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

Function main

examples/IBLevelSet/ex6/example.cpp:140–619  ·  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

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

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

Tested by

no test coverage detected