PetIBM 0.5.4
Toolbox and applications of the immersed-boundary method for distributed-memory architectures

Immersed-boundary method proposed by Taira and Colonius (2007). More...

#include <ibpm.h>

Inheritance diagram for IBPMSolver:
[legend]

Public Member Functions

 IBPMSolver ()=default
 Default constructor. More...
 
 IBPMSolver (const MPI_Comm &world, const YAML::Node &node)
 Constructor. Initialize the IBPM solver. More...
 
 ~IBPMSolver ()
 Default destructor. More...
 
PetscErrorCode destroy ()
 Manually destroy data. More...
 
PetscErrorCode init (const MPI_Comm &world, const YAML::Node &node)
 Initialize the IBPM solver. More...
 
PetscErrorCode write ()
 Write solution, forces, and solvers info to files. More...
 
PetscErrorCode ioInitialData ()
 Read or write initial data. More...
 
PetscErrorCode advance ()
 Advance the solution by one time step. More...
 
bool finished ()
 Evaluate if the simulation is finished. More...
 

Protected Member Functions

virtual PetscErrorCode assembleRHSPoisson ()
 Assemble the RHS vector of the Poisson system. More...
 
virtual PetscErrorCode createOperators ()
 Create operators. More...
 
virtual PetscErrorCode createVectors ()
 Create vectors. More...
 
virtual PetscErrorCode setNullSpace ()
 Set Poisson nullspace or pin pressure at a reference point. More...
 
virtual PetscErrorCode writeSolutionHDF5 (const std::string &filePath)
 Write the solution fields into a HDF5 file. More...
 
virtual PetscErrorCode writeRestartDataHDF5 (const std::string &filePath)
 Write data required to restart a simulation into a HDF5 file. More...
 
virtual PetscErrorCode readRestartDataHDF5 (const std::string &filePath)
 Read data required to restart a simulation from a HDF5 file. More...
 
virtual PetscErrorCode writeForcesASCII ()
 Write the forces acting on the bodies into an ASCII file. More...
 
virtual PetscErrorCode assembleRHSVelocity ()
 Assemble the RHS vector of the velocity system. More...
 
virtual PetscErrorCode solveVelocity ()
 Solve the velocity system. More...
 
virtual PetscErrorCode solvePoisson ()
 Solve the Poisson system. More...
 
virtual PetscErrorCode applyDivergenceFreeVelocity ()
 
virtual PetscErrorCode updatePressure ()
 
virtual PetscErrorCode createPetscViewerASCII (const std::string &filePath, const PetscFileMode &mode, PetscViewer &viewer)
 Create an ASCII PetscViewer. More...
 
virtual PetscErrorCode writeLinSolversInfo ()
 Write numbers of iterations and residuals of solvers to file. More...
 
virtual PetscErrorCode writeTimeHDF5 (const PetscReal &t, const std::string &filePath)
 Write the time value into a HDF5 file. More...
 
virtual PetscErrorCode readTimeHDF5 (const std::string &filePath, PetscReal &t)
 Read the time value from a HDF5 file. More...
 
virtual PetscErrorCode monitorProbes ()
 Monitor the solution at probes. More...
 

Protected Attributes

petibm::type::BodyPack bodies
 Pack of immersed bodies. More...
 
Vec P
 PETSc Vec object with pressure field and Lagrangian forces. More...
 
IS isDE [2]
 Global index sets for pressure field and Lagrangian forces. More...
 
PetscLogStage stageIntegrateForces
 Log stage for integrating the Lagrangian forces. More...
 
PetscViewer forcesViewer
 ASCII PetscViewer object to output the forces. More...
 
MPI_Comm comm
 MPI communicator. More...
 
PetscMPIInt commSize
 Size of the MPI communicator. More...
 
PetscMPIInt commRank
 Rank of the process in the MPI communicator. More...
 
YAML::Node config
 YAML configuration settings. More...
 
petibm::type::Mesh mesh
 Structured Cartesian mesh object. More...
 
petibm::type::Boundary bc
 Information about the domain boundaries. More...
 
petibm::type::Solution solution
 Data object holding the velocity and pressure fields. More...
 
petibm::type::TimeIntegration convCoeffs
 Time scheme for the convective terms. More...
 
petibm::type::TimeIntegration diffCoeffs
 Time scheme for the diffusion terms. More...
 
petibm::type::LinSolver vSolver
 Velocity linear solver. More...
 
petibm::type::LinSolver pSolver
 Poisson linear solver. More...
 
