9 using namespace Nektar;
10 using namespace Nektar::SolverUtils;
12 int main(
int argc,
char *argv[])
16 fprintf(stderr,
"Usage: ./Aliasing 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, MultiRegions::ExpListSharedPtr> fields = IncNav->UpdateFields();
43 int nConvectiveFields = IncNav->GetNConvectiveFields();
44 int nphys = fields[0]->GetTotPoints();
45 Array<OneD, Array<OneD, NekDouble> > VelFields(nConvectiveFields);
46 Array<OneD, Array<OneD, NekDouble> > NonLinear(nConvectiveFields);
47 Array<OneD, Array<OneD, NekDouble> > NonLinearDealiased(nConvectiveFields);
49 for(i = 0; i < nConvectiveFields; ++i)
51 VelFields[i] = fields[i]->UpdatePhys();
52 NonLinear[i] = Array<OneD, NekDouble> (nphys);
53 NonLinearDealiased[i] = Array<OneD, NekDouble> (nphys);
57 IncNav->GetAdvObject()->SetSpecHPDealiasing(
false);
58 IncNav->GetAdvObject()->DoAdvection(fields,nConvectiveFields,
59 IncNav->GetVelocity(), VelFields,
64 IncNav->GetAdvObject()->SetSpecHPDealiasing(
true);
65 IncNav->GetAdvObject()->DoAdvection(fields,nConvectiveFields,
66 IncNav->GetVelocity(), VelFields,
67 NonLinearDealiased, 0.0);
70 for(i = 0; i < nConvectiveFields; ++i)
72 Vmath::Vsub(nphys,NonLinearDealiased[i],1,NonLinear[i],1,NonLinear[i],1);
73 fields[i]->FwdTrans_IterPerExp(NonLinear[i],fields[i]->UpdateCoeffs());
75 string name =
"NL_Aliasing_"+session->GetVariable(i);
76 session->SetVariable(i,name.c_str());
81 std::string outname = IncNav->GetSessionName();
83 outname +=
"_NonLinear_Aliasing";
84 IncNav->ResetSessionName(outname);
88 catch (
const std::runtime_error&)
92 catch (
const std::string& eStr)
94 cout <<
"Error: " << eStr << endl;