MAST
kinematic_coupling.h
Go to the documentation of this file.
1 /*
2  * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3  * Copyright (C) 2013-2019 Manav Bhatia
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #ifndef __mast__kinematic_coupling_h__
21 #define __mast__kinematic_coupling_h__
22 
23 
24 // C++ includes
25 #include <set>
26 #include <map>
27 
28 // MAST includes
29 #include "base/dof_coupling_base.h"
30 
31 // libMesh includes
32 #include "libmesh/node.h"
33 
34 namespace MAST {
35 
36  // Forward declerations
37  class KinematicCouplingConstraint;
38  class MeshCouplingBase;
39 
46  public MAST::DoFCouplingBase {
47 
48  public:
49 
51 
52  virtual ~KinematicCoupling();
53 
61  void
62  add_master_and_slave(const std::set<const libMesh::Node*>& master,
63  const libMesh::Node& slave,
64  bool constrain_rotations);
65 
66 
70  void
72  (const std::vector<std::pair<const libMesh::Node*, std::set<const libMesh::Node*>>>& couplings,
73  bool constrain_rotations);
74 
75 
81 
86  virtual void
87  get_constraint_rows(std::vector<std::tuple<libMesh::dof_id_type, libMesh::DofConstraintRow, Real>>& constrs);
88 
89 
90  protected:
91 
93 
94  std::map<const libMesh::Node*, const MAST::KinematicCouplingConstraint*> _slave_node_constraints;
95  };
96 }
97 
98 #endif // __mast__kinematic_coupling_h__
std::map< const libMesh::Node *, const MAST::KinematicCouplingConstraint * > _slave_node_constraints
void add_dof_constraints_to_dof_map()
initializes the dof constraint rows in the DofMap object associated with the system.
void add_master_and_slave(const std::set< const libMesh::Node * > &master, const libMesh::Node &slave, bool constrain_rotations)
Constrain the slave node to the specified set of master nodes.
This provides a base class to couple degrees-of-freedom within a single system.
virtual void get_constraint_rows(std::vector< std::tuple< libMesh::dof_id_type, libMesh::DofConstraintRow, Real >> &constrs)
Provides the vector of constraints and right-hand-side value pairs to be added to the system...
This constrains the slave nodes to be kinematically constrained to the master node.
KinematicCoupling(MAST::SystemInitialization &sys_init)