* 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 * *
| 358 | * * |
| 359 | *******************************************************************************/ |
| 360 | int |
| 361 | main(int argc, char* argv[]) |
| 362 | { |
| 363 | // Initialize libMesh, PETSc, MPI, and SAMRAI. |
| 364 | LibMeshInit init(argc, argv); |
| 365 | SAMRAI_MPI::setCommunicator(PETSC_COMM_WORLD); |
| 366 | SAMRAIManager::startup(); |
| 367 | |
| 368 | { // cleanup dynamically allocated objects prior to shutdown |
| 369 | |
| 370 | // Parse command line options, set some standard options from the input |
| 371 | // file, initialize the restart database (if this is a restarted run), |
| 372 | // and enable file logging. |
| 373 | Pointer<AppInitializer> app_initializer = new AppInitializer(argc, argv, "IB.log"); |
| 374 | Pointer<Database> input_db = app_initializer->getInputDatabase(); |
| 375 | |
| 376 | // Get various standard options set in the input file. |
| 377 | const bool dump_viz_data = app_initializer->dumpVizData(); |
| 378 | const int viz_dump_interval = app_initializer->getVizDumpInterval(); |
| 379 | const bool uses_visit = dump_viz_data && app_initializer->getVisItDataWriter(); |
| 380 | const bool uses_exodus = dump_viz_data && !app_initializer->getExodusIIFilename().empty(); |
| 381 | const string viz_dump_dirname = app_initializer->getVizDumpDirectory(); |
| 382 | const string exodus_filename = viz_dump_dirname + "/disk.ex2"; |
| 383 | const string exodus_bndry_filename = viz_dump_dirname + "/disk_bndry.ex2"; |
| 384 | |
| 385 | const bool dump_restart_data = app_initializer->dumpRestartData(); |
| 386 | const int restart_dump_interval = app_initializer->getRestartDumpInterval(); |
| 387 | const string restart_dump_dirname = app_initializer->getRestartDumpDirectory(); |
| 388 | |
| 389 | const bool dump_postproc_data = app_initializer->dumpPostProcessingData(); |
| 390 | const int postproc_data_dump_interval = app_initializer->getPostProcessingDataDumpInterval(); |
| 391 | const string postproc_data_dump_dirname = app_initializer->getPostProcessingDataDumpDirectory(); |
| 392 | if (dump_postproc_data && (postproc_data_dump_interval > 0) && !postproc_data_dump_dirname.empty()) |
| 393 | { |
| 394 | Utilities::recursiveMkdir(postproc_data_dump_dirname); |
| 395 | } |
| 396 | |
| 397 | const bool dump_timer_data = app_initializer->dumpTimerData(); |
| 398 | const int timer_dump_interval = app_initializer->getTimerDumpInterval(); |
| 399 | |
| 400 | // Create a simple FE mesh. |
| 401 | ReplicatedMesh beam_mesh(init.comm(), NDIM); |
| 402 | DX = input_db->getDouble("DX"); |
| 403 | D = input_db->getDouble("D"); |
| 404 | const double n_cycles = input_db->getDouble("NCYCLE"); |
| 405 | string beam_elem_type = input_db->getString("BEAM_ELEM_TYPE"); |
| 406 | beam_mesh.read(input_db->getString("BEAM_MESH_FILENAME"), nullptr); |
| 407 | |
| 408 | const auto node_end = beam_mesh.nodes_end(); |
| 409 | for (MeshBase::node_iterator n_it = beam_mesh.nodes_begin(); n_it != node_end; ++n_it) |
| 410 | { |
| 411 | Node& n = **n_it; |
| 412 | |
| 413 | n(1) += 2 * D; |
| 414 | n(0) += 2 * D; |
| 415 | } |
| 416 | |
| 417 | MeshRefinement mesh_refinement_beam1(beam_mesh); |
nothing calls this directly
no test coverage detected