Reference documentation for deal.II version 9.3.3
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Classes | Public Member Functions | Private Attributes | List of all members
Utilities::MPI::RemotePointEvaluation< dim, spacedim > Class Template Reference

#include <deal.II/base/mpi_remote_point_evaluation.h>

Classes

struct  CellData
 

Public Member Functions

 RemotePointEvaluation (const double tolerance=1e-6, const bool enforce_unique_mapping=false)
 
 ~RemotePointEvaluation ()
 
void reinit (const std::vector< Point< spacedim > > &points, const Triangulation< dim, spacedim > &tria, const Mapping< dim, spacedim > &mapping)
 
template<typename T >
void evaluate_and_process (std::vector< T > &output, std::vector< T > &buffer, const std::function< void(const ArrayView< T > &, const CellData &)> &evaluation_function) const
 
template<typename T >
void process_and_evaluate (const std::vector< T > &input, std::vector< T > &buffer, const std::function< void(const ArrayView< const T > &, const CellData &)> &evaluation_function) const
 
const std::vector< unsigned int > & get_point_ptrs () const
 
bool is_map_unique () const
 
const Triangulation< dim, spacedim > & get_triangulation () const
 
const Mapping< dim, spacedim > & get_mapping () const
 
bool is_ready () const
 

Private Attributes

const double tolerance
 
const bool enforce_unique_mapping
 
boost::signals2::connection tria_signal
 
bool ready_flag
 
SmartPointer< const Triangulation< dim, spacedim > > tria
 
SmartPointer< const Mapping< dim, spacedim > > mapping
 
bool unique_mapping
 
std::vector< unsigned intpoint_ptrs
 
std::vector< unsigned intrecv_permutation
 
std::vector< unsigned intrecv_ptrs
 
std::vector< unsigned intrecv_ranks
 
CellData cell_data
 
std::vector< unsigned intsend_permutation
 
std::vector< unsigned intsend_ranks
 
std::vector< unsigned intsend_ptrs
 

Detailed Description

template<int dim, int spacedim = dim>
class Utilities::MPI::RemotePointEvaluation< dim, spacedim >

Helper class to access values on non-matching grids.

Note
The name of the fields are chosen with the method evaluate_and_process() in mind. Here, quantities are computed at specified arbitrary positioned points (and even on remote processes in the MPI universe) cell by cell and these values are sent to requesting processes, which receive the result and resort the result according to the points.

Definition at line 44 of file mpi_remote_point_evaluation.h.

Constructor & Destructor Documentation

◆ RemotePointEvaluation()

template<int dim, int spacedim>
Utilities::MPI::RemotePointEvaluation< dim, spacedim >::RemotePointEvaluation ( const double  tolerance = 1e-6,
const bool  enforce_unique_mapping = false 
)

Constructor.

Parameters
toleranceTolerance in terms of unit cell coordinates for determining all cells around a point passed to the class during reinit(). Depending on the problem, it might be necessary to adjust the tolerance in order to be able to identify a cell. Floating point arithmetic implies that a point will, in general, not lie exactly on a vertex, edge, or face.
enforce_unique_mappingEnforce unique mapping, i.e., (one-to-one) relation of points and cells.

Definition at line 39 of file mpi_remote_point_evaluation.cc.

◆ ~RemotePointEvaluation()

template<int dim, int spacedim>
Utilities::MPI::RemotePointEvaluation< dim, spacedim >::~RemotePointEvaluation

Destructor.

Definition at line 50 of file mpi_remote_point_evaluation.cc.

Member Function Documentation

◆ reinit()

template<int dim, int spacedim>
void Utilities::MPI::RemotePointEvaluation< dim, spacedim >::reinit ( const std::vector< Point< spacedim > > &  points,
const Triangulation< dim, spacedim > &  tria,
const Mapping< dim, spacedim > &  mapping 
)

Set up internal data structures and communication pattern based on a list of points points and mesh description (tria and mapping).

