Skip to content
Snippets Groups Projects
Commit cb4ede8a authored by Tobias Gerach's avatar Tobias Gerach
Browse files

add DREAMRegion to eikonal models

parent e66c3ca6
No related tags found
No related merge requests found
Pipeline #10407 passed
......@@ -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
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment