PetIBM 0.5.4
Toolbox and applications of the immersed-boundary method for distributed-memory architectures
decoupledibpm.h
Go to the documentation of this file.
1
10#pragma once
11
12#include <petibm/bodypack.h>
13
14#include "../navierstokes/navierstokes.h"
15
23{
24public:
27
33 DecoupledIBPMSolver(const MPI_Comm &world, const YAML::Node &node);
34
37
39 PetscErrorCode destroy();
40
46 PetscErrorCode init(const MPI_Comm &world, const YAML::Node &node);
47
49
51 PetscErrorCode advance();
52
54 PetscErrorCode write();
55
57
58protected:
61
64
66 Mat H;
67
69 Mat E;
70
72 Mat EBNH;
73
75 Mat BNH;
76
78 Vec f;
79
81 Vec df;
82
84 Vec rhsf;
85
87 PetscLogStage stageRHSForces;
88
90 PetscLogStage stageSolveForces;
91
93 PetscLogStage stageIntegrateForces;
94
96 PetscViewer forcesViewer;
97
99 virtual PetscErrorCode assembleRHSVelocity();
100
102 virtual PetscErrorCode assembleRHSForces();
103
105 virtual PetscErrorCode solveForces();
106
108 virtual PetscErrorCode applyNoSlip();
109
111 virtual PetscErrorCode updateForces();
112
114 virtual PetscErrorCode createExtraOperators();
115
117 virtual PetscErrorCode createExtraVectors();
118
124 virtual PetscErrorCode writeRestartDataHDF5(const std::string &filePath);
125
131 virtual PetscErrorCode readRestartDataHDF5(const std::string &filePath);
132
134 virtual PetscErrorCode writeLinSolversInfo();
135
137 virtual PetscErrorCode writeForcesASCII();
138
139}; // DecoupledIBPMSolver
body::BodyPackBase, type::BodyPack, and factory function.
Immersed-boundary method proposed by Li et. al. (2016).
Definition: decoupledibpm.h:23
Mat E
Regularization operator.
Definition: decoupledibpm.h:69
PetscLogStage stageRHSForces
Log stage for assembling the RHS of the forces system.
Definition: decoupledibpm.h:87
Mat BNH
Projection operator for the forces.
Definition: decoupledibpm.h:75
petibm::type::BodyPack bodies
Pack of immersed bodies.
Definition: decoupledibpm.h:60
virtual PetscErrorCode writeLinSolversInfo()
Write numbers of iterations and residuals of solvers to file.
virtual PetscErrorCode applyNoSlip()
Update the velocity to satisfy the no-slip condition.
Mat H
Spreading operator.
Definition: decoupledibpm.h:66
PetscViewer forcesViewer
ASCII PetscViewer object to output the forces.
Definition: decoupledibpm.h:96
virtual PetscErrorCode writeRestartDataHDF5(const std::string &filePath)
Write data required to restart a simulation into a HDF5 file.
Vec f
Vector to hold the forces at time step n.
Definition: decoupledibpm.h:78
virtual PetscErrorCode readRestartDataHDF5(const std::string &filePath)
Read data required to restart a simulation from a HDF5 file.
PetscErrorCode init(const MPI_Comm &world, const YAML::Node &node)
Initialize the decoupled IBPM solver.
DecoupledIBPMSolver()=default
Default constructor.
virtual PetscErrorCode createExtraOperators()
Assemble additional operators.
PetscLogStage stageSolveForces
Log stage for solving the forces system.
Definition: decoupledibpm.h:90
virtual PetscErrorCode writeForcesASCII()
Write the forces acting on the bodies into an ASCII file.
virtual PetscErrorCode solveForces()
Solve the system for the boundary forces.
PetscErrorCode destroy()
Manually destroy data.
PetscLogStage stageIntegrateForces
Log stage for integrating the Lagrangian forces.
Definition: decoupledibpm.h:93
Vec rhsf
Right-hand side of the forces system.
Definition: decoupledibpm.h:84
~DecoupledIBPMSolver()
Default destructor.
Vec df
Force-increment vector.
Definition: decoupledibpm.h:81
petibm::type::LinSolver fSolver
Linear solver for the Lagrangian forces.
Definition: decoupledibpm.h:63
virtual PetscErrorCode createExtraVectors()
Create additional vectors.
virtual PetscErrorCode assembleRHSForces()
Assemble the RHS vector of the system for the Lagrangian forces.
PetscErrorCode advance()
Advance the solution by one time step.
PetscErrorCode write()
Write solution and solver info to files.
virtual PetscErrorCode assembleRHSVelocity()
Assemble the RHS vector of the velocity system.
virtual PetscErrorCode updateForces()
Update the Lagrangian forces.
Mat EBNH
Left-hand side operator of the system for the forces.
Definition: decoupledibpm.h:72
Solve the incompressible Navier-Stokes equations with a projection method (Perot 1993).
Definition: navierstokes.h:30
PetscErrorCode ioInitialData()
Read or write initial data.
bool finished()
Evaluate if the simulation is finished.
std::shared_ptr< body::BodyPackBase > BodyPack
Definition of type::BodyPack.
Definition: bodypack.h:262
std::shared_ptr< linsolver::LinSolverBase > LinSolver
Type definition of LinSolver.
Definition: linsolver.h:174