Nektar++
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:
[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< StimulusSharedPtrLoadStimuli (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 64 of file Stimulus.h.

Constructor & Destructor Documentation

◆ ~Stimulus()

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

Definition at line 67 of file Stimulus.h.

68 {
69 }

◆ Stimulus()

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

Stimulus base class constructor.

Definition at line 64 of file Stimulus.cpp.

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

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

Member Function Documentation

◆ GenerateSummary()

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

Print a summary of the outarray.

Definition at line 82 of file Stimulus.h.

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

References v_GenerateSummary().

◆ Initialise()

void Nektar::Stimulus::Initialise ( )

Initialise the stimulus storage and set initial conditions.

Initialise the stimulus. Allocate workspace and variable storage.

Definition at line 82 of file Stimulus.cpp.

83{
84}

◆ LoadStimuli()

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

Definition at line 89 of file Stimulus.cpp.

92{
93 vector<StimulusSharedPtr> vStimList;
94
95 TiXmlElement *vStimuli = pSession->GetElement("Nektar/Stimuli");
96 if (vStimuli)
97 {
98 TiXmlElement *vStimulus = vStimuli->FirstChildElement("STIMULUS");
99 while (vStimulus)
100 {
101 string vType = vStimulus->Attribute("TYPE");
102
103 vStimList.push_back(GetStimulusFactory().CreateInstance(
104 vType, pSession, pField, vStimulus));
105 vStimulus = vStimulus->NextSiblingElement("STIMULUS");
106 }
107 }
108 return vStimList;
109}
StimulusFactory & GetStimulusFactory()
Definition: Stimulus.cpp:44

References Nektar::GetStimulusFactory().

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

◆ Update()

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.

77 {
78 v_Update(outarray, time);
79 }
virtual void v_Update(Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)=0

References v_Update().

◆ v_GenerateSummary()

virtual void Nektar::Stimulus::v_GenerateSummary ( SolverUtils::SummaryList s)
protectedpure virtual

◆ v_Update()

virtual void Nektar::Stimulus::v_Update ( Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  time 
)
protectedpure virtual

Member Data Documentation

◆ m_field

MultiRegions::ExpListSharedPtr Nektar::Stimulus::m_field
protected

◆ m_nq

int Nektar::Stimulus::m_nq
protected

◆ m_Protocol

ProtocolSharedPtr Nektar::Stimulus::m_Protocol
protected

◆ m_session

LibUtilities::SessionReaderSharedPtr Nektar::Stimulus::m_session
protected