suanPan
Contact2D.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (C) 2017-2022 Theodore Chang
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program 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
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  ******************************************************************************/
31 #ifndef CONTACT2D_H
32 #define CONTACT2D_H
33 
34 #include <Element/Element.h>
35 
36 class Contact2D final : public Element {
37  struct MasterNode {
38  weak_ptr<Node> node;
39  vec position;
40  vec axis;
41  vec norm;
42  };
43 
44  struct SlaveNode {
45  weak_ptr<Node> node;
46  vec position;
47  };
48 
49  static constexpr unsigned c_dof = 2;
50 
51  static const mat rotation;
52 
53  const unsigned master_tag, slave_tag;
54 
55  std::vector<MasterNode> master;
56  std::vector<SlaveNode> slave;
57 
58  const double alpha;
59 
60  void update_position();
61 
62 public:
63  Contact2D(unsigned, unsigned, unsigned, double = 1E8);
64 
65  int initialize(const shared_ptr<DomainBase>&) override;
66 
67  int update_status() override;
68 
69  int clear_status() override;
70  int commit_status() override;
71  int reset_status() override;
72 };
73 
74 #endif
75 
A Contact2D class.
Definition: Contact2D.h:36
int clear_status() override
Definition: Contact2D.cpp:116
int initialize(const shared_ptr< DomainBase > &) override
Definition: Contact2D.cpp:52
int commit_status() override
Definition: Contact2D.cpp:124
Contact2D(unsigned, unsigned, unsigned, double=1E8)
Definition: Contact2D.cpp:46
int update_status() override
Definition: Contact2D.cpp:66
int reset_status() override
Definition: Contact2D.cpp:130
A Element class.
Definition: Element.h:92
double norm(const vec &)
Definition: tensorToolbox.cpp:302