std::vector< petibm::type::Probeprobes
 Probes to monitor the solution. More...
 
PetscReal dt
 Time-step size. More...
 
PetscInt ite
 Time-step index. More...
 
PetscReal t
 Time value. More...
 
PetscInt nstart
 Starting time-step index. More...
 
PetscInt nt
 Number of time steps to compute. More...
 
PetscInt nsave
 Frequency at which the solution fields are written to files. More...
 
PetscInt nrestart
 Frequency at which data to restart are written to files. More...
 
PetscReal nu
 Viscous diffusion coefficient. More...
 
Mat L
 Laplacian operator. More...
 
Mat LCorrection
 Laplacian correction operator for boundary conditions. More...
 
Mat G
 Gradient operator. More...
 
Mat D
 Divergence operator. More...
 
Mat DCorrection
 Divergence correction for boundary conditions. More...
 
Mat N
 Convective operator (matrix-free). More...
 
Mat A
 Implicit operator for the velocity solver. More...
 
Mat BNG
 Projection operator. More...
 
Mat DBNG
 Poisson operator. More...
 
Vec dP
 Pressure-correction vector. More...
 
Vec bc1
 Inhomogeneous boundary terms for the velocity system. More...
 
Vec rhs1
 Right-hand side vector of the velocity system. More...
 
Vec rhs2
 Right-hand side vector of the Poisson system. More...
 
std::vector< Vec > conv
 Explicit convective terms. More...
 
std::vector< Vec > diff
 Explicit diffusion terms. More...
 
PetscBool isRefP
 True if we pin the pressure at a reference point. More...
 
PetscLogStage stageInitialize
 Log stage for the initialization phase. More...
 
PetscLogStage stageRHSVelocity
 Log stage for assembling the RHS of the velocity system. More...
 
PetscLogStage stageSolveVelocity
 Log stage for solving the velocity system. More...
 
PetscLogStage stageRHSPoisson
 Log stage for assembling the RHS of the Poisson system. More...
 
PetscLogStage stageSolvePoisson
 Log stage for solving the Poisson system. More...
 
PetscLogStage stageUpdate
 Log stage for updating field variables. More...
 
PetscLogStage stageWrite
 Log stage when write the solution fields. More...
 
PetscLogStage stageMonitor
 Log stage for monitoring user-defined regions of the domain. More...
 
PetscViewer solversViewer
 ASCII PetscViewer object to output solvers info. More...
 

Detailed Description

Immersed-boundary method proposed by Taira and Colonius (2007).

See also
IBPM solver (Taira & Colonius 2007), NavierStokesSolver

Definition at line 22 of file ibpm.h.

Constructor & Destructor Documentation

◆ IBPMSolver() [1/2]

IBPMSolver::IBPMSolver ( )
default

Default constructor.

◆ IBPMSolver() [2/2]

IBPMSolver::IBPMSolver ( const MPI_Comm &  world,
const YAML::Node &  node 
)

Constructor. Initialize the IBPM solver.

Parameters
world[in] MPI communicator
node[in] YAML configuration settings

Definition at line 17 of file ibpm.cpp.

◆ ~IBPMSolver()

IBPMSolver::~IBPMSolver ( )

Default destructor.

Definition at line 23 of file ibpm.cpp.

Member Function Documentation

◆ advance()

PetscErrorCode NavierStokesSolver::advance ( )

Advance the solution by one time step.

Definition at line 67 of file navierstokes.cpp.

◆ applyDivergenceFreeVelocity()

PetscErrorCode NavierStokesSolver::applyDivergenceFreeVelocity ( )
protectedvirtualinherited

Definition at line 583 of file navierstokes.cpp.

◆ assembleRHSPoisson()

PetscErrorCode IBPMSolver::assembleRHSPoisson ( )
protectedvirtual

Assemble the RHS vector of the Poisson system.

Reimplemented from NavierStokesSolver.

Definition at line 286 of file ibpm.cpp.

◆ assembleRHSVelocity()

PetscErrorCode NavierStokesSolver::assembleRHSVelocity ( )
protectedvirtualinherited

Assemble the RHS vector of the velocity system.

Reimplemented in DecoupledIBPMSolver.

Definition at line 432 of file navierstokes.cpp.

◆ createOperators()

PetscErrorCode IBPMSolver::createOperators ( )
protectedvirtual

Create operators.

Reimplemented from NavierStokesSolver.

Definition at line 100 of file ibpm.cpp.

