46 RegisterCreatorFunction(
"Absorption",
47 ForcingAbsorption::create,
48 "Forcing Absorption");
53 m_hasRefFlowTime(false)
59 const unsigned int& pNumForcingFields,
60 const TiXmlElement* pForce)
63 int npts = pFields[0]->GetTotPoints();
65 const TiXmlElement* funcNameElmt;
66 funcNameElmt = pForce->FirstChildElement(
"COEFF");
67 ASSERTL0(funcNameElmt,
"Requires COEFF tag, specifying function "
68 "name which prescribes absorption layer coefficient.");
70 string funcName = funcNameElmt->GetText();
72 "Function '" + funcName +
"' not defined.");
74 std::string s_FieldStr;
81 "Variable '" + s_FieldStr +
"' not defined.");
85 m_Absorption[i], funcName);
88 funcNameElmt = pForce->FirstChildElement(
"REFFLOW");
91 string funcName = funcNameElmt->GetText();
93 "Function '" + funcName +
"' not defined.");
100 "Variable '" + s_FieldStr +
"' not defined.");
103 m_Refflow[i], funcName);
108 funcNameElmt = pForce->FirstChildElement(
"REFFLOWTIME");
125 std::string s_FieldStr;
151 outarray[i], 1, outarray[i], 1);
161 outarray[i], 1, outarray[i], 1);
SOLVER_UTILS_EXPORT void EvaluateTimeFunction(LibUtilities::SessionReaderSharedPtr pSession, std::string pFieldName, Array< OneD, NekDouble > &pArray, const std::string &pFunctionName, NekDouble pTime=NekDouble(0))
Array< OneD, Array< OneD, NekDouble > > m_Forcing
Evaluated forcing function.
#define ASSERTL0(condition, msg)
virtual SOLVER_UTILS_EXPORT 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)
ForcingFactory & GetForcingFactory()
Declaration of the forcing factory singleton.
SOLVER_UTILS_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))
Array< OneD, Array< OneD, NekDouble > > m_Absorption
std::string m_funcNameTime
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Array< OneD, Array< OneD, NekDouble > > m_Refflow
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
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.
int m_NumVariable
Number of variables.
virtual SOLVER_UTILS_EXPORT void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce)
Defines a forcing term to be explicitly applied.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
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 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.