45 const std::shared_ptr<EquationSystem> &pEquation,
const ParamMap &pParams)
46 :
Filter(pSession, pEquation)
49 auto it = pParams.find(
"OutputFile");
50 if (it == pParams.end())
56 ASSERTL0(it->second.length() > 0,
"Empty parameter 'OutputFile'.");
61 it = pParams.find(
"OutputFrequency");
62 ASSERTL0(it != pParams.end(),
"Missing parameter 'OutputFrequency'.");
67 it = pParams.find(
"OutputStartTime");
68 if (it == pParams.end())
105 std::stringstream vOutputFilename;
108 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
109 pFields[0]->GetFieldDefinitions();
110 std::vector<std::vector<NekDouble>> FieldData(FieldDef.size());
113 for (
int j = 0; j < pFields.size(); ++j)
115 for (
int i = 0; i < FieldDef.size(); ++i)
118 FieldDef[i]->m_fields.push_back(
m_session->GetVariable(j));
119 pFields[0]->AppendFieldData(FieldDef[i], FieldData[i],
120 pFields[j]->UpdateCoeffs());
123 m_fld->Write(vOutputFilename.str(), FieldDef, FieldData);
#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.
SOLVER_UTILS_EXPORT ~FilterCheckpoint() override
SOLVER_UTILS_EXPORT FilterCheckpoint(const LibUtilities::SessionReaderSharedPtr &pSession, const std::shared_ptr< EquationSystem > &pEquation, const ParamMap &pParams)
static FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::shared_ptr< EquationSystem > &pEquation, const std::map< std::string, std::string > &pParams)
Creates an instance of this class.
NekDouble m_outputStartTime
void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
bool v_IsTimeDependent() override
void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
LibUtilities::FieldIOSharedPtr m_fld
unsigned int m_outputFrequency
unsigned int m_outputIndex
void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
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()