◆ createPetscViewerASCII()

PetscErrorCode NavierStokesSolver::createPetscViewerASCII ( const std::string &  filePath,
const PetscFileMode &  mode,
PetscViewer &  viewer 
)
protectedvirtualinherited

Create an ASCII PetscViewer.

Parameters
filePath[in] Path of the file to write in
mode[in] File mode
viewer[out] PetscViewer object
Returns
PetscErrorCode

Definition at line 749 of file navierstokes.cpp.

◆ createVectors()

PetscErrorCode IBPMSolver::createVectors ( )
protectedvirtual

Create vectors.

Reimplemented from NavierStokesSolver.

Definition at line 206 of file ibpm.cpp.

◆ destroy()

PetscErrorCode IBPMSolver::destroy ( )

Manually destroy data.

Definition at line 37 of file ibpm.cpp.

◆ finished()

bool NavierStokesSolver::finished ( )

Evaluate if the simulation is finished.

Definition at line 73 of file navierstokes.cpp.

◆ init()

PetscErrorCode IBPMSolver::init ( const MPI_Comm &  world,
const YAML::Node &  node 
)

Initialize the IBPM solver.

Parameters
world[in] MPI communicator
node[in] YAML configuration settings
Returns
PetscErrorCode

Definition at line 54 of file ibpm.cpp.

◆ ioInitialData()

PetscErrorCode NavierStokesSolver::ioInitialData ( )

Read or write initial data.

Definition at line 64 of file navierstokes.cpp.

◆ monitorProbes()

PetscErrorCode NavierStokesSolver::monitorProbes ( )
protectedvirtualinherited

Monitor the solution at probes.

Definition at line 840 of file navierstokes.cpp.

◆ readRestartDataHDF5()

PetscErrorCode IBPMSolver::readRestartDataHDF5 ( const std::string &  filePath)
protectedvirtual

Read data required to restart a simulation from a HDF5 file.

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

Reimplemented from NavierStokesSolver.

Definition at line 357 of file ibpm.cpp.

◆ readTimeHDF5()

PetscErrorCode NavierStokesSolver::readTimeHDF5 ( const std::string &  filePath,
PetscReal &  t 
)
protectedvirtualinherited

Read the time value from a HDF5 file.

Parameters
filePath[in] Path of the file to read from
t[out] Time
Returns
PetscErrorCode

Definition at line 818 of file navierstokes.cpp.

◆ setNullSpace()

PetscErrorCode IBPMSolver::setNullSpace ( )
protectedvirtual

Set Poisson nullspace or pin pressure at a reference point.

Reimplemented from NavierStokesSolver.

Definition at line 242 of file ibpm.cpp.

◆ solvePoisson()

PetscErrorCode NavierStokesSolver::solvePoisson ( )
protectedvirtualinherited

Solve the Poisson system.

Definition at line 566 of file navierstokes.cpp.

◆ solveVelocity()

PetscErrorCode NavierStokesSolver::solveVelocity ( )
protectedvirtualinherited

Solve the velocity system.

Definition at line 524 of file navierstokes.cpp.

◆ updatePressure()

PetscErrorCode NavierStokesSolver::updatePressure ( )
protectedvirtualinherited

Definition at line 601 of file navierstokes.cpp.

◆ write()

PetscErrorCode IBPMSolver::write ( )

Write solution, forces, and solvers info to files.

Definition at line 85 of file ibpm.cpp.

◆ writeForcesASCII()

PetscErrorCode IBPMSolver::writeForcesASCII ( )
protectedvirtual

Write the forces acting on the bodies into an ASCII file.

Definition at line 387 of file ibpm.cpp.

◆ writeLinSolversInfo()

PetscErrorCode NavierStokesSolver::writeLinSolversInfo ( )
protectedvirtualinherited

Write numbers of iterations and residuals of solvers to file.

Reimplemented in DecoupledIBPMSolver.

Definition at line 766 of file navierstokes.cpp.

◆ writeRestartDataHDF5()

PetscErrorCode IBPMSolver::writeRestartDataHDF5 ( const std::string &  filePath)
protectedvirtual

Write data required to restart a simulation into a HDF5 file.

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

Reimplemented from NavierStokesSolver.

Definition at line 338 of file ibpm.cpp.

◆ writeSolutionHDF5()

PetscErrorCode IBPMSolver::writeSolutionHDF5 ( const std::string &  filePath)
protectedvirtual

Write the solution fields into a HDF5 file.

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

