49 void Foam::circleSet::calcSamples
51 DynamicList<point>& samplingPts,
52 DynamicList<label>& samplingCells,
53 DynamicList<label>& samplingFaces,
54 DynamicList<label>& samplingSegments,
55 DynamicList<scalar>& samplingCurveDist
62 samplingPts.append(startPoint_);
63 samplingCells.append(celli);
64 samplingFaces.append(-1);
65 samplingSegments.append(0);
66 samplingCurveDist.append(0.0);
71 <<
"Unable to find cell at point id " << 0
72 <<
" at location " << startPoint_ <<
endl;
81 vector axis1 = startPoint_ - origin_;
82 const scalar radius =
mag(axis1);
84 if (
mag(axis1 & circleAxis_) > SMALL)
87 <<
"Vector defined by (startPoint - origin) not orthogonal to " 88 <<
"circleAxis:" <<
nl 89 <<
" startPoint - origin = " << axis1 <<
nl 90 <<
" circleAxis = " << circleAxis_ <<
nl 96 scalar theta = dTheta_;
100 axis1 =
normalised(axis1*cosAlpha + (axis1^circleAxis_)*sinAlpha);
101 point pt = origin_ + radius*axis1;
107 samplingPts.append(pt);
108 samplingCells.append(celli);
109 samplingFaces.append(-1);
110 samplingSegments.append(nPoint);
111 samplingCurveDist.append(radius*
degToRad(theta));
118 <<
"Unable to find cell at point id " << nPoint
119 <<
" at location " << pt <<
endl;
126 void Foam::circleSet::genSamples()
129 DynamicList<point> samplingPts;
130 DynamicList<label> samplingCells;
131 DynamicList<label> samplingFaces;
132 DynamicList<label> samplingSegments;
133 DynamicList<scalar> samplingCurveDist;
144 samplingPts.shrink();
145 samplingCells.shrink();
146 samplingFaces.shrink();
147 samplingSegments.shrink();
148 samplingCurveDist.shrink();
153 std::move(samplingPts),
154 std::move(samplingCells),
155 std::move(samplingFaces),
156 std::move(samplingSegments),
157 std::move(samplingCurveDist)
172 const polyMesh&
mesh,
173 const meshSearch& searchEngine,
177 const point& startPoint,
181 sampledSet(
name,
mesh, searchEngine, axis),
183 circleAxis_(circleAxis),
184 startPoint_(startPoint),
203 dTheta_(
dict.
get<scalar>(
"dTheta"))
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...
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Unit conversion functions.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
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)
dimensionedScalar cos(const dimensionedScalar &ds)
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...
label findCell(const point &location, const label seedCelli=-1, const bool useTreeSearch=true) const
Find cell containing location.
A class for handling words, derived from Foam::string.
virtual point getRefPoint(const List< point > &pts) const
Get reference point.
dimensionedScalar sin(const dimensionedScalar &ds)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
int debug
Static debugging option.
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.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const meshSearch & searchEngine() const noexcept
Mesh consisting of general polyhedral cells.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)