Open chrispbradley opened 7 years ago
Putting in the context will require changes to examples. The possible new API will look like this TYPE(cmfe_ContextType) :: context TYPE(cmfe_CoordinateSystemType) :: coordinateSystem,worldCoordinateSystem TYPE(cmfe_ProblemType) :: problem TYPE(cmfe_RegionType) :: region,worldRegion
CALL cmfe_Context_Initialise(context,err) !CALL cmfe_Initialise(worldCoordinateSystem,worldRegion,err) CALL cmfe_Initialise(context,err) CALL cmfe_CoordinateSystem_Initialise(worldCoordinateSystem,err) CALL cmfe_Context_WorldCoordinateSystemGet(context,worldCoordinateSystem,err)
CALL cmfe_Region_Initialise(worldRegion,err) CALL cmfe_Context_WorldRegionGet(context,worldRegion,err)
CALL cmfe_Region_Initialise(region,Err) CALL cmfe_Region_CreateStart(regionUserNumber,worldRegion,region,err)
CALL cmfe_Basis_Initialise(basis,err) CALL cmfe_Basis_CreateStart(basisUserNumber,context,basis,Err)
CALL cmfe_Problem_Initialise(problem,Err) CALL cmfe_Problem_CreateStart(problemUserNumber,context, & & [CMFE_PROBLEM_CLASSICAL_FIELD_CLASS, & & CMFE_PROBLEM_LAPLACE_EQUATION_TYPE, & & CMFE_PROBLEM_STANDARD_LAPLACE_SUBTYPE],problem,err)
CALL cmfe_Finalise(context,err)
Or maybe things like bases and problems should have root objects as well like region?
Other base level commands will likely also become context commands e.g.
CALL cmfe_Context_ErrorHandlingModeSet(context,CMFE_ERRORS_TRAP_ERROR,err) CALL cmfe_Context_RandomSeedsSet(context,9999,err) CALL cmfe_Context_DiagnosticsSetOn(context,CMFE_IN_DIAG_TYPE,[1,2,3,4,5],"Diagnostics", & & ["DOMAIN_MAPPINGS_LOCAL_FROM_GLOBAL_CALCULATE"],err) CALL cmfe_Context_OutputSetOn(context,filename,err)
We are now starting to get a few top level objects e.g., region, problem, basis etc. It is probably time that we put in a context object which holds all these. The context would be returned by the cmfe_Initialise call and would need to be given to the cmfe_Finalise call. This would, however, mean that all top level objects would now require the context as an argument which would break all examples. Maybe a good time to do this is at the next uber merge?