Install ElmerGUI on Ubuntu 14.04

Discussion about building and installing Elmer
Post Reply
DePurpereWolf
Posts: 22
Joined: 13 Mar 2013, 23:46
Antispam: Yes

Install ElmerGUI on Ubuntu 14.04

Post by DePurpereWolf »

Hello,

I've just switched to Ubuntu 14.04
I can install Elmer solver etc. from the repository, however ElmerGUI is not included.
I read somewhere that ElmerGUI is not included because of licencing issues with opencascade code which it uses.

What is the best way to install ElmerGui on my machine? Where can I find instructions on this?
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Install ElmerGUI on Ubuntu 14.04

Post by annier »

Hi,
- Yeah installation of ElmerGUI requires the compatibility within different components.
The installation of ElmerGUI in Ubuntu 12.04 has been discussed in the following website:
http://ascend4.org/Building_Elmer_on_Ubuntu_12.04
Also, the compilation process of ElmerGUI has been discussed in the following Elmer forum:
viewtopic.php?f=2&t=3245&sid=1794b800e9 ... 1a79e7c1a5
I have no idea about the difference in requirements for Ubuntu 14.04 and Ubuntu 12.04.

- i have been using Elmer without GUI and it is quite easier to install as well as to use.

If you plan to use ElmernonGUI, there are basically few steps for simulation although you will not see a television screen look alike GUI.

Steps

1. We need to write all the input information (Header, Body, Solver, Simulation, Equation, Material ,Boundary Conditions) in a text file and make it a SIF (ending with .sif). Let it be named as abcd.sif. ( A sample Solver Input File for learning about the structure of .sif file can be found at different test examples in the downloaded elmer directory => $HOME/elmerfem/fem/tests or in general /path/ to elmer directory/fem/tests .)
Additionally, we need to create an empty text file with the file name ELMERSOLVER_STARTINFO and inside it we write the following thing:

Code: Select all

abcd.sif
1
The ELMERSOLVER_STARTINFO file should be in the same directory with the abcd.sif file.

2. We draw the geometry and mesh in some other preprocessors and convert it into Elmer format with ElmerGrid command in the terminal by jumping into the directory where the geometry/mesh files are located.
If the file exported by the preprocessor in .unv format has the name abcdwxyz.unv, then the following command converts the .unv file into Elmer format:

Code: Select all

$ ElmerGrid 8 2 abcdwxyz.unv -autoclean
3. Then we put the folder with mesh files (in elmer grid format) in the directory where the SIF file is located. If the folder having mesh files (in Elmer Format) is named mymesh, then Header in abcd.sif should be like:

Code: Select all

Header
Mesh DB "." "mymesh"
End
4. In the terminal, we jump into the directory containing abcd.sif and type:

Code: Select all

$ ElmerSolver
or, in case we need to see the solver logfile

Code: Select all

$ ElmerSolver anyname.log > 2>&1
This will run the Elmer Solver.

5. In order to see the result, we can open postprocessor (example : Paraview) and browse the .vtu files located within the mymesh directory.
For this, there should have been written the following command in the simulation section of abcd.sif:

Code: Select all

Simulation
...
Post File = "case.vtu"
...
End

Yours
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
ivnn
Posts: 1
Joined: 23 Jun 2014, 18:16
Antispam: Yes

Re: Install ElmerGUI on Ubuntu 14.04

Post by ivnn »

(updated 23/06 - figured out the ---with-tcltk option)
I have just compiled elmer (release 6809) and elmergui in 14.04. There are some particular issues regarding kubuntu 14.04 (and, of course, ubuntu 14.04 as well).

First, install the dependencies mentioned here:http://ascend4.org/Building_Elmer_on_Ubuntu_12.04
and here: http://tehnick-8.narod.ru/elmer/compilation.html

Install also tetgen (libtet1.5-dev).

I followed this steps mentioned here:http://www.elmerfem.org/elmerwiki/index ... u_12.04%29, but with the script changed a bit:
(differences are inclusion of libX11, front and post, specify tcl/tk8.5 and list of libs exported via LIBS env var)

Code: Select all

#!/bin/sh -f

export CC="mpicc"
export CXX="mpicxx"
export FC="mpif90"
export F77="mpif90"

