* 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 * *
| 52 | * * |
| 53 | *******************************************************************************/ |
| 54 | int |
| 55 | main(int argc, char* argv[]) |
| 56 | { |
| 57 | // Initialize IBAMR and libraries. Deinitialization is handled by this object as well. |
| 58 | IBTKInit ibtk_init(argc, argv, MPI_COMM_WORLD); |
| 59 | |
| 60 | { // cleanup dynamically allocated objects prior to shutdown |
| 61 | |
| 62 | // Parse command line options, set some standard options from the input |
| 63 | // file, initialize the restart database (if this is a restarted run), |
| 64 | // and enable file logging. |
| 65 | Pointer<AppInitializer> app_initializer = new AppInitializer(argc, argv, "adv_diff.log"); |
| 66 | Pointer<Database> input_db = app_initializer->getInputDatabase(); |
| 67 | Pointer<Database> main_db = app_initializer->getComponentDatabase("Main"); |
| 68 | |
| 69 | // Get various standard options set in the input file. |
| 70 | const bool dump_viz_data = app_initializer->dumpVizData(); |
| 71 | const int viz_dump_interval = app_initializer->getVizDumpInterval(); |
| 72 | const bool uses_visit = dump_viz_data && app_initializer->getVisItDataWriter(); |
| 73 | |
| 74 | const bool dump_restart_data = app_initializer->dumpRestartData(); |
| 75 | const int restart_dump_interval = app_initializer->getRestartDumpInterval(); |
| 76 | const string restart_dump_dirname = app_initializer->getRestartDumpDirectory(); |
| 77 | |
| 78 | const bool dump_timer_data = app_initializer->dumpTimerData(); |
| 79 | const int timer_dump_interval = app_initializer->getTimerDumpInterval(); |
| 80 | |
| 81 | // Create major algorithm and data objects that comprise the |
| 82 | // application. These objects are configured from the input database |
| 83 | // and, if this is a restarted run, from the restart database. |
| 84 | Pointer<AdvDiffHierarchyIntegrator> time_integrator; |
| 85 | const string solver_type = |
| 86 | app_initializer->getComponentDatabase("Main")->getStringWithDefault("solver_type", "GODUNOV"); |
| 87 | if (solver_type == "GODUNOV") |
| 88 | { |
| 89 | Pointer<AdvectorExplicitPredictorPatchOps> predictor = new AdvectorExplicitPredictorPatchOps( |
| 90 | "AdvectorExplicitPredictorPatchOps", |
| 91 | app_initializer->getComponentDatabase("AdvectorExplicitPredictorPatchOps")); |
| 92 | time_integrator = new AdvDiffPredictorCorrectorHierarchyIntegrator( |
| 93 | "AdvDiffPredictorCorrectorHierarchyIntegrator", |
| 94 | app_initializer->getComponentDatabase("AdvDiffPredictorCorrectorHierarchyIntegrator"), |
| 95 | predictor); |
| 96 | } |
| 97 | else if (solver_type == "SEMI_IMPLICIT") |
| 98 | { |
| 99 | time_integrator = new AdvDiffSemiImplicitHierarchyIntegrator( |
| 100 | "AdvDiffSemiImplicitHierarchyIntegrator", |
| 101 | app_initializer->getComponentDatabase("AdvDiffSemiImplicitHierarchyIntegrator")); |
| 102 | } |
| 103 | else |
| 104 | { |
| 105 | TBOX_ERROR("Unsupported solver type: " << solver_type << "\n" |
| 106 | << "Valid options are: GODUNOV, SEMI_IMPLICIT"); |
| 107 | } |
| 108 | Pointer<CartesianGridGeometry<NDIM>> grid_geometry = new CartesianGridGeometry<NDIM>( |
| 109 | "CartesianGeometry", app_initializer->getComponentDatabase("CartesianGeometry")); |
| 110 | Pointer<PatchHierarchy<NDIM>> patch_hierarchy = new PatchHierarchy<NDIM>("PatchHierarchy", grid_geometry); |
| 111 | Pointer<StandardTagAndInitialize<NDIM>> error_detector = |
nothing calls this directly
no test coverage detected