Welcome to MDOODZ7.0 public repository!
In addition to Continuous Integration (CI), MDOODZ7.0 also includes a series of more expensives tests. The results can be compared to reference ones. Check out:
Check out Julia visualisation based on Makie.
There are two ways to build and run MDOODZ7.0:
- The first possibility is to use the CMake project tools. This is recommended for most users. This allows to: (1) automatically download necessary libraries (HDF5 and SuiteSparse), (2) build MDOODZ7.0 and (3) run MDOODZ7.0.
- The second possibility is to use the standard make project as for previous versions of MDOODZ. It is still available and recommended for users who want to manually install necesary libraries HDF5 and SuiteSparse) and control the type/versions of compilers.
Project is ready to be built in CMake
In order to build MDOODZ with CMake you have to install cmake 3.16 or newer version.
blas, zlib and lapack libraries are CMake compatible and does not require any additional setup other than installing them with your package manager:
If you want to use your fixed environmental variables, set them up in a env.cmake file. Just copy env.cmake.example
without example suffix.
sudo apt-get install libblas-dev liblapack-dev zlib1g-dev libhdf5-serial-devThere are two ways how to use SuiteSparse:
- Build SuiteSparse to the project:
make install-suitesparse- Specify path to the build SuiteSparse on your machine in the
env.cmakefile:
set(SuiteSparse_DIR /usr/lib/x86_64-linux-gnu/)
If there is a SuiteSparse in a deps folder, it will be automatically linked with the MDOODZ.
Otherwise it will try to find library and headers in a specified path.
You can specify C Compiler in the env.cmake file. By default, it's gcc:
set(C_COMPILER gcc)
- In a
SETSdirectory you need to create executableYourSetName.cfile and theYourSetName.txtsetup file. Both files should have a same name. - In
SETS/CMakeLists.txtfile add a line with the commandadd_set(YourSetName)and it will be built as executable by default. - Alternatively you could build your set with specifying it as a command line argument. Examples are given below
CMake gives us a framework for building MDOODZ in developer mode or as a separate package and CTest can be used as test suite.
Makefile related to cmake is located in a root directory
To build library, tests and executables with OpenMP and in optimised mode:
make build SET=RiftingCheninAn alternative .txt input file located in the SETS/ folder can be used if specified as TXT. If not stated, the default .txt input file will be taken.
make build SET=RiftingChenin TXT=RiftingChenin_alternative.txtTo explicitly set OPT (optimisation) and OMP (OpenMP). If not stated, it's OFF by default
make build-dev OMP=ON OPT=ON SET=RiftingCheninBuild files will be located at the cmake-build/ directory.
Executables will be stored in a cmake-exec/YourSetName/ directory
After building, you could run MDOODZ with:
make run SET=YourSetNameor run autotests:
make run-testsWhole process in cluster mode with optimisation and OpenMP:
make clean build run SET=YourSetNameAll output files generated by the runtime (.gzip.h5, .dat) will be stored in a same directory as the executable.
Setup .txt file will be automatically detected if it has a same name as the executable. But alternatively you can specify it explicitly:
cd cmake-exec/YourSetName
./YourSetName /path/to/setup.txt- Open the Linux terminal
- Install the dependencies:
sudo apt update && sudo apt install -y cmake gcc g++ libhdf5-serial-dev libsuitesparse-dev libopenblas-dev - Set
LIBRARY_PATHandC_INCLUDE_PATH, add these lines to you bash setup file (e.g.,.bashrc,.bash_profile,,zprofile)
example: export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
example: export C_INCLUDE_PATH=/usr/include/suitesparse:/usr/include/hdf5/serial
-
Compile the code using
make:make clean all SET=ViscousInclusion -
This generates an executable file, which you can run, e.g.,:
./ViscousInclusion -
The output files are written in the WSL filesystem, to visualise them with
JuliaVisualisation, run VSCode from Windows file system, use the remote explorer to log into the Linux filesystem. From there, you can open the folderJuliaVisualisation(inside MDOODZ7.0 folder) and run the scripts.
- Install vcpkg https://vcpkg.io/en/index.html
- By running vcpkg you will need to install HDF5 and SuiteSparse libraries by typing in
vcpkg install hdf5:x64-windows-staticandvcpkg install suitesparse:x64-windows-x64-staticin a terminal. - Copy env.cmake.example to the same folder but without .example. Make sure that you have a correct path to vcpkg.cmake in a
CMAKE_TOOLCHAIN_FILEparam
It is possible to build MDOODZ7.0 using the makefile which is located in the MDLIB folder. The make build does not install the necessary libraries, it is thus mandatory to manually install SuiteSparse and HDF5 prior to building MDOODZ7.0 with make. These libraries are also available via package managers (e.g., Homebrew or MacPorts). For a successful build procedure, links to compiler, library and header files should be added to the current the environement (e.g. add to PATH, LIBRARY_PATH, C_INCLUDE_PATH...). The excutable file will be located directly in the MDLIB folder and the related YourSetName.txt fille will be automatically copied there.
This type of build is (so far) only supported on Linux and Mac OS.
make clean all SET=YourSetNameWill clean and make a fresh build without any specific optmisation.
make all SET=YourSetNameWill update the build (compiles only modified files) without any specific optmisation.
make clean all SET=YourSetName OPT=yes OMP=yesWill clean and make a fresh build with optmisation level 3 and including OpenMP parallelism.
make all SET=YourSetName OPT=yes OMP=yesWill update the build (compiles only modified files) with optmisation level 3 and including OpenMP parallelism.
MDOODZ Source Code stored in MDLIB directory and compiled as a separate library libmdoodz
with the public interface mdoodz.h.
The public interface includes a struct that stores input parameters and setup toolchains: MdoodzInput.
To run the simulation MdoodzInput must be passed to RunMDOODZ(MdoodzInput *input) function
- Setting models with pure or simple or shear boundary conditions: ShearTemplate
- Viscous relaxation of a free surface: TopoBenchCase1
- A continental rifting and thermal solution model: RiftingChenin
- Grain size evolution model and necking in calcite: PinchSwellGSE
- Quartz-Coesite inclusion density change in Garnet: QuartzCoesite
inputFileNamestores the name of the.txtfile with input parameter key = value pairsmodelaggregates general input parameters from.txtfilematerialsaggregates input parameters from.txtfile concerning phase propertiesscaleaggregates input parameters from.txtfile concerning scaling of unitscrazyConductivitycontains parameters for the crazy conductivity of the asthenosphere for the initialisation step
Import files are the external files that are processed by MDOODZ and contains information
such as phase transition diagrams or particle geometry. Described by import_files_dir and import_file
If you wish to add crazy conductivity of the asthenosphere to the initialisation step
there is a crazyConductivity parameter that points to the struct that aggregates
phasesarray of phases ids that crazy conductivity should be applied tonPhasestotal number of phasesmultiplierrefers to the multiplier of the effective conductivity
If your .txt file shares the same name as executable,
you could extract it with the GetSetupFileName(nargs, args) function on Unix systems
Structures that aggregate pointers to the functions that will be used in a runtime as callback functions. Some of those functions must be implemented, but others if not implemented will give a default result
Aggregates pointers to functions for setting up topography chain properties.
Must have if model.free_surface == 1.
SetSurfaceZCoorddescribes an altitude in relation to the x coordinate. Default value is1.0e3 / input->scaling.L: flat surface will be generatedSetSurfacePhasedescribes a topography chain particle phase id in relation to the x coordinate. Default phase0
Aggregates pointers to functions for setting up particle properties. Must have.
SetHorizontalVelocitydescribes a particle Horizontal Velocity (Vx) in relation to coordinates. Default value is-coordinates.x * input->model.bkg_strain_rateSetVerticalVelocitydescribes a particle Vertical Velocity (Vz) in relation to coordinates. Default value iscoordinates.z * input->model.bkg_strain_rateSetPhasedescribes a particle phase id in relation to coordinates. Default value is0: model will be homogeneousSetTemperaturedescribes a particle temperature in relation to coordinates. Default value is273.15 / input->scaling.T: model is 0°CSetGrainSizedescribes a particle grain size in relation to coordinates. Default value is0.0SetPorositydescribes a particle grain porosity in relation to coordinates. Default value is0.0SetDensitydescribes a particle grain density in relation to coordinates. Default value is set according to the particle phaseSetXComponentdescribes a particle X component value in relation to coordinates. Default value is0.0SetPressuredescribes a particle pressure value in relation to coordinates. Default value is0.0SetNoisedescribes a noise property value in relation to coordinates. Default value is0.0
Aggregates pointers to functions for setting up Boundary Conditions in a mesh grid. Must have.
SetBCVxdescribes the type and value of the Vx point. Must be implemented. Pre-made functions from mdoodz library can be used:SetPureShearBCVx,SetSimpleShearBCVx,SetPureOrSimpleShearBCVx(depends onshear_styleinput parameter)SetBCVzdescribes the type and value of the Vz point. Must be implemented. Pre-made functions from mdoodz library can be used:SetPureShearBCVz,SetSimpleShearBCVz,SetPureOrSimpleShearBCVz(depends onshear_styleinput parameter)SetBCPTypedescribes the type of the Pressure Boundary conditions point. Default one is-1SetBCTdescribes the Temperature Boundary type and value. Must be implemented ifmodel.thermal == 1SetBCTNewdescribes the Temperature Boundary type and value on 1d boundary array. Must be implemented ifmodel.thermal == 1. Will be deprecated