Reimplemented from NavierStokesSolver.

Definition at line 316 of file ibpm.cpp.

◆ writeTimeHDF5()

PetscErrorCode NavierStokesSolver::writeTimeHDF5 ( const PetscReal &  t,
const std::string &  filePath 
)
protectedvirtualinherited

Write the time value into a HDF5 file.

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

Definition at line 797 of file navierstokes.cpp.

Member Data Documentation

◆ A

Mat NavierStokesSolver::A
protectedinherited

Implicit operator for the velocity solver.

Definition at line 155 of file navierstokes.h.

◆ bc

petibm::type::Boundary NavierStokesSolver::bc
protectedinherited

Information about the domain boundaries.

Definition at line 92 of file navierstokes.h.

◆ bc1

Vec NavierStokesSolver::bc1
protectedinherited

Inhomogeneous boundary terms for the velocity system.

Definition at line 167 of file navierstokes.h.

◆ BNG

Mat NavierStokesSolver::BNG
protectedinherited

Projection operator.

Definition at line 158 of file navierstokes.h.

◆ bodies

petibm::type::BodyPack IBPMSolver::bodies
protected

Pack of immersed bodies.

Definition at line 61 of file ibpm.h.

◆ comm

MPI_Comm NavierStokesSolver::comm
protectedinherited

MPI communicator.

Definition at line 77 of file navierstokes.h.

◆ commRank

PetscMPIInt NavierStokesSolver::commRank
protectedinherited

Rank of the process in the MPI communicator.

Definition at line 83 of file navierstokes.h.

◆ commSize

PetscMPIInt NavierStokesSolver::commSize
protectedinherited

Size of the MPI communicator.

Definition at line 80 of file navierstokes.h.

◆ config

YAML::Node NavierStokesSolver::config
protectedinherited

YAML configuration settings.

Definition at line 86 of file navierstokes.h.

◆ conv

std::vector<Vec> NavierStokesSolver::conv
protectedinherited

Explicit convective terms.

Definition at line 176 of file navierstokes.h.

◆ convCoeffs

petibm::type::TimeIntegration NavierStokesSolver::convCoeffs
protectedinherited

Time scheme for the convective terms.

Definition at line 98 of file navierstokes.h.

◆ D

Mat NavierStokesSolver::D
protectedinherited

Divergence operator.

Definition at line 146 of file navierstokes.h.

◆ DBNG

Mat NavierStokesSolver::DBNG
protectedinherited

Poisson operator.

Definition at line 161 of file navierstokes.h.

◆ DCorrection

Mat NavierStokesSolver::DCorrection
protectedinherited

Divergence correction for boundary conditions.

Definition at line 149 of file navierstokes.h.

◆ diff

std::vector<Vec> NavierStokesSolver::diff
protectedinherited

Explicit diffusion terms.

Definition at line 179 of file navierstokes.h.

◆ diffCoeffs

petibm::type::TimeIntegration NavierStokesSolver::diffCoeffs
protectedinherited

Time scheme for the diffusion terms.

Definition at line 101 of file navierstokes.h.

◆ dP

Vec NavierStokesSolver::dP
protectedinherited

Pressure-correction vector.

Definition at line 164 of file navierstokes.h.

◆ dt

PetscReal NavierStokesSolver::dt
protectedinherited

Time-step size.

Definition at line 113 of file navierstokes.h.

◆ forcesViewer

PetscViewer IBPMSolver::forcesViewer
protected

ASCII PetscViewer object to output the forces.

Definition at line 73 of file ibpm.h.

◆ G

Mat NavierStokesSolver::G
protectedinherited

Gradient operator.

Definition at line 143 of file navierstokes.h.

◆ isDE

IS IBPMSolver::isDE[2]
protected

Global index sets for pressure field and Lagrangian forces.

Definition at line 67 of file ibpm.h.

◆ isRefP

PetscBool NavierStokesSolver::isRefP
protectedinherited

True if we pin the pressure at a reference point.

Definition at line 182 of file navierstokes.h.

◆ ite

PetscInt NavierStokesSolver::ite
protectedinherited

Time-step index.

Definition at line 116 of file navierstokes.h.

◆ L

Mat NavierStokesSolver::L
protectedinherited

Laplacian operator.

Definition at line 137 of file navierstokes.h.

◆ LCorrection

Mat NavierStokesSolver::LCorrection
protectedinherited

Laplacian correction operator for boundary conditions.

Definition at line 140 of file navierstokes.h.

