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 65 of file Stimulus.cpp.

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

68  {
69  m_session = pSession;
70  m_field = pField;
71  m_nq = pField->GetTotPoints();
72 
73  const TiXmlElement* vProtocol = pXml->FirstChildElement("PROTOCOL");
74  string vTypeP = vProtocol->Attribute("TYPE");
75 
77  vTypeP, pSession, vProtocol);
78 
79  }
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 85 of file Stimulus.cpp.

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

Definition at line 93 of file Stimulus.cpp.

References Nektar::GetStimulusFactory().

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

96  {
97  vector<StimulusSharedPtr> vStimList;
98 
99  TiXmlElement* vStimuli = pSession->GetElement("Nektar/Stimuli");
100  if (vStimuli)
101  {
102  TiXmlElement* vStimulus = vStimuli->FirstChildElement("STIMULUS");
103  while (vStimulus)
104  {
105  string vType = vStimulus->Attribute("TYPE");
106 
107  vStimList.push_back(GetStimulusFactory().CreateInstance(
108  vType, pSession, pField, vStimulus));
109  vStimulus = vStimulus->NextSiblingElement("STIMULUS");
110  }
111  }
112  return vStimList;
113  }
StimulusFactory & GetStimulusFactory()
Definition: Stimulus.cpp:43
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
ProtocolSharedPtr Nektar::Stimulus::m_Protocol
protected
LibUtilities::SessionReaderSharedPtr Nektar::Stimulus::m_session
protected