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())
144 for (
int i = 0; i < pFields[0]->GetNpoints(); ++i)
171 pFields[0]->GetSession()->GetComm()->AllReduce(max_idx,
193 std::stringstream vOutputFilename;
196 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
197 = pFields[0]->GetFieldDefinitions();
198 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
201 pFields[0]->FwdTrans_IterPerExp(
m_threshold[i], vCoeffs);
204 for(
int i = 0; i < FieldDef.size(); ++i)
207 FieldDef[i]->m_fields.push_back(
"m");
208 pFields[0]->AppendFieldData(FieldDef[i], FieldData[i], vCoeffs);
211 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.
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
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
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.