69 const std::map<std::string, std::string> &pParams)
72 ParamMap::const_iterator it;
75 it = pParams.find(
"MovingAverage");
76 if (it == pParams.end())
82 std::string sOption = it->second.c_str();
83 m_movAvg = (boost::iequals(sOption,
"true")) ||
84 (boost::iequals(sOption,
"yes"));
93 it = pParams.find(
"alpha");
94 if (it == pParams.end())
96 it = pParams.find(
"tau");
97 if (it == pParams.end())
99 ASSERTL0(
false,
"MovingAverage needs either alpha or tau.");
108 m_session->LoadParameter(
"TimeStep", dT);
119 it = pParams.find(
"tau");
120 if (it != pParams.end())
123 "Cannot define both alpha and tau in MovingAverage.");
138 int dim = pFields.num_elements() - 1;
139 int nExtraFields = dim == 2 ? 3 : 6;
140 int origFields = pFields.num_elements();
143 m_fields.resize(origFields + nExtraFields);
146 for (
int n = 0; n <
m_fields.size(); ++n)
150 for (
int n = 0; n <
m_delta.size(); ++n)
161 for (
int j = 0; j <
m_fields.size(); ++j)
164 if (pFields[0]->GetWaveSpace())
175 int dim = pFields.num_elements() - 1;
176 int origFields = pFields.num_elements();
179 for (
int n = 0; n < origFields; ++n)
181 m_variables.push_back(pFields[n]->GetSession()->GetVariable(n));
200 ASSERTL0(
false,
"Unsupported dimension");
209 int nq = pFields[0]->GetTotPoints();
210 int dim = pFields.num_elements() - 1;
211 bool waveSpace = pFields[0]->GetWaveSpace();
222 NekDouble facOld, facAvg, facStress, facDelta;
225 facOld = 1.0 - alpha;
234 facStress = nSamples / (nSamples - 1);
235 facDelta = 1.0 / nSamples;
242 for (n = 0; n < dim; ++n)
246 pFields[n]->HomogeneousBwdTrans(pFields[n]->GetPhys(), vel);
250 vel = pFields[n]->GetPhys();
259 pFields[dim]->GetCoeffs(),
274 for (i = 0, n = dim + 1; i < dim; ++i)
276 for (j = i; j < dim; ++j, ++n)
289 int dim = pFields.num_elements() - 1;
295 bool waveSpace = pFields[0]->GetWaveSpace();
296 pFields[0]->SetWaveSpace(
false);
299 for (
int i = 0; i <
m_fields.size(); ++i)
308 pFields[0]->SetWaveSpace(waveSpace);
LibUtilities::FieldMetaDataMap m_fieldMetaData
#define ASSERTL0(condition, msg)
virtual void v_FillVariablesName(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields)
SOLVER_UTILS_EXPORT ~FilterReynoldsStresses()
std::vector< Array< OneD, NekDouble > > m_outFields
virtual SOLVER_UTILS_EXPORT void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
virtual NekDouble v_GetScale()
unsigned int m_sampleFrequency
virtual void v_ProcessSample(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
NekDouble Evaluate() const
static FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::map< std::string, std::string > &pParams)
Creates an instance of this class.
virtual void v_PrepareOutput(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
void Svtvm(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x - y
SOLVER_UTILS_EXPORT FilterReynoldsStresses(const LibUtilities::SessionReaderSharedPtr &pSession, const std::map< std::string, std::string > &pParams)
std::vector< Array< OneD, NekDouble > > m_delta
LibUtilities::SessionReaderSharedPtr m_session
std::vector< Array< OneD, NekDouble > > m_fields
static std::string className
Name of the class.
virtual void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
FilterFactory & GetFilterFactory()
void Svtsvtp(int n, const T alpha, const T *x, int incx, const T beta, const T *y, int incy, T *z, int incz)
vvtvvtp (scalar times vector plus scalar times vector):
std::vector< std::string > m_variables
unsigned int m_numSamples
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.