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
21 changes: 13 additions & 8 deletions src/python/monodomain_2D_vary_parameters_spatially.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,34 @@
cellMLParametersFieldUserNumber = 8
cellMLIntermediateFieldUserNumber = 9

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)

#DOC-START parallel information
# 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()
#DOC-END parallel information

#DOC-START initialisation
# Create a 2D rectangular cartesian coordinate system
coordinateSystem = iron.CoordinateSystem()
coordinateSystem.CreateStart(coordinateSystemUserNumber)
coordinateSystem.CreateStart(coordinateSystemUserNumber,iron.Context)
coordinateSystem.DimensionSet(2)
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()
Expand All @@ -88,7 +93,7 @@
#DOC-START basis
# Define a bilinear Lagrange basis
basis = iron.Basis()
basis.CreateStart(basisUserNumber)
basis.CreateStart(basisUserNumber,iron.Context)
basis.type = iron.BasisTypes.LAGRANGE_HERMITE_TP
basis.numberOfXi = 2
basis.interpolationXi = [iron.BasisInterpolationSpecifications.LINEAR_LAGRANGE]*2
Expand Down Expand Up @@ -281,7 +286,7 @@
problemSpecification = [iron.ProblemClasses.BIOELECTRICS,
iron.ProblemTypes.MONODOMAIN_EQUATION,
iron.ProblemSubtypes.MONODOMAIN_GUDUNOV_SPLIT]
problem.CreateStart(problemUserNumber, problemSpecification)
problem.CreateStart(problemUserNumber,iron.Context,problemSpecification)
problem.CreateFinish()
#DOC-END define monodomain problem

Expand Down