73 static_cast<MeshReference&
>(*this).shallowCopy
96 time().findInstance(meshDir(),
"points"),
105 time().findInstance(meshDir(),
"faces"),
112 MeshReference(this->storedIOFaces(), this->storedIOPoints()),
119 time().findInstance(meshDir(),
"surfZones"),
131 const word& surfName,
157 MeshReference(this->storedIOFaces(), this->storedIOPoints()),
203 MeshReference(this->storedIOFaces(), this->storedIOPoints()),
219 <<
"IOobject: " <<
io.path() <<
nl
220 <<
" name: " <<
io.name()
221 <<
" instance: " <<
io.instance()
222 <<
" local: " <<
io.local()
223 <<
" dbDir: " <<
io.db().dbDir() <<
nl
224 <<
"creating surfMesh at instance " <<
instance() <<
endl;
259 MeshReference(this->storedIOFaces(), this->storedIOPoints()),
275 <<
"IOobject: " <<
io.path() <<
nl
276 <<
" name: " <<
io.name()
277 <<
" instance: " <<
io.instance()
278 <<
" local: " <<
io.local()
279 <<
" dbDir: " <<
io.db().dbDir() <<
nl
280 <<
"creating surfMesh at instance " <<
instance() <<
nl
309 || this->nFaces() != faces.
size()
316 this->storedIOPoints() =
points;
317 this->storedIOFaces() = faces;
344 this->storedIOPoints() = surf.
points();
345 this->storedIOFaces() = surf.
faces();
365 || this->nFaces() != surf.
surfFaces().size()
372 this->storedIOPoints() = surf.
points();
373 this->storedIOFaces() = surf.
surfFaces();
387 MeshedSurface<face>& surf,
393 this->storedPoints().transfer(surf.storedPoints());
394 this->storedFaces().transfer(surf.storedFaces());
395 this->storedZones().transfer(surf.storedZones());
413 auto aptr = autoPtr<MeshedSurface<face>>
::New();
416 aptr->storedPoints().transfer(this->storedPoints());
417 aptr->storedFaces().transfer(this->storedFaces());
418 aptr->storedZones().transfer(this->storedZones());
452 return this->faces().
size();
470 auto& zones = this->storedZones();
472 if (zones.size() <= 1)
481 bool zonesTooBig(
false);
483 const label maxCount = this->nFaces();
486 for (surfZone& zn : zones)
490 if (start > maxCount)
493 zn.size() = (maxCount - zn.start());
494 start = (zn.start() + zn.size());
502 if ((zn.start() + zn.size()) < maxCount)
505 zn.size() += maxCount - zn.start();
510 <<
"Surface has more faces " << maxCount
511 <<
" than zone addressing ... extending final zone" <<
nl;
514 else if (zonesTooBig)
519 <<
"Surface has more zone addressing than faces "
521 <<
" ... trucated/resized accordingly" <<
nl;
539 surfZones_[zonei] =
surfZone(zones[zonei], zonei);
552 fileName meshFilesPath = db().path()/instanceDir/meshSubDir;
554 rm(meshFilesPath/
"points");
555 rm(meshFilesPath/
"faces");
556 rm(meshFilesPath/
"surfZones");
580 const word& fileType,
590 ).
write(
name, fileType, streamOpt, options);
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
faceCompactIOList & storedIOFaces() noexcept
Non-const access to the faces.
pointIOField & storedIOPoints() noexcept
Non-const access to the points.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
readOption readOpt() const noexcept
Get the read option.
writeOption writeOpt() const noexcept
Get the write option.
@ NO_READ
Nothing to be read.
@ MUST_READ
Reading required.
@ LAZY_READ
Reading is optional [identical to READ_IF_PRESENT].
@ 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.
const fileName & instance() const noexcept
Read access to instance path component.
A simple container for options an IOstream can normally have.
void clear()
Clear the list, i.e. set size to zero.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
static void write(const fileName &name, const MeshedSurfaceProxy &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
Write to file, select based on its extension.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
surfZoneList & storedZones()
Non-const access to the zones.
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.
const Field< point_type > & points() const noexcept
Return reference to global points.
void size(const label n)
Older name for setAddressableSize.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
Abstract definition of a meshed surface defined by faces and points.
virtual const faceList & faces() const =0
The faces used for the surface.
virtual const pointField & points() const =0
The points used for the surface.
Registry of regIOobjects.
virtual const fileName & dbDir() const
Local directory path of this objectRegistry relative to the time.
const Time & time() const noexcept
Return time registry.
A surface mesh consisting of general polygon faces that has IO capabilities and a registry for storin...
virtual label size() const
Return number of faces.
autoPtr< MeshedSurface< face > > releaseGeom()
Release the geometry and return as a MeshedSurface<face>.
surfZoneList & storedZones()
Non-const access to the surface zones.
const fileName & facesInstance() const
Return the current instance directory for faces.
void copySurface(const pointField &points, const faceList &faces, bool validate=false)
Update with new contents.
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir).
pointField & storedPoints()
Non-const access to global points.
virtual const faceList & faces() const
Return faces.
faceList & storedFaces()
Non-const access to the faces.
virtual ~surfMesh()
Destructor.
void updateRefs()
Update point/face references.
surfMesh(const surfMesh &)=delete
No copy construct.
const fileName & pointsInstance() const
Return the current instance directory for points.
void checkZones(const bool verbose=true)
Check the surface zone definitions.
void removeFiles(const fileName &instanceDir) const
Remove all files from mesh instance.
virtual const pointField & points() const
Return points.
void clearFields()
Clear stored fields.
void removeFiles() const
Remove all files from mesh instance().
virtual label nPoints() const
Return the number of raw points.
virtual const surfZoneList & surfZones() const
Return surface zones.
static word meshSubDir
Return the mesh sub-directory name (normally "surfMesh").
void removeZones()
Remove surface zones.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
void transfer(MeshedSurface< face > &surf, bool validate=false)
Transfer the contents of the argument and annul the argument.
void addZones(const surfZoneList &zones, bool validate=true)
Add surface zones, optionally validating the zone coverage.
virtual label nFaces() const
Return the number of raw faces.
void write(const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const
Write to file, choosing writer based on its extension.
A surface zone on a MeshedSurface.
label start() const
The start label of this zone in the face list.
label size() const
The size of this zone in the face list.
Wraps the normal objectRegistry with a local instance for surfaces.
surfaceRegistry(const surfaceRegistry &)=delete
No copy construct.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define DebugInfo
Report an information message using Foam::Info.
#define WarningInFunction
Report a warning using Foam::Warning.
bool rm(const fileName &file)
Remove a file (or its gz equivalent), returning true if successful.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
List< surfZone > surfZoneList
List of surfZone.
List< face > faceList
List of faces.
label checkZones(const polyMesh &mesh, const ZoneMesh< Zone, polyMesh > &zones, topoSet &set)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
vectorField pointField
pointField is a vectorField.
constexpr char nl
The newline '\n' character (0x0a).
thermo validate(args.executable(), "h")
#define forAll(list, i)
Loop across all elements in list.