Skip to content
Snippets Groups Projects
Commit 9fe0ce5b authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'issue/fix-tests' into 'master'

Fix some tests due to changes in dune

See merge request amdis/amdis!189
parents 7cd71b46 fe98e00a
Branches
Tags
No related merge requests found
......@@ -47,11 +47,7 @@ if (PETSc_FOUND)
target_link_libraries(amdis PUBLIC PETSc::PETSc)
endif (PETSc_FOUND)
if (NOT EIGEN3_FOUND)
# do not activate all packages by default in the Eigen backend
add_dune_all_flags(amdis)
endif()
add_dune_all_flags(amdis)
if (ENABLE_ALL_WARNINGS)
target_compile_options(amdis PUBLIC "-Wall" "-Wpedantic"
......
......@@ -127,6 +127,14 @@ namespace AMDiS
, container_(&container)
{}
template <class G, class T,
std::enable_if_t<std::is_same_v<typename G::LeafGridView,GridView>, int> = 0,
std::enable_if_t<std::is_same_v<typename ElementVector<G,T>::Data, Container>, int> = 0>
ElementGridFunction(ElementVector<G,T> const& elementVector)
: entitySet_(elementVector.gridView())
, container_(&elementVector.data())
{}
/// Return the constant `value_`
Range operator()(Domain const& /*x*/) const
{
......@@ -150,9 +158,14 @@ namespace AMDiS
Container const* container_;
};
// deduction guide
template <class G, class T>
ElementGridFunction(ElementVector<G,T> const&)
-> ElementGridFunction<typename G::LeafGridView, typename ElementVector<G,T>::Data>;
/// A Generator for an \ref ElementGridFunction
template <class G, class T>
auto valueOf(ElementGridFunction<G,T> const& ev)
auto valueOf(ElementVector<G,T> const& ev)
{
return ElementGridFunction{ev.gridView(), ev.data()};
}
......
......@@ -3,10 +3,16 @@
#include <memory>
#include <Eigen/IterativeLinearSolvers>
#if HAVE_METIS && !HAVE_SCOTCH_METIS
#include <Eigen/MetisSupport>
#endif
#include <Eigen/SparseLU>
#if HAVE_SUPERLU
#include <Eigen/SuperLUSupport>
#endif
#if HAVE_SUITESPARSE_UMFPACK
#include <Eigen/UmfPackSupport>
#endif
#include <unsupported/Eigen/IterativeSolvers>
#include <amdis/CreatorMap.hpp>
......
......@@ -63,6 +63,7 @@ void configKSP(KSP ksp, std::string prefix, bool initPC)
PC pc;
KSPGetPC(ksp, &pc);
PETSc::configPC(pc, prefix + "->pc");
PCSetUp(pc);
}
}
......@@ -76,7 +77,7 @@ void configDirectSolver(KSP ksp, std::string prefix)
PC pc;
KSPGetPC(ksp, &pc);
PCSetType(pc, PCLU);
PCSetUp(pc);
auto matSolverType = Parameters::get<std::string>(prefix + "->mat solver");
if (matSolverType)
PETSc::PCFactorSetMatSolverType(pc, matSolverType.value().c_str());
......@@ -90,6 +91,8 @@ void configDirectSolver(KSP ksp, std::string prefix)
else if (std::strcmp(type, MATAIJ) == 0)
PETSc::PCFactorSetMatSolverType(pc, MATSOLVERMUMPS);
}
PCSetUp(pc);
}
......@@ -102,7 +105,6 @@ void configPC(PC pc, std::string prefix)
if (pcType) {
pcTypeStr = pcType.value();
PCSetType(pc, pcTypeStr.c_str());
PCSetUp(pc);
}
if (pcTypeStr == "lu") {
......
......@@ -51,6 +51,8 @@ macro(pkg_config_link_libraries _prefix _output)
find_library(pkgcfg_lib_${_prefix}_${_pkg_search}
NAMES ${_pkg_search}
${_find_opts})
list(APPEND ${_output} "${pkgcfg_lib_${_prefix}_${_pkg_search}}")
if(pkgcfg_lib_${_prefix}_${_pkg_search})
list(APPEND ${_output} "${pkgcfg_lib_${_prefix}_${_pkg_search}}")
endif()
endforeach()
endmacro(pkg_config_link_libraries)
\ No newline at end of file
......@@ -16,7 +16,7 @@ void test()
using namespace AMDiS;
using namespace Dune;
using namespace Dune::Functions;
using namespace Dune::Functions::BasisBuilder;
using namespace Dune::Functions::BasisFactory;
using namespace Dune::Indices;
// create grid
......@@ -56,5 +56,5 @@ int main(int argc, char** argv)
AMDiS::Environment env(argc, argv);
test();
return report_errors();
return AMDiS::report_errors();
}
......@@ -74,5 +74,5 @@ int main(int argc, char** argv)
AMDiS::Environment env(argc, argv);
test();
return report_errors();
return AMDiS::report_errors();
}
......@@ -14,7 +14,7 @@ void test()
using namespace AMDiS;
using namespace Dune;
using namespace Dune::Functions;
using namespace Dune::Functions::BasisBuilder;
using namespace Dune::Functions::BasisFactory;
using namespace Dune::Indices;
// create grid
......@@ -56,5 +56,5 @@ int main(int argc, char** argv)
AMDiS::Environment env(argc, argv);
test();
return report_errors();
return AMDiS::report_errors();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment