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-2018 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 
77  // Private Member Functions
78 
79  //- Disallow default bitwise copy construct
81 
82  //- Disallow default bitwise assignment
83  void operator=(const coordinateSystems&);
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("coordinateSystems");
90 
91  // Constructors
92 
93  //- Read construct from IOobject
94  explicit coordinateSystems(const IOobject&);
95 
96  //- Construct from IOobject and a PtrList
98  (
99  const IOobject&,
101  );
102 
103  //- Construct from IOobject and transferring the PtrList contents
105  (
106  const IOobject&,
108  );
109 
110 
111  // Selectors
112 
113  //- Return previously registered or read construct from "constant"
114  static const coordinateSystems& New(const objectRegistry&);
115 
116 
117  // Member Functions
118 
119  //- Find and return indices for all matches
120  labelList findIndices(const keyType& key) const;
121 
122  //- Find and return index for the first match, return -1 if not found
123  label findIndex(const keyType& key) const;
124 
125  //- Search for given key
126  bool found(const keyType& key) const;
127 
128  //- Return the table of contents (list of all keywords)
129  wordList toc() const;
130 
131  //- Write data
132  bool writeData(Ostream&) const;
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
A class for handling keywords in dictionaries.
Definition: keyType.H:64
A simple container for copying or transferring objects of type <T>.
Definition: Xfer.H:85
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.
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:53
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.