78 m_equ[0]->PrintSummary(out);
79 m_equ[0]->DoInitialise();
84 if (
m_session->GetSolverInfo(
"EqType") ==
"EulerCFE" ||
85 m_session->GetSolverInfo(
"EqType") ==
"NavierStokesCFE")
90 Array<OneD, Array<OneD, NekDouble> > q0(
NumVar_SFD);
91 Array<OneD, Array<OneD, NekDouble> > q1(
NumVar_SFD);
92 Array<OneD, Array<OneD, NekDouble> > qBar0(
NumVar_SFD);
93 Array<OneD, Array<OneD, NekDouble> > qBar1(
NumVar_SFD);
101 m_session->LoadParameter(
"TOL", TOL, 1.0e-08);
118 cout <<
"------------------ SFD Parameters ------------------" << endl;
119 cout <<
"\tX = " <<
m_X0 << endl;
120 cout <<
"\tDelta = " <<
m_Delta0 << endl;
121 cout <<
"----------------------------------------------------" << endl;
123 m_equ[0]->SetStepsToOne();
124 ofstream
m_file(
"ConvergenceHistory.txt", ios::out | ios::trunc);
128 q0[i] = Array<OneD, NekDouble> (
m_equ[0]->GetTotPoints(), 0.0);
129 qBar0[i] = Array<OneD, NekDouble> (
m_equ[0]->GetTotPoints(), 0.0);
130 m_equ[0]->CopyFromPhysField(i, qBar0[i]);
145 m_equ[0]->CopyFromPhysField(i, q0[i]);
151 m_equ[0]->CopyToPhysField(i, q1[i]);
169 cout <<
"\nFINAL Filter Width: Delta = " <<
m_Delta <<
"; FINAL Control Coeff: X = " <<
m_X <<
"\n" << endl;
182 for(
int i = 0; i <
m_equ[0]->GetNvariables(); ++i)
186 if (
m_comm->GetRank() == 0)
188 out <<
"L 2 error (variable " <<
m_equ[0]->GetVariable(i) <<
") : " << vL2Error << endl;
189 out <<
"L inf error (variable " <<
m_equ[0]->GetVariable(i) <<
") : " << vLinfError << endl;
196 const Array<
OneD,
const Array<OneD, NekDouble> > &q0,
197 const Array<
OneD,
const Array<OneD, NekDouble> > &qBar0,
198 Array<
OneD, Array<OneD, NekDouble> > &q1,
199 Array<
OneD, Array<OneD, NekDouble> > &qBar1)
201 q1[i] = Array<OneD, NekDouble> (
m_equ[0]->GetTotPoints(),0.0);
202 qBar1[i] = Array<OneD, NekDouble> (
m_equ[0]->GetTotPoints(),0.0);
205 Vmath::Svtvp(q1[i].num_elements(),
F11, q0[i], 1, q1[i], 1, q1[i], 1 );
206 Vmath::Svtvp(q1[i].num_elements(),
F12, qBar0[i], 1, q1[i], 1, q1[i], 1 );
208 Vmath::Svtvp(qBar1[i].num_elements(),
F21, q0[i], 1, qBar1[i], 1, qBar1[i], 1 );
209 Vmath::Svtvp(qBar1[i].num_elements(),
F22, qBar0[i], 1, qBar1[i], 1, qBar1[i], 1 );
214 const Array<
OneD,
const Array<OneD, NekDouble> > &q0,
220 Array<OneD, NekDouble > NormDiff_q_qBar(
NumVar_SFD, 1.0);
221 Array<OneD, NekDouble > NormDiff_q1_q0(
NumVar_SFD, 1.0);
223 MaxNormDiff_q_qBar=0.0;
224 MaxNormDiff_q1_q0=0.0;
231 NormDiff_q_qBar[i] =
m_equ[0]->LinfError(i, qBar1[i]);
234 NormDiff_q1_q0[i] =
m_equ[0]->LinfError(i, q0[i]);
236 if (MaxNormDiff_q_qBar < NormDiff_q_qBar[i])
238 MaxNormDiff_q_qBar = NormDiff_q_qBar[i];
241 if (MaxNormDiff_q1_q0 < NormDiff_q1_q0[i])
243 MaxNormDiff_q1_q0 = NormDiff_q1_q0[i];
248 MPI_Comm_rank(MPI_COMM_WORLD,&
MPIrank);
251 cout <<
"SFD (MPI) - Step: " <<
m_n+1 <<
"; Time: " <<
m_equ[0]->GetFinalTime() <<
"; |q-qBar|inf = " << MaxNormDiff_q_qBar <<
"; |q1-q0|inf = " << MaxNormDiff_q1_q0 <<
";\t for X = " <<
m_X0 <<
" and Delta = " <<
m_Delta0 <<endl;
252 std::ofstream
m_file(
"ConvergenceHistory.txt", std::ios_base::app);
253 m_file <<
m_n+1 <<
"\t" <<
m_equ[0]->GetFinalTime() <<
"\t" << MaxNormDiff_q_qBar <<
"\t" << MaxNormDiff_q1_q0 << endl;
257 cout <<
"SFD - Step: " <<
m_n+1 <<
"; Time: " <<
m_equ[0]->GetFinalTime() <<
"; |q-qBar|inf = " << MaxNormDiff_q_qBar <<
"; |q1-q0|inf = " << MaxNormDiff_q1_q0 <<
";\t for X = " <<
m_X0 <<
" and Delta = " <<
m_Delta0 <<endl;
258 std::ofstream
m_file(
"ConvergenceHistory.txt", std::ios_base::app);
259 m_file <<
m_n+1 <<
"\t" <<
m_equ[0]->GetFinalTime() <<
"\t" << MaxNormDiff_q_qBar <<
"\t" << MaxNormDiff_q1_q0 << endl;