Peano
Loading...
Searching...
No Matches
exahype2::fv::internal Namespace Reference

Functions

tarch::la::Vector< Dimensions, int > mapParticleOntoVoxel (const peano4::datamanagement::CellMarker &marker, int voxelsPerAxis, const tarch::la::Vector< Dimensions, double > &particleX)
 Assume that we have a particle suspended in a cell.
 
tarch::la::Vector< Dimensions, int > mapBiasedParticleOntoVoxel (const peano4::datamanagement::CellMarker &marker, int voxelsPerAxis, const tarch::la::Vector< Dimensions, double > &particleX)
 Similar to mapParticleOntoVoxel() but this time, we always take the biased voxel to the left.
 
double projectValueOntoParticle_piecewiseConstant (const peano4::datamanagement::CellMarker &marker, int voxelsPerAxis, int unknownsPerVoxel, const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &particleX, int unknown)
 Project one quantity from the patch data onto the particle.
 
double projectValueOntoParticle_piecewiseLinear (const peano4::datamanagement::CellMarker &marker, int voxelsPerAxis, int unknownsPerVoxel, const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &particleX, int unknown)
 
template<typename Particle , int SourceIndex, int... SourceIndices>
void projectValuesOntoParticle_piecewiseConstant (const peano4::datamanagement::CellMarker &marker, int voxelsPerAxis, int unknownsPerVoxel, const double *__restrict__ Q, Particle &particle, int destinationIndex)
 Actual realisation of the projection routine.
 
template<typename Particle , int SourceIndex, int... SourceIndices>
void projectValuesOntoParticle_piecewiseLinear (const peano4::datamanagement::CellMarker &marker, int voxelsPerAxis, int unknownsPerVoxel, const double *__restrict__ Q, Particle &particle, int destinationIndex)
 
template<typename Particle >
void projectValuesOntoParticle_piecewiseConstant (const peano4::datamanagement::CellMarker &marker, int voxelsPerAxis, int unknownsPerVoxel, const double *__restrict__ Q, Particle &particle, int destinationIndex)
 End-point of variadic templates and therefore nop.
 
template<typename Particle >
void projectValuesOntoParticle_piecewiseLinear (const peano4::datamanagement::CellMarker &marker, int voxelsPerAxis, int unknownsPerVoxel, const double *__restrict__ Q, Particle &particle, int destinationIndex)
 End-point of variadic templates and therefore nop.
 

Function Documentation

◆ mapBiasedParticleOntoVoxel()

tarch::la::Vector< Dimensions, int > exahype2::fv::internal::mapBiasedParticleOntoVoxel ( const peano4::datamanagement::CellMarker & marker,
int voxelsPerAxis,
const tarch::la::Vector< Dimensions, double > & particleX )

Similar to mapParticleOntoVoxel() but this time, we always take the biased voxel to the left.

Let a 1d patch be divided into voxels of size h. Up to 1.5h, the operation returns 0. From 1.5h-2.5h, the function yields a 1. So we always are biased towards the left neighbour, which is useful whenever we use the outcome as input for a linear interpolation. In this context, the result is also bounded by 0 to the bottom (which is a natural choice), but no component of the result vector exceeds voxelsPerAxis-2. You can always increment an entry safely by a one.

See also
projectValueOntoParticle_piecewiseLinear() for an example where this helper routine is used

◆ mapParticleOntoVoxel()

tarch::la::Vector< Dimensions, int > exahype2::fv::internal::mapParticleOntoVoxel ( const peano4::datamanagement::CellMarker & marker,
int voxelsPerAxis,
const tarch::la::Vector< Dimensions, double > & particleX )

Assume that we have a particle suspended in a cell.

The cell hosts a regular Cartesian mesh. The routine computes the correct voxel.

You can convert the result via

  int voxelIndex = peano4::utils::dLinearised(voxel,voxelsPerAxis);

into an index to access your Q array. The whole construct assumes that Q is not surrounded by a halo layer. If you have a halo layer, you have to add (1,1,1) to the result and then increment voxelsPerAxis by two.

◆ projectValueOntoParticle_piecewiseConstant()

double exahype2::fv::internal::projectValueOntoParticle_piecewiseConstant ( const peano4::datamanagement::CellMarker & marker,
int voxelsPerAxis,
int unknownsPerVoxel,
const double *__restrict__ Q,
const tarch::la::Vector< Dimensions, double > & particleX,
int unknown )

Project one quantity from the patch data onto the particle.

Parameters
markerCell marker describing the cell's geometric/spatial properties.
voxelsPerAxisDescribe patch. We assume that the pathch has not halo.
unknownsPerVoxel
QVoxel field, i.e. actual patch data. Has the dimensions \( voxelsPerAxis^d \cdot unknownsPerVoxel \).
particleXPosition of particle.
unknownWhich unknown from data field to pick.

◆ projectValueOntoParticle_piecewiseLinear()

double exahype2::fv::internal::projectValueOntoParticle_piecewiseLinear ( const peano4::datamanagement::CellMarker & marker,
int voxelsPerAxis,
int unknownsPerVoxel,
const double *__restrict__ Q,
const tarch::la::Vector< Dimensions, double > & particleX,
int unknown )
See also
mapBiasedParticleOntoVoxel() which provides the index calculations, i.e. the code to identify the voxels which affect the particle of interest.

◆ projectValuesOntoParticle_piecewiseConstant() [1/2]

template<typename Particle , int SourceIndex, int... SourceIndices>
void exahype2::fv::internal::projectValuesOntoParticle_piecewiseConstant ( const peano4::datamanagement::CellMarker & marker,
int voxelsPerAxis,
int unknownsPerVoxel,
const double *__restrict__ Q,
Particle & particle,
int destinationIndex )

Actual realisation of the projection routine.

Has to be in a subnamespace, as we have to permute the template arguments such that the variadic arguments come last. Otherwise, C++ cannot match them.

◆ projectValuesOntoParticle_piecewiseConstant() [2/2]

template<typename Particle >
void exahype2::fv::internal::projectValuesOntoParticle_piecewiseConstant ( const peano4::datamanagement::CellMarker & marker,
int voxelsPerAxis,
int unknownsPerVoxel,
const double *__restrict__ Q,
Particle & particle,
int destinationIndex )

End-point of variadic templates and therefore nop.

◆ projectValuesOntoParticle_piecewiseLinear() [1/2]

template<typename Particle , int SourceIndex, int... SourceIndices>
void exahype2::fv::internal::projectValuesOntoParticle_piecewiseLinear ( const peano4::datamanagement::CellMarker & marker,
int voxelsPerAxis,
int unknownsPerVoxel,
const double *__restrict__ Q,
Particle & particle,
int destinationIndex )

◆ projectValuesOntoParticle_piecewiseLinear() [2/2]

template<typename Particle >
void exahype2::fv::internal::projectValuesOntoParticle_piecewiseLinear ( const peano4::datamanagement::CellMarker & marker,
int voxelsPerAxis,
int unknownsPerVoxel,
const double *__restrict__ Q,
Particle & particle,
int destinationIndex )

End-point of variadic templates and therefore nop.