48 const std::shared_ptr<EquationSystem> &pEquation,
const ParamMap &pParams)
49 :
Filter(pSession, pEquation)
52 auto it = pParams.find(
"ThresholdValue");
53 ASSERTL0(it != pParams.end(),
"Missing parameter 'ThresholdValue'.");
58 it = pParams.find(
"InitialValue");
59 ASSERTL0(it != pParams.end(),
"Missing parameter 'InitialValue'.");
64 it = pParams.find(
"StartTime");
66 if (it != pParams.end())
73 it = pParams.find(
"OutputFile");
75 if (it != pParams.end())
81 it = pParams.find(
"ThresholdVar");
83 if (it != pParams.end())
85 std::string var = it->second.c_str();
86 std::vector<string> varlist = pSession->GetVariables();
87 auto x =
std::find(varlist.begin(), varlist.end(), var);
89 "Specified variable " + var +
90 " in ThresholdMax filter is not available.");
136 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
138 std::vector<std::vector<NekDouble>> FieldData(FieldDef.size());
144 for (
int i = 0; i < FieldDef.size(); ++i)
147 FieldDef[i]->m_fields.push_back(
"m");
148 pFields[
m_thresholdVar]->AppendFieldData(FieldDef[i], FieldData[i],
#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.
LibUtilities::SessionReaderSharedPtr m_session
std::map< std::string, std::string > ParamMap
static std::string className
Name of the class.
LibUtilities::FieldIOSharedPtr m_fld
FieldIO object for writing data.
void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
Initialises the filter.
void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
For each point in domain test if solution is above threshold.
SOLVER_UTILS_EXPORT FilterThresholdMax(const LibUtilities::SessionReaderSharedPtr &pSession, const std::shared_ptr< EquationSystem > &pEquation, const ParamMap &pParams)
void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
Finalise the filter and write out data.
NekDouble m_startTime
Time at which to start recording.
std::string m_outputFile
File into which to write output data.
NekDouble m_initialValue
Initial value of storage.
Array< OneD, NekDouble > m_threshold
Storage for recording when each point in domain rises above threshold.
bool v_IsTimeDependent() override
Indicate that this filter is time dependent.
int m_thresholdVar
Variable on which to detect threshold.
NekDouble m_thresholdValue
Value of threshold.
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.
SOLVER_UTILS_EXPORT ~FilterThresholdMax() override
std::shared_ptr< SessionReader > SessionReaderSharedPtr
FilterFactory & GetFilterFactory()
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)