Loading...
Searching...
No Matches
patchFieldProbe.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) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2025 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::patchFieldProbe
29
30Description
31 Utility class for probing specified points on user-selected boundary
32 patches. The input points are projected onto the nearest point of the
33 nearest face on the specified patch, ensuring sampling occurs at valid
34 patch locations.
35
36 The patchFieldProbe enables sampling of both volume and surface fields
37 at these snapped locations. Patch selection is controlled via patch names or
38 indices, and the class provides runtime selection and dictionary-driven
39 configuration.
40
41 Typical usage involves specifying patch names and probe locations in a
42 dictionary, after which the class manages the mapping and sampling
43 operations.
44
45SourceFiles
46 patchFieldProbe.C
47 patchFieldProbe.txx
48
49\*---------------------------------------------------------------------------*/
50
51#ifndef Foam_patchFieldProbe_H
52#define Foam_patchFieldProbe_H
53
54#include "probeModel.H"
55
56// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57
58namespace Foam
59{
61/*---------------------------------------------------------------------------*\
62 Class patchFieldProbe Declaration
63\*---------------------------------------------------------------------------*/
64
66:
67 public probeModel
68{
69protected:
70
71 // Protected Data
72
73 //- Names of the patches to sample
75
76 //- Index of the patches to sample
78
79
80 // Protected Member Functions
81
82 //- Find elements containing patchFieldProbe
83 virtual void findElements(const fvMesh& mesh);
84
85
86public:
87
88 //- Runtime type information
89 TypeName("patchFieldProbe");
90
91
92 // Constructors
93
94 //- Construct from Time and dictionary
96 (
97 const fvMesh& mesh,
98 const dictionary& dict
99 );
100
101
102 //- Destructor
103 virtual ~patchFieldProbe() = default;
104
105
106 // Member Functions
107
108 // Access
109
110 //- Return the index of the patches to sample
111 const labelList& patchIDs() const noexcept { return patchIDs_; }
112
113
114 // Sampling
115
116 //- Sample a volume field at all locations
117 template<class Type>
119
120 //- Sample a surface field at all locations
121 template<class Type>
123
124 //- Sample a volume field at all locations
125 template<class Type>
126 tmp<Field<Type>> sample(const word& fieldName) const;
127
128 //- Sample a surface field at all locations
129 template<class Type>
130 tmp<Field<Type>> sampleSurfaceField(const word& fieldName) const;
131
132
133 // I-O
134
135 //- Read the settings dictionary
136 virtual bool read(const dictionary&);
137};
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
141} // End namespace Foam
142
143// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144
145#ifdef NoRepository
146 #include "patchFieldProbe.txx"
147#endif
148
149// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150
151#endif
152
153// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
tmp< Field< Type > > sample(const SurfaceField< Type > &) const
Sample a surface field at all locations.
virtual void findElements(const fvMesh &mesh)
Find elements containing patchFieldProbe.
virtual ~patchFieldProbe()=default
Destructor.
const labelList & patchIDs() const noexcept
Return the index of the patches to sample.
patchFieldProbe(const fvMesh &mesh, const dictionary &dict)
Construct from Time and dictionary.
TypeName("patchFieldProbe")
Runtime type information.
tmp< Field< Type > > sample(const word &fieldName) const
Sample a volume field at all locations.
tmp< Field< Type > > sampleSurfaceField(const word &fieldName) const
Sample a surface field at all locations.
wordRes patchNames_
Names of the patches to sample.
tmp< Field< Type > > sample(const VolumeField< Type > &) const
Sample a volume field at all locations.
labelList patchIDs_
Index of the patches to sample.
virtual bool read(const dictionary &)
Read the settings dictionary.
probeModel(const probeModel &)=delete
No copy construct.
A class for managing temporary objects.
Definition tmp.H:75
A List of wordRe with additional matching capabilities.
Definition wordRes.H:56
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
Namespace for OpenFOAM.
GeometricField< Type, fvPatchField, volMesh > VolumeField
A volume field for a given type.
List< label > labelList
A List of labels.
Definition List.H:62
const direction noexcept
Definition scalarImpl.H:265
GeometricField< Type, fvsPatchField, surfaceMesh > SurfaceField
A (volume) surface field for a given type.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68