Go to the documentation of this file.
   20 #ifndef LIBMESH_DOF_MAP_H 
   21 #define LIBMESH_DOF_MAP_H 
   24 #include "libmesh/libmesh_common.h" 
   25 #include "libmesh/reference_counted_object.h" 
   26 #include "libmesh/libmesh.h"  
   27 #include "libmesh/variable.h" 
   28 #include "libmesh/threads.h" 
   29 #include "libmesh/threads_allocators.h" 
   30 #include "libmesh/elem_range.h" 
   31 #include "libmesh/ghosting_functor.h" 
   32 #include "libmesh/sparsity_pattern.h" 
   33 #include "libmesh/parallel_object.h" 
   34 #include "libmesh/point.h" 
   36 #ifdef LIBMESH_FORWARD_DECLARE_ENUMS 
   42 #include "libmesh/enum_order.h" 
   59 class DefaultCoupling;
 
   60 class DirichletBoundary;
 
   61 class DirichletBoundaries;
 
   67 class PeriodicBoundaryBase;
 
   68 class PeriodicBoundaries;
 
   70 class NonlinearImplicitSystem;
 
   82 #if defined(LIBMESH_ENABLE_AMR) ||              \ 
   83   defined(LIBMESH_ENABLE_PERIODIC) ||           \ 
   84   defined(LIBMESH_ENABLE_DIRICHLET) 
   85 #  define LIBMESH_ENABLE_CONSTRAINTS 1 
   91 #ifdef LIBMESH_ENABLE_CONSTRAINTS 
   96                  std::less<dof_id_type>,
 
  107                                        std::less<dof_id_type>,
 
  108                                        Threads::scalable_allocator<std::pair<const dof_id_type, DofConstraintRow>>>
 
  118     public std::map<dof_id_type, Number,
 
  119                     std::less<dof_id_type>,
 
  120                     Threads::scalable_allocator<std::pair<const dof_id_type, Number>>>
 
  129     public std::map<unsigned int, DofConstraintValueMap,
 
  130                     std::less<unsigned int>,
 
  131                     Threads::scalable_allocator
 
  132                     <std::pair<const unsigned int, DofConstraintValueMap>>>
 
  136 #ifdef LIBMESH_ENABLE_NODE_CONSTRAINTS 
  143 typedef std::map<
const Node *, 
Real,
 
  144                  std::less<const Node *>,
 
  154                                         std::pair<NodeConstraintRow,Point>,
 
  155                                         std::less<const Node *>,
 
  156                                         Threads::scalable_allocator<std::pair<const Node * const, std::pair<NodeConstraintRow,Point>>>>
 
  159 #endif // LIBMESH_ENABLE_NODE_CONSTRAINTS 
  161 #endif // LIBMESH_ENABLE_CONSTRAINTS 
  208                                            std::vector<dof_id_type> & n_nz,
 
  209                                            std::vector<dof_id_type> & n_oz) = 0;
 
  305                             bool to_mesh = 
true);
 
  367                                       bool to_mesh = 
true);
 
  431                                                    std::vector<dof_id_type> & n_nz,
 
  432                                                    std::vector<dof_id_type> & n_oz,
 
  434                                       void * context = 
nullptr)
 
  454                                        void * context = 
nullptr)
 
  593   { 
return cast_int<unsigned int>(
_variables.size()); }
 
  643     libmesh_assert_less (proc, 
_first_df.size());
 
  656 #ifdef LIBMESH_ENABLE_AMR 
  666 #endif //LIBMESH_ENABLE_AMR 
  674 #ifdef LIBMESH_ENABLE_DEPRECATED 
  677     libmesh_deprecated();
 
  678     libmesh_assert_less (proc, 
_end_df.size());
 
  679     return cast_int<dof_id_type>(
_end_df[proc] - 1);
 
  693   { libmesh_assert_less (proc, 
_end_df.size()); 
return _end_df[proc]; }
 
  702   { std::vector<dof_id_type>::const_iterator ub =
 
  705     return cast_int<processor_id_type>(ub - 
_end_df.begin());
 
  708 #ifdef LIBMESH_ENABLE_AMR 
  721 #endif //LIBMESH_ENABLE_AMR 
  728                     std::vector<dof_id_type> & di) 
