-rm filename -mfmt [8bit|short|long|longlong]; if
-mfmtis not specified the format defaults to the flag
PRECISION_INTpassed on during compilation, which is itself, by default, 8-bit signed integers.
εxxcomponent is saved in the file
εyxcomponent is saved in the file
εyycomponent is saved in the file
IDis the identification string passed in the option
-id ID(an underscore by default). In turn, each file is to be read as a list of floating-point numbers saved in the ``Fortran'' order
(1,1) (2,1) (3,1) ... (Lx,1) (1,2) ... (Lx,Ly) (2D) (1,1,1) (2,1,1) (3,1,1) ... (Lx,1,1) (1,2,1) ... (Lx,Ly,Lz) (3D)where the indexes
i, jcorrespond to the coordinates
Complex values are saved in two separate files corresponding to a real and imaginary part.
Each number is saved in the same machine-dependant
format as specified by the flag
PRECISION during compilation
DOUBLE by default.
DOUBLE floating-point precision, the following pieces of code illustrate
how fields may be imported into various softwares:
!fortran (2D) INTEGER L DOUBLE PRECISION x(L,L) OPEN(UNIT=21,FILE='filename',FORM='UNFORMATTED',ACCESS='STREAM') READ(21) x CLOSE(21) %scilab (2D) fd=mopen('filename','rb'); x=matrix(mget(L**2,'d',fd),[L L]); mclose(fd); %matlab (3D) fd=fopen('filename','rb'); x=reshape(fread(fd,L^3,'double'),[L L L]); fclose(fd);In the examples above, it is assumed that the machine used to run the computation is the same as the one used to import the data and hence have the same endian type, otherwise an endianness conversion may need to be performed.
Alternatively, plain text files may be generated using the
-txt option. This is obviously much less efficient and is meant to be used for tesing purposes on small data sets only.
10%embedded in a matrix of conductivity
1; a macroscopic temperature gradient is applied in the
./morphhom -2d 128 -hs .1 -l 1 0 -E 1 0
10%embedded in a nonlinear (``powerlaw'') matrix of exponent
0.5and conductivity prefactor
1and linear part with conductivity
2; a macroscopic temperature gradient is applied in the
./morphhom -2d 128 -hs .1 -pl 1 .5 2 0 -E 1 0
10%spherical prefectly-rigid inclusions embedded in a matrix with bulk and shear moduli
1; stress loading is applied:
./morphhom -greenstress -3d 128 -hs .1 -l 1 0 -m 1 0 -press
10%spherical voids embedded in a matrix with bulk modulus
1, linear elastic regime with shear modulus
1and nonlinear powerlaw elastic regime with exponent
0.5; simple shear loading is applied:
./morphhom -2d 128 -hs .1 -pl 1 .5 2 0 -m 1 0 -e 0 1 0
10%spherical voids with complex permittivity
iembedded in a matrix with complex permittivity
1; an electrical field of mean
1is applied along the
xdirection; solved with the accelerated scheme;
./morphhom -2d 128 -hs .1 -l 1 0 -p 0 1 -E 1 0 -acc
10%; a macroscopic pressure gradient of
1is applied along the
xdirection; the fluid viscosity is
1and the voxel size is
./morphhom -2d 128 -hs .1 -s 1 -vsi 1 -E 1 0
mpirun -np 2 -h host1,host2 ./morphhom -3d 1024 -l 1 2 -hs .1runs a distributed computation on two nodes, producing the following output files:
1_E1, 2_E1, 1_E2, 2_E2, 1_E3, 2_E3, 1_J1, 2_J1, 1_J2, 2_J2, 1_J3, 2_J3.Files should be concatenated to get the temperature gradient and current fields. For instance, the temperature gradient in the
xcomponent might be recovered with:
cat _E1 > _E1.
gcc/gfortran≥4.2 or Intel's
./configure --enable-openmp [--enable-sse2] [--enable-mpi] [--enable-float|--enable-long-double|--enable-quad-precision]The above followed by
make; sudo make installinstalls FFTW in
/usr/local/include(as of 2012, this is subject top changes by the FFTW developpers).
You are on your own on non-Unix machines; you probably need to adjust various things, e.g. the files
Makefile.mk which were only tested with GNU make.
make [ARG=val [ARG2=val2...]]The build process supports the following flags:
|C and Fortran compilers (default to |
|Enable shared-memory parallelization with openMP multithreading (default: yes).|
|Enable distributed-memory parallelization with MPI (default: no); in that case you may want to adjust the compiler
|Floating-point precision; valid values for |
|Range of integers used to index phases; the default value for |
|Compile statically (default: no); not supported with MPI.|
|Directories where FFTW header files and libraries might be found by the compiler; default values are |
|Name of executable ouput (default: morphhom).|
|Enable debugging info (default: no).|
|Use GNU's |
|Check the code's conformity with the Fortran 2003 standard (default: no).|
THREADSLIBflags defined in the file
Makefile.mkshould be adjusted for building the software with a different compiler. With few minor adjustments, the program compiles with Portland's Fortran and C compilers as well, but the resulting performance on the machine where it was tested was not encouraging.
make checkto verify the correctness of solutions provided for a few basic problems.
This calls the script
checkresults which in turn runs
if you compiled morphhom with MPI enabled, this script will attempt to launch commands on two processors, in the form
mpirun -np 2 OUTPUT [options...].
This setting might be adjusted by modifying the top of the file
-Osoption; however the figures are only marginaly changed without that option. It is also assumed that Morphhom uses 95% of the RAM, to leave to the OS itself a minimal amount of space.
|4 Gb RAM||16 Gb RAM||128 Gb RAM|
|2D conductivity, direct or accelerated scheme||220292||440582||1246152|
|2D conductivity (network), direct or accelerated scheme||309162||618332||1748922|
|2D conductivity, Lagrangian||157522||315052||891112|
|2D mechanics, direct or accelerated scheme||181892||363792||1028972|
|2D mechanics, Lagrangian||129112||258222||730362|
|3D conductivity, direct or accelerated scheme||6883||10923||21843|
|3D conductivity (network), direct or accelerated scheme||9853||15643||31293|
|3D conductivity, Lagrangian||5503||8733||17473|
|3D mechanics, direct or accelerated scheme||5503||8733||17473|
|3D mechanics, Lagrangian||4373||6953||13903|