Nektar++
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
Nektar::SolverUtils::UnsteadySystem Class Reference

Base class for unsteady solvers. More...

#include <UnsteadySystem.h>

Inheritance diagram for Nektar::SolverUtils::UnsteadySystem:
[legend]

Public Member Functions

virtual SOLVER_UTILS_EXPORT ~UnsteadySystem ()
 Destructor. More...
 
SOLVER_UTILS_EXPORT NekDouble GetTimeStep (const Array< OneD, const Array< OneD, NekDouble >> &inarray)
 Calculate the larger time-step mantaining the problem stable. More...
 
SOLVER_UTILS_EXPORT void SteadyStateResidual (int step, Array< OneD, NekDouble > &L2)
 
- Public Member Functions inherited from Nektar::SolverUtils::EquationSystem
virtual SOLVER_UTILS_EXPORT ~EquationSystem ()
 Destructor. More...
 
SOLVER_UTILS_EXPORT void SetUpTraceNormals (void)
 
SOLVER_UTILS_EXPORT void InitObject ()
 Initialises the members of this object. More...
 
SOLVER_UTILS_EXPORT void DoInitialise ()
 Perform any initialisation necessary before solving the problem. More...
 
SOLVER_UTILS_EXPORT void DoSolve ()
 Solve the problem. More...
 
SOLVER_UTILS_EXPORT void TransCoeffToPhys ()
 Transform from coefficient to physical space. More...
 
SOLVER_UTILS_EXPORT void TransPhysToCoeff ()
 Transform from physical to coefficient space. More...
 
SOLVER_UTILS_EXPORT void Output ()
 Perform output operations after solve. More...
 
SOLVER_UTILS_EXPORT NekDouble LinfError (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray)
 Linf error computation. More...
 
SOLVER_UTILS_EXPORT std::string GetSessionName ()
 Get Session name. More...
 
template<class T >
std::shared_ptr< T > as ()
 
SOLVER_UTILS_EXPORT void ResetSessionName (std::string newname)
 Reset Session name. More...
 
SOLVER_UTILS_EXPORT LibUtilities::SessionReaderSharedPtr GetSession ()
 Get Session name. More...
 
SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr GetPressure ()
 Get pressure field if available. More...
 
