A surfaceWriter for special purpose debugging. Its definition and behaviour are subject to change at any time. More...
#include <debugSurfaceWriter.H>


Public Member Functions | |
| TypeNameNoDebug ("debug") | |
| Declare type-name, virtual type (without debug switch). | |
| debugWriter () | |
| Default construct. | |
| debugWriter (const dictionary &options) | |
| Construct with some output options. | |
| debugWriter (const meshedSurf &surf, const fileName &outputPath, bool parallel=UPstream::parRun(), const dictionary &options=dictionary()) | |
| Construct from components. | |
| debugWriter (const pointField &points, const faceList &faces, const fileName &outputPath, bool parallel=UPstream::parRun(), const dictionary &options=dictionary()) | |
| Construct from components. | |
| virtual | ~debugWriter ()=default |
| Destructor. | |
| virtual fileName | write () |
| Write surface geometry to file. | |
| declareSurfaceWriterWriteMethod (label) | |
| declareSurfaceWriterWriteMethod (scalar) | |
| declareSurfaceWriterWriteMethod (vector) | |
| declareSurfaceWriterWriteMethod (sphericalTensor) | |
| declareSurfaceWriterWriteMethod (symmTensor) | |
| declareSurfaceWriterWriteMethod (tensor) | |
| template<class Type> | |
| Foam::tmp< Foam::Field< Type > > | mergeField (const Field< Type > &fld) const |
| template<class Type> | |
| Foam::fileName | writeTemplate (const word &fieldName, const Field< Type > &localValues) |
| Public Member Functions inherited from surfaceWriter | |
| TypeName ("surfaceWriter") | |
| Runtime type information. | |
| declareRunTimeSelectionTable (autoPtr, surfaceWriter, word,(),()) | |
| declareRunTimeSelectionTable (autoPtr, surfaceWriter, wordDict,(const dictionary &writeOpts),(writeOpts)) | |
| surfaceWriter () | |
| Default construct. | |
| surfaceWriter (const dictionary &options) | |
| Default construct with specified options. | |
| virtual | ~surfaceWriter () |
| Destructor. Calls close(). | |
| virtual bool | enabled () const |
| The writer is enabled. If the writer is not enabled, it may be possible for the caller to skip various preparatory operations. | |
| virtual bool | separateGeometry () const |
| True if the surface format requires geometry in a separate file. | |
| 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). | |
| virtual bool | wroteData () const |
| Geometry or fields written since the last open? | |
| virtual bool | expire () |
| Mark that surface changed and the writer will need an update, and set nFields = 0. | |
| virtual void | clear () |
| Close any open output, remove association with a surface and expire the writer. The parallel flag remains untouched. | |
| virtual void | setSurface (const meshedSurf &surf, bool parallel) |
| Change association with a surface, expire the writer with defined parallel/serial treatment. | |
| virtual void | setSurface (const pointField &points, const faceList &faces, bool parallel) |
| Change association with a surface, expire the writer with defined parallel/serial treatment. | |
| virtual void | setSurface (const meshedSurf &surf) |
| Change association with a surface, expire the writer with the current parallel/serial treatment. | |
| virtual void | setSurface (const pointField &points, const faceList &faces) |
| Change association with a surface, expire the writer with the current parallel/serial treatment. | |
| bool | is_open () const noexcept |
| Test if outputPath has been set. | |
| bool | hasSurface () const |
| Writer is associated with a surface. | |
| bool | empty () const |
| The surface to write is empty if the global number of faces is zero. | |
| label | size () const |
| The global number of faces for the associated surface. | |
| label | nFields () const noexcept |
| The number of expected output fields. | |
| label | nFields (const label n) noexcept |
| Set the number of expected output fields. | |
| bool | isPointData () const noexcept |
| Are the field data to be treated as point data? | |
| bool | isPointData (const bool on) noexcept |
| Set handling of field data to face/point data. | |
| bool | useTimeDir () const noexcept |
| Should a time directory be spliced into the output path? | |
| bool | useTimeDir (const bool on) noexcept |
| Enable/disable use of spliced output path. | |
| bool | verbose () const noexcept |
| Get output verbosity. | |
| bool | verbose (const bool on) noexcept |
| Enable/disable verbose output. | |
| scalar | mergeDim () const noexcept |
| The current value of the point merge dimension (metre). | |
| scalar | mergeDim (const scalar dist) noexcept |
| Change the point merge dimension (metre). | |
| scalar | scale () const noexcept |
| The current value of the geometry scaling. | |
| scalar | scale (const scalar factor) noexcept |
| Change the geometry scaling. | |
| const coordSystem::cartesian & | transform () const noexcept |
| The current (cartesian) coordinate system transformation. | |
| bool | hasTime () const |
| True if there is a known time. | |
| const word & | timeName () const |
| The current time value/name. | |
| scalar | timeValue () const |
| The current time value/name. | |
| void | setTime (const instant &inst) |
| Set the current time. | |
| void | setTime (scalar timeValue) |
| Set current time from timeValue, auto generating the name. | |
| void | setTime (scalar timeValue, const word &timeName) |
| Set current time from timeValue and timeName. | |
| void | unsetTime () |
| Clear the current time. | |
| virtual void | beginTime (const Time &t) |
| Begin a time-step. | |
| virtual void | beginTime (const instant &inst) |
| Begin a time-step. | |
| virtual void | endTime () |
| End a time-step. | |
| virtual void | open (const fileName &outputPath) |
| Open for output on specified path, using existing surface. | |
| virtual void | open (const pointField &points, const faceList &faces, const fileName &outputPath, bool parallel) |
| Open from components. | |
| virtual void | open (const meshedSurf &surf, const fileName &outputPath, bool parallel) |
| Open from components. | |
| virtual void | open (const pointField &points, const faceList &faces, const fileName &outputPath) |
| Open from components, with the current parallel/serial treatment. | |
| virtual void | open (const meshedSurf &surf, const fileName &outputPath) |
| Open from components, with the current parallel/serial treatment. | |
| virtual void | close () |
| Finish output, performing any necessary cleanup. | |
| virtual fileName | write (const word &fieldName, const Field< label > &values)=0 |
| Write field of label (per face or vertex). | |
| virtual fileName | write (const word &fieldName, const Field< scalar > &values)=0 |
| Write field of scalar (per face or vertex). | |
| virtual fileName | write (const word &fieldName, const Field< vector > &values)=0 |
| Write field of vector (per face or vertex). | |
| virtual fileName | write (const word &fieldName, const Field< sphericalTensor > &values)=0 |
| Write field of sphericalTensor (per face or vertex). | |
| virtual fileName | write (const word &fieldName, const Field< symmTensor > &values)=0 |
| Write field of symmTensor (per face or vertex). | |
| virtual fileName | write (const word &fieldName, const Field< tensor > &values)=0 |
| Write field of tensor (per face or vertex). | |
| virtual InfoProxy< surfaceWriter > | info () const noexcept |
| Return info proxy, used to print information to a stream. | |
| template<class Type> | |
| Foam::tmp< Foam::Field< Type > > | mergeFieldTemplate (const Field< Type > &fld) const |
| template<class Type> | |
| Foam::tmp< Foam::Field< Type > > | adjustFieldTemplate (const word &fieldName, const tmp< Field< Type > > &tfield) const |
Additional Inherited Members | |
| Static Public Member Functions inherited from surfaceWriter | |
| static dictionary | formatOptions (const dictionary &dict, const word &formatName, const word &entryName="formatOptions") |
| Same as fileFormats::getFormatOptions. | |
| static dictionary | formatOptions (const dictionary &dict, const dictionary &surfDict, const word &formatName, const word &entryName="formatOptions") |
| Same as fileFormats::getFormatOptions. | |
| static bool | supportedType (const word &writeType) |
| True if New is likely to succeed for this writeType. | |
| static autoPtr< surfaceWriter > | TryNew (const word &writeType) |
| Optional select construct surfaceWriter. | |
| static autoPtr< surfaceWriter > | TryNew (const word &writeType, const dictionary &writeOptions) |
| Optional select construct surfaceWriter with extra write options. | |
| static autoPtr< surfaceWriter > | New (const word &writeType) |
| Select construct a surfaceWriter. | |
| static autoPtr< surfaceWriter > | New (const word &writeType, const dictionary &writeOptions) |
| Select construct a surfaceWriter with extra write options. | |
| Static Public Attributes inherited from surfaceWriter | |
| static scalar | defaultMergeDim = 1e-8 |
| The default merge dimension (1e-8). | |
| Protected Member Functions inherited from surfaceWriter | |
| void | checkOpen () const |
| Verify that the outputPath_ has been set or FatalError. | |
| virtual bool | merge () const |
| Merge surfaces if they are not already upToDate (parallel) or simply mark the surface as being up-to-date. | |
| 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 apply any coordinate system changes and/or output scaling. | |
| template<class Type> | |
| tmp< Field< Type > > | mergeFieldTemplate (const Field< Type > &fld) const |
| Gather (merge) fields with renumbering and shrinking for point data. | |
| template<class Type> | |
| tmp< Field< Type > > | adjustFieldTemplate (const word &fieldName, const tmp< Field< Type > > &tfield) const |
| Apply refLevel and fieldScaling. | |
| tmp< Field< label > > | mergeField (const Field< label > &fld) const |
| tmp< Field< label > > | adjustField (const word &fieldName, const tmp< Field< label > > &tfield) const |
| tmp< Field< scalar > > | mergeField (const Field< scalar > &fld) const |
| tmp< Field< scalar > > | adjustField (const word &fieldName, const tmp< Field< scalar > > &tfield) const |
| tmp< Field< vector > > | mergeField (const Field< vector > &fld) const |
| tmp< Field< vector > > | adjustField (const word &fieldName, const tmp< Field< vector > > &tfield) const |
| tmp< Field< sphericalTensor > > | mergeField (const Field< sphericalTensor > &fld) const |
| tmp< Field< sphericalTensor > > | adjustField (const word &fieldName, const tmp< Field< sphericalTensor > > &tfield) const |
| tmp< Field< symmTensor > > | mergeField (const Field< symmTensor > &fld) const |
| tmp< Field< symmTensor > > | adjustField (const word &fieldName, const tmp< Field< symmTensor > > &tfield) const |
| tmp< Field< tensor > > | mergeField (const Field< tensor > &fld) const |
| tmp< Field< tensor > > | adjustField (const word &fieldName, const tmp< Field< tensor > > &tfield) const |
| template<class Type> | |
| fileName | writeTemplate (const word &fieldName, const Field< Type > &localValues) |
| Dummy templated write operation. | |
| Protected Attributes inherited from surfaceWriter | |
| meshedSurfRef | surf_ |
| Reference to surface or surface components. | |
| mergedSurf | mergedSurf_ |
| Surface after merging (parallel). | |
| meshedSurfRef | adjustedSurf_ |
| The surface after point coordinate transforms and scaling. | |
| scalar | mergeDim_ |
| Dimension for merging. | |
| scalar | geometryScale_ |
| Output geometry scaling after rotate/translate. | |
| point | geometryCentre_ |
| The centre of rotation (untranslate, translate). | |
| coordSystem::cartesian | geometryTransform_ |
| Local coordinate system transformation. | |
| bool | upToDate_ |
| The topology/surface is up-to-date? | |
| bool | wroteGeom_ |
| Track if geometry has been written since the last open. | |
| bool | parallel_ |
| Writing in parallel (via master). | |
| bool | useTimeDir_ |
| Insert additional time sub-directory in the output path. | |
| bool | isPointData_ |
| Is point vs cell data. | |
| bool | verbose_ |
| Additional output verbosity. | |
| UPstream::commsTypes | commType_ |
| Communication type (for field merging). | |
| bool | gatherv_ |
| Prefer MPI gatherv intrinsic (for field merging) [experimental]. | |
| label | nFields_ |
| The number of fields. | |
| instant | currTime_ |
| The current time value/name. | |
| fileName | outputPath_ |
| The full output directory and file (surface) name. | |
| dictionary | fieldLevel_ |
| Field level to remove (on output). | |
| dictionary | fieldScale_ |
| Field scaling (on output). | |
A surfaceWriter for special purpose debugging. Its definition and behaviour are subject to change at any time.
formatOptions
{
debug
{
merge true;
write true;
}
}
Format options:
| Property | Description | Required | Default |
|---|---|---|---|
commsType | scheduled/nonBlocking/buffered | no | scheduled |
merge | Enable geometry/field merging | no | true |
write | Write file(s) | no | false |
Output files (if any) are written as boundaryData (binary + header).
Definition at line 98 of file debugSurfaceWriter.H.
| debugWriter | ( | ) |
Default construct.
Definition at line 62 of file debugSurfaceWriter.C.
References surfaceWriter::surfaceWriter().
Referenced by debugWriter(), and debugWriter().


