From 7e0bb9184354f3cfa2f382a299e8148552bef216 Mon Sep 17 00:00:00 2001 From: Chris Bradley Date: Tue, 10 Apr 2018 15:14:29 +1200 Subject: [PATCH 1/2] Update for new computation environment routines. --- src/fortran/membrane_extension_2d_space.F90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fortran/membrane_extension_2d_space.F90 b/src/fortran/membrane_extension_2d_space.F90 index 9aa0036..6d279f8 100644 --- a/src/fortran/membrane_extension_2d_space.F90 +++ b/src/fortran/membrane_extension_2d_space.F90 @@ -69,6 +69,7 @@ PROGRAM MEMBRANEEXTENSION2DSPACE TYPE(cmfe_BasisType) :: Basis TYPE(cmfe_BoundaryConditionsType) :: BoundaryConditions + TYPE(cmfe_ComputationEnvironmentType) :: computationEnvironment TYPE(cmfe_CoordinateSystemType) :: CoordinateSystem, WorldCoordinateSystem TYPE(cmfe_MeshType) :: Mesh TYPE(cmfe_DecompositionType) :: Decomposition @@ -116,8 +117,9 @@ PROGRAM MEMBRANEEXTENSION2DSPACE CALL cmfe_DiagnosticsSetOn(CMFE_FROM_DIAG_TYPE,[1,2,3,4,5],"Diagnostics",["PROBLEM_FINITE_ELEMENT_CALCULATE"],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) !Create a CS - default is 3D rectangular cartesian CS with 0,0,0 as origin CALL cmfe_CoordinateSystem_Initialise(CoordinateSystem,Err) From 2f90954d71182cc3b74457e55c3682b37df77244 Mon Sep 17 00:00:00 2001 From: Chris Bradley Date: Fri, 27 Apr 2018 20:14:55 +1200 Subject: [PATCH 2/2] Fixes for contexts. --- src/fortran/membrane_extension_2d_space.F90 | 24 ++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/fortran/membrane_extension_2d_space.F90 b/src/fortran/membrane_extension_2d_space.F90 index 6d279f8..ca1c9b2 100644 --- a/src/fortran/membrane_extension_2d_space.F90 +++ b/src/fortran/membrane_extension_2d_space.F90 @@ -1,5 +1,5 @@ !> Main program -PROGRAM MEMBRANEEXTENSION2DSPACE +PROGRAM MembraneExtension2DSpace USE OpenCMISS USE OpenCMISS_Iron @@ -70,7 +70,8 @@ PROGRAM MEMBRANEEXTENSION2DSPACE TYPE(cmfe_BasisType) :: Basis 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 @@ -107,9 +108,11 @@ PROGRAM MEMBRANEEXTENSION2DSPACE #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) WRITE(*,'(A)') "Program starting." @@ -118,12 +121,13 @@ PROGRAM MEMBRANEEXTENSION2DSPACE !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) !Create a CS - default is 3D rectangular cartesian CS with 0,0,0 as origin CALL cmfe_CoordinateSystem_Initialise(CoordinateSystem,Err) - CALL cmfe_CoordinateSystem_CreateStart(CoordinateSystemUserNumber,CoordinateSystem,Err) + CALL cmfe_CoordinateSystem_CreateStart(CoordinateSystemUserNumber,context,CoordinateSystem,Err) CALL cmfe_CoordinateSystem_TypeSet(CoordinateSystem,CMFE_COORDINATE_RECTANGULAR_CARTESIAN_TYPE,Err) CALL cmfe_CoordinateSystem_DimensionSet(CoordinateSystem,NumberOfSpatialCoordinates,Err) CALL cmfe_CoordinateSystem_OriginSet(CoordinateSystem,[0.0_CMISSRP,0.0_CMISSRP,0.0_CMISSRP],Err) @@ -137,7 +141,7 @@ PROGRAM MEMBRANEEXTENSION2DSPACE !Define basis function - tri-linear Lagrange CALL cmfe_Basis_Initialise(Basis,Err) - CALL cmfe_Basis_CreateStart(BasisUserNumber,Basis,Err) + CALL cmfe_Basis_CreateStart(BasisUserNumber,context,Basis,Err) CALL cmfe_Basis_TypeSet(Basis,CMFE_BASIS_LAGRANGE_HERMITE_TP_TYPE,Err) CALL cmfe_Basis_NumberOfXiSet(Basis,NumberOfXiCoordinates,Err) CALL cmfe_Basis_InterpolationXiSet(Basis,[CMFE_BASIS_LINEAR_LAGRANGE_INTERPOLATION, & @@ -278,7 +282,7 @@ PROGRAM MEMBRANEEXTENSION2DSPACE !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) @@ -339,11 +343,11 @@ PROGRAM MEMBRANEEXTENSION2DSPACE CALL cmfe_Fields_ElementsExport(Fields,"./results/MembraneExtension2DSpace","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 MEMBRANEEXTENSION2DSPACE +END PROGRAM MembraneExtension2DSpace