42 void Foam::sampledSurfaces::distanceSurface::createGeometry()
46 Pout<<
"distanceSurface::createGeometry :updating geometry." <<
endl;
60 cellDistancePtr_.
reset 85 surfPtr_().findNearest
96 surfPtr_().getVolumeType(cc, volType);
104 fld[i] =
Foam::mag(cc[i] - nearest[i].hitPoint());
108 fld[i] = -
Foam::mag(cc[i] - nearest[i].hitPoint());
113 <<
"getVolumeType failure, neither INSIDE or OUTSIDE" 122 fld[i] =
Foam::mag(cc[i] - nearest[i].hitPoint());
127 volScalarField::Boundary& cellDistanceBf =
138 surfPtr_().findNearest
149 surfPtr_().getVolumeType(cc, volType);
157 fld[i] =
Foam::mag(cc[i] - nearest[i].hitPoint());
161 fld[i] = -
Foam::mag(cc[i] - nearest[i].hitPoint());
166 <<
"getVolumeType failure, " 167 <<
"neither INSIDE or OUTSIDE" 176 fld[i] =
Foam::mag(cc[i] - nearest[i].hitPoint());
188 pointDistance_.setSize(mesh.
nPoints());
193 surfPtr_().findNearest
204 surfPtr_().getVolumeType(pts, volType);
213 Foam::mag(pts[i] - nearest[i].hitPoint());
218 -
Foam::mag(pts[i] - nearest[i].hitPoint());
223 <<
"getVolumeType failure, neither INSIDE or OUTSIDE" 232 pointDistance_[i] =
Foam::mag(pts[i]-nearest[i].hitPoint());
241 cellDistance.
write();
258 Pout<<
"Writing point distance:" << pDist.objectPath() <<
endl;
298 dict.
lookup(
"surfaceType"),
311 distance_(dict.
lookup<scalar>(
"distance")),
315 dict.
found(
"filtering")
330 const bool interpolate,
331 const word& surfaceType,
332 const word& surfaceName,
333 const scalar distance,
334 const bool signedDistance,
358 signed_(signedDistance),
385 Pout<<
"distanceSurface::expire :" 386 <<
" needsUpdate_:" << needsUpdate_ <<
endl;
407 Pout<<
"distanceSurface::update :" 408 <<
" needsUpdate_:" << needsUpdate_ <<
endl;
418 needsUpdate_ =
false;
429 return sampleField(vField);
439 return sampleField(vField);
449 return sampleField(vField);
459 return sampleField(vField);
469 return sampleField(vField);
479 return interpolateField(interpolator);
489 return interpolateField(interpolator);
498 return interpolateField(interpolator);
508 return interpolateField(interpolator);
518 return interpolateField(interpolator);
524 os <<
"distanceSurface: " <<
name() <<
" :" 525 <<
" surface:" << surfPtr_().name()
526 <<
" distance:" << distance_
527 <<
" faces:" << faces().size()
528 <<
" points:" <<
points().size();
virtual ~distanceSurface()
Destructor.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
virtual Ostream & write(const char)=0
Write character.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
An abstract class for surfaces with sampling.
defineTypeNameAndDebug(distanceSurface, 0)
const Boundary & boundaryField() const
Return const-reference to the boundary field.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual bool update()
Update the surface as required.
void size(const label)
Override size to be inconsistent with allocated storage.
bool interpolate() const
Interpolation requested for surface.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const Time & time() const
Return the top-level database.
A sampledSurface defined by a distance to a surface.
Macros for easy insertion into run-time selection tables.
static const pointMesh & New(const polyMesh &mesh)
virtual const pointField & points() const
Return raw points.
virtual void print(Ostream &) const
Write.
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){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word & constant() const
Return constant name.
static const NamedEnum< filterType, 3 > filterTypeNames_
virtual bool needsUpdate() const
Does the surface need an update?
virtual bool expire()
Mark the surface as needing an update.
A sampledSurface defined by a surface of iso value. To be used in sampleSurfaces / functionObjects...
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
const Time & time() const
Return time.
addToRunTimeSelectionTable(sampledSurface, distanceSurface, word)
distanceSurface(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
prefixOSstream Pout(cout, "Pout")
Mesh data needed to do the Finite Volume discretisation.
virtual tmp< scalarField > sample(const volScalarField &) const
Sample field on surface.
static autoPtr< searchableSurface > New(const word &surfaceType, const IOobject &io, const dictionary &dict)
Return a reference to the selected searchableSurface.
Set of surfaces to sample.
dimensioned< scalar > mag(const dimensioned< Type > &)
Enum read(Istream &) const
Read a word from Istream and return the corresponding.
Mesh consisting of general polyhedral cells.
const volVectorField & C() const
Return cell centres as volVectorField.
virtual bool write(const bool write=true) const
Write using setting from DB.
A class for managing temporary objects.
static const keyType null
An empty keyType.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
fileName objectPath() const
Return complete path + object name.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.