diff --git a/src/fortran/simple_shear.F90 b/src/fortran/simple_shear.F90 index d7cdd3d..ba40ec0 100644 --- a/src/fortran/simple_shear.F90 +++ b/src/fortran/simple_shear.F90 @@ -1,5 +1,5 @@ !> Main program -PROGRAM SIMPLESHEAREXAMPLE +PROGRAM SimpleShearExample USE OpenCMISS USE OpenCMISS_Iron @@ -67,7 +67,9 @@ PROGRAM SIMPLESHEAREXAMPLE !CMISS variables TYPE(cmfe_BasisType) :: Basis, PressureBasis TYPE(cmfe_BoundaryConditionsType) :: BoundaryConditions - TYPE(cmfe_CoordinateSystemType) :: CoordinateSystem, WorldCoordinateSystem + TYPE(cmfe_ComputationEnvironmentType) :: computationEnvironment + TYPE(cmfe_ContextType) :: context + TYPE(cmfe_CoordinateSystemType) :: CoordinateSystem TYPE(cmfe_MeshType) :: Mesh TYPE(cmfe_DecompositionType) :: Decomposition TYPE(cmfe_EquationsType) :: Equations @@ -101,9 +103,11 @@ PROGRAM SIMPLESHEAREXAMPLE #endif !Intialise cmiss - CALL cmfe_Initialise(WorldCoordinateSystem,WorldRegion,Err) - - CALL cmfe_ErrorHandlingModeSet(CMFE_ERRORS_TRAP_ERROR,Err) + CALL cmfe_Context_Initialise(context,err) + CALL cmfe_Initialise(context,err) + CALL cmfe_ErrorHandlingModeSet(CMFE_ERRORS_TRAP_ERROR,err) + CALL cmfe_Region_Initialise(worldRegion,err) + CALL cmfe_Context_WorldRegionGet(context,worldRegion,err) !Set all diganostic levels on for testing !CALL cmfe_DiagnosticsSetOn(CMFE_FROM_DIAG_TYPE,[1,2,3,4,5],"Diagnostics",["PROBLEM_RESIDUAL_EVALUATE"],Err) @@ -111,8 +115,10 @@ PROGRAM SIMPLESHEAREXAMPLE CALL cmfe_OutputSetOn("SimpleShear",Err) !Get the number of computational nodes and this computational node number - CALL cmfe_ComputationalNumberOfNodesGet(NumberOfComputationalNodes,Err) - CALL cmfe_ComputationalNodeNumberGet(ComputationalNodeNumber,Err) + CALL cmfe_ComputationEnvironment_Initialise(computationEnvironment,err) + CALL cmfe_Context_ComputationEnvironmentGet(context,computationEnvironment,err) + CALL cmfe_ComputationEnvironment_NumberOfWorldNodesGet(computationEnvironment,numberOfComputationalNodes,err) + CALL cmfe_ComputationEnvironment_WorldNodeNumberGet(computationEnvironment,computationalNodeNumber,err) NumberGlobalXElements=2 NumberGlobalYElements=2 @@ -121,7 +127,7 @@ PROGRAM SIMPLESHEAREXAMPLE !Create a 3D rectangular cartesian coordinate system CALL cmfe_CoordinateSystem_Initialise(CoordinateSystem,Err) - CALL cmfe_CoordinateSystem_CreateStart(CoordinateSystemUserNumber,CoordinateSystem,Err) + CALL cmfe_CoordinateSystem_CreateStart(CoordinateSystemUserNumber,context,CoordinateSystem,Err) CALL cmfe_CoordinateSystem_CreateFinish(CoordinateSystem,Err) !Create a region and assign the coordinate system to the region @@ -133,7 +139,7 @@ PROGRAM SIMPLESHEAREXAMPLE !Define geometric basis CALL cmfe_Basis_Initialise(Basis,Err) - CALL cmfe_Basis_CreateStart(BasisUserNumber,Basis,Err) + CALL cmfe_Basis_CreateStart(BasisUserNumber,context,Basis,Err) SELECT CASE(InterpolationType) CASE(1,2,3,4) CALL cmfe_Basis_TypeSet(Basis,CMFE_BASIS_LAGRANGE_HERMITE_TP_TYPE,Err) @@ -158,7 +164,7 @@ PROGRAM SIMPLESHEAREXAMPLE !Define pressure basis IF(UsePressureBasis) THEN CALL cmfe_Basis_Initialise(PressureBasis,Err) - CALL cmfe_Basis_CreateStart(PressureBasisUserNumber,PressureBasis,Err) + CALL cmfe_Basis_CreateStart(PressureBasisUserNumber,context,PressureBasis,Err) SELECT CASE(PressureInterpolationType) CASE(1,2,3,4) CALL cmfe_Basis_TypeSet(PressureBasis,CMFE_BASIS_LAGRANGE_HERMITE_TP_TYPE,Err) @@ -304,7 +310,7 @@ PROGRAM SIMPLESHEAREXAMPLE !Define the problem CALL cmfe_Problem_Initialise(Problem,Err) - CALL cmfe_Problem_CreateStart(ProblemUserNumber,[CMFE_PROBLEM_ELASTICITY_CLASS,CMFE_PROBLEM_FINITE_ELASTICITY_TYPE, & + CALL cmfe_Problem_CreateStart(ProblemUserNumber,context,[CMFE_PROBLEM_ELASTICITY_CLASS,CMFE_PROBLEM_FINITE_ELASTICITY_TYPE, & & CMFE_PROBLEM_NO_SUBTYPE],Problem,Err) CALL cmfe_Problem_CreateFinish(Problem,Err) @@ -407,11 +413,11 @@ PROGRAM SIMPLESHEAREXAMPLE CALL cmfe_Fields_ElementsExport(Fields,"./results/SimpleShear","FORTRAN",Err) CALL cmfe_Fields_Finalise(Fields,Err) - CALL cmfe_Finalise(Err) + CALL cmfe_Finalise(context,Err) WRITE(*,'(A)') "Program successfully completed." STOP -END PROGRAM SIMPLESHEAREXAMPLE +END PROGRAM SimpleShearExample