9 using namespace Nektar;
10 using namespace Nektar::SolverUtils;
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");
38 Array<OneD, NekDouble> cfl = IncNav->GetElmtCFLVals();
41 Array<OneD, MultiRegions::ExpListSharedPtr> fields = IncNav->UpdateFields();
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");
61 Array<OneD, NekDouble> phys = fields[n]->UpdatePhys();
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;