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 -------------------------------------------------------------------------------
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 Class
27  Foam::lumpedPointController
28 
29 Description
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 
39 Note
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 
43 SourceFiles
44  lumpedPointController.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef lumpedPointController_H
49 #define lumpedPointController_H
50 
51 #include "List.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 // Forward Declarations
59 class dictionary;
60 template<class T> class Map;
61 
62 /*---------------------------------------------------------------------------*\
63  Class lumpedPointController Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 class lumpedPointController
67 {
68  // Private Data
69 
70  //- The lumped points associated with the controller
71  labelList pointLabels_;
72 
73 
74 public:
75 
76  // Constructors
77 
78  //- Default construct
79  lumpedPointController() noexcept;
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 
101 
102  // Member Functions
103 
104  //- No controller points specified?
105  bool empty() const
106  {
107  return pointLabels_.empty();
108  }
109 
110  //- Number of controller points specified
111  label size() const
112  {
113  return pointLabels_.size();
114  }
115 
116  //- The controller points
117  const labelList& pointLabels() const
118  {
119  return pointLabels_;
120  }
121 
122  //- Check point mapping (the count) or remap the point labels
123  void remapPointLabels
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 // ************************************************************************* //
Foam::autoPtr::New
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
Foam::lumpedPointController::remapPointLabels
void remapPointLabels(const label nPoints, const Map< label > &originalIds)
Check point mapping (the count) or remap the point labels.
Definition: lumpedPointController.C:71
List.H
Foam::lumpedPointController::lumpedPointController
lumpedPointController() noexcept
Default construct.
Definition: lumpedPointController.C:35
Foam::Map
A HashTable to objects of type <T> with a label key.
Definition: lumpedPointController.H:69
Foam::lumpedPointController::size
label size() const
Number of controller points specified.
Definition: lumpedPointController.H:120
Foam::lumpedPointController
Simple connectivity of point labels to specify a controller for lumped point movement.
Definition: lumpedPointController.H:75
Foam::lumpedPointController::New
static autoPtr< lumpedPointController > New(const dictionary &dict)
Factory method.
Definition: lumpedPointController.H:101
nPoints
label nPoints
Definition: gmvOutputHeader.H:2
Foam::lumpedPointController::~lumpedPointController
~lumpedPointController()=default
Destructor.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::lumpedPointController::pointLabels
const labelList & pointLabels() const
The controller points.
Definition: lumpedPointController.H:126
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::List< label >
Foam::UList< label >
Foam::lumpedPointController::empty
bool empty() const
No controller points specified?
Definition: lumpedPointController.H:114