46 const std::map<std::string, std::string> &pParams,
47 const bool pConstDensity)
50 m_homogeneous (false),
52 m_constDensity(pConstDensity)
55 if (pParams.find(
"OutputFile") == pParams.end())
61 ASSERTL0(!(pParams.find(
"OutputFile")->second.empty()),
62 "Missing parameter 'OutputFile'.");
63 outName = pParams.find(
"OutputFile")->second;
66 m_comm = pSession->GetComm();
68 if (
m_comm->GetRank() == 0)
72 m_outFile.setf(ios::scientific, ios::floatfield);
76 <<
"# ---------------------------------------------"
82 ASSERTL0(pParams.find(
"OutputFrequency") != pParams.end(),
83 "Missing parameter 'OutputFrequency'.");
85 pParams.find(
"OutputFrequency")->second.c_str());
94 const Array<OneD, const MultiRegions::ExpListSharedPtr> &pFields,
101 "Homogeneous 2D expansion not supported"
102 "for energy filter");
113 areaField = pFields[0]->GetPlane(0);
117 areaField = pFields[0];
120 Array<OneD, NekDouble> inarray(areaField->GetNpoints(), 1.0);
121 m_area = areaField->Integral(inarray);
133 const Array<OneD, const MultiRegions::ExpListSharedPtr> &pFields,
136 int i, nPoints = pFields[0]->GetNpoints();
147 Array<OneD, NekDouble> tmp(nPoints, 0.0);
148 Array<OneD, Array<OneD, NekDouble> > u(3);
149 for (i = 0; i < 3; ++i)
151 u[i] = Array<OneD, NekDouble>(nPoints);
157 pFields[i]->HomogeneousBwdTrans(u[i], u[i]);
160 Vmath::Vvtvp(nPoints, u[i], 1, u[i], 1, tmp, 1, tmp, 1);
170 Array<OneD, NekDouble> tmp2(nPoints, 0.0);
171 pFields[0]->HomogeneousFwdTrans(tmp, tmp2);
172 Ek = pFields[0]->GetPlane(0)->Integral(tmp2) * 2.0 * M_PI;
176 Ek = pFields[0]->Integral(tmp);
181 if (
m_comm->GetRank() == 0)
183 m_outFile << setw(17) << setprecision(8) << time
184 << setw(22) << setprecision(11) << Ek;
187 bool waveSpace[3] = {
188 pFields[0]->GetWaveSpace(),
189 pFields[1]->GetWaveSpace(),
190 pFields[2]->GetWaveSpace()
195 for (i = 0; i < 3; ++i)
197 pFields[i]->SetWaveSpace(
false);
202 Array<OneD, NekDouble> tmp2(nPoints), tmp3(nPoints);
204 for (i = 0; i < 3; ++i)
206 int f1 = (i+2) % 3, c2 = f1;
207 int c1 = (i+1) % 3, f2 = c1;
208 pFields[f1]->PhysDeriv(c1, u[f1], tmp2);
209 pFields[f2]->PhysDeriv(c2, u[f2], tmp3);
211 Vmath::Vvtvp(nPoints, tmp2, 1, tmp2, 1, tmp, 1, tmp, 1);
221 for (i = 0; i < 3; ++i)
223 pFields[i]->SetWaveSpace(waveSpace[i]);
225 pFields[0]->HomogeneousFwdTrans(tmp, tmp);
226 Ek = pFields[0]->GetPlane(0)->Integral(tmp) * 2 * M_PI;
230 Ek = pFields[0]->Integral(tmp);
235 if (
m_comm->GetRank() == 0)
237 m_outFile << setw(22) << setprecision(11) << Ek << endl;
242 const Array<OneD, const MultiRegions::ExpListSharedPtr> &pFields,
254 const Array<OneD, const MultiRegions::ExpListSharedPtr> &pFields,
256 Array<OneD, NekDouble> &velocity)
258 ASSERTL0(
false,
"Needs to implemented by subclass");
262 const Array<OneD, const MultiRegions::ExpListSharedPtr> &pFields)
264 ASSERTL0(
false,
"Needs to implemented by subclass");
265 return Array<OneD, NekDouble>();