const;
 
  736                     std::vector<dof_id_type> & di,
 
  737                     const unsigned int vn,
 
  738                     int p_level = -12345) 
const;
 
  745                     std::vector<dof_id_type> & di) 
const;
 
  752                     std::vector<dof_id_type> & di,
 
  753                     const unsigned int vn) 
const;
 
  763                     std::vector<dof_id_type> & di,
 
  764                     const unsigned int vn) 
const;
 
  766 #ifdef LIBMESH_ENABLE_AMR 
  776                         std::vector<dof_id_type> & di,
 
  777                         const unsigned int vn) 
const;
 
  779 #endif // LIBMESH_ENABLE_AMR 
  790                            const unsigned int vn,
 
  791                            const bool old_dofs=
false) 
const;
 
  816   { 
return (dof_index >= this->
first_dof()) && (dof_index < this->
end_dof()); }
 
  823   template <
typename DofObjectSub
class>
 
  864                               unsigned int var_num) 
const;
 
  866 #ifdef LIBMESH_ENABLE_CONSTRAINTS 
  882 #ifdef LIBMESH_ENABLE_NODE_CONSTRAINTS 
  889 #endif // LIBMESH_ENABLE_NODE_CONSTRAINTS 
  922                            std::set<dof_id_type> & unexpanded_dofs,
 
  923                            bool look_for_constrainees);
 
  957                            const Number constraint_rhs,
 
  958                            const bool forbid_constraint_overwrite);
 
  973                                    const Number constraint_rhs,
 
  974                                    const bool forbid_constraint_overwrite);
 
  983                            const bool forbid_constraint_overwrite = 
true)
 
 1027 #ifdef LIBMESH_ENABLE_NODE_CONSTRAINTS 
 1039 #endif // LIBMESH_ENABLE_NODE_CONSTRAINTS 
 1080                              bool print_nonlocal=
false) 
const;
 
 1101 #endif // LIBMESH_ENABLE_CONSTRAINTS 
 1124                                  std::vector<dof_id_type> & elem_dofs,
 
 1125                                  bool asymmetric_constraint_rows = 
true) 
const;
 
 1134                                  std::vector<dof_id_type> & row_dofs,
 
 1135                                  std::vector<dof_id_type> & col_dofs,
 
 1136                                  bool asymmetric_constraint_rows = 
true) 
const;
 
 1142                                  std::vector<dof_id_type> & dofs,
 
 1143                                  bool asymmetric_constraint_rows = 
true) 
const;
 
 1155                                             std::vector<dof_id_type> & elem_dofs,
 
 1156                                             bool asymmetric_constraint_rows = 
true) 
const;
 
 1183                                                            std::vector<dof_id_type> & elem_dofs,
 
 1184                                                            bool asymmetric_constraint_rows = 
true,
 
 1185                                                            int qoi_index = -1) 
const;
 
 1210                                                 std::vector<dof_id_type> & elem_dofs,
 
 1211                                                 bool asymmetric_constraint_rows = 
true,
 
 1212                                                 int qoi_index = -1) 
const;
 
 1226                                       std::vector<dof_id_type> & row_dofs,
 
 1227                                       bool asymmetric_constraint_rows = 
true) 
const;
 
 1252                                     bool homogeneous = 
false) 
const;
 
 1261                                             unsigned int q) 
const;
 
 1266                                         bool homogeneous = 
true) 
const;
 
 1271 #ifdef LIBMESH_ENABLE_PERIODIC 
 1300 #endif // LIBMESH_ENABLE_PERIODIC 
 1303 #ifdef LIBMESH_ENABLE_DIRICHLET 
 1351 #endif // LIBMESH_ENABLE_DIRICHLET 
 1354 #ifdef LIBMESH_ENABLE_AMR 
 1369 #ifdef LIBMESH_ENABLE_AMR 
 1378                         std::vector<dof_id_type> & di,
 
 1386 #endif // LIBMESH_ENABLE_AMR 
 1398 #endif // LIBMESH_ENABLE_AMR 
 1455                      std::vector<dof_id_type> & di,
 
 1456                      const unsigned int vg,
 
 1457                      const unsigned int vig,
 
 1458                      const Node * 
const * nodes,
 
 1462                      const unsigned int v,
 
 1463                      std::size_t & tot_size
 
 1474                           std::vector<dof_id_type> & di,
 
 1475                           const unsigned int vn) 
