arraySet.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 OpenFOAM Foundation
9 Copyright (C) 2018 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::arraySet
29
30Description
31 Specifies an x,y,z array of uniformly distributed sampling points.
32
33 For a dictionary specification:
34 \table
35 Property | Description | Required | Default
36 type | array | yes |
37 axis | x, y, z, xyz, distance | yes |
38 pointsDensity | The sampling density as (x y z) integers | yes |
39 spanBox | The sample box dimensions (vector) | yes |
40 \endtable
41
42 The dictionary should also contain an embedded (Cartesian) coordinateSystem
43 specification, for example,
44
45 \verbatim
46 origin (-0.05 -0.05 -0.05);
47 rotation
48 {
49 type axes;
50 e1 (1 0 0);
51 e2 (0 1 0);
52 }
53 \endverbatim
54
55SourceFiles
56 arraySet.C
57
58\*---------------------------------------------------------------------------*/
59
60#ifndef arraySet_H
61#define arraySet_H
62
63#include "sampledSet.H"
64#include "labelVector.H"
65#include "DynamicList.H"
66#include "cartesianCS.H"
67#include "cylindricalCS.H"
68
69// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70
71namespace Foam
72{
73
74/*---------------------------------------------------------------------------*\
75 Class arraySet Declaration
76\*---------------------------------------------------------------------------*/
77
78class arraySet
79:
80 public sampledSet
81{
82 // Private data
83
84 //- Local Cartesian coordinate system
85 coordSystem::cartesian csys_;
86
87 //- Point density vector
88 labelVector pointsDensity_;
89
90 //- Span box
91 vector spanBox_;
92
93
94 // Private Member Functions
95
96 //- Samples all points in sampleCoords.
97 void calcSamples
98 (
99 DynamicList<point>& samplingPts,
100 DynamicList<label>& samplingCells,
101 DynamicList<label>& samplingFaces,
102 DynamicList<label>& samplingSegments,
103 DynamicList<scalar>& samplingCurveDist
104 ) const;
105
106 //- Uses calcSamples to obtain samples. Copies them into *this.
107 void genSamples();
108
109
110public:
111
112 //- Runtime type information
113 TypeName("array");
114
115
116 // Constructors
117
118 //- Construct from components
120 (
121 const word& name,
122 const polyMesh& mesh,
124 const word& axis,
125 const coordSystem::cartesian& csys,
126 const Vector<label>& pointsDensity,
127 const Vector<scalar>& spanBox
128 );
129
130 //- Construct from dictionary
132 (
133 const word& name,
134 const polyMesh& mesh,
136 const dictionary& dict
137 );
138
139
140 //- Destructor
141 virtual ~arraySet() = default;
142};
143
144
145// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146
147} // End namespace Foam
148
149// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150
151#endif
152
153// ************************************************************************* //
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
Specifies an x,y,z array of uniformly distributed sampling points.
Definition: arraySet.H:105
TypeName("array")
Runtime type information.
virtual ~arraySet()=default
Destructor.
const word & axis() const
The sort axis name.
Definition: coordSet.H:140
const word & name() const noexcept
The coord-set name.
Definition: coordSet.H:134
A Cartesian coordinate system.
Definition: cartesianCS.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition: meshSearch.H:61
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition: sampledSet.H:86
const meshSearch & searchEngine() const noexcept
Definition: sampledSet.H:324
const polyMesh & mesh() const noexcept
Definition: sampledSet.H:319
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
Vector< label > labelVector
Vector of labels.
Definition: labelVector.H:51
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73