Commit 8305b6f5 authored by Praetorius, Simon's avatar Praetorius, Simon

repaired eigen backend and added dune install script

parent 8185137f
Pipeline #1843 passed with stage
in 26 minutes and 1 second
cmake_minimum_required(VERSION 3.1)
project(amdis CXX VERSION 0.2)
project(amdis LANGUAGES CXX VERSION 0.2)
#find dune-common and set the module path
find_package(dune-common REQUIRED)
......@@ -26,7 +26,9 @@ target_link_libraries(amdis fmt)
option(ENABLE_ALL_WARNINGS "enable all meaningful warnings" OFF)
if (ENABLE_ALL_WARNINGS)
target_compile_options(amdis PUBLIC "-Wall" "-Wextra" "-pedantic" "-Wnon-virtual-dtor" "-Wold-style-cast" "-Wcast-align" "-Woverloaded-virtual" "-Wpedantic" "-Wconversion")
target_compile_options(amdis PUBLIC "-Wall" "-Wextra" "-pedantic" "-Wnon-virtual-dtor"
"-Wold-style-cast" "-Wcast-align" "-Woverloaded-virtual"
"-Wpedantic" "-Wconversion")
endif (ENABLE_ALL_WARNINGS)
# finalize the dune project, e.g. generating config.h etc.
......
......@@ -25,7 +25,14 @@ The `dunecontrol` script searches for the required
(See the file `dune.module` for an up-to-date list of dependencies). The dune modules
can be obtained from https://gitlab.dune-project.org and need to be found in a
subdirectory of `DUNE_CONTROL_PATH`. See also https://dune-project.org/doc/installation
for details about the installation of dune modules.
for details about the installation of dune modules. You can use the script
```
bin/install_all_dune_modules.sh DOWNLOAD_DIR
```
to clone all dune repositories into `DOWNLOAD_DIR` and provide a simple way using `dunecontrol`
to install all of them at once.
Additionally the following optional libraries can be used:
- [MTL4](https://gitlab.math.tu-dresden.de/spraetor/mtl4) (use this fork to get up-to-date changes)
......
#!/usr/bin/env bash
if [ $# -lt 1 ]; then
echo "usage: $0 DOWNLOAD_DIR"
exit 1
fi
DOWNLOAD_DIR="$1"
mkdir -p ${DOWNLOAD_DIR}/dune
cd ${DOWNLOAD_DIR}/dune
CORE_MODULES=("dune-common" "dune-geometry" "dune-grid" "dune-istl" "dune-localfunctions")
STAGING_MODULES=("dune-functions" "dune-typetree" "dune-uggrid")
EXTENSIONS_MODULES=("dune-alugrid" "dune-spgrid" "dune-foamgrid")
for MOD in ${CORE_MODULES[*]}; do
git clone https://gitlab.dune-project.org/core/${MOD}.git --branch releases/2.6 --single-branch
done
for MOD in ${STAGING_MODULES[*]}; do
git clone https://gitlab.dune-project.org/staging/${MOD}.git --branch releases/2.6 --single-branch
done
for MOD in ${EXTENSIONS_MODULES[*]}; do
git clone https://gitlab.dune-project.org/extensions/${MOD}.git --branch releases/2.6 --single-branch
done
echo ""
echo "=============================================================="
echo "To build all dune modules run the commands... "
echo " DUNE_CONTROL_PATH=${DOWNLOAD_DIR}/dune dunecontrol configure"
echo " DUNE_CONTROL_PATH=${DOWNLOAD_DIR}/dune dunecontrol make -j4 "
echo "=============================================================="
\ No newline at end of file
......@@ -72,7 +72,7 @@ namespace AMDiS
static void init(std::string const& prefix, Eigen::UmfPackLU<M>& solver)
{
DUNE_UNUSED auto& control = solver.umfpackControl();
// here, umfpack parameters could be initialized
// TODO: initialized umfpack parameters
}
};
#endif
......
......@@ -30,7 +30,7 @@ namespace AMDiS
using SolverBase = LinearSolverInterface<Matrix, VectorX, VectorB>;
using Scalar = typename Matrix::Scalar;
std::unique_ptr<SolverBase> createWithString(std::string const& prefix) override
std::unique_ptr<SolverBase> createWithString(std::string prefix) override
{
// get creator string for preconditioner
std::string precon = "no";
......@@ -40,12 +40,12 @@ namespace AMDiS
precon == "jacobi")
{
auto creator = SolverCreator<Eigen::DiagonalPreconditioner<Scalar>>{};
return creator.create(prefix);
return creator.createWithString(prefix);
}
else if (precon == "ilu")
{
auto creator = SolverCreator<Eigen::IncompleteLUT<Scalar>>{};
return creator.create(prefix);
return creator.createWithString(prefix);
}
else if (precon == "ic")
{
......@@ -53,7 +53,7 @@ namespace AMDiS
}
else {
auto creator = SolverCreator<Eigen::IdentityPreconditioner>{};
return creator.create(prefix);
return creator.createWithString(prefix);
}
}
......@@ -62,18 +62,18 @@ namespace AMDiS
using IncompleteCholesky =
SolverCreator<Eigen::IncompleteCholesky<Scalar, Eigen::Lower|Eigen::Upper, Ordering>>;
std::unique_ptr<SolverBase> createIncompleteCholesky(std::string const& prefix) const
std::unique_ptr<SolverBase> createIncompleteCholesky(std::string prefix) const
{
std::string ordering = "amd";
Parameters::get(prefix + "->precon->ordering", ordering);
if (ordering == "amd") {
using AMD = Eigen::AMDOrdering<typename Matrix::StorageIndex>;
return IncompleteCholesky<AMD>{}.create(prefix);
return IncompleteCholesky<AMD>{}.createWithString(prefix);
}
else {
using NATURAL = Eigen::NaturalOrdering<typename Matrix::StorageIndex>;
return IncompleteCholesky<NATURAL>{}.create(prefix);
return IncompleteCholesky<NATURAL>{}.createWithString(prefix);
}
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment