lumpedPointMovementI.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) 2017-2020 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 \*---------------------------------------------------------------------------*/
26 
27 
28 inline bool Foam::lumpedPointMovement::empty() const
29 {
30  return state0_.empty();
31 }
32 
33 
34 inline Foam::label Foam::lumpedPointMovement::size() const
35 {
36  return state0_.size();
37 }
38 
39 
40 inline Foam::label Foam::lumpedPointMovement::ownerId() const
41 {
42  return ownerId_;
43 }
44 
45 
47 {
48  ownerId_ = id;
49 }
50 
51 
52 inline bool
53 Foam::lumpedPointMovement::hasPatchControl(const label patchIndex) const
54 {
55  return patchControls_.found(patchIndex);
56 }
57 
58 
59 inline bool
60 Foam::lumpedPointMovement::hasInterpolator(const label patchIndex) const
61 {
62  const auto iter = patchControls_.cfind(patchIndex);
63 
64  return (iter.good() && iter().interp_.size());
65 }
66 
67 
70 {
71  return coupler_;
72 }
73 
74 
76 {
77  return coupler_;
78 }
79 
80 
82 {
83  return state0_;
84 }
85 
86 
88 {
89  return state_;
90 }
91 
92 
94 {
95  return origin_;
96 }
97 
98 
100 (
102 ) const
103 {
104  state.scalePoints(scaleInput_[scalingType::LENGTH]);
105 }
106 
108 inline Foam::scalar Foam::lumpedPointMovement::relax() const
109 {
110  return relax_;
111 }
112 
114 inline Foam::scalar& Foam::lumpedPointMovement::relax()
115 {
116  return relax_;
117 }
118 
121 {
122  return inputName_;
123 }
124 
127 {
128  return outputName_;
129 }
130 
131 
133 {
134  return logName_;
135 }
136 
137 
140 {
141  return inputFormat_;
142 }
143 
144 
147 {
148  return outputFormat_;
149 }
150 
151 
154 {
155  return state0().rotationOrder();
156 }
157 
159 inline bool Foam::lumpedPointMovement::degrees() const
160 {
161  return state0().degrees();
162 }
163 
164 
165 inline bool Foam::lumpedPointMovement::hasMapping() const
166 {
167  return !patchControls_.empty();
168 }
169 
170 
171 // ************************************************************************* //
const word & inputName() const
The input (state) file name.
Encapsulates the logic for coordinating between OpenFOAM and an external application.
const word & outputName() const
The output (forces) file name.
inputFormatType
Input format types.
bool hasMapping() const
True if the pressure-zones mapping has already been performed.
quaternion::eulerOrder rotationOrder() const
The Euler-angle rotation order.
void scalePoints(lumpedPointState &state) const
Scale the lumped points (on input).
lumpedPointMovement::outputFormatType outputFormat() const
The output (forces) file format.
label ownerId() const
An owner Id, if needed for bookkeeping purposes.
lumpedPointState::inputFormatType inputFormat() const
The input (state) file format.
bool degrees() const
Rotation angles in degrees.
const word & logName() const
The log file name.
A class for handling words, derived from Foam::string.
Definition: word.H:63
const externalFileCoupler & coupler() const
Communication control.
bool hasInterpolator(const pointPatch &fpatch) const
Check if patch control exists for specified patch.
outputFormatType
Output format types.
scalar relax() const
The relaxation factor when changing states.
eulerOrder
Euler-angle rotation order.
Definition: quaternion.H:115
bool empty() const
If no number of lumped points (locations) were specified.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
void scalePoints(const scalar scaleFactor)
Scale points by given factor.
const lumpedPointState & state() const
The current state (positions/rotations)
const point & origin() const
The offset for lumped points, used on input.
const lumpedPointState & state0() const
The initial state (positions/rotations)
bool empty() const
If no points were specified.
bool hasPatchControl(const label patchIndex) const
Check if patch control exists for specified patch.
label size() const
The number of lumped points (number of locations)
The state of lumped points corresponds to positions and rotations.