surfaceReader.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) 2015 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::surfaceReader
28
29Description
30 Base class for surface readers
31
32SourceFiles
33 surfaceReader.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef surfaceReader_H
38#define surfaceReader_H
39
40#include "typeInfo.H"
41#include "autoPtr.H"
42#include "MeshedSurfaces.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class surfaceReader Declaration
52\*---------------------------------------------------------------------------*/
54class surfaceReader
55{
56protected:
57
58 //- File name
60
61
62public:
63
64 //- Runtime type information
65 TypeName("surfaceReader");
66
67 // Declare run-time constructor selection table
70 (
71 autoPtr,
74 (
75 const fileName& fName
76 ),
77 (fName)
78 );
79
80
81 // Selectors
82
83 //- Return a reference to the selected surfaceReader
85 (
86 const word& readType,
87 const fileName& fName
88 );
89
90
91 // Constructors
92
93 //- Construct from fileName
94 surfaceReader(const fileName& fName);
95
96
97 //- Destructor
98 virtual ~surfaceReader() = default;
99
100
101 // Member Functions
102
103 //- Return a reference to the surface geometry
104 virtual const meshedSurface& geometry(const label timeIndex) = 0;
105
106 //- Return a list of the available times
107 virtual instantList times() const = 0;
108
109 //- Return a list of the available fields at a given time
110 virtual wordList fieldNames(const label timeIndex) const = 0;
111
112 //- Return a scalar field at a given time
113 virtual tmp<Field<scalar>> field
114 (
115 const label timeIndex,
116 const label fieldIndex,
117 const scalar& refValue = pTraits<scalar>::zero
118 ) const = 0;
119
120 //- Return a vector field at a given time
121 virtual tmp<Field<vector>> field
122 (
123 const label timeIndex,
124 const label fieldIndex,
125 const vector& refValue = pTraits<vector>::zero
126 ) const = 0;
127
128 //- Return a sphericalTensor field at a given time
130 (
131 const label timeIndex,
132 const label fieldIndex,
134 ) const = 0;
135
136 //- Return a symmTensor field at a given time
138 (
139 const label timeIndex,
140 const label fieldIndex,
141 const symmTensor& refValue = pTraits<symmTensor>::zero
142 ) const = 0;
143
144 //- Return a tensor field at a given time
145 virtual tmp<Field<tensor>> field
146 (
147 const label timeIndex,
148 const label fieldIndex,
149 const tensor& refValue = pTraits<tensor>::zero
150 ) const = 0;
151};
152
153
154// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155
156} // End namespace Foam
157
158// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159
160
161#endif
162
163// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A class for handling file names.
Definition: fileName.H:76
Base class for surface readers.
Definition: surfaceReader.H:54
virtual instantList times() const =0
Return a list of the available times.
virtual tmp< Field< sphericalTensor > > field(const label timeIndex, const label fieldIndex, const sphericalTensor &refValue=pTraits< sphericalTensor >::zero) const =0
Return a sphericalTensor field at a given time.
virtual tmp< Field< vector > > field(const label timeIndex, const label fieldIndex, const vector &refValue=pTraits< vector >::zero) const =0
Return a vector field at a given time.
declareRunTimeSelectionTable(autoPtr, surfaceReader, fileName,(const fileName &fName),(fName))
virtual wordList fieldNames(const label timeIndex) const =0
Return a list of the available fields at a given time.
virtual tmp< Field< symmTensor > > field(const label timeIndex, const label fieldIndex, const symmTensor &refValue=pTraits< symmTensor >::zero) const =0
Return a symmTensor field at a given time.
virtual const meshedSurface & geometry(const label timeIndex)=0
Return a reference to the surface geometry.
virtual ~surfaceReader()=default
Destructor.
virtual tmp< Field< tensor > > field(const label timeIndex, const label fieldIndex, const tensor &refValue=pTraits< tensor >::zero) const =0
Return a tensor field at a given time.
virtual tmp< Field< scalar > > field(const label timeIndex, const label fieldIndex, const scalar &refValue=pTraits< scalar >::zero) const =0
Return a scalar field at a given time.
fileName fileName_
File name.
Definition: surfaceReader.H:58
TypeName("surfaceReader")
Runtime type information.
static autoPtr< surfaceReader > New(const word &readType, const fileName &fName)
Return a reference to the selected surfaceReader.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
rDeltaTY field()
Namespace for OpenFOAM.
label timeIndex
Definition: getTimeIndex.H:30
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
A non-counting (dummy) refCount.
Definition: refCount.H:59
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73