cuIBM
A GPU-based Immersed Boundary Method code
cuIBM.cu
Go to the documentation of this file.
1 
7 #include "utilities/types.h"
8 #include "utilities/helpers.h"
9 #include "utilities/domain.h"
10 #include "io/io.h"
11 #include "solvers/createSolver.h"
12 
13 
17 int main(int argc, char **argv)
18 {
19  // initialize the computational domain
20  domain dom_info;
21 
22  // initialize the parameters of the simulation
23  parameterDB paramDB;
24 
25  // read input files
26  io::readInputs(argc, argv, paramDB, dom_info);
27 
28  io::printSimulationInfo(paramDB, dom_info);
29 
30  // create and initialize the appropriate flow solver
31  NavierStokesSolver<device_memory> *solver = createSolver<device_memory>(paramDB, dom_info);
32  solver->initialise();
33 
34  io::printDeviceMemoryUsage(std::string("Initialization complete"));
35 
36  // time-step loop
37  while (!solver->finished())
38  {
39  solver->stepTime();
40  solver->writeData();
41  }
42 
43  solver->shutDown();
44 } // main
void readInputs(int argc, char **argv, parameterDB &DB, domain &D)
Reads data inputs from the command-line and the simulation files.
Definition: io.cu:83
bool finished()
Evaluates the condition required to stop the simulation.
Definition of custom types required by the code.
Declaration of the function that creates the Navier-Stokes solver.
void stepTime()
Calculates the variables at the next time step.
Declaration of the functions of the namespace io.
std::map< std::string, componentParameter > parameterDB
Map from a string to a componentParameter.
Definition: parameterDB.h:64
virtual void shutDown()
Prints timing information and closes the different files.
Stores information about the computational grid.
Definition: domain.h:16
int main(int argc, char **argv)
Main function.
Definition: cuIBM.cu:17
virtual void writeData()
Writes data into files.
void printSimulationInfo(parameterDB &DB, domain &D)
Prints the parameters of the simulation.
Definition: io.cu:385
void printDeviceMemoryUsage(std::string label)
Prints device memory usage.
Definition: io.cu:593
Definition of the class domain.
Declaration of the discrete delta function.
Solves the Navier-Stokes equations in a rectangular domain.
virtual void initialise()
Initializes parameters, arrays and matrices required for the simulation.