Chaste
Release::2018.1
Main Page
Related Pages
Classes
Files
File List
File Members
CheckMonoLr91Vars.hpp
1
/*
2
3
Copyright (c) 2005-2018, University of Oxford.
4
All rights reserved.
5
6
University of Oxford means the Chancellor, Masters and Scholars of the
7
University of Oxford, having an administrative office at Wellington
8
Square, Oxford OX1 2JD, UK.
9
10
This file is part of Chaste.
11
12
Redistribution and use in source and binary forms, with or without
13
modification, are permitted provided that the following conditions are met:
14
* Redistributions of source code must retain the above copyright notice,
15
this list of conditions and the following disclaimer.
16
* Redistributions in binary form must reproduce the above copyright notice,
17
this list of conditions and the following disclaimer in the documentation
18
and/or other materials provided with the distribution.
19
* Neither the name of the University of Oxford nor the names of its
20
contributors may be used to endorse or promote products derived from this
21
software without specific prior written permission.
22
23
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
34
*/
35
36
37
#ifndef CHECKMONOLR91VARS_HPP_
38
#define CHECKMONOLR91VARS_HPP_
39
40
#include "MonodomainProblem.hpp"
41
42
template
<
unsigned
ELEMENT_DIM,
unsigned
SPACE_DIM>
43
void
CheckMonoLr91Vars(
MonodomainProblem<ELEMENT_DIM, SPACE_DIM>
& problem)
44
{
45
46
DistributedVector
voltage = problem.
rGetMesh
().GetDistributedVectorFactory()->CreateDistributedVector(problem.
GetSolution
());
47
for
(
DistributedVector::Iterator
index = voltage.
Begin
();
48
index != voltage.
End
();
49
++index)
50
{
51
// assuming LR model has Ena = 54.4 and Ek = -77
52
double
Ena = 54.4;
53
double
Ek = -77.0;
54
55
TS_ASSERT_LESS_THAN_EQUALS( voltage[index] , Ena + 30);
56
TS_ASSERT_LESS_THAN_EQUALS(-voltage[index] + (Ek-30), 0);
57
58
std::vector<double> ode_vars = problem.
GetMonodomainTissue
()->GetCardiacCell(index.Global)->GetStdVecStateVariables();
59
for
(
int
j=0; j<8; j++)
60
{
61
// if not voltage or calcium ion conc, test whether between 0 and 1
62
if
((j!=0) && (j!=7))
63
{
64
TS_ASSERT_LESS_THAN_EQUALS( ode_vars[j], 1.0);
65
TS_ASSERT_LESS_THAN_EQUALS( -ode_vars[j], 0.0);
66
}
67
}
68
}
69
}
70
71
#endif
/*CHECKMONOLR91VARS_HPP_*/
MonodomainProblem::GetMonodomainTissue
MonodomainTissue< ELEMENT_DIM, SPACE_DIM > * GetMonodomainTissue()
Definition:
MonodomainProblem.cpp:99
DistributedVector::Iterator
Definition:
DistributedVector.hpp:167
AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, 1 >::rGetMesh
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > & rGetMesh()
DistributedVector::End
Iterator End()
Definition:
DistributedVector.cpp:132
DistributedVector
Definition:
DistributedVector.hpp:55
AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, 1 >::GetSolution
Vec GetSolution()
MonodomainProblem
Definition:
MonodomainProblem.hpp:54
DistributedVector::Begin
Iterator Begin()
Definition:
DistributedVector.cpp:124
heart
src
fortests
CheckMonoLr91Vars.hpp
Generated on Thu Dec 20 2018 14:37:52 for Chaste by
1.8.6