Skip to content
Open
Changes from all commits
Commits
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
23 changes: 14 additions & 9 deletions src/python/homogeneous_pipe_axial_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,37 +54,42 @@
else:
numberOfMeshComponents = 1

worldRegion = iron.Region()
iron.Context.WorldRegionGet(worldRegion)

# Set the OpenCMISS random seed so that we can test this example by using the
# same parallel decomposition
numberOfRandomSeeds = iron.RandomSeedsSizeGet()
numberOfRandomSeeds = iron.Context.RandomSeedsSizeGet()
randomSeeds = [0]*numberOfRandomSeeds
randomSeeds[0] = 100
iron.RandomSeedsSet(randomSeeds)
iron.Context.RandomSeedsSet(randomSeeds)

# Get the number of computational nodes and this computational node number
numberOfComputationalNodes = iron.ComputationalNumberOfNodesGet()
computationalNodeNumber = iron.ComputationalNodeNumberGet()
computationEnvironment = iron.ComputationEnvironment()
iron.Context.ComputationEnvironmentGet(computationEnvironment)
numberOfComputationalNodes = computationEnvironment.NumberOfWorldNodesGet()
computationalNodeNumber = computationEnvironment.WorldNodeNumberGet()

if computationalNodeNumber == 0:
if not os.path.exists("./results"):
os.makedirs("./results")

# Create a 3D rectangular cartesian coordinate system
coordinateSystem = iron.CoordinateSystem()
coordinateSystem.CreateStart(coordinateSystemUserNumber)
coordinateSystem.CreateStart(coordinateSystemUserNumber,iron.Context)
coordinateSystem.DimensionSet(3)
coordinateSystem.CreateFinish()

# Create a region and assign the coordinate system to the region
region = iron.Region()
region.CreateStart(regionUserNumber,iron.WorldRegion)
region.CreateStart(regionUserNumber,worldRegion)
region.LabelSet("Region")
region.coordinateSystem = coordinateSystem
region.CreateFinish()

# Define basis
basis = iron.Basis()
basis.CreateStart(basisUserNumber)
basis.CreateStart(basisUserNumber,iron.Context)
basis.TypeSet(iron.BasisTypes.LAGRANGE_HERMITE_TP)
basis.NumberOfXiSet(numberOfXi)
basis.InterpolationXiSet([iron.BasisInterpolationSpecifications.QUADRATIC_LAGRANGE]*numberOfXi)
Expand All @@ -95,7 +100,7 @@
if(usePressureBasis):
# Define pressure basis
pressureBasis = iron.Basis()
pressureBasis.CreateStart(pressureBasisUserNumber)
pressureBasis.CreateStart(pressureBasisUserNumber,iron.Context)
pressureBasis.TypeSet(iron.BasisTypes.LAGRANGE_HERMITE_TP)
pressureBasis.NumberOfXiSet(numberOfXi)
pressureBasis.InterpolationXiSet([iron.BasisInterpolationSpecifications.LINEAR_LAGRANGE]*numberOfXi)
Expand Down Expand Up @@ -406,7 +411,7 @@
problemSpecification = [iron.ProblemClasses.ELASTICITY,
iron.ProblemTypes.FINITE_ELASTICITY,
iron.ProblemSubtypes.FINITE_ELASTICITY_WITH_CELLML]
problem.CreateStart(problemUserNumber, problemSpecification)
problem.CreateStart(problemUserNumber,iron.Context,problemSpecification)
problem.CreateFinish()
#DOC-END define CellML finite elasticity problem

Expand Down