Class for getting mirror particles to impose Neumann BCs. More...
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.
SurfaceNormal | Index of property to which the surface normal should be written to. |
vd_type | Template 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. | |
void | get_mirror_particles (vd_type &vd) |
Place mirror particles along the surface normal. | |
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. | |
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. | |
typedef Point<vd_type::dims, typename vd_type::stype> MethodOfImages< SurfaceNormal, vd_type >::point_type |
Definition at line 29 of file MethodOfImages.hpp.
typedef vector_dist_subset<vd_type::dims, typename vd_type::stype, typename vd_type::value_type> MethodOfImages< SurfaceNormal, vd_type >::vd_subset_type |
Definition at line 28 of file MethodOfImages.hpp.
|
inline |
Constructor.
vd | Input particle vector_dist of type vd_type. |
keys_source | Vector containing keys of source particles (key-type: openfpm::vector<vect_dist_key_dx>). |
subset_id_mirror | ID of subset containing the mirror particles (default=1). |
Definition at line 37 of file MethodOfImages.hpp.
|
inline |
Copies the values stored in PropToMirror from each source particle to its respective mirror particles.
PropToMirror | Index of property storing the values that should be mirrored. |
vd | Input particle vector_dist of type vd_type. |
Definition at line 121 of file MethodOfImages.hpp.
|
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.
vd | Input particle vector_dist of type vd_type. |
Definition at line 143 of file MethodOfImages.hpp.
|
inline |
Place mirror particles along the surface normal.
vd | Input particle vector_dist of type vd_type. |
Definition at line 67 of file MethodOfImages.hpp.
openfpm::vector<openfpm::vector<size_t> > MethodOfImages< SurfaceNormal, vd_type >::key_map_source_mirror |
Definition at line 61 of file MethodOfImages.hpp.
KEY_VECTOR_TYPE MethodOfImages< SurfaceNormal, vd_type >::keys_source |
Vector containing keys of source particles.
Definition at line 57 of file MethodOfImages.hpp.
vd_subset_type MethodOfImages< SurfaceNormal, vd_type >::Mirror |
Subset containing the mirror particles.
Definition at line 59 of file MethodOfImages.hpp.
PID_VECTOR_TYPE MethodOfImages< SurfaceNormal, vd_type >::pid_mirror |
Vector containing indices of mirror particles.
Definition at line 58 of file MethodOfImages.hpp.
vd_subset_type MethodOfImages< SurfaceNormal, vd_type >::Real |
Definition at line 60 of file MethodOfImages.hpp.
size_t MethodOfImages< SurfaceNormal, vd_type >::subset_id_mirror |
ID of subset containing the mirror particles (default=1).
Definition at line 56 of file MethodOfImages.hpp.
size_t MethodOfImages< SurfaceNormal, vd_type >::subset_id_real |
ID of subset containing the real particles (default=0).
Definition at line 55 of file MethodOfImages.hpp.