deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+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
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | Related Symbols | List of all members
Portable::MatrixFree< dim, Number > Class Template Reference

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

Detailed Description

template<int dim, typename Number = double>
class Portable::MatrixFree< dim, Number >

This class collects all the data that is stored for the matrix free implementation. The storage scheme is tailored towards several loops performed with the same data, i.e., typically doing many matrix-vector products or residual computations on the same mesh.

This class does not implement any operations involving finite element basis functions, i.e., regarding the operation performed on the cells. For these operations, the class FEEvaluation is designed to use the data collected in this class.

This class implements a loop over all cells (cell_loop()). This loop is scheduled in such a way that cells that share degrees of freedom are not worked on simultaneously, which implies that it is possible to write to vectors in parallel without having to explicitly synchronize access to these vectors and matrices. This class does not implement any shape values, all it does is to cache the respective data. To implement finite element operations, use the class Portable::FEEvaluation.

This class traverse the cells in a different order than the usual Triangulation class in deal.II.

Note
Only float and double are supported.

Definition at line 197 of file portable_matrix_free.h.

Inheritance diagram for Portable::MatrixFree< dim, Number >:
[legend]

Classes

struct  AdditionalData
 
struct  Data
 
struct  DoFInfo
 
struct  MappingInfo
 
struct  PrecomputedData
 

Public Types

using jacobian_type = Tensor< 2, dim, Tensor< 1, dim, Number > >
 
using point_type = Point< dim, Number >
 
using CellFilter = FilteredIterator< typename DoFHandler< dim >::active_cell_iterator >
 
using LevelCellFilter = FilteredIterator< typename DoFHandler< dim >::level_cell_iterator >
 

Public Member Functions

 MatrixFree ()
 
unsigned int get_padding_length () const
 
template<typename IteratorFiltersType >
void reinit (const Mapping< dim > &mapping, const DoFHandler< dim > &dof_handler, const AffineConstraints< Number > &constraints, const Quadrature< 1 > &quad, const IteratorFiltersType &iterator_filter, const AdditionalData &additional_data=AdditionalData())
 
void reinit (const Mapping< dim > &mapping, const DoFHandler< dim > &dof_handler, const AffineConstraints< Number > &constraints, const Quadrature< 1 > &quad, const AdditionalData &additional_data=AdditionalData())
 
void reinit (const DoFHandler< dim > &dof_handler, const AffineConstraints< Number > &constraints, const Quadrature< 1 > &quad, const AdditionalData &additional_data=AdditionalData())
 
template<typename IteratorFiltersType >
void reinit (const Mapping< dim > &mapping, const std::vector< const DoFHandler< dim > * > &dof_handler, const std::vector< const AffineConstraints< Number > * > &constraints, const Quadrature< 1 > &quad, const IteratorFiltersType &iterator_filter, const AdditionalData &additional_data=AdditionalData())
 
void reinit (const Mapping< dim > &mapping, const std::vector< const DoFHandler< dim > * > &dof_handler, const std::vector< const AffineConstraints< Number > * > &constraints, const Quadrature< 1 > &quad, const AdditionalData &additional_data=AdditionalData())
 
PrecomputedData get_data (const unsigned int color, const unsigned int dof_handler_index=0) const
 
template<typename Functor , typename VectorType >
void cell_loop (const Functor &func, const VectorType &src, VectorType &dst) const
 
template<typename Functor >
void evaluate_coefficients (Functor func) const
 
template<typename VectorType >
void copy_constrained_values (const VectorType &src, VectorType &dst, const unsigned int dof_handler_index=0) const
 
void copy_constrained_values (const LinearAlgebra::distributed::BlockVector< Number, MemorySpace::Default > &src, LinearAlgebra::distributed::BlockVector< Number, MemorySpace::Default > &dst) const
 
template<typename VectorType >
void set_constrained_values (const Number value, VectorType &dst, const unsigned int dof_handler_index=0) const
 
template<typename MemorySpaceType >
void initialize_dof_vector (LinearAlgebra::distributed::Vector< Number, MemorySpaceType > &vec, const unsigned int dof_handler_index=0) const
 
template<typename MemorySpaceType >
void initialize_dof_vector (LinearAlgebra::distributed::BlockVector< Number, MemorySpaceType > &vec) const
 