◆ mesh

petibm::type::Mesh NavierStokesSolver::mesh
protectedinherited

Structured Cartesian mesh object.

Definition at line 89 of file navierstokes.h.

◆ N

Mat NavierStokesSolver::N
protectedinherited

Convective operator (matrix-free).

Definition at line 152 of file navierstokes.h.

◆ nrestart

PetscInt NavierStokesSolver::nrestart
protectedinherited

Frequency at which data to restart are written to files.

Definition at line 131 of file navierstokes.h.

◆ nsave

PetscInt NavierStokesSolver::nsave
protectedinherited

Frequency at which the solution fields are written to files.

Definition at line 128 of file navierstokes.h.

◆ nstart

PetscInt NavierStokesSolver::nstart
protectedinherited

Starting time-step index.

Definition at line 122 of file navierstokes.h.

◆ nt

PetscInt NavierStokesSolver::nt
protectedinherited

Number of time steps to compute.

Definition at line 125 of file navierstokes.h.

◆ nu

PetscReal NavierStokesSolver::nu
protectedinherited

Viscous diffusion coefficient.

Definition at line 134 of file navierstokes.h.

◆ P

Vec IBPMSolver::P
protected

PETSc Vec object with pressure field and Lagrangian forces.

Definition at line 64 of file ibpm.h.

◆ probes

std::vector<petibm::type::Probe> NavierStokesSolver::probes
protectedinherited

Probes to monitor the solution.

Definition at line 110 of file navierstokes.h.

◆ pSolver

petibm::type::LinSolver NavierStokesSolver::pSolver
protectedinherited

Poisson linear solver.

Definition at line 107 of file navierstokes.h.

◆ rhs1

Vec NavierStokesSolver::rhs1
protectedinherited

Right-hand side vector of the velocity system.

Definition at line 170 of file navierstokes.h.

◆ rhs2

Vec NavierStokesSolver::rhs2
protectedinherited

Right-hand side vector of the Poisson system.

Definition at line 173 of file navierstokes.h.

◆ solution

petibm::type::Solution NavierStokesSolver::solution
protectedinherited

Data object holding the velocity and pressure fields.

Definition at line 95 of file navierstokes.h.

◆ solversViewer

PetscViewer NavierStokesSolver::solversViewer
protectedinherited

ASCII PetscViewer object to output solvers info.

Definition at line 209 of file navierstokes.h.

◆ stageInitialize

PetscLogStage NavierStokesSolver::stageInitialize
protectedinherited

Log stage for the initialization phase.

Definition at line 185 of file navierstokes.h.

◆ stageIntegrateForces

PetscLogStage IBPMSolver::stageIntegrateForces
protected

Log stage for integrating the Lagrangian forces.

Definition at line 70 of file ibpm.h.

◆ stageMonitor

PetscLogStage NavierStokesSolver::stageMonitor
protectedinherited

Log stage for monitoring user-defined regions of the domain.

Definition at line 206 of file navierstokes.h.

◆ stageRHSPoisson

PetscLogStage NavierStokesSolver::stageRHSPoisson
protectedinherited

Log stage for assembling the RHS of the Poisson system.

Definition at line 194 of file navierstokes.h.

◆ stageRHSVelocity

PetscLogStage NavierStokesSolver::stageRHSVelocity
protectedinherited

Log stage for assembling the RHS of the velocity system.

Definition at line 188 of file navierstokes.h.

◆ stageSolvePoisson

PetscLogStage NavierStokesSolver::stageSolvePoisson
protectedinherited

Log stage for solving the Poisson system.

Definition at line 197 of file navierstokes.h.

◆ stageSolveVelocity

PetscLogStage NavierStokesSolver::stageSolveVelocity
protectedinherited

Log stage for solving the velocity system.

Definition at line 191 of file navierstokes.h.

◆ stageUpdate

PetscLogStage NavierStokesSolver::stageUpdate
protectedinherited

Log stage for updating field variables.

Definition at line 200 of file navierstokes.h.

◆ stageWrite

PetscLogStage NavierStokesSolver::stageWrite
protectedinherited

Log stage when write the solution fields.

Definition at line 203 of file navierstokes.h.

◆ t

PetscReal NavierStokesSolver::t
protectedinherited

Time value.

Definition at line 119 of file navierstokes.h.

◆ vSolver

petibm::type::LinSolver NavierStokesSolver::vSolver
protectedinherited

Velocity linear solver.

Definition at line 104 of file navierstokes.h.


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