Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
Nektar::StimulusCirc Class Reference

Protocol base class. More...

#include <StimulusCircle.h>

Inheritance diagram for Nektar::StimulusCirc:
Inheritance graph
[legend]
Collaboration diagram for Nektar::StimulusCirc:
Collaboration graph
[legend]

Public Member Functions

virtual ~StimulusCirc ()
 
void Initialise ()
 Initialise the protocol storage and set initial conditions. More...
 
- Public Member Functions inherited from Nektar::Stimulus
virtual ~Stimulus ()
 
void Initialise ()
 Initialise the stimulus storage and set initial conditions. More...
 
void Update (Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
 Updates RHS of outarray by adding a stimulus to it. More...
 
void GenerateSummary (SolverUtils::SummaryList &s)
 Print a summary of the outarray. More...
 

Static Public Member Functions

static StimulusSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField, const TiXmlElement *pXml)
 Creates an instance of this class. More...
 
- Static Public Member Functions inherited from Nektar::Stimulus
static std::vector
< StimulusSharedPtr
LoadStimuli (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
 

Static Public Attributes

static std::string className
 Name of class. More...
 

Protected Member Functions

virtual void v_Update (Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
 
virtual void v_GenerateSummary (SolverUtils::SummaryList &s)
 
- Protected Member Functions inherited from Nektar::Stimulus
 Stimulus (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField, const TiXmlElement *pXml)
 

Protected Attributes

NekDouble m_px1
 
NekDouble m_py1
 
NekDouble m_pz1
 
NekDouble m_pr1
 
NekDouble m_pis
 
NekDouble m_strength
 
NekDouble v_amp
 
NekDouble m_chiCapMembrane
 
- Protected Attributes inherited from Nektar::Stimulus
LibUtilities::SessionReaderSharedPtr m_session
 Session. More...
 
MultiRegions::ExpListSharedPtr m_field
 Transmembrane potential field from PDE system. More...
 
int m_nq
 Number of physical points. More...
 
ProtocolSharedPtr m_Protocol
 Stimulus protocol to apply. More...
 

Private Member Functions

 StimulusCirc (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField, const TiXmlElement *pXml)
 

Friends

class MemoryManager< StimulusCirc >
 

Detailed Description

Protocol base class.

The Stimulus class and derived classes implement a range of stimuli. The stimulus contains input stimuli that can be applied throughout the domain, on specified regions determined by the derived classes of Stimulus, at specified frequencies determined by the derived classes of Protocol.

Definition at line 53 of file StimulusCircle.h.

Constructor & Destructor Documentation

virtual Nektar::StimulusCirc::~StimulusCirc ( )
inlinevirtual

Definition at line 71 of file StimulusCircle.h.

71 {}
Nektar::StimulusCirc::StimulusCirc ( const LibUtilities::SessionReaderSharedPtr pSession,
const MultiRegions::ExpListSharedPtr pField,
const TiXmlElement *  pXml 
)
private

Stimulus base class constructor.

Definition at line 61 of file StimulusCircle.cpp.

References m_chiCapMembrane, Nektar::Stimulus::m_field, Nektar::Stimulus::m_nq, m_pis, m_pr1, m_px1, m_py1, m_pz1, Nektar::Stimulus::m_session, and m_strength.

65  : Stimulus(pSession, pField, pXml)
66  {
67  m_session = pSession;
68  m_field = pField;
69  m_nq = pField->GetTotPoints();
70  m_chiCapMembrane = m_session->GetParameter("chi")
71  * m_session->GetParameter("Cm");
72 
73  if (!pXml)
74  {
75  return;
76  }
77 
78  const TiXmlElement *pXmlparameter;
79 
80  pXmlparameter = pXml->FirstChildElement("p_x1");
81  m_px1 = atof(pXmlparameter->GetText());
82 
83  pXmlparameter = pXml->FirstChildElement("p_y1");
84  m_py1 = atof(pXmlparameter->GetText());
85 
86  pXmlparameter = pXml->FirstChildElement("p_z1");
87  m_pz1 = atof(pXmlparameter->GetText());
88 
89  pXmlparameter = pXml->FirstChildElement("p_r1");
90  m_pr1 = atof(pXmlparameter->GetText());
91 
92  pXmlparameter = pXml->FirstChildElement("p_is");
93  m_pis = atof(pXmlparameter->GetText());
94 
95  pXmlparameter = pXml->FirstChildElement("p_strength");
96  m_strength = atof(pXmlparameter->GetText());
97  }
NekDouble m_chiCapMembrane
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: Stimulus.h:93
int m_nq
Number of physical points.
Definition: Stimulus.h:97
Stimulus(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField, const TiXmlElement *pXml)
Definition: Stimulus.cpp:67
MultiRegions::ExpListSharedPtr m_field
Transmembrane potential field from PDE system.
Definition: Stimulus.h:95

Member Function Documentation

static StimulusSharedPtr Nektar::StimulusCirc::create ( const LibUtilities::SessionReaderSharedPtr pSession,
const MultiRegions::ExpListSharedPtr pField,
const TiXmlElement *  pXml 
)
inlinestatic

Creates an instance of this class.

Definition at line 57 of file StimulusCircle.h.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

61  {
63  ::AllocateSharedPtr(pSession, pField, pXml);
64  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
void Nektar::StimulusCirc::Initialise ( )

Initialise the protocol storage and set initial conditions.

Initialise the stimulus. Allocate workspace and variable storage.

Definition at line 103 of file StimulusCircle.cpp.

104  {
105  }
void Nektar::StimulusCirc::v_GenerateSummary ( SolverUtils::SummaryList s)
protectedvirtual

Implements Nektar::Stimulus.

Definition at line 171 of file StimulusCircle.cpp.

172  {
173  }
void Nektar::StimulusCirc::v_Update ( Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  time 
)
protectedvirtual

Implements Nektar::Stimulus.

Definition at line 111 of file StimulusCircle.cpp.

References Nektar::Stimulus::m_field, m_pis, m_pr1, Nektar::Stimulus::m_Protocol, m_px1, m_py1, m_pz1, m_strength, and v_amp.

113  {
114  // Get the dimension of the expansion
115  int dim = m_field->GetCoordim(0);
116 
117  //Retrieve coodrinates of quadrature points
118  int nq = m_field->GetNpoints();
119  Array<OneD,NekDouble> x0(nq);
120  Array<OneD,NekDouble> x1(nq);
121  Array<OneD,NekDouble> x2(nq);
122 
123  // Get the protocol amplitude
124  NekDouble v_amp = m_Protocol->GetAmplitude(time) * m_strength;
125 
126  // get the coordinates
127  m_field->GetCoords(x0,x1,x2);
128 
129  switch (dim)
130  {
131  case 1:
132  for(int j=0; j<nq; j++)
133  {
134  outarray[0][j] += v_amp
135  * ( -tanh( (m_pis * x0[j] - m_px1 + m_pr1)
136  * (m_pis * x0[j] - m_px1 - m_pr1)
137  ) / 2.0 + 0.5 );
138  }
139  break;
140  case 2:
141  for(int j=0; j<nq; j++)
142  {
143  outarray[0][j] += v_amp
144  * ( -tanh( (m_pis * x0[j] - m_px1+m_pr1)
145  * (m_pis * x0[j] - m_px1-m_pr1)
146  + (m_pis * x1[j] - m_py1+m_pr1)
147  * (m_pis * x1[j] - m_py1-m_pr1)
148  ) / 2.0 + 0.5 );
149  }
150  break;
151  case 3:
152  for(int j=0; j<nq; j++)
153  {
154  outarray[0][j] += v_amp
155  * ( -tanh( (m_pis * x0[j] - m_px1+m_pr1)
156  * (m_pis * x0[j] - m_px1-m_pr1)
157  + (m_pis * x1[j] - m_py1+m_pr1)
158  * (m_pis * x1[j] - m_py1-m_pr1)
159  + (m_pis * x2[j] - m_pz1+m_pr1)
160  * (m_pis * x2[j] - m_pz1-m_pr1)
161  ) / 2.0 + 0.5 );
162  }
163  break;
164  }
165  }
ProtocolSharedPtr m_Protocol
Stimulus protocol to apply.
Definition: Stimulus.h:99
double NekDouble
MultiRegions::ExpListSharedPtr m_field
Transmembrane potential field from PDE system.
Definition: Stimulus.h:95

Friends And Related Function Documentation

friend class MemoryManager< StimulusCirc >
friend

Definition at line 69 of file StimulusCircle.h.

Member Data Documentation

std::string Nektar::StimulusCirc::className
static
Initial value:
"StimulusCirc",
"Circular stimulus.")

Name of class.

Definition at line 67 of file StimulusCircle.h.

NekDouble Nektar::StimulusCirc::m_chiCapMembrane
protected

Definition at line 84 of file StimulusCircle.h.

Referenced by StimulusCirc().

NekDouble Nektar::StimulusCirc::m_pis
protected

Definition at line 81 of file StimulusCircle.h.

Referenced by StimulusCirc(), and v_Update().

NekDouble Nektar::StimulusCirc::m_pr1
protected

Definition at line 80 of file StimulusCircle.h.

Referenced by StimulusCirc(), and v_Update().

NekDouble Nektar::StimulusCirc::m_px1
protected

Definition at line 77 of file StimulusCircle.h.

Referenced by StimulusCirc(), and v_Update().

NekDouble Nektar::StimulusCirc::m_py1
protected

Definition at line 78 of file StimulusCircle.h.

Referenced by StimulusCirc(), and v_Update().

NekDouble Nektar::StimulusCirc::m_pz1
protected

Definition at line 79 of file StimulusCircle.h.

Referenced by StimulusCirc(), and v_Update().

NekDouble Nektar::StimulusCirc::m_strength
protected

Definition at line 82 of file StimulusCircle.h.

Referenced by StimulusCirc(), and v_Update().

NekDouble Nektar::StimulusCirc::v_amp
protected

Definition at line 83 of file StimulusCircle.h.

Referenced by v_Update().