const std::vector< std::vector< CellFilter > > & get_colored_graph () const
 
const std::vector< std::vector< LevelCellFilter > > & get_colored_level_graph () const
 
const std::shared_ptr< const Utilities::MPI::Partitioner > & get_vector_partitioner (const unsigned int dof_handler_index=0) const
 
const DoFHandler< dim > & get_dof_handler (const unsigned int dof_handler_index=0) const
 
unsigned int get_mg_level () const
 
DoFHandler< dim >::cell_iterator get_cell_iterator (const unsigned int color, const unsigned int index, const unsigned int dof_handler_index=0) const
 
unsigned int n_cells_per_color (const unsigned int color) const
 
bool use_overlap_communication_computation () const
 
std::size_t memory_consumption () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 
Querying the observer pointers an object has.
unsigned int n_subscriptions () const
 
template<typename StreamType >
void list_subscribers (StreamType &stream) const
 
void list_subscribers () const
 

Static Public Member Functions

static ::ExceptionBase & ExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBase & ExcNoSubscriber (std::string arg1, std::string arg2)
 

Private Member Functions

template<typename IteratorFiltersType >
void internal_reinit (const Mapping< dim > &mapping, const std::vector< const DoFHandler< dim > * > &dof_handler, const std::vector< const AffineConstraints< Number > * > &constraints, const Quadrature< 1 > &quad, const IteratorFiltersType &iterator_filter, const std::shared_ptr< const MPI_Comm > &comm, const AdditionalData additional_data)
 
template<typename Functor , typename VectorType >
void serial_cell_loop (const Functor &func, const VectorType &src, VectorType &dst) const
 
template<typename Functor >
void distributed_cell_loop (const Functor &func, const LinearAlgebra::distributed::Vector< Number, MemorySpace::Default > &src, LinearAlgebra::distributed::Vector< Number, MemorySpace::Default > &dst) const
 
template<typename Functor >
void distributed_cell_loop (const Functor &func, const LinearAlgebra::distributed::BlockVector< Number, MemorySpace::Default > &src, LinearAlgebra::distributed::BlockVector< Number, MemorySpace::Default > &dst) const
 
EnableObserverPointer functionality

Classes derived from EnableObserverPointer provide a facility to subscribe to this object. This is mostly used by the ObserverPointer class.

void subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void check_no_subscribers () const noexcept
 

Private Attributes

int my_id
 
bool use_coloring
 
bool overlap_communication_computation
 
unsigned int mg_level
 
unsigned int team_size
 
std::vector< MappingInfo > mapping_info
 
std::vector< DoFInfo > dof_handler_data
 
unsigned int q_points_per_cell
 
unsigned int n_colors
 
std::vector< unsigned int > n_cells
 
unsigned int padding_length
 
std::vector< unsigned int > row_start
 
std::vector< std::vector< CellFilter > > graph
 
std::vector< std::vector< LevelCellFilter > > level_graph
 
std::atomic< unsigned int > counter
 
std::map< std::string, unsigned int > counter_map
 
std::vector< std::atomic< bool > * > validity_pointers
 
const std::type_info * object_info
 

Static Private Attributes

static std::mutex mutex
 

Friends

class internal::ReinitHelper< dim, Number >
 

Related Symbols

(Note that these are not member symbols.)

template<int dim, typename Number >
DataHost< dim, Number > copy_mf_data_to_host (const typename::Portable::MatrixFree< dim, Number >::PrecomputedData &data, const UpdateFlags &update_flags)
 

Member Typedef Documentation

◆ jacobian_type

template<int dim, typename Number = double>
using Portable::MatrixFree< dim, Number >::jacobian_type = Tensor<2, dim, Tensor<1, dim, Number> >

Definition at line 200 of file portable_matrix_free.h.

◆ point_type

template<int dim, typename Number = double>
using Portable::MatrixFree< dim, Number >::point_type = Point<dim, Number>

Definition at line 201 of file portable_matrix_free.h.

◆ CellFilter

template<int dim, typename Number = double>
using Portable::MatrixFree< dim, Number >::CellFilter = FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>

Definition at line 202 of file portable_matrix_free.h.

◆ LevelCellFilter

