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);
84 pt = csys_.globalPosition(pt);
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()
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)
148 const polyMesh&
mesh,
149 const meshSearch& searchEngine,
151 const coordSystem::cartesian& csys,
152 const Vector<label>& pointsDensity,
153 const Vector<scalar>& spanBox
156 sampledSet(
name,
mesh, searchEngine, axis),
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.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
bool get(const label i) const
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Specifies an x,y,z array of uniformly distributed sampling points.
arraySet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const coordSystem::cartesian &csys, const Vector< label > &pointsDensity, const Vector< scalar > &spanBox)
Construct from components.
const word & axis() const
The sort axis name.
const word & name() const noexcept
The coord-set name.
A Cartesian coordinate system.
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
sampledSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const coordSet::coordFormat axisType)
Construct from components.
const polyMesh & mesh() 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.
Namespace for handling debugging switches.
Vector< label > labelVector
Vector of labels.
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.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)