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()));
128 return (surf_ ? surf_.
cref().points() : points_.get());
140 return (surf_ ? surf_.
cref().faces() : faces_.get());
146 return (surf_ ? surf_.
cref().zoneIds() : zoneIds_.get());
152 return (surf_ ? surf_.
cref().faceIds() : faceIds_.get());
183 points_ = std::cref<pointField>(
points);
184 faces_ = std::cref<faceList>(
faces);
185 zoneIds_ = std::cref<labelList>(
zoneIds);
186 faceIds_ = std::cref<labelList>(
faceIds);
217 if (scaleFactor > SMALL && !
equal(scaleFactor, 1))
219 if (newPoints_.
empty())
223 newPoints_ *= scaleFactor;
virtual const pointField & points() const
The points used for the surface.
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
bool equal(const T &a, const T &b)
Compare two values for equality.
bool empty() const noexcept
True if List is empty (ie, size() is zero)
void movePoints(pointField &&pts)
Change point positions.
static const List< label > & null()
Return a null List.
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
virtual const labelList & faceIds() const
Per-face identifier (eg, element Id)
A class for managing references or pointers (no reference counting)
void reset(const meshedSurf &s)
Reset surface.
Abstract definition of a meshed surface defined by faces and points.
virtual ~meshedSurfRef()=default
Destructor.
Implements a meshed surface by referencing another meshed surface or faces/points components...
void clear()
Clear the list, i.e. set size to zero.
void scalePoints(const scalar scaleFactor)
Scale points: ignore unity and non-positive factors.
virtual const faceList & faces() const
The faces used for the surface.
bool valid() const
Contains a valid reference?
static const Field< vector > & null()
Return nullObject reference Field.
bool good() const
Contains a valid reference?
virtual const labelList & zoneIds() const
Per-face zone/region information.
void clear() const noexcept
If object pointer points to valid object: delete object and set pointer to nullptr.
A class for managing temporary objects.
void resetPoints()
Reset changes in point positions.
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))
meshedSurfRef()
Default construct.
bool notNull(const T *ptr)
True if ptr is not a pointer (of type T) to the nullObject.
void clear()
Invalid by redirecting to null objects.
void reset(T *p=nullptr) noexcept
Delete managed pointer and set to new given pointer.
const pointField & points0() const
The original points used for the surface.