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

Class to hold the velocity vector field and pressure scalar field. More...

#include <solutionsimple.h>

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

Public Member Functions

 SolutionSimple (const type::Mesh &mesh)
 Constructor using a Cartesian mesh. More...
 
virtual ~SolutionSimple ()
 Default destructor. More...
 
virtual PetscErrorCode setInitialConditions (const YAML::Node &node)
 Set initial conditions of the flow fields. More...
 
virtual PetscErrorCode convert2Velocity (const Mat &Rinv)
 Convert velocity fluxes to velocity components. More...
 
virtual PetscErrorCode convert2Flux (const Mat &R)
 Convert velocity components to velocity fluxes. More...
 
virtual PetscErrorCode write (const std::string &filePath) const
 Write flow field solutions to a file. More...
 
virtual PetscErrorCode read (const std::string &filePath)
 Read the flow field solutions from a file. More...
 
virtual PetscErrorCode destroy ()
 Manually destroy data. More...
 
PetscErrorCode printInfo () const
 Print information about the solution to standard output. 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)
 Initialize the flow field solutions. More...
 
PetscErrorCode createInfoString ()
 Create a string with information about the solution. 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

Class to hold the velocity vector field and pressure scalar field.

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

Definition at line 25 of file solutionsimple.h.

Constructor & Destructor Documentation

◆ SolutionSimple()

petibm::solution::SolutionSimple::SolutionSimple ( const type::Mesh mesh)

Constructor using a Cartesian mesh.

Parameters
mesh[in] Cartesian mesh object.

Definition at line 24 of file solutionsimple.cpp.

◆ ~SolutionSimple()

petibm::solution::SolutionSimple::~SolutionSimple ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ convert2Flux()

PetscErrorCode petibm::solution::SolutionSimple::convert2Flux ( const Mat &  R)
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.

Implements petibm::solution::SolutionBase.

Definition at line 106 of file solutionsimple.cpp.

◆ convert2Velocity()

PetscErrorCode petibm::solution::SolutionSimple::convert2Velocity ( const Mat &  Rinv)
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.

Implements petibm::solution::SolutionBase.

Definition at line 90 of file solutionsimple.cpp.

◆ createInfoString()

PetscErrorCode petibm::solution::SolutionSimple::createInfoString ( )
protected

Create a string with information about the solution.

Returns
PetscErrorCode.

Definition at line 60 of file solutionsimple.cpp.

◆ destroy()

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

Manually destroy data.

Returns
PetscErrorCode.

Definition at line 34 of file solution.cpp.

◆ init()

PetscErrorCode petibm::solution::SolutionSimple::init ( const type::Mesh mesh)
protectedvirtual

Initialize the flow field solutions.

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

Implements petibm::solution::SolutionBase.

Definition at line 30 of file solutionsimple.cpp.

◆ printInfo()

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

Print information about the solution to standard output.

Returns
PetscErrorCode.

Definition at line 53 of file solution.cpp.

◆ read()

PetscErrorCode petibm::solution::SolutionSimple::read ( const std::string &  filePath)
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.

Implements petibm::solution::SolutionBase.

Definition at line 262 of file solutionsimple.cpp.

◆ setInitialConditions()

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

Set initial conditions of the flow fields.

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

Implements petibm::solution::SolutionBase.

Definition at line 122 of file solutionsimple.cpp.

◆ write()

PetscErrorCode petibm::solution::SolutionSimple::write ( const std::string &  filePath) const
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.

Implements petibm::solution::SolutionBase.

Definition at line 229 of file solutionsimple.cpp.

Member Data Documentation

◆ comm

MPI_Comm petibm::solution::SolutionBase::comm
protectedinherited

MPI communicator.

Definition at line 167 of file solution.h.

◆ dim

PetscInt petibm::solution::SolutionBase::dim
inherited

Number of dimensions.

Definition at line 63 of file solution.h.

◆ info

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

String containing information about the solution.

Definition at line 72 of file solution.h.

◆ mesh

type::Mesh petibm::solution::SolutionBase::mesh
protectedinherited

Shared pointer to the underlying Cartesian mesh object.

Definition at line 176 of file solution.h.

◆ mpiRank

PetscMPIInt petibm::solution::SolutionBase::mpiRank
protectedinherited

Rank of the local process.

Definition at line 173 of file solution.h.

◆ mpiSize

PetscMPIInt petibm::solution::SolutionBase::mpiSize
protectedinherited

Size of MPI communicator.

Definition at line 170 of file solution.h.

◆ pGlobal

Vec petibm::solution::SolutionBase::pGlobal
inherited

PETSc Vec for the pressure scalar field.

Definition at line 69 of file solution.h.

◆ UGlobal

Vec petibm::solution::SolutionBase::UGlobal
inherited

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: