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