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

Function main

examples/CIB/ex0/example.cpp:89–357  ·  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

87 * *
88 *******************************************************************************/
89int
90main(int argc, char* argv[])
91{
92 // Initialize IBAMR and libraries. Deinitialization is handled by this object as well.
93 IBTKInit ibtk_init(argc, argv, MPI_COMM_WORLD);
94
95 { // cleanup dynamically allocated objects prior to shutdown
96
97 // Parse command line options, set some standard options from the input
98 // file, initialize the restart database (if this is a restarted run),
99 // and enable file logging.
100 Pointer<AppInitializer> app_initializer = new AppInitializer(argc, argv, "CIB.log");
101 Pointer<Database> input_db = app_initializer->getInputDatabase();
102
103 // Read default Petsc options
104 if (input_db->keyExists("petsc_options_file"))
105 {
106 std::string petsc_options_file = input_db->getString("petsc_options_file");
107 PetscOptionsInsertFile(PETSC_COMM_WORLD, nullptr, petsc_options_file.c_str(), PETSC_TRUE);
108 }
109
110 // Get various standard options set in the input file.
111 const bool dump_viz_data = app_initializer->dumpVizData();
112 const int viz_dump_interval = app_initializer->getVizDumpInterval();
113 const bool uses_visit = dump_viz_data && !app_initializer->getVisItDataWriter().isNull();
114
115 const bool dump_restart_data = app_initializer->dumpRestartData();
116 const int restart_dump_interval = app_initializer->getRestartDumpInterval();
117 const string restart_dump_dirname = app_initializer->getRestartDumpDirectory();
118
119 const bool dump_postproc_data = app_initializer->dumpPostProcessingData();
120 const int postproc_data_dump_interval = app_initializer->getPostProcessingDataDumpInterval();
121 const string postproc_data_dump_dirname = app_initializer->getPostProcessingDataDumpDirectory();
122 if (dump_postproc_data && (postproc_data_dump_interval > 0) && !postproc_data_dump_dirname.empty())
123 {
124 Utilities::recursiveMkdir(postproc_data_dump_dirname);
125 }
126
127 const bool dump_timer_data = app_initializer->dumpTimerData();
128 const int timer_dump_interval = app_initializer->getTimerDumpInterval();
129
130 // Create major algorithm and data objects that comprise the
131 // application. These objects are configured from the input database
132 // and, if this is a restarted run, from the restart database.
133
134 // INS integrator
135 Pointer<INSStaggeredHierarchyIntegrator> navier_stokes_integrator = new INSStaggeredHierarchyIntegrator(
136 "INSStaggeredHierarchyIntegrator",
137 app_initializer->getComponentDatabase("INSStaggeredHierarchyIntegrator"));
138
139 // CIB method
140 const unsigned int num_structures = input_db->getIntegerWithDefault("num_structures", 1);
141 Pointer<CIBMethod> ib_method_ops =
142 new CIBMethod("CIBMethod", app_initializer->getComponentDatabase("CIBMethod"), num_structures);
143
144 // Krylov solver for INS integrator that solves for [u,p,U,L]
145 Pointer<CIBStaggeredStokesSolver> CIBSolver =
146 new CIBStaggeredStokesSolver("CIBStaggeredStokesSolver",

Callers

nothing calls this directly

Calls 15

rel_equal_epsFunction · 0.85
getInputDatabaseMethod · 0.80
dumpVizDataMethod · 0.80
getVizDumpIntervalMethod · 0.80
isNullMethod · 0.80
dumpRestartDataMethod · 0.80
dumpTimerDataMethod · 0.80

Tested by

no test coverage detected