48int main(
int argc,
char *argv[])
52 fprintf(stderr,
"Usage: ./CflStep file.xml \n");
53 fprintf(stderr,
"\t Method will read initial conditions section of "
54 ".xml file for input \n");
66 session = LibUtilities::SessionReader::CreateInstance(argc, argv);
69 graph = SpatialDomains::MeshGraphIO::Read(session);
72 session->LoadSolverInfo(
"Driver", vDriverModule,
"Standard");
83 IncNav->UpdateFields();
85 int nfields = fields.size();
86 int nexp = fields[0]->GetExpSize();
90 cout <<
"Max CFL: " << cfl[elmtid] <<
" In element " << elmtid << endl;
92 for (n = 0; n < nfields; ++n)
94 if (session->GetVariable(n) ==
"p")
100 ASSERTL0(n != nfields,
"Could not find field named p in m_fields");
105 for (i = 0; i < fields[n]->GetExpSize(); ++i)
107 nquad = fields[n]->GetExp(i)->GetTotPoints();
112 fields[n]->FwdTransLocalElmt(fields[n]->GetPhys(),
113 fields[n]->UpdateCoeffs());
116 session->SetVariable(n,
"CFL");
119 std::string outname = IncNav->GetSessionName();
121 outname +=
"_CFLStep";
122 IncNav->ResetSessionName(outname);
125 catch (
const std::runtime_error &)
129 catch (
const std::string &eStr)
131 cout <<
"Error: " << eStr << endl;
int main(int argc, char *argv[])
#define ASSERTL0(condition, msg)
This class is the base class for Navier Stokes problems.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
SOLVER_UTILS_EXPORT void SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
Initialise the data in the dependent fields.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Driver > DriverSharedPtr
A shared pointer to a Driver object.
DriverFactory & GetDriverFactory()
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::shared_ptr< IncNavierStokes > IncNavierStokesSharedPtr
int Imax(int n, const T *x, const int incx)
Return the index of the maximum element in x.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.