Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new heart1 scaffold #29

Merged
merged 26 commits into from
Nov 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d784de1
Modify atria aorta incline region
rchristie Oct 24, 2018
daac31c
Add LV, RV outlets, AV fibrous ring nodes
rchristie Oct 26, 2018
63c3105
Add regular elements around base
rchristie Oct 29, 2018
2c50a28
Add cfb, more septum elements
rchristie Nov 1, 2018
463840b
Use wedge elements over v septum
rchristie Nov 5, 2018
cb239ec
Add heart1 scaffold
rchristie Nov 5, 2018
02a9eda
Renumber RV inner nodes
rchristie Nov 5, 2018
7450ea2
Point RV inner septum end d3 toward sulci
rchristie Nov 6, 2018
ed06b38
Make RV inside ends rounder
rchristie Nov 6, 2018
d9a1de1
Tweak base septum elements
rchristie Nov 6, 2018
be09ac5
Add extra points on supraventricular crest
rchristie Nov 8, 2018
e970cce
Add more RV base elements
rchristie Nov 8, 2018
1070aad
Close rv supraventricular crest
rchristie Nov 8, 2018
4faff61
Remove hanging node elements, close infundibulum
rchristie Nov 9, 2018
6f7635a
Fix/remove derivative 3 between lv, rv outlets
rchristie Nov 9, 2018
edddc7b
Complete LV freewall row 1 elements
rchristie Nov 11, 2018
a064192
Reorder and remap derivatives on anterior sulcus point
rchristie Nov 11, 2018
32b50e1
Add more LV closure elements
rchristie Nov 11, 2018
f5a645c
Fix derivative map around LA/LV freewall
rchristie Nov 12, 2018
62df04f
Close base
rchristie Nov 13, 2018
47d926c
Fix mapping at cfb element
rchristie Nov 13, 2018
608dfc4
Reverse derivative 3 at cfb
rchristie Nov 13, 2018
c5edf66
Add fibrous ring to heart1
rchristie Nov 14, 2018
be87d3b
Return whether check options changed dependencies
rchristie Nov 15, 2018
c468e21
Support 6 or 8 elements around atrial free wall in base
rchristie Nov 16, 2018
713f890
Merge remote-tracking branch 'abi/master' into heart1
rchristie Nov 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion scaffoldmaker/annotation/annotationgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,37 @@ def getGroup(self):
def getFieldElementGroup(self, mesh):
'''
:param mesh: The Zinc mesh to manage a sub group of.
:return: The Zinc meshGroup for adding elements of mesh in this AnnotationGroup.
:return: The Zinc element group field for mesh in this AnnotationGroup.
'''
elementGroup = self._group.getFieldElementGroup(mesh)
if not elementGroup.isValid():
elementGroup = self._group.createFieldElementGroup(mesh)
return elementGroup

def getFieldNodeGroup(self, nodeset):
'''
:param nodeset: The Zinc nodeset to manage a sub group of.
:return: The Zinc node group field for nodeset in this AnnotationGroup.
'''
nodeGroup = self._group.getFieldNodeGroup(nodeset)
if not nodeGroup.isValid():
nodeGroup = self._group.createFieldNodeGroup(nodeset)
return nodeGroup

def getMeshGroup(self, mesh):
'''
:param mesh: The Zinc mesh to manage a sub group of.
:return: The Zinc meshGroup for adding elements of mesh in this AnnotationGroup.
'''
return self.getFieldElementGroup(mesh).getMeshGroup()

def getNodesetGroup(self, nodeset):
'''
:param nodeset: The Zinc nodeset to manage a sub group of.
:return: The Zinc nodesetGroup for adding nodes from nodeset in this AnnotationGroup.
'''
return self.getFieldNodeGroup(nodeset).getNodesetGroup()

