From 5dfc2a8c4d9ed0876fbe1651a0d64a246d25f617 Mon Sep 17 00:00:00 2001 From: Chris Bradley Date: Tue, 10 Apr 2018 15:22:24 +1200 Subject: [PATCH 1/2] Update for new computation environment routines. --- src/fortran/simple_shear.F90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fortran/simple_shear.F90 b/src/fortran/simple_shear.F90 index d7cdd3d..96a0021 100644 --- a/src/fortran/simple_shear.F90 +++ b/src/fortran/simple_shear.F90 @@ -67,6 +67,7 @@ PROGRAM SIMPLESHEAREXAMPLE !CMISS variables TYPE(cmfe_BasisType) :: Basis, PressureBasis TYPE(cmfe_BoundaryConditionsType) :: BoundaryConditions + TYPE(cmfe_ComputationEnvironmentType) :: computationEnvironment TYPE(cmfe_CoordinateSystemType) :: CoordinateSystem, WorldCoordinateSystem TYPE(cmfe_MeshType) :: Mesh TYPE(cmfe_DecompositionType) :: Decomposition @@ -111,8 +112,9 @@ 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_ComputationEnvironment_NumberOfWorldNodesGet(computationEnvironment,numberOfComputationalNodes,err) + CALL cmfe_ComputationEnvironment_WorldNodeNumberGet(computationEnvironment,computationalNodeNumber,err) NumberGlobalXElements=2 NumberGlobalYElements=2 From 6c20f3704fd81a4c0850857c03159ea87e64be69 Mon Sep 17 00:00:00 2001 From: Chris Bradley Date: Fri, 27 Apr 2018 20:19:47 +1200 Subject: [PATCH 2/2] Fixes for contexts. --- src/fortran/simple_shear.F90 | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/fortran/simple_shear.F90 b/src/fortran/simple_shear.F90 index 96a0021..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 @@ -68,7 +68,8 @@ PROGRAM SIMPLESHEAREXAMPLE TYPE(cmfe_BasisType) :: Basis, PressureBasis TYPE(cmfe_BoundaryConditionsType) :: BoundaryConditions TYPE(cmfe_ComputationEnvironmentType) :: computationEnvironment - TYPE(cmfe_CoordinateSystemType) :: CoordinateSystem, WorldCoordinateSystem + TYPE(cmfe_ContextType) :: context + TYPE(cmfe_CoordinateSystemType) :: CoordinateSystem TYPE(cmfe_MeshType) :: Mesh TYPE(cmfe_DecompositionType) :: Decomposition TYPE(cmfe_EquationsType) :: Equations @@ -102,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) @@ -113,6 +116,7 @@ PROGRAM SIMPLESHEAREXAMPLE !Get the number of computational nodes and this computational node number 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) @@ -123,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 @@ -135,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) @@ -160,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) @@ -306,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) @@ -409,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