Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contexts #5

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 76 additions & 76 deletions src/fortran/expected_results/output/STATIC_SOLUTION.part0.exnode
Original file line number Diff line number Diff line change
Expand Up @@ -19,174 +19,174 @@
0.0000000000000000E+00
0.0000000000000000E+00
0.0000000000000000E+00
1.0901513302419586E+01
1.0148614788529272E-11
1.0378060669630887E-11
3.1353923793432077E-13
1.0901513302416737E+01
9.5430192824053428E+00
1.7514034659511040E+00
2.5289492722180285E-13
1.2345678806304932E+00
1.0000000000000000E+00
Node: 2
3.3333333333333331E-01
0.0000000000000000E+00
0.0000000000000000E+00
1.0000000000000000E+00
2.7592262631199432E+01
8.3333333342046068E-02
2.7777777779855961E-02
-5.0110560845827408E-12
2.7592262631202082E+01
1.8880888454946290E+00
9.0000000000001563E+00
1.9917054117080113E-13
1.2345678806304932E+00
1.0000000000000000E+00
Node: 3
6.6666666666666663E-01
0.0000000000000000E+00
0.0000000000000000E+00
1.0000000000000000E+00
2.7592262631195471E+01
8.3333333342046068E-02
2.7777777779855961E-02
-5.0110560845827408E-12
2.7592262631200526E+01
-1.8880888455008913E+00
8.9999999999986358E+00
-3.5345337767722640E-13
1.2345678806304932E+00
1.0000000000000000E+00
Node: 4
1.0000000000000000E+00
0.0000000000000000E+00
0.0000000000000000E+00
0.0000000000000000E+00
1.0901513302414328E+01
-1.0116929431700257E-11
-3.6364521728898529E-12
-3.1882013073915667E-13
1.0901513302415355E+01
-9.5430192823971627E+00
1.7514034659483149E+00
-2.5110469259459478E-13
1.2345678806304932E+00
1.0000000000000000E+00
Node: 5
0.0000000000000000E+00
1.0000000000000000E+00
0.0000000000000000E+00
0.0000000000000000E+00
2.4126556016596762E+01
8.3333333331930520E-02
2.7777777718643423E-02
-1.9412142555298874E-12
2.4126556016589223E+01
1.8729842974550085E+01
-3.8965096411983837E+00
1.5850792900451438E-12
1.2345678806304932E+00
1.0000000000000000E+00
Node: 6
3.3333333333333331E-01
1.0000000000000000E+00
-1.1414153992951605E-11
1.0000000000069182E+00
1.9402123505003484E+01
-5.8333333328872428E-01
-5.0000000020055702E-01
-2.7777777769272018E-02
-3.0412978783330374E-12
1.0000000000000198E+00
1.9402123504998819E+01
-2.1956991780314183E-11
-1.5487056082008621E-12
1.6008756820173886E-12
1.2345678806304932E+00
1.0000000000000000E+00
Node: 7
6.6666666666666663E-01
1.0000000000000000E+00
-1.1350783279293575E-11
9.9999999999337319E-01
1.9402123504995604E+01
-5.8333333328872417E-01
-5.0000000020055702E-01
-2.7777777769272021E-02
-2.7148255567957135E-12
1.0000000000008951E+00
1.9402123504990389E+01
-2.1951995776703370E-11
1.2517209491136327E-12
-1.4861722963388502E-12
1.2345678806304932E+00
1.0000000000000000E+00
Node: 8
1.0000000000000000E+00
1.0000000000000000E+00
0.0000000000000000E+00
0.0000000000000000E+00
2.4126556016590314E+01
-8.3333333303996615E-02
5.5555555637114007E-02
-4.9501737805862627E-13
2.4126556016580906E+01
-1.8729842974505779E+01
-3.8965096412049798E+00
-1.4286662131102190E-12
1.2345678806304932E+00
1.0000000000000000E+00
Node: 9
0.0000000000000000E+00
2.0000000000000000E+00
0.0000000000000000E+00
0.0000000000000000E+00
4.9713204783765406E+00
8.3333333331930520E-02
2.7777777718643423E-02
-1.9412142555298874E-12
4.9713204784021876E+00
8.2701570255031545E+00
-4.5258725896951191E+00
2.8184954370402693E-12
1.2345678806304932E+00
1.0000000000000000E+00
Node: 10
3.3333333333333331E-01
2.0000000000000000E+00
4.0440480505852691E-11
9.9999999999155953E-01
7.1783011959820309E+00
-5.8333333328872428E-01
-5.0000000020055702E-01
-2.7777777769272018E-02
-6.3646124069719480E-12
9.9999999999852651E-01
7.1783011960009100E+00
-4.1195324929077515E-11
-2.9924882016807430E-12
2.8309229960221671E-12
1.2345678806304932E+00
1.0000000000000000E+00
Node: 11
6.6666666666666663E-01
2.0000000000000000E+00
4.0712304309671806E-11
1.0000000000078662E+00
7.1783011960152123E+00
-5.8333333328872417E-01
-5.0000000020055702E-01
-2.7777777769272021E-02
-6.3356538362573612E-12
9.9999999999984668E-01
7.1783011959868404E+00
-4.0922598643078345E-11
3.1083191576186664E-12
-2.6734170432973769E-12
1.2345678806304932E+00
1.0000000000000000E+00
Node: 12
1.0000000000000000E+00
2.0000000000000000E+00
0.0000000000000000E+00
0.0000000000000000E+00
4.9713204784127427E+00
-8.3333333303996615E-02
5.5555555637114007E-02
-4.9501737805862627E-13
4.9713204783880220E+00
-8.2701570254234777E+00
-4.5258725896983041E+00
-2.8429550380515423E-12
1.2345678806304932E+00
1.0000000000000000E+00
Node: 13
0.0000000000000000E+00
3.0000000000000000E+00
0.0000000000000000E+00
0.0000000000000000E+00
5.6091042226294405E+00
1.0139581415351851E-11
-1.0283004599143842E-11
3.1353923793432062E-13
5.6091042226250201E+00
2.6982548206234149E+00
-2.3290212350519601E+00
1.4041198759251472E-12
1.2345678806304932E+00
1.0000000000000000E+00
Node: 14
3.3333333333333331E-01
3.0000000000000000E+00
-6.3011398419993023E-11
9.9999999999619316E-01
1.5056138638185477E+00
1.6666666667628444E-01
-2.7777777695646513E-02
-4.0598765851701072E-12
-5.6603805912701455E-12
1.0000000000010343E+00
1.5056138638082328E+00
-2.1021295815160101E-11
1.2504441926353138E-12
1.3809127452635295E-12
1.2345678806304932E+00
1.0000000000000000E+00
Node: 15
6.6666666666666663E-01
3.0000000000000000E+00
-6.3647661313185245E-11
1.0000000000038995E+00
1.5056138637845415E+00
1.6666666667628444E-01
-2.7777777695646527E-02
-4.0598765851701072E-12
-6.6621445322223295E-12
9.9999999999908207E-01
1.5056138638016086E+00
-2.0936363753776277E-11
-1.3208600879721644E-12
-1.4585138652378760E-12
1.2345678806304932E+00
1.0000000000000000E+00
Node: 16
1.0000000000000000E+00
3.0000000000000000E+00
0.0000000000000000E+00
0.0000000000000000E+00
5.6091042225962147E+00
-1.0171266772180866E-11
3.5413961024028090E-12
-3.1882013073915647E-13
5.6091042226184067E+00
-2.6982548205813313E+00
-2.3290212350492081E+00
-1.6170988159647237E-12
1.2345678806304932E+00
1.0000000000000000E+00
28 changes: 17 additions & 11 deletions src/fortran/stokes_static.F90
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ PROGRAM stokes_static

