cellCutPlot.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::cellCutPlot
26 
27 Description
28  Functions for generating weights for a cut-plot of a patch
29 
30 SourceFiles
31  cellCutPlot.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cellCutPlot_H
36 #define cellCutPlot_H
37 
38 #include "cutPlot.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 class polyMesh;
46 class fvMesh;
47 class generatedCellZone;
48 class setWriter;
49 
50 namespace cellCutPlot
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 polyMesh& mesh,
62  const generatedCellZone& zone,
63  const scalarField& pointXs,
64  const scalarField& cutXs,
65  const bool interpolate,
66  const bool normalise = true
67 );
68 
69 //- Compute and return evenly-spaced cut coordinates
70 tmp<scalarField> calcCutXs
71 (
72  const polyMesh& mesh,
73  const generatedCellZone& zone,
74  const scalarField& pointXs,
75  const bool interpolate,
76  const label nCuts,
77  const label nIter,
78  const bool debug = false,
79  const word& functionName = word::null,
80  const setWriter& functionFormatter = NullObjectRef<setWriter>()
81 );
82 
83 //- Write the layers as components of a tensor field for debugging
84 void writeLayers
85 (
86  const fvMesh& mesh,
87  const List<cellCutPlot::weight>& weights,
88  const word& functionName
89 );
90 
91 //- Construct plot values from cell values given a set of weights
92 template<class Type>
94 (
95  const label n,
96  const List<cellCutPlot::weight>& weights,
97  const Field<Type>& cellValues
98 );
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 } // End namespace cellCutPlot
103 } // End namespace Foam
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 #endif
108 
109 // ************************************************************************* //
label n
Pre-declare SubField and related Field type.
Definition: Field.H:83
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
Motion of the mesh specified as a list of pointMeshMovers.
A class for managing temporary objects.
Definition: tmp.H:55
static const word null
An empty word.
Definition: word.H:78
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
List< weight > calcWeights(const polyMesh &mesh, const generatedCellZone &zone, const scalarField &pointXs, const scalarField &cellMinXs, const scalarField &cellMaxXs, const labelList &cellMinOrder, const scalarField &cutXs, const bool interpolate, const bool normalise)
Definition: cellCutPlot.C:848
void writeLayers(const fvMesh &mesh, const List< cellCutPlot::weight > &weights, const word &functionName)
Write the layers as components of a tensor field for debugging.
Definition: cellCutPlot.C:1130
tmp< scalarField > calcCutXs(const polyMesh &mesh, const generatedCellZone &zone, const scalarField &pointXs, const bool interpolate, const label nCuts, const label nIter, const bool debug=false, const word &functionName=word::null, const setWriter &functionFormatter=NullObjectRef< setWriter >())
Compute and return evenly-spaced cut coordinates.
Definition: cellCutPlot.C:941
tmp< Field< Type > > applyWeights(const label n, const List< cellCutPlot::weight > &weights, const Field< Type > &cellValues)
Construct plot values from cell values given a set of weights.
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
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
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