Go to the documentation of this file.
90 time().findInstance(meshDir(),
"points"),
99 time().findInstance(meshDir(),
"faces"),
106 MeshReference(this->storedIOFaces(), this->storedIOPoints()),
113 time().findInstance(meshDir(),
"surfZones"),
123 Foam::surfMesh::surfMesh
125 const word& surfName,
151 MeshReference(this->storedIOFaces(), this->storedIOPoints()),
168 Foam::surfMesh::surfMesh
197 MeshReference(this->storedIOFaces(), this->storedIOPoints()),
213 <<
"IOobject: " << io.
path() <<
nl
214 <<
" name: " << io.
name()
216 <<
" local: " << io.
local()
218 <<
"creating surfMesh at instance " << instance() <<
endl;
224 Foam::surfMesh::surfMesh
253 MeshReference(this->storedIOFaces(), this->storedIOPoints()),
269 <<
"IOobject: " << io.
path() <<
nl
270 <<
" name: " << io.
name()
272 <<
" local: " << io.
local()
274 <<
"creating surfMesh at instance " << instance() <<
nl
275 <<
"timeName: " << instance() <<
endl;
317 this->updatePointsRef();
318 this->updateFacesRef();
333 this->
nPoints() != points.size()
334 || this->nFaces() != faces.size()
341 this->storedIOPoints() =
points;
342 this->storedIOFaces() = faces;
362 || this->nFaces() != surf.
faces().size()
369 this->storedIOPoints() = surf.
points();
370 this->storedIOFaces() = surf.
faces();
390 || this->nFaces() != surf.
surfFaces().size()
397 this->storedIOPoints() = surf.points();
398 this->storedIOFaces() = surf.
surfFaces();
438 aptr->storedPoints().transfer(this->storedPoints());
439 aptr->storedFaces().transfer(this->storedFaces());
440 aptr->storedZones().transfer(this->storedZones());
452 return dbDir()/meshSubDir;
458 return this->storedIOPoints().instance();
464 return this->storedIOFaces().instance();
470 return this->
points().size();
476 return this->faces().size();
482 return this->storedIOPoints();
488 return this->storedIOFaces();
497 if (surfZones_.size() <= 1)
510 if (
count < nFaces())
513 <<
"More faces " << nFaces() <<
" than zones " <<
count
514 <<
" ... extending final zone"
517 surfZones_.last().size() +=
count - nFaces();
519 else if (size() <
count)
522 <<
"More zones " <<
count <<
" than faces " << nFaces()
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());
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,...
virtual void updatePointsRef()
Update references to storedPoints.
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.
const word & name() const
Return name.
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.
static std::string path(const std::string &str)
Return directory path name (part before last /)
pointField & storedPoints()
Non-const access to global points.
Template functions to aid in the implementation of demand driven data.
virtual void updateRefs()
Update references to storedPoints/storedFaces.
const fileName & instance() const
thermo validate(args.executable(), "h")
virtual const faceList & faces() const =0
The faces used for the surface.
Abstract definition of a meshed surface defined by faces and points.
const List< Face > & surfFaces() const
Return const access to the faces.
A surface mesh consisting of general polygon faces.
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 .)
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.
const objectRegistry & db() const
Return the local objectRegistry.
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
static void write(const fileName &name, const MeshedSurfaceProxy &surf, const dictionary &options)
Write to file, select based on its extension.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
writeOption writeOpt() const
The write option.
void addZones(const surfZoneList &zones, bool validate=true)
Add surface zones, optionally validating the zone coverage.
word name(const complex &c)
Return string representation of complex.
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,...
virtual label nPoints() const
Return the number of raw points.
void removeFiles() const
Remove all files from mesh instance()
virtual void updateFacesRef()
Update references to storedFaces.
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
void transfer(MeshedSurface< face > &surf, bool validate=false)
Transfer the contents of the argument and annul the argument.
void shallowCopy(const UList< T > &list)
Copy the pointer held by the given UList.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
virtual ~surfMesh()
Destructor.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual const pointField & points() const
Return points.
#define DebugInfo
Report an information message using Foam::Info.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir)
A surface zone on a MeshedSurface.
readOption readOpt() const
The read option.
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)
autoPtr< MeshedSurface< face > > releaseGeom()
Release the geometry and return as a MeshedSurface<face>.
void write(const fileName &name, const dictionary &options=dictionary::null) const
Write to file, choosing writer based on its extension.
void checkZones()
Check the surface zone definitions.
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.