TYPE(cmfe_RegionType) :: Region
TYPE(cmfe_RegionType) :: WorldRegion
TYPE(cmfe_ComputationEnvironmentType) :: computationEnvironment
TYPE(cmfe_ContextType) :: context
TYPE(cmfe_CoordinateSystemType) :: CoordinateSystem
TYPE(cmfe_CoordinateSystemType) :: WorldCoordinateSystem
TYPE(cmfe_BasisType) :: BasisGeometry
TYPE(cmfe_BasisType) :: BasisVelocity
TYPE(cmfe_BasisType) :: BasisPressure
Expand Down Expand Up @@ -132,8 +133,11 @@ PROGRAM stokes_static

!INITIALISE 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)

!
!================================================================================================================================
Expand All @@ -142,8 +146,10 @@ PROGRAM stokes_static
!CHECK COMPUTATIONAL NODE

!Get the computational nodes information
CALL cmfe_ComputationalNumberOfNodesGet(NumberOfComputationalNodes,Err)
CALL cmfe_ComputationalNodeNumberGet(ComputationalNodeNumber,Err)
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)

!
!================================================================================================================================
Expand Down Expand Up @@ -212,7 +218,7 @@ PROGRAM stokes_static

!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 dimension
CALL cmfe_CoordinateSystem_DimensionSet(CoordinateSystem,NUMBER_OF_DIMENSIONS,Err)
!Finish the creation of the coordinate system
Expand Down Expand Up @@ -242,7 +248,7 @@ PROGRAM stokes_static
!Start the creation of new bases
MESH_NUMBER_OF_COMPONENTS=1
CALL cmfe_Basis_Initialise(BasisGeometry,Err)
CALL cmfe_Basis_CreateStart(BASIS_NUMBER_SPACE,BasisGeometry,Err)
CALL cmfe_Basis_CreateStart(BASIS_NUMBER_SPACE,context,BasisGeometry,Err)
!Set the basis type (Lagrange/Simplex)
CALL cmfe_Basis_TypeSet(BasisGeometry,BASIS_TYPE,Err)
!Set the basis xi number
Expand All @@ -268,7 +274,7 @@ PROGRAM stokes_static
!Initialise a new velocity basis
CALL cmfe_Basis_Initialise(BasisVelocity,Err)
!Start the creation of a basis
CALL cmfe_Basis_CreateStart(BASIS_NUMBER_VELOCITY,BasisVelocity,Err)
CALL cmfe_Basis_CreateStart(BASIS_NUMBER_VELOCITY,context,BasisVelocity,Err)
!Set the basis type (Lagrange/Simplex)
CALL cmfe_Basis_TypeSet(BasisVelocity,BASIS_TYPE,Err)
!Set the basis xi number
Expand Down Expand Up @@ -297,7 +303,7 @@ PROGRAM stokes_static
!Initialise a new pressure basis
CALL cmfe_Basis_Initialise(BasisPressure,Err)
!Start the creation of a basis
CALL cmfe_Basis_CreateStart(BASIS_NUMBER_PRESSURE,BasisPressure,Err)
CALL cmfe_Basis_CreateStart(BASIS_NUMBER_PRESSURE,context,BasisPressure,Err)
!Set the basis type (Lagrange/Simplex)
CALL cmfe_Basis_TypeSet(BasisPressure,BASIS_TYPE,Err)
!Set the basis xi number
Expand Down Expand Up @@ -484,7 +490,7 @@ PROGRAM stokes_static
!Start the creation of a problem.
CALL cmfe_Problem_Initialise(Problem,Err)
CALL cmfe_ControlLoop_Initialise(ControlLoop,Err)
CALL cmfe_Problem_CreateStart(ProblemUserNumber,[CMFE_PROBLEM_FLUID_MECHANICS_CLASS,CMFE_PROBLEM_STOKES_EQUATION_TYPE, &
CALL cmfe_Problem_CreateStart(ProblemUserNumber,context,[CMFE_PROBLEM_FLUID_MECHANICS_CLASS,CMFE_PROBLEM_STOKES_EQUATION_TYPE, &
& CMFE_PROBLEM_STATIC_STOKES_SUBTYPE],Problem,Err)
!Finish the creation of a problem.
CALL cmfe_Problem_CreateFinish(Problem,Err)
Expand Down Expand Up @@ -620,7 +626,7 @@ PROGRAM stokes_static
ENDIF

!Finialise CMISS
CALL cmfe_Finalise(Err)
CALL cmfe_Finalise(context,Err)
WRITE(*,'(A)') "Program successfully completed."
STOP

Expand Down