Code mécaniques des matériaux

NEPER

NEPER: Neper is a software package for polycrystal generation and meshing. It can deal with 2D and 3D polycrystals with very large numbers of grains.

Reference:

Usage

  • Use module load codes/neper/4.2.0
  • See module configuration :
    [homer@vision build]$ module show codes/neper/4.2.0
    -------------------------------------------------------------------
    /zfs/softs/modulefiles/codes/neper/4.2.0:
    
    module-whatis   {loads NEPER :software package for polycrystal generation and meshing.}
    prereq          compilers/intel/compilers_2020u2
    prereq          lib/gsl/2.7
    setenv          NEPER_ROOT /softs/codes/neper/4.2.0/intel/
    prepend-path    INCLUDE /softs/codes/neper/4.2.0/intel//include
    prepend-path    LD_LIBRARY_PATH /softs/codes/neper/4.2.0/intel//lib64
    prepend-path    CPATH /softs/codes/neper/4.2.0/intel//include
    prepend-path    PATH /softs/codes/neper/4.2.0/intel//bin
    prepend-path    CMAKE_PREFIX_PATH /softs/codes/neper/4.2.0/intel//lib64/cmake/nlopt
    -------------------------------------------------------------------
    
  • Load configuration and get 1st information
    [homer@vision]$ module add compilers/intel/compilers_2020u2 lib/gsl/2.7 
    [homer@vision]$ module add codes/neper/4.2.0
    [homer@vision]$ which neper
    /softs/codes/neper/4.2.0/intel/bin/neper
    [homer@vision codes]$ neper --help
    
    ========================    N   e   p   e   r    =======================
    Info   : A software package for polycrystal generation and meshing.
    Info   : Version 4.2.0
    Info   : Built with: gsl|muparser|opengjk|openmp|nlopt|libscotch (full)
    Info   : Running on 24 threads.
    Info   : <https://neper.info>
    Info   : Copyright (C) 2003-2021, and GNU GPL'd, by Romain Quey.
    ========================================================================
    
  • 1st generation of simple microstructure
    $ neper -T -n 1000
    

MFRONT/TFEL

MFront: a code generation tool dedicated to material knowledge ;
MFront is a code generator which translates a set of closely related domain specific languages into plain C++ on top of the TFEL library. Those languages cover three kinds of material knowledge:

  • material properties (for instance the Young modulus, the thermal conductivity, etc.)
  • mechanical behaviours. Numerical performances of generated mechanical behaviours were given a particular attention. Various benchmarks show that MFront implementations are competitive with native implementations available in the Cast3M, Code-Aster, Abaqus Standard solvers.
  • simple point-wise models, such as material swelling used in fuel performance codes.
  • Compiled with Abaqus and Zebulon interface, and python support (only for 4.0.dev, to used with python/anaconda3 module) ;
  • MFront is also linked with MFrontGenericInterfaceSupport , which aims at providing tools (functions, classes, bindings, etc...) to handle behaviours written using MFront generic interface.

Reference :

Usage :

Available version

[hom@vision]$ module av codes/endo/tfel
------------------------------------------------- /zfs/softs/modulefiles -------------------------------------------------
codes/endo/tfel/3.4.1  codes/endo/tfel/4.0.0  codes/endo/tfel/4.0.dev

1st usage

  • Need to load one of the available module (with gcc compiler version 10) ; See module configuration :
[hom@vision codes]$ module add compilers/gcc/10.2 codes/endo/tfel
[hom@vision codes]$ module show codes/endo/tfel
-------------------------------------------------------------------
/zfs/softs/modulefiles/codes/endo/tfel/4.0.dev:

