66 ParamMap::const_iterator it;
69 it = pParams.find(
"ThresholdValue");
70 ASSERTL0(it != pParams.end(),
"Missing parameter 'ThresholdValue'.");
75 it = pParams.find(
"InitialValue");
76 ASSERTL0(it != pParams.end(),
"Missing parameter 'InitialValue'.");
81 it = pParams.find(
"OutputFile");
82 ASSERTL0(it->second.length() > 0,
"Missing parameter 'OutputFile'.");
87 it = pParams.find(
"StartTime");
88 if (it != pParams.end())
143 for (
int i = 0; i < pFields[0]->GetNpoints(); ++i)
170 pFields[0]->GetSession()->GetComm()->AllReduce(max_idx,
192 std::stringstream vOutputFilename;
195 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
196 = pFields[0]->GetFieldDefinitions();
197 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
200 pFields[0]->FwdTrans_IterPerExp(
m_threshold[i], vCoeffs);
203 for(
int i = 0; i < FieldDef.size(); ++i)
206 FieldDef[i]->m_fields.push_back(
"m");
207 pFields[0]->AppendFieldData(FieldDef[i], FieldData[i], vCoeffs);
210 m_fld->Write(vOutputFilename.str(),FieldDef,FieldData);
virtual void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
Update recorded times.
#define ASSERTL0(condition, msg)
virtual ~FilterBenchmark()
Destructor for the benchmark filter.
NekDouble m_initialValue
Initial time to use in storage array.
virtual bool v_IsTimeDependent()
Identifies that the benchmark filter is time dependent.
std::string m_outputFile
Filename of output files.
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
NekDouble Evaluate() const
NekDouble m_startTime
Time at which to start detecting activations and repolarisations.
virtual void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
Initialises the benchmark filter and allocates storage.
LibUtilities::FieldIOSharedPtr m_fld
FieldIO object used for writing output files.
NekDouble m_thresholdValue
Value at which tissue is considered active.
std::map< std::string, std::string > ParamMap
LibUtilities::SessionReaderSharedPtr m_session
static boost::shared_ptr< FieldIO > CreateDefault(const LibUtilities::SessionReaderSharedPtr session)
Returns an object for the default FieldIO method.
std::vector< Array< OneD, NekDouble > > m_threshold
Storage for activation and repolarisation times.
Array< OneD, int > m_idx
Number of activations and repolarisations detected for each point.
FilterFactory & GetFilterFactory()
static std::string className
Name of the class.
virtual void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
Finalises the benchmark filter and write out recorded data.
Array< OneD, int > m_polarity
Indicates if the previous event was an activation or repolarisation.
static SolverUtils::FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const ParamMap &pParams)
Creates an instance of this class.
FilterBenchmark(const LibUtilities::SessionReaderSharedPtr &pSession, const ParamMap &pParams)
Construct the benchmark filter.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.