Git Product home page Git Product logo

cdmath's Introduction

logo CDMATH

CDMATH is a CFD toolbox designed for numerical analysts who work on the representation of thermal-hydraulics and who would prefer to focus on high-level computation. The software is maintained and used by CDMATH, a collaborative workgroup with the same name. The software is easiest to install on Ubuntu 14.04 LTS, on Debian Jessie, as well as on Fedora 20, 21 and 22.

Download binary CDMATH from repositories

If you are on Ubuntu 14.04, you can simply add our Ubuntu repository to your system.

Similarly, if you are on Fedora 20, 21 or 22, then you can also simply download an RPM package from our Fedora repository.

Download CDMATH sources to compile

If you are on another system, or if you prefer to compile the latest sources to benefit from our continuous improvement, please follow the instructions hereunder.

Create your source directory. For instance:

  • mkdir ~/workspace/cdmath
  • cd ~/workspace/cdmath

Download from GitHub. For instance:

  • git clone https://github.com/PROJECT-CDMATH/CDMATH.git cdmath_src

Set environment for the compilation of CDMATH

Dependencies. The following packages list is sufficient on Ubuntu 14.04, Ubuntu 14.10 and Debian Jessie:

  • cmake
  • g++ or another C++ compiler
  • libhdf5-dev
  • libopenmpi-dev, in particular if you need to use the compilation option -DMEDFILE_USE_MPI=ON.
  • petsc-dev, if you want to compile a CDMATH-based linear solver. PETSc should mandatorily be at a minor subversion of version 3.4. * , that is to say not more recent. We have chosen the version 3.4 of PETSc (released on 13 May 2013), as it is easily installable from the main distributions repositories. Use the compilation option -DCDMATH_WITH_PETSC=ON.
  • python-dev, python-numpy and swig, if you want to generate Python executables and libraries of CDMATH. Use the compilation option -DCDMATH_WITH_PYTHON=ON.
  • libcppunit-dev, if you want to generate unit tests. Use the compilation option -DCDMATH_WITH_TESTS=ON.
  • doxygen, graphviz and mscgen, if you want to generate a nice documentation in ~/workspace/cdmath/cdmath_install/doc/. Use the compilation option -DCDMATH_WITH_DOCUMENTATION=ON.
  • rpm, if you want to generate RPM installation packages. Use the compilation option -DCDMATH_WITH_PACKAGE=ON.

Directories. Create the suggested build and installation folders:

  • cd ~/workspace/cdmath
  • mkdir cdmath_build
  • mkdir cdmath_install
  • cd cdmath_build

Compile and install CDMATH

Generate makefiles for a minimum version:

  • cmake ../cdmath_src/ -DCMAKE_INSTALL_PREFIX=../cdmath_install -DCMAKE_BUILD_TYPE=Release

Or generate makefiles for an all-options version:

  • cmake ../cdmath_src/ -DCMAKE_INSTALL_PREFIX=../cdmath_install -DCMAKE_BUILD_TYPE=Release -G"Eclipse CDT4 - Unix Makefiles" -D_ECLIPSE_VERSION=4.3 -DMEDFILE_USE_MPI=ON -DCDMATH_WITH_PETSC=ON -DCDMATH_WITH_PYTHON=ON -DCDMATH_WITH_TESTS=ON -DCDMATH_WITH_DOCUMENTATION=ON -DCDMATH_WITH_PACKAGE=ON

Compile and install:

  • make
  • make install

Notes for compilation options:

  • Eclipse: The Cmake options -G"Eclipse CDT4 - Unix Makefiles" -D_ECLIPSE_VERSION=4.3 create project files if you want to develop CDMATH with Eclipse Kepler or higher.
  • HDF5: On some systems (not Ubuntu 14.04), you may have to use the compilation option -DHDF5_ROOT_DIR=/path/to/hdf5/library too.
  • MPI: On some systems (not Ubuntu 14.04), you may have to use the compilation option -DMPI_ROOT_DIR=/path/to/mpi/library too. You may also have to set the environment variable export MPI_ROOT_DIR=/path/to/mpi/library. Moreover, on some systems (not Ubuntu 14.04), the compilation option -DMEDFILE_USE_MPI=ON may be mandatory and be set to ON.
  • PETSc: On some systems (not Ubuntu 14.04), you may have to use the compilation options -DPETSC_DIR=/path/to/petsc/installation/petsc-3.4.5/ -DPETSC_ARCH=arch-linux2-c-opt. Adapt according to your system, as it can also be -DPETSC_DIR=/path/to/petsc/installation/petsc-3.4.5_install/ for instance. You may also have to use export PETSC_DIR=/path/to/compiled/source/petsc-3.4.5/bin/ if you compiled PETSc from the sources as explained on the official documentation.

