suanPan
🧮 An Open Source, Parallel and Heterogeneous Finite Element Analysis Framework
Loading...
Searching...
No Matches
RigidWallPenalty.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2026 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 ******************************************************************************/
29#ifndef RIGIDWALLPENALTY_H
30#define RIGIDWALLPENALTY_H
31
32#include "Constraint.h"
33
35 static auto setup(const unsigned dimension) {
36 std::vector<Node::DOF> ref_dof;
37 if(dimension > 0u) ref_dof.emplace_back(Node::DOF::U1);
38 if(dimension > 1u) ref_dof.emplace_back(Node::DOF::U2);
39 if(dimension > 2u) ref_dof.emplace_back(Node::DOF::U3);
40 return ref_dof;
41 }
42
43protected:
44 const unsigned n_dim;
45
46 const double alpha;
47
48 const vec edge_a, edge_b;
49 const vec origin, outer_norm;
50 const double length_a = 0., length_b = 0.;
51
52public:
53 RigidWallPenalty(unsigned, unsigned, vec&&, vec&&, double, unsigned);
54 RigidWallPenalty(unsigned, unsigned, vec&&, vec&&, vec&&, double, unsigned);
55
56 int initialize(const shared_ptr<DomainBase>&) override;
57
58 int process(const shared_ptr<DomainBase>&) override;
59
60 void commit_status() override;
61 void clear_status() override;
62 void reset_status() override;
63};
64
66public:
67 RigidWallPenalty1D(unsigned, unsigned, double, double, double);
68};
69
71public:
72 RigidWallPenalty2D(unsigned, unsigned, vec2&&, vec2&&, double);
73 RigidWallPenalty2D(unsigned, unsigned, vec2&&, vec3&&, double);
74};
75
77public:
78 RigidWallPenalty3D(unsigned, unsigned, vec3&&, vec3&&, double);
79 RigidWallPenalty3D(unsigned, unsigned, vec3&&, vec3&&, vec3&&, double);
80};
81
82#endif
83
A Constraint class.
Definition Constraint.h:36
Definition RigidWallPenalty.h:65
Definition RigidWallPenalty.h:70
Definition RigidWallPenalty.h:76
A RigidWall class.
Definition RigidWallPenalty.h:34
const vec origin
Definition RigidWallPenalty.h:49
void clear_status() override
Definition RigidWallPenalty.cpp:82
const double alpha
Definition RigidWallPenalty.h:46
int initialize(const shared_ptr< DomainBase > &) override
Definition RigidWallPenalty.cpp:40
void reset_status() override
Definition RigidWallPenalty.cpp:84
const unsigned n_dim
Definition RigidWallPenalty.h:44
int process(const shared_ptr< DomainBase > &) override
Process and update both stiffness and resistance.
Definition RigidWallPenalty.cpp:46
const double length_b
Definition RigidWallPenalty.h:50
const vec edge_a
Definition RigidWallPenalty.h:48
void commit_status() override
Definition RigidWallPenalty.cpp:80
const double length_a
Definition RigidWallPenalty.h:50
const vec outer_norm
Definition RigidWallPenalty.h:49
const vec edge_b
Definition RigidWallPenalty.h:48