Loading...
Searching...
No Matches
internalFieldProbe.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::internalFieldProbe
29
30Description
31 A utility class for probing field values at specified point locations
32 within an \c fvMesh.
33
34 The \c internalFieldProbe stores a list of 3D point coordinates and
35 determines the corresponding mesh elements (cells or faces) that contain
36 these points. It provides methods to sample volume or surface fields at
37 the stored locations, with support for fixed or mesh-moving point
38 coordinates.
39
40 Features include:
41 - Reading probe locations and settings from a dictionary
42 - Support for fixed or moving locations (for dynamic mesh cases)
43 - Optional inclusion of points that lie outside of the mesh domain
44 - Selection of interpolation/sampling schemes for fixed locations
45 - Sampling of volume and surface fields by name or by direct reference
46 - Automatic update of element mapping when the mesh changes or moves
47
48SourceFiles
49 internalFieldProbe.C
50 internalFieldProbe.txx
51
52\*---------------------------------------------------------------------------*/
53
54#ifndef Foam_internalFieldProbe_H
55#define Foam_internalFieldProbe_H
56
57#include "probeModel.H"
58
59// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60
61namespace Foam
62{
64/*---------------------------------------------------------------------------*\
65 Class internalFieldProbe Declaration
66\*---------------------------------------------------------------------------*/
67
69:
70 public probeModel
71{
72protected:
73
74 // Protected Member Functions
75
76 //- Find cells and faces containing probes
77 virtual void findElements(const fvMesh& mesh);
78
79
80public:
81
82 //- Runtime type information
83 TypeName("internalFieldProbe");
84
85
86 // Constructors
87
88 //- Construct from Time and dictionary
90 (
91 const fvMesh& mesh,
92 const dictionary& dict
93 );
94
95
96 //- Destructor
97 virtual ~internalFieldProbe() = default;
98
99
100 // Member Functions
101
102 // Sampling
103
104 //- Sample a volume field at all locations
105 template<class Type>
107
108 //- Sample a surface field at all locations
109 template<class Type>
112 //- Sample a volume field at all locations
113 template<class Type>
114 tmp<Field<Type>> sample(const word& fieldName) const;
115
116 //- Sample a surface field at all locations
117 template<class Type>
118 tmp<Field<Type>> sampleSurfaceField(const word& fieldName) const;
119
120
121 // I-O
122
123 //- Read the settings dictionary
124 virtual bool read(const dictionary&);
125};
126
127// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128
129} // End namespace Foam
130
131// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132
133#ifdef NoRepository
134 #include "internalFieldProbe.txx"
135#endif
136
137// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138
139#endif
140
141// ************************************************************************* //
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 ~internalFieldProbe()=default
Destructor.
virtual void findElements(const fvMesh &mesh)
Find cells and faces containing probes.
internalFieldProbe(const fvMesh &mesh, const dictionary &dict)
Construct from Time and dictionary.
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.
tmp< Field< Type > > sample(const VolumeField< Type > &) const
Sample a volume field at all locations.
TypeName("internalFieldProbe")
Runtime type information.
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 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.
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