54 Foam::scalar Foam::areaWrite::mergeTol_ = 1
e-10;
62 Foam::areaWrite::areaWrite
70 loadFromFiles_(false),
88 Foam::areaWrite::areaWrite
93 const bool loadFromFiles
96 functionObjects::fvMeshFunctionObject(
name, obr,
dict),
97 loadFromFiles_(loadFromFiles),
130 selectAreas_.clear();
131 fieldSelection_.clear();
140 obr_.time().constant(),
156 if (selectAreas_.empty())
163 if (available.
size())
165 areaName = available.
first();
169 if (!areaName.empty())
171 selectAreas_.resize(1);
172 selectAreas_.first() = areaName;
177 meshes_.filterKeys(selectAreas_);
180 fieldSelection_.uniq();
184 const word writerType =
dict.
get<word>(
"surfaceFormat");
186 const dictionary writerOptions
191 for (
const word& areaName : meshes_.keys())
198 surfWriter->useTimeDir(
true);
199 surfWriter->verbose(verbose_);
201 writers_.set(areaName, surfWriter);
225 for (
const word& areaName : meshes_.sortedToc())
234 surfptr =
new polySurface(areaName, *surfaces_,
true);
243 surfaceWriter& outWriter = *writers_[areaName];
245 if (outWriter.needsUpdate())
247 outWriter.setSurface(*surfptr);
256 IOobjectList objects(0);
263 allFields = objects.names();
264 selected = objects.classes(fieldSelection_);
279 forAll(fieldSelection_, i)
292 << (loadFromFiles_ ?
"field file" :
"registered field")
294 << UIndirectList<wordRe>(fieldSelection_, missed) <<
endl;
299 label nAreaFields = 0;
303 const word& clsName = iter.key();
304 const label
n = iter.val().size();
318 outWriter.nFields(nAreaFields);
323 outWriter.open(outputPath_/areaName);
325 outWriter.beginTime(obr_.time());
332 #define doLocalCode(Type) \ 335 GeometricField<Type, Foam::faPatchField, Foam::areaMesh> \ 338 outWriter, areaMesh, objects \ 349 #define doLocalCode(Type) \ 352 DimensionedField<Type, Foam::areaMesh> \ 355 outWriter, areaMesh, objects \ 372 if (!outWriter.wroteData())
384 void Foam::areaWrite::expire()
389 const scalar mergeDim = mergeTol_ * mesh_.bounds().mag();
395 writer.mergeDim(mergeDim);
402 if (&mpm.mesh() == &mesh_)
435 scalar old(mergeTol_);
A surface mesh consisting of general polygon faces and capable of holding fields. ...
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
void size(const label n)
Older name for setAddressableSize.
virtual void readUpdate(const polyMesh::readUpdateState state)
Update for changes of mesh due to readUpdate - expires the surfaces.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
bool found(const ListType &input, const UnaryPredicate &pred, const label start=0)
Same as found_if.
constexpr char nl
The newline '\n' character (0x0a)
List< face > faceList
A List of faces.
wordList names() const
The unsorted names of all objects.
T & first()
Access first element of the list, position [0].
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ignore writing from objectRegistry::writeObject()
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
Abstract base-class for Time/database function objects.
static dictionary formatOptions(const dictionary &dict, const word &formatName, const word &entryName="formatOptions")
Same as fileFormats::getFormatOptions.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual const objectRegistry & thisDb() const
Return reference to the mesh database.
Macros for easy insertion into run-time selection tables.
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh - expires the surfaces.
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
const uindirectPrimitivePatch & patch() const
Return constant reference to primitive patch.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect...
static scalar mergeTol() noexcept
Get merge tolerance.
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
const wordList area
Standard area field types (scalar, vector, tensor, etc)
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
A class for handling words, derived from Foam::string.
Type * getObjectPtr(const word &name, const bool recursive=false) const
Return non-const pointer to the object of the given Type, using a const-cast to have it behave like a...
const Time & time() const noexcept
Return time registry.
virtual bool write()
Sample and write.
void clear()
Clear all entries from table.
wordList sortedNames() const
The sorted names of all objects.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
A HashTable similar to std::unordered_map.
#define doLocalCode(Type)
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
vtk::internalMeshWriter writer(topoMesh, topoCells, vtk::formatType::INLINE_ASCII, runTime.path()/"blockTopology")
defineTypeNameAndDebug(combustionModel, 0)
static bool clean(std::string &str)
Cleanup filename string, possibly applies other transformations such as changing the path separator e...
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
bool verbose(const bool on) noexcept
Enable/disable verbose output.
void transfer(pointField &&points, faceList &&faces, labelList &&zoneIds=labelList())
Transfer the contents of the argument and annul the argument.
#define WarningInFunction
Report a warning using Foam::Warning.
const wordList area_internal
Standard dimensioned field types (scalar, vector, tensor, etc)
virtual bool read(const dictionary &dict)
Read the areaWrite dictionary.
Mesh data needed to do the Finite Area discretisation.
virtual void movePoints(const polyMesh &mesh)
Update for mesh point-motion - expires the surfaces.
Base class for surface writers.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
readUpdateState
Enumeration defining the state of the mesh after a read update.
Registry of regIOobjects.
static void mapCombineReduce(Container &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine map values from different processo...
Defines the attributes of an object for which implicit objectRegistry management is supported...
HashTable< const Type * > lookupClass(const bool strict=false) const
Return all objects with a class satisfying isA<Type>
virtual bool execute()
Execute, currently does nothing.
Do not request registration (bool: false)
static autoPtr< surfaceWriter > New(const word &writeType)
Return a reference to the selected surfaceWriter.
forAllConstIters(mixture.phases(), phase)
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.