libMesh
Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions | Private Attributes | List of all members
libMesh::SparsityPattern::Build Class Reference

This helper class can be called on multiple threads to compute the sparsity pattern (or graph) of the sparse matrix resulting from the discretization. More...

#include <sparsity_pattern.h>

Inheritance diagram for libMesh::SparsityPattern::Build:
[legend]

Public Member Functions

 Build (const MeshBase &mesh_in, const DofMap &dof_map_in, const CouplingMatrix *dof_coupling_in, std::set< GhostingFunctor *> coupling_functors_in, const bool implicit_neighbor_dofs_in, const bool need_full_sparsity_pattern_in)
 
 Build (Build &other, Threads::split)
 
void operator() (const ConstElemRange &range)
 
void join (const Build &other)
 
void parallel_sync ()
 
const Parallel::Communicatorcomm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Public Attributes

SparsityPattern::Graph sparsity_pattern
 
SparsityPattern::NonlocalGraph nonlocal_pattern
 
std::vector< dof_id_typen_nz
 
std::vector< dof_id_typen_oz
 

Protected Attributes

const Parallel::Communicator_communicator
 

Private Member Functions

void handle_vi_vj (const std::vector< dof_id_type > &element_dofs_i, const std::vector< dof_id_type > &element_dofs_j)
 
void sorted_connected_dofs (const Elem *elem, std::vector< dof_id_type > &dofs_vi, unsigned int vi)
 

Private Attributes

const MeshBasemesh
 
const DofMapdof_map
 
const CouplingMatrixdof_coupling
 
const std::set< GhostingFunctor * > & coupling_functors
 
const bool implicit_neighbor_dofs
 
const bool need_full_sparsity_pattern
 

Detailed Description

This helper class can be called on multiple threads to compute the sparsity pattern (or graph) of the sparse matrix resulting from the discretization.

This pattern may be used directly by a particular sparse matrix format (e.g. LaspackMatrix) or indirectly (e.g. PetscMatrix). In the latter case the number of nonzeros per row of the matrix is needed for efficient preallocation. In this case it suffices to provide estimate (but bounding) values, and in this case the threaded method can take some short-cuts for efficiency.

Definition at line 80 of file sparsity_pattern.h.

Constructor & Destructor Documentation

◆ Build() [1/2]

libMesh::SparsityPattern::Build::Build ( const MeshBase mesh_in,
const DofMap dof_map_in,
const CouplingMatrix dof_coupling_in,
std::set< GhostingFunctor *>  coupling_functors_in,
const bool  implicit_neighbor_dofs_in,
const bool  need_full_sparsity_pattern_in 
)

◆ Build() [2/2]

libMesh::SparsityPattern::Build::Build ( Build other,
Threads::split   
)

Member Function Documentation

◆ comm()

const Parallel::Communicator& libMesh::ParallelObject::comm ( ) const
inherited

◆ handle_vi_vj()

void libMesh::SparsityPattern::Build::handle_vi_vj ( const std::vector< dof_id_type > &  element_dofs_i,
const std::vector< dof_id_type > &  element_dofs_j 
)
private

◆ join()

void libMesh::SparsityPattern::Build::join ( const Build other)

◆ n_processors()

processor_id_type libMesh::ParallelObject::n_processors ( ) const
inherited
Returns
The number of processors in the group.

Definition at line 93 of file parallel_object.h.

References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::size().

Referenced by libMesh::MeshBase::partition().

94  { return cast_int<processor_id_type>(_communicator.size()); }
processor_id_type size() const
Definition: communicator.h:175
const Parallel::Communicator & _communicator

◆ operator()()

void libMesh::SparsityPattern::Build::operator() ( const ConstElemRange range)

◆ parallel_sync()

void libMesh::SparsityPattern::Build::parallel_sync ( )

◆ processor_id()

processor_id_type libMesh::ParallelObject::processor_id ( ) const
inherited

◆ sorted_connected_dofs()

void libMesh::SparsityPattern::Build::sorted_connected_dofs ( const Elem elem,
std::vector< dof_id_type > &  dofs_vi,
unsigned int  vi 
)
private

Member Data Documentation

◆ _communicator

const Parallel::Communicator& libMesh::ParallelObject::_communicator
protectedinherited

◆ coupling_functors

const std::set<GhostingFunctor *>& libMesh::SparsityPattern::Build::coupling_functors
private

Definition at line 86 of file sparsity_pattern.h.

◆ dof_coupling

const CouplingMatrix* libMesh::SparsityPattern::Build::dof_coupling
private

Definition at line 85 of file sparsity_pattern.h.

◆ dof_map

const DofMap& libMesh::SparsityPattern::Build::dof_map
private

Definition at line 84 of file sparsity_pattern.h.

◆ implicit_neighbor_dofs

const bool libMesh::SparsityPattern::Build::implicit_neighbor_dofs
private

Definition at line 87 of file sparsity_pattern.h.

◆ mesh

const MeshBase& libMesh::SparsityPattern::Build::mesh
private

Definition at line 83 of file sparsity_pattern.h.

◆ n_nz

std::vector<dof_id_type> libMesh::SparsityPattern::Build::n_nz

Definition at line 102 of file sparsity_pattern.h.

◆ n_oz

std::vector<dof_id_type> libMesh::SparsityPattern::Build::n_oz

Definition at line 103 of file sparsity_pattern.h.

◆ need_full_sparsity_pattern

const bool libMesh::SparsityPattern::Build::need_full_sparsity_pattern
private

Definition at line 88 of file sparsity_pattern.h.

◆ nonlocal_pattern

SparsityPattern::NonlocalGraph libMesh::SparsityPattern::Build::nonlocal_pattern

Definition at line 100 of file sparsity_pattern.h.

◆ sparsity_pattern

SparsityPattern::Graph libMesh::SparsityPattern::Build::sparsity_pattern

Definition at line 99 of file sparsity_pattern.h.


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