template<int dim, typename Number = double>
using Portable::MatrixFree< dim, Number >::LevelCellFilter = FilteredIterator<typename DoFHandler<dim>::level_cell_iterator>

Definition at line 204 of file portable_matrix_free.h.

Constructor & Destructor Documentation

◆ MatrixFree()

template<int dim, typename Number = double>
Portable::MatrixFree< dim, Number >::MatrixFree ( )

Default constructor.

Member Function Documentation

◆ get_padding_length()

template<int dim, typename Number = double>
unsigned int Portable::MatrixFree< dim, Number >::get_padding_length ( ) const

Return the length of the padding.

◆ reinit() [1/5]

template<int dim, typename Number = double>
template<typename IteratorFiltersType >
void Portable::MatrixFree< dim, Number >::reinit ( const Mapping< dim > &  mapping,
const DoFHandler< dim > &  dof_handler,
const AffineConstraints< Number > &  constraints,
const Quadrature< 1 > &  quad,
const IteratorFiltersType &  iterator_filter,
const AdditionalData &  additional_data = AdditionalData() 
)

Extracts the information needed to perform loops over cells. The DoFHandler and AffineConstraints objects describe the layout of degrees of freedom, the DoFHandler and the mapping describe the transformation from unit to real cell, and the finite element underlying the DoFHandler together with the quadrature formula describe the local operations. This function takes an IteratorFilters object (predicate) to loop over a subset of the active cells. When using MPI, the predicate should filter out non locally owned cells.

◆ reinit() [2/5]

template<int dim, typename Number = double>
void Portable::MatrixFree< dim, Number >::reinit ( const Mapping< dim > &  mapping,
const DoFHandler< dim > &  dof_handler,
const AffineConstraints< Number > &  constraints,
const Quadrature< 1 > &  quad,
const AdditionalData &  additional_data = AdditionalData() 
)

Same as above using Iterators::LocallyOwnedCell() as predicate.

◆ reinit() [3/5]

template<int dim, typename Number = double>
void Portable::MatrixFree< dim, Number >::reinit ( const DoFHandler< dim > &  dof_handler,
const AffineConstraints< Number > &  constraints,
const Quadrature< 1 > &  quad,
const AdditionalData &  additional_data = AdditionalData() 
)

Initializes the data structures. Same as above but using a Q1 mapping.

◆ reinit() [4/5]

template<int dim, typename Number = double>
template<typename IteratorFiltersType >
void Portable::MatrixFree< dim, Number >::reinit ( const Mapping< dim > &  mapping,
const std::vector< const DoFHandler< dim > * > &  dof_handler,
const std::vector< const AffineConstraints< Number > * > &  constraints,
const Quadrature< 1 > &  quad,
const IteratorFiltersType &  iterator_filter,
const AdditionalData &  additional_data = AdditionalData() 
)

Reinit with a list of DoFHandler objects.

◆ reinit() [5/5]

template<int dim, typename Number = double>
void Portable::MatrixFree< dim, Number >::reinit ( const Mapping< dim > &  mapping,
const std::vector< const DoFHandler< dim > * > &  dof_handler,
const std::vector< const AffineConstraints< Number > * > &  constraints,
const Quadrature< 1 > &  quad,
const AdditionalData &  additional_data = AdditionalData() 
)

Same as above using Iterators::LocallyOwnedCell() as predicate.

◆ get_data()

template<int dim, typename Number = double>
PrecomputedData Portable::MatrixFree< dim, Number >::get_data ( const unsigned int  color,
const unsigned int  dof_handler_index = 0 
) const

Return the Data structure associated with color.

◆ cell_loop()

template<int dim, typename Number = double>
template<typename Functor , typename VectorType >
void Portable::MatrixFree< dim, Number >::cell_loop ( const Functor &  func,
const VectorType &  src,
VectorType &  dst 
) const

This method performs a loop over all cells and applies the local operation on each element in parallel. func is a functor which is applied for each color and each cell.

If VectorType is a LinearAlgebra::distributed::Vector, func needs to define

DeviceVector<Number> &dst) const;
static const unsigned int n_q_points;
*  *  Point< dim > operator()(const Point< dim > &p) const * 
#define DEAL_II_HOST_DEVICE
Definition config.h:171
std::vector< index_type > data
Definition mpi.cc:734
Kokkos::View< Number *, MemorySpace::Default::kokkos_space > DeviceVector

