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 Elem *partner, const std::vector< dof_id_type > &element_dofs_i, unsigned int vj)
 

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

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 
)

Definition at line 36 of file sparsity_pattern.C.

41  :
42  ParallelObject(dof_map_in),
43  mesh(mesh_in),
44  dof_map(dof_map_in),
45  dof_coupling(dof_coupling_in),
46  coupling_functors(coupling_functors_in),
47  implicit_neighbor_dofs(implicit_neighbor_dofs_in),
48  need_full_sparsity_pattern(need_full_sparsity_pattern_in),
51  n_nz(),
52  n_oz()
53 {}
ParallelObject(const Parallel::Communicator &comm_in)
Constructor.
SparsityPattern::Graph sparsity_pattern
const std::set< GhostingFunctor * > & coupling_functors
const CouplingMatrix * dof_coupling
std::vector< dof_id_type > n_nz
SparsityPattern::NonlocalGraph nonlocal_pattern
std::vector< dof_id_type > n_oz
libMesh::SparsityPattern::Build::Build ( Build other,
Threads::split   
)

Definition at line 57 of file sparsity_pattern.C.

57  :
58  ParallelObject(other),
59  mesh(other.mesh),
60  dof_map(other.dof_map),
61  dof_coupling(other.dof_coupling),
62  coupling_functors(other.coupling_functors),
63  implicit_neighbor_dofs(other.implicit_neighbor_dofs),
64  need_full_sparsity_pattern(other.need_full_sparsity_pattern),
67  n_nz(),
68  n_oz()
69 {}
ParallelObject(const Parallel::Communicator &comm_in)
Constructor.
SparsityPattern::Graph sparsity_pattern
const std::set< GhostingFunctor * > & coupling_functors
const CouplingMatrix * dof_coupling
std::vector< dof_id_type > n_nz
SparsityPattern::NonlocalGraph nonlocal_pattern
std::vector< dof_id_type > n_oz

Member Function Documentation

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

