47 RegisterCreatorFunction(
"Noise",
49 "White Noise Forcing");
51 ForcingNoise::ForcingNoise(
59 const unsigned int& pNumForcingFields,
60 const TiXmlElement* pForce)
63 int nq = pFields[0]->GetTotPoints();
65 const TiXmlElement* noiseElmt = pForce->FirstChildElement(
"WHITENOISE");
66 ASSERTL0(noiseElmt,
"Requires WHITENOISE tag specifying "
67 "magnitude of white noise force.");
69 string noiseValue = noiseElmt->GetText();
74 const TiXmlElement* freqElmt = pForce->FirstChildElement(
"UPDATEFREQ");
77 string freqValue = freqElmt->GetText();
86 const TiXmlElement* stepsElmt = pForce->FirstChildElement(
"NSTEPS");
89 string stepsValue = stepsElmt->GetText();
90 m_numSteps = boost::lexical_cast<
int>(stepsValue);
101 int seed = -
m_session->GetComm()->GetRank();
138 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)
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
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
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.