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())
165 if (!available.
empty())
167 areaName = available.
front();
172 if (!areaName.empty())
174 selectAreas_.resize(1);
175 selectAreas_.front() = areaName;
184 meshes_ = faRegistry->csorted<faMesh>(selectAreas_);
188 fieldSelection_.uniq();
192 const word writerType =
dict.
get<word>(
"surfaceFormat");
199 for (
const faMesh& areaMesh : meshes_)
201 const word& areaName = areaMesh.name();
208 surfWriter->useTimeDir(
true);
209 surfWriter->verbose(verbose_);
211 writers_.set(areaName, surfWriter);
244 surfptr =
new polySurface(areaName, *surfaces_,
true);
248 faceList fcs(areaMesh.patch().localFaces());
253 surfaceWriter& outWriter = *writers_[areaName];
255 if (outWriter.needsUpdate())
257 outWriter.setSurface(*surfptr);
266 IOobjectList objects;
271 objects = IOobjectList(areaMesh.thisDb(), obr_.time().timeName());
273 allFields = objects.names();
274 selected = objects.classes(fieldSelection_);
279 allFields = areaMesh.thisDb().names();
280 selected = areaMesh.thisDb().classes(fieldSelection_);
289 forAll(fieldSelection_, i)
302 << (loadFromFiles_ ?
"field file" :
"registered field")
304 << UIndirectList<wordRe>(fieldSelection_, missed) <<
endl;
309 label nAreaFields = 0;
313 const word& clsName = iter.key();
314 const label
n = iter.val().size();
328 outWriter.nFields(nAreaFields);
333 outWriter.open(outputPath_/areaName);
335 outWriter.beginTime(obr_.time());
342 #define doLocalCode(Type) \ 345 GeometricField<Type, Foam::faPatchField, Foam::areaMesh> \ 348 outWriter, areaMesh, objects \ 359 #define doLocalCode(Type) \ 362 DimensionedField<Type, Foam::areaMesh> \ 365 outWriter, areaMesh, objects \ 382 if (!outWriter.wroteData())
394 void Foam::areaWrite::expire()
399 const scalar mergeDim = mergeTol_ * mesh_.bounds().mag();
405 writer.mergeDim(mergeDim);
412 if (&mpm.mesh() == &mesh_)
445 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 ...
virtual void readUpdate(const polyMesh::readUpdateState state)
Update for changes of mesh due to readUpdate - expires the surfaces.
vtk::lineWriter writer(edgeCentres, edgeList::null(), fileName(aMesh.time().globalPath()/"finiteArea-edgesCentres"))
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)
bool empty() const noexcept
True if List is empty (ie, size() is zero)
T & front()
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.
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.
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...
List< face > faceList
List of faces.
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 expressions::valueTypeCode::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...
virtual bool write()
Sample and write.
void clear()
Remove all entries from table.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
A HashTable similar to std::unordered_map.
#define doLocalCode(Type)
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...
defineTypeNameAndDebug(combustionModel, 0)
static bool clean(std::string &str)
Cleanup filename string, possibly applies other transformations such as changing the path separator e...
bool verbose(const bool on) noexcept
Enable/disable verbose output.
void transfer(pointField &&points, faceList &&faces, labelList &&zoneIds=labelList())
Transfer the contents (and annul the parameters). Removes existing fields.
#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.
static const objectRegistry * registry(const polyMesh &pMesh)
The parent registry containing all finite-area meshes on the polyMesh.
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...
virtual bool execute()
Execute, currently does nothing.
Do not request registration (bool: false)
static autoPtr< surfaceWriter > New(const word &writeType)
Select construct a surfaceWriter.
forAllConstIters(mixture.phases(), phase)
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)