If VectorType is a LinearAlgebra::distributed::BlockVector, func uses BlockDeviceVector instead of DeviceVector for the src and dst arguments.

While src can be left empty, dst must be provided and allocated with a partitioner of one of the DoFHandlers of this MatrixFree object (or a BlockVector with one block for each DoFHandler). If src is provided, it must have the same partitioner as dst.

◆ evaluate_coefficients()

template<int dim, typename Number = double>
template<typename Functor >
void Portable::MatrixFree< dim, Number >::evaluate_coefficients ( Functor  func) const

This method runs the loop over all cells and apply the local operation on each element in parallel. This function is very similar to cell_loop() but it uses a simpler functor.

A typical usage of this function is to fill a Kokkos::View or LinearAlgebra::distributed::Vector with data for every cell or quadrature point. See step-64 for an example.

func needs to define

static const unsigned int n_q_points;

◆ copy_constrained_values() [1/2]

template<int dim, typename Number = double>
template<typename VectorType >
void Portable::MatrixFree< dim, Number >::copy_constrained_values ( const VectorType &  src,
VectorType &  dst,
const unsigned int  dof_handler_index = 0 
) const

Copy the values of the constrained entries from src to dst. This is used to impose zero Dirichlet boundary conditions.

dof_handler_index is used to select the DoFHandler object.

◆ copy_constrained_values() [2/2]

template<int dim, typename Number = double>
void Portable::MatrixFree< dim, Number >::copy_constrained_values ( const LinearAlgebra::distributed::BlockVector< Number, MemorySpace::Default > &  src,
LinearAlgebra::distributed::BlockVector< Number, MemorySpace::Default > &  dst 
) const

Copy the values of the constrained entries from src to dst. This is used to impose zero Dirichlet boundary conditions.

This is a specialization for BlockVector and will copy the constrained values for all DoFHandlers. The number of blocks in src and dst must be equal to the number of DoFHandlers of this MatrixFree object.

◆ set_constrained_values()

template<int dim, typename Number = double>
template<typename VectorType >
void Portable::MatrixFree< dim, Number >::set_constrained_values ( const Number  value,
VectorType &  dst,
const unsigned int  dof_handler_index = 0 
) const

Set the entries in dst corresponding to constrained values to value. The main purpose of this function is to set the constrained entries of the source vector used in cell_loop() to zero.

dof_handler_index is used to select the DoFHandler object.

◆ initialize_dof_vector() [1/2]

template<int dim, typename Number = double>
template<typename MemorySpaceType >
void Portable::MatrixFree< dim, Number >::initialize_dof_vector ( LinearAlgebra::distributed::Vector< Number, MemorySpaceType > &  vec,
const unsigned int  dof_handler_index = 0 
) const

Initialize a distributed vector. The local elements correspond to the locally owned degrees of freedom and the ghost elements correspond to the (additional) locally relevant dofs.

If the MatrixFree class is initialized with more than one DoFHandler, it can be chosen with dof_handler_index.

◆ initialize_dof_vector() [2/2]

template<int dim, typename Number = double>
template<typename MemorySpaceType >
void Portable::MatrixFree< dim, Number >::initialize_dof_vector ( LinearAlgebra::distributed::BlockVector< Number, MemorySpaceType > &  vec) const

Initialize a distributed block vector. The local elements correspond to the locally owned degrees of freedom and the ghost elements correspond to the (additional) locally relevant dofs. This version creates one block for each DoFHandler provided when the MatrixFree class was initialized.

◆ get_colored_graph()

template<int dim, typename Number = double>
const std::vector< std::vector< CellFilter > > & Portable::MatrixFree< dim, Number >::get_colored_graph ( ) const

Return the colored graph of locally owned active cells.

Warning
if MatrixFree is initialized for a specific multigrid level, this function will throw an exception.

◆ get_colored_level_graph()

template<int dim, typename Number = double>
const std::vector< std::vector< LevelCellFilter > > & Portable::MatrixFree< dim, Number >::get_colored_level_graph ( ) const

Return the colored graph of locally owned level cells.

Warning
if MatrixFree is initialized for active cells, this function will throw an exception.

◆ get_vector_partitioner()

