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