63 const unsigned int &pNumForcingFields,
64 const TiXmlElement *pForce)
68 "Wavyness implemented just for 3D Homogenous 1D expansions.");
75 int phystot = pFields[0]->GetTotPoints();
82 for (
int i = 0; i < m_wavyGeom.num_elements(); i++)
87 const TiXmlElement* funcNameElmt;
88 funcNameElmt = pForce->FirstChildElement(
"WAVYNESS");
89 ASSERTL0(funcNameElmt,
"Requires WAVYNESS tag, specifying function "
90 "name which prescribes wavy function.");
92 string funcName = funcNameElmt->GetText();
94 "Function '" + funcName +
"' not defined.");
96 std::string s_FieldStr =
m_session->GetVariable(0);
98 "Variable '" + s_FieldStr +
"' not defined.");
104 for (
int i = 1; i < 4; i++)
107 m_wavyGeom[i - 1], m_wavyGeom[i]);
110 Vmath::Vmul(phystot, m_wavyGeom[1], 1, m_wavyGeom[1], 1,
112 Vmath::Vmul(phystot, m_wavyGeom[1], 1, m_wavyGeom[2], 1,
144 int np = fields[0]->GetNpoints();
146 Array<OneD, NekDouble> U, V, W, P, tmp1, tmp2, tmp3, Wz, Wzz, Px;
161 fields[0]->HomogeneousBwdTrans(fields[0]->GetPhys(), U);
162 fields[0]->HomogeneousBwdTrans(fields[1]->GetPhys(), V);
163 fields[0]->HomogeneousBwdTrans(fields[2]->GetPhys(), W);
164 fields[0]->HomogeneousBwdTrans(fields[3]->GetPhys(), P);
169 fields[3]->GetPhys(), tmp2);
171 fields[0]->HomogeneousBwdTrans(tmp2, tmp3);
193 fields[2]->GetPhys(), tmp1);
197 fields[0]->HomogeneousBwdTrans(tmp1, Wz);
199 fields[0]->HomogeneousBwdTrans(tmp2, Wzz);
218 fields[0]->GetPhys(), tmp1);
222 fields[0]->HomogeneousBwdTrans(tmp2, tmp1);
233 fields[0]->HomogeneousFwdTrans(tmp2,
m_Forcing[0]);
250 fields[1]->GetPhys(), tmp3);
254 fields[0]->HomogeneousBwdTrans(tmp2, tmp1);
264 fields[0]->HomogeneousFwdTrans(tmp1,
m_Forcing[1]);
296 fields[0]->HomogeneousFwdTrans(tmp2,
m_Forcing[2]);
void CalculateForcing(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields)
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.
Array< OneD, Array< OneD, NekDouble > > m_Forcing
Evaluated forcing function.
#define ASSERTL0(condition, msg)
Array< OneD, Array< OneD, NekDouble > > m_wavyGeom
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))
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.
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.
MultiRegions::Direction const DirCartesianMap[]
int m_NumVariable
Number of variables.
ForcingWavyness(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)
Defines a forcing term to be explicitly applied.
virtual SOLVER_UTILS_EXPORT void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce)
static std::string className
Name of the class.
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.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.