Line data Source code
1 : // The libMesh Finite Element Library. 2 : // Copyright (C) 2002-2026 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 3 : 4 : // This library is free software; you can redistribute it and/or 5 : // modify it under the terms of the GNU Lesser General Public 6 : // License as published by the Free Software Foundation; either 7 : // version 2.1 of the License, or (at your option) any later version. 8 : 9 : // This library is distributed in the hope that it will be useful, 10 : // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 : // Lesser General Public License for more details. 13 : 14 : // You should have received a copy of the GNU Lesser General Public 15 : // License along with this library; if not, write to the Free Software 16 : // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 : 18 : #ifndef LIBMESH_CONSTRAINT_ELIMINATION_DOF_MAP_H 19 : #define LIBMESH_CONSTRAINT_ELIMINATION_DOF_MAP_H 20 : 21 : #include "libmesh/reduced_dof_map.h" 22 : 23 : namespace libMesh 24 : { 25 : 26 : /** 27 : * The reduced space of the unconstrained degrees of freedom of a \p DofMap. 28 : * 29 : * Every \p DofMap constraint is affine: the full solution is \f$ x = C y + h \f$, where \f$ y \f$ 30 : * holds the unconstrained degrees of freedom, \f$ C \f$ is the identity on them and holds the 31 : * constraint coefficients on constrained rows, and \f$ h \f$ holds the constraint values. The 32 : * reduced residual and Jacobian are \f$ C^T F(C y + h) \f$ and \f$ C^T J C \f$. Element matrices 33 : * and vectors constrained with \p DofMap::constrain_element_matrix() and its relatives are \f$ C^T 34 : * K C \f$ and \f$ C^T F \f$ on their unconstrained rows and columns, so dropping their constrained 35 : * rows and columns at insertion assembles the reduced system exactly. 36 : */ 37 56 : class ConstraintEliminationDofMap : public ReducedDofMap 38 : { 39 : public: 40 : ConstraintEliminationDofMap(MeshBase & mesh, System & system, const DofMap & dof_map); 41 : virtual ~ConstraintEliminationDofMap(); 42 : 43 : /** 44 : * Unconstrained degrees of freedom are retained 45 : */ 46 : virtual bool retain_field_dof(const Elem & elem, 47 : unsigned int node_num, 48 : unsigned int var_num, 49 : dof_id_type field_dof) const override; 50 : 51 : /** 52 : * Unconstrained degrees of freedom are retained 53 : */ 54 : virtual bool retain_scalar_dof(dof_id_type scalar_dof) const override; 55 : 56 : private: 57 : bool is_unconstrained(dof_id_type dof) const; 58 : }; 59 : 60 : } 61 : 62 : #endif // LIBMESH_CONSTRAINT_ELIMINATION_DOF_MAP_H