95#ifndef Foam_surfaceWriter_H
96#define Foam_surfaceWriter_H
122Ostream&
operator<<(Ostream&
os,
const InfoProxy<surfaceWriter>& ip);
199 virtual bool merge()
const;
222#undef declareSurfaceFieldMethod
223#define declareSurfaceFieldMethods(Type) \
225 tmp<Field<Type>> mergeField(const Field<Type>& fld) const; \
227 tmp<Field<Type>> adjustField \
229 const word& fieldName, \
230 const tmp<Field<Type>>& tfield \
240 #undef declareSurfaceFieldMethods
246 const word& fieldName,
304 const word& writeType,
365 virtual void clear();
538 virtual
void close();
547#undef declareSurfaceWriterWriteMethod
548#define declareSurfaceWriterWriteMethod(Type) \
550 virtual fileName write \
552 const word& fieldName, \
553 const Field<Type>& values \
564#undef declareSurfaceWriterWriteMethod
565#define declareSurfaceWriterWriteMethod(Type) \
568 virtual fileName write \
570 const word& fieldName, \
571 const Field<Type>& values \
593 #ifdef Foam_surfaceWriter_directAccess
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Generic templated field type.
A helper class for outputting values to Ostream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A Cartesian coordinate system.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
static const fileName null
An empty fileName.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name.
Simple class to manage surface merging information.
Implements a meshed surface by referencing another meshed surface or faces/points components.
Abstract definition of a meshed surface defined by faces and points.
Base class for surface writers.
surfaceWriter()
Default construct.
coordSystem::cartesian geometryTransform_
Local coordinate system transformation.
virtual void open(const fileName &outputPath)
Open for output on specified path, using existing surface.
meshedSurfRef surf_
Reference to surface or surface components.
virtual void endTime()
End a time-step.
virtual bool enabled() const
scalar geometryScale_
Output geometry scaling after rotate/translate.
virtual fileName write()=0
Write separate surface geometry to file.
bool useTimeDir_
Insert additional time sub-directory in the output path.
static autoPtr< surfaceWriter > New(const word &writeType)
Return a reference to the selected surfaceWriter.
bool wroteGeom_
Track if geometry has been written since the last open.
bool isPointData_
Is point vs cell data.
bool useTimeDir() const noexcept
Should a time directory be spliced into the output path?
meshedSurfRef adjustedSurf_
The surface after point coordinate transforms and scaling.
const meshedSurf & surface() const
bool isPointData() const noexcept
Are the field data to be treated as point data?
const word & timeName() const
The current time value/name.
fileName writeTemplate(const word &fieldName, const Field< Type > &localValues)
Dummy templated write operation.
void checkOpen() const
Verify that the outputPath_ has been set or FatalError.
void unsetTime()
Clear the current time.
scalar scale() const noexcept
The current value of the geometry scaling.
virtual void beginTime(const Time &t)
Begin a time-step.
label size() const
The global number of faces for the associated surface.
label nFields_
The number of fields.
static scalar defaultMergeDim
The default merge dimension (1e-8)
virtual ~surfaceWriter()
Destructor. Calls close()
virtual void setSurface(const meshedSurf &surf, bool parallel)
virtual void close()
Finish output, performing any necessary cleanup.
bool parallel_
Writing in parallel (via master)
bool empty() const
The surface to write is empty if the global number of faces is zero.
virtual InfoProxy< surfaceWriter > info() const
Return info proxy.
bool upToDate_
The topology/surface is up-to-date?
dictionary fieldLevel_
Field level to remove (on output)
static bool supportedType(const word &writeType)
True if New is likely to succeed for this writeType.
bool is_open() const noexcept
Test if outputPath has been set.
void setTime(const instant &inst)
Set the current time.
declareRunTimeSelectionTable(autoPtr, surfaceWriter, wordDict,(const dictionary &writeOpts),(writeOpts))
virtual bool merge() const
mergedSurf mergedSurf_
Surface after merging (parallel)
bool verbose_
Additional output verbosity.
tmp< Field< Type > > adjustFieldTemplate(const word &fieldName, const tmp< Field< Type > > &tfield) const
Apply refLevel and fieldScaling.
dictionary fieldScale_
Field scaling (on output)
virtual bool usesFaceIds() const
True if the writer format uses faceIds as part of its output.
virtual bool needsUpdate() const
Does the writer need an update (eg, lagging behind surface changes)
tmp< Field< Type > > mergeFieldTemplate(const Field< Type > &fld) const
Gather (merge) fields with renumbering and shrinking for point data.
instant currTime_
The current time value/name.
virtual bool separateGeometry() const
True if the surface format requires geometry in a separate file.
bool verbose() const noexcept
Get output verbosity.
bool hasSurface() const
Writer is associated with a surface.
const meshedSurfRef & adjustSurface() const
declareRunTimeSelectionTable(autoPtr, surfaceWriter, word,(),())
scalar timeValue() const
The current time value/name.
virtual bool wroteData() const
Geometry or fields written since the last open?
scalar mergeDim() const noexcept
The current value of the point merge dimension (metre)
bool hasTime() const
True if there is a known time.
fileName outputPath_
The full output directory and file (surface) name.
const coordSystem::cartesian & transform() const noexcept
The current (cartesian) coordinate system transformation.
label nFields() const noexcept
The number of expected output fields.
scalar mergeDim_
Dimension for merging.
TypeName("surfaceWriter")
Runtime type information.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
vectorField pointField
pointField is a vectorField.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
List< face > faceList
A List of faces.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define declareSurfaceFieldMethods(Type)
#define declareSurfaceWriterWriteMethod(Type)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.