Manages the degrees of freedom (DOFs) in a simulation. More...
#include <dof_map.h>
Classes | |
class | AugmentSendList |
class | AugmentSparsityPattern |
Public Member Functions | |
DofMap (const unsigned int sys_number, MeshBase &mesh) | |
~DofMap () | |
void | attach_matrix (SparseMatrix< Number > &matrix) |
bool | is_attached (SparseMatrix< Number > &matrix) |
void | distribute_dofs (MeshBase &) |
void | compute_sparsity (const MeshBase &) |
void | clear_sparsity () |
void | remove_default_ghosting () |
void | add_default_ghosting () |
void | add_coupling_functor (GhostingFunctor &coupling_functor, bool to_mesh=true) |
void | remove_coupling_functor (GhostingFunctor &coupling_functor) |
std::set< GhostingFunctor * >::const_iterator | coupling_functors_begin () const |
std::set< GhostingFunctor * >::const_iterator | coupling_functors_end () const |
DefaultCoupling & | default_coupling () |
void | add_algebraic_ghosting_functor (GhostingFunctor &evaluable_functor, bool to_mesh=true) |
void | remove_algebraic_ghosting_functor (GhostingFunctor &evaluable_functor) |
std::set< GhostingFunctor * >::const_iterator | algebraic_ghosting_functors_begin () const |
std::set< GhostingFunctor * >::const_iterator | algebraic_ghosting_functors_end () const |
DefaultCoupling & | default_algebraic_ghosting () |
void | attach_extra_sparsity_object (DofMap::AugmentSparsityPattern &asp) |
void | attach_extra_sparsity_function (void(*func)(SparsityPattern::Graph &sparsity, std::vector< dof_id_type > &n_nz, std::vector< dof_id_type > &n_oz, void *), void *context=nullptr) |
void | attach_extra_send_list_object (DofMap::AugmentSendList &asl) |
void | attach_extra_send_list_function (void(*func)(std::vector< dof_id_type > &, void *), void *context=nullptr) |
void | prepare_send_list () |
const std::vector< dof_id_type > & | get_send_list () const |
const std::vector< dof_id_type > & | get_n_nz () const |
const std::vector< dof_id_type > & | get_n_oz () const |
void | add_variable_group (const VariableGroup &var_group) |
void | set_error_on_cyclic_constraint (bool error_on_cyclic_constraint) |
const VariableGroup & | variable_group (const unsigned int c) const |
const Variable & | variable (const unsigned int c) const |
Order | variable_order (const unsigned int c) const |
Order | variable_group_order (const unsigned int vg) const |
const FEType & | variable_type (const unsigned int c) const |
const FEType & | variable_group_type (const unsigned int vg) const |
unsigned int | n_variable_groups () const |
unsigned int | n_variables () const |
bool | has_blocked_representation () const |
unsigned int | block_size () const |
dof_id_type | n_dofs () const |
dof_id_type | n_SCALAR_dofs () const |
dof_id_type | n_local_dofs () const |
dof_id_type | n_dofs_on_processor (const processor_id_type proc) const |
dof_id_type | first_dof (const processor_id_type proc) const |
dof_id_type | first_dof () const |
dof_id_type | first_old_dof (const processor_id_type proc) const |
dof_id_type | first_old_dof () const |
dof_id_type | last_dof (const processor_id_type proc) const |
dof_id_type | last_dof () const |
dof_id_type | end_dof (const processor_id_type proc) const |
dof_id_type | end_dof () const |
processor_id_type | dof_owner (const dof_id_type dof) const |
dof_id_type | end_old_dof (const processor_id_type proc) const |
dof_id_type | end_old_dof () const |
void | dof_indices (const Elem *const elem, std::vector< dof_id_type > &di) const |
void | dof_indices (const Elem *const elem, std::vector< dof_id_type > &di, const unsigned int vn, int p_level=-12345) const |
void | dof_indices (const Node *const node, std::vector< dof_id_type > &di) const |
void | dof_indices (const Node *const node, std::vector< dof_id_type > &di, const unsigned int vn) const |
void | SCALAR_dof_indices (std::vector< dof_id_type > &di, const unsigned int vn, const bool old_dofs=false) const |
bool | semilocal_index (dof_id_type dof_index) const |
bool | all_semilocal_indices (const std::vector< dof_id_type > &dof_indices) const |
bool | local_index (dof_id_type dof_index) const |
template<typename DofObjectSubclass > | |
bool | is_evaluable (const DofObjectSubclass &obj, unsigned int var_num=libMesh::invalid_uint) const |
void | set_implicit_neighbor_dofs (bool implicit_neighbor_dofs) |
bool | use_coupled_neighbor_dofs (const MeshBase &mesh) const |
void | extract_local_vector (const NumericVector< Number > &Ug, const std::vector< dof_id_type > &dof_indices, DenseVectorBase< Number > &Ue) const |
void | local_variable_indices (std::vector< dof_id_type > &idx, const MeshBase &mesh, unsigned int var_num) const |
dof_id_type | n_constrained_dofs () const |
dof_id_type | n_local_constrained_dofs () const |
dof_id_type | n_constrained_nodes () const |
void | create_dof_constraints (const MeshBase &, Real time=0) |
void | allgather_recursive_constraints (MeshBase &) |
void | scatter_constraints (MeshBase &) |
void | gather_constraints (MeshBase &mesh, std::set< dof_id_type > &unexpanded_dofs, bool look_for_constrainees) |
void | process_constraints (MeshBase &) |
void | check_for_cyclic_constraints () |
void | add_constraint_row (const dof_id_type dof_number, const DofConstraintRow &constraint_row, const Number constraint_rhs, const bool forbid_constraint_overwrite) |
void | add_adjoint_constraint_row (const unsigned int qoi_index, const dof_id_type dof_number, const DofConstraintRow &constraint_row, const Number constraint_rhs, const bool forbid_constraint_overwrite) |
void | add_constraint_row (const dof_id_type dof_number, const DofConstraintRow &constraint_row, const bool forbid_constraint_overwrite=true) |
DofConstraints::const_iterator | constraint_rows_begin () const |
DofConstraints::const_iterator | constraint_rows_end () const |
void | stash_dof_constraints () |
void | unstash_dof_constraints () |
NodeConstraints::const_iterator | node_constraint_rows_begin () const |
NodeConstraints::const_iterator | node_constraint_rows_end () const |
bool | is_constrained_dof (const dof_id_type dof) const |
bool | has_heterogenous_adjoint_constraints (const unsigned int qoi_num) const |
Number | has_heterogenous_adjoint_constraint (const unsigned int qoi_num, const dof_id_type dof) const |
DofConstraintValueMap & | get_primal_constraint_values () |
bool | is_constrained_node (const Node *node) const |
void | print_dof_constraints (std::ostream &os=libMesh::out, bool print_nonlocal=false) const |
std::string | get_local_constraints (bool print_nonlocal=false) const |
std::pair< Real, Real > | max_constraint_error (const System &system, NumericVector< Number > *v=nullptr) const |
void | constrain_element_matrix (DenseMatrix< Number > &matrix, std::vector< dof_id_type > &elem_dofs, bool asymmetric_constraint_rows=true) const |
void | constrain_element_matrix (DenseMatrix< Number > &matrix, std::vector< dof_id_type > &row_dofs, std::vector< dof_id_type > &col_dofs, bool asymmetric_constraint_rows=true) const |
void | constrain_element_vector (DenseVector< Number > &rhs, std::vector< dof_id_type > &dofs, bool asymmetric_constraint_rows=true) const |
void | constrain_element_matrix_and_vector (DenseMatrix< Number > &matrix, DenseVector< Number > &rhs, std::vector< dof_id_type > &elem_dofs, bool asymmetric_constraint_rows=true) const |
void | heterogenously_constrain_element_matrix_and_vector (DenseMatrix< Number > &matrix, DenseVector< Number > &rhs, std::vector< dof_id_type > &elem_dofs, bool asymmetric_constraint_rows=true, int qoi_index=-1) const |
void | heterogenously_constrain_element_vector (const DenseMatrix< Number > &matrix, DenseVector< Number > &rhs, std::vector< dof_id_type > &elem_dofs, bool asymmetric_constraint_rows=true, int qoi_index=-1) const |
void | constrain_element_dyad_matrix (DenseVector< Number > &v, DenseVector< Number > &w, std::vector< dof_id_type > &row_dofs, bool asymmetric_constraint_rows=true) const |
void | constrain_nothing (std::vector< dof_id_type > &dofs) const |
void | enforce_constraints_exactly (const System &system, NumericVector< Number > *v=nullptr, bool homogeneous=false) const |
void | enforce_adjoint_constraints_exactly (NumericVector< Number > &v, unsigned int q) const |
void | add_periodic_boundary (const PeriodicBoundaryBase &periodic_boundary) |
void | add_periodic_boundary (const PeriodicBoundaryBase &boundary, const PeriodicBoundaryBase &inverse_boundary) |
bool | is_periodic_boundary (const boundary_id_type boundaryid) const |
PeriodicBoundaries * | get_periodic_boundaries () |
void | add_dirichlet_boundary (const DirichletBoundary &dirichlet_boundary) |
void | add_adjoint_dirichlet_boundary (const DirichletBoundary &dirichlet_boundary, unsigned int q) |
void | remove_dirichlet_boundary (const DirichletBoundary &dirichlet_boundary) |
void | remove_adjoint_dirichlet_boundary (const DirichletBoundary &dirichlet_boundary, unsigned int q) |
const DirichletBoundaries * | get_dirichlet_boundaries () const |
DirichletBoundaries * | get_dirichlet_boundaries () |
bool | has_adjoint_dirichlet_boundaries (unsigned int q) const |
const DirichletBoundaries * | get_adjoint_dirichlet_boundaries (unsigned int q) const |
DirichletBoundaries * | get_adjoint_dirichlet_boundaries (unsigned int q) |
void | old_dof_indices (const Elem *const elem, std::vector< dof_id_type > &di, const unsigned int vn=libMesh::invalid_uint) const |
dof_id_type | n_old_dofs () const |
void | constrain_p_dofs (unsigned int var, const Elem *elem, unsigned int s, unsigned int p) |
void | reinit (MeshBase &mesh) |
void | clear () |
void | print_info (std::ostream &os=libMesh::out) const |
std::string | get_info () const |
unsigned int | sys_number () const |
const Parallel::Communicator & | comm () const |
processor_id_type | n_processors () const |
processor_id_type | processor_id () const |
Static Public Member Functions | |
static std::string | get_info () |
static void | print_info (std::ostream &out=libMesh::out) |
static unsigned int | n_objects () |
static void | enable_print_counter_info () |
static void | disable_print_counter_info () |
Public Attributes | |
CouplingMatrix * | _dof_coupling |
Protected Types | |
typedef std::map< std::string, std::pair< unsigned int, unsigned int > > | Counts |
Protected Member Functions | |
void | increment_constructor_count (const std::string &name) |
void | increment_destructor_count (const std::string &name) |
Protected Attributes | |
const Parallel::Communicator & | _communicator |
Static Protected Attributes | |
static Counts | _counts |
static Threads::atomic< unsigned int > | _n_objects |
static Threads::spin_mutex | _mutex |
static bool | _enable_print_counter = true |
Private Types | |
typedef DofObject *(DofMap::* | dofobject_accessor) (MeshBase &mesh, dof_id_type i) const |
Private Member Functions | |
void | _dof_indices (const Elem &elem, int p_level, std::vector< dof_id_type > &di, const unsigned int vg, const unsigned int vig, const Node *const *nodes, unsigned int n_nodes #ifdef DEBUG, const unsigned int v, std::size_t &tot_size #endif) const |
std::unique_ptr< SparsityPattern::Build > | build_sparsity (const MeshBase &mesh) const |
void | invalidate_dofs (MeshBase &mesh) const |
DofObject * | node_ptr (MeshBase &mesh, dof_id_type i) const |
DofObject * | elem_ptr (MeshBase &mesh, dof_id_type i) const |
template<typename iterator_type > | |
void | set_nonlocal_dof_objects (iterator_type objects_begin, iterator_type objects_end, MeshBase &mesh, dofobject_accessor objects) |
void | distribute_local_dofs_var_major (dof_id_type &next_free_dof, MeshBase &mesh) |
void | distribute_local_dofs_node_major (dof_id_type &next_free_dof, MeshBase &mesh) |
void | add_neighbors_to_send_list (MeshBase &mesh) |
void | build_constraint_matrix (DenseMatrix< Number > &C, std::vector< dof_id_type > &elem_dofs, const bool called_recursively=false) const |
void | build_constraint_matrix_and_vector (DenseMatrix< Number > &C, DenseVector< Number > &H, std::vector< dof_id_type > &elem_dofs, int qoi_index=-1, const bool called_recursively=false) const |
void | find_connected_dofs (std::vector< dof_id_type > &elem_dofs) const |
void | find_connected_dof_objects (std::vector< const DofObject *> &objs) const |
void | add_constraints_to_send_list () |
void | check_dirichlet_bcid_consistency (const MeshBase &mesh, const DirichletBoundary &boundary) const |
Static Private Member Functions | |
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) |
Friends | |
class | SparsityPattern::Build |
Manages the degrees of freedom (DOFs) in a simulation.
This class handles the numbering of degrees of freedom on a mesh. For systems of equations the class supports a fixed number of variables. The degrees of freedom are numbered such that sequential, contiguous blocks belong to distinct processors. This is so that the resulting data structures will work well with parallel linear algebra packages.
|
protectedinherited |
Data structure to log the information. The log is identified by the class name.
Definition at line 117 of file reference_counter.h.
|
private |
A member function type like node_ptr()
or elem_ptr()
.
|
explicit |
Constructor. Requires the number of the system for which we will be numbering degrees of freedom & the parent object we are contained in, which defines our communication space.
Definition at line 130 of file dof_map.C.
References _default_coupling, _default_evaluating, _matrices, _mesh, _periodic_boundaries, add_algebraic_ghosting_functor(), and add_coupling_functor().
libMesh::DofMap::~DofMap | ( | ) |
Destructor.
Definition at line 201 of file dof_map.C.
References _adjoint_dirichlet_boundaries, _default_coupling, _default_evaluating, _mesh, clear(), and libMesh::MeshBase::remove_ghosting_functor().
|
private |
Helper function that gets the dof indices on the current element for a non-SCALAR type variable, where the variable is identified by its variable group number vg
and its offset vig
from the first variable in that group.
In DEBUG mode, the tot_size parameter will add up the total number of dof indices that should have been added to di, and v will be the variable number corresponding to vg and vig.
Definition at line 2209 of file dof_map.C.
References libMesh::Elem::active(), libMesh::Variable::active_on_subdomain(), libMesh::Elem::dim(), libMesh::DofObject::dof_number(), libMesh::FEInterface::extra_hanging_dofs(), libMesh::FEType::family, libMesh::Elem::infinite(), libMesh::DofObject::invalid_id, libMesh::Elem::is_vertex(), libMesh::LAGRANGE, libMesh::DofObject::n_comp_group(), libMesh::FEInterface::n_dofs(), libMesh::FEInterface::n_dofs_at_node(), libMesh::FEInterface::n_dofs_at_node_function(), libMesh::FEInterface::n_dofs_per_elem(), n_nodes, libMesh::DofObject::n_systems(), libMesh::FEType::order, libMesh::SUBDIVISION, libMesh::Elem::subdomain_id(), sys_number(), libMesh::Variable::type(), libMesh::Elem::type(), libMesh::DofObject::var_to_vg_and_offset(), and variable_group().
Referenced by dof_indices().
void libMesh::DofMap::add_adjoint_constraint_row | ( | const unsigned int | qoi_index, |
const dof_id_type | dof_number, | ||
const DofConstraintRow & | constraint_row, | ||
const Number | constraint_rhs, | ||
const bool | forbid_constraint_overwrite | ||
) |
Adds a copy of the user-defined row to the constraint matrix, using an inhomogeneous right-hand-side for the adjoint constraint equation.
forbid_constraint_overwrite
here only tests for overwriting the rhs. This method should only be used when an equivalent constraint (with a potentially different rhs) already exists for the primal problem.
Definition at line 1373 of file dof_map_constraints.C.
void libMesh::DofMap::add_adjoint_dirichlet_boundary | ( | const DirichletBoundary & | dirichlet_boundary, |
unsigned int | q | ||
) |
Adds a copy of the specified Dirichlet boundary to the system, corresponding to the adjoint problem defined by Quantity of Interest q
.
Definition at line 4279 of file dof_map_constraints.C.
void libMesh::DofMap::add_algebraic_ghosting_functor | ( | GhostingFunctor & | evaluable_functor, |
bool | to_mesh = true |
||
) |
Adds a functor which can specify algebraic ghosting requirements for use with distributed vectors. Degrees of freedom on other processors which match the elements and variables returned by these functors will be added to the send_list, and the elements on other processors will be ghosted on a distributed mesh, so that the elements can always be found and the solutions on them will always be evaluable.
GhostingFunctor memory must be managed by the code which calls this function; the GhostingFunctor lifetime is expected to extend until either the functor is removed or the DofMap is destructed.
When to_mesh
is true, the coupling_functor
is also added to our associated mesh, to ensure that evaluable elements do not get lost during mesh distribution. (if evaluable elements were already lost there's no getting them back after the fact, sorry)
If to_mesh
is false, no change to mesh ghosting is made; the Mesh must already have ghosting functor(s) specifying a superset of evaluable_functor
or this is a horrible bug.
Definition at line 1829 of file dof_map.C.
References _algebraic_ghosting_functors, _mesh, and libMesh::MeshBase::add_ghosting_functor().
Referenced by add_default_ghosting(), clear(), and DofMap().
void libMesh::DofMap::add_constraint_row | ( | const dof_id_type | dof_number, |
const DofConstraintRow & | constraint_row, | ||
const Number | constraint_rhs, | ||
const bool | forbid_constraint_overwrite | ||
) |
Adds a copy of the user-defined row to the constraint matrix, using an inhomogeneous right-hand-side for the constraint equation.
Definition at line 1350 of file dof_map_constraints.C.
Referenced by add_constraint_row().
|
inline |
Adds a copy of the user-defined row to the constraint matrix, using a homogeneous right-hand-side for the constraint equation. By default, produces an error if the DOF was already constrained.
Definition at line 894 of file dof_map.h.
References add_constraint_row().
|
private |
Adds entries to the _send_list
vector corresponding to DoFs which are dependencies for constraint equations on the current processor.
Definition at line 4163 of file dof_map_constraints.C.
void libMesh::DofMap::add_coupling_functor | ( | GhostingFunctor & | coupling_functor, |
bool | to_mesh = true |
||
) |
Adds a functor which can specify coupling requirements for creation of sparse matrices. Degree of freedom pairs which match the elements and variables returned by these functors will be added to the sparsity pattern, and the degrees of freedom which live on other processors will be added to the send_list for use on ghosted vectors, and the elements which live on other processors will be ghosted on a distributed mesh.
GhostingFunctor memory must be managed by the code which calls this function; the GhostingFunctor lifetime is expected to extend until either the functor is removed or the DofMap is destructed.
When to_mesh
is true, the coupling_functor
is also added to our associated mesh, to ensure that coupled elements do not get lost during mesh distribution. (if coupled elements were already lost there's no getting them back after the fact, sorry)
If to_mesh
is false, no change to mesh ghosting is made; the Mesh must already have ghosting functor(s) specifying a superset of coupling_functor
or this is a horrible bug.
Definition at line 1809 of file dof_map.C.
References _coupling_functors, _mesh, and libMesh::MeshBase::add_ghosting_functor().
Referenced by add_default_ghosting(), clear(), and DofMap().
void libMesh::DofMap::add_default_ghosting | ( | ) |
Add the default functor(s) for coupling and algebraic ghosting. User-added ghosting functors will be unaffected.
Definition at line 1800 of file dof_map.C.
References add_algebraic_ghosting_functor(), add_coupling_functor(), default_algebraic_ghosting(), and default_coupling().
Referenced by libMesh::EquationSystems::enable_default_ghosting().
void libMesh::DofMap::add_dirichlet_boundary | ( | const DirichletBoundary & | dirichlet_boundary | ) |
Adds a copy of the specified Dirichlet boundary to the system.
Definition at line 4273 of file dof_map_constraints.C.
Referenced by libMesh::DifferentiableSystem::add_dot_var_dirichlet_bcs().
|
private |
Adds entries to the _send_list
vector corresponding to DoFs on elements neighboring the current processor.
Definition at line 1499 of file dof_map.C.
References _send_list, algebraic_ghosting_functors_begin(), algebraic_ghosting_functors_end(), coupling_functors_begin(), coupling_functors_end(), dof_indices(), local_index(), merge_ghost_functor_outputs(), mesh, n_variables(), libMesh::ParallelObject::processor_id(), and libMesh::DofObject::processor_id().
Referenced by distribute_dofs().
void libMesh::DofMap::add_periodic_boundary | ( | const PeriodicBoundaryBase & | periodic_boundary | ) |
Adds a copy of the specified periodic boundary to the system.
Definition at line 4393 of file dof_map_constraints.C.
References libMesh::PeriodicBoundaryBase::clone(), libMesh::PeriodicBoundaryBase::merge(), libMesh::PeriodicBoundaryBase::myboundary, and libMesh::PeriodicBoundaryBase::pairedboundary.
void libMesh::DofMap::add_periodic_boundary | ( | const PeriodicBoundaryBase & | boundary, |
const PeriodicBoundaryBase & | inverse_boundary | ||
) |
Add a periodic boundary pair
boundary | - primary boundary |
inverse_boundary | - inverse boundary |
Definition at line 4423 of file dof_map_constraints.C.
References libMesh::PeriodicBoundaryBase::clone(), libMesh::PeriodicBoundaryBase::myboundary, and libMesh::PeriodicBoundaryBase::pairedboundary.
void libMesh::DofMap::add_variable_group | ( | const VariableGroup & | var_group | ) |
Add an unknown of order order
and finite element type type
to the system of equations. Add a group of unknowns of order order
and finite element type type
to the system of equations.
Definition at line 245 of file dof_map.C.
References _variable_group_numbers, _variable_groups, _variables, and libMesh::VariableGroup::n_variables().
|
inline |
Beginning of range of algebraic ghosting functors
Definition at line 367 of file dof_map.h.
References _algebraic_ghosting_functors.
Referenced by add_neighbors_to_send_list().
|
inline |
End of range of algebraic ghosting functors
Definition at line 373 of file dof_map.h.
References _algebraic_ghosting_functors.
Referenced by add_neighbors_to_send_list().
bool libMesh::DofMap::all_semilocal_indices | ( | const std::vector< dof_id_type > & | dof_indices | ) | const |
true
if all degree of freedom indices in dof_indices
are either local indices or in the send_list
.Definition at line 2400 of file dof_map.C.
References semilocal_index().
Referenced by is_evaluable().
void libMesh::DofMap::allgather_recursive_constraints | ( | MeshBase & | mesh | ) |
Gathers constraint equation dependencies from other processors
Definition at line 2595 of file dof_map_constraints.C.
References libMesh::MeshBase::active_not_local_elements_begin(), libMesh::MeshBase::active_not_local_elements_end(), libMesh::as_range(), data, libMesh::DofObject::dof_number(), libMesh::DofObject::id(), libMesh::index_range(), libMesh::MeshBase::is_serial(), libMesh::libmesh_isnan(), mesh, libMesh::DofObject::n_comp(), n_nodes, n_vars, libMesh::DofObject::n_vars(), libMesh::MeshBase::node_ptr(), libMesh::DofObject::processor_id(), libMesh::Parallel::pull_parallel_vector_data(), libMesh::Parallel::push_parallel_vector_data(), libMesh::Real, libMesh::TypeVector< T >::size(), and libMesh::Parallel::wait().
|
inline |
Attach a function pointer to use as a callback to populate the send_list with extra entries.
Definition at line 429 of file dof_map.h.
References _extra_send_list_context, and _extra_send_list_function.
|
inline |
Attach an object to populate the send_list with extra entries. This should only add to the send list, but no checking is done to enforce this behavior.
This is an advanced function... use at your own peril!
Definition at line 420 of file dof_map.h.
References _augment_send_list.
|
inline |
Attach a function pointer to use as a callback to populate the sparsity pattern with extra entries.
Care must be taken that when adding entries they are sorted into the Rows
Further, you must modify n_nz and n_oz properly!
This is an advanced function... use at your own peril!
Definition at line 406 of file dof_map.h.
References _extra_sparsity_context, and _extra_sparsity_function.
|
inline |
Attach an object to use to populate the sparsity pattern with extra entries.
Care must be taken that when adding entries they are sorted into the Rows
Further, you must modify n_nz and n_oz properly!
This is an advanced function... use at your own peril!
Definition at line 391 of file dof_map.h.
References _augment_sparsity_pattern.
void libMesh::DofMap::attach_matrix | ( | SparseMatrix< Number > & | matrix | ) |
Additional matrices may be handled with this DofMap
. They are initialized to the same sparsity structure as the major matrix.
Definition at line 262 of file dof_map.C.
References _matrices, _n_nz, _n_oz, _sp, libMesh::SparseMatrix< T >::attach_dof_map(), libMesh::ParallelObject::comm(), libMesh::Parallel::Communicator::max(), libMesh::SparseMatrix< T >::need_full_sparsity_pattern(), need_full_sparsity_pattern, and libMesh::SparseMatrix< T >::update_sparsity_pattern().
Referenced by libMesh::EigenSystem::init_matrices(), and libMesh::ImplicitSystem::init_matrices().
|
inline |
Definition at line 562 of file dof_map.h.
References has_blocked_representation(), and n_variables().
|
private |
Build the constraint matrix C associated with the element degree of freedom indices elem_dofs. The optional parameter called_recursively
should be left at the default value false
. This is used to handle the special case of an element's degrees of freedom being constrained in terms of other, local degrees of freedom. The usual case is for an elements DOFs to be constrained by some other, external DOFs.
Definition at line 2346 of file dof_map_constraints.C.
References libMesh::DenseMatrixBase< T >::m(), libMesh::DenseMatrixBase< T >::n(), libMesh::DenseMatrix< T >::resize(), and libMesh::DenseMatrix< T >::right_multiply().
|
private |
Build the constraint matrix C and the forcing vector H associated with the element degree of freedom indices elem_dofs. The optional parameter called_recursively
should be left at the default value false
. This is used to handle the special case of an element's degrees of freedom being constrained in terms of other, local degrees of freedom. The usual case is for an elements DOFs to be constrained by some other, external DOFs and/or Dirichlet conditions.
The forcing vector will depend on which solution's heterogenous constraints are being applied. For the default qoi_index
this will be the primal solution; for qoi_index
>= 0 the corresponding adjoint solution's constraints will be used.
Definition at line 2456 of file dof_map_constraints.C.
References libMesh::DenseMatrixBase< T >::m(), libMesh::DenseMatrixBase< T >::n(), libMesh::DenseVector< T >::resize(), libMesh::DenseMatrix< T >::resize(), libMesh::DenseMatrix< T >::right_multiply(), and libMesh::DenseMatrix< T >::vector_mult_add().
Referenced by extract_local_vector().
|
private |
Builds a sparsity pattern
Definition at line 58 of file dof_map.C.
References _augment_sparsity_pattern, _coupling_functors, _dof_coupling, _extra_sparsity_context, _extra_sparsity_function, libMesh::DofMap::AugmentSparsityPattern::augment_sparsity_pattern(), mesh, n_dofs_on_processor(), need_full_sparsity_pattern, libMesh::out, libMesh::Threads::parallel_reduce(), and use_coupled_neighbor_dofs().
Referenced by compute_sparsity().
|
private |
Check that all the ids in dirichlet_bcids are actually present in the mesh. If not, this will throw an error.
Definition at line 4362 of file dof_map_constraints.C.
References libMesh::DirichletBoundary::b, bc_id, libMesh::ParallelObject::comm(), libMesh::BoundaryInfo::get_boundary_ids(), libMesh::MeshBase::get_boundary_info(), libMesh::Parallel::Communicator::max(), mesh, and libMesh::Parallel::Communicator::verify().
void libMesh::DofMap::check_for_cyclic_constraints | ( | ) |
Throw an error if we detect and cyclic constraints, since these are not supported by libMesh and give erroneous results if they are present.
Definition at line 3334 of file dof_map_constraints.C.
References libMesh::Real.
void libMesh::DofMap::clear | ( | ) |
Free all new memory associated with the object, but restore its original state, with the mesh pointer and any default ghosting.
Definition at line 828 of file dof_map.C.
References _adjoint_constraint_values, _algebraic_ghosting_functors, _coupling_functors, _default_coupling, _default_evaluating, _dof_constraints, _dof_coupling, _end_df, _end_old_df, _first_df, _first_old_df, _first_old_scalar_df, _first_scalar_df, _matrices, _mesh, _n_dfs, _n_old_dfs, _primal_constraint_values, _send_list, _stashed_dof_constraints, _variable_group_numbers, _variable_groups, _variables, add_algebraic_ghosting_functor(), add_coupling_functor(), clear_sparsity(), need_full_sparsity_pattern, libMesh::MeshBase::remove_ghosting_functor(), and use_coupled_neighbor_dofs().
Referenced by ~DofMap().
void libMesh::DofMap::clear_sparsity | ( | ) |
Clears the sparsity pattern
Definition at line 1771 of file dof_map.C.
References _n_nz, _n_oz, _sp, and need_full_sparsity_pattern.
Referenced by clear(), libMesh::EigenSystem::reinit(), and libMesh::ImplicitSystem::reinit().
|
inlineinherited |
Parallel::Communicator
object used by this mesh. Definition at line 89 of file parallel_object.h.
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::__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::UniformRefinementEstimator::_estimate_error(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::SlepcEigenSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::SlepcEigenSolver< T >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< 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(), libMesh::PetscDMWrapper::add_dofs_helper(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::ImplicitSystem::add_matrix(), libMesh::System::add_vector(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::FEMSystem::assemble_qoi(), libMesh::MeshCommunication::assign_global_indices(), attach_matrix(), libMesh::MeshTools::Generation::build_extrusion(), 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_dims(), libMesh::System::calculate_norm(), check_dirichlet_bcid_consistency(), libMesh::PetscDMWrapper::check_section_n_dofs(), 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::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(), distribute_dofs(), DMlibMeshFunction(), DMlibMeshJacobian(), DMlibMeshSetSystem_libMesh(), DMVariableBounds_libMesh(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::EpetraVector< T >::EpetraVector(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::CondensedEigenSystem::get_eigenpair(), get_info(), libMesh::ImplicitSystem::get_linear_solver(), libMesh::LocationMap< T >::init(), libMesh::TimeSolver::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::EigenSystem::init_data(), libMesh::EigenSystem::init_matrices(), libMesh::OptimizationSystem::initialize_equality_constraints_storage(), libMesh::OptimizationSystem::initialize_inequality_constraints_storage(), 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_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::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_snes_fd_residual(), libMesh::libmesh_petsc_snes_jacobian(), libMesh::libmesh_petsc_snes_mffd_residual(), libMesh::libmesh_petsc_snes_postcheck(), libMesh::libmesh_petsc_snes_residual(), libMesh::libmesh_petsc_snes_residual_helper(), 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::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::FEMSystem::mesh_position_set(), 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(), 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(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::MeshTools::paranoid_n_levels(), libMesh::petsc_auto_fieldsplit(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::MeshBase::prepare_for_use(), libMesh::Nemesis_IO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::System::read_header(), libMesh::System::read_legacy_data(), 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::MeshBase::recalculate_n_partitions(), libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::CheckpointIO::select_split_config(), set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::PetscDiffSolver::setup_petsc_data(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::split_mesh(), libMesh::MeshBase::subdomain_ids(), libMesh::BoundaryInfo::sync(), libMesh::MeshRefinement::test_level_one(), libMesh::MeshRefinement::test_unflagged(), libMesh::MeshTools::total_weight(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), 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().
void libMesh::DofMap::compute_sparsity | ( | const MeshBase & | mesh | ) |
Computes the sparsity pattern for the matrices corresponding to proc_id
and sends that data to Linear Algebra packages for preallocation of sparse matrices.
Definition at line 1739 of file dof_map.C.
References _matrices, _n_nz, _n_oz, _sp, build_sparsity(), and need_full_sparsity_pattern.
Referenced by libMesh::EigenSystem::init_matrices(), libMesh::ImplicitSystem::init_matrices(), libMesh::EigenSystem::reinit(), and libMesh::ImplicitSystem::reinit().
|
inline |
Constrains a dyadic element matrix B = v w'. This method requires the element matrix to be square, in which case the elem_dofs correspond to the global DOF indices of both the rows and columns of the element matrix. For this case the rows and columns of the matrix necessarily correspond to variables of the same approximation order.
Definition at line 2012 of file dof_map_constraints.C.
References libMesh::DenseMatrixBase< T >::m(), libMesh::DenseMatrixBase< T >::n(), libMesh::DenseVector< T >::size(), and libMesh::DenseMatrix< T >::vector_mult_transpose().
|
inline |
Constrains the element matrix. This method requires the element matrix to be square, in which case the elem_dofs correspond to the global DOF indices of both the rows and columns of the element matrix. For this case the rows and columns of the matrix necessarily correspond to variables of the same approximation order.
If asymmetric_constraint_rows
is set to true (as it is by default), constraint row equations will be reinforced in a way which breaks matrix symmetry but makes inexact linear solver solutions more likely to satisfy hanging node constraints.
Definition at line 1545 of file dof_map_constraints.C.
References libMesh::DenseMatrix< T >::left_multiply_transpose(), libMesh::DenseMatrixBase< T >::m(), libMesh::DenseMatrixBase< T >::n(), and libMesh::DenseMatrix< T >::right_multiply().
|
inline |
Constrains the element matrix. This method allows the element matrix to be non-square, in which case the row_dofs and col_dofs may be of different size and correspond to variables approximated in different spaces.
Definition at line 1878 of file dof_map_constraints.C.
References libMesh::DenseMatrix< T >::left_multiply_transpose(), libMesh::DenseMatrixBase< T >::m(), libMesh::DenseMatrixBase< T >::n(), and libMesh::DenseMatrix< T >::right_multiply().
|
inline |
Constrains the element matrix and vector. This method requires the element matrix to be square, in which case the elem_dofs correspond to the global DOF indices of both the rows and columns of the element matrix. For this case the rows and columns of the matrix necessarily correspond to variables of the same approximation order.
Definition at line 1615 of file dof_map_constraints.C.
References libMesh::DenseMatrix< T >::left_multiply_transpose(), libMesh::DenseMatrixBase< T >::m(), libMesh::DenseMatrixBase< T >::n(), libMesh::DenseMatrix< T >::right_multiply(), libMesh::DenseVector< T >::size(), and libMesh::DenseMatrix< T >::vector_mult_transpose().
|
inline |
Constrains the element vector.
Definition at line 1970 of file dof_map_constraints.C.
References libMesh::DenseMatrixBase< T >::m(), libMesh::DenseMatrixBase< T >::n(), libMesh::DenseVector< T >::size(), and libMesh::DenseMatrix< T >::vector_mult_transpose().
void libMesh::DofMap::constrain_nothing | ( | std::vector< dof_id_type > & | dofs | ) | const |
Does not actually constrain anything, but modifies dofs
in the same way as any of the constrain functions would do, i.e. adds those dofs in terms of which any of the existing dofs is constrained.
Definition at line 2063 of file dof_map_constraints.C.
void libMesh::DofMap::constrain_p_dofs | ( | unsigned int | var, |
const Elem * | elem, | ||
unsigned int | s, | ||
unsigned int | p | ||
) |
Constrains degrees of freedom on side s
of element elem
which correspond to variable number var
and to p refinement levels above p
.
Definition at line 4208 of file dof_map_constraints.C.
References libMesh::Elem::dim(), libMesh::DofObject::dof_number(), libMesh::Elem::is_node_on_side(), libMesh::Elem::is_vertex(), libMesh::DofObject::n_comp(), n_nodes, libMesh::Elem::n_nodes(), libMesh::Elem::n_sides(), libMesh::Elem::node_ref(), libMesh::FEType::order, libMesh::Elem::p_level(), libMesh::Threads::spin_mtx, and libMesh::Elem::type().
Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), and libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints().
|
inline |
Definition at line 902 of file dof_map.h.
References _dof_constraints.
|
inline |
Definition at line 908 of file dof_map.h.
References _dof_constraints.
|
inline |
Beginning of range of coupling functors
Definition at line 317 of file dof_map.h.
References _coupling_functors.
Referenced by add_neighbors_to_send_list(), and libMesh::SparsityPattern::Build::operator()().
|
inline |
End of range of coupling functors
Definition at line 323 of file dof_map.h.
References _coupling_functors.
Referenced by add_neighbors_to_send_list(), and libMesh::SparsityPattern::Build::operator()().
Rebuilds the raw degree of freedom and DofObject constraints. A time is specified for use in building time-dependent Dirichlet constraints.
Definition at line 1194 of file dof_map_constraints.C.
References libMesh::StoredRange< iterator_type, object_type >::empty(), libMesh::MeshBase::is_prepared(), libMesh::MeshBase::is_serial(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshBase::local_elements_begin(), libMesh::MeshBase::local_elements_end(), mesh, libMesh::MeshBase::mesh_dimension(), libMesh::MeshBase::n_elem(), libMesh::Threads::parallel_for(), libMesh::StoredRange< iterator_type, object_type >::reset(), and libMesh::MeshBase::sub_point_locator().
Referenced by libMesh::System::reinit_constraints().
|
inline |
Default algebraic ghosting functor
Definition at line 379 of file dof_map.h.
References _default_evaluating.
Referenced by add_default_ghosting(), and remove_default_ghosting().
|
inline |
Default coupling functor
Definition at line 329 of file dof_map.h.
References _default_coupling.
Referenced by add_default_ghosting(), and remove_default_ghosting().
|
staticinherited |
Definition at line 106 of file reference_counter.C.
References libMesh::ReferenceCounter::_enable_print_counter.
Referenced by libMesh::LibMeshInit::LibMeshInit().
void libMesh::DofMap::distribute_dofs | ( | MeshBase & | mesh | ) |
Distribute dofs on the current mesh. Also builds the send list for processor proc_id
, which defaults to 0 for ease of use in serial applications.
Definition at line 902 of file dof_map.C.
References _algebraic_ghosting_functors, _coupling_functors, _end_df, _end_old_df, _first_df, _first_old_df, _first_old_scalar_df, _first_scalar_df, _n_dfs, _n_old_dfs, _send_list, add_neighbors_to_send_list(), libMesh::Parallel::Communicator::allgather(), libMesh::ParallelObject::comm(), distribute_local_dofs_node_major(), distribute_local_dofs_var_major(), libMesh::DofObject::dof_number(), elem_ptr(), libMesh::MeshBase::elements_begin(), end_dof(), libMesh::FEType::family, first_dof(), libMesh::OrderWrapper::get_order(), libMesh::DofObject::invalid_id, invalidate_dofs(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), mesh, libMesh::DofObject::n_comp(), n_dofs(), libMesh::ParallelObject::n_processors(), n_SCALAR_dofs(), n_variables(), libMesh::DofObject::n_vars(), node_ptr(), libMesh::MeshBase::nodes_begin(), libMesh::on_command_line(), libMesh::FEType::order, libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), reinit(), libMesh::SCALAR, set_nonlocal_dof_objects(), sys_number(), libMesh::Variable::type(), and variable().
Referenced by libMesh::EquationSystems::allgather(), and libMesh::EquationSystems::reinit_solutions().
|
private |
Distributes the global degrees of freedom for dofs on this processor. In this format all the degrees of freedom at a node/element are in contiguous blocks. Starts at index next_free_dof
, and increments it to the post-final index. If build_send_list
is true
, builds the send list. If false
, clears and reserves the send list.
distribute_local_dofs_var_major
. Definition at line 1163 of file dof_map.C.
References _n_SCALAR_dofs, libMesh::Variable::active_on_subdomain(), libMesh::FEType::family, libMesh::OrderWrapper::get_order(), libMesh::DofObject::invalid_id, mesh, libMesh::DofObject::n_comp_group(), n_nodes, libMesh::ParallelObject::n_processors(), n_variable_groups(), libMesh::VariableGroup::n_variables(), libMesh::FEType::order, libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::SCALAR, libMesh::DofObject::set_vg_dof_base(), sys_number(), libMesh::Variable::type(), variable_group(), and libMesh::DofObject::vg_dof_base().
Referenced by distribute_dofs().
|
private |
Distributes the global degrees of freedom, for dofs on this processor. In this format the local degrees of freedom are in a contiguous block for each variable in the system. Starts at index next_free_dof, and increments it to the post-final index.
Definition at line 1302 of file dof_map.C.
References _n_SCALAR_dofs, libMesh::Variable::active_on_subdomain(), libMesh::FEType::family, libMesh::OrderWrapper::get_order(), libMesh::DofObject::invalid_id, mesh, libMesh::DofObject::n_comp_group(), n_nodes, libMesh::ParallelObject::n_processors(), n_variable_groups(), libMesh::VariableGroup::n_variables(), libMesh::FEType::order, libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::SCALAR, libMesh::DofObject::set_vg_dof_base(), sys_number(), libMesh::Variable::type(), variable_group(), and libMesh::DofObject::vg_dof_base().
Referenced by distribute_dofs().
void libMesh::DofMap::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 at line 1930 of file dof_map.C.
References _dof_indices(), libMesh::Elem::active(), libMesh::Variable::active_on_subdomain(), libMesh::FEType::family, libMesh::MeshTools::Subdivision::find_one_ring(), libMesh::Elem::get_nodes(), libMesh::Tri3Subdivision::is_ghost(), n_nodes, libMesh::Elem::n_nodes(), n_variable_groups(), libMesh::VariableGroup::n_variables(), libMesh::VariableGroup::number(), libMesh::FEType::order, libMesh::Elem::p_level(), libMesh::SCALAR, SCALAR_dof_indices(), libMesh::Elem::subdomain_id(), libMesh::TRI3SUBDIVISION, libMesh::Variable::type(), libMesh::Elem::type(), and variable_group().
Referenced by libMesh::ExactSolution::_compute_error(), libMesh::UniformRefinementEstimator::_estimate_error(), add_neighbors_to_send_list(), libMesh::HPCoarsenTest::add_projection(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::System::calculate_norm(), libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::MeshFunction::discontinuous_gradient(), libMesh::MeshFunction::discontinuous_value(), DMCreateDomainDecomposition_libMesh(), DMCreateFieldDecomposition_libMesh(), dof_indices(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::MeshFunction::gradient(), libMesh::MeshFunction::hessian(), libMesh::SystemSubsetBySubdomain::init(), is_evaluable(), libMesh::System::local_dof_indices(), libMesh::DGFEMContext::neighbor_side_fe_reinit(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::MeshFunction::operator()(), libMesh::BoundaryProjectSolution::operator()(), libMesh::ErrorVector::plot_error(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::FEMContext::pre_fe_reinit(), libMesh::HPCoarsenTest::select_refinement(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::SparsityPattern::Build::sorted_connected_dofs(), libMesh::EnsightIO::write_scalar_ascii(), and libMesh::EnsightIO::write_vector_ascii().
void libMesh::DofMap::dof_indices | ( | const Elem *const | elem, |
std::vector< dof_id_type > & | di, | ||
const unsigned int | vn, | ||
int | p_level = -12345 |
||
) | const |
Fills the vector di
with the global degree of freedom indices for the element. For one variable, and potentially for a non-default element p refinement level
Definition at line 2040 of file dof_map.C.
References _dof_indices(), _variable_group_numbers, libMesh::Variable::active_on_subdomain(), libMesh::FEType::family, libMesh::MeshTools::Subdivision::find_one_ring(), libMesh::Elem::get_nodes(), libMesh::Tri3Subdivision::is_ghost(), libMesh::Elem::n_nodes(), libMesh::VariableGroup::number(), libMesh::FEType::order, libMesh::Elem::p_level(), libMesh::SCALAR, SCALAR_dof_indices(), libMesh::Elem::subdomain_id(), libMesh::TRI3SUBDIVISION, libMesh::Variable::type(), libMesh::Elem::type(), and variable_group().
void libMesh::DofMap::dof_indices | ( | const Node *const | node, |
std::vector< dof_id_type > & | di | ||
) | const |
Fills the vector di
with the global degree of freedom indices for the node.
Definition at line 2115 of file dof_map.C.
References libMesh::DofObject::dof_number(), libMesh::FEType::family, libMesh::DofObject::invalid_id, libMesh::DofObject::n_comp_group(), n_variable_groups(), libMesh::VariableGroup::n_variables(), libMesh::VariableGroup::number(), libMesh::SCALAR, SCALAR_dof_indices(), sys_number(), libMesh::Variable::type(), and variable_group().
void libMesh::DofMap::dof_indices | ( | const Node *const | node, |
std::vector< dof_id_type > & | di, | ||
const unsigned int | vn | ||
) | const |
Fills the vector di
with the global degree of freedom indices for the node. For one variable vn
.
Definition at line 2163 of file dof_map.C.
References _variable_group_numbers, dof_indices(), libMesh::DofObject::dof_number(), libMesh::FEType::family, libMesh::DofObject::invalid_id, libMesh::invalid_uint, libMesh::DofObject::n_comp_group(), libMesh::VariableGroup::number(), libMesh::SCALAR, SCALAR_dof_indices(), sys_number(), libMesh::Variable::type(), and variable_group().
|
inline |
dof
Definition at line 650 of file dof_map.h.
References _end_df.
Referenced by libMesh::PetscDMWrapper::build_sf().
|
private |
i
from the mesh
. Definition at line 313 of file dof_map.C.
References mesh.
Referenced by distribute_dofs().
|
staticinherited |
Methods to enable/disable the reference counter output from print_info()
Definition at line 100 of file reference_counter.C.
References libMesh::ReferenceCounter::_enable_print_counter.
|
inline |
proc
.Analogous to the end() member function of STL containers.
Definition at line 641 of file dof_map.h.
References _end_df.
Referenced by DMCreateDomainDecomposition_libMesh(), DMCreateFieldDecomposition_libMesh(), libMesh::SparsityPattern::Build::handle_vi_vj(), libMesh::SystemSubsetBySubdomain::init(), libMesh::CondensedEigenSystem::initialize_condensed_dofs(), libMesh::SparsityPattern::Build::join(), libMesh::System::local_dof_indices(), libMesh::SparsityPattern::Build::operator()(), and libMesh::SparsityPattern::Build::parallel_sync().
|
inline |
Definition at line 644 of file dof_map.h.
References libMesh::ParallelObject::processor_id().
Referenced by distribute_dofs(), and local_index().
|
inline |
proc
.Analogous to the end() member function of STL containers.
Definition at line 664 of file dof_map.h.
References _end_old_df.
Referenced by libMesh::BuildProjectionList::operator()().
|
inline |
Definition at line 667 of file dof_map.h.
References libMesh::ParallelObject::processor_id().
|
inline |
Heterogenously constrains the numeric vector v
, which represents an adjoint solution defined on the mesh for quantity fo interest q
. For homogeneous constraints, use enforce_constraints_exactly
instead
Definition at line 2170 of file dof_map_constraints.C.
References libMesh::NumericVector< T >::close(), libMesh::NumericVector< T >::closed(), libMesh::NumericVector< T >::get(), libMesh::GHOSTED, libMesh::NumericVector< T >::localize(), libMesh::PARALLEL, libMesh::SERIAL, libMesh::NumericVector< T >::set(), libMesh::NumericVector< T >::size(), and libMesh::NumericVector< T >::type().
Referenced by libMesh::ImplicitSystem::adjoint_solve(), and libMesh::AdjointRefinementEstimator::estimate_error().
|
inline |
Constrains the numeric vector v
, which represents a solution defined on the mesh. This may need to be used after a linear solve, if your linear solver's solutions do not satisfy your DoF constraints to a tight enough tolerance.
If v
== nullptr, the system solution vector is constrained
If homogeneous
== true, heterogeneous constraints are enforced as if they were homogeneous. This might be appropriate for e.g. a vector representing a difference between two heterogeneously-constrained solutions.
Definition at line 2077 of file dof_map_constraints.C.
References libMesh::NumericVector< T >::close(), libMesh::NumericVector< T >::closed(), libMesh::NumericVector< T >::get(), libMesh::System::get_dof_map(), libMesh::GHOSTED, libMesh::NumericVector< T >::localize(), libMesh::PARALLEL, libMesh::SERIAL, libMesh::NumericVector< T >::set(), libMesh::NumericVector< T >::size(), libMesh::System::solution, and libMesh::NumericVector< T >::type().
Referenced by libMesh::__libmesh_petsc_diff_solver_jacobian(), libMesh::__libmesh_petsc_diff_solver_residual(), libMesh::Problem_Interface::computeF(), libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), DMlibMeshFunction(), DMlibMeshJacobian(), libMesh::libmesh_petsc_snes_jacobian(), libMesh::libmesh_petsc_snes_postcheck(), libMesh::libmesh_petsc_snes_residual_helper(), libMesh::ImplicitSystem::sensitivity_solve(), libMesh::NewtonSolver::solve(), libMesh::PetscDiffSolver::solve(), libMesh::ImplicitSystem::weighted_sensitivity_adjoint_solve(), and libMesh::ImplicitSystem::weighted_sensitivity_solve().
void libMesh::DofMap::extract_local_vector | ( | const NumericVector< Number > & | Ug, |
const std::vector< dof_id_type > & | dof_indices, | ||
DenseVectorBase< Number > & | Ue | ||
) | const |
Builds the local element vector Ue
from the global vector Ug
, accounting for any constrained degrees of freedom. For an element without constrained degrees of freedom this is the trivial mapping
Ue
is properly sized when calling this method. This is because there is no resize()
method in the DenseVectorBase<>
class. Definition at line 1848 of file dof_map.C.
References build_constraint_matrix_and_vector(), libMesh::DenseVectorBase< T >::el(), libMesh::NumericVector< T >::first_local_index(), is_constrained_dof(), libMesh::NumericVector< T >::last_local_index(), libMesh::DenseMatrixBase< T >::m(), libMesh::DenseMatrixBase< T >::n(), libMesh::DenseVectorBase< T >::size(), libMesh::NumericVector< T >::size(), and libMesh::DenseVectorBase< T >::zero().
|
private |
Finds all the DofObjects associated with the set in objs
. This will account for off-element couplings via hanging nodes.
|
private |
Finds all the DOFS associated with the element DOFs elem_dofs. This will account for off-element couplings via hanging nodes.
Definition at line 2633 of file dof_map.C.
References _dof_constraints, and is_constrained_dof().
Referenced by libMesh::SparsityPattern::Build::sorted_connected_dofs().