bug fix in operator resetting and (Re)InitExcitation
This commit is contained in:
parent
ea71dce1c3
commit
0fe63823d0
@ -63,7 +63,43 @@ Excitation::~Excitation()
|
|||||||
delete[] Volt_index[n];
|
delete[] Volt_index[n];
|
||||||
delete[] Curr_index[n];
|
delete[] Curr_index[n];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Excitation::Reset( double timestep )
|
||||||
|
{
|
||||||
|
delete[] Signal_volt;
|
||||||
|
Signal_volt = 0;
|
||||||
|
delete[] Signal_curr;
|
||||||
|
Signal_curr = 0;
|
||||||
|
delete[] Volt_delay;
|
||||||
|
Volt_delay = 0;
|
||||||
|
delete[] Volt_dir;
|
||||||
|
Volt_dir = 0;
|
||||||
|
delete[] Volt_amp;
|
||||||
|
Volt_amp = 0;
|
||||||
|
delete[] Curr_delay;
|
||||||
|
Curr_delay = 0;
|
||||||
|
delete[] Curr_dir;
|
||||||
|
Curr_dir = 0;
|
||||||
|
delete[] Curr_amp;
|
||||||
|
Curr_amp = 0;
|
||||||
|
|
||||||
|
Volt_Count = 0;
|
||||||
|
Curr_Count = 0;
|
||||||
|
|
||||||
|
for (int n=0; n<3; ++n)
|
||||||
|
{
|
||||||
|
delete[] Volt_index[n];
|
||||||
|
Volt_index[n] = 0;
|
||||||
|
delete[] Curr_index[n];
|
||||||
|
Curr_index[n] = 0;
|
||||||
|
|
||||||
|
Volt_Count_Dir[n] = 0;
|
||||||
|
Curr_Count_Dir[n] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
dT = timestep;
|
||||||
|
m_nyquistTS = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Excitation::setupExcitation( TiXmlElement* Excite, unsigned int maxTS )
|
bool Excitation::setupExcitation( TiXmlElement* Excite, unsigned int maxTS )
|
||||||
|
@ -30,6 +30,8 @@ public:
|
|||||||
Excitation( double timestep );
|
Excitation( double timestep );
|
||||||
virtual ~Excitation();
|
virtual ~Excitation();
|
||||||
|
|
||||||
|
virtual void Reset( double timestep );
|
||||||
|
|
||||||
bool setupExcitation( TiXmlElement* Excite, unsigned int maxTS );
|
bool setupExcitation( TiXmlElement* Excite, unsigned int maxTS );
|
||||||
|
|
||||||
//! Get the excitation timestep with the (first) max amplitude
|
//! Get the excitation timestep with the (first) max amplitude
|
||||||
|
@ -803,10 +803,13 @@ double Operator::GetDiscMaterial(int type, int n, const unsigned int pos[3]) con
|
|||||||
|
|
||||||
void Operator::InitExcitation()
|
void Operator::InitExcitation()
|
||||||
{
|
{
|
||||||
delete Exc;
|
if (Exc!=NULL)
|
||||||
Exc = new Excitation( dT );
|
Exc->Reset(dT);
|
||||||
|
else
|
||||||
this->AddExtension(new Operator_Ext_Excitation(this,Exc));
|
{
|
||||||
|
Exc = new Excitation( dT );
|
||||||
|
this->AddExtension(new Operator_Ext_Excitation(this,Exc));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Operator::Calc_ECOperatorPos(int n, unsigned int* pos)
|
void Operator::Calc_ECOperatorPos(int n, unsigned int* pos)
|
||||||
|
Loading…
Reference in New Issue
Block a user