45 RegisterCreatorFunction(
"Noise",
47 "White Noise Forcing");
57 const unsigned int& pNumForcingFields,
58 const TiXmlElement* pForce)
61 int nq = pFields[0]->GetTotPoints();
63 const TiXmlElement* noiseElmt = pForce->FirstChildElement(
"WHITENOISE");
64 ASSERTL0(noiseElmt,
"Requires WHITENOISE tag specifying "
65 "magnitude of white noise force.");
67 string noiseValue = noiseElmt->GetText();
72 const TiXmlElement* freqElmt = pForce->FirstChildElement(
"UPDATEFREQ");
75 string freqValue = freqElmt->GetText();
84 const TiXmlElement* stepsElmt = pForce->FirstChildElement(
"NSTEPS");
87 string stepsValue = stepsElmt->GetText();
88 m_numSteps = boost::lexical_cast<
int>(stepsValue);
134 Vmath::Vadd(outarray[i].num_elements(), outarray[i], 1,
virtual SOLVER_UTILS_EXPORT void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce)
ForcingNoise(const LibUtilities::SessionReaderSharedPtr &pSession)
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.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
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.
static std::string className
Name of the class.
int m_NumVariable
Number of variables.
void FillWhiteNoise(int n, const T eps, T *x, const int incx, int outseed)
Fills a vector with white noise.
Defines a forcing term to be explicitly applied.
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.