46 void Foam::circleSet::calcSamples
48 DynamicList<point>& samplingPts,
49 DynamicList<label>& samplingCells,
50 DynamicList<label>& samplingFaces,
51 DynamicList<label>& samplingSegments,
52 DynamicList<scalar>& samplingCurveDist
55 static const string funcName =
57 "void circleSet::calcSamples" 59 "DynamicList<point>&, " 60 "DynamicList<label>&, " 61 "DynamicList<label>&, " 62 "DynamicList<label>&, " 63 "DynamicList<scalar>&" 71 samplingPts.append(startPoint_);
72 samplingCells.append(celli);
73 samplingFaces.append(-1);
74 samplingSegments.append(0);
75 samplingCurveDist.append(0.0);
80 <<
"Unable to find cell at point id " << 0
81 <<
" at location " << startPoint_ <<
endl;
86 const scalar sinAlpha =
sin(alpha);
87 const scalar cosAlpha =
cos(alpha);
90 vector axis1 = startPoint_ - origin_;
91 const scalar radius =
mag(axis1);
93 if (
mag(axis1 & circleAxis_) > SMALL)
96 <<
"Vector defined by (startPoint - origin) not orthogonal to " 97 <<
"circleAxis:" <<
nl 98 <<
" startPoint - origin = " << axis1 <<
nl 99 <<
" circleAxis = " << circleAxis_ <<
nl 105 scalar theta = dTheta_;
109 axis1 = axis1*cosAlpha + (axis1^circleAxis_)*sinAlpha;
111 point pt = origin_ + radius*axis1;
117 samplingPts.append(pt);
118 samplingCells.append(celli);
119 samplingFaces.append(-1);
120 samplingSegments.append(nPoint);
121 samplingCurveDist.append
131 <<
"Unable to find cell at point id " << nPoint
132 <<
" at location " << pt <<
endl;
139 void Foam::circleSet::genSamples()
142 DynamicList<point> samplingPts;
143 DynamicList<label> samplingCells;
144 DynamicList<label> samplingFaces;
145 DynamicList<label> samplingSegments;
146 DynamicList<scalar> samplingCurveDist;
157 samplingPts.shrink();
158 samplingCells.shrink();
159 samplingFaces.shrink();
160 samplingSegments.shrink();
161 samplingCurveDist.shrink();
184 const point& startPoint,
190 circleAxis_(circleAxis),
191 startPoint_(startPoint),
212 origin_(dict.
lookup(
"origin")),
213 circleAxis_(dict.
lookup(
"circleAxis")),
214 startPoint_(dict.
lookup(
"startPoint")),
218 circleAxis_ /=
mag(circleAxis_);
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
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...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Ostream & endl(Ostream &os)
Add newline and flush stream.
Vector< scalar > vector
A scalar version of the templated Vector.
label findCell(const point &location, const label seedCelli=-1, const bool useTreeSearch=true) const
Find cell containing location.
virtual point getRefPoint(const List< point > &) const
Get reference point.
Macros for easy insertion into run-time selection tables.
dimensionedScalar cos(const dimensionedScalar &ds)
Holds list of sampling points which is filled at construction time. Various implementations of this b...
A class for handling words, derived from string.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
dimensionedScalar sin(const dimensionedScalar &ds)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
vector point
Point is a vector.
circleSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const point &origin, const vector &circleAxis, const point &startPoint, const scalar dTheta)
Construct from components.
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.