suanPan
Contact3D.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2024 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 CONTACT3D_H
32#define CONTACT3D_H
33
34#include <Element/Element.h>
35#include <array>
36
37class Contact3D final : public Element {
38 struct SlaveNode {
39 weak_ptr<Node> node;
40 uvec local_span;
41 vec position;
42 };
43
44 struct MasterNode {
45 weak_ptr<Node> node;
46 uvec local_span;
47 vec position;
48 vec outer_norm;
49 };
50
51 struct MasterFacet {
52 std::array<MasterNode, 3> node;
53 vec facet_outer_norm;
54 double facet_area;
55 };
56
57 static constexpr unsigned c_dof = 3;
58
59 const unsigned master_tag, slave_tag;
60
61 std::vector<MasterFacet> master;
62 std::vector<SlaveNode> slave;
63
64 const double alpha;
65
66 void update_position();
67 void check_contact(const MasterFacet&, const SlaveNode&);
68
69public:
70 Contact3D(unsigned, unsigned, unsigned, double = 1E8);
71
72 int initialize(const shared_ptr<DomainBase>&) override;
73
74 int update_status() override;
75
76 int clear_status() override;
77 int commit_status() override;
78 int reset_status() override;
79};
80
81#endif
82
A Contact3D class.
Definition: Contact3D.h:37
Contact3D(unsigned, unsigned, unsigned, double=1E8)
Definition: Contact3D.cpp:142
int reset_status() override
Definition: Contact3D.cpp:210
int clear_status() override
Definition: Contact3D.cpp:196
int update_status() override
Definition: Contact3D.cpp:182
int initialize(const shared_ptr< DomainBase > &) override
Definition: Contact3D.cpp:148
int commit_status() override
Definition: Contact3D.cpp:204
A Element class.
Definition: Element.h:117