48 RegisterCreatorFunction(
"ModalEnergy", FilterModalEnergy::create);
53 FilterModalEnergy::FilterModalEnergy(
58 ParamMap::const_iterator it;
61 it = pParams.find(
"OutputFile");
62 if (it == pParams.end())
68 ASSERTL0(it->second.length() > 0,
"Missing parameter 'OutputFile'.");
78 it = pParams.find(
"OutputFrequency");
79 if (it == pParams.end())
92 m_session->MatchSolverInfo(
"CalculatePerturbationEnergy",
"True",
102 it = pParams.find(
"OutputPlane");
103 if (it == pParams.end())
136 if (vComm->GetRank() == 0)
140 m_session->MatchSolverInfo(
"Driver",
"Adaptive",
186 int colrank = vComm->GetColumnComm()->GetRank();
187 int nproc = vComm->GetColumnComm()->GetSize();
204 ASSERTL0(
false,
"Stability analysis module not "
205 "implemented for the Compressible Flow "
206 "Solver. Please remove the function BaseFlow "
207 "from your .xml file");
216 GetFunctionFilename(
"BaseFlow", 0);
219 for (
int i = 0; i < pFields.num_elements()-1; ++i)
222 pFields[i]->GetCoeffs(), 1,
223 m_base [i]->GetCoeffs(), 1,
224 pFields[i]->UpdateCoeffs(), 1);
226 energy_tmp = pFields[i]->HomogeneousEnergy();
228 energy, 1, energy, 1);
231 pFields[i]->GetCoeffs(), 1,
232 m_base[i]->GetCoeffs(), 1,
233 pFields[i]->UpdateCoeffs(), 1);
246 for (
int i = 1; i < pFields.num_elements()-1; ++i)
248 energy_tmp = pFields[i]->HomogeneousEnergy();
250 energy, 1, energy, 1);
257 for (
int i = 0; i < pFields.num_elements()-1; ++i)
259 energy_tmp = pFields[i]->HomogeneousEnergy();
261 energy, 1, energy, 1);
271 for (j = 0; j < energy.num_elements(); ++j, ++m)
275 << setw(18) << energy[j] << endl;
278 for (
int i = 1; i < nproc; ++i)
280 vComm->GetColumnComm()->Recv(i, energy);
282 for (j = 0; j < energy.num_elements(); ++j, ++m)
286 << setw(18) << energy[j] << endl;
292 vComm->GetColumnComm()->Send(0, energy);
298 ASSERTL0(
false,
"3D Homogeneous 2D energy "
299 "dumping not implemented yet");
311 for (
int i = 1; i < pFields.num_elements()-1; ++i)
313 pFields[i]->SetPhysState(
true);
315 energy += norm * norm;
328 for (
int i = 0; i < pFields.num_elements()-1; ++i)
330 pFields[i]->SetPhysState(
true);
332 energy += norm * norm;
349 if (pFields[0]->GetComm()->GetRank() == 0)
369 if (pFields[field]->GetPhysState() ==
false)
371 pFields[field]->BwdTrans(pFields[field]->GetCoeffs(),
372 pFields[field]->UpdatePhys());
376 L2error = pFields[field]->L2(pFields[field]->GetPhys());
387 int m_expdim = graphShrPtr->GetMeshDimension();
390 if(
m_session->DefinesSolverInfo(
"PROJECTION"))
392 std::string ProjectStr =
m_session->GetSolverInfo(
"PROJECTION");
394 if ((ProjectStr ==
"Continuous") ||
395 (ProjectStr ==
"Galerkin") ||
396 (ProjectStr ==
"CONTINUOUS") ||
397 (ProjectStr ==
"GALERKIN"))
401 else if ((ProjectStr ==
"MixedCGDG") ||
402 (ProjectStr ==
"Mixed_CG_Discontinuous"))
406 else if(ProjectStr ==
"DisContinuous")
412 ASSERTL0(
false,
"PROJECTION value not recognised");
417 cerr <<
"Projection type not specified in SOLVERINFO,"
418 "defaulting to continuous Galerkin" << endl;
422 if (
m_session->DefinesSolverInfo(
"ModeType"))
424 m_session->MatchSolverInfo(
"ModeType",
"SingleMode",
426 m_session->MatchSolverInfo(
"ModeType",
"HalfMode",
428 m_session->MatchSolverInfo(
"ModeType",
"MultipleModes",
433 m_session->MatchSolverInfo(
"DEALIASING",
"True",
438 m_session->MatchSolverInfo(
"DEALIASING",
"On",
443 if (
m_session->DefinesSolverInfo(
"ModeType"))
459 ASSERTL0(
false,
"SolverInfo ModeType not valid");
474 for(i = 0; i <
m_base.num_elements(); i++)
495 for (i = 0 ; i <
m_base.num_elements(); i++)
505 m_base[i]->SetWaveSpace(
true);
518 for (i = 0 ; i <
m_base.num_elements(); i++)
528 m_base[i]->SetWaveSpace(
true);
539 for (i = 0 ; i <
m_base.num_elements(); i++)
549 m_base[i]->SetWaveSpace(
false);
564 for (i = 1 ; i < m_base.num_elements(); i++)
568 *firstbase, graphShrPtr,
581 for (i = 1 ; i < m_base.num_elements(); i++)
585 *firstbase, graphShrPtr,
591 ASSERTL0(
false,
"Expansion dimension not recognised");
603 for (i = 0 ; i <
m_base.num_elements(); i++)
614 for (i = 0 ; i <
m_base.num_elements(); i++)
626 ASSERTL0(
false,
"Expansion dimension not recognised");
639 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
640 std::vector<std::vector<NekDouble> > FieldData;
643 m_fld->Import(pInfile,FieldDef,FieldData);
645 int nvar =
m_session->GetVariables().size();
646 if(
m_session->DefinesSolverInfo(
"HOMOGENEOUS"))
648 std::string HomoStr =
m_session->GetSolverInfo(
"HOMOGENEOUS");
651 for (
int j = 0; j < nvar; ++j)
653 for (
int i = 0; i < FieldDef.size(); ++i)
656 FieldDef[i]->m_fields[j] ==
m_session->GetVariable(j);
658 ASSERTL0(flag, (std::string(
"Order of ") + pInfile
659 + std::string(
" data and that defined in "
660 "m_boundaryconditions differs")).c_str());
662 m_base[j]->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
663 FieldDef[i]->m_fields[j],
664 m_base[j]->UpdateCoeffs());
#define ASSERTL0(condition, msg)
enum MultiRegions::ProjectionType m_projectionType
static boost::shared_ptr< MeshGraph > Read(const LibUtilities::SessionReaderSharedPtr &pSession, DomainRangeShPtr &rng=NullDomainRangeShPtr)
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
unsigned int m_outputFrequency
virtual void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
virtual void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
boost::shared_ptr< ContField2D > ContField2DSharedPtr
Array< OneD, MultiRegions::ExpListSharedPtr > m_base
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
LibUtilities::FieldIOSharedPtr m_fld
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
1D Evenly-spaced points using Fourier Fit
Fourier Modified expansions with just the real part of the first mode .
This class is the abstraction of a global continuous two- dimensional spectral/hp element expansion w...
void SetUpBaseFields(SpatialDomains::MeshGraphSharedPtr &mesh)
NekDouble Evaluate() const
This class is the abstraction of a global discontinuous two- dimensional spectral/hp element expansio...
bool m_homogen_dealiasing
Defines a specification for a set of points.
void ImportFldBase(std::string pInfile, SpatialDomains::MeshGraphSharedPtr pGraph)
std::map< std::string, std::string > ParamMap
LibUtilities::SessionReaderSharedPtr m_session
NekDouble L2Error(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, unsigned int field, const NekDouble &time)
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
virtual void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
1D Non Evenly-spaced points for Single Mode analysis
virtual bool v_IsTimeDependent()
FilterFactory & GetFilterFactory()
virtual SOLVER_UTILS_EXPORT ~FilterModalEnergy()
boost::shared_ptr< ContField3D > ContField3DSharedPtr
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
Describes the specification for a Basis.
std::ofstream m_outputStream
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
unsigned int m_outputPlane