Nektar++
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
solvers
CardiacEPSolver
Stimuli
Protocol.h
Go to the documentation of this file.
1
///////////////////////////////////////////////////////////////////////////////
2
//
3
// File Protocol.h
4
//
5
// For more information, please see: http://www.nektar.info
6
//
7
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
8
// Department of Aeronautics, Imperial College London (UK), and Scientific
9
// Computing and Imaging Institute, University of Utah (USA).
10
//
11
// License for the specific language governing rights and limitations under
12
// Permission is hereby granted, free of charge, to any person obtaining a
13
// copy of this software and associated documentation files (the "Software"),
14
// to deal in the Software without restriction, including without limitation
15
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
16
// and/or sell copies of the Software, and to permit persons to whom the
17
// Software is furnished to do so, subject to the following conditions:
18
//
19
// The above copyright notice and this permission notice shall be included
20
// in all copies or substantial portions of the Software.
21
//
22
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28
// DEALINGS IN THE SOFTWARE.
29
//
30
// Description: Stimulus protocol base class.
31
//
32
///////////////////////////////////////////////////////////////////////////////
33
34
#ifndef NEKTAR_SOLVERS_CARDIACEPSOLVER_STIMULI_PROTOCOL
35
#define NEKTAR_SOLVERS_CARDIACEPSOLVER_STIMULI_PROTOCOL
36
37
#include <
LibUtilities/BasicUtils/NekFactory.hpp
>
38
#include <
LibUtilities/BasicUtils/SessionReader.h
>
39
#include <
LibUtilities/BasicUtils/SharedArray.hpp
>
40
#include <
SolverUtils/Core/Misc.h
>
41
42
namespace
Nektar
43
{
44
// Forward declaration
45
class
Protocol
;
46
47
/// A shared pointer to an EquationSystem object
48
typedef
boost::shared_ptr<Protocol>
ProtocolSharedPtr
;
49
50
/// Datatype of the NekFactory used to instantiate classes derived from
51
/// the EquationSystem class.
52
typedef
LibUtilities::NekFactory
< std::string,
Protocol
,
53
const
LibUtilities::SessionReaderSharedPtr
&,
54
const
TiXmlElement*>
ProtocolFactory
;
55
56
ProtocolFactory
&
GetProtocolFactory
();
57
58
59
/// Protocol base class.
60
class
Protocol
61
{
62
public
:
63
Protocol
(
const
LibUtilities::SessionReaderSharedPtr
& pSession,
64
const
TiXmlElement* pXml);
65
66
virtual
~Protocol
() {}
67
68
/// Initialise the protocol storage and set initial conditions
69
void
Initialise
();
70
71
/// Returns amplitude of stimulus (1 or 0) at given time
72
NekDouble
GetAmplitude
(
const
NekDouble
time)
73
{
74
return
v_GetAmplitude
(time);
75
}
76
77
/// Print a summary of the cell model
78
void
GenerateSummary
(
SolverUtils::SummaryList
& s)
79
{
80
v_GenerateSummary
(s);
81
}
82
83
protected
:
84
/// Session
85
LibUtilities::SessionReaderSharedPtr
m_session
;
86
87
virtual
NekDouble
v_GetAmplitude
(
const
NekDouble
time) = 0;
88
89
virtual
void
v_GenerateSummary
(
SolverUtils::SummaryList
& s) = 0;
90
91
};
92
93
}
94
95
#endif
/*PROTOCOL_H_ */
Generated on Sun Mar 15 2015 00:11:34 for Nektar++ by
1.8.1.2