KratosMultiphysics / Kratos

Kratos Multiphysics (A.K.A Kratos) is a framework for building parallel multi-disciplinary simulation software. Modularity, extensibility and HPC are the main objectives. Kratos has BSD license and is written in C++ with extensive Python interface.
https://kratosmultiphysics.github.io/Kratos/
Other
1.01k stars 244 forks source link

About configure.sh and the output-file #1994

Closed fengzekang closed 6 years ago

fengzekang commented 6 years ago

I am a beginner of Kratos. I just want to add the -DCONTACT_STRUCTURAL_MECHANICS_APPLICATION=ON \ But there are errors when I configure. What should I do for this. And also I want to use the "Paraview" to visualize the output-file.What should I change in the .py file to get it.

loumalouomega commented 6 years ago

The -DCONTACT_STRUCTURAL_MECHANICS_APPLICATION=ON should work. Can you post the output? For Paraview you need to use the HDF5Application, @msandre can guide you

loumalouomega commented 6 years ago

What are you trying to simulate?, only frictionless contact works right now in the contact mechanics

fengzekang commented 6 years ago

Thanks for your reply. @loumalouomega .I have attached the file "configure.sh" in the following.Is there errors in my file? configure.txt As for my simulation, I just want to simulate the tunnel excavation.The complete process conclude the excavation,setting the cables in the surround rock(there will be some questions about the contact between cables and rock). Looking forward to your reply.

fengzekang commented 6 years ago

Hello, @msandre .I want to use the Paraview to visualize the results of Kratos.What should I do to compile the .py file.Could you give me an example?Thanks a lot.

loumalouomega commented 6 years ago

The current contact implementation just works between solids or, between shells/membrane elements (but assuming zero thickness), I don't know if with that you can simulate what you want

loumalouomega commented 6 years ago

You script looks OK, be careful with the spaces, shell scripts are very sensitive

msandre commented 6 years ago

The basic steps you need to visualize are 1) compile the HDF5Application and ensure all tests work 2) save your results by adding one of the python processes to your json parameters 3) generate the xdmf file using create_xdmf_file.py. I don't have an example for you now as it is still under development.

fengzekang commented 6 years ago

Thanks so much for you @loumalouomega .But when I compile "sh configure.sh",there will be something wrong with some errors.If it is convenient, May I look your "configure.sh" file?

loumalouomega commented 6 years ago
#!/bin/sh

# this is an example file...please DO NOT MODIFY if you don't want to do it for everyone
#to use it, copy it to another file and run it

# additional compiler flags could be added customizing the corresponding var, for example
# -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -msse3 ". Note that the "defaults are already correctly coded"
#so we should ass here only machine specific stuff

#an effort is made to autodetect all of the libraries needed HOWEVER:
#METIS_APPLICATION needs the var PARMETIS_ROOT_DIR to be specified by the user (not needed if the app is set to OFF)
#TRILINOS_APPLICATION needs the var PARMETIS_ROOT_DIR to be specified by the user (not needed if the app is set to OFF)
#MKL_SOLVERS_APPLICATION needs the var MKLSOLVER_INCLUDE_DIR and MKLSOLVER_LIB_DIR to be specified by the user (not needed if the app is set to OFF)
#note that the MKLSOLVER_LIB_DIR should include /lib/em64t. This is needed as intel is changing location of mkl at every update of the compiler!!

#the user should also note that the symbol "\" marks that the command continues on the next line. IT SHOULD ONLY BE FOLLOWED
#BY the "ENTER" and NOT by any space!!

clear

#you may want to decomment this the first time you compile
rm CMakeCache.txt
rm *.cmake
rm -rf CMakeFiles\

# export BLA_VENDOR=Intel10_64lp
# export LD_LIBRARY_PATH=/opt/intel/compilers_and_libraries/linux/mkl/lib/intel64_lin/
# -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fno-inline -std=c++11 -fopenmp -Wpedantic -Wno-undefined-var-template -Wno-gnu-zero-variadic-macro-arguments"                                  \

