MCPcopy Create free account
hub / github.com/IBAMR/IBAMR / main

Function main

examples/adv_diff/ex1/example.cpp:49–282  ·  view source on GitHub ↗

* 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 * *

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 15

rel_equal_epsFunction · 0.85
getInputDatabaseMethod · 0.80
dumpVizDataMethod · 0.80
getVizDumpIntervalMethod · 0.80
dumpRestartDataMethod · 0.80
dumpTimerDataMethod · 0.80
getTimerDumpIntervalMethod · 0.80
getComponentDatabaseMethod · 0.80
setNullMethod · 0.80

Tested by

no test coverage detected