Definition at line 60 of file mpi_remote_point_evaluation.cc.

◆ evaluate_and_process()

template<int dim, int spacedim>
template<typename T >
void Utilities::MPI::RemotePointEvaluation< dim, spacedim >::evaluate_and_process ( std::vector< T > &  output,
std::vector< T > &  buffer,
const std::function< void(const ArrayView< T > &, const CellData &)> &  evaluation_function 
) const

Evaluate function evaluation_function in the given points and triangulation. The result is stored in output.

Note
If the map of points to cells is not a one-to-one relation (is_map_unique()==false), the result needs to be processed with the help of get_point_ptrs(). This might be the case if a point coincides with a geometric entity (e.g., vertex) that is shared by multiple cells or a point is outside of the computational domain.

Definition at line 257 of file mpi_remote_point_evaluation.h.

◆ process_and_evaluate()

template<int dim, int spacedim>
template<typename T >
void Utilities::MPI::RemotePointEvaluation< dim, spacedim >::process_and_evaluate ( const std::vector< T > &  input,
std::vector< T > &  buffer,
const std::function< void(const ArrayView< const T > &, const CellData &)> &  evaluation_function 
) const

This method is the inverse of the method evaluate_and_process(). It makes the data at the points, provided by input, available in the function evaluation_function.

Definition at line 371 of file mpi_remote_point_evaluation.h.

◆ get_point_ptrs()

template<int dim, int spacedim>
const std::vector< unsigned int > & Utilities::MPI::RemotePointEvaluation< dim, spacedim >::get_point_ptrs

Return a CRS-like data structure to determine the position of the result corresponding a point and the amount.

Definition at line 162 of file mpi_remote_point_evaluation.cc.

◆ is_map_unique()

template<int dim, int spacedim>
bool Utilities::MPI::RemotePointEvaluation< dim, spacedim >::is_map_unique

Return if points and cells have a one-to-one relation. This is not the case if a point is not owned by any cell (the point is outside of the domain) or if multiple cells own the point (the point is positioned on a geometric entity shared by neighboring cells).

Definition at line 171 of file mpi_remote_point_evaluation.cc.

◆ get_triangulation()

template<int dim, int spacedim>
const Triangulation< dim, spacedim > & Utilities::MPI::RemotePointEvaluation< dim, spacedim >::get_triangulation

Return the Triangulation object used during reinit().

Definition at line 180 of file mpi_remote_point_evaluation.cc.

◆ get_mapping()

template<int dim, int spacedim>
const Mapping< dim, spacedim > & Utilities::MPI::RemotePointEvaluation< dim, spacedim >::get_mapping

Return the Mapping object used during reinit().

Definition at line 189 of file mpi_remote_point_evaluation.cc.

◆ is_ready()

template<int dim, int spacedim>
bool Utilities::MPI::RemotePointEvaluation< dim, spacedim >::is_ready

Return if the internal data structures have been set up and if yes whether they are still valid (and not invalidated due to changes of the Triangulation).

Definition at line 198 of file mpi_remote_point_evaluation.cc.

Member Data Documentation

◆ tolerance

template<int dim, int spacedim = dim>
const double Utilities::MPI::RemotePointEvaluation< dim, spacedim >::tolerance
private

Tolerance to be used while determining the surrounding cells of a point.

Definition at line 172 of file mpi_remote_point_evaluation.h.

◆ enforce_unique_mapping

template<int dim, int spacedim = dim>
const bool Utilities::MPI::RemotePointEvaluation< dim, spacedim >::enforce_unique_mapping
private

Enforce unique mapping, i.e., (one-to-one) relation of points and cells.

Definition at line 178 of file mpi_remote_point_evaluation.h.

◆ tria_signal

template<int dim, int spacedim = dim>
boost::signals2::connection Utilities::MPI::RemotePointEvaluation< dim, spacedim >::tria_signal
private

