deal.II version GIT relicensing-1984-g8e532b1e87 2024-10-13 23:20:00+00:00
\(\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\}}\)
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
FERemoteEvaluation< dim, n_components, value_type > Class Template Reference

#include <deal.II/matrix_free/fe_remote_evaluation.h>

Public Member Functions

template<typename MeshType >
 FERemoteEvaluation (const FERemoteEvaluationCommunicator< dim > &comm, const MeshType &mesh, const unsigned int first_selected_component=0, const VectorTools::EvaluationFlags::EvaluationFlags evaluation_flags=VectorTools::EvaluationFlags::avg)
 
template<typename VectorType >
void gather_evaluate (const VectorType &src, const EvaluationFlags::EvaluationFlags flags)
 
internal::PrecomputedEvaluationDataAccessor< dim, n_components, value_type > get_data_accessor () const
 

Private Member Functions

void set_mesh (const Triangulation< dim > &tria)
 
void set_mesh (const DoFHandler< dim > &dof_handler)
 

Private Attributes

internal::PrecomputedEvaluationData< dim, n_components, value_type > data
 
ObserverPointer< const FERemoteEvaluationCommunicator< dim > > comm
 
ObserverPointer< const Triangulation< dim > > tria
 
ObserverPointer< const DoFHandler< dim > > dof_handler
 
const unsigned int first_selected_component
 
const VectorTools::EvaluationFlags::EvaluationFlags evaluation_flags
 

Detailed Description

template<int dim, int n_components, typename value_type>
class FERemoteEvaluation< dim, n_components, value_type >

Class to access data in a matrix-free loop for non-matching discretizations. Interfaces are named with FEEvaluation in mind. The main difference is, that gather_evaluate() updates and caches all values at once. Therefore, it has to be called on one thread before a matrix-free loop.

To access values and gradients in a thread safe way, get_data_accessor() has to be called on every thread. It provides the functions get_value() and get_gradient().

Definition at line 538 of file fe_remote_evaluation.h.

Constructor & Destructor Documentation

◆ FERemoteEvaluation()

template<int dim, int n_components, typename value_type >
template<typename MeshType >
FERemoteEvaluation< dim, n_components, value_type >::FERemoteEvaluation ( const FERemoteEvaluationCommunicator< dim > &  comm,
const MeshType &  mesh,
const unsigned int  first_selected_component = 0,
const VectorTools::EvaluationFlags::EvaluationFlags  evaluation_flags = VectorTools::EvaluationFlags::avg 
)

The constructor needs a corresponding FERemoteEvaluationCommunicator which has to be set up outside of this class. This design choice is motivated since the same FERemoteEvaluationCommunicator can be used for different MeshTypes and number of components.

Parameters
[in]commFERemoteEvaluationCommunicator.
[in]meshTriangulation or DoFHandler.
[in]evaluation_flagsSpecify treatment of values at points which are found on multiple cells.
[in]first_selected_componentSelect first component of evaluation in DoFHandlers with multiple components.

Definition at line 1459 of file fe_remote_evaluation.h.

Member Function Documentation

◆ gather_evaluate()

template<int dim, int n_components, typename value_type >
template<typename VectorType >
void FERemoteEvaluation< dim, n_components, value_type >::gather_evaluate ( const VectorType &  src,
const EvaluationFlags::EvaluationFlags  flags 
)

Update the data which can be accessed via get_value() and get_gradient().

Parameters
[in]srcSolution vector used to update data.
[in]flagsEvaluation flags. Currently supported are EvaluationFlags::values and EvaluationFlags::gradients.

Definition at line 1474 of file fe_remote_evaluation.h.

◆ get_data_accessor()

template<int dim, int n_components, typename value_type >
internal::PrecomputedEvaluationDataAccessor< dim, n_components, value_type > FERemoteEvaluation< dim, n_components, value_type >::get_data_accessor ( ) const

FERemoteEvaluation does not provide the functions get_value() and get_gradient(). To access values and/or gradients call get_data_accessor() on every thread, e.g., auto remote_evaluator = get_data_accessor(); The returned object can be used as follows.

for (unsigned int entity = range.first; entity < range.second; ++entity)
{
remote_evaluator.reinit(entity);
for(unsigned int q : quadrature_point_indices())
remote_evaluator.get_value(q)
}

Definition at line 1503 of file fe_remote_evaluation.h.

◆ set_mesh() [1/2]

template<int dim, int n_components, typename value_type >
void FERemoteEvaluation< dim, n_components, value_type >::set_mesh ( const Triangulation< dim > &  tria)
private

Use Triangulation as MeshType.

Definition at line 1512 of file fe_remote_evaluation.h.

◆ set_mesh() [2/2]

template<int dim, int n_components, typename value_type >
void FERemoteEvaluation< dim, n_components, value_type >::set_mesh ( const DoFHandler< dim > &  dof_handler)
private

Use DoFHandler as MeshType.

Definition at line 1520 of file fe_remote_evaluation.h.

Member Data Documentation

◆ data

template<int dim, int n_components, typename value_type >
internal::PrecomputedEvaluationData<dim, n_components, value_type> FERemoteEvaluation< dim, n_components, value_type >::data
private

Precomputed values and/or gradients at remote locations.

Definition at line 607 of file fe_remote_evaluation.h.

◆ comm

template<int dim, int n_components, typename value_type >
ObserverPointer<const FERemoteEvaluationCommunicator<dim> > FERemoteEvaluation< dim, n_components, value_type >::comm
private

Underlying communicator which handles update of the ghost values.

Definition at line 612 of file fe_remote_evaluation.h.

◆ tria

template<int dim, int n_components, typename value_type >
ObserverPointer<const Triangulation<dim> > FERemoteEvaluation< dim, n_components, value_type >::tria
private

Pointer to MeshType if used with Triangulation.

Definition at line 617 of file fe_remote_evaluation.h.

◆ dof_handler

template<int dim, int n_components, typename value_type >
ObserverPointer<const DoFHandler<dim> > FERemoteEvaluation< dim, n_components, value_type >::dof_handler
private

Pointer to MeshType if used with DoFHandler.

Definition at line 622 of file fe_remote_evaluation.h.

◆ first_selected_component

template<int dim, int n_components, typename value_type >
const unsigned int FERemoteEvaluation< dim, n_components, value_type >::first_selected_component
private

First selected component.

Definition at line 627 of file fe_remote_evaluation.h.

◆ evaluation_flags

template<int dim, int n_components, typename value_type >
const VectorTools::EvaluationFlags::EvaluationFlags FERemoteEvaluation< dim, n_components, value_type >::evaluation_flags
private

Flags that indicate which ghost values are updated.

Definition at line 632 of file fe_remote_evaluation.h.


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