Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Nektar
Nektar
Commits
7fe8d96e
Commit
7fe8d96e
authored
Apr 04, 2013
by
Chris Cantwell
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/cardiac-electrogram' of localhost:nektar
parents
70a85d53
dc70d531
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
48 deletions
+52
-48
solvers/CardiacEPSolver/Filters/FilterElectrogram.cpp
solvers/CardiacEPSolver/Filters/FilterElectrogram.cpp
+7
-5
solvers/CardiacEPSolver/Filters/FilterElectrogram.h
solvers/CardiacEPSolver/Filters/FilterElectrogram.h
+45
-43
No files found.
solvers/CardiacEPSolver/Filters/FilterElectrogram.cpp
View file @
7fe8d96e
...
...
@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Outputs v
alues at specific points during time-stepping
.
// Description: Outputs v
irtual electrograms at specific locations
.
//
///////////////////////////////////////////////////////////////////////////////
...
...
@@ -39,7 +39,10 @@
namespace
Nektar
{
std
::
string
FilterElectrogram
::
className
=
GetFilterFactory
().
RegisterCreatorFunction
(
"Electrogram"
,
FilterElectrogram
::
create
);
std
::
string
FilterElectrogram
::
className
=
GetFilterFactory
().
RegisterCreatorFunction
(
"Electrogram"
,
FilterElectrogram
::
create
);
/**
*
...
...
@@ -99,15 +102,14 @@ namespace Nektar
"No history points in stream."
);
m_index
=
0
;
m_electrogramList
.
clear
();
Array
<
OneD
,
NekDouble
>
gloCoord
(
3
,
0.0
);
LibUtilities
::
CommSharedPtr
vComm
=
pFields
[
0
]
->
GetComm
();
// Read electrogram points
// Always use dim = 3 to allow electrode to be above surface
int
dim
=
3
;
const
int
dim
=
3
;
const
NekDouble
tol
=
1e-06
;
int
i
=
0
;
NekDouble
tol
=
1e-06
;
while
(
!
m_electrogramStream
.
fail
())
{
...
...
solvers/CardiacEPSolver/Filters/FilterElectrogram.h
View file @
7fe8d96e
///////////////////////////////////////////////////////////////////////////////
//
// File Filter
Checkpoint
.h
// File Filter
Electrogram
.h
//
// For more information, please see: http://www.nektar.info
//
...
...
@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Outputs
solution fields during time-stepping
.
// Description: Outputs
virtual electrograms at specific locations
.
//
///////////////////////////////////////////////////////////////////////////////
...
...
@@ -42,51 +42,53 @@ using namespace SolverUtils;
namespace
Nektar
{
// namespace SolverUtils
// {
class
FilterElectrogram
:
public
Filter
{
public:
friend
class
MemoryManager
<
FilterElectrogram
>
;
class
FilterElectrogram
:
public
Filter
{
public:
friend
class
MemoryManager
<
FilterElectrogram
>
;
/// Creates an instance of this class
static
FilterSharedPtr
create
(
const
LibUtilities
::
SessionReaderSharedPtr
&
pSession
,
const
std
::
map
<
std
::
string
,
std
::
string
>
&
pParams
)
{
FilterSharedPtr
p
=
MemoryManager
<
FilterElectrogram
>::
AllocateSharedPtr
(
pSession
,
pParams
);
//p->InitObject();
return
p
;
}
/// Creates an instance of this class
static
FilterSharedPtr
create
(
const
LibUtilities
::
SessionReaderSharedPtr
&
pSession
,
const
std
::
map
<
std
::
string
,
std
::
string
>
&
pParams
)
{
FilterSharedPtr
p
=
MemoryManager
<
FilterElectrogram
>::
AllocateSharedPtr
(
pSession
,
pParams
);
return
p
;
}
///Name of the class
static
std
::
string
className
;
///Name of the class
static
std
::
string
className
;
FilterElectrogram
(
const
LibUtilities
::
SessionReaderSharedPtr
&
pSession
,
const
std
::
map
<
std
::
string
,
std
::
string
>
&
pParams
);
~
FilterElectrogram
();
FilterElectrogram
(
const
LibUtilities
::
SessionReaderSharedPtr
&
pSession
,
const
std
::
map
<
std
::
string
,
std
::
string
>
&
pParams
);
~
FilterElectrogram
();
protected:
virtual
void
v_Initialise
(
const
Array
<
OneD
,
const
MultiRegions
::
ExpListSharedPtr
>
&
pFields
,
const
NekDouble
&
time
);
virtual
void
v_Update
(
const
Array
<
OneD
,
const
MultiRegions
::
ExpListSharedPtr
>
&
pFields
,
const
NekDouble
&
time
);
virtual
void
v_Finalise
(
const
Array
<
OneD
,
const
MultiRegions
::
ExpListSharedPtr
>
&
pFields
,
const
NekDouble
&
time
);
virtual
bool
v_IsTimeDependent
();
protected:
virtual
void
v_Initialise
(
const
Array
<
OneD
,
const
MultiRegions
::
ExpListSharedPtr
>
&
pFields
,
const
NekDouble
&
time
);
virtual
void
v_Update
(
const
Array
<
OneD
,
const
MultiRegions
::
ExpListSharedPtr
>
&
pFields
,
const
NekDouble
&
time
);
virtual
void
v_Finalise
(
const
Array
<
OneD
,
const
MultiRegions
::
ExpListSharedPtr
>
&
pFields
,
const
NekDouble
&
time
);
virtual
bool
v_IsTimeDependent
();
private:
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
m_grad_R_x
;
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
m_grad_R_y
;
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
m_grad_R_z
;
SpatialDomains
::
VertexComponentVector
m_electrogramPoints
;
unsigned
int
m_index
;
unsigned
int
m_outputFrequency
;
std
::
string
m_outputFile
;
std
::
ofstream
m_outputStream
;
std
::
stringstream
m_electrogramStream
;
std
::
list
<
std
::
pair
<
SpatialDomains
::
VertexComponentSharedPtr
,
int
>
>
m_electrogramList
;
std
::
map
<
int
,
int
>
m_electrogramLocalPointMap
;
};
// }
private:
/// Gradient of the radius from each electrogram point in x-direction
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
m_grad_R_x
;
/// Gradient of the radius from each electrogram point in y-direction
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
m_grad_R_y
;
/// Gradient of the radius from each electrogram point in z-direction
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
m_grad_R_z
;
/// List of electrogram points
SpatialDomains
::
VertexComponentVector
m_electrogramPoints
;
/// Counts number of calls to update (number of timesteps)
unsigned
int
m_index
;
/// Number of timesteps between outputs
unsigned
int
m_outputFrequency
;
/// Filename to output electrogram data to
std
::
string
m_outputFile
;
/// Output file stream for electrogram data
std
::
ofstream
m_outputStream
;
/// Point coordinate input string
std
::
stringstream
m_electrogramStream
;
};
}
#endif
/* NEKTAR_SOLVERUTILS_FILTERS_FILTERCHECKPOINT_H */
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment