lineCellFace.C
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) 2011-2025 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 \*---------------------------------------------------------------------------*/
25 
26 #include "lineCellFace.H"
27 #include "DynamicList.H"
28 #include "polyMesh.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace sampledSets
36 {
39 }
40 }
41 
42 
43 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
44 
45 bool Foam::sampledSets::lineCellFace::calcSamples
46 (
47  DynamicList<point>& samplingPositions,
48  DynamicList<scalar>& samplingDistances,
49  DynamicList<label>& samplingSegments,
50  DynamicList<label>& samplingCells,
51  DynamicList<label>& samplingFaces
52 ) const
53 {
54  lineFace::calcSamples
55  (
56  mesh(),
57  start_,
58  end_,
59  storeBothProcFaces_ ? 2 : 1,
60  true,
61  samplingPositions,
62  samplingDistances,
63  samplingSegments,
64  samplingCells,
65  samplingFaces
66  );
67 
68  // This set is ordered. Distances have been created.
69  return true;
70 }
71 
72 
73 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
74 
76 (
77  const word& name,
78  const polyMesh& mesh,
79  const dictionary& dict
80 )
81 :
83  start_(dict.lookup("start")),
84  end_(dict.lookup("end")),
85  storeBothProcFaces_(false)
86 {}
87 
88 
90 (
91  const word& name,
92  const polyMesh& mesh,
93  const word& axis,
94  const point& start,
95  const point& end
96 )
97 :
98  sampledSet(name, mesh, axis),
99  start_(start),
100  end_(end),
101  storeBothProcFaces_(true)
102 {}
103 
104 
105 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
106 
108 {}
109 
110 
111 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition: sampledSet.H:64
const polyMesh & mesh() const
Access the mesh.
Definition: sampledSetI.H:36
Face-intersections along a line, plus cell-samples at the mid-points in-between.
Definition: lineCellFace.H:92
virtual ~lineCellFace()
Destructor.
Definition: lineCellFace.C:107
lineCellFace(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
Definition: lineCellFace.C:76
Set of sets to sample. Call sampledSets.write() to sample&write files.
A class for handling words, derived from string.
Definition: word.H:63
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
defineTypeNameAndDebug(arcUniform, 0)
addToRunTimeSelectionTable(sampledSet, arcUniform, word)
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
Definition: units.C:346
Namespace for OpenFOAM.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
dictionary dict