template<int dim, typename Number = double>
const std::shared_ptr< const Utilities::MPI::Partitioner > & Portable::MatrixFree< dim, Number >::get_vector_partitioner ( const unsigned int  dof_handler_index = 0) const

Return the partitioner that represents the locally owned data and the ghost indices where access is needed to for the cell loop. The partitioner is constructed from the locally owned dofs and ghost dofs given by the respective fields. If you want to have specific information about these objects, you can query them with the respective access functions. If you just want to initialize a (parallel) vector, you should usually prefer this data structure as the data exchange information can be reused from one vector to another.

◆ get_dof_handler()

template<int dim, typename Number = double>
const DoFHandler< dim > & Portable::MatrixFree< dim, Number >::get_dof_handler ( const unsigned int  dof_handler_index = 0) const

Return the DoFHandler with index dof_handler_index.

◆ get_mg_level()

template<int dim, typename Number = double>
unsigned int Portable::MatrixFree< dim, Number >::get_mg_level ( ) const

Return the local smoothing multigrid level that this object has been initialized with. The level is numbers::invalid_unsigned_int for active cells.

◆ get_cell_iterator()

template<int dim, typename Number = double>
DoFHandler< dim >::cell_iterator Portable::MatrixFree< dim, Number >::get_cell_iterator ( const unsigned int  color,
const unsigned int  index,
const unsigned int  dof_handler_index = 0 
) const

Return the cell iterator given the index within the color.

Parameters
colorThe color index
indexThe index within the color
dof_handler_indexIndex of the DoFHandler (default 0)

◆ n_cells_per_color()

template<int dim, typename Number = double>
unsigned int Portable::MatrixFree< dim, Number >::n_cells_per_color ( const unsigned int  color) const

Return the entries (cells) per color.

◆ use_overlap_communication_computation()

template<int dim, typename Number = double>
bool Portable::MatrixFree< dim, Number >::use_overlap_communication_computation ( ) const

Return the flag indicating whether overlap MPI communication with computation is used as was set by AdditionalData::overlap_communication_computation.

◆ memory_consumption()

template<int dim, typename Number = double>
std::size_t Portable::MatrixFree< dim, Number >::memory_consumption ( ) const

Return an approximation of the memory consumption of this class in bytes.

◆ internal_reinit()

template<int dim, typename Number = double>
template<typename IteratorFiltersType >
void Portable::MatrixFree< dim, Number >::internal_reinit ( const Mapping< dim > &  mapping,
const std::vector< const DoFHandler< dim > * > &  dof_handler,
const std::vector< const AffineConstraints< Number > * > &  constraints,
const Quadrature< 1 > &  quad,
const IteratorFiltersType &  iterator_filter,
const std::shared_ptr< const MPI_Comm > &  comm,
const AdditionalData  additional_data 
)
private

Initializes the data structures.

◆ serial_cell_loop()

template<int dim, typename Number = double>
template<typename Functor , typename VectorType >
void Portable::MatrixFree< dim, Number >::serial_cell_loop ( const Functor &  func,
const VectorType &  src,
VectorType &  dst 
) const
private

Helper function. Loop over all the cells and apply the functor on each element in parallel. This function is used when MPI is not used.

◆ distributed_cell_loop() [1/2]

template<int dim, typename Number = double>
template<typename Functor >
void Portable::MatrixFree< dim, Number >::distributed_cell_loop ( const Functor &  func,
const LinearAlgebra::distributed::Vector< Number, MemorySpace::Default > &  src,
LinearAlgebra::distributed::Vector< Number, MemorySpace::Default > &  dst 
) const
private

Helper function. Loop over all the cells and apply the functor on each element in parallel. This function is used when MPI is used.

◆ distributed_cell_loop() [2/2]

template<int dim, typename Number = double>
template<typename Functor >
void Portable::MatrixFree< dim, Number >::distributed_cell_loop ( const Functor &  func,
const LinearAlgebra::distributed::BlockVector< Number, MemorySpace::Default > &  src,
LinearAlgebra::distributed::BlockVector< Number, MemorySpace::Default > &  dst 
) const
private

Same as above but for BlockVector.

◆ n_subscriptions()

unsigned int EnableObserverPointer::n_subscriptions ( ) const
inlineinherited

