56 ParamMap::const_iterator it;
59 it = pParams.find(
"ThresholdValue");
60 ASSERTL0(it != pParams.end(),
"Missing parameter 'ThresholdValue'.");
65 it = pParams.find(
"InitialValue");
66 ASSERTL0(it != pParams.end(),
"Missing parameter 'InitialValue'.");
71 it = pParams.find(
"StartTime");
73 if (it != pParams.end())
80 it = pParams.find(
"OutputFile");
82 if (it != pParams.end())
88 it = pParams.find(
"ThresholdVar");
90 if (it != pParams.end())
92 std::string var = it->second.c_str();
93 std::vector<string> varlist = pSession->GetVariables();
94 std::vector<string>::const_iterator x;
97 "Specified variable " + var +
98 " in ThresholdMin filter is not available.");
161 std::stringstream vOutputFilename;
164 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
165 = pFields[0]->GetFieldDefinitions();
166 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
169 pFields[0]->FwdTrans_IterPerExp(
m_threshold, vCoeffs);
172 for(
int i = 0; i < FieldDef.size(); ++i)
175 FieldDef[i]->m_fields.push_back(
"m");
176 pFields[0]->AppendFieldData(FieldDef[i], FieldData[i], vCoeffs);
179 m_fld->Write(vOutputFilename.str(),FieldDef,FieldData);
#define ASSERTL0(condition, msg)
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
static FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const ParamMap &pParams)
Creates an instance of this class.
virtual SOLVER_UTILS_EXPORT bool v_IsTimeDependent()
Indicate that this filter is time dependent.
NekDouble m_thresholdValue
Value of threshold.
NekDouble Evaluate() const
int m_thresholdVar
Variable on which to detect threshold.
NekDouble m_initialValue
Initial value of storage.
SOLVER_UTILS_EXPORT FilterThresholdMin(const LibUtilities::SessionReaderSharedPtr &pSession, const ParamMap &pParams)
std::map< std::string, std::string > ParamMap
LibUtilities::SessionReaderSharedPtr m_session
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.
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
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.