Loading...
Searching...
No Matches
surfaceDistance.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-------------------------------------------------------------------------------
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::functionObjects::surfaceDistance
28
29Group
30 grpFieldFunctionObjects
31
32Description
33 Computes the distance to the nearest surface from a given geometry.
34
35 Operands:
36 \table
37 Operand | Type | Location
38 input | - | -
39 output file | - | -
40 output field | volScalarField | <time>/surfaceDistance
41 \endtable
42
43Usage
44 Minimal example by using \c system/controlDict.functions:
45 \verbatim
46 surfaceDistanceFO
47 {
48 // Mandatory entries
49 type surfaceDistance;
50 libs (fieldFunctionObjects);
51 geometry
52 {
53 motorBike.obj
54 {
55 type triSurfaceMesh;
56 name motorBike;
57 }
58 }
59
60 // Optional entries
61 calculateCells <bool>;
62
63 // Inherited entries
64 ...
65 }
66 \endverbatim
67
68 where the entries mean:
69 \table
70 Property | Description | Type | Reqd | Deflt
71 type | Type name: surfaceDistance | word | yes | -
72 libs | Library name: fieldFunctionObjects | word | yes | -
73 geometry | Surface details | dict | yes | -
74 calculateCells | Calculate distance from cell | bool | no | true
75 \endtable
76
77 The inherited entries are elaborated in:
78 - \link functionObject.H \endlink
79
80SourceFiles
81 surfaceDistance.C
82
83\*---------------------------------------------------------------------------*/
84
85#ifndef Foam_functionObjects_surfaceDistance_H
86#define Foam_functionObjects_surfaceDistance_H
87
89#include "searchableSurfaces.H"
90#include "volFields.H"
91
92// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
93
94namespace Foam
95{
96
97// Forward Declarations
98class objectRegistry;
99class dictionary;
100class mapPolyMesh;
101
102namespace functionObjects
103{
104
105/*---------------------------------------------------------------------------*\
106 Class surfaceDistance Declaration
107\*---------------------------------------------------------------------------*/
108
109class surfaceDistance
110:
112{
113protected:
114
115 // Protected Data
116
117 //- Switch to calculate distance-to-cells
118 Switch doCells_;
119
120 //- Geometry
121 autoPtr<searchableSurfaces> geomPtr_;
122
123
124public:
125
126 //- Runtime type information
127 TypeName("surfaceDistance");
128
129
130 // Constructors
131
132 //- Construct for given objectRegistry and dictionary.
133 // Allow the possibility to load fields from files
135 (
136 const word& name,
137 const Time& runTime,
138 const dictionary& dict
139 );
140
141 //- No copy construct
142 surfaceDistance(const surfaceDistance&) = delete;
143
144 //- No copy assignment
145 void operator=(const surfaceDistance&) = delete;
146
147
148 //- Destructor
149 virtual ~surfaceDistance() = default;
151
152 // Member Functions
153
154 //- Read the function-object dictionary
155 virtual bool read(const dictionary& dict);
156
157 //- Execute the function-object operations
158 virtual bool execute();
159
160 //- Write the function-object results
161 virtual bool write();
162};
163
164
165// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167} // End namespace functionObjects
168} // End namespace Foam
169
170// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171
172#endif
173
174// ************************************************************************* //
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition Switch.H:81
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const word & name() const noexcept
Return the name of this functionObject.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
Computes the distance to the nearest surface from a given geometry.
autoPtr< searchableSurfaces > geomPtr_
Geometry.
TypeName("surfaceDistance")
Runtime type information.
surfaceDistance(const word &name, const Time &runTime, const dictionary &dict)
Construct for given objectRegistry and dictionary.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
virtual ~surfaceDistance()=default
Destructor.
void operator=(const surfaceDistance &)=delete
No copy assignment.
surfaceDistance(const surfaceDistance &)=delete
No copy construct.
Switch doCells_
Switch to calculate distance-to-cells.
virtual bool execute()
Execute the function-object operations.
virtual bool write()
Write the function-object results.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Registry of regIOobjects.
A class for handling words, derived from Foam::string.
Definition word.H:66
engineTime & runTime
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68