module-whatis   {loads MFRONT : a code generation tool dedicated to material knowledge}
setenv          TFEL_ROOT /softs/endo/tfel/master
setenv          MFRONT_ROOT /softs/endo/tfel/master
setenv          MFRONT_DIR /softs/endo/tfel/master
setenv          MGIS_DIR /softs/endo/tfel/master/MGIS
setenv          MGIS_ROOT /softs/endo/tfel/master/MGIS
prepend-path    INCLUDE /softs/endo/tfel/master/include
prepend-path    INCLUDE /softs/endo/tfel/master/MGIS/include
prepend-path    LD_LIBRARY_PATH /softs/endo/tfel/master/lib
prepend-path    LD_LIBRARY_PATH /softs/endo/tfel/master/MGIS/lib
prepend-path    CPATH /softs/endo/tfel/master/include
prepend-path    CPATH /softs/endo/tfel/master/MGIS/include
prepend-path    PATH /softs/endo/tfel/master/bin
prepend-path    PYTHONPATH /softs/endo/tfel/master/lib/python3.7/site-packages
prepend-path    CMAKE_PREFIX_PATH /softs/endo/tfel/master/share/tfel-4.0.0-dev/cmake
prepend-path    CMAKE_PREFIX_PATH /softs/endo/tfel/master/MGIS/share/mgis/cmake

Abaqus interface

Mfront file
  • The following mfront Plasticity file shows how a simple plastic behaviour can be implemented : we use IsotropicPlasticMisesFlow DSL (domain specific langage) with a behaviour name called Plasticity
$ cat Plasticity.mfront
@DSL       IsotropicPlasticMisesFlow;
@Behaviour Plasticity;

@Epsilon 1.e-16;

@ElasticMaterialProperties {20000.0, 0.3};
@Parameter s0 =  200.0;
@Parameter H  = 2222.22222222;

@FlowRule{
  f       = seq-H*p-s0;
  df_dseq = 1;
  df_dp   = -H;
}
  • Compile mfront file with abaqus interface :
    $ module add compilers/gcc/10.2 codes/endo/tfel/3.4.1
    

    $ mfront --obuild --interface=abaqus Plasticity.mfront
    

This command create src, include, abaqus directories, more specifically with abaqus/umat.cpp compiled further by abaqus, and src/libABAQUSBEHAVIOUR.so linked further to abaqus.

  • MFront generate abaqus/<BehaviourName>.inp. To use the generated material from abaqus, the user must set the correct name in the abaqus inp file, as given by mfront in abaqus/<BehaviourName>.inp. For this example abaqus/Plasticity.inp. For instance, if we see the abaqus/Plasticity.inp :
$ cat abaqus/Plasticity.inp
** ...
** Example for the 'Tridimensional' modelling hypothesis
** This behaviour requires 1 field variables to be defined:
*Material, name=ABAQUSBEHAVIOUR_PLASTICITY_3D
*Depvar
7,
1, ElasticStrain_11
2, ElasticStrain_22
3, ElasticStrain_33
4, ElasticStrain_12
5, ElasticStrain_13
6, ElasticStrain_23
7, EquivalentPlasticStrain
*User Material, constants=0
Abaqus file
  • Edition of the inp abaqus file used for FEM modelling ; see cub 8C3D8. Be sure to use in inp file (*section and *material keyword), the ABAQUSBEHAVIOUR_<NAME>_3D (or ..._AXIS for axisymmetrical hypothesis and ..._PSTRAIN for plane strain hypothesis) with <NAME> corresponding to the mfront name in uppercase ; for this example, ABAQUSBEHAVIOUR_PLASTICITY_3D
