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 "
ibpm.h
"
16
39
int
main
(
int
argc,
char
**argv)
40
{
41
PetscErrorCode ierr;
42
YAML::Node config;
43
IBPMSolver
solver;
44
45
ierr = PetscInitialize(&argc, &argv,
nullptr
,
nullptr
); CHKERRQ(ierr);
46
ierr = PetscLogDefaultBegin(); CHKERRQ(ierr);
47
48
// parse configuration files; store info in YAML node
49
ierr =
petibm::parser::getSettings
(config); CHKERRQ(ierr);
50
51
// initialize the IBPM solver
52
ierr = solver.
init
(PETSC_COMM_WORLD, config); CHKERRQ(ierr);
53
ierr = solver.
ioInitialData
(); CHKERRQ(ierr);
54
ierr = PetscPrintf(PETSC_COMM_WORLD,
55
"Completed initialization stage\n"
); CHKERRQ(ierr);
56
57
// integrate the solution in time
58
while
(!solver.
finished
())
59
{
60
// compute the solution at the next time step
61
ierr = solver.
advance
(); CHKERRQ(ierr);
62
// output data to files
63
ierr = solver.
write
(); CHKERRQ(ierr);
64
}
65
66
// destroy the IBPM solver
67
ierr = solver.
destroy
(); CHKERRQ(ierr);
68
69
ierr = PetscFinalize(); CHKERRQ(ierr);
70
71
return
0;
72
}
// main
main
int main(int argc, char **argv)
Definition:
main.cpp:48
IBPMSolver
Immersed-boundary method proposed by Taira and Colonius (2007).
Definition:
ibpm.h:23
IBPMSolver::init
PetscErrorCode init(const MPI_Comm &world, const YAML::Node &node)
Initialize the IBPM solver.
Definition:
ibpm.cpp:54
IBPMSolver::ioInitialData
PetscErrorCode ioInitialData()
Read or write initial data.
Definition:
navierstokes.cpp:207
IBPMSolver::advance
PetscErrorCode advance()
Advance the solution by one time step.
Definition:
navierstokes.cpp:240
IBPMSolver::write
PetscErrorCode write()
Write solution, forces, and solvers info to files.
Definition:
ibpm.cpp:85
IBPMSolver::finished
bool finished()
Evaluate if the simulation is finished.
Definition:
navierstokes.cpp:311
IBPMSolver::destroy
PetscErrorCode destroy()
Manually destroy data.
Definition:
ibpm.cpp:37
petibm::parser::getSettings
PetscErrorCode getSettings(YAML::Node &node)
Get configuration settings.
Definition:
parser.cpp:175
ibpm.h
Definition of the class IBPMSolver.
parser.h
Prototypes of parser functions.
applications
ibpm
main.cpp
Generated on Mon May 30 2022 16:28:10 for PetIBM by
1.9.3