Particle field state class. More...
#include <swarm_state.h>
Public Member Functions | |
SwarmState ()=default | |
Create an empty state. More... | |
SwarmState (Swarm< dim > const &swarm) | |
Initialize from a reference swarm. More... | |
SwarmState (int size) | |
Initialize with a field size. More... | |
template<typename State > | |
SwarmState (State const &state, Wonton::Entity_kind kind) | |
Create the swarm state from a given mesh state wrapper. More... | |
template<typename State > | |
SwarmState (std::vector< State *> const &states, Wonton::Entity_kind kind) | |
Create the swarm state from set of mesh states wrappers. More... | |
~SwarmState ()=default | |
Destructor. More... | |
template<typename T = double> | |
void | add_field (std::string name, Portage::vector< T > const &value) |
Set a field on the swarm. More... | |
template<typename T = double> | |
void | add_field (std::string name, const T *const value) |
Set a field on the swarm. More... | |
template<typename T = double> | |
void | add_field (std::string name, T value) |
Set an empty field on the swarm. More... | |
Portage::vector< int > & | get_field_int (std::string name) const |
Retrieve a specified integer field. More... | |
Portage::vector< double > & | get_field_dbl (std::string name) const |
Retrieve a specified real field. More... | |
Portage::vector< double > & | get_field (std::string name) const |
template<typename T = double> | |
void | copy_field (std::string name, T *value) |
Retrieve the specified field. More... | |
int | get_size () |
Get number of particles. More... | |
template<typename T = double> | |
std::vector< std::string > | get_field_names () |
Retrieve the list of field names. More... | |
template<typename T > | |
void | extend_field (std::string name, Portage::vector< T > const &values) |
Extend the field with the given subfield. More... | |
Detailed Description
template<int dim>
class Portage::Meshfree::SwarmState< dim >
Particle field state class.
- Template Parameters
-
dim the dimension of the problem.
Constructor & Destructor Documentation
◆ SwarmState() [1/5]
|
default |
Create an empty state.
◆ SwarmState() [2/5]
|
inlineexplicit |
Initialize from a reference swarm.
- Parameters
-
swarm the swarm with which the field data are associated.
◆ SwarmState() [3/5]
|
inlineexplicit |
Initialize with a field size.
- Parameters
-
size size of each field.
◆ SwarmState() [4/5]
|
inline |
Create the swarm state from a given mesh state wrapper.
Copies fields from mesh state wrapper to the current swarm state of the same size. It works only for double precision floating-point fields.
- Template Parameters
-
State type of the mesh state wrapper.
- Parameters
-
state the mesh state wrapper. kind the entity kind to consider (node, cell).
◆ SwarmState() [5/5]
|
inline |
Create the swarm state from set of mesh states wrappers.
Copies fields from mesh state wrappers to the current swarm state of the same total size. It is useful for mapping from several meshes at once, e.g. for analysis of multiple times, or multiple simulations at the same set of spatial points, to obtain statistical properties like average, confidence bounds, and uncertaintities, for example. It works only for double precision floating-point fields.
- Template Parameters
-
State type of the mesh state wrapper.
- Parameters
-
state a list of mesh states wrappers. kind the entity kind to consider (node, cell).
◆ ~SwarmState()
|
default |
Destructor.
Member Function Documentation
◆ add_field() [1/3]
|
inline |
Set a field on the swarm.
- Template Parameters
-
T field values type (int, double)
- Parameters
-
name field name. value field values list.
◆ add_field() [2/3]
|
inline |
Set a field on the swarm.
- Template Parameters
-
T field values type (int, double)
- Parameters
-
name field name. value field values array.
◆ add_field() [3/3]
|
inline |
Set an empty field on the swarm.
- Template Parameters
-
T field values type (int, double)
- Parameters
-
name field name. value default field elements value.
◆ copy_field()
|
inline |
Retrieve the specified field.
- Parameters
-
name field name. value a pointer to field values.
◆ extend_field()
|
inline |
Extend the field with the given subfield.
- Template Parameters
-
T field values type (int or double).
- Parameters
-
name name of the field to update. values the subfield to add.
◆ get_field()
|
inline |
- Parameters
-
name
- Returns
◆ get_field_dbl()
|
inline |
Retrieve a specified real field.
One cannot specialize template method without specializing the template class, so just revert to plain untemplated methods.
- Parameters
-
name the name of the integer field
- Returns
- value the values in the field
◆ get_field_int()
|
inline |
Retrieve a specified integer field.
One cannot specialize template method without specializing the template class, so just revert to plain untemplated methods.
- Parameters
-
name the name of the integer field
- Returns
- value the values in the field
◆ get_field_names()
|
inline |
Retrieve the list of field names.
- Template Parameters
-
T field values type (int or double)
- Returns
- the list of field names
◆ get_size()
|
inline |
Get number of particles.
- Returns
- the number of particles of the swarm.
The documentation for this class was generated from the following file:
- /home/portage/portage/portage/swarm/swarm_state.h