** ... abaqus definition mesh above 
*Solid Section, elset=_EL1, material=ABAQUSBEHAVIOUR_PLASTICITY_3D
1,
** ... abaqus definition mesh below
**
** MATERIALS
**
***Material, name=Material-1
*Material, name=ABAQUSBEHAVIOUR_PLASTICITY_3D
*Depvar
7,
1, ElasticStrain_11
2, ElasticStrain_22
3, ElasticStrain_33
4, ElasticStrain_12
5, ElasticStrain_13
6, ElasticStrain_23
7, EquivalentPlasticStrain
*User Material, constants=0
** ... STEP definition
** ...
** ... 
Abaqus execution
  • The user must create environment file abaqus_v6.env in the work directory (eg where the abaqus inp file is located) with specific compile options :
    compile_cpp = ['g++', '-O2', '-std=c++11','-c', '-fPIC', '-w', '-Wno-deprecated', '-DTYPENAME=typename',
                   '-D_LINUX_SOURCE', '-DABQ_LINUX', '-DABQ_LNX86_64', '-DSMA_GNUC',
                   '-DFOR_TRAIL', '-DHAS_BOOL', '-DASSERT_ENABLED',
                   '-D_BSD_TYPES', '-D_BSD_SOURCE', '-D_GNU_SOURCE',
                   '-D_POSIX_SOURCE', '-D_XOPEN_SOURCE_EXTENDED', '-D_XOPEN_SOURCE',
                   '-DHAVE_OPENGL', '-DHKS_OPEN_GL',  '-DGL_GLEXT_PROTOTYPES',
                   '-DMULTI_THREADING_ENABLED', '-D_REENTRANT',
                   '-DABQ_MPI_SUPPORT', '-DBIT64', '-D_LARGEFILE64_SOURCE', '-D_FILE_OFFSET_BITS=64', '%P',
                   # '-O0', # <-- Optimization level
                   # '-g',  # <-- Debug symbols
                   '-I%I']
    
  • To launch abaqus, every MFront libraries (this newly generated, but also the installed from mfront installed configuration) must be found by the dynamic loader of the operating system. 2 options :
  • the search path for dynamic libraries are specified using the LD_LIBRARY_PATH variable environment. This variable defines a colon-separated set of directories where libraries should be searched for first, before the standard set of directories. The path to library file libABAQUSBEHAVIOUR.so must be set ; for example if the global path is /path/to/mfront/library/interface/plastic/tfel-3.4.1/aba_interface/src
    $ export LD_LIBRARY_PATH=/path/to/mfront/library/interface/plastic/tfel-3.4.1/aba_interface/src:$LD_LIBRARY_PATH
    
  • another way is to add in abaqus_v6.env with usub_lib_dir keyword to define the path to found mfront libraries ; in this case the path to mfront installed libraries must be given (and depend to mfront version)
usub_lib_dir='/path/to/mfront/library/interface/plastic/tfel-3.4.1/aba_interface/src:/softs/endo/tfel/3.4.1/gcc10/lib'
  • After this configuration, the commands used to launch abaqus ; this can be executed from interactive session (with qsub -I ..., or runDesktop.sh), or inside a pbs script : the inp file and abaqus_v6.env is located in the same directory to src, include, abaqus directories generated by MFront
$ module add abaqus/2017
$ module add compilers/intel/compilers_2020u2 # ifort is not used, but mandatory to abaqus configuration
$ abaqus job=cub_8C3D8.inp user=abaqus/umat.cpp
Abaqus Warning: The .inp extension has been removed from the job identifier
Analysis initiated from SIMULIA established products
Abaqus JOB cub_8C3D8
Abaqus 3DEXPERIENCE R2017x
Abaqus License Manager checked out the following licenses:
Abaqus/Standard checked out 5 tokens from Flexnet server 193.55.160.10.
<120 out of 130 licenses remain available>.
Begin Compiling Abaqus/Standard User Subroutines
Wed 22 Jun 2022 04:10:49 PM CEST
End Compiling Abaqus/Standard User Subroutines
Begin Linking Abaqus/Standard User Subroutines
Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.2.254 Build 20200623
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.

GNU ld version 2.27-44.base.el7
End Linking Abaqus/Standard User Subroutines
Wed 22 Jun 2022 04:10:53 PM CEST
Begin Analysis Input File Processor
Wed 22 Jun 2022 04:10:53 PM CEST
Run pre
Wed 22 Jun 2022 04:10:54 PM CEST
End Analysis Input File Processor
Begin Abaqus/Standard Analysis
Wed 22 Jun 2022 04:10:54 PM CEST
Run standard
Wed 22 Jun 2022 04:10:56 PM CEST
End Abaqus/Standard Analysis
Begin MFS->SFS and SIM cleanup
Wed 22 Jun 2022 04:10:57 PM CEST
Run SMASimUtility
Wed 22 Jun 2022 04:10:57 PM CEST
End MFS->SFS and SIM cleanup
Abaqus JOB cub_8C3D8 COMPLETED
Reference

