47 const std::weak_ptr<SolverUtils::EquationSystem> &pEquation)
54 const unsigned int &pNumForcingFields,
const TiXmlElement *pForce)
60 ASSERTL0(pFields[0]->GetGraph()->GetSpaceDimension() == 1,
61 "ForcingQuasi1D requires a 1D problem.");
63 const TiXmlElement *funcNameElmt = pForce->FirstChildElement(
"AREAFCN");
67 "Requires AREAFCN tag "
68 "specifying function name which prescribes nozzle area.");
71 string funcName = funcNameElmt->GetText();
73 "Function '" + funcName +
"' not defined.");
79 std::string sFieldStr =
m_session->GetVariable(0);
81 "Variable '" + sFieldStr +
"' not defined.");
86 const TiXmlElement *dAFuncNameElmt = pForce->FirstChildElement(
"DADXFCN");
89 funcName = dAFuncNameElmt->GetText();
91 "Function '" + funcName +
"' not defined.");
93 "Variable '" + sFieldStr +
"' not defined.");
95 ->Evaluate(sFieldStr, tmp, 0.0);
126 int nPoints = pFields[0]->GetTotPoints();
131 Vmath::Vadd(nPoints, tmp, 1, inarray[2], 1, tmp, 1);
#define ASSERTL0(condition, msg)
void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce) override
VariableConverterSharedPtr m_varConv
Array< OneD, NekDouble > m_geomFactor
static SolverUtils::ForcingSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< SolverUtils::EquationSystem > &pEquation, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce)
Creates an instance of this class.
void v_Apply(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble &time) override
ForcingQuasi1D(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< SolverUtils::EquationSystem > &pEquation)
static std::string className
Name of the class.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Defines a forcing term to be explicitly applied.
int m_NumVariable
Number of variables.
Array< OneD, Array< OneD, NekDouble > > m_Forcing
Evaluated forcing function.
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const LibUtilities::SessionReaderSharedPtr &pSession, std::string pName, bool pCache=false)
Get a SessionFunction by name.
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
MultiRegions::Direction const DirCartesianMap[]
ForcingFactory & GetForcingFactory()
Declaration of the forcing factory singleton.
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 Neg(int n, T *x, const int incx)
Negate x = -x.
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 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.