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
36506fb6
Commit
36506fb6
authored
2 years ago
by
Abhinav Singh
Browse files
Options
Downloads
Patches
Plain Diff
adding relevant if def
parent
b95ece0b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OdeIntegrators/OdeIntegrators.hpp
+37
-37
37 additions, 37 deletions
src/OdeIntegrators/OdeIntegrators.hpp
src/OdeIntegrators/tests/Odeintegrators_test_gpu.cu
+2
-0
2 additions, 0 deletions
src/OdeIntegrators/tests/Odeintegrators_test_gpu.cu
with
39 additions
and
37 deletions
src/OdeIntegrators/OdeIntegrators.hpp
+
37
−
37
View file @
36506fb6
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/OdeIntegrators/tests/Odeintegrators_test_gpu.cu
+
2
−
0
View file @
36506fb6
...
...
@@ -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
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