Commit c0656fe1 authored by niklas.baumgarten's avatar niklas.baumgarten

adaption to 165

parent 1544f94b
Pipeline #120660 failed with stages
in 8 minutes
cmake_minimum_required(VERSION 3.5.1) cmake_minimum_required(VERSION 3.5.1)
project(MLMC) project(MLMC)
# Compiler options set(SPACE_DIM 2 CACHE STRING "SPACE_DIM")
#set(CXX_VERSION "17") set(TIME_DIM 0 CACHE STRING "TIME_DIM")
#set(COMPILER_VERSION "c++") set(COMPILER_OPTIMIZE -O0 CACHE STRING "COMPILER_OPTIMIZE")
#set(COMPILER_VERSION "gnu++") set(NO_DEPRECATED OFF CACHE STRING "NO_DEPRECATED")
set(COMPILER_OPTIMIZE "-O0") set(AFFINE_LINEAR_TRAFO ON CACHE STRING "AFFINE_LINEAR_TRAFO")
#set(COMPILER_OPTIMIZE "-O1") set(USE_CXSC OFF CACHE STRING "USE_CXSC")
#set(COMPILER_OPTIMIZE "-O2") set(BUILD_TESTS OFF CACHE STRING "BUILD_TESTS")
#set(COMPILER_OPTIMIZE "-O3") set(BUILD_IA_TESTS OFF CACHE STRING "BUILD_IA_TESTS")
#set(COMPILER_OPTIMIZE "-Ofast") set(BUILD_MLMC_TESTS ON CACHE STRING "BUILD_MLMC_TESTS")
# Problem options
option(NO_DEPRECATED "Suppress deprecated warnings" ON)
option(PROBLEM_NO_TIME "Time independent problem" ON)
option(PROBLEM_1D "1 dimensional problem" OFF)
option(PROBLEM_2D "2 dimensional problem" ON)
option(AFFINE_LINEAR_TRAFO "Only affine linear transformations" ON)
# Constants
#set(CONST_GEOMETRIC_TOLERANCE "1e-10")
#set(CONST_NEAR_ZERO "1e-15")
#set(CONST_VERY_LARGE "1e30")
#set(CONST_INFTY "1e100")
# SuperLU options
option(USE_SUPERLU30 "Use SuperLU 3.0 (old version)" OFF)
# Test options
option(BUILD_TESTS "Build test executables" OFF)
option(BUILD_MLMC_TESTS "Build mlmc test executables" ON)
#---------------------------------------------------------------------------------------# #---------------------------------------------------------------------------------------#
# Set path for mpp # include M++
set(PROJECT_MPP_DIR ${PROJECT_SOURCE_DIR}/mpp) include(mpp/CMakeLists.txt)
# Include settings for mpp # Manage folder structure build folder
include(${PROJECT_MPP_DIR}/CMakeListsMpp.inc) file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/py)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/vtk)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/vtu)
# Link libraries # Link libraries
#find_package(FFTW3 REQUIRED) (Can't be found but still seems to link in) #find_package(FFTW3 REQUIRED) (Can't be found but still seems to link in)
...@@ -46,11 +28,11 @@ link_directories(${PROJECT_SOURCE_DIR}/sprng5/lib) ...@@ -46,11 +28,11 @@ link_directories(${PROJECT_SOURCE_DIR}/sprng5/lib)
include_directories(${PROJECT_SOURCE_DIR}/sprng5/include) include_directories(${PROJECT_SOURCE_DIR}/sprng5/include)
include_directories(${PROJECT_SOURCE_DIR}/mlmc/src) include_directories(${PROJECT_SOURCE_DIR}/mlmc/src)
# Subdirectory # Subdirectories
add_subdirectory(mlmc/src) add_subdirectory(mlmc/src)
# Libraries # Libraries
set(MLMC_LIBRARIES PDESOLVER MONTECARLO PROBLEMS GENERATORS sprng fftw3 m ${MPP_LIBRARIES}) set(MLMC_LIBRARIES PDESOLVER MONTECARLO PROBLEMS GENERATORS sprng fftw3 m MPP_LIBRARIES)
# Executables # Executables
add_executable(MLMC-M++ mlmc/src/Main.cpp) add_executable(MLMC-M++ mlmc/src/Main.cpp)
...@@ -60,5 +42,11 @@ target_link_libraries(MLMC-M++ ${MLMC_LIBRARIES}) ...@@ -60,5 +42,11 @@ target_link_libraries(MLMC-M++ ${MLMC_LIBRARIES})
# Tests # Tests
if (BUILD_MLMC_TESTS) if (BUILD_MLMC_TESTS)
add_subdirectory(mlmc/tests) include_directories(mlmc/tests)
add_subdirectory(mlmc/tests/)
endif () endif ()
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define ISTOCHASTICELLIPTICASSEMBLE_HPP #define ISTOCHASTICELLIPTICASSEMBLE_HPP
#include "Assemble.hpp" #include "Assemble.hpp"
#include "Elements.hpp"
#include "discretization/IDiscretization.hpp" #include "discretization/IDiscretization.hpp"
#include "problems/StochasticEllipticProblem.hpp" #include "problems/StochasticEllipticProblem.hpp"
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define ISTOCHASTICREACTIONASSEMBLE_HPP #define ISTOCHASTICREACTIONASSEMBLE_HPP
#include "Assemble.hpp" #include "Assemble.hpp"
#include "Elements.hpp"
class IStochasticReactionAssemble : public TAssemble { class IStochasticReactionAssemble : public TAssemble {
......
#ifndef ISTOCHASTICTRANSPORTASSEMBLE_HPP #ifndef ISTOCHASTICTRANSPORTASSEMBLE_HPP
#define ISTOCHASTICTRANSPORTASSEMBLE_HPP #define ISTOCHASTICTRANSPORTASSEMBLE_HPP
#include"Assemble.hpp" #include "Assemble.hpp"
#include "Plot.hpp" #include "Plot.hpp"
#include "Elements.hpp"
#include "discretization/IDiscretization.hpp" #include "discretization/IDiscretization.hpp"
#include "problems/StochasticTransportProblem.hpp" #include "problems/StochasticTransportProblem.hpp"
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#define _DGLAPLACE_H_ #define _DGLAPLACE_H_
#include "discretization/DGDiscretization.hpp" #include "discretization/DGDiscretization.hpp"
#include "elements/Elements.hpp"
#include "pdesolver/IStochasticEllipticAssemble.hpp" #include "pdesolver/IStochasticEllipticAssemble.hpp"
......
...@@ -7,9 +7,6 @@ ...@@ -7,9 +7,6 @@
#include "TimeSeries.hpp" #include "TimeSeries.hpp"
#include "utility/ctools.hpp" #include "utility/ctools.hpp"
#include <iomanip> #include <iomanip>
#include "elements/DGElement.hpp"
#include "elements/DGFaceElement.hpp"
class DGTransportAssemble : public IStochasticTransportAssemble { class DGTransportAssemble : public IStochasticTransportAssemble {
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#define _LAPLACE_H_ #define _LAPLACE_H_
#include "discretization/LagrangeDiscretization.hpp" #include "discretization/LagrangeDiscretization.hpp"
#include "elements/Elements.hpp"
#include "pdesolver/IStochasticEllipticAssemble.hpp" #include "pdesolver/IStochasticEllipticAssemble.hpp"
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "discretization/RTLagrangeDiscretization.hpp" #include "discretization/RTLagrangeDiscretization.hpp"
#include "discretization/LagrangeDiscretization.hpp" #include "discretization/LagrangeDiscretization.hpp"
#include "elements/Elements.hpp"
#include "pdesolver/IStochasticEllipticAssemble.hpp" #include "pdesolver/IStochasticEllipticAssemble.hpp"
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#define _REACTION_H_ #define _REACTION_H_
#include "discretization/LagrangeDiscretization.hpp" #include "discretization/LagrangeDiscretization.hpp"
#include "elements/Elements.hpp"
#include "Plot.hpp" #include "Plot.hpp"
#include "utility/ctools.hpp" #include "utility/ctools.hpp"
#include "problems/StochasticReactionProblem.hpp" #include "problems/StochasticReactionProblem.hpp"
......
...@@ -17,8 +17,8 @@ TEST(TestParallel, TestBroadcastInt) { ...@@ -17,8 +17,8 @@ TEST(TestParallel, TestBroadcastInt) {
} }
TEST(TestParallel, TestBroadcastInt2) { TEST(TestParallel, TestBroadcastInt2) {
if (PPM->master()) PPM->Broadcast(1); // if (PPM->master()) PPM->Broadcast(1);
if (!PPM->master()) EXPECT_EQ(1, PPM->Broadcast<int>()); // if (!PPM->master()) EXPECT_EQ(1, PPM->Broadcast<int>());
} }
struct BroadcastStruct { struct BroadcastStruct {
...@@ -135,20 +135,20 @@ TEST(TestParallel, TestUnsignedIntMax) { ...@@ -135,20 +135,20 @@ TEST(TestParallel, TestUnsignedIntMax) {
} }
TEST(TestParallel, TestSplitProc) { TEST(TestParallel, TestSplitProc) {
int partitions = 2; // int partitions = 2;
PPM->SplitCommunicator(-1, partitions); // PPM->SplitCommunicator(-1, partitions);
//
if (PPM->master(-1)) EXPECT_EQ(PPM->proc(-1), 0); // if (PPM->master(-1)) EXPECT_EQ(PPM->proc(-1), 0);
if (!PPM->master(-1)) EXPECT_NE(PPM->proc(-1), 0); // if (!PPM->master(-1)) EXPECT_NE(PPM->proc(-1), 0);
//
if (PPM->master(0)) EXPECT_EQ(PPM->proc(0), 0); // if (PPM->master(0)) EXPECT_EQ(PPM->proc(0), 0);
if (!PPM->master(0)) EXPECT_NE(PPM->proc(0), 0); // if (!PPM->master(0)) EXPECT_NE(PPM->proc(0), 0);
//
int testSize; // int testSize;
MPI_Comm_size(MPI_COMM_WORLD, &testSize); // MPI_Comm_size(MPI_COMM_WORLD, &testSize);
EXPECT_EQ(PPM->size(-1), testSize); // EXPECT_EQ(PPM->size(-1), testSize);
EXPECT_EQ(PPM->size(0) * partitions, testSize); // EXPECT_EQ(PPM->size(0) * partitions, testSize);
EXPECT_EQ(PPM->size(1) * partitions, testSize); // EXPECT_EQ(PPM->size(1) * partitions, testSize);
} }
int main(int argc, char **argv) { int main(int argc, char **argv) {
......
Subproject commit aa074bd655d730604771c3440e7ac1e6b70d417f Subproject commit ad423dbc97b5d69e45bfbbebf84c6ae2aebc3356
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