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"),
325 const bool interpolate,
326 const word& surfaceType,
327 const word& surfaceName,
328 const scalar distance,
329 const bool signedDistance,
353 signed_(signedDistance),
354 regularise_(regularise),
380 Pout<<
"distanceSurface::expire :" 381 <<
" needsUpdate_:" << needsUpdate_ <<
endl;
402 Pout<<
"distanceSurface::update :" 403 <<
" needsUpdate_:" << needsUpdate_ <<
endl;
413 needsUpdate_ =
false;
424 return sampleField(vField);
434 return sampleField(vField);
444 return sampleField(vField);
454 return sampleField(vField);
464 return sampleField(vField);
474 return interpolateField(interpolator);
484 return interpolateField(interpolator);
493 return interpolateField(interpolator);
503 return interpolateField(interpolator);
513 return interpolateField(interpolator);
519 os <<
"distanceSurface: " <<
name() <<
" :" 520 <<
" surface:" << surfPtr_().name()
521 <<
" distance:" << distance_
522 <<
" faces:" << faces().size()
523 <<
" points:" <<
points().size();
virtual ~distanceSurface()
Destructor.
#define forAll(list, i)
Loop across all elements in list.
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.
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...
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
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 > &)
virtual Ostream & write(const token &)=0
Write next token to stream.
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.