12 int main(
int argc,
char *argv[])
16 fprintf(stderr,
"Usage: ./CflStep file.xml \n");
17 fprintf(stderr,
"\t Method will read intiial conditions section of .xml file for input \n");
30 session->LoadSolverInfo(
"Driver", vDriverModule,
"Standard");
43 int nfields = fields.num_elements();
44 int nexp = fields[0]->GetExpSize();
48 cout <<
"Max CFL: "<< cfl[elmtid] <<
" In element " << elmtid << endl;
51 for(n = 0; n < nfields; ++n)
53 if(session->GetVariable(n) ==
"p")
59 ASSERTL0(n != nfields,
"Could not find field named p in m_fields");
64 for(i = 0; i < fields[n]->GetExpSize(); ++i)
66 nquad = fields[n]->GetExp(i)->GetTotPoints();
71 fields[n]->FwdTrans_IterPerExp(fields[n]->GetPhys(),fields[n]->UpdateCoeffs());
74 session->SetVariable(n,
"CFL");
77 std::string outname = IncNav->GetSessionName();
79 outname +=
"_CFLStep";
80 IncNav->ResetSessionName(outname);
84 catch (
const std::runtime_error&)
88 catch (
const std::string& eStr)
90 cout <<
"Error: " << eStr << endl;
#define ASSERTL0(condition, msg)
boost::shared_ptr< Driver > DriverSharedPtr
A shared pointer to a Driver object.
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
boost::shared_ptr< IncNavierStokes > IncNavierStokesSharedPtr
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
int Imax(int n, const T *x, const int incx)
Return the index of the maximum element in x.
int main(int argc, char *argv[])
boost::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
static SessionReaderSharedPtr CreateInstance(int argc, char *argv[])
Creates an instance of the SessionReader class.
This class is the base class for Navier Stokes problems.
DriverFactory & GetDriverFactory()
SOLVER_UTILS_EXPORT void SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
Initialise the data in the dependent fields.