55 ParamMap::const_iterator it;
58 it = pParams.find(
"OutputFile");
59 if (it == pParams.end())
65 ASSERTL0(it->second.length() > 0,
"Missing parameter 'OutputFile'.");
75 it = pParams.find(
"OutputFrequency");
76 if (it == pParams.end())
87 it = pParams.find(
"Points");
88 ASSERTL0(it != pParams.end(),
"Missing parameter 'Points'.");
111 "No history points in stream.");
130 gloCoord[1], gloCoord[2]);
137 if (vComm->GetRank() == 0)
143 for (i = 0; i < pFields.num_elements(); ++i)
168 const unsigned int nq = pFields[0]->GetNpoints();
180 for (
unsigned int i = 0; i <
npts; ++i)
189 pFields[0]->GetCoords(x,y,z);
194 Vmath::Vvtvvtp(nq, x, 1, x, 1, y, 1, y, 1, oneOverR, 1);
195 Vmath::Vvtvp (nq, z, 1, z, 1, oneOverR, 1, oneOverR, 1);
200 pFields[0]->PhysDeriv(oneOverR,
m_grad_R_x[i], m_grad_R_y[i],
222 const unsigned int nq = pFields[0]->GetNpoints();
231 pFields[0]->PhysDeriv(pFields[0]->GetPhys(),
232 grad_V_x, grad_V_y, grad_V_z);
234 for (i = 0; i < npoints; ++i)
239 grad_V_y, 1, output, 1);
243 e[i] = pFields[0]->Integral(output);
251 if (vComm->GetRank() == 0)
274 if (pFields[0]->GetComm()->GetRank() == 0)
unsigned int m_index
Counts number of calls to update (number of timesteps)
std::string m_outputFile
Filename to output electrogram data to.
#define ASSERTL0(condition, msg)
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
Array< OneD, Array< OneD, NekDouble > > m_grad_R_y
Gradient of the radius from each electrogram point in y-direction.
std::stringstream m_electrogramStream
Point coordinate input string.
virtual void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
Finalise the electrogram filter and close output file.
std::ofstream m_outputStream
Output file stream for electrogram data.
virtual bool v_IsTimeDependent()
Filter is time-dependent and should be called at each time-step.
SpatialDomains::PointGeomVector m_electrogramPoints
List of electrogram points.
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
virtual void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
Compute extracellular potential at egm points at current time.
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/y.
static std::string className
Name of the class.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
unsigned int m_outputFrequency
Number of timesteps between outputs.
static SolverUtils::FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const ParamMap &pParams)
Creates an instance of this class.
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
NekDouble Evaluate() const
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
std::map< std::string, std::string > ParamMap
LibUtilities::SessionReaderSharedPtr m_session
FilterElectrogram(const LibUtilities::SessionReaderSharedPtr &pSession, const ParamMap &pParams)
Electrogram filter constructor.
void Vvtvvtp(int n, const T *v, int incv, const T *w, int incw, const T *x, int incx, const T *y, int incy, T *z, int incz)
vvtvvtp (vector times vector plus vector times vector):
Array< OneD, Array< OneD, NekDouble > > m_grad_R_z
Gradient of the radius from each electrogram point in z-direction.
FilterFactory & GetFilterFactory()
virtual ~FilterElectrogram()
Electrogram filter destructor.
virtual void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
Initialises the electrogram filter and open output file.
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Array< OneD, Array< OneD, NekDouble > > m_grad_R_x
Gradient of the radius from each electrogram point in x-direction.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.