49 void Foam::sampledSets::arcUniform::calcSamples
51 DynamicList<point>& samplingPositions,
52 DynamicList<scalar>& samplingDistances,
53 DynamicList<label>& samplingSegments,
54 DynamicList<label>& samplingCells,
55 DynamicList<label>& samplingFaces
59 const vector axis1 = radial_ - (radial_ & normal_)*normal_;
60 const vector axis2 = normal_ ^ axis1;
61 const scalar radius =
mag(axis1);
65 const scalarField theta((1 - ts)*startAngle_ + ts*endAngle_);
83 forAll(samplingPositions, i)
85 const vector v = samplingPositions[i] - centre_;
86 const scalar theta =
atan2(v & axis2, v & axis1);
87 samplingDistances[i] = radius*theta;
92 void Foam::sampledSets::arcUniform::genSamples()
94 DynamicList<point> samplingPositions;
95 DynamicList<scalar> samplingDistances;
96 DynamicList<label> samplingSegments;
97 DynamicList<label> samplingCells;
98 DynamicList<label> samplingFaces;
109 samplingPositions.shrink();
110 samplingDistances.shrink();
111 samplingSegments.shrink();
112 samplingCells.shrink();
113 samplingFaces.shrink();
137 centre_(
dict.lookup(
"centre")),
140 startAngle_(
dict.lookup<scalar>(
"startAngle")),
141 endAngle_(
dict.lookup<scalar>(
"endAngle")),
142 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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::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.
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
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.
dimensionSet normalised(const dimensionSet &)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
dimensionedScalar cos(const dimensionedScalar &ds)