LMGC90

LMGC90 is a free and open source software dedicated to multiple physics simulation
of discrete material and structures.

Référence

https://git-xen.lmgc.univ-montp2.fr/lmgc90/lmgc90_user/-/wikis/home

Usage

2 modules sont disponibles pour utiliser lmgc90 : un module utilisant un container lmgc90/sing_2021, et un second compilé et interfacé avec python/anaconda3 :

$ module av lmgc
-------------------------------------- /zfs/softs/modulefiles --------------------------------------
lmgc90/anac37_2021  lmgc90/sing_2021

Utilisation de lmgc90/sing_2021

  • Exemple en mode interactif
    1. Réservation des ressources : pour l'exemple, on réserve 24 threads pendant 30 minutes
      $ qsub -I -l select=1:ncpus=24:ompthreads=24 -l walltime=00:30:00
      $ cd $PBS_O_WORKDIR
      
    2. Chargement du module :
      $ module add lmgc90/sing_2021
      Loading lmgc90/sing_2021
        Loading requirement: singularity/3.6.4
      
    3. On se place dans le répertoire de travail
      $ lt
      total 8.5K
      drwxr-xr-x 6 hom pprime 10 Jun  9 08:38 lego
      $ cd lego/
      $ ls
      CMakeLists.txt  command.py  DATBOX  DISPLAY  gen_sample.py  lego.msh  OUTBOX  POSTPRO
      
    4. lancement du code utilisant le fichier python command.py : Il faut utiliser la variable $SING_EXEC pour utiliser correctement le code
      $ $SING_EXEC python command.py
      
  • Exemple en mode batch

Le code lmgc90 peut être utilisé directement par le biais d'un script pour lancer le code.

