Operator: allow to choose time stepping method

Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>
pull/1/head
Thorsten Liebig 2013-03-27 11:58:24 +01:00
parent 6016a10fc2
commit 816553fc34
3 changed files with 8 additions and 0 deletions

View File

@ -81,6 +81,9 @@ public:
virtual void SetTimestepFactor(double factor);
bool GetTimestepValid() const {return !m_InvaildTimestep;}
//! Choose a time step method (0=auto, 1=CFL, 3=Rennings)
void SetTimeStepMethod(int var) {m_TimeStepVar=var;}
//! Set operator to assume a constant material inside a cell (material probing in the cell center)
void SetCellConstantMaterial() {m_MatCellShiftFaktor=0.5;}

View File

@ -12,6 +12,7 @@ function FDTD = InitFDTD(varargin)
% CoordSystem: choose coordinate system (0 Cartesian, 1 Cylindrical)
% TimeStep: force to use a given timestep (dangerous!)
% TimeStepFactor: reduce the timestep by a given factor (>0 to <=1)
% TimeStepMethod: 1 or 3 chose timestep method (1=CFL, 3=Rennigs (default))
% CellConstantMaterial: set to 1 to assume a material is constant inside
% a cell (material probing in cell center)
%

View File

@ -666,6 +666,10 @@ int openEMS::SetupFDTD(const char* file)
SetupBoundaryConditions(BC);
int TS_method=0;
if (FDTD_Opts->QueryIntAttribute("TimeStepMethod",&TS_method)==TIXML_SUCCESS)
FDTD_Op->SetTimeStepMethod(TS_method);
double timestep=0;
FDTD_Opts->QueryDoubleAttribute("TimeStep",&timestep);
if (timestep)