Go to the documentation of this file.
96 time().findInstance(meshDir(),
"points"),
105 time().findInstance(meshDir(),
"faces"),
112 MeshReference(this->storedIOFaces(), this->storedIOPoints()),
119 time().findInstance(meshDir(),
"surfZones"),
129 Foam::surfMesh::surfMesh
131 const word& surfName,
157 MeshReference(this->storedIOFaces(), this->storedIOPoints()),
174 Foam::surfMesh::surfMesh
203 MeshReference(this->storedIOFaces(), this->storedIOPoints()),
219 <<
"IOobject: " << io.
path() <<
nl
220 <<
" name: " << io.
name()
222 <<
" local: " << io.
local()
224 <<
"creating surfMesh at instance " << instance() <<
endl;
230 Foam::surfMesh::surfMesh
259 MeshReference(this->storedIOFaces(), this->storedIOPoints()),
275 <<
"IOobject: " << io.
path() <<
nl
276 <<
" name: " << io.
name()
278 <<
" local: " << io.
local()
280 <<
"creating surfMesh at instance " << instance() <<
nl
281 <<
"timeName: " << instance() <<
endl;
308 this->
nPoints() != points.size()
309 || this->nFaces() != faces.size()
316 this->storedIOPoints() =
points;
317 this->storedIOFaces() = faces;
337 || this->nFaces() != surf.
faces().size()
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();
416 aptr->storedPoints().transfer(this->storedPoints());
417 aptr->storedFaces().transfer(this->storedFaces());
418 aptr->storedZones().transfer(this->storedZones());
428 return dbDir()/meshSubDir;
434 return this->storedIOPoints().instance();
440 return this->storedIOFaces().instance();
446 return this->
points().size();
452 return this->faces().size();
458 return this->storedIOPoints();
464 return this->storedIOFaces();
470 auto& zones = this->storedZones();
472 if (zones.size() <= 1)
481 bool zonesTooBig(
false);
483 const label maxCount = this->nFaces();
490 if (start > maxCount)
493 zn.size() = (maxCount - zn.start());
494 start = (zn.start() + zn.size());
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");
562 removeFiles(instance());
580 const word& fileType,
590 ).
write(
name, fileType, streamOpt, options);
label start() const
The start label of this zone in the face list.
const fileName & pointsInstance() const
Return the current instance directory for points.
A helper class for storing points and faces with IO capabilities.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
const surfZoneList & surfZones() const
Const access to the surface zones.
A class for handling words, derived from Foam::string.
List< Face > & storedFaces()
Non-const access to the faces.
Wraps the normal objectRegistry with a local instance for surfaces.
A class for handling file names.
const fileName & instance() const noexcept
static std::string path(const std::string &str)
Return directory path name (part before last /)
pointField & storedPoints()
Non-const access to global points.
faceList & storedFaces()
Non-const access to the faces.
void updateRefs()
Update point/face references.
virtual const faceList & faces() const =0
The faces used for the surface.
Abstract definition of a meshed surface defined by faces and points.
void write(const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const
Write to file, choosing writer based on its extension.
const List< Face > & surfFaces() const
Return const access to the faces.
A surface mesh consisting of general polygon faces that has IO capabilities and a registry for storin...
bool rm(const fileName &file)
Remove a file (or its gz equivalent), returning true if successful.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word ext() const
Return file name extension (part after last .)
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.
writeOption writeOpt() const noexcept
The write option.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
static word meshSubDir
Return the mesh sub-directory name (normally "surfMesh")
#define forAll(list, i)
Loop across all elements in list.
Registry of regIOobjects.
virtual const fileName & dbDir() const
Local directory path of this objectRegistry relative to the time.
surfZoneList & storedZones()
Non-const access to the zones.
const fileName & local() const noexcept
void addZones(const surfZoneList &zones, bool validate=true)
Add surface zones, optionally validating the zone coverage.
The IOstreamOption is a simple container for options an IOstream can normally have.
virtual const faceList & faces() const
Return faces.
virtual const pointField & points() const =0
The points used for the surface.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
label size() const
The size of this zone in the face list.
virtual label nPoints() const
Return the number of raw points.
void removeFiles() const
Remove all files from mesh instance()
readOption readOpt() const noexcept
The read option.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
const word & name() const noexcept
Return name.
void transfer(MeshedSurface< face > &surf, bool validate=false)
Transfer the contents of the argument and annul the argument.
void checkZones(const bool verbose=true)
Check the surface zone definitions.
void shallowCopy(const UList< T > &list)
Copy the pointer and size held by the given UList.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
virtual ~surfMesh()
Destructor.
virtual const pointField & points() const
Return points.
#define DebugInfo
Report an information message using Foam::Info.
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir)
A surface zone on a MeshedSurface.
void clear()
Clear the list, i.e. set size to zero.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
autoPtr< MeshedSurface< face > > releaseGeom()
Release the geometry and return as a MeshedSurface<face>.
StringType validate(const std::string &str, const UnaryPredicate &accept, const bool invert=false)
Return a copy of the input string with validated characters.
label size() const
The surface size is the number of faces.
fileName path() const
The complete path.
defineTypeNameAndDebug(combustionModel, 0)
virtual label nFaces() const
Return the number of raw faces.
#define WarningInFunction
Report a warning using Foam::Warning.
void copySurface(const pointField &points, const faceList &faces, bool validate=false)
Update with new contents.
const fileName & facesInstance() const
Return the current instance directory for faces.
const objectRegistry & db() const noexcept
Return the local objectRegistry.