suanPan
FixedLength.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  ******************************************************************************/
32 #ifndef FIXEDLENGTH_H
33 #define FIXEDLENGTH_H
34 
35 #include "Constraint.h"
36 
37 class FixedLength : public Constraint {
38  vec coor;
39 
40 protected:
41  const bool min_bound = false, max_bound = false;
42  const double min_gap = 0., max_gap = 0.;
43 
44 public:
45  FixedLength(unsigned, unsigned, unsigned, uvec&&);
46 
47  int initialize(const shared_ptr<DomainBase>&) override;
48 
49  int process(const shared_ptr<DomainBase>&) override;
50 
51  void update_status(const vec&) override;
52  void commit_status() override;
53  void clear_status() override;
54  void reset_status() override;
55 };
56 
57 class MinimumGap final : public FixedLength {
58 public:
59  MinimumGap(unsigned, unsigned, unsigned, double, uvec&&);
60 };
61 
62 class MaximumGap final : public FixedLength {
63 public:
64  MaximumGap(unsigned, unsigned, unsigned, double, uvec&&);
65 };
66 
67 class Sleeve final : public FixedLength {
68 public:
69  Sleeve(unsigned, unsigned, unsigned, double, double, uvec&&);
70 };
71 
72 class MaxForce final : public FixedLength {
73  const double max_force;
74 
75  bool trial_flag = false;
76  bool current_flag = false;
77 
78 public:
79  MaxForce(unsigned, unsigned, unsigned, double, uvec&&);
80 
81  int process(const shared_ptr<DomainBase>&) override;
82 
83  void commit_status() override;
84  void clear_status() override;
85  void reset_status() override;
86 };
87 
88 #endif
89 
A Constraint class.
Definition: Constraint.h:36
A FixedLength class.
Definition: FixedLength.h:37
int initialize(const shared_ptr< DomainBase > &) override
Definition: FixedLength.cpp:26
const bool min_bound
Definition: FixedLength.h:41
const bool max_bound
Definition: FixedLength.h:41
void clear_status() override
Definition: FixedLength.cpp:90
void update_status(const vec &) override
Definition: FixedLength.cpp:83
FixedLength(unsigned, unsigned, unsigned, uvec &&)
Definition: FixedLength.cpp:23
void reset_status() override
Definition: FixedLength.cpp:95
const double max_gap
Definition: FixedLength.h:42
const double min_gap
Definition: FixedLength.h:42
int process(const shared_ptr< DomainBase > &) override
This method provides all necessary pieces of typical constraints/loads required, including additional...
Definition: FixedLength.cpp:39
void commit_status() override
Definition: FixedLength.cpp:85
Definition: FixedLength.h:72
int process(const shared_ptr< DomainBase > &) override
This method provides all necessary pieces of typical constraints/loads required, including additional...
Definition: FixedLength.cpp:124
void commit_status() override
Definition: FixedLength.cpp:146
void clear_status() override
Definition: FixedLength.cpp:151
void reset_status() override
Definition: FixedLength.cpp:156
MaxForce(unsigned, unsigned, unsigned, double, uvec &&)
Definition: FixedLength.cpp:120
Definition: FixedLength.h:62
MaximumGap(unsigned, unsigned, unsigned, double, uvec &&)
Definition: FixedLength.cpp:106
Definition: FixedLength.h:57
MinimumGap(unsigned, unsigned, unsigned, double, uvec &&)
Definition: FixedLength.cpp:100
Definition: FixedLength.h:67
Sleeve(unsigned, unsigned, unsigned, double, double, uvec &&)
Definition: FixedLength.cpp:112