44 void 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()
89 io.db().time().constant(),
91 IOobjectOption::NO_READ,
92 IOobjectOption::NO_WRITE,
93 IOobjectOption::REGISTER
109 const word& surfName,
110 const objectRegistry& obr,
119 obr.time().constant(),
121 IOobjectOption::NO_READ,
122 IOobjectOption::NO_WRITE,
123 IOobjectOption::REGISTER
160 const word& surfName,
178 const word& surfName,
179 const objectRegistry& obr
182 return obr.checkOut(obr.getObjectPtr<
polySurface>(surfName));
199 if (objectRegistry::foundObject<objectRegistry>(pointDataName))
211 objectRegistry::cfindObject<objectRegistry>(pointDataName);
215 return subreg->size();
246 if (subreg && subreg->
contains(fieldName))
254 subreg = cfindObject<objectRegistry>(pointDataName);
256 if (subreg && subreg->
contains(fieldName))
268 const word& fieldName,
272 const unsigned where(association);
275 const regIOobject* ioptr =
nullptr;
276 const objectRegistry* subreg =
nullptr;
283 if (subreg && (ioptr = subreg->cfindObject<regIOobject>(fieldName)))
292 subreg = cfindObject<objectRegistry>(pointDataName);
294 if (subreg && (ioptr = subreg->cfindObject<regIOobject>(fieldName)))
315 this->
nPoints() != points.size()
316 || this->nFaces() != faces.size()
323 this->storedPoints() =
points;
324 this->storedFaces() = faces;
353 this->storedPoints() = surf.
points();
354 this->storedFaces() = surf.
faces();
383 this->storedPoints() = surf.
points();
406 this->storedFaces().transfer(faces);
407 zoneIds_.transfer(zoneIds);
476 const regIOobject* polySurface::findFieldObject<polySurfaceGeoMesh>
478 const word& fieldName
482 return cfindObject<regIOobject>(fieldName);
487 const regIOobject* polySurface::findFieldObject<polySurfacePointGeoMesh>
489 const word& fieldName
495 objectRegistry::cfindObject<objectRegistry>(pointDataName);
499 return subreg->cfindObject<
regIOobject>(fieldName);
508 const objectRegistry* polySurface::whichRegistry<polySurfaceGeoMesh>
510 const word& fieldName
526 const objectRegistry* polySurface::whichRegistry<polySurfacePointGeoMesh>
528 const word& fieldName
534 objectRegistry::cfindObject<objectRegistry>(pointDataName);
536 if (subreg && subreg->contains(fieldName))
A surface mesh consisting of general polygon faces and capable of holding fields. ...
bool contains(const word &name, const bool recursive=false) const
Does the registry contain the regIOobject object (by name).
void size(const label n)
Older name for setAddressableSize.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static bool Delete(const word &surfName, const objectRegistry &)
Remove named surface from specified registry.
virtual const labelList & zoneIds() const
Per-face zone/region information.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool store()
Register object with its registry and transfer ownership to the registry.
static polySurface & New(const word &surfName, const objectRegistry &)
Get or create (NO_READ, NO_WRITE) named surface on registry.
const objectRegistry & subRegistry(const word &name, const bool forceCreate=false, const bool recursive=false) const
Lookup and return a const sub-objectRegistry.
A special purpose MeshedSurface that exposes the stored values for direct modification.
Abstract definition of a meshed surface defined by faces and points.
FieldAssociation queryFieldAssociation(const word &fieldName) const
Query the field association (FACE or POINT)
const objectRegistry & pointData() const
Point data are stored in a sub-registry.
List< face > faceList
List of faces.
label size() const noexcept
The number of elements in table.
virtual label size() const
Return number of faces.
bool returnReduceAnd(const bool value, const label comm=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
vectorField pointField
pointField is a vectorField.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
label nPointData() const
Number of entries on PointData sub-registry (if it exists)
List< Face > & storedFaces()
Non-const access to the faces.
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from Foam::string.
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...
FieldAssociation
Enumeration for the field association.
pointField & storedPoints()
Non-const access to global points.
label nFaceData() const
Number of main entries, without PointData sub-registry.
const Field< point_type > & points() const noexcept
Return reference to global points.
polySurface(const polySurface &)=delete
No copy construct.
virtual const faceList & faces() const =0
The faces used for the surface.
const objectRegistry & faceData() const
Face data are stored directly on the registry.
const List< Face > & surfFaces() const
Return const access to the faces.
defineTypeNameAndDebug(combustionModel, 0)
const regIOobject * findFieldObject(const word &fieldName, const FieldAssociation association) const
Find the field object with the given name and required FieldAssociation (FACE or POINT).
virtual ~polySurface()
Destructor.
void transfer(pointField &&points, faceList &&faces, labelList &&zoneIds=labelList())
Transfer the contents (and annul the parameters). Removes existing fields.
#define WarningInFunction
Report a warning using Foam::Warning.
void copySurface(const pointField &points, const faceList &faces, bool unused=false)
Update with new contents. Removes existing fields if sizes have changed.
static const word pointDataName
Name for point fields sub-registry.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Registry of regIOobjects.
const surfZoneList & surfZones() const
Const access to the surface zones.
Defines the attributes of an object for which implicit objectRegistry management is supported...
virtual const pointField & points() const =0
The points used for the surface.