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 
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 
68 inline const Foam::externalFileCoupler&
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 (
101  lumpedPointState& state
102 ) const
103 {
104  state.scalePoints(scaleInput_[scalingType::LENGTH]);
105 }
106 
107 
108 inline Foam::scalar Foam::lumpedPointMovement::relax() const
109 {
110  return relax_;
111 }
112 
113 
114 inline Foam::scalar& Foam::lumpedPointMovement::relax()
115 {
116  return relax_;
117 }
118 
119 
121 {
122  return inputName_;
123 }
124 
125 
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 
158 
160 {
161  return state0().degrees();
162 }
163 
164 
166 {
167  return !patchControls_.empty();
168 }
169 
170 
171 // ************************************************************************* //
Foam::lumpedPointMovement::coupler
const externalFileCoupler & coupler() const
Communication control.
Definition: lumpedPointMovementI.H:69
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::lumpedPointMovement::degrees
bool degrees() const
Rotation angles in degrees.
Definition: lumpedPointMovementI.H:159
Foam::lumpedPointState::inputFormatType
inputFormatType
Input format types.
Definition: lumpedPointState.H:119
Foam::lumpedPointMovement::origin
const point & origin() const
The offset for lumped points, used on input.
Definition: lumpedPointMovementI.H:93
Foam::lumpedPointMovement::inputName
const word & inputName() const
The input (state) file name.
Definition: lumpedPointMovementI.H:120
Foam::lumpedPointMovement::ownerId
label ownerId() const
An owner Id, if needed for bookkeeping purposes.
Definition: lumpedPointMovementI.H:40
Foam::lumpedPointMovement::rotationOrder
quaternion::eulerOrder rotationOrder() const
The Euler-angle rotation order.
Definition: lumpedPointMovementI.H:153
Foam::lumpedPointMovement::size
label size() const
The number of lumped points (number of locations)
Definition: lumpedPointMovementI.H:34
Foam::lumpedPointMovement::hasInterpolator
bool hasInterpolator(const pointPatch &fpatch) const
Check if patch control exists for specified patch.
Definition: lumpedPointMovement.C:347
Foam::lumpedPointMovement::outputFormat
lumpedPointMovement::outputFormatType outputFormat() const
The output (forces) file format.
Definition: lumpedPointMovementI.H:146
Foam::lumpedPointState
The state of lumped points corresponds to positions and rotations.
Definition: lumpedPointState.H:112
Foam::lumpedPointState::scalePoints
void scalePoints(const scalar scaleFactor)
Scale points by given factor.
Definition: lumpedPointState.C:236
Foam::lumpedPointMovement::state0
const lumpedPointState & state0() const
The initial state (positions/rotations)
Definition: lumpedPointMovementI.H:81
Foam::lumpedPointMovement::inputFormat
lumpedPointState::inputFormatType inputFormat() const
The input (state) file format.
Definition: lumpedPointMovementI.H:139
Foam::quaternion::eulerOrder
eulerOrder
Euler-angle rotation order.
Definition: quaternion.H:102
Foam::lumpedPointState::empty
bool empty() const
If no points were specified.
Definition: lumpedPointStateI.H:34
Foam::lumpedPointMovement::relax
scalar relax() const
The relaxation factor when changing states.
Definition: lumpedPointMovementI.H:108
Foam::lumpedPointMovement::state
const lumpedPointState & state() const
The current state (positions/rotations)
Definition: lumpedPointMovementI.H:87
Foam::lumpedPointMovement::logName
const word & logName() const
The log file name.
Definition: lumpedPointMovementI.H:132
Foam::externalFileCoupler
Encapsulates the logic for coordinating between OpenFOAM and an external application.
Definition: externalFileCoupler.H:107
Foam::lumpedPointMovement::outputName
const word & outputName() const
The output (forces) file name.
Definition: lumpedPointMovementI.H:126
Foam::lumpedPointMovement::empty
bool empty() const
If no number of lumped points (locations) were specified.
Definition: lumpedPointMovementI.H:28
Foam::lumpedPointMovement::outputFormatType
outputFormatType
Output format types.
Definition: lumpedPointMovement.H:276
Foam::lumpedPointMovement::hasPatchControl
bool hasPatchControl(const label patchIndex) const
Check if patch control exists for specified patch.
Definition: lumpedPointMovementI.H:53
Foam::Vector< scalar >
Foam::lumpedPointMovement::hasMapping
bool hasMapping() const
True if the pressure-zones mapping has already been performed.
Definition: lumpedPointMovementI.H:165
Foam::lumpedPointMovement::scalePoints
void scalePoints(lumpedPointState &state) const
Scale the lumped points (on input).
Definition: lumpedPointMovementI.H:100