Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TurTLE
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TurTLE
TurTLE
Commits
db9d9248
Commit
db9d9248
authored
Oct 23, 2020
by
Cristian Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
documents abstract_particle_rhs
parent
e0d41803
No related branches found
No related tags found
No related merge requests found
Pipeline
#84962
passed
Oct 23, 2020
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cpp/particles/abstract_particle_rhs.hpp
+52
-9
52 additions, 9 deletions
cpp/particles/abstract_particle_rhs.hpp
with
52 additions
and
9 deletions
cpp/particles/abstract_particle_rhs.hpp
+
52
−
9
View file @
db9d9248
...
...
@@ -28,7 +28,17 @@
#include
"particles/interpolation/abstract_particle_set.hpp"
// children of this class must provide a method to compute the rhs for a given particle set
/** Particle model definition, i.e. provides right-hand-side of ODEs
*
* This abstract class prescribes the way that particle models shall be
* implemented in TurTLE.
* Children of this class must implement a "function call" operator,
* where the right-hand-side of the corresponding ODE shall be computed,
* as well as an "imposeModelConstraints" method where miscellaneous properties
* can be enforced as needed (an example would be orientation vectors being
* reset to unit lenght).
*
*/
class
abstract_particle_rhs
{
protected:
...
...
@@ -37,21 +47,54 @@ class abstract_particle_rhs
// destructor
virtual
~
abstract_particle_rhs
(){}
// a way to probe the dimension of the ODE
/** Probe the dimension of the ODE
*/
virtual
const
int
getStateSize
()
const
=
0
;
// important bit
// may resort particles, therefore it takes the
// parameter `additional_data` to possibly resort other arrays
/** Compute right-hand-side of the ODE
*
* Notes
* -----
* 1. This method may shuffle particle data in-memory, but
* it may not redistribute particles between MPI processes.
* The `additional_data` parameter allows for other particle data to be
* shuffled in the same fashion.
* In particular, you may use `additional_data` when computing substeps
* for Runge Kutta methods to keep the different temporary arrays in
* the same order.
* Please see implementation of the Heun method for an example.
*
* For completeness: shuffling of data will at least take place during
* the computation of particle-to-particle interaction terms.
*
* 2. This method may not modify the current state of the particles.
* I cannot mark the parameter `abstract_particle_set &pset` as
* `const` because the arrays may need to be shuffled, but separate
* parts of the code rely on the fact that this method does not change
* the state of the particle set.
* If your particle model has strict constraints that affect the
* computation of the right-hand side, you must ensure that those
* constraints are respected within this method *without* modifying
* the current particle state.
* Otherwise the ODE may not be integrated correctly.
*/
virtual
int
operator
()(
double
t
,
abstract_particle_set
&
pset
,
particle_rnumber
*
result
,
std
::
vector
<
std
::
unique_ptr
<
abstract_particle_set
::
particle_rnumber
[]
>>
&
additional_data
)
=
0
;
// for post-timestep actions such as
// normalization of orientation vector
std
::
vector
<
std
::
unique_ptr
<
abstract_particle_set
::
particle_rnumber
[]
>>
&
additional_data
)
=
0
;
/** Enforce model constraints on a set of particles
*
* Note:
* This is meant to be used as a safe-guard against growth of small
* errors.
* As an example, shaped particles for which orientation must be tracked
* through time may slowly develop non-unit-sized orientation vectors.
* This method will change the particle states such that any such
* constraints are respected.
*/
virtual
int
imposeModelConstraints
(
abstract_particle_set
&
pset
)
const
=
0
;
};
...
...
...
...
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
sign in
to comment