1 / 46

ElmerGUI A new pre-processor for Elmer

Mikko Lyly CSC, Finnish IT Center for Science Elmer User meeting, 29th May 2008, CSC, Espoo. ElmerGUI A new pre-processor for Elmer. Outline. Backgound Workflow Practical example On input file formats Excercise Custom menus. Background. Intended to replace ElmerFront:

nerina
Download Presentation

ElmerGUI A new pre-processor for Elmer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mikko Lyly CSC, Finnish IT Center for Science Elmer User meeting, 29th May 2008, CSC, Espoo ElmerGUIA new pre-processor for Elmer

  2. Outline • Backgound • Workflow • Practical example • On input file formats • Excercise • Custom menus

  3. Background • Intended to replace ElmerFront: • Enhanced mesh generation and mesh manipulation tools • Enhanced visualization routines (based on OpenGL and extensions) • Better compatibility with latest Solver • Programmable/customizable GUI • Less dependencies on external libraries • Portability (Linux, Windows, Mac)‏ • ElmerGUI is not: • A CAD program – complicated 3D-geometries should be modelled by separate tools and imported into ElmerGUI in an appropriate format • A stand-alone-program – it needs ElmerSolver and ElmerPost (the “elmer-suite”) in path to solve the problem and visualize the results

  4. Prequisites • Libraries: • Qt Cross-Platform Application Framework (version 4.2 or higher)‏ • Qwt - Qt Widgets for Technical Applications (version 5 or higher)‏ • Qt4: http://trolltech.com/products/qt/ • Qwt5: http://qwt.sourceforge.net/ • Licence: GPL • Qt4 is pre-installed on most Linux distributions • Binary installation packages available for Windows and Mac

  5. Compilation • Getting the sources: $ svn co https://elmerfem.svn.sourceforge.net/svnroot/elmerfem elmefem • ElmerGUI is located in ”elmerfem/trunk/misc/Mesh3D”: $ cd elmerfem/trunk/misc/Mesh3D $ less LICENCES.txt • Follow the compilation instruction in README.txt: $ qmake –project $ qmake $ make

  6. Mesh generation • Possibility to use the following mesh generators: • Tetgen (libtet compiled as a shared library)‏ • Netgen (libng compiled as a shared library)‏ • ElmerGrid (built-in)‏ • No hard-coded dependencies on external generators • For more information and documentation, see: http://tetgen.berlios.de/ http://www.hpfem.jku.at/netgen/ http://www.csc.fi/elmer

  7. Mesh generation • Tetgen (libtet)‏ • Developed by Hang Si et al. at the Weierstrass Institute for Applied Analysis and Stochastics • Fast and efficient unstructured tetrahedral mesh generator • Licenced under the MIT-licence • Not free, but for private, research, and educational purposes it can be used at no cost and without further arrangements • Due to the commercial restrictions, libtet is not included in the binary distribution packages of Elmer. • The user has to make sure that he has a valid licence, or right to use the genarator otherwise, and download /compile the shared library from source: $ cd elmerfem/trunk/misc/tetgen_patches $ patch < patch_tetgen.h $ g++ -fPIC -c predicates.cxx $ g++ -fPIC -O -DTETLIBRARY -c tetgen.cxx $ g++ -fPIC -c ElmerAPI.cpp $ g++ -shared predicates.o tetgen.o ElmerAPI.o -o libtet.so

  8. Mesh generation • Netgen (libng)‏ • NETGEN was developed mainly by Joachim Schöberl within project grants from the Austrian Science Fund FWF ( Special Research Project "Numerical and Symbolic Scientific Computing", Start Project "hp-FEM) at the Johannes Kepler University Linz. Significant contributions were made by Johannes Gerstmayr (STL geometry) Robert Gaisbauer (OpenCascade interface). • Powerful triangular and tetrahedral mesh generator • Licenced under LGPL – included in the binary distribution packages of Elmer • Instructions for compiling libng from source can be found from $ cd elmerfem/trunk/misc/netgen_patches $ less README

  9. Mesh generation • ElmerGrid • Built-in mesh generator and mesh manipulation tool • Very fast structured 1D/2D/3D-mesh generation • Able to import mesh files in several external formats

  10. Mesh generation • Mesh generator chosen automatically by input-file-format: • STL (stereolitography format) – libtet or libng • SMESH (piecewise linear complex) – libtet • POLY (like SMESH but less restrictions) - libtet • OFF (Geomview's polyhedral file format) - libtet • PLY (polyhedral file format) - libtet • MESH (Medit's surface mesh file format) - libtet • GRD (elmergrid's native input file) - ElmerGrid • FDNET (Fidap's mesh file format) - ElmerGrid • MSH (Gmesh's file format) - ElmerGrid • MPHTXT (Comsol Multiphysic's mesh file format) - ElmerGrid • UNV (Ideas' universal file format) – ElmerGrid • Elmer's native mesh file format

  11. Workflow ElmerGUI + ElmerSolver + ElmerPost ElmerGrid

  12. Workflow • Open your input file (example: samples/grd/angle3d.grd):

  13. Workflow • Optionally configure mesh generator and remesh:

  14. Workflow • The values in the config dialog are inherited from cmd line tools:

  15. Workflow • Remeshing is perfomed in a separate thread:

  16. Workflow • Manipulate boundaries: Select a boundary by double clicking and choose ”divide surface” to split it by ”sharp edges”:

  17. Workflow • Manipulate boundaries: Select boundaries by holding down the CTRL-key while double clicking. Choose ”unify surface” to join:

  18. Workflow • Turn on/off boundary index numbering for verification:

  19. Workflow • Define an equation (PDE-system) to solve:

  20. Workflow • Let us define the ”heat equation” as an example:

  21. Workflow • The equation can later be activated for modification from menu:

  22. Workflow • Similarly, we can next define material properties and parameters:

  23. Workflow • Data is given in the ”General” and ”Heat equation” tabs:

  24. Workflow • Add body force:

  25. Workflow • Add boundary conditions:

  26. Workflow • Generate solver input file (sif):

  27. Workflow • Edit the solver input file (if needed):

  28. Workflow • Save the model:

  29. Workflow • Run solver:

  30. Workflow • Convergence monitor reveals possible problems:

  31. Workflow • Invoke post processor:

  32. Workflow • Visualize the results by Elmerpost:

  33. Workflow • You can alternatively define/edit body properties by holding down the SHIFT-key and by double clicking any surface of the body:

  34. Workflow • Similarly, boundary conditions may be (re)defined by holding down the ALT-key while double clicking a boundary:

  35. Workflow • The SHIFT / ALT –functionality may also be activated from menu:

  36. Workflow • There are some useful functions available from menu: • View -> Surface mesh (toggles the visibility of surface mesh) • View -> Sharp edges (show the ”sharp edges” separating boundaries) • View -> Compass (show coordinates) • View -> Hide/show selected (toggle the visibility of current selection) • View -> Numbering (useful for debugging and verification of the model) • View -> Reset model view (clear view) • Model -> Summary (get an overview of the model) • File -> Save picture as… (save the image in several formats) • Mesh -> Terminate (kills the meshing thread, if blocked) • Run -> Show convergence (toggles the visibility of convergece monitor) • Run -> Kill solver (kills the solver process, if necessary) • Run -> Kill postprocessor (kills ElmerPost, if necessary)

  37. Input file formats • SMESH • Part 1 - node list • First line: <# of points> <dimension (must be 3)> <# of attributes> <# of boundary markers (0 or 1)> • Remaining lines list # of points:<point #> <x> <y> <z>[attributes] [boundary marker]... • Part 2 - facet list • One line: <# of facets> <boundary markers (0 or 1)> • Following lines list # of facets: <# of corners> <corner 1> <corner 2> ... <corner #> [boundary marker]... • Part 3 - hole list • One line: <# of holes> • Following lines list # of holes:<hole #> <x> <y> <z>... • Part 4 - region attributes list • One line: <# of region> • Following lines list # of region attributes:<region #> <x> <y> <z><region number><region attribute>...

  38. Input file formats • Example (”L.smesh”): • 12 3 0 1 • 1 0 0 0 1 • 2 4 0 0 1 • 3 4 2 0 1 • 4 2 2 0 1 • 5 2 6 0 1 • 6 0 6 0 1 • 7 0 0 2 1 • 8 4 0 2 1 • 9 4 2 2 1 • 10 2 2 2 1 • 11 2 6 2 1 • 12 0 6 2 1 • 8 1 • 6 1 2 3 4 5 6 1 • 6 7 8 9 10 11 12 1 • 4 1 2 8 7 1 • 4 2 3 9 8 2 • 4 3 4 10 9 1 • 4 4 5 11 10 1 • 4 5 6 12 11 3 • 4 6 1 7 12 1 • 0 • 0

  39. Input file formats • The previous smesh-file should produce the following output:

  40. Input file formats • Mesh density control by volume constaints (see tetgen’s manuals for more details about command relevant line arguments):

  41. Input file formats • It is possible to control the density locally by ”mtr-files” • Example (”L.mtr”): • 12 1 • 0.25 • 0.25 • 0.25 • 0.025 • 0.25 • 0.25 • 0.25 • 0.25 • 0.25 • 0.025 • 0.25 • 0.25

  42. Input file formats • Activate local mesh density control by introducing argument ”m”:

  43. Input file formats

  44. Input file formats • Examples can be found from • Tetgen’s site at http://tetgen.berlios.de/ • INRIA’s mesh database at http://www-c.inria.fr/gamma/download/disclaimer.php

  45. Customizing the GUI • The menus of ElmerGUI are constructed dynamically when the process is initiated • Menus are described by ”edf-files” (elmer-definition-file) which are written in XML containing problem specific information about dialog styles and dependencies on model data • The files are located in directory ”edf” (with respect to ElmerGUI) • An example of customizing the menus can be found from the course material and from Elmer’s web site

  46. Finally… • ElmerGUI will be evolving in the near future • Tutoirials available from Elmer’s web site • User feedback is more than welcome

More Related