deal.II version GIT relicensing-2165-gc91f007519 2024-11-20 01:40: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 | Public Attributes | List of all members
internal::DoFHandlerImplementation::NumberCache Struct Reference

#include <deal.II/dofs/number_cache.h>

Public Member Functions

 NumberCache ()
 
 NumberCache (const NumberCache &)=default
 
 NumberCache (NumberCache &&)=default
 
 NumberCache (const types::global_dof_index n_global_dofs)
 
 NumberCache (const std::vector< IndexSet > &locally_owned_dofs_per_processor, const unsigned int my_rank)
 
NumberCacheoperator= (const NumberCache &)=default
 
NumberCacheoperator= (NumberCache &&)=default
 
std::size_t memory_consumption () const
 
void clear ()
 
std::vector< types::global_dof_indexget_n_locally_owned_dofs_per_processor (const MPI_Comm mpi_communicator) const
 
std::vector< IndexSetget_locally_owned_dofs_per_processor (const MPI_Comm mpi_communicator) const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Public Attributes

types::global_dof_index n_global_dofs
 
types::global_dof_index n_locally_owned_dofs
 
IndexSet locally_owned_dofs
 
std::vector< types::global_dof_indexn_locally_owned_dofs_per_processor
 
std::vector< IndexSetlocally_owned_dofs_per_processor
 

Detailed Description

A structure used by the DoFHandler classes to store information about the degrees of freedom they deal with.

Definition at line 36 of file number_cache.h.

Constructor & Destructor Documentation

◆ NumberCache() [1/5]

internal::DoFHandlerImplementation::NumberCache::NumberCache ( )

Default constructor.

Definition at line 29 of file number_cache.cc.

◆ NumberCache() [2/5]

internal::DoFHandlerImplementation::NumberCache::NumberCache ( const NumberCache )
default

Copy constructor. Simply copy all members of the referenced object to the current object.

◆ NumberCache() [3/5]

internal::DoFHandlerImplementation::NumberCache::NumberCache ( NumberCache &&  )
default

Move constructor. Simply move all members of the referenced object to the current object.

◆ NumberCache() [4/5]

internal::DoFHandlerImplementation::NumberCache::NumberCache ( const types::global_dof_index  n_global_dofs)

Create a NumberCache object that corresponds to a sequential DoFHandler object in which a single processor stores all degrees of freedom. (Here, "sequential" means that either the whole program does not use MPI, or that it uses MPI but only uses a single MPI process, or that there are multiple MPI processes but the Triangulation on which this DoFHandler builds works only on one MPI process.)

Definition at line 35 of file number_cache.cc.

◆ NumberCache() [5/5]

internal::DoFHandlerImplementation::NumberCache::NumberCache ( const std::vector< IndexSet > &  locally_owned_dofs_per_processor,
const unsigned int  my_rank 
)

Create a NumberCache object that corresponds to a parallel DoFHandler object with as many processors as the size of the given argument, in which each processor stores the degrees of freedom indicated in the corresponding element of the vector passed as first argument. The second argument indicates the rank among all participating processors the current processor has, so that we can set the locally_owned_dofs and n_locally_owned_dofs fields.

All other fields stored by the current object can be and are computed from the argument.

Definition at line 45 of file number_cache.cc.

Member Function Documentation

◆ operator=() [1/2]

NumberCache & internal::DoFHandlerImplementation::NumberCache::operator= ( const NumberCache )
default

Copy operator. Simply copy all members of the referenced object to the current object.

◆ operator=() [2/2]

NumberCache & internal::DoFHandlerImplementation::NumberCache::operator= ( NumberCache &&  )
default

Move assignment operator. Simply move all members of the referenced object to the current object.

◆ memory_consumption()

std::size_t internal::DoFHandlerImplementation::NumberCache::memory_consumption ( ) const

Determine an estimate for the memory consumption (in bytes) of this object.

Definition at line 127 of file number_cache.cc.

◆ clear()

void internal::DoFHandlerImplementation::NumberCache::clear ( )

This function resets all the stored information.

Definition at line 73 of file number_cache.cc.

◆ get_n_locally_owned_dofs_per_processor()

std::vector< types::global_dof_index > internal::DoFHandlerImplementation::NumberCache::get_n_locally_owned_dofs_per_processor ( const MPI_Comm  mpi_communicator) const

Return a representation of n_locally_owned_dofs_per_processor both in case it was set up (directly returning the array) or in case we need to accumulate some information over all processors. The latter case involves global communication and is typically expensive to set up because it invokes MPI_Allgather.

Definition at line 85 of file number_cache.cc.

◆ get_locally_owned_dofs_per_processor()

std::vector< IndexSet > internal::DoFHandlerImplementation::NumberCache::get_locally_owned_dofs_per_processor ( const MPI_Comm  mpi_communicator) const

Return a representation of locally_owned_dofs_per_processor both in case it was set up (directly returning the array of IndexSet fields) or in case we need to accumulate some information over all processors. The latter case involves global communication and is typically expensive to set up because it invokes MPI_Allgather.

Definition at line 106 of file number_cache.cc.

◆ serialize()

template<class Archive >
void internal::DoFHandlerImplementation::NumberCache::serialize ( Archive &  ar,
const unsigned int  version 
)

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

Definition at line 194 of file number_cache.h.

Member Data Documentation

◆ n_global_dofs

types::global_dof_index internal::DoFHandlerImplementation::NumberCache::n_global_dofs

Total number of dofs, accumulated over all processors that may participate on this mesh.

Definition at line 136 of file number_cache.h.

◆ n_locally_owned_dofs

types::global_dof_index internal::DoFHandlerImplementation::NumberCache::n_locally_owned_dofs

Number of dofs owned by this MPI process. If this is a sequential computation, then this equals n_global_dofs. (Here, "sequential" means that either the whole program does not use MPI, or that it uses MPI but only uses a single MPI process, or that there are multiple MPI processes but the Triangulation on which this DoFHandler builds works only on one MPI process.)

Definition at line 146 of file number_cache.h.

◆ locally_owned_dofs

IndexSet internal::DoFHandlerImplementation::NumberCache::locally_owned_dofs

An index set denoting the set of locally owned dofs. If this is a sequential computation, then it contains the entire range [0,n_global_dofs). (Here, "sequential" means that either the whole program does not use MPI, or that it uses MPI but only uses a single MPI process, or that there are multiple MPI processes but the Triangulation on which this DoFHandler builds works only on one MPI process.)

Definition at line 157 of file number_cache.h.

◆ n_locally_owned_dofs_per_processor

std::vector<types::global_dof_index> internal::DoFHandlerImplementation::NumberCache::n_locally_owned_dofs_per_processor

The number of dofs owned by each of the various MPI processes. If this is a sequential computation, then the vector contains a single element equal to n_global_dofs. (Here, "sequential" means that either the whole program does not use MPI, or that it uses MPI but only uses a single MPI process, or that there are multiple MPI processes but the Triangulation on which this DoFHandler builds works only on one MPI process.)

Definition at line 168 of file number_cache.h.

◆ locally_owned_dofs_per_processor

std::vector<IndexSet> internal::DoFHandlerImplementation::NumberCache::locally_owned_dofs_per_processor

The dofs owned by each of the various MPI processes. If this is a sequential DoFHandler, then the vector has a single element equal to locally_owned_dofs. (Here, "sequential" means that either the whole program does not use MPI, or that it uses MPI but only uses a single MPI process, or that there are multiple MPI processes but the Triangulation on which this DoFHandler builds works only on one MPI process.)

Definition at line 179 of file number_cache.h.


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