Difference between revisions of "GetDP"

From ONELAB
Jump to: navigation, search
(Getting started)
 
(75 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[http://geuz.org/getdp GetDP] is a rather general open source finite element solver using mixed elements to discretize de Rham-type complexes in one, two and three dimensions. GetDP is developed by the [http://ace.montefiore.ulg.ac.be ACE] group from the [http://www.montefiore.ulg.ac.be Montefiore Institute] at the [http://www.ulg.ac.be University of Liège], and is released under the GNU GPL.
+
[http://geuz.org/getdp GetDP] is an open source finite element solver using mixed elements to discretize de Rham-type complexes in one, two and three dimensions. GetDP is developed by the [http://ace.montefiore.ulg.ac.be ACE] group from the [http://www.montefiore.ulg.ac.be Montefiore Institute] at the [http://www.ulg.ac.be University of Liège], and is released under the GNU GPL.
  
= Getting started =
+
== Getting started ==
  
 
ONELAB allows to use GetDP as a black-box solver: you don't need to know anything about finite elements or de Rham complexes in order to run your first simulations:
 
ONELAB allows to use GetDP as a black-box solver: you don't need to know anything about finite elements or de Rham complexes in order to run your first simulations:
  
# Download and uncompress the Gmsh/GetDP bundle for [http://onelab.info/files/gmsh-getdp-Windows64.zip Windows64], [http://onelab.info/files/gmsh-getdp-Windows32.zip Windows32], [http://onelab.info/files/gmsh-getdp-Linux64.zip Linux64], [http://onelab.info/files/gmsh-getdp-Linux32.zip Linux32] or [http://onelab.info/files/gmsh-getdp-MacOSX.zip MacOSX]. (If you prefer you can of course also download and install [http://geuz.org/gmsh/#Download Gmsh] and [http://geuz.org/getdp/#Download GetDP] independently.)
+
<ol>
# Double-click on the Gmsh executable ('''gmsh.exe''' [[File:GmshIcon.png|GmshIcon.png]] on Windows).
+
  <li>Download the ONELAB bundle:
# Load one of the GetDP models ('''.pro''' file) through the '''File/Open''' menu, e.g. '''magnet.pro''' for the {{GetDPFile|Magnetostatics/magnet.zip}} example.
+
  <ul>
# Click on '''Run'''.
+
    <li>Desktop version for [http://onelab.info/files/onelab-Windows64.zip Windows] ([http://onelab.info/files/onelab-Windows32.zip 32 bit]), [http://onelab.info/files/onelab-Linux64.zip Linux] ([http://onelab.info/files/onelab-Linux32.zip 32 bit]) and [http://onelab.info/files/onelab-MacOSX.dmg MacOS]
# ... that's it!
+
    <li>Mobile version for [https://play.google.com/store/apps/details?id=org.geuz.onelab Android] and [https://itunes.apple.com/us/app/onelab/id845930897 iOS]
 +
    <li>[http://onelab.info/files/onelab-source.zip Source code]
 +
  </ul>
 +
  <li>Launch the app <img src="http://geuz.org/gmsh/gallery/icon.png" height=20px>
 +
  <li>Open a GetDP model:
 +
  <ul>
 +
    <li>Desktop version: go to the '''File/Open''' menu and select a GetDP '''.pro''' file, e.g. '''models/magnetometer/magnetometer.pro'''
 +
    <li>Mobile version: select one of the preloaded models
 +
  </ul>
 +
  <li>Press '''Run'''.
 +
</ol>
  
<gallery widths=320px heights=180px perrow=2>
+
<!-- Note that on Windows, depending on your computer security settings, you might have to explicitly allow the GetDP executable to be launched by Gmsh. Manually launch GetDP once by double-clicking on '''getdp.exe''' to allow this. -->
Image:GmshGetDP_1.png|Launch Gmsh and load the GetDP model '''magnet.pro''' with the '''File/Open''' menu.
 
Image:GmshGetDP_2.png|Click on '''Run''' to launch a computation. You can change any parameter and then '''Run''' again!
 
</gallery>
 
  
= Featured GetDP models =
+
== GetDP models ==
  
* [[Inductor|Simple inductor/core system]]
+
=== Basic templates ===
* [[Electric_Machines|Rotating electric machines]]
 
* [[Electromechanical_Relay|Electromechanical relay]]
 
* [[Magnetodynamics with cohomology conditions]]
 
* Multiple scattering with [[Multiple scattering with Sommerfeld absorbing condition|Sommerfeld ABC]] and with [[Multiple scattering with a Perfectly Matched Layer (PML)|Perfectly Matched Layer (PML)]]
 
* Time reversal in [[Time reversal in the free space|free space]]
 
  
= All GetDP models =
+
These are basic physical templates, that can either be used interactively to define new problems from scratch, or be included in other problem definition files.
  
[[:Category:GetDP]]
+
{| class="wikitable"
 +
|
 +
* [[Electrostatics template|Electrostatics]]
 +
* [[Magnetostatics template|Magnetostatics]]
 +
|}
  
= How does it work? =
+
=== Featured physical models ===
  
ONELAB numeric parameters can be defined directly in the input files through the '''DefineConstant''' syntax:
+
These are complete, parametric application examples, ready to be solved and modified.
<syntaxhighlight lang="cpp">
 
DefineConstant[ x = 1 ];
 
DefineConstant[ x = {1, Label "My variable"} ];
 
DefineConstant[ x = {1, Label "My variable", Choices {0,1}} ];
 
DefineConstant[ x = {1, Label "My variable", Choices {0,3,5}} ];
 
DefineConstant[ x = {1, Label "My variable", Choices {0="Zero",3="Three", 5="Five"}} ];
 
DefineConstant[ x = {1, Label "My variable", Min 0, Max 50, Step 5} ]
 
DefineConstant[ x = {1, Label "My variable", Min 0, Max 50, Step 5, Path "Variables/input/"} ];
 
</syntaxhighlight>
 
  
When the input file is analyzed, if the parameter has not been previously defined, it takes the value provided in '''DefineConstant''' and is sent to the ONELAB server. If the input file is re-analyzed later, the value will be updated using the value from the server (unless it is labeled '''ReadOnly''': see below). The same syntax can be used to define string parameters:
+
{| class="wikitable"
<syntaxhighlight lang="cpp">
+
! Acoustics
DefineConstant[ s = "a" ];
+
! Electromagnetism
DefineConstant[ s = {"a", Label "My string variable"} ];
+
! Heat transfer
DefineConstant[ s = {"a", Label "My string variable", Choices {"a", "b", "c"} } ];
+
! Multi-physics
DefineConstant[ x = {"a", Label "My string variable", Kind "File"} ]
+
|-
DefineConstant[ x = {"a", Label "My variable", Path "Variables/Input/"} ];
+
|
</syntaxhighlight>
+
* [[Acoustic scattering|Multiple scattering]]
 +
* [[Time reversal|Time reversal]]
 +
|
 +
* [[Inductor|Simple inductor/core system]]
 +
* [[Magnets|Forces on magnets]]
 +
* [[Electric machines|Rotating electric machines]]
 +
* [[Antennas]]
 +
* [[Waveguides]]
 +
* [[Shielding effectiveness]]
 +
* [[Bloch modes in periodic waveguides]]
 +
* [[Superconducting wire]]
 +
* [[Diffraction grating]]
 +
|
 +
* [[Thermal conduction]]
 +
|
 +
* [[Electromechanical relay]]
 +
* [[Magnetodynamics with cohomology conditions|Induction heating (electro-thermal)]]
 +
* [[Magnetometer|Magnetometer (electromechanical, thermal)]]
 +
* [[Magnetostriction|Magnetostriction (magnetic, mechanical)]]
 +
|}
  
Note that when the code is run without the ONELAB server, the parameters take the default values provided by '''DefineConstant'''.
+
=== Advanced numerical techniques ===
  
== Common parameter attributes ==
+
{| class="wikitable"
 +
|-
 +
|
 +
* [[Domain decomposition methods for waves]]
 +
|}
  
Here's the list of attributes available for all ONELAB parameters:
+
<!--  
;Label string
+
=== Featured tutorials ===
: User-friendly label used in the graphical user interface
+
* [[Numerical schemes: Laplace's equation|Laplace's equation]]
;Path string
+
* [[Numerical schemes: Heat equation|Heat equation]]
: Full path of the parameter in the ONELAB server (represented as a tree in the graphical user interface)
+
* [[Electrostatics]]
;ReadOnly 0|1
+
* [[Numerical_schemes:_Wave_propagation|Wave propagation]]
: If ReadOnly is set, the value cannot be changed server-side, and the value provided in '''DefineConstant''' is always used
+
* [[Laplace equation with Neumann boundary condition]]
;Highlight string
+
* [[Laplace equation with Dirichlet boundary condition]]
: Color used to draw the widget in the graphical interface
+
* [[Heat equation with Dirichlet boundary control]]
;Visible 0|1
+
* [[Coupled problems]]
: Should the parameter be visible in the interface?
+
* Eigenvalues problems
;Closed 0|1
+
-->
: Should the subtree containing this variable be closed?
 
;Help string
 
: Help string for this parameter
 
;AutoCheck 0|1
 
: Allows to disable automatic "check" (rebuild of the interface) when the value is changed
 
;GmshOption string
 
: Treat the parameter as the name of a Gmsh option (e.g. '''Mesh.Algorithm''')
 
  
== Number attributes ==
+
=== All models ===
  
In addition, numbers can take the following specific attributes:
+
[[:Category:GetDP|All GetDP models]]
;Min number
 
: Minimum value allowed when scrolling in the interface, and when looping on the parameter
 
;Max number
 
: Maximum value allowed when scrolling in the interface, and when looping on the parameter
 
;Step number
 
: Step value used when scrolling in the interface, and when looping on the parameter
 
;Range {min, max, step}
 
: Alternate syntax for Min, Max and Step
 
;Choices{number, number, ...}
 
: Possible choices for the parameter
 
;Choices{number=string, number=string, ...}
 
: Possible choices for the parameter, with string labels for each choice
 
;ReadOnlyRange 0|1
 
: Treat the range (or the choices, if they are provided) as read-only
 
;Loop string
 
: Loop over the parameter (the string indicates the loop imbrication level: currently "1", "2" or "3")
 
;Graph string
 
  
== String attributes ==
+
== How does it work? ==
  
String accepts the following specific attributes:
+
GetDP input files ('''.pro''' files) can be instrumented to share parameters with the ONELAB server, [[ONELAB syntax for Gmsh and GetDP|through the same syntax as the one used in Gmsh]].
;Kind string
 
: Mutable kind of the string (currently: "file")
 
;Choices {string, string, ...}
 
: Possible choices for the parameter
 
;MultipleSelection 0|1
 
: Allow multiple selection in choices
 
;Macro string
 
: Treat the parameter as the filename of a macro that will be run when the parameter is clicked in the interface
 
  
 
<!--
 
<!--
= Electromagnetics examples =
+
== Electromagnetics examples ==
  
 
* [[Electrostatics]]
 
* [[Electrostatics]]
Line 122: Line 110:
 
** Waveguide, parabolic reflector, dipole antenna, microstrip antenna, optical fiber, invisibility cloak, plasmonics
 
** Waveguide, parabolic reflector, dipole antenna, microstrip antenna, optical fiber, invisibility cloak, plasmonics
  
= Acoustics examples =
+
== Acoustics examples ==
  
 
* Time-harmonic scattering (Helmholtz equation)
 
* Time-harmonic scattering (Helmholtz equation)
Line 128: Line 116:
 
** Time reversal in the [[Time reversal in the free space|free space]]
 
** Time reversal in the [[Time reversal in the free space|free space]]
  
= Heat transfer examples =
+
== Heat transfer examples ==
  
 
* [[Heat transfer]]
 
* [[Heat transfer]]
  
= Generic PDE examples =
+
== Generic PDE examples ==
  
 
* Elliptic equations
 
* Elliptic equations
Line 142: Line 130:
 
* Hyperbolic equations
 
* Hyperbolic equations
 
** [[Wave equation with Dirichlet boundary control]]
 
** [[Wave equation with Dirichlet boundary control]]
->
+
-->
 +
 
 +
== Building GetDP from the source code ==
 +
 
 +
If you want to recompile GetDP directly from the source code, you should
 +
 
 +
* Download PETSc from http://www.mcs.anl.gov/petsc/petsc-as/download/ and uncompress the archive (in this example, using PETSc 3.7.4):
 +
<source>
 +
tar zxvf petsc-3.7.4.tar.gz
 +
</source>
 +
 
 +
* Configure and build PETSc. The configuration options depend on the calculations you want to perform (complex- or real-valued), as well as your compiler setup. For a sequential build (without MPI), run (remove <code>--with-scalar-type=complex</code> to build in real arithmetic):
 +
<source>
 +
cd petsc-3.7.4
 +
export PETSC_DIR=$PWD
 +
export PETSC_ARCH=complex_mumps_seq
 +
./configure --with-clanguage=cxx --with-debugging=0 --with-mpi=0 --with-mpiuni-fortran-binding=0 --download-mumps=yes --with-mumps-serial --with-shared-libraries=0 --with-x=0 --with-ssl=0 --with-scalar-type=complex
 +
make
 +
cd ..
 +
</source>
 +
 
 +
* Download and unzip the Gmsh and the GetDP source code from the ONELAB bundle  http://onelab.info/files/gmsh-getdp-source.zip (or download the latest source code from http://getdp.info and http://gmsh.info, respectively)
 +
 
 +
* Configure, compile and install a minimal Gmsh library (it will be used by GetDP):
 +
<source>
 +
cd gmsh-xxx
 +
mkdir lib
 +
cd lib
 +
cmake -DDEFAULT=0 -DENABLE_PARSER=1 -DENABLE_POST=1 -DENABLE_BUILD_LIB=1 ..
 +
make lib
 +
sudo make install/fast
 +
cd ../..
 +
</source>
 +
 
 +
* Configure and compile GetDP:
 +
<source>
 +
cd getdp-xxx
 +
mkdir bin
 +
cd bin
 +
cmake ..
 +
make
 +
cd ../..
 +
</source>
 +
 
 +
Instructions for building the parallel (MPI) version of GetDP are available [[GetDDM|here]]

Latest revision as of 19:07, 25 November 2017

GetDP is an open source finite element solver using mixed elements to discretize de Rham-type complexes in one, two and three dimensions. GetDP is developed by the ACE group from the Montefiore Institute at the University of Liège, and is released under the GNU GPL.

Getting started

ONELAB allows to use GetDP as a black-box solver: you don't need to know anything about finite elements or de Rham complexes in order to run your first simulations:

  1. Download the ONELAB bundle:
  2. Launch the app
  3. Open a GetDP model:
    • Desktop version: go to the File/Open menu and select a GetDP .pro file, e.g. models/magnetometer/magnetometer.pro
    • Mobile version: select one of the preloaded models
  4. Press Run.


GetDP models

Basic templates

These are basic physical templates, that can either be used interactively to define new problems from scratch, or be included in other problem definition files.

Featured physical models

These are complete, parametric application examples, ready to be solved and modified.

Acoustics Electromagnetism Heat transfer Multi-physics

Advanced numerical techniques


All models

All GetDP models

How does it work?

GetDP input files (.pro files) can be instrumented to share parameters with the ONELAB server, through the same syntax as the one used in Gmsh.


Building GetDP from the source code

If you want to recompile GetDP directly from the source code, you should

tar zxvf petsc-3.7.4.tar.gz
  • Configure and build PETSc. The configuration options depend on the calculations you want to perform (complex- or real-valued), as well as your compiler setup. For a sequential build (without MPI), run (remove --with-scalar-type=complex to build in real arithmetic):
cd petsc-3.7.4
export PETSC_DIR=$PWD
export PETSC_ARCH=complex_mumps_seq
./configure --with-clanguage=cxx --with-debugging=0 --with-mpi=0 --with-mpiuni-fortran-binding=0 --download-mumps=yes --with-mumps-serial --with-shared-libraries=0 --with-x=0 --with-ssl=0 --with-scalar-type=complex
make
cd ..
  • Configure, compile and install a minimal Gmsh library (it will be used by GetDP):
cd gmsh-xxx
mkdir lib
cd lib
cmake -DDEFAULT=0 -DENABLE_PARSER=1 -DENABLE_POST=1 -DENABLE_BUILD_LIB=1 ..
make lib
sudo make install/fast
cd ../..
  • Configure and compile GetDP:
cd getdp-xxx
mkdir bin
cd bin
cmake ..
make
cd ../..

Instructions for building the parallel (MPI) version of GetDP are available here