Skip to content
Snippets Groups Projects
Commit 36506fb6 authored by Abhinav Singh's avatar Abhinav Singh
Browse files

adding relevant if def

parent b95ece0b
No related branches found
No related tags found
No related merge requests found
......@@ -31,41 +31,6 @@ namespace boost{
#ifdef __NVCC__
#include "OdeIntegrators/vector_algebra_ofp_gpu.hpp"
#endif
namespace boost { namespace numeric { namespace odeint {
template<typename T>
struct is_resizeable< vector_dist_expression<0,openfpm::vector<aggregate<T>> > >
{
typedef boost::true_type type;
static const bool value = type::value;
};
} } }
/*! \brief A 1d Odeint and Openfpm compatible structure.
*
* Use the method this.data.get<d>() to refer to property of all the particles in the dimension d.
*
* d starts with 0.
*
*/
struct state_type_1d_ofp{
state_type_1d_ofp(){
}
typedef size_t size_type;
typedef int is_state_vector;
aggregate<texp_v<double>> data;
size_t size() const
{ return data.get<0>().size(); }
void resize(size_t n)
{
data.get<0>().resize(n);
}
};
/*! \brief A 1d Odeint and Openfpm compatible structure.
*
* Use the method this.data.get<d>() to refer to property of all the particles in the dimension d.
......@@ -113,6 +78,41 @@ struct state_type_1d_ofp_gpu{
return s1_ker;
}
};
#endif
namespace boost { namespace numeric { namespace odeint {
template<typename T>
struct is_resizeable< vector_dist_expression<0,openfpm::vector<aggregate<T>> > >
{
typedef boost::true_type type;
static const bool value = type::value;
};
} } }
/*! \brief A 1d Odeint and Openfpm compatible structure.
*
* Use the method this.data.get<d>() to refer to property of all the particles in the dimension d.
*
* d starts with 0.
*
*/
struct state_type_1d_ofp{
state_type_1d_ofp(){
}
typedef size_t size_type;
typedef int is_state_vector;
aggregate<texp_v<double>> data;
size_t size() const
{ return data.get<0>().size(); }
void resize(size_t n)
{
data.get<0>().resize(n);
}
};
/*! \brief A 2d Odeint and Openfpm compatible structure.
*
......@@ -225,13 +225,13 @@ namespace boost {
typedef boost::true_type type;
static const bool value = type::value;
};
#ifdef __NVCC__
template<>
struct is_resizeable<state_type_1d_ofp_gpu> {
typedef boost::true_type type;
static const bool value = type::value;
};
#endif
template<>
struct is_resizeable<state_type_2d_ofp> {
typedef boost::true_type type;
......
......@@ -14,6 +14,7 @@
#include "Operators/Vector/vector_dist_operators.hpp"
#include "OdeIntegrators/OdeIntegrators.hpp"
//#include "DCPSE/DCPSE_op/DCPSE_op.hpp"
#ifdef __NVCC__
typedef state_type_1d_ofp_gpu state_type;
//const double a = 2.8e-4;
......@@ -100,3 +101,4 @@ BOOST_AUTO_TEST_CASE(odeint_base_test_gpu)
BOOST_REQUIRE(worst < 1e-6);
}
BOOST_AUTO_TEST_SUITE_END()
#endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment