Commit dd822aec authored by Dmitry Yu. Naumov's avatar Dmitry Yu. Naumov
Browse files

Merge branch 'eigen-dep' into 'master'

[CMake] Removed option OGS_USE_EIGEN.

Closes #3100

See merge request ogs/ogs!3435
parents e7248b5c 7f929a51
......@@ -110,7 +110,6 @@ option(OGS_USE_NETCDF "Add NetCDF support." OFF)
option(OGS_USE_XDMF "Add Xdmf file IO support" OFF)
# Eigen
option(OGS_USE_EIGEN "Use Eigen linear solver" ON)
option(OGS_USE_EIGEN_UNSUPPORTED "Use Eigen unsupported modules" ON)
option(OGS_EIGEN_INITIALIZE_MATRICES_BY_NAN "" ON)
option(EIGEN_NO_DEBUG "Disables Eigen's assertions" OFF)
......@@ -188,7 +187,6 @@ option(OGS_USE_MFRONT
# ---- Definitions ----
if(OGS_USE_LIS)
include_directories(SYSTEM ${LIS_INCLUDE_DIR})
set(OGS_USE_EIGEN ON)
endif()
if(OGS_USE_MKL)
......@@ -196,32 +194,24 @@ if(OGS_USE_MKL)
endif()
# Eigen
if(OGS_USE_EIGEN)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DEIGEN_INITIALIZE_MATRICES_BY_NAN)
endif()
if(EIGEN_NO_DEBUG)
add_definitions(-DEIGEN_NO_DEBUG)
endif()
if(EIGEN_DONT_VECTORIZE)
add_definitions(-DEIGEN_DONT_VECTORIZE)
endif()
if(OGS_EIGEN_DYNAMIC_SHAPE_MATRICES_INTERNAL)
add_definitions(-DOGS_EIGEN_DYNAMIC_SHAPE_MATRICES)
endif()
if(OGS_USE_EIGEN_UNSUPPORTED)
add_definitions(-DUSE_EIGEN_UNSUPPORTED)
endif()
if(OGS_EIGEN_INITIALIZE_MATRICES_BY_NAN)
add_definitions(-DEIGEN_INITIALIZE_MATRICES_BY_NAN)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DEIGEN_INITIALIZE_MATRICES_BY_NAN)
endif()
if(EIGEN_NO_DEBUG)
add_definitions(-DEIGEN_NO_DEBUG)
endif()
if(EIGEN_DONT_VECTORIZE)
add_definitions(-DEIGEN_DONT_VECTORIZE)
endif()
if(OGS_EIGEN_DYNAMIC_SHAPE_MATRICES_INTERNAL)
add_definitions(-DOGS_EIGEN_DYNAMIC_SHAPE_MATRICES)
endif()
if(OGS_USE_EIGEN_UNSUPPORTED)
add_definitions(-DUSE_EIGEN_UNSUPPORTED)
endif()
if(OGS_EIGEN_INITIALIZE_MATRICES_BY_NAN)
add_definitions(-DEIGEN_INITIALIZE_MATRICES_BY_NAN)
endif()
# End Eigen
# Packaging
include(scripts/cmake/packaging/Pack.cmake)
......
......@@ -9,10 +9,7 @@ if(CVODE_FOUND)
append_source_files(SOURCES ODE)
endif()
append_source_files(SOURCES Nonlinear)
if(OGS_USE_EIGEN)
append_source_files(SOURCES LinAlg/Eigen)
endif()
append_source_files(SOURCES LinAlg/Eigen)
if(OGS_USE_LIS)
append_source_files(SOURCES LinAlg/Lis)
......@@ -59,7 +56,6 @@ target_compile_definitions(MathLib
PUBLIC
$<$<BOOL:${USE_LIS}>:USE_LIS>
$<$<BOOL:${OGS_USE_PETSC}>:USE_PETSC>
$<$<BOOL:${OGS_USE_EIGEN}>:OGS_USE_EIGEN>
$<$<BOOL:${CVODE_FOUND}>:CVODE_FOUND>
PRIVATE
$<$<BOOL:${OGS_USE_MKL}>:USE_MKL>
......
......@@ -11,10 +11,8 @@
#include <vector>
#ifdef OGS_USE_EIGEN
#include "MathLib/LinAlg/Eigen/EigenTools.h"
#endif // OGS_USE_EIGEN
#ifdef USE_PETSC
#include "MathLib/LinAlg/PETSc/PETScTools.h"
#endif // USE_PETSC
#endif // USE_PETSC
......@@ -36,7 +36,7 @@
using GlobalLinearSolver = MathLib::PETScLinearSolver;
#elif defined(OGS_USE_EIGEN)
#else
#include "MathLib/LinAlg/Eigen/EigenVector.h"
#include "MathLib/LinAlg/Eigen/EigenMatrix.h"
#include "MathLib/LinAlg/Eigen/EigenLinearSolver.h"
......@@ -46,7 +46,7 @@
using GlobalLinearSolver = MathLib::EigenLinearSolver;
#endif // OGS_USE_EIGEN
#endif
/// A type used for indexing of global vectors and matrices. It is equal to the
......
......@@ -173,7 +173,7 @@ void finalizeAssembly(PETScVector& x)
// Sparse global EigenMatrix/EigenVector //////////////////////////////////////////
#elif defined(OGS_USE_EIGEN)
#else
#include "MathLib/LinAlg/Eigen/EigenVector.h"
#include "MathLib/LinAlg/Eigen/EigenMatrix.h"
......
......@@ -196,7 +196,7 @@ void finalizeAssembly(PETScVector& x);
// Sparse global EigenMatrix/EigenVector //////////////////////////////////////////
#elif defined(OGS_USE_EIGEN)
#else
namespace MathLib {
......
......@@ -92,7 +92,7 @@ std::unique_ptr<PETScVector> MatrixVectorTraits<PETScVector>::newInstance(
} // namespace MathLib
#elif defined(OGS_USE_EIGEN)
#else
namespace MathLib
{
......@@ -153,4 +153,4 @@ std::unique_ptr<EigenVector> MatrixVectorTraits<EigenVector>::newInstance(
}
} // namespace MathLib
#endif // defined(OGS_USE_EIGEN)
#endif
......@@ -43,7 +43,7 @@ SPECIALIZE_MATRIX_VECTOR_TRAITS(PETScVector, PETScVector::IndexType);
}
#elif defined(OGS_USE_EIGEN)
#else
#include "MathLib/LinAlg/Eigen/EigenMatrix.h"
#include "MathLib/LinAlg/Eigen/EigenVector.h"
......
......@@ -40,6 +40,4 @@ void setMatrixSparsity(MATRIX& matrix, SPARSITY_PATTERN const& sparsity_pattern)
#include "Lis/LisMatrix.h"
#endif // USE_LIS
#ifdef OGS_USE_EIGEN
#include "Eigen/EigenMatrix.h"
#endif // OGS_USE_EIGEN
......@@ -97,7 +97,7 @@ void addToMatrix(PETScMatrix& m,
} // namespace MathLib
#elif defined(OGS_USE_EIGEN)
#else
// Sparse global EigenMatrix/EigenVector //////////////////////////////////////////
......@@ -171,4 +171,4 @@ void addToMatrix(EigenMatrix& m,
} // namespace MathLib
#endif // OGS_USE_EIGEN
#endif
......@@ -42,7 +42,7 @@ void setMatrix(PETScMatrix& m,
} // namespace MathLib
#elif defined(OGS_USE_EIGEN)
#else
// Sparse global EigenMatrix/EigenVector //////////////////////////////////////////
......@@ -68,4 +68,4 @@ void addToMatrix(EigenMatrix& m,
} // namespace MathLib
#endif // OGS_USE_EIGEN
#endif
......@@ -21,7 +21,7 @@
#if defined(USE_PETSC)
#include "MathLib/LinAlg/PETSc/PETScMatrix.h"
#elif defined(OGS_USE_EIGEN)
#else
#include "MathLib/LinAlg/Eigen/EigenMatrix.h"
#endif
......@@ -228,7 +228,7 @@ TEST(MPITest_Math, CheckInterface_PETSc_Rectangular_Matrix_Global_Size)
checkGlobalRectangularMatrixInterfaceMPI(A, x);
}
#elif defined(OGS_USE_EIGEN)
#else
TEST(Math, CheckInterface_EigenMatrix)
{
MathLib::EigenMatrix m(10);
......
......@@ -20,7 +20,7 @@
#if defined(USE_PETSC)
#include "MathLib/LinAlg/PETSc/PETScVector.h"
#elif defined(OGS_USE_EIGEN)
#else
#include "MathLib/LinAlg/Eigen/EigenVector.h"
#endif
......@@ -282,7 +282,7 @@ TEST(MPITest_Math, CheckInterface_PETScVector)
{
checkGlobalVectorInterfacePETSc<MathLib::PETScVector >();
}
#elif defined(OGS_USE_EIGEN)
#else
TEST(Math, CheckInterface_EigenVector)
{
checkGlobalVectorInterface<MathLib::EigenVector >();
......
......@@ -20,13 +20,11 @@
#include "MathLib/LinAlg/FinalizeMatrixAssembly.h"
#include "MathLib/LinAlg/LinAlg.h"
#ifdef OGS_USE_EIGEN
#include "MathLib/LinAlg/Eigen/EigenMatrix.h"
#include "MathLib/LinAlg/Eigen/EigenVector.h"
#include "MathLib/LinAlg/Eigen/EigenLinearSolver.h"
#endif
#if defined(OGS_USE_EIGEN) && defined(USE_LIS)
#if defined(USE_LIS)
#include "MathLib/LinAlg/EigenLis/EigenLisLinearSolver.h"
#endif
......@@ -219,7 +217,6 @@ void checkLinearSolverInterface(T_MATRIX& A, T_VECTOR& b,
} // end namespace
#ifdef OGS_USE_EIGEN
TEST(Math, CheckInterface_Eigen)
{
// set solver options using Boost property tree
......@@ -239,9 +236,8 @@ TEST(Math, CheckInterface_Eigen)
checkLinearSolverInterface<MathLib::EigenMatrix, MathLib::EigenVector,
MathLib::EigenLinearSolver, IntType>(A, conf);
}
#endif
#if defined(OGS_USE_EIGEN) && defined(USE_LIS)
#if defined(USE_LIS)
TEST(Math, CheckInterface_EigenLis)
{
// set solver options using Boost property tree
......
......@@ -14,7 +14,7 @@
# TESTER <diff|vtkdiff|gmldiff|memcheck> # optional
# REQUIREMENTS # optional simple boolean expression which has to be true to
# enable the test, e.g.
# OGS_USE_PETSC AND (OGS_USE_EIGEN OR OGS_USE_LIS)
# OGS_USE_PETSC AND (FOO OR BAR)
# PYTHON_PACKAGES package_x=1.2.3 package_y=0.1.x # optional
# VIS <vtu output file(s)> # optional for documentation
# RUNTIME <in seconds> # optional for optimizing ctest duration
......
......@@ -11,7 +11,7 @@
# WRAPPER_ARGS <arguments> # optional
# REQUIREMENTS # optional simple boolean expression which has to be true to
# enable the test, e.g.
# OGS_USE_PETSC AND (OGS_USE_EIGEN OR OGS_USE_LIS)
# OGS_USE_PETSC AND (FOO OR BAR)
# RUNTIME <in seconds> # optional for optimizing ctest duration
# values should be taken from envinf1 serial job
# )
......
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