Commit 6f9304f0 authored by Lukas Riedel's avatar Lukas Riedel 📝

Merge branch 'update/dune-v2.5.1' into feature/dune-randomfield

parents 9c168d22 8206188f
image: dorie/dune-env:2.5
image: dorie/dune-env:2.5.1
variables:
DUNE_CONTROL_PATH: /opt/dune:$CI_PROJECT_DIR
......@@ -14,7 +14,7 @@ build:main:
tags:
- docker
script:
- MAKE_FLAGS="-j 2" ./dune-common/bin/dunecontrol --only=dorie all
- CMAKE_FLAGS="-DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" MAKE_FLAGS="-j 2" ./dune-common/bin/dunecontrol --only=dorie all
- export PATH=/opt/dune/dorie/build-cmake/bin:$PATH
- ARGS="--output-on-failure -j 2" ./dune-common/bin/dunecontrol --only=dorie make test
- ./dune-common/bin/dunecontrol --only=dorie make doc
......@@ -25,25 +25,13 @@ build:main:
- $CI_PROJECT_DIR/build-cmake/doc/html/
expire_in: 1 week
build:python3:
tags:
- docker
script:
- ./dune-common/bin/dunecontrol --only=dune-python exec "rm -rf build-cmake"
- ./dune-common/bin/dunecontrol --only=dune-testtools exec "rm -rf build-cmake"
- ./dune-common/bin/dunecontrol --only=dorie exec "rm -rf build-cmake"
- CMAKE_FLAGS="-DDUNE_FORCE_PYTHON3=True" MAKE_FLAGS="-j 2" ./dune-common/bin/dunecontrol --module=dorie all
- export PATH=/opt/dune/dorie/build-cmake/bin:$PATH
- ARGS="--output-on-failure -j 2" ./dune-common/bin/dunecontrol --only=dorie make test
stage: build
build:update_dune:
tags:
- docker
script:
- ./dune-common/bin/dunecontrol update || true
- ./dune-common/bin/dunecontrol exec "rm -rf build-cmake"
- MAKE_FLAGS="-j 2" ./dune-common/bin/dunecontrol all
- CMAKE_FLAGS="-DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" MAKE_FLAGS="-j 2" ./dune-common/bin/dunecontrol all
- export PATH=/opt/dune/dorie/build-cmake/bin:$PATH
- ARGS="--output-on-failure -j 2" ./dune-common/bin/dunecontrol --only=dorie make test
stage: build
......@@ -52,7 +40,7 @@ build:debug:
tags:
- docker
script:
- CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Debug" ./dune-common/bin/dunecontrol --only=dorie all
- CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Debug -DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" ./dune-common/bin/dunecontrol --only=dorie all
stage: build
deploy:docs:
......
FROM dorie/dune-env:2.5
FROM dorie/dune-env:2.5.1
MAINTAINER Dion Häfner
WORKDIR /opt/dune
ADD . /opt/dune/dorie/
RUN source /opt/dune/venv/dorie/bin/activate && ./dune-common/bin/dunecontrol --only=dorie all
RUN CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release -DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" ./dune-common/bin/dunecontrol --only=dorie all
ENV PATH="/opt/dune/dorie/build-cmake/bin:${PATH}"
WORKDIR /sim
ENTRYPOINT ["/opt/dune/dorie/build-cmake/bin/dorie"]
\ No newline at end of file
......@@ -34,18 +34,13 @@ In the section 'Usage' you will find a list of possible commands. Note that inpu
## Docker Installation - Interactive Setup
This setup is intended for advanced users. You will gain access to the DORiE module outside the container, and be able to make changes to the source code.
We have prepared a [DORiE DUNE Environment Image on Dockerhub](https://hub.docker.com/r/dorie/dune-env/), which is a modified image of the Ubuntu OS that has all dependencies readily installed. The current version is 2.5 (referencing the DUNE module version 2.5).
Run a new container from this image by calling
We have prepared a [DORiE DUNE Environment Image on Dockerhub](https://hub.docker.com/r/dorie/dune-env/), which is a modified image of the Ubuntu OS that has all dependencies readily installed. The current version is 2.5.1 (referencing the DUNE module version 2.5). We will run a new container from this image and mount some local directory `<hostdir>/dorie` into it by calling
docker run -i -t dorie/dune-env:2.5 /bin/bash
docker run -v <hostdir>/dorie:/opt/dune/dorie -i -t dorie/dune-env:2.5.1 /bin/bash
Docker will automatically download the image if necessary. Use the `-v` option of the `run` command to mount a local directory into the container:
Docker will automatically download the image if necessary. Now you can access the content of the (still empty) folder of the virtual machine from your local `<hostdir>/dorie` directory. *Mounting directories is not possible after your container has been started!*
-v <hostdir/dorie>:/opt/dune/dorie
This way, you can access the content of the (still empty) folder of the virtual machine from your local `<hostdir>/dorie` directory. *Mounting directories is not possible after your container has been started!*
Next, use `git clone` to download the DORiE repository into the shared folder. Enter the container, and execute
Next, use `git clone` to download the DORiE repository into the shared (mounted) folder. Enter the container, and execute
dunecontrol --only=dorie all
......@@ -58,7 +53,7 @@ to build in parallel on `N` processes. Lastly, install the DORiE binaries by cal
dunecontrol --only=dorie make install
### Update DUNE
The DUNE modules in the repository might be outdated. You can update to the newest versions by calling
The DUNE modules (as well as DORiE itself) in the repository might be outdated. You can update to the newest versions by calling
dunecontrol update
......@@ -87,7 +82,7 @@ Depending on your system configuration, there will be more packages necessary to
| pip | 2.7 or 3.x |
| MPI | | Tested with OpenMPI
| SuperLU | 4.3 or 5.x |
| VirtualEnv | | Install via `pip` |
| VirtualEnv | | For Python 2 only. Install via `pip` |
| [dune-common](https://gitlab.dune-project.org/core/dune-common) | releases/2.5
| [dune-geometry](https://gitlab.dune-project.org/core/dune-geometry) | releases/2.5
| [dune-grid](https://gitlab.dune-project.org/core/dune-grid) | releases/2.5
......@@ -97,11 +92,19 @@ Depending on your system configuration, there will be more packages necessary to
| [dune-functions](https://gitlab.dune-project.org/staging/dune-functions) | releases/2.5
| [dune-typetree](https://gitlab.dune-project.org/staging/dune-typetree) | releases/2.5
| [dune-pdelab](https://gitlab.dune-project.org/pdelab/dune-pdelab) | releases/2.5
| [dune-testtools](https://gitlab.dune-project.org/quality/dune-testtools) | master
| [dune-randomfield](https://gitlab.dune-project.org/oklein/dune-randomfield) | master
| [dune-python](https://gitlab.dune-project.org/quality/dune-python) | releases/2.5
| [dune-testtools](https://gitlab.dune-project.org/quality/dune-testtools) | releases/2.5
If you also want to build the documentation, you will additionally need to install Doxygen, Sphinx and Breathe.
### Optional Packages
| Software | Version/Branch | Comments |
| ---------| -------------- | -------- |
| [doxygen](http://www.stack.nl/~dimitri/doxygen/) | | Builds documentation
| [Sphinx](http://www.sphinx-doc.org/en/stable/) | | Builds documentation
| [Breathe](https://github.com/michaeljones/breathe) | | Builds documentation
| [METIS](http://glaros.dtc.umn.edu/gkhome/views/metis) | 5 | For parallel runs
| [ParMETIS](http://glaros.dtc.umn.edu/gkhome/views/metis) | 4 | For parallel runs
### Step-by-step Instructions
These instructions are suitable for a clean **Ubuntu** or **Mac OS X** setup. The main difference between the two systems is the package manager. Debian-based systems have the APT manager already built in. On Mac, we recommend installing [Homebrew](http://brew.sh/). If you prefer to use [MacPorts](https://www.macports.org/), you need to check if some of the packages require different installation options than displayed here.
......@@ -111,55 +114,57 @@ These instructions are suitable for a clean **Ubuntu** or **Mac OS X** setup. Th
**Ubuntu:**
apt update
apt install autoconf bison cmake flex gcc-5 g++-5 gfortran-5 \
apt install cmake doxygen gcc-5 g++-5 gfortran-5 \
git libatlas-base-dev libfftw3-dev libfftw3-mpi-dev \
libfreetype6-dev libhdf5-mpi-dev libopenmpi-dev libpng-dev \
libsuperlu-dev libxft-dev python-dev python-pip python-sphinx \
python-breathe doxygen
libsuperlu-dev libxft-dev python3-dev python3-pip
**Mac OS X:**
brew update
brew install automake cmake doxygen gcc libtool libpng open-mpi \
brew install cmake doxygen gcc libpng open-mpi \
pkg-config python3 superlu
brew install hdf5 --with-mpi
brew install fftw --with-mpi
2. Install the necessary Python packages using `pip`:
1. The parallel linear solver of DORiE can make use of the ParMETIS package. If you want to run DORiE in parallel on multiple processes, additionally install METIS and ParMETIS:
**Ubuntu:**
python -m pip install virtualenv
apt install libmetis-dev libparmetis-dev
**Mac OS X:**
sudo -H python3 -m pip install virtualenv sphinx breathe
brew install metis parmetis
**Parallel runs without these two packages are possible but not supported!**
2. Install the necessary Python packages using `pip`:
pip3 install --upgrade pip
pip3 install sphinx breathe
3. **Mac OS X** only:
The Apple Clang compiler shipped with CMake is not suitable for compiling DUNE and UG. Before proceeding, call
The Apple Clang compiler shipped with CMake is not suitable for compiling DORiE. Before proceeding, call
export CC=gcc-6
export CXX=g++-6
export CC=gcc-7
export CXX=g++-7
to enfore the Homebrew'd GCC compiler. Note that this variable export only lasts for your current terminal session. Always make sure that the configuration tool actually finds GCC instead of the Apple Clang.
4. Clone the DUNE modules and DORiE into a suitable folder on your machine. Make sure that you check out the correct branches (see above). Enter the parent folder, and call
**Ubuntu:**
MAKE_FLAGS="-j <N>" ./dune-common/bin/dunecontrol all
**Mac OS X:**
CMAKE_FLAGS="-DDUNE_FORCE_PYTHON3=True" MAKE_FLAGS="-j <N>" ./dune-common/bin/dunecontrol all
CMAKE_FLAGS="-DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" MAKE_FLAGS="-j <N>" ./dune-common/bin/dunecontrol all
to build all DUNE modules in parallel on `N` processes. If you installed software into paths not appended to your `PATH` variable, you will have to add `CMAKE_FLAGS` to the call to make sure that CMake finds all packages. Alternatively, you can add a custom options file. See the [DUNE Installation Instructions](https://dune-project.org/doc/installation/) for details. CMake will throw an error if required packages are not found.
5. To install all DUNE packages into system locations (so you can call `dunecontrol` and `dorie` from anywhere), you can run
5. After a successful build you can call the `dorie` wrapper located in `dorie/build-cmake/bin` from anywhere on your machine, but it is more handy to add this location to your search path. You can add the directory to your `PATH` variable by calling
PATH=<path/to/>dorie/build-cmake/bin:$PATH
./dune-common/bin/dunecontrol make install
However, this will only last for your current terminal session. Another option is to add this path permanently in your shell configuration file.
which may require `sudo` rights on your machine. This action is **optional and not required to run DORiE**. If you choose not to install DORiE, make sure to append the location of `dunecontrol` (`dune-common/bin`) and `dorie` (`dorie/build-cmake/bin`) to your search path.
**Installing DUNE and DORiE via `make install` into your usual work environment is strongly discouraged!**
## Recommended Third-Party Software
......@@ -187,14 +192,20 @@ The documentation can be built after DORiE has been properly configured (i.e., b
dunecontrol --only=dorie make doc
or navigate to the `dorie/build-cmake` directory and call
make doc
The documentation files can now be found in the subfolder `dorie/build-cmake/doc`.
## Run, DORiE, Run!
During `make install`, DORiE installs a wrapper to access the functions and executables of DORiE from any location on your device. After a successful installation, you can call the wrapper by simply executing
If you made the DORiE wrapper directory available through your `PATH` variable, you can call it by simply executing
dorie <command>
If you did not run `dunecontrol make install`, you can find the wrapper in the `dorie/build-cmake/bin` folder of your installation.
You can always find the wrapper in the `dorie/build-cmake/bin` folder of your installation and call it directly with
<path/to/>dorie/build-cmake/bin/dorie <command>
To start your first simulation run, create a new directory and enter it. Place some exemplary configuration and boundary condition data files in there by calling
......
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import sys
......@@ -24,7 +24,7 @@ MPIEXEC_POSTFLAGS = "@MPIEXEC_POSTFLAGS@"
# set some paths
DORIE_EXECUTABLE = os.path.join(DORIEDIR, "dune/dorie/dorie")
PARAMETERDIR = os.path.join(DORIEDIR, "doc/default_files")
DORIE_PYTHON = os.path.join(DORIEDIR, "dune-env")
DORIE_PYTHON = os.path.join(DORIEDIR, "run-in-dune-env")
def MPIRUN(nproc,exe,*args,**kwargs):
mpi_flags = kwargs.get("mpi_flags") or []
return [k for k in [MPIEXEC,MPIEXEC_NUMPROC_FLAG,str(nproc)] \
......
# File for module specific CMake tests.
# find all required packages
FIND_PACKAGE (HDF5 REQUIRED COMPONENTS C)
if(HDF5_IS_PARALLEL)
message(STATUS "Parallel HDF5 library found")
add_definitions(-DHDF5_PARALLEL)
FIND_PACKAGE (HDF5 REQUIRED)
if(NOT HDF5_IS_PARALLEL)
message(SEND_ERROR "Parallel HDF5 must be installed!")
endif()
add_definitions(-DHDF5_PARALLEL)
FIND_PACKAGE (FFTW REQUIRED)
FIND_PACKAGE (SuperLU REQUIRED)
FIND_PACKAGE (MPI REQUIRED)
if(NOT dune-uggrid_FOUND)
MESSAGE(STATUS "Module dune-uggrid was not found. Falling back to external UG grid manager")
FIND_PACKAGE(UG REQUIRED)
endif()
FIND_PACKAGE (METIS)
FIND_PACKAGE (ParMETIS)
......
function(scrape_parameters SOURCE_DIR XML_FILE CSS OUTPUT RESULT_NAME)
message(STATUS "Running parameter scraper on sources ${SOURCE_DIR}")
if(DEPLOY_SPHINX_SOURCE_URL)
execute_process(COMMAND ${CMAKE_BINARY_DIR}/dune-env scrape_folder.py --source ${SOURCE_DIR}
execute_process(COMMAND ${CMAKE_BINARY_DIR}/run-in-dune-env scrape_folder.py --source ${SOURCE_DIR}
--xml ${XML_FILE} --out ${OUTPUT} --css ${CSS}
--source_url ${DEPLOY_SPHINX_SOURCE_URL}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE RETURN_CODE)
else()
execute_process(COMMAND ${CMAKE_BINARY_DIR}/dune-env scrape_folder.py --source ${SOURCE_DIR}
execute_process(COMMAND ${CMAKE_BINARY_DIR}/run-in-dune-env scrape_folder.py --source ${SOURCE_DIR}
--xml ${XML_FILE} --out ${OUTPUT} --css ${CSS}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE RETURN_CODE)
......@@ -18,11 +18,11 @@ endfunction()
file(COPY ${CMAKE_CURRENT_LIST_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/..)
scrape_parameters(${PROJECT_SOURCE_DIR}/dune/dorie-rfg ${CMAKE_CURRENT_SOURCE_DIR}/field-parameters.xml ${CMAKE_CURRENT_SOURCE_DIR}/parameters.css "parfield.ini;field-parameters.html;field-parameters.rst" FIELDPARSCRAPE_RETURN)
if (${FIELDPARSCRAPE_RETURN} GREATER 0)
if (NOT ${FIELDPARSCRAPE_RETURN} EQUAL 0)
message(FATAL_ERROR "Parameter scraper failed. DORiE can not be built.")
endif()
scrape_parameters(${PROJECT_SOURCE_DIR}/dune/dorie ${CMAKE_CURRENT_SOURCE_DIR}/parameters.xml ${CMAKE_CURRENT_SOURCE_DIR}/parameters.css "config.ini;parameters.html;parameters.rst" PARSCRAPE_RETURN)
if (${PARSCRAPE_RETURN} GREATER 0)
if (NOT ${PARSCRAPE_RETURN} EQUAL 0)
message(FATAL_ERROR "Parameter scraper failed. DORiE can not be built.")
endif()
......@@ -7,5 +7,5 @@ Module: dorie
Version: 0.9
Maintainer: dorieteam@iup.uni-heidelberg.de
#depending on
Depends: dune-python dune-pdelab dune-randomfield
Suggests: dune-testtools dune-uggrid
Depends: dune-pdelab dune-uggrid dune-randomfield
Suggests: dune-testtools
\ No newline at end of file
......@@ -46,8 +46,10 @@
#include <dune/pdelab/common/function.hh>
#include <dune/pdelab/constraints/p0.hh>
#include <dune/pdelab/constraints/p0ghost.hh>
#include <dune/pdelab/constraints/conforming.hh>
#include <dune/pdelab/constraints/common/constraints.hh>
#include <dune/pdelab/finiteelementmap/qkdg.hh>
#include <dune/pdelab/finiteelementmap/p0fem.hh>
#include <dune/pdelab/finiteelementmap/pkfem.hh>
#include <dune/pdelab/gridfunctionspace/gridfunctionspace.hh>
#include <dune/pdelab/gridfunctionspace/localfunctionspace.hh>
......
......@@ -11,17 +11,18 @@ Simulation<Traits>::Simulation (Dune::MPIHelper& _helper, std::shared_ptr<Grid>
verbose(inifile.get<int>("output.verbose"))
{
Dune::Timer timer;
const int verbose_low = helper.rank() == 0 ? verbose : 0;
// --- Grid Function Space ---
gfs = std::make_unique<GFS>(GFSHelper::create(gv));
gfs->name("matric_head");
cc = std::make_unique<CC>();
Dune::PDELab::constraints(*gfs,*cc,true);
Dune::PDELab::constraints(*gfs,*cc,false);
// --- Parameter class ---
InterpolatorFactory intfac(inifile,helper,verbose);
InterpolatorFactory intfac(inifile,helper,verbose_low);
interp = intfac.create();
ParameterizationFactory pfac(inifile,helper,*interp,verbose);
ParameterizationFactory pfac(inifile,helper,*interp,verbose_low);
param = pfac.create();
// --- Operator Helper Classes ---
......@@ -63,20 +64,44 @@ void Simulation<Traits>::operator_setup ()
go1 = std::make_unique<GO1>(*gfs,*cc,*gfs,*cc,*tlop,mbe_tlop);
igo = std::make_unique<IGO>(*go0,*go1);
// --- Solvers ---
ls = std::make_unique<LS>(5000,0);
pdesolver = std::make_unique<PDESOLVER>(*igo,*ls);
pdesolver->setParameters(inifile.sub("NewtonParameters"));
pdesolver->setVerbosityLevel(verbose);
// build parallel solvers
if (helper.size() > 1) {
// --- Solvers ---
lsgfs = std::make_unique<LSGFS>(LSGFSHelper::create(gv));
lscc = std::make_unique<LSCC>();
ls_par = std::make_unique<LSPar>(*igo,*cc,*lsgfs,*lscc,1000,0,true,true);
pdesolver_par = std::make_unique<PDESOLVERPar>(*igo,*ls_par);
pdesolver_par->setParameters(inifile.sub("NewtonParameters"));
pdesolver_par->setVerbosityLevel(verbose);
// --- Time Step Operators ---
Dune::PDELab::OneStepMethodResult osm_result;
if(osm_par){
osm_result = osm_par->result(); // cache old result
}
osm_par = std::make_unique<OSMPar>(alex2,*igo,*pdesolver_par);
osm_par->setResult(osm_result);
osm_par->setVerbosityLevel(verbose+1);
}
// build sequential solvers
else {
ls_seq = std::make_unique<LSSeq>(5000,0);
pdesolver_seq = std::make_unique<PDESOLVERSeq>(*igo,*ls_seq);
pdesolver_seq->setParameters(inifile.sub("NewtonParameters"));
pdesolver_seq->setVerbosityLevel(verbose);
// --- Time Step Operators ---
Dune::PDELab::OneStepMethodResult osm_result;
if(osm){
osm_result = osm->result(); // cache old result
// --- Time Step Operators ---
Dune::PDELab::OneStepMethodResult osm_result;
if(osm_seq){
osm_result = osm_seq->result(); // cache old result
}
osm_seq = std::make_unique<OSMSeq>(alex2,*igo,*pdesolver_seq);
osm_seq->setResult(osm_result);
osm_seq->setVerbosityLevel(verbose+1);
}
osm = std::make_unique<OSM>(alex2,*igo,*pdesolver);
osm->setResult(osm_result);
osm->setVerbosityLevel(verbose+1);
gfs->update();
......@@ -102,11 +127,22 @@ bool Simulation<Traits>::compute_time_step ()
{
const RF t = controller->getTime();
const RF dt = controller->getDT();
pdesolver->setMaxIterations(controller->getIterations());
bool exception = false;
try
{
osm->apply(t,dt,*uold,*unew);
// solve in parallel
if (helper.size() > 1) {
pdesolver_par->setMaxIterations(controller->getIterations());
dwarn.push(false);
osm_par->apply(t,dt,*uold,*unew);
dwarn.pop();
}
// solve sequentially
else {
pdesolver_seq->setMaxIterations(controller->getIterations());
osm_seq->apply(t,dt,*uold,*unew);
}
*uold = *unew;
}
catch (Dune::PDELab::NewtonError &e){
......
......@@ -23,6 +23,14 @@ protected:
/// GFS Constraints Container
using CC = typename GFSHelper::CC;
/// LSGFS Helper
using LSGFSHelper = Dune::Dorie::LinearSolverGridFunctionSpaceHelper<GV,RF,Traits::GridGeometryType>;
/// Linear solver GFS
using LSGFS = typename LSGFSHelper::Type;
/// LSGFS Constraints Container
using LSCC = typename LSGFSHelper::CC;
// -- DORiE Class Definitions -- //
/// Parameter Interpolator
using Interpolator = Dune::Dorie::InterpolatorBase<Traits,Traits::dim>;
......@@ -56,14 +64,18 @@ protected:
using IGO = Dune::PDELab::OneStepGridOperator<GO0,GO1>;
/// Solution vector type
using U = typename IGO::Traits::Domain;
/// Linear solver type
using LS = Dune::PDELab::ISTLBackend_SEQ_SuperLU;
/// Non-linear solver type
using PDESOLVER = Dune::PDELab::Newton<IGO,LS,U>;
/// Linear solver types
using LSSeq = Dune::PDELab::ISTLBackend_SEQ_SuperLU;
using LSPar = Dune::PDELab::ISTLBackend_OVLP_AMG_4_DG<IGO,CC,LSGFS,LSCC,
Dune::PDELab::CG2DGProlongation,Dune::SeqSSOR,Dune::BiCGSTABSolver>;
/// Non-linear solver types
using PDESOLVERSeq = Dune::PDELab::Newton<IGO,LSSeq,U>;
using PDESOLVERPar = Dune::PDELab::Newton<IGO,LSPar,U>;
/// Time stepping scheme
using TimeStepScheme = Dune::PDELab::Alexander2Parameter<RF>;
/// Method computing the time step
using OSM = Dune::PDELab::OneStepMethod<RF,IGO,PDESOLVER,U,U>;
/// Methods computing the time step
using OSMSeq = Dune::PDELab::OneStepMethod<RF,IGO,PDESOLVERSeq,U,U>;
using OSMPar = Dune::PDELab::OneStepMethod<RF,IGO,PDESOLVERPar,U,U>;
// -- Utility Class Definitions -- //
/// VTK Output writer base class
......@@ -82,6 +94,9 @@ protected:
std::unique_ptr<GFS> gfs;
std::unique_ptr<CC> cc;
std::unique_ptr<LSGFS> lsgfs;
std::unique_ptr<LSCC> lscc;
std::unique_ptr<Interpolator> interp;
std::unique_ptr<Parameters> param;
std::unique_ptr<FlowBoundary> fboundary;
......@@ -96,9 +111,12 @@ protected:
std::unique_ptr<GO0> go0;
std::unique_ptr<GO1> go1;
std::unique_ptr<IGO> igo;
std::unique_ptr<LS> ls;
std::unique_ptr<PDESOLVER> pdesolver;
std::unique_ptr<OSM> osm;
std::unique_ptr<LSSeq> ls_seq;
std::unique_ptr<LSPar> ls_par;
std::unique_ptr<PDESOLVERSeq> pdesolver_seq;
std::unique_ptr<PDESOLVERPar> pdesolver_par;
std::unique_ptr<OSMSeq> osm_seq;
std::unique_ptr<OSMPar> osm_par;
TimeStepScheme alex2;
std::unique_ptr<U> uold;
......
......@@ -31,6 +31,77 @@ R estimate_mbe_entries (const int dim, const Dune::GeometryType::BasicType geo)
return 1;
}
/// Provide types and construction of the GFS for the linear solver
template<typename GridView, typename RF, Dune::GeometryType::BasicType GeometryType>
struct LinearSolverGridFunctionSpaceHelper
{};
/// Provide types and construction of the GridFunctionSpace
template<typename GridView, typename RF>
struct LinearSolverGridFunctionSpaceHelper<GridView,RF,Dune::GeometryType::BasicType::simplex>
{
private:
static constexpr int dim = GridView::dimension;
using DF = typename GridView::Grid::ctype;
public:
/// Entity set of the GFS
using ES = Dune::PDELab::OverlappingEntitySet<GridView>;
/// FiniteElementMap type of GFS
using FEM = typename Dune::PDELab::P0LocalFiniteElementMap<DF,RF,dim>;
/// Constraints type of the GFS
using CON = Dune::PDELab::P0ParallelConstraints;
/// GFS type
using Type = typename Dune::PDELab::GridFunctionSpace<ES,FEM,CON,
Dune::PDELab::istl::VectorBackend<Dune::PDELab::istl::Blocking::fixed>>;
/// GFS Constraints Container type
using CC = typename Type::template ConstraintsContainer<RF>::Type;
/// create GFS from GridView
static Type create (const GridView& gv)
{
ES es(gv);
Dune::GeometryType geo;
geo.makeSimplex(dim);
auto fem = std::make_shared<FEM>(geo);
auto con = std::make_shared<CON>();
return Type(es,fem,con);
}
};
/// Provide types and construction of the GridFunctionSpace
template<typename GridView, typename RF>
struct LinearSolverGridFunctionSpaceHelper<GridView,RF,Dune::GeometryType::BasicType::cube>
{
private:
static constexpr int dim = GridView::dimension;
using DF = typename GridView::Grid::ctype;
public:
/// Entity set of the GFS
using ES = Dune::PDELab::OverlappingEntitySet<GridView>;
/// FiniteElementMap type of GFS
using FEM = typename Dune::PDELab::P0LocalFiniteElementMap<DF,RF,dim>;
/// Constraints type of the GFS
using CON = Dune::PDELab::P0ParallelConstraints;
/// GFS type
using Type = typename Dune::PDELab::GridFunctionSpace<ES,FEM,CON,
Dune::PDELab::istl::VectorBackend<Dune::PDELab::istl::Blocking::fixed> >;
/// GFS Constraints Container type
using CC = typename Type::template ConstraintsContainer<RF>::Type;
/// create GFS from GridView
static Type create (const GridView& gv)
{
ES es(gv);
Dune::GeometryType geo;
geo.makeCube(dim);
auto fem = std::make_shared<FEM>(geo);
auto con = std::make_shared<CON>();
return Type(es,fem,con);
}
};
/// Provide types and construction of the GridFunctionSpace. Has to be specialized.
template<typename GridView, typename RF, int order, Dune::GeometryType::BasicType GeometryType>
struct GridFunctionSpaceHelper
......@@ -46,21 +117,25 @@ private:
using DF = typename GridView::Grid::ctype;
public:
/// Entity set of the GFS
using ES = Dune::PDELab::OverlappingEntitySet<GridView>;
/// FiniteElementMap type of GFS
using FEM = typename Dune::PDELab::PkLocalFiniteElementMap<GridView,DF,RF,order>;
using FEM = typename Dune::PDELab::PkLocalFiniteElementMap<ES,DF,RF,order>;
/// Constraints type of the GFS
using CON = Dune::PDELab::P0ParallelConstraints;
/// GFS type
using Type = typename Dune::PDELab::GridFunctionSpace<GridView,FEM,
Dune::PDELab::P0ParallelConstraints,
Dune::PDELab::istl::VectorBackend<
Dune::PDELab::istl::Blocking::fixed> >;
using Type = typename Dune::PDELab::GridFunctionSpace<ES,FEM,CON,
Dune::PDELab::istl::VectorBackend<Dune::PDELab::istl::Blocking::fixed>>;
/// GFS Constraints Container type
using CC = typename Type::template ConstraintsContainer<RF>::Type;
/// create GFS from GridView
static Type create (const GridView& gv)
{
auto fem = std::make_shared<FEM>(gv);
return Type(gv,fem);
ES es(gv);
auto fem = std::make_shared<FEM>(es);
auto con = std::make_shared<CON>();
return Type(es,fem,con);
}
};
......@@ -73,21 +148,25 @@ private:
using DF = typename GridView::Grid::ctype;
public:
/// Entity set of the GFS
using ES = Dune::PDELab::OverlappingEntitySet<GridView>;
/// FiniteElementMap type of GFS
using FEM = typename Dune::PDELab::QkDGLocalFiniteElementMap<DF,RF,order,dim>;
/// Constraints type of the GFS
using CON = Dune::PDELab::P0ParallelConstraints;
/// GFS type
using Type = typename Dune::PDELab::GridFunctionSpace<GridView,FEM,
Dune::PDELab::P0ParallelGhostConstraints,
Dune::PDELab::istl::VectorBackend<
Dune::PDELab::istl::Blocking::fixed> >;
using Type = typename Dune::PDELab::GridFunctionSpace<ES,FEM,CON,
Dune::PDELab::istl::VectorBackend<Dune::PDELab::istl::Blocking::fixed> >;
/// GFS Constraints Container type
using CC = typename Type::template ConstraintsContainer<RF>::Type;
/// create GFS from GridView
static Type create (const GridView& gv)