38#ifndef Foam_meshedSurfRef_H
39#define Foam_meshedSurfRef_H
64 std::reference_wrapper<const pointField> points_;
65 std::reference_wrapper<const faceList> faces_;
66 std::reference_wrapper<const labelList> zoneIds_;
67 std::reference_wrapper<const labelList> faceIds_;
119 return (surf_ ||
notNull(points_.get()));
125 return (surf_ ? surf_.
cref().points() : points_.get());
137 return (surf_ ? surf_.
cref().faces() : faces_.get());
143 return (surf_ ? surf_.
cref().zoneIds() : zoneIds_.get());
149 return (surf_ ? surf_.
cref().faceIds() : faceIds_.get());
180 points_ = std::cref<pointField>(
points);
181 faces_ = std::cref<faceList>(
faces);
182 zoneIds_ = std::cref<labelList>(
zoneIds);
183 faceIds_ = std::cref<labelList>(
faceIds);
214 if (scaleFactor > SMALL && !
equal(scaleFactor, 1))
216 if (newPoints_.
empty())
220 newPoints_ *= scaleFactor;
void transfer(List< T > &list)
void clear()
Clear the list, i.e. set size to zero.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
Implements a meshed surface by referencing another meshed surface or faces/points components.
meshedSurfRef()
Default construct.
virtual const pointField & points() const
The points used for the surface.
void reset(const pointField &points, const faceList &faces, const labelList &zoneIds=labelList::null(), const labelList &faceIds=labelList::null())
Reset components.
void movePoints(pointField &&pts)
Change point positions.
bool valid() const
Contains a valid reference?
void movePoints(const tmp< pointField > &tpts)
Change point positions.
virtual const labelList & faceIds() const
Per-face identifier (eg, element Id)
virtual const faceList & faces() const
The faces used for the surface.
virtual const labelList & zoneIds() const
Per-face zone/region information.
void reset(const meshedSurf &s)
Reset surface.
void resetPoints()
Reset changes in point positions.
void clear()
Invalid by redirecting to null objects.
meshedSurfRef(const pointField &points, const faceList &faces, const labelList &zoneIds=labelList::null(), const labelList &faceIds=labelList::null())
Construct from components.
const pointField & points0() const
The original points used for the surface.
void scalePoints(const scalar scaleFactor)
Scale points: ignore unity and non-positive factors.
meshedSurfRef(const meshedSurf &s)
Construct as reference to a meshedSurf.
virtual ~meshedSurfRef()=default
Destructor.
Abstract definition of a meshed surface defined by faces and points.
A class for managing references or pointers (no reference counting)
void reset(refPtr< T > &&other) noexcept
Clear existing and transfer ownership.
A class for managing temporary objects.
void clear() const noexcept
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
bool equal(const T &s1, const T &s2)
Compare two values for equality.
bool notNull(const T *ptr)
True if ptr is not a pointer (of type T) to the nullObject.