49 const std::map<std::string, std::string> &pParams) :
50 Filter(pSession), m_index(0), m_homogeneous(false), m_planes()
53 if (pParams.find(
"OutputFile") == pParams.end())
59 ASSERTL0(!(pParams.find(
"OutputFile")->second.empty()),
60 "Missing parameter 'OutputFile'.");
61 outName = pParams.find(
"OutputFile")->second;
64 m_comm = pSession->GetComm();
66 if (
m_comm->GetRank() == 0)
72 ASSERTL0(pParams.find(
"OutputFrequency") != pParams.end(),
73 "Missing parameter 'OutputFrequency'.");
75 pParams.find(
"OutputFrequency")->second.c_str());
84 const Array<OneD, const MultiRegions::ExpListSharedPtr> &pFields,
91 "Homogeneous 2D expansion not supported"
103 areaField = pFields[0]->GetPlane(0);
107 areaField = pFields[0];
110 Array<OneD, NekDouble> inarray(areaField->GetNpoints(), 1.0);
111 m_area = areaField->Integral(inarray);
123 const Array<OneD, const MultiRegions::ExpListSharedPtr> &pFields,
126 int i, nPoints = pFields[0]->GetNpoints(), nPlanePts = 0;
130 nPlanePts = pFields[0]->GetPlane(0)->GetNpoints();
141 Array<OneD, NekDouble> tmp(nPoints);
142 Array<OneD, Array<OneD, NekDouble> > u(3);
143 for (i = 0; i < 3; ++i)
147 pFields[i]->HomogeneousBwdTrans(pFields[i]->GetPhys(), tmp);
151 tmp = pFields[i]->GetPhys();
154 u[i] = Array<OneD, NekDouble>(nPoints);
160 pFields[i]->HomogeneousFwdTrans(tmp, tmp);
161 Ek += pFields[i]->GetPlane(0)->Integral(tmp) * 2.0 * M_PI;
165 Ek += pFields[i]->Integral(tmp);
171 if (
m_comm->GetRank() == 0)
173 m_outFile << setw(10) << time << setw(20) << Ek;
176 bool waveSpace[3] = {
177 pFields[0]->GetWaveSpace(),
178 pFields[1]->GetWaveSpace(),
179 pFields[2]->GetWaveSpace()
184 for (i = 0; i < 3; ++i)
186 pFields[i]->SetWaveSpace(
false);
191 Array<OneD, NekDouble> tmp2(nPoints), tmp3(nPoints);
193 for (i = 0; i < 3; ++i)
195 int f1 = (i+2) % 3, c2 = f1;
196 int c1 = (i+1) % 3, f2 = c1;
197 pFields[f1]->PhysDeriv(c1, u[f1], tmp2);
198 pFields[f2]->PhysDeriv(c2, u[f2], tmp3);
200 Vmath::Vvtvp(nPoints, tmp2, 1, tmp2, 1, tmp, 1, tmp, 1);
205 for (i = 0; i < 3; ++i)
207 pFields[i]->SetWaveSpace(waveSpace[i]);
209 pFields[0]->HomogeneousFwdTrans(tmp, tmp);
210 Ek = pFields[0]->GetPlane(0)->Integral(tmp) * 2 * M_PI;
214 Ek = pFields[0]->Integral(tmp);
219 if (
m_comm->GetRank() == 0)
226 const Array<OneD, const MultiRegions::ExpListSharedPtr> &pFields,