50 void Foam::sampledSets::arcUniform::calcSamples
52 DynamicList<point>& samplingPositions,
53 DynamicList<scalar>& samplingDistances,
54 DynamicList<label>& samplingSegments,
55 DynamicList<label>& samplingCells,
56 DynamicList<label>& samplingFaces
60 const vector axis1 = radial_ - (radial_ & normal_)*normal_;
61 const vector axis2 = normal_ ^ axis1;
62 const scalar radius =
mag(axis1);
66 const scalarField theta((1 - ts)*startAngle_ + ts*endAngle_);
84 forAll(samplingPositions, i)
86 const vector v = samplingPositions[i] - centre_;
87 const scalar theta =
atan2(v & axis2, v & axis1);
88 samplingDistances[i] = radius*theta;
93 void Foam::sampledSets::arcUniform::genSamples()
95 DynamicList<point> samplingPositions;
96 DynamicList<scalar> samplingDistances;
97 DynamicList<label> samplingSegments;
98 DynamicList<label> samplingCells;
99 DynamicList<label> samplingFaces;
110 samplingPositions.shrink();
111 samplingDistances.shrink();
112 samplingSegments.shrink();
113 samplingCells.shrink();
114 samplingFaces.shrink();
138 centre_(
dict.lookup(
"centre")),
141 startAngle_(
dict.lookup<scalar>(
"startAngle")),
142 endAngle_(
dict.lookup<scalar>(
"endAngle")),
143 nPoints_(
dict.lookup<scalar>(
"nPoints"))
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
A list of keyword definitions, which are a keyword followed by any number of values (e....
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
Access the search engine.
const polyMesh & mesh() const
Access the mesh.
static void calcSamples(const polyMesh &mesh, const meshSearch &searchEngine, const pointField &points, DynamicList< point > &samplingPositons, DynamicList< scalar > &samplingDistances, DynamicList< label > &samplingSegments, DynamicList< label > &samplingCells, DynamicList< label > &samplingFaces)
Calculate all the sampling points.
Set of sets to sample. Call sampledSets.write() to sample&write files.
A class for handling words, derived from string.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dimensionedScalar c
Speed of light in a vacuum.
defineTypeNameAndDebug(arcUniform, 0)
addToRunTimeSelectionTable(sampledSet, arcUniform, word)
dimensionedScalar sin(const dimensionedScalar &ds)
vectorField pointField
pointField is a vectorField.
List< scalar > scalarList
A List of scalars.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
Vector< scalar > vector
A scalar version of the templated Vector.
dimensioned< scalar > mag(const dimensioned< Type > &)
Form normalised(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
word name(const complex &)
Return a string representation of a complex.
dimensionedScalar cos(const dimensionedScalar &ds)
Unit conversion functions.