export ELMER_INSTALL="/home/ivan/elmer/elmer/"


export CFLAGS="-O3 -march=core-avx2  -ftree-vectorize -funroll-loops -ffast-math"
export CXXFLAGS="-O3 -march=core-avx2  -ftree-vectorize -funroll-loops -ffast-math"
export FCFLAGS="-O3  -march=core-avx2  -ftree-vectorize -funroll-loops -ffast-math"
export F90FLAGS="-O3  -march=core-avx2  -ftree-vectorize -funroll-loops -ffast-math"
export F77FLAGS="-O3 -march=core-avx2  -ftree-vectorize -funroll-loops -ffast-math"
export FFLAGS="-O3  -march=core-avx2  -ftree-vectorize -funroll-loops -ffast-math"

export FCPPFLAGS="$FCPPFLAGS -DHAVE_MUMPS"
export LIBS="-ldmumps -lmumps_common -lpord -lscalapack-openmpi -lblacs-openmpi -lmpi_f77 -lmpi -lHYPRE -lX11"
export TCLTK_INCPATH="/usr/include/tcl8.5"

modules="matc umfpack mathlibs meshgen2d eio hutiter fem elmergrid front post"
par1="mathlibs"
par2="fem"

##### configure, build and install #########
for m in $modules; do
  echo "module $m"
  echo "###############"

  cd $m 
  make distclean

  if [ $m = $par1 ] || [ $m = $par2 ]; then
    echo "This module needs special attention due to the parallelisation."
    ##### parallel #######
    ./configure --prefix=$ELMER_INSTALL --with-mpi-dir="/usr/lib/openmpi/" --with-64bits=yes --with-hypre="-lHYPRE"
  else
    ##### no special treatment #######
    ./configure --prefix=$ELMER_INSTALL --with-64bits=yes --with-tcltk="-ltcl8.5 -ltk8.5"

  fi

make install && cd ..

done
change the -march to suit your CPU and the ELMER _INSTALL to where you want it, but before running the script:
The default tck / tk in 14.04 is the 8.6, but compiled with an option that makes it incompatible with elmer. The tcl/tk 8.5, that are also in the repositores, is compatible. So we need to compile and link elmer against the 8.5 version.
So first install the tcl8.5-dev and tk8.5-dev.
After that you should succeed in running the script under 14.04 and build elmer without erros (but with many warnings).

For ElmerGUI, my ElmerGUI.pri is:

Code: Select all


DEFINES += EG_QWT      # Use QWT for convergence monitor?
DEFINES += EG_VTK      # Use VTK for postprocessing?
DEFINES += EG_PARAVIEW # Use ParaView for postprocessing?
DEFINES += EG_MATC     # Use MATC for internal operations in postprocessing?
DEFINES += EG_OCC      # Use OpenCASCADE 6.3 for importing CAD files? Needs VTK.
DEFINES += EG_PYTHONQT # Use PythonQt for scripting in post processor?

#------------------------------------------------------------------------------
# 64 bit system?
#------------------------------------------------------------------------------
BITS = 64

ELMERGUI_HOME = /home/ivan/elmer/elmer/bin

#------------------------------------------------------------------------------
# Python library:
#------------------------------------------------------------------------------
unix {
   PY_INCLUDEPATH = /usr/include/python2.7
   PY_LIBPATH = /usr/lib/x86_64-linux-gnu
   PY_LIBS = -lpython2.7
}

#------------------------------------------------------------------------------
# QWT library:
#------------------------------------------------------------------------------
unix {
  QWT_INCLUDEPATH = /usr/include/qwt
  QWT_LIBPATH = /usr/lib
  QWT_LIBS = -lqwt
}

#------------------------------------------------------------------------------
# VTK library:
#------------------------------------------------------------------------------
unix {
   VTK_INCLUDEPATH = /usr/include/vtk-5.8
   VTK_LIBPATH = /usr/lib
   VTK_LIBS = -lQVTK \
              -lvtkCommon \
              -lvtkDICOMParser \
              -lvtkFiltering \
              -lvtkGenericFiltering \
              -lvtkGraphics \
              -lvtkHybrid \
              -lvtkIO \
              -lvtkImaging \
              -lvtkInfovis \
#              -lvtkNetCDF \
              -lvtkRendering \
              -lvtkViews \
              -lvtkVolumeRendering \
              -lvtkWidgets
}

