Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
lagrangianWriter Class Reference

Write lagrangian (cloud) positions and fields (as PointData) in VTP format. Legacy VTK format is intentionally not supported since the VTP format provides much better field selection in ParaView, and for consistency with the Foam::functionObjects::vtkCloud function object. More...

Inheritance diagram for lagrangianWriter:
Inheritance graph
[legend]
Collaboration diagram for lagrangianWriter:
Collaboration graph
[legend]

Public Member Functions

 lagrangianWriter (const fvMesh &mesh, const word &cloudName, const vtk::outputOptions opts=vtk::formatType::INLINE_BASE64, bool useVerts=false)
 
 lagrangianWriter (const fvMesh &mesh, const word &cloudName, const fileName &file, bool parallel=Pstream::parRun())
 
 lagrangianWriter (const fvMesh &mesh, const word &cloudName, const vtk::outputOptions opts, const fileName &file, bool parallel=Pstream::parRun())
 
virtual ~lagrangianWriter ()=default
 
virtual bool beginFile (std::string title="")
 
virtual bool writeGeometry ()
 
bool beginParcelData ()
 
bool endParcelData ()
 
template<class Type >
void write (const IOField< Type > &field)
 
template<class Type >
label writeFields (const wordList &fieldNames, bool verbose=true)
 
template<class Type >
label writeFields (const IOobjectList &objects, bool verbose=true)
 
template<class Type >
Foam::label writeFields (const wordList &fieldNames, bool verbose)
 
template<class Type >
Foam::label writeFields (const IOobjectList &objects, const bool verbose)
 
- Public Member Functions inherited from fileWriter
 fileWriter (const vtk::fileTag contentType, const vtk::outputOptions opts)
 
virtual ~fileWriter ()
 
vtk::fileTag contentType () const
 
vtk::outputOptions opts () const
 
word ext () const
 
bool legacy () const
 
bool parallel () const noexcept
 
const wordstate () const
 
const fileNameoutput () const noexcept
 
bool open (const fileName &file, bool parallel=Pstream::parRun())
 
void close ()
 
bool beginFieldData (label nFields=0)
 
label nCellData () const noexcept
 
label nPointData () const noexcept
 
bool endFieldData ()
 
bool endCellData ()
 
bool endPointData ()
 
void writeTimeValue (scalar timeValue)
 

Static Public Member Functions

static word ext (vtk::outputOptions)
 

Protected Member Functions

virtual bool beginCellData (label nFields=0)
 
virtual bool beginPointData (label nFields=0)
 
- Protected Member Functions inherited from fileWriter
void checkFormatterValidity () const
 
OstreamreportBadState (Ostream &, outputState expected) const
 
OstreamreportBadState (Ostream &, outputState, outputState) const
 
std::ofstream & os () noexcept
 
vtk::formatterformat ()
 
bool isState (outputState test) const noexcept
 
bool notState (outputState test) const noexcept
 
template<class Type >
void beginDataArray (const word &fieldName, const label nValues)
 
void endDataArray ()
 
void beginPoints (const label nPoints)
 
void endPoints ()
 
bool enter_Piece ()
 
bool endPiece ()
 
bool enter_CellData (label nEntries, label nFields)
 
bool enter_PointData (label nEntries, label nFields)
 
bool exit_File ()
 
template<class Type >
void writeUniform (const word &fieldName, const Type &val, const label nValues)
 
template<class Type >
void writeBasicField (const word &fieldName, const UList< Type > &field)
 
bool writeProcIDs (const label nValues)
 
 fileWriter (const fileWriter &)=delete
 
void operator= (const fileWriter &)=delete
 

Additional Inherited Members

- Protected Types inherited from fileWriter
enum  outputState {
  CLOSED = 0, OPENED, DECLARED, FIELD_DATA,
  PIECE, CELL_DATA, POINT_DATA
}
 
- Protected Attributes inherited from fileWriter
vtk::fileTag contentType_
 
outputOptions opts_
 
bool parallel_
 
outputState state_
 
label nCellData_
 
label nPointData_
 
fileName outputFile_
 
