suanPan
Loading...
Searching...
No Matches
Constraint.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2025 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, // amplitude tag
58 uvec&&, // node tags
59 uvec&&, // dof tags
60 unsigned // size of multiplier
61 );
62
63 const sp_vec& get_resistance() const;
64 const sp_mat& get_stiffness() const;
65
66 const vec& get_auxiliary_resistance() const;
67 const vec& get_auxiliary_load() const;
68 const sp_mat& get_auxiliary_stiffness() const;
69
70 void set_multiplier_size(unsigned);
71 [[nodiscard]] unsigned get_multiplier_size() const;
72};
73
74void set_constraint_multiplier(double);
75
76#endif
77
A ConditionalModifier class.
Definition ConditionalModifier.h:42
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
const sp_vec & get_resistance() const
Definition Constraint.cpp:26
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
friend void set_constraint_multiplier(double)
Definition Constraint.cpp:50
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