53 const std::map<std::string, std::string> &pParams)
56 ASSERTL0(pParams.find(
"ThresholdValue") != pParams.end(),
57 "Missing parameter 'ThresholdValue'.");
59 ASSERTL0(pParams.find(
"InitialValue") != pParams.end(),
60 "Missing parameter 'InitialValue'.");
61 m_initialValue = atof(pParams.find(
"InitialValue")->second.c_str());
62 ASSERTL0(!(pParams.find(
"OutputFile")->second.empty()),
63 "Missing parameter 'OutputFile'.");
66 if (pParams.find(
"StartTime") != pParams.end())
68 m_startTime = atof(pParams.find(
"StartTime")->second.c_str());
111 NekDouble timestep = pFields[0]->GetSession()->GetParameter(
"TimeStep");
113 for (i = 0; i < pFields[0]->GetNpoints(); ++i)
131 std::stringstream vOutputFilename;
134 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
135 = pFields[0]->GetFieldDefinitions();
136 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
139 pFields[0]->FwdTrans_IterPerExp(
m_threshold, vCoeffs);
142 for(
int i = 0; i < FieldDef.size(); ++i)
145 FieldDef[i]->m_fields.push_back(
"m");
146 pFields[0]->AppendFieldData(FieldDef[i], FieldData[i], vCoeffs);
149 m_fld->Write(vOutputFilename.str(),FieldDef,FieldData);
#define ASSERTL0(condition, msg)
static FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::map< std::string, std::string > &pParams)
Creates an instance of this class.
NekDouble m_startTime
Time at which to start recording.
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
static std::string className
Name of the class.
virtual SOLVER_UTILS_EXPORT void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
Initialises the filter.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
virtual SOLVER_UTILS_EXPORT bool v_IsTimeDependent()
Indicate that this filter is time dependent.
NekDouble m_thresholdValue
Value of threshold.
NekDouble m_initialValue
Initial value of storage.
std::string m_outputFile
File into which to write output data.
virtual SOLVER_UTILS_EXPORT ~FilterThresholdMin()
virtual SOLVER_UTILS_EXPORT void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
For each point in domain test if solution is below threshold.
LibUtilities::FieldIOSharedPtr m_fld
FieldIO object for writing data.
virtual SOLVER_UTILS_EXPORT void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
Finalise the filter and write out data.
SOLVER_UTILS_EXPORT FilterThresholdMin(const LibUtilities::SessionReaderSharedPtr &pSession, const std::map< std::string, std::string > &pParams)
FilterFactory & GetFilterFactory()
Array< OneD, NekDouble > m_threshold
Storage for recording when each point in domain drops below threshold.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.