pointConstraint.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::pointConstraint
26 
27 Description
28  Accumulates point constraints through successive applications of the
29  applyConstraint function.
30 
31  After all the constraints have been entered the resulting
32  transformation tensor is returned by the constraintTransformation
33  function.
34 
35 SourceFiles
36  pointConstraintI.H
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef pointConstraint_H
41 #define pointConstraint_H
42 
43 #include "label.H"
44 #include "vector.H"
45 #include "Tuple2.H"
46 #include "transform.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class pointConstraint Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class pointConstraint
58 :
59  public Tuple2<label, vector>
60 {
61 
62 public:
63 
64  // Constructors
65 
66  //- Construct null
67  inline pointConstraint();
68 
69  //- Construct from components
71 
72  //- Construct from Istream
73  inline pointConstraint(Istream&);
74 
75 
76  // Member Functions
77 
78  //- Apply and accumulate the effect of the given constraint direction
79  inline void applyConstraint(const vector& cd);
80 
81  //- Combine constraints
82  inline void combine(const pointConstraint&);
83 
84  //- Return the accumulated constraint transformation tensor
85  inline tensor constraintTransformation() const;
86 
87  //- Return the accumulated unconstrained directions. Directions
88  // coded as first n rows of tensor.
89  inline void unconstrainedDirections(label& n, tensor& vecs) const;
90 
91  //- Constrain a displacement
92  inline vector constrainDisplacement(const vector& disp) const;
93 };
94 
95 
96 //- Reduce operator
98 {
99 public:
100  inline void operator()(pointConstraint&, const pointConstraint&) const;
101 };
102 
103 //- Transformation function
104 inline pointConstraint transform(const tensor& tt, const pointConstraint& v);
105 
106 //- contiguous
107 template<class T> bool contiguous();
108 template<>
109 inline bool contiguous<pointConstraint>() {return true;}
110 
111 
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #include "pointConstraintI.H"
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
label n
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
A 2-tuple for storing two objects of different types.
Definition: Tuple2.H:66
void operator()(pointConstraint &, const pointConstraint &) const
Accumulates point constraints through successive applications of the applyConstraint function.
void combine(const pointConstraint &)
Combine constraints.
void applyConstraint(const vector &cd)
Apply and accumulate the effect of the given constraint direction.
pointConstraint()
Construct null.
tensor constraintTransformation() const
Return the accumulated constraint transformation tensor.
void unconstrainedDirections(label &n, tensor &vecs) const
Return the accumulated unconstrained directions. Directions.
vector constrainDisplacement(const vector &disp) const
Constrain a displacement.
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
bool contiguous< pointConstraint >()
bool contiguous()
contiguous
Definition: contiguous.H:53
dimensionSet transform(const dimensionSet &)
Definition: dimensionSet.C:504
3D tensor transformation operations.