35#include <boost/core/ignore_unused.hpp>
40#include <boost/algorithm/string/predicate.hpp>
46namespace GlobalMapping
61 : m_session(pSession), m_fields(pFields)
86 ASSERTL0(0,
"Dimension not supported");
103 const TiXmlElement *pMapping)
105 boost::ignore_unused(pFields);
107 int phystot =
m_fields[0]->GetTotPoints();
113 for (
int i = 0; i < 3; i++)
121 const TiXmlElement *timeDep = pMapping->FirstChildElement(
"TIMEDEPENDENT");
124 string sTimeDep = timeDep->GetText();
126 (boost::iequals(sTimeDep,
"yes"));
134 string fieldNames[3] = {
"x",
"y",
"z"};
135 const TiXmlElement *funcNameElmt = pMapping->FirstChildElement(
"COORDS");
140 "Function '" +
m_funcName +
"' not defined.");
143 m_fields[0]->GetCoords(coords[0], coords[1], coords[2]);
145 std::string s_FieldStr;
148 for (
int i = 0; i < 3; i++)
150 s_FieldStr = fieldNames[i];
159 "3DH1D does not support mapping in the z-direction.");
171 m_fields[0]->GetCoords(coords[0], coords[1], coords[2]);
172 for (
int i = 0; i < 3; i++)
183 string velFieldNames[3] = {
"vx",
"vy",
"vz"};
184 const TiXmlElement *velFuncNameElmt = pMapping->FirstChildElement(
"VEL");
191 std::string s_FieldStr;
194 for (
int i = 0; i < 3; i++)
196 s_FieldStr = velFieldNames[i];
205 "3DH1D does not support mapping in the z-direction.");
217 for (
int i = 0; i < 3; i++)
228 for (
int i = 0; i < nvel; i++)
231 for (
int j = 0; j < nvel; j++)
252 TiXmlElement *vMapping = NULL;
254 if (
m_session->DefinesElement(
"Nektar/Mapping"))
256 vMapping =
m_session->GetElement(
"Nektar/Mapping");
278 TiXmlElement *vMapping = NULL;
280 if (pSession->DefinesElement(
"Nektar/Mapping"))
282 vMapping = pSession->GetElement(
"Nektar/Mapping");
283 vType = vMapping->Attribute(
"TYPE");
286 vMapping, pSession->GetTimeLevel());
290 vType =
"Translation";
311 const std::string &outname)
316 fieldMetaDataMap[
"MappingCartesianVel"] = std::string(
"False");
320 fieldMetaDataMap[
"MappingType"] = std::string(
"Expression");
321 fieldMetaDataMap[
"MappingExpression"] =
m_funcName;
329 int expdim =
m_fields[0]->GetGraph()->GetMeshDimension();
330 string fieldNames[3] = {
"x",
"y",
"z"};
331 string velFieldNames[3] = {
"vx",
"vy",
"vz"};
333 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
335 std::vector<std::vector<NekDouble>> FieldData(FieldDef.size());
337 int ncoeffs =
m_fields[0]->GetNcoeffs();
340 bool wavespace =
m_fields[0]->GetWaveSpace();
343 for (
int j = 0; j < expdim; ++j)
347 for (
int i = 0; i < FieldDef.size(); ++i)
350 FieldDef[i]->m_fields.push_back(fieldNames[j]);
351 m_fields[0]->AppendFieldData(FieldDef[i], FieldData[i],
359 for (
int j = 0; j < expdim; ++j)
363 for (
int i = 0; i < FieldDef.size(); ++i)
366 FieldDef[i]->m_fields.push_back(velFieldNames[j]);
367 m_fields[0]->AppendFieldData(FieldDef[i], FieldData[i],
373 std::string outfile = outname;
374 outfile.erase(outfile.end() - 4, outfile.end());
377 m_fld->Write(outfile, FieldDef, FieldData, fieldMetaDataMap);
380 fieldMetaDataMap[
"MappingType"] = std::string(
"File");
381 fieldMetaDataMap[
"FileName"] = outfile;
383 m_fields[0]->SetWaveSpace(wavespace);
393 ASSERTL0(pSession->DefinesFunction(pFunctionName),
394 "Function '" + pFunctionName +
"' does not exist.");
397 pSession->GetFunction(pFunctionName, pFieldName);
403 ffunc->Evaluate(x0, x1, x2, pTime, pArray);
412 ASSERTL0(pSession->DefinesFunction(pFunctionName),
413 "Function '" + pFunctionName +
"' does not exist.");
415 unsigned int nq = pFields[0]->GetNpoints();
416 if (pArray.size() != nq)
422 vType = pSession->GetFunctionType(pFunctionName, pFieldName);
429 pFields[0]->GetCoords(x0, x1, x2);
431 pSession->GetFunction(pFunctionName, pFieldName);
433 ffunc->Evaluate(x0, x1, x2, pTime, pArray);
437 std::string filename =
438 pSession->GetFunctionFilename(pFunctionName, pFieldName);
440 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
441 std::vector<std::vector<NekDouble>> FieldData;
447 fld->Import(filename, FieldDef, FieldData);
450 for (
int i = 0; i < FieldDef.size(); ++i)
452 for (
int j = 0; j < FieldDef[i]->m_fields.size(); ++j)
454 if (FieldDef[i]->
m_fields[j] == pFieldName)
462 pFields[0]->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
468 cout <<
"Field " + pFieldName +
" not found." << endl;
471 pFields[0]->BwdTrans(vCoeffs, pArray);
489 if (inarray == outarray)
491 int physTot =
m_fields[0]->GetTotPoints();
494 for (
int i = 0; i < nvel; i++)
520 if (inarray == outarray)
522 int physTot =
m_fields[0]->GetTotPoints();
525 for (
int i = 0; i < nvel; i++)
551 if (inarray == outarray)
553 int physTot =
m_fields[0]->GetTotPoints();
556 for (
int i = 0; i < nvel; i++)
582 if (inarray == outarray)
584 int physTot =
m_fields[0]->GetTotPoints();
587 for (
int i = 0; i < nvel; i++)
612 if (inarray == outarray)
614 int physTot =
m_fields[0]->GetTotPoints();
617 for (
int i = 0; i < nvel; i++)
642 if (inarray == outarray)
644 int physTot =
m_fields[0]->GetTotPoints();
647 for (
int i = 0; i < nvel; i++)
663 int physTot =
m_fields[0]->GetTotPoints();
676 int physTot =
m_fields[0]->GetTotPoints();
689 int physTot =
m_fields[0]->GetTotPoints();
695 bool wavespace =
m_fields[0]->GetWaveSpace();
707 Vmath::Vvtvp(physTot, inarray[i], 1, wk, 1, outarray, 1, outarray,
710 m_fields[0]->SetWaveSpace(wavespace);
717 int physTot =
m_fields[0]->GetTotPoints();
724 for (
int i = 0; i < nvel; i++)
727 for (
int j = 0; j < nvel; j++)
729 Vmath::Vvtvp(physTot, g[i * nvel + j], 1, inarray[j], 1,
730 outarray[i], 1, outarray[i], 1);
738 int physTot =
m_fields[0]->GetTotPoints();
745 for (
int i = 0; i < nvel; i++)
748 for (
int j = 0; j < nvel; j++)
750 Vmath::Vvtvp(physTot, g[i * nvel + j], 1, inarray[j], 1,
751 outarray[i], 1, outarray[i], 1);
759 int physTot =
m_fields[0]->GetTotPoints();
765 bool wavespace =
m_fields[0]->GetWaveSpace();
774 Vmath::Vmul(physTot, Jac, 1, inarray[i], 1, wk, 1);
777 Vmath::Vadd(physTot, wk, 1, outarray, 1, outarray, 1);
779 Vmath::Vdiv(physTot, outarray, 1, Jac, 1, outarray, 1);
781 m_fields[0]->SetWaveSpace(wavespace);
788 int physTot =
m_fields[0]->GetTotPoints();
794 bool wavespace =
m_fields[0]->GetWaveSpace();
799 for (
int i = 0; i < nvel; i++)
804 m_wk2[i * nvel + 1]);
811 for (
int k = 0; k < nvel; k++)
814 m_wk1[i * nvel + k], 1);
818 for (
int i = 0; i < nvel; i++)
820 for (
int k = 0; k < nvel; k++)
822 tmp[k] =
m_wk1[i * nvel + k];
825 for (
int j = 0; j < nvel; j++)
836 for (
int i = 0; i < nvel; i++)
839 for (
int j = 0; j < nvel; j++)
852 for (
int i = 0; i < nvel; i++)
854 for (
int p = 0;
p < nvel;
p++)
859 for (
int j = 0; j < nvel; j++)
867 for (
int j = 0; j < nvel; j++)
869 for (
int p = 0;
p < nvel;
p++)
874 for (
int i = 0; i < nvel; i++)
882 m_fields[0]->SetWaveSpace(wavespace);
888 int physTot =
m_fields[0]->GetTotPoints();
894 for (
int i = 0; i < nvel * nvel * nvel; i++)
900 bool wavespace =
m_fields[0]->GetWaveSpace();
905 for (
int i = 0; i < nvel; i++)
910 m_wk2[i * nvel + 1]);
917 for (
int j = 0; j < nvel; j++)
920 m_wk1[i * nvel + j], 1);
929 for (
int i = 0; i < nvel; i++)
931 for (
int j = 0; j < nvel; j++)
937 outarray[i * nvel * nvel + j * nvel + 0],
938 outarray[i * nvel * nvel + j * nvel + 1]);
944 outarray[i * nvel * nvel + j * nvel + 0],
945 outarray[i * nvel * nvel + j * nvel + 1],
946 outarray[i * nvel * nvel + j * nvel + 2]);
952 for (
int i = 0; i < nvel; i++)
954 for (
int p = 0;
p < nvel;
p++)
959 for (
int j = 0; j < nvel; j++)
961 for (
int k = 0; k < nvel; k++)
963 Vmath::Vsub(physTot, outarray[i * nvel * nvel + j * nvel + k],
964 1,
m_wk2[j * nvel + k], 1,
965 outarray[i * nvel * nvel + j * nvel + k], 1);
971 for (
int j = 0; j < nvel; j++)
973 for (
int p = 0;
p < nvel;
p++)
978 for (
int i = 0; i < nvel; i++)
980 for (
int k = 0; k < nvel; k++)
982 Vmath::Vadd(physTot, outarray[i * nvel * nvel + j * nvel + k],
983 1,
m_wk2[i * nvel + k], 1,
984 outarray[i * nvel * nvel + j * nvel + k], 1);
990 m_fields[0]->SetWaveSpace(wavespace);
995 const bool generalized)
997 int physTot =
m_fields[0]->GetTotPoints();
1001 bool wavespace =
m_fields[0]->GetWaveSpace();
1014 for (
int i = 0; i < nvel; ++i)
1016 for (
int k = 0; k < nvel; ++k)
1019 for (
int j = 0; j < nvel; ++j)
1021 tmp[j] = ddU[i * nvel * nvel + j * nvel + k];
1024 for (
int p = 0;
p < nvel; ++
p)
1027 ddU[i * nvel * nvel +
p * nvel + k], 1);
1032 for (
int i = 0; i < nvel; ++i)
1035 for (
int k = 0; k < nvel; ++k)
1038 ddU[k * nvel * nvel + i * nvel + k], 1, outarray[i],
1041 ddU[i * nvel * nvel + k * nvel + k], 1, outarray[i],
1048 m_fields[0]->CurlCurl(inarray, outarray);
1052 m_fields[0]->SetWaveSpace(wavespace);
1057 int physTot =
m_fields[0]->GetTotPoints();
1060 int nbnds =
m_fields[0]->GetBndConditions().size();
1069 for (
int i = 0; i < nfields; i++)
1077 for (
int i = 0; i < nvel; i++)
1090 for (
int dir = 0; dir < 3; dir++)
1097 for (
int n = 0; n < nbnds; ++n)
1100 for (
int i = 0; i < nfields; ++i)
1102 BndConds =
m_fields[i]->GetBndConditions();
1103 BndExp =
m_fields[i]->GetBndCondExpansions();
1104 if (BndConds[n]->GetBoundaryConditionType() ==
1107 isDirichlet[i] =
true;
1112 for (
int j = 0; j < nvel; ++j)
1115 ->GetBndConditions()[n]
1116 ->GetBoundaryConditionType() ==
1118 "Mapping only supported when all velocity "
1119 "components have the same type of boundary "
1125 "Time-dependent Dirichlet boundary conditions not "
1126 "supported with mapping yet.");
1130 std::static_pointer_cast<
1132 ->m_dirichletCondition;
1134 condition.
Evaluate(coords[0], coords[1], coords[2], time,
1139 isDirichlet[i] =
false;
1145 for (
int i = 0; i < nvel; ++i)
1150 for (
int i = 0; i < nvel; ++i)
1157 for (
int i = 0; i < nfields; ++i)
1159 BndConds =
m_fields[i]->GetBndConditions();
1160 BndExp =
m_fields[i]->GetBndCondExpansions();
1162 if (BndConds[n]->GetUserDefined() ==
"" ||
1163 BndConds[n]->GetUserDefined() ==
"MovingBody")
1165 m_fields[i]->ExtractPhysToBnd(n, values[i],
1166 BndExp[n]->UpdatePhys());
1169 if ((i < nvel) && BndConds[n]->GetUserDefined() ==
"MovingBody")
1173 BndExp[n]->GetTotPoints());
1174 m_fields[i]->ExtractPhysToBnd(n, coordVel[i], coordVelBnd);
1177 Vmath::Vadd(BndExp[n]->GetTotPoints(), coordVelBnd, 1,
1178 BndExp[n]->UpdatePhys(), 1,
1179 BndExp[n]->UpdatePhys(), 1);
1186 for (
int i = 0; i <
m_fields.size(); ++i)
1189 BndConds =
m_fields[i]->GetBndConditions();
1190 BndExp =
m_fields[i]->GetBndCondExpansions();
1192 for (
int n = 0; n < BndConds.size(); ++n)
1194 if (BndConds[n]->GetBoundaryConditionType() ==
1197 if (BndConds[n]->GetUserDefined() ==
"" ||
1198 BndConds[n]->GetUserDefined() ==
"MovingBody")
1202 BndExp[n]->SetWaveSpace(
false);
1205 BndExp[n]->FwdTransBndConstrained(
1206 BndExp[n]->GetPhys(), BndExp[n]->UpdateCoeffs());
1219 std::string s_FieldStr;
1220 string fieldNames[3] = {
"x",
"y",
"z"};
1221 string velFieldNames[3] = {
"vx",
"vy",
"vz"};
1225 for (
int i = 0; i < 3; i++)
1227 s_FieldStr = fieldNames[i];
1236 "3DH1D does not support mapping in the z-direction.");
1239 s_FieldStr = velFieldNames[i];
1248 "3DH1D does not support mapping in the z-direction.");
1255 int physTot =
m_fields[0]->GetTotPoints();
1258 for (
int i = 0; i < 3; i++)
1263 for (
int i = 0; i < nvel; i++)
#define ASSERTL0(condition, msg)
bool m_fromFunction
Flag defining if the Mapping is defined by a function.
int m_nConvectiveFields
Number of velocity components.
static MappingSharedPtr m_mappingPtr
virtual GLOBAL_MAPPING_EXPORT void v_GetCartesianCoordinates(Array< OneD, NekDouble > &out0, Array< OneD, NekDouble > &out1, Array< OneD, NekDouble > &out2)
GLOBAL_MAPPING_EXPORT void LowerIndex(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Lower index of vector: .
GLOBAL_MAPPING_EXPORT void EvaluateTimeFunction(LibUtilities::SessionReaderSharedPtr pSession, std::string pFieldName, Array< OneD, NekDouble > &pArray, const std::string &pFunctionName, NekDouble pTime=NekDouble(0))
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
GLOBAL_MAPPING_EXPORT void ContravarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Convert a contravariant vector to the Cartesian system.
GLOBAL_MAPPING_EXPORT void GetInvMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)
Get the inverse of metric tensor .
virtual GLOBAL_MAPPING_EXPORT void v_UpdateBCs(const NekDouble time)
GLOBAL_MAPPING_EXPORT void GetCartesianCoordinates(Array< OneD, NekDouble > &out0, Array< OneD, NekDouble > &out1, Array< OneD, NekDouble > &out2)
Get the Cartesian coordinates in the field.
GLOBAL_MAPPING_EXPORT void gradgradU(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Second order covariant derivatives of a contravariant vector.
GLOBAL_MAPPING_EXPORT bool IsTimeDependent()
Get flag defining if mapping is time-dependent.
Array< OneD, Array< OneD, NekDouble > > m_wk2
virtual GLOBAL_MAPPING_EXPORT void v_CurlCurlField(Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const bool generalized)
GLOBAL_MAPPING_EXPORT void UpdateGeomInfo()
Recompute the metric terms of the Mapping.
Array< OneD, Array< OneD, NekDouble > > m_coords
Array with the Cartesian coordinates.
Array< OneD, Array< OneD, NekDouble > > m_coordsVel
Array with the velocity of the coordinates.
virtual GLOBAL_MAPPING_EXPORT void v_RaiseIndex(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
std::string m_velFuncName
Name of the function containing the velocity of the coordinates.
GLOBAL_MAPPING_EXPORT void InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
Initialise the mapping object.
virtual GLOBAL_MAPPING_EXPORT void v_LowerIndex(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
GLOBAL_MAPPING_EXPORT void Output(LibUtilities::FieldMetaDataMap &fieldMetaDataMap, const std::string &outname)
Output function called when a chk or fld file is written.
GLOBAL_MAPPING_EXPORT void GetMetricTensor(Array< OneD, Array< OneD, NekDouble > > &outarray)
Get the metric tensor .
Array< OneD, Array< OneD, NekDouble > > m_wk1
GLOBAL_MAPPING_EXPORT void ContravarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Convert a contravariant vector to the transformed system.
virtual GLOBAL_MAPPING_EXPORT void v_GetCoordVelocity(Array< OneD, Array< OneD, NekDouble > > &outarray)
GLOBAL_MAPPING_EXPORT void EvaluateFunction(Array< OneD, MultiRegions::ExpListSharedPtr > pFields, LibUtilities::SessionReaderSharedPtr pSession, std::string pFieldName, Array< OneD, NekDouble > &pArray, const std::string &pFunctionName, NekDouble pTime=NekDouble(0))
virtual GLOBAL_MAPPING_EXPORT void v_gradgradU(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
virtual GLOBAL_MAPPING_EXPORT void v_ContravarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
LibUtilities::FieldIOSharedPtr m_fld
virtual GLOBAL_MAPPING_EXPORT void v_Divergence(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
virtual GLOBAL_MAPPING_EXPORT void v_CovarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
GLOBAL_MAPPING_EXPORT bool HasConstantJacobian()
Get flag defining if mapping has constant Jacobian.
GLOBAL_MAPPING_EXPORT void CovarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Convert a covariant vector to the Cartesian system.
GLOBAL_MAPPING_EXPORT void ReplaceField(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Replace the Expansion List used by the mapping.
virtual GLOBAL_MAPPING_EXPORT void v_CovarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
GLOBAL_MAPPING_EXPORT void RaiseIndex(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Raise index of vector: .
GLOBAL_MAPPING_EXPORT void ApplyChristoffelContravar(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Apply the Christoffel symbols to a contravariant vector.
virtual GLOBAL_MAPPING_EXPORT void v_DotGradJacobian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &outarray)
GLOBAL_MAPPING_EXPORT void GetCoordVelocity(Array< OneD, Array< OneD, NekDouble > > &outarray)
Obtain the velocity of the coordinates.
std::string m_funcName
Name of the function containing the coordinates.
static GLOBAL_MAPPING_EXPORT MappingSharedPtr Load(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Return a pointer to the mapping, creating it on first call.
GLOBAL_MAPPING_EXPORT void CovarFromCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Convert a covariant vector to the transformed system.
GLOBAL_MAPPING_EXPORT void GetJacobian(Array< OneD, NekDouble > &outarray)
Get the Jacobian of the transformation.
GLOBAL_MAPPING_EXPORT Mapping(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Constructor.
virtual GLOBAL_MAPPING_EXPORT void v_VelocityLaplacian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble alpha)
virtual GLOBAL_MAPPING_EXPORT void v_ContravarToCartesian(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0
virtual GLOBAL_MAPPING_EXPORT void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pMapping)
GLOBAL_MAPPING_EXPORT void ApplyChristoffelCovar(const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Apply the Christoffel symbols to a covariant vector.
virtual GLOBAL_MAPPING_EXPORT void v_UpdateMapping(const NekDouble time, const Array< OneD, Array< OneD, NekDouble > > &coords=NullNekDoubleArrayOfArray, const Array< OneD, Array< OneD, NekDouble > > &coordsVel=NullNekDoubleArrayOfArray)
Array< OneD, Array< OneD, NekDouble > > m_tmp
bool m_timeDependent
Flag defining if the Mapping is time-dependent.
NekDouble Evaluate() const
static std::shared_ptr< FieldIO > CreateForFile(const LibUtilities::SessionReaderSharedPtr session, const std::string &filename)
Construct a FieldIO object for a given input filename.
static std::shared_ptr< FieldIO > CreateDefault(const LibUtilities::SessionReaderSharedPtr session)
Returns an object for the default FieldIO method.
Provides a generic Factory class.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
static void GetXMLElementTimeLevel(TiXmlElement *&element, const size_t timeLevel, const bool disableCheck=true)
Get XML elment time level (Parallel-in-Time)
GLOBAL_MAPPING_EXPORT typedef std::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
MappingFactory & GetMappingFactory()
Declaration of the mapping factory singleton.
std::shared_ptr< FieldIO > FieldIOSharedPtr
std::map< std::string, std::string > FieldMetaDataMap
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Equation > EquationSharedPtr
@ eFunctionTypeExpression
MultiRegions::Direction const DirCartesianMap[]
The above copyright notice and this permission notice shall be included.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
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.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
void Zero(int n, T *x, const int incx)
Zero vector.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
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.