@@ -72,7 +72,8 @@ PROGRAM ActiveContractionExample
7272 TYPE (cmfe_BasisType) :: QuadraticBasis, LinearBasis
7373 TYPE (cmfe_BoundaryConditionsType) :: BoundaryConditions
7474 TYPE (cmfe_ComputationEnvironmentType) :: computationEnvironment
75- TYPE (cmfe_CoordinateSystemType) :: CoordinateSystem, WorldCoordinateSystem
75+ TYPE (cmfe_ContextType) :: context
76+ TYPE (cmfe_CoordinateSystemType) :: CoordinateSystem
7677 TYPE (cmfe_MeshType) :: Mesh
7778 TYPE (cmfe_DecompositionType) :: Decomposition
7879 TYPE (cmfe_EquationsType) :: Equations
@@ -93,19 +94,22 @@ PROGRAM ActiveContractionExample
9394 INTEGER (CMISSIntg) :: Err
9495
9596 ! Intialise cmiss
96- CALL cmfe_Initialise(WorldCoordinateSystem,WorldRegion,Err)
97-
98- CALL cmfe_ErrorHandlingModeSet(CMFE_ERRORS_TRAP_ERROR,Err)
97+
98+ CALL cmfe_Context_Initialise(context,err)
99+ CALL cmfe_Initialise(context,err)
100+ CALL cmfe_ErrorHandlingModeSet(CMFE_ERRORS_TRAP_ERROR,err)
101+ CALL cmfe_Region_Initialise(worldRegion,err)
102+ CALL cmfe_Context_WorldRegionGet(context,worldRegion,err)
99103
100104 ! Set all diganostic levels on for testing
101105 ! CALL cmfe_DiagnosticsSetOn(CMFE_FROM_DIAG_TYPE,[1,2,3,4,5],"Diagnostics",["PROBLEM_RESIDUAL_EVALUATE"],Err)
102106
103107 ! Get the number of computational nodes and this computational node number
104108 CALL cmfe_ComputationEnvironment_Initialise(computationEnvironment,Err)
109+ CALL cmfe_Context_ComputationEnvironmentGet(context,computationEnvironment,err)
105110 CALL cmfe_ComputationEnvironment_NumberOfWorldNodesGet(computationEnvironment,numberOfComputationalNodes,Err)
106111 CALL cmfe_ComputationEnvironment_WorldNodeNumberGet(computationEnvironment,computationalNodeNumber,Err)
107112
108-
109113 num_args = command_argument_count()
110114 allocate (args(num_args))
111115
@@ -135,7 +139,7 @@ PROGRAM ActiveContractionExample
135139
136140 ! Create a 3D rectangular cartesian coordinate system
137141 CALL cmfe_CoordinateSystem_Initialise(CoordinateSystem,Err)
138- CALL cmfe_CoordinateSystem_CreateStart(CoordinateSystemUserNumber,CoordinateSystem,Err)
142+ CALL cmfe_CoordinateSystem_CreateStart(CoordinateSystemUserNumber,context, CoordinateSystem,Err)
139143 CALL cmfe_CoordinateSystem_CreateFinish(CoordinateSystem,Err)
140144
141145 ! Create a region and assign the coordinate system to the region
@@ -147,11 +151,11 @@ PROGRAM ActiveContractionExample
147151
148152 ! Define basis functions - tri-linear Lagrange and tri-Quadratic Lagrange
149153 CALL cmfe_Basis_Initialise(LinearBasis,Err)
150- CALL cmfe_Basis_CreateStart(LinearBasisUserNumber,LinearBasis,Err)
154+ CALL cmfe_Basis_CreateStart(LinearBasisUserNumber,context, LinearBasis,Err)
151155 CALL cmfe_Basis_CreateFinish(LinearBasis,Err)
152156
153157 CALL cmfe_Basis_Initialise(QuadraticBasis,Err)
154- CALL cmfe_Basis_CreateStart(QuadraticBasisUserNumber,QuadraticBasis,Err)
158+ CALL cmfe_Basis_CreateStart(QuadraticBasisUserNumber,context, QuadraticBasis,Err)
155159 CALL cmfe_Basis_InterpolationXiSet(QuadraticBasis,[CMFE_BASIS_QUADRATIC_LAGRANGE_INTERPOLATION, &
156160 & CMFE_BASIS_QUADRATIC_LAGRANGE_INTERPOLATION,CMFE_BASIS_QUADRATIC_LAGRANGE_INTERPOLATION],Err)
157161 CALL cmfe_Basis_QuadratureNumberOfGaussXiSet(QuadraticBasis, &
@@ -344,7 +348,7 @@ PROGRAM ActiveContractionExample
344348
345349 ! Define the problem
346350 CALL cmfe_Problem_Initialise(Problem,Err)
347- CALL cmfe_Problem_CreateStart(ProblemUserNumber,[CMFE_PROBLEM_ELASTICITY_CLASS,CMFE_PROBLEM_FINITE_ELASTICITY_TYPE, &
351+ CALL cmfe_Problem_CreateStart(ProblemUserNumber,context, [CMFE_PROBLEM_ELASTICITY_CLASS,CMFE_PROBLEM_FINITE_ELASTICITY_TYPE, &
348352 & CMFE_PROBLEM_QUASISTATIC_FINITE_ELASTICITY_SUBTYPE],Problem,Err)
349353 ! CHANGED TO CMFE_PROBLEM_QUASISTATIC_FINITE_ELASTICITY_SUBTYPE
350354 CALL cmfe_Problem_CreateFinish(Problem,Err)
@@ -408,7 +412,7 @@ PROGRAM ActiveContractionExample
408412 CALL cmfe_Fields_ElementsExport(Fields," ./results/ActiveContraction" ," FORTRAN" ,Err)
409413 CALL cmfe_Fields_Finalise(Fields,Err)
410414
411- CALL cmfe_Finalise(Err)
415+ CALL cmfe_Finalise(context, Err)
412416
413417 WRITE (* ,' (A)' ) " Program successfully completed."
414418
0 commit comments