49 ParamMap::const_iterator it;
52 it = pParams.find(
"OutputFile");
53 if (it == pParams.end())
59 ASSERTL0(it->second.length() > 0,
"Missing parameter 'OutputFile'.");
64 it = pParams.find(
"SampleFrequency");
65 if (it == pParams.end())
76 it = pParams.find(
"OutputFrequency");
77 if (it == pParams.end())
103 int ncoeff = pFields[0]->GetNcoeffs();
112 m_fieldMetaData[
"InitialTime"] = boost::lexical_cast<std::string>(time);
158 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
159 pFields[0]->GetFieldDefinitions();
160 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
163 int ncoeffs = pFields[0]->GetNcoeffs();
176 pFields[0]->ExtractCoeffsToCoeffs(
180 for (
int i = 0; i < FieldDef.size(); ++i)
183 pFields[0]->AppendFieldData(FieldDef[i], FieldData[i], fieldcoeffs);
190 std::stringstream outname;
198 outname <<
m_outputFile <<
"_" << dump << suffix <<
".fld";
unsigned int m_outputIndex
#define ASSERTL0(condition, msg)
std::vector< Array< OneD, NekDouble > > m_outFields
virtual SOLVER_UTILS_EXPORT void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
unsigned int m_numSamples
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
virtual SOLVER_UTILS_EXPORT std::string v_GetFileSuffix()=0
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
void OutputField(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, int dump=-1)
LibUtilities::FieldMetaDataMap m_fieldMetaData
unsigned int m_sampleFrequency
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
std::vector< std::string > m_variables
NekDouble Evaluate() const
virtual SOLVER_UTILS_EXPORT void v_ProcessSample(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)=0
virtual SOLVER_UTILS_EXPORT void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
LibUtilities::FieldIOSharedPtr m_fld
unsigned int m_outputFrequency
std::map< std::string, std::string > ParamMap
LibUtilities::SessionReaderSharedPtr m_session
SOLVER_UTILS_EXPORT FilterSampler(const LibUtilities::SessionReaderSharedPtr &pSession, const ParamMap &pParams)
virtual SOLVER_UTILS_EXPORT ~FilterSampler()
virtual SOLVER_UTILS_EXPORT void v_PrepareOutput(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
virtual SOLVER_UTILS_EXPORT void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)