From ce87c3e75f5324ef70a9c71bc0c40813b619700f Mon Sep 17 00:00:00 2001 From: Chris Bradley Date: Tue, 10 Apr 2018 14:30:53 +1200 Subject: [PATCH 1/2] Update for new computation environment routines. --- src/fortran/burgers_generalised.F90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fortran/burgers_generalised.F90 b/src/fortran/burgers_generalised.F90 index a983032..1b702b7 100644 --- a/src/fortran/burgers_generalised.F90 +++ b/src/fortran/burgers_generalised.F90 @@ -44,6 +44,7 @@ PROGRAM burgers_generalised !Program types TYPE(cmfe_BasisType) :: Basis + TYPE(cmfe_ComputationEnvironmentType) :: computationEnvironment TYPE(cmfe_CoordinateSystemType) :: CoordinateSystem,WorldCoordinateSystem TYPE(cmfe_DecompositionType) :: Decomposition TYPE(cmfe_EquationsType) :: Equations @@ -69,8 +70,9 @@ PROGRAM burgers_generalised 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) !----------------------------------------------------------------------------------------------------------- ! PROBLEM CONTROL PANEL From 5022840009eede96b85f3f7f5a729f11697fac5b Mon Sep 17 00:00:00 2001 From: Chris Bradley Date: Fri, 27 Apr 2018 20:02:31 +1200 Subject: [PATCH 2/2] Fixes for contexts. --- src/fortran/burgers_generalised.F90 | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/fortran/burgers_generalised.F90 b/src/fortran/burgers_generalised.F90 index 1b702b7..1bf123a 100644 --- a/src/fortran/burgers_generalised.F90 +++ b/src/fortran/burgers_generalised.F90 @@ -45,7 +45,8 @@ PROGRAM burgers_generalised !Program types 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 @@ -66,11 +67,15 @@ PROGRAM burgers_generalised LOGICAL :: LINEAR_SOLVER_DIRECT_FLAG,EXPORT_FIELD !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) @@ -101,7 +106,7 @@ PROGRAM burgers_generalised !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) !Set the coordinate system to be 1D CALL cmfe_CoordinateSystem_DimensionSet(CoordinateSystem,1,Err) !Finish the creation of the coordinate system @@ -126,7 +131,7 @@ PROGRAM burgers_generalised !Start the creation of a basis 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,1,Err) !Set the basis xi interpolation and number of Gauss points @@ -251,7 +256,7 @@ PROGRAM burgers_generalised !Create the problem CALL cmfe_Problem_Initialise(Problem,Err) - CALL cmfe_Problem_CreateStart(ProblemUserNumber,[CMFE_PROBLEM_FLUID_MECHANICS_CLASS,CMFE_PROBLEM_BURGERS_EQUATION_TYPE, & + CALL cmfe_Problem_CreateStart(ProblemUserNumber,context,[CMFE_PROBLEM_FLUID_MECHANICS_CLASS,CMFE_PROBLEM_BURGERS_EQUATION_TYPE, & & CMFE_PROBLEM_DYNAMIC_BURGERS_SUBTYPE],Problem,Err) !Finish the creation of a problem. CALL cmfe_Problem_CreateFinish(Problem,Err) @@ -370,7 +375,7 @@ PROGRAM burgers_generalised CALL cmfe_Fields_Finalise(Fields,Err) ENDIF - CALL cmfe_Finalise(Err) + CALL cmfe_Finalise(context,Err) WRITE(*,'(A)') "Program successfully completed." END PROGRAM burgers_generalised