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

Protocol base class. More...

#include <ProtocolS1S2.h>

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

Public Member Functions

 ProtocolS1S2 (const LibUtilities::SessionReaderSharedPtr &pSession, const TiXmlElement *pXml)
virtual ~ProtocolS1S2 ()
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
NekDouble m_s1cyclelength
NekDouble m_num_s1
NekDouble m_s2cyclelength
NekDouble m_s2start
NekDouble time1
- Protected Attributes inherited from Nektar::Protocol
LibUtilities::SessionReaderSharedPtr m_session
 Session.

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 46 of file ProtocolS1S2.h.

Constructor & Destructor Documentation

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

Protocol base class constructor.

Definition at line 57 of file ProtocolS1S2.cpp.

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

: Protocol(pSession, pXml)
{
m_session = pSession;
if (!pXml)
{
return;
}
const TiXmlElement *pXmlparameter; //Declaring variable called pxml...
// See if we have parameters defined. They are optional so we go on if not.
//member variables m_* defined in ProtocolS1S2.h
pXmlparameter = pXml->FirstChildElement("START");
m_start = atof(pXmlparameter->GetText()); //text value within px1, convert to a floating pt and save in m_px1
pXmlparameter = pXml->FirstChildElement("DURATION");
m_dur = atof(pXmlparameter->GetText());
pXmlparameter = pXml->FirstChildElement("S1CYCLELENGTH");
m_s1cyclelength = atof(pXmlparameter->GetText());
pXmlparameter = pXml->FirstChildElement("NUM_S1");
m_num_s1 = atof(pXmlparameter->GetText());
pXmlparameter = pXml->FirstChildElement("S2CYCLELENGTH");
m_s2cyclelength = atof(pXmlparameter->GetText());
}
virtual Nektar::ProtocolS1S2::~ProtocolS1S2 ( )
inlinevirtual

Definition at line 64 of file ProtocolS1S2.h.

{}

Member Function Documentation

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

Creates an instance of this class.

Definition at line 50 of file ProtocolS1S2.h.

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

Initialise the protocol storage and set initial conditions.

Initialise the protocol. Allocate workspace and variable storage.

Reimplemented from Nektar::Protocol.

Definition at line 95 of file ProtocolS1S2.cpp.

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

Implements Nektar::Protocol.

Definition at line 119 of file ProtocolS1S2.cpp.

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

Implements Nektar::Protocol.

Definition at line 101 of file ProtocolS1S2.cpp.

References m_dur, m_num_s1, m_s1cyclelength, m_s2start, m_start, and time1.

{
if( time1 > 0 && time < (m_s1cyclelength * (m_num_s1) + m_start) && time1 < (m_dur))
{
return 1.0;
}
if (time > (m_s2start) && (time < (m_s2start+m_dur)))
{
return 1.0;
}
return 0.0;
}
void Nektar::ProtocolS1S2::v_SetInitialConditions ( )
protectedvirtual

Definition at line 124 of file ProtocolS1S2.cpp.

{
}

Member Data Documentation

std::string Nektar::ProtocolS1S2::className
static
Initial value:
"ProtocolS1S2",
"S1S2 stimulus protocol.")

Name of class.

Definition at line 59 of file ProtocolS1S2.h.

NekDouble Nektar::ProtocolS1S2::m_dur
protected

Definition at line 71 of file ProtocolS1S2.h.

Referenced by ProtocolS1S2(), and v_GetAmplitude().

NekDouble Nektar::ProtocolS1S2::m_num_s1
protected

Definition at line 73 of file ProtocolS1S2.h.

Referenced by ProtocolS1S2(), and v_GetAmplitude().

NekDouble Nektar::ProtocolS1S2::m_s1cyclelength
protected

Definition at line 72 of file ProtocolS1S2.h.

Referenced by ProtocolS1S2(), and v_GetAmplitude().

NekDouble Nektar::ProtocolS1S2::m_s2cyclelength
protected

Definition at line 74 of file ProtocolS1S2.h.

Referenced by ProtocolS1S2().

NekDouble Nektar::ProtocolS1S2::m_s2start
protected

Definition at line 75 of file ProtocolS1S2.h.

Referenced by ProtocolS1S2(), and v_GetAmplitude().

NekDouble Nektar::ProtocolS1S2::m_start
protected

Definition at line 70 of file ProtocolS1S2.h.

Referenced by ProtocolS1S2(), and v_GetAmplitude().

NekDouble Nektar::ProtocolS1S2::time1
protected

Definition at line 76 of file ProtocolS1S2.h.

Referenced by v_GetAmplitude().