Commit a12b9a64 authored by Rémy Mozul's avatar Rémy Mozul

Merge branch 'rev_2017' into 'master'

user 2017.rc1

See merge request !2
parents c1e1eb32 fb967829
......@@ -16,12 +16,30 @@ include(OutOfSourcesBuild)
project(LMGC90_dev Fortran C CXX)
SET(LMGC90_MAJOR_VERSION 2)
SET(LMGC90_MAJOR_VERSION 3)
SET(LMGC90_MINOR_VERSION 0)
SET(LMGC90_PATCH_VERSION 0)
MESSAGE(STATUS "You try to build LMGC90_dev")
# Try to find out if on ubuntu
# (does nothing if lsb_release executable does not exist)
find_program(LSB_RELEASE lsb_release)
execute_process(COMMAND ${LSB_RELEASE} -is
OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
#message(STATUS "lsb_release : ${LSB_RELEASE_ID_SHORT}")
# Get current year to help set version
include(GetCurrentYear)
TODAY(TODAY YEAR)
# Set release candidate number (used in sphinx doc)
set(RC 1)
if( RC )
set(RCWITHDOT ".rc${RC}")
endif( RC )
include(CTest)
......
......@@ -17,345 +17,9 @@ To stay aware, you can subscribe to this mailing list by asking to:
- Dubois Frédéric : frederic.dubois@umontpellier.fr
- Rémy Mozul : remy.mozul@umontpellier.fr
# Organization
# How does it work
*lmgc90_user* directory is organized in several
subdirectories:
To obtain up to date informations on how to download/install/use, please check the
[wiki](https://git-xen.lmgc.univ-montp2.fr/lmgc90/lmgc90_user/wikis/home#how-does-it-work)
* *src* : the sources of LMGC90 software
* *examples* : the user examples working with the sources
* *manuals* : a list of manuals/documentation for the software in pdf format
* *docs* : the html documentation generated from the sources
The software is originally designed for [Linux or MacOS](#linversion)
For Windows user, jump to [Windows Version section](#winversion)
# <a name="linversion"> Linux and MacOS version </a>
# Versionning
People contributing to the project can view up-to-date information
[here](https://git-xen.lmgc.univ-montp2.fr/lmgc90/lmgc90_user/tree/master)
The versionning tool used is git. To have more information the workflow used
and how to use git check [there](https://git-xen.lmgc.univ-montp2.fr/lmgc90/lmgc90_user/wikis/LMGC90_user)
With MacOS and Linux the installation and use of LMGC90 software is through
the use of the terminal. You must know how to open a terminal in a specific
directory and move through your directory tree.
## Update
To update to very last version from a terminal in current directory:
```
$> git pull origin master
```
To get as specific version, for example *2016* :
```
$> git pull origin 2016
```
## Compilation
### Pre-requisites
To compile you need:
* A Fortran compiler (GNU, Intel or PGI)
* Lapack library
* CMake
* Swig
* Python and Numpy
For visualisation:
* Python VTK module
* Paraview
To build the sphinx documentation:
* Latex distribution (with pdflatex utility)
* Sphinx and numpydoc
* Doxygen
* Graphviz
* dvipng
To read some tutorials:
* Jupyter
* iPython
### Ubuntu 12.04/14.04/16.04 Debian 7
To compile:
```
apt-get install cmake gcc g++ gfortran liblapack-dev swig python-dev python-numpy
```
To visualize:
```
apt-get install python-vtk paraview
```
To build the documentation:
```
apt-get install doxygen graphviz python-numpydoc texlive-latex-extra dvipng imagemagick
```
To read tutorials
```
apt-get install python-pip
pip install jupyter
```
### OpenSuse Leap 42.1
To compile:
```
zypper install cmake gcc gcc-c++ gcc-fortran lapack-devel swig python-devel python-numpy-devel
```
To visualize:
```
zypper install python-vtk paraview
```
Due to some problem one must add to the *.bashrc* file a line similar to:
```
export LD_LIBRARY_PATH=/usr/lib64/mpi/gcc/openmpi/lib64
```
To build the documentation:
```
zypper install doxygen graphviz python-numpydoc texlive-dvipng ImageMagick
```
To read tutorials
```
zypper install python-pip
pip install jupyter
```
### CentOS 7
To compile:
```
yum install git cmake gcc gcc-c++ gcc-gfortran lapack-devel swig python-devel numpy
```
To visualize, some extra packages, not provided by the standard package repository, are
needed. Thus an extra repository must be added before installing the dependencies:
```
yum install epel-release
yum install vtk-python paraview
```
To build the documentation:
```
yum install doxygen graphviz tex-preview textlive-latex texlive-dvipng python-sphinx python-numpydoc ImageMagick
```
To read tutorials
```
yum install python-pip
pip install jupyter
```
### Mac OS
On MacOs using macports (beware of the second line, the *+ python27* goes with *vtk*):
```
port install gcc49 python27 py27-numpy swig-python cmake +gui
port install vtk +python27
```
Then you need to set the compiler and python as the default on your system:
```
sudo port select gcc mp-gcc49
sudo port select python python27
```
To build the documentation:
```
doxygen graphviz py27-sphinx py27-numpydoc texlive-latex-extra dvipng ImageMagick
```
To read tutorials:
```
sudo port install py27-jupyter
```
## Building
You have several commands to run. If you are not familiar with the terminal and compilation in general
please read the output of each command carefully. And if an error occurs do not blindly run the next
commands, but try to correct it first.
In the *lmgc90_user* directory run:
```shell
mkdir build
cd build
cmake ..
make
```
Instead of cmake, one can use *ccmake* to change variable values on
the command line, or *cmake-gui* to use graphical interface.
If you are only interested in rigid computations, some external libraries
can be disabled ; before the ```make``` command, run:
```
cmake . -DMATLIB_VERSION=none -DMUMPS_VERSION=none
```
If you want to re-build the documentation run :
```
make docs
```
It will build the sphinx documentation in:
* docs/chipy/
* docs/dev/
* docs/Pre/
Where you should open the ```index.html``` file.
The doxygen documentation of the the core of the software would be in ```src/Docs/html/index.html```.
## Installing
Our policy is to not mess with default system paths. So instead we advise to
use a environment variable to add to python the path to our build directory.
In general adding the following lines to your *.bashrc* (Linux) or *.profile* (MacOS)
file does the trick. Of course you have to replace *mybuildpath* by the path to
your own building directory. Basically it is what returns the command *pwd* when
ran in the same directory you ran the commands *cmake* and *make*.
```shell
if [ -z ${PYTHONPATH} ]; then
export PYTHONPATH=mybuildpath
else
export PYTHONPATH=${PYTHONPATH}:mybuildpath
fi
```
## Getting started
There are several examples in the directory *examples*
sorted by the type of simulation.
A good entry point is the *Tutorials* directory where you
can find some **ipython notebooks** trying to introduce
step by step the use of the software.
### Linux
To read the notebooks, open a terminal there and run:
```shell
jupyter notebook
```
### MacOS
To read the notebooks, open a terminal there and run:
```shell
jupyter-notebook-2.7
```
Python being the interface language to the LMGC90 software,
[this introduction](https://www.python.org/about/gettingstarted/)
is recommended for those unfamiliar with the language or programming
in general.
# <a name=winversion> Windows version </a>
## Prerequisite
The only pre-requisite to use LMGC90 on Windows is the Python distribution used.
A binary build is provided to work with the Anaconda python distribution
which can be downloaded from here:
* [32 bits](https://repo.continuum.io/archive/.winzip/Anaconda2-2.5.0-Windows-x86.zip)
* [64 bits](https://repo.continuum.io/archive/.winzip/Anaconda2-2.5.0-Windows-x86.zip)
Once the file downloaded, unzip it and run the installer.
To generate visualization files the **vtk** python module must be added. To do that
launch the `Anaconda Prompt` software and type:
```shell
conda install vtk
```
To visualize the files the [Paraview](http://www.paraview.org/download) software
is also needed.
## Getting the pre-compiled version
Download the pre-compiled version of LMGC90 for Windows:
* [32 bits](https://mycore.core-cloud.net/public.php?service=files&t=9bb2e3561373c64a4855596873aa98bd)
* [64 bits](https://mycore.core-cloud.net/public.php?service=files&t=9525fc1c270aaddf7e8eae96214f4b49)
Then create a directory *build* in your *lmgc90_user* directory and unzip
the download file there, it should create a `pylmgc90-xxxx-py27` (where `xxxx`
is to replaced by `i686` if you download the 32 bits version or `x86_64` if you
downloaded the 64 bits version).
## Installation
Start `Spyder` then click on the upper line `tools` and `PYTHONPATH manager`.
Then click `Add a path` on lower left corner and select the path to the directory
previously unzipped (that is in this README: *lmgc90_user/build/pylmgc90-xxxx-py27*).
Finally, so that the previous step is taken into account in your current
environment, you have to open a new console by clicking `Console` and then
`Open a new IPython console`.
## Getting started
There are several examples in the directory *examples*
sorted by the type of simulation.
A good entry point is the *Tutorials* directory where you
can find some **ipython notebooks** trying to introduce
step by step the use of the software.
To read the notebook run the `Jupyter Notebook` application
installed with Anaconda.
Python being the interface language to the LMGC90 software,
[this introduction](https://www.python.org/about/gettingstarted/)
is recommended for those unfamiliar with the language or programming
in general.
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 18d4cbd131087e90d4cf97685dfe9ec3
config: fe71abc29a7abe7fa7ffbd3eda79a4e9
tags: 645f666f9bcd5a90fca523b33c5a78b7
......@@ -5,32 +5,37 @@ from pylmgc90.pre import *
dim = 2
# disk creation
radius = 0.1
disk = avatar(dimension=dim)
disk.addNode( node(coor=numpy.array([0.,0.1]),number=1) )
disk.addBulk( rigid2d() )
disk.defineGroups()
disk.addContactors(shape='DISKx',color='BLUEx',byrd=radius)
# foundation creation
floor = avatar(dimension=dim)
floor.addNode( node(coor=numpy.array([0.,-0.05]),number=1) )
floor.addBulk( rigid2d() )
floor.defineGroups()
floor.addContactors(shape='JONCx',color='BLUEx',axe1=1.,axe2=0.05)
# materials, model and groups definition
mat = material(name='TDURx',materialType='RIGID',density=1000.)
mut = material(name='MOUxx',materialType='RIGID',density=100.)
mod = model(name='rigid', physics='MECAx', element='Rxx2D', dimension=dim)
disk.defineModel(model=mod)
disk.defineMaterial(material=mut)
disk.computeRigidProperties()
floor.defineModel(model=mod)
floor.defineMaterial(material=mat)
floor.computeRigidProperties()
radius = 0.1
disk = rigidDisk(r=radius, center=[0.,0.1], model=mod, material= mat, color='BLUEx')
floor= rigidJonc(axe1=1., axe2=0.05, center=[0.,-0.05], model=mod, material=mat, color='BLUEx')
## disk creation
#radius = 0.1
#disk = avatar(dimension=dim)
#disk.addNode( node(coor=numpy.array([0.,0.1]),number=1) )
#disk.addBulk( rigid2d() )
#disk.defineGroups()
#disk.addContactors(shape='DISKx',color='BLUEx',byrd=radius)
#
## foundation creation
#floor = avatar(dimension=dim)
#floor.addNode( node(coor=numpy.array([0.,-0.05]),number=1) )
#floor.addBulk( rigid2d() )
#floor.defineGroups()
#floor.addContactors(shape='JONCx',color='BLUEx',axe1=1.,axe2=0.05)
#
#disk.defineModel(model=mod)
#disk.defineMaterial(material=mut)
#disk.computeRigidProperties()
#floor.defineModel(model=mod)
#floor.defineMaterial(material=mat)
#floor.computeRigidProperties()
# boundary condition
floor.imposeDrivenDof(component=[1,2,3],dofty='vlocy')
......
......@@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Overview: module code &mdash; pylmgc90.pre 2015.2 documentation</title>
<title>Overview: module code &#8212; pylmgc90.pre 2017.rc1 documentation</title>
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
......@@ -14,16 +14,18 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '2015.2',
VERSION: '2017.rc1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pylmgc90.pre 2015.2 documentation" href="../index.html" />
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
......@@ -35,7 +37,7 @@
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pylmgc90.pre 2015.2 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">pylmgc90.pre 2017.rc1 documentation</a> &#187;</li>
</ul>
</div>
......@@ -105,12 +107,12 @@
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pylmgc90.pre 2015.2 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">pylmgc90.pre 2017.rc1 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&copy; Copyright 2015, CNRS.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.4.
&#169; Copyright 2017, CNRS, UM.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.2.
</div>
</body>
</html>
\ No newline at end of file
......@@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pylmgc90.pre.IO.evolution2File &mdash; pylmgc90.pre 2015.2 documentation</title>
<title>pylmgc90.pre.IO.evolution2File &#8212; pylmgc90.pre 2017.rc1 documentation</title>
<link rel="stylesheet" href="../../../../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" />
......@@ -14,17 +14,18 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../../',
VERSION: '2015.2',
VERSION: '2017.rc1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../../_static/doctools.js"></script>
<link rel="top" title="pylmgc90.pre 2015.2 documentation" href="../../../../index.html" />
<link rel="up" title="Module code" href="../../../index.html" />
<link rel="index" title="Index" href="../../../../genindex.html" />
<link rel="search" title="Search" href="../../../../search.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
......@@ -36,8 +37,8 @@
<li class="right" >
<a href="../../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../../index.html">pylmgc90.pre 2015.2 documentation</a> &raquo;</li>
<li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Module code</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../../../../index.html">pylmgc90.pre 2017.rc1 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Module code</a> &#187;</li>
</ul>
</div>
......@@ -49,7 +50,7 @@
<h1>Source code for pylmgc90.pre.IO.evolution2File</h1><div class="highlight"><pre>
<span></span><span class="c1"># module gerant l&#39;ecriture du fichier d&#39;evolution pour l&#39;application des conditions limites</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">from</span> <span class="nn">pylmgc90.pre.utilities.error</span> <span class="kn">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">pylmgc90.pre.utilities.error</span> <span class="k">import</span> <span class="o">*</span>
<div class="viewcode-block" id="writeEvolution"><a class="viewcode-back" href="../../../../classes.html#pylmgc90.pre.writeEvolution">[docs]</a><span class="k">def</span> <span class="nf">writeEvolution</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">instants</span><span class="p">,</span> <span class="n">path</span><span class="o">=</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s1">&#39;evolution.dat&#39;</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
......@@ -68,13 +69,13 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># on verifie que la fonction donnee est bien appelable</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">callable</span><span class="p">(</span><span class="n">f</span><span class="p">):</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">callable</span><span class="p">(</span><span class="n">f</span><span class="p">):</span>
<span class="n">showError</span><span class="p">(</span><span class="s2">&quot;given function is not callable!&quot;</span><span class="p">)</span>
<span class="c1"># on ouvre le fichier d&#39;evolution en ecriture</span>
<span class="n">fid</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">path</span><span class="p">,</span><span class="n">name</span><span class="p">),</span> <span class="s1">&#39;w&#39;</span><span class="p">)</span>
<span class="k">print</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">Debut Ecriture du fichier </span><span class="se">\t</span><span class="s1">:</span><span class="se">\t</span><span class="s1">&#39;</span> <span class="o">+</span> <span class="n">name</span>
<span class="nb">print</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">Debut Ecriture du fichier </span><span class="se">\t</span><span class="s1">:</span><span class="se">\t</span><span class="s1">&#39;</span> <span class="o">+</span> <span class="n">name</span>
<span class="c1"># on ecrit le couple t, f(t) pour chaque instant t</span>
<span class="k">for</span> <span class="n">t</span> <span class="ow">in</span> <span class="n">instants</span><span class="p">:</span>
......@@ -83,7 +84,7 @@
<span class="c1"># on ferme le fichier</span>
<span class="n">fid</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
<span class="k">print</span> <span class="s1">&#39;Fin Ecriture du fichier </span><span class="se">\t</span><span class="s1">:</span><span class="se">\t</span><span class="s1">&#39;</span> <span class="o">+</span> <span class="n">name</span></div>
<span class="nb">print</span> <span class="s1">&#39;Fin Ecriture du fichier </span><span class="se">\t</span><span class="s1">:</span><span class="se">\t</span><span class="s1">&#39;</span> <span class="o">+</span> <span class="n">name</span></div>
</pre></div>
</div>
......@@ -114,13 +115,13 @@
<li class="right" >
<a href="../../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../../index.html">pylmgc90.pre 2015.2 documentation</a> &raquo;</li>
<li class="nav-item nav-item-1"><a href="../../../index.html" >Module code</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../../../../index.html">pylmgc90.pre 2017.rc1 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../../index.html" >Module code</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&copy; Copyright 2015, CNRS.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.4.
&#169; Copyright 2017, CNRS, UM.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.2.
</div>
</body>
</html>
\ No newline at end of file