coordinateSystems.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 | Copyright (C) 2011-2015 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  //- Find and return index for the first match, returns -1 if not found
126  // \deprecated use findIndex() instead (deprecated Jul 2010)
127  label find(const keyType& key) const;
128 
129  //- Search for given key
130  bool found(const keyType& key) const;
131 
132  //- Return the table of contents (list of all keywords)
133  wordList toc() const;
134 
135  //- Write data
136  bool writeData(Ostream&) const;
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
Foam::coordinateSystems::find
label find(const keyType &key) const
Find and return index for the first match, returns -1 if not found.
Definition: coordinateSystems.C:101
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::coordinateSystems::findIndex
label findIndex(const keyType &key) const
Find and return index for the first match, return -1 if not found.
Definition: coordinateSystems.C:132
Foam::coordinateSystems::coordinateSystems
coordinateSystems(const coordinateSystems &)
Disallow default bitwise copy construct.
Foam::IOPtrList
A PtrList of objects of type <T> with automated input and output.
Definition: IOPtrList.H:50
Foam::coordinateSystems::TypeName
TypeName("coordinateSystems")
Runtime type information.
Foam::coordinateSystems::toc
wordList toc() const
Return the table of contents (list of all keywords)
Definition: coordinateSystems.C:164
coordinateSystem.H
Foam::Xfer
A simple container for copying or transferring objects of type <T>.
Definition: Xfer.H:85
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:50
Foam::keyType
A class for handling keywords in dictionaries.
Definition: keyType.H:56
Foam::label
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
IOPtrList.H
Foam::PtrList< coordinateSystem >
Foam::coordinateSystems
Provides a centralized coordinateSystem collection.
Definition: coordinateSystems.H:71
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::coordinateSystems::writeData
bool writeData(Ostream &) const
Write data.
Definition: coordinateSystems.C:177
Foam::coordinateSystems::operator=
void operator=(const coordinateSystems &)
Disallow default bitwise assignment.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::coordinateSystems::New
static const coordinateSystems & New(const objectRegistry &)
Return previously registered or read construct from "constant".
Definition: coordinateSystems.C:71
Foam::coordinateSystems::found
bool found(const keyType &key) const
Search for given key.
Definition: coordinateSystems.C:158
Foam::coordinateSystems::findIndices
labelList findIndices(const keyType &key) const
Find and return indices for all matches.
Definition: coordinateSystems.C:107