45 const std::weak_ptr<SolverUtils::EquationSystem> &pEquation,
47 :
Filter(pSession, pEquation)
50 auto it = pParams.find(
"OutputFile");
51 if (it == pParams.end())
57 ASSERTL0(it->second.length() > 0,
"Missing parameter 'OutputFile'.");
62 it = pParams.find(
"OutputFrequency");
63 ASSERTL0(it != pParams.end(),
"Missing parameter 'OutputFrequency'.");
81 "Cell model has not been set by EquationSystem "
82 "class. Use SetCellModel on this filter to achieve this.");
99 std::stringstream vOutputFilename;
104 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
105 pFields[0]->GetFieldDefinitions();
106 std::vector<std::vector<NekDouble>> FieldData(FieldDef.size());
110 for (
size_t j = 1; j <
m_cell->GetNumCellVariables(); ++j)
112 varName =
m_cell->GetCellVarName(j);
114 for (
size_t i = 0; i < FieldDef.size(); ++i)
120 FieldDef[i]->m_fields.push_back(varName);
121 pFields[0]->AppendFieldData(FieldDef[i], FieldData[i], data);
127 fieldMetaDataMap[
"Time"] = boost::lexical_cast<std::string>(time);
129 m_fld->Write(vOutputFilename.str(), FieldDef, FieldData, fieldMetaDataMap);
#define ASSERTL0(condition, msg)
FilterCheckpointCellModel(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< SolverUtils::EquationSystem > &pEquation, const ParamMap &pParams)
void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
static std::string className
Name of the class.
void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
LibUtilities::FieldIOSharedPtr m_fld
void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
static SolverUtils::FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< SolverUtils::EquationSystem > &pEquation, const ParamMap &pParams)
Creates an instance of this class.
~FilterCheckpointCellModel() override
bool v_IsTimeDependent() override
CellModelSharedPtr m_cell
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.
LibUtilities::SessionReaderSharedPtr m_session
std::map< std::string, std::string > ParamMap
std::map< std::string, std::string > FieldMetaDataMap
std::shared_ptr< SessionReader > SessionReaderSharedPtr
FilterFactory & GetFilterFactory()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr