44 RegisterCreatorFunction(
"Absorption",
46 "Forcing Absorption");
51 m_hasRefFlowTime(false)
57 const unsigned int& pNumForcingFields,
58 const TiXmlElement* pForce)
61 int npts = pFields[0]->GetTotPoints();
63 const TiXmlElement* funcNameElmt;
64 funcNameElmt = pForce->FirstChildElement(
"COEFF");
65 ASSERTL0(funcNameElmt,
"Requires COEFF tag, specifying function "
66 "name which prescribes absorption layer coefficient.");
68 string funcName = funcNameElmt->GetText();
70 "Function '" + funcName +
"' not defined.");
72 std::string s_FieldStr;
79 "Variable '" + s_FieldStr +
"' not defined.");
83 m_Absorption[i], funcName);
86 funcNameElmt = pForce->FirstChildElement(
"REFFLOW");
89 string funcName = funcNameElmt->GetText();
91 "Function '" + funcName +
"' not defined.");
98 "Variable '" + s_FieldStr +
"' not defined.");
101 m_Refflow[i], funcName);
106 funcNameElmt = pForce->FirstChildElement(
"REFFLOWTIME");
123 std::string s_FieldStr;
149 outarray[i], 1, outarray[i], 1);
159 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)
ForcingAbsorption(const LibUtilities::SessionReaderSharedPtr &pSession)
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
static std::string className
Name of the class.
static SOLVER_UTILS_EXPORT ForcingSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce)
Creates an instance of this class.
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.