autoPtr< vtk::formatterformat_
 
std::ofstream os_
 
- Static Protected Attributes inherited from fileWriter
static const Enum< outputStatestateNames
 

Detailed Description

Write lagrangian (cloud) positions and fields (as PointData) in VTP format. Legacy VTK format is intentionally not supported since the VTP format provides much better field selection in ParaView, and for consistency with the Foam::functionObjects::vtkCloud function object.

The file output states are managed by the Foam::vtk::fileWriter class. FieldData (eg, TimeValue) must appear before any geometry pieces.

Note
If fields should be CellData instead of PointData (default), this must be decided at construction time.
Source files

Definition at line 66 of file foamVtkLagrangianWriter.H.

Constructor & Destructor Documentation

◆ lagrangianWriter() [1/3]

lagrangianWriter ( const fvMesh mesh,
const word cloudName,
const vtk::outputOptions  opts = vtk::formatType::INLINE_BASE64,
bool  useVerts = false 
)

Definition at line 111 of file foamVtkLagrangianWriter.C.

References fileWriter::legacy().

Here is the call graph for this function:

◆ lagrangianWriter() [2/3]

lagrangianWriter ( const fvMesh mesh,
const word cloudName,
const fileName file,
bool  parallel = Pstream::parRun() 
)

Definition at line 130 of file foamVtkLagrangianWriter.C.

◆ lagrangianWriter() [3/3]

lagrangianWriter ( const fvMesh mesh,
const word cloudName,
const vtk::outputOptions  opts,
const fileName file,
bool  parallel = Pstream::parRun() 
)

Definition at line 144 of file foamVtkLagrangianWriter.C.

◆ ~lagrangianWriter()

virtual ~lagrangianWriter ( )
virtualdefault

Member Function Documentation

◆ beginCellData()

bool beginCellData ( label  nFields = 0)
protectedvirtual

Implements fileWriter.

Definition at line 96 of file foamVtkLagrangianWriter.C.

◆ beginPointData()

bool beginPointData ( label  nFields = 0)
protectedvirtual

Implements fileWriter.

Definition at line 102 of file foamVtkLagrangianWriter.C.

◆ ext()

static word ext ( vtk::outputOptions  )
inlinestatic

Definition at line 174 of file foamVtkLagrangianWriter.H.

References Foam::vtk::fileExtension, and Foam::vtk::POLY_DATA.

◆ beginFile()

bool beginFile ( std::string  title = "")
virtual

Reimplemented from fileWriter.

Definition at line 160 of file foamVtkLagrangianWriter.C.

References fileWriter::beginFile(), and Foam::name().

Here is the call graph for this function:

◆ writeGeometry()

bool writeGeometry ( )
virtual

◆ beginParcelData()

bool beginParcelData ( )

Definition at line 271 of file foamVtkLagrangianWriter.C.

References Foam::vtk::legacy::beginCellData(), and Foam::vtk::legacy::beginPointData().

Here is the call graph for this function:

◆ endParcelData()

bool endParcelData ( )

Definition at line 284 of file foamVtkLagrangianWriter.C.

◆ write()

void write ( const IOField< Type > &  field)

◆ writeFields() [1/4]

label writeFields ( const wordList fieldNames,
bool  verbose = true 
)

◆ writeFields() [2/4]

label writeFields ( const IOobjectList objects,
bool  verbose = true 
)

◆ writeFields() [3/4]

Foam::label writeFields ( const wordList fieldNames,
bool  verbose 
)

Definition at line 68 of file foamVtkLagrangianWriterTemplates.C.

References Foam::endl(), field(), fieldNames(), Foam::Info, IOobject::READ_IF_PRESENT, Foam::returnReduce(), and IOobject::typeHeaderOk().

Here is the call graph for this function:

◆ writeFields() [4/4]

Foam::label writeFields ( const IOobjectList objects,
const bool  verbose 
)

Definition at line 134 of file foamVtkLagrangianWriterTemplates.C.

References IOobjectList::allNames().

Here is the call graph for this function:

The documentation for this class was generated from the following files: