coordinateSystems.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::coordinateSystems
26 
27 Description
28  Provides a centralized coordinateSystem collection.
29 
30 Note
31  Mixing normal constructors and the coordinateSystems::New constructor
32  may yield unexpected results.
33 
34  \verbatim
35  1
36  (
37  cat1
38  {
39  coordinateSystem system_10;
40  porosity 0.781;
41  Darcy
42  {
43  d d [0 -2 0 0 0] (-1000 -1000 0.50753e+08);
44  f f [0 -1 0 0 0] (-1000 -1000 12.83);
45  }
46  }
47  )
48  \endverbatim
49 
50  For this to work correctly, the coordinateSystem constructor must be
51  supplied with both a dictionary and an objectRegistry.
52 
53 SourceFiles
54  coordinateSystems.C
55 
56 \*---------------------------------------------------------------------------*/
57 #ifndef coordinateSystems_H
58 #define coordinateSystems_H
59 
60 #include "coordinateSystem.H"
61 #include "IOPtrList.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 
68 /*---------------------------------------------------------------------------*\
69  Class coordinateSystems Declaration
70 \*---------------------------------------------------------------------------*/
71 
73 :
74  public IOPtrList<coordinateSystem>
75 {
76 public:
77 
78  //- Runtime type information
79  TypeName("coordinateSystems");
80 
81  // Constructors
82 
83  //- Read construct from IOobject
84  explicit coordinateSystems(const IOobject&);
85 
86  //- Construct from IOobject and a PtrList
88  (
89  const IOobject&,
91  );
92 
93  //- Construct from IOobject and transferring the PtrList contents
95  (
96  const IOobject&,
98  );
99 
100  //- Disallow default bitwise copy construction
101  coordinateSystems(const coordinateSystems&) = delete;
102 
103 
104  // Selectors
105 
106  //- Return previously registered or read construct from "constant"
107  static const coordinateSystems& New(const objectRegistry&);
108 
109 
110  // Member Functions
111 
112  //- Find and return indices for all matches
113  labelList findIndices(const keyType& key) const;
114 
115  //- Find and return index for the first match, return -1 if not found
116  label findIndex(const keyType& key) const;
117 
118  //- Search for given key
119  bool found(const keyType& key) const;
120 
121  //- Return the table of contents (list of all keywords)
122  wordList toc() const;
123 
124  //- Write data
125  bool writeData(Ostream&) const;
126 
127 
128  // Member Operators
129 
130  //- Disallow default bitwise assignment
131  void operator=(const coordinateSystems&) = delete;
132 };
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
A class for handling keywords in dictionaries.
Definition: keyType.H:66
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Provides a centralized coordinateSystem collection.
coordinateSystems(const IOobject &)
Read construct from IOobject.
void operator=(const coordinateSystems &)=delete
Disallow default bitwise assignment.
labelList findIndices(const keyType &key) const
Find and return indices for all matches.
TypeName("coordinateSystems")
Runtime type information.
bool found(const keyType &key) const
Search for given key.
label findIndex(const keyType &key) const
Find and return index for the first match, return -1 if not found.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
wordList toc() const
Return the table of contents (list of all keywords)
static const coordinateSystems & New(const objectRegistry &)
Return previously registered or read construct from "constant".
A PtrList of objects of type <T> with automated input and output.
Definition: IOPtrList.H:50
Registry of regIOobjects.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
Namespace for OpenFOAM.
bool writeData(Ostream &) const
Write data.