48 void 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);
102 void 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)
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),
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
point globalPosition(const point &local) const
From local coordinate position to global (cartesian) position.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const Cmpt & y() const noexcept
Access to the vector y component.
label k
Boltzmann constant.
Macros for easy insertion into run-time selection tables.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
A class for handling words, derived from Foam::string.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const Cmpt & x() const noexcept
Access to the vector x component.
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
const Cmpt & z() const noexcept
Access to the vector z component.
vector point
Point is a vector.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const meshSearch & searchEngine() const noexcept
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.
Mesh consisting of general polyhedral cells.
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)