44void Foam::polySurface::calculateZoneIds(
const UList<surfZone>& zones)
55 zoneIds_.resize_nocopy(
size());
58 for (
const surfZone& zn : zones)
60 SubList<label>(zoneIds_, zn.size(), off) = zn.index();
67 <<
"More faces " <<
size() <<
" than zones " << off <<
endl;
69 zoneIds_.slice(off) = (zones.empty() ? 0 : zones.back().index());
71 else if (
size() < off)
74 <<
"More zones " << off <<
" than faces " <<
size()
91 IOobjectOption::NO_READ,
92 IOobjectOption::NO_WRITE,
93 IOobjectOption::REGISTER
109 const word& surfName,
110 const objectRegistry& obr,
121 IOobjectOption::NO_READ,
122 IOobjectOption::NO_WRITE,
160 const word& surfName,
178 const word& surfName,
179 const objectRegistry& obr
182 return obr.checkOut(obr.getObjectPtr<
polySurface>(surfName));
215 return subreg->size();
224 return static_cast<const objectRegistry&
>(*this);
238 unsigned where(FieldAssociation::NO_DATA);
246 if (subreg && subreg->
contains(fieldName))
248 where |= FieldAssociation::FACE_DATA;
254 subreg = cfindObject<objectRegistry>(pointDataName);
256 if (subreg && subreg->
contains(fieldName))
258 where |= FieldAssociation::POINT_DATA;
268 const word& fieldName,
269 enum FieldAssociation association
272 const unsigned where(association);
279 if (where & FieldAssociation::FACE_DATA)
283 if (subreg && (ioptr = subreg->cfindObject<
regIOobject>(fieldName)))
290 if (where & FieldAssociation::POINT_DATA)
292 subreg = cfindObject<objectRegistry>(pointDataName);
294 if (subreg && (ioptr = subreg->cfindObject<
regIOobject>(fieldName)))
316 || this->nFaces() != faces.size()
323 this->storedPoints() =
points;
324 this->storedFaces() = faces;
353 this->storedPoints() = surf.
points();
354 this->storedFaces() = surf.
faces();
376 || this->nFaces() != surf.
surfFaces().size()
383 this->storedPoints() = surf.
points();
478 const word& fieldName
489 const word& fieldName
499 return subreg->cfindObject<
regIOobject>(fieldName);
510 const word& fieldName
528 const word& fieldName
536 if (subreg && subreg->contains(fieldName))
label size() const noexcept
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
@ REGISTER
Request registration (bool: true).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const objectRegistry & db() const noexcept
Return the local objectRegistry.
void clear()
Clear the list, i.e. set size to zero.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
const surfZoneList & surfZones() const
Const access to the surface zones.
pointField & storedPoints()
Non-const access to global points.
const List< Face > & surfFaces() const
Return const access to the faces.
List< Face > & storedFaces()
Non-const access to the faces.
A special purpose MeshedSurface that exposes the stored values for direct modification.
const Field< point_type > & points() const noexcept
Return reference to global points.
void size(const label n)
Older name for setAddressableSize.
The field association for mesh (patch/volume) values.
Abstract definition of a meshed surface defined by faces and points.
virtual const faceList & faces() const =0
The faces used for the surface.
constexpr meshedSurf() noexcept=default
Default construct.
virtual const labelList & zoneIds() const
Per-face zone/region information.
virtual const pointField & points() const =0
The points used for the surface.
Registry of regIOobjects.
bool contains(const word &name, const bool recursive=false) const
Does the registry contain the regIOobject object (by name).
bool foundObject(const word &name, const bool recursive=false) const
Contains the named Type?
const Time & time() const noexcept
Return time registry.
bool checkOut(regIOobject *io) const
Remove a regIOobject from registry and free memory if the object is ownedByRegistry....
const objectRegistry & subRegistry(const word &name, const bool forceCreate=false, const bool recursive=false) const
Lookup and return a const sub-objectRegistry.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
Type * getObjectPtr(const word &name, const bool recursive=false) const
Return non-const pointer to the object of the given Type, using a const-cast to have it behave like a...
constant condensation/saturation model.
A surface mesh consisting of general polygon faces and capable of holding fields.
virtual label size() const
Return number of faces.
virtual const pointField & points() const
Return points.
const objectRegistry & faceData() const
Face data are stored directly on the registry.
void copySurface(const pointField &points, const faceList &faces, bool unused=false)
Update with new contents. Removes existing fields if sizes have changed.
static polySurface & New(const word &surfName, const objectRegistry &)
Get or create (NO_READ, NO_WRITE) named surface on registry.
pointField & storedPoints()
Non-const access to points.
label nFaceData() const
Number of main entries, without PointData sub-registry.
virtual ~polySurface()
Destructor.
faceList & storedFaces()
Non-const access to the faces.
polySurface(const polySurface &)=delete
No copy construct.
const objectRegistry * whichRegistry(const word &fieldName) const
General finding of the registry with the field object (FACE or POINT).
const objectRegistry & pointData() const
Point data are stored in a sub-registry.
virtual const faceList & faces() const
Return faces.
virtual const labelList & zoneIds() const
Const access to per-face zone/region information (demand-driven).
label nPointData() const
Number of entries on PointData sub-registry (if it exists).
static bool Delete(const word &surfName, const objectRegistry &)
Remove named surface from specified registry.
FieldAssociation
Enumeration for the field association.
@ FACE_DATA
Data associated with faces.
@ POINT_DATA
Data associated with points.
@ NO_DATA
No associated data.
void transfer(pointField &&points, faceList &&faces, labelList &&zoneIds=labelList())
Transfer the contents (and annul the parameters). Removes existing fields.
void clearFields()
Clear stored fields.
FieldAssociation queryFieldAssociation(const word &fieldName) const
Query the field association (FACE or POINT).
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
static const word pointDataName
Name for point fields sub-registry.
const regIOobject * findFieldObject(const word &fieldName, const FieldAssociation association) const
Find the field object with the given name and required FieldAssociation (FACE or POINT).
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
bool store()
Register object with its registry and transfer ownership to the registry.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
Different types of constants.
List< label > labelList
A List of labels.
List< face > faceList
List of faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool returnReduceAnd(const bool value, const int communicator=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
vectorField pointField
pointField is a vectorField.
errorManipArg< error, int > exit(error &err, const int errNo=1)