|
explicit |
Construct with some output options.
Definition at line 72 of file debugSurfaceWriter.C.
References UPstream::commsTypeNames, surfaceWriter::commType_, Foam::endl(), surfaceWriter::gatherv_, Foam::Info, surfaceWriter::isPointData(), Switch::name(), and surfaceWriter::surfaceWriter().

| debugWriter | ( | const meshedSurf & | surf, |
| const fileName & | outputPath, | ||
| bool | parallel = UPstream::parRun(), | ||
| const dictionary & | options = dictionary() ) |
Construct from components.
Definition at line 94 of file debugSurfaceWriter.C.
References debugWriter(), and surfaceWriter::open().

| debugWriter | ( | const pointField & | points, |
| const faceList & | faces, | ||
| const fileName & | outputPath, | ||
| bool | parallel = UPstream::parRun(), | ||
| const dictionary & | options = dictionary() ) |
Construct from components.
Definition at line 108 of file debugSurfaceWriter.C.
References debugWriter(), surfaceWriter::open(), and points.

|
virtualdefault |
Destructor.
| TypeNameNoDebug | ( | "debug" | ) |
Declare type-name, virtual type (without debug switch).
References UPstream::parRun(), and points.

|
virtual |
Write surface geometry to file.
Implements surfaceWriter.
Definition at line 180 of file debugSurfaceWriter.C.
References surfaceWriter::checkOpen(), meshedSurf::faces(), Foam::Info, Foam::isDir(), surfaceWriter::isPointData(), UPstream::master(), Foam::mkDir(), Time::NewGlobalTime(), Foam::nl, IOobjectOption::NO_READ, IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, IOobject::note(), surfaceWriter::outputPath_, surfaceWriter::parallel_, UList< T >::size(), surfaceWriter::surface(), surfaceWriter::verbose_, and surfaceWriter::wroteGeom_.

