45 bool Foam::sampledSets::circleRandom::calcSamples
47 DynamicList<point>& samplingPositions,
49 DynamicList<label>& samplingSegments,
50 DynamicList<label>& samplingCells,
51 DynamicList<label>& samplingFaces
56 randomGenerator
rndGen(261782,
true);
61 for (
label i = 0; i < nPoints_; ++ i)
66 const scalar r = radius_*
rndGen.scalar01();
68 const scalar
c =
cos(theta),
s =
sin(theta);
70 const point pt = centre_ + r*(
c*radial1 +
s*radial2);
71 const label celli = searchEngine.findCell(pt);
75 samplingPositions.append(pt);
76 samplingSegments.append(i);
77 samplingCells.append(celli);
78 samplingFaces.append(-1);
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.
static const meshSearch & New(const polyMesh &mesh, const pointInCellShapes=pointInCellShapes::tets)
Lookup or construct from mesh and cell decomposition option.
Mesh consisting of general polyhedral cells.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
const polyMesh & mesh() const
Access the mesh.
Random samples within a circle.
circleRandom(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
virtual ~circleRandom()
Destructor.
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)
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedScalar sin(const dimensionedScalar &ds)
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.
dimensionSet perpendicular(const dimensionSet &)
dimensionedScalar cos(const dimensionedScalar &ds)
randomGenerator rndGen(653213)