Commit a8e821cf authored by incardon's avatar incardon

Eliminating scalar data_type

parent 77ebd35b
...@@ -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],
......
...@@ -75,6 +75,16 @@ public: ...@@ -75,6 +75,16 @@ public:
row() = i; row() = i;
value() = val; value() = val;
} }
/*! \brief Indicate that the structure has no pointer
*
* \return true
*
*/
static inline bool noPointers()
{
return true;
}
}; };
template<typename T> template<typename T>
......
...@@ -78,6 +78,16 @@ public: ...@@ -78,6 +78,16 @@ public:
rw() = i; rw() = i;
val() = val; val() = val;
} }
/*! \brief Indicate that the structure has no pointer
*
* \return true
*
*/
static inline bool noPointers()
{
return true;
}
}; };
constexpr unsigned int row_id = 0; constexpr unsigned int row_id = 0;
......
...@@ -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