const;
 
 1506   template<
typename iterator_type>
 
 1508                                 iterator_type objects_end,
 
 1543                                std::set<CouplingMatrix *> & temporary_coupling_matrices,
 
 1544                                const std::set<GhostingFunctor *>::iterator & gf_begin,
 
 1545                                const std::set<GhostingFunctor *>::iterator & gf_end,
 
 1556 #ifdef LIBMESH_ENABLE_CONSTRAINTS 
 1569                                 std::vector<dof_id_type> & elem_dofs,
 
 1570                                 const bool called_recursively=
false) 
const;
 
 1589                                            std::vector<dof_id_type> & elem_dofs,
 
 1591                                            const bool called_recursively=
false) 
const;
 
 1612 #endif // LIBMESH_ENABLE_CONSTRAINTS 
 1684                                    std::vector<dof_id_type> & n_nz,
 
 1685                                    std::vector<dof_id_type> & n_oz,
 
 1762   std::unique_ptr<SparsityPattern::Build> 
_sp;
 
 1789 #ifdef LIBMESH_ENABLE_AMR 
 1814 #ifdef LIBMESH_ENABLE_CONSTRAINTS 
 1826 #ifdef LIBMESH_ENABLE_NODE_CONSTRAINTS 
 1831 #endif // LIBMESH_ENABLE_NODE_CONSTRAINTS 
 1834 #ifdef LIBMESH_ENABLE_PERIODIC 
 1842 #ifdef LIBMESH_ENABLE_DIRICHLET 
 1942 #ifdef LIBMESH_ENABLE_CONSTRAINTS 
 1947 #ifdef LIBMESH_ENABLE_NODE_CONSTRAINTS
 
 1952 #ifdef LIBMESH_ENABLE_NODE_CONSTRAINTS 
 1974   AdjointDofConstraintValues::const_iterator it =
 
 1978   if (it->second.empty())
 
 1989   AdjointDofConstraintValues::const_iterator it =
 
 1993       DofConstraintValueMap::const_iterator rhsit =
 
 1994         it->second.find(dof);
 
 1995       if (rhsit == it->second.end())
 
 1998         return rhsit->second;
 
 2022                                               std::vector<dof_id_type> &,
 
 2026                                               std::vector<dof_id_type> &,
 
 2027                                               std::vector<dof_id_type> &,
 
 2031                                               std::vector<dof_id_type> &,
 
 2036                                                          std::vector<dof_id_type> &,
 
 2041    std::vector<dof_id_type> &, 
bool, 
int) 
const {}
 
 2045    std::vector<dof_id_type> &, 
bool, 
int) 
const {}
 
 2049                                                    std::vector<dof_id_type> &,
 
 2059                                                          unsigned int)
 const {}
 
 2072 #endif // LIBMESH_ENABLE_CONSTRAINTS 
 2076 #endif // LIBMESH_DOF_MAP_H 
  
AdjointDofConstraintValues _adjoint_constraint_values
 
The constraint matrix storage format.
 
dof_id_type last_dof(const processor_id_type proc) const
 
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.
 
Manages consistently variables, degrees of freedom, and coefficient vectors.
 
DofConstraintValueMap _primal_constraint_values
 
void add_algebraic_ghosting_functor(std::shared_ptr< GhostingFunctor > evaluable_functor, bool to_mesh=true)
Adds a functor which can specify algebraic ghosting requirements for use with distributed vectors.
 
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.
 
void compute_sparsity(const MeshBase &)
Computes the sparsity pattern for the matrices corresponding to proc_id and sends that data to Linear...
 
DofObject * elem_ptr(MeshBase &mesh, dof_id_type i) const
 
void swap_dof_constraints()
Similar to the stash/unstash_dof_constraints() API, but swaps _dof_constraints and _stashed_dof_const...
 
We're using a class instead of a typedef to allow forward declarations and future flexibility.
 
void add_variable_group(const VariableGroup &var_group)
 
bool is_evaluable(const DofObjectSubclass &obj, unsigned int var_num=libMesh::invalid_uint) const
 
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
 
bool is_attached(SparseMatrix< Number > &matrix)
Matrices should not be attached more than once.
 
dof_id_type n_old_dofs() const
 
