Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
carputils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
openCARP
carputils
Commits
cb4ede8a
Commit
cb4ede8a
authored
2 weeks ago
by
Tobias Gerach
Browse files
Options
Downloads
Patches
Plain Diff
add DREAMRegion to eikonal models
parent
e66c3ca6
Branches
DREAM-interface
No related tags found
No related merge requests found
Pipeline
#10407
passed
2 weeks ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
carputils/model/__init__.py
+1
-1
1 addition, 1 deletion
carputils/model/__init__.py
carputils/model/eikonal.py
+73
-1
73 additions, 1 deletion
carputils/model/eikonal.py
with
74 additions
and
2 deletions
carputils/model/__init__.py
+
1
−
1
View file @
cb4ede8a
...
...
@@ -29,7 +29,7 @@ from . import prepace
from
.stimulus
import
Stimulus
from
.conductivity
import
ConductivityRegion
from
.eikonal
import
EikonalRegion
from
.eikonal
import
EikonalRegion
,
DREAMRegion
# Make aliases for compactness
GRegion
=
ConductivityRegion
...
...
This diff is collapsed.
Click to expand it.
carputils/model/eikonal.py
+
73
−
1
View file @
cb4ede8a
...
...
@@ -17,7 +17,7 @@
# under the License.
#
from
.general
import
AbstractModelComponent
,
SingleIDRegionMixin
from
.general
import
AbstractModelComponent
,
SingleIDRegionMixin
,
RegionMixin
class
EikonalRegion
(
SingleIDRegionMixin
,
AbstractModelComponent
):
"""
...
...
@@ -94,3 +94,75 @@ class EikonalRegion(SingleIDRegionMixin, AbstractModelComponent):
# Add ignore flag
yield
'
ignore
'
,
int
(
self
.
_passive
)
class
DREAMRegion
(
RegionMixin
,
AbstractModelComponent
):
"""
Defines an eikonal model region for the DREAM.
Args
IDs : list
The material tags in this region
name : str, optional
A short descriptive name for this region
vel_l : float, optional
Conduction velocity in the fibre direction
vel_t : float, optional
Conduction velocity in the sheet direction
vel_n : float, optional
Conduction velocity in the sheet-normal direction
"""
PRM_ARRAY
=
'
gregion
'
PRM_LENGTH
=
'
num_gregions
'
_SENTINEL
=
object
()
def
__init__
(
self
,
IDs
=
[],
name
=
None
,
vel_l
=
600
,
vel_t
=
400
,
vel_n
=
200
,
g_il
=
0.174
,
g_it
=
0.019
,
g_in
=
0.019
,
g_el
=
0.625
,
g_et
=
0.236
,
g_en
=
0.236
):
super
(
DREAMRegion
,
self
).
__init__
(
IDs
=
IDs
,
name
=
name
)
self
.
_vel_l
=
vel_l
self
.
_vel_t
=
vel_t
self
.
_vel_n
=
vel_n
self
.
_g_il
=
g_il
self
.
_g_it
=
g_it
self
.
_g_in
=
g_in
self
.
_g_el
=
g_el
self
.
_g_et
=
g_et
self
.
_g_en
=
g_en
@classmethod
def
isotropic
(
cls
,
IDs
=
[],
name
=
None
,
vel
=
400
,
cond
=
0.1
):
"""
Define an isotropic conductivity region.
Args:
IDs : list
The material tags in this region
name : str, optional
A short descriptive name for this region
vel : float, optional
The conduction velocity to use
cond : float, optional
The conductivity to use
"""
obj
=
cls
(
IDs
,
name
,
vel
,
vel
,
vel
,
cond
,
cond
,
cond
,
cond
,
cond
,
cond
)
return
obj
def
opts
(
self
):
for
opt
in
super
(
DREAMRegion
,
self
).
opts
():
yield
opt
# Add velocities
yield
'
dream.vel_l
'
,
self
.
_vel_l
yield
'
dream.vel_t
'
,
self
.
_vel_t
yield
'
dream.vel_n
'
,
self
.
_vel_n
yield
'
g_il
'
,
self
.
_g_il
yield
'
g_it
'
,
self
.
_g_it
yield
'
g_in
'
,
self
.
_g_in
yield
'
g_el
'
,
self
.
_g_el
yield
'
g_et
'
,
self
.
_g_et
yield
'
g_en
'
,
self
.
_g_en
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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