35 #ifndef FIELDUTILS_FIELD
36 #define FIELDUTILS_FIELD
79 std::vector<LibUtilities::FieldDefinitionsSharedPtr>
m_fielddef;
80 std::vector<std::vector<double> >
m_data;
81 std::vector<MultiRegions::ExpListSharedPtr>
m_exp;
107 int NumHomogeneousDir,
bool fldfilegiven =
false)
113 int expdim =
m_graph->GetMeshDimension();
114 bool dealiasing =
false;
123 "Quasi-3D approach is only set up for 1 or 2 "
124 "homogeneous directions");
126 if (NumHomogeneousDir == 1)
143 m_session->LoadParameter(
"HomModesZ", nplanes);
158 ASSERTL0(
false,
"ContField2DHomogeneous1D or "
159 "DisContField2DHomogenenous1D has "
160 "not been implemented");
170 else if (NumHomogeneousDir == 2)
174 int nylines, nzlines;
189 m_session->LoadParameter(
"HomModesY", nylines);
190 m_session->LoadParameter(
"HomModesZ", nzlines);
211 AllocateSharedPtr(
m_session, BkeyY, BkeyZ, ly, lz,
220 AllocateSharedPtr(
m_session, BkeyY, BkeyZ, ly, lz,
229 AllocateSharedPtr(
m_session, BkeyY, BkeyZ, ly, lz,
270 "NumHomogeneousDir is only set up for 1");
272 if (NumHomogeneousDir == 1)
307 m_session->LoadParameter(
"HomModesZ", nplanes);
415 ASSERTL0(
false,
"Expansion dimension not recognised");
434 std::string filename)
438 auto it =
m_fld.find(fmt);
440 if (it ==
m_fld.end())
454 int NumHomogeneousDir,
455 std::string var =
"DefaultVar",
456 bool NewField =
false)
466 switch (
m_graph->GetMeshDimension())
470 if (NumHomogeneousDir == 1)
474 "ContField2DHomogeneous1D or "
475 "DisContField2DHomogenenous1D has not been "
479 std::dynamic_pointer_cast<
485 else if (NumHomogeneousDir == 2)
490 std::dynamic_pointer_cast<
496 AllocateSharedPtr(*tmp2);
501 tmp2 = std::dynamic_pointer_cast<
507 AllocateSharedPtr(*tmp2);
512 std::dynamic_pointer_cast<
517 AllocateSharedPtr(*tmp2);
525 std::dynamic_pointer_cast<
534 std::dynamic_pointer_cast<
543 std::dynamic_pointer_cast<
554 if (NumHomogeneousDir == 1)
560 bool dealiasing =
false;
566 ->GetHomogeneousBasis()
574 tmp2 = std::dynamic_pointer_cast<
578 ASSERTL0(tmp2,
"Failed to type cast m_exp[0]");
581 AllocateSharedPtr(*tmp2,
m_graph, var);
588 bool dealiasing =
false;
594 ->GetHomogeneousBasis()
602 tmp2 = std::dynamic_pointer_cast<
605 ASSERTL0(tmp2,
"Failed to type cast m_exp[0]");
609 AllocateSharedPtr(*tmp2);
616 bool dealiasing =
false;
622 ->GetHomogeneousBasis()
630 std::dynamic_pointer_cast<
633 ASSERTL0(tmp2,
"Failed to type cast m_exp[0]");
637 AllocateSharedPtr(*tmp2);
654 std::dynamic_pointer_cast<
671 std::dynamic_pointer_cast<
681 std::dynamic_pointer_cast<
702 std::dynamic_pointer_cast<
719 std::dynamic_pointer_cast<
729 std::dynamic_pointer_cast<MultiRegions::ExpList3D>(
738 ASSERTL0(
false,
"Expansion dimension not recognised");
751 m_fielddef = std::vector<LibUtilities::FieldDefinitionsSharedPtr>();
752 m_data = std::vector<std::vector<NekDouble> > ();
759 std::map<std::string, LibUtilities::FieldIOSharedPtr>
m_fld;
#define ASSERTL0(condition, msg)
#define FIELD_UTILS_EXPORT
Describes the specification for a Basis.
static const std::string GetFileType(const std::string &filename, CommSharedPtr comm)
Determine file type of given input file.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Defines a specification for a set of points.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Abstraction of a global continuous one-dimensional spectral/hp element expansion which approximates t...
This class is the abstraction of a global continuous two- dimensional spectral/hp element expansion w...
This class is the abstraction of a global discontinuous two- dimensional spectral/hp element expansio...
This class is the abstraction of a one-dimensional multi-elemental expansions which is merely a colle...
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
Abstraction of a one-dimensional multi-elemental expansion which is merely a collection of local expa...
Abstraction of a three-dimensional multi-elemental expansion which is merely a collection of local ex...
std::shared_ptr< Field > FieldSharedPtr
std::shared_ptr< FieldIO > FieldIOSharedPtr
std::map< std::string, std::string > FieldMetaDataMap
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< PtsField > PtsFieldSharedPtr
static PtsFieldSharedPtr NullPtsField
FieldIOFactory & GetFieldIOFactory()
Returns the FieldIO factory.
@ eFourierEvenlySpaced
1D Evenly-spaced points using Fourier Fit
@ ePolyEvenlySpaced
1D Evenly-spaced points using Lagrange polynomial
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
@ eFourierSingleMode
Fourier ModifiedExpansion with just the first mode .
@ eFourierHalfModeRe
Fourier Modified expansions with just the real part of the first mode
@ eFourier
Fourier Expansion .
std::shared_ptr< DisContField1D > DisContField1DSharedPtr
std::shared_ptr< ContField1D > ContField1DSharedPtr
std::shared_ptr< ExpList3D > ExpList3DSharedPtr
Shared pointer to an ExpList3D object.
std::shared_ptr< DisContField3DHomogeneous2D > DisContField3DHomogeneous2DSharedPtr
std::shared_ptr< DisContField2D > DisContField2DSharedPtr
std::shared_ptr< DisContField3DHomogeneous1D > DisContField3DHomogeneous1DSharedPtr
std::shared_ptr< ExpList2D > ExpList2DSharedPtr
Shared pointer to an ExpList2D object.
std::shared_ptr< ContField3DHomogeneous2D > ContField3DHomogeneous2DSharedPtr
std::shared_ptr< ContField3DHomogeneous1D > ContField3DHomogeneous1DSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< DisContField3D > DisContField3DSharedPtr
std::shared_ptr< ExpList2DHomogeneous1D > ExpList2DHomogeneous1DSharedPtr
Shared pointer to an ExpList2DHomogeneous1D object.
std::shared_ptr< ExpList1D > ExpList1DSharedPtr
Shared pointer to an ExpList1D object.
std::shared_ptr< ContField2D > ContField2DSharedPtr
std::shared_ptr< ContField3D > ContField3DSharedPtr
std::shared_ptr< ExpList3DHomogeneous2D > ExpList3DHomogeneous2DSharedPtr
Shared pointer to an ExpList3DHomogeneous2D object.
std::shared_ptr< ExpList3DHomogeneous1D > ExpList3DHomogeneous1DSharedPtr
Shared pointer to an ExpList3DHomogeneous1D object.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
FIELD_UTILS_EXPORT MultiRegions::ExpListSharedPtr SetUpFirstExpList(int NumHomogeneousDir, bool fldfilegiven=false)
FIELD_UTILS_EXPORT MultiRegions::ExpListSharedPtr AppendExpList(int NumHomogeneousDir, std::string var="DefaultVar", bool NewField=false)
bool m_requireBoundaryExpansion
bool m_declareExpansionAsDisContField
SpatialDomains::MeshGraphSharedPtr m_graph
std::vector< std::string > m_variables
std::vector< unsigned int > m_bndRegionsToWrite
LibUtilities::SessionReaderSharedPtr m_session
std::map< std::string, LibUtilities::FieldIOSharedPtr > m_fld
Map to store FieldIO instances. Key is the reader type, value is the FieldIO object.
std::map< std::string, std::vector< std::string > > m_inputfiles
FIELD_UTILS_EXPORT Field()
bool m_declareExpansionAsContField
FIELD_UTILS_EXPORT void ClearField()
std::vector< LibUtilities::FieldDefinitionsSharedPtr > m_fielddef
LibUtilities::PtsFieldSharedPtr m_fieldPts
FIELD_UTILS_EXPORT ~Field()
std::vector< std::vector< double > > m_data
std::vector< MultiRegions::ExpListSharedPtr > m_exp
LibUtilities::CommSharedPtr m_comm
FIELD_UTILS_EXPORT LibUtilities::FieldIOSharedPtr FieldIOForFile(std::string filename)
Construct a FieldIO object for the file filename.
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap