Skip to content

Commit 49525fb

Browse files
committed
Merge branch 'develop' of https://github.com/OpenCMISS-Examples/active_contraction into develop
2 parents e3967c9 + c98a1cf commit 49525fb

File tree

2 files changed

+31
-19
lines changed

2 files changed

+31
-19
lines changed

README.rst

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
==================
2-
active_contraction
2+
Active Contraction
33
==================
44

55
Active contraction
66

77
Building the example
88
====================
99

10-
Instructions on how to configure and build with CMake::
10+
This example can be configure and built with CMake using the following commands::
1111

1212
git clone https://github.com/OpenCMISS-Examples/active_contraction.git
13-
mkdir build
13+
mkdir active_contraction-build
14+
cd active_contraction-build
1415
cmake -DOpenCMISSLibs_DIR=/path/to/opencmisslib/install ../active_contraction
1516
make # cmake --build . will also work here and is much more platform agnostic.
1617

1718
Running the example
1819
===================
1920

20-
Explain how the example is run::
21+
To run the example execute the following commands (assumes current directory is the build directory from 'Building the example')::
2122

22-
cd build
23-
./src/fortran/active_contraction.F90
23+
cd src/fortran
24+
./active_contraction
2425

25-
or maybe it is a Python only example::
26-
27-
source /path/to/opencmisslibs/install/virtaul_environments/oclibs_venv_pyXY_release/bin/activate
28-
python src/python/active_contraction.py
29-
30-
where the XY in the path are the Python major and minor versions respectively.
3126

3227
Prerequisites
3328
=============

src/fortran/active_contraction.F90

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ PROGRAM ActiveContractionExample
5757

5858
INTEGER(CMISSIntg) :: EquationsSetIndex
5959
INTEGER(CMISSIntg) :: NumberOfComputationalNodes,NumberOfDomains,ComputationalNodeNumber
60-
INTEGER(CMISSIntg) :: D, E, N, I
60+
INTEGER(CMISSIntg) :: D, E, N, I, num_args, ix
6161

6262
REAL(CMISSRP) :: TMP
6363
REAL(CMISSRP), DIMENSION(1:7) :: COSTA_PARAMS = [ 0.2, 30.0, 12.0, 14.0, 14.0, 10.0, 18.0 ] ! a bff bfs bfn bss bsn bnn
@@ -87,6 +87,8 @@ PROGRAM ActiveContractionExample
8787
TYPE(cmfe_NodesType) :: CMNodes
8888
TYPE(cmfe_ControlLoopType) :: ControlLoop
8989

90+
character(len=256), dimension(:), allocatable :: args
91+
9092
!Generic CMISS variables
9193
INTEGER(CMISSIntg) :: Err
9294

@@ -104,12 +106,27 @@ PROGRAM ActiveContractionExample
104106
CALL cmfe_ComputationEnvironment_WorldNodeNumberGet(computationEnvironment,computationalNodeNumber,Err)
105107

106108

107-
! open(unit = 2, file = "./input/hollowcylq-221.in")
108-
! open(unit = 3, file = "./input/hollowcylq-221.in.gpactiv")
109-
open(unit = 2, file = "./lvq-842.in")
110-
open(unit = 3, file = "./lvq-842.in.gpactiv")
111-
call read_mesh(2, Elements, Nodes, DirichletConditions, Fibers)
112-
call read_activation_times(3, ActivationTimes)
109+
num_args = command_argument_count()
110+
allocate(args(num_args))
111+
112+
DO ix = 1, num_args
113+
CALL get_command_argument(ix,args(ix))
114+
END DO
115+
116+
IF (num_args .gt. 0) THEN
117+
open(unit = 2, file = args(1))
118+
ELSE
119+
! open(unit = 2, file = "./input/hollowcylq-221.in")
120+
open(unit = 2, file = "./lvq-842.in")
121+
ENDIF
122+
IF (num_args .gt. 1) THEN
123+
open(unit = 3, file = args(2))
124+
ELSE
125+
! open(unit = 3, file = "./input/hollowcylq-221.in.gpactiv")
126+
open(unit = 3, file = "./lvq-842.in.gpactiv")
127+
ENDIF
128+
CALL read_mesh(2, Elements, Nodes, DirichletConditions, Fibers)
129+
CALL read_activation_times(3, ActivationTimes)
113130
close(2)
114131
close(3)
115132

0 commit comments

Comments
 (0)