def addSubelements(self):
'''
Call after group is complete and faces have been defined to add faces and
Expand Down
401 changes: 401 additions & 0 deletions scaffoldmaker/meshtypes/meshtype_3d_heart1.py

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions scaffoldmaker/meshtypes/meshtype_3d_heart2.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ def getOrderedOptionNames():

@staticmethod
def checkOptions(options):
MeshType_3d_heartventriclesbase2.checkOptions(options)
MeshType_3d_heartatria2.checkOptions(options)
dependentChanges = MeshType_3d_heartventriclesbase2.checkOptions(options) \
or MeshType_3d_heartatria2.checkOptions(options)
# only works with particular numbers of elements around
options['Number of elements around atrial septum'] = 2
# set dependent outer diameter used in atria2
options['LV outlet outer diameter'] = options['LV outlet inner diameter'] + 2.0*options['LV outlet wall thickness']
return dependentChanges

@classmethod
def generateBaseMesh(cls, region, options):
Expand Down
108 changes: 70 additions & 38 deletions scaffoldmaker/meshtypes/meshtype_3d_heartatria1.py

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions scaffoldmaker/meshtypes/meshtype_3d_heartatria2.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ def getOrderedOptionNames():

@staticmethod
def checkOptions(options):
'''
:return: True if dependent options changed, otherwise False. This
happens where two or more options must change together to be valid.
Here the number of elements around atrial free wall must be an even number,
but the parameter is number of elements around atria, which depends on
number of elements around atrial septum.
'''
dependentChanges = False
if options['Number of elements around atria'] < 6:
options['Number of elements around atria'] = 6
if options['Number of elements around atrial septum'] < 1:
Expand All @@ -98,6 +106,7 @@ def checkOptions(options):
# need even number of elements around free wall
if ((options['Number of elements around atria'] - options['Number of elements around atrial septum']) % 2) == 1:
options['Number of elements around atria'] += 1
dependentChanges = True
if options['Number of elements up atria'] < 3:
options['Number of elements up atria'] = 3
for key in [
Expand Down Expand Up @@ -138,6 +147,7 @@ def checkOptions(options):
'Refine number of elements through atrial wall']:
if options[key] < 1:
options[key] = 1
return dependentChanges

@classmethod
def generateBaseMesh(cls, region, options):
Expand Down
114 changes: 64 additions & 50 deletions scaffoldmaker/meshtypes/meshtype_3d_heartventricles1.py

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions scaffoldmaker/meshtypes/meshtype_3d_heartventricles2.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def getOrderedOptionNames():

@staticmethod
def checkOptions(options):
'''
:return: True if dependent options changed, otherwise False.
'''
dependentChanges = False
for key in [
'Refine number of elements surface',
'Refine number of elements through LV wall',
Expand Down Expand Up @@ -112,6 +116,7 @@ def checkOptions(options):
options['RV arc around degrees'] = 45.0
elif options['RV arc around degrees'] > 270.0:
options['RV arc around degrees'] = 270.0
return dependentChanges

@classmethod
def generateBaseMesh(cls, region, options):
Expand Down
1,135 changes: 1,104 additions & 31 deletions scaffoldmaker/meshtypes/meshtype_3d_heartventriclesbase1.py

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions scaffoldmaker/meshtypes/meshtype_3d_heartventriclesbase2.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def getDefaultOptions():
options['Number of elements around LV free wall'] = 5
options['Number of elements around ventricular septum'] = 7
options['Number of elements around atria'] = 8
options['Number of elements around atrial septum'] = 2
# works best with particular numbers of elements up
options['Number of elements up LV apex'] = 1
options['Number of elements up ventricular septum'] = 4
Expand All @@ -64,6 +65,7 @@ def getDefaultOptions():
def getOrderedOptionNames():
optionNames = MeshType_3d_heartventricles2.getOrderedOptionNames()
optionNames.insert(4, 'Number of elements around atria')
optionNames.insert(5, 'Number of elements around atrial septum')
optionNames += [
'Atria base inner major axis length',
'Atria base inner minor axis length',
Expand Down Expand Up @@ -93,11 +95,15 @@ def getOrderedOptionNames():

@staticmethod
def checkOptions(options):
MeshType_3d_heartventricles2.checkOptions(options)
'''
:return: True if dependent options changed, otherwise False.
'''
dependentChanges = MeshType_3d_heartventricles2.checkOptions(options)
# only works with particular numbers of elements around
options['Number of elements around LV free wall'] = 5
options['Number of elements around ventricular septum'] = 7
options['Number of elements around atria'] = 8
options['Number of elements around atrial septum'] = 2
for key in [
'Atria base inner major axis length',
'Atria base inner minor axis length',
Expand All @@ -119,6 +125,7 @@ def checkOptions(options):
options['Atria major axis rotation degrees'] = -75.0
elif options['Atria major axis rotation degrees'] > 75.0:
options['Atria major axis rotation degrees'] = 75.0
return dependentChanges

@classmethod
def generateBaseMesh(cls, region, options):
Expand All @@ -136,8 +143,8 @@ def generateBaseMesh(cls, region, options):
elementsCountUpLV = elementsCountUpLVApex + elementsCountUpVSeptum
elementsCountUpRV = elementsCountUpVSeptum + 1
elementsCountAroundRV = elementsCountAroundVSeptum + 2
elementsCountAtrialSeptum = 2 # elementsCountAroundVSeptum - 5
elementsCountAroundAtria = options['Number of elements around atria']
elementsCountAtrialSeptum = options['Number of elements around atrial septum']
lvOuterHeight = options['LV outer height']
lvOuterRadius = options['LV outer radius']
lvFreeWallThickness = options['LV free wall thickness']
Expand Down
2 changes: 2 additions & 0 deletions scaffoldmaker/scaffolds.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from scaffoldmaker.meshtypes.meshtype_3d_box1 import MeshType_3d_box1
from scaffoldmaker.meshtypes.meshtype_3d_boxhole1 import MeshType_3d_boxhole1
from scaffoldmaker.meshtypes.meshtype_3d_centrallinetube1 import MeshType_3d_centrallinetube1
from scaffoldmaker.meshtypes.meshtype_3d_heart1 import MeshType_3d_heart1
from scaffoldmaker.meshtypes.meshtype_3d_heart2 import MeshType_3d_heart2
from scaffoldmaker.meshtypes.meshtype_3d_heartatria1 import MeshType_3d_heartatria1
from scaffoldmaker.meshtypes.meshtype_3d_heartatria2 import MeshType_3d_heartatria2
Expand All @@ -35,6 +36,7 @@ def __init__(self):
MeshType_3d_box1,
MeshType_3d_boxhole1,
MeshType_3d_centrallinetube1,
MeshType_3d_heart1,
MeshType_3d_heart2,
MeshType_3d_heartatria1,
MeshType_3d_heartatria2,
Expand Down