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

Function main

examples/IBLevelSet/ex4/example.cpp:217–565  ·  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

215 * *
216 *******************************************************************************/
217int
218main(int argc, char* argv[])
219{
220 // Initialize PETSc, MPI, and SAMRAI.
221 IBTKInit ibtk_init(argc, argv, MPI_COMM_WORLD);
222
223 // Increase maximum patch data component indices
224 SAMRAIManager::setMaxNumberPatchDataEntries(2500);
225
226 { // cleanup dynamically allocated objects prior to shutdown
227
228 // Parse command line options, set some standard options from the input
229 // file, initialize the restart database (if this is a restarted run),
230 // and enable file logging.
231 Pointer<AppInitializer> app_initializer = new AppInitializer(argc, argv, "IBLevelSet.log");
232 Pointer<Database> input_db = app_initializer->getInputDatabase();
233
234 // Get various standard options set in the input file.
235 const bool dump_viz_data = app_initializer->dumpVizData();
236 const int viz_dump_interval = app_initializer->getVizDumpInterval();
237 const bool uses_visit = dump_viz_data && !app_initializer->getVisItDataWriter().isNull();
238
239 const bool dump_restart_data = app_initializer->dumpRestartData();
240 const int restart_dump_interval = app_initializer->getRestartDumpInterval();
241 const string restart_dump_dirname = app_initializer->getRestartDumpDirectory();
242 if (dump_restart_data && (restart_dump_interval > 0) && !restart_dump_dirname.empty())
243 {
244 Utilities::recursiveMkdir(restart_dump_dirname);
245 }
246
247 const bool dump_postproc_data = app_initializer->dumpPostProcessingData();
248 const int postproc_data_dump_interval = app_initializer->getPostProcessingDataDumpInterval();
249 const string postproc_data_dump_dirname = app_initializer->getPostProcessingDataDumpDirectory();
250 if (dump_postproc_data && (postproc_data_dump_interval > 0) && !postproc_data_dump_dirname.empty())
251 {
252 Utilities::recursiveMkdir(postproc_data_dump_dirname);
253 }
254
255 const bool dump_timer_data = app_initializer->dumpTimerData();
256 const int timer_dump_interval = app_initializer->getTimerDumpInterval();
257
258 // Setup solid information
259 foilA.R = input_db->getDouble("R");
260 foilA.mass = input_db->getDouble("MASS");
261
262 foilA.X0[0] = input_db->getDouble("X_COM");
263 foilA.X0[1] = input_db->getDouble("Y_COM");
264 foilA.X1[0] = input_db->getDouble("X1");
265 foilA.X1[1] = input_db->getDouble("Y1");
266 foilA.X2[0] = input_db->getDouble("X2");
267 foilA.X2[1] = input_db->getDouble("Y2");
268 foilA.X3[0] = input_db->getDouble("X3");
269 foilA.X3[1] = input_db->getDouble("Y3");
270
271 foilA.freq = input_db->getDouble("FREQ");
272 foilA.theta_0 = input_db->getDouble("THETA_0");
273
274 // Create major algorithm and data objects that comprise the

Callers

nothing calls this directly

Calls 15

getInputDatabaseMethod · 0.80
dumpVizDataMethod · 0.80
getVizDumpIntervalMethod · 0.80
isNullMethod · 0.80
dumpRestartDataMethod · 0.80
dumpTimerDataMethod · 0.80
getTimerDumpIntervalMethod · 0.80

Tested by

no test coverage detected