56 ParamMap::const_iterator it;
59 it = pParams.find(
"OutputFile");
60 if (it == pParams.end())
66 ASSERTL0(it->second.length() > 0,
"Missing parameter 'OutputFile'.");
76 it = pParams.find(
"OutputFrequency");
77 if (it == pParams.end())
90 m_session->MatchSolverInfo(
"CalculatePerturbationEnergy",
"True",
100 it = pParams.find(
"OutputPlane");
101 if (it == pParams.end())
134 if (vComm->GetRank() == 0)
175 int colrank = vComm->GetColumnComm()->GetRank();
176 int nproc = vComm->GetColumnComm()->GetSize();
193 ASSERTL0(
false,
"Stability analysis module not "
194 "implemented for the Compressible Flow "
195 "Solver. Please remove the function BaseFlow "
196 "from your .xml file");
205 GetFunctionFilename(
"BaseFlow", 0);
208 for (
int i = 0; i < pFields.num_elements()-1; ++i)
211 pFields[i]->GetCoeffs(), 1,
212 m_base [i]->GetCoeffs(), 1,
213 pFields[i]->UpdateCoeffs(), 1);
215 energy_tmp = pFields[i]->HomogeneousEnergy();
217 energy, 1, energy, 1);
220 pFields[i]->GetCoeffs(), 1,
221 m_base[i]->GetCoeffs(), 1,
222 pFields[i]->UpdateCoeffs(), 1);
235 for (
int i = 1; i < pFields.num_elements()-1; ++i)
237 energy_tmp = pFields[i]->HomogeneousEnergy();
239 energy, 1, energy, 1);
246 for (
int i = 0; i < pFields.num_elements()-1; ++i)
248 energy_tmp = pFields[i]->HomogeneousEnergy();
250 energy, 1, energy, 1);
260 for (j = 0; j < energy.num_elements(); ++j, ++m)
264 << setw(18) << energy[j] << endl;
267 for (
int i = 1; i < nproc; ++i)
269 vComm->GetColumnComm()->Recv(i, energy);
271 for (j = 0; j < energy.num_elements(); ++j, ++m)
275 << setw(18) << energy[j] << endl;
281 vComm->GetColumnComm()->Send(0, energy);
287 ASSERTL0(
false,
"3D Homogeneous 2D energy "
288 "dumping not implemented yet");
300 for (
int i = 1; i < pFields.num_elements()-1; ++i)
302 pFields[i]->SetPhysState(
true);
304 energy += norm * norm;
317 for (
int i = 0; i < pFields.num_elements()-1; ++i)
319 pFields[i]->SetPhysState(
true);
321 energy += norm * norm;
338 if (pFields[0]->GetComm()->GetRank() == 0)
358 if (pFields[field]->GetPhysState() ==
false)
360 pFields[field]->BwdTrans(pFields[field]->GetCoeffs(),
361 pFields[field]->UpdatePhys());
365 L2error = pFields[field]->L2(pFields[field]->GetPhys());
376 int m_expdim = graphShrPtr->GetMeshDimension();
379 if(
m_session->DefinesSolverInfo(
"PROJECTION"))
381 std::string ProjectStr =
m_session->GetSolverInfo(
"PROJECTION");
383 if ((ProjectStr ==
"Continuous") ||
384 (ProjectStr ==
"Galerkin") ||
385 (ProjectStr ==
"CONTINUOUS") ||
386 (ProjectStr ==
"GALERKIN"))
390 else if ((ProjectStr ==
"MixedCGDG") ||
391 (ProjectStr ==
"Mixed_CG_Discontinuous"))
395 else if(ProjectStr ==
"DisContinuous")
401 ASSERTL0(
false,
"PROJECTION value not recognised");
406 cerr <<
"Projection type not specified in SOLVERINFO,"
407 "defaulting to continuous Galerkin" << endl;
411 if (
m_session->DefinesSolverInfo(
"ModeType"))
413 m_session->MatchSolverInfo(
"ModeType",
"SingleMode",
415 m_session->MatchSolverInfo(
"ModeType",
"HalfMode",
417 m_session->MatchSolverInfo(
"ModeType",
"MultipleModes",
422 m_session->MatchSolverInfo(
"DEALIASING",
"True",
427 m_session->MatchSolverInfo(
"DEALIASING",
"On",
432 if (
m_session->DefinesSolverInfo(
"ModeType"))
448 ASSERTL0(
false,
"SolverInfo ModeType not valid");
463 for(i = 0; i <
m_base.num_elements(); i++)
484 for (i = 0 ; i <
m_base.num_elements(); i++)
494 m_base[i]->SetWaveSpace(
true);
507 for (i = 0 ; i <
m_base.num_elements(); i++)
517 m_base[i]->SetWaveSpace(
true);
528 for (i = 0 ; i <
m_base.num_elements(); i++)
538 m_base[i]->SetWaveSpace(
false);
553 for (i = 1 ; i < m_base.num_elements(); i++)
557 *firstbase, graphShrPtr,
570 for (i = 1 ; i < m_base.num_elements(); i++)
574 *firstbase, graphShrPtr,
580 ASSERTL0(
false,
"Expansion dimension not recognised");
592 for (i = 0 ; i <
m_base.num_elements(); i++)
603 for (i = 0 ; i <
m_base.num_elements(); i++)
615 ASSERTL0(
false,
"Expansion dimension not recognised");
628 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
629 std::vector<std::vector<NekDouble> > FieldData;
632 m_fld->Import(pInfile,FieldDef,FieldData);
634 int nvar =
m_session->GetVariables().size();
635 if(
m_session->DefinesSolverInfo(
"HOMOGENEOUS"))
637 std::string HomoStr =
m_session->GetSolverInfo(
"HOMOGENEOUS");
640 for (
int j = 0; j < nvar; ++j)
642 for (
int i = 0; i < FieldDef.size(); ++i)
645 FieldDef[i]->m_fields[j] ==
m_session->GetVariable(j);
647 ASSERTL0(flag, (std::string(
"Order of ") + pInfile
648 + std::string(
" data and that defined in "
649 "m_boundaryconditions differs")).c_str());
651 m_base[j]->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
652 FieldDef[i]->m_fields[j],
653 m_base[j]->UpdateCoeffs());
static FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const ParamMap &pParams)
#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.
static std::string className
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()
SOLVER_UTILS_EXPORT FilterModalEnergy(const LibUtilities::SessionReaderSharedPtr &pSession, const ParamMap &pParams)
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