Commit f0f5fc63 authored by incardon's avatar incardon

Small refactor

parent 4e569e3b
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "Grid/grid_dist_id.hpp" #include "Grid/grid_dist_id.hpp"
#include "Grid/Iterators/grid_dist_id_iterator_sub.hpp" #include "Grid/Iterators/grid_dist_id_iterator_sub.hpp"
#include "eq.hpp" #include "eq.hpp"
#include "data_type/scalar.hpp"
#include "NN/CellList/CellDecomposer.hpp" #include "NN/CellList/CellDecomposer.hpp"
#include "Grid/staggered_dist_grid_util.hpp" #include "Grid/staggered_dist_grid_util.hpp"
#include "Grid/grid_dist_id.hpp" #include "Grid/grid_dist_id.hpp"
...@@ -127,7 +126,7 @@ class FDScheme ...@@ -127,7 +126,7 @@ class FDScheme
public: public:
//! Distributed grid map //! Distributed grid map
typedef grid_dist_id<Sys_eqs::dims,typename Sys_eqs::stype,scalar<size_t>,typename Sys_eqs::b_grid::decomposition::extended_type> g_map_type; typedef grid_dist_id<Sys_eqs::dims,typename Sys_eqs::stype,aggregate<size_t>,typename Sys_eqs::b_grid::decomposition::extended_type> g_map_type;
//! Type that specify the properties of the system of equations //! Type that specify the properties of the system of equations
typedef Sys_eqs Sys_eqs_typ; typedef Sys_eqs Sys_eqs_typ;
......
...@@ -37,7 +37,7 @@ struct sys_nn ...@@ -37,7 +37,7 @@ struct sys_nn
typedef float stype; typedef float stype;
//! Base grid //! Base grid
typedef grid_dist_id<dims,stype,scalar<float>,CartDecomposition<2,stype> > b_grid; typedef grid_dist_id<dims,stype,aggregate<float>,CartDecomposition<2,stype> > b_grid;
//! specify that we are on testing //! specify that we are on testing
typedef void testing; typedef void testing;
...@@ -60,7 +60,7 @@ struct sys_pp ...@@ -60,7 +60,7 @@ struct sys_pp
typedef float stype; typedef float stype;
//! Base grid //! Base grid
typedef grid_dist_id<dims,stype,scalar<float>,CartDecomposition<2,stype> > b_grid; typedef grid_dist_id<dims,stype,aggregate<float>,CartDecomposition<2,stype> > b_grid;
//! Indicate we are on testing //! Indicate we are on testing
typedef void testing; typedef void testing;
...@@ -89,7 +89,7 @@ struct syss_nn ...@@ -89,7 +89,7 @@ struct syss_nn
typedef float stype; typedef float stype;
//! Base grid //! Base grid
typedef grid_dist_id<dims,stype,scalar<float>,CartDecomposition<2,stype> > b_grid; typedef grid_dist_id<dims,stype,aggregate<float>,CartDecomposition<2,stype> > b_grid;
//! Indicate we are on testing //! Indicate we are on testing
typedef void testing; typedef void testing;
...@@ -115,7 +115,7 @@ struct syss_pp ...@@ -115,7 +115,7 @@ struct syss_pp
typedef float stype; typedef float stype;
//! Base grid //! Base grid
typedef grid_dist_id<dims,stype,scalar<float>,CartDecomposition<2,stype> > b_grid; typedef grid_dist_id<dims,stype,aggregate<float>,CartDecomposition<2,stype> > b_grid;
//! Indicate we are on testing //! Indicate we are on testing
typedef void testing; typedef void testing;
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
//#define PERIODIC true //#define PERIODIC true
//#define NON_PERIODIC false //#define NON_PERIODIC false
#include "data_type/scalar.hpp"
#include "util/util_num.hpp" #include "util/util_num.hpp"
/*! \brief Equation /*! \brief Equation
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "FiniteDifference/sum.hpp" #include "FiniteDifference/sum.hpp"
#include "FiniteDifference/mul.hpp" #include "FiniteDifference/mul.hpp"
#include "Grid/grid_dist_id.hpp" #include "Grid/grid_dist_id.hpp"
#include "data_type/scalar.hpp"
#include "Decomposition/CartDecomposition.hpp" #include "Decomposition/CartDecomposition.hpp"
#include "Vector/Vector.hpp" #include "Vector/Vector.hpp"
#include "Solvers/umfpack_solver.hpp" #include "Solvers/umfpack_solver.hpp"
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "FiniteDifference/sum.hpp" #include "FiniteDifference/sum.hpp"
#include "FiniteDifference/mul.hpp" #include "FiniteDifference/mul.hpp"
#include "Grid/grid_dist_id.hpp" #include "Grid/grid_dist_id.hpp"
#include "data_type/scalar.hpp"
#include "Decomposition/CartDecomposition.hpp" #include "Decomposition/CartDecomposition.hpp"
#include "Vector/Vector.hpp" #include "Vector/Vector.hpp"
#include "Solvers/umfpack_solver.hpp" #include "Solvers/umfpack_solver.hpp"
......
...@@ -55,7 +55,7 @@ struct const_mul_functor_value ...@@ -55,7 +55,7 @@ struct const_mul_functor_value
const grid_sm<last::dims,void> & gs; const grid_sm<last::dims,void> & gs;
//! grid mapping //! grid mapping
const grid_dist_id<last::dims,typename last::stype,scalar<size_t>,typename last::b_grid::decomposition::extended_type> & g_map; const grid_dist_id<last::dims,typename last::stype,aggregate<size_t>,typename last::b_grid::decomposition::extended_type> & g_map;
//! grid position //! grid position
grid_dist_key_dx<last::dims> & kmap; grid_dist_key_dx<last::dims> & kmap;
...@@ -76,7 +76,7 @@ struct const_mul_functor_value ...@@ -76,7 +76,7 @@ struct const_mul_functor_value
* \param coeff multiplication coefficent * \param coeff multiplication coefficent
* *
*/ */
const_mul_functor_value(const grid_dist_id<last::dims,typename last::stype,scalar<size_t>,typename last::b_grid::decomposition::extended_type> & g_map, const_mul_functor_value(const grid_dist_id<last::dims,typename last::stype,aggregate<size_t>,typename last::b_grid::decomposition::extended_type> & g_map,
grid_dist_key_dx<last::dims> & kmap, grid_dist_key_dx<last::dims> & kmap,
const grid_sm<last::dims,void> & gs, const grid_sm<last::dims,void> & gs,
typename last::stype (& spacing)[last::dims], typename last::stype (& spacing)[last::dims],
...@@ -137,7 +137,7 @@ struct mul ...@@ -137,7 +137,7 @@ struct mul
* \param coeff coefficent (constant in front of the derivative) * \param coeff coefficent (constant in front of the derivative)
* *
*/ */
inline static void value(const grid_dist_id<Sys_eqs::dims,typename Sys_eqs::stype,scalar<size_t>,typename Sys_eqs::b_grid::decomposition::extended_type> & g_map, inline static void value(const grid_dist_id<Sys_eqs::dims,typename Sys_eqs::stype,aggregate<size_t>,typename Sys_eqs::b_grid::decomposition::extended_type> & g_map,
grid_dist_key_dx<Sys_eqs::dims> & kmap, grid_dist_key_dx<Sys_eqs::dims> & kmap,
const grid_sm<Sys_eqs::dims,void> & gs, const grid_sm<Sys_eqs::dims,void> & gs,
typename Sys_eqs::stype (& spacing )[Sys_eqs::dims], typename Sys_eqs::stype (& spacing )[Sys_eqs::dims],
......
...@@ -3,7 +3,7 @@ LINKLIBS = $(HDF5_LDFLAGS) $(HDF5_LIBS) $(OPENMP_LDFLAGS) $(LIBHILBERT_LIB) $(P ...@@ -3,7 +3,7 @@ LINKLIBS = $(HDF5_LDFLAGS) $(HDF5_LIBS) $(OPENMP_LDFLAGS) $(LIBHILBERT_LIB) $(P
noinst_PROGRAMS = numerics 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 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_CXXFLAGS = $(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_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_CFLAGS = $(CUDA_CFLAGS)
numerics_LDADD = $(LINKLIBS) -lparmetis -lmetis numerics_LDADD = $(LINKLIBS) -lparmetis -lmetis
nobase_include_HEADERS = Matrix/SparseMatrix.hpp Matrix/SparseMatrix_Eigen.hpp Matrix/SparseMatrix_petsc.hpp \ nobase_include_HEADERS = Matrix/SparseMatrix.hpp Matrix/SparseMatrix_Eigen.hpp Matrix/SparseMatrix_petsc.hpp \
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#ifndef OPENFPM_NUMERICS_SRC_INTERPOLATION_INTERPOLATION_HPP_ #ifndef OPENFPM_NUMERICS_SRC_INTERPOLATION_INTERPOLATION_HPP_
#define OPENFPM_NUMERICS_SRC_INTERPOLATION_INTERPOLATION_HPP_ #define OPENFPM_NUMERICS_SRC_INTERPOLATION_INTERPOLATION_HPP_
#include "NN/CellList/MemFast.hpp" #include "NN/Mem_type/MemFast.hpp"
#include "NN/CellList/CellList.hpp" #include "NN/CellList/CellList.hpp"
#include "Grid/grid_dist_key.hpp" #include "Grid/grid_dist_key.hpp"
...@@ -293,7 +293,7 @@ struct calculate_aint<3,vector,np> ...@@ -293,7 +293,7 @@ struct calculate_aint<3,vector,np>
*/ */
template<typename vector, typename grid> template<typename vector, typename grid>
inline size_t getSub(Point<vector::dims,typename vector::stype> & p, inline size_t getSub(Point<vector::dims,typename vector::stype> & p,
const CellList<vector::dims,typename vector::stype,Mem_fast,shift<vector::dims,typename vector::stype>> & geo_cell, const CellList<vector::dims,typename vector::stype,Mem_fast<>,shift<vector::dims,typename vector::stype>> & geo_cell,
grid & gd) grid & gd)
{ {
size_t cell = geo_cell.getCell(p); size_t cell = geo_cell.getCell(p);
...@@ -419,7 +419,7 @@ struct inte_calc_impl ...@@ -419,7 +419,7 @@ struct inte_calc_impl
typename vector::stype (& a)[vector::dims][kernel::np], typename vector::stype (& a)[vector::dims][kernel::np],
typename vector::stype (& x)[vector::dims][kernel::np], typename vector::stype (& x)[vector::dims][kernel::np],
size_t (& sz)[vector::dims], size_t (& sz)[vector::dims],
const CellList<vector::dims,typename vector::stype,Mem_fast,shift<vector::dims,typename vector::stype>> & geo_cell, const CellList<vector::dims,typename vector::stype,Mem_fast<>,shift<vector::dims,typename vector::stype>> & geo_cell,
openfpm::vector<agg_arr<openfpm::math::pow(kernel::np,vector::dims)>> & offsets) openfpm::vector<agg_arr<openfpm::math::pow(kernel::np,vector::dims)>> & offsets)
{ {
auto key_p = it.get(); auto key_p = it.get();
...@@ -504,7 +504,7 @@ template<typename vector,typename grid, typename kernel> ...@@ -504,7 +504,7 @@ template<typename vector,typename grid, typename kernel>
class interpolate class interpolate
{ {
//! Cell list used to convert particles position to sub-domain //! Cell list used to convert particles position to sub-domain
CellList<vector::dims,typename vector::stype,Mem_fast,shift<vector::dims,typename vector::stype>> geo_cell; CellList<vector::dims,typename vector::stype,Mem_fast<>,shift<vector::dims,typename vector::stype>> geo_cell;
/*! Structure to order boxes by volume /*! Structure to order boxes by volume
* *
......
...@@ -8,13 +8,12 @@ ...@@ -8,13 +8,12 @@
#ifndef OPENFPM_NUMERICS_SRC_UTIL_GRID_DIST_TESTING_HPP_ #ifndef OPENFPM_NUMERICS_SRC_UTIL_GRID_DIST_TESTING_HPP_
#define OPENFPM_NUMERICS_SRC_UTIL_GRID_DIST_TESTING_HPP_ #define OPENFPM_NUMERICS_SRC_UTIL_GRID_DIST_TESTING_HPP_
#include "data_type/scalar.hpp"
#include "Grid/grid_dist_key.hpp" #include "Grid/grid_dist_key.hpp"
template<unsigned int dim> template<unsigned int dim>
class grid_dist_testing class grid_dist_testing
{ {
grid_cpu<dim,scalar<size_t>> grid_test; grid_cpu<dim,aggregate<size_t>> grid_test;
public: public:
......
...@@ -91,7 +91,7 @@ template<typename T, unsigned int dims, typename stype, typename decomposition> ...@@ -91,7 +91,7 @@ template<typename T, unsigned int dims, typename stype, typename decomposition>
struct stub_or_real<T,dims,stype,decomposition,false> struct stub_or_real<T,dims,stype,decomposition,false>
{ {
//! switch type if we are on testing or not //! switch type if we are on testing or not
typedef grid_dist_id<dims,stype,scalar<size_t>,decomposition> type; typedef grid_dist_id<dims,stype,aggregate<size_t>,decomposition> type;
}; };
#endif /* OPENFPM_NUMERICS_SRC_UTIL_UTIL_NUM_HPP_ */ #endif /* OPENFPM_NUMERICS_SRC_UTIL_UTIL_NUM_HPP_ */
...@@ -97,7 +97,7 @@ BOOST_AUTO_TEST_CASE( util_num ) ...@@ -97,7 +97,7 @@ BOOST_AUTO_TEST_CASE( util_num )
ret = std::is_same<stub_or_real<on_test,2,float,CartDecomposition<2,float>>::type, grid_dist_testing<2>>::value ; ret = std::is_same<stub_or_real<on_test,2,float,CartDecomposition<2,float>>::type, grid_dist_testing<2>>::value ;
BOOST_REQUIRE_EQUAL(ret,true); BOOST_REQUIRE_EQUAL(ret,true);
ret = std::is_same<stub_or_real<not_on_test,2,float,CartDecomposition<2,float>>::type, grid_dist_id<2,float,scalar<size_t>,CartDecomposition<2,float>> >::value; ret = std::is_same<stub_or_real<not_on_test,2,float,CartDecomposition<2,float>>::type, grid_dist_id<2,float,aggregate<size_t>,CartDecomposition<2,float>> >::value;
BOOST_REQUIRE_EQUAL(ret,true); BOOST_REQUIRE_EQUAL(ret,true);
//! [Usage of stub_or_real] //! [Usage of stub_or_real]
......
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