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

Stimulus base class. More...

#include <Stimulus.h>

Inheritance diagram for Nektar::Stimulus:
Inheritance graph
[legend]

Public Member Functions

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 std::vector
< StimulusSharedPtr
LoadStimuli (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
 

Protected Member Functions

 Stimulus (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField, const TiXmlElement *pXml)
 
virtual void v_Update (Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)=0
 
virtual void v_GenerateSummary (SolverUtils::SummaryList &s)=0
 

Protected Attributes

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...
 

Detailed Description

Stimulus 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 66 of file Stimulus.h.

Constructor & Destructor Documentation

virtual Nektar::Stimulus::~Stimulus ( )
inlinevirtual

Definition at line 69 of file Stimulus.h.

69 {}
Nektar::Stimulus::Stimulus ( const LibUtilities::SessionReaderSharedPtr pSession,
const MultiRegions::ExpListSharedPtr pField,
const TiXmlElement *  pXml 
)
protected

Stimulus base class constructor.

Definition at line 67 of file Stimulus.cpp.

References Nektar::LibUtilities::NekFactory< tKey, tBase, >::CreateInstance(), and Nektar::GetProtocolFactory().

70  {
71  m_session = pSession;
72  m_field = pField;
73  m_nq = pField->GetTotPoints();
74 
75  const TiXmlElement* vProtocol = pXml->FirstChildElement("PROTOCOL");
76  string vTypeP = vProtocol->Attribute("TYPE");
77 
79  vTypeP, pSession, vProtocol);
80 
81  }
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:162
ProtocolSharedPtr m_Protocol
Stimulus protocol to apply.
Definition: Stimulus.h:99
ProtocolFactory & GetProtocolFactory()
Definition: Protocol.cpp:40
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: Stimulus.h:93
int m_nq
Number of physical points.
Definition: Stimulus.h:97
MultiRegions::ExpListSharedPtr m_field
Transmembrane potential field from PDE system.
Definition: Stimulus.h:95

Member Function Documentation

void Nektar::Stimulus::GenerateSummary ( SolverUtils::SummaryList s)
inline

Print a summary of the outarray.

Definition at line 82 of file Stimulus.h.

References v_GenerateSummary().

83  {
85  }
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)=0
void Nektar::Stimulus::Initialise ( )

Initialise the stimulus storage and set initial conditions.

Initialise the stimulus. Allocate workspace and variable storage.

Definition at line 87 of file Stimulus.cpp.

88  {
89  }
vector< StimulusSharedPtr > Nektar::Stimulus::LoadStimuli ( const LibUtilities::SessionReaderSharedPtr pSession,
const MultiRegions::ExpListSharedPtr pField 
)
static

Definition at line 95 of file Stimulus.cpp.

References Nektar::GetStimulusFactory().

Referenced by Nektar::BidomainRoth::v_InitObject(), and Nektar::Monodomain::v_InitObject().

98  {
99  vector<StimulusSharedPtr> vStimList;
100 
101  TiXmlElement* vStimuli = pSession->GetElement("Nektar/Stimuli");
102  if (vStimuli)
103  {
104  TiXmlElement* vStimulus = vStimuli->FirstChildElement("STIMULUS");
105  while (vStimulus)
106  {
107  string vType = vStimulus->Attribute("TYPE");
108 
109  vStimList.push_back(GetStimulusFactory().CreateInstance(
110  vType, pSession, pField, vStimulus));
111  vStimulus = vStimulus->NextSiblingElement("STIMULUS");
112  }
113  }
114  return vStimList;
115  }
StimulusFactory & GetStimulusFactory()
Definition: Stimulus.cpp:45
void Nektar::Stimulus::Update ( Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  time 
)
inline

Updates RHS of outarray by adding a stimulus to it.

Definition at line 75 of file Stimulus.h.

References v_Update().

77  {
78  v_Update(outarray, time);
79  }
virtual void v_Update(Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)=0
virtual void Nektar::Stimulus::v_GenerateSummary ( SolverUtils::SummaryList s)
protectedpure virtual
virtual void Nektar::Stimulus::v_Update ( Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  time 
)
protectedpure virtual

Member Data Documentation

MultiRegions::ExpListSharedPtr Nektar::Stimulus::m_field
protected
int Nektar::Stimulus::m_nq
protected

Number of physical points.

Definition at line 97 of file Stimulus.h.

Referenced by Nektar::StimulusCirc::StimulusCirc(), Nektar::StimulusPoint::StimulusPoint(), and Nektar::StimulusRect::StimulusRect().

ProtocolSharedPtr Nektar::Stimulus::m_Protocol
protected
LibUtilities::SessionReaderSharedPtr Nektar::Stimulus::m_session
protected