13 int main(
int argc,
char *argv[])
17 fprintf(stderr,
"Usage: ./CflStep file.xml \n");
18 fprintf(stderr,
"\t Method will read intiial conditions section of "
19 ".xml file for input \n");
31 session = LibUtilities::SessionReader::CreateInstance(argc, argv);
34 graph = SpatialDomains::MeshGraph::Read(session);
37 session->LoadSolverInfo(
"Driver", vDriverModule,
"Standard");
48 IncNav->UpdateFields();
50 int nfields = fields.size();
51 int nexp = fields[0]->GetExpSize();
55 cout <<
"Max CFL: " << cfl[elmtid] <<
" In element " << elmtid << endl;
57 for (n = 0; n < nfields; ++n)
59 if (session->GetVariable(n) ==
"p")
65 ASSERTL0(n != nfields,
"Could not find field named p in m_fields");
70 for (i = 0; i < fields[n]->GetExpSize(); ++i)
72 nquad = fields[n]->GetExp(i)->GetTotPoints();
77 fields[n]->FwdTransLocalElmt(fields[n]->GetPhys(),
78 fields[n]->UpdateCoeffs());
81 session->SetVariable(n,
"CFL");
84 std::string outname = IncNav->GetSessionName();
86 outname +=
"_CFLStep";
87 IncNav->ResetSessionName(outname);
90 catch (
const std::runtime_error &)
94 catch (
const std::string &eStr)
96 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
The above copyright notice and this permission notice shall be included.
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.