PetIBM
0.5.4
Toolbox and applications of the immersed-boundary method for distributed-memory architectures
main.cpp
Go to the documentation of this file.
1
10
#include <petscsys.h>
11
#include <yaml-cpp/yaml.h>
12
13
#include <
petibm/parser.h
>
14
15
#include "
decoupledibpm.h
"
16
40
int
main
(
int
argc,
char
**argv)
41
{
42
PetscErrorCode ierr;
43
YAML::Node config;
44
DecoupledIBPMSolver
solver;
45
46
ierr = PetscInitialize(&argc, &argv,
nullptr
,
nullptr
); CHKERRQ(ierr);
47
ierr = PetscLogDefaultBegin(); CHKERRQ(ierr);
48
49
// parse configuration files; store info in YAML node
50
ierr =
petibm::parser::getSettings
(config); CHKERRQ(ierr);
51
52
// initialize the decoupled IBPM solver
53
ierr = solver.
init
(PETSC_COMM_WORLD, config); CHKERRQ(ierr);
54
ierr = solver.
ioInitialData
(); CHKERRQ(ierr);
55
ierr = PetscPrintf(PETSC_COMM_WORLD,
56
"Completed initialization stage\n"
); CHKERRQ(ierr);
57
58
// integrate the solution in time
59
while
(!solver.
finished
())
60
{
61
// compute the solution at the next time step
62
ierr = solver.
advance
(); CHKERRQ(ierr);
63
// output data to files
64
ierr = solver.
write
(); CHKERRQ(ierr);
65
}
66
67
// destroy the decoupled IBPM solver
68
ierr = solver.
destroy
(); CHKERRQ(ierr);
69
70
ierr = PetscFinalize(); CHKERRQ(ierr);
71
72
return
0;
73
}
// main
main
int main(int argc, char **argv)
Definition:
main.cpp:48
DecoupledIBPMSolver
Immersed-boundary method proposed by Li et. al. (2016).
Definition:
decoupledibpm.h:23
DecoupledIBPMSolver::ioInitialData
PetscErrorCode ioInitialData()
Read or write initial data.
Definition:
navierstokes.cpp:207
DecoupledIBPMSolver::finished
bool finished()
Evaluate if the simulation is finished.
Definition:
navierstokes.cpp:311
DecoupledIBPMSolver::init
PetscErrorCode init(const MPI_Comm &world, const YAML::Node &node)
Initialize the decoupled IBPM solver.
Definition:
decoupledibpm.cpp:57
DecoupledIBPMSolver::destroy
PetscErrorCode destroy()
Manually destroy data.
Definition:
decoupledibpm.cpp:36
DecoupledIBPMSolver::advance
PetscErrorCode advance()
Advance the solution by one time step.
Definition:
decoupledibpm.cpp:105
DecoupledIBPMSolver::write
PetscErrorCode write()
Write solution and solver info to files.
Definition:
decoupledibpm.cpp:134
decoupledibpm.h
Definition of the class DecoupledIBPMSolver.
petibm::parser::getSettings
PetscErrorCode getSettings(YAML::Node &node)
Get configuration settings.
Definition:
parser.cpp:175
parser.h
Prototypes of parser functions.
applications
decoupledibpm
main.cpp
Generated on Mon May 30 2022 16:28:10 for PetIBM by
1.9.3