Go to the documentation of this file.
71 #ifndef surfaceWriter_H
72 #define surfaceWriter_H
95 Ostream&
operator<<(Ostream& os,
const InfoProxy<surfaceWriter>& ip);
115 std::reference_wrapper<const meshedSurf>
surf_;
164 virtual bool merge()
const;
175 #undef declareSurfaceWriterMergeMethod
176 #define declareSurfaceWriterMergeMethod(Type) \
177 tmp<Field<Type>> mergeField(const Field<Type>& fld) const;
186 #undef declareSurfaceWriterMergeMethod
192 const word& fieldName,
193 const Field<Type>& localValues
198 return this->
write();
250 const word& writeType,
320 virtual void clear();
475 virtual void close();
484 #undef declareSurfaceWriterWriteMethod
485 #define declareSurfaceWriterWriteMethod(Type) \
487 virtual fileName write \
489 const word& fieldName, \
490 const Field<Type>& values \
501 #undef declareSurfaceWriterWriteMethod
502 #define declareSurfaceWriterWriteMethod(Type) \
505 virtual fileName write \
507 const word& fieldName, \
508 const Field<Type>& values \
515 virtual InfoProxy<surfaceWriter>
info()
const
521 friend Ostream&
operator<<
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
scalar timeValue() const
The current time value/name.
A class for handling words, derived from Foam::string.
virtual fileName write()=0
Write separate surface geometry to file.
A helper class for outputting values to Ostream.
Base class for surface writers.
A class for handling file names.
scalar mergeDim() const
The current value of the point merge dimension (metre)
TypeName("surfaceWriter")
Runtime type information.
A class for managing temporary objects.
static scalar defaultMergeDim
The default merge dimension (1e-8)
void unsetTime()
Clear the current time.
virtual bool merge() const
virtual void setSurface(const meshedSurf &surf, bool parallel)
bool useTimeDir() const
Should a time directory be spliced into the output path?
static bool & parRun()
Is this a parallel run?
void setTime(const instant &inst)
Set the current time.
bool useComponents_
Use raw surface components instead of surface reference.
bool useTimeDir_
Insert additional time sub-directory in the output path.
const meshedSurf & surface() const
Abstract definition of a meshed surface defined by faces and points.
bool hasTime() const
True if there is a known time.
label size() const
The global number of faces for the associated surface.
static const meshedSurf::emptySurface emptySurface_
Placeholder.
Implements a meshed surface by referencing existing faces and points.
fileName writeTemplate(const word &fieldName, const Field< Type > &localValues)
Dummy templated write operation.
const word & timeName() const
The current time value/name.
bool empty() const
The surface to write is empty if the global number of faces is zero.
bool isPointData() const
Are the field data to be treated as point data?
#define declareSurfaceWriterMergeMethod(Type)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
bool verbose() const
Get output verbosity.
virtual void endTime()
End a time-step.
bool upToDate_
The topology/surface is up-to-date?
virtual void beginTime(const Time &t)
Begin a time-step.
Generic templated field type.
label nFields_
The number of fields.
Simple class to manage surface merging information.
std::reference_wrapper< const meshedSurf > surf_
Reference to a surface.
bool parallel_
Writing in parallel (via master)
scalar mergeDim_
Dimension for merging.
bool checkOpen() const
Verify that the outputPath_ has been set or FatalError.
surfaceWriter()
Construct null.
virtual bool needsUpdate() const
Does the writer need an update (eg, lagging behind surface changes)
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
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))
fileName outputPath_
The full output directory and file (surface) name.
virtual bool wroteData() const
Geometry or fields written since the last open?
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual InfoProxy< surfaceWriter > info() const
Return info proxy.
virtual bool enabled() const
Vector< scalar > vector
A scalar version of the templated Vector.
bool isPointData_
Is point vs cell data.
static const fileName null
An empty fileName.
virtual bool separateGeometry() const
True if the surface format requires geometry in a separate file.
A concrete meshedSurf class without faces, points, etc.
declareRunTimeSelectionTable(autoPtr, surfaceWriter, word,(),())
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
instant currTime_
The current time value/name.
Macros to ease declaration of run-time selection tables.
static autoPtr< surfaceWriter > New(const word &writeType)
Return a reference to the selected surfaceWriter.
meshedSurfRef surfComp_
Reference to raw surface components.
virtual ~surfaceWriter()
Destructor. Calls close()
bool hasSurface() const
Writer is associated with a surface.
label nFields() const
The number of expected output fields.
An instant of time. Contains the time value and name.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool wroteGeom_
Track if geometry has been written since the last open.
tmp< Field< Type > > mergeFieldTemplate(const Field< Type > &fld) const
Gather (merge) fields with renumbering and shrinking for point data.
bool verbose_
Additional output verbosity.
virtual void close()
Finish output, performing any necessary cleanup.
#define declareSurfaceWriterWriteMethod(Type)
Tensor< scalar > tensor
Tensor of scalars, i.e. Tensor<scalar>.
static bool supportedType(const word &writeType)
True if New is likely to succeed for this writeType.
virtual void open(const fileName &outputPath)
Open for output on specified path, using existing surface.
mergedSurf merged_
Merging information and the resulting merged surface (parallel)