14 int main(
int argc,
char *argv[])
18 fprintf(stderr,
"Usage: ./NonLinearEnergy file.xml \n");
19 fprintf(stderr,
"\t Method will read intiial conditions section of .xml file for input \n");
29 session = LibUtilities::SessionReader::CreateInstance(argc, argv);
32 session->LoadSolverInfo(
"Driver", vDriverModule,
"Standard");
43 int nConvectiveFields = IncNav->GetNConvectiveFields();
44 int nphys = fields[0]->GetTotPoints();
48 for(i = 0; i < nConvectiveFields; ++i)
50 VelFields[i] = fields[i]->UpdatePhys();
54 boost::shared_ptr<NavierStokesAdvection>
A
59 cout <<
"Must use non-linear Navier-Stokes advection" << endl;
64 A->Advect(nConvectiveFields, fields,
70 for(i = 0; i < nConvectiveFields; ++i)
72 fields[i]->FwdTrans_IterPerExp(NonLinear[i],fields[i]->UpdateCoeffs());
76 for(
int n = 0; n < fields[i]->GetExpSize(); ++n)
78 int offset = fields[i]->GetCoeff_Offset(n);
79 int ncoeffs = fields[i]->GetExp(n)->GetNcoeffs();
82 fields[i]->GetExp(n)->ReduceOrderCoeffs(fields[i]->GetExp(n)->GetBasisNumModes(0)-1,fields[i]->GetCoeffs()+offset,coeffsred);
84 Vmath::Vsub(ncoeffs,fields[i]->GetCoeffs()+offset,1,
85 coeffsred,1,tmp = fields[i]->UpdateCoeffs()+
91 string name =
"NL_TopMode_"+session->GetVariable(i);
92 session->SetVariable(i,name.c_str());
97 std::string outname = IncNav->GetSessionName();
99 outname +=
"_NonLinear_Energy";
100 IncNav->ResetSessionName(outname);
104 catch (
const std::runtime_error&)
108 catch (
const std::string& eStr)
110 cout <<
"Error: " << eStr << endl;
int main(int argc, char *argv[])
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.
boost::shared_ptr< IncNavierStokes > IncNavierStokesSharedPtr
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
boost::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
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.