* 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 * *
| 144 | * * |
| 145 | *******************************************************************************/ |
| 146 | int |
| 147 | main(int argc, char* argv[]) |
| 148 | { |
| 149 | // Initialize PETSc, MPI, and SAMRAI. |
| 150 | PetscInitialize(&argc, &argv, nullptr, nullptr); |
| 151 | SAMRAI_MPI::setCommunicator(PETSC_COMM_WORLD); |
| 152 | SAMRAI_MPI::setCallAbortInSerialInsteadOfExit(); |
| 153 | SAMRAIManager::startup(); |
| 154 | |
| 155 | // Increase maximum patch data component indices |
| 156 | SAMRAIManager::setMaxNumberPatchDataEntries(2500); |
| 157 | |
| 158 | { // cleanup dynamically allocated objects prior to shutdown |
| 159 | |
| 160 | // Parse command line options, set some standard options from the input |
| 161 | // file, initialize the restart database (if this is a restarted run), |
| 162 | // and enable file logging. |
| 163 | Pointer<AppInitializer> app_initializer = new AppInitializer(argc, argv, "IBLevelSet.log"); |
| 164 | Pointer<Database> input_db = app_initializer->getInputDatabase(); |
| 165 | |
| 166 | // Get various standard options set in the input file. |
| 167 | const bool dump_viz_data = app_initializer->dumpVizData(); |
| 168 | const int viz_dump_interval = app_initializer->getVizDumpInterval(); |
| 169 | const bool uses_visit = dump_viz_data && !app_initializer->getVisItDataWriter().isNull(); |
| 170 | |
| 171 | const bool dump_restart_data = app_initializer->dumpRestartData(); |
| 172 | const int restart_dump_interval = app_initializer->getRestartDumpInterval(); |
| 173 | const string restart_dump_dirname = app_initializer->getRestartDumpDirectory(); |
| 174 | if (dump_restart_data && (restart_dump_interval > 0) && !restart_dump_dirname.empty()) |
| 175 | { |
| 176 | Utilities::recursiveMkdir(restart_dump_dirname); |
| 177 | } |
| 178 | |
| 179 | const bool dump_postproc_data = app_initializer->dumpPostProcessingData(); |
| 180 | const int postproc_data_dump_interval = app_initializer->getPostProcessingDataDumpInterval(); |
| 181 | const string postproc_data_dump_dirname = app_initializer->getPostProcessingDataDumpDirectory(); |
| 182 | if (dump_postproc_data && (postproc_data_dump_interval > 0) && !postproc_data_dump_dirname.empty()) |
| 183 | { |
| 184 | Utilities::recursiveMkdir(postproc_data_dump_dirname); |
| 185 | } |
| 186 | |
| 187 | const bool dump_timer_data = app_initializer->dumpTimerData(); |
| 188 | const int timer_dump_interval = app_initializer->getTimerDumpInterval(); |
| 189 | |
| 190 | // Setup solid information |
| 191 | circle.R = input_db->getDouble("R"); |
| 192 | circle.X0[0] = input_db->getDouble("XCOM"); |
| 193 | circle.X0[1] = input_db->getDouble("YCOM"); |
| 194 | #if (NDIM == 3) |
| 195 | circle.X0[2] = input_db->getDouble("ZCOM"); |
| 196 | #endif |
| 197 | |
| 198 | // Create major algorithm and data objects that comprise the |
| 199 | // application. These objects are configured from the input database |
| 200 | // and, if this is a restarted run, from the restart database. |
| 201 | Pointer<INSVCStaggeredHierarchyIntegrator> navier_stokes_integrator = |
| 202 | new INSVCStaggeredConservativeHierarchyIntegrator( |
| 203 | "INSVCStaggeredConservativeHierarchyIntegrator", |
nothing calls this directly
no test coverage detected