54Foam::scalar Foam::areaWrite::mergeTol_ = 1
e-10;
66 loadFromFiles_(false),
89 const bool loadFromFiles
92 functionObjects::fvMeshFunctionObject(
name, obr,
dict),
93 loadFromFiles_(loadFromFiles),
123 fvMeshFunctionObject::read(
dict);
126 selectAreas_.clear();
127 fieldSelection_.clear();
136 obr_.time().constant(),
148 meshes_ = obr().lookupClass<
faMesh>();
152 if (selectAreas_.empty())
159 if (available.
size())
161 areaName = available.
first();
165 if (!areaName.empty())
167 selectAreas_.resize(1);
168 selectAreas_.first() = areaName;
173 meshes_.filterKeys(selectAreas_);
176 fieldSelection_.uniq();
187 for (
const word& areaName : meshes_.keys())
194 surfWriter->useTimeDir(
true);
195 surfWriter->verbose(verbose_);
197 writers_.set(areaName, surfWriter);
221 for (
const word& areaName : meshes_.sortedToc())
230 surfptr =
new polySurface(areaName, *surfaces_,
true);
237 surfptr->
transfer(std::move(pts), std::move(fcs));
259 allFields = objects.
names();
260 selected = objects.
classes(fieldSelection_);
275 forAll(fieldSelection_, i)
288 << (loadFromFiles_ ?
"field file" :
"registered field")
295 label nAreaFields = 0;
299 const word& clsName = iter.key();
300 const label
n = iter.val().size();
310 outWriter.
nFields(nAreaFields);
315 outWriter.
open(outputPath_/areaName);
321 performAction<areaScalarField>(outWriter,
areaMesh, objects);
322 performAction<areaVectorField>(outWriter,
areaMesh, objects);
323 performAction<areaSphericalTensorField>(outWriter,
areaMesh, objects);
324 performAction<areaSymmTensorField>(outWriter,
areaMesh, objects);
325 performAction<areaTensorField>(outWriter,
areaMesh, objects);
344void Foam::areaWrite::expire()
349 const scalar mergeDim = mergeTol_ * mesh_.bounds().mag();
355 writer.mergeDim(mergeDim);
362 if (&mpm.
mesh() == &mesh_)
395 const scalar prev(mergeTol_);
Various functions to operate on Lists.
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
vtk::internalMeshWriter writer(topoMesh, topoCells, vtk::formatType::INLINE_ASCII, runTime.path()/"blockTopology")
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void append(const T &val)
Copy append an element to the end of this list.
const objectRegistry & thisDb() const
Return the object registry.
A HashTable similar to std::unordered_map.
void clear()
Clear all entries from table.
List of IOobjects with searching and retrieving facilities.
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.
wordList names() const
The unsorted names of the IOobjects.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static void mapCombineAllGather(const List< commsStruct > &comms, Container &values, const CombineOp &cop, const int tag, const label comm)
After completion all processors have the same data.
virtual bool read()
Re-read model coefficients if they have changed.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static word timeName(const scalar t, const int precision=precision_)
A List with indirect addressing. Like IndirectList but does not store addressing.
T & first()
Return the first element of the list.
void size(const label n)
Older name for setAddressableSize.
Mesh data needed to do the Finite Area discretisation.
Write finite area mesh/fields to standard output formats.
virtual bool read(const dictionary &dict)
Read the areaWrite dictionary.
static scalar mergeTol()
Get merge tolerance.
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Sample and write.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
int verbose() const noexcept
Output verbosity level.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
static bool clean(std::string &str)
Abstract base-class for Time/database function objects.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const polyMesh & mesh() const
Return polyMesh.
void movePoints()
Update for new mesh geometry.
void updateMesh()
Update for new mesh topology.
Registry of regIOobjects.
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.
const Time & time() const noexcept
Return time registry.
wordList names() const
The unsorted names of all objects.
Type * getObjectPtr(const word &name, const bool recursive=false) const
Mesh consisting of general polyhedral cells.
readUpdateState
Enumeration defining the state of the mesh after a read update.
A surface mesh consisting of general polygon faces and capable of holding fields.
void transfer(pointField &&points, faceList &&faces, labelList &&zoneIds=labelList())
Transfer the contents of the argument and annul the argument.
Base class for surface writers.
virtual void open(const fileName &outputPath)
Open for output on specified path, using existing surface.
virtual void endTime()
End a time-step.
virtual fileName write()=0
Write separate surface geometry to file.
virtual void beginTime(const Time &t)
Begin a time-step.
virtual void setSurface(const meshedSurf &surf, bool parallel)
virtual bool needsUpdate() const
Does the writer need an update (eg, lagging behind surface changes)
virtual bool wroteData() const
Geometry or fields written since the last open?
label nFields() const noexcept
The number of expected output fields.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define WarningInFunction
Report a warning using Foam::Warning.
bool found(const ListType &input, const UnaryPredicate &pred, const label start=0)
Same as found_if.
const wordList area
Standard area field types (scalar, vector, tensor, etc)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
Combine HashSet operation. Equivalent to 'a |= b'.