Use CDMATH

To use CDMATH with your C++ code main.cxx:

  • C++ libraries: export LD_LIBRARY_PATH=~/workspace/cdmath/cdmath_install/lib
  • To know how to include the right libraries for compilation, see the makefiles of the examples. They include the list -linterpkernel -lmedC -lmedloader -lmedcoupling -lbase -lmesh -llinearsolver.

To use CDMATH with your Python code main.py:

  • C++ libraries: export LD_LIBRARY_PATH=~/workspace/cdmath/cdmath_install/lib
  • Python libraries: export PYTHONPATH=~/workspace/cdmath/cdmath_install/lib/cdmath:~/workspace/cdmath/cdmath_install/bin/cdmath

Create Linux installation packages for CDMATH

After popular request, here is how you can create packages for Ubuntu 14.04 and Red Hat-based Linux distributions:

  1. Download CDMATH as explained hereabove.
  2. Set the environment as explained hereabove (in particular, make sure you have rpm installed).
  3. Generate a makefile with cmake -DCMAKE_INSTALL_PREFIX=../cdmath_install -DCMAKE_BUILD_TYPE=Release -DCDMATH_WITH_PACKAGE=ON ../cdmath_src/ and eventually other options (documentation, tests, swig, etc).
  4. Compile with make package.

You will then find a Debian package in the build directory; you may install it on Ubuntu 14.04. You will also find an RPM package, which you may install on Red Hat-based distributions. This way, the packages you generate may include all the compilation options you want.

Unfortunately, the Debian package may be said to be of “bad quality” for Debian standards as far as ownership is concerned. This is true and due to limitations in CMake/CPack. The package should still install nonetheless.

cdmath's People

Contributors

arthurtalpaert avatar admin-cdmath avatar anouarmekkas avatar agmenor avatar abruneton avatar

Stargazers

Vos avatar  avatar CDMATH avatar Frederic Couderc avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  avatar Arthur Talpaert avatar CDMATH avatar

cdmath's Issues

La fonctionnalité d'écriture/relecture de champs MED ne fonctionne pas en 1D

La fonction setMesh renvoie une erreur lorsqu'on exécute un code qui doit relire le fichier MED 1D. On constate dans les exemples que setMesh/readMeshMed ne sont testées qu'en 2D.
On obient l'erreur suivante :
terminate called after throwing an instance of 'INTERP_KERNEL::Exception' what(): CellModel::getOrientationStatus : invalid dimension ! Must be 1 or 2
et gdb donne la pile d'exécutions suivante
6 0x00007ffff73e87f5 in INTERP_KERNEL::CellModel::getOrientationStatus(unsigned int, int const_, int const_) const ()
from /export/home/guest/Logiciels/CDMATH/20122014/install/lib/libinterpkernel.so
7 0x00007ffff76f4b9e in MEDCouplingOrientationSensitiveNbrer(int, unsigned int, INTERP_KERNEL::CellModel const&, bool, int const_, int const_) ()
from /export/home/guest/Logiciels/CDMATH/20122014/install/lib/libmedcoupling.so
8 0x00007ffff774ecf8 in ParaMEDMEM::MEDCouplingUMesh* ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivityGenParaMEDMEM::DataArrayInt_, ParaMEDMEM::DataArrayInt_, ParaMEDMEM::DataArrayInt_, ParaMEDMEM::DataArrayInt_, int ()(int, unsigned int, INTERP_KERNEL::CellModel const&, bool, int const, int const*)) const ()
from /export/home/guest/Logiciels/CDMATH/20122014/install/lib/libmedcoupling.so
9 0x00007ffff719a3ab in Mesh::setMesh() ()
---Type to continue, or q to quit---
from /export/home/guest/Logiciels/CDMATH/20122014/install/lib/libmesh.so
10 0x00007ffff719f12c in Mesh::readMeshMed(std::string) ()
from /export/home/guest/Logiciels/CDMATH/20122014/install/lib/libmesh.so
11 0x00007ffff719f23c in Mesh::Mesh(std::string) ()
from /export/home/guest/Logiciels/CDMATH/20122014/install/lib/libmesh.so
12 0x00007ffff7198e1e in Field::Field(std::string, TypeField, std::string const&, int, int) ()
from /export/home/guest/Logiciels/CDMATH/20122014/install/lib/libmesh.so
13 0x0000000000407e9a in Resolution_Flica4 (tmax=5, ntmax=20000,
nNewtonMax=50, iterGMRESMax=50, cfl=0.25, freqSauv=20, outputfile=
"Schema_Flica4_Implicite1DPetsc", inputfile=
"Regime_permanent_explicite1D_50Cells_U", Centree=0, Tentree=292,
VitEntree=1, Psortie=15500000, g=0, phi=100000000, K=0)
at ../src/Flica4Implicite1DPetscReprise.cpp:536
14 0x0000000000409ee2 in Schema_Flica4 ()
at ../src/Flica4Implicite1DPetscReprise.cpp:692
15 0x0000000000409feb in main ()
at ../src/Flica4Implicite1DPetscReprise.cpp:699