Definition at line 87 of file parallel_object.h.

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::__libmesh_petsc_diff_solver_monitor(), libMesh::__libmesh_petsc_diff_solver_residual(), libMesh::__libmesh_petsc_preconditioner_apply(), libMesh::__libmesh_petsc_snes_jacobian(), libMesh::__libmesh_petsc_snes_postcheck(), libMesh::__libmesh_petsc_snes_residual(), libMesh::__libmesh_tao_equality_constraints(), libMesh::__libmesh_tao_equality_constraints_jacobian(), libMesh::__libmesh_tao_gradient(), libMesh::__libmesh_tao_hessian(), libMesh::__libmesh_tao_inequality_constraints(), libMesh::__libmesh_tao_inequality_constraints_jacobian(), libMesh::__libmesh_tao_objective(), libMesh::MeshRefinement::_coarsen_elements(), libMesh::ExactSolution::_compute_error(), libMesh::ParmetisPartitioner::_do_repartition(), libMesh::UniformRefinementEstimator::_estimate_error(), 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::EquationSystems::_read_impl(), libMesh::MeshRefinement::_refine_elements(), libMesh::MeshRefinement::_smooth_flags(), add_cube_convex_hull_to_mesh(), libMesh::TransientRBConstruction::add_IC_to_RB_space(), libMesh::ImplicitSystem::add_matrix(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::System::add_vector(), libMesh::EigenSparseLinearSolver< T >::adjoint_solve(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::TransientRBConstruction::allocate_data_structures(), libMesh::RBConstruction::allocate_data_structures(), libMesh::TransientRBConstruction::assemble_affine_expansion(), libMesh::FEMSystem::assemble_qoi(), libMesh::MeshCommunication::assign_global_indices(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::DofMap::attach_matrix(), libMesh::Parallel::BinSorter< KeyType, IdxType >::binsort(), libMesh::Parallel::Sort< KeyType, IdxType >::binsort(), libMesh::MeshCommunication::broadcast(), libMesh::SparseMatrix< T >::build(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::Parallel::Histogram< KeyType, IdxType >::build_histogram(), libMesh::PetscNonlinearSolver< T >::build_mat_null_space(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::MeshBase::cache_elem_dims(), libMesh::System::calculate_norm(), libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::Parallel::Sort< KeyType, IdxType >::communicate_bins(), 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::RBSCMConstruction::compute_SCM_bounds_on_training_set(), libMesh::Problem_Interface::computeF(), libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshTools::create_bounding_box(), 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::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), DMlibMeshFunction(), DMlibMeshJacobian(), DMlibMeshSetSystem_libMesh(), DMVariableBounds_libMesh(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::TransientRBConstruction::enrich_RB_space(), libMesh::RBConstruction::enrich_RB_space(), AssembleOptimization::equality_constraints(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::RBEIMConstruction::evaluate_mesh_function(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::MeshCommunication::gather(), libMesh::MeshCommunication::gather_neighboring_elements(), libMesh::MeshfreeInterpolation::gather_remote_data(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::DofMap::get_info(), libMesh::ImplicitSystem::get_linear_solver(), libMesh::EquationSystems::get_solution(), AssembleOptimization::inequality_constraints(), AssembleOptimization::inequality_constraints_jacobian(), libMesh::LocationMap< T >::init(), libMesh::TopologyMap::init(), libMesh::PetscDiffSolver::init(), libMesh::TimeSolver::init(), libMesh::TaoOptimizationSolver< T >::init(), libMesh::PetscNonlinearSolver< T >::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::EigenSystem::init_data(), libMesh::EigenSystem::init_matrices(), libMesh::ParmetisPartitioner::initialize(), libMesh::OptimizationSystem::initialize_equality_constraints_storage(), libMesh::OptimizationSystem::initialize_inequality_constraints_storage(), libMesh::RBEIMConstruction::initialize_rb_construction(), integrate_function(), 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::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::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshCommunication::make_elems_parallel_consistent(), libMesh::MeshRefinement::make_flags_parallel_consistent(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_new_nodes_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::MeshRefinement::make_refinement_compatible(), libMesh::TransientRBConstruction::mass_matrix_scaled_matvec(), libMesh::FEMSystem::mesh_position_set(), libMesh::MeshSerializer::MeshSerializer(), LinearElasticityWithContact::move_mesh(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshTools::n_active_levels(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::CondensedEigenSystem::n_global_non_condensed_dofs(), libMesh::MeshTools::n_levels(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::MeshTools::n_p_levels(), libMesh::BoundaryInfo::n_shellface_conds(), new_function_base(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::ReplicatedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_n_elem(), libMesh::DistributedMesh::parallel_n_nodes(), parallel_sync(), libMesh::MeshTools::paranoid_n_levels(), libMesh::Partitioner::partition(), libMesh::MetisPartitioner::partition_range(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::petsc_auto_fieldsplit(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::MeshBase::prepare_for_use(), libMesh::SparseMatrix< T >::print(), FEMParameters::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::MeshBase::recalculate_n_partitions(), libMesh::MeshCommunication::redistribute(), libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::DistributedMesh::renumber_dof_objects(), LinearElasticityWithContact::residual_and_jacobian(), libMesh::MeshCommunication::send_coarse_ghosts(), libMesh::TransientRBConstruction::set_error_temporal_data(), libMesh::RBEIMConstruction::set_explicit_sys_subvector(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::Parallel::Sort< KeyType, IdxType >::sort(), libMesh::MeshBase::subdomain_ids(), libMesh::BoundaryInfo::sync(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id(), libMesh::MeshRefinement::test_level_one(), MeshfunctionDFEM::test_mesh_function_dfem(), MeshfunctionDFEM::test_mesh_function_dfem_grad(), libMesh::MeshRefinement::test_unflagged(), PointLocatorTest::testLocator(), BoundaryInfoTest::testMesh(), SystemsTest::testProjectCubeWithMeshFunction(), libMesh::MeshTools::total_weight(), libMesh::MeshFunctionSolutionTransfer::transfer(), libMesh::MeshfreeSolutionTransfer::transfer(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::TransientRBConstruction::update_RB_initial_condition_all_N(), libMesh::RBEIMConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_RB_system_matrices(), libMesh::RBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_residual_terms(), libMesh::RBConstruction::update_residual_terms(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), libMesh::RBEvaluation::write_out_vectors(), libMesh::TransientRBConstruction::write_riesz_representors_to_files(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::XdrIO::write_serialized_bcs_helper(), 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().

88  { return _communicator; }
const Parallel::Communicator & _communicator
void libMesh::SparsityPattern::Build::handle_vi_vj ( const Elem partner,
const std::vector< dof_id_type > &  element_dofs_i,
unsigned int  vj 
)
private

Definition at line 81 of file sparsity_pattern.C.

References libMesh::DofMap::dof_indices(), dof_map, libMesh::DofMap::end_dof(), libMesh::DofMap::find_connected_dofs(), libMesh::DofMap::first_dof(), mesh, nonlocal_pattern, libMesh::ParallelObject::processor_id(), libMesh::SparsityPattern::sort_row(), and sparsity_pattern.

Referenced by operator()().

84 {
85  const unsigned int n_dofs_on_element_i =
86  cast_int<unsigned int>(element_dofs_i.size());
87 
88  const processor_id_type proc_id = mesh.processor_id();
89  const dof_id_type first_dof_on_proc = dof_map.first_dof(proc_id);
90  const dof_id_type end_dof_on_proc = dof_map.end_dof(proc_id);
91 
92  std::vector<dof_id_type>
93  element_dofs_j,
94  dofs_to_add;
95 
96  // Find element dofs for variable vj
97  dof_map.dof_indices (partner, element_dofs_j, vj);
98 #ifdef LIBMESH_ENABLE_CONSTRAINTS
99  dof_map.find_connected_dofs (element_dofs_j);
100 #endif
101 
102  // We can be more efficient if we sort the element DOFs
103  // into increasing order
104  std::sort (element_dofs_j.begin(), element_dofs_j.end());
105 
106  const unsigned int n_dofs_on_element_j =
107  cast_int<unsigned int>(element_dofs_j.size());
108 
109  // there might be 0 dofs for the other variable on the same element
110  // (when subdomain variables do not overlap) and that's when we do
111  // not do anything
112  if (n_dofs_on_element_j > 0)
113  {
114  for (unsigned int i=0; i<n_dofs_on_element_i; i++)
115  {
116  const dof_id_type ig = element_dofs_i[i];
117 
118  SparsityPattern::Row * row;
119 
120  // We save non-local row components for now so we can
121  // communicate them to other processors later.
122 
123  if ((ig >= first_dof_on_proc) &&
124  (ig < end_dof_on_proc))
125  {
126  // This is what I mean
127  // libmesh_assert_greater_equal ((ig - first_dof_on_proc), 0);
128  // but do the test like this because ig and
129  // first_dof_on_proc are unsigned ints
130  libmesh_assert_greater_equal (ig, first_dof_on_proc);
131  libmesh_assert_less (ig, (sparsity_pattern.size() +
132  first_dof_on_proc));
133 
134  row = &sparsity_pattern[ig - first_dof_on_proc];
135  }
136  else
137  {
138  row = &nonlocal_pattern[ig];
139  }
140 
141  // If the row is empty we will add *all*
142  // the element j DOFs, so just do that.
143  if (row->empty())
144  {
145  row->insert(row->end(),
146  element_dofs_j.begin(),
147  element_dofs_j.end());
148  }
149  else
150  {
151  // Build a list of the DOF indices not found in the
152  // sparsity pattern
153  dofs_to_add.clear();
154 
155  // Cache iterators. Low will move forward, subsequent
156  // searches will be on smaller ranges
157  SparsityPattern::Row::iterator
158  low = std::lower_bound
159  (row->begin(), row->end(), element_dofs_j.front()),
160  high = std::upper_bound
161  (low, row->end(), element_dofs_j.back());
162 
163  for (unsigned int j=0; j<n_dofs_on_element_j; j++)
164  {
165  const dof_id_type jg = element_dofs_j[j];
166 
167  // See if jg is in the sorted range
168  std::pair<SparsityPattern::Row::iterator,
169  SparsityPattern::Row::iterator>
170  pos = std::equal_range (low, high, jg);
171 
172  // Must add jg if it wasn't found
173  if (pos.first == pos.second)
174  dofs_to_add.push_back(jg);
175 
176  // pos.first is now a valid lower bound for any
177  // remaining element j DOFs. (That's why we sorted them.)
178  // Use it for the next search
179  low = pos.first;
180  }
181 
182  // Add to the sparsity pattern
183  if (!dofs_to_add.empty())
184  {
185  const std::size_t old_size = row->size();
186 
187  row->insert (row->end(),
188  dofs_to_add.begin(),
189  dofs_to_add.end());
190 
192  (row->begin(), row->begin()+old_size,
193  row->end());
194  }
195  }
196  } // End dofs-of-var-i loop
197  } // End if-dofs-of-var-j
198 }
SparsityPattern::Graph sparsity_pattern
uint8_t processor_id_type
Definition: id_types.h:99
std::vector< dof_id_type, Threads::scalable_allocator< dof_id_type > > Row
dof_id_type first_dof(const processor_id_type proc) const
Definition: dof_map.h:535
dof_id_type end_dof(const processor_id_type proc) const
Definition: dof_map.h:577
SparsityPattern::NonlocalGraph nonlocal_pattern
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:2561
uint8_t dof_id_type
Definition: id_types.h:64
processor_id_type processor_id() const
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Fills the vector di with the global degree of freedom indices for the element.
Definition: dof_map.C:1917
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...
void libMesh::SparsityPattern::Build::join ( const Build other)

Definition at line 337 of file sparsity_pattern.C.

References dof_id, dof_map, libMesh::DofMap::end_dof(), libMesh::DofMap::first_dof(), libMesh::libmesh_assert(), mesh, std::min(), libMesh::DofMap::n_dofs(), libMesh::DofMap::n_dofs_on_processor(), n_nz, n_oz, need_full_sparsity_pattern, nonlocal_pattern, libMesh::ParallelObject::processor_id(), and sparsity_pattern.

338 {
339  const processor_id_type proc_id = mesh.processor_id();
340  const dof_id_type n_global_dofs = dof_map.n_dofs();
341  const dof_id_type n_dofs_on_proc = dof_map.n_dofs_on_processor(proc_id);
342  const dof_id_type first_dof_on_proc = dof_map.first_dof(proc_id);
343  const dof_id_type end_dof_on_proc = dof_map.end_dof(proc_id);
344 
345  libmesh_assert_equal_to (sparsity_pattern.size(), other.sparsity_pattern.size());
346  libmesh_assert_equal_to (n_nz.size(), sparsity_pattern.size());
347  libmesh_assert_equal_to (n_oz.size(), sparsity_pattern.size());
348 
349  for (dof_id_type r=0; r<n_dofs_on_proc; r++)
350  {
351  // increment the number of on and off-processor nonzeros in this row
352  // (note this will be an upper bound unless we need the full sparsity pattern)
354  {
356  const SparsityPattern::Row & their_row = other.sparsity_pattern[r];
357 
358  // simple copy if I have no dofs
359  if (my_row.empty())
360  my_row = their_row;
361 
362  // otherwise add their DOFs to mine, resort, and re-unique the row
363  else if (!their_row.empty()) // do nothing for the trivial case where
364  { // their row is empty
365  my_row.insert (my_row.end(),
366  their_row.begin(),
367  their_row.end());
368 
369  // We cannot use SparsityPattern::sort_row() here because it expects
370  // the [begin,middle) [middle,end) to be non-overlapping. This is not
371  // necessarily the case here, so use std::sort()
372  std::sort (my_row.begin(), my_row.end());
373 
374  my_row.erase(std::unique (my_row.begin(), my_row.end()), my_row.end());
375  }
376 
377  // fix the number of on and off-processor nonzeros in this row
378  n_nz[r] = n_oz[r] = 0;
379 
380  for (std::size_t j=0; j<my_row.size(); j++)
381  if ((my_row[j] < first_dof_on_proc) || (my_row[j] >= end_dof_on_proc))
382  n_oz[r]++;
383  else
384  n_nz[r]++;
385  }
386  else
387  {
388  n_nz[r] += other.n_nz[r];
389  n_nz[r] = std::min(n_nz[r], n_dofs_on_proc);
390  n_oz[r] += other.n_oz[r];
391  n_oz[r] =std::min(n_oz[r], static_cast<dof_id_type>(n_global_dofs-n_nz[r]));
392  }
393  }
394 
395  // Move nonlocal row information to ourselves; the other thread
396  // won't need it in the map after that.
397  NonlocalGraph::const_iterator it = other.nonlocal_pattern.begin();
398  for (; it != other.nonlocal_pattern.end(); ++it)
399  {
400 #ifndef NDEBUG
401  const dof_id_type dof_id = it->first;
402 
403  processor_id_type dbg_proc_id = 0;
404  while (dof_id >= dof_map.end_dof(dbg_proc_id))
405  dbg_proc_id++;
406  libmesh_assert (dbg_proc_id != this->processor_id());
407 #endif
408 
409  const SparsityPattern::Row & their_row = it->second;
410 
411  // We should have no empty values in a map
412  libmesh_assert (!their_row.empty());
413 
414  NonlocalGraph::iterator my_it = nonlocal_pattern.find(it->first);
415  if (my_it == nonlocal_pattern.end())
416  {
417  // nonlocal_pattern[it->first].swap(their_row);
418  nonlocal_pattern[it->first] = their_row;
419  }
420  else
421  {
422  SparsityPattern::Row & my_row = my_it->second;
423 
424  my_row.insert (my_row.end(),
425  their_row.begin(),
426  their_row.end());
427 
428  // We cannot use SparsityPattern::sort_row() here because it expects
429  // the [begin,middle) [middle,end) to be non-overlapping. This is not
430  // necessarily the case here, so use std::sort()
431  std::sort (my_row.begin(), my_row.end());
432 
433  my_row.erase(std::unique (my_row.begin(), my_row.end()), my_row.end());
434  }
435  }
436 }
SparsityPattern::Graph sparsity_pattern
uint8_t processor_id_type
Definition: id_types.h:99
dof_id_type dof_id
Definition: xdr_io.C:48
dof_id_type n_dofs() const
Definition: dof_map.h:510
dof_id_type n_dofs_on_processor(const processor_id_type proc) const
Definition: dof_map.h:526
libmesh_assert(j)
std::vector< dof_id_type, Threads::scalable_allocator< dof_id_type > > Row
dof_id_type first_dof(const processor_id_type proc) const
Definition: dof_map.h:535
dof_id_type end_dof(const processor_id_type proc) const
Definition: dof_map.h:577
std::vector< dof_id_type > n_nz
SparsityPattern::NonlocalGraph nonlocal_pattern
long double min(long double a, double b)
uint8_t dof_id_type
Definition: id_types.h:64
processor_id_type processor_id() const
std::vector< dof_id_type > n_oz
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::ParmetisPartitioner::_do_repartition(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::DistributedMesh::add_node(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::FEMSystem::assembly(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::AztecLinearSolver< T >::AztecLinearSolver(), libMesh::MeshCommunication::broadcast(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::DistributedMesh::clear(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::UnstructuredMesh::create_pid_mesh(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DistributedMesh::DistributedMesh(), libMesh::EnsightIO::EnsightIO(), libMesh::MeshCommunication::gather(), libMesh::MeshCommunication::gather_neighboring_elements(), libMesh::MeshBase::get_info(), libMesh::EquationSystems::get_solution(), libMesh::SystemSubsetBySubdomain::init(), libMesh::ParmetisPartitioner::initialize(), libMesh::Nemesis_IO_Helper::initialize(), libMesh::DistributedMesh::insert_elem(), 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::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshBase::n_active_elem_on_proc(), libMesh::MeshBase::n_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), parallel_sync(), libMesh::Partitioner::partition(), libMesh::MeshBase::partition(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::PetscLinearSolver< T >::PetscLinearSolver(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::SparseMatrix< T >::print(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_header(), libMesh::CheckpointIO::read_nodes(), libMesh::MeshCommunication::redistribute(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::Partitioner::repartition(), libMesh::MeshCommunication::send_coarse_ghosts(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Parallel::Sort< KeyType, IdxType >::sort(), WriteVecAndScalar::testWrite(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), and libMesh::XdrIO::write_serialized_nodesets().

94  { return cast_int<processor_id_type>(_communicator.size()); }
unsigned int size() const
Definition: parallel.h:726
const Parallel::Communicator & _communicator
void libMesh::SparsityPattern::Build::operator() ( const ConstElemRange range)

Definition at line 202 of file sparsity_pattern.C.

References libMesh::StoredRange< iterator_type, object_type >::begin(), libMesh::DofMap::coupling_functors_begin(), libMesh::DofMap::coupling_functors_end(), libMesh::DofMap::dof_indices(), dof_map, libMesh::StoredRange< iterator_type, object_type >::end(), end, libMesh::DofMap::end_dof(), libMesh::DofMap::find_connected_dofs(), libMesh::DofMap::first_dof(), handle_vi_vj(), libMesh::DofObject::invalid_processor_id, libMesh::DofMap::merge_ghost_functor_outputs(), mesh, libMesh::DofMap::n_dofs_on_processor(), n_nz, n_oz, libMesh::DofMap::n_variables(), need_full_sparsity_pattern, libMesh::ParallelObject::processor_id(), libMesh::CouplingMatrix::size(), and sparsity_pattern.

203 {
204  // Compute the sparsity structure of the global matrix. This can be
205  // fed into a PetscMatrix to allocate exactly the number of nonzeros
206  // necessary to store the matrix. This algorithm should be linear
207  // in the (# of elements)*(# nodes per element)
208  const processor_id_type proc_id = mesh.processor_id();
209  const dof_id_type n_dofs_on_proc = dof_map.n_dofs_on_processor(proc_id);
210  const dof_id_type first_dof_on_proc = dof_map.first_dof(proc_id);
211  const dof_id_type end_dof_on_proc = dof_map.end_dof(proc_id);
212 
213  sparsity_pattern.resize(n_dofs_on_proc);
214 
215  // Handle dof coupling specified by library and user coupling functors
216  {
217  const unsigned int n_var = dof_map.n_variables();
218 
219  std::vector<dof_id_type> element_dofs_i;
220 
221  std::vector<const Elem *> coupled_neighbors;
222  for (ConstElemRange::const_iterator elem_it = range.begin() ; elem_it != range.end(); ++elem_it)
223  {
224  const Elem * const elem = *elem_it;
225 
226  // Make some fake element iterators defining a range
227  // pointing to only this element.
228  Elem * const * elempp = const_cast<Elem * const *>(&elem);
229  Elem * const * elemend = elempp+1;
230 
231  const MeshBase::const_element_iterator fake_elem_it =
232  MeshBase::const_element_iterator(elempp,
233  elemend,
234  Predicates::NotNull<Elem * const *>());
235 
236  const MeshBase::const_element_iterator fake_elem_end =
237  MeshBase::const_element_iterator(elemend,
238  elemend,
239  Predicates::NotNull<Elem * const *>());
240 
241  GhostingFunctor::map_type elements_to_couple;
242 
243  // Man, I wish we had guaranteed unique_ptr availability...
244  std::set<CouplingMatrix *> temporary_coupling_matrices;
245 
246  dof_map.merge_ghost_functor_outputs(elements_to_couple,
247  temporary_coupling_matrices,
250  fake_elem_it,
251  fake_elem_end,
253 
254  for (unsigned int vi=0; vi<n_var; vi++)
255  {
256  // Find element dofs for variable vi
257  dof_map.dof_indices (elem, element_dofs_i, vi);
258 #ifdef LIBMESH_ENABLE_CONSTRAINTS
259  dof_map.find_connected_dofs (element_dofs_i);
260 #endif
261 
262  // We can be more efficient if we sort the element DOFs
263  // into increasing order
264  std::sort(element_dofs_i.begin(), element_dofs_i.end());
265 
266  GhostingFunctor::map_type::iterator etg_it = elements_to_couple.begin();
267  const GhostingFunctor::map_type::iterator etg_end = elements_to_couple.end();
268  for (; etg_it != etg_end; ++etg_it)
269  {
270  const Elem * const partner = etg_it->first;
271  const CouplingMatrix * ghost_coupling = etg_it->second;
272 
273  // Loop over coupling matrix row variables if we have a
274  // coupling matrix, or all variables if not.
275  if (ghost_coupling)
276  {
277  libmesh_assert_equal_to (ghost_coupling->size(), n_var);
278  ConstCouplingRow ccr(vi, *ghost_coupling);
279 
280  for (ConstCouplingRow::const_iterator it = ccr.begin(),
281  end = ccr.end();
282  it != end; ++it)
283  this->handle_vi_vj(partner, element_dofs_i, *it);
284  }
285  else
286  {
287  for (unsigned int vj = 0; vj != n_var; ++vj)
288  this->handle_vi_vj(partner, element_dofs_i, vj);
289  }
290  } // End ghosted element loop
291  } // End vi loop
292 
293  for (std::set<CouplingMatrix *>::iterator
294  it = temporary_coupling_matrices.begin(),
295  end = temporary_coupling_matrices.begin();
296  it != end; ++it)
297  delete *it;
298 
299  } // End range element loop
300  } // End ghosting functor section
301 
302  // Now a new chunk of sparsity structure is built for all of the
303  // DOFs connected to our rows of the matrix.
304 
305  // If we're building a full sparsity pattern, then we've got
306  // complete rows to work with, so we can just count them from
307  // scratch.
309  {
310  n_nz.clear();
311  n_oz.clear();
312  }
313 
314  n_nz.resize (n_dofs_on_proc, 0);
315  n_oz.resize (n_dofs_on_proc, 0);
316 
317  for (dof_id_type i=0; i<n_dofs_on_proc; i++)
318  {
319  // Get the row of the sparsity pattern
321 
322  for (std::size_t j=0; j<row.size(); j++)
323  if ((row[j] < first_dof_on_proc) || (row[j] >= end_dof_on_proc))
324  n_oz[i]++;
325  else
326  n_nz[i]++;
327 
328  // If we're not building a full sparsity pattern, then we want
329  // to avoid overcounting these entries as much as possible.
331  row.clear();
332  }
333 }
SparsityPattern::Graph sparsity_pattern
std::set< GhostingFunctor * >::const_iterator coupling_functors_begin() const
Beginning of range of coupling functors.
Definition: dof_map.h:275
uint8_t processor_id_type
Definition: id_types.h:99
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
void handle_vi_vj(const Elem *partner, const std::vector< dof_id_type > &element_dofs_i, unsigned int vj)
dof_id_type n_dofs_on_processor(const processor_id_type proc) const
Definition: dof_map.h:526
std::vector< dof_id_type, Threads::scalable_allocator< dof_id_type > > Row
dof_id_type first_dof(const processor_id_type proc) const
Definition: dof_map.h:535
dof_id_type end_dof(const processor_id_type proc) const
Definition: dof_map.h:577
static const 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:335
std::unordered_map< const Elem *, const CouplingMatrix * > map_type
What elements do we care about and what variables do we care about on each element?
std::vector< dof_id_type > n_nz
static void merge_ghost_functor_outputs(GhostingFunctor::map_type &elements_to_ghost, std::set< CouplingMatrix * > &temporary_coupling_matrices, const std::set< GhostingFunctor * >::iterator &gf_begin, const std::set< GhostingFunctor * >::iterator &gf_end, const MeshBase::const_element_iterator &elems_begin, const MeshBase::const_element_iterator &elems_end, processor_id_type p)
Definition: dof_map.C:1408
std::vector< object_type >::const_iterator const_iterator
Allows an StoredRange to behave like an STL container.
Definition: stored_range.h:58
unsigned int n_variables() const
Definition: dof_map.h:477
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:2561
std::set< GhostingFunctor * >::const_iterator coupling_functors_end() const
End of range of coupling functors.
Definition: dof_map.h:281
ConstCouplingRowConstIterator const_iterator
uint8_t dof_id_type
Definition: id_types.h:64
processor_id_type processor_id() const
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Fills the vector di with the global degree of freedom indices for the element.
Definition: dof_map.C:1917
std::vector< dof_id_type > n_oz
void libMesh::SparsityPattern::Build::parallel_sync ( )

Definition at line 440 of file sparsity_pattern.C.

References libMesh::ParallelObject::comm(), dof_id, dof_map, libMesh::DofMap::end_dof(), libMesh::DofMap::first_dof(), libMesh::libmesh_assert(), std::min(), libMesh::DofMap::n_dofs(), libMesh::DofMap::n_dofs_on_processor(), n_nz, n_oz, libMesh::ParallelObject::n_processors(), need_full_sparsity_pattern, nonlocal_pattern, libMesh::ParallelObject::processor_id(), libMesh::Parallel::Communicator::send_receive(), sparsity_pattern, and libMesh::Parallel::verify().

441 {
442  parallel_object_only();
444 
445  const dof_id_type n_global_dofs = dof_map.n_dofs();
446  const dof_id_type n_dofs_on_proc = dof_map.n_dofs_on_processor(this->processor_id());
447  const dof_id_type local_first_dof = dof_map.first_dof();
448  const dof_id_type local_end_dof = dof_map.end_dof();
449 
450  // Trade sparsity rows with other processors
451  for (processor_id_type p=1; p != this->n_processors(); ++p)
452  {
453  // Push to processor procup while receiving from procdown
454  processor_id_type procup =
455  cast_int<processor_id_type>((this->processor_id() + p) %
456  this->n_processors());
457  processor_id_type procdown =
458  cast_int<processor_id_type>((this->n_processors() + this->processor_id() - p) %
459  this->n_processors());
460 
461  // Pack the sparsity pattern rows to push to procup
462  std::vector<dof_id_type> pushed_row_ids,
463  pushed_row_ids_to_me;
464  std::vector<std::vector<dof_id_type>> pushed_rows,
465  pushed_rows_to_me;
466 
467  // Move nonlocal row information to a structure to send it from;
468  // we don't need it in the map after that.
469  NonlocalGraph::iterator it = nonlocal_pattern.begin();
470  while (it != nonlocal_pattern.end())
471  {
472  const dof_id_type dof_id = it->first;
473  processor_id_type proc_id = 0;
474  while (dof_id >= dof_map.end_dof(proc_id))
475  proc_id++;
476 
477  libmesh_assert (proc_id != this->processor_id());
478 
479  if (proc_id == procup)
480  {
481  pushed_row_ids.push_back(dof_id);
482 
483  // We can't just do the swap trick here, thanks to the
484  // differing vector allocators?
485  pushed_rows.push_back(std::vector<dof_id_type>());
486  pushed_rows.back().assign
487  (it->second.begin(), it->second.end());
488 
489  nonlocal_pattern.erase(it++);
490  }
491  else
492  ++it;
493  }
494 
495  this->comm().send_receive(procup, pushed_row_ids,
496  procdown, pushed_row_ids_to_me);
497  this->comm().send_receive(procup, pushed_rows,
498  procdown, pushed_rows_to_me);
499  pushed_row_ids.clear();
500  pushed_rows.clear();
501 
502  const std::size_t n_rows = pushed_row_ids_to_me.size();
503  for (std::size_t i=0; i != n_rows; ++i)
504  {
505  const dof_id_type r = pushed_row_ids_to_me[i];
506  const dof_id_type my_r = r - local_first_dof;
507 
508  std::vector<dof_id_type> & their_row = pushed_rows_to_me[i];
509 
511  {
512  SparsityPattern::Row & my_row =
513  sparsity_pattern[my_r];
514 
515  // They wouldn't have sent an empty row
516  libmesh_assert(!their_row.empty());
517 
518  // We can end up with an empty row on a dof that touches our
519  // inactive elements but not our active ones
520  if (my_row.empty())
521  {
522  my_row.assign (their_row.begin(),
523  their_row.end());
524  }
525  else
526  {
527  my_row.insert (my_row.end(),
528  their_row.begin(),
529  their_row.end());
530 
531  // We cannot use SparsityPattern::sort_row() here because it expects
532  // the [begin,middle) [middle,end) to be non-overlapping. This is not
533  // necessarily the case here, so use std::sort()
534  std::sort (my_row.begin(), my_row.end());
535 
536  my_row.erase(std::unique (my_row.begin(), my_row.end()), my_row.end());
537  }
538 
539  // fix the number of on and off-processor nonzeros in this row
540  n_nz[my_r] = n_oz[my_r] = 0;
541 
542  for (std::size_t j=0; j<my_row.size(); j++)
543  if ((my_row[j] < local_first_dof) || (my_row[j] >= local_end_dof))
544  n_oz[my_r]++;
545  else
546  n_nz[my_r]++;
547  }
548  else
549  {
550  for (std::size_t j=0; j<their_row.size(); j++)
551  if ((their_row[j] < local_first_dof) || (their_row[j] >= local_end_dof))
552  n_oz[my_r]++;
553  else
554  n_nz[my_r]++;
555 
556  n_nz[my_r] = std::min(n_nz[my_r], n_dofs_on_proc);
557  n_oz[my_r] = std::min(n_oz[my_r],
558  static_cast<dof_id_type>(n_global_dofs-n_nz[my_r]));
559  }
560  }
561  }
562 
563  // We should have sent everything at this point.
565 }
SparsityPattern::Graph sparsity_pattern
processor_id_type n_processors() const
uint8_t processor_id_type
Definition: id_types.h:99
dof_id_type dof_id
Definition: xdr_io.C:48
dof_id_type n_dofs() const
Definition: dof_map.h:510
dof_id_type n_dofs_on_processor(const processor_id_type proc) const
Definition: dof_map.h:526
libmesh_assert(j)
std::vector< dof_id_type, Threads::scalable_allocator< dof_id_type > > Row
dof_id_type first_dof(const processor_id_type proc) const
Definition: dof_map.h:535
dof_id_type end_dof(const processor_id_type proc) const
Definition: dof_map.h:577
void send_receive(const unsigned int dest_processor_id, const T1 &send, const unsigned int source_processor_id, T2 &recv, const MessageTag &send_tag=no_tag, const MessageTag &recv_tag=any_tag) const
Send data send to one processor while simultaneously receiving other data recv from a (potentially di...
std::vector< dof_id_type > n_nz
SparsityPattern::NonlocalGraph nonlocal_pattern
bool verify(const T &r, const Communicator &comm=Communicator_World)
const Parallel::Communicator & comm() const
long double min(long double a, double b)
processor_id_type processor_id() const
uint8_t dof_id_type
Definition: id_types.h:64
std::vector< dof_id_type > n_oz
processor_id_type libMesh::ParallelObject::processor_id ( ) const
inherited
Returns
The rank of this processor in the group.

Definition at line 99 of file parallel_object.h.

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

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::EquationSystems::_read_impl(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::MeshRefinement::add_node(), libMesh::MeshTools::Modification::all_tri(), libMesh::FEMSystem::assembly(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::MeshCommunication::broadcast(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::ParmetisPartitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::DofMap::build_sparsity(), libMesh::DistributedMesh::clear(), 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::MeshTools::correct_node_proc_ids(), libMesh::ExodusII_IO_Helper::create(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DistributedMesh::DistributedMesh(), libMesh::EnsightIO::EnsightIO(), libMesh::RBEIMConstruction::evaluate_mesh_function(), libMesh::MeshFunction::find_element(), libMesh::MeshFunction::find_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshCommunication::gather(), libMesh::MeshCommunication::gather_neighboring_elements(), 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::DofMap::get_info(), libMesh::Nemesis_IO_Helper::get_init_global(), libMesh::Nemesis_IO_Helper::get_init_info(), libMesh::Nemesis_IO_Helper::get_loadbal_param(), libMesh::Nemesis_IO_Helper::get_node_cmap(), libMesh::Nemesis_IO_Helper::get_node_map(), libMesh::Nemesis_IO_Helper::get_ns_param_global(), libMesh::EquationSystems::get_solution(), libMesh::Nemesis_IO_Helper::get_ss_param_global(), handle_vi_vj(), libMesh::SystemSubsetBySubdomain::init(), HeatSystem::init_data(), libMesh::ParmetisPartitioner::initialize(), 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::DofMap::is_evaluable(), join(), libMesh::TransientRBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEIMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DofMap::local_variable_indices(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), AugmentSparsityOnInterface::mesh_reinit(), libMesh::MeshBase::n_active_local_elem(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::System::n_local_dofs(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), parallel_sync(), libMesh::MetisPartitioner::partition_range(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::SparseMatrix< T >::print(), libMesh::NumericVector< T >::print_global(), 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::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::XdrIO::read(), libMesh::ExodusII_IO_Helper::read_elem_num_map(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::ExodusII_IO_Helper::read_node_num_map(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::MeshCommunication::redistribute(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::MeshCommunication::send_coarse_ghosts(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::LaplaceMeshSmoother::smooth(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), BoundaryInfoTest::testShellFaceConstraints(), WriteVecAndScalar::testWrite(), libMesh::MeshTools::total_weight(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::DTKAdapter::update_variable_values(), libMesh::MeshTools::weight(), libMesh::NameBasedIO::write(), libMesh::CheckpointIO::write(), libMesh::XdrIO::write(), libMesh::EquationSystems::write(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO::write_element_data(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO::write_global_data(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::ExodusII_IO::write_information_records(), libMesh::ExodusII_IO_Helper::write_information_records(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::UCDIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), libMesh::Nemesis_IO_Helper::write_nodesets(), libMesh::ExodusII_IO_Helper::write_nodesets(), libMesh::RBEvaluation::write_out_vectors(), write_output_solvedata(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::XdrIO::write_serialized_bc_names(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::XdrIO::write_serialized_subdomain_names(), libMesh::Nemesis_IO_Helper::write_sidesets(), libMesh::ExodusII_IO_Helper::write_sidesets(), libMesh::ExodusII_IO::write_timestep(), and libMesh::ExodusII_IO_Helper::write_timestep().

100  { return cast_int<processor_id_type>(_communicator.rank()); }
const Parallel::Communicator & _communicator
unsigned int rank() const
Definition: parallel.h:724

Member Data Documentation

const Parallel::Communicator& libMesh::ParallelObject::_communicator
protectedinherited
const std::set<GhostingFunctor *>& libMesh::SparsityPattern::Build::coupling_functors
private

Definition at line 86 of file sparsity_pattern.h.

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

Definition at line 85 of file sparsity_pattern.h.

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

Definition at line 84 of file sparsity_pattern.h.

Referenced by handle_vi_vj(), join(), operator()(), and parallel_sync().

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

Definition at line 87 of file sparsity_pattern.h.

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

Definition at line 83 of file sparsity_pattern.h.

Referenced by handle_vi_vj(), join(), and operator()().

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

Definition at line 99 of file sparsity_pattern.h.

Referenced by join(), operator()(), and parallel_sync().

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

Definition at line 100 of file sparsity_pattern.h.

Referenced by join(), operator()(), and parallel_sync().

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

Definition at line 88 of file sparsity_pattern.h.

Referenced by join(), operator()(), and parallel_sync().

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

Definition at line 97 of file sparsity_pattern.h.

Referenced by handle_vi_vj(), join(), and parallel_sync().

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

Definition at line 96 of file sparsity_pattern.h.

Referenced by handle_vi_vj(), join(), operator()(), and parallel_sync().


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