44 std::string FilterElectrogram::className =
47 FilterElectrogram::create);
52 FilterElectrogram::FilterElectrogram(
57 ParamMap::const_iterator it;
60 it = pParams.find(
"OutputFile");
61 if (it == pParams.end())
67 ASSERTL0(it->second.length() > 0,
"Missing parameter 'OutputFile'.");
77 it = pParams.find(
"OutputFrequency");
78 if (it == pParams.end())
89 it = pParams.find(
"Points");
90 ASSERTL0(it != pParams.end(),
"Missing parameter 'Points'.");
113 "No history points in stream.");
132 gloCoord[1], gloCoord[2]);
139 if (vComm->GetRank() == 0)
145 for (i = 0; i < pFields.num_elements(); ++i)
170 const unsigned int nq = pFields[0]->GetNpoints();
182 for (
unsigned int i = 0; i <
npts; ++i)
191 pFields[0]->GetCoords(x,y,z);
196 Vmath::Vvtvvtp(nq, x, 1, x, 1, y, 1, y, 1, oneOverR, 1);
197 Vmath::Vvtvp (nq, z, 1, z, 1, oneOverR, 1, oneOverR, 1);
202 pFields[0]->PhysDeriv(oneOverR,
m_grad_R_x[i], m_grad_R_y[i],
224 const unsigned int nq = pFields[0]->GetNpoints();
233 pFields[0]->PhysDeriv(pFields[0]->GetPhys(),
234 grad_V_x, grad_V_y, grad_V_z);
236 for (i = 0; i < npoints; ++i)
241 grad_V_y, 1, output, 1);
245 e[i] = pFields[0]->Integral(output);
253 if (vComm->GetRank() == 0)
276 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.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
unsigned int m_outputFrequency
Number of timesteps between outputs.
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
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.