suanPan
Constraint.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 CONSTRAINT_H
32#define CONSTRAINT_H
33
35
37protected:
38 static double multiplier;
39
40 unsigned num_size; // size of multiplier
41
42 vec trial_lambda = zeros(num_size);
44
45 sp_vec resistance;
46 sp_mat stiffness;
47
51
52 friend void set_constraint_multiplier(double);
53
54public:
56 unsigned, // tag
57 unsigned, // step tag
58 unsigned, // amplitude tag
59 uvec&&, // node tags
60 uvec&&, // dof tags
61 unsigned // size of multiplier
62 );
63 Constraint(const Constraint&) = delete; // copy forbidden
64 Constraint(Constraint&&) = delete; // move forbidden
65 Constraint& operator=(const Constraint&) = delete; // assign forbidden
66 Constraint& operator=(Constraint&&) = delete; // assign forbidden
67
68 ~Constraint() override = default;
69
70 const sp_vec& get_resistance() const;
71 const sp_mat& get_stiffness() const;
72
73 const vec& get_auxiliary_resistance() const;
74 const vec& get_auxiliary_load() const;
75 const sp_mat& get_auxiliary_stiffness() const;
76
77 void set_multiplier_size(unsigned);
78 [[nodiscard]] unsigned get_multiplier_size() const;
79};
80
81void set_constraint_multiplier(double);
82
83#endif
84
A ConditionalModifier class.
Definition: ConditionalModifier.h:41
A Constraint class.
Definition: Constraint.h:36
unsigned get_multiplier_size() const
Definition: Constraint.cpp:48
const sp_mat & get_stiffness() const
Definition: Constraint.cpp:32
Constraint(unsigned, unsigned, unsigned, uvec &&, uvec &&, unsigned)
Definition: Constraint.cpp:22
~Constraint() override=default
const sp_vec & get_resistance() const
Definition: Constraint.cpp:26
Constraint & operator=(const Constraint &)=delete
const sp_mat & get_auxiliary_stiffness() const
Definition: Constraint.cpp:30
sp_mat stiffness
Definition: Constraint.h:46
const vec & get_auxiliary_load() const
Definition: Constraint.cpp:34
sp_vec resistance
Definition: Constraint.h:45
vec current_lambda
Definition: Constraint.h:43
Constraint(Constraint &&)=delete
friend void set_constraint_multiplier(double)
Definition: Constraint.cpp:50
Constraint(const Constraint &)=delete
Constraint & operator=(Constraint &&)=delete
unsigned num_size
Definition: Constraint.h:40
vec trial_lambda
Definition: Constraint.h:42
const vec & get_auxiliary_resistance() const
Definition: Constraint.cpp:28
sp_mat auxiliary_stiffness
Definition: Constraint.h:50
vec auxiliary_load
Definition: Constraint.h:49
void set_multiplier_size(unsigned)
At the beginning of each sub-step, it is assumed that constraints are not active (constraining condit...
Definition: Constraint.cpp:42
static double multiplier
Definition: Constraint.h:38
vec auxiliary_resistance
Definition: Constraint.h:48
void set_constraint_multiplier(double)
Definition: Constraint.cpp:50