libMesh
Loading...
Searching...
No Matches
Public Member Functions | 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 DofMap &dof_map_in, const CouplingMatrix *dof_coupling_in, const std::vector< GhostingFunctor * > &coupling_functors_in, const bool implicit_neighbor_dofs_in, const bool need_full_sparsity_pattern_in, const bool calculate_constrained_in=false, const StaticCondensationDofMap *sc=nullptr)
 
 Build (const Build &)=default
 Special functions.
 
Buildoperator= (const Build &)=delete
 
 Build (Build &&)=default
 
Buildoperator= (Build &&)=delete
 
 ~Build ()=default
 
 Build (Build &other, Threads::split)
 Splitting constructor, for use in multithreaded loops.
 
void operator() (const ConstElemRange &range)
 Add entries from a range of elements to this object's sparsity pattern.
 
void join (const Build &other)
 Combine the sparsity pattern in other with this object's sparsity pattern.
 
void parallel_sync ()
 Send sparsity pattern data relevant to other processors to those processors, and receive and incorporate data relevant to us.
 
const SparsityPattern::Graphget_sparsity_pattern () const
 Rows of sparse matrix indices, indexed by the offset from the first DoF on this processor.
 
const SparsityPattern::NonlocalGraphget_nonlocal_pattern () const
 Rows of sparse matrix indices, mapped from global DoF number, which belong on other processors.
 
std::size_t n_nonzeros () const
 The total number of nonzeros in the global matrix.
 
const std::vector< dof_id_type > & get_n_nz () const
 The number of on-processor nonzeros in my portion of the global matrix.
 
const std::vector< dof_id_type > & get_n_oz () const
 The number of off-processor nonzeros in my portion of the global matrix.
 
void apply_extra_sparsity_object (SparsityPattern::AugmentSparsityPattern &asp)
 Let a user-provided AugmentSparsityPattern subclass modify our sparsity structure.
 
void apply_extra_sparsity_function (void(*func)(SparsityPattern::Graph &sparsity, std::vector< dof_id_type > &n_nz, std::vector< dof_id_type > &n_oz, void *context), void *context)
 Let a user-provided function modify our sparsity structure.
 
void clear_full_sparsity ()
 Clear the "full" details of our sparsity structure, leaving only the counts of non-zero entries.
 
const Parallel::Communicatorcomm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

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 DofMapdof_map
 
const CouplingMatrixdof_coupling
 
const std::vector< GhostingFunctor * > & coupling_functors
 
const bool implicit_neighbor_dofs
 
const bool need_full_sparsity_pattern
 
const bool calculate_constrained
 
const StaticCondensationDofMap *const sc
 
std::unordered_set< dof_id_typehashed_dof_sets
 If there are "spider" nodes in the mesh (i.e.
 
std::vector< dof_id_typedummy_vec
 A dummy work vector to avoid repeated memory allocations.
 
SparsityPattern::Graph sparsity_pattern
 
SparsityPattern::NonlocalGraph nonlocal_pattern
 
std::vector< dof_id_typen_nz
 
std::vector< dof_id_typen_oz
 

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. PetscMatrixBase). 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 103 of file sparsity_pattern.h.

Constructor & Destructor Documentation

◆ Build() [1/4]

libMesh::SparsityPattern::Build::Build ( const DofMap dof_map_in,
const CouplingMatrix dof_coupling_in,
const std::vector< GhostingFunctor * > &  coupling_functors_in,
const bool  implicit_neighbor_dofs_in,
const bool  need_full_sparsity_pattern_in,
const bool  calculate_constrained_in = false,
const StaticCondensationDofMap sc = nullptr 
)

Definition at line 47 of file sparsity_pattern.C.

53 :
54 ParallelObject(dof_map_in),
55 dof_map(dof_map_in),
56 dof_coupling(dof_coupling_in),
57 coupling_functors(coupling_functors_in),
58 implicit_neighbor_dofs(implicit_neighbor_dofs_in),
59 need_full_sparsity_pattern(need_full_sparsity_pattern_in),
60 calculate_constrained(calculate_constrained_in),
61 sc(sc_in),
64 n_nz(),
65 n_oz()
66{}
ParallelObject(const Parallel::Communicator &comm_in)
Constructor.
SparsityPattern::Graph sparsity_pattern
const CouplingMatrix * dof_coupling
const StaticCondensationDofMap *const sc
const std::vector< GhostingFunctor * > & coupling_functors
std::vector< dof_id_type > n_nz
SparsityPattern::NonlocalGraph nonlocal_pattern
std::vector< dof_id_type > n_oz

◆ Build() [2/4]

libMesh::SparsityPattern::Build::Build ( const Build )
default

Special functions.

  • The Build object holds references to DofMap and coupling functors, therefore it can't be assigned.

◆ Build() [3/4]

libMesh::SparsityPattern::Build::Build ( Build &&  )
default

◆ ~Build()

libMesh::SparsityPattern::Build::~Build ( )
default

◆ Build() [4/4]

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

Splitting constructor, for use in multithreaded loops.

Definition at line 70 of file sparsity_pattern.C.

