35#include <boost/core/ignore_unused.hpp>
49 const std::weak_ptr<EquationSystem> &pEquation,
const ParamMap &pParams)
50 :
Filter(pSession, pEquation)
53 auto it = pParams.find(
"OutputFile");
54 if (it == pParams.end())
60 ASSERTL0(it->second.length() > 0,
"Empty parameter 'OutputFile'.");
65 it = pParams.find(
"OutputFrequency");
66 ASSERTL0(it != pParams.end(),
"Missing parameter 'OutputFrequency'.");
71 it = pParams.find(
"OutputStartTime");
72 if (it == pParams.end())
108 std::stringstream vOutputFilename;
111 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
112 pFields[0]->GetFieldDefinitions();
113 std::vector<std::vector<NekDouble>> FieldData(FieldDef.size());
116 for (
int j = 0; j < pFields.size(); ++j)
118 for (
int i = 0; i < FieldDef.size(); ++i)
121 FieldDef[i]->m_fields.push_back(
m_session->GetVariable(j));
122 pFields[0]->AppendFieldData(FieldDef[i], FieldData[i],
123 pFields[j]->UpdateCoeffs());
126 m_fld->Write(vOutputFilename.str(), FieldDef, FieldData);
134 boost::ignore_unused(pFields, time);
#define ASSERTL0(condition, msg)
NekDouble Evaluate() const
static std::shared_ptr< FieldIO > CreateDefault(const LibUtilities::SessionReaderSharedPtr session)
Returns an object for the default FieldIO method.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
NekDouble m_outputStartTime
virtual void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
virtual bool v_IsTimeDependent() override
virtual void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
virtual SOLVER_UTILS_EXPORT ~FilterCheckpoint()
LibUtilities::FieldIOSharedPtr m_fld
unsigned int m_outputFrequency
unsigned int m_outputIndex
virtual void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
SOLVER_UTILS_EXPORT FilterCheckpoint(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< EquationSystem > &pEquation, const ParamMap &pParams)
static FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< EquationSystem > &pEquation, const std::map< std::string, std::string > &pParams)
Creates an instance of this class.
static std::string className
Name of the class.
LibUtilities::SessionReaderSharedPtr m_session
std::map< std::string, std::string > ParamMap
std::shared_ptr< SessionReader > SessionReaderSharedPtr
FilterFactory & GetFilterFactory()
The above copyright notice and this permission notice shall be included.