diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..e9c68401b2b42fea1a62136ca45ae02a4739c02e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,120 @@ +cmake_minimum_required(VERSION 3.8 FATAL_ERROR) +project(openfpm_numerics LANGUAGES C CXX CUDA) + + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/CMakeFiles/) + +set(BOOST_INCLUDE ${Boost_INCLUDE_DIR} CACHE PATH "Include directory for BOOST") +set(PETSC_ROOT CACHE PATH "If compiling with linear algebra indicate the PETSC root directory") +set(PARMETIS_ROOT CACHE PATH "Parmetis root directory") +set(METIS_ROOT CACHE PATH "Metis root directory") +set(LIBHILBERT_ROOT CACHE PATH "LibHilbert root path") +set(HDF5_ROOT CACHE PATH "HDF5 root path") +set(EIGEN3_ROOT CACHE PATH "Eigen3 include path") +set(LIBHILBERT_ROOT CACHE PATH "LibHilbert root path") +set(SE_CLASS1 CACHE BOOL "Activate compilation with SE_CLASS1") +set(SE_CLASS2 CACHE BOOL "Activate compilation with SE_CLASS2") +set(SE_CLASS3 CACHE BOOL "Activate compilation with SE_CLASS3") +set(PROFILE_WITH_SCOREP CACHE BOOL "Enable profiling with scorep") +set(ENV{PETSC_DIR} ${PETSC_ROOT}) +set(ENV{HDF5_ROOT} ${HDF5_ROOT}) +set(ENV{EIGEN3_ROOT} ${EIGEN3_ROOT}) +set(METIS_DIR ${METIS_ROOT}) +set(PARMETIS_DIR ${PARMETIS_ROOT}) + +set(ENV{PATH} "$ENV{PATH}:${HDF5_ROOT}/bin") +set(HDF5_PREFER_PARALLEL TRUE) + +find_package(Boost 1.52.0 REQUIRED unit_test_framework iostreams program_options) +find_package(CUDA) +find_package(MPI REQUIRED) +find_package(PETSc) +find_package(HDF5 REQUIRED) +find_package(Eigen3) +find_package(LibHilbert REQUIRED) +find_package(Metis REQUIRED) +find_package(ParMetis REQUIRED) + +if(PROFILE_WITH_SCOREP) + set(CMAKE_CXX_COMPILER_LAUNCHER "scorep") + set(CMAKE_CC_COMPILER_LAUNCHER "scorep") + set(CMAKE_CUDA_COMPILER_LAUNCHER "scorep") +endif() + +if(CUDA_FOUND) + set(OPENFPM_INIT_FILE "initialize/initialize_wrapper_cuda.cu") +else() + set(OPENFPM_INIT_FILE "initialize/initialize_wrapper_cuda.cpp") +endif() + +###### CONFIG.h FILE ###### + +if(SE_CLASS1) + set(DEFINE_SE_CLASS1 "#define SE_CLASS1") +endif() + +if(SE_CLASS2) + set(DEFINE_SE_CLASS2 "#define SE_CLASS2") +endif() + +if(SE_CLASS3) + set(DEFINE_SE_CLASS3 "#define SE_CLASS3") +endif() + +if(CUDA_FOUND) + set(DEFINE_CUDA_GPU "#define CUDA_GPU") +endif() + +if (METIS_FOUND) + set(DEFINE_HAVE_METIS "#define HAVE_METIS 1") +else() + message( FATAL_ERROR "Metis is required in order to install OpenFPM" ) +endif() + +if (PARMETIS_FOUND) + set(DEFINE_HAVE_PARMETIS "#define HAVE_PARMETIS 1") +else() + message( FATAL_ERROR "ParMetis is required in order to install OpenFPM") +endif() + +if(MPI_FOUND) + set(DEFINE_HAVE_MPI "#define HAVE_MPI") +else() + message( FATAL_ERROR "MPI is required in order to install OpenFPM" ) +endif() + +if (Boost_FOUND) + set(DEFINE_HAVE_BOOST "#define HAVE_BOOST") + set(DEFINE_HAVE_BOOST_IOSTREAMS "#define HAVE_BOOST_IOSTREAMS") + set(DEFINE_HAVE_BOOST_PROGRAM_OPTIONS "#define HAVE_BOOST_PROGRAM_OPTIONS") + set(DEFINE_HAVE_BOOST_UNIT_TEST_FRAMEWORK "#define HAVE_BOOST_UNIT_TEST_FRAMEWORK") +else() + message( FATAL_ERROR "BOOST is required in order to install OpenFPM" ) +endif() + +if(HDF5_FOUND) + if (HDF5_IS_PARALLEL) + set(DEFINE_HAVE_HDF5 "#define HAVE_HDF5") + else() + message( STATUS "HDF5 found ${HDF5_INCLUDE_DIRS} does not have parallel support, OpenFPM require it" ) + endif() +else() + message( FATAL_ERROR "HDF5 with parallel support is required in order to install OpenFPM" ) +endif() + +if(EIGEN_FOUND) + set(DEFINE_HAVE_EIGEN "#define HAVE_EIGEN") +endif() + +if(LIBHILBERT_FOUND) + set(DEFINE_HAVE_LIBHILBERT "#define HAVE_LIBHILBERT 1") +else() + message( FATAL_ERROR "LibHilbert is required in order to install OpenFPM") +endif() + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config/config_cmake.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config/config.h) + +include_directories(SYSTEM ${MPI_INCLUDE_PATH}) + +add_subdirectory (src) + diff --git a/configure.ac b/configure.ac index 23d6afe9b80474587afae00936b6f8e361fc9b45..7842383e6fd7081c82e7f147d74448ec5983b6fb 100755 --- a/configure.ac +++ b/configure.ac @@ -161,7 +161,7 @@ have_quad_head=no AC_CHECK_LIB(quadmath, sinq, [have_quad_lib=yes], []) AC_CHECK_HEADER(quadmath.h,[have_quad_head=yes],[]) -if [x"have_quad_math" == x"yes" $&& x"have_quad_math" == x"yes" ]; then +if test x"have_quad_math" == x"yes"; then AC_DEFINE(HAVE_LIBQUADMATH,[],[Have quad math lib]) LIBQUADMATH=" -lquadmath " fi diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..eb31a5efa99bb81f07d76334cc3b15fe9e97b449 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,112 @@ +cmake_minimum_required(VERSION 3.8 FATAL_ERROR) + +########################### Executables + +add_executable(numerics main.cpp Matrix/SparseMatrix_unit_tests.cpp interpolation/interpolation_unit_tests.cpp Vector/Vector_unit_tests.cpp Solvers/petsc_solver_unit_tests.cpp FiniteDifference/FDScheme_unit_tests.cpp FiniteDifference/eq_unit_test_3d.cpp FiniteDifference/eq_unit_test.cpp Operators/Vector/vector_dist_operators_unit_tests.cpp ../../openfpm_vcluster/src/VCluster/VCluster.cpp ../../openfpm_devices/src/memory/CudaMemory.cu ../../openfpm_devices/src/memory/HeapMemory.cpp ../../openfpm_devices/src/memory/PtrMemory.cpp ../../openfpm_devices/src/Memleak_check.cpp) + + +########################### + +target_compile_options(numerics PUBLIC $<$:-Xcudafe "--display_error_number --diag_suppress=2885 --diag_suppress=2887 --diag_suppress=2888 --diag_suppress=186 --diag_suppress=111" --expt-extended-lambda>) + +target_include_directories (numerics PUBLIC ${CUDA_INCLUDE_DIRS}) +target_include_directories (numerics PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories (numerics PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../openfpm_devices/src/) +target_include_directories (numerics PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../openfpm_vcluster/src/) +target_include_directories (numerics PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../src/) +target_include_directories (numerics PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../openfpm_data/src/) +target_include_directories (numerics PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../openfpm_io/src/) +target_include_directories (numerics PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config) +target_include_directories (numerics PUBLIC ${PETSC_INCLUDES}) +target_include_directories (numerics PUBLIC ${PARMETIS_ROOT}/include) +target_include_directories (numerics PUBLIC ${METIS_ROOT}/include) +target_include_directories (numerics PUBLIC ${HDF5_ROOT}/include) +target_include_directories (numerics PUBLIC ${LIBHILBERT_INCLUDE_DIRS}) + +target_link_libraries(numerics ${Boost_LIBRARIES}) +target_link_libraries(numerics -L${METIS_ROOT}/lib metis) +target_link_libraries(numerics -L${PARMETIS_ROOT}/lib parmetis) +target_link_libraries(numerics -L${HDF5_ROOT}/lib hdf5 hdf5_hl) +target_link_libraries(numerics -L${LIBHILBERT_LIBRARY_DIRS} ${LIBHILBERT_LIBRARIES}) +if(PETSC_FOUND) + target_link_libraries(numerics -L${PETSC_LIB_DIR} ${PETSC_LIBRARIES}) +endif() + + +# Request that particles be built with -std=c++11 +# As this is a public compile feature anything that links to particles +# will also build with -std=c++11 +target_compile_features(numerics PUBLIC cxx_std_11) +target_link_libraries(numerics ${MPI_C_LIBRARIES}) + +install(FILES Matrix/SparseMatrix.hpp + Matrix/SparseMatrix_Eigen.hpp + Matrix/SparseMatrix_petsc.hpp + DESTINATION openfpm_numerics/include/Matrix) + +install(FILES Vector/Vector_eigen.hpp + Vector/Vector_petsc.hpp + Vector/Vector_util.hpp + Vector/Vector.hpp + DESTINATION openfpm_numerics/Vector ) + +install(FILES Solvers/umfpack_solver.hpp Solvers/petsc_solver.hpp + DESTINATION openfpm_numerics/include/Solvers ) + +install(FILES util/petsc_util.hpp + util/linalgebra_lib.hpp + util/util_num.hpp + util/grid_dist_testing.hpp + DESTINATION openfpm_numerics/include/util ) + +install(FILES FiniteDifference/Average.hpp + FiniteDifference/Derivative.hpp + FiniteDifference/FD_util_include.hpp + FiniteDifference/eq.hpp + FiniteDifference/FDScheme.hpp + FiniteDifference/Laplacian.hpp + FiniteDifference/mul.hpp + FiniteDifference/sum.hpp + DESTINATION openfpm_numerics/include/FiniteDifference ) + +install(FILES FiniteDifference/util/common.hpp + DESTINATION openfpm_numerics/include/FiniteDifference/util ) + +install(FILES PSE/Kernels.hpp PSE/Kernels_test_util.hpp + DESTINATION openfpm_numerics/include/PSE ) + +install(FILES Operators/Vector/vector_dist_operators_extensions.hpp + Operators/Vector/vector_dist_operators.hpp + Operators/Vector/vector_dist_operators_apply_kernel.hpp + Operators/Vector/vector_dist_operators_functions.hpp + Operators/Vector/vector_dist_operator_assign.hpp + DESTINATION openfpm_numerics/include/Operators/Vector ) + +install(FILES Draw/DrawParticles.hpp + Draw/PointIterator.hpp + Draw/PointIteratorSkin.hpp + DESTINATION openfpm_numerics/include/Draw ) + +install(FILES interpolation/interpolation.hpp + interpolation/mp4_kernel.hpp + interpolation/z_spline.hpp + DESTINATION openfpm_numerics/include/interpolation ) + + +#if(BUILD_TESTING) + +# add_executable(particle_test test.cu) + +# set_target_properties(particle_test PROPERTIES CUDA_SEPARABLE_COMPILATION ON) +# target_link_libraries(particle_test PRIVATE particles) + +# add_test(NAME particles_10k COMMAND particle_test 10000 ) +# add_test(NAME particles_256k COMMAND particle_test 256000 ) + +# if(APPLE) + # We need to add the default path to the driver (libcuda.dylib) as an rpath, + # so that the static cuda runtime can find it at runtime. + # set_property(TARGET particle_test PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}) + # endif() + #endif() + diff --git a/src/Draw/DrawParticles.hpp b/src/Draw/DrawParticles.hpp index 12d46dc9c45ea161e8b1ef28b0dddf378da63555..8fd3db3725394eb5ce9550211213501483d84323 100644 --- a/src/Draw/DrawParticles.hpp +++ b/src/Draw/DrawParticles.hpp @@ -43,8 +43,9 @@ public: * \return an iterator to the selected particles * */ - template static PointIteratorSkin - DrawSkin(vector_dist & vd, + template + static PointIteratorSkin + DrawSkin(vd_type & vd, size_t (& sz)[dim], Box & domain, Box & sub_A, @@ -55,7 +56,7 @@ public: for (size_t i = 0 ; i < dim ; i++) bc[i] = NON_PERIODIC; - return PointIteratorSkin(vd.getDecomposition(),sz,vd.getDecomposition().getDomain(),sub_A, sub_B, bc); + return PointIteratorSkin(vd.getDecomposition(),sz,vd.getDecomposition().getDomain(),sub_A, sub_B, bc); } @@ -79,8 +80,9 @@ public: * \return an iterator to the selected particles * */ - template static PointIteratorSkin - DrawSkin(vector_dist & vd, + template + static PointIteratorSkin + DrawSkin(vd_type & vd, size_t (& sz)[dim], Box & domain, openfpm::vector> & sub_A, @@ -91,7 +93,7 @@ public: for (size_t i = 0 ; i < dim ; i++) bc[i] = NON_PERIODIC; - PointIteratorSkin it(vd.getDecomposition(),sz,vd.getDecomposition().getDomain(),sub_A.get(0), sub_B, bc); + PointIteratorSkin it(vd.getDecomposition(),sz,vd.getDecomposition().getDomain(),sub_A.get(0), sub_B, bc); for (size_t i = 1 ; i < sub_A.size() ; i++) it.addBoxA(Box(sub_A.get(i))); @@ -117,13 +119,13 @@ public: * \return an iterator to the selected particles * */ - template static PointIterator - DrawBox(vector_dist & vd, + template static PointIterator + DrawBox(vd_type & vd, size_t (& sz)[dim], Box & domain, Box & sub) { - return PointIterator(vd.getDecomposition(),sz,vd.getDecomposition().getDomain(),sub); + return PointIterator(vd.getDecomposition(),sz,vd.getDecomposition().getDomain(),sub); } }; diff --git a/src/Draw/DrawParticles_unit_tests.hpp b/src/Draw/DrawParticles_unit_tests.hpp index b3355bd935d380e5c576a75f0a95ec1d3dcf7ccc..6da89ac67a9a97a2baaad6d0710f758d01a52bb4 100644 --- a/src/Draw/DrawParticles_unit_tests.hpp +++ b/src/Draw/DrawParticles_unit_tests.hpp @@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE(point_iterator) //! [DrawBox_example] - Vcluster & v_cl = create_vcluster(); + Vcluster<> & v_cl = create_vcluster(); v_cl.sum(cnt); v_cl.execute(); @@ -115,7 +115,7 @@ BOOST_AUTO_TEST_CASE(point_iterator_skin) ++p; } - Vcluster & v_cl = create_vcluster(); + Vcluster<> & v_cl = create_vcluster(); v_cl.sum(cnt); v_cl.execute(); diff --git a/src/Equations/stoke_flow_eq_3d.hpp b/src/Equations/stoke_flow_eq_3d.hpp index 886b6b3883e8123691ec5d2164ac184190d4cabf..fcd8b3e6f197a39ccc01a8b1da9a687fa5976079 100644 --- a/src/Equations/stoke_flow_eq_3d.hpp +++ b/src/Equations/stoke_flow_eq_3d.hpp @@ -8,6 +8,10 @@ #ifndef OPENFPM_NUMERICS_SRC_EQUATIONS_STOKE_FLOW_EQ_3D_HPP_ #define OPENFPM_NUMERICS_SRC_EQUATIONS_STOKE_FLOW_EQ_3D_HPP_ +constexpr unsigned int x = 0; +constexpr unsigned int y = 1; +constexpr unsigned int z = 2; + // Model the equations constexpr unsigned int v[] = {0,1,2}; diff --git a/src/FiniteDifference/FDScheme.hpp b/src/FiniteDifference/FDScheme.hpp index 75718266fabbd864b8236bdc360cbafb4c5126a2..67db9cfde58ee7c0e667bf4ee8c3b5417488bd06 100644 --- a/src/FiniteDifference/FDScheme.hpp +++ b/src/FiniteDifference/FDScheme.hpp @@ -310,7 +310,7 @@ private: // Indicate all the non zero colums // This check can be done only on single processor - Vcluster & v_cl = create_vcluster(); + Vcluster<> & v_cl = create_vcluster(); if (v_cl.getProcessingUnits() == 1) { openfpm::vector nz_cols; @@ -604,7 +604,7 @@ private: */ void construct_gmap() { - Vcluster & v_cl = create_vcluster(); + Vcluster<> & v_cl = create_vcluster(); // Calculate the size of the local domain size_t sz = g_map.getLocalDomainSize(); diff --git a/src/FiniteDifference/FDScheme_unit_tests.hpp b/src/FiniteDifference/FDScheme_unit_tests.cpp similarity index 99% rename from src/FiniteDifference/FDScheme_unit_tests.hpp rename to src/FiniteDifference/FDScheme_unit_tests.cpp index 43cc916b127a2a1cc20a09c519d1967dfbe06bcc..593a5cb301b237e39e16bdaa056111df4a05e332 100644 --- a/src/FiniteDifference/FDScheme_unit_tests.hpp +++ b/src/FiniteDifference/FDScheme_unit_tests.cpp @@ -8,6 +8,9 @@ #ifndef OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_FDSCHEME_UNIT_TESTS_HPP_ #define OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_FDSCHEME_UNIT_TESTS_HPP_ +#define BOOST_TEST_DYN_LINK +#include + #include "FiniteDifference/Derivative.hpp" #include "FiniteDifference/Laplacian.hpp" #include "Decomposition/CartDecomposition.hpp" diff --git a/src/FiniteDifference/eq.hpp b/src/FiniteDifference/eq.hpp index e14175116e24ec92d19b56152c7d497b7c4365f6..6b79a23b39a804be59cd84afbbbd442023fc423f 100644 --- a/src/FiniteDifference/eq.hpp +++ b/src/FiniteDifference/eq.hpp @@ -15,6 +15,7 @@ //#define NON_PERIODIC false #include "util/util_num.hpp" +#include "Matrix/SparseMatrix.hpp" /*! \brief Equation * diff --git a/src/FiniteDifference/eq_unit_test.hpp b/src/FiniteDifference/eq_unit_test.hpp deleted file mode 100644 index 099c3da423e80a9da93c11fd667a35896d24dcce..0000000000000000000000000000000000000000 --- a/src/FiniteDifference/eq_unit_test.hpp +++ /dev/null @@ -1,286 +0,0 @@ -/* - * eq_unit_test.hpp - * - * Created on: Oct 13, 2015 - * Author: i-bird - */ - -#ifndef OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_EQ_UNIT_TEST_HPP_ -#define OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_EQ_UNIT_TEST_HPP_ - -#include "Laplacian.hpp" -#include "FiniteDifference/eq.hpp" -#include "FiniteDifference/sum.hpp" -#include "FiniteDifference/mul.hpp" -#include "Grid/grid_dist_id.hpp" -#include "Decomposition/CartDecomposition.hpp" -#include "Vector/Vector.hpp" -#include "Solvers/umfpack_solver.hpp" -#include "data_type/aggregate.hpp" -#include "FiniteDifference/FDScheme.hpp" - -BOOST_AUTO_TEST_SUITE( eq_test_suite ) - -//! [Definition of the system] - -struct lid_nn -{ - // dimensionaly of the equation (2D problem 3D problem ...) - static const unsigned int dims = 2; - - // number of fields in the system v_x, v_y, P so a total of 3 - static const unsigned int nvar = 3; - - // boundary conditions PERIODIC OR NON_PERIODIC - static const bool boundary[]; - - // type of space float, double, ... - typedef float stype; - - // type of base grid, it is the distributed grid that will store the result - // Note the first property is a 2D vector (velocity), the second is a scalar (Pressure) - typedef grid_dist_id<2,float,aggregate,CartDecomposition<2,float>> b_grid; - - // type of SparseMatrix, for the linear system, this parameter is bounded by the solver - // that you are using, in case of umfpack it is the only possible choice - typedef SparseMatrix SparseMatrix_type; - - // type of Vector for the linear system, this parameter is bounded by the solver - // that you are using, in case of umfpack it is the only possible choice - typedef Vector Vector_type; - - // Define that the underline grid where we discretize the system of equation is staggered - static const int grid_type = STAGGERED_GRID; -}; - -const bool lid_nn::boundary[] = {NON_PERIODIC,NON_PERIODIC}; - -//! [Definition of the system] - -//! [Definition of the equation of the system in the bulk and at the boundary] - -// Constant Field -struct eta -{ - typedef void const_field; - - static float val() {return 1.0;} -}; - -// Convenient constants -constexpr unsigned int v[] = {0,1}; -constexpr unsigned int P = 2; -constexpr unsigned int ic = 2; - -// Create field that we have v_x, v_y, P -typedef Field v_x; -typedef Field v_y; -typedef Field Prs; - -// Eq1 V_x - -typedef mul,lid_nn> eta_lap_vx; -typedef D p_x; -typedef minus m_p_x; -typedef sum vx_eq; - -// Eq2 V_y - -typedef mul,lid_nn> eta_lap_vy; -typedef D p_y; -typedef minus m_p_y; -typedef sum vy_eq; - -// Eq3 Incompressibility - -typedef D dx_vx; -typedef D dy_vy; -typedef sum ic_eq; - - -// Equation for boundary conditions - -/* Consider the staggered cell - * - \verbatim - - +--$--+ - | | - # * # - | | - 0--$--+ - - # = velocity(y) - $ = velocity(x) - * = pressure - - \endverbatim - * - * - * If we want to impose v_y = 0 on 0 we have to interpolate between # of this cell - * and # of the previous cell on y, (Average) or Avg operator - * - */ - -// Directional Avg -typedef Avg avg_vy; -typedef Avg avg_vx; - -typedef Avg avg_vy_f; -typedef Avg avg_vx_f; - -#define EQ_1 0 -#define EQ_2 1 -#define EQ_3 2 - -//! [Definition of the equation of the system in the bulk and at the boundary] - -template void lid_driven_cavity_2d() -{ - Vcluster & v_cl = create_vcluster(); - - if (v_cl.getProcessingUnits() > 3) - return; - - //! [lid-driven cavity 2D] - - // velocity in the grid is the property 0, pressure is the property 1 - constexpr int velocity = 0; - constexpr int pressure = 1; - - // Domain, a rectangle - Box<2,float> domain({0.0,0.0},{3.0,1.0}); - - // Ghost (Not important in this case but required) - Ghost<2,float> g(0.01); - - // Grid points on x=256 and y=64 - long int sz[] = {256,64}; - size_t szu[2]; - szu[0] = (size_t)sz[0]; - szu[1] = (size_t)sz[1]; - - // We need one more point on the left and down part of the domain - // This is given by the boundary conditions that we impose, the - // reason is mathematical in order to have a well defined system - // and cannot be discussed here - Padding<2> pd({1,1},{0,0}); - - // Distributed grid that store the solution - grid_dist_id<2,float,aggregate,CartDecomposition<2,float>> g_dist(szu,domain,g); - - // It is the maximum extension of the stencil - Ghost<2,long int> stencil_max(1); - - // Finite difference scheme - FDScheme fd(pd, stencil_max, domain,g_dist); - - // Here we impose the equation, we start from the incompressibility Eq imposed in the bulk with the - // exception of the first point {0,0} and than we set P = 0 in {0,0}, why we are doing this is again - // mathematical to have a well defined system, an intuitive explanation is that P and P + c are both - // solution for the incompressibility equation, this produce an ill-posed problem to make it well posed - // we set one point in this case {0,0} the pressure to a fixed constant for convenience P = 0 - fd.impose(ic_eq(),0.0, EQ_3, {0,0},{sz[0]-2,sz[1]-2},true); - fd.impose(Prs(), 0.0, EQ_3, {0,0},{0,0}); - - // Here we impose the Eq1 and Eq2 - fd.impose(vx_eq(),0.0, EQ_1, {1,0},{sz[0]-2,sz[1]-2}); - fd.impose(vy_eq(),0.0, EQ_2, {0,1},{sz[0]-2,sz[1]-2}); - - // v_x and v_y - // Imposing B1 - fd.impose(v_x(),0.0, EQ_1, {0,0},{0,sz[1]-2}); - fd.impose(avg_vy_f(),0.0, EQ_2 , {-1,0},{-1,sz[1]-1}); - // Imposing B2 - fd.impose(v_x(),0.0, EQ_1, {sz[0]-1,0},{sz[0]-1,sz[1]-2}); - fd.impose(avg_vy(),1.0, EQ_2, {sz[0]-1,0},{sz[0]-1,sz[1]-1}); - - // Imposing B3 - fd.impose(avg_vx_f(),0.0, EQ_1, {0,-1},{sz[0]-1,-1}); - fd.impose(v_y(), 0.0, EQ_2, {0,0},{sz[0]-2,0}); - // Imposing B4 - fd.impose(avg_vx(),0.0, EQ_1, {0,sz[1]-1},{sz[0]-1,sz[1]-1}); - fd.impose(v_y(), 0.0, EQ_2, {0,sz[1]-1},{sz[0]-2,sz[1]-1}); - - // When we pad the grid, there are points of the grid that are not - // touched by the previous condition. Mathematically this lead - // to have too many variables for the conditions that we are imposing. - // Here we are imposing variables that we do not touch to zero - // - - // Padding pressure - fd.impose(Prs(), 0.0, EQ_3, {-1,-1},{sz[0]-1,-1}); - fd.impose(Prs(), 0.0, EQ_3, {-1,sz[1]-1},{sz[0]-1,sz[1]-1}); - fd.impose(Prs(), 0.0, EQ_3, {-1,0},{-1,sz[1]-2}); - fd.impose(Prs(), 0.0, EQ_3, {sz[0]-1,0},{sz[0]-1,sz[1]-2}); - - // Impose v_x Padding Impose v_y padding - fd.impose(v_x(), 0.0, EQ_1, {-1,-1},{-1,sz[1]-1}); - fd.impose(v_y(), 0.0, EQ_2, {-1,-1},{sz[0]-1,-1}); - - solver_type solver; - auto x = solver.solve(fd.getA(),fd.getB()); - - //! [lid-driven cavity 2D] - - //! [Copy the solution to grid] - - fd.template copy(x,{0,0},{sz[0]-1,sz[1]-1},g_dist); - - std::string s = std::string(demangle(typeid(solver_type).name())); - s += "_"; - - //! [Copy the solution to grid] - - g_dist.write(s + "lid_driven_cavity_p" + std::to_string(v_cl.getProcessingUnits()) + "_grid"); - -#ifdef HAVE_OSX - - std::string file1 = std::string("test/") + s + "lid_driven_cavity_p" + std::to_string(v_cl.getProcessingUnits()) + "_grid_" + std::to_string(v_cl.getProcessUnitID()) + "_test_osx.vtk"; - std::string file2 = s + "lid_driven_cavity_p" + std::to_string(v_cl.getProcessingUnits()) + "_grid_" + std::to_string(v_cl.getProcessUnitID()) + ".vtk"; - -#else - - #if __GNUC__ == 6 - - std::string file1 = std::string("test/") + s + "lid_driven_cavity_p" + std::to_string(v_cl.getProcessingUnits()) + "_grid_" + std::to_string(v_cl.getProcessUnitID()) + "_test_GCC6.vtk"; - std::string file2 = s + "lid_driven_cavity_p" + std::to_string(v_cl.getProcessingUnits()) + "_grid_" + std::to_string(v_cl.getProcessUnitID()) + ".vtk"; - - #elif __GNUC__ == 5 - - std::string file1 = std::string("test/") + s + "lid_driven_cavity_p" + std::to_string(v_cl.getProcessingUnits()) + "_grid_" + std::to_string(v_cl.getProcessUnitID()) + "_test_GCC5.vtk"; - std::string file2 = s + "lid_driven_cavity_p" + std::to_string(v_cl.getProcessingUnits()) + "_grid_" + std::to_string(v_cl.getProcessUnitID()) + ".vtk"; - - #else - - std::string file1 = std::string("test/") + s + "lid_driven_cavity_p" + std::to_string(v_cl.getProcessingUnits()) + "_grid_" + std::to_string(v_cl.getProcessUnitID()) + "_test_GCC4.vtk"; - std::string file2 = s + "lid_driven_cavity_p" + std::to_string(v_cl.getProcessingUnits()) + "_grid_" + std::to_string(v_cl.getProcessUnitID()) + ".vtk"; - - #endif - - -#endif - - std::cout << "File1: " << file1 << std::endl; - std::cout << "File2: " << file2 << std::endl; - -#ifndef SE_CLASS3 - - // Check that match - bool test = compare(file1,file2); - BOOST_REQUIRE_EQUAL(test,true); - -#endif - -} - -// Lid driven cavity, incompressible fluid - -BOOST_AUTO_TEST_CASE(lid_driven_cavity) -{ - lid_driven_cavity_2d,lid_nn>(); -} - -BOOST_AUTO_TEST_SUITE_END() - -#endif /* OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_EQ_UNIT_TEST_HPP_ */ diff --git a/src/FiniteDifference/eq_unit_test_3d.hpp b/src/FiniteDifference/eq_unit_test_3d.cpp similarity index 96% rename from src/FiniteDifference/eq_unit_test_3d.hpp rename to src/FiniteDifference/eq_unit_test_3d.cpp index 26f6ad250fcc167eb0ed9b1a30ec232deed610b8..9b9694031d75cf2f4c433c56df5e3bef67936837 100644 --- a/src/FiniteDifference/eq_unit_test_3d.hpp +++ b/src/FiniteDifference/eq_unit_test_3d.cpp @@ -8,6 +8,9 @@ #ifndef OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_EQ_UNIT_TEST_3D_HPP_ #define OPENFPM_NUMERICS_SRC_FINITEDIFFERENCE_EQ_UNIT_TEST_3D_HPP_ +#define BOOST_TEST_DYN_LINK +#include + #include "config.h" #include "Laplacian.hpp" #include "FiniteDifference/eq.hpp" @@ -18,6 +21,8 @@ #include "Vector/Vector.hpp" #include "Solvers/umfpack_solver.hpp" #include "data_type/aggregate.hpp" +#include "Solvers/petsc_solver.hpp" +#include "FiniteDifference/FDScheme.hpp" BOOST_AUTO_TEST_SUITE( eq_test_suite_3d ) @@ -93,7 +98,7 @@ template void lid_driven_cavity_3d() { #include "Equations/stoke_flow_eq_3d.hpp" - Vcluster & v_cl = create_vcluster(); + Vcluster<> & v_cl = create_vcluster(); if (v_cl.getProcessingUnits() > 3) return; @@ -192,10 +197,10 @@ template void lid_driven_cavity_3d() fd.impose(v_z(), 0.0, EQ_3, {-1,-1,-1},{sz[0]-1,sz[1]-1,-1}); solver_type solver; - auto x = solver.try_solve(fd.getA(),fd.getB()); + auto x_ = solver.try_solve(fd.getA(),fd.getB()); // Bring the solution to grid - fd.template copy(x,{0,0},{sz[0]-1,sz[1]-1,sz[2]-1},g_dist); + fd.template copy(x_,{0,0},{sz[0]-1,sz[1]-1,sz[2]-1},g_dist); std::string s = std::string(demangle(typeid(solver_type).name())); s += "_"; diff --git a/src/Makefile.am b/src/Makefile.am index 5157d0577820a91e98226cf87b26febee3002b24..daaf7d879a0e47f8ffc7411e29911abbe9a5e46d 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ LINKLIBS = $(HDF5_LDFLAGS) $(HDF5_LIBS) $(OPENMP_LDFLAGS) $(LIBHILBERT_LIB) $(PETSC_LIB) $(SUITESPARSE_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(METIS_LIB) $(PARMETIS_LIB) $(DEFAULT_LIB) $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIB) $(BOOST_IOSTREAMS_LIB) $(LIBQUADMATH) $(OPENMP_LDFLAGS) $(LIBIFCORE) noinst_PROGRAMS = numerics -numerics_SOURCES = main.cpp Solvers/petsc_solver_unit_tests.cpp ../../openfpm_vcluster/src/VCluster/VCluster.cpp ../../openfpm_devices/src/memory/HeapMemory.cpp ../../openfpm_devices/src/memory/PtrMemory.cpp ../../openfpm_devices/src/Memleak_check.cpp +numerics_SOURCES = main.cpp Matrix/SparseMatrix_unit_tests.cpp interpolation/interpolation_unit_tests.cpp Vector/Vector_unit_tests.cpp Solvers/petsc_solver_unit_tests.cpp FiniteDifference/FDScheme_unit_tests.cpp FiniteDifference/eq_unit_test_3d.cpp FiniteDifference/eq_unit_test.cpp Operators/Vector/vector_dist_operators_unit_tests.cpp ../../openfpm_vcluster/src/VCluster/VCluster.cpp ../../openfpm_devices/src/memory/HeapMemory.cpp ../../openfpm_devices/src/memory/PtrMemory.cpp ../../openfpm_devices/src/Memleak_check.cpp numerics_CXXFLAGS = -Wno-unknown-pragmas -Wno-int-in-bool-context $(HDF5_CPPFLAGS) $(OPENMP_CFLAGS) $(LIBHILBERT_INCLUDE) $(AM_CXXFLAGS) $(INCLUDES_PATH) $(BOOST_CPPFLAGS) $(SUITESPARSE_INCLUDE) $(METIS_INCLUDE) $(PARMETIS_INCLUDE) $(EIGEN_INCLUDE) $(PETSC_INCLUDE) -Wno-deprecated-declarations -Wno-unused-local-typedefs numerics_CFLAGS = $(CUDA_CFLAGS) numerics_LDADD = $(LINKLIBS) -lparmetis -lmetis diff --git a/src/Matrix/SparseMatrix.hpp b/src/Matrix/SparseMatrix.hpp index 0371e504400e8a7f516b46b263c658c43a628fa7..66934ef8290157314a60048145bd6605bb6223ad 100644 --- a/src/Matrix/SparseMatrix.hpp +++ b/src/Matrix/SparseMatrix.hpp @@ -10,6 +10,8 @@ #include "config/config.h" #include "util/linalgebra_lib.hpp" +#include "Vector/map_vector.hpp" +#include "VCluster/VCluster.hpp" #ifdef HAVE_EIGEN #include diff --git a/src/Matrix/SparseMatrix_Eigen.hpp b/src/Matrix/SparseMatrix_Eigen.hpp index ce65579714f51f156b5b47114ee0d38b298b6df1..a71f171bc77d37a27f5bf69a9baab00afee4fed8 100644 --- a/src/Matrix/SparseMatrix_Eigen.hpp +++ b/src/Matrix/SparseMatrix_Eigen.hpp @@ -96,7 +96,7 @@ private: */ void assemble() { - Vcluster & vcl = create_vcluster(); + Vcluster<> & vcl = create_vcluster(); ////// On Master and only here // we assemble the Matrix from the collected data @@ -116,7 +116,7 @@ private: */ void collect() { - Vcluster & vcl = create_vcluster(); + Vcluster<> & vcl = create_vcluster(); trpl_recv.clear(); diff --git a/src/Matrix/SparseMatrix_petsc.hpp b/src/Matrix/SparseMatrix_petsc.hpp index 89c4ccd28ec1824dafbe451f5a1d4c32c81c3e85..3534924bd0a1d7c07475019b887d4cee051be6ce 100644 --- a/src/Matrix/SparseMatrix_petsc.hpp +++ b/src/Matrix/SparseMatrix_petsc.hpp @@ -217,7 +217,7 @@ public: PETSC_SAFE_CALL(MatSetType(mat,MATMPIAIJ)); PETSC_SAFE_CALL(MatSetSizes(mat,n_row_local,n_row_local,N1,N2)); - Vcluster & v_cl = create_vcluster(); + Vcluster<> & v_cl = create_vcluster(); openfpm::vector vn_row_local; v_cl.allGather(l_row,vn_row_local); @@ -305,7 +305,7 @@ public: PETSC_SAFE_CALL(MatSetSizes(mat,l_row,l_col,g_row,g_col)); - Vcluster & v_cl = create_vcluster(); + Vcluster<> & v_cl = create_vcluster(); openfpm::vector vn_row_local; v_cl.allGather(l_row,vn_row_local); diff --git a/src/Matrix/SparseMatrix_unit_tests.hpp b/src/Matrix/SparseMatrix_unit_tests.cpp similarity index 97% rename from src/Matrix/SparseMatrix_unit_tests.hpp rename to src/Matrix/SparseMatrix_unit_tests.cpp index 7a9cedeaa77c147ea2f022262995e359e23350f1..80cb5581fa83298640aa21e03b1eef86874266f8 100644 --- a/src/Matrix/SparseMatrix_unit_tests.hpp +++ b/src/Matrix/SparseMatrix_unit_tests.cpp @@ -8,6 +8,9 @@ #ifndef OPENFPM_NUMERICS_SRC_MATRIX_SPARSEMATRIX_UNIT_TESTS_HPP_ #define OPENFPM_NUMERICS_SRC_MATRIX_SPARSEMATRIX_UNIT_TESTS_HPP_ +#define BOOST_TEST_DYN_LINK +#include + #include "Matrix/SparseMatrix.hpp" #include "Vector/Vector.hpp" #include "Solvers/umfpack_solver.hpp" @@ -23,7 +26,7 @@ BOOST_AUTO_TEST_SUITE( sparse_matrix_test_suite ) BOOST_AUTO_TEST_CASE(sparse_matrix_eigen_parallel) { - Vcluster & vcl = create_vcluster(); + Vcluster<> & vcl = create_vcluster(); if (vcl.getProcessingUnits() != 3) return; @@ -172,7 +175,7 @@ BOOST_AUTO_TEST_CASE(sparse_matrix_eigen_parallel) BOOST_AUTO_TEST_CASE(sparse_matrix_eigen_petsc) { - Vcluster & vcl = create_vcluster(); + Vcluster<> & vcl = create_vcluster(); if (vcl.getProcessingUnits() != 3) return; @@ -343,7 +346,7 @@ BOOST_AUTO_TEST_CASE(sparse_matrix_eigen_petsc) BOOST_AUTO_TEST_CASE(sparse_matrix_eigen_petsc_solve) { - Vcluster & vcl = create_vcluster(); + Vcluster<> & vcl = create_vcluster(); if (vcl.getProcessingUnits() != 3) return; diff --git a/src/Operators/Vector/vector_dist_operators_unit_tests.hpp b/src/Operators/Vector/vector_dist_operators_unit_tests.cpp similarity index 99% rename from src/Operators/Vector/vector_dist_operators_unit_tests.hpp rename to src/Operators/Vector/vector_dist_operators_unit_tests.cpp index d2d7a125d09e3ab6056238f27650fd7fa5c53da5..2d6f2a958f620f1ff8f2723f9629f29730d903ab 100644 --- a/src/Operators/Vector/vector_dist_operators_unit_tests.hpp +++ b/src/Operators/Vector/vector_dist_operators_unit_tests.cpp @@ -8,6 +8,9 @@ #ifndef OPENFPM_NUMERICS_SRC_OPERATORS_VECTOR_VECTOR_DIST_OPERATORS_UNIT_TESTS_HPP_ #define OPENFPM_NUMERICS_SRC_OPERATORS_VECTOR_VECTOR_DIST_OPERATORS_UNIT_TESTS_HPP_ +#define BOOST_TEST_DYN_LINK +#include + #include "Operators/Vector/vector_dist_operators.hpp" constexpr int A = 0; diff --git a/src/PSE/Kernels_unit_tests.hpp b/src/PSE/Kernels_unit_tests.hpp index fcbcec1255c494cda326bbb397f6132cacf59d14..99a1093d5b387a1cdff3409f4fb856089ad77651 100644 --- a/src/PSE/Kernels_unit_tests.hpp +++ b/src/PSE/Kernels_unit_tests.hpp @@ -17,7 +17,7 @@ BOOST_AUTO_TEST_SUITE( pse_kernels_unit_tests ) BOOST_AUTO_TEST_CASE( pse_ker ) { - Vcluster & v_cl = create_vcluster(); + Vcluster<> & v_cl = create_vcluster(); // This test is not made to run in parallel if (v_cl.getProcessingUnits() > 1) diff --git a/src/Solvers/umfpack_solver.hpp b/src/Solvers/umfpack_solver.hpp index 0ea505092fc7cf8937f595c94fb90fca28baf489..555236a64de7babb09613c8d37a9bb2129998adc 100644 --- a/src/Solvers/umfpack_solver.hpp +++ b/src/Solvers/umfpack_solver.hpp @@ -71,7 +71,7 @@ public: */ static Vector solve(SparseMatrix & A, const Vector & b, size_t opt = UMFPACK_NONE) { - Vcluster & vcl = create_vcluster(); + Vcluster<> & vcl = create_vcluster(); Vector x; diff --git a/src/Vector/Vector_eigen.hpp b/src/Vector/Vector_eigen.hpp index 243ef5c24e51939bca340137473226e0d3408833..b20d5162ee6969e61135d474e386aed60d8cfe97 100644 --- a/src/Vector/Vector_eigen.hpp +++ b/src/Vector/Vector_eigen.hpp @@ -107,7 +107,7 @@ class Vector */ void collect() const { - Vcluster & vcl = create_vcluster(); + Vcluster<> & vcl = create_vcluster(); row_val_recv.clear(); @@ -329,7 +329,7 @@ public: void scatter() { row_val_recv.clear(); - Vcluster & vcl = create_vcluster(); + Vcluster<> & vcl = create_vcluster(); vcl.SScatter(row_val,row_val_recv,prc,sz,0); diff --git a/src/Vector/Vector_unit_tests.hpp b/src/Vector/Vector_unit_tests.cpp similarity index 96% rename from src/Vector/Vector_unit_tests.hpp rename to src/Vector/Vector_unit_tests.cpp index f2e44b9af97970bd11e85dfc520d1f94948e1928..2dc9be20240600a39df19a14983bc52f6aa70d92 100644 --- a/src/Vector/Vector_unit_tests.hpp +++ b/src/Vector/Vector_unit_tests.cpp @@ -8,13 +8,18 @@ #ifndef OPENFPM_NUMERICS_SRC_VECTOR_VECTOR_UNIT_TESTS_HPP_ #define OPENFPM_NUMERICS_SRC_VECTOR_VECTOR_UNIT_TESTS_HPP_ +#define BOOST_TEST_DYN_LINK +#include +#include + +#include #include "Vector/Vector.hpp" BOOST_AUTO_TEST_SUITE( vector_test_suite ) BOOST_AUTO_TEST_CASE(vector_eigen_parallel) { - Vcluster & vcl = create_vcluster(); + Vcluster<> & vcl = create_vcluster(); if (vcl.getProcessingUnits() != 3) return; @@ -133,7 +138,7 @@ BOOST_AUTO_TEST_CASE(vector_eigen_parallel) BOOST_AUTO_TEST_CASE(vector_petsc_parallel) { - Vcluster & vcl = create_vcluster(); + Vcluster<> & vcl = create_vcluster(); if (vcl.getProcessingUnits() != 3) return; diff --git a/src/config/config_cmake.h.in b/src/config/config_cmake.h.in new file mode 100644 index 0000000000000000000000000000000000000000..a0d62c9edc325fad8f80ce5ca11c06c068f57baf --- /dev/null +++ b/src/config/config_cmake.h.in @@ -0,0 +1,159 @@ +/* Coverty scan */ +${DEFINE_COVERTY_SCAN} + +/* GPU support */ +${DEFINE_CUDA_GPU} + +/* Debug */ +${DEFINE_DEBUG} /**/ + +/* Debug */ +${DEFINE_DEBUG_MODE} /**/ + +/* Define to dummy `main' function (if any) required to link to the Fortran + libraries. */ +${DEFINE_F77_DUMMY_MAIN} + +/* Define if F77 and FC dummy `main' functions are identical. */ +${DEFINE_FC_DUMMY_MAIN_EQ_F77} + +/* Define if you have a BLAS library. */ +${DEFINE_HAVE_BLAS} + +/* define if the Boost library is available */ +${DEFINE_HAVE_BOOST} + +/* define if the Boost::IOStreams library is available */ +${DEFINE_HAVE_BOOST_IOSTREAMS} /**/ + +/* define if the Boost::PROGRAM_OPTIONS library is available */ +${DEFINE_HAVE_BOOST_PROGRAM_OPTIONS} /**/ + +/* define if the Boost::Unit_Test_Framework library is available */ +${DEFINE_HAVE_BOOST_UNIT_TEST_FRAMEWORK} /**/ + +/* Have clock time */ +${DEFINE_HAVE_CLOCK_GETTIME} /**/ + +/* Define to 1 if you have the header file. */ +${DEFINE_HAVE_DLFCN_H} + +/* Define if you have EIGEN library. */ +${DEFINE_HAVE_EIGEN} + +/* Define to 1 if you have the header file. */ +${DEFINE_HAVE_EIGEN_DENSE} + +/* Define to 1 if you have the header file. */ +${DEFINE_HAVE_EIGEN_LU} + +/* Defined if you have HDF5 support */ +${DEFINE_HAVE_HDF5} + +/* Define to 1 if you have the header file. */ +${DEFINE_HAVE_INTTYPES_H} + +/* Define if you have LAPACK library */ +${DEFINE_HAVE_LAPACK} + +/* Define if you have LIBHILBERT library */ +${DEFINE_HAVE_LIBHILBERT} + +/* Have quad math lib */ +${DEFINE_HAVE_LIBQUADMATH} + +/* Define to 1 if you have the header file. */ +${DEFINE_HAVE_MEMORY_H} + +/* Define if you have METIS library */ +${DEFINE_HAVE_METIS} + +/* MPI Enabled */ +${DEFINE_HAVE_MPI} + +/* We have OSX */ +${DEFINE_HAVE_OSX} + +/* Define if you have PARMETIS library */ +${DEFINE_HAVE_PARMETIS} + +/* Define if you have PETSC library */ +${DEFINE_HAVE_PETSC} + +/* Define to 1 if you have the header file. */ +${DEFINE_HAVE_STDINT_H} + +/* Define to 1 if you have the header file. */ +${DEFINE_HAVE_STDLIB_H} + +/* Define to 1 if you have the header file. */ +${DEFINE_HAVE_STRINGS_H} + +/* Define to 1 if you have the header file. */ +${DEFINE_HAVE_STRING_H} + +/* Define if you have SUITESPARSE library. */ +${DEFINE_HAVE_SUITESPARSE} + +/* Define to 1 if you have the header file. */ +${DEFINE_HAVE_SYS_STAT_H} + +/* Define to 1 if you have the header file. */ +${DEFINE_HAVE_SYS_TYPES_H} + +/* Define to 1 if you have the header file. */ +${DEFINE_HAVE_UNISTD_H} + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* NVCC compiling */ +${DEFINE_NVCC} /**/ + +/* Name of package */ +#define PACKAGE "openfpm_pdata" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "BUG-REPORT-ADDRESS" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "OpenFPM_pdata" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "OpenFPM_pdata 1.0.0" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "openfpm_pdata" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.0.0" + +/* Test performance mode */ +${DEFINE_PERFORMANCE_TEST} + +/* Security enhancement class 1 */ +${DEFINE_SE_CLASS1} + +/* Security enhancement class 2 */ +${DEFINE_SE_CLASS2} + +/* Security enhancement class 3 */ +${DEFINE_SE_CLASS3} + +/* Define to 1 if you have the ANSI C header files. */ +${DEFINE_STDC_HEADERS} + +/* If an error occur stop the program */ +${DEFINE_STOP_ON_ERROR} + +/* Test coverage mode */ +${DEFINE_TEST_COVERAGE_MODE} + +/* when an error accur continue but avoid unsafe operation */ +/* #undef THROW_ON_ERROR */ + +/* Version number of package */ +#define VERSION "1.0.0" diff --git a/src/interpolation/interpolation_unit_tests.hpp b/src/interpolation/interpolation_unit_tests.cpp similarity index 98% rename from src/interpolation/interpolation_unit_tests.hpp rename to src/interpolation/interpolation_unit_tests.cpp index 6a73dc8e919e39a05c5a929116236adf6dfdc817..9512a73fe31ea2539e418a789002d5c6654989f3 100644 --- a/src/interpolation/interpolation_unit_tests.hpp +++ b/src/interpolation/interpolation_unit_tests.cpp @@ -8,9 +8,15 @@ #ifndef OPENFPM_NUMERICS_SRC_INTERPOLATION_INTERPOLATION_UNIT_TESTS_HPP_ #define OPENFPM_NUMERICS_SRC_INTERPOLATION_INTERPOLATION_UNIT_TESTS_HPP_ +#define BOOST_TEST_DYN_LINK +#include + #include "interpolation/mp4_kernel.hpp" #include "interpolation/z_spline.hpp" #include "interpolation.hpp" +#include +#include +#include BOOST_AUTO_TEST_SUITE( interpolation_test ) diff --git a/src/main.cpp b/src/main.cpp index fdb08845570c9f532770a5cf3b80a773ec90cecb..163e93ac938399cfdca7755ce004755e4cb6be00 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,14 +6,7 @@ #include "unit_test_init_cleanup.hpp" #include "config.h" -#include "Vector/Vector_unit_tests.hpp" -#include "Matrix/SparseMatrix_unit_tests.hpp" -#include "FiniteDifference/FDScheme_unit_tests.hpp" #include "FiniteDifference/util/common_test.hpp" -#include "FiniteDifference/eq_unit_test.hpp" -#include "FiniteDifference/eq_unit_test_3d.hpp" #include "util/util_num_unit_tests.hpp" #include "PSE/Kernels_unit_tests.hpp" -#include "Operators/Vector/vector_dist_operators_unit_tests.hpp" #include "Draw/DrawParticles_unit_tests.hpp" -#include "interpolation/interpolation_unit_tests.hpp" diff --git a/src/util/grid_dist_testing.hpp b/src/util/grid_dist_testing.hpp index cba4505a2cfdddc24d487db9e964b876ae7cd095..0d5020bc4d93430ca3a518b6952acc485fcaf099 100644 --- a/src/util/grid_dist_testing.hpp +++ b/src/util/grid_dist_testing.hpp @@ -9,6 +9,8 @@ #define OPENFPM_NUMERICS_SRC_UTIL_GRID_DIST_TESTING_HPP_ #include "Grid/grid_dist_key.hpp" +#include "Grid/grid_dist_key.hpp" +#include "Grid/map_grid.hpp" template class grid_dist_testing