libMesh
|
This class handles the numbering of degrees of freedom on a mesh. More...
#include <dof_map.h>
Classes | |
class | AugmentSendList |
Abstract base class to be used to add user-defined parallel degree of freedom couplings. More... | |
class | AugmentSparsityPattern |
Abstract base class to be used to add user-defined implicit degree of freedom couplings. More... | |
Public Member Functions | |
DofMap (const unsigned int sys_number, MeshBase &mesh) | |
Constructor. More... | |
~DofMap () | |
Destructor. More... | |
void | attach_matrix (SparseMatrix< Number > &matrix) |
Additional matrices may be handled with this DofMap . More... | |
bool | is_attached (SparseMatrix< Number > &matrix) |
Matrices should not be attached more than once. More... | |
void | distribute_dofs (MeshBase &) |
Distribute dofs on the current mesh. More... | |
void | compute_sparsity (const MeshBase &) |
Computes the sparsity pattern for the matrices corresponding to proc_id and sends that data to Linear Algebra packages for preallocation of sparse matrices. More... | |
void | clear_sparsity () |
Clears the sparsity pattern. More... | |
void | remove_default_ghosting () |
Remove any default ghosting functor(s). More... | |
void | add_default_ghosting () |
Add the default functor(s) for coupling and algebraic ghosting. More... | |
void | add_coupling_functor (GhostingFunctor &coupling_functor, bool to_mesh=true) |
Adds a functor which can specify coupling requirements for creation of sparse matrices. More... | |
void | remove_coupling_functor (GhostingFunctor &coupling_functor) |
Removes a functor which was previously added to the set of coupling functors, from both this DofMap and from the underlying mesh. More... | |
std::set< GhostingFunctor * >::const_iterator | coupling_functors_begin () const |
Beginning of range of coupling functors. More... | |
std::set< GhostingFunctor * >::const_iterator | coupling_functors_end () const |
End of range of coupling functors. More... | |
DefaultCoupling & | default_coupling () |
Default coupling functor. More... | |
void | 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. More... | |
void | remove_algebraic_ghosting_functor (GhostingFunctor &evaluable_functor) |
Removes a functor which was previously added to the set of algebraic ghosting functors, from both this DofMap and from the underlying mesh. More... | |
std::set< GhostingFunctor * >::const_iterator | algebraic_ghosting_functors_begin () const |
Beginning of range of algebraic ghosting functors. More... | |
std::set< GhostingFunctor * >::const_iterator | algebraic_ghosting_functors_end () const |
End of range of algebraic ghosting functors. More... | |
DefaultCoupling & | default_algebraic_ghosting () |
Default algebraic ghosting functor. More... | |
void | attach_extra_sparsity_object (DofMap::AugmentSparsityPattern &asp) |
Attach an object to use to populate the sparsity pattern with extra entries. More... | |
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) |
Attach a function pointer to use as a callback to populate the sparsity pattern with extra entries. More... | |
void | attach_extra_send_list_object (DofMap::AugmentSendList &asl) |
Attach an object to populate the send_list with extra entries. More... | |
void | attach_extra_send_list_function (void(*func)(std::vector< dof_id_type > &, void *), void *context=nullptr) |
Attach a function pointer to use as a callback to populate the send_list with extra entries. More... | |
void | prepare_send_list () |
Takes the _send_list vector (which may have duplicate entries) and sorts it. More... | |
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) |
Add an unknown of order order and finite element type type to the system of equations. More... | |
void | set_error_on_cyclic_constraint (bool error_on_cyclic_constraint) |
Specify whether or not we perform an extra (opt-mode enabled) check for cyclic constraints. More... | |
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 |
Fills the vector di with the global degree of freedom indices for the element. More... | |
void | 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. More... | |
void | 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. More... | |
void | 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. More... | |
void | SCALAR_dof_indices (std::vector< dof_id_type > &di, const unsigned int vn, const bool old_dofs=false) const |
Fills the vector di with the global degree of freedom indices corresponding to the SCALAR variable vn. More... | |
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) |
Allow the implicit_neighbor_dofs flag to be set programmatically. More... | |
bool | use_coupled_neighbor_dofs (const MeshBase &mesh) const |
Tells other library functions whether or not this problem includes coupling between dofs in neighboring cells, as can currently be specified on the command line or inferred from the use of all discontinuous variables. More... | |
void | 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. More... | |
void | local_variable_indices (std::vector< dof_id_type > &idx, const MeshBase &mesh, unsigned int var_num) const |
Fills an array of those dof indices which belong to the given variable number and live on the current processor. More... | |
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) |
Rebuilds the raw degree of freedom and DofObject constraints. More... | |
void | allgather_recursive_constraints (MeshBase &) |
Gathers constraint equation dependencies from other processors. More... | |
void | scatter_constraints (MeshBase &) |
Sends constraint equations to constraining processors. More... | |
void | gather_constraints (MeshBase &mesh, std::set< dof_id_type > &unexpanded_dofs, bool look_for_constrainees) |
Helper function for querying about constraint equations on other processors. More... | |
void | process_constraints (MeshBase &) |
Postprocesses any constrained degrees of freedom to be constrained only in terms of unconstrained dofs, then adds unconstrained dofs to the send_list and prepares that for use. More... | |
void | 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. More... | |
void | 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. More... | |
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) |
Adds a copy of the user-defined row to the constraint matrix, using an inhomogeneous right-hand-side for the adjoint constraint equation. More... | |
void | add_constraint_row (const dof_id_type dof_number, const DofConstraintRow &constraint_row, const bool forbid_constraint_overwrite=true) |
Adds a copy of the user-defined row to the constraint matrix, using a homogeneous right-hand-side for the constraint equation. More... | |
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 |
Prints (from processor 0) all DoF and Node constraints. More... | |
std::string | get_local_constraints (bool print_nonlocal=false) const |
Gets a string reporting all DoF and Node constraints local to this processor. More... | |
std::pair< Real, Real > | max_constraint_error (const System &system, NumericVector< Number > *v=nullptr) const |
Tests the constrained degrees of freedom on the numeric vector v , which represents a solution defined on the mesh, returning a pair whose first entry is the maximum absolute error on a constrained DoF and whose second entry is the maximum relative error. More... | |
void | constrain_element_matrix (DenseMatrix< Number > &matrix, std::vector< dof_id_type > &elem_dofs, bool asymmetric_constraint_rows=true) const |
Constrains the element matrix. More... | |
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 |
Constrains the element matrix. More... | |
void | constrain_element_vector (DenseVector< Number > &rhs, std::vector< dof_id_type > &dofs, bool asymmetric_constraint_rows=true) const |
Constrains the element vector. More... | |
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 |
Constrains the element matrix and vector. More... | |
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 |
Constrains the element matrix and vector. More... | |
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 |
Constrains the element vector. More... | |
void | constrain_element_dyad_matrix (DenseVector< Number > &v, DenseVector< Number > &w, std::vector< dof_id_type > &row_dofs, bool asymmetric_constraint_rows=true) const |
Constrains a dyadic element matrix B = v w'. More... | |
void | 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. More... | |
void | enforce_constraints_exactly (const System &system, NumericVector< Number > *v=nullptr, bool homogeneous=false) const |
Constrains the numeric vector v , which represents a solution defined on the mesh. More... | |
void | enforce_adjoint_constraints_exactly (NumericVector< Number > &v, unsigned int q) const |
Heterogenously constrains the numeric vector v , which represents an adjoint solution defined on the mesh for quantity fo interest q . More... | |
void | enforce_constraints_on_residual (const NonlinearImplicitSystem &system, NumericVector< Number > *rhs, NumericVector< Number > const *solution, bool homogeneous=true) const |
void | enforce_constraints_on_jacobian (const NonlinearImplicitSystem &system, SparseMatrix< Number > *jac) const |
void | add_periodic_boundary (const PeriodicBoundaryBase &periodic_boundary) |
Adds a copy of the specified periodic boundary to the system. More... | |
void | add_periodic_boundary (const PeriodicBoundaryBase &boundary, const PeriodicBoundaryBase &inverse_boundary) |
Add a periodic boundary pair. More... | |
bool | is_periodic_boundary (const boundary_id_type boundaryid) const |
PeriodicBoundaries * | get_periodic_boundaries () |
void | add_dirichlet_boundary (const DirichletBoundary &dirichlet_boundary) |
Adds a copy of the specified Dirichlet boundary to the system. More... | |
void | 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 . More... | |
void | remove_dirichlet_boundary (const DirichletBoundary &dirichlet_boundary) |
Removes the specified Dirichlet boundary from the system. More... | |
void | remove_adjoint_dirichlet_boundary (const DirichletBoundary &dirichlet_boundary, unsigned int q) |
Removes from the system the specified Dirichlet boundary for the adjoint equation defined by Quantity of interest index q. More... | |
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 |
After a mesh is refined and repartitioned it is possible that the _send_list will need to be augmented. More... | |
dof_id_type | n_old_dofs () const |
void | 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 . More... | |
void | reinit (MeshBase &mesh) |
Reinitialize the underlying data structures conformal to the current mesh. More... | |
void | clear () |
Free all new memory associated with the object, but restore its original state, with the mesh pointer and any default ghosting. More... | |
void | print_info (std::ostream &os=libMesh::out) const |
Prints summary info about the sparsity bandwidth and constraints. More... | |
std::string | get_info () const |
Gets summary info about the sparsity bandwidth and constraints. More... | |
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 () |
Gets a string containing the reference information. More... | |
static void | print_info (std::ostream &out=libMesh::out) |
Prints the reference information, by default to libMesh::out . More... | |
static unsigned int | n_objects () |
Prints the number of outstanding (created, but not yet destroyed) objects. More... | |
static void | enable_print_counter_info () |
Methods to enable/disable the reference counter output from print_info() More... | |
static void | disable_print_counter_info () |
Public Attributes | |
CouplingMatrix * | _dof_coupling |
Degree of freedom coupling. More... | |
Protected Types | |
typedef std::map< std::string, std::pair< unsigned int, unsigned int > > | Counts |
Data structure to log the information. More... | |
Protected Member Functions | |
void | increment_constructor_count (const std::string &name) |
Increments the construction counter. More... | |
void | increment_destructor_count (const std::string &name) |
Increments the destruction counter. More... | |
Protected Attributes | |
const Parallel::Communicator & | _communicator |
Static Protected Attributes | |
static Counts | _counts |
Actually holds the data. More... | |
static Threads::atomic< unsigned int > | _n_objects |
The number of objects. More... | |
static Threads::spin_mutex | _mutex |
Mutual exclusion object to enable thread-safe reference counting. More... | |
static bool | _enable_print_counter |
Flag to control whether reference count information is printed when print_info is called. More... | |
Private Types | |
typedef DofObject *(DofMap::* | dofobject_accessor) (MeshBase &mesh, dof_id_type i) const |
A member function type like node_ptr() or elem_ptr() . More... | |
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 |
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. More... | |
std::unique_ptr< SparsityPattern::Build > | build_sparsity (const MeshBase &mesh) const |
Builds a sparsity pattern. More... | |
void | invalidate_dofs (MeshBase &mesh) const |
Invalidates all active DofObject dofs for this system. More... | |
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) |
Helper function for distributing dofs in parallel. More... | |
void | distribute_local_dofs_var_major (dof_id_type &next_free_dof, MeshBase &mesh) |
Distributes the global degrees of freedom, for dofs on this processor. More... | |
void | distribute_local_dofs_node_major (dof_id_type &next_free_dof, MeshBase &mesh) |
Distributes the global degrees of freedom for dofs on this processor. More... | |
void | add_neighbors_to_send_list (MeshBase &mesh) |
Adds entries to the _send_list vector corresponding to DoFs on elements neighboring the current processor. More... | |
void | build_constraint_matrix (DenseMatrix< Number > &C, std::vector< dof_id_type > &elem_dofs, const bool called_recursively=false) const |
Build the constraint matrix C associated with the element degree of freedom indices elem_dofs. More... | |
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 |
Build the constraint matrix C and the forcing vector H associated with the element degree of freedom indices elem_dofs. More... | |
void | find_connected_dofs (std::vector< dof_id_type > &elem_dofs) const |
Finds all the DOFS associated with the element DOFs elem_dofs. More... | |
void | find_connected_dof_objects (std::vector< const DofObject *> &objs) const |
Finds all the DofObjects associated with the set in objs . More... | |
void | add_constraints_to_send_list () |
Adds entries to the _send_list vector corresponding to DoFs which are dependencies for constraint equations on the current processor. More... | |
void | check_dirichlet_bcid_consistency (const MeshBase &mesh, const DirichletBoundary &boundary) const |
Check that all the ids in dirichlet_bcids are actually present in the mesh. More... | |
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) |
Private Attributes | |
bool | _error_on_cyclic_constraint |
This flag indicates whether or not we do an opt-mode check for the presence of cyclic constraints. More... | |
std::vector< Variable > | _variables |
The finite element type for each variable. More... | |
std::vector< VariableGroup > | _variable_groups |
The finite element type for each variable group. More... | |
std::vector< unsigned int > | _variable_group_numbers |
The variable group number for each variable. More... | |
const unsigned int | _sys_number |
The number of the system we manage DOFs for. More... | |
MeshBase & | _mesh |
The mesh that system uses. More... | |
std::vector< SparseMatrix< Number > *> | _matrices |
Additional matrices handled by this object. More... | |
std::vector< dof_id_type > | _first_df |
First DOF index on processor p . More... | |
std::vector< dof_id_type > | _end_df |
Last DOF index (plus 1) on processor p . More... | |
std::vector< dof_id_type > | _first_scalar_df |
First DOF index for SCALAR variable v, or garbage for non-SCALAR variable v. More... | |
std::vector< dof_id_type > | _send_list |
A list containing all the global DOF indices that affect the solution on my processor. More... | |
AugmentSparsityPattern * | _augment_sparsity_pattern |
Function object to call to add extra entries to the sparsity pattern. More... | |
void(* | _extra_sparsity_function )(SparsityPattern::Graph &, std::vector< dof_id_type > &n_nz, std::vector< dof_id_type > &n_oz, void *) |
A function pointer to a function to call to add extra entries to the sparsity pattern. More... | |
void * | _extra_sparsity_context |
A pointer associated with the extra sparsity that can optionally be passed in. More... | |
AugmentSendList * | _augment_send_list |
Function object to call to add extra entries to the send list. More... | |
void(* | _extra_send_list_function )(std::vector< dof_id_type > &, void *) |
A function pointer to a function to call to add extra entries to the send list. More... | |
void * | _extra_send_list_context |
A pointer associated with the extra send list that can optionally be passed in. More... | |
std::unique_ptr< DefaultCoupling > | _default_coupling |
The default coupling GhostingFunctor, used to implement standard libMesh sparsity pattern construction. More... | |
std::unique_ptr< DefaultCoupling > | _default_evaluating |
The default algebraic GhostingFunctor, used to implement standard libMesh send_list construction. More... | |
std::set< GhostingFunctor * > | _algebraic_ghosting_functors |
The list of all GhostingFunctor objects to be used when distributing ghosted vectors. More... | |
std::set< GhostingFunctor * > | _coupling_functors |
The list of all GhostingFunctor objects to be used when coupling degrees of freedom in matrix sparsity patterns. More... | |
bool | need_full_sparsity_pattern |
Default false; set to true if any attached matrix requires a full sparsity pattern. More... | |
std::unique_ptr< SparsityPattern::Build > | _sp |
The sparsity pattern of the global matrix, kept around if it might be needed by future additions of the same type of matrix. More... | |
std::vector< dof_id_type > * | _n_nz |
The number of on-processor nonzeros in my portion of the global matrix. More... | |
std::vector< dof_id_type > * | _n_oz |
The number of off-processor nonzeros in my portion of the global matrix; allocated similar to _n_nz. More... | |
dof_id_type | _n_dfs |
Total number of degrees of freedom. More... | |
dof_id_type | _n_SCALAR_dofs |
The total number of SCALAR dofs associated to all SCALAR variables. More... | |
dof_id_type | _n_old_dfs |
Total number of degrees of freedom on old dof objects. More... | |
std::vector< dof_id_type > | _first_old_df |
First old DOF index on processor p . More... | |
std::vector< dof_id_type > | _end_old_df |
Last old DOF index (plus 1) on processor p . More... | |
std::vector< dof_id_type > | _first_old_scalar_df |
First old DOF index for SCALAR variable v, or garbage for non-SCALAR variable v. More... | |
DofConstraints | _dof_constraints |
Data structure containing DOF constraints. More... | |
DofConstraints | _stashed_dof_constraints |
DofConstraintValueMap | _primal_constraint_values |
AdjointDofConstraintValues | _adjoint_constraint_values |
NodeConstraints | _node_constraints |
Data structure containing DofObject constraints. More... | |
std::unique_ptr< PeriodicBoundaries > | _periodic_boundaries |
Data structure containing periodic boundaries. More... | |
std::unique_ptr< DirichletBoundaries > | _dirichlet_boundaries |
Data structure containing Dirichlet functions. More... | |
std::vector< DirichletBoundaries * > | _adjoint_dirichlet_boundaries |
Data structure containing Dirichlet functions. More... | |
bool | _implicit_neighbor_dofs_initialized |
Bools to indicate if we override the –implicit_neighbor_dofs commandline options. More... | |
bool | _implicit_neighbor_dofs |
Friends | |
class | SparsityPattern::Build |
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.
libMesh::DofMap::~DofMap | ( | ) |
Destructor.
|
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.
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.
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
.
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.
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.
Referenced by add_constraint_row().
void libMesh::DofMap::add_constraint_row | ( | const dof_id_type | dof_number, |
const DofConstraintRow & | constraint_row, | ||
const bool | forbid_constraint_overwrite = true |
||
) |
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 895 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.
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.
void libMesh::DofMap::add_default_ghosting | ( | ) |
Add the default functor(s) for coupling and algebraic ghosting.
User-added ghosting functors will be unaffected.
void libMesh::DofMap::add_dirichlet_boundary | ( | const DirichletBoundary & | dirichlet_boundary | ) |
Adds a copy of the specified Dirichlet boundary to the system.
Referenced by SimpleRBConstruction::init_data().
|
private |
Adds entries to the _send_list
vector corresponding to DoFs on elements neighboring the current processor.
void libMesh::DofMap::add_periodic_boundary | ( | const PeriodicBoundaryBase & | periodic_boundary | ) |
Adds a copy of the specified periodic boundary to the system.
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 |
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.
std::set<GhostingFunctor *>::const_iterator libMesh::DofMap::algebraic_ghosting_functors_begin | ( | ) | const |
Beginning of range of algebraic ghosting functors.
Definition at line 368 of file dof_map.h.
References _algebraic_ghosting_functors.
std::set<GhostingFunctor *>::const_iterator libMesh::DofMap::algebraic_ghosting_functors_end | ( | ) | const |
End of range of algebraic ghosting functors.
Definition at line 374 of file dof_map.h.
References _algebraic_ghosting_functors.
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
.void libMesh::DofMap::allgather_recursive_constraints | ( | MeshBase & | ) |
Gathers constraint equation dependencies from other processors.
void libMesh::DofMap::attach_extra_send_list_function | ( | void(*)(std::vector< dof_id_type > &, void *) | func, |
void * | context = nullptr |
||
) |
Attach a function pointer to use as a callback to populate the send_list with extra entries.
Definition at line 430 of file dof_map.h.
References _extra_send_list_context, and _extra_send_list_function.
void libMesh::DofMap::attach_extra_send_list_object | ( | DofMap::AugmentSendList & | asl | ) |
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 421 of file dof_map.h.
References _augment_send_list.
void libMesh::DofMap::attach_extra_sparsity_function | ( | void(*)(SparsityPattern::Graph &sparsity, std::vector< dof_id_type > &n_nz, std::vector< dof_id_type > &n_oz, void *) | func, |
void * | context = nullptr |
||
) |
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 407 of file dof_map.h.
References _extra_sparsity_context, and _extra_sparsity_function.
void libMesh::DofMap::attach_extra_sparsity_object | ( | DofMap::AugmentSparsityPattern & | asp | ) |
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 392 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.
unsigned int libMesh::DofMap::block_size | ( | ) | const |
Definition at line 563 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.
|
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.
|
private |
Builds a sparsity pattern.
|
private |
Check that all the ids in dirichlet_bcids are actually present in the mesh.
If not, this will throw an error.
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.
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.
void libMesh::DofMap::clear_sparsity | ( | ) |
Clears the sparsity pattern.
|
inherited |
Parallel::Communicator
object used by this mesh. Definition at line 89 of file parallel_object.h.
References libMesh::ParallelObject::_communicator.
Referenced by libMesh::EpetraVector< T >::EpetraVector(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id(), and libMesh::Parallel::sync_node_data_by_element_id_once().
void libMesh::DofMap::compute_sparsity | ( | const MeshBase & | ) |
Computes the sparsity pattern for the matrices corresponding to proc_id
and sends that data to Linear Algebra packages for preallocation of sparse matrices.
void libMesh::DofMap::constrain_element_dyad_matrix | ( | DenseVector< Number > & | v, |
DenseVector< Number > & | w, | ||
std::vector< dof_id_type > & | row_dofs, | ||
bool | asymmetric_constraint_rows = true |
||
) | const |
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.
void libMesh::DofMap::constrain_element_matrix | ( | DenseMatrix< Number > & | matrix, |
std::vector< dof_id_type > & | elem_dofs, | ||
bool | asymmetric_constraint_rows = true |
||
) | const |
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.
void libMesh::DofMap::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 libMesh::DofMap::constrain_element_matrix_and_vector | ( | DenseMatrix< Number > & | matrix, |
DenseVector< Number > & | rhs, | ||
std::vector< dof_id_type > & | elem_dofs, | ||
bool | asymmetric_constraint_rows = true |
||
) | const |
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.
void libMesh::DofMap::constrain_element_vector | ( | DenseVector< Number > & | rhs, |
std::vector< dof_id_type > & | dofs, | ||
bool | asymmetric_constraint_rows = true |
||
) | const |
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.
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
.
DofConstraints::const_iterator libMesh::DofMap::constraint_rows_begin | ( | ) | const |
Definition at line 903 of file dof_map.h.
References _dof_constraints.
DofConstraints::const_iterator libMesh::DofMap::constraint_rows_end | ( | ) | const |
Definition at line 909 of file dof_map.h.
References _dof_constraints.
std::set<GhostingFunctor *>::const_iterator libMesh::DofMap::coupling_functors_begin | ( | ) | const |
Beginning of range of coupling functors.
Definition at line 318 of file dof_map.h.
References _coupling_functors.
std::set<GhostingFunctor *>::const_iterator libMesh::DofMap::coupling_functors_end | ( | ) | const |
End of range of coupling functors.
Definition at line 324 of file dof_map.h.
References _coupling_functors.
Rebuilds the raw degree of freedom and DofObject constraints.
A time is specified for use in building time-dependent Dirichlet constraints.
DefaultCoupling& libMesh::DofMap::default_algebraic_ghosting | ( | ) |
Default algebraic ghosting functor.
Definition at line 380 of file dof_map.h.
References _default_evaluating.
DefaultCoupling& libMesh::DofMap::default_coupling | ( | ) |
Default coupling functor.
Definition at line 330 of file dof_map.h.
References _default_coupling.
|
staticinherited |
void libMesh::DofMap::distribute_dofs | ( | MeshBase & | ) |
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.
|
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
.
|
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.
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.
Referenced by FETest< order, family, elem_type >::setUp().
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
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.
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
.
processor_id_type libMesh::DofMap::dof_owner | ( | const dof_id_type | dof | ) | const |
dof
Definition at line 651 of file dof_map.h.
References _end_df.
|
private |
i
from the mesh
.
|
staticinherited |
Methods to enable/disable the reference counter output from print_info()
dof_id_type libMesh::DofMap::end_dof | ( | const processor_id_type | proc | ) | const |
proc
.Analogous to the end() member function of STL containers.
Definition at line 642 of file dof_map.h.
References _end_df.
dof_id_type libMesh::DofMap::end_dof | ( | ) | const |
Definition at line 645 of file dof_map.h.
References libMesh::ParallelObject::processor_id().
Referenced by local_index().
dof_id_type libMesh::DofMap::end_old_dof | ( | const processor_id_type | proc | ) | const |
proc
.Analogous to the end() member function of STL containers.
Definition at line 665 of file dof_map.h.
References _end_old_df.
dof_id_type libMesh::DofMap::end_old_dof | ( | ) | const |
Definition at line 668 of file dof_map.h.
References libMesh::ParallelObject::processor_id().
void libMesh::DofMap::enforce_adjoint_constraints_exactly | ( | NumericVector< Number > & | v, |
unsigned int | q | ||
) | const |
void libMesh::DofMap::enforce_constraints_exactly | ( | const System & | system, |
NumericVector< Number > * | v = nullptr , |
||
bool | homogeneous = false |
||
) | const |
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.
void libMesh::DofMap::enforce_constraints_on_jacobian | ( | const NonlinearImplicitSystem & | system, |
SparseMatrix< Number > * | jac | ||
) | const |
void libMesh::DofMap::enforce_constraints_on_residual | ( | const NonlinearImplicitSystem & | system, |
NumericVector< Number > * | rhs, | ||
NumericVector< Number > const * | solution, | ||
bool | homogeneous = true |
||
) | const |
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.
|
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.
dof_id_type libMesh::DofMap::first_dof | ( | const processor_id_type | proc | ) | const |
proc
. Definition at line 600 of file dof_map.h.
References _first_df.
dof_id_type libMesh::DofMap::first_dof | ( | ) | const |
Definition at line 603 of file dof_map.h.
References libMesh::ParallelObject::processor_id().
Referenced by local_index().
dof_id_type libMesh::DofMap::first_old_dof | ( | const processor_id_type | proc | ) | const |
proc
. Definition at line 610 of file dof_map.h.
References _first_old_df.
dof_id_type libMesh::DofMap::first_old_dof | ( | ) | const |
Definition at line 613 of file dof_map.h.
References libMesh::ParallelObject::processor_id().
void libMesh::DofMap::gather_constraints | ( | MeshBase & | mesh, |
std::set< dof_id_type > & | unexpanded_dofs, | ||
bool | look_for_constrainees | ||
) |
Helper function for querying about constraint equations on other processors.
If any id in requested_dof_ids
is constrained on another processor, its constraint will be added on this processor as well. If look_for_constrainees
is true, then constraints will also be returned if the id appears as a constraining value not just if it appears as a constrained value.
This function operates recursively: if the constraint for a constrained dof is newly added locally, then any other dofs which constrain it are queried to see if they are in turn constrained, and so on.
const DirichletBoundaries* libMesh::DofMap::get_adjoint_dirichlet_boundaries | ( | unsigned int | q | ) | const |
DirichletBoundaries* libMesh::DofMap::get_adjoint_dirichlet_boundaries | ( | unsigned int | q | ) |
const DirichletBoundaries* libMesh::DofMap::get_dirichlet_boundaries | ( | ) | const |
Definition at line 1231 of file dof_map.h.
References _dirichlet_boundaries.
DirichletBoundaries* libMesh::DofMap::get_dirichlet_boundaries | ( | ) |
Definition at line 1236 of file dof_map.h.
References _dirichlet_boundaries.
|
staticinherited |
Gets a string containing the reference information.
std::string libMesh::DofMap::get_info | ( | ) | const |
Gets summary info about the sparsity bandwidth and constraints.
std::string libMesh::DofMap::get_local_constraints | ( | bool | print_nonlocal = false | ) | const |
Gets a string reporting all DoF and Node constraints local to this processor.
If print_nonlocal
is true, then nonlocal constraints which are locally known are included.
const std::vector<dof_id_type>& libMesh::DofMap::get_n_nz | ( | ) | const |
_n_nz
list for this processor.The vector contains the bandwidth of the on-processor coupling for each row of the global matrix that the current processor owns. This information can be used to preallocate space for a parallel sparse matrix.
Definition at line 460 of file dof_map.h.
References _n_nz.
const std::vector<dof_id_type>& libMesh::DofMap::get_n_oz | ( | ) | const |
_n_oz
list for this processor.The vector contains the bandwidth of the off-processor coupling for each row of the global matrix that the current processor owns. This information can be used to preallocate space for a parallel sparse matrix.
Definition at line 473 of file dof_map.h.
References _n_oz.
PeriodicBoundaries* libMesh::DofMap::get_periodic_boundaries | ( | ) |
Definition at line 1193 of file dof_map.h.
References _periodic_boundaries.
DofConstraintValueMap & libMesh::DofMap::get_primal_constraint_values | ( | ) |
Definition at line 1882 of file dof_map.h.
References _primal_constraint_values.
const std::vector<dof_id_type>& libMesh::DofMap::get_send_list | ( | ) | const |
_send_list
for this processor.The _send_list
contains the global indices of all the variables in the global solution vector that influence the current processor. This information can be used for gathers at each solution step to retrieve solution values needed for computation.
Definition at line 451 of file dof_map.h.
References _send_list.
bool libMesh::DofMap::has_adjoint_dirichlet_boundaries | ( | unsigned int | q | ) | const |
bool libMesh::DofMap::has_blocked_representation | ( | ) | const |
true
if the variables are capable of being stored in a blocked form. Presently, this means that there can only be one variable group, and that the group has more than one variable. Definition at line 550 of file dof_map.h.
References n_variable_groups(), and n_variables().
Referenced by block_size().
Number libMesh::DofMap::has_heterogenous_adjoint_constraint | ( | const unsigned int | qoi_num, |
const dof_id_type | dof | ||
) | const |
dof
has a heterogenous constraint for adjoint solution qoi_num
, zero otherwise. Definition at line 1861 of file dof_map.h.
References _adjoint_constraint_values.
bool libMesh::DofMap::has_heterogenous_adjoint_constraints | ( | const unsigned int | qoi_num | ) | const |
true
if the system has any heterogenous constraints for adjoint solution qoi_num
, false
otherwise. Definition at line 1847 of file dof_map.h.
References _adjoint_constraint_values.
void libMesh::DofMap::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 |
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.
The heterogenous version of this method creates linear systems in which heterogenously constrained degrees of freedom will solve to their correct offset values, as would be appropriate for finding a solution to a linear problem in a single algebraic solve. The non-heterogenous version of this method creates linear systems in which even heterogenously constrained degrees of freedom are solved without offset values taken into account, as would be appropriate for finding linearized updates to a solution in which heterogenous constraints are already satisfied.
By default, the constraints for the primal solution of this system are used. If a non-negative qoi_index
is passed in, then the constraints for the corresponding adjoint solution are used instead.
void libMesh::DofMap::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 |
Constrains the element vector.
This method requires the element matrix to be square and not-yet-constrained, in which case the elem_dofs correspond to the global DOF indices of both the rows and columns of the element matrix.
The heterogenous version of this method creates linear systems in which heterogenously constrained degrees of freedom will solve to their correct offset values, as would be appropriate for finding a solution to a linear problem in a single algebraic solve. The non-heterogenous version of this method creates linear systems in which even heterogenously constrained degrees of freedom are solved without offset values taken into account, as would be appropriate for finding linearized updates to a solution in which heterogenous constraints are already satisfied.
By default, the constraints for the primal solution of this system are used. If a non-negative qoi_index
is passed in, then the constraints for the corresponding adjoint solution are used instead.
|
protectedinherited |
Increments the construction counter.
Should be called in the constructor of any derived class that will be reference counted.
Definition at line 181 of file reference_counter.h.
References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.
Referenced by libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().
|
protectedinherited |
Increments the destruction counter.
Should be called in the destructor of any derived class that will be reference counted.
Definition at line 194 of file reference_counter.h.
References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.
Referenced by libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().
|
private |
Invalidates all active DofObject dofs for this system.
bool libMesh::DofMap::is_attached | ( | SparseMatrix< Number > & | matrix | ) |
Matrices should not be attached more than once.
We can test for an already-attached matrix if necessary using is_attached
bool libMesh::DofMap::is_constrained_dof | ( | const dof_id_type | dof | ) | const |
true
if the degree of freedom dof is constrained, false
otherwise. Definition at line 1837 of file dof_map.h.
References _dof_constraints.
bool libMesh::DofMap::is_constrained_node | ( | const Node * | node | ) | const |
true
if the Node is constrained, false otherwise. Definition at line 1820 of file dof_map.h.
References _node_constraints.
bool libMesh::DofMap::is_evaluable | ( | const DofObjectSubclass & | obj, |
unsigned int | var_num = libMesh::invalid_uint |
||
) | const |
bool libMesh::DofMap::is_periodic_boundary | ( | const boundary_id_type | boundaryid | ) | const |
true
if the boundary given by boundaryid
is periodic, false otherwise dof_id_type libMesh::DofMap::last_dof | ( | const processor_id_type | proc | ) | const |
proc
.proc
has no local dof indices. Use end_dof() instead. Definition at line 625 of file dof_map.h.
References _end_df.
dof_id_type libMesh::DofMap::last_dof | ( | ) | const |
Definition at line 632 of file dof_map.h.
References libMesh::ParallelObject::processor_id().
bool libMesh::DofMap::local_index | ( | dof_id_type | dof_index | ) | const |
true
if degree of freedom index dof_index
is a local index. Definition at line 739 of file dof_map.h.
References end_dof(), and first_dof().
void libMesh::DofMap::local_variable_indices | ( | std::vector< dof_id_type > & | idx, |
const MeshBase & | mesh, | ||
unsigned int | var_num | ||
) | const |
Fills an array of those dof indices which belong to the given variable number and live on the current processor.
std::pair<Real, Real> libMesh::DofMap::max_constraint_error | ( | const System & | system, |
NumericVector< Number > * | v = nullptr |
||
) | const |
Tests the constrained degrees of freedom on the numeric vector v
, which represents a solution defined on the mesh, returning a pair whose first entry is the maximum absolute error on a constrained DoF and whose second entry is the maximum relative error.
Useful for debugging purposes.
If v
== nullptr, the system solution vector is tested.
|
staticprivate |
dof_id_type libMesh::DofMap::n_constrained_dofs | ( | ) | const |
dof_id_type libMesh::DofMap::n_constrained_nodes | ( | ) | const |
Definition at line 811 of file dof_map.h.
References _node_constraints.
dof_id_type libMesh::DofMap::n_dofs | ( | ) | const |
Definition at line 575 of file dof_map.h.
References _n_dfs.
dof_id_type libMesh::DofMap::n_dofs_on_processor | ( | const processor_id_type | proc | ) | const |
proc
. Definition at line 591 of file dof_map.h.
References _end_df, and _first_df.
Referenced by n_local_dofs().
dof_id_type libMesh::DofMap::n_local_constrained_dofs | ( | ) | const |
dof_id_type libMesh::DofMap::n_local_dofs | ( | ) | const |
Definition at line 585 of file dof_map.h.
References n_dofs_on_processor(), and libMesh::ParallelObject::processor_id().
|
staticinherited |
Prints the number of outstanding (created, but not yet destroyed) objects.
Definition at line 83 of file reference_counter.h.
References libMesh::ReferenceCounter::_n_objects.
dof_id_type libMesh::DofMap::n_old_dofs | ( | ) | const |
Definition at line 1279 of file dof_map.h.
References _n_old_dfs.
|
inherited |
Definition at line 95 of file parallel_object.h.
References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::size().
Referenced by libMesh::MeshBase::partition().
dof_id_type libMesh::DofMap::n_SCALAR_dofs | ( | ) | const |
Definition at line 580 of file dof_map.h.
References _n_SCALAR_dofs.
unsigned int libMesh::DofMap::n_variable_groups | ( | ) | const |
Definition at line 534 of file dof_map.h.
References _variable_groups.
Referenced by has_blocked_representation().
unsigned int libMesh::DofMap::n_variables | ( | ) | const |
Definition at line 542 of file dof_map.h.
References _variables.
Referenced by block_size(), and has_blocked_representation().
NodeConstraints::const_iterator libMesh::DofMap::node_constraint_rows_begin | ( | ) | const |
Definition at line 928 of file dof_map.h.
References _node_constraints.
NodeConstraints::const_iterator libMesh::DofMap::node_constraint_rows_end | ( | ) | const |
Definition at line 934 of file dof_map.h.
References _node_constraints.
|
private |
i
from the mesh
. void libMesh::DofMap::old_dof_indices | ( | const Elem *const | elem, |
std::vector< dof_id_type > & | di, | ||
const unsigned int | vn = libMesh::invalid_uint |
||
) | const |
After a mesh is refined and repartitioned it is possible that the _send_list
will need to be augmented.
This is the case when an element is refined and its children end up on different processors than the parent. These children will need values from the parent when projecting the solution onto the refined mesh, hence the parent's DOF indices need to be included in the _send_list
. Fills the vector di with the global degree of freedom indices for the element using the DofMap::old_dof_object
. If no variable number is specified then all variables are returned.
void libMesh::DofMap::prepare_send_list | ( | ) |
Takes the _send_list
vector (which may have duplicate entries) and sorts it.
The duplicate entries are then removed, resulting in a sorted _send_list
with unique entries. Also calls any user-provided methods for adding to the send list.
void libMesh::DofMap::print_dof_constraints | ( | std::ostream & | os = libMesh::out , |
bool | print_nonlocal = false |
||
) | const |
Prints (from processor 0) all DoF and Node constraints.
If print_nonlocal
is true, then each constraint is printed once for each processor that knows about it, which may be useful for DistributedMesh
debugging.
|
staticinherited |
Prints the reference information, by default to libMesh::out
.
void libMesh::DofMap::print_info | ( | std::ostream & | os = libMesh::out | ) | const |
Prints summary info about the sparsity bandwidth and constraints.
void libMesh::DofMap::process_constraints | ( | MeshBase & | ) |
Postprocesses any constrained degrees of freedom to be constrained only in terms of unconstrained dofs, then adds unconstrained dofs to the send_list and prepares that for use.
This should be run after both system (create_dof_constraints) and user constraints have all been added.
|
inherited |
Definition at line 101 of file parallel_object.h.
References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::rank().
Referenced by end_dof(), end_old_dof(), first_dof(), first_old_dof(), last_dof(), libMesh::MeshBase::n_active_local_elem(), n_local_dofs(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), and libMesh::MeshTools::weight().
void libMesh::DofMap::reinit | ( | MeshBase & | mesh | ) |
Reinitialize the underlying data structures conformal to the current mesh.
void libMesh::DofMap::remove_adjoint_dirichlet_boundary | ( | const DirichletBoundary & | dirichlet_boundary, |
unsigned int | q | ||
) |
Removes from the system the specified Dirichlet boundary for the adjoint equation defined by Quantity of interest index q.
void libMesh::DofMap::remove_algebraic_ghosting_functor | ( | GhostingFunctor & | evaluable_functor | ) |
Removes a functor which was previously added to the set of algebraic ghosting functors, from both this DofMap and from the underlying mesh.
void libMesh::DofMap::remove_coupling_functor | ( | GhostingFunctor & | coupling_functor | ) |
Removes a functor which was previously added to the set of coupling functors, from both this DofMap and from the underlying mesh.
void libMesh::DofMap::remove_default_ghosting | ( | ) |
Remove any default ghosting functor(s).
User-added ghosting functors will be unaffected.
Unless user-added equivalent ghosting functors exist, removing the default coupling functor is only safe for explicit solves, and removing the default algebraic ghosting functor is only safe for codes where no evaluations on neighbor cells (e.g. no jump error estimators) are done.
Defaults can be restored manually via add_default_ghosting(), or automatically if clear() returns the DofMap to a default state.
void libMesh::DofMap::remove_dirichlet_boundary | ( | const DirichletBoundary & | dirichlet_boundary | ) |
Removes the specified Dirichlet boundary from the system.
void libMesh::DofMap::SCALAR_dof_indices | ( | std::vector< dof_id_type > & | di, |
const unsigned int | vn, | ||
const bool | old_dofs = false |
||
) | const |
Fills the vector di
with the global degree of freedom indices corresponding to the SCALAR variable vn.
If old_dofs=true, the old SCALAR dof indices are returned.
void libMesh::DofMap::scatter_constraints | ( | MeshBase & | ) |
Sends constraint equations to constraining processors.
bool libMesh::DofMap::semilocal_index | ( | dof_id_type | dof_index | ) | const |
true
if degree of freedom index dof_index
is either a local index or in the send_list
.void libMesh::DofMap::set_error_on_cyclic_constraint | ( | bool | error_on_cyclic_constraint | ) |
Specify whether or not we perform an extra (opt-mode enabled) check for cyclic constraints.
If a cyclic constraint is present then the system constraints are not valid, so if error_on_cyclic_constraint
is true we will throw an error in this case.
void libMesh::DofMap::set_implicit_neighbor_dofs | ( | bool | implicit_neighbor_dofs | ) |
Allow the implicit_neighbor_dofs flag to be set programmatically.
This overrides the –implicit_neighbor_dofs commandline option. We can use this to set the implicit neighbor dofs option differently for different systems, whereas the commandline option is the same for all systems.
|
private |
Helper function for distributing dofs in parallel.
void libMesh::DofMap::stash_dof_constraints | ( | ) |
Definition at line 912 of file dof_map.h.
References _dof_constraints, and _stashed_dof_constraints.
unsigned int libMesh::DofMap::sys_number | ( | ) | const |
Definition at line 1752 of file dof_map.h.
References _sys_number.
void libMesh::DofMap::unstash_dof_constraints | ( | ) |
Definition at line 918 of file dof_map.h.
References _dof_constraints, and _stashed_dof_constraints.
bool libMesh::DofMap::use_coupled_neighbor_dofs | ( | const MeshBase & | mesh | ) | const |
Tells other library functions whether or not this problem includes coupling between dofs in neighboring cells, as can currently be specified on the command line or inferred from the use of all discontinuous variables.
const Variable & libMesh::DofMap::variable | ( | const unsigned int | c | ) | const |
c
. Definition at line 1770 of file dof_map.h.
References _variables.
Referenced by libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()().
const VariableGroup & libMesh::DofMap::variable_group | ( | const unsigned int | c | ) | const |
VariableGroup
description object for group g
. Definition at line 1760 of file dof_map.h.
References _variable_groups.
Order libMesh::DofMap::variable_group_order | ( | const unsigned int | vg | ) | const |
VariableGroup
vg
. Definition at line 1790 of file dof_map.h.
References _variable_groups.
const FEType & libMesh::DofMap::variable_group_type | ( | const unsigned int | vg | ) | const |
VariableGroup
vg
. Definition at line 1810 of file dof_map.h.
References _variable_groups.
Order libMesh::DofMap::variable_order | ( | const unsigned int | c | ) | const |
c
. Definition at line 1780 of file dof_map.h.
References _variables.
const FEType & libMesh::DofMap::variable_type | ( | const unsigned int | c | ) | const |
c
. Definition at line 1800 of file dof_map.h.
References _variables.
|
friend |
|
private |
Definition at line 1699 of file dof_map.h.
Referenced by has_heterogenous_adjoint_constraint(), and has_heterogenous_adjoint_constraints().
|
private |
|
private |
The list of all GhostingFunctor objects to be used when distributing ghosted vectors.
The library should automatically copy these functors to the MeshBase, too, so any algebraically ghosted dofs will live on geometrically ghosted elements.
Definition at line 1613 of file dof_map.h.
Referenced by algebraic_ghosting_functors_begin(), and algebraic_ghosting_functors_end().
|
private |
Function object to call to add extra entries to the send list.
Definition at line 1577 of file dof_map.h.
Referenced by attach_extra_send_list_object().
|
private |
Function object to call to add extra entries to the sparsity pattern.
Definition at line 1560 of file dof_map.h.
Referenced by attach_extra_sparsity_object().
|
protectedinherited |
Definition at line 107 of file parallel_object.h.
Referenced by libMesh::ParallelObject::comm(), libMesh::ParallelObject::n_processors(), libMesh::ParallelObject::operator=(), and libMesh::ParallelObject::processor_id().
|
staticprotectedinherited |
Actually holds the data.
Definition at line 122 of file reference_counter.h.
Referenced by libMesh::ReferenceCounter::increment_constructor_count(), and libMesh::ReferenceCounter::increment_destructor_count().
|
private |
The list of all GhostingFunctor objects to be used when coupling degrees of freedom in matrix sparsity patterns.
These objects will also be used as algebraic ghosting functors, but not vice-versa.
The library should automatically copy these functors to the MeshBase, too, so any dofs coupled to local dofs will live on geometrically ghosted elements.
Definition at line 1626 of file dof_map.h.
Referenced by coupling_functors_begin(), and coupling_functors_end().
|
private |
The default coupling GhostingFunctor, used to implement standard libMesh sparsity pattern construction.
We use a std::unique_ptr here to reduce header dependencies.
Definition at line 1595 of file dof_map.h.
Referenced by default_coupling().
|
private |
The default algebraic GhostingFunctor, used to implement standard libMesh send_list construction.
We use a std::unique_ptr here to reduce header dependencies.
Definition at line 1603 of file dof_map.h.
Referenced by default_algebraic_ghosting().
|
private |
Data structure containing Dirichlet functions.
The ith entry is the constraint matrix row for boundaryid i.
Definition at line 1729 of file dof_map.h.
Referenced by get_dirichlet_boundaries().
|
private |
Data structure containing DOF constraints.
The ith entry is the constraint matrix row for DOF i.
Definition at line 1695 of file dof_map.h.
Referenced by constraint_rows_begin(), constraint_rows_end(), is_constrained_dof(), stash_dof_constraints(), and unstash_dof_constraints().
CouplingMatrix* libMesh::DofMap::_dof_coupling |
Degree of freedom coupling.
If left empty each DOF couples to all others. Can be used to reduce memory requirements for sparse matrices. DOF 0 might only couple to itself, in which case dof_coupling(0,0)
should be 1 and dof_coupling(0,j)
= 0 for j not equal to 0.
This variable is named as though it were class private, but it is in the public interface. Also there are no public methods for accessing it... This typically means you should only use it if you know what you are doing.
|
staticprotectedinherited |
Flag to control whether reference count information is printed when print_info is called.
Definition at line 141 of file reference_counter.h.
|
private |
Last DOF index (plus 1) on processor p
.
Definition at line 1543 of file dof_map.h.
Referenced by dof_owner(), end_dof(), last_dof(), and n_dofs_on_processor().
|
private |
Last old DOF index (plus 1) on processor p
.
Definition at line 1680 of file dof_map.h.
Referenced by end_old_dof().
|
private |
|
private |
A pointer associated with the extra send list that can optionally be passed in.
Definition at line 1587 of file dof_map.h.
Referenced by attach_extra_send_list_function().
|
private |
A function pointer to a function to call to add extra entries to the send list.
Definition at line 1582 of file dof_map.h.
Referenced by attach_extra_send_list_function().
|
private |
A pointer associated with the extra sparsity that can optionally be passed in.
Definition at line 1572 of file dof_map.h.
Referenced by attach_extra_sparsity_function().
|
private |
A function pointer to a function to call to add extra entries to the sparsity pattern.
Definition at line 1565 of file dof_map.h.
Referenced by attach_extra_sparsity_function().
|
private |
First DOF index on processor p
.
Definition at line 1538 of file dof_map.h.
Referenced by first_dof(), and n_dofs_on_processor().
|
private |
First old DOF index on processor p
.
Definition at line 1675 of file dof_map.h.
Referenced by first_old_dof().
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprotectedinherited |
Mutual exclusion object to enable thread-safe reference counting.
Definition at line 135 of file reference_counter.h.
|
private |
|
private |
The number of on-processor nonzeros in my portion of the global matrix.
If need_full_sparsity_pattern is true, this will just be a pointer into the corresponding sparsity pattern vector. Otherwise we have to new/delete it ourselves.
Definition at line 1646 of file dof_map.h.
Referenced by get_n_nz().
|
staticprotectedinherited |
The number of objects.
Print the reference count information when the number returns to 0.
Definition at line 130 of file reference_counter.h.
Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().
|
private |
Total number of degrees of freedom on old dof objects.
Definition at line 1670 of file dof_map.h.
Referenced by n_old_dofs().
|
private |
The number of off-processor nonzeros in my portion of the global matrix; allocated similar to _n_nz.
Definition at line 1652 of file dof_map.h.
Referenced by get_n_oz().
|
private |
The total number of SCALAR dofs associated to all SCALAR variables.
Definition at line 1663 of file dof_map.h.
Referenced by n_SCALAR_dofs().
|
private |
Data structure containing DofObject constraints.
Definition at line 1706 of file dof_map.h.
Referenced by is_constrained_node(), n_constrained_nodes(), node_constraint_rows_begin(), and node_constraint_rows_end().
|
private |
Data structure containing periodic boundaries.
The ith entry is the constraint matrix row for boundaryid i.
Definition at line 1715 of file dof_map.h.
Referenced by get_periodic_boundaries().
|
private |
Definition at line 1697 of file dof_map.h.
Referenced by get_primal_constraint_values().
|
private |
A list containing all the global DOF indices that affect the solution on my processor.
Definition at line 1555 of file dof_map.h.
Referenced by get_send_list().
|
private |
|
private |
Definition at line 1695 of file dof_map.h.
Referenced by stash_dof_constraints(), and unstash_dof_constraints().
|
private |
The number of the system we manage DOFs for.
Definition at line 1521 of file dof_map.h.
Referenced by sys_number().
|
private |
|
private |
The finite element type for each variable group.
Definition at line 1511 of file dof_map.h.
Referenced by n_variable_groups(), variable_group(), variable_group_order(), and variable_group_type().
|
private |
The finite element type for each variable.
Definition at line 1506 of file dof_map.h.
Referenced by n_variables(), variable(), variable_order(), and variable_type().
|
private |