Nektar++
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
Nektar::StimulusPoint Class Reference

Protocol base class. More...

#include <StimulusPoint.h>

Inheritance diagram for Nektar::StimulusPoint:
[legend]

Public Member Functions

 ~StimulusPoint () override
 
void Initialise ()
 Initialise the stimulus 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< StimulusSharedPtrLoadStimuli (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
 

Static Public Attributes

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

Protected Member Functions

void v_Update (Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time) override
 
void v_GenerateSummary (SolverUtils::SummaryList &s) override
 
- Protected Member Functions inherited from Nektar::Stimulus
 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

NekDouble m_strength
 
- 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

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

Friends

class MemoryManager< StimulusPoint >
 

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 49 of file StimulusPoint.h.

Constructor & Destructor Documentation

◆ ~StimulusPoint()

Nektar::StimulusPoint::~StimulusPoint ( )
inlineoverride

Definition at line 66 of file StimulusPoint.h.

67 {
68 }

◆ StimulusPoint()

Nektar::StimulusPoint::StimulusPoint ( const LibUtilities::SessionReaderSharedPtr pSession,
const MultiRegions::ExpListSharedPtr pField,
const TiXmlElement *  pXml 
)
private

Stimulus base class constructor.

Definition at line 59 of file StimulusPoint.cpp.

62 : Stimulus(pSession, pField, pXml)
63{
64 m_session = pSession;
65 m_field = pField;
66 m_nq = pField->GetTotPoints();
67
68 if (!pXml)
69 {
70 return;
71 }
72
73 const TiXmlElement *pXmlparameter;
74
75 pXmlparameter = pXml->FirstChildElement("p_strength");
76 m_strength = atof(pXmlparameter->GetText());
77}
Stimulus(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField, const TiXmlElement *pXml)
Definition: Stimulus.cpp:64
MultiRegions::ExpListSharedPtr m_field
Transmembrane potential field from PDE system.
Definition: Stimulus.h:95
int m_nq
Number of physical points.
Definition: Stimulus.h:97
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: Stimulus.h:93

References Nektar::Stimulus::m_field, Nektar::Stimulus::m_nq, Nektar::Stimulus::m_session, and m_strength.

Member Function Documentation

◆ create()

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

Creates an instance of this class.

Definition at line 53 of file StimulusPoint.h.

56 {
58 pXml);
59 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

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

◆ Initialise()

void Nektar::StimulusPoint::Initialise ( )

Initialise the stimulus storage and set initial conditions.

Initialise the stimulus. Allocate workspace and variable storage.

Definition at line 82 of file StimulusPoint.cpp.

83{
84}

◆ v_GenerateSummary()

void Nektar::StimulusPoint::v_GenerateSummary ( SolverUtils::SummaryList s)
overrideprotectedvirtual

Implements Nektar::Stimulus.

Definition at line 101 of file StimulusPoint.cpp.

103{
104}

◆ v_Update()

void Nektar::StimulusPoint::v_Update ( Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  time 
)
overrideprotectedvirtual

Implements Nektar::Stimulus.

Definition at line 89 of file StimulusPoint.cpp.

91{
92 // Get the protocol amplitude
93 NekDouble v_amp = m_Protocol->GetAmplitude(time) * m_strength;
94
95 outarray[0][0] += v_amp;
96}
ProtocolSharedPtr m_Protocol
Stimulus protocol to apply.
Definition: Stimulus.h:99
double NekDouble

References Nektar::Stimulus::m_Protocol, and m_strength.

Friends And Related Function Documentation

◆ MemoryManager< StimulusPoint >

friend class MemoryManager< StimulusPoint >
friend

Definition at line 62 of file StimulusPoint.h.

Member Data Documentation

◆ className

std::string Nektar::StimulusPoint::className
static
Initial value:
=
"StimulusPoint", StimulusPoint::create, "Point stimulus.")
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static StimulusSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField, const TiXmlElement *pXml)
Creates an instance of this class.
Definition: StimulusPoint.h:53
StimulusFactory & GetStimulusFactory()
Definition: Stimulus.cpp:44

Name of class.

Definition at line 62 of file StimulusPoint.h.

◆ m_strength

NekDouble Nektar::StimulusPoint::m_strength
protected

Definition at line 74 of file StimulusPoint.h.

Referenced by StimulusPoint(), and v_Update().