Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moose
Manage
Activity
Members
Labels
Plan
Issues
9
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sahil Moza
moose
Commits
08f2e43a
Commit
08f2e43a
authored
8 years ago
by
Asia Jędrzejewska-Szmek
Browse files
Options
Downloads
Patches
Plain Diff
Indentation
parent
d0c7b374
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!205
DifShell and DifBuffer implementation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
moose-core/biophysics/DifBufferBase.cpp
+106
-104
106 additions, 104 deletions
moose-core/biophysics/DifBufferBase.cpp
with
106 additions
and
104 deletions
moose-core/biophysics/DifBufferBase.cpp
+
106
−
104
View file @
08f2e43a
...
@@ -41,12 +41,12 @@ const Cinfo * DifBufferBase::initCinfo()
...
@@ -41,12 +41,12 @@ const Cinfo * DifBufferBase::initCinfo()
};
};
static
SharedFinfo
proc
(
static
SharedFinfo
proc
(
"proc"
,
"proc"
,
"Here we create 2 shared finfos to attach with the Ticks. This is because we want to perform DifBufferBase "
"Here we create 2 shared finfos to attach with the Ticks. This is because we want to perform DifBufferBase "
"computations in 2 stages, much as in the Compartment object. "
"computations in 2 stages, much as in the Compartment object. "
"In the first stage we send out the concentration value to other DifBufferBases and Buffer elements. We also"
,
"In the first stage we send out the concentration value to other DifBufferBases and Buffer elements. We also"
,
processShared
,
processShared
,
sizeof
(
processShared
)
/
sizeof
(
Finfo
*
));
sizeof
(
processShared
)
/
sizeof
(
Finfo
*
));
static
DestFinfo
concentration
(
"concentration"
,
static
DestFinfo
concentration
(
"concentration"
,
"Receives concentration (from DifShell)."
,
"Receives concentration (from DifShell)."
,
...
@@ -74,8 +74,8 @@ const Cinfo * DifBufferBase::initCinfo()
...
@@ -74,8 +74,8 @@ const Cinfo * DifBufferBase::initCinfo()
new
EpFunc2
<
DifBufferBase
,
double
,
double
>
(
&
DifBufferBase
::
fluxFromOut
));
new
EpFunc2
<
DifBufferBase
,
double
,
double
>
(
&
DifBufferBase
::
fluxFromOut
));
static
Finfo
*
innerDifShared
[]
=
{
static
Finfo
*
innerDifShared
[]
=
{
&
fluxFromOut
,
&
fluxFromOut
,
DifBufferBase
::
innerDifSourceOut
()
DifBufferBase
::
innerDifSourceOut
()
};
};
...
@@ -104,60 +104,62 @@ const Cinfo * DifBufferBase::initCinfo()
...
@@ -104,60 +104,62 @@ const Cinfo * DifBufferBase::initCinfo()
// Field defs
// Field defs
////////////////////////////
////////////////////////////
static
ElementValueFinfo
<
DifBufferBase
,
double
>
activation
(
"activation"
,
static
ElementValueFinfo
<
DifBufferBase
,
double
>
activation
(
"activation"
,
"Ion concentration from incoming conc message."
,
"Ion concentration from incoming conc message."
,
&
DifBufferBase
::
setActivation
,
&
DifBufferBase
::
setActivation
,
&
DifBufferBase
::
getActivation
);
&
DifBufferBase
::
getActivation
);
static
ElementValueFinfo
<
DifBufferBase
,
double
>
kf
(
"kf"
,
static
ElementValueFinfo
<
DifBufferBase
,
double
>
kf
(
"kf"
,
"Forward rate constant of buffer molecules 1/mM/s (?)"
,
"Forward rate constant of buffer molecules 1/mM/s (?)"
,
&
DifBufferBase
::
setKf
,
&
DifBufferBase
::
setKf
,
&
DifBufferBase
::
getKf
);
&
DifBufferBase
::
getKf
);
static
ElementValueFinfo
<
DifBufferBase
,
double
>
kb
(
"kb"
,
static
ElementValueFinfo
<
DifBufferBase
,
double
>
kb
(
"kb"
,
"Backward rate constant of buffer molecules. 1/s"
,
"Backward rate constant of buffer molecules. 1/s"
,
&
DifBufferBase
::
setKb
,
&
DifBufferBase
::
setKb
,
&
DifBufferBase
::
getKb
);
&
DifBufferBase
::
getKb
);
static
ElementValueFinfo
<
DifBufferBase
,
double
>
D
(
"D"
,
static
ElementValueFinfo
<
DifBufferBase
,
double
>
D
(
"D"
,
"Diffusion constant of buffer molecules. m^2/s"
,
"Diffusion constant of buffer molecules. m^2/s"
,
&
DifBufferBase
::
setD
,
&
DifBufferBase
::
setD
,
&
DifBufferBase
::
getD
);
&
DifBufferBase
::
getD
);
static
ReadOnlyElementValueFinfo
<
DifBufferBase
,
double
>
bFree
(
"bFree"
,
static
ElementValueFinfo
<
DifBufferBase
,
double
>
bFree
(
"bFree"
,
"Free buffer concentration"
,
"Free buffer concentration"
,
&
DifBufferBase
::
getBFree
);
&
DifBufferBase
::
setBFree
,
static
ReadOnlyElementValueFinfo
<
DifBufferBase
,
double
>
bBound
(
"bBound"
,
&
DifBufferBase
::
getBFree
);
"Bound buffer concentration"
,
static
ElementValueFinfo
<
DifBufferBase
,
double
>
bBound
(
"bBound"
,
&
DifBufferBase
::
getBBound
);
"Bound buffer concentration"
,
&
DifBufferBase
::
setBBound
,
&
DifBufferBase
::
getBBound
);
static
ElementValueFinfo
<
DifBufferBase
,
double
>
bTot
(
"bTot"
,
static
ElementValueFinfo
<
DifBufferBase
,
double
>
bTot
(
"bTot"
,
"Total buffer concentration."
,
"Total buffer concentration."
,
&
DifBufferBase
::
setBTot
,
&
DifBufferBase
::
setBTot
,
&
DifBufferBase
::
getBTot
);
&
DifBufferBase
::
getBTot
);
static
ElementValueFinfo
<
DifBufferBase
,
double
>
length
(
"length"
,
static
ElementValueFinfo
<
DifBufferBase
,
double
>
length
(
"length"
,
"Length of shell"
,
"Length of shell"
,
&
DifBufferBase
::
setLength
,
&
DifBufferBase
::
setLength
,
&
DifBufferBase
::
getLength
);
&
DifBufferBase
::
getLength
);
static
ElementValueFinfo
<
DifBufferBase
,
double
>
diameter
(
"diameter"
,
static
ElementValueFinfo
<
DifBufferBase
,
double
>
diameter
(
"diameter"
,
"Diameter of shell"
,
"Diameter of shell"
,
&
DifBufferBase
::
setDiameter
,
&
DifBufferBase
::
setDiameter
,
&
DifBufferBase
::
getDiameter
);
&
DifBufferBase
::
getDiameter
);
static
ElementValueFinfo
<
DifBufferBase
,
unsigned
int
>
shapeMode
(
"shapeMode"
,
static
ElementValueFinfo
<
DifBufferBase
,
unsigned
int
>
shapeMode
(
"shapeMode"
,
"shape of the shell: SHELL=0, SLICE=SLAB=1, USERDEF=3"
,
"shape of the shell: SHELL=0, SLICE=SLAB=1, USERDEF=3"
,
&
DifBufferBase
::
setShapeMode
,
&
DifBufferBase
::
setShapeMode
,
&
DifBufferBase
::
getShapeMode
);
&
DifBufferBase
::
getShapeMode
);
static
ElementValueFinfo
<
DifBufferBase
,
double
>
thickness
(
"thickness"
,
static
ElementValueFinfo
<
DifBufferBase
,
double
>
thickness
(
"thickness"
,
"Thickness of shell"
,
"Thickness of shell"
,
&
DifBufferBase
::
setThickness
,
&
DifBufferBase
::
setThickness
,
&
DifBufferBase
::
getThickness
);
&
DifBufferBase
::
getThickness
);
static
ElementValueFinfo
<
DifBufferBase
,
double
>
innerArea
(
"innerArea"
,
static
ElementValueFinfo
<
DifBufferBase
,
double
>
innerArea
(
"innerArea"
,
"Inner area of shell"
,
"Inner area of shell"
,
&
DifBufferBase
::
setInnerArea
,
&
DifBufferBase
::
setInnerArea
,
&
DifBufferBase
::
getInnerArea
);
&
DifBufferBase
::
getInnerArea
);
static
ElementValueFinfo
<
DifBufferBase
,
double
>
outerArea
(
"outerArea"
,
static
ElementValueFinfo
<
DifBufferBase
,
double
>
outerArea
(
"outerArea"
,
"Outer area of shell"
,
"Outer area of shell"
,
&
DifBufferBase
::
setOuterArea
,
&
DifBufferBase
::
setOuterArea
,
&
DifBufferBase
::
getOuterArea
);
&
DifBufferBase
::
getOuterArea
);
static
ElementValueFinfo
<
DifBufferBase
,
double
>
volume
(
"volume"
,
""
,
static
ElementValueFinfo
<
DifBufferBase
,
double
>
volume
(
"volume"
,
""
,
&
DifBufferBase
::
setVolume
,
&
DifBufferBase
::
setVolume
,
&
DifBufferBase
::
getVolume
);
&
DifBufferBase
::
getVolume
);
////
////
// DestFinfo
// DestFinfo
...
@@ -399,61 +401,61 @@ void DifBufferBase::vSetSolver( const Eref& e, Id hsolve )
...
@@ -399,61 +401,61 @@ void DifBufferBase::vSetSolver( const Eref& e, Id hsolve )
{;}
{;}
void
DifBufferBase
::
zombify
(
Element
*
orig
,
const
Cinfo
*
zClass
,
void
DifBufferBase
::
zombify
(
Element
*
orig
,
const
Cinfo
*
zClass
,
Id
hsolve
)
Id
hsolve
)
{
{
if
(
orig
->
cinfo
()
==
zClass
)
if
(
orig
->
cinfo
()
==
zClass
)
return
;
return
;
unsigned
int
start
=
orig
->
localDataStart
();
unsigned
int
start
=
orig
->
localDataStart
();
unsigned
int
num
=
orig
->
numLocalData
();
unsigned
int
num
=
orig
->
numLocalData
();
if
(
num
==
0
)
if
(
num
==
0
)
return
;
return
;
unsigned
int
len
=
14
;
unsigned
int
len
=
14
;
vector
<
double
>
data
(
num
*
len
);
vector
<
double
>
data
(
num
*
len
);
unsigned
int
j
=
0
;
unsigned
int
j
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
num
;
++
i
)
{
for
(
unsigned
int
i
=
0
;
i
<
num
;
++
i
)
{
Eref
er
(
orig
,
i
+
start
);
Eref
er
(
orig
,
i
+
start
);
const
DifBufferBase
*
ds
=
const
DifBufferBase
*
ds
=
reinterpret_cast
<
const
DifBufferBase
*
>
(
er
.
data
()
);
reinterpret_cast
<
const
DifBufferBase
*
>
(
er
.
data
()
);
data
[
j
+
0
]
=
ds
->
getActivation
(
er
);
data
[
j
+
0
]
=
ds
->
getActivation
(
er
);
data
[
j
+
1
]
=
ds
->
getBFree
(
er
);
data
[
j
+
1
]
=
ds
->
getBFree
(
er
);
data
[
j
+
2
]
=
ds
->
getBBound
(
er
);
data
[
j
+
2
]
=
ds
->
getBBound
(
er
);
data
[
j
+
3
]
=
ds
->
getBTot
(
er
);
data
[
j
+
3
]
=
ds
->
getBTot
(
er
);
data
[
j
+
4
]
=
ds
->
getKf
(
er
);
data
[
j
+
4
]
=
ds
->
getKf
(
er
);
data
[
j
+
5
]
=
ds
->
getKb
(
er
);
data
[
j
+
5
]
=
ds
->
getKb
(
er
);
data
[
j
+
6
]
=
ds
->
getD
(
er
);
data
[
j
+
6
]
=
ds
->
getD
(
er
);
data
[
j
+
7
]
=
ds
->
getShapeMode
(
er
);
data
[
j
+
7
]
=
ds
->
getShapeMode
(
er
);
data
[
j
+
8
]
=
ds
->
getLength
(
er
);
data
[
j
+
8
]
=
ds
->
getLength
(
er
);
data
[
j
+
9
]
=
ds
->
getDiameter
(
er
);
data
[
j
+
9
]
=
ds
->
getDiameter
(
er
);
data
[
j
+
10
]
=
ds
->
getThickness
(
er
);
data
[
j
+
10
]
=
ds
->
getThickness
(
er
);
data
[
j
+
11
]
=
ds
->
getVolume
(
er
);
data
[
j
+
11
]
=
ds
->
getVolume
(
er
);
data
[
j
+
12
]
=
ds
->
getOuterArea
(
er
);
data
[
j
+
12
]
=
ds
->
getOuterArea
(
er
);
data
[
j
+
13
]
=
ds
->
getInnerArea
(
er
);
data
[
j
+
13
]
=
ds
->
getInnerArea
(
er
);
j
+=
len
;
j
+=
len
;
}
}
orig
->
zombieSwap
(
zClass
);
orig
->
zombieSwap
(
zClass
);
j
=
0
;
j
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
num
;
++
i
)
{
for
(
unsigned
int
i
=
0
;
i
<
num
;
++
i
)
{
Eref
er
(
orig
,
i
+
start
);
Eref
er
(
orig
,
i
+
start
);
DifBufferBase
*
ds
=
DifBufferBase
*
ds
=
reinterpret_cast
<
DifBufferBase
*
>
(
er
.
data
()
);
reinterpret_cast
<
DifBufferBase
*
>
(
er
.
data
()
);
ds
->
vSetSolver
(
er
,
hsolve
);
ds
->
vSetSolver
(
er
,
hsolve
);
ds
->
setActivation
(
er
,
data
[
j
+
0
]);
ds
->
setActivation
(
er
,
data
[
j
+
0
]);
ds
->
setBFree
(
er
,
data
[
j
+
1
]);
ds
->
setBFree
(
er
,
data
[
j
+
1
]);
ds
->
setBBound
(
er
,
data
[
j
+
2
]);
ds
->
setBBound
(
er
,
data
[
j
+
2
]);
ds
->
setBTot
(
er
,
data
[
j
+
3
]);
ds
->
setBTot
(
er
,
data
[
j
+
3
]);
ds
->
setKf
(
er
,
data
[
j
+
4
]);
ds
->
setKf
(
er
,
data
[
j
+
4
]);
ds
->
setKb
(
er
,
data
[
j
+
5
]);
ds
->
setKb
(
er
,
data
[
j
+
5
]);
ds
->
setD
(
er
,
data
[
j
+
6
]);
ds
->
setD
(
er
,
data
[
j
+
6
]);
ds
->
setShapeMode
(
er
,
data
[
j
+
7
]);
ds
->
setShapeMode
(
er
,
data
[
j
+
7
]);
ds
->
setLength
(
er
,
data
[
j
+
8
]);
ds
->
setLength
(
er
,
data
[
j
+
8
]);
ds
->
setDiameter
(
er
,
data
[
j
+
9
]);
ds
->
setDiameter
(
er
,
data
[
j
+
9
]);
ds
->
setThickness
(
er
,
data
[
j
+
10
]);
ds
->
setThickness
(
er
,
data
[
j
+
10
]);
ds
->
setVolume
(
er
,
data
[
j
+
11
]);
ds
->
setVolume
(
er
,
data
[
j
+
11
]);
ds
->
setOuterArea
(
er
,
data
[
j
+
12
]);
ds
->
setOuterArea
(
er
,
data
[
j
+
12
]);
ds
->
setInnerArea
(
er
,
data
[
j
+
13
]);
ds
->
setInnerArea
(
er
,
data
[
j
+
13
]);
j
+=
len
;
//??
j
+=
len
;
//??
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment