Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
amdis
amdis-core
Commits
4e161587
Commit
4e161587
authored
Dec 22, 2020
by
Praetorius, Simon
Browse files
Merge branch 'feature/test_backends' into 'master'
Test all backends in gitlabci Closes
#16
See merge request
!256
parents
f6fb3225
a896e522
Changes
6
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
4e161587
...
...
@@ -15,18 +15,46 @@ dune-2.7:
-
duneci-standard-test
-
dunecontrol --current make -j2 examples
dune-git
:
image
:
registry.dune-project.org/docker/ci/dune:git-debian-10-gcc-8-17
dune-git-clang
:
image
:
registry.dune-project.org/docker/ci/dune:git-ubuntu-18.04-clang-6-17
script
:
-
duneci-standard-test
-
dunecontrol --current make -j2 examples
dune-git-istl-gcc
:
image
:
registry.dune-project.org/docker/ci/dune-pdelab-deps:git-debian-10-gcc-8-17
variables
:
DUNECI_CMAKE_FLAGS
:
"
-DBACKEND=ISTL"
DUNECI_CXXFLAGS
:
"
-Wno-deprecated-declarations
-Wno-cpp"
script
:
-
duneci-standard-test
-
dunecontrol --current make -j2 examples
dune-git-petsc-gcc
:
image
:
registry.dune-project.org/docker/ci/dune-pdelab-deps:git-debian-10-gcc-8-17
variables
:
DUNECI_CMAKE_FLAGS
:
"
-DBACKEND=PETSC"
DUNECI_CXXFLAGS
:
"
-Wno-deprecated-declarations
-Wno-cpp"
script
:
-
duneci-standard-test
-
dunecontrol --current make -j2 examples
dune-git-eigen-gcc
:
image
:
registry.dune-project.org/docker/ci/dune-pdelab-deps:git-debian-10-gcc-8-17
variables
:
DUNECI_CMAKE_FLAGS
:
"
-DBACKEND=EIGEN"
DUNECI_CXXFLAGS
:
"
-Wno-deprecated-declarations
-Wno-cpp"
script
:
-
duneci-standard-test
-
dunecontrol --current make -j2 examples
dune-git-
full
:
dune-git-
mtl-gcc
:
image
:
registry.dune-project.org/docker/ci/dune-pdelab-deps:git-debian-10-gcc-8-17
variables
:
DUNECI_CMAKE_FLAGS
:
"
-DBACKEND=MTL
-DMTL_INCLUDE_DIR=/duneci/libs/mtl4"
DUNECI_CXXFLAGS
:
"
-Wno-deprecated-declarations
-Wno-cpp"
before_script
:
-
git clone https://gitlab.mn.tu-dresden.de/spraetor/mtl4.git /duneci/libs/mtl4
script
:
-
duneci-standard-test
-
dunecontrol --current make -j2 examples
CMakeLists.txt
View file @
4e161587
...
...
@@ -26,7 +26,6 @@ dune_target_link_libraries(amdis fmt)
if
(
MTL_FOUND
)
dune_target_link_libraries
(
amdis MTL::MTL
)
target_compile_definitions
(
amdis PUBLIC ENABLE_MTL
)
endif
(
MTL_FOUND
)
if
(
HYPRE_FOUND
)
...
...
@@ -36,14 +35,13 @@ endif(HYPRE_FOUND)
if
(
EIGEN3_FOUND
)
dune_target_link_libraries
(
amdis Eigen3::Eigen
)
target_compile_definitions
(
amdis PUBLIC ENABLE_EIGEN
)
endif
(
EIGEN3_FOUND
)
if
(
PETSc_FOUND
)
dune_target_link_libraries
(
amdis PETSc::PETSc
)
target_compile_definitions
(
amdis PUBLIC ENABLE_PETSC
)
endif
(
PETSc_FOUND
)
option
(
ENABLE_ALL_WARNINGS
"enable all meaningful warnings"
OFF
)
if
(
ENABLE_ALL_WARNINGS
)
target_compile_options
(
amdis PUBLIC
"-Wall"
"-Wpedantic"
...
...
amdis/LinearAlgebra.hpp
View file @
4e161587
#pragma once
#if AMDIS_
HAS
_MTL
#if AMDIS_
BACKEND == AMDIS_BACKEND
_MTL
#include
<amdis/linearalgebra/mtl/Constraints.hpp>
#include
<amdis/linearalgebra/mtl/ITL_Solver.hpp>
...
...
@@ -9,7 +9,7 @@
#include
<amdis/linearalgebra/mtl/MatrixBackend.hpp>
#include
<amdis/linearalgebra/mtl/VectorBackend.hpp>
#elif AMDIS_
HAS
_EIGEN
#elif AMDIS_
BACKEND == AMDIS_BACKEND
_EIGEN
#include
<amdis/linearalgebra/eigen/Constraints.hpp>
#include
<amdis/linearalgebra/eigen/SolverCreator.hpp>
...
...
@@ -17,7 +17,7 @@
#include
<amdis/linearalgebra/eigen/MatrixBackend.hpp>
#include
<amdis/linearalgebra/eigen/VectorBackend.hpp>
#elif AMDIS_
HAS
_PETSC
#elif AMDIS_
BACKEND == AMDIS_BACKEND
_PETSC
#include
<amdis/linearalgebra/petsc/Constraints.hpp>
#include
<amdis/linearalgebra/petsc/SolverCreator.hpp>
...
...
@@ -25,7 +25,7 @@
#include
<amdis/linearalgebra/petsc/MatrixBackend.hpp>
#include
<amdis/linearalgebra/petsc/VectorBackend.hpp>
#el
se //
ISTL
#el
if AMDIS_BACKEND == AMDIS_BACKEND_
ISTL
#include
<amdis/linearalgebra/istl/Constraints.hpp>
#include
<amdis/linearalgebra/istl/ISTLSolver.hpp>
...
...
cmake/modules/AmdisMacros.cmake
View file @
4e161587
...
...
@@ -9,12 +9,19 @@ endif ()
if
(
NOT BACKEND
)
set
(
BACKEND
"ISTL"
CACHE STRING
"LinearAlgebra backend. One of MTL, EIGEN, PETSC, ISTL"
)
set_property
(
CACHE BACKEND PROPERTY STRINGS
"MTL"
"EIGEN"
"
ISTL"
"PETSC
"
)
set_property
(
CACHE BACKEND PROPERTY STRINGS
"MTL"
"EIGEN"
"
PETSC"
"ISTL
"
)
endif
(
NOT BACKEND
)
if
(
BACKEND STREQUAL
"MTL"
OR BACKEND STREQUAL
"MTL4"
)
if
(
BACKEND STREQUAL
"ISTL"
)
set
(
AMDIS_BACKEND 1
)
if
(
NOT dune-istl_FOUND
)
message
(
FATAL_ERROR
"Need dune-istl for backend ISTL. Either install the dune-istl module, or change the BACKEND!"
)
endif
()
elseif
(
BACKEND STREQUAL
"MTL"
OR BACKEND STREQUAL
"MTL4"
)
find_package
(
MTL REQUIRED
)
set
(
AMDIS_HAS_MTL TRUE
)
set
(
AMDIS_BACKEND 2
)
find_package
(
HYPRE
)
set
(
AMDIS_HAS_HYPRE
${
HYPRE_FOUND
}
)
...
...
@@ -22,16 +29,14 @@ if (BACKEND STREQUAL "MTL" OR BACKEND STREQUAL "MTL4")
elseif
(
BACKEND STREQUAL
"EIGEN"
OR BACKEND STREQUAL
"EIGEN3"
)
find_package
(
Eigen3 REQUIRED 3.3.5
)
set
(
AMDIS_HAS_EIGEN TRUE
)
set
(
AMDIS_BACKEND 3
)
message
(
STATUS
" Found Eigen3, version:
${
Eigen3_VERSION
}
"
)
elseif
(
BACKEND STREQUAL
"PETSC"
)
find_package
(
PETSc REQUIRED
)
set
(
AMDIS_HAS_PETSC TRUE
)
set
(
AMDIS_BACKEND 4
)
elseif
(
BACKEND STREQUAL
"ISTL"
)
if
(
NOT dune-istl_FOUND
)
message
(
FATAL_ERROR
"Need dune-istl, MTL, PETSc, or Eigen3 as linear algebra backend. Change flag BACKEND!"
)
endif
()
else
()
message
(
FATAL_ERROR
"BACKEND must be one of MTL, EIGEN, PETSC, ISTL"
)
message
(
FATAL_ERROR
"BACKEND must be one of MTL, EIGEN, PETSC, ISTL
, ISTL_BLOCKED
"
)
endif
()
config.h.cmake
View file @
4e161587
...
...
@@ -52,6 +52,14 @@
/* Define to true if the PETSc library is available */
#cmakedefine AMDIS_HAS_PETSC 1
#define AMDIS_BACKEND_ISTL 1
#define AMDIS_BACKEND_MTL 2
#define AMDIS_BACKEND_EIGEN 3
#define AMDIS_BACKEND_PETSC 4
/* Define one of the IDs defined above representing the AMDiS backend*/
#define AMDIS_BACKEND @AMDIS_BACKEND@
/* some detected compiler features may be used in AMDiS */
#cmakedefine AMDIS_HAS_EXPANSION_STATEMENTS 1
...
...
test/DiscreteFunctionTest.cpp
View file @
4e161587
...
...
@@ -299,6 +299,7 @@ void test2(Grid& grid, BasisFactory&& basis)
template
<
class
GridView
>
void
test3
(
GridView
const
&
gridView
)
{
#if AMDIS_BACKEND == AMDIS_BACKEND_ISTL
using
namespace
Dune
::
Functions
::
BasisFactory
;
auto
blockedBasis
=
makeBasis
(
gridView
,
power
<
2
>
(
lagrange
<
2
>
()));
...
...
@@ -315,6 +316,7 @@ void test3(GridView const& gridView)
ISTLBlockVector
<
double
>
vec4
(
flatBasis
);
DiscreteFunction
u4
{
vec4
,
flatBasis
};
#endif
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment