OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
NarrowBand< grid_in_type, phi_type > Class Template Reference

Class for getting the narrow band around the interface. More...

Detailed Description

template<typename grid_in_type, typename phi_type = double>
class NarrowBand< grid_in_type, phi_type >

Class for getting the narrow band around the interface.

Places particle at those grid point positions, which lay inside a narrow band of user-defined width around the interface. The respective SDF or arbitrary other property value is then also copied from the grid node to that particle occupying the same position.

Author
Justina Stark
Date
May 2020
Template Parameters
grid_in_typeTemplate type of input grid that stores the signed distance function Phi_SDF.

Definition at line 42 of file NarrowBand.hpp.

#include <NarrowBand.hpp>

Public Types

typedef aggregate< phi_type, phi_type[grid_in_type::dims], int > props_temp
 Aggregated properties for the temporary grid.
 
typedef grid_dist_id< grid_in_type::dims, typename grid_in_type::stype, props_tempg_temp_type
 Type definition for the temporary grid.
 

Public Member Functions

 NarrowBand (const grid_in_type &grid_in, size_t thickness)
 Constructor taking the thickness of the narrow band as grid points in order to initialize the lower and upper bound for the narrow band. Initializes the temporary internal grid.
 
 NarrowBand (const grid_in_type &grid_in, double thickness)
 Constructor taking the thickness of the narrow band as physical width in space in order to initialize the lower and upper bound for the narrow band. Initializes the temporary internal grid.
 
 NarrowBand (const grid_in_type &grid_in, float thickness)
 Constructor taking the thickness of the narrow band as physical width in space in order to initialize the lower and upper bound for the narrow band. Initializes the temporary internal grid.
 
template<typename width_type >
 NarrowBand (const grid_in_type &grid_in, width_type width_outside, width_type width_inside)
 Constructor taking the inside and outside physical width of the narrow band in order to initialize the lower and upper bound for the narrow band. Initializes the temporary internal grid.
 
template<size_t Phi_SDF_grid, size_t Phi_SDF_vd, typename vector_type , typename grid_type >
void get_narrow_band (grid_type &grid, vector_type &vd)
 Places particles within a narrow band around the interface. Only the SDF is copied from the grid properties to the respective particles.
 
template<size_t Phi_SDF_grid, size_t Phi_SDF_vd, size_t Phi_grad, typename vector_type , typename grid_type >
void get_narrow_band (grid_type &grid, vector_type &vd)
 Places particles within a narrow band around the interface. SDF and Phi_grad_temp are copied from the temp. grid to the respective particle.
 
template<size_t Phi_SDF_grid, size_t Phi_SDF_vd, size_t Phi_grad, size_t Phi_magnOfGrad, typename vector_type , typename grid_type >
void get_narrow_band (grid_type &grid, vector_type &vd)
 Places particles within a narrow band around the interface. SDF and Phi_grad_temp are copied from the temp. grid to the respective particle.
 
template<size_t Phi_SDF_grid, size_t Prop1_grid, size_t Prop1_vd, typename vector_type , typename grid_type >
void get_narrow_band_copy_specific_property (grid_type &grid, vector_type &vd)
 Places particles within a narrow band around the interface. An arbitrary property is copied from the grid to the respective particle.
 
template<size_t Phi_SDF_grid, size_t Index1Grid, size_t Index2Grid, size_t Index3Grid, size_t Index1Vd, size_t Index2Vd, size_t Index3Vd, typename grid_type , typename vector_type >
void get_narrow_band_copy_three_scalar_properties (grid_type &grid, vector_type &vd)
 Places particles within a narrow band around the interface. An arbitrary property is copied from the grid to the respective particle.
 

Data Fields

g_temp_type g_temp
 Create temporary grid, which is only used inside the class to get the gradients.
 

Private Member Functions

void set_bounds (const size_t thickness, const grid_in_type &grid_in)
 Set the member variable NarrowBand::b_low and NarrowBand::b_up.
 
template<typename thickness_type >
void set_bounds (const thickness_type thickness, const grid_in_type &grid_in)
 Set the member variable NarrowBand::b_low and NarrowBand::b_up.
 
template<typename width_type >
void set_bounds (width_type lower_bound, width_type upper_bound, const grid_in_type &grid_in)
 Set the member variable NarrowBand::b_low and NarrowBand::b_up.
 
template<size_t Phi_SDF>
void initialize_temporary_grid (const grid_in_type &grid_in)
 Initialize the internal temporary grid.
 
template<typename T >
bool within_narrow_band (T Phi)
 Checks if a value for Phi_SDF lays within the narrow band.
 

Private Attributes

phi_type b_low
 Narrow band extension towards the object outside.
 
phi_type b_up
 Narrow band extension towards the object inside.
 

Static Private Attributes

static const size_t Phi_SDF_temp = 0
 Property index of Phi_SDF on the temporary grid.
 
static const size_t Phi_grad_temp = 1
 Property index of gradient of Phi on the temporary grid.
 
static const size_t Phi_sign_temp = 2
 Property index of sign of Phi on the temporary grid.
 

Member Typedef Documentation

◆ g_temp_type

template<typename grid_in_type , typename phi_type = double>
typedef grid_dist_id<grid_in_type::dims, typename grid_in_type::stype, props_temp> NarrowBand< grid_in_type, phi_type >::g_temp_type

Type definition for the temporary grid.

Definition at line 103 of file NarrowBand.hpp.

◆ props_temp

template<typename grid_in_type , typename phi_type = double>
typedef aggregate<phi_type, phi_type[grid_in_type::dims], int> NarrowBand< grid_in_type, phi_type >::props_temp

Aggregated properties for the temporary grid.

The properties are Phi_SDF (result from redistancing), gradient of Phi, and sign of Phi_SDF (for the upwinding).

Definition at line 100 of file NarrowBand.hpp.

Constructor & Destructor Documentation

◆ NarrowBand() [1/4]

template<typename grid_in_type , typename phi_type = double>
NarrowBand< grid_in_type, phi_type >::NarrowBand ( const grid_in_type &  grid_in,
size_t  thickness 
)
inline

Constructor taking the thickness of the narrow band as grid points in order to initialize the lower and upper bound for the narrow band. Initializes the temporary internal grid.

Parameters
grid_inInput grid with min. 1 property: Phi_SDF.
thicknessWidth of narrow band in # grid points.

Definition at line 51 of file NarrowBand.hpp.

◆ NarrowBand() [2/4]

template<typename grid_in_type , typename phi_type = double>
NarrowBand< grid_in_type, phi_type >::NarrowBand ( const grid_in_type &  grid_in,
double  thickness 
)
inline

Constructor taking the thickness of the narrow band as physical width in space in order to initialize the lower and upper bound for the narrow band. Initializes the temporary internal grid.

Parameters
grid_inInput grid with min. 1 property: Phi_SDF.
thicknessWidth of narrow band as physical width.

Definition at line 63 of file NarrowBand.hpp.

◆ NarrowBand() [3/4]

template<typename grid_in_type , typename phi_type = double>
NarrowBand< grid_in_type, phi_type >::NarrowBand ( const grid_in_type &  grid_in,
float  thickness 
)
inline

Constructor taking the thickness of the narrow band as physical width in space in order to initialize the lower and upper bound for the narrow band. Initializes the temporary internal grid.

Parameters
grid_inInput grid with min. 1 property: Phi_SDF.
thicknessWidth of narrow band as physical width.

Definition at line 75 of file NarrowBand.hpp.

◆ NarrowBand() [4/4]

template<typename grid_in_type , typename phi_type = double>
template<typename width_type >
NarrowBand< grid_in_type, phi_type >::NarrowBand ( const grid_in_type &  grid_in,
width_type  width_outside,
width_type  width_inside 
)
inline

Constructor taking the inside and outside physical width of the narrow band in order to initialize the lower and upper bound for the narrow band. Initializes the temporary internal grid.

Parameters
grid_inInput grid with min. 1 property: Phi_SDF.
width_outsideExtension of narrow band as physical width inside of object (Phi > 0).
width_insideExtension of narrow band as physical width outside of object (Phi < 0).

Definition at line 89 of file NarrowBand.hpp.

Member Function Documentation

◆ get_narrow_band() [1/3]

template<typename grid_in_type , typename phi_type = double>
template<size_t Phi_SDF_grid, size_t Phi_SDF_vd, typename vector_type , typename grid_type >
void NarrowBand< grid_in_type, phi_type >::get_narrow_band ( grid_type grid,
vector_type vd 
)
inline

Places particles within a narrow band around the interface. Only the SDF is copied from the grid properties to the respective particles.

Template Parameters
Phi_SDF_gridIndex of property storing the signed distance function in the input grid.
Phi_SDF_vdIndex of property that should store the SDF in the narrow band particle vector.
vector_typeTemplate type of the particle vector.
grid_typeTemplate type of the grid storing the SDF.
Parameters
gridGrid of arb. dims. storing the SDF (result of redistancing).
vdEmpty vector with same spatial scaling (box) as the grid.

Definition at line 125 of file NarrowBand.hpp.

◆ get_narrow_band() [2/3]

template<typename grid_in_type , typename phi_type = double>
template<size_t Phi_SDF_grid, size_t Phi_SDF_vd, size_t Phi_grad, typename vector_type , typename grid_type >
void NarrowBand< grid_in_type, phi_type >::get_narrow_band ( grid_type grid,
vector_type vd 
)
inline

Places particles within a narrow band around the interface. SDF and Phi_grad_temp are copied from the temp. grid to the respective particle.

Template Parameters
Phi_SDF_gridIndex of property storing the signed distance function in the input grid.
Phi_SDF_vdIndex of property that should store the SDF in the narrow band particle vector.
Phi_gradIndex of property that should store the gradient of phi in the narrow band particle vector.
vector_typeTemplate type of the particle vector.
grid_typeTemplate type of the grid storing the SDF.
Parameters
gridGrid of arb. dims. storing the SDF (result of redistancing).
vdEmpty vector with same spatial scaling (box) as the grid.

Definition at line 159 of file NarrowBand.hpp.

◆ get_narrow_band() [3/3]

template<typename grid_in_type , typename phi_type = double>
template<size_t Phi_SDF_grid, size_t Phi_SDF_vd, size_t Phi_grad, size_t Phi_magnOfGrad, typename vector_type , typename grid_type >
void NarrowBand< grid_in_type, phi_type >::get_narrow_band ( grid_type grid,
vector_type vd 
)
inline

Places particles within a narrow band around the interface. SDF and Phi_grad_temp are copied from the temp. grid to the respective particle.

Template Parameters
Phi_SDF_gridIndex of property storing the signed distance function in the input grid.
Phi_SDF_vdIndex of property that should store the SDF in the narrow band particle vector.
Phi_gradIndex of property that should store the gradient of phi in the narrow band particle vector.
Phi_magnOfGradIndex of property that should store the gradient magnitude of Phi.
vector_typeTemplate type of the particle vector.
grid_typeTemplate type of the grid storing the SDF.
Parameters
gridGrid of arb. dims. storing the SDF (result of redistancing).
vdEmpty vector with same spatial scaling (box) as the grid.

Definition at line 197 of file NarrowBand.hpp.

◆ get_narrow_band_copy_specific_property()

template<typename grid_in_type , typename phi_type = double>
template<size_t Phi_SDF_grid, size_t Prop1_grid, size_t Prop1_vd, typename vector_type , typename grid_type >
void NarrowBand< grid_in_type, phi_type >::get_narrow_band_copy_specific_property ( grid_type grid,
vector_type vd 
)
inline

Places particles within a narrow band around the interface. An arbitrary property is copied from the grid to the respective particle.

Template Parameters
Phi_SDF_gridIndex of property storing the signed distance function in the input grid.
Prop1_gridIndex of arbitrary grid property that should be copied to the particles (prop. value must be a scalar).
Prop1_vdIndex of particle property, where grid property should be copied to (prop. value must be a scalar).
vector_typeTemplate type of the particle vector.
grid_typeTemplate type of the grid storing the SDF.
Parameters
gridGrid of arb. dims. storing the SDF (result of redistancing) and any arbitrary other (scalar) property.
vdEmpty vector with same spatial scaling (box) as the grid.

Definition at line 236 of file NarrowBand.hpp.

◆ get_narrow_band_copy_three_scalar_properties()

template<typename grid_in_type , typename phi_type = double>
template<size_t Phi_SDF_grid, size_t Index1Grid, size_t Index2Grid, size_t Index3Grid, size_t Index1Vd, size_t Index2Vd, size_t Index3Vd, typename grid_type , typename vector_type >
void NarrowBand< grid_in_type, phi_type >::get_narrow_band_copy_three_scalar_properties ( grid_type grid,
vector_type vd 
)
inline

Places particles within a narrow band around the interface. An arbitrary property is copied from the grid to the respective particle.

Template Parameters
Phi_SDF_gridIndex of property storing the signed distance function in the input grid.
Index1GridIndex of 1st scalar grid property that should be copied from grid to particles.
Index2GridIndex of 2nd scalar grid property that should be copied from grid to particles.
Index3GridIndex of 3rd scalar grid property that should be copied from grid to particles.
Index1VdIndex of 1st scalar property on particle to which value from grid should be copied to.
Index2VdIndex of 2nd scalar property on particle to which value from grid should be copied to.
Index3VdIndex of 3rd scalar property on particle to which value from grid should be copied to.
vector_typeTemplate type of the particle vector.
grid_typeTemplate type of the grid storing the SDF.
Parameters
gridGrid of arb. dims. storing the SDF (result of redistancing) and any arbitrary other (scalar) property.
vdEmpty vector with same spatial scaling (box) as the grid.

Definition at line 275 of file NarrowBand.hpp.

◆ initialize_temporary_grid()