70 :
71 ParallelObject(other),
72 dof_map(other.dof_map),
73 dof_coupling(other.dof_coupling),
74 coupling_functors(other.coupling_functors),
75 implicit_neighbor_dofs(other.implicit_neighbor_dofs),
76 need_full_sparsity_pattern(other.need_full_sparsity_pattern),
77 calculate_constrained(other.calculate_constrained),
78 sc(other.sc),
79 hashed_dof_sets(other.hashed_dof_sets),
82 n_nz(),
83 n_oz()
84{}
std::unordered_set< dof_id_type > hashed_dof_sets
If there are "spider" nodes in the mesh (i.e.

Member Function Documentation

◆ apply_extra_sparsity_function()

void libMesh::SparsityPattern::Build::apply_extra_sparsity_function ( void(*)(SparsityPattern::Graph &sparsity, std::vector< dof_id_type > &n_nz, std::vector< dof_id_type > &n_oz, void *context)  func,
void *  context 
)
inline

Let a user-provided function modify our sparsity structure.

Definition at line 191 of file sparsity_pattern.h.

196 { func(sparsity_pattern, n_nz, n_oz, context); }

References n_nz, n_oz, and sparsity_pattern.

◆ apply_extra_sparsity_object()

void libMesh::SparsityPattern::Build::apply_extra_sparsity_object ( SparsityPattern::AugmentSparsityPattern asp)

Let a user-provided AugmentSparsityPattern subclass modify our sparsity structure.

Definition at line 578 of file sparsity_pattern.C.

579{
580 asp.augment_sparsity_pattern (sparsity_pattern, n_nz, n_oz);
581}

References libMesh::SparsityPattern::AugmentSparsityPattern::augment_sparsity_pattern(), n_nz, n_oz, and sparsity_pattern.

◆ clear_full_sparsity()

void libMesh::SparsityPattern::Build::clear_full_sparsity ( )
inline

Clear the "full" details of our sparsity structure, leaving only the counts of non-zero entries.

Definition at line 202 of file sparsity_pattern.h.

203 {
204 sparsity_pattern.clear();
205 nonlocal_pattern.clear();
206 }

References nonlocal_pattern, and sparsity_pattern.

◆ comm()

const Parallel::Communicator & libMesh::ParallelObject::comm ( ) const
inlineinherited
Returns
A reference to the Parallel::Communicator object used by this mesh.

Definition at line 97 of file parallel_object.h.

98 { return _communicator; }
const Parallel::Communicator & _communicator

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::__libmesh_petsc_diff_solver_jacobian(), libMesh::__libmesh_petsc_diff_solver_monitor(), libMesh::__libmesh_petsc_diff_solver_residual(), libMesh::ExactSolution::_compute_error(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::Partitioner::_find_global_index_by_pid_map(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::SlepcEigenSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult(), libMesh::SlepcEigenSolver< T >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult_add(), libMesh::DofMap::add_constraints_to_send_list(), add_cube_convex_hull_to_mesh(), libMesh::PetscDMWrapper::add_dofs_helper(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::TransientRBConstruction::add_IC_to_RB_space(), libMesh::RBEIMEvaluation::add_interpolation_data(), libMesh::CondensedEigenSystem::add_matrices(), libMesh::EigenSystem::add_matrices(), libMesh::System::add_matrix(), libMesh::System::add_matrix(), libMesh::System::add_matrix(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::System::add_vector(), libMesh::MeshTools::Modification::all_tri(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::RBConstruction::allocate_data_structures(), libMesh::TransientRBConstruction::allocate_data_structures(), libMesh::TransientRBConstruction::assemble_affine_expansion(), libMesh::AdvectionSystem::assemble_claw_rhs(), libMesh::FEMSystem::assemble_qoi(), libMesh::Nemesis_IO::assert_symmetric_cmaps(), libMesh::MeshCommunication::assign_global_indices(), libMesh::Partitioner::assign_partitioning(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::PetscDMWrapper::build_section(), libMesh::PetscDMWrapper::build_sf(), libMesh::MeshBase::cache_elem_data(), libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::MeshTetInterface::check_hull_integrity(), libMesh::MeshBase::complete_preparation(), libMesh::RBConstruction::compute_Fq_representor_innerprods(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::RBConstruction::compute_output_dual_innerprods(), libMesh::RBConstruction::compute_residual_dual_norm_slow(), libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set(), libMesh::DofMap::computed_sparsity_already(), libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), PetscSolverConfiguration::configure_solver(), libMesh::ContinuationSystem::ContinuationSystem(), libMesh::MeshBase::copy_constraint_rows(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::CondensedEigenSystem::copy_super_to_sub(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshTools::create_bounding_box(), libMesh::DofMap::create_dof_constraints(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::MeshTools::create_subdomain_bounding_box(), libMesh::PetscMatrix< T >::create_submatrix_nosort(), create_wrapped_function(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::MeshBase::detect_interior_parents(), libMesh::RBEIMEvaluation::distribute_bfs(), DMlibMeshFunction(), DMlibMeshJacobian(), DMlibMeshSetSystem_libMesh(), DMVariableBounds_libMesh(), libMesh::DTKSolutionTransfer::DTKSolutionTransfer(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_nodes(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_sides(), libMesh::TransientRBConstruction::enrich_RB_space(), libMesh::EpetraVector< T >::EpetraVector(), AssembleOptimization::equality_constraints(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::SmoothnessEstimator::estimate_smoothness(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_error_tolerance(), libMesh::MeshRefinement::flag_elements_by_mean_stddev(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::RBEIMEvaluation::gather_bfs(), libMesh::DofMap::gather_constraints(), libMesh::MeshfreeInterpolation::gather_remote_data(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::RBEIMEvaluation::get_eim_basis_function_node_value(), libMesh::RBEIMEvaluation::get_eim_basis_function_side_value(), libMesh::RBEIMEvaluation::get_eim_basis_function_value(), libMesh::MeshBase::get_info(), libMesh::RBEIMEvaluation::get_interior_basis_functions_as_vecs(), libMesh::ImplicitSystem::get_linear_solver(), libMesh::RBEIMConstruction::get_max_abs_value(), libMesh::RBEIMConstruction::get_node_max_abs_value(), libMesh::RBEIMEvaluation::get_parametrized_function_node_value(), libMesh::RBEIMEvaluation::get_parametrized_function_side_value(), libMesh::RBEIMEvaluation::get_parametrized_function_value(), libMesh::RBEIMConstruction::get_random_point(), libMesh::RBEIMConstruction::get_random_point(), libMesh::RBEIMConstruction::get_random_point(), libMesh::MeshTetInterface::improve_hull_integrity(), AssembleOptimization::inequality_constraints(), AssembleOptimization::inequality_constraints_jacobian(), libMesh::StaticCondensation::init(), libMesh::TimeSolver::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::LocationMap< T >::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), ElasticitySystem::init_data(), libMesh::AdvectionSystem::init_data(), libMesh::ClawSystem::init_data(), libMesh::PetscDMWrapper::init_petscdm(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::OptimizationSystem::initialize_equality_constraints_storage(), libMesh::OptimizationSystem::initialize_inequality_constraints_storage(), libMesh::RBEIMConstruction::initialize_parametrized_functions_in_training_set(), libMesh::RBEIMConstruction::inner_product(), integrate_function(), libMesh::MeshTools::Modification::interpolate_surface(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_equal_connectivity(), libMesh::MeshTools::libmesh_assert_equal_points(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_constraint_rows(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::MeshTools::libmesh_assert_valid_unique_ids(), libMesh::libmesh_petsc_linesearch_shellfunc(), libMesh::libmesh_petsc_preconditioner_apply(), libMesh::libmesh_petsc_snes_mffd_interface(), libMesh::libmesh_petsc_snes_postcheck(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), libMesh::LinearImplicitSystem::LinearImplicitSystem(), main(), libMesh::MeshCommunication::make_elems_parallel_consistent(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_new_nodes_parallel_consistent(), libMesh::MeshCommunication::make_node_bcids_parallel_consistent(), libMesh::MeshCommunication::make_node_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_unique_ids_parallel_consistent(), libMesh::MeshCommunication::make_nodes_parallel_consistent(), libMesh::MeshCommunication::make_p_levels_parallel_consistent(), libMesh::TransientRBConstruction::mass_matrix_scaled_matvec(), libMesh::FEMSystem::mesh_position_set(), libMesh::TriangulatorInterface::MeshedHole::MeshedHole(), LinearElasticityWithContact::move_mesh(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshTools::n_active_levels(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::MeshTools::n_connected_components(), libMesh::DofMap::n_constrained_dofs(), libMesh::MeshBase::n_constraint_rows(), libMesh::DofMap::n_dofs(), libMesh::DofMap::n_dofs_per_processor(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::CondensedEigenSystem::n_global_non_condensed_dofs(), libMesh::MeshTools::n_levels(), MixedOrderTest::n_neighbor_links(), libMesh::BoundaryInfo::n_nodeset_conds(), n_nonzeros(), libMesh::MeshTools::n_p_levels(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::RBEIMEvaluation::node_distribute_bfs(), libMesh::RBEIMEvaluation::node_gather_bfs(), libMesh::RBEIMConstruction::node_inner_product(), libMesh::PetscVector< T >::operator=(), libMesh::MeshBase::operator==(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::DistributedMesh::parallel_max_unique_id(), libMesh::ReplicatedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_n_elem(), libMesh::DistributedMesh::parallel_n_nodes(), parallel_sync(), libMesh::BoundaryInfo::parallel_sync_node_ids(), libMesh::BoundaryInfo::parallel_sync_side_ids(), libMesh::MeshTools::paranoid_n_levels(), libMesh::Partitioner::partition(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::petsc_auto_fieldsplit(), LaplaceSystem::postprocess(), PoissonSystem::postprocess(), libMesh::MeshBase::print_constraint_rows(), libMesh::DofMap::print_dof_constraints(), libMesh::DofMap::process_mesh_constraint_rows(), libMesh::Partitioner::processor_pairs_to_interface_nodes(), libMesh::InterMeshProjection::project_system_vectors(), libMesh::XdrIO::read(), libMesh::Nemesis_IO::read(), FEMParameters::read(), libMesh::EquationSystems::read(), libMesh::CheckpointIO::read_header(), libMesh::ExodusII_IO::read_header(), libMesh::System::read_header(), libMesh::XdrIO::read_header(), libMesh::RBEIMEvaluation::read_in_interior_basis_functions(), libMesh::RBEIMEvaluation::read_in_node_basis_functions(), libMesh::RBEIMEvaluation::read_in_side_basis_functions(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::System::read_SCALAR_dofs(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::System::read_serialized_vector(), libMesh::Nemesis_IO_Helper::read_var_names_impl(), MeshFunctionTest::read_variable_info_from_output_data(), libMesh::MeshBase::recalculate_n_partitions(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::StaticCondensationDofMap::reinit(), libMesh::BoundaryInfo::remove_edge_id(), libMesh::BoundaryInfo::remove_node_id(), libMesh::BoundaryInfo::remove_shellface_id(), libMesh::BoundaryInfo::remove_side_id(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DistributedMesh::renumber_nodes_and_elements(), LinearElasticityWithContact::residual_and_jacobian(), OverlappingAlgebraicGhostingTest::run_ghosting_test(), OverlappingCouplingGhostingTest::run_sparsity_pattern_test(), scale_mesh_and_plot(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::send_and_insert_dof_values(), libMesh::TransientRBConstruction::set_error_temporal_data(), libMesh::Partitioner::set_interface_node_processor_ids_BFS(), libMesh::Partitioner::set_interface_node_processor_ids_linear(), libMesh::Partitioner::set_interface_node_processor_ids_petscpartitioner(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::PetscDiffSolver::setup_petsc_data(), libMesh::RBEIMEvaluation::side_distribute_bfs(), libMesh::RBEIMEvaluation::side_gather_bfs(), libMesh::RBEIMConstruction::side_inner_product(), libMesh::Partitioner::single_partition(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::VariationalMeshSmoother::smooth(), libMesh::NoxNonlinearSolver< Number >::solve(), libMesh::ClawSystem::solve_conservation_law(), libMesh::split_mesh(), libMesh::RBEIMConstruction::store_eim_solutions_for_training_set(), libMesh::MeshBase::subdomain_ids(), libMesh::BoundaryInfo::sync(), libMesh::MeshBase::sync_subdomain_name_map(), ConstraintOperatorTest::test1DCoarseningNewNodes(), ConstraintOperatorTest::test1DCoarseningOperator(), MeshFunctionTest::test_bad_gradient_var_with_out_of_mesh_value(), MeshFunctionTest::test_bad_hessian_var_with_out_of_mesh_value(), MeshfunctionDFEM::test_mesh_function_dfem(), MeshfunctionDFEM::test_mesh_function_dfem_grad(), MeshFunctionTest::test_p_level(), ExodusC0PolyhedronTest::test_write_and_read_hexagonal_prism(), ExodusC0PolygonTest::test_write_and_read_pentagon(), DofMapTest::testBadElemFECombo(), SystemsTest::testBlockRestrictedVarNDofs(), BoundaryInfoTest::testBoundaryOnChildrenErrors(), CheckpointIOTest::testC0PolygonCheckpoint(), VolumeTest::testC0PolygonMethods(), CheckpointIOTest::testC0PolyhedronCheckpoint(), VolumeTest::testC0PolyhedronMethods(), ConstraintOperatorTest::testCoreform(), ConnectedComponentsTest::testEdge(), MeshInputTest::testExodusIGASidesets(), MeshTriangulationTest::testFoundCenters(), PointLocatorTest::testLocator(), BoundaryInfoTest::testMesh(), BoundaryMeshSubdomainTest::testPerBoundarySubdomain(), PointLocatorTest::testPlanar(), MeshTriangulationTest::testPoly2TriEdge3ToTri7CenterFixup(), MeshTriangulationTest::testPoly2TriRefinementBase(), SystemsTest::testProjectCubeWithMeshFunction(), SystemsTest::testProjectScalarCoarsening(), BoundaryInfoTest::testRenumber(), BoundaryInfoTest::testSelectiveRenumber(), BoundaryMeshSubdomainTest::testSingleSubdomain(), CheckpointIOTest::testSplitter(), MeshInputTest::testTetgenIO(), MeshTriangulationTest::testTriangulatorInterp(), MeshTriangulationTest::testTriangulatorMeshedHoles(), MeshTriangulationTest::testTriangulatorRoundHole(), MeshSmootherTest::testVariationalSmoother(), libMesh::MeshTools::total_weight(), libMesh::RBConstruction::train_reduced_basis_with_POD(), libMesh::MeshfreeSolutionTransfer::transfer(), libMesh::MeshFunctionSolutionTransfer::transfer(), libMesh::Poly2TriTriangulator::triangulate(), libMesh::RBConstruction::truth_assembly(), libMesh::TransientRBConstruction::truth_assembly(), update_current_local_solution(), libMesh::TransientRBConstruction::update_RB_initial_condition_all_N(), libMesh::RBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_residual_terms(), libMesh::RBConstruction::update_residual_terms(), libMesh::MeshTools::volume(), libMesh::STLIO::write(), libMesh::XdrIO::write(), libMesh::NameBasedIO::write(), libMesh::VTKIO::write_nodal_data(), libMesh::RBEIMEvaluation::write_out_interior_basis_functions(), libMesh::RBEIMEvaluation::write_out_node_basis_functions(), libMesh::RBEIMEvaluation::write_out_side_basis_functions(), libMesh::RBEvaluation::write_out_vectors(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::TransientRBConstruction::write_riesz_representors_to_files(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::RBDataSerialization::RBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::TransientRBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::RBEIMEvaluationSerialization::write_to_file(), and libMesh::RBDataSerialization::RBSCMEvaluationSerialization::write_to_file().

◆ get_n_nz()

const std::vector< dof_id_type > & libMesh::SparsityPattern::Build::get_n_nz ( ) const
inline

The number of on-processor nonzeros in my portion of the global matrix.

Definition at line 172 of file sparsity_pattern.h.

173 { return n_nz; }

References n_nz.

Referenced by libMesh::StaticCondensation::init().

◆ get_n_oz()

const std::vector< dof_id_type > & libMesh::SparsityPattern::Build::get_n_oz ( ) const
inline

The number of off-processor nonzeros in my portion of the global matrix.

Definition at line 179 of file sparsity_pattern.h.

180 { return n_oz; }

References n_oz.

Referenced by libMesh::StaticCondensation::init().

◆ get_nonlocal_pattern()

const SparsityPattern::NonlocalGraph & libMesh::SparsityPattern::Build::get_nonlocal_pattern ( ) const
inline

Rows of sparse matrix indices, mapped from global DoF number, which belong on other processors.

Stored here only temporarily until a parallel_sync() sends them where they belong.

Definition at line 160 of file sparsity_pattern.h.

161 { return nonlocal_pattern; }

References nonlocal_pattern.

◆ get_sparsity_pattern()

const SparsityPattern::Graph & libMesh::SparsityPattern::Build::get_sparsity_pattern ( ) const
inline

Rows of sparse matrix indices, indexed by the offset from the first DoF on this processor.

Definition at line 152 of file sparsity_pattern.h.

153 { return sparsity_pattern; }

References sparsity_pattern.

◆ 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

Definition at line 152 of file sparsity_pattern.C.

154{
155 const unsigned int n_dofs_on_element_i =
156 cast_int<unsigned int>(element_dofs_i.size());
157
158 const processor_id_type proc_id = dof_map.processor_id();
159 const dof_id_type first_dof_on_proc = dof_map.first_dof(proc_id);
160 const dof_id_type end_dof_on_proc = dof_map.end_dof(proc_id);
161
162 std::vector<dof_id_type>
163 dofs_to_add;
164
165 const unsigned int n_dofs_on_element_j =
166 cast_int<unsigned int>(element_dofs_j.size());
167
168 // It only makes sense to compute hashes and see if we can skip
169 // doing work when there are a "large" amount of DOFs for a given
170 // element. The cutoff for "large" is somewhat arbitrarily chosen
171 // based on a test case with a spider node that resulted in O(10^3)
172 // entries in element_dofs_i for O(10^3) elements. Making this
173 // number larger will disable the hashing optimization in more
174 // cases.
175 bool dofs_seen = false;
176 if (n_dofs_on_element_j > 0 && n_dofs_on_element_i > 256)
177 {
178 auto hash_i = Utility::hashword(element_dofs_i);
179 auto hash_j = Utility::hashword(element_dofs_j);
180 auto final_hash = Utility::hashword2(hash_i, hash_j);
181 auto result = hashed_dof_sets.insert(final_hash);
182 // if insert failed, we have already seen these dofs
183 dofs_seen = !result.second;
184 }
185
186 // there might be 0 dofs for the other variable on the same element
187 // (when subdomain variables do not overlap) and that's when we do
188 // not do anything
189 if (n_dofs_on_element_j > 0 && !dofs_seen)
190 {
191 for (unsigned int i=0; i<n_dofs_on_element_i; i++)
192 {
193 const dof_id_type ig = element_dofs_i[i];
194
196
197 // We save non-local row components for now so we can
198 // communicate them to other processors later.
199
200 if ((ig >= first_dof_on_proc) &&
201 (ig < end_dof_on_proc))
202 {
203 // This is what I mean
204 // libmesh_assert_greater_equal ((ig - first_dof_on_proc), 0);
205 // but do the test like this because ig and
206 // first_dof_on_proc are unsigned ints
207 libmesh_assert_greater_equal (ig, first_dof_on_proc);
208 libmesh_assert_less (ig, (sparsity_pattern.size() +
209 first_dof_on_proc));
210
211 row = &sparsity_pattern[ig - first_dof_on_proc];
212 }
213 else
214 {
215 row = &nonlocal_pattern[ig];
216 }
217
218 // If the row is empty we will add *all*
219 // the element j DOFs, so just do that.
220 if (row->empty())
221 {
222 row->insert(row->end(),
223 element_dofs_j.begin(),
224 element_dofs_j.end());
225 }
226 else
227 {
228 // Build a list of the DOF indices not found in the
229 // sparsity pattern
230 dofs_to_add.clear();
231
232 // Cache iterators. Low will move forward, subsequent
233 // searches will be on smaller ranges
234 SparsityPattern::Row::iterator
235 low = std::lower_bound
236 (row->begin(), row->end(), element_dofs_j.front()),
237 high = std::upper_bound
238 (low, row->end(), element_dofs_j.back());
239
240 for (unsigned int j=0; j<n_dofs_on_element_j; j++)
241 {
242 const dof_id_type jg = element_dofs_j[j];
243
244 // See if jg is in the sorted range
245 std::pair<SparsityPattern::Row::iterator,
246 SparsityPattern::Row::iterator>
247 pos = std::equal_range (low, high, jg);
248
249 // Must add jg if it wasn't found
250 if (pos.first == pos.second)
251 dofs_to_add.push_back(jg);
252
253 // pos.first is now a valid lower bound for any
254 // remaining element j DOFs. (That's why we sorted them.)
255 // Use it for the next search
256 low = pos.first;
257 }
258
259 // Add to the sparsity pattern
260 if (!dofs_to_add.empty())
261 {
262 const std::size_t old_size = row->size();
263
264 row->insert (row->end(),
265 dofs_to_add.begin(),
266 dofs_to_add.end());
267
269 (row->begin(), row->begin()+old_size,
270 row->end());
271 }
272 }
273 } // End dofs-of-var-i loop
274 } // End if-dofs-of-var-j
275}
dof_id_type first_dof(const processor_id_type proc) const
dof_id_type end_dof(const processor_id_type proc) const
processor_id_type processor_id() const
static void sort_row(const BidirectionalIterator begin, BidirectionalIterator middle, const BidirectionalIterator end)
Splices the two sorted ranges [begin,middle) and [middle,end) into one sorted range [begin,...
std::vector< dof_id_type, Threads::scalable_allocator< dof_id_type > > Row
uint32_t hashword2(const uint32_t &first, const uint32_t &second, uint32_t initval=0)
This is a hard-coded version of hashword for hashing exactly 2 numbers.
Definition hashword.h:215
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval=0)
The hashword function takes an array of uint32_t's of length 'length' and computes a single key from ...
Definition hashword.h:158
uint8_t dof_id_type
Definition id_types.h:67
uint8_t processor_id_type
Definition id_types.h:104

References dof_map, libMesh::DofMapBase::end_dof(), libMesh::DofMapBase::first_dof(), hashed_dof_sets, libMesh::Utility::hashword(), libMesh::Utility::hashword2(), nonlocal_pattern, libMesh::ParallelObject::processor_id(), libMesh::SparsityPattern::sort_row(), and sparsity_pattern.

Referenced by operator()().

◆ join()

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

Combine the sparsity pattern in other with this object's sparsity pattern.

Useful in multithreaded loops.

Definition at line 367 of file sparsity_pattern.C.

368{
369 libmesh_assert_equal_to (sparsity_pattern.size(), other.sparsity_pattern.size());
370
371 for (dof_id_type r=0; r<dof_map.n_local_dofs(); r++)
372 {
373 // increment the number of on and off-processor nonzeros in this row
374 // (note this will be an upper bound unless we need the full sparsity pattern)
376 const SparsityPattern::Row & their_row = other.sparsity_pattern[r];
377
378 // simple copy if I have no dofs
379 if (my_row.empty())
380 my_row = their_row;
381
382 // otherwise add their DOFs to mine, resort, and re-unique the row
383 else if (!their_row.empty()) // do nothing for the trivial case where
384 { // their row is empty
385 my_row.insert (my_row.end(),
386 their_row.begin(),
387 their_row.end());
388
389 // We cannot use SparsityPattern::sort_row() here because it expects
390 // the [begin,middle) [middle,end) to be non-overlapping. This is not
391 // necessarily the case here, so use std::sort()
392 std::sort (my_row.begin(), my_row.end());
393
394 my_row.erase(std::unique (my_row.begin(), my_row.end()), my_row.end());
395 }
396 }
397
398 // Move nonlocal row information to ourselves; the other thread
399 // won't need it in the map after that.
400 for (const auto & p : other.nonlocal_pattern)
401 {
402#ifndef NDEBUG
403 const dof_id_type dof_id = p.first;
404
405 processor_id_type dbg_proc_id = 0;
406 while (dof_id >= dof_map.end_dof(dbg_proc_id))
407 dbg_proc_id++;
408 libmesh_assert (dbg_proc_id != this->processor_id());
409#endif
410
411 const SparsityPattern::Row & their_row = p.second;
412
413 // We should have no empty values in a map
414 libmesh_assert (!their_row.empty());
415
416 if (auto my_it = nonlocal_pattern.find(p.first);
417 my_it == nonlocal_pattern.end())
418 {
419 // nonlocal_pattern[it->first].swap(their_row);
420 nonlocal_pattern[p.first] = their_row;
421 }
422 else
423 {
424 SparsityPattern::Row & my_row = my_it->second;
425
426 my_row.insert (my_row.end(),
427 their_row.begin(),
428 their_row.end());
429
430 // We cannot use SparsityPattern::sort_row() here because it expects
431 // the [begin,middle) [middle,end) to be non-overlapping. This is not
432 // necessarily the case here, so use std::sort()
433 std::sort (my_row.begin(), my_row.end());
434
435 my_row.erase(std::unique (my_row.begin(), my_row.end()), my_row.end());
436 }
437 }
438
439 // Combine the other thread's hashed_dof_sets with ours.
440 hashed_dof_sets.insert(other.hashed_dof_sets.begin(),
441 other.hashed_dof_sets.end());
442}
dof_id_type n_local_dofs(const unsigned int vn) const
Definition dof_map.h:794
libmesh_assert(ctx)

References dof_map, libMesh::DofMapBase::end_dof(), hashed_dof_sets, libMesh::libmesh_assert(), libMesh::DofMap::n_local_dofs(), nonlocal_pattern, libMesh::ParallelObject::processor_id(), and sparsity_pattern.

◆ n_nonzeros()

std::size_t libMesh::SparsityPattern::Build::n_nonzeros ( ) const

The total number of nonzeros in the global matrix.

Definition at line 584 of file sparsity_pattern.C.

585{
586 // At some point I'll remember that "C++17" compilers don't always
587 // come with complete C++17 standard libraries.
588 // std::size_t total_nonzeros = std::reduce(n_nz.begin(), n_nz.end(), std::size_t(0));
589 // total_nonzeros += std::reduce(n_oz.begin(), n_oz.end(), std::size_t(0));
590
591 std::size_t total_nonzeros = 0;
592 for (auto nnzi : n_nz)
593 total_nonzeros += nnzi;
594 for (auto nozi : n_oz)
595 total_nonzeros += nozi;
596
597 this->comm().sum(total_nonzeros);
598 return total_nonzeros;
599}
const Parallel::Communicator & comm() const

References libMesh::ParallelObject::comm(), n_nz, n_oz, and libMesh::Parallel::Communicator::sum().

◆ n_processors()

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

Definition at line 103 of file parallel_object.h.

104 {
105 processor_id_type returnval =
106 cast_int<processor_id_type>(_communicator.size());
107 libmesh_assert(returnval); // We never have an empty comm
108 return returnval;
109 }
processor_id_type size() const

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

Referenced by libMesh::Partitioner::_find_global_index_by_pid_map(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::DofMap::add_constraints_to_send_list(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::DistributedMesh::add_elem(), libMesh::DistributedMesh::add_node(), libMesh::System::add_vector(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEMSystem::assembly(), libMesh::Nemesis_IO::assert_symmetric_cmaps(), libMesh::Partitioner::assign_partitioning(), libMesh::AztecLinearSolver< T >::AztecLinearSolver(), libMesh::Partitioner::build_graph(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::DistributedMesh::clear(), libMesh::DistributedMesh::clear_elems(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::Nemesis_IO::copy_scalar_solution(), libMesh::UnstructuredMesh::create_pid_mesh(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::DistributedMesh::DistributedMesh(), libMesh::EnsightIO::EnsightIO(), libMesh::RBEIMEvaluation::gather_bfs(), libMesh::MeshBase::get_info(), libMesh::StaticCondensation::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_petscdm(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::Nemesis_IO_Helper::initialize(), libMesh::DistributedMesh::insert_elem(), libMesh::NumericVector< T >::is_effectively_ghosted(), libMesh::NumericVector< T >::is_effectively_serial(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::MeshBase::n_active_elem_on_proc(), libMesh::DofMap::n_dofs_per_processor(), libMesh::MeshBase::n_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), libMesh::RBEIMEvaluation::node_gather_bfs(), libMesh::MeshBase::partition(), libMesh::Partitioner::partition(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::MeshBase::print_constraint_rows(), libMesh::DofMap::print_dof_constraints(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::NameBasedIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_header(), libMesh::CheckpointIO::read_nodes(), libMesh::System::read_parallel_data(), libMesh::System::read_SCALAR_dofs(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::System::read_serialized_vector(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::Partitioner::repartition(), OverlappingFunctorTest::run_partitioner_test(), libMesh::DofMap::scatter_constraints(), libMesh::DistributedMesh::set_next_unique_id(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), WriteVecAndScalar::setupTests(), libMesh::RBEIMEvaluation::side_gather_bfs(), DistributedMeshTest::testRemoteElemError(), CheckpointIOTest::testSplitter(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::VTKIO::write_nodal_data(), libMesh::System::write_parallel_data(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), and libMesh::XdrIO::write_serialized_nodesets().

◆ operator()()

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

Add entries from a range of elements to this object's sparsity pattern.

Definition at line 279 of file sparsity_pattern.C.

280{
281 // Compute the sparsity structure of the global matrix. This can be
282 // fed into a PetscMatrixBase to allocate exactly the number of nonzeros
283 // necessary to store the matrix. This algorithm should be linear
284 // in the (# of elements)*(# nodes per element)
286
287 // Handle dof coupling specified by library and user coupling functors
288 {
289 const unsigned int n_var = dof_map.n_variables();
290
291 std::vector<std::vector<dof_id_type> > element_dofs_i(n_var);
292
293 std::vector<const Elem *> coupled_neighbors;
294 for (const auto & elem : range)
295 {
296 // Make some fake element iterators defining a range
297 // pointing to only this element.
298 Elem * const * elempp = const_cast<Elem * const *>(&elem);
299 Elem * const * elemend = elempp+1;
300
301 const MeshBase::const_element_iterator fake_elem_it =
302 MeshBase::const_element_iterator(elempp,
303 elemend,
304 Predicates::NotNull<Elem * const *>());
305
306 const MeshBase::const_element_iterator fake_elem_end =
307 MeshBase::const_element_iterator(elemend,
308 elemend,
309 Predicates::NotNull<Elem * const *>());
310
311 GhostingFunctor::map_type elements_to_couple;
312 DofMap::CouplingMatricesSet temporary_coupling_matrices;
313
314 dof_map.merge_ghost_functor_outputs(elements_to_couple,
315 temporary_coupling_matrices,
318 fake_elem_it,
319 fake_elem_end,
321 for (unsigned int vi=0; vi<n_var; vi++)
322 this->sorted_connected_dofs(elem, element_dofs_i[vi], vi);
323
324 for (unsigned int vi=0; vi<n_var; vi++)
325 for (const auto & [partner, ghost_coupling] : elements_to_couple)
326 {
327 // Loop over coupling matrix row variables if we have a
328 // coupling matrix, or all variables if not.
329 if (ghost_coupling)
330 {
331 libmesh_assert_equal_to (ghost_coupling->size(), n_var);
332 ConstCouplingRow ccr(vi, *ghost_coupling);
333
334 for (const auto & idx : ccr)
335 {
336 if (partner == elem)
337 this->handle_vi_vj(element_dofs_i[vi], element_dofs_i[idx]);
338 else
339 {
340 std::vector<dof_id_type> partner_dofs;
341 this->sorted_connected_dofs(partner, partner_dofs, idx);
342 this->handle_vi_vj(element_dofs_i[vi], partner_dofs);
343 }
344 }
345 }
346 else
347 {
348 for (unsigned int vj = 0; vj != n_var; ++vj)
349 {
350 if (partner == elem)
351 this->handle_vi_vj(element_dofs_i[vi], element_dofs_i[vj]);
352 else
353 {
354 std::vector<dof_id_type> partner_dofs;
355 this->sorted_connected_dofs(partner, partner_dofs, vj);
356 this->handle_vi_vj(element_dofs_i[vi], partner_dofs);
357 }
358 }
359 }
360 } // End ghosted element loop
361 } // End range element loop
362 } // End ghosting functor section
363}
unsigned int n_variables() const override
Definition dof_map.h:736
GhostingFunctorIterator coupling_functors_begin() const
Beginning of range of coupling functors.
Definition dof_map.h:366
GhostingFunctorIterator coupling_functors_end() const
End of range of coupling functors.
Definition dof_map.h:372
static void merge_ghost_functor_outputs(GhostingFunctor::map_type &elements_to_ghost, CouplingMatricesSet &temporary_coupling_matrices, const GhostingFunctorIterator &gf_begin, const GhostingFunctorIterator &gf_end, const MeshBase::const_element_iterator &elems_begin, const MeshBase::const_element_iterator &elems_end, processor_id_type p)
Definition dof_map.C:1585
std::set< std::unique_ptr< CouplingMatrix >, Utility::CompareUnderlying > CouplingMatricesSet
Definition dof_map.h:1999
static constexpr processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
Definition dof_object.h:484
std::map< const Elem *, const CouplingMatrix *, CompareDofObjectsByPIDAndThenID > map_type
What elements do we care about and what variables do we care about on each element?
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)

References libMesh::DofMap::coupling_functors_begin(), libMesh::DofMap::coupling_functors_end(), dof_map, handle_vi_vj(), libMesh::DofObject::invalid_processor_id, libMesh::DofMap::merge_ghost_functor_outputs(), libMesh::DofMap::n_local_dofs(), libMesh::DofMap::n_variables(), sorted_connected_dofs(), and sparsity_pattern.

◆ operator=() [1/2]

Build & libMesh::SparsityPattern::Build::operator= ( Build &&  )
delete

◆ operator=() [2/2]

Build & libMesh::SparsityPattern::Build::operator= ( const Build )
delete

◆ parallel_sync()

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

Send sparsity pattern data relevant to other processors to those processors, and receive and incorporate data relevant to us.

Definition at line 446 of file sparsity_pattern.C.

447{
448 parallel_object_only();
450
451 const auto n_dofs_on_proc = dof_map.n_local_dofs();
452 const auto local_first_dof = dof_map.first_dof();
453
454 // The data to send
455 std::map<processor_id_type, std::vector<dof_id_type>> ids_to_send;
456 std::map<processor_id_type, std::vector<Row>> rows_to_send;
457
458 // Loop over the nonlocal rows and transform them into the new datastructure
459 NonlocalGraph::iterator it = nonlocal_pattern.begin();
460 while (it != nonlocal_pattern.end())
461 {
462 const auto dof_id = it->first;
463 auto & row = it->second;
464
465 processor_id_type proc_id = 0;
466 while (dof_id >= dof_map.end_dof(proc_id))
467 proc_id++;
468
469 ids_to_send[proc_id].push_back(dof_id);
470
471 // Note this invalidates the data in nonlocal_pattern
472 rows_to_send[proc_id].push_back(std::move(row));
473
474 // Might as well remove it since it's invalidated anyway
475 it = nonlocal_pattern.erase(it);
476 }
477
478 std::map<processor_id_type, std::vector<dof_id_type>> received_ids_map;
479
480 auto ids_action_functor =
481 [& received_ids_map]
483 const std::vector<dof_id_type> & received_ids)
484 {
485 received_ids_map.emplace(pid, received_ids);
486 };
487
488 Parallel::push_parallel_vector_data(this->comm(), ids_to_send,
489 ids_action_functor);
490
491 auto rows_action_functor =
492 [this,
493 & received_ids_map,
494 local_first_dof]
496 const std::vector<Row> & received_rows)
497 {
498 const std::vector<dof_id_type> & received_ids = libmesh_map_find(received_ids_map, pid);
499
500 std::size_t n_rows = received_rows.size();
501 libmesh_assert_equal_to(n_rows, received_ids.size());
502
503 for (auto i : IntRange<std::size_t>(0, n_rows))
504 {
505 const auto r = received_ids[i];
507
508 const auto my_r = r - local_first_dof;
509
510 auto & their_row = received_rows[i];
511
512 auto & my_row = sparsity_pattern[my_r];
513
514 // They wouldn't have sent an empty row
515 libmesh_assert(!their_row.empty());
516
517 // We can end up with an empty row on a dof that touches our
518 // inactive elements but not our active ones
519 if (my_row.empty())
520 {
521 my_row.assign (their_row.begin(), their_row.end());
522 }
523 else
524 {
525 my_row.insert (my_row.end(),
526 their_row.begin(),
527 their_row.end());
528
529 // We cannot use SparsityPattern::sort_row() here because it expects
530 // the [begin,middle) [middle,end) to be non-overlapping. This is not
531 // necessarily the case here, so use std::sort()
532 std::sort (my_row.begin(), my_row.end());
533
534 my_row.erase(std::unique (my_row.begin(), my_row.end()), my_row.end());
535 }
536
537 }
538 };
539
540 Parallel::push_parallel_vector_data(this->comm(), rows_to_send,
541 rows_action_functor);
542
543 // We should have sent everything at this point.
545
546 // assert these are empty because std::vector::resize will only append the specified element value
547 // if the new size is greater than the current size. Elements whose indices are less than the
548 // current size are untouched
549 libmesh_assert(n_nz.empty());
550 libmesh_assert(n_oz.empty());
551 n_nz.resize (n_dofs_on_proc, 0);
552 n_oz.resize (n_dofs_on_proc, 0);
553
554 const dof_id_type first_dof_on_proc = dof_map.first_dof();
555 const dof_id_type end_dof_on_proc = dof_map.end_dof();
556
557 for (dof_id_type i=0; i<n_dofs_on_proc; i++)
558 {
559 // Get the row of the sparsity pattern
561
562 for (const auto & df : row)
563 if ((df < first_dof_on_proc) || (df >= end_dof_on_proc))
564 n_oz[i]++;
565 else
566 n_nz[i]++;
567
568 libmesh_assert(n_nz[i] <= n_dofs_on_proc);
569
570 // If we're not building a full sparsity pattern, then we want
571 // to avoid overcounting these entries as much as possible.
573 row.clear();
574 }
575}
bool local_index(dof_id_type dof_index) const
Definition dof_map.h:967
void push_parallel_vector_data(const Communicator &comm, MapToVectors &&data, const ActionFunctor &act_on_data)

References libMesh::ParallelObject::comm(), dof_map, libMesh::DofMapBase::end_dof(), libMesh::DofMapBase::first_dof(), libMesh::libmesh_assert(), libMesh::DofMap::local_index(), libMesh::DofMap::n_local_dofs(), n_nz, n_oz, need_full_sparsity_pattern, nonlocal_pattern, TIMPI::push_parallel_vector_data(), and sparsity_pattern.

◆ processor_id()

processor_id_type libMesh::ParallelObject::processor_id ( ) const
inlineinherited
Returns
The rank of this processor in the group.

Definition at line 114 of file parallel_object.h.

115 { return cast_int<processor_id_type>(_communicator.rank()); }
processor_id_type rank() const

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

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::DistributedMesh::add_node(), libMesh::MeshTools::Modification::all_tri(), libMesh::FEMSystem::assembly(), libMesh::Nemesis_IO::assert_symmetric_cmaps(), libMesh::Partitioner::assign_partitioning(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::MeshFunction::check_found_elem(), libMesh::DistributedMesh::clear(), libMesh::DistributedMesh::clear_elems(), libMesh::ExodusII_IO_Helper::close(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::compute_communication_map_parameters(), libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_node_communication_maps(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::Nemesis_IO::copy_scalar_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::ExodusII_IO_Helper::create(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DistributedMesh::DistributedMesh(), libMesh::DistributedMesh::DistributedMesh(), libMesh::DofMapBase::end_dof(), libMesh::DofMapBase::end_old_dof(), libMesh::EnsightIO::EnsightIO(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::DofMapBase::first_dof(), libMesh::DofMapBase::first_old_dof(), libMesh::RBEIMEvaluation::gather_bfs(), libMesh::Nemesis_IO_Helper::get_cmap_params(), libMesh::Nemesis_IO_Helper::get_eb_info_global(), libMesh::Nemesis_IO_Helper::get_elem_cmap(), libMesh::Nemesis_IO_Helper::get_elem_map(), libMesh::MeshBase::get_info(), libMesh::Nemesis_IO_Helper::get_init_global(), libMesh::Nemesis_IO_Helper::get_init_info(), libMesh::RBEIMEvaluation::get_interior_basis_functions_as_vecs(), libMesh::Nemesis_IO_Helper::get_loadbal_param(), libMesh::DofMap::get_local_constraints(), libMesh::MeshBase::get_local_constraints(), libMesh::Nemesis_IO_Helper::get_node_cmap(), libMesh::Nemesis_IO_Helper::get_node_map(), libMesh::Nemesis_IO_Helper::get_ns_param_global(), libMesh::Nemesis_IO_Helper::get_ss_param_global(), handle_vi_vj(), libMesh::LaplaceMeshSmoother::init(), libMesh::SystemSubsetBySubdomain::init(), HeatSystem::init_data(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_element_variables(), libMesh::ExodusII_IO_Helper::initialize_global_variables(), libMesh::ExodusII_IO_Helper::initialize_nodal_variables(), libMesh::DistributedMesh::insert_elem(), libMesh::MeshTools::Modification::interpolate_surface(), join(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files(), libMesh::TransientRBEvaluation::legacy_write_offline_data_to_files(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), main(), AugmentSparsityOnInterface::mesh_reinit(), libMesh::TriangulatorInterface::MeshedHole::MeshedHole(), libMesh::MeshBase::n_active_local_elem(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::MeshTools::n_connected_components(), libMesh::MeshBase::n_constraint_rows(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::DofMapBase::n_local_dofs(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::RBEIMEvaluation::node_gather_bfs(), libMesh::DistributedMesh::own_node(), libMesh::BoundaryInfo::parallel_sync_node_ids(), libMesh::BoundaryInfo::parallel_sync_side_ids(), libMesh::MeshBase::print_constraint_rows(), libMesh::DofMap::print_dof_constraints(), libMesh::DofMap::process_mesh_constraint_rows(), libMesh::Nemesis_IO_Helper::put_cmap_params(), libMesh::Nemesis_IO_Helper::put_elem_cmap(), libMesh::Nemesis_IO_Helper::put_elem_map(), libMesh::Nemesis_IO_Helper::put_loadbal_param(), libMesh::Nemesis_IO_Helper::put_node_cmap(), libMesh::Nemesis_IO_Helper::put_node_map(), libMesh::XdrIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::NameBasedIO::read(), libMesh::EquationSystems::read(), libMesh::EquationSystems::read(), libMesh::ExodusII_IO_Helper::read_elem_num_map(), libMesh::ExodusII_IO_Helper::read_global_values(), libMesh::CheckpointIO::read_header(), libMesh::ExodusII_IO::read_header(), libMesh::System::read_header(), libMesh::XdrIO::read_header(), libMesh::DynaIO::read_mesh(), libMesh::ExodusII_IO_Helper::read_node_num_map(), libMesh::System::read_parallel_data(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::System::read_SCALAR_dofs(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::System::read_serialized_data(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::System::read_serialized_vector(), libMesh::System::read_serialized_vectors(), libMesh::Nemesis_IO_Helper::read_var_names_impl(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::StaticCondensationDofMap::reinit(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::DistributedMesh::set_next_unique_id(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::RBEIMEvaluation::side_gather_bfs(), MeshFunctionTest::test_bad_gradient_var_with_out_of_mesh_value(), MeshFunctionTest::test_bad_hessian_var_with_out_of_mesh_value(), ExodusTest< elem_type >::test_read_gold(), ExodusTest< elem_type >::test_write(), ExodusC0PolyhedronTest::test_write_and_read_hexagonal_prism(), ExodusC0PolygonTest::test_write_and_read_pentagon(), MeshInputTest::testAbaqusRead(), MeshInputTest::testBadGmsh(), BoundaryInfoTest::testBoundaryIDs(), MeshInputTest::testCopyElementSolutionImpl(), MeshInputTest::testCopyElementVectorImpl(), MeshInputTest::testCopyNodalSolutionImpl(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), MeshInputTest::testDynaFileMappings(), MeshInputTest::testDynaNoSplines(), MeshInputTest::testDynaReadElem(), MeshInputTest::testDynaReadPatch(), MeshInputTest::testExodusFileMappings(), MeshInputTest::testExodusIGASidesets(), MeshInputTest::testExodusWriteElementDataFromDiscontinuousNodalData(), MeshInputTest::testGmshBCIDOverlap(), MeshInputTest::testGoodGmsh(), MeshInputTest::testGoodSTL(), MeshInputTest::testGoodSTLBinary(), BoundaryInfoTest::testInternalBoundary(), MeshInputTest::testLowOrderEdgeBlocks(), BoundaryMeshSubdomainTest::testPerBoundarySubdomain(), SystemsTest::testProjectMatrix3D(), BoundaryInfoTest::testShellFaceConstraints(), MeshInputTest::testSingleElementImpl(), BoundaryMeshSubdomainTest::testSingleSubdomain(), WriteVecAndScalar::testSolution(), CheckpointIOTest::testSplitter(), MeshInputTest::testTetgenIO(), MeshSmootherTest::testVariationalSmoother(), libMesh::MeshTools::total_weight(), libMesh::NetGenMeshInterface::triangulate(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::DTKAdapter::update_variable_values(), libMesh::MeshTools::volume(), libMesh::STLIO::write(), libMesh::XdrIO::write(), libMesh::NameBasedIO::write(), libMesh::CheckpointIO::write(), libMesh::EquationSystems::write(), libMesh::EquationSystems::write(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO::write_element_data(), libMesh::ExodusII_IO::write_element_data_from_discontinuous_nodal_data(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_element_values_element_major(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO_Helper::write_elemset_data(), libMesh::ExodusII_IO_Helper::write_elemsets(), libMesh::ExodusII_IO::write_global_data(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::System::write_header(), libMesh::ExodusII_IO::write_information_records(), libMesh::ExodusII_IO_Helper::write_information_records(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::VTKIO::write_nodal_data(), libMesh::UCDIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data_common(), libMesh::ExodusII_IO::write_nodal_data_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), libMesh::ExodusII_IO_Helper::write_nodeset_data(), libMesh::ExodusII_IO_Helper::write_nodesets(), libMesh::Nemesis_IO_Helper::write_nodesets(), libMesh::RBEIMEvaluation::write_out_interior_basis_functions(), libMesh::RBEIMEvaluation::write_out_node_basis_functions(), libMesh::RBEIMEvaluation::write_out_side_basis_functions(), write_output_solvedata(), libMesh::System::write_parallel_data(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bc_names(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::System::write_serialized_data(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::XdrIO::write_serialized_subdomain_names(), libMesh::System::write_serialized_vector(), libMesh::System::write_serialized_vectors(), libMesh::ExodusII_IO_Helper::write_sideset_data(), libMesh::ExodusII_IO_Helper::write_sidesets(), libMesh::Nemesis_IO_Helper::write_sidesets(), libMesh::ExodusII_IO::write_timestep(), libMesh::ExodusII_IO_Helper::write_timestep(), and libMesh::ExodusII_IO::write_timestep_discontinuous().

◆ sorted_connected_dofs()

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

Definition at line 96 of file sparsity_pattern.C.

99{
100 if (this->sc)
101 {
102 // We build a sparsity pattern that will match the size of the condensed system. This is so that
103 // we have the data necessary to init the reduced system matrix
104 dofs_vi.clear();
105
106 auto total_and_uncondensed_from_scalar_dofs_functor =
107 [&dofs_vi](const Elem & /*elem*/,
108 std::vector<dof_id_type> & dof_indices,
109 const std::vector<dof_id_type> & scalar_dof_indices)
110 {
111 dof_indices.insert(dof_indices.end(), scalar_dof_indices.begin(), scalar_dof_indices.end());
112 dofs_vi.insert(dofs_vi.end(), scalar_dof_indices.begin(), scalar_dof_indices.end());
113 };
114
115 auto total_and_uncondensed_from_field_dofs_functor =
116 [&dofs_vi, this](const Elem & functor_elem,
117 const unsigned int node_num,
118 const unsigned int var_num,
119 std::vector<dof_id_type> & dof_indices,
120 const dof_id_type field_dof)
121 {
122 dof_indices.push_back(field_dof);
123 if (this->sc->uncondensed_vars().count(var_num) ||
124 (node_num != invalid_uint && !functor_elem.is_internal(node_num)))
125 dofs_vi.push_back(field_dof);
126 };
127
128 dof_map.dof_indices(elem,
129 dummy_vec,
130 vi,
131 total_and_uncondensed_from_scalar_dofs_functor,
132 total_and_uncondensed_from_field_dofs_functor,
133 elem->p_level());
134 }
135 else
136 dof_map.dof_indices (elem, dofs_vi, vi);
137
138#ifdef LIBMESH_ENABLE_CONSTRAINTS
140#endif
141 // We can be more efficient if we sort the element DOFs into
142 // increasing order
143 std::sort(dofs_vi.begin(), dofs_vi.end());
144
145 // Handle cases where duplicate nodes are intentionally assigned to
146 // a single element.
147 dofs_vi.erase(std::unique(dofs_vi.begin(), dofs_vi.end()), dofs_vi.end());
148}
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition dof_map.C:2201
void find_connected_dofs(std::vector< dof_id_type > &elem_dofs) const
Finds all the DOFS associated with the element DOFs elem_dofs.
Definition dof_map.C:2915
std::vector< dof_id_type > dummy_vec
A dummy work vector to avoid repeated memory allocations.
const std::unordered_set< unsigned int > & uncondensed_vars() const
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition libmesh.h:303

References libMesh::DofMap::dof_indices(), dof_map, dummy_vec, libMesh::DofMap::find_connected_dofs(), libMesh::invalid_uint, libMesh::Elem::p_level(), sc, and libMesh::StaticCondensationDofMap::uncondensed_vars().

Referenced by operator()().

Member Data Documentation

◆ _communicator

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

◆ calculate_constrained

const bool libMesh::SparsityPattern::Build::calculate_constrained
private

Definition at line 214 of file sparsity_pattern.h.

◆ coupling_functors

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

Definition at line 211 of file sparsity_pattern.h.

◆ dof_coupling

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

Definition at line 210 of file sparsity_pattern.h.

◆ dof_map

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

◆ dummy_vec

std::vector<dof_id_type> libMesh::SparsityPattern::Build::dummy_vec
private

A dummy work vector to avoid repeated memory allocations.

Definition at line 231 of file sparsity_pattern.h.

Referenced by sorted_connected_dofs().

◆ hashed_dof_sets

std::unordered_set<dof_id_type> libMesh::SparsityPattern::Build::hashed_dof_sets
private

If there are "spider" nodes in the mesh (i.e.

a single node which is connected to many 1D elements) and Constraints, we can end up sorting the same set of DOFs multiple times in handle_vi_vj(), only to find that it has no net effect on the final sparsity. In such cases it is much faster to keep track of (element_dofs_i, element_dofs_j) pairs which have already been handled and not repeat the computation. We use this data structure to keep track of hashes of sets of dofs we have already seen, thus avoiding unnecessary calculations.

Definition at line 228 of file sparsity_pattern.h.

Referenced by handle_vi_vj(), and join().

◆ implicit_neighbor_dofs

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

Definition at line 212 of file sparsity_pattern.h.

◆ n_nz

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

◆ n_oz

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

◆ need_full_sparsity_pattern

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

Definition at line 213 of file sparsity_pattern.h.

Referenced by parallel_sync().

◆ nonlocal_pattern

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

◆ sc

const StaticCondensationDofMap* const libMesh::SparsityPattern::Build::sc
private

Definition at line 215 of file sparsity_pattern.h.

Referenced by sorted_connected_dofs().

◆ sparsity_pattern

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

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