DofObject *(DofMap::* dofobject_accessor)(MeshBase &mesh, dof_id_type i) const
A member function type like node_ptr() or elem_ptr().
 
void attach_extra_send_list_object(DofMap::AugmentSendList &asl)
Attach an object to populate the send_list with extra entries.
 
MeshBase & _mesh
The mesh that system uses.
 
virtual ~AugmentSendList()
 
DofConstraints _stashed_dof_constraints
 
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.
 
void prepare_send_list()
Takes the _send_list vector (which may have duplicate entries) and sorts it.
 
std::unique_ptr< DefaultCoupling > _default_coupling
The default coupling GhostingFunctor, used to implement standard libMesh sparsity pattern constructio...
 
void stash_dof_constraints()
 
const DirichletBoundaries * get_adjoint_dirichlet_boundaries(unsigned int q) const
 
const DirichletBoundaries * get_dirichlet_boundaries() 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.
 
dof_id_type n_constrained_dofs() const
 
std::unique_ptr< PeriodicBoundaries > _periodic_boundaries
Data structure containing periodic boundaries.
 
void print_dof_constraints(std::ostream &os=libMesh::out, bool print_nonlocal=false) const
Prints (from processor 0) all DoF and Node constraints.
 
NodeConstraints _node_constraints
Data structure containing DofObject constraints.
 
void constrain_element_vector(DenseVector< Number > &rhs, std::vector< dof_id_type > &dofs, bool asymmetric_constraint_rows=true) const
Constrains the element vector.
 
void add_dirichlet_boundary(const DirichletBoundary &dirichlet_boundary)
Adds a copy of the specified Dirichlet boundary to the system.
 
std::vector< dof_id_type > _first_old_df
First old DOF index on processor p.
 
dof_id_type n_local_dofs() const
 
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 ...
 
dof_id_type n_dofs() const
 
const std::vector< dof_id_type > & get_n_oz() const
 
bool has_heterogenous_adjoint_constraints(const unsigned int qoi_num) const
 
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 ...
 
std::vector< dof_id_type > _first_old_scalar_df
First old DOF index for SCALAR variable v, or garbage for non-SCALAR variable v.
 
Scalable allocator to be used in multithreaded code chunks which allocate a lot of dynamic memory.
 
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.
 
bool need_full_sparsity_pattern
Default false; set to true if any attached matrix requires a full sparsity pattern.
 
bool has_adjoint_dirichlet_boundaries(unsigned int q) const
 
bool is_constrained_node(const Node *node) const
 
std::string get_info() const
Gets summary info about the sparsity bandwidth and constraints.
 
std::unique_ptr< SparsityPattern::Build > build_sparsity(const MeshBase &mesh) const
Builds a sparsity pattern.
 
const unsigned int _sys_number
The number of the system we manage DOFs for.
 
DofConstraintValueMap & get_primal_constraint_values()
 
This class implements reference counting.
 
dof_id_type end_dof() const
 
The base class for defining periodic boundaries.
 
PeriodicBoundaries * get_periodic_boundaries()
 
The libMesh namespace provides an interface to certain functionality in the library.
 
void attach_extra_sparsity_object(DofMap::AugmentSparsityPattern &asp)
Attach an object to use to populate the sparsity pattern with extra entries.
 
std::vector< dof_id_type > * _n_nz
The number of on-processor nonzeros in my portion of the global matrix.
 
DofMap(const unsigned int sys_number, MeshBase &mesh)
Constructor.
 
std::vector< dof_id_type > _end_old_df
Last old DOF index (plus 1) on processor p.
 
void remove_coupling_functor(GhostingFunctor &coupling_functor)
Removes a functor which was previously added to the set of coupling functors, from both this DofMap a...
 
dof_id_type n_constrained_nodes() const
 
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.
 
bool use_coupled_neighbor_dofs(const MeshBase &mesh) const
Tells other library functions whether or not this problem includes coupling between dofs in neighbori...
 
virtual ~AugmentSparsityPattern()
 
bool semilocal_index(dof_id_type dof_index) const
 
void set_error_on_cyclic_constraint(bool error_on_cyclic_constraint)
Specify whether or not we perform an extra (opt-mode enabled) check for constraint loops.
 
std::set< GhostingFunctor * >::const_iterator coupling_functors_begin() const
Beginning of range of coupling functors.
 
void clear_send_list()
Clears the _send_list vector.
 
Defines a dense matrix for use in Finite Element-type computations.
 
unsigned int n_variables() const
 
dof_id_type _n_SCALAR_dofs
The total number of SCALAR dofs associated to all SCALAR variables.
 
std::unordered_map< const Elem *, const CouplingMatrix * > map_type
What elements do we care about and what variables do we care about on each element?
 
Defines an abstract dense vector base class for use in Finite Element-type computations.
 
void process_constraints(MeshBase &)
Postprocesses any constrained degrees of freedom to be constrained only in terms of unconstrained dof...
 
DofConstraints _dof_constraints
Data structure containing DOF constraints.
 
std::vector< DirichletBoundaries * > _adjoint_dirichlet_boundaries
Data structure containing Dirichlet functions.
 
dof_id_type end_old_dof(const processor_id_type proc) const
 
DefaultCoupling & default_coupling()
Default coupling functor.
 
dof_id_type first_dof(const processor_id_type proc) const
 
std::vector< unsigned int > _variable_group_numbers
The variable group number for each variable.
 
std::vector< dof_id_type > _first_scalar_df
First DOF index for SCALAR variable v, or garbage for non-SCALAR variable v.
 
unsigned int n_variable_groups() const
 
void invalidate_dofs(MeshBase &mesh) const
Invalidates all active DofObject dofs for this system.
 
Number has_heterogenous_adjoint_constraint(const unsigned int qoi_num, const dof_id_type dof) const
 
bool is_constrained_dof(const dof_id_type dof) const
 
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and non-linear solv...
 
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
 
std::string get_local_constraints(bool print_nonlocal=false) const
Gets a string reporting all DoF and Node constraints local to this processor.
 
We're using a class instead of a typedef to allow forward declarations and future flexibility.
 
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.
 
std::vector< dof_id_type > _send_list
A list containing all the global DOF indices that affect the solution on my processor.
 
std::vector< dof_id_type > _first_df
First DOF index on processor p.
 
void check_for_cyclic_constraints()
Throw an error if we detect any constraint loops, i.e.
 
void old_dof_indices(const Elem &elem, unsigned int n, std::vector< dof_id_type > &di, const unsigned int vn) const
Appends to the vector di the old global degree of freedom indices for elem.node_ref(n),...
 
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.
 
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
 
void set_error_on_constraint_loop(bool error_on_constraint_loop)
 
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 m...
 
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.
 
void add_default_ghosting()
Add the default functor(s) for coupling and algebraic ghosting.
 
void reinit(MeshBase &mesh)
Reinitialize the underlying data structures conformal to the current mesh.
 
const FEType & variable_group_type(const unsigned int vg) const
 
This helper class can be called on multiple threads to compute the sparsity pattern (or graph) of the...
 
void distribute_dofs(MeshBase &)
Distribute dofs on the current mesh.
 
Order variable_order(const unsigned int c) const
 
This is the MeshBase class.
 
void enforce_constraints_on_residual(const NonlinearImplicitSystem &system, NumericVector< Number > *rhs, NumericVector< Number > const *solution, bool homogeneous=true) const
 
void check_for_constraint_loops()
 
virtual void augment_sparsity_pattern(SparsityPattern::Graph &sparsity, std::vector< dof_id_type > &n_nz, std::vector< dof_id_type > &n_oz)=0
User-defined function to augment the sparsity pattern.
 
Storage for DofConstraint right hand sides for a particular problem.
 
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...
 
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'.
 
unsigned int sys_number() const
 
DofConstraints::const_iterator constraint_rows_end() const
 
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 funct...
 
This abstract base class defines the interface by which library code and user code can report associa...
 
AugmentSparsityPattern * _augment_sparsity_pattern
Function object to call to add extra entries to the sparsity pattern.
 
void set_implicit_neighbor_dofs(bool implicit_neighbor_dofs)
Allow the implicit_neighbor_dofs flag to be set programmatically.
 
void * _extra_sparsity_context
A pointer associated with the extra sparsity that can optionally be passed in.
 
const Variable & variable(const unsigned int c) const
 
void clear()
Free all new memory associated with the object, but restore its original state, with the mesh pointer...
 
processor_id_type processor_id() const
 
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.
 
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...
 
dof_id_type _n_dfs
Total number of degrees of freedom.
 
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...
 
This class defines the notion of a variable in the system.
 
uint8_t processor_id_type
 
void scatter_constraints(MeshBase &)
Sends constraint equations to constraining processors.
 
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.
 
void unstash_dof_constraints()
 
dof_id_type _n_old_dfs
Total number of degrees of freedom on old dof objects.
 
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.
 
const std::vector< dof_id_type > & get_n_nz() const
 
void find_connected_dofs(std::vector< dof_id_type > &elem_dofs) const
Finds all the DOFS associated with the element DOFs elem_dofs.
 
A Node is like a Point, but with more information.
 
NodeConstraints::const_iterator node_constraint_rows_begin() const
 
std::set< GhostingFunctor * > _coupling_functors
The list of all GhostingFunctor objects to be used when coupling degrees of freedom in matrix sparsit...
 
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 ...
 
DirichletBoundaries * get_dirichlet_boundaries()
 
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 t...
 
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...
 
const FEType & variable_type(const unsigned int c) const
 
void print_info(std::ostream &os=libMesh::out) const
Prints summary info about the sparsity bandwidth and constraints.
 
Abstract base class to be used to add user-defined parallel degree of freedom couplings.
 
const dof_id_type n_nodes
 
dof_id_type end_old_dof() const
 
std::set< GhostingFunctor * >::const_iterator algebraic_ghosting_functors_end() const
End of range of algebraic ghosting functors.
 
void add_constraints_to_send_list()
Adds entries to the _send_list vector corresponding to DoFs which are dependencies for constraint equ...
 
const std::vector< dof_id_type > & get_send_list() const
 
void add_periodic_boundary(const PeriodicBoundaryBase &periodic_boundary)
Adds a copy of the specified periodic boundary to the system.
 
std::set< GhostingFunctor * >::const_iterator algebraic_ghosting_functors_begin() const
Beginning of range of algebraic ghosting functors.
 
The definition of the const_element_iterator struct.
 
void add_coupling_functor(std::shared_ptr< GhostingFunctor > coupling_functor, bool to_mesh=true)
Adds a functor which can specify coupling requirements for creation of sparse matrices.
 
bool has_blocked_representation() const
 
AugmentSendList * _augment_send_list
Function object to call to add extra entries to the send list.
 
void create_dof_constraints(const MeshBase &, Real time=0)
Rebuilds the raw degree of freedom and DofObject constraints.
 
std::vector< VariableGroup > _variable_groups
The finite element type for each variable group.
 
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.
 
void allgather_recursive_constraints(MeshBase &)
Gathers constraint equation dependencies from other processors.
 
void reinit_send_list(MeshBase &mesh)
Clears the _send_list vector and then rebuilds it.
 
This class implements the default algebraic coupling in libMesh: elements couple to themselves,...
 
void remove_algebraic_ghosting_functor(GhostingFunctor &evaluable_functor)
Removes a functor which was previously added to the set of algebraic ghosting functors,...
 
dof_id_type n_dofs_on_processor(const processor_id_type proc) const
 
std::vector< SparseMatrix< Number > * > _matrices
Additional matrices handled by this object.
 
std::unique_ptr< DirichletBoundaries > _dirichlet_boundaries
Data structure containing Dirichlet functions.
 
void find_connected_dof_objects(std::vector< const DofObject * > &objs) const
Finds all the DofObjects associated with the set in objs.
 
void constrain_element_matrix(DenseMatrix< Number > &matrix, std::vector< dof_id_type > &elem_dofs, bool asymmetric_constraint_rows=true) const
Constrains the element matrix.
 
void attach_matrix(SparseMatrix< Number > &matrix)
Additional matrices may be handled with this DofMap.
 
bool local_index(dof_id_type dof_index) const
 
void remove_default_ghosting()
Remove any default ghosting functor(s).
 
void remove_dirichlet_boundary(const DirichletBoundary &dirichlet_boundary)
Removes the specified Dirichlet boundary from the system.
 
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 d...
 
The Node constraint storage format.
 
std::set< GhostingFunctor * >::const_iterator coupling_functors_end() const
End of range of coupling functors.
 
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
 
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...
 
