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

Merge branch 'FD_solver' into 'develop'

Odeint Extra Structures

See merge request openfpm/openfpm_numerics!9
parents ea756d65 c63e8164
Branches
1 merge request!9Odeint Extra Structures
......@@ -39,10 +39,17 @@ namespace boost { namespace numeric { namespace odeint {
};
} } }
/*! \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(){
}
//Laplacian Lap;
typedef size_t size_type;
typedef int is_state_vector;
aggregate<texp_v<double>> data;
......@@ -56,11 +63,16 @@ struct state_type_1d_ofp{
}
};
/*! \brief A 2d 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_2d_ofp{
state_type_2d_ofp(){
}
//Laplacian Lap;
typedef size_t size_type;
typedef int is_state_vector;
aggregate<texp_v<double>,texp_v<double>> data;
......@@ -75,11 +87,16 @@ struct state_type_2d_ofp{
}
};
/*! \brief A 3d 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_3d_ofp{
state_type_3d_ofp(){
}
//Laplacian Lap;
typedef size_t size_type;
typedef int is_state_vector;
aggregate<texp_v<double>,texp_v<double>,texp_v<double>> data;
......@@ -95,6 +112,60 @@ struct state_type_3d_ofp{
}
};
/*! \brief A 4d 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_4d_ofp{
state_type_4d_ofp(){
}
typedef size_t size_type;
typedef int is_state_vector;
aggregate<texp_v<double>,texp_v<double>,texp_v<double>,texp_v<double>> data;
size_t size() const
{ return data.get<0>().size(); }
void resize(size_t n)
{
data.get<0>().resize(n);
data.get<1>().resize(n);
data.get<2>().resize(n);
data.get<3>().resize(n);
}
};
/*! \brief A 5d 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_5d_ofp{
state_type_5d_ofp(){
}
typedef size_t size_type;
typedef int is_state_vector;
aggregate<texp_v<double>,texp_v<double>,texp_v<double>,texp_v<double>,texp_v<double>> data;
size_t size() const
{ return data.get<0>().size(); }
void resize(size_t n)
{
data.get<0>().resize(n);
data.get<1>().resize(n);
data.get<2>().resize(n);
data.get<3>().resize(n);
data.get<4>().resize(n);
}
};
namespace boost {
namespace numeric {
namespace odeint {
......@@ -115,6 +186,16 @@ namespace boost {
typedef boost::true_type type;
static const bool value = type::value;
};
template<>
struct is_resizeable<state_type_4d_ofp> {
typedef boost::true_type type;
static const bool value = type::value;
};
template<>
struct is_resizeable<state_type_5d_ofp> {
typedef boost::true_type type;
static const bool value = type::value;
};
......@@ -136,6 +217,18 @@ namespace boost {
typedef double result_type;
};
template<>
struct vector_space_norm_inf<state_type_4d_ofp>
{
typedef double result_type;
};
template<>
struct vector_space_norm_inf<state_type_5d_ofp>
{
typedef double result_type;
};
}
}
}
......
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