lumpedPointController.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) 2019-2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::lumpedPointController
28
29Description
30 Simple connectivity of point labels to specify a controller for lumped
31 point movement.
32
33 \heading Dictionary parameters
34 \table
35 Property | Description | Required | Default
36 pointLabels | List of point labels | yes |
37 \endtable
38
39Note
40 If the calling program itself specified a point-label mapping
41 (eg, original ids from FEA), these can be used initially and remapped.
42
43SourceFiles
44 lumpedPointController.C
45
46\*---------------------------------------------------------------------------*/
47
48#ifndef lumpedPointController_H
49#define lumpedPointController_H
50
51#include "List.H"
52
53// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54
55namespace Foam
56{
57
58// Forward Declarations
59class dictionary;
60template<class T> class Map;
61
62/*---------------------------------------------------------------------------*\
63 Class lumpedPointController Declaration
64\*---------------------------------------------------------------------------*/
65
66class lumpedPointController
67{
68 // Private Data
69
70 //- The lumped points associated with the controller
71 labelList pointLabels_;
72
73
74public:
76 // Constructors
77
78 //- Default construct
80
81 //- Copy construct from point ids
83
84 //- Move construct from point ids
86
87 //- Construct from dictionary
88 explicit lumpedPointController(const dictionary& dict);
89
90
91 //- Factory method
93 {
95 }
96
97
98 //- Destructor
99 ~lumpedPointController() = default;
100
102 // Member Functions
103
104 //- No controller points specified?
105 bool empty() const
106 {
107 return pointLabels_.empty();
109
110 //- Number of controller points specified
111 label size() const
112 {
113 return pointLabels_.size();
115
116 //- The controller points
117 const labelList& pointLabels() const
118 {
119 return pointLabels_;
121
122 //- Check point mapping (the count) or remap the point labels
124 (
125 const label nPoints,
126 const Map<label>& originalIds
127 );
128};
129
130
131// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132
133} // End namespace Foam
134
135// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136
137#endif
138
139// ************************************************************************* //
A HashTable to objects of type <T> with a label key.
Definition: Map.H:60
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
Definition: UListI.H:427
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Simple connectivity of point labels to specify a controller for lumped point movement.
const labelList & pointLabels() const
The controller points.
~lumpedPointController()=default
Destructor.
void remapPointLabels(const label nPoints, const Map< label > &originalIds)
Check point mapping (the count) or remap the point labels.
lumpedPointController() noexcept
Default construct.
bool empty() const
No controller points specified?
label size() const
Number of controller points specified.
static autoPtr< lumpedPointController > New(const dictionary &dict)
Factory method.
label nPoints
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: List.H:66
const direction noexcept
Definition: Scalar.H:223
dictionary dict