10 using namespace Nektar;
11 using namespace Nektar::SolverUtils;
13 int main(
int argc,
char *argv[])
17 fprintf(stderr,
"Usage: ./Aliasing file.xml \n");
18 fprintf(stderr,
"\t Method will read intiial conditions section of .xml file for input \n");
31 session->LoadSolverInfo(
"Driver", vDriverModule,
"Standard");
39 Array<OneD, MultiRegions::ExpListSharedPtr> fields = IncNav->UpdateFields();
42 int nConvectiveFields = IncNav->GetNConvectiveFields();
43 int nphys = fields[0]->GetTotPoints();
44 Array<OneD, Array<OneD, NekDouble> > VelFields(nConvectiveFields);
45 Array<OneD, Array<OneD, NekDouble> > NonLinear(nConvectiveFields);
46 Array<OneD, Array<OneD, NekDouble> > NonLinearDealiased(nConvectiveFields);
48 for(i = 0; i < nConvectiveFields; ++i)
50 VelFields[i] = fields[i]->UpdatePhys();
51 NonLinear[i] = Array<OneD, NekDouble> (nphys);
52 NonLinearDealiased[i] = Array<OneD, NekDouble> (nphys);
55 boost::shared_ptr<NavierStokesAdvection> A
60 cout <<
"Must use non-linear Navier-Stokes advection" << endl;
65 A->SetSpecHPDealiasing(
false);
66 A->Advect(nConvectiveFields, fields,
72 A->SetSpecHPDealiasing(
true);
73 A->Advect(nConvectiveFields, fields,
75 NonLinearDealiased, 0.0);
78 for(i = 0; i < nConvectiveFields; ++i)
80 Vmath::Vsub(nphys,NonLinearDealiased[i],1,NonLinear[i],1,NonLinear[i],1);
81 fields[i]->FwdTrans_IterPerExp(NonLinear[i],fields[i]->UpdateCoeffs());
83 string name =
"NL_Aliasing_"+session->GetVariable(i);
84 session->SetVariable(i,name.c_str());
89 std::string outname = IncNav->GetSessionName();
91 outname +=
"_NonLinear_Aliasing";
92 IncNav->ResetSessionName(outname);
96 catch (
const std::runtime_error&)
100 catch (
const std::string& eStr)
102 cout <<
"Error: " << eStr << endl;