├── .dockerignore
├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── RELEASE-NOTES.md
├── docker
├── Dockerfile_elmer84_of6
├── Dockerfile_elmer84_of6_debug
├── Dockerfile_elmerdev_of7
├── Dockerfile_eof
├── Dockerfile_pv54_mesa
├── Dockerfile_pv56_mesa
├── travisDockerPush.sh
└── user-mapping.sh
├── etc
└── bashrc
├── libs
├── Elmer2OpenFOAM.F90
├── OpenFOAM2Elmer.F90
├── commSplit
│ ├── 2
│ │ ├── PstreamGlobals.C
│ │ ├── PstreamGlobals.H
│ │ ├── UIPread.C
│ │ ├── UOPwrite.C
│ │ ├── UPstream.C
│ │ ├── allReduce.H
│ │ └── allReduceTemplates.C
│ ├── 3
│ │ ├── PstreamGlobals.C
│ │ ├── PstreamGlobals.H
│ │ ├── UIPread.C
│ │ ├── UOPwrite.C
│ │ ├── UPstream.C
│ │ ├── allReduce.H
│ │ └── allReduceTemplates.C
│ ├── 4
│ │ ├── PstreamGlobals.C
│ │ ├── PstreamGlobals.H
│ │ ├── UIPread.C
│ │ ├── UOPwrite.C
│ │ ├── UPstream.C
│ │ ├── allReduce.H
│ │ └── allReduceTemplates.C
│ ├── 5
│ │ ├── PstreamGlobals.C
│ │ ├── PstreamGlobals.H
│ │ ├── UIPread.C
│ │ ├── UOPwrite.C
│ │ ├── UPstream.C
│ │ ├── allReduce.H
│ │ └── allReduceTemplates.C
│ ├── Make
│ │ ├── files
│ │ └── options
│ └── v1812
│ │ ├── PstreamGlobals.C
│ │ ├── PstreamGlobals.H
│ │ ├── UIPread.C
│ │ ├── UOPwrite.C
│ │ ├── UPstream.C
│ │ ├── allReduce.H
│ │ └── allReduceTemplates.C
└── coupleElmer
│ ├── Elmer.C
│ ├── Elmer.H
│ └── Make
│ ├── files
│ └── options
├── solvers
├── interpolationTestFoam
│ ├── Make
│ │ ├── files
│ │ └── options
│ └── interpolationTestFoam.C
├── mhdInterFoam5
│ ├── Make
│ │ ├── files
│ │ └── options
│ ├── UEqn.H
│ ├── alphaCourantNo.H
│ ├── alphaEqn.H
│ ├── alphaEqnSubCycle.H
│ ├── correctPhi.H
│ ├── createFields.H
│ ├── mhdInterFoam.C
│ ├── pEqn.H
│ ├── setDeltaT.H
│ └── setRDeltaT.H
├── mhdInterFoam6
│ ├── Make
│ │ ├── files
│ │ └── options
│ ├── UEqn.H
│ ├── VoF
│ │ ├── alphaCourantNo.H
│ │ ├── alphaEqn.H
│ │ ├── alphaEqnSubCycle.H
│ │ ├── createAlphaFluxes.H
│ │ ├── setDeltaT.H
│ │ └── setRDeltaT.H
│ ├── alphaSuSp.H
│ ├── correctPhi.H
│ ├── createFields.H
│ ├── initCorrectPhi.H
│ ├── mhdInterFoam.C
│ ├── pEqn.H
│ └── rhofs.H
├── mhdInterFoam7
│ ├── Make
│ │ ├── files
│ │ └── options
│ ├── UEqn.H
│ ├── VoF
│ │ ├── alphaCourantNo.H
│ │ ├── alphaEqn.H
│ │ ├── alphaEqnSubCycle.H
│ │ ├── createAlphaFluxes.H
│ │ ├── setDeltaT.H
│ │ └── setRDeltaT.H
│ ├── alphaSuSp.H
│ ├── correctPhi.H
│ ├── createFields.H
│ ├── initCorrectPhi.H
│ ├── mhdInterFoam.C
│ ├── pEqn.H
│ └── rhofs.H
├── mhdThermoInterFoam5
│ ├── Make
│ │ ├── files
│ │ └── options
│ ├── TEqn.H
│ ├── TableVisc
│ │ ├── Make
│ │ │ ├── files
│ │ │ └── options
│ │ ├── TableVisc.C
│ │ └── TableVisc.H
│ ├── UEqn.H
│ ├── alphaCourantNo.H
│ ├── alphaEqn.H
│ ├── alphaEqnSubCycle.H
│ ├── correctPhi.H
│ ├── createFields.H
│ ├── mhdThermoInterFoam.C
│ ├── pEqn.H
│ ├── setDeltaT.H
│ └── setRDeltaT.H
└── mhdVxBPimpleFoam5
│ ├── Make
│ ├── files
│ └── options
│ ├── UEqn.H
│ ├── createFields.H
│ ├── mhdVxBPimpleFoam.C
│ └── pEqn.H
└── tests
├── interpolationTest
├── 0
│ ├── T
│ └── realT
├── InterpolationTester.F90
├── constant
│ ├── polyMesh
│ │ ├── boundary
│ │ ├── cellZones
│ │ ├── faces
│ │ ├── neighbour
│ │ ├── owner
│ │ └── points
│ └── transportProperties
├── dg.sif
├── elem.sif
├── ip.sif
├── meshElmer
│ ├── mesh.boundary
│ ├── mesh.elements
│ ├── mesh.header
│ ├── mesh.names
│ └── mesh.nodes
├── runTravisTest.sh
└── system
│ ├── blockMeshDict
│ ├── controlDict
│ ├── decomposeParDict
│ ├── fvSchemes
│ └── fvSolution
├── levitation2D
├── 0
│ ├── JxB
│ ├── U
│ ├── alpha.melt
│ ├── alpha.melt.orig
│ ├── epsilon
│ ├── k
│ ├── nut
│ ├── omega
│ └── p_rgh
├── case.sif
├── constant
│ ├── dynamicMeshDict
│ ├── g
│ ├── polyMesh
│ │ ├── boundary
│ │ ├── cellZones
│ │ ├── faces
│ │ ├── neighbour
│ │ ├── owner
│ │ └── points
│ ├── transportProperties
│ └── turbulenceProperties
├── meshElmer
│ ├── mesh.boundary
│ ├── mesh.elements
│ ├── mesh.header
│ ├── mesh.names
│ └── mesh.nodes
├── runTravisTest.sh
└── system
│ ├── blockMeshDict
│ ├── controlDict
│ ├── decomposeParDict
│ ├── extrudeMeshDict
│ ├── fvSchemes
│ ├── fvSolution
│ ├── mapFieldsDict
│ ├── setFieldsDict
│ └── snappyHexMeshDict
└── travisTests.sh
/.dockerignore:
--------------------------------------------------------------------------------
1 | partitioning.*
2 | processor*
3 | runs/
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | **/lnInclude/
2 | **/Make/*/
3 | runs/
4 |
5 | processor*
6 | partitioning.*
7 | *vtu
8 |
9 | # Eclipse
10 | .cproject
11 | .project
12 | .settings
13 |
14 | # Compiled Object files
15 | *.slo
16 | *.lo
17 | *.o
18 | *.obj
19 | *.dep
20 |
21 | # Precompiled Headers
22 | *.gch
23 | *.pch
24 |
25 | # Compiled Dynamic libraries
26 | *.so
27 | *.dylib
28 | *.dll
29 |
30 | # Fortran module files
31 | *.mod
32 | *.smod
33 |
34 | # Compiled Static libraries
35 | *.lai
36 | *.la
37 | *.a
38 | *.lib
39 |
40 | # Executables
41 | *.exe
42 | *.out
43 | *.app
44 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | services: docker
2 |
3 | install:
4 | - docker --version
5 | - docker build --no-cache --pull -t test_image -f docker/Dockerfile_eof .
6 |
7 | script:
8 | - docker run --rm -it -e HOST_USER_ID=$(id -u) -e HOST_USER_GID=$(id -g) test_image ./EOF-Library/tests/travisTests.sh
9 |
10 | deploy:
11 | provider: script
12 | script: bash docker/travisDockerPush.sh
13 | on:
14 | all_branches: true
15 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # [EOF-Library](https://EOF-Library.com)
2 | Libraries for coupling [Elmer FEM](https://www.csc.fi/web/elmer) and [OpenFOAM](https://openfoam.org/) + test cases. For detailed information how this software works check our [article](https://doi.org/10.1016/j.softx.2019.01.007).
3 |
4 | ___If you use EOF-Library, please cite:___
5 | Juris Vencels, Peter Råback, Vadims Geža,
6 | _EOF-Library: Open-source Elmer FEM and OpenFOAM coupler for electromagnetics and fluid dynamics_,
7 | SoftwareX, Volume 9, 2019, Pages 68-72, ISSN 2352-7110,
8 | https://doi.org/10.1016/j.softx.2019.01.007.
9 |
10 | ## About ##
11 | This software is maintained by [Juris Vencels](https://lv.linkedin.com/in/vencels) from *EOF Consulting LLC* in cooperation with *CSC - IT Center for Science Ltd.* (Finland).
12 |
13 | * Software improvements and suggestions are very welcome.
14 | * If you find this software useful then drop me a message.
15 | * The best way to support development of this library is buying consulting services.
16 | * GPL v3 license allows commercial use of this software.
17 |
18 | ## Introduction ##
19 | EOF-Library couples internal fields between Elmer FEM and OpenFOAM. Applications are
20 | * Magnetohydrodynamics (MHD)
21 | * Microwave ehating
22 | * Plasma physics
23 | * Convective cooling of electrical devices and machines
24 |
25 | ## Requirements ##
26 | * **Both Elmer and OpenFOAM must use the same OpenMPI version!**
27 |
28 | ## How to ##
29 | There are two options to install and use this software:
30 | 1. __Docker__ install (best for *beginners* and running on *clouds*) - **Linux, Windows, MacOS**
31 | 2. __Complete__ install (best for *developers* and *advanced* users) - **Linux**
32 |
33 | Performance-wise these two options are comparable. Docker installation comes with OpenFOAM and Elmer installed, and environment is set. This is preferred option for most users and for running simulations on multiple computers or cloud.
34 |
35 | On the other hand complete installation gives users more flexibility, it is preferred option for developers who want to work on their own solvers or have full control over software and its source code.
36 |
37 | #### 1. Docker ####
38 | First, you will need to install docker on your OS:
39 | 1. **Ubuntu/Linux** (preferred) - https://docs.docker.com/install/linux/docker-ce/ubuntu/
40 | 2. **Windows** - https://docs.docker.com/docker-for-windows/install/
41 | https://docs.docker.com/docker-for-windows/install/
42 | 3. **MacOS** - https://docs.docker.com/docker-for-mac/install/
43 |
44 |
45 | Then, follow commands below to install the software & run demo simulation.
46 | * Create an empty folder
47 | ```
48 | mkdir runs
49 | cd runs
50 | ```
51 | * Run Docker image and bind mount current host system folder *${PWD}* to newly created *EOF-Library/runs* folder
52 | ```
53 | docker run --rm -it -e HOST_USER_ID=$(id -u) -e HOST_USER_GID=$(id -g) -v ${PWD}:/home/openfoam/EOF-Library/runs eoflibrary/eof_elmer84_of6:latest
54 | ```
55 | * Update EOF-Library and compile it
56 | ```
57 | eofUpdate
58 | ```
59 | * Compile OpenFOAM solver
60 | ```
61 | cd EOF-Library
62 | wmake solvers/mhdInterFoam6
63 | ```
64 | * Copy test simulation
65 | ```
66 | cp -r tests/levitation2D runs
67 | ```
68 | * Prepare case
69 | ```
70 | cd runs/levitation2D
71 | setFields
72 | decomposePar
73 | ElmerGrid 2 2 meshElmer -metis 2
74 | ```
75 | * Run simulation on 2 physical cores:
76 | ```
77 | mpirun -n 2 mhdInterFoam -parallel : -n 2 ElmerSolver_mpi case.sif
78 | ```
79 | * Simulation results will appear in host system *runs* folder
80 |
81 |
82 | #### 2. Manual installation ####
83 | * Get `git`, `cmake`, `gfortran`, `blas` and `lapack`.
84 | ```
85 | sudo apt-get install git cmake gfortran libblas-dev liblapack-dev
86 | ```
87 | * Download OpenFOAM source code, configure and compile it
88 | * Download Elmer from developers repo (https://github.com/ElmerCSC/elmerfem).
89 |
90 | * Configure and compile Elmer with `-DWITH_MPI=TRUE` by following these steps (https://www.csc.fi/web/elmer/sources-and-compilation). In short .., we create build folder and call CMake from this folder:
91 | ```
92 | cmake -DWITH_MPI=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../mpi-install ../elmerfem
93 | make -j install
94 | ```
95 |
96 | * Download EOF-Library:
97 |
98 | ```
99 | git clone https://github.com/jvencels/EOF-Library
100 | ```
101 | * Update environment
102 | ```
103 | . EOF-Library/etc/bashrc
104 | ```
105 | * Check the MPI implementation and version (it is **important** that Elmer and OpenFOAM was compiled with the same version!)
106 | ```
107 | which mpirun
108 | mpirun --version
109 | ```
110 | * Compile EOF-Library
111 |
112 | ```
113 | eofCompile
114 | ```
115 | * Colmpile OpenFOAM solver
116 | ```
117 | cd EOF-Library/solvers/mhdInterFoam6
118 | wmake
119 | ```
120 |
121 | * Copy test
122 |
123 | ```
124 | cd ../..
125 | mkdir runs
126 | cd runs
127 | cp -r ../tests/levitation2D .
128 | ```
129 |
130 | * Prepare test
131 |
132 | ```
133 | cd levitation2D
134 | setFields
135 | decomposePar
136 | ElmerGrid 2 2 meshElmer -metis 2
137 | ```
138 |
139 | * Run OpenFOAM on 2 processes and Elmer on 2 processes
140 |
141 | ```
142 | mpirun -np 2 mhdInterFoam -parallel : -np 2 ElmerSolver_mpi
143 | ```
144 |
--------------------------------------------------------------------------------
/RELEASE-NOTES.md:
--------------------------------------------------------------------------------
1 | # EOF-Library release notes
2 |
3 | ### X.Y.Z
4 | **X** - major releases, not back-compatible (0 = beta)
5 | **Y** - new features, back-compatible within the same release
6 | **Z** - patches and bug fixes
7 |
8 | ## Current issues:
9 | * **OpenFOAM v5.0** - There are many ways to install OpenFOAM v5.0 - Ubuntu repositories, source from git development branch or source pack from OpenFOAM.org. All these versions have different changes in code responsible for MPI communication, therefore user may incounter issues compiling EOF-Library. **Fix:** try compiling OpenFOAM from https://openfoam.org/download/5-0-source/
10 |
11 | ## Changes for 0.5.1:
12 | * Fixed OpenFOAM Docker image version, was using v6 instead of v7.
13 | * Added support receiving SymmThensor from Elmer to OF.
14 | * O2E pair file - stores information about element-to-cell pairs. In some cases can speed up initialization of simulation.
15 |
16 | ## Changes for 0.5.0:
17 | * Added support for OpenFOAM v7
18 |
19 | ## Changes for 0.5.0:
20 | * Added support for OpenFOAM v7
21 |
22 | ## Changes for 0.4.0:
23 | * Added support for OpenFOAM's multiRegion
24 |
25 | ## Changes for 0.3.0:
26 | * Fixed Travis automatic tests.
27 | * Travis pushes Docker images to https://hub.docker.com/u/eoflibrary
28 |
29 | ## Changes for 0.2.0:
30 | * Added script for dynamically setting user and group ID's inside Docker.
31 |
32 | ## Changes for 0.1.0:
33 | * First release.
34 |
--------------------------------------------------------------------------------
/docker/Dockerfile_elmer84_of6:
--------------------------------------------------------------------------------
1 | ARG BASE_IMAGE=hfdresearch/swak4foamandpyfoam:latest-v6.0
2 |
3 | # Alternatively, you can use Docker flag
4 | # --build-arg BASE_IMAGE=openfoam/openfoam6-paraview54:latest
5 |
6 | FROM $BASE_IMAGE
7 |
8 | USER root
9 |
10 | RUN apt-get -y update && \
11 | apt-get install -y \
12 | gcc \
13 | cmake \
14 | g++ \
15 | gfortran \
16 | libopenblas-dev \
17 | git
18 |
19 | # Elmer
20 | RUN cd /opt && \
21 | git clone https://github.com/ElmerCSC/elmerfem.git && \
22 | cd elmerfem && \
23 | git checkout release && \
24 | git log --pretty=oneline | head -n 10 | tee -a /opt/elmerBuild.log && \
25 | mkdir build && \
26 | cd build && \
27 | cmake -DWITH_MPI=TRUE -DCMAKE_BUILD_TYPE=Release ../ | tee -a /opt/elmerBuild.log && \
28 | make -j install | tee -a /opt/elmerBuild.log
29 |
--------------------------------------------------------------------------------
/docker/Dockerfile_elmer84_of6_debug:
--------------------------------------------------------------------------------
1 | ARG BASE_IMAGE=hfdresearch/swak4foamandpyfoam:latest-v6.0
2 |
3 | # Alternatively, you can use Docker flag
4 | # --build-arg BASE_IMAGE=openfoam/openfoam6-paraview54:latest
5 |
6 | FROM $BASE_IMAGE
7 |
8 | USER root
9 |
10 | RUN apt-get -y update && \
11 | apt-get install -y \
12 | gcc \
13 | cmake \
14 | g++ \
15 | gfortran \
16 | libopenblas-dev \
17 | git \
18 | valgrind
19 |
20 | # OpenMPI
21 | RUN cd /opt && \
22 | wget https://download.open-mpi.org/release/open-mpi/v1.10/openmpi-1.10.2.tar.gz && \
23 | tar xvzf openmpi-1.10.2.tar.gz && \
24 | rm openmpi-1.10.2.tar.gz && \
25 | cd openmpi-1.10.2 && \
26 | ./configure --prefix=$(pwd)/install && \
27 | make -j install && \
28 | echo "export MPI_INST=/opt/openmpi-1.10.2/install" >> /etc/bash.bashrc && \
29 | echo "export PATH=\$MPI_INST/bin:\$MPI_INST/include:\$PATH" >> /etc/bash.bashrc && \
30 | echo "export LD_LIBRARY_PATH=\$MPI_INST/lib:\$LD_LIBRARY_PATH" >> /etc/bash.bashrc
31 |
32 | # Elmer
33 | RUN cd /opt && \
34 | git clone https://github.com/ElmerCSC/elmerfem.git && \
35 | chown -R openfoam:openfoam elmerfem && \
36 | cd elmerfem && \
37 | git checkout release && \
38 | git log --pretty=oneline | head -n 10 | tee -a /opt/elmerBuild.log && \
39 | mkdir build && \
40 | cd build && \
41 | cmake -DWITH_MPI=TRUE -DCMAKE_BUILD_TYPE=Debug -DCMAKE_Fortran_FLAGS_DEBUG="-cpp -g -O0 -fbacktrace -fcheck=all -Wall -Wtabs -Wuninitialized -Wextra -Wconversion -ffpe-trap=overflow -ffree-line-length-none" ../ | tee -a /opt/elmerBuild.log && \
42 | make -j install | tee -a /opt/elmerBuild.log
43 |
--------------------------------------------------------------------------------
/docker/Dockerfile_elmerdev_of7:
--------------------------------------------------------------------------------
1 | ARG BASE_IMAGE=hfdresearch/swak4foamandpyfoam:latest-v7.0
2 |
3 | # Alternatively, you can use Docker flag
4 | # --build-arg BASE_IMAGE=openfoam/openfoam7-paraview56:latest
5 |
6 | FROM $BASE_IMAGE
7 |
8 | USER root
9 |
10 | RUN apt-get -y update && \
11 | apt-get install -y \
12 | gcc \
13 | cmake \
14 | g++ \
15 | gfortran \
16 | libopenblas-dev \
17 | git
18 |
19 | # Elmer
20 | RUN cd /opt && \
21 | git clone https://github.com/ElmerCSC/elmerfem.git && \
22 | cd elmerfem && \
23 | git log --pretty=oneline | head -n 10 | tee -a /opt/elmerBuild.log && \
24 | mkdir build && \
25 | cd build && \
26 | cmake -DWITH_MPI=TRUE -DCMAKE_BUILD_TYPE=Release ../ | tee -a /opt/elmerBuild.log && \
27 | make -j install | tee -a /opt/elmerBuild.log
28 |
--------------------------------------------------------------------------------
/docker/Dockerfile_eof:
--------------------------------------------------------------------------------
1 | ARG BASE_IMAGE=eoflibrary/elmerdev_of7:latest
2 | # --build-arg BASE_IMAGE=eoflibrary/elmer84_of6_debug:latest
3 |
4 | FROM $BASE_IMAGE
5 |
6 | # Default user inside base image
7 | ENV USER=openfoam USER_ID=98765 USER_GID=98765
8 |
9 | USER root
10 |
11 | RUN apt-get -y update && \
12 | apt-get install -y \
13 | sudo && \
14 | echo "openfoam:openfoam" | chpasswd && \
15 | adduser openfoam sudo
16 |
17 | # Add EOF-Library
18 | ADD ./ EOF-Library
19 |
20 | # Update environment & install script for dynamic UID:GID mapping
21 | RUN echo ". /home/openfoam/EOF-Library/etc/bashrc" >> .bashrc && \
22 | mv /home/openfoam/EOF-Library/docker/user-mapping.sh / && \
23 | chmod u+x /user-mapping.sh
24 |
25 | ENTRYPOINT ["/user-mapping.sh"]
26 |
--------------------------------------------------------------------------------
/docker/Dockerfile_pv54_mesa:
--------------------------------------------------------------------------------
1 | FROM ubuntu:16.04
2 |
3 | USER root
4 |
5 | RUN apt-get -y update && \
6 | apt-get install -y \
7 | pkg-config \
8 | zlib1g-dev \
9 | libexpat1-dev \
10 | cmake \
11 | mesa-utils \
12 | python \
13 | python-pip \
14 | wget \
15 | libopenmpi-dev \
16 | openmpi-bin
17 |
18 | RUN wget http://releases.llvm.org/7.0.0/llvm-7.0.0.src.tar.xz && \
19 | tar -xvf llvm-7.0.0.src.tar.xz && \
20 | cd llvm-7.0.0.src && mkdir build && cd build && \
21 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_ENABLE_RTTI=ON -DLLVM_INSTALL_UTILS=ON -DLLVM_TARGETS_TO_BUILD:STRING=X86 -DLLVM_LINK_LLVM_DYLIB=ON .. && \
22 | make -j4 install && \
23 | cd / && rm llvm-7.0.0.src.tar.xz && rm -r llvm-7.0.0.src
24 |
25 | RUN wget https://mesa.freedesktop.org/archive/mesa-18.2.4.tar.gz && \
26 | tar -xvzf mesa-18.2.4.tar.gz && \
27 | cd mesa-18.2.4 && \
28 | ./configure --prefix=/usr/local/ --enable-opengl --disable-gles1 --disable-gles2 --disable-va --disable-xvmc --disable-vdpau --enable-shared-glapi --disable-texture-float --enable-llvm --enable-llvm-shared-libs --with-gallium-drivers=swrast --disable-dri --disable-glx --disable-egl --with-platforms= --disable-gbm --with-swr-archs=avx,avx2,skx,knl --disable-osmesa --enable-gallium-osmesa && \
29 | make -j4 install && \
30 | cd / && rm mesa-18.2.4.tar.gz && rm -r mesa-18.2.4
31 |
32 | RUN wget "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v5.4&type=source&os=Sources&downloadFile=ParaView-v5.4.0.tar.gz" -O ParaView-v5.4.0.tar.gz && \
33 | tar -xvzf ParaView-v5.4.0.tar.gz && cd ParaView-v5.4.0 && mkdir build && cd build && \
34 | cmake -DPARAVIEW_ENABLE_PYTHON=ON -DPARAVIEW_BUILD_QT_GUI=OFF -DVTK_USE_X=OFF -DOPENGL_INCLUDE_DIR=IGNORE -DOPENGL_xmesa_INCLUDE_DIR=IGNORE -DOPENGL_gl_LIBRARY=IGNORE -DOSMESA_INCLUDE_DIR=/usr/local/include -DOSMESA_LIBRARY=/usr/local/lib/libOSMesa.so -DVTK_OPENGL_HAS_OSMESA=ON -DVTK_USE_OFFSCREEN=OFF -DPARAVIEW_USE_MPI=ON .. && \
35 | make -j4 install && \
36 | cd / && rm ParaView-v5.4.0.tar.gz && rm -r ParaView-v5.4.0
37 |
38 |
--------------------------------------------------------------------------------
/docker/Dockerfile_pv56_mesa:
--------------------------------------------------------------------------------
1 | FROM ubuntu:18.04
2 |
3 | USER root
4 |
5 | RUN apt-get -y update && \
6 | apt-get install -y \
7 | pkg-config \
8 | zlib1g-dev \
9 | libexpat1-dev \
10 | cmake \
11 | mesa-utils \
12 | python \
13 | python-pip \
14 | wget \
15 | libopenmpi-dev \
16 | openmpi-bin
17 |
18 | RUN wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/llvm-10.0.0.src.tar.xz && \
19 | tar -xvf llvm-10.0.0.src.tar.xz && \
20 | cd llvm-10.0.0.src && mkdir build && cd build && \
21 | cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_ENABLE_RTTI=ON -DLLVM_INSTALL_UTILS=ON -DLLVM_TARGETS_TO_BUILD:STRING=X86 -DLLVM_LINK_LLVM_DYLIB=ON .. && \
22 | make -j4 install && \
23 | cd / && rm llvm-10.0.0.src.tar.xz && rm -r llvm-10.0.0.src
24 |
25 | RUN wget https://mesa.freedesktop.org/archive/mesa-18.3.6.tar.gz && \
26 | tar -xvzf mesa-18.3.6.tar.gz && \
27 | cd mesa-18.3.6 && \
28 | ./configure --prefix=/usr/local/ --enable-opengl --disable-gles1 --disable-gles2 --disable-va --disable-xvmc --disable-vdpau --enable-shared-glapi --disable-texture-float --enable-llvm --enable-llvm-shared-libs --with-gallium-drivers=swrast --disable-dri --disable-glx --disable-egl --with-platforms= --disable-gbm --with-swr-archs=avx,avx2,skx,knl --disable-osmesa --enable-gallium-osmesa && \
29 | make -j4 install && \
30 | cd / && rm mesa-18.3.6.tar.gz && rm -r mesa-18.3.6
31 |
32 | RUN wget "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v5.6&type=source&os=Sources&downloadFile=ParaView-v5.6.0.tar.gz" -O ParaView-v5.6.0.tar.gz && \
33 | tar -xvzf ParaView-v5.6.0.tar.gz && cd ParaView-v5.6.0 && mkdir build && cd build && \
34 | cmake -DPARAVIEW_ENABLE_PYTHON=ON -DPARAVIEW_BUILD_QT_GUI=OFF -DVTK_USE_X=OFF -DOPENGL_INCLUDE_DIR=IGNORE -DOPENGL_xmesa_INCLUDE_DIR=IGNORE -DOPENGL_gl_LIBRARY=IGNORE -DOSMESA_INCLUDE_DIR=/usr/local/include -DOSMESA_LIBRARY=/usr/local/lib/libOSMesa.so -DVTK_OPENGL_HAS_OSMESA=ON -DVTK_USE_OFFSCREEN=OFF -DPARAVIEW_USE_MPI=ON .. && \
35 | make -j4 install && \
36 | cd / && rm ParaView-v5.6.0.tar.gz && rm -r ParaView-v5.6.0
37 |
38 |
--------------------------------------------------------------------------------
/docker/travisDockerPush.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | dockerImageName="eoflibrary/eof_elmerdev_of7"
4 |
5 | echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
6 |
7 | if [ "$TRAVIS_BRANCH" == "master" ]; then
8 | docker tag test_image $dockerImageName:latest
9 | docker push $dockerImageName:latest
10 | fi
11 |
12 | if [ -n "${TRAVIS_TAG}" ] ; then
13 | echo "Git commit tag name: ${TRAVIS_TAG}"
14 | docker tag test_image $dockerImageName:$TRAVIS_TAG
15 | docker push $dockerImageName:$TRAVIS_TAG
16 |
17 | docker tag test_image $dockerImageName:latest
18 | docker push $dockerImageName:latest
19 | fi
20 |
--------------------------------------------------------------------------------
/docker/user-mapping.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # docker: mapping host uid and gid to user inisde container
4 | # --------------------------------------------------
5 | # Original file obtained from:
6 | # https://gist.github.com/renzok/29c9e5744f1dffa392cf
7 |
8 | # if both not set we do not need to do anything
9 | if [ -z "${HOST_USER_ID}" -o -z "${HOST_USER_GID}" -o -z "${USER}" ]; then
10 | echo "Flags '-e HOST_USER_ID=\$(id -u) -e HOST_USER_GID=\$(id -g)' were not set. You might have permission problems."
11 | /bin/bash "$@"
12 | else
13 | # reset user_?id to either new id or if empty old (still one of above
14 | # might not be set)
15 | USER_ID=${HOST_USER_ID:=$USER_ID}
16 | USER_GID=${HOST_USER_GID:=$USER_GID}
17 |
18 | LINE=$(grep -F "${USER}" /etc/passwd)
19 | # replace all ':' with a space and create array
20 | array=( ${LINE//:/ } )
21 |
22 | # home is 5th element
23 | USER_HOME=${array[4]}
24 |
25 | sed -i -e "s/^${USER}:\([^:]*\):[0-9]*:[0-9]*/${USER}:\1:${USER_ID}:${USER_GID}/" /etc/passwd
26 | sed -i -e "s/^${USER}:\([^:]*\):[0-9]*/${USER}:\1:${USER_GID}/" /etc/group
27 |
28 | chown -R ${USER_ID}:${USER_GID} ${USER_HOME}
29 |
30 | exec su - "${USER}" "$@"
31 | fi
32 |
--------------------------------------------------------------------------------
/etc/bashrc:
--------------------------------------------------------------------------------
1 | export EOF_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/..
2 | export EOF_SRC=$EOF_HOME/libs
3 | export LD_LIBRARY_PATH=$EOF_SRC:$LD_LIBRARY_PATH
4 | export LD_LIBRARY_PATH=$FOAM_USER_LIBBIN:$LD_LIBRARY_PATH
5 |
6 | eofPull() {
7 | git -C $EOF_HOME pull
8 | }
9 |
10 | eofCompile() {
11 | wmake $EOF_SRC/coupleElmer
12 | elmerf90 -o $EOF_SRC/Elmer2OpenFOAM.so -J$EOF_SRC $EOF_SRC/Elmer2OpenFOAM.F90
13 | elmerf90 -o $EOF_SRC/OpenFOAM2Elmer.so -J$EOF_SRC $EOF_SRC/OpenFOAM2Elmer.F90
14 | }
15 |
16 | eofUpdate() {
17 | eofPull
18 | eofCompile
19 | }
20 |
--------------------------------------------------------------------------------
/libs/commSplit/2/PstreamGlobals.C:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------------------------*\
2 | ========= |
3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 | \\ / O peration |
5 | \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation
6 | \\/ M anipulation |
7 | -------------------------------------------------------------------------------
8 | License
9 | This file is part of OpenFOAM.
10 |
11 | OpenFOAM is free software: you can redistribute it and/or modify it
12 | under the terms of the GNU General Public License as published by
13 | the Free Software Foundation, either version 3 of the License, or
14 | (at your option) any later version.
15 |
16 | OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 | for more details.
20 |
21 | You should have received a copy of the GNU General Public License
22 | along with OpenFOAM. If not, see .
23 |
24 | \*---------------------------------------------------------------------------*/
25 |
26 | #include "PstreamGlobals.H"
27 |
28 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 |
30 | namespace Foam
31 | {
32 |
33 | // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 |
35 | MPI_Comm PstreamGlobals::MPI_COMM_FOAM;
36 |
37 | // Outstanding non-blocking operations.
38 | //! \cond fileScope
39 | DynamicList PstreamGlobals::outstandingRequests_;
40 | //! \endcond
41 |
42 | //// Max outstanding non-blocking operations.
43 | ////! \cond fileScope
44 | //int PstreamGlobals::nRequests_ = 0;
45 | ////! \endcond
46 |
47 | // Free'd non-blocking operations.
48 | //! \cond fileScope
49 | //DynamicList