#------------------------------------------------------------------------------
# OpenCASCADE library:
#------------------------------------------------------------------------------
unix {
   OCC_INCLUDEPATH = /usr/include/oce
   OCC_LIBPATH = /usr/lib/x86_64-linux-gnu
   OCC_LIBS = -lTKSTL \
              -lTKBRep \
              -lTKernel \
              -lTKG2d \
              -lTKG3d \
              -lTKGeomAlgo \
              -lTKGeomBase \
              -lTKMath \
              -lTKMesh \
              -lTKShHealing \
              -lTKSTEP \
              -lTKSTEP209 \
              -lTKSTEPAttr \
              -lTKSTEPBase \
              -lTKIGES \
              -lTKTopAlgo \
              -lTKXSBase
}
Opencascade, vtk, qwt (qwt6) are all default from repositories. python2.7-dev must be installed. But do not install the pythonqt from the repositories. If installed, the build chokes with it. Uninstall if you have it installed (and install back later, if you wish). ElmerGUI comes with its own pythonqt.

before running make-qt4 in the elmerGUI directory, edit the file
.../ElmerGUI/Application/Application.pro
and change the order for linking pythonqt. The line
LIBS += $${PY_LIBS} -lPythonQt
must be changed to:
LIBS += -lPythonQt $${PY_LIBS}
otherwise the linking will fail, since (at least on gcc) the linking order is important.
After that, doing:

Code: Select all

qmake-qt4
make
make install
should produce a working ElmerGUI.
kataja
Posts: 74
Joined: 09 May 2014, 16:06
Antispam: Yes

Re: Install ElmerGUI on Ubuntu 14.04

Post by kataja »

Hi,

there are cmake installation files of the ElmerGUI available in https://github.com/ElmerCSC/elmerfem/tree/devel.

That version should work with packages available in official Ubuntu 14.04 repositories.

To build it do following

Code: Select all

$ git clone https://www.github.com/ElmerCSC/elmerfem
$ cd elmerfem && git checkout devel && cd ..
$ mkdir elmer-gui-build && cd elmer-gui-build
$ cmake ../elmerfem/ElmerGUI
and run

Code: Select all

$ ccmake .
to fine tune which features to enable and where to install (CMAKE_INSTALL_PREFIX) ElmerGUI. Finally run

Code: Select all

 $ make install 
to compile and install ElmerGUI.
DePurpereWolf
Posts: 22
Joined: 13 Mar 2013, 23:46
Antispam: Yes

Re: Install ElmerGUI on Ubuntu 14.04

Post by DePurpereWolf »

Thank you all for your answers, I have ElmerGUI working now on Ubuntu 14.04
I only really need to use the GUI sometimes to check if my mesh is correct. It is a good way to verify boundary numbers.

However, I also do like the convergence plot it makes during simulations.

Is there a way to view the convergence monitor without using GUI? Or a workaround that maybe plots the elmeroutput when the simulation is done?
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Install ElmerGUI on Ubuntu 14.04

Post by raback »

Hi

A work-a-round: use SaveScalars and choose the variable of the solver that you are interested. Then there are many operators that can give info on convergence e.g.

Code: Select all

Exec Solver = After timestep
Variable 1 = Temperature
Operator 1 = Norm
Operator 2 = Nonlin Change
...
Look at the documentation (or code) of SaveScalars for the right operators.

When you the file with the info just use gnuplot, Matlab, Excel, etc. to plot the convergence.

-Peter
theaembee
Posts: 4
Joined: 08 Jan 2014, 13:06
Antispam: Yes

Re: Install ElmerGUI on Ubuntu 14.04

Post by theaembee »

Should the compilation of all modules (GUI and non-GUI) work now on Ubuntu 14.04 with the general compilation instructions? I get the error message as described in post viewtopic.php?f=3&t=3585

I don't know which of the modules ivnn talked about still are necessary. Has anybody information about that? I already made a new installation of my system because I had package incompatibilities from the last try.

Are there maybe any working compilation scripts for all modules to run on Ubuntu 14.04 or maybe even a step-by-step instruction?
Post Reply