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 .xml file for input \n");
28 session = LibUtilities::SessionReader::CreateInstance(argc, argv);
31 session->LoadSolverInfo(
"Driver", vDriverModule,
"Standard");
44 int nfields = fields.num_elements();
45 int nexp = fields[0]->GetExpSize();
49 cout <<
"Max CFL: "<< cfl[elmtid] <<
" In element " << elmtid << endl;
52 for(n = 0; n < nfields; ++n)
54 if(session->GetVariable(n) ==
"p")
60 ASSERTL0(n != nfields,
"Could not find field named p in m_fields");
65 for(i = 0; i < fields[n]->GetExpSize(); ++i)
67 nquad = fields[n]->GetExp(i)->GetTotPoints();
72 fields[n]->FwdTrans_IterPerExp(fields[n]->GetPhys(),fields[n]->UpdateCoeffs());
75 session->SetVariable(n,
"CFL");
78 std::string outname = IncNav->GetSessionName();
80 outname +=
"_CFLStep";
81 IncNav->ResetSessionName(outname);
85 catch (
const std::runtime_error&)
89 catch (
const std::string& eStr)
91 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.
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.