106 #ifndef Foam_surfaceWriter_H 107 #define Foam_surfaceWriter_H 134 Ostream& operator<<(Ostream& os, const InfoProxy<surfaceWriter>& ip);
217 virtual bool merge()
const;
240 #undef declareSurfaceFieldMethods 241 #define declareSurfaceFieldMethods(Type) \ 243 tmp<Field<Type>> mergeField(const Field<Type>& fld) const; \ 245 tmp<Field<Type>> adjustField \ 247 const word& fieldName, \ 248 const tmp<Field<Type>>& tfield \ 258 #undef declareSurfaceFieldMethods 264 const word& fieldName,
270 return this->
write();
315 const word& formatName,
316 const word& entryName =
"formatOptions" 323 const dictionary& surfDict,
324 const word& formatName,
325 const word& entryName =
"formatOptions" 336 static autoPtr<surfaceWriter>
TryNew(
const word& writeType);
340 static autoPtr<surfaceWriter>
TryNew 342 const word& writeType,
343 const dictionary& writeOptions
352 const word& writeType,
413 virtual void clear();
422 const meshedSurf& surf,
439 const meshedSurf& surf
586 virtual
void close();
595 #undef declareSurfaceWriterWriteMethod 596 #define declareSurfaceWriterWriteMethod(Type) \ 598 virtual fileName write \ 600 const word& fieldName, \ 601 const Field<Type>& values \ 612 #undef declareSurfaceWriterWriteMethod 613 #define declareSurfaceWriterWriteMethod(Type) \ 616 virtual fileName write \ 618 const word& fieldName, \ 619 const Field<Type>& values \ 642 #ifdef Foam_surfaceWriter_directAccess bool hasTime() const
True if there is a known time.
virtual bool usesFaceIds() const
True if the writer format uses faceIds as part of its output.
declareRunTimeSelectionTable(autoPtr, surfaceWriter, word,(),())
bool is_open() const noexcept
Test if outputPath has been set.
label size() const
The global number of faces for the associated surface.
virtual bool expire()
Mark that surface changed and the writer will need an update, and set nFields = 0.
A class for handling file names.
surfaceWriter()
Default construct.
commsTypes
Communications types.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
bool empty() const
The surface to write is empty if the global number of faces is zero.
dictionary fieldLevel_
Field level to remove (on output)
void checkOpen() const
Verify that the outputPath_ has been set or FatalError.
virtual void open(const fileName &outputPath)
Open for output on specified path, using existing surface.
static const fileName null
An empty fileName.
const meshedSurf & surface() const
Merge surfaces (if not upToDate) and return merged (parallel) or regular surface (non-parallel) ...
const meshedSurfRef & adjustSurface() const
Merge surfaces (if not upToDate) and return merged (parallel) or regular surface (non-parallel) and a...
point geometryCentre_
The centre of rotation (untranslate, translate)
virtual bool separateGeometry() const
True if the surface format requires geometry in a separate file.
meshedSurfRef adjustedSurf_
The surface after point coordinate transforms and scaling.
bool parallel_
Writing in parallel (via master)
static bool supportedType(const word &writeType)
True if New is likely to succeed for this writeType.
scalar timeValue() const
The current time value/name.
fileName writeTemplate(const word &fieldName, const Field< Type > &localValues)
Dummy templated write operation.
bool wroteGeom_
Track if geometry has been written since the last open.
static dictionary formatOptions(const dictionary &dict, const word &formatName, const word &entryName="formatOptions")
Same as fileFormats::getFormatOptions.
mergedSurf mergedSurf_
Surface after merging (parallel)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual InfoProxy< surfaceWriter > info() const noexcept
Return info proxy, used to print information to a stream.
UPstream::commsTypes commType_
Communication type (for field merging)
virtual ~surfaceWriter()
Destructor. Calls close()
Abstract definition of a meshed surface defined by faces and points.
bool isPointData() const noexcept
Are the field data to be treated as point data?
const word & timeName() const
The current time value/name.
static scalar defaultMergeDim
The default merge dimension (1e-8)
List< face > faceList
List of faces.
virtual void clear()
Close any open output, remove association with a surface and expire the writer. The parallel flag rem...
virtual void setSurface(const meshedSurf &surf, bool parallel)
Change association with a surface, expire the writer with defined parallel/serial treatment...
#define declareSurfaceFieldMethods(Type)
virtual void endTime()
End a time-step.
vectorField pointField
pointField is a vectorField.
bool useTimeDir_
Insert additional time sub-directory in the output path.
label nFields_
The number of fields.
Generic templated field type.
Implements a meshed surface by referencing another meshed surface or faces/points components...
A class for handling words, derived from Foam::string.
virtual bool needsUpdate() const
Does the writer need an update (eg, lagging behind surface changes)
coordSystem::cartesian geometryTransform_
Local coordinate system transformation.
scalar mergeDim() const noexcept
The current value of the point merge dimension (metre)
scalar geometryScale_
Output geometry scaling after rotate/translate.
bool verbose() const noexcept
Get output verbosity.
bool hasSurface() const
Writer is associated with a surface.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
tmp< Field< Type > > mergeFieldTemplate(const Field< Type > &fld) const
Gather (merge) fields with renumbering and shrinking for point data.
bool isPointData_
Is point vs cell data.
virtual void close()
Finish output, performing any necessary cleanup.
TypeName("surfaceWriter")
Runtime type information.
tmp< Field< Type > > adjustFieldTemplate(const word &fieldName, const tmp< Field< Type >> &tfield) const
Apply refLevel and fieldScaling.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
dictionary fieldScale_
Field scaling (on output)
Basic run-time type information using word as the type's name. Used to enhance the standard RTTI to c...
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name...
scalar mergeDim_
Dimension for merging.
label nFields() const noexcept
The number of expected output fields.
A helper class for outputting values to Ostream.
vector point
Point is a vector.
bool useTimeDir() const noexcept
Should a time directory be spliced into the output path?
fileName outputPath_
The full output directory and file (surface) name.
virtual bool wroteData() const
Geometry or fields written since the last open?
const coordSystem::cartesian & transform() const noexcept
The current (cartesian) coordinate system transformation.
virtual bool merge() const
Merge surfaces if they are not already upToDate (parallel) or simply mark the surface as being up-to-...
virtual bool enabled() const
The writer is enabled. If the writer is not enabled, it may be possible for the caller to skip variou...
Base class for surface writers.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
bool verbose_
Additional output verbosity.
virtual fileName write()=0
Write separate surface geometry to file.
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
Tensor of scalars, i.e. Tensor<scalar>.
#define declareSurfaceWriterWriteMethod(Type)
meshedSurfRef surf_
Reference to surface or surface components.
instant currTime_
The current time value/name.
static autoPtr< surfaceWriter > TryNew(const word &writeType)
Optional select construct surfaceWriter.
void unsetTime()
Clear the current time.
static autoPtr< surfaceWriter > New(const word &writeType)
Select construct a surfaceWriter.
bool upToDate_
The topology/surface is up-to-date?
virtual void beginTime(const Time &t)
Begin a time-step.
void setTime(const instant &inst)
Set the current time.
scalar scale() const noexcept
The current value of the geometry scaling.