template<typename grid_in_type , typename phi_type = double>
template<size_t Phi_SDF>
void NarrowBand< grid_in_type, phi_type >::initialize_temporary_grid ( const grid_in_type &  grid_in)
inlineprivate

Initialize the internal temporary grid.

Copies Phi_SDF from the input grid to the temorary grid.

Template Parameters
Phi_SDFIndex of property storing the signed distance function in the input grid.
Parameters
grid_inInput grid storing the signed distance function Phi_SDF (redistancing output).

Definition at line 354 of file NarrowBand.hpp.

◆ set_bounds() [1/3]

template<typename grid_in_type , typename phi_type = double>
void NarrowBand< grid_in_type, phi_type >::set_bounds ( const size_t  thickness,
const grid_in_type &  grid_in 
)
inlineprivate

Set the member variable NarrowBand::b_low and NarrowBand::b_up.

Parameters
thicknessThickness of narrow band in number of grid points.
grid_inInput grid storing the signed distance function Phi_SDF (redistancing output).

Definition at line 314 of file NarrowBand.hpp.

◆ set_bounds() [2/3]

template<typename grid_in_type , typename phi_type = double>
template<typename thickness_type >
void NarrowBand< grid_in_type, phi_type >::set_bounds ( const thickness_type  thickness,
const grid_in_type &  grid_in 
)
inlineprivate

Set the member variable NarrowBand::b_low and NarrowBand::b_up.

Parameters
thicknessThickness of narrow band as physical width.
grid_inInput grid storing the signed distance function Phi_SDF (redistancing output).

Definition at line 326 of file NarrowBand.hpp.

◆ set_bounds() [3/3]

template<typename grid_in_type , typename phi_type = double>
template<typename width_type >
void NarrowBand< grid_in_type, phi_type >::set_bounds ( width_type  lower_bound,
width_type  upper_bound,
const grid_in_type &  grid_in 
)
inlineprivate

Set the member variable NarrowBand::b_low and NarrowBand::b_up.

Parameters
lower_boundExtension of narrow band as physical width inside of object (Phi > 0).
upper_boundExtension of narrow band as physical width outside of object (Phi < 0).
grid_inInput grid storing the signed distance function Phi_SDF (redistancing output).

Definition at line 339 of file NarrowBand.hpp.

◆ within_narrow_band()

template<typename grid_in_type , typename phi_type = double>
template<typename T >
bool NarrowBand< grid_in_type, phi_type >::within_narrow_band ( Phi)
inlineprivate

Checks if a value for Phi_SDF lays within the narrow band.

Template Parameters
TTemplate type of parameter Phi.
Parameters
PhiValue of the signed distance function Phi_SDF.
Returns
True, if point lays within the narrow band; False if not.

Definition at line 368 of file NarrowBand.hpp.

Field Documentation

◆ b_low

template<typename grid_in_type , typename phi_type = double>
phi_type NarrowBand< grid_in_type, phi_type >::b_low
private

Narrow band extension towards the object outside.

Definition at line 306 of file NarrowBand.hpp.

◆ b_up

template<typename grid_in_type , typename phi_type = double>
phi_type NarrowBand< grid_in_type, phi_type >::b_up
private

Narrow band extension towards the object inside.

Definition at line 307 of file NarrowBand.hpp.

◆ g_temp

template<typename grid_in_type , typename phi_type = double>
g_temp_type NarrowBand< grid_in_type, phi_type >::g_temp

Create temporary grid, which is only used inside the class to get the gradients.

The grid is needed, when the user wants a narrow band which also contains the upwind gradient of phi. It contains the following 4 properties: Phi_SDF (result from redistancing), gradient of Phi, and sign of Phi_SDF (for the upwinding).

Definition at line 111 of file NarrowBand.hpp.

◆ Phi_grad_temp

template<typename grid_in_type , typename phi_type = double>
const size_t NarrowBand< grid_in_type, phi_type >::Phi_grad_temp = 1
staticprivate

Property index of gradient of Phi on the temporary grid.

Definition at line 303 of file NarrowBand.hpp.

◆ Phi_SDF_temp

template<typename grid_in_type , typename phi_type = double>
const size_t NarrowBand< grid_in_type, phi_type >::Phi_SDF_temp = 0
staticprivate

Property index of Phi_SDF on the temporary grid.

Definition at line 302 of file NarrowBand.hpp.

◆ Phi_sign_temp

template<typename grid_in_type , typename phi_type = double>
const size_t NarrowBand< grid_in_type, phi_type >::Phi_sign_temp = 2
staticprivate

Property index of sign of Phi on the temporary grid.

Definition at line 304 of file NarrowBand.hpp.


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