Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openfpm_numerics
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sbalzarini Lab
Software
Parallel Computing
OpenFPM
openfpm_numerics
Commits
c63e8164
Commit
c63e8164
authored
3 years ago
by
Abhinav Singh
Browse files
Options
Downloads
Patches
Plain Diff
adding more structures
parent
0d96ba85
No related branches found
Branches containing commit
No related tags found
1 merge request
!9
Odeint Extra Structures
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/OdeIntegrators/OdeIntegrators.hpp
+98
-5
98 additions, 5 deletions
src/OdeIntegrators/OdeIntegrators.hpp
with
98 additions
and
5 deletions
src/OdeIntegrators/OdeIntegrators.hpp
+
98
−
5
View file @
c63e8164
...
...
@@ -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
;
};
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment