Skip to content

Commit

Permalink
changed Rat options + MinorRadius parametr name
Browse files Browse the repository at this point in the history
  • Loading branch information
zekh167 committed Jan 14, 2020
1 parent 464ccf2 commit b3976d5
Showing 1 changed file with 29 additions and 31 deletions.
60 changes: 29 additions & 31 deletions src/scaffoldmaker/meshtypes/meshtype_3d_bladder1.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,15 @@ def getDefaultOptions(cls, parameterSetName='Default'):
}

if 'Rat' in parameterSetName:
options = {
'Number of elements around': 16, # should be even
'Number of elements radially on annulus': 2,
'Height': 3.0,
'Major diameter': 5.0,
'Minor diameter': 3.0,
'Urethra diameter': 0.7,
'Ureter': copy.deepcopy(ostiumOption),
'Ostium position around': 0.55,
'Ostium position up': 0.65,
}
options['Number of elements around'] = 16, # should be even
options['Number of elements radially on annulus'] = 2,
options['Height'] = 3.0,
options['Major diameter'] = 5.0,
options['Minor diameter'] = 3.0,
options['Urethra diameter'] = 0.7,
options['Ureter'] = copy.deepcopy(ostiumOption),

This comment has been minimized.

Copy link
@rchristie

rchristie Jan 14, 2020

Member

options['Ureter'] should already be correct from above code.

options['Ostium position around'] = 0.55,
options['Ostium position up'] = 0.65,
return options

@staticmethod
Expand Down Expand Up @@ -271,7 +269,7 @@ def generateBaseMesh(region, options):
neckMeshGroup = neckGroup.getMeshGroup(mesh)
bodyMeshGroup = bodyGroup.getMeshGroup(mesh)

# # create nodes
# create nodes
# create neck of the bladder
nodeIdentifier = 1
radiansPerElementAround = 2.0*math.pi/elementsCountAround
Expand All @@ -294,21 +292,21 @@ def generateBaseMesh(region, options):
radiansUp = n2 * radiansPerElementUpNeck
cosRadiansUp = math.cos(radiansUp)
sinRadiansUp = math.sin(radiansUp)
MajorRadius = 0.5 * majorDiameter * sinRadiansUp - n3 * bladderWallThickness
MinorRadius = 0.5 * minorDiameter * sinRadiansUp - n3 * bladderWallThickness
majorRadius = 0.5 * majorDiameter * sinRadiansUp - n3 * bladderWallThickness
minorRadius = 0.5 * minorDiameter * sinRadiansUp - n3 * bladderWallThickness
if n2 == 0:
for n1 in range(elementsCountAround):
radiansAround = n1 * radiansPerElementAround
cosRadiansAround = math.cos(radiansAround)
sinRadiansAround = math.sin(radiansAround)
x = [
-MajorRadius * sinRadiansAround,
MinorRadius * cosRadiansAround,
-majorRadius * sinRadiansAround,
minorRadius * cosRadiansAround,
-height - neckHeight
]
dx_ds1 = [
-MajorRadius * cosRadiansAround * radiansPerElementAround,
MinorRadius * -sinRadiansAround * radiansPerElementAround,
-majorRadius * cosRadiansAround * radiansPerElementAround,
minorRadius * -sinRadiansAround * radiansPerElementAround,
0.0
]
dx_ds2 = [
Expand All @@ -326,13 +324,13 @@ def generateBaseMesh(region, options):
cosRadiansAround = math.cos(radiansAround)
sinRadiansAround = math.sin(radiansAround)
x = [
-MajorRadius * sinRadiansAround,
MinorRadius * cosRadiansAround,
-majorRadius * sinRadiansAround,
minorRadius * cosRadiansAround,
-height - neckHeight + n2 * 2 * neckHeight / elementsCountUpNeck
]
dx_ds1 = [
-MajorRadius * cosRadiansAround * radiansPerElementAround,
MinorRadius * -sinRadiansAround * radiansPerElementAround,
-majorRadius * cosRadiansAround * radiansPerElementAround,
minorRadius * -sinRadiansAround * radiansPerElementAround,
0.0
]
dx_ds2 = [
Expand Down Expand Up @@ -481,21 +479,21 @@ def generateBaseMesh(region, options):
radiansUp = (math.pi / 4) + n2 * radiansPerElementUpBody
cosRadiansUp = math.cos(radiansUp)
sinRadiansUp = math.sin(radiansUp)
MajorRadius = 0.5 * majorDiameter * sinRadiansUp - n3 * bladderWallThickness
MinorRadius = 0.5 * minorDiameter * sinRadiansUp - n3 * bladderWallThickness
majorRadius = 0.5 * majorDiameter * sinRadiansUp - n3 * bladderWallThickness
minorRadius = 0.5 * minorDiameter * sinRadiansUp - n3 * bladderWallThickness
for n1 in range(elementsCountAround):
radiansAround = n1 * radiansPerElementAround
cosRadiansAround = math.cos(radiansAround)
sinRadiansAround = math.sin(radiansAround)
et = (2 * height + neckHeight) / (elementsCountUpNeck + elementsCountUpBody)
x = [
-MajorRadius * sinRadiansAround,
MinorRadius * cosRadiansAround,
-majorRadius * sinRadiansAround,
minorRadius * cosRadiansAround,
-height * cosRadiansUp
]
dx_ds1 = [
-MajorRadius * cosRadiansAround * radiansPerElementAround,
MinorRadius * -sinRadiansAround * radiansPerElementAround,
-majorRadius * cosRadiansAround * radiansPerElementAround,
minorRadius * -sinRadiansAround * radiansPerElementAround,
0.0
]
dx_ds2 = [
Expand All @@ -520,7 +518,7 @@ def generateBaseMesh(region, options):
coordinates.setNodeParameters(cache, -1, Node.VALUE_LABEL_D_DS2, 1, [0.0, height*radiansPerElementUpBody/2, 0.0])
nodeIdentifier += 1

# # create ureters on the surface
# create ureters on the surface
elementIdentifier = 1
# ureter 1
centerUreter1_x, centerUreter1_d1, centerUreter1_d2 = tracksurfaceOstium1.evaluateCoordinates(ostium1Position, derivatives=True)
Expand Down Expand Up @@ -553,7 +551,7 @@ def generateBaseMesh(region, options):
startNodeIdentifier=nodeIdentifier,
startElementIdentifier=elementIdentifier)

# # create annulus mesh around ostium
# create annulus mesh around ostium
endPoints1_x = [[None] * elementsCountAroundOstium, [None] * elementsCountAroundOstium]
endPoints1_d1 = [[None] * elementsCountAroundOstium, [None] * elementsCountAroundOstium]
endPoints1_d2 = [[None] * elementsCountAroundOstium, [None] * elementsCountAroundOstium]
Expand Down Expand Up @@ -662,7 +660,7 @@ def generateBaseMesh(region, options):
endPoints2_x, endPoints2_d1, endPoints2_d2, None, endNode2_Id, endDerivativesMap,
elementsCountRadial=elementsCountAnnulusRadially, meshGroups=[neckMeshGroup])

# # create elements
# create elements
for e3 in range(1):
newl = (e3 + 1) * ((elementsCountUpNeck + elementsCountUpBody) * elementsCountAround + 1)
# create bladder neck elements
Expand Down

0 comments on commit b3976d5

Please sign in to comment.