Skip to content

Commit

Permalink
Calculate thickness proportions from input relative thicknesses
Browse files Browse the repository at this point in the history
  • Loading branch information
mlin865 committed Nov 12, 2021
1 parent c35f2f4 commit 677db9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/scaffoldmaker/meshtypes/meshtype_3d_stomach1.py
Original file line number Diff line number Diff line change
Expand Up @@ -1990,8 +1990,10 @@ def generateBaseMesh(cls, region, options):
idxMat = []

if elementsCountThroughWall > 1:
thicknessProportions = [0.0, mucosaRelThickness, submucosaRelThickness, circularRelThickness,
longitudinalRelThickness, longitudinalRelThickness]
thicknessProportionsUI = [0.0, mucosaRelThickness, submucosaRelThickness, circularRelThickness,
longitudinalRelThickness, longitudinalRelThickness]
thicknessProportions = [thicknessProportion / sum(thicknessProportionsUI)
for thicknessProportion in thicknessProportionsUI]
xi3List = []
xi3 = 0.0
for i in range(len(thicknessProportions) - 1):
Expand Down
8 changes: 4 additions & 4 deletions tests/test_stomach.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def test_stomach1(self):
coordinates = fieldmodule.findFieldByName("coordinates").castFiniteElement()
self.assertTrue(coordinates.isValid())
minimums, maximums = evaluateFieldNodesetRange(coordinates, nodes)
assertAlmostEqualList(self, minimums, [-18.238549598577396, -16.033751319943754, -8.905924748773598], 1.0E-6)
assertAlmostEqualList(self, maximums, [18.285156743233415, 15.214807824088728, 8.905433142848109], 1.0E-6)
assertAlmostEqualList(self, minimums, [-18.214909076136756, -16.010042251585798, -8.882419863214968], 1.0E-6)
assertAlmostEqualList(self, maximums, [18.262047678184306, 15.214807824088728, 8.881936264327805], 1.0E-6)

with ChangeManager(fieldmodule):
one = fieldmodule.createFieldConstant(1.0)
Expand All @@ -84,10 +84,10 @@ def test_stomach1(self):
fieldcache = fieldmodule.createFieldcache()
result, surfaceArea = surfaceAreaField.evaluateReal(fieldcache, 1)
self.assertEqual(result, RESULT_OK)
self.assertAlmostEqual(surfaceArea, 2557.832902256128, delta=1.0E-6)
self.assertAlmostEqual(surfaceArea, 2548.511860089027, delta=1.0E-6)
result, volume = volumeField.evaluateReal(fieldcache, 1)
self.assertEqual(result, RESULT_OK)
self.assertAlmostEqual(volume, 809.0349219398828, delta=1.0E-6)
self.assertAlmostEqual(volume, 769.8802118839903, delta=1.0E-6)

# check some annotationGroups:
expectedSizes3d = {
Expand Down

0 comments on commit 677db9e

Please sign in to comment.