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
125 selectAreas_.clear();
126 fieldSelection_.clear();
135 obr_.time().constant(),
151 if (selectAreas_.empty())
158 if (available.size())
160 areaName = available.first();
164 if (!areaName.empty())
167 selectAreas_.first() = areaName;
172 meshes_.filterKeys(selectAreas_);
175 fieldSelection_.uniq();
186 for (
const word& areaName : meshes_.keys())
193 surfWriter->useTimeDir(
true);
194 surfWriter->verbose(verbose_);
196 writers_.set(areaName, surfWriter);
220 for (
const word& areaName : meshes_.sortedToc())
229 surfptr =
new polySurface(areaName, *surfaces_,
true);
236 surfptr->
transfer(std::move(pts), std::move(fcs));
255 allFields = objects.names();
256 selected = objects.classes(fieldSelection_);
274 forAll(fieldSelection_, i)
276 if (
findStrings(fieldSelection_[i], allFields).empty())
287 << (loadFromFiles_ ?
"field file" :
"registered field")
294 label nAreaFields = 0;
298 const word& clsName = iter.key();
299 const label
n = iter.val().size();
309 outWriter.
nFields(nAreaFields);
314 outWriter.
open(outputPath_/areaName);
320 performAction<areaScalarField>(outWriter,
areaMesh, objects);
321 performAction<areaVectorField>(outWriter,
areaMesh, objects);
322 performAction<areaSphericalTensorField>(outWriter,
areaMesh, objects);
323 performAction<areaSymmTensorField>(outWriter,
areaMesh, objects);
324 performAction<areaTensorField>(outWriter,
areaMesh, objects);
343 void Foam::areaWrite::expire()
348 const scalar mergeDim = mergeTol_ * mesh_.bounds().mag();
354 writer.mergeDim(mergeDim);
361 if (&mpm.
mesh() == &mesh_)
394 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 resize(const label len)
Adjust allocated size of list.
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.
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.
bool verbose(const bool on)
Enable/disable verbose output.
#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.
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.
#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.
static bool & parRun() noexcept
Test if this a parallel run.
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.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
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.
const Time & time() const noexcept
Return time registry.
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