Storage for the status of the triangulation signal.

Definition at line 183 of file mpi_remote_point_evaluation.h.

◆ ready_flag

template<int dim, int spacedim = dim>
bool Utilities::MPI::RemotePointEvaluation< dim, spacedim >::ready_flag
private

Flag indicating if the reinit() function has been called and if yes the triangulation has not been modified since then (potentially invalidating the communication pattern).

Definition at line 190 of file mpi_remote_point_evaluation.h.

◆ tria

template<int dim, int spacedim = dim>
SmartPointer<const Triangulation<dim, spacedim> > Utilities::MPI::RemotePointEvaluation< dim, spacedim >::tria
private

Reference to the Triangulation object used during reinit().

Definition at line 195 of file mpi_remote_point_evaluation.h.

◆ mapping

template<int dim, int spacedim = dim>
SmartPointer<const Mapping<dim, spacedim> > Utilities::MPI::RemotePointEvaluation< dim, spacedim >::mapping
private

Reference to the Mapping object used during reinit().

Definition at line 200 of file mpi_remote_point_evaluation.h.

◆ unique_mapping

template<int dim, int spacedim = dim>
bool Utilities::MPI::RemotePointEvaluation< dim, spacedim >::unique_mapping
private

(One-to-one) relation of points and cells.

Definition at line 205 of file mpi_remote_point_evaluation.h.

◆ point_ptrs

template<int dim, int spacedim = dim>
std::vector<unsigned int> Utilities::MPI::RemotePointEvaluation< dim, spacedim >::point_ptrs
private

Since for each point multiple or no results can be available, the pointers in this vector indicate the first and last entry associated with a point in a CRS-like fashion.

Definition at line 212 of file mpi_remote_point_evaluation.h.

◆ recv_permutation

template<int dim, int spacedim = dim>
std::vector<unsigned int> Utilities::MPI::RemotePointEvaluation< dim, spacedim >::recv_permutation
private

Permutation index within a recv buffer.

Definition at line 217 of file mpi_remote_point_evaluation.h.

◆ recv_ptrs

template<int dim, int spacedim = dim>
std::vector<unsigned int> Utilities::MPI::RemotePointEvaluation< dim, spacedim >::recv_ptrs
private

Pointers of ranges within a receive buffer that are filled by ranks specified by recv_ranks.

Definition at line 223 of file mpi_remote_point_evaluation.h.

◆ recv_ranks

template<int dim, int spacedim = dim>
std::vector<unsigned int> Utilities::MPI::RemotePointEvaluation< dim, spacedim >::recv_ranks
private

Ranks from where data is received.

Definition at line 228 of file mpi_remote_point_evaluation.h.

◆ cell_data

template<int dim, int spacedim = dim>
CellData Utilities::MPI::RemotePointEvaluation< dim, spacedim >::cell_data
private

Point data sorted according to cells so that evaluation (incl. reading of degrees of freedoms) needs to performed only once per cell.

Definition at line 234 of file mpi_remote_point_evaluation.h.

◆ send_permutation

template<int dim, int spacedim = dim>
std::vector<unsigned int> Utilities::MPI::RemotePointEvaluation< dim, spacedim >::send_permutation
private

Permutation index within a send buffer.

Definition at line 239 of file mpi_remote_point_evaluation.h.

◆ send_ranks

template<int dim, int spacedim = dim>
std::vector<unsigned int> Utilities::MPI::RemotePointEvaluation< dim, spacedim >::send_ranks
private

Ranks to send to.

Definition at line 244 of file mpi_remote_point_evaluation.h.

◆ send_ptrs

template<int dim, int spacedim = dim>
std::vector<unsigned int> Utilities::MPI::RemotePointEvaluation< dim, spacedim >::send_ptrs
private

Pointers of ranges within a send buffer to be sent to the ranks specified by send_ranks.

Definition at line 250 of file mpi_remote_point_evaluation.h.


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