Skip to content
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
14 changes: 8 additions & 6 deletions bindings/c/tests/laplace.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ int main()
{
cmfe_BasisType Basis = (cmfe_BasisType)NULL;
cmfe_BoundaryConditionsType BoundaryConditions=(cmfe_BoundaryConditionsType)NULL;
cmfe_ComputationEnvironmentType ComputationEnvironment = (cmfe_ComputationEnvironmentType)NULL;
cmfe_CoordinateSystemType CoordinateSystem=(cmfe_CoordinateSystemType)NULL,WorldCoordinateSystem=(cmfe_CoordinateSystemType)NULL;
cmfe_DecompositionType Decomposition=(cmfe_DecompositionType)NULL;
cmfe_EquationsType Equations=(cmfe_EquationsType)NULL;
Expand All @@ -103,7 +104,7 @@ int main()
cmfe_SolverType Solver=(cmfe_SolverType)NULL;
cmfe_SolverEquationsType SolverEquations=(cmfe_SolverEquationsType)NULL;

int NumberOfComputationalNodes,ComputationalNodeNumber;
int NumberOfComputationNodes,ComputationNodeNumber;
int EquationsSetIndex;
int FirstNodeNumber,LastNodeNumber;
int FirstNodeDomain,LastNodeDomain;
Expand All @@ -127,8 +128,9 @@ int main()
CHECK_ERROR("Initialising OpenCMISS-Iron");
Err = cmfe_ErrorHandlingModeSet(CMFE_ERRORS_TRAP_ERROR);

Err = cmfe_ComputationalNumberOfNodesGet(&NumberOfComputationalNodes);
Err = cmfe_ComputationalNodeNumberGet(&ComputationalNodeNumber);
Err = cmfe_ComputationEnvironment_Initialise(&ComputationEnvironment);
Err = cmfe_ComputationEnvironment_NumberOfWorldNodesGet(ComputationEnvironment,&NumberOfComputationNodes);
Err = cmfe_ComputationEnvironment_WorldNodeNumberGet(ComputationEnvironment,&ComputationNodeNumber);

/* Start the creation of a new RC coordinate system */
Err = cmfe_CoordinateSystem_Initialise(&CoordinateSystem);
Expand Down Expand Up @@ -200,7 +202,7 @@ int main()
Err = cmfe_Decomposition_CreateStart(DECOMPOSITION_USER_NUMBER,Mesh,Decomposition);
/* Set the decomposition to be a general decomposition with the specified number of domains */
Err = cmfe_Decomposition_TypeSet(Decomposition,CMFE_DECOMPOSITION_CALCULATED_TYPE);
Err = cmfe_Decomposition_NumberOfDomainsSet(Decomposition,NumberOfComputationalNodes);
Err = cmfe_Decomposition_NumberOfDomainsSet(Decomposition,NumberOfComputationNodes);
/* Finish the decomposition */
Err = cmfe_Decomposition_CreateFinish(Decomposition);

Expand Down Expand Up @@ -313,12 +315,12 @@ int main()
}
Err = cmfe_Decomposition_NodeDomainGet(Decomposition,FirstNodeNumber,1,&FirstNodeDomain);
Err = cmfe_Decomposition_NodeDomainGet(Decomposition,LastNodeNumber,1,&LastNodeDomain);
if(FirstNodeDomain==ComputationalNodeNumber)
if(FirstNodeDomain==ComputationNodeNumber)
{
Err = cmfe_BoundaryConditions_SetNode(BoundaryConditions,DependentField,CMFE_FIELD_U_VARIABLE_TYPE,1,1,FirstNodeNumber,1, \
CMFE_BOUNDARY_CONDITION_FIXED,0.0);
}
if(LastNodeDomain==ComputationalNodeNumber)
if(LastNodeDomain==ComputationNodeNumber)
{
Err = cmfe_BoundaryConditions_SetNode(BoundaryConditions,DependentField,CMFE_FIELD_U_VARIABLE_TYPE,1,1,LastNodeNumber,1, \
CMFE_BOUNDARY_CONDITION_FIXED,1.0);
Expand Down
3 changes: 2 additions & 1 deletion cmake/Sources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ set(IRON_Fortran_SRC
cmiss_petsc_types.f90
cmiss_petsc.f90
cmiss.f90
computational_environment.f90
computation_routines.f90
computation_access_routines.f90
constants.f90
control_loop_routines.f90
control_loop_access_routines.f90
Expand Down
9 changes: 5 additions & 4 deletions src/Darcy_equations_routines.f90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ MODULE DARCY_EQUATIONS_ROUTINES
USE Constants
USE CONTROL_LOOP_ROUTINES
USE ControlLoopAccessRoutines
USE ComputationEnvironment
USE ComputationRoutines
USE ComputationAccessRoutines
USE COORDINATE_ROUTINES
USE DistributedMatrixVector
USE DOMAIN_MAPPINGS
Expand Down Expand Up @@ -7213,7 +7214,7 @@ SUBROUTINE DARCY_EQUATION_MONITOR_CONVERGENCE(CONTROL_LOOP,SOLVER,err,error,*)

INTEGER(INTG) :: FIELD_VAR_TYPE
INTEGER(INTG) :: dof_number,NUMBER_OF_DOFS,equations_set_idx
INTEGER(INTG) :: COMPUTATIONAL_NODE_NUMBER
INTEGER(INTG) :: COMPUTATION_NODE_NUMBER
INTEGER(INTG) :: FILEUNIT_N, FILEUNIT_N1

ENTERS("DARCY_EQUATION_MONITOR_CONVERGENCE",err,error,*999)
Expand All @@ -7226,8 +7227,8 @@ SUBROUTINE DARCY_EQUATION_MONITOR_CONVERGENCE(CONTROL_LOOP,SOLVER,err,error,*)
NULLIFY(vectorMapping)
NULLIFY(FIELD_VARIABLE)

COMPUTATIONAL_NODE_NUMBER=ComputationalEnvironment_NodeNumberGet(err,error)
WRITE(FILENAME,'("Darcy_",I3.3,".conv")') COMPUTATIONAL_NODE_NUMBER
CALL ComputationEnvironment_WorldNodeNumberGet(computationEnvironment,COMPUTATION_NODE_NUMBER,err,error,*999)
WRITE(FILENAME,'("Darcy_",I3.3,".conv")') COMPUTATION_NODE_NUMBER
FILEPATH = "./output/"//FILENAME
OPEN(UNIT=23, FILE=CHAR(FILEPATH),STATUS='unknown',ACCESS='append')

Expand Down
Loading