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

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

Static Public Member Functions

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

Static Public Attributes

static std::string className
 Name of class.

Protected Member Functions

virtual NekDouble v_GetAmplitude (const NekDouble time)
virtual void v_GenerateSummary (SolverUtils::SummaryList &s)
virtual void v_SetInitialConditions ()

Protected Attributes

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

Detailed Description

Protocol base class.

Definition at line 47 of file ProtocolSingle.h.

Constructor & Destructor Documentation

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

Protocol base class constructor.

Definition at line 61 of file ProtocolSingle.cpp.

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

: Protocol(pSession, pXml)
{
m_session = pSession;
if (!pXml)
{
return;
}
const TiXmlElement *pXmlparameter;
pXmlparameter = pXml->FirstChildElement("START");
m_start = atof(pXmlparameter->GetText());
pXmlparameter = pXml->FirstChildElement("DURATION");
m_dur = atof(pXmlparameter->GetText());
}
virtual Nektar::ProtocolSingle::~ProtocolSingle ( )
inlinevirtual

Definition at line 65 of file ProtocolSingle.h.

{}

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.

{
return MemoryManager<ProtocolSingle>
::AllocateSharedPtr(pSession, pXml);
}
void Nektar::ProtocolSingle::Initialise ( )

Initialise the protocol storage and set initial conditions.

Initialise the protocol. Allocate workspace and variable storage.

Reimplemented from Nektar::Protocol.

Definition at line 87 of file ProtocolSingle.cpp.

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

Implements Nektar::Protocol.

Definition at line 114 of file ProtocolSingle.cpp.

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

Implements Nektar::Protocol.

Definition at line 96 of file ProtocolSingle.cpp.

References m_dur, and m_start.

{
if(time > m_start && time < (m_start+m_dur))
{
return 1.0;
}
else
{
return 0.0;
}
}
void Nektar::ProtocolSingle::v_SetInitialConditions ( )
protectedvirtual

Definition at line 123 of file ProtocolSingle.cpp.

{
}

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

Referenced by ProtocolSingle(), and v_GetAmplitude().

NekDouble Nektar::ProtocolSingle::m_start
protected

Definition at line 71 of file ProtocolSingle.h.

Referenced by ProtocolSingle(), and v_GetAmplitude().