51 ParamMap::const_iterator it;
54 it = pParams.find(
"OutputFile");
55 if (it == pParams.end())
61 ASSERTL0(it->second.length() > 0,
"Missing parameter 'OutputFile'.");
66 it = pParams.find(
"SampleFrequency");
67 if(it == pParams.end())
78 it = pParams.find(
"OutputFrequency");
79 if(it == pParams.end())
105 int nfield = pFields.num_elements();
106 int ncoeff = pFields[0]->GetNcoeffs();
108 for(
int n =0; n < nfield; ++n)
113 = boost::lexical_cast<std::string>(time);
126 for(
int n = 0; n < pFields.num_elements(); ++n)
136 = boost::lexical_cast<std::string>(time);
156 for(
int n = 0; n <
m_avgFields.num_elements(); ++n)
163 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
164 = pFields[0]->GetFieldDefinitions();
165 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
168 int ncoeffs = pFields[0]->GetNcoeffs();
171 for(
int j = 0; j < pFields.num_elements(); ++j)
181 pFields[0]->ExtractCoeffsToCoeffs(pFields[j],
186 for(
int i = 0; i < FieldDef.size(); ++i)
189 FieldDef[i]->m_fields.push_back(
m_session->GetVariable(j));
190 pFields[0]->AppendFieldData(FieldDef[i],
199 std::stringstream outname;
213 for(
int n = 0; n <
m_avgFields.num_elements(); ++n)
virtual void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
#define ASSERTL0(condition, msg)
LibUtilities::FieldMetaDataMap m_avgFieldMetaData
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
virtual void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
static std::string className
Name of the class.
unsigned int m_numAverages
Array< OneD, Array< OneD, NekDouble > > m_avgFields
void OutputAvgField(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, int dump=-1)
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
virtual void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
static FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::map< std::string, std::string > &pParams)
Creates an instance of this class.
NekDouble Evaluate() const
virtual bool v_IsTimeDependent()
std::map< std::string, std::string > ParamMap
LibUtilities::SessionReaderSharedPtr m_session
unsigned int m_outputFrequency
SOLVER_UTILS_EXPORT FilterAverageFields(const LibUtilities::SessionReaderSharedPtr &pSession, const ParamMap &pParams)
FilterFactory & GetFilterFactory()
unsigned int m_outputIndex
LibUtilities::FieldIOSharedPtr m_fld
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.
virtual SOLVER_UTILS_EXPORT ~FilterAverageFields()
unsigned int m_sampleFrequency
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.