fix wrong time step for cylinder mesh with r=0

Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>
This commit is contained in:
Thorsten Liebig 2016-02-18 22:58:07 +01:00
parent bb6483fd73
commit add2f2decb
2 changed files with 10 additions and 4 deletions

View File

@ -88,6 +88,15 @@ int Operator_Cylinder::CalcECOperator( DebugFlags debugFlags )
return rc;
}
double Operator_Cylinder::CalcTimestep()
{
if (discLines[0][0]==0.0)
// use conservative timestep for a mesh including the r==0 singularity
m_TimeStepVar = 1;
return Operator::CalcTimestep();
}
inline unsigned int Operator_Cylinder::GetNumberOfLines(int ny, bool full) const
{
if (full)
@ -493,9 +502,6 @@ bool Operator_Cylinder::SetupCSXGrid(CSRectGrid* grid)
if (g_settings.GetVerboseLevel()>0)
cout << "Operator_Cylinder::SetupCSXGrid: r=0 included..." << endl;
CC_R0_included = CC_closedAlpha; //needed for correct ec-calculation, deactivate if closed cylinder is false... --> E_r = 0 anyways
// use conservative timestep for a mesh including the r==0 singularity
m_TimeStepVar = 1;
}
#ifdef MPI_SUPPORT

View File

@ -105,7 +105,7 @@ protected:
virtual double GetMaterial(int ny, const double coords[3], int MatType, vector<CSPrimitives*> vPrims, bool markAsUsed=true) const;
virtual int CalcECOperator( DebugFlags debugFlags = None );
virtual double CalcTimestep();
bool CC_closedAlpha;
bool CC_R0_included;
Operator_Ext_Cylinder* m_Cyl_Ext;