patchCutPlot.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-2026 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 Namespace
25  Foam::patchCutPlot
26 
27 Description
28  Functions for generating weights for a cut-plot of a patch
29 
30 SourceFiles
31  patchCutPlot.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef patchCutPlot_H
36 #define patchCutPlot_H
37 
38 #include "cutPlot.H"
39 #include "faceList.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 class polyMesh;
47 class fvMesh;
48 class setWriter;
49 
50 namespace patchCutPlot
51 {
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 //- Structure containing the weight for a given cell and cut index
56 using cutPlot::weight;
57 
58 //- Calculate and return weights
60 (
61  const faceList& faces,
62  const UList<vector>& faceAreas,
63  const UList<vector>& faceNormals,
64  const pointField& points,
65  const scalarField& pointXs,
66  const scalarField& cutXs,
67  const bool interpolate,
68  const bool normalise = true
69 );
70 
71 //- Calculate and return weights
72 template<class PatchType>
74 (
75  const PatchType& p,
76  const scalarField& localPointXs,
77  const scalarField& cutXs,
78  const bool interpolate,
79  const bool normalise = true
80 );
81 
82 //- Compute and return evenly-spaced cut coordinates
84 (
85  const faceList& faces,
86  const Field<vector>& faceAreas,
87  const Field<vector>& faceNormals,
88  const pointField& points,
89  const scalarField& pointXs,
90  const bool interpolate,
91  const label nCuts,
92  const label nIter,
93  const bool debug = false,
94  const word& functionName = word::null,
95  const polyMesh& functionMesh = NullObjectRef<polyMesh>(),
96  const setWriter& functionFormatter = NullObjectRef<setWriter>()
97 );
98 
99 //- Compute and return evenly-spaced cut coordinates
100 template<class PatchType>
102 (
103  const PatchType& p,
104  const scalarField& localPointXs,
105  const bool interpolate,
106  const label nCuts,
107  const label nIter,
108  const bool debug = false,
109  const word& functionName = word::null,
110  const polyMesh& functionMesh = NullObjectRef<polyMesh>(),
111  const setWriter& functionFormatter = NullObjectRef<setWriter>()
112 );
113 
114 //- Write the layers as components of a tensor field for debugging
115 void writeLayers
116 (
117  const SubList<face>& faces,
118  const List<patchCutPlot::weight>& weights,
119  const word& functionName,
120  const fvMesh& functionMesh
121 );
122 
123 //- Write the layers as components of a tensor field for debugging
124 void writeLayers
125 (
126  const UIndirectList<face>& faces,
127  const List<patchCutPlot::weight>& weights,
128  const word& functionName,
129  const fvMesh& functionMesh
130 );
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 } // End namespace patchCutPlot
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #ifdef NoRepository
140  #include "patchCutPlotTemplates.C"
141 #endif
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #endif
146 
147 // ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
A List obtained as a section of another List.
Definition: SubList.H:56
A List with indirect addressing.
Definition: UIndirectList.H:61
A functionName is a word starting with '#'.
Definition: functionName.H:60
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
Motion of the mesh specified as a list of pointMeshMovers.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
Base class for writing coordinate sets with data.
Definition: setWriter.H:64
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
static const word null
An empty word.
Definition: word.H:78
const pointField & points
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
void writeLayers(const SubList< face > &faces, const List< patchCutPlot::weight > &weights, const word &functionName, const fvMesh &functionMesh)
Write the layers as components of a tensor field for debugging.
Definition: patchCutPlot.C:675
List< weight > calcWeights(const faceList &faces, const UList< vector > &faceAreas, const UList< vector > &faceNormals, const pointField &points, const scalarField &pointXs, const scalarField &faceMinXs, const scalarField &faceMaxXs, const labelList &faceMinOrder, const scalarField &cutXs, const bool interpolate, const bool normalise)
Definition: patchCutPlot.C:397
tmp< scalarField > calcCutXs(const faceList &faces, const Field< vector > &faceAreas, const Field< vector > &faceNormals, const pointField &points, const scalarField &pointXs, const bool interpolate, const label nCuts, const label nIter, const bool debug=false, const word &functionName=word::null, const polyMesh &functionMesh=NullObjectRef< polyMesh >(), const setWriter &functionFormatter=NullObjectRef< setWriter >())
Compute and return evenly-spaced cut coordinates.
Definition: patchCutPlot.C:488
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:42
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
quaternion normalise(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
Definition: quaternionI.H:603
List< face > faceList
Definition: faceListFwd.H:41
volScalarField & p