Skip to content

Commit 1a4b39d

Browse files
committed
Fixes for contexts.
1 parent 4d352e6 commit 1a4b39d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/python/dof_constraints.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,31 @@
3131
sourceFieldUserNumber) = range(1, 6)
3232
problemUserNumber = 1
3333

34+
35+
worldRegion = iron.Region()
36+
iron.Context.WorldRegionGet(worldRegion)
37+
3438
# Get the number of computational nodes and this computational node number
3539
computationEnvironment = iron.ComputationEnvironment()
40+
iron.Context.ComputationEnvironmentGet(computationEnvironment)
3641
numberOfComputationalNodes = computationEnvironment.NumberOfWorldNodesGet()
3742
computationalNodeNumber = computationEnvironment.WorldNodeNumberGet()
3843

3944
# Create a 3D rectangular cartesian coordinate system
4045
coordinateSystem = iron.CoordinateSystem()
41-
coordinateSystem.CreateStart(coordinateSystemUserNumber)
46+
coordinateSystem.CreateStart(coordinateSystemUserNumber,iron.Context)
4247
coordinateSystem.CreateFinish()
4348

4449
# Create a region and assign the coordinate system to the region
4550
region = iron.Region()
46-
region.CreateStart(regionUserNumber, iron.WorldRegion)
51+
region.CreateStart(regionUserNumber, worldRegion)
4752
region.LabelSet("Region")
4853
region.CoordinateSystemSet(coordinateSystem)
4954
region.CreateFinish()
5055

5156
# Define basis
5257
basis = iron.Basis()
53-
basis.CreateStart(basisUserNumber)
58+
basis.CreateStart(basisUserNumber,iron.Context)
5459
basis.NumberOfXiSet(numberOfXi)
5560
basis.InterpolationXiSet([
5661
iron.BasisInterpolationSpecifications.LINEAR_LAGRANGE] * numberOfXi)
@@ -146,7 +151,7 @@
146151
problemSpecification = [iron.ProblemClasses.ELASTICITY,
147152
iron.ProblemTypes.FINITE_ELASTICITY,
148153
iron.ProblemSubtypes.NONE]
149-
problem.CreateStart(problemUserNumber, problemSpecification)
154+
problem.CreateStart(problemUserNumber,iron.Context,problemSpecification)
150155
problem.CreateFinish()
151156

152157
# Create the problem control loop

0 commit comments

Comments
 (0)