48void Foam::arraySet::calcSamples
50 DynamicList<point>& samplingPts,
51 DynamicList<label>& samplingCells,
52 DynamicList<label>& samplingFaces,
53 DynamicList<label>& samplingSegments,
54 DynamicList<scalar>& samplingCurveDist
59 if (
cmptMin(pointsDensity_) < 1)
63 <<
". It specifies the number of points per coordinate axis"
64 <<
" so should contain positive integers only."
68 const scalar dx = spanBox_.x()/(pointsDensity_.
x() + 1);
69 const scalar dy = spanBox_.y()/(pointsDensity_.
y() + 1);
70 const scalar dz = spanBox_.z()/(pointsDensity_.
z() + 1);
74 for (label
k=1;
k<=pointsDensity_.
z(); ++
k)
76 for (label j=1; j<=pointsDensity_.
y(); ++j)
78 for (label i=1; i<=pointsDensity_.
x(); ++i)
81 point pt(i*dx, j*dy,
k*dz);
86 const label celli = queryMesh.findCell(pt);
90 samplingPts.append(pt);
91 samplingCells.append(celli);
92 samplingFaces.append(-1);
93 samplingSegments.append(0);
94 samplingCurveDist.append(1.0 * sampleI);
102void Foam::arraySet::genSamples()
105 DynamicList<point> samplingPts;
106 DynamicList<label> samplingCells;
107 DynamicList<label> samplingFaces;
108 DynamicList<label> samplingSegments;
109 DynamicList<scalar> samplingCurveDist;
120 samplingPts.shrink();
121 samplingCells.shrink();
122 samplingFaces.shrink();
123 samplingSegments.shrink();
124 samplingCurveDist.shrink();
129 std::move(samplingPts),
130 std::move(samplingCells),
131 std::move(samplingFaces),
132 std::move(samplingSegments),
133 std::move(samplingCurveDist)
158 pointsDensity_(pointsDensity),
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
const Cmpt & z() const
Access to the vector z component.
const Cmpt & y() const
Access to the vector y component.
const Cmpt & x() const
Access to the vector x component.
Specifies an x,y,z array of uniformly distributed sampling points.
A Cartesian coordinate system.
point globalPosition(const point &local) const
From local coordinate position to global (cartesian) position.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Mesh consisting of general polyhedral cells.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
const meshSearch & searchEngine() const noexcept
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
messageStream Info
Information stream (stdout output on master, null elsewhere)
vector point
Point is a vector.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)