11! > Main program
2- PROGRAM SIMPLESHEAREXAMPLE
2+ PROGRAM SimpleShearExample
33
44 USE OpenCMISS
55 USE OpenCMISS_Iron
@@ -68,7 +68,8 @@ PROGRAM SIMPLESHEAREXAMPLE
6868 TYPE (cmfe_BasisType) :: Basis, PressureBasis
6969 TYPE (cmfe_BoundaryConditionsType) :: BoundaryConditions
7070 TYPE (cmfe_ComputationEnvironmentType) :: computationEnvironment
71- TYPE (cmfe_CoordinateSystemType) :: CoordinateSystem, WorldCoordinateSystem
71+ TYPE (cmfe_ContextType) :: context
72+ TYPE (cmfe_CoordinateSystemType) :: CoordinateSystem
7273 TYPE (cmfe_MeshType) :: Mesh
7374 TYPE (cmfe_DecompositionType) :: Decomposition
7475 TYPE (cmfe_EquationsType) :: Equations
@@ -102,9 +103,11 @@ PROGRAM SIMPLESHEAREXAMPLE
102103#endif
103104
104105 ! Intialise cmiss
105- CALL cmfe_Initialise(WorldCoordinateSystem,WorldRegion,Err)
106-
107- CALL cmfe_ErrorHandlingModeSet(CMFE_ERRORS_TRAP_ERROR,Err)
106+ CALL cmfe_Context_Initialise(context,err)
107+ CALL cmfe_Initialise(context,err)
108+ CALL cmfe_ErrorHandlingModeSet(CMFE_ERRORS_TRAP_ERROR,err)
109+ CALL cmfe_Region_Initialise(worldRegion,err)
110+ CALL cmfe_Context_WorldRegionGet(context,worldRegion,err)
108111
109112 ! Set all diganostic levels on for testing
110113 ! CALL cmfe_DiagnosticsSetOn(CMFE_FROM_DIAG_TYPE,[1,2,3,4,5],"Diagnostics",["PROBLEM_RESIDUAL_EVALUATE"],Err)
@@ -113,6 +116,7 @@ PROGRAM SIMPLESHEAREXAMPLE
113116
114117 ! Get the number of computational nodes and this computational node number
115118 CALL cmfe_ComputationEnvironment_Initialise(computationEnvironment,err)
119+ CALL cmfe_Context_ComputationEnvironmentGet(context,computationEnvironment,err)
116120 CALL cmfe_ComputationEnvironment_NumberOfWorldNodesGet(computationEnvironment,numberOfComputationalNodes,err)
117121 CALL cmfe_ComputationEnvironment_WorldNodeNumberGet(computationEnvironment,computationalNodeNumber,err)
118122
@@ -123,7 +127,7 @@ PROGRAM SIMPLESHEAREXAMPLE
123127
124128 ! Create a 3D rectangular cartesian coordinate system
125129 CALL cmfe_CoordinateSystem_Initialise(CoordinateSystem,Err)
126- CALL cmfe_CoordinateSystem_CreateStart(CoordinateSystemUserNumber,CoordinateSystem,Err)
130+ CALL cmfe_CoordinateSystem_CreateStart(CoordinateSystemUserNumber,context, CoordinateSystem,Err)
127131 CALL cmfe_CoordinateSystem_CreateFinish(CoordinateSystem,Err)
128132
129133 ! Create a region and assign the coordinate system to the region
@@ -135,7 +139,7 @@ PROGRAM SIMPLESHEAREXAMPLE
135139
136140 ! Define geometric basis
137141 CALL cmfe_Basis_Initialise(Basis,Err)
138- CALL cmfe_Basis_CreateStart(BasisUserNumber,Basis,Err)
142+ CALL cmfe_Basis_CreateStart(BasisUserNumber,context, Basis,Err)
139143 SELECT CASE (InterpolationType)
140144 CASE (1 ,2 ,3 ,4 )
141145 CALL cmfe_Basis_TypeSet(Basis,CMFE_BASIS_LAGRANGE_HERMITE_TP_TYPE,Err)
@@ -160,7 +164,7 @@ PROGRAM SIMPLESHEAREXAMPLE
160164 ! Define pressure basis
161165 IF (UsePressureBasis) THEN
162166 CALL cmfe_Basis_Initialise(PressureBasis,Err)
163- CALL cmfe_Basis_CreateStart(PressureBasisUserNumber,PressureBasis,Err)
167+ CALL cmfe_Basis_CreateStart(PressureBasisUserNumber,context, PressureBasis,Err)
164168 SELECT CASE (PressureInterpolationType)
165169 CASE (1 ,2 ,3 ,4 )
166170 CALL cmfe_Basis_TypeSet(PressureBasis,CMFE_BASIS_LAGRANGE_HERMITE_TP_TYPE,Err)
@@ -306,7 +310,7 @@ PROGRAM SIMPLESHEAREXAMPLE
306310
307311 ! Define the problem
308312 CALL cmfe_Problem_Initialise(Problem,Err)
309- CALL cmfe_Problem_CreateStart(ProblemUserNumber,[CMFE_PROBLEM_ELASTICITY_CLASS,CMFE_PROBLEM_FINITE_ELASTICITY_TYPE, &
313+ CALL cmfe_Problem_CreateStart(ProblemUserNumber,context, [CMFE_PROBLEM_ELASTICITY_CLASS,CMFE_PROBLEM_FINITE_ELASTICITY_TYPE, &
310314 & CMFE_PROBLEM_NO_SUBTYPE],Problem,Err)
311315 CALL cmfe_Problem_CreateFinish(Problem,Err)
312316
@@ -409,11 +413,11 @@ PROGRAM SIMPLESHEAREXAMPLE
409413 CALL cmfe_Fields_ElementsExport(Fields," ./results/SimpleShear" ," FORTRAN" ,Err)
410414 CALL cmfe_Fields_Finalise(Fields,Err)
411415
412- CALL cmfe_Finalise(Err)
416+ CALL cmfe_Finalise(context, Err)
413417
414418 WRITE (* ,' (A)' ) " Program successfully completed."
415419
416420 STOP
417421
418- END PROGRAM SIMPLESHEAREXAMPLE
422+ END PROGRAM SimpleShearExample
419423
0 commit comments