| declareSurfaceWriterWriteMethod | ( | label | ) |
| declareSurfaceWriterWriteMethod | ( | scalar | ) |
| declareSurfaceWriterWriteMethod | ( | vector | ) |
| declareSurfaceWriterWriteMethod | ( | sphericalTensor | ) |
| declareSurfaceWriterWriteMethod | ( | symmTensor | ) |
| declareSurfaceWriterWriteMethod | ( | tensor | ) |
| Foam::tmp< Foam::Field< Type > > mergeField | ( | const Field< Type > & | fld | ) | const |
Definition at line 50 of file debugSurfaceWriter.C.
References addProfiling, fld(), surfaceWriter::merge(), and surfaceWriter::mergeField().

| Foam::fileName writeTemplate | ( | const word & | fieldName, |
| const Field< Type > & | localValues ) |
Definition at line 249 of file debugSurfaceWriter.C.
References surfaceWriter::checkOpen(), Foam::Info, Foam::isDir(), surfaceWriter::isPointData(), UPstream::master(), Foam::mkDir(), Time::NewGlobalTime(), Foam::nl, IOobjectOption::NO_READ, IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, IOobject::note(), IOobject::objectPath(), os(), surfaceWriter::outputPath_, surfaceWriter::parallel_, fileName::path(), surfaceWriter::surface(), timeName, surfaceWriter::verbose_, IOobject::writeEndDivider(), IOobject::writeHeader(), and surfaceWriter::wroteGeom_.
