46 void Foam::arraySet::calcSamples
48 DynamicList<point>& samplingPts,
49 DynamicList<label>& samplingCells,
50 DynamicList<label>& samplingFaces,
51 DynamicList<label>& samplingSegments,
52 DynamicList<scalar>& samplingCurveDist
55 const meshSearch& queryMesh = searchEngine();
64 List<point> sampleCoords(nTotalSamples);
66 const scalar deltax = spanBox_.x()/(pointsDensity_.x() + 1);
67 const scalar deltay = spanBox_.y()/(pointsDensity_.y() + 1);
68 const scalar deltaz = spanBox_.z()/(pointsDensity_.z() + 1);
71 for (
label k=1;
k<=pointsDensity_.z();
k++)
73 for (
label j=1; j<=pointsDensity_.y(); j++)
75 for (
label i=1; i<=pointsDensity_.x(); i++)
77 vector t(deltax*i , deltay*j, deltaz*
k);
78 sampleCoords[
p] = coordSys_.origin() + t;
86 sampleCoords[i] =
transform(coordSys_.R().R(), sampleCoords[i]);
89 forAll(sampleCoords, sampleI)
91 label celli = queryMesh.findCell(sampleCoords[sampleI]);
95 samplingPts.append(sampleCoords[sampleI]);
96 samplingCells.append(celli);
97 samplingFaces.append(-1);
98 samplingSegments.append(0);
99 samplingCurveDist.append(1.0 * sampleI);
105 void Foam::arraySet::genSamples()
108 DynamicList<point> samplingPts;
109 DynamicList<label> samplingCells;
110 DynamicList<label> samplingFaces;
111 DynamicList<label> samplingSegments;
112 DynamicList<scalar> samplingCurveDist;
123 samplingPts.shrink();
124 samplingCells.shrink();
125 samplingFaces.shrink();
126 samplingSegments.shrink();
127 samplingCurveDist.shrink();
155 pointsDensity_(pointsDensity),
177 pointsDensity_(dict.
lookup(
"pointsDensity")),
178 spanBox_(dict.
lookup(
"spanBox"))
arraySet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const coordinateSystem &coordSys, const Vector< label > &pointsDensity, const Vector< scalar > &spanBox)
Construct from components.
Base class for other coordinate system specifications.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual ~arraySet()
Destructor.
Vector< scalar > vector
A scalar version of the templated Vector.
label k
Boltzmann constant.
Macros for easy insertion into run-time selection tables.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
A class for handling words, derived from string.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
Mesh consisting of general polyhedral cells.
dimensionSet transform(const dimensionSet &)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.