Debugger/retirer linearSolver(SparseMatrix)

MN n'arrive plus à résoudre les systèmes linéaires creux depuis les dernières modifications d'AM
Normale d'une face en 1D retourne 0 et fait planter les calculs, ce qui empêche de factoriser les codes 1D, 2D et 3D.

Compilation with swig fails

When Swig is activated, the compilation fails on some machines, namely a fresh Fedora 18 or a fresh Ubuntu 14.04.
One of the errors is like:
~/workspace/cdmath/cdmath_build/pre_requis/MEDLoader/Swig/MEDLoaderPYTHON_wrap.cxx error: 'import_array' was not declared in this scope

Reciprocal functions of getValuesOn…

Please make reciprocal functions like the following:
setValuesOnAllComponent for getValuesOnAllComponent
setValuesOnComponent for getValuesOnComponent

Problème avec MPI

Je pense qu'il faut rajouter PetscInitialize(0,(char ***)"", PETSC_NULL, PETSC_NULL); à la ligne 37 de LinearSolver.cxx.

Si je ne le fais pas, dès que j'appelle LinearSolver myLinearSolver; dans mon main, j'obtiens quelque chose du type :

PETSC ERROR: Logging has not been enabled
[0]PETSC ERROR: PetscOptionsInsertFile() line 461 in
/home/bkhanal/Documents/softwares/petsc-3.4.2/src/sys/objects/options.c
[0]PETSC ERROR: PetscOptionsInsert() line 623 in
/home/bkhanal/Documents/softwares/petsc-3.4.2/src/sys/objects/options.c
[0]PETSC ERROR: PetscInitialize() line 769 in
/home/bkhanal/Documents/softwares/petsc-3.4.2/src/sys/objects/pinit.c
PETSC ERROR: Logging has not been enabled.
You might have forgotten to call PetscInitialize().
application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0
[cli_0]: aborting job:
application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0

Malheureusement, quand je rajoute la ligne, j'obtiens une erreur cryptique dans l'exécution de mon programme :

A name collision was detected on an MCA variable name. This can happen if two components try to register the same variable with slightly different name components. The conflicting variables are listed below:

MCA variable name: opal_event_include
New name: opal (null) event_include
Existing name: opal event include

[is221716:25269] [[INVALID],INVALID] ORTE_ERROR_LOG: Not found in file ../../../orte/runtime>/orte_init.c at line 125

It looks like orte_init failed for some reason; your parallel process is likely to abort. There are many reasons that a parallel process can fail during orte_init; some of which are due to configuration or environment problems. This failure appears to be an internal failure; here's some additional information (which may only be relevant to an Open MPI developer):

orte_ess_base_select failed
--> Returned value Not found (-13) instead of ORTE_SUCCESS

[is221716:25269] *** Process received signal ***
[is221716:25269] Signal: Segmentation fault (11)
[is221716:25269] Signal code: Invalid permissions (2)
[is221716:25269] Failing at address: 0x7fd46d0cca90
[is221716:25269] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7fd470c10cb0]
[is221716:25269] [ 1] /export/home/talpaert/openmpi/openmpi-1.8.3_install/lib/libopen-pal.so.6(opal_show_help+0x0)[0x7fd46d0cca90]
[is221716:25269] *** End of error message ***
Segmentation fault (core dumped)

Que faire ?

Field.getMesh().getDXYZ() is empty

The following code creates a SEGFAULT at the execution of the 4th line:

Mesh myMesh(xinf, xsup, nx);
Field myField = Field("attached", CELLS, myMesh, 1);
cout << myMesh.getDXYZ()[0] << endl;
cout << myField.getMesh().getDXYZ()[0] << endl;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.