From de4172ebe2b6531abb8c4ed3601cc8569abbdc53 Mon Sep 17 00:00:00 2001 From: Chris Bradley Date: Tue, 10 Apr 2018 15:00:49 +1200 Subject: [PATCH 1/2] Update for new computation environment routines. --- src/python/dof_constraints.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/python/dof_constraints.py b/src/python/dof_constraints.py index f8bc6e8..8d74941 100755 --- a/src/python/dof_constraints.py +++ b/src/python/dof_constraints.py @@ -32,8 +32,9 @@ problemUserNumber = 1 # Get the number of computational nodes and this computational node number -numberOfComputationalNodes = iron.ComputationalNumberOfNodesGet() -computationalNodeNumber = iron.ComputationalNodeNumberGet() +computationEnvironment = iron.ComputationEnvironment() +numberOfComputationalNodes = computationEnvironment.NumberOfWorldNodesGet() +computationalNodeNumber = computationEnvironment.WorldNodeNumberGet() # Create a 3D rectangular cartesian coordinate system coordinateSystem = iron.CoordinateSystem() From 1a4b39d108ba2d8819736eb09a9e1901eaa47e8f Mon Sep 17 00:00:00 2001 From: Chris Bradley Date: Fri, 27 Apr 2018 20:08:42 +1200 Subject: [PATCH 2/2] Fixes for contexts. --- src/python/dof_constraints.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/python/dof_constraints.py b/src/python/dof_constraints.py index 8d74941..a9d041f 100755 --- a/src/python/dof_constraints.py +++ b/src/python/dof_constraints.py @@ -31,26 +31,31 @@ sourceFieldUserNumber) = range(1, 6) problemUserNumber = 1 + +worldRegion = iron.Region() +iron.Context.WorldRegionGet(worldRegion) + # Get the number of computational nodes and this computational node number computationEnvironment = iron.ComputationEnvironment() +iron.Context.ComputationEnvironmentGet(computationEnvironment) numberOfComputationalNodes = computationEnvironment.NumberOfWorldNodesGet() computationalNodeNumber = computationEnvironment.WorldNodeNumberGet() # Create a 3D rectangular cartesian coordinate system coordinateSystem = iron.CoordinateSystem() -coordinateSystem.CreateStart(coordinateSystemUserNumber) +coordinateSystem.CreateStart(coordinateSystemUserNumber,iron.Context) 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.CoordinateSystemSet(coordinateSystem) region.CreateFinish() # Define basis basis = iron.Basis() -basis.CreateStart(basisUserNumber) +basis.CreateStart(basisUserNumber,iron.Context) basis.NumberOfXiSet(numberOfXi) basis.InterpolationXiSet([ iron.BasisInterpolationSpecifications.LINEAR_LAGRANGE] * numberOfXi) @@ -146,7 +151,7 @@ problemSpecification = [iron.ProblemClasses.ELASTICITY, iron.ProblemTypes.FINITE_ELASTICITY, iron.ProblemSubtypes.NONE] -problem.CreateStart(problemUserNumber, problemSpecification) +problem.CreateStart(problemUserNumber,iron.Context,problemSpecification) problem.CreateFinish() # Create the problem control loop