Go to the documentation of this file.
71 #ifndef surfaceWriter_H
72 #define surfaceWriter_H
98 Ostream&
operator<<(Ostream&
os,
const InfoProxy<surfaceWriter>& ip);
118 std::reference_wrapper<const meshedSurf>
surf_;
167 virtual bool merge()
const;
178 #undef declareSurfaceWriterMergeMethod
179 #define declareSurfaceWriterMergeMethod(Type) \
180 tmp<Field<Type>> mergeField(const Field<Type>& fld) const;
189 #undef declareSurfaceWriterMergeMethod
195 const word& fieldName,
196 const Field<Type>& localValues
201 return this->
write();
253 const word& writeType,
331 virtual void clear();
387 inline label
nFields(
const label
n);
408 inline bool verbose(
const bool on);
415 inline scalar
mergeDim(
const scalar dist);
491 virtual void close();
500 #undef declareSurfaceWriterWriteMethod
501 #define declareSurfaceWriterWriteMethod(Type) \
503 virtual fileName write \
505 const word& fieldName, \
506 const Field<Type>& values \
517 #undef declareSurfaceWriterWriteMethod
518 #define declareSurfaceWriterWriteMethod(Type) \
521 virtual fileName write \
523 const word& fieldName, \
524 const Field<Type>& values \
531 virtual InfoProxy<surfaceWriter>
info()
const
537 friend Ostream&
operator<<
546 #ifdef Foam_surfaceWriter_directAccess
vectorField pointField
pointField is a vectorField.
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?
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()
Default construct.
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,...
OBJstream os(runTime.globalPath()/outputName)
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.
List< face > faceList
A List of faces.
static autoPtr< surfaceWriter > New(const word &writeType)
Return a reference to the selected surfaceWriter.
static bool & parRun() noexcept
Test if this a parallel run.
meshedSurfRef surfComp_
Reference to raw surface components.
virtual bool usesFaceIds() const
True if the writer format uses faceIds as part of its output.
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)