operator: set a forced timestep
parent
e081a9cf94
commit
594b38e345
|
@ -35,6 +35,7 @@ Operator::Operator()
|
|||
{
|
||||
m_MeshType = ProcessFields::CARTESIAN_MESH;
|
||||
Exc = 0;
|
||||
dT = 0;
|
||||
}
|
||||
|
||||
Operator::~Operator()
|
||||
|
@ -77,6 +78,7 @@ void Operator::Init()
|
|||
m_BC[n]=0;
|
||||
|
||||
Exc = 0;
|
||||
dT = 0;
|
||||
}
|
||||
|
||||
void Operator::Reset()
|
||||
|
@ -531,6 +533,15 @@ int Operator::CalcECOperator()
|
|||
if (Calc_EC()==0)
|
||||
return -1;
|
||||
|
||||
if (dT>0)
|
||||
{
|
||||
double save_dT = dT;
|
||||
CalcTimestep();
|
||||
if (dT<save_dT)
|
||||
cerr << "Operator::CalcECOperator: Warning, forced timestep: " << save_dT << "s is larger than calculated timestep: " << dT << "s! It is not recommended using this timestep!! " << endl;
|
||||
dT = save_dT;
|
||||
}
|
||||
else
|
||||
CalcTimestep();
|
||||
|
||||
InitOperator();
|
||||
|
|
|
@ -54,6 +54,8 @@ public:
|
|||
virtual void ApplyElectricBC(bool* dirs); //applied by default to all boundaries
|
||||
virtual void ApplyMagneticBC(bool* dirs);
|
||||
|
||||
//! Set a forced timestep to use by the operator
|
||||
virtual void SetTimestep(double ts) {dT = ts;}
|
||||
double GetTimestep() const {return dT;};
|
||||
double GetNumberCells() const;
|
||||
|
||||
|
|
Loading…
Reference in New Issue