Return the present number of subscriptions to this object. This allows to use this class for reference counted lifetime determination where the last one to unsubscribe also deletes the object.

Definition at line 318 of file enable_observer_pointer.h.

◆ list_subscribers() [1/2]

template<typename StreamType >
void EnableObserverPointer::list_subscribers ( StreamType &  stream) const
inlineinherited

List the subscribers to the input stream.

Definition at line 335 of file enable_observer_pointer.h.

◆ list_subscribers() [2/2]

void EnableObserverPointer::list_subscribers ( ) const
inherited

List the subscribers to deallog.

Definition at line 200 of file enable_observer_pointer.cc.

◆ serialize()

template<class Archive >
void EnableObserverPointer::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineinherited

Read or write the data of this object to or from a stream for the purpose of serialization using the BOOST serialization library.

This function does not actually serialize any of the member variables of this class. The reason is that what this class stores is only who subscribes to this object, but who does so at the time of storing the contents of this object does not necessarily have anything to do with who subscribes to the object when it is restored. Consequently, we do not want to overwrite the subscribers at the time of restoring, and then there is no reason to write the subscribers out in the first place.

Definition at line 327 of file enable_observer_pointer.h.

◆ subscribe()

void EnableObserverPointer::subscribe ( std::atomic< bool > *const  validity,
const std::string &  identifier = "" 
) const
privateinherited

Subscribes a user of the object by storing the pointer validity. The subscriber may be identified by text supplied as identifier.

Definition at line 136 of file enable_observer_pointer.cc.

◆ unsubscribe()

void EnableObserverPointer::unsubscribe ( std::atomic< bool > *const  validity,
const std::string &  identifier = "" 
) const
privateinherited

Unsubscribes a user from the object.

Note
The identifier and the validity pointer must be the same as the one supplied to subscribe().

Definition at line 154 of file enable_observer_pointer.cc.

◆ check_no_subscribers()

void EnableObserverPointer::check_no_subscribers ( ) const
privatenoexceptinherited

Check that there are no objects subscribing to this object. If this check passes then it is safe to destroy the current object. It this check fails then this function will either abort or print an error message to deallog (by using the AssertNothrow mechanism), but will not throw an exception.

Note
Since this function is just a consistency check it does nothing in release mode.
If this function is called when there is an uncaught exception then, rather than aborting, this function prints an error message to the standard error stream and returns.

Definition at line 58 of file enable_observer_pointer.cc.

Friends And Related Symbol Documentation

◆ internal::ReinitHelper< dim, Number >

template<int dim, typename Number = double>
friend class internal::ReinitHelper< dim, Number >
friend

Definition at line 1078 of file portable_matrix_free.h.

◆ copy_mf_data_to_host()

template<int dim, typename Number >
DataHost< dim, Number > copy_mf_data_to_host ( const typename ::Portable::MatrixFree< dim, Number >::PrecomputedData &  data,
const UpdateFlags &  update_flags 
)
related

Copy data from the device to the host. update_flags should be identical to the one used in MatrixFree::AdditionalData.

Definition at line 1295 of file portable_matrix_free.h.

Member Data Documentation

◆ my_id

template<int dim, typename Number = double>
int Portable::MatrixFree< dim, Number >::my_id
private

Unique ID associated with the object.

Definition at line 844 of file portable_matrix_free.h.

◆ use_coloring

template<int dim, typename Number = double>
bool Portable::MatrixFree< dim, Number >::use_coloring
private

If true, use graph coloring. Otherwise, use atomic operations. Graph coloring ensures bitwise reproducibility but is slower on Pascal and newer architectures.

Definition at line 851 of file portable_matrix_free.h.

◆ overlap_communication_computation

template<int dim, typename Number = double>
bool Portable::MatrixFree< dim, Number >::overlap_communication_computation
private

Overlap MPI communications with computation. This requires device-aware MPI and use_coloring must be false.

Definition at line 857 of file portable_matrix_free.h.

◆ mg_level

template<int dim, typename Number = double>
unsigned int Portable::MatrixFree< dim, Number >::mg_level
private

Multigrid level for which this MatrixFree object is initialized. If set to numbers::invalid_unsigned_int, this operates on active cells.

Definition at line 863 of file portable_matrix_free.h.

◆ team_size