std::set< GhostingFunctor * > _algebraic_ghosting_functors
The list of all GhostingFunctor objects to be used when distributing ghosted vectors.
 
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.
 
This class handles the numbering of degrees of freedom on a mesh.
 
bool all_semilocal_indices(const std::vector< dof_id_type > &dof_indices) const
 
void clear_sparsity()
Clears the sparsity pattern.
 
std::vector< dof_id_type > _end_df
Last DOF index (plus 1) on processor p.
 
This class allows one to associate Dirichlet boundary values with a given set of mesh boundary ids an...
 
dof_id_type last_dof() const
 
void enforce_constraints_on_jacobian(const NonlinearImplicitSystem &system, SparseMatrix< Number > *jac) const
 
std::map< GhostingFunctor *, std::shared_ptr< GhostingFunctor > > _shared_functors
Hang on to references to any GhostingFunctor objects we were passed in shared_ptr form.
 
Storage for DofConstraint right hand sides for all adjoint problems.
 
This is the base class from which all geometric element types are derived.
 
DofObject * node_ptr(MeshBase &mesh, dof_id_type i) const
 
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.
 
dof_id_type n_local_constrained_dofs() const
 
virtual void augment_send_list(std::vector< dof_id_type > &send_list)=0
User-defined function to augment the send list.
 
bool is_periodic_boundary(const boundary_id_type boundaryid) const
 
DefaultCoupling & default_algebraic_ghosting()
Default algebraic ghosting functor.
 
std::unique_ptr< DefaultCoupling > _default_evaluating
The default algebraic GhostingFunctor, used to implement standard libMesh send_list construction.
 
bool _implicit_neighbor_dofs
 
CouplingMatrix * _dof_coupling
Degree of freedom coupling.
 
This class defines a coupling matrix.
 
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
 
dof_id_type n_SCALAR_dofs() const
 
An object whose state is distributed along a set of processors.
 
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 ...
 
bool _error_on_constraint_loop
This flag indicates whether or not we do an opt-mode check for the presence of constraint loops,...
 
processor_id_type dof_owner(const dof_id_type dof) const
 
std::vector< Variable > _variables
The finite element type for each variable.
 
This class defines a logically grouped set of variables in the system.
 
unsigned int block_size() const
 
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,...
 
dof_id_type first_dof() const
 
dof_id_type first_old_dof(const processor_id_type proc) const
 
Order variable_group_order(const unsigned int vg) const
 
std::map< dof_id_type, Real, std::less< dof_id_type >, Threads::scalable_allocator< std::pair< const dof_id_type, Real > > > DofConstraintRow
A row of the Dof constraint matrix.
 
NodeConstraints::const_iterator node_constraint_rows_end() const
 
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.
 
dof_id_type first_old_dof() const
 
void ErrorVector unsigned int
 
Abstract base class to be used to add user-defined implicit degree of freedom couplings.
 
std::unique_ptr< SparsityPattern::Build > _sp
The sparsity pattern of the global matrix, kept around if it might be needed by future additions of t...
 
bool _implicit_neighbor_dofs_initialized
Bools to indicate if we override the –implicit_neighbor_dofs commandline options.
 
Defines a dense vector for use in Finite Element-type computations.
 
void _node_dof_indices(const Elem &elem, unsigned int n, const DofObject &obj, std::vector< dof_id_type > &di, const unsigned int vn) const
Helper function that implements the element-nodal versions of dof_indices and old_dof_indices.
 
void * _extra_send_list_context
A pointer associated with the extra send list that can optionally be passed in.
 
const VariableGroup & variable_group(const unsigned int c) const
 
DofConstraints::const_iterator constraint_rows_begin() const
 
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.
 
dof_id_type end_dof(const processor_id_type proc) const
 
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)
 
std::map< const Node *, Real, std::less< const Node * >, Threads::scalable_allocator< std::pair< const Node *const, Real > > > NodeConstraintRow
A row of the Node constraint mapping.
 
void add_neighbors_to_send_list(MeshBase &mesh)
Adds entries to the _send_list vector corresponding to DoFs on elements neighboring the current proce...
 
void add_coupling_functor(GhostingFunctor &coupling_functor, bool to_mesh=true)
Adds a functor which can specify coupling requirements for creation of sparse matrices.