35 #include <boost/core/ignore_unused.hpp>
46 std::string FilterThresholdMax::className =
48 "ThresholdMax", FilterThresholdMax::create);
50 FilterThresholdMax::FilterThresholdMax(
52 const std::weak_ptr<EquationSystem> &pEquation,
54 Filter(pSession, pEquation)
57 auto it = pParams.find(
"ThresholdValue");
58 ASSERTL0(it != pParams.end(),
"Missing parameter 'ThresholdValue'.");
64 it = pParams.find(
"InitialValue");
65 ASSERTL0(it != pParams.end(),
"Missing parameter 'InitialValue'.");
71 it = pParams.find(
"StartTime");
73 if (it != pParams.end())
81 it = pParams.find(
"OutputFile");
83 if (it != pParams.end())
89 it = pParams.find(
"ThresholdVar");
91 if (it != pParams.end())
93 std::string var = it->second.c_str();
94 std::vector<string> varlist = pSession->GetVariables();
95 auto x =
std::find(varlist.begin(), varlist.end(), var);
97 "Specified variable " + var +
98 " in ThresholdMax filter is not available.");
114 boost::ignore_unused(time);
146 boost::ignore_unused(time);
148 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
150 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
156 for(
int i = 0; i < FieldDef.size(); ++i)
159 FieldDef[i]->m_fields.push_back(
"m");
160 pFields[
m_thresholdVar]->AppendFieldData(FieldDef[i], FieldData[i], vCoeffs);
#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
LibUtilities::FieldIOSharedPtr m_fld
FieldIO object for writing 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.
virtual void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
For each point in domain test if solution is above threshold.
int m_thresholdVar
Variable on which to detect threshold.
virtual void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
Initialises the filter.
virtual SOLVER_UTILS_EXPORT ~FilterThresholdMax()
virtual void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
Finalise the filter and write out data.
NekDouble m_thresholdValue
Value of threshold.
virtual bool v_IsTimeDependent()
Indicate that this filter is time dependent.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
FilterFactory & GetFilterFactory()
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
The above copyright notice and this permission notice shall be included.