PetIBM 0.5.4
Toolbox and applications of the immersed-boundary method for distributed-memory architectures
petibm::solution::SolutionBase Class Referenceabstract

Base (abstract) class for different solution holders. More...

#include <solution.h>

Inheritance diagram for petibm::solution::SolutionBase:
[legend]

Public Member Functions

 SolutionBase ()=default
 Default constructor. More...
 
 SolutionBase (const type::Mesh &mesh)
 Constructor using a Cartesian mesh. More...
 
virtual ~SolutionBase ()
 Default destructor. More...
 
virtual PetscErrorCode destroy ()
 Manually destroy data. More...
 
PetscErrorCode printInfo () const
 Print information about the solution to standard output. More...
 
virtual PetscErrorCode setInitialConditions (const YAML::Node &node)=0
 Set initial conditions of the flow fields. More...
 
virtual PetscErrorCode convert2Velocity (const Mat &Rinv)=0
 Convert velocity fluxes to velocity components. More...
 
virtual PetscErrorCode convert2Flux (const Mat &R)=0
 Convert velocity components to velocity fluxes. More...
 
virtual PetscErrorCode write (const std::string &filePath) const =0
 Write flow field solutions to a file. More...
 
virtual PetscErrorCode read (const std::string &filePath)=0
 Read the flow field solutions from a file. More...
 

Public Attributes

PetscInt dim
 Number of dimensions. More...
 
Vec UGlobal
 Packed PETSc Vec object for the velocity vector field. More...
 
Vec pGlobal
 PETSc Vec for the pressure scalar field. More...
 
std::string info
 String containing information about the solution. More...
 

Protected Member Functions

virtual PetscErrorCode init (const type::Mesh &mesh)=0
 Initialize the flow field solutions. More...
 

Protected Attributes

MPI_Comm comm
 MPI communicator. More...
 
PetscMPIInt mpiSize
 Size of MPI communicator. More...
 
PetscMPIInt mpiRank
 Rank of the local process. More...
 
type::Mesh mesh
 Shared pointer to the underlying Cartesian mesh object. More...
 

Detailed Description

Base (abstract) class for different solution holders.

See also
Solution holders, petibm::type::Solution, petibm::solution::createSolution

Definition at line 59 of file solution.h.

Constructor & Destructor Documentation

◆ SolutionBase() [1/2]

petibm::solution::SolutionBase::SolutionBase ( )
default

Default constructor.

◆ SolutionBase() [2/2]

petibm::solution::SolutionBase::SolutionBase ( const type::Mesh mesh)
inline

Constructor using a Cartesian mesh.

Parameters
mesh[in] Cartesian mesh object.

Definition at line 82 of file solution.h.

◆ ~SolutionBase()

petibm::solution::SolutionBase::~SolutionBase ( )
virtual

Default destructor.

Definition at line 18 of file solution.cpp.

Member Function Documentation

◆ convert2Flux()

virtual PetscErrorCode petibm::solution::SolutionBase::convert2Flux ( const Mat &  R)
pure virtual

Convert velocity components to velocity fluxes.

It assumes that UGlobal currently contains velocity components and converts (inplace) to velocity fluxes.

Parameters
R[in] Operator to convert components to fluxes.
Returns
PetscErrorCode.

Implemented in petibm::solution::SolutionSimple.

◆ convert2Velocity()

virtual PetscErrorCode petibm::solution::SolutionBase::convert2Velocity ( const Mat &  Rinv)
pure virtual

Convert velocity fluxes to velocity components.

It assumes that UGlobal currently contains velocity fluxes and converts (inplace) to velocity components.

Parameters
Rinv[in] Operator to convert fluxes to components.
Returns
PetscErrorCode.

Implemented in petibm::solution::SolutionSimple.

◆ destroy()

PetscErrorCode petibm::solution::SolutionBase::destroy ( )
virtual

Manually destroy data.

Returns
PetscErrorCode.

Definition at line 34 of file solution.cpp.

◆ init()

virtual PetscErrorCode petibm::solution::SolutionBase::init ( const type::Mesh mesh)
protectedpure virtual

Initialize the flow field solutions.

Parameters
mesh[in] Cartesian mesh object.
Returns
PetscErrorCode.

Implemented in petibm::solution::SolutionSimple.

◆ printInfo()

PetscErrorCode petibm::solution::SolutionBase::printInfo ( ) const

Print information about the solution to standard output.

Returns
PetscErrorCode.

Definition at line 53 of file solution.cpp.

◆ read()

virtual PetscErrorCode petibm::solution::SolutionBase::read ( const std::string &  filePath)
pure virtual

Read the flow field solutions from a file.

Currently only supports HDF5 format.

Parameters
filePath[in] Path of the file to read from.
Returns
PetscErrorCode.

Implemented in petibm::solution::SolutionSimple.

◆ setInitialConditions()

virtual PetscErrorCode petibm::solution::SolutionBase::setInitialConditions ( const YAML::Node &  node)
pure virtual

Set initial conditions of the flow fields.

Parameters
node[in] YAML node with flow settings.
Returns
PetscErrorCode.

Implemented in petibm::solution::SolutionSimple.

◆ write()

virtual PetscErrorCode petibm::solution::SolutionBase::write ( const std::string &  filePath) const
pure virtual

Write flow field solutions to a file.

Currently only supports HDF5 format.

Parameters
filePath[in] Path of the file to write in.
Returns
PetscErrorCode.

Implemented in petibm::solution::SolutionSimple.

Member Data Documentation

◆ comm

MPI_Comm petibm::solution::SolutionBase::comm
protected

MPI communicator.

Definition at line 167 of file solution.h.

◆ dim

PetscInt petibm::solution::SolutionBase::dim

Number of dimensions.

Definition at line 63 of file solution.h.

◆ info

std::string petibm::solution::SolutionBase::info

String containing information about the solution.

Definition at line 72 of file solution.h.

◆ mesh

type::Mesh petibm::solution::SolutionBase::mesh
protected

Shared pointer to the underlying Cartesian mesh object.

Definition at line 176 of file solution.h.

◆ mpiRank

PetscMPIInt petibm::solution::SolutionBase::mpiRank
protected

Rank of the local process.

Definition at line 173 of file solution.h.

◆ mpiSize

PetscMPIInt petibm::solution::SolutionBase::mpiSize
protected

Size of MPI communicator.

Definition at line 170 of file solution.h.

◆ pGlobal

Vec petibm::solution::SolutionBase::pGlobal

PETSc Vec for the pressure scalar field.

Definition at line 69 of file solution.h.

◆ UGlobal

Vec petibm::solution::SolutionBase::UGlobal

Packed PETSc Vec object for the velocity vector field.

Definition at line 66 of file solution.h.


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