Portage::Meshfree::Swarm< dim > Class Template Reference
An effective "mesh" class for a collection disconnected points (particles). More...
#include <swarm.h>
Public Member Functions | |
Swarm ()=default | |
Create an empty particle field. More... | |
Swarm (Portage::vector< Wonton::Point< dim >> const &points) | |
Create a particle field from a given list. More... | |
Swarm (int num_particles, int distribution, unsigned user_seed=0, double x_min=0.0, double x_max=0.0, double y_min=0.0, double y_max=0.0, double z_min=0.0, double z_max=0.0) | |
Generate a random or uniform particle field. More... | |
template<typename Mesh > | |
Swarm (Mesh const &mesh, Wonton::Entity_kind entity) | |
Create a particle field from an arbitary mesh wrapper. More... | |
template<typename Mesh > | |
Swarm (std::vector< Mesh *> const &meshes, Wonton::Entity_kind entity) | |
Create a particle field from a set of mesh wrappers. More... | |
~Swarm ()=default | |
Destructor. More... | |
int | space_dimension () const |
Get the dimension. More... | |
int | num_owned_particles () const |
Get owned particles count. More... | |
int | num_ghost_particles () const |
Get ghost particles count. More... | |
int | num_particles (Wonton::Entity_type type=Wonton::ALL) const |
Get particles count. More... | |
Wonton::Point< dim > | get_particle_coordinates (int index) const |
Get the coordinates of the particle. More... | |
counting_iterator | begin (Entity_kind const kind=Wonton::PARTICLE, Entity_type const type=Wonton::ALL) const |
Get an iterator at first element of the particle field. More... | |
counting_iterator | end (Entity_kind const kind=Wonton::PARTICLE, Entity_type const type=Wonton::ALL) const |
Get an iterator at last element of the particle field. More... | |
void | extend_particle_list (std::vector< Wonton::Point< dim >> const &new_pts) |
Extend the particle field. More... | |
template<> | |
Swarm (int num_particles, int distribution, unsigned user_seed, double x_min, double x_max, double, double, double, double) | |
template<> | |
Swarm (int num_particles, int distribution, unsigned user_seed, double x_min, double x_max, double y_min, double y_max, double, double) | |
template<> | |
Swarm (int num_particles, int distribution, unsigned user_seed, double x_min, double x_max, double y_min, double y_max, double z_min, double z_max) | |
Detailed Description
template<int dim>
class Portage::Meshfree::Swarm< dim >
An effective "mesh" class for a collection disconnected points (particles).
- Template Parameters
-
dim the dimension of the problem.
Constructor & Destructor Documentation
◆ Swarm() [1/8]
template<int dim>
|
default |
Create an empty particle field.
◆ Swarm() [2/8]
template<int dim>
|
inlineexplicit |
Create a particle field from a given list.
- Parameters
-
points the given list of points.
◆ Swarm() [3/8]
template<int dim>
Portage::Meshfree::Swarm< dim >::Swarm | ( | int | num_particles, |
int | distribution, | ||
unsigned | user_seed = 0 , |
||
double | x_min = 0.0 , |
||
double | x_max = 0.0 , |
||
double | y_min = 0.0 , |
||
double | y_max = 0.0 , |
||
double | z_min = 0.0 , |
||
double | z_max = 0.0 |
||
) |
Generate a random or uniform particle field.
- Parameters
-
num_particles number of points. p_min lower bounds on points coordinates. p_max upper bounds on points coordinates. distribution the kind of random numbers distribution. seed a seed used by the random number generator.
◆ Swarm() [4/8]
template<int dim>
template<typename Mesh >
Portage::Meshfree::Swarm< dim >::Swarm | ( | Mesh const & | mesh, |
Wonton::Entity_kind | entity | ||
) |
Create a particle field from an arbitary mesh wrapper.
- Template Parameters
-
Mesh type of mesh wrapper.
- Parameters
-
mesh a mesh. entity the entity kind.
◆ Swarm() [5/8]
template<int dim>
template<typename Mesh >
Portage::Meshfree::Swarm< dim >::Swarm | ( | std::vector< Mesh *> const & | meshes, |
Wonton::Entity_kind | entity | ||
) |
Create a particle field from a set of mesh wrappers.
- Template Parameters
-
Mesh type of mesh wrappers.
- Parameters
-
meshes a set of meshes. entity the entity kind.
◆ ~Swarm()
template<int dim>
|
default |
Destructor.
◆ Swarm() [6/8]
template<>
|
inline |
◆ Swarm() [7/8]
template<>
|
inline |
◆ Swarm() [8/8]
template<>
|
inline |
Member Function Documentation
◆ begin()
template<int dim>
|
inline |
Get an iterator at first element of the particle field.
- Parameters
-
kind entity kind (kept for consistency with mesh iterators) type entity type (kept for consistency with mesh iterators)
- Returns
- an iterator pointing to the first element of the particle field.
◆ end()
template<int dim>
|
inline |
Get an iterator at last element of the particle field.
- Parameters
-
kind entity kind (kept for consistency with mesh iterators) type entity type (kept for consistency with mesh iterators)
- Returns
- an iterator pointing to the last element of the particle field.
◆ extend_particle_list()
template<int dim>
|
inline |
Extend the particle field.
◆ get_particle_coordinates()
template<int dim>
|
inline |
Get the coordinates of the particle.
- Parameters
-
index index of particle.
- Returns
- its coordinates.
◆ num_ghost_particles()
template<int dim>
|
inline |
Get ghost particles count.
- Returns
- number of ghost particles.
◆ num_owned_particles()
template<int dim>
|
inline |
Get owned particles count.
- Returns
- number of owned particles.
◆ num_particles()
template<int dim>
|
inline |
Get particles count.
- Parameters
-
type entity type (owned, ghost, all).
- Returns
- the particle count for the given entity type.
◆ space_dimension()
template<int dim>
|
inline |
Get the dimension.
- Returns
- the dimension.
The documentation for this class was generated from the following file:
- /home/portage/portage/portage/swarm/swarm.h