44 void Foam::polySurface::calculateZoneIds(
const UList<surfZone>& zones)
58 for (
const surfZone& zn : zones)
60 const label sz = zn.size();
62 SubList<label>(zoneIds_, sz, off) = zn.index();
70 <<
"More faces " <<
size() <<
" than zones " << off <<
endl;
72 SubList<label>(zoneIds_,
size()-off, off) = zones.last().index();
74 else if (
size() < off)
77 <<
"More zones " << off <<
" than faces " <<
size()
85 Foam::polySurface::polySurface(
const IOobject&
io,
bool doCheckIn)
92 io.db().time().constant(),
111 Foam::polySurface::polySurface
113 const word& surfName,
114 const objectRegistry& obr,
123 obr.time().constant(),
134 Foam::polySurface::polySurface
147 Foam::polySurface::polySurface
175 if (objectRegistry::foundObject<objectRegistry>(pointDataName))
186 const objectRegistry* subreg =
187 objectRegistry::cfindObject<objectRegistry>(pointDataName);
191 return subreg->size();
220 if (regptr && regptr->
found(fieldName))
228 const objectRegistry* regptr =
229 cfindObject<objectRegistry>(pointDataName);
231 if (regptr && regptr->found(fieldName))
243 const word& fieldName,
247 const unsigned where(association);
250 const regIOobject* ioptr =
nullptr;
255 const objectRegistry* regptr =
this;
257 if (regptr && (ioptr = regptr->cfindObject<regIOobject>(fieldName)))
266 const objectRegistry* regptr =
267 cfindObject<objectRegistry>(pointDataName);
269 if (regptr && (ioptr = regptr->cfindObject<regIOobject>(fieldName)))
290 this->
nPoints() != points.size()
291 || this->nFaces() != faces.size()
298 this->storedPoints() =
points;
299 this->storedFaces() = faces;
328 this->storedPoints() = surf.
points();
329 this->storedFaces() = surf.
faces();
358 this->storedPoints() = surf.
points();
381 this->storedFaces().transfer(faces);
382 zoneIds_.transfer(zoneIds);
451 const regIOobject* polySurface::findFieldObject<polySurfaceGeoMesh>
453 const word& fieldName
457 return cfindObject<regIOobject>(fieldName);
462 const regIOobject* polySurface::findFieldObject<polySurfacePointGeoMesh>
464 const word& fieldName
470 objectRegistry::cfindObject<objectRegistry>(pointDataName);
483 const objectRegistry* polySurface::whichRegistry<polySurfaceGeoMesh>
485 const word& fieldName
491 if (subreg->
found(fieldName))
501 const objectRegistry* polySurface::whichRegistry<polySurfacePointGeoMesh>
503 const word& fieldName
509 objectRegistry::cfindObject<objectRegistry>(pointDataName);
511 if (subreg && subreg->
found(fieldName))
A surface mesh consisting of general polygon faces and capable of holding fields. ...
bool found(const word &name, const bool recursive=false) const
Can the regIOobject object be found (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.
virtual const labelList & zoneIds() const
Per-face zone/region information.
List< face > faceList
A List of faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool store()
Register object with its registry and transfer ownership to the registry.
label size() const noexcept
The number of elements in table.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
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.
virtual label size() const
Return number of faces.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
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.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for 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.
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.
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 of the argument and annul the argument.
#define WarningInFunction
Report a warning using Foam::Warning.
void copySurface(const pointField &points, const faceList &faces, bool unused=false)
Update with new contents.
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...
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.
static constexpr const zero Zero
Global zero (0)