(https://forge.univ-poitiers.fr/projects/vision-git/repository/revisions/master/entry/run_lmgc_sing.pbs)

#!/bin/bash
#PBS -N LMGC90
#PBS -l select=1:ncpus=24:ompthreads=24:mem=24GB
#PBS -l walltime=02:00:00
#PBS -j oe
#PBS -q calcul_small
#PBS -m abe -M homer.simpson@springfield.fr

module purge
module add lmgc90/sing_2021

cd ${PBS_O_WORKDIR}
#affichage dans le fichier de sortie de plusieurs informations
echo "run" 
$SING_EXEC python command.py > lmgc90.log 2>&1
echo "run done !!" 

l'execution du script se fait avec la commande

$ qsub run_lmgc_sing.pbs

Utilisation de lmgc90/anac37_2021

Le code est compilé avec les directives openmp, et utilise le solveur MUMPS pour la résolution des systèmes linéaires ;

Exemple d'utilisation en mode graphique

Le cas d'exemple se trouve dans la distribution de lmgc90 (./examples/RIGID_3D/lego)

$ module add lmgc90/anac37_2021
Loading lmgc90/anac37_2021
  Loading requirement: python/anaconda3 compilers/gcc/10.2
[gueguenm@vision lmgc90_user_2021.rc1]$ ls ./examples/RIGID_3D/lego
CMakeLists.txt  command.py  DATBOX  DISPLAY  gen_sample.py  lego.msh  OUTBOX  POSTPRO
$ cd ./examples/RIGID_3D/lego
  • Génération du modèle : lancement de la commande python gen_sample.py : Il faut utiliser la commande vglrun pour permettre de visualiser le modèle (à faire pour toutes commandes de lmgc90 faisant appel à la visualisation. Une erreur apparaitra sinon.

  • Lancement du code python :python command.py

$ python command.py
INIT TIME STEPPING
READ BEHAVIOURS
1 bulk materials found
--
1 tact law found
--
1 see table found
--
1 models found
--
READ BODIES
0 MAILx found
--
2 RBDY3 found
--
LOAD BEHAVIOURS
...
Utilisation en mode batch

Pour l'utilisation sans interaction (pas de fenêtre interactive crée, que la partie solver du code) : réservation de 24 threads et 24Go pendant 2h sur la file calcul_small

  • fichier runlmgc90.pbs (https://forge.univ-poitiers.fr/projects/vision-git/repository/revisions/master/entry/run_lmgc.pbs)
    #!/bin/bash
    #PBS -N LMGC90
    #PBS -l select=1:ncpus=24:ompthreads=24:mem=24GB
    #PBS -l walltime=02:00:00
    #PBS -j oe
    #PBS -q calcul_small
    #PBS -m abe -M homer.simpson@springfield.fr
    
    module purge
    module add lmgc90/anac37_2021
    
    cd ${PBS_O_WORKDIR}
    #affichage dans le fichier de sortie de plusieurs informations
    echo "run" 
    python command.py > lmgc90.log 2>&1
    echo "run done !!" 
    
  • lancer la commande :
    $ qsub runlmgc90.pbs
    

Abaqus

Code éléments finis pour le calcul de structure. Les versions 2017 et 2019 sont installées.

La licence du code est de type commercial, il faut donc au préalable bénéficier de l'accès au serveur de licence pour effectuer les calculs, et dans ce cadre faire une demande auprès des administrateurs

Script d'exemple

Il faut charger au préalable le module abaqus correspondant aux versions installées : 2017 ou 2019

$ module av abaqus
-------------------------------------- /zfs/softs/modulefiles ---------------------------------------
abaqus/2017  abaqus/2019
  • Attribution de 24 coeurs (soit 1 cpu) et 96 Go sur la machine :
#!/bin/bash
#PBS -N 128VXiteA17
#PBS -l select=1:ncpus=24:mpiprocs=24:mem=96GB
#PBS -l walltime=02:00:00
#PBS -j oe
#PBS -q calcul_small
#PBS -l abq_lic=19
#PBS -m abe -M homer.simpson@springfield.fr

module purge
module add abaqus/2017

cd ${PBS_O_WORKDIR}
#affichage dans le fichier de sortie de plusieurs informations
NCPU=`wc -l < $PBS_NODEFILE`
echo "CPUS via PBS_NODEFILE : $NCPU" 

#Run Abaqus
echo "run" 
abq2017 interactive job=Model-128_OPT.inp cpus=$NCPU > Model-128_OPT.log 2>&1
echo "run done !!" 
  • Si utilisation d'une user subroutine (exemple : UMAT, UEL...) : ajouter le mot clé user= avec le nom du fichier fortran ; il faut charger au préalable le compilateur intel avec module load compilers/intel/compilers_2020u2.
#!/bin/bash
#PBS -N 128VXiteA17
#PBS -l select=1:ncpus=24:mpiprocs=24:mem=96GB
#PBS -l walltime=02:00:00
#PBS -j oe
#PBS -q calcul_small
#PBS -l abq_lic=19
#PBS -m abe -M homer.simpson@springfield.fr

module purge
module add abaqus/2017
module add compilers/intel/compilers_2020u2

cd ${PBS_O_WORKDIR}
#affichage dans le fichier de sortie de plusieurs informations
NCPU=`wc -l < $PBS_NODEFILE`
echo "CPUS via PBS_NODEFILE : $NCPU" 

#Run Abaqus
echo "run" 
abq2017 interactive job=Model-128_OPT.inp user=umat.f cpus=$NCPU > Model-128_OPT.log 2>&1
echo "run done !!" 

Soumission par un script

Il est possible de lancer le code en utilisant un script de soumission si on souhaite avoir plus de possibilités concernant la gestion des paramètres de PBS :
Le script d'exemple permettant de lancer le code : run_abaqus.pbs

Pour lancer la commande :

$ qsub  -q calcul_small run_abaqus.pbs
64120.vision

Zebulon

Code éléments finis pour le calcul de structure. version Z8.6 et version Z9.1 ;

La licence du code est de type commercial, il faut donc au préalable bénéficier de l'accès au serveur de licence pour effectuer les calculs, et dans ce cadre faire une demande auprès des administrateurs

  • Usage : utilisation du module associé
$ module add zebulon/Z8.6
$ module add zebulon/Z9.1

view_lmgc.png (643 KB) Gueguen Mikael, 07/13/2021 03:32 PM