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

Protocol base class. More...

#include <StimulusCircle.h>

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

Public Member Functions

 StimulusCirc (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField, const TiXmlElement *pXml)
virtual ~StimulusCirc ()
void Initialise ()
 Initialise the protocol storage and set initial conditions.
- Public Member Functions inherited from Nektar::Stimulus
 Stimulus (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField, const TiXmlElement *pXml)
virtual ~Stimulus ()
void Update (Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
 Updates RHS of outarray by adding a stimulus to it.
void GenerateSummary (SolverUtils::SummaryList &s)
 Print a summary of the outarray.

Static Public Member Functions

static StimulusSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField, const TiXmlElement *pXml)
 Creates an instance of this class.
- Static Public Member Functions inherited from Nektar::Stimulus
static std::vector
< StimulusSharedPtr
LoadStimuli (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)

Static Public Attributes

static std::string className
 Name of class.

Protected Member Functions

virtual void v_Update (Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
virtual void v_GenerateSummary (SolverUtils::SummaryList &s)

Protected Attributes

NekDouble m_px1
NekDouble m_py1
NekDouble m_pz1
NekDouble m_pr1
NekDouble m_pis
NekDouble m_strength
NekDouble v_amp
- Protected Attributes inherited from Nektar::Stimulus
LibUtilities::SessionReaderSharedPtr m_session
 Session.
MultiRegions::ExpListSharedPtr m_field
 Transmembrane potential field from PDE system.
int m_nq
 Number of physical points.
ProtocolSharedPtr m_Protocol

Detailed Description

Protocol base class.

The Stimulus 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 53 of file StimulusCircle.h.

Constructor & Destructor Documentation

Nektar::StimulusCirc::StimulusCirc ( const LibUtilities::SessionReaderSharedPtr pSession,
const MultiRegions::ExpListSharedPtr pField,
const TiXmlElement *  pXml 
)

Stimulus base class constructor.

Definition at line 61 of file StimulusCircle.cpp.

References Nektar::Stimulus::m_field, Nektar::Stimulus::m_nq, m_pis, m_pr1, m_px1, m_py1, m_pz1, Nektar::Stimulus::m_session, and m_strength.

: Stimulus(pSession, pField, pXml)
{
m_session = pSession;
m_field = pField;
m_nq = pField->GetTotPoints();
if (!pXml)
{
return;
}
const TiXmlElement *pXmlparameter;
pXmlparameter = pXml->FirstChildElement("p_x1");
m_px1 = atof(pXmlparameter->GetText());
pXmlparameter = pXml->FirstChildElement("p_y1");
m_py1 = atof(pXmlparameter->GetText());
pXmlparameter = pXml->FirstChildElement("p_z1");
m_pz1 = atof(pXmlparameter->GetText());
pXmlparameter = pXml->FirstChildElement("p_r1");
m_pr1 = atof(pXmlparameter->GetText());
pXmlparameter = pXml->FirstChildElement("p_is");
m_pis = atof(pXmlparameter->GetText());
pXmlparameter = pXml->FirstChildElement("p_strength");
m_strength = atof(pXmlparameter->GetText());
}
virtual Nektar::StimulusCirc::~StimulusCirc ( )
inlinevirtual

Definition at line 73 of file StimulusCircle.h.

{}

Member Function Documentation

static StimulusSharedPtr Nektar::StimulusCirc::create ( const LibUtilities::SessionReaderSharedPtr pSession,
const MultiRegions::ExpListSharedPtr pField,
const TiXmlElement *  pXml 
)
inlinestatic

Creates an instance of this class.

Definition at line 57 of file StimulusCircle.h.

{
::AllocateSharedPtr(pSession, pField, pXml);
}
void Nektar::StimulusCirc::Initialise ( )

Initialise the protocol storage and set initial conditions.

Initialise the stimulus. Allocate workspace and variable storage.

Reimplemented from Nektar::Stimulus.

Definition at line 101 of file StimulusCircle.cpp.

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

Implements Nektar::Stimulus.

Definition at line 173 of file StimulusCircle.cpp.

{
}
void Nektar::StimulusCirc::v_Update ( Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  time 
)
protectedvirtual

Implements Nektar::Stimulus.

Definition at line 110 of file StimulusCircle.cpp.

References Nektar::Stimulus::m_field, m_pis, m_pr1, Nektar::Stimulus::m_Protocol, m_px1, m_py1, m_pz1, m_strength, and v_amp.

{
// Get the dimension of the expansion
int dim = m_field->GetCoordim(0);
//Retrieve coodrinates of quadrature points
int nq = m_field->GetNpoints();
Array<OneD,NekDouble> x0(nq);
Array<OneD,NekDouble> x1(nq);
Array<OneD,NekDouble> x2(nq);
// Get the protocol amplitude
NekDouble v_amp = m_Protocol->GetAmplitude(time) * m_strength;
// get the coordinates
m_field->GetCoords(x0,x1,x2);
switch (dim)
{
case 1:
for(int j=0; j<nq; j++)
{
outarray[0][j] += v_amp
* ( -tanh( (m_pis * x0[j] - m_px1 + m_pr1)
* (m_pis * x0[j] - m_px1 - m_pr1)
) / 2.0 + 0.5 );
}
break;
case 2:
for(int j=0; j<nq; j++)
{
outarray[0][j] += v_amp
* ( -tanh( (m_pis * x0[j] - m_px1+m_pr1)
* (m_pis * x0[j] - m_px1-m_pr1)
+ (m_pis * x1[j] - m_py1+m_pr1)
* (m_pis * x1[j] - m_py1-m_pr1)
) / 2.0 + 0.5 );
}
break;
case 3:
for(int j=0; j<nq; j++)
{
outarray[0][j] += v_amp
* ( -tanh( (m_pis * x0[j] - m_px1+m_pr1)
* (m_pis * x0[j] - m_px1-m_pr1)
+ (m_pis * x1[j] - m_py1+m_pr1)
* (m_pis * x1[j] - m_py1-m_pr1)
+ (m_pis * x2[j] - m_pz1+m_pr1)
* (m_pis * x2[j] - m_pz1-m_pr1)
) / 2.0 + 0.5 );
}
break;
}
}

Member Data Documentation

std::string Nektar::StimulusCirc::className
static
Initial value:
"StimulusCirc",
"Circular stimulus.")

Name of class.

Definition at line 67 of file StimulusCircle.h.

NekDouble Nektar::StimulusCirc::m_pis
protected

Definition at line 83 of file StimulusCircle.h.

Referenced by StimulusCirc(), and v_Update().

NekDouble Nektar::StimulusCirc::m_pr1
protected

Definition at line 82 of file StimulusCircle.h.

Referenced by StimulusCirc(), and v_Update().

NekDouble Nektar::StimulusCirc::m_px1
protected

Definition at line 79 of file StimulusCircle.h.

Referenced by StimulusCirc(), and v_Update().

NekDouble Nektar::StimulusCirc::m_py1
protected

Definition at line 80 of file StimulusCircle.h.

Referenced by StimulusCirc(), and v_Update().

NekDouble Nektar::StimulusCirc::m_pz1
protected

Definition at line 81 of file StimulusCircle.h.

Referenced by StimulusCirc(), and v_Update().

NekDouble Nektar::StimulusCirc::m_strength
protected

Definition at line 84 of file StimulusCircle.h.

Referenced by StimulusCirc(), and v_Update().

NekDouble Nektar::StimulusCirc::v_amp
protected

Definition at line 85 of file StimulusCircle.h.

Referenced by v_Update().