OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
MethodOfImages< SurfaceNormal, vd_type > Class Template Reference

Class for getting mirror particles to impose Neumann BCs. More...

Detailed Description

template<size_t SurfaceNormal, typename vd_type>
class MethodOfImages< SurfaceNormal, vd_type >

Class for getting mirror particles to impose Neumann BCs.

Source refers to the particles close to the boundary that will we mirrored at the boundary. The source particles do not form an individual subset because subsets mustn't overlap and source particles belong to the real particles. Instead, store the keys of the desired source particles in a vector and pass them to the constructor.

Template Parameters
SurfaceNormalIndex of property to which the surface normal should be written to.
vd_typeTemplate type of input particle vector_dist.

Definition at line 25 of file MethodOfImages.hpp.

#include <MethodOfImages.hpp>

Public Types

typedef vector_dist_subset< vd_type::dims, typename vd_type::stype, typename vd_type::value_type > vd_subset_type
 
typedef Point< vd_type::dims, typename vd_type::stype > point_type
 

Public Member Functions

 MethodOfImages (vd_type &vd, const KEY_VECTOR_TYPE &keys_source, const size_t subset_id_real=0, const size_t subset_id_mirror=1)
 Constructor. More...
 
void get_mirror_particles (vd_type &vd)
 Place mirror particles along the surface normal. More...
 
template<size_t PropToMirror>
void apply_noflux (vd_type &vd)
 Copies the values stored in PropToMirror from each source particle to its respective mirror particles. More...
 

Data Fields

size_t subset_id_real
 ID of subset containing the real particles (default=0).
 
size_t subset_id_mirror
 ID of subset containing the mirror particles (default=1).
 
KEY_VECTOR_TYPE keys_source
 Vector containing keys of source particles.
 
PID_VECTOR_TYPE pid_mirror
 Vector containing indices of mirror particles.
 
vd_subset_type Mirror
 Subset containing the mirror particles.
 
vd_subset_type Real
 
openfpm::vector< openfpm::vector< size_t > > key_map_source_mirror
 

Private Member Functions

void check_if_ghost_isometric (vd_type &vd)
 Checks if the ghost layer has the same size in all dimensions. This is required to ensure that the ghost layer is bigger than the mirror layer in all dimensions. This is needed s.t. added mirror particles can be accessed by the same processor on which the corresponding source lies. More...
 

Constructor & Destructor Documentation

◆ MethodOfImages()

template<size_t SurfaceNormal, typename vd_type>
MethodOfImages< SurfaceNormal, vd_type >::MethodOfImages ( vd_type &  vd,
const KEY_VECTOR_TYPE &  keys_source,
const size_t  subset_id_real = 0,
const size_t  subset_id_mirror = 1 
)
inline

Constructor.

Parameters
vdInput particle vector_dist of type vd_type.
keys_sourceVector containing keys of source particles (key-type: openfpm::vector<vect_dist_key_dx>).
subset_id_mirrorID of subset containing the mirror particles (default=1).

Definition at line 37 of file MethodOfImages.hpp.

Member Function Documentation

◆ apply_noflux()

template<size_t SurfaceNormal, typename vd_type>
template<size_t PropToMirror>
void MethodOfImages< SurfaceNormal, vd_type >::apply_noflux ( vd_type &  vd)
inline

Copies the values stored in PropToMirror from each source particle to its respective mirror particles.

Template Parameters
PropToMirrorIndex of property storing the values that should be mirrored.
Parameters
vdInput particle vector_dist of type vd_type.

Definition at line 121 of file MethodOfImages.hpp.

◆ check_if_ghost_isometric()

template<size_t SurfaceNormal, typename vd_type>
void MethodOfImages< SurfaceNormal, vd_type >::check_if_ghost_isometric ( vd_type &  vd)
inlineprivate

Checks if the ghost layer has the same size in all dimensions. This is required to ensure that the ghost layer is bigger than the mirror layer in all dimensions. This is needed s.t. added mirror particles can be accessed by the same processor on which the corresponding source lies.

Parameters
vdInput particle vector_dist of type vd_type.

Definition at line 143 of file MethodOfImages.hpp.

◆ get_mirror_particles()

template<size_t SurfaceNormal, typename vd_type>
void MethodOfImages< SurfaceNormal, vd_type >::get_mirror_particles ( vd_type &  vd)
inline

Place mirror particles along the surface normal.

Parameters
vdInput particle vector_dist of type vd_type.

Definition at line 67 of file MethodOfImages.hpp.


The documentation for this class was generated from the following file: