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::ProtocolSingle Class Reference

Protocol base class. More...

#include <ProtocolSingle.h>

Inheritance diagram for Nektar::ProtocolSingle:
[legend]

Public Member Functions

 ~ProtocolSingle () override
 
void Initialise ()
 Initialise the protocol storage and set initial conditions. More...
 
- Public Member Functions inherited from Nektar::Protocol
virtual ~Protocol ()
 
void Initialise ()
 Initialise the protocol storage and set initial conditions. More...
 
NekDouble GetAmplitude (const NekDouble time)
 Returns amplitude of stimulus (1 or 0) at given time. More...
 
void GenerateSummary (SolverUtils::SummaryList &s)
 Print a summary of the cell model. More...
 

Static Public Member Functions

static ProtocolSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession, const TiXmlElement *pXml)
 Creates an instance of this class. More...
 

Static Public Attributes

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

Protected Member Functions

NekDouble v_GetAmplitude (const NekDouble time) override
 
void v_GenerateSummary (SolverUtils::SummaryList &s) override
 
virtual void v_SetInitialConditions ()
 
- Protected Member Functions inherited from Nektar::Protocol
 Protocol (const LibUtilities::SessionReaderSharedPtr &pSession, const TiXmlElement *pXml)
 
virtual NekDouble v_GetAmplitude (const NekDouble time)=0
 
virtual void v_GenerateSummary (SolverUtils::SummaryList &s)=0
 

Protected Attributes

NekDouble m_start
 
NekDouble m_dur
 
- Protected Attributes inherited from Nektar::Protocol
LibUtilities::SessionReaderSharedPtr m_session
 Session. More...
 

Private Member Functions

 ProtocolSingle (const LibUtilities::SessionReaderSharedPtr &pSession, const TiXmlElement *pXml)
 

Friends

class MemoryManager< ProtocolSingle >
 

Detailed Description

Protocol base class.

Definition at line 46 of file ProtocolSingle.h.

Constructor & Destructor Documentation

◆ ~ProtocolSingle()

Nektar::ProtocolSingle::~ProtocolSingle ( )
inlineoverride

Definition at line 62 of file ProtocolSingle.h.

63 {
64 }

◆ ProtocolSingle()

Nektar::ProtocolSingle::ProtocolSingle ( const LibUtilities::SessionReaderSharedPtr pSession,
const TiXmlElement *  pXml 
)
private

Protocol base class constructor.

Definition at line 58 of file ProtocolSingle.cpp.

61 : Protocol(pSession, pXml)
62{
63 m_session = pSession;
64
65 if (!pXml)
66 {
67 return;
68 }
69
70 const TiXmlElement *pXmlparameter;
71
72 pXmlparameter = pXml->FirstChildElement("START");
73 m_start = atof(pXmlparameter->GetText());
74
75 pXmlparameter = pXml->FirstChildElement("DURATION");
76 m_dur = atof(pXmlparameter->GetText());
77}
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: Protocol.h:85
Protocol(const LibUtilities::SessionReaderSharedPtr &pSession, const TiXmlElement *pXml)
Definition: Protocol.cpp:58

References m_dur, Nektar::Protocol::m_session, and m_start.

Member Function Documentation

◆ create()

static ProtocolSharedPtr Nektar::ProtocolSingle::create ( const LibUtilities::SessionReaderSharedPtr pSession,
const TiXmlElement *  pXml 
)
inlinestatic

Creates an instance of this class.

Definition at line 50 of file ProtocolSingle.h.

53 {
55 }
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::ProtocolSingle::Initialise ( )

Initialise the protocol storage and set initial conditions.

Initialise the protocol. Allocate workspace and variable storage.

Definition at line 82 of file ProtocolSingle.cpp.

83{
84}

◆ v_GenerateSummary()

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

Implements Nektar::Protocol.

Definition at line 104 of file ProtocolSingle.cpp.

106{
107}

◆ v_GetAmplitude()

NekDouble Nektar::ProtocolSingle::v_GetAmplitude ( const NekDouble  time)
overrideprotectedvirtual

Implements Nektar::Protocol.

Definition at line 89 of file ProtocolSingle.cpp.

90{
91 if (time > m_start && time < (m_start + m_dur))
92 {
93 return 1.0;
94 }
95 else
96 {
97 return 0.0;
98 }
99}

References m_dur, and m_start.

◆ v_SetInitialConditions()

void Nektar::ProtocolSingle::v_SetInitialConditions ( )
protectedvirtual

Definition at line 112 of file ProtocolSingle.cpp.

113{
114}

Friends And Related Function Documentation

◆ MemoryManager< ProtocolSingle >

friend class MemoryManager< ProtocolSingle >
friend

Definition at line 58 of file ProtocolSingle.h.

Member Data Documentation

◆ className

std::string Nektar::ProtocolSingle::className
static
Initial value:
=
"ProtocolSingle", ProtocolSingle::create, "Single stimulus protocol.")
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static ProtocolSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const TiXmlElement *pXml)
Creates an instance of this class.
ProtocolFactory & GetProtocolFactory()
Definition: Protocol.cpp:39

Name of class.

Definition at line 58 of file ProtocolSingle.h.

◆ m_dur

NekDouble Nektar::ProtocolSingle::m_dur
protected

Definition at line 71 of file ProtocolSingle.h.

Referenced by ProtocolSingle(), and v_GetAmplitude().

◆ m_start

NekDouble Nektar::ProtocolSingle::m_start
protected

Definition at line 70 of file ProtocolSingle.h.

Referenced by ProtocolSingle(), and v_GetAmplitude().