From 3fa68fe351f7f240f78064b2bcc6399c4e105385 Mon Sep 17 00:00:00 2001 From: Chris Bradley Date: Tue, 10 Apr 2018 14:58:53 +1200 Subject: [PATCH 1/2] Update for new computation environment routines. --- src/fortran/diffusion_equation.F90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fortran/diffusion_equation.F90 b/src/fortran/diffusion_equation.F90 index d6e9823..adc951e 100644 --- a/src/fortran/diffusion_equation.F90 +++ b/src/fortran/diffusion_equation.F90 @@ -54,6 +54,7 @@ PROGRAM DIFFUSION_EQUATION !CMISS variables TYPE(cmfe_BasisType) :: Basis + TYPE(cmfe_ComputationEnvironmentType) :: computationEnvironment TYPE(cmfe_CoordinateSystemType) :: CoordinateSystem,WorldCoordinateSystem TYPE(cmfe_DecompositionType) :: Decomposition TYPE(cmfe_EquationsType) :: Equations @@ -99,8 +100,9 @@ PROGRAM DIFFUSION_EQUATION CALL cmfe_ErrorHandlingModeSet(CMFE_ERRORS_TRAP_ERROR,Err) !Get the computational nodes information - 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) NUMBER_GLOBAL_X_ELEMENTS=10 NUMBER_GLOBAL_Y_ELEMENTS=10 From c2180c3b37c58f9c2707af340912f4c0780d91e2 Mon Sep 17 00:00:00 2001 From: Chris Bradley Date: Fri, 27 Apr 2018 20:06:22 +1200 Subject: [PATCH 2/2] Fixes for contexts. --- src/fortran/diffusion_equation.F90 | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/fortran/diffusion_equation.F90 b/src/fortran/diffusion_equation.F90 index adc951e..b465d45 100644 --- a/src/fortran/diffusion_equation.F90 +++ b/src/fortran/diffusion_equation.F90 @@ -1,4 +1,4 @@ -PROGRAM DIFFUSION_EQUATION +PROGRAM DiffusionEquation USE OpenCMISS USE OpenCMISS_Iron @@ -55,7 +55,8 @@ PROGRAM DIFFUSION_EQUATION !CMISS variables TYPE(cmfe_BasisType) :: Basis TYPE(cmfe_ComputationEnvironmentType) :: computationEnvironment - TYPE(cmfe_CoordinateSystemType) :: CoordinateSystem,WorldCoordinateSystem + TYPE(cmfe_ContextType) :: context + TYPE(cmfe_CoordinateSystemType) :: CoordinateSystem TYPE(cmfe_DecompositionType) :: Decomposition TYPE(cmfe_EquationsType) :: Equations TYPE(cmfe_EquationsSetType) :: EquationsSet @@ -95,12 +96,15 @@ PROGRAM DIFFUSION_EQUATION #endif !Intialise OpenCMISS - 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) !Get the computational nodes information 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) @@ -121,7 +125,7 @@ PROGRAM DIFFUSION_EQUATION !Start the creation of a new RC coordinate system CALL cmfe_CoordinateSystem_Initialise(CoordinateSystem,Err) - CALL cmfe_CoordinateSystem_CreateStart(CoordinateSystemUserNumber,CoordinateSystem,Err) + CALL cmfe_CoordinateSystem_CreateStart(CoordinateSystemUserNumber,context,CoordinateSystem,Err) IF(NUMBER_GLOBAL_Z_ELEMENTS==0) THEN !Set the coordinate system to be 2D CALL cmfe_CoordinateSystem_DimensionSet(CoordinateSystem,2,Err) @@ -151,7 +155,7 @@ PROGRAM DIFFUSION_EQUATION !Start the creation of a basis (default is trilinear lagrange) CALL cmfe_Basis_Initialise(Basis,Err) - CALL cmfe_Basis_CreateStart(BasisUserNumber,Basis,Err) + CALL cmfe_Basis_CreateStart(BasisUserNumber,context,Basis,Err) IF(NUMBER_GLOBAL_Z_ELEMENTS==0) THEN !Set the basis to be a bilinear Lagrange basis !CALL cmfe_Basis_TypeSet(Basis,CMFE_BASIS_LAGRANGE_HERMITE_TP_TYPE,Err) @@ -265,7 +269,8 @@ PROGRAM DIFFUSION_EQUATION !Create the equations set analytic field variables CALL cmfe_Field_Initialise(AnalyticField,Err) IF(NUMBER_GLOBAL_Z_ELEMENTS==0) THEN - CALL cmfe_EquationsSet_AnalyticCreateStart(EquationsSet,CMFE_EQUATIONS_SET_DIFFUSION_EQUATION_TWO_DIM_1, & + CALL cmfe_EquationsSet_AnalyticCreateStart(EquationsSet, & + & CMFE_EQUATIONS_SET_DIFFUSION_EQUATION_TWO_DIM_1, & & AnalyticFieldUserNumber, & & AnalyticField,Err) ELSE @@ -337,8 +342,8 @@ PROGRAM DIFFUSION_EQUATION !Create the problem CALL cmfe_Problem_Initialise(Problem,Err) - CALL cmfe_Problem_CreateStart(ProblemUserNumber,[CMFE_PROBLEM_CLASSICAL_FIELD_CLASS,CMFE_PROBLEM_DIFFUSION_EQUATION_TYPE, & - & CMFE_PROBLEM_NO_SOURCE_DIFFUSION_SUBTYPE],Problem,Err) + CALL cmfe_Problem_CreateStart(ProblemUserNumber,context,[CMFE_PROBLEM_CLASSICAL_FIELD_CLASS, & + & CMFE_PROBLEM_DIFFUSION_EQUATION_TYPE,CMFE_PROBLEM_NO_SOURCE_DIFFUSION_SUBTYPE],Problem,Err) !Finish the creation of a problem. CALL cmfe_Problem_CreateFinish(Problem,Err) @@ -440,11 +445,10 @@ PROGRAM DIFFUSION_EQUATION ! CALL WRITE_STRING_TWO_VALUE(GENERAL_OUTPUT_TYPE,"User time = ",STOP_USER_TIME(1)-START_USER_TIME(1),", System time = ", & ! & STOP_SYSTEM_TIME(1)-START_SYSTEM_TIME(1),ERR,ERROR,*999) ! - !CALL CMFE_FINALISE(ERR,ERROR,*999) - !CALL cmfe_Finalise(Err) + CALL cmfe_Finalise(context,Err) WRITE(*,'(A)') "Program successfully completed." STOP -END PROGRAM DIFFUSION_EQUATION +END PROGRAM DiffusionEquation