SOLVER_UTILS_EXPORT void ExtraFldOutput (std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 
SOLVER_UTILS_EXPORT void PrintSummary (std::ostream &out)
 Print a summary of parameters and solver characteristics. More...
 
SOLVER_UTILS_EXPORT void SetLambda (NekDouble lambda)
 Set parameter m_lambda. More...
 
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction (std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
 Get a SessionFunction by name. More...
 
SOLVER_UTILS_EXPORT void SetInitialConditions (NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
 Initialise the data in the dependent fields. More...
 
SOLVER_UTILS_EXPORT void EvaluateExactSolution (int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
 Evaluates an exact solution. More...
 
SOLVER_UTILS_EXPORT NekDouble L2Error (unsigned int field, const Array< OneD, NekDouble > &exactsoln, bool Normalised=false)
 Compute the L2 error between fields and a given exact solution. More...
 
SOLVER_UTILS_EXPORT NekDouble L2Error (unsigned int field, bool Normalised=false)
 Compute the L2 error of the fields. More...
 
SOLVER_UTILS_EXPORT Array< OneD, NekDoubleErrorExtraPoints (unsigned int field)
 Compute error (L2 and L_inf) over an larger set of quadrature points return [L2 Linf]. More...
 
SOLVER_UTILS_EXPORT void Checkpoint_Output (const int n)
 Write checkpoint file of m_fields. More...
 
SOLVER_UTILS_EXPORT void Checkpoint_Output (const int n, MultiRegions::ExpListSharedPtr &field, std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 Write checkpoint file of custom data fields. More...
 
SOLVER_UTILS_EXPORT void Checkpoint_BaseFlow (const int n)
 Write base flow file of m_fields. More...
 
SOLVER_UTILS_EXPORT void WriteFld (const std::string &outname)
 Write field data to the given filename. More...
 
SOLVER_UTILS_EXPORT void WriteFld (const std::string &outname, MultiRegions::ExpListSharedPtr &field, std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 Write input fields to the given filename. More...
 
SOLVER_UTILS_EXPORT void ImportFld (const std::string &infile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
 Input field data from the given file. More...
 
SOLVER_UTILS_EXPORT void ImportFldToMultiDomains (const std::string &infile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const int ndomains)
 Input field data from the given file to multiple domains. More...
 
SOLVER_UTILS_EXPORT void ImportFld (const std::string &infile, std::vector< std::string > &fieldStr, Array< OneD, Array< OneD, NekDouble > > &coeffs)
 Output a field. Input field data into array from the given file. More...
 
SOLVER_UTILS_EXPORT void ImportFld (const std::string &infile, MultiRegions::ExpListSharedPtr &pField, std::string &pFieldName)
 Output a field. Input field data into ExpList from the given file. More...
 
SOLVER_UTILS_EXPORT void SessionSummary (SummaryList &vSummary)
 Write out a session summary. More...
 
SOLVER_UTILS_EXPORT Array< OneD, MultiRegions::ExpListSharedPtr > & UpdateFields ()
 
SOLVER_UTILS_EXPORT LibUtilities::FieldMetaDataMapUpdateFieldMetaDataMap ()
 Get hold of FieldInfoMap so it can be updated. More...
 
SOLVER_UTILS_EXPORT NekDouble GetFinalTime ()
 Return final time. More...
 
SOLVER_UTILS_EXPORT int GetNcoeffs ()
 
SOLVER_UTILS_EXPORT int GetNcoeffs (const int eid)
 
SOLVER_UTILS_EXPORT int GetNumExpModes ()
 
SOLVER_UTILS_EXPORT const Array< OneD, int > GetNumExpModesPerExp ()
 
SOLVER_UTILS_EXPORT int GetNvariables ()
 
SOLVER_UTILS_EXPORT const std::string GetVariable (unsigned int i)
 
SOLVER_UTILS_EXPORT int GetTraceTotPoints ()
 
SOLVER_UTILS_EXPORT int GetTraceNpoints ()
 
SOLVER_UTILS_EXPORT int GetExpSize ()
 
SOLVER_UTILS_EXPORT int GetPhys_Offset (int n)
 
SOLVER_UTILS_EXPORT int GetCoeff_Offset (int n)
 
SOLVER_UTILS_EXPORT int GetTotPoints ()
 
SOLVER_UTILS_EXPORT int GetTotPoints (int n)
 
SOLVER_UTILS_EXPORT int GetNpoints ()
 
SOLVER_UTILS_EXPORT int GetSteps ()
 
SOLVER_UTILS_EXPORT NekDouble GetTimeStep ()
 
SOLVER_UTILS_EXPORT void CopyFromPhysField (const int i, Array< OneD, NekDouble > &output)
 
SOLVER_UTILS_EXPORT void CopyToPhysField (const int i, Array< OneD, NekDouble > &output)
 
SOLVER_UTILS_EXPORT void SetSteps (const int steps)
 
SOLVER_UTILS_EXPORT void ZeroPhysFields ()
 
SOLVER_UTILS_EXPORT void FwdTransFields ()
 
SOLVER_UTILS_EXPORT void SetModifiedBasis (const bool modbasis)
 
SOLVER_UTILS_EXPORT int GetCheckpointNumber ()
 
SOLVER_UTILS_EXPORT void SetCheckpointNumber (int num)
 
SOLVER_UTILS_EXPORT int GetCheckpointSteps ()
 
SOLVER_UTILS_EXPORT void SetCheckpointSteps (int num)
 
SOLVER_UTILS_EXPORT void SetTime (const NekDouble time)
 
SOLVER_UTILS_EXPORT void SetInitialStep (const int step)
 
SOLVER_UTILS_EXPORT void SetBoundaryConditions (NekDouble time)
 Evaluates the boundary conditions at the given time. More...
 
virtual SOLVER_UTILS_EXPORT bool v_NegatedOp ()
 Virtual function to identify if operator is negated in DoSolve. More...
 

Public Attributes

NekDouble m_cflSafetyFactor
 CFL safety factor (comprise between 0 to 1). More...
 
NekDouble m_cflNonAcoustic
 
NekDouble m_CFLGrowth
 CFL growth rate. More...
 
NekDouble m_CFLEnd
 maximun cfl in cfl growth More...
 

Protected Member Functions

SOLVER_UTILS_EXPORT UnsteadySystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Initialises UnsteadySystem class members. More...
 
virtual SOLVER_UTILS_EXPORT void v_InitObject ()
 Init object for UnsteadySystem class. More...
 
SOLVER_UTILS_EXPORT NekDouble MaxTimeStepEstimator ()
 Get the maximum timestep estimator for cfl control. More...
 
virtual SOLVER_UTILS_EXPORT void v_DoSolve ()
 Solves an unsteady problem. More...
 
virtual SOLVER_UTILS_EXPORT void v_DoInitialise ()
 Sets up initial conditions. More...
 
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary (SummaryList &s)
 Print a summary of time stepping parameters. More...
 
virtual SOLVER_UTILS_EXPORT void v_AppendOutput1D (Array< OneD, Array< OneD, NekDouble >> &solution1D)
 Print the solution at each solution point in a txt file. More...
 
virtual SOLVER_UTILS_EXPORT NekDouble v_GetTimeStep (const Array< OneD, const Array< OneD, NekDouble >> &inarray)
 Return the timestep to be used for the next step in the time-marching loop. More...
 
virtual SOLVER_UTILS_EXPORT bool v_PreIntegrate (int step)
 
virtual SOLVER_UTILS_EXPORT bool v_PostIntegrate (int step)
 
virtual SOLVER_UTILS_EXPORT bool v_RequireFwdTrans ()
 
virtual SOLVER_UTILS_EXPORT void v_SteadyStateResidual (int step, Array< OneD, NekDouble > &L2)
 
SOLVER_UTILS_EXPORT void CheckForRestartTime (NekDouble &time, int &nchk)
 
SOLVER_UTILS_EXPORT void SVVVarDiffCoeff (const Array< OneD, Array< OneD, NekDouble >> vel, StdRegions::VarCoeffMap &varCoeffMap)
 Evaluate the SVV diffusion coefficient according to Moura's paper where it should proportional to h time velocity. More...
 
virtual SOLVER_UTILS_EXPORT bool UpdateTimeStepCheck ()
 
- Protected Member Functions inherited from Nektar::SolverUtils::EquationSystem
SOLVER_UTILS_EXPORT EquationSystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Initialises EquationSystem class members. More...
 
virtual SOLVER_UTILS_EXPORT NekDouble v_LinfError (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray)
 Virtual function for the L_inf error computation between fields and a given exact solution. More...
 
virtual SOLVER_UTILS_EXPORT NekDouble v_L2Error (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray, bool Normalised=false)
 Virtual function for the L_2 error computation between fields and a given exact solution. More...
 
virtual SOLVER_UTILS_EXPORT void v_TransCoeffToPhys ()
 Virtual function for transformation to physical space. More...
 
virtual SOLVER_UTILS_EXPORT void v_TransPhysToCoeff ()
 Virtual function for transformation to coefficient space. More...
 
virtual SOLVER_UTILS_EXPORT void v_SetInitialConditions (NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
 
virtual SOLVER_UTILS_EXPORT void v_EvaluateExactSolution (unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
 
virtual SOLVER_UTILS_EXPORT void v_Output (void)
 
virtual SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr v_GetPressure (void)
 
virtual SOLVER_UTILS_EXPORT void v_ExtraFldOutput (std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 

Protected Attributes

int m_infosteps
 Number of time steps between outputting status information. More...
 
int m_abortSteps
 Number of steps between checks for abort conditions. More...
 
int m_filtersInfosteps
 Number of time steps between outputting filters information. More...
 
int m_nanSteps
 
LibUtilities::TimeIntegrationSchemeSharedPtr m_intScheme
 Wrapper to the time integration scheme. More...
 
LibUtilities::TimeIntegrationSchemeOperators m_ode
 The time integration scheme operators to use. More...
 
NekDouble m_epsilon
 
bool m_explicitDiffusion
 Indicates if explicit or implicit treatment of diffusion is used. More...
 
bool m_explicitAdvection
 Indicates if explicit or implicit treatment of advection is used. More...
 
bool m_explicitReaction
 Indicates if explicit or implicit treatment of reaction is used. More...
 
bool m_homoInitialFwd
 Flag to determine if simulation should start in homogeneous forward transformed state. More...
 
NekDouble m_steadyStateTol
 Tolerance to which steady state should be evaluated at. More...
 
int m_steadyStateSteps
 Check for steady state at step interval. More...
 
NekDouble m_steadyStateRes = 1.0
 
NekDouble m_steadyStateRes0 = 1.0
 
Array< OneD, Array< OneD, NekDouble > > m_previousSolution
 Storage for previous solution for steady-state check. More...
 
std::ofstream m_errFile
 
std::vector< int > m_intVariables
 
std::vector< std::pair< std::string, FilterSharedPtr > > m_filters
 
NekDouble m_filterTimeWarning
 Number of time steps between outputting status information. More...
 
NekDouble m_TimeIntegLambda =0.0
 coefff of spacial derivatives(rhs or m_F in GLM) in calculating the residual of the whole equation(used in unsteady time integrations) More...
 
bool m_flagImplicitItsStatistics
 
bool m_flagImplicitSolver = false
 
Array< OneD, NekDoublem_magnitdEstimat
 estimate the magnitude of each conserved varibles More...
 
Array< OneD, NekDoublem_locTimeStep
 local time step(notice only for jfnk other see m_cflSafetyFactor) More...
 
NekDouble m_inArrayNorm =-1.0
 
int m_TotLinItePerStep =0
 
int m_StagesPerStep =1
 
bool m_flagUpdatePreconMat
 
int m_maxLinItePerNewton
 
int m_TotNewtonIts =0
 
int m_TotLinIts =0
 
int m_TotImpStages =0
 
bool m_CalcPhysicalAV = true
 flag to update artificial viscosity More...
 
- Protected Attributes inherited from Nektar::SolverUtils::EquationSystem
LibUtilities::CommSharedPtr m_comm
 Communicator. More...
 
bool m_verbose
 
bool m_root
 
LibUtilities::SessionReaderSharedPtr m_session
 The session reader. More...
 
std::map< std::string, SolverUtils::SessionFunctionSharedPtrm_sessionFunctions
 Map of known SessionFunctions. More...
 
LibUtilities::FieldIOSharedPtr m_fld
 Field input/output. More...
 
Array< OneD, MultiRegions::ExpListSharedPtrm_fields
 Array holding all dependent variables. More...
 
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
 Pointer to boundary conditions object. More...
 
SpatialDomains::MeshGraphSharedPtr m_graph
 Pointer to graph defining mesh. More...
 
std::string m_sessionName
 Name of the session. More...
 
NekDouble m_time
 Current time of simulation. More...
 
int m_initialStep
 Number of the step where the simulation should begin. More...
 
NekDouble m_fintime
 Finish time of the simulation. More...
 
NekDouble m_timestep
 Time step size. More...
 
NekDouble m_timestepMax = -1.0
 Time step size. More...
 
NekDouble m_lambda
 Lambda constant in real system if one required. More...
 
NekDouble m_checktime
 Time between checkpoints. More...
 
NekDouble m_lastCheckTime
 
NekDouble m_TimeIncrementFactor
 
int m_nchk
 Number of checkpoints written so far. More...
 
int m_steps
 Number of steps to take. More...
 
int m_checksteps
 Number of steps between checkpoints. More...
 
int m_spacedim
 Spatial dimension (>= expansion dim). More...
 
int m_expdim
 Expansion dimension. More...
 
bool m_singleMode
 Flag to determine if single homogeneous mode is used. More...
 
bool m_halfMode
 Flag to determine if half homogeneous mode is used. More...
 
bool m_multipleModes
 Flag to determine if use multiple homogenenous modes are used. More...
 
bool m_useFFT
 Flag to determine if FFT is used for homogeneous transform. More...
 
bool m_homogen_dealiasing
 Flag to determine if dealiasing is used for homogeneous simulations. More...
 
bool m_specHP_dealiasing
 Flag to determine if dealisising is usde for the Spectral/hp element discretisation. More...
 
enum MultiRegions::ProjectionType m_projectionType
 Type of projection; e.g continuous or discontinuous. More...
 
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
 Array holding trace normals for DG simulations in the forwards direction. More...
 
Array< OneD, bool > m_checkIfSystemSingular
 Flag to indicate if the fields should be checked for singularity. More...
 
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
 Map to identify relevant solver info to dump in output fields. More...
 
int m_NumQuadPointsError
 Number of Quadrature points used to work out the error. More...
 
enum HomogeneousType m_HomogeneousType
 
NekDouble m_LhomX
 physical length in X direction (if homogeneous) More...
 
NekDouble m_LhomY
 physical length in Y direction (if homogeneous) More...
 
NekDouble m_LhomZ
 physical length in Z direction (if homogeneous) More...
 
int m_npointsX
 number of points in X direction (if homogeneous) More...
 
int m_npointsY
 number of points in Y direction (if homogeneous) More...
 
int m_npointsZ
 number of points in Z direction (if homogeneous) More...
 
int m_HomoDirec
 number of homogenous directions More...
 

Private Member Functions

void InitializeSteadyState ()
 
bool CheckSteadyState (int step)
 Calculate whether the system has reached a steady state by observing residuals to a user-defined tolerance. More...
 
bool CheckSteadyState (int step, NekDouble totCPUTime)
 

Additional Inherited Members

- Protected Types inherited from Nektar::SolverUtils::EquationSystem
enum  HomogeneousType { eHomogeneous1D , eHomogeneous2D , eHomogeneous3D , eNotHomogeneous }
 Parameter for homogeneous expansions. More...
 
- Static Protected Attributes inherited from Nektar::SolverUtils::EquationSystem
static std::string equationSystemTypeLookupIds []
 

Detailed Description

Base class for unsteady solvers.

Provides the underlying timestepping framework for unsteady solvers including the general timestepping routines. This class is not intended to be directly instantiated, but rather is a base class on which to define unsteady solvers.

For details on implementing unsteady solvers see sectionADRSolverModuleImplementation here

Definition at line 48 of file UnsteadySystem.h.

Constructor & Destructor Documentation

◆ ~UnsteadySystem()

Nektar::SolverUtils::UnsteadySystem::~UnsteadySystem ( )
virtual

Destructor.

Destructor for the class UnsteadyAdvection.

Definition at line 184 of file UnsteadySystem.cpp.

185  {
186  }

◆ UnsteadySystem()

Nektar::SolverUtils::UnsteadySystem::UnsteadySystem ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr pGraph 
)
protected

Initialises UnsteadySystem class members.

Processes SolverInfo parameters from the session file and sets up timestepping-specific code.

Parameters
pSessionSession object to read parameters from.

Definition at line 69 of file UnsteadySystem.cpp.

72  : EquationSystem(pSession, pGraph),
73  m_infosteps(10)
74 
75  {
76  }
SOLVER_UTILS_EXPORT EquationSystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Initialises EquationSystem class members.
int m_infosteps
Number of time steps between outputting status information.

Member Function Documentation

◆ CheckForRestartTime()

void Nektar::SolverUtils::UnsteadySystem::CheckForRestartTime ( NekDouble time,
int &  nchk 
)
protected

Definition at line 662 of file UnsteadySystem.cpp.

663  {
664  if (m_session->DefinesFunction("InitialConditions"))
665  {
666  for (int i = 0; i < m_fields.size(); ++i)
667  {
669 
670  vType = m_session->GetFunctionType(
671  "InitialConditions", m_session->GetVariable(i));
672 
673  if (vType == LibUtilities::eFunctionTypeFile)
674  {
675  std::string filename
676  = m_session->GetFunctionFilename(
677  "InitialConditions", m_session->GetVariable(i));
678 
679  fs::path pfilename(filename);
680 
681  // redefine path for parallel file which is in directory
682  if(fs::is_directory(pfilename))
683  {
684  fs::path metafile("Info.xml");
685  fs::path fullpath = pfilename / metafile;
686  filename = LibUtilities::PortablePath(fullpath);
687  }
690  m_session, filename);
691  fld->ImportFieldMetaData(filename, m_fieldMetaDataMap);
692 
693  // check to see if time defined
694  if (m_fieldMetaDataMap !=
696  {
697  auto iter = m_fieldMetaDataMap.find("Time");
698  if (iter != m_fieldMetaDataMap.end())
699  {
700  time = boost::lexical_cast<NekDouble>(
701  iter->second);
702  }
703 
704  iter = m_fieldMetaDataMap.find("ChkFileNum");
705  if (iter != m_fieldMetaDataMap.end())
706  {
707  nchk = boost::lexical_cast<NekDouble>(
708  iter->second);
709  }
710  }
711 
712  break;
713  }
714  }
715  }
716  }
static std::shared_ptr< FieldIO > CreateForFile(const LibUtilities::SessionReaderSharedPtr session, const std::string &filename)
Construct a FieldIO object for a given input filename.
Definition: FieldIO.cpp:226
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
Map to identify relevant solver info to dump in output fields.
std::shared_ptr< FieldIO > FieldIOSharedPtr
Definition: FieldIO.h:306
std::string PortablePath(const boost::filesystem::path &path)
create portable path on different platforms for boost::filesystem path
Definition: FileSystem.cpp:41
static FieldMetaDataMap NullFieldMetaDataMap
Definition: FieldIO.h:53

References Nektar::LibUtilities::FieldIO::CreateForFile(), Nektar::LibUtilities::eFunctionTypeFile, Nektar::SolverUtils::EquationSystem::m_fieldMetaDataMap, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_session, Nektar::LibUtilities::NullFieldMetaDataMap, and Nektar::LibUtilities::PortablePath().

Referenced by v_DoInitialise().

◆ CheckSteadyState() [1/2]

bool Nektar::SolverUtils::UnsteadySystem::CheckSteadyState ( int  step)
private

Calculate whether the system has reached a steady state by observing residuals to a user-defined tolerance.

Definition at line 839 of file UnsteadySystem.cpp.

840  {
841  return CheckSteadyState(step,0.0);
842  }
bool CheckSteadyState(int step)
Calculate whether the system has reached a steady state by observing residuals to a user-defined tole...

Referenced by v_DoSolve().

◆ CheckSteadyState() [2/2]

bool Nektar::SolverUtils::UnsteadySystem::CheckSteadyState ( int  step,
NekDouble  totCPUTime 
)
private

Definition at line 844 of file UnsteadySystem.cpp.

845  {
846  const int nPoints = GetTotPoints();
847  const int nFields = m_fields.size();
848 
849  // Holds L2 errors.
850  Array<OneD, NekDouble> L2 (nFields);
851 
852  SteadyStateResidual(step, L2);
853 
854  if (m_comm->GetRank() == 0 && ( ((step+1) % m_infosteps == 0)||((step== m_initialStep)) ))
855  {
856  // Output time
857  m_errFile << boost::format("%25.19e") % m_time;
858 
859  m_errFile << " "<< boost::format("%25.19e") % totCPUTime;
860 
861  int stepp = step +1;
862 
863  m_errFile << " "<< boost::format("%25.19e") % stepp;
864 
865  // Output residuals
866  for (int i = 0; i < nFields; ++i)
867  {
868  m_errFile << " " << boost::format("%25.19e") % L2[i];
869  }
870 
871  m_errFile << endl;
872  }
873 
874  // Calculate maximum L2 error
875  NekDouble maxL2 = Vmath::Vmax(nFields, L2, 1);
876 
877  if (m_session->DefinesCmdLineArgument("verbose") &&
878  m_comm->GetRank() == 0 && ((step+1) % m_infosteps == 0))
879  {
880  cout << "-- Maximum L^2 residual: " << maxL2 << endl;
881  }
882 
883  if (maxL2 <= m_steadyStateTol)
884  {
885  return true;
886  }
887 
888  for (int i = 0; i < m_fields.size(); ++i)
889  {
890  Vmath::Vcopy(nPoints, m_fields[i]->GetPhys(), 1,
891  m_previousSolution[i], 1);
892  }
893 
895  m_steadyStateRes = maxL2;
896 
897  return false;
898  }
LibUtilities::CommSharedPtr m_comm
Communicator.
NekDouble m_time
Current time of simulation.
int m_initialStep
Number of the step where the simulation should begin.
SOLVER_UTILS_EXPORT int GetTotPoints()
Array< OneD, Array< OneD, NekDouble > > m_previousSolution
Storage for previous solution for steady-state check.
NekDouble m_steadyStateTol
Tolerance to which steady state should be evaluated at.
SOLVER_UTILS_EXPORT void SteadyStateResidual(int step, Array< OneD, NekDouble > &L2)
double NekDouble
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
Definition: Vmath.cpp:892
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1199

References CellMLToNektar.pycml::format, Nektar::SolverUtils::EquationSystem::GetTotPoints(), Nektar::SolverUtils::EquationSystem::m_comm, m_errFile, Nektar::SolverUtils::EquationSystem::m_fields, m_infosteps, Nektar::SolverUtils::EquationSystem::m_initialStep, m_previousSolution, Nektar::SolverUtils::EquationSystem::m_session, m_steadyStateRes, m_steadyStateRes0, m_steadyStateTol, Nektar::SolverUtils::EquationSystem::m_time, SteadyStateResidual(), Vmath::Vcopy(), and Vmath::Vmax().

◆ GetTimeStep()

NekDouble Nektar::SolverUtils::UnsteadySystem::GetTimeStep ( const Array< OneD, const Array< OneD, NekDouble >> &  inarray)

Calculate the larger time-step mantaining the problem stable.

Return the timestep to be used for the next step in the time-marching loop.

This function can be overloaded to facilitate solver which utilise a CFL (or other) parameter to determine a maximum timestep under which the problem remains stable.

Definition at line 726 of file UnsteadySystem.cpp.

728  {
729  return v_GetTimeStep(inarray);
730  }
virtual SOLVER_UTILS_EXPORT NekDouble v_GetTimeStep(const Array< OneD, const Array< OneD, NekDouble >> &inarray)
Return the timestep to be used for the next step in the time-marching loop.

References v_GetTimeStep().

◆ InitializeSteadyState()

void Nektar::SolverUtils::UnsteadySystem::InitializeSteadyState ( )
private

Definition at line 799 of file UnsteadySystem.cpp.

800  {
801  if (m_steadyStateTol > 0.0)
802  {
803  const int nPoints = m_fields[0]->GetTotPoints();
804  m_previousSolution = Array<OneD, Array<OneD, NekDouble> > (
805  m_fields.size());
806 
807  for (int i = 0; i < m_fields.size(); ++i)
808  {
809  m_previousSolution[i] = Array<OneD, NekDouble>(nPoints);
810  Vmath::Vcopy(nPoints, m_fields[i]->GetPhys(), 1,
811  m_previousSolution[i], 1);
812  }
813 
814  if (m_comm->GetRank() == 0)
815  {
816  std::string fName = m_session->GetSessionName() +
817  std::string(".resd");
818  m_errFile.open(fName.c_str());
819  m_errFile << setw(26) << left << "# Time";
820 
821  m_errFile << setw(26) << left << "CPU_Time";
822 
823  m_errFile << setw(26) << left << "Step";
824 
825  for (int i = 0; i < m_fields.size(); ++i)
826  {
827  m_errFile << setw(26) << m_session->GetVariables()[i];
828  }
829 
830  m_errFile << endl;
831  }
832  }
833  }

References Nektar::SolverUtils::EquationSystem::m_comm, m_errFile, Nektar::SolverUtils::EquationSystem::m_fields, m_previousSolution, Nektar::SolverUtils::EquationSystem::m_session, m_steadyStateTol, and Vmath::Vcopy().

Referenced by v_DoInitialise().

◆ MaxTimeStepEstimator()

NekDouble Nektar::SolverUtils::UnsteadySystem::MaxTimeStepEstimator ( )
protected

Get the maximum timestep estimator for cfl control.

Returns the maximum time estimator for CFL control.

Definition at line 191 of file UnsteadySystem.cpp.

192  {
193  return m_intScheme->GetTimeStability();
194  }
LibUtilities::TimeIntegrationSchemeSharedPtr m_intScheme
Wrapper to the time integration scheme.

References m_intScheme.

Referenced by Nektar::CompressibleFlowSystem::GetElmtTimeStep().

◆ SteadyStateResidual()

SOLVER_UTILS_EXPORT void Nektar::SolverUtils::UnsteadySystem::SteadyStateResidual ( int  step,
Array< OneD, NekDouble > &  L2 
)
inline

Definition at line 58 of file UnsteadySystem.h.

61  {
62  v_SteadyStateResidual(step,L2);
63  }
virtual SOLVER_UTILS_EXPORT void v_SteadyStateResidual(int step, Array< OneD, NekDouble > &L2)

References v_SteadyStateResidual().

Referenced by CheckSteadyState().

◆ SVVVarDiffCoeff()

void Nektar::SolverUtils::UnsteadySystem::SVVVarDiffCoeff ( const Array< OneD, Array< OneD, NekDouble >>  vel,
StdRegions::VarCoeffMap varCoeffMap 
)
protected

Evaluate the SVV diffusion coefficient according to Moura's paper where it should proportional to h time velocity.

Definition at line 758 of file UnsteadySystem.cpp.

761  {
762  int phystot = m_fields[0]->GetTotPoints();
763  int nvel = vel.size();
764 
765  Array<OneD, NekDouble> varcoeff(phystot),tmp;
766 
767  // calculate magnitude of v
768  Vmath::Vmul(phystot,vel[0],1,vel[0],1,varcoeff,1);
769  for(int n = 1; n < nvel; ++n)
770  {
771  Vmath::Vvtvp(phystot,vel[n],1,vel[n],1,varcoeff,1,varcoeff,1);
772  }
773  Vmath::Vsqrt(phystot,varcoeff,1,varcoeff,1);
774 
775  for(int i = 0; i < m_fields[0]->GetNumElmts(); ++i)
776  {
777  int offset = m_fields[0]->GetPhys_Offset(i);
778  int nq = m_fields[0]->GetExp(i)->GetTotPoints();
779  Array<OneD, NekDouble> unit(nq,1.0);
780 
781  int nmodes = 0;
782 
783  for(int n = 0; n < m_fields[0]->GetExp(i)->GetNumBases(); ++n)
784  {
785  nmodes = max(nmodes,
786  m_fields[0]->GetExp(i)->GetBasisNumModes(n));
787  }
788 
789  NekDouble h = m_fields[0]->GetExp(i)->Integral(unit);
790  h = pow(h,(NekDouble) (1.0/nvel))/((NekDouble) nmodes);
791 
792  Vmath::Smul(nq,h,varcoeff+offset,1,tmp = varcoeff+offset,1);
793  }
794 
795  // set up map with eVarCoffLaplacian key
796  varCoeffMap[StdRegions::eVarCoeffLaplacian] = varcoeff;
797  }
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
Definition: Vmath.cpp:475
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:192
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:513
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.cpp:225

References Nektar::StdRegions::eVarCoeffLaplacian, Nektar::SolverUtils::EquationSystem::m_fields, Vmath::Smul(), Vmath::Vmul(), Vmath::Vsqrt(), and Vmath::Vvtvp().

Referenced by Nektar::UnsteadyViscousBurgers::DoImplicitSolve(), and Nektar::UnsteadyViscousBurgers::v_InitObject().

◆ UpdateTimeStepCheck()

bool Nektar::SolverUtils::UnsteadySystem::UpdateTimeStepCheck ( )
inlineprotectedvirtual

Reimplemented in Nektar::CFSImplicit.

Definition at line 205 of file UnsteadySystem.h.

206  {
207  return true;
208  }

Referenced by v_DoSolve().

◆ v_AppendOutput1D()

void Nektar::SolverUtils::UnsteadySystem::v_AppendOutput1D ( Array< OneD, Array< OneD, NekDouble >> &  solution1D)
protectedvirtual

Print the solution at each solution point in a txt file.

Stores the solution in a file for 1D problems only. This method has been implemented to facilitate the post-processing for 1D problems.

Definition at line 641 of file UnsteadySystem.cpp.

643  {
644  // Coordinates of the quadrature points in the real physical space
645  Array<OneD,NekDouble> x(GetNpoints());
646  Array<OneD,NekDouble> y(GetNpoints());
647  Array<OneD,NekDouble> z(GetNpoints());
648  m_fields[0]->GetCoords(x, y, z);
649 
650  // Print out the solution in a txt file
651  ofstream outfile;
652  outfile.open("solution1D.txt");
653  for(int i = 0; i < GetNpoints(); i++)
654  {
655  outfile << scientific << setw (17) << setprecision(16) << x[i]
656  << " " << solution1D[0][i] << endl;
657  }
658  outfile << endl << endl;
659  outfile.close();
660  }
SOLVER_UTILS_EXPORT int GetNpoints()

References Nektar::SolverUtils::EquationSystem::GetNpoints(), and Nektar::SolverUtils::EquationSystem::m_fields.

Referenced by v_DoSolve().

◆ v_DoInitialise()

void Nektar::SolverUtils::UnsteadySystem::v_DoInitialise ( void  )
protectedvirtual

Sets up initial conditions.

Sets the initial conditions.

Reimplemented from Nektar::SolverUtils::EquationSystem.

Reimplemented in Nektar::VelocityCorrectionScheme, Nektar::VCSMapping, Nektar::CoupledLinearNS, Nektar::MMFSWE, and Nektar::PulseWaveSystem.

Definition at line 597 of file UnsteadySystem.cpp.

598  {
603  }
int m_nchk
Number of checkpoints written so far.
SOLVER_UTILS_EXPORT void SetBoundaryConditions(NekDouble time)
Evaluates the boundary conditions at the given time.
SOLVER_UTILS_EXPORT void SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
Initialise the data in the dependent fields.
SOLVER_UTILS_EXPORT void CheckForRestartTime(NekDouble &time, int &nchk)

References CheckForRestartTime(), InitializeSteadyState(), Nektar::SolverUtils::EquationSystem::m_nchk, Nektar::SolverUtils::EquationSystem::m_time, Nektar::SolverUtils::EquationSystem::SetBoundaryConditions(), and Nektar::SolverUtils::EquationSystem::SetInitialConditions().

Referenced by Nektar::VCSMapping::v_DoInitialise(), and Nektar::VelocityCorrectionScheme::v_DoInitialise().

◆ v_DoSolve()

void Nektar::SolverUtils::UnsteadySystem::v_DoSolve ( void  )
protectedvirtual

Solves an unsteady problem.

Initialises the time integration scheme (as specified in the session file), and perform the time integration.

Reimplemented from Nektar::SolverUtils::EquationSystem.

Reimplemented in Nektar::CoupledLinearNS, Nektar::MMFSWE, Nektar::PulseWaveSystem, Nektar::MMFMaxwell, and Nektar::MMFAdvection.

Definition at line 200 of file UnsteadySystem.cpp.

201  {
202  ASSERTL0(m_intScheme != 0, "No time integration scheme.");
203 
204  int i = 1;
205  int nvariables = 0;
206  int nfields = m_fields.size();
207 
208  if (m_intVariables.empty())
209  {
210  for (i = 0; i < nfields; ++i)
211  {
212  m_intVariables.push_back(i);
213  }
214  nvariables = nfields;
215  }
216  else
217  {
218  nvariables = m_intVariables.size();
219  }
220 
221  // Integrate in wave-space if using homogeneous1D
223  {
224  for(i = 0; i < nfields; ++i)
225  {
226  m_fields[i]->HomogeneousFwdTrans(m_fields[i]->GetPhys(),
227  m_fields[i]->UpdatePhys());
228  m_fields[i]->SetWaveSpace(true);
229  m_fields[i]->SetPhysState(false);
230  }
231  }
232 
233  // Set up wrapper to fields data storage.
234  Array<OneD, Array<OneD, NekDouble> > fields(nvariables);
235 
236  // Order storage to list time-integrated fields first.
237  for(i = 0; i < nvariables; ++i)
238  {
239  fields[i] = m_fields[m_intVariables[i]]->GetPhys();
240  m_fields[m_intVariables[i]]->SetPhysState(false);
241  }
242 
243  // Initialise time integration scheme
244  m_intScheme->InitializeScheme( m_timestep, fields, m_time, m_ode );
245 
246  // Initialise filters
247  for( auto &x : m_filters )
248  {
249  x.second->Initialise(m_fields, m_time);
250  }
251 
252  LibUtilities::Timer timer;
253  bool doCheckTime = false;
254  int step = m_initialStep;
255  int stepCounter = 0;
256  int restartStep = -1;
257  NekDouble intTime = 0.0;
258  NekDouble cpuTime = 0.0;
259  NekDouble cpuPrevious = 0.0;
260  NekDouble elapsed = 0.0;
261  NekDouble totFilterTime = 0.0;
262 
263  m_lastCheckTime = 0.0;
264 
265  m_TotNewtonIts = 0;
266  m_TotLinIts = 0;
267  m_TotImpStages = 0;
268 
269  Array<OneD, int> abortFlags(2, 0);
270  string abortFile = "abort";
271  if (m_session->DefinesSolverInfo("CheckAbortFile"))
272  {
273  abortFile = m_session->GetSolverInfo("CheckAbortFile");
274  }
275 
276  NekDouble tmp_cflSafetyFactor = m_cflSafetyFactor;
277 
279  while ((step < m_steps ||
281  abortFlags[1] == 0)
282  {
283  restartStep++;
284 
286  {
287  tmp_cflSafetyFactor =
288  min(m_CFLEnd,m_CFLGrowth*tmp_cflSafetyFactor);
289  }
290 
291  m_flagUpdatePreconMat = true;
292 
293  // Flag to update AV
294  m_CalcPhysicalAV = true;
295  // Frozen preconditioner checks
296  if (UpdateTimeStepCheck())
297  {
298  m_cflSafetyFactor = tmp_cflSafetyFactor;
299 
300  if (m_cflSafetyFactor)
301  {
302  m_timestep = GetTimeStep(fields);
303  }
304 
305  // Ensure that the final timestep finishes at the final
306  // time, or at a prescribed IO_CheckTime.
307  if (m_time + m_timestep > m_fintime && m_fintime > 0.0)
308  {
310  }
311  else if (m_checktime &&
313  {
316  doCheckTime = true;
317  }
318  }
319 
320  if (m_TimeIncrementFactor > 1.0)
321  {
322  NekDouble timeincrementFactor = m_TimeIncrementFactor;
323  m_timestep *= timeincrementFactor;
324 
325  if (m_time + m_timestep > m_fintime && m_fintime > 0.0)
326  {
328  }
329  }
330 
331  // Perform any solver-specific pre-integration steps
332  timer.Start();
333  if (v_PreIntegrate(step))
334  {
335  break;
336  }
337 
338  m_StagesPerStep = 0;
339  m_TotLinItePerStep = 0;
340 
341  ASSERTL0(m_timestep > 0, "m_timestep < 0");
342 
343  fields =
344  m_intScheme->TimeIntegrate( stepCounter, m_timestep, m_ode);
345  timer.Stop();
346 
347  m_time += m_timestep;
348  elapsed = timer.TimePerTest(1);
349  intTime += elapsed;
350  cpuTime += elapsed;
351 
352  // Write out status information
353  if (m_session->GetComm()->GetRank() == 0 &&
354  !((step+1) % m_infosteps))
355  {
356  cout << "Steps: " << setw(8) << left << step+1 << " "
357  << "Time: " << setw(12) << left << m_time;
358 
359  if (m_cflSafetyFactor)
360  {
361  cout << " Time-step: " << setw(12)
362  << left << m_timestep;
363  }
364 
365  stringstream ss;
366  ss << cpuTime << "s";
367  cout << " CPU Time: " << setw(8) << left
368  << ss.str() << endl;
369  cpuPrevious = cpuTime;
370  cpuTime = 0.0;
371 
373  {
374  cout
375  << " &&"
376  << " TotImpStages= " << m_TotImpStages
377  << " TotNewtonIts= " << m_TotNewtonIts
378  << " TotLinearIts = " << m_TotLinIts
379  << endl;
380  }
381  }
382 
383  // Transform data into coefficient space
384  for (i = 0; i < nvariables; ++i)
385  {
386  // copy fields into ExpList::m_phys and assign the new
387  // array to fields
388  m_fields[m_intVariables[i]]->SetPhys(fields[i]);
389  fields[i] = m_fields[m_intVariables[i]]->UpdatePhys();
390  if( v_RequireFwdTrans() )
391  {
392  m_fields[m_intVariables[i]]->FwdTrans_IterPerExp(
393  fields[i],
394  m_fields[m_intVariables[i]]->UpdateCoeffs());
395  }
396  m_fields[m_intVariables[i]]->SetPhysState(false);
397  }
398 
399  // Perform any solver-specific post-integration steps
400  if (v_PostIntegrate(step))
401  {
402  break;
403  }
404 
405  // Check for steady-state
406  if (m_steadyStateTol > 0.0 && (!((step+1)%m_steadyStateSteps)) )
407  {
408  if (CheckSteadyState(step,intTime))
409  {
410  if (m_comm->GetRank() == 0)
411  {
412  cout << "Reached Steady State to tolerance "
413  << m_steadyStateTol << endl;
414  }
415  break;
416  }
417  }
418 
419  // test for abort conditions (nan, or abort file)
420  if (m_abortSteps && !((step+1) % m_abortSteps) )
421  {
422  abortFlags[0] = 0;
423  for (i = 0; i < nvariables; ++i)
424  {
425  if (Vmath::Nnan(fields[i].size(),
426  fields[i], 1) > 0)
427  {
428  abortFlags[0] = 1;
429  }
430  }
431 
432  //rank zero looks for abort file and deltes it
433  //if it exists. The communicates the abort
434  if(m_session->GetComm()->GetRank() == 0)
435  {
436  if(boost::filesystem::exists(abortFile))
437  {
438  boost::filesystem::remove(abortFile);
439  abortFlags[1] = 1;
440  }
441  }
442 
443  m_session->GetComm()->AllReduce(abortFlags,
445 
446  ASSERTL0 (!abortFlags[0],
447  "NaN found during time integration.");
448  }
449 
450  // Update filters
451  for (auto &x : m_filters)
452  {
453  timer.Start();
454  x.second->Update(m_fields, m_time);
455  timer.Stop();
456  elapsed = timer.TimePerTest(1);
457  totFilterTime += elapsed;
458 
459  // Write out individual filter status information
460  if(m_session->GetComm()->GetRank() == 0 &&
461  !((step+1) % m_filtersInfosteps) && !m_filters.empty() &&
462  m_session->DefinesCmdLineArgument("verbose"))
463  {
464  stringstream s0;
465  s0 << x.first << ":";
466  stringstream s1;
467  s1 << elapsed << "s";
468  stringstream s2;
469  s2 << elapsed / cpuPrevious * 100 << "%";
470  cout << "CPU time for filter " << setw(25) << left
471  << s0.str() << setw(12) << left << s1.str() <<
472  endl << "\t Percentage of time integration: "
473  << setw(10) << left << s2.str() << endl;
474  }
475  }
476 
477  // Write out overall filter status information
478  if (m_session->GetComm()->GetRank() == 0 &&
479  !((step+1) % m_filtersInfosteps) && !m_filters.empty())
480  {
481  stringstream ss;
482  ss << totFilterTime << "s";
483  cout << "Total filters CPU Time:\t\t\t " << setw(10)
484  << left << ss.str() << endl;
485  }
486  totFilterTime = 0.0;
487 
488  // Write out checkpoint files
489  if ((m_checksteps && !((step + 1) % m_checksteps)) ||
490  doCheckTime)
491  {
493  {
494  vector<bool> transformed(nfields, false);
495  for(i = 0; i < nfields; i++)
496  {
497  if (m_fields[i]->GetWaveSpace())
498  {
499  m_fields[i]->SetWaveSpace(false);
500  m_fields[i]->BwdTrans(m_fields[i]->GetCoeffs(),
501  m_fields[i]->UpdatePhys());
502  m_fields[i]->SetPhysState(true);
503  transformed[i] = true;
504  }
505  }
507  m_nchk++;
508  for(i = 0; i < nfields; i++)
509  {
510  if (transformed[i])
511  {
512  m_fields[i]->SetWaveSpace(true);
513  m_fields[i]->HomogeneousFwdTrans(
514  m_fields[i]->GetPhys(),
515  m_fields[i]->UpdatePhys());
516  m_fields[i]->SetPhysState(false);
517  }
518  }
519  }
520  else
521  {
523  m_nchk++;
524  }
525  doCheckTime = false;
526  }
527 
528  // Step advance
529  ++step;
530  ++stepCounter;
531  }
532 
533  // Print out summary statistics
534  if (m_session->GetComm()->GetRank() == 0)
535  {
536  if (m_cflSafetyFactor > 0.0)
537  {
538  cout << "CFL safety factor : " << m_cflSafetyFactor << endl
539  << "CFL time-step : " << m_timestep << endl;
540  }
541 
542  if (m_session->GetSolverInfo("Driver") != "SteadyState")
543  {
544  cout << "Time-integration : " << intTime << "s" << endl;
545  }
546 
548  {
549  cout
550  << "-------------------------------------------" << endl
551  << "Total Implicit Stages: " << m_TotImpStages << endl
552  << "Total Newton Its : " << m_TotNewtonIts << endl
553  << "Total Linear Its : " << m_TotLinIts << endl
554  << "-------------------------------------------" << endl;
555  }
556  }
557 
558  // If homogeneous, transform back into physical space if necessary.
560  {
561  for(i = 0; i < nfields; i++)
562  {
563  if (m_fields[i]->GetWaveSpace())
564  {
565  m_fields[i]->SetWaveSpace(false);
566  m_fields[i]->BwdTrans(m_fields[i]->GetCoeffs(),
567  m_fields[i]->UpdatePhys());
568  m_fields[i]->SetPhysState(true);
569  }
570  }
571  }
572  else
573  {
574  for(i = 0; i < nvariables; ++i)
575  {
576  m_fields[m_intVariables[i]]->SetPhys(fields[i]);
577  m_fields[m_intVariables[i]]->SetPhysState(true);
578  }
579  }
580 
581  // Finalise filters
582  for (auto &x : m_filters)
583  {
584  x.second->Finalise(m_fields, m_time);
585  }
586 
587  // Print for 1D problems
588  if(m_spacedim == 1)
589  {
590  v_AppendOutput1D(fields);
591  }
592  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
int m_spacedim
Spatial dimension (>= expansion dim).
NekDouble m_timestep
Time step size.
NekDouble m_fintime
Finish time of the simulation.
SOLVER_UTILS_EXPORT void Checkpoint_Output(const int n)
Write checkpoint file of m_fields.
NekDouble m_checktime
Time between checkpoints.
SOLVER_UTILS_EXPORT NekDouble GetTimeStep()
NekDouble m_timestepMax
Time step size.
enum HomogeneousType m_HomogeneousType
int m_steps
Number of steps to take.
int m_checksteps
Number of steps between checkpoints.
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
NekDouble m_CFLGrowth
CFL growth rate.
bool m_CalcPhysicalAV
flag to update artificial viscosity
std::vector< std::pair< std::string, FilterSharedPtr > > m_filters
NekDouble m_cflSafetyFactor
CFL safety factor (comprise between 0 to 1).
int m_abortSteps
Number of steps between checks for abort conditions.
virtual SOLVER_UTILS_EXPORT bool v_RequireFwdTrans()
virtual SOLVER_UTILS_EXPORT bool v_PostIntegrate(int step)
NekDouble m_CFLEnd
maximun cfl in cfl growth
virtual SOLVER_UTILS_EXPORT bool v_PreIntegrate(int step)
int m_steadyStateSteps
Check for steady state at step interval.
virtual SOLVER_UTILS_EXPORT bool UpdateTimeStepCheck()
int m_filtersInfosteps
Number of time steps between outputting filters information.
virtual SOLVER_UTILS_EXPORT void v_AppendOutput1D(Array< OneD, Array< OneD, NekDouble >> &solution1D)
Print the solution at each solution point in a txt file.
bool m_homoInitialFwd
Flag to determine if simulation should start in homogeneous forward transformed state.
static const NekDouble kNekZeroTol
int Nnan(int n, const T *x, const int incx)
Return number of NaN elements of x.
Definition: Vmath.cpp:1015

References ASSERTL0, Nektar::SolverUtils::EquationSystem::Checkpoint_Output(), CheckSteadyState(), Nektar::SolverUtils::EquationSystem::eNotHomogeneous, Nektar::SolverUtils::EquationSystem::GetTimeStep(), Nektar::NekConstants::kNekZeroTol, m_abortSteps, m_CalcPhysicalAV, m_CFLEnd, m_CFLGrowth, m_cflSafetyFactor, Nektar::SolverUtils::EquationSystem::m_checksteps, Nektar::SolverUtils::EquationSystem::m_checktime, Nektar::SolverUtils::EquationSystem::m_comm, Nektar::SolverUtils::EquationSystem::m_fields, m_filters, m_filtersInfosteps, Nektar::SolverUtils::EquationSystem::m_fintime, m_flagImplicitItsStatistics, m_flagImplicitSolver, m_flagUpdatePreconMat, Nektar::SolverUtils::EquationSystem::m_HomogeneousType, m_homoInitialFwd, m_infosteps, Nektar::SolverUtils::EquationSystem::m_initialStep, m_intScheme, m_intVariables, Nektar::SolverUtils::EquationSystem::m_lastCheckTime, Nektar::SolverUtils::EquationSystem::m_nchk, m_ode, Nektar::SolverUtils::EquationSystem::m_session, Nektar::SolverUtils::EquationSystem::m_spacedim, m_StagesPerStep, m_steadyStateSteps, m_steadyStateTol, Nektar::SolverUtils::EquationSystem::m_steps, Nektar::SolverUtils::EquationSystem::m_time, Nektar::SolverUtils::EquationSystem::m_TimeIncrementFactor, Nektar::SolverUtils::EquationSystem::m_timestep, Nektar::SolverUtils::EquationSystem::m_timestepMax, m_TotImpStages, m_TotLinItePerStep, m_TotLinIts, m_TotNewtonIts, Vmath::Nnan(), Nektar::LibUtilities::ReduceMax, Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), Nektar::LibUtilities::Timer::TimePerTest(), UpdateTimeStepCheck(), v_AppendOutput1D(), v_PostIntegrate(), v_PreIntegrate(), and v_RequireFwdTrans().

Referenced by Nektar::CoupledLinearNS::v_DoSolve().

◆ v_GenerateSummary()

void Nektar::SolverUtils::UnsteadySystem::v_GenerateSummary ( SummaryList s)
protectedvirtual

Print a summary of time stepping parameters.

Prints a summary with some information regards the time-stepping.

Reimplemented from Nektar::SolverUtils::EquationSystem.

Reimplemented in Nektar::Monodomain, Nektar::BidomainRoth, Nektar::Bidomain, Nektar::UnsteadyDiffusion, Nektar::CFLtester, Nektar::SolverUtils::MMFSystem, Nektar::ShallowWaterSystem, Nektar::NonlinearSWE, Nektar::NonlinearPeregrine, Nektar::MMFSWE, Nektar::LinearSWE, Nektar::PulseWavePropagation, Nektar::MMFMaxwell, Nektar::VCSWeakPressure, Nektar::VelocityCorrectionScheme, Nektar::SmoothedProfileMethod, Nektar::CoupledLinearNS, Nektar::ImageWarpingSystem, Nektar::MMFDiffusion, Nektar::RinglebFlow, Nektar::IsentropicVortex, Nektar::UnsteadyViscousBurgers, Nektar::UnsteadyAdvectionDiffusion, Nektar::UnsteadyAdvection, and Nektar::MMFAdvection.

Definition at line 609 of file UnsteadySystem.cpp.

610  {
612  AddSummaryItem(s, "Advection",
613  m_explicitAdvection ? "explicit" : "implicit");
614 
615  if(m_session->DefinesSolverInfo("AdvectionType"))
616  {
617  AddSummaryItem(s, "AdvectionType",
618  m_session->GetSolverInfo("AdvectionType"));
619  }
620 
621  AddSummaryItem(s, "Diffusion",
622  m_explicitDiffusion ? "explicit" : "implicit");
623 
624  if (m_session->GetSolverInfo("EQTYPE")
625  == "SteadyAdvectionDiffusionReaction")
626  {
627  AddSummaryItem(s, "Reaction",
628  m_explicitReaction ? "explicit" : "implicit");
629  }
630 
631  AddSummaryItem( s, "Time Step", m_timestep );
632  AddSummaryItem( s, "No. of Steps", m_steps );
633  AddSummaryItem( s, "Checkpoints (steps)", m_checksteps );
634  AddSummaryItem( s, "Integration Type", m_intScheme->GetName() );
635  }
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &l)
Virtual function for generating summary information.
bool m_explicitReaction
Indicates if explicit or implicit treatment of reaction is used.
bool m_explicitAdvection
Indicates if explicit or implicit treatment of advection is used.
bool m_explicitDiffusion
Indicates if explicit or implicit treatment of diffusion is used.
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
Definition: Misc.cpp:47

References Nektar::SolverUtils::AddSummaryItem(), Nektar::SolverUtils::EquationSystem::m_checksteps, m_explicitAdvection, m_explicitDiffusion, m_explicitReaction, m_intScheme, Nektar::SolverUtils::EquationSystem::m_session, Nektar::SolverUtils::EquationSystem::m_steps, Nektar::SolverUtils::EquationSystem::m_timestep, and Nektar::SolverUtils::EquationSystem::v_GenerateSummary().

Referenced by Nektar::UnsteadyAdvection::v_GenerateSummary(), Nektar::UnsteadyAdvectionDiffusion::v_GenerateSummary(), Nektar::UnsteadyViscousBurgers::v_GenerateSummary(), Nektar::IsentropicVortex::v_GenerateSummary(), Nektar::RinglebFlow::v_GenerateSummary(), Nektar::ImageWarpingSystem::v_GenerateSummary(), Nektar::VelocityCorrectionScheme::v_GenerateSummary(), Nektar::VCSWeakPressure::v_GenerateSummary(), Nektar::PulseWavePropagation::v_GenerateSummary(), Nektar::ShallowWaterSystem::v_GenerateSummary(), Nektar::SolverUtils::MMFSystem::v_GenerateSummary(), Nektar::CFLtester::v_GenerateSummary(), Nektar::UnsteadyDiffusion::v_GenerateSummary(), Nektar::Bidomain::v_GenerateSummary(), Nektar::BidomainRoth::v_GenerateSummary(), and Nektar::Monodomain::v_GenerateSummary().

◆ v_GetTimeStep()

NekDouble Nektar::SolverUtils::UnsteadySystem::v_GetTimeStep ( const Array< OneD, const Array< OneD, NekDouble >> &  inarray)
protectedvirtual

Return the timestep to be used for the next step in the time-marching loop.

See also
UnsteadySystem::GetTimeStep

Definition at line 738 of file UnsteadySystem.cpp.

740  {
741  boost::ignore_unused(inarray);
742  NEKERROR(ErrorUtil::efatal, "Not defined for this class");
743  return 0.0;
744  }
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:209

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetTimeStep().

◆ v_InitObject()

void Nektar::SolverUtils::UnsteadySystem::v_InitObject ( )
protectedvirtual

Init object for UnsteadySystem class.

Initialization object for UnsteadySystem class.

Reimplemented from Nektar::SolverUtils::EquationSystem.

Reimplemented in Nektar::ShallowWaterSystem, Nektar::NonlinearSWE, Nektar::NonlinearPeregrine, Nektar::MMFSWE, Nektar::LinearSWE, Nektar::PulseWaveSystemOutput, Nektar::PulseWaveSystem, Nektar::PulseWavePropagation, Nektar::MMFMaxwell, Nektar::VelocityCorrectionScheme, Nektar::VCSMapping, Nektar::SmoothedProfileMethod, Nektar::IncNavierStokes, Nektar::CoupledLinearNS, Nektar::ImageWarpingSystem, Nektar::Dummy, Nektar::MMFDiffusion, Nektar::NavierStokesImplicitCFE, Nektar::NavierStokesCFEAxisym, Nektar::NavierStokesCFE, Nektar::EulerImplicitCFE, Nektar::EulerCFE, Nektar::CFSImplicit, Nektar::CompressibleFlowSystem, Nektar::Monodomain, Nektar::BidomainRoth, Nektar::Bidomain, Nektar::UnsteadyViscousBurgers, Nektar::UnsteadyReactionDiffusion, Nektar::UnsteadyInviscidBurger, Nektar::UnsteadyDiffusion, Nektar::UnsteadyAdvectionDiffusion, Nektar::UnsteadyAdvection, Nektar::MMFAdvection, Nektar::CFLtester, Nektar::LEE, Nektar::APE, Nektar::AcousticSystem, and Nektar::SolverUtils::AdvectionSystem.

Definition at line 81 of file UnsteadySystem.cpp.

82  {
84 
85  m_initialStep = 0;
86 
87  // Load SolverInfo parameters
88  m_session->MatchSolverInfo("DIFFUSIONADVANCEMENT","Explicit",
89  m_explicitDiffusion,true);
90  m_session->MatchSolverInfo("ADVECTIONADVANCEMENT","Explicit",
91  m_explicitAdvection,true);
92  m_session->MatchSolverInfo("REACTIONADVANCEMENT", "Explicit",
93  m_explicitReaction, true);
94 
95  m_session->MatchSolverInfo("FLAGIMPLICITITSSTATISTICS", "True",
97 
98  m_session->LoadParameter("CheckAbortSteps", m_abortSteps, 1);
99  // Steady state tolerance
100  m_session->LoadParameter("SteadyStateTol", m_steadyStateTol, 0.0);
101  // Frequency for checking steady state
102  m_session->LoadParameter("SteadyStateSteps",
103  m_steadyStateSteps, 1);
104 
105  // For steady problems, we do not initialise the time integration
106  if (m_session->DefinesSolverInfo("TimeIntegrationMethod") ||
107  m_session->DefinesTimeIntScheme())
108  {
109  LibUtilities::TimeIntScheme timeInt;
110  if (m_session->DefinesTimeIntScheme())
111  {
112  timeInt = m_session->GetTimeIntScheme();
113  }
114  else
115  {
116  timeInt.method = m_session->GetSolverInfo(
117  "TimeIntegrationMethod");
118  }
119 
121  .CreateInstance(timeInt.method,
122  timeInt.variant,
123  timeInt.order,
124  timeInt.freeParams);
125 
126  // Load generic input parameters
127  m_session->LoadParameter("IO_InfoSteps", m_infosteps, 0);
128  m_session->LoadParameter("IO_FiltersInfoSteps",
130  m_session->LoadParameter("CFL", m_cflSafetyFactor, 0.0);
131  m_session->LoadParameter("CFLEnd", m_CFLEnd, 0.0);
132  m_session->LoadParameter("CFLGrowth", m_CFLGrowth, 1.0);
133  m_session->LoadParameter("CFLGrowth", m_CFLGrowth, 1.0);
134 
135 
136  // Time tolerance between filter update time and time integration
137  m_session->LoadParameter("FilterTimeWarning",
139 
140  // Ensure that there is no conflict of parameters
141  if(m_cflSafetyFactor > 0.0)
142  {
143  // Check final condition
144  ASSERTL0(m_fintime == 0.0 || m_steps == 0,
145  "Final condition not unique: "
146  "fintime > 0.0 and Nsteps > 0");
147  // Check timestep condition
148  ASSERTL0(m_timestep == 0.0,
149  "Timestep not unique: timestep > 0.0 & CFL > 0.0");
150  }
151  else
152  {
153  ASSERTL0(m_timestep != 0.0,
154  "Need to set either TimeStep or CFL");
155  }
156 
157  // Ensure that there is no conflict of parameters
158  if (m_CFLGrowth > 1.0)
159  {
160  // Check final condition
162  "m_CFLEnd >= m_cflSafetyFactor required");
163  }
164 
165  // Set up time to be dumped in field information
166  m_fieldMetaDataMap["Time"] =
167  boost::lexical_cast<std::string>(m_time);
168  }
169 
170  // By default attempt to forward transform initial condition.
171  m_homoInitialFwd = true;
172 
173  // Set up filters
174  for (auto &x : m_session->GetFilters())
175  {
176  m_filters.push_back(make_pair(x.first, GetFilterFactory().CreateInstance(
177  x.first, m_session, shared_from_this(), x.second)));
178  }
179  }
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:145
virtual SOLVER_UTILS_EXPORT void v_InitObject()
Initialisation object for EquationSystem.
NekDouble m_filterTimeWarning
Number of time steps between outputting status information.
TimeIntegrationSchemeFactory & GetTimeIntegrationSchemeFactory()
FilterFactory & GetFilterFactory()
Definition: Filter.cpp:41

References ASSERTL0, Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::LibUtilities::TimeIntScheme::freeParams, Nektar::SolverUtils::GetFilterFactory(), Nektar::LibUtilities::GetTimeIntegrationSchemeFactory(), m_abortSteps, m_CFLEnd, m_CFLGrowth, m_cflSafetyFactor, m_explicitAdvection, m_explicitDiffusion, m_explicitReaction, Nektar::SolverUtils::EquationSystem::m_fieldMetaDataMap, m_filters, m_filtersInfosteps, m_filterTimeWarning, Nektar::SolverUtils::EquationSystem::m_fintime, m_flagImplicitItsStatistics, m_homoInitialFwd, m_infosteps, Nektar::SolverUtils::EquationSystem::m_initialStep, m_intScheme, Nektar::SolverUtils::EquationSystem::m_session, m_steadyStateSteps, m_steadyStateTol, Nektar::SolverUtils::EquationSystem::m_steps, Nektar::SolverUtils::EquationSystem::m_time, Nektar::SolverUtils::EquationSystem::m_timestep, Nektar::LibUtilities::TimeIntScheme::method, Nektar::LibUtilities::TimeIntScheme::order, Nektar::SolverUtils::EquationSystem::v_InitObject(), and Nektar::LibUtilities::TimeIntScheme::variant.

Referenced by Nektar::SolverUtils::AdvectionSystem::v_InitObject(), Nektar::MMFAdvection::v_InitObject(), Nektar::UnsteadyDiffusion::v_InitObject(), Nektar::UnsteadyReactionDiffusion::v_InitObject(), Nektar::Bidomain::v_InitObject(), Nektar::BidomainRoth::v_InitObject(), Nektar::Monodomain::v_InitObject(), Nektar::MMFDiffusion::v_InitObject(), Nektar::Dummy::v_InitObject(), Nektar::MMFMaxwell::v_InitObject(), Nektar::PulseWaveSystem::v_InitObject(), Nektar::MMFSWE::v_InitObject(), and Nektar::ShallowWaterSystem::v_InitObject().

◆ v_PostIntegrate()

bool Nektar::SolverUtils::UnsteadySystem::v_PostIntegrate ( int  step)
protectedvirtual

Reimplemented in Nektar::VelocityCorrectionScheme, Nektar::Dummy, and Nektar::SolverUtils::AdvectionSystem.

Definition at line 752 of file UnsteadySystem.cpp.

753  {
754  boost::ignore_unused(step);
755  return false;
756  }

Referenced by v_DoSolve(), Nektar::SolverUtils::AdvectionSystem::v_PostIntegrate(), and Nektar::Dummy::v_PostIntegrate().

◆ v_PreIntegrate()

bool Nektar::SolverUtils::UnsteadySystem::v_PreIntegrate ( int  step)
protectedvirtual

Reimplemented in Nektar::IncNavierStokes, Nektar::Dummy, Nektar::UnsteadyAdvectionDiffusion, and Nektar::AcousticSystem.

Definition at line 746 of file UnsteadySystem.cpp.

747  {
748  boost::ignore_unused(step);
749  return false;
750  }

Referenced by v_DoSolve(), Nektar::AcousticSystem::v_PreIntegrate(), and Nektar::Dummy::v_PreIntegrate().

◆ v_RequireFwdTrans()

virtual SOLVER_UTILS_EXPORT bool Nektar::SolverUtils::UnsteadySystem::v_RequireFwdTrans ( )
inlineprotectedvirtual

Reimplemented in Nektar::VelocityCorrectionScheme, and Nektar::Dummy.

Definition at line 177 of file UnsteadySystem.h.

178  {
179  return true;
180  }

Referenced by v_DoSolve().

◆ v_SteadyStateResidual()

void Nektar::SolverUtils::UnsteadySystem::v_SteadyStateResidual ( int  step,
Array< OneD, NekDouble > &  L2 
)
protectedvirtual

Reimplemented in Nektar::CompressibleFlowSystem.

Definition at line 900 of file UnsteadySystem.cpp.

903  {
904  boost::ignore_unused(step);
905  const int nPoints = GetTotPoints();
906  const int nFields = m_fields.size();
907 
908  // Holds L2 errors.
909  Array<OneD, NekDouble> RHSL2 (nFields);
910  Array<OneD, NekDouble> residual (nFields);
911  Array<OneD, NekDouble> reference(nFields);
912 
913  for (int i = 0; i < nFields; ++i)
914  {
915  Array<OneD, NekDouble> tmp(nPoints);
916 
917  Vmath::Vsub(nPoints, m_fields[i]->GetPhys(), 1,
918  m_previousSolution[i], 1, tmp, 1);
919  Vmath::Vmul(nPoints, tmp, 1, tmp, 1, tmp, 1);
920  residual[i] = Vmath::Vsum(nPoints, tmp, 1);
921 
922  Vmath::Vmul(nPoints, m_previousSolution[i], 1,
923  m_previousSolution[i], 1, tmp, 1);
924  reference[i] = Vmath::Vsum(nPoints, tmp, 1);
925  }
926 
927  m_comm->AllReduce(residual , LibUtilities::ReduceSum);
928  m_comm->AllReduce(reference, LibUtilities::ReduceSum);
929 
930  // L2 error
931  for (int i = 0; i < nFields; ++i)
932  {
933  reference[i] = (reference[i] == 0) ? 1 : reference[i];
934  L2[i] = sqrt(residual[i] / reference[i]);
935  }
936  }
T Vsum(int n, const T *x, const int incx)
Subtract return sum(x)
Definition: Vmath.cpp:846
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.cpp:372
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:267

References Nektar::SolverUtils::EquationSystem::GetTotPoints(), Nektar::SolverUtils::EquationSystem::m_comm, Nektar::SolverUtils::EquationSystem::m_fields, m_previousSolution, Nektar::LibUtilities::ReduceSum, tinysimd::sqrt(), Vmath::Vmul(), Vmath::Vsub(), and Vmath::Vsum().

Referenced by SteadyStateResidual().

Member Data Documentation

◆ m_abortSteps

int Nektar::SolverUtils::UnsteadySystem::m_abortSteps
protected

Number of steps between checks for abort conditions.

Definition at line 77 of file UnsteadySystem.h.

Referenced by v_DoSolve(), and v_InitObject().

◆ m_CalcPhysicalAV

bool Nektar::SolverUtils::UnsteadySystem::m_CalcPhysicalAV = true
protected

◆ m_CFLEnd

NekDouble Nektar::SolverUtils::UnsteadySystem::m_CFLEnd

maximun cfl in cfl growth

Definition at line 71 of file UnsteadySystem.h.

Referenced by v_DoSolve(), and v_InitObject().

◆ m_CFLGrowth

NekDouble Nektar::SolverUtils::UnsteadySystem::m_CFLGrowth

CFL growth rate.

Definition at line 69 of file UnsteadySystem.h.

Referenced by v_DoSolve(), and v_InitObject().

◆ m_cflNonAcoustic

NekDouble Nektar::SolverUtils::UnsteadySystem::m_cflNonAcoustic

Definition at line 67 of file UnsteadySystem.h.

Referenced by Nektar::CompressibleFlowSystem::v_GetTimeStep().

◆ m_cflSafetyFactor

NekDouble Nektar::SolverUtils::UnsteadySystem::m_cflSafetyFactor

◆ m_epsilon

NekDouble Nektar::SolverUtils::UnsteadySystem::m_epsilon
protected

Definition at line 86 of file UnsteadySystem.h.

◆ m_errFile

std::ofstream Nektar::SolverUtils::UnsteadySystem::m_errFile
protected

Definition at line 107 of file UnsteadySystem.h.

Referenced by CheckSteadyState(), and InitializeSteadyState().

◆ m_explicitAdvection

bool Nektar::SolverUtils::UnsteadySystem::m_explicitAdvection
protected

◆ m_explicitDiffusion

bool Nektar::SolverUtils::UnsteadySystem::m_explicitDiffusion
protected

◆ m_explicitReaction

bool Nektar::SolverUtils::UnsteadySystem::m_explicitReaction
protected

Indicates if explicit or implicit treatment of reaction is used.

Definition at line 92 of file UnsteadySystem.h.

Referenced by v_GenerateSummary(), and v_InitObject().

◆ m_filters

std::vector<std::pair<std::string, FilterSharedPtr> > Nektar::SolverUtils::UnsteadySystem::m_filters
protected

◆ m_filtersInfosteps

int Nektar::SolverUtils::UnsteadySystem::m_filtersInfosteps
protected

Number of time steps between outputting filters information.

Definition at line 79 of file UnsteadySystem.h.

Referenced by v_DoSolve(), and v_InitObject().

◆ m_filterTimeWarning

NekDouble Nektar::SolverUtils::UnsteadySystem::m_filterTimeWarning
protected

Number of time steps between outputting status information.

Definition at line 114 of file UnsteadySystem.h.

Referenced by v_InitObject().

◆ m_flagImplicitItsStatistics

bool Nektar::SolverUtils::UnsteadySystem::m_flagImplicitItsStatistics
protected

Definition at line 119 of file UnsteadySystem.h.

Referenced by v_DoSolve(), and v_InitObject().

◆ m_flagImplicitSolver

bool Nektar::SolverUtils::UnsteadySystem::m_flagImplicitSolver = false
protected

Definition at line 120 of file UnsteadySystem.h.

Referenced by v_DoSolve(), and Nektar::CFSImplicit::v_InitObject().

◆ m_flagUpdatePreconMat

bool Nektar::SolverUtils::UnsteadySystem::m_flagUpdatePreconMat
protected

Definition at line 135 of file UnsteadySystem.h.

Referenced by Nektar::CFSImplicit::PreconCoeff(), and v_DoSolve().

◆ m_homoInitialFwd

bool Nektar::SolverUtils::UnsteadySystem::m_homoInitialFwd
protected

◆ m_inArrayNorm

NekDouble Nektar::SolverUtils::UnsteadySystem::m_inArrayNorm =-1.0
protected

◆ m_infosteps

int Nektar::SolverUtils::UnsteadySystem::m_infosteps
protected

◆ m_intScheme

LibUtilities::TimeIntegrationSchemeSharedPtr Nektar::SolverUtils::UnsteadySystem::m_intScheme
protected

◆ m_intVariables

std::vector<int> Nektar::SolverUtils::UnsteadySystem::m_intVariables
protected

◆ m_locTimeStep

Array<OneD, NekDouble> Nektar::SolverUtils::UnsteadySystem::m_locTimeStep
protected

local time step(notice only for jfnk other see m_cflSafetyFactor)

Definition at line 126 of file UnsteadySystem.h.

◆ m_magnitdEstimat

Array<OneD, NekDouble> Nektar::SolverUtils::UnsteadySystem::m_magnitdEstimat
protected

estimate the magnitude of each conserved varibles

Definition at line 123 of file UnsteadySystem.h.

Referenced by Nektar::CFSImplicit::CalcRefValues(), and Nektar::CFSImplicit::NumCalcRiemFluxJac().

◆ m_maxLinItePerNewton

int Nektar::SolverUtils::UnsteadySystem::m_maxLinItePerNewton
protected

Definition at line 137 of file UnsteadySystem.h.

◆ m_nanSteps

int Nektar::SolverUtils::UnsteadySystem::m_nanSteps
protected

Definition at line 80 of file UnsteadySystem.h.

Referenced by Nektar::Dummy::v_InitObject().

◆ m_ode

LibUtilities::TimeIntegrationSchemeOperators Nektar::SolverUtils::UnsteadySystem::m_ode
protected

◆ m_previousSolution

Array<OneD, Array<OneD, NekDouble> > Nektar::SolverUtils::UnsteadySystem::m_previousSolution
protected

Storage for previous solution for steady-state check.

Definition at line 105 of file UnsteadySystem.h.

Referenced by CheckSteadyState(), InitializeSteadyState(), and v_SteadyStateResidual().

◆ m_StagesPerStep

int Nektar::SolverUtils::UnsteadySystem::m_StagesPerStep =1
protected

Definition at line 131 of file UnsteadySystem.h.

Referenced by Nektar::CFSImplicit::DoImplicitSolveCoeff(), and v_DoSolve().

◆ m_steadyStateRes

NekDouble Nektar::SolverUtils::UnsteadySystem::m_steadyStateRes = 1.0
protected

Definition at line 101 of file UnsteadySystem.h.

Referenced by CheckSteadyState().

◆ m_steadyStateRes0

NekDouble Nektar::SolverUtils::UnsteadySystem::m_steadyStateRes0 = 1.0
protected

Definition at line 102 of file UnsteadySystem.h.

Referenced by CheckSteadyState().

◆ m_steadyStateSteps

int Nektar::SolverUtils::UnsteadySystem::m_steadyStateSteps
protected

Check for steady state at step interval.

Definition at line 100 of file UnsteadySystem.h.

Referenced by v_DoSolve(), and v_InitObject().

◆ m_steadyStateTol

NekDouble Nektar::SolverUtils::UnsteadySystem::m_steadyStateTol
protected

Tolerance to which steady state should be evaluated at.

Definition at line 98 of file UnsteadySystem.h.

Referenced by CheckSteadyState(), InitializeSteadyState(), v_DoSolve(), and v_InitObject().

◆ m_TimeIntegLambda

NekDouble Nektar::SolverUtils::UnsteadySystem::m_TimeIntegLambda =0.0
protected

coefff of spacial derivatives(rhs or m_F in GLM) in calculating the residual of the whole equation(used in unsteady time integrations)

Definition at line 117 of file UnsteadySystem.h.

Referenced by Nektar::CFSImplicit::CalcPreconMatBRJCoeff(), Nektar::CFSImplicit::DoImplicitSolveCoeff(), Nektar::CFSImplicit::NonlinSysEvaluatorCoeff(), Nektar::CFSImplicit::PreconCoeff(), and Nektar::CFSImplicit::UpdateTimeStepCheck().

◆ m_TotImpStages

int Nektar::SolverUtils::UnsteadySystem::m_TotImpStages =0
protected

Definition at line 141 of file UnsteadySystem.h.

Referenced by Nektar::CFSImplicit::DoImplicitSolveCoeff(), and v_DoSolve().

◆ m_TotLinItePerStep

int Nektar::SolverUtils::UnsteadySystem::m_TotLinItePerStep =0
protected

Definition at line 130 of file UnsteadySystem.h.

Referenced by v_DoSolve().

◆ m_TotLinIts

int Nektar::SolverUtils::UnsteadySystem::m_TotLinIts =0
protected

Definition at line 140 of file UnsteadySystem.h.

Referenced by Nektar::CFSImplicit::DoImplicitSolveCoeff(), and v_DoSolve().

◆ m_TotNewtonIts

int Nektar::SolverUtils::UnsteadySystem::m_TotNewtonIts =0
protected

Definition at line 139 of file UnsteadySystem.h.

Referenced by Nektar::CFSImplicit::DoImplicitSolveCoeff(), and v_DoSolve().