50 void Foam::sampledSets::circleRandom::calcSamples
52 DynamicList<point>& samplingPts,
53 DynamicList<label>& samplingCells,
54 DynamicList<label>& samplingFaces,
55 DynamicList<label>& samplingSegments,
56 DynamicList<scalar>& samplingCurveDist
64 for (
label i = 0; i < nPoints_; ++ i)
69 const scalar r = radius_*
rndGen.scalar01();
71 const scalar c =
cos(theta),
s =
sin(theta);
73 const point pt = centre_ + r*(c*radial1 +
s*radial2);
78 samplingPts.append(pt);
79 samplingCells.append(celli);
80 samplingFaces.append(-1);
81 samplingSegments.append(0);
82 samplingCurveDist.append(scalar(i));
88 void Foam::sampledSets::circleRandom::genSamples()
91 DynamicList<point> samplingPts;
92 DynamicList<label> samplingCells;
93 DynamicList<label> samplingFaces;
94 DynamicList<label> samplingSegments;
95 DynamicList<scalar> samplingCurveDist;
106 samplingPts.shrink();
107 samplingCells.shrink();
108 samplingFaces.shrink();
109 samplingSegments.shrink();
110 samplingCurveDist.shrink();
134 centre_(dict.
lookup(
"centre")),
136 radius_(dict.
lookup<scalar>(
"radius")),
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...
Vector< scalar > vector
A scalar version of the templated Vector.
Macros for easy insertion into run-time selection tables.
circleRandom(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
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.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Form normalised(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
dimensionedScalar cos(const dimensionedScalar &ds)
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 string.
addToRunTimeSelectionTable(sampledSet, arcUniform, word)
dimensionedScalar sin(const dimensionedScalar &ds)
Vector< Cmpt > perpendicular(const Vector< Cmpt > &v)
vector point
Point is a vector.
virtual bool write()
Sample and write.
Mesh consisting of general polyhedral cells.
defineTypeNameAndDebug(arcUniform, 0)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.