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");
40 Array<OneD, NekDouble> cfl = IncNav->GetElmtCFLVals();
43 Array<OneD, MultiRegions::ExpListSharedPtr> fields = IncNav->UpdateFields();
45 int nfields = fields.num_elements();
46 int nexp = fields[0]->GetExpSize();
50 cout <<
"Max CFL: "<< cfl[elmtid] <<
" In element " << elmtid << endl;
53 for(n = 0; n < nfields; ++n)
55 if(session->GetVariable(n) ==
"p")
61 ASSERTL0(n != nfields,
"Could not find field named p in m_fields");
63 Array<OneD, NekDouble> phys = fields[n]->UpdatePhys();
66 for(i = 0; i < fields[n]->GetExpSize(); ++i)
68 nquad = fields[n]->GetExp(i)->GetTotPoints();
73 fields[n]->FwdTrans_IterPerExp(fields[n]->GetPhys(),fields[n]->UpdateCoeffs());
76 session->SetVariable(n,
"CFL");
79 std::string outname = IncNav->GetSessionName();
81 outname +=
"_CFLStep";
82 IncNav->ResetSessionName(outname);
86 catch (
const std::runtime_error&)
90 catch (
const std::string& eStr)
92 cout <<
"Error: " << eStr << endl;