cutPolyIsoSurface.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2022-2023 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::cutPolyIsoSurface
26 
27 Description
28  Iso-surface class based on the cutPoly cutting routines
29 
30 SourceFiles
31  cutPolyIsoSurface.C
32  cutPolyIsoSurfaceTemplates.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef cutPolyIsoSurface_H
37 #define cutPolyIsoSurface_H
38 
39 #include "polyMesh.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class cutPolyIsoSurface Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 {
52  // Private Data
53 
54  //- Points of the iso-surface
55  pointField points_;
56 
57  //- The mesh edge associated with each point
58  edgeList pointEdges_;
59 
60  //- The local coordinate of each point within its associated edge
61  scalarList pointEdgeLambdas_;
62 
63  //- Faces of the iso-surface
64  faceList faces_;
65 
66  //- The mesh cell index associated with each face
67  labelList faceCells_;
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("cutPolyIsoSurface");
74 
75 
76  // Constructors
77 
78  //- Construct from a mesh, point values and an iso-value
80  (
81  const polyMesh& mesh,
82  const scalarField& pAlphas,
83  const scalar isoAlpha,
84  const labelList& zoneIDs = NullObjectRef<labelList>()
85  );
86 
87  //- Construct by combining a list of iso-surfaces
89 
90  //- Disallow default bitwise copy construction
91  cutPolyIsoSurface(const cutPolyIsoSurface&) = delete;
92 
93 
94  //- Destructor
95  virtual ~cutPolyIsoSurface();
96 
97 
98  // Member Functions
99 
100  // Access
101 
102  //- Points of the iso-surface
103  inline const pointField& points() const
104  {
105  return points_;
106  }
107 
108  //- Faces of the iso-surface
109  inline const faceList& faces() const
110  {
111  return faces_;
112  }
113 
114  //- The mesh cell index associated with each face
115  inline const labelList& faceCells() const
116  {
117  return faceCells_;
118  }
119 
120 
121  //- Return a field of values for the surface faces, sampled from their
122  // associated cells
123  template<class Type>
124  tmp<Field<Type>> sample(const Field<Type> cPsis) const;
125 
126  //- Return a field of values for the surface points, interpolated
127  // within their associated edges
128  template<class Type>
129  tmp<Field<Type>> interpolate(const Field<Type>& pPsis) const;
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #ifdef NoRepository
141 #endif
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #endif
146 
147 // ************************************************************************* //
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
Iso-surface class based on the cutPoly cutting routines.
virtual ~cutPolyIsoSurface()
Destructor.
tmp< Field< Type > > interpolate(const Field< Type > &pPsis) const
Return a field of values for the surface points, interpolated.
cutPolyIsoSurface(const polyMesh &mesh, const scalarField &pAlphas, const scalar isoAlpha, const labelList &zoneIDs=NullObjectRef< labelList >())
Construct from a mesh, point values and an iso-value.
const faceList & faces() const
Faces of the iso-surface.
const labelList & faceCells() const
The mesh cell index associated with each face.
TypeName("cutPolyIsoSurface")
Runtime type information.
tmp< Field< Type > > sample(const Field< Type > cPsis) const
Return a field of values for the surface faces, sampled from their.
const pointField & points() const
Points of the iso-surface.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.