template<int dim, typename Number = double>
unsigned int Portable::MatrixFree< dim, Number >::team_size
private

The team size used by the underlying kokkos team policy. If -1 is provided then Kokkos::AUTO will be used.

Definition at line 869 of file portable_matrix_free.h.

◆ mapping_info

template<int dim, typename Number = double>
std::vector<MappingInfo> Portable::MatrixFree< dim, Number >::mapping_info
private

Store information for each quadrature formula / mapping. Currently always exactly size 1.

Definition at line 929 of file portable_matrix_free.h.

◆ dof_handler_data

template<int dim, typename Number = double>
std::vector<DoFInfo> Portable::MatrixFree< dim, Number >::dof_handler_data
private

Store information necessary for each DoFHandler

Definition at line 1039 of file portable_matrix_free.h.

◆ q_points_per_cell

template<int dim, typename Number = double>
unsigned int Portable::MatrixFree< dim, Number >::q_points_per_cell
private

Number of quadrature points per cells.

Definition at line 1044 of file portable_matrix_free.h.

◆ n_colors

template<int dim, typename Number = double>
unsigned int Portable::MatrixFree< dim, Number >::n_colors
private

Number of colors produced by the graph coloring algorithm.

Definition at line 1049 of file portable_matrix_free.h.

◆ n_cells

template<int dim, typename Number = double>
std::vector<unsigned int> Portable::MatrixFree< dim, Number >::n_cells
private

Number of cells in each color.

Definition at line 1054 of file portable_matrix_free.h.

◆ padding_length

template<int dim, typename Number = double>
unsigned int Portable::MatrixFree< dim, Number >::padding_length
private

Length of the padding (closest power of two larger than or equal to the number of thread).

Definition at line 1060 of file portable_matrix_free.h.

◆ row_start

template<int dim, typename Number = double>
std::vector<unsigned int> Portable::MatrixFree< dim, Number >::row_start
private

Row start of each color.

Definition at line 1065 of file portable_matrix_free.h.

◆ graph

template<int dim, typename Number = double>
std::vector<std::vector<CellFilter> > Portable::MatrixFree< dim, Number >::graph
private

Colored graph of locally owned active cells (used when mg_level == invalid).

Definition at line 1072 of file portable_matrix_free.h.

◆ level_graph

template<int dim, typename Number = double>
std::vector<std::vector<LevelCellFilter> > Portable::MatrixFree< dim, Number >::level_graph
private

Colored graph of locally owned level cells (used when mg_level != invalid).

Definition at line 1078 of file portable_matrix_free.h.

◆ counter

std::atomic<unsigned int> EnableObserverPointer::counter
mutableprivateinherited

Store the number of objects which subscribed to this object. Initially, this number is zero, and upon destruction it shall be zero again (i.e. all objects which subscribed should have unsubscribed again).

The creator (and owner) of an object is counted in the map below if HE manages to supply identification.

We use the mutable keyword in order to allow subscription to constant objects also.

This counter may be read from and written to concurrently in multithreaded code: hence we use the std::atomic class template.

Definition at line 212 of file enable_observer_pointer.h.

◆ counter_map

std::map<std::string, unsigned int> EnableObserverPointer::counter_map
mutableprivateinherited

In this map, we count subscriptions for each different identification string supplied to subscribe().

Definition at line 218 of file enable_observer_pointer.h.

◆ validity_pointers

std::vector<std::atomic<bool> *> EnableObserverPointer::validity_pointers
mutableprivateinherited

In this vector, we store pointers to the validity bool in the ObserverPointer objects that subscribe to this class.

Definition at line 224 of file enable_observer_pointer.h.

◆ object_info

const std::type_info* EnableObserverPointer::object_info
mutableprivateinherited

Pointer to the typeinfo object of this object, from which we can later deduce the class name. Since this information on the derived class is neither available in the destructor, nor in the constructor, we obtain it in between and store it here.

Definition at line 232 of file enable_observer_pointer.h.

◆ mutex

std::mutex EnableObserverPointer::mutex
staticprivateinherited

A mutex used to ensure data consistency when accessing the mutable members of this class. This lock is used in the subscribe() and unsubscribe() functions, as well as in list_subscribers().

Definition at line 239 of file enable_observer_pointer.h.


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