* For each run, the input filename and restart information (if needed) must * * be given on the command line. For non-restarted case, command line is: * * * * executable * *
| 62 | * * |
| 63 | *******************************************************************************/ |
| 64 | int |
| 65 | main(int argc, char* argv[]) |
| 66 | { |
| 67 | // Initialize IBAMR and libraries. Deinitialization is handled by this object as well. |
| 68 | IBTKInit ibtk_init(argc, argv, MPI_COMM_WORLD); |
| 69 | |
| 70 | { // cleanup dynamically allocated objects prior to shutdown |
| 71 | |
| 72 | // Parse command line options, set some standard options from the input |
| 73 | // file, initialize the restart database (if this is a restarted run), |
| 74 | // and enable file logging. |
| 75 | Pointer<AppInitializer> app_initializer = new AppInitializer(argc, argv, "IB.log"); |
| 76 | Pointer<Database> input_db = app_initializer->getInputDatabase(); |
| 77 | |
| 78 | // Get various standard options set in the input file. |
| 79 | const bool dump_viz_data = app_initializer->dumpVizData(); |
| 80 | const int viz_dump_interval = app_initializer->getVizDumpInterval(); |
| 81 | const bool uses_visit = dump_viz_data && app_initializer->getVisItDataWriter(); |
| 82 | |
| 83 | const bool dump_restart_data = app_initializer->dumpRestartData(); |
| 84 | const int restart_dump_interval = app_initializer->getRestartDumpInterval(); |
| 85 | const string restart_dump_dirname = app_initializer->getRestartDumpDirectory(); |
| 86 | |
| 87 | const bool dump_timer_data = app_initializer->dumpTimerData(); |
| 88 | const int timer_dump_interval = app_initializer->getTimerDumpInterval(); |
| 89 | |
| 90 | // Create major algorithm and data objects that comprise the |
| 91 | // application. These objects are configured from the input database |
| 92 | // and, if this is a restarted run, from the restart database. |
| 93 | Pointer<INSHierarchyIntegrator> navier_stokes_integrator; |
| 94 | const string solver_type = |
| 95 | app_initializer->getComponentDatabase("Main")->getStringWithDefault("solver_type", "STAGGERED"); |
| 96 | if (solver_type == "STAGGERED") |
| 97 | { |
| 98 | navier_stokes_integrator = new INSStaggeredHierarchyIntegrator( |
| 99 | "INSStaggeredHierarchyIntegrator", |
| 100 | app_initializer->getComponentDatabase("INSStaggeredHierarchyIntegrator")); |
| 101 | } |
| 102 | else if (solver_type == "COLLOCATED") |
| 103 | { |
| 104 | navier_stokes_integrator = new INSCollocatedHierarchyIntegrator( |
| 105 | "INSCollocatedHierarchyIntegrator", |
| 106 | app_initializer->getComponentDatabase("INSCollocatedHierarchyIntegrator")); |
| 107 | } |
| 108 | else |
| 109 | { |
| 110 | TBOX_ERROR("Unsupported solver type: " << solver_type << "\n" |
| 111 | << "Valid options are: COLLOCATED, STAGGERED"); |
| 112 | } |
| 113 | Pointer<IBMethod> ib_method_ops = new IBMethod("IBMethod", app_initializer->getComponentDatabase("IBMethod")); |
| 114 | Pointer<IBHierarchyIntegrator> time_integrator = |
| 115 | new IBExplicitHierarchyIntegrator("IBHierarchyIntegrator", |
| 116 | app_initializer->getComponentDatabase("IBHierarchyIntegrator"), |
| 117 | ib_method_ops, |
| 118 | navier_stokes_integrator); |
| 119 | Pointer<CartesianGridGeometry<NDIM>> grid_geometry = new CartesianGridGeometry<NDIM>( |
| 120 | "CartesianGeometry", app_initializer->getComponentDatabase("CartesianGeometry")); |
| 121 | Pointer<PatchHierarchy<NDIM>> patch_hierarchy = new PatchHierarchy<NDIM>("PatchHierarchy", grid_geometry); |
nothing calls this directly
no test coverage detected