cmake ..                                                                                         \
-DCMAKE_C_COMPILER=/usr/local/bin/clang                                                          \
-DCMAKE_CXX_COMPILER=/usr/local/bin/clang++                                                      \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -msse3 -O3 -g -std=c++11 -fopenmp"                         \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -msse3 -O3 -g"                                                 \
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE                                                         \
-DCKE_INSTALL_RPATH="~/src/Kratos/libs"                                                        \
-DCMAKE_BUILD_TYPE=Release                                                                       \
-DUSE_COTIRE=OFF                                                                                 \
-DKRATOS_BUILD_TESTING=ON                                                                        \
-DSOLID_MECHANICS_APPLICATION=OFF                                                                \
-DCONSTITUTIVE_MODELS_APPLICATION=OFF                                                             \
-DFLUID_DYNAMICS_APPLICATION=ON                                                                  \
-DCONVECTION_DIFFUSION_APPLICATION=OFF                                                           \
-DDEM_APPLICATION=OFF                                                                            \
-DSWIMMING_DEM_APPLICATION=OFF                                                                   \
-DINCOMPRESSIBLE_FLUID_APPLICATION=OFF                                                           \
-DMESHING_APPLICATION=OFF                                                                         \
-DEXTERNAL_SOLVERS_APPLICATION=ON                                                                \
-DPFEM_APPLICATION=OFF                                                                           \
-DSTRUCTURAL_APPLICATION=OFF                                                                     \
-DSTRUCTURAL_MECHANICS_APPLICATION=ON                                                            \
-DCONTACT_STRUCTURAL_MECHANICS_APPLICATION=ON                                                    \
-DALE_APPLICATION=OFF                                                                            \
-DFSI_APPLICATION=OFF                                                                            \
-DMAPPING_APPLICATION=OFF                                                                        \
-DOPENCL_APPLICATION=OFF                                                                         \
-DMIXED_ELEMENT_APPLICATION=OFF                                                                  \
-DMETIS_APPLICATION=OFF                                                                          \
-DPARMETIS_ROOT_DIR="/home/youruser/compiled_libraries/ParMetis-3.1.1"                           \
-DTRILINOS_APPLICATION=OFF                                                                       \
-DUSE_METIS_5=OFF                                                                                \
-DMETIS_LIBRARIES="/usr/lib/x86_64-linux-gnu/"                                                   \
-DMETIS_INCLUDES="/usr/include/"                                                                 \
-DTRILINOS_LIBRARY_DIR="/usr/lib/x86_64-linux-gnu/"                                              \
-DTRILINOS_INCLUDE_DIR="/usr/include/trilinos/"                                                  \
-DTRILINOS_LIBRARY_PREFIX="trilinos_"                                                            \
-DINSTALL_EMBEDDED_PYTHON=ON                                                                     \
-DSHAPE_OPTIMIZATION_APPLICATION=OFF                                                             \
-DTOPOLOGY_OPTIMIZATION_APPLICATION=OFF                                                          \
-DBOOST_ROOT="~/src/boost_1_66_0"                                                                \
-DBOOST_PYTHON_SUFFIX="3"                                                                        \
-DPYTHON_LIBRARY="/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.so"              \
-DPYTHON_INCLUDE_DIR="/usr/include/python3.6"                                                    \
-DEIGEN_SOLVERS_APPLICATION=ON                                                                   \
-DUSE_EIGEN_MKL=ON                                                                               \
-DEIGEN_ROOT="~/src/eigen"                                                                       \
-DINCLUDE_PASTIX=ON                                                                              \
-DPASTIX_INSTALL_DIR="~/src/pastix_5.2.3/install/"                                               \
-DSCOTCH_INSTALL_DIR="~/src/scotch_6.0.4/lib"                                                    \
-DINCLUDE_FEAST=ON                                                                               \
-DINCLUDE_MMG=ON                                                                                 \
-DMMG_INCLUDE_DIR="~/src/mmg/include/mmg/"                                                       \
-DMMG2D_INCLUDE_DIR="~/src/mmg/include/mmg/mmg2d/"                                               \
-DMMG3D_INCLUDE_DIR="~/src/mmg/include/mmg/mmg3d/"                                               \
-DMMGS_INCLUDE_DIR="~/src/mmg/include/mmg/mmgs/"                                                 \
-DMMG_LIBRARY="/usr/local/lib/libmmg.a"                                                          \
-DMMG2D_LIBRARY="/usr/local/lib/libmmg2d.a"                                                      \
-DMMG3D_LIBRARY="/usr/local/lib/libmmg3d.a"                                                      \
-DMMGS_LIBRARY="/usr/local/lib/libmmgs.a"                                                        \

#decomment this to have it verbose
# make VERBOSE=1 -j4
make -j8
make install
# make all_unity install/fast
fengzekang commented 6 years ago

@msandre I have compiled the HDF5Application.But I don't know how to save the results by adding one of the python processes to the json parameters and how to generate the xdmf file using create_xdmf_file.py.What's the meaning of these?

sunethwarna commented 6 years ago

This is a very basic example which I use on how to use HDF5Application to generate output files and visualize them in ParaView. Therefore, full functionality is not present in this example since this is still under development.

HDF5Application_Example.tar.gz

Once you generate the HDF files, then run the following command

python3 $PATH_TO_KRATOS/applications/HDF5Application/python_scripts/create_xdmf_file.py MainModelPart.h5.

This will create an xdmf file. Use paraview to open it. I hope this helps.

RiccardoRossi commented 6 years ago

closing since inactive. reopen as needed