Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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:
Inheritance graph
[legend]
Collaboration diagram for Nektar::ProtocolSingle:
Collaboration graph
[legend]

Public Member Functions

virtual ~ProtocolSingle ()
 
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

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

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 47 of file ProtocolSingle.h.

Constructor & Destructor Documentation

virtual Nektar::ProtocolSingle::~ProtocolSingle ( )
inlinevirtual

Definition at line 64 of file ProtocolSingle.h.

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

Protocol base class constructor.

Definition at line 61 of file ProtocolSingle.cpp.

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

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

Member Function Documentation

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

Creates an instance of this class.

Definition at line 51 of file ProtocolSingle.h.

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

54  {
56  ::AllocateSharedPtr(pSession, pXml);
57  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
void Nektar::ProtocolSingle::Initialise ( )

Initialise the protocol storage and set initial conditions.

Initialise the protocol. Allocate workspace and variable storage.

Definition at line 86 of file ProtocolSingle.cpp.

87  {
88  }
void Nektar::ProtocolSingle::v_GenerateSummary ( SolverUtils::SummaryList s)
protectedvirtual

Implements Nektar::Protocol.

Definition at line 110 of file ProtocolSingle.cpp.

111  {
112  }
NekDouble Nektar::ProtocolSingle::v_GetAmplitude ( const NekDouble  time)
protectedvirtual

Implements Nektar::Protocol.

Definition at line 94 of file ProtocolSingle.cpp.

References m_dur, and m_start.

95  {
96  if(time > m_start && time < (m_start+m_dur))
97  {
98  return 1.0;
99  }
100  else
101  {
102  return 0.0;
103  }
104  }
void Nektar::ProtocolSingle::v_SetInitialConditions ( )
protectedvirtual

Definition at line 118 of file ProtocolSingle.cpp.

119  {
120  }

Friends And Related Function Documentation

friend class MemoryManager< ProtocolSingle >
friend

Definition at line 62 of file ProtocolSingle.h.

Member Data Documentation

std::string Nektar::ProtocolSingle::className
static
Initial value:
"ProtocolSingle",
"Single stimulus protocol.")

Name of class.

Definition at line 60 of file ProtocolSingle.h.

NekDouble Nektar::ProtocolSingle::m_dur
protected

Definition at line 71 of file ProtocolSingle.h.

Referenced by ProtocolSingle(), and v_GetAmplitude().

NekDouble Nektar::ProtocolSingle::m_start
protected

Definition at line 70 of file ProtocolSingle.h.

Referenced by ProtocolSingle(), and v_GetAmplitude().