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

Protocol base class. More...

#include <ProtocolS1.h>

Inheritance diagram for Nektar::ProtocolS1:
Inheritance graph
[legend]
Collaboration diagram for Nektar::ProtocolS1:
Collaboration graph
[legend]

Public Member Functions

virtual ~ProtocolS1 ()
 
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
 
NekDouble m_num_s1
 
NekDouble m_s1cyclelength
 
- Protected Attributes inherited from Nektar::Protocol
LibUtilities::SessionReaderSharedPtr m_session
 Session. More...
 

Private Member Functions

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

Friends

class MemoryManager< ProtocolS1 >
 

Detailed Description

Protocol base class.

The Stimuli 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 47 of file ProtocolS1.h.

Constructor & Destructor Documentation

virtual Nektar::ProtocolS1::~ProtocolS1 ( )
inlinevirtual

Definition at line 63 of file ProtocolS1.h.

63 {}
Nektar::ProtocolS1::ProtocolS1 ( const LibUtilities::SessionReaderSharedPtr pSession,
const TiXmlElement *  pXml 
)
private

Protocol base class constructor.

Definition at line 60 of file ProtocolS1.cpp.

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

63  : Protocol(pSession, pXml)
64  {
65  m_session = pSession;
66 
67  if (!pXml)
68  {
69  return;
70  }
71 
72  // Declare temporary XML element pointer
73  const TiXmlElement *pXmlparameter;
74 
75  // Read each variable, extract text and convert to floating-point
76  pXmlparameter = pXml->FirstChildElement("START");
77  m_start = atof(pXmlparameter->GetText());
78 
79  pXmlparameter = pXml->FirstChildElement("DURATION");
80  m_dur = atof(pXmlparameter->GetText());
81 
82  pXmlparameter = pXml->FirstChildElement("S1CYCLELENGTH");
83  m_s1cyclelength = atof(pXmlparameter->GetText());
84 
85  pXmlparameter = pXml->FirstChildElement("NUM_S1");
86  m_num_s1 = atof(pXmlparameter->GetText());
87  }
NekDouble m_dur
Definition: ProtocolS1.h:70
NekDouble m_s1cyclelength
Definition: ProtocolS1.h:72
Protocol(const LibUtilities::SessionReaderSharedPtr &pSession, const TiXmlElement *pXml)
Definition: Protocol.cpp:61
NekDouble m_num_s1
Definition: ProtocolS1.h:71
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: Protocol.h:82
NekDouble m_start
Definition: ProtocolS1.h:69

Member Function Documentation

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

Creates an instance of this class.

Definition at line 51 of file ProtocolS1.h.

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

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

Initialise the protocol storage and set initial conditions.

Initialise the protocol. Allocate workspace and variable storage.

Definition at line 93 of file ProtocolS1.cpp.

94  {
95  }
void Nektar::ProtocolS1::v_GenerateSummary ( SolverUtils::SummaryList s)
protectedvirtual

Implements Nektar::Protocol.

Definition at line 121 of file ProtocolS1.cpp.

122  {
123  }
NekDouble Nektar::ProtocolS1::v_GetAmplitude ( const NekDouble  time)
protectedvirtual

Implements Nektar::Protocol.

Definition at line 101 of file ProtocolS1.cpp.

References m_dur, m_num_s1, m_s1cyclelength, and m_start.

102  {
103  // Number of complete S1 intervals
104  NekDouble a = floor((time-m_start)/m_s1cyclelength);
105 
106  // Time since start of most recent S1 interval
107  NekDouble time1 = time - a * m_s1cyclelength - m_start;
108 
109  if( (time1 > 0) && (a < m_num_s1) && (time1 < m_dur) )
110  {
111  return 1.0;
112  }
113 
114  return 0.0;
115  }
NekDouble m_dur
Definition: ProtocolS1.h:70
NekDouble m_s1cyclelength
Definition: ProtocolS1.h:72
NekDouble m_num_s1
Definition: ProtocolS1.h:71
NekDouble m_start
Definition: ProtocolS1.h:69
double NekDouble
void Nektar::ProtocolS1::v_SetInitialConditions ( )
protectedvirtual

Definition at line 129 of file ProtocolS1.cpp.

130  {
131  }

Friends And Related Function Documentation

friend class MemoryManager< ProtocolS1 >
friend

Definition at line 61 of file ProtocolS1.h.

Member Data Documentation

std::string Nektar::ProtocolS1::className
static
Initial value:
"ProtocolS1",
"S1 stimulus protocol.")

Name of class.

Definition at line 59 of file ProtocolS1.h.

NekDouble Nektar::ProtocolS1::m_dur
protected

Definition at line 70 of file ProtocolS1.h.

Referenced by ProtocolS1(), and v_GetAmplitude().

NekDouble Nektar::ProtocolS1::m_num_s1
protected

Definition at line 71 of file ProtocolS1.h.

Referenced by ProtocolS1(), and v_GetAmplitude().

NekDouble Nektar::ProtocolS1::m_s1cyclelength
protected

Definition at line 72 of file ProtocolS1.h.

Referenced by ProtocolS1(), and v_GetAmplitude().

NekDouble Nektar::ProtocolS1::m_start
protected

Definition at line 69 of file ProtocolS1.h.

Referenced by ProtocolS1(), and v_GetAmplitude().