41 bool Foam::sampledSurfaces::verbose_ =
false;
42 Foam::scalar Foam::sampledSurfaces::mergeTol_ = 1
e-10;
47 void Foam::sampledSurfaces::writeGeometry()
const 52 const fileName outputDir = outputPath_/mesh_.time().timeName();
56 const sampledSurface& s = operator[](surfI);
66 mergeList_[surfI].points,
67 mergeList_[surfI].faces
71 else if (s.faces().size())
87 Foam::sampledSurfaces::sampledSurfaces
92 const bool loadFromFiles
97 mesh_(refCast<const fvMesh>(obr)),
98 loadFromFiles_(loadFromFiles),
107 outputPath_ = mesh_.time().path()/
".."/
"postProcessing"/name_;
111 outputPath_ = mesh_.time().path()/
"postProcessing"/name_;
128 verbose_ = verbosity;
157 const label nFields = classifyFields();
163 Pout<<
"Creating directory " 164 << outputPath_/mesh_.time().timeName() <<
nl <<
endl;
168 mkDir(outputPath_/mesh_.time().timeName());
173 if (nFields == 0 || formatter_->separateGeometry())
178 const IOobjectList objects(mesh_, mesh_.time().timeName());
180 sampleAndWrite<volScalarField>(objects);
181 sampleAndWrite<volVectorField>(objects);
182 sampleAndWrite<volSphericalTensorField>(objects);
183 sampleAndWrite<volSymmTensorField>(objects);
184 sampleAndWrite<volTensorField>(objects);
186 sampleAndWrite<surfaceScalarField>(objects);
187 sampleAndWrite<surfaceVectorField>(objects);
188 sampleAndWrite<surfaceSphericalTensorField>(objects);
189 sampleAndWrite<surfaceSymmTensorField>(objects);
190 sampleAndWrite<surfaceTensorField>(objects);
197 bool surfacesFound = dict.
found(
"surfaces");
201 dict.
lookup(
"fields") >> fieldSelection_;
203 dict.
lookup(
"interpolationScheme") >> interpolationScheme_;
204 const word writeType(dict.
lookup(
"surfaceFormat"));
223 mergeList_.setSize(size());
231 Info<<
"Reading surface description:" <<
nl;
234 Info<<
" " << operator[](surfI).name() <<
nl;
242 Pout<<
"sample fields:" << fieldSelection_ <<
nl 243 <<
"sample surfaces:" <<
nl <<
"(" <<
nl;
247 Pout<<
" " << operator[](surfI) <<
endl;
281 if (
operator[](surfI).needsUpdate())
293 bool justExpired =
false;
297 if (
operator[](surfI).expire())
305 mergeList_[surfI].clear();
316 bool updated =
false;
328 if (
operator[](surfI).update())
338 scalar mergeDim = mergeTol_ * mesh_.bounds().mag();
342 Pout<<
nl <<
"Merging all points within " 343 << mergeDim <<
" metre" <<
endl;
368 mergeList_[surfI].faces,
369 mergeList_[surfI].pointsMap
static bool & parRun()
Is this a parallel run?
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
const pointField & points
virtual bool update()
Update the surfaces as required and merge surface points (parallel).
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
List of IOobjects with searching and retrieving facilities.
An abstract class for surfaces with sampling.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual void write()
Sample and write.
virtual void movePoints(const polyMesh &)
Update for mesh point-motion - expires the surfaces.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
virtual void execute()
Execute, currently does nothing.
virtual bool needsUpdate() const
Does any of the surfaces need an update?
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual void readUpdate(const polyMesh::readUpdateState state)
Update for changes of mesh due to readUpdate - expires the surfaces.
virtual bool expire()
Mark the surfaces as needing an update.
static void gatherAndMerge(const scalar mergeDist, const PrimitivePatch< Face, FaceList, PointField, PointType > &p, Field< PointType > &mergedPoints, List< Face > &mergedFaces, labelList &pointMergeMap)
Gather points and faces onto master and merge into single patch.
const double e
Elementary charge.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void end()
Execute at the final time-loop, currently does nothing.
readUpdateState
Enumeration defining the state of the mesh after a read update.
void verbose(const bool verbosity=true)
Set verbosity level.
static const fileName null
An empty fileName.
virtual bool update()=0
Update the surface as required.
Istream and Ostream manipulators taking arguments.
virtual void read(const dictionary &)
Read the sampledSurfaces dictionary.
A list of faces which address into the list of points.
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh - expires the surfaces.
Mesh consisting of general polyhedral cells.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Registry of regIOobjects.
Class used for the PtrLists read-construction.
static bool master(const label communicator=0)
Am I the master process.
bool read(const char *, int32_t &)
virtual const pointField & points() const =0
Points of surface.
A List obtained as a section of another List.
virtual const faceList & faces() const =0
Faces of surface.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
virtual ~sampledSurfaces()
Destructor.
static const word null
An empty word.
static autoPtr< surfaceWriter > New(const word &writeType)
Return a reference to the selected surfaceWriter.
defineTypeNameAndDebug(combustionModel, 0)
dictionary subOrEmptyDict(const word &, const bool mustRead=false) const
Find and return a sub-dictionary as a copy, or.
prefixOSstream Pout(cout,"Pout")