Go to the documentation of this file.
53 Foam::scalar Foam::areaWrite::mergeTol_ = 1
e-10;
57 Foam::areaWrite::areaWrite
65 loadFromFiles_(
false),
69 time_.globalPath()/functionObject::outputPrefix/
name
83 Foam::areaWrite::areaWrite
88 const bool loadFromFiles
92 loadFromFiles_(loadFromFiles),
96 time_.globalPath()/functionObject::outputPrefix/
name
114 verbose_ = verbosity;
123 selectAreas_.clear();
124 fieldSelection_.clear();
133 obr_.time().constant(),
149 if (selectAreas_.empty())
156 if (available.size())
158 areaName = available.first();
162 if (!areaName.empty())
165 selectAreas_.first() = areaName;
170 meshes_.filterKeys(selectAreas_);
173 fieldSelection_.uniq();
184 for (
const word& areaName : meshes_.keys())
191 surfWriter->useTimeDir() =
true;
192 surfWriter->verbose() = verbose_;
194 writers_.set(areaName, surfWriter);
218 for (
const word& areaName : meshes_.sortedToc())
227 surfptr =
new polySurface(areaName, *surfaces_,
true);
234 surfptr->
transfer(std::move(pts), std::move(fcs));
253 allFields = objects.names();
254 selected = objects.classes(fieldSelection_);
272 forAll(fieldSelection_, i)
274 if (
findStrings(fieldSelection_[i], allFields).empty())
285 << (loadFromFiles_ ?
"field file" :
"registered field")
292 label nAreaFields = 0;
296 const word& clsName = iter.key();
297 const label
n = iter.val().size();
307 outWriter.
nFields() = nAreaFields;
312 outWriter.
open(outputPath_/areaName);
318 performAction<areaScalarField>(outWriter,
areaMesh, objects);
319 performAction<areaVectorField>(outWriter,
areaMesh, objects);
320 performAction<areaSphericalTensorField>(outWriter,
areaMesh, objects);
321 performAction<areaSymmTensorField>(outWriter,
areaMesh, objects);
322 performAction<areaTensorField>(outWriter,
areaMesh, objects);
341 void Foam::areaWrite::expire()
346 const scalar mergeDim = mergeTol_ * mesh_.bounds().mag();
352 writer.mergeDim() = mergeDim;
359 if (&mpm.
mesh() == &mesh_)
392 const scalar prev(mergeTol_);
static void mapCombineGather(const List< commsStruct > &comms, Container &Values, const CombineOp &cop, const int tag, const label comm)
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Type * getObjectPtr(const word &name, const bool recursive=false) const
wordList sortedNames() const
The sorted names of all objects.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
virtual fileName write()=0
Write separate surface geometry to file.
Base class for surface writers.
virtual bool execute()
Execute, currently does nothing.
virtual void movePoints(const polyMesh &mesh)
Update for mesh point-motion - expires the surfaces.
void verbose(const bool verbosity=true)
Set verbosity level.
virtual void setSurface(const meshedSurf &surf, bool parallel)
void transfer(pointField &&points, faceList &&faces, labelList &&zoneIds=labelList())
Transfer the contents of the argument and annul the argument.
const Time & time() const
Return time.
static bool & parRun()
Is this a parallel run?
static word timeName(const scalar t, const int precision=precision_)
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh - expires the surfaces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
static scalar mergeTol()
Get merge tolerance.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Mesh consisting of general polyhedral cells.
virtual void readUpdate(const polyMesh::readUpdateState state)
Update for changes of mesh due to readUpdate - expires the surfaces.
#define forAll(list, i)
Loop across all elements in list.
Registry of regIOobjects.
HashTable< const Type * > lookupClass(const bool strict=false) const
Return all objects with a class satisfying isA<Type>
A surface mesh consisting of general polygon faces and capable of holding fields.
virtual void endTime()
End a time-step.
virtual void beginTime(const Time &t)
Begin a time-step.
word name(const complex &c)
Return string representation of complex.
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.
virtual bool needsUpdate() const
Does the writer need an update (eg, lagging behind surface changes)
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Mesh data needed to do the Finite Area discretisation.
void resize(const label newSize)
Adjust allocated size of list.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
virtual bool wroteData() const
Geometry or fields written since the last open?
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Combine HashSet operation. Equivalent to 'a |= b'.
Macros for easy insertion into run-time selection tables.
Base class for graphics format writing. Entry points are.
labelList findStrings(const regExp &matcher, const UList< StringType > &input, const bool invert=false)
Return list indices for strings matching the regular expression.
List of IOobjects with searching and retrieving facilities.
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
readUpdateState
Enumeration defining the state of the mesh after a read update.
A HashTable similar to std::unordered_map.
forAllConstIters(mixture.phases(), phase)
static void mapCombineScatter(const List< commsStruct > &comms, Container &Values, const int tag, const label comm)
Scatter data. Reverse of combineGather.
void clear()
Clear all entries from table.
virtual bool write()
Sample and write.
wordList names() const
The names of all objects.
static autoPtr< surfaceWriter > New(const word &writeType)
Return a reference to the selected surfaceWriter.
const dimensionedScalar e
Elementary charge.
const wordList area
Standard area field types (scalar, vector, tensor, etc)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Finite area mesh. Used for 2-D non-Euclidian finite area method.
A List with indirect addressing.
label nFields() const
The number of expected output fields.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
const polyMesh & mesh() const
Return polyMesh.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
const objectRegistry & thisDb() const
Return the object registry.
virtual bool read(const dictionary &dict)
Read the areaWrite dictionary.
virtual void open(const fileName &outputPath)
Open for output on specified path, using existing surface.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const