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

Function main

examples/CIB/ex1/example.cpp:121–513  ·  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

119 * *
120 *******************************************************************************/
121int
122main(int argc, char* argv[])
123{
124 // Initialize IBAMR and libraries. Deinitialization is handled by this object as well.
125 IBTKInit ibtk_init(argc, argv, MPI_COMM_WORLD);
126
127 { // cleanup dynamically allocated objects prior to shutdown
128
129 // Parse command line options, set some standard options from the input
130 // file, initialize the restart database (if this is a restarted run),
131 // and enable file logging.
132 Pointer<AppInitializer> app_initializer = new AppInitializer(argc, argv, "CIB.log");
133 Pointer<Database> input_db = app_initializer->getInputDatabase();
134
135 // Read default Petsc options
136 if (input_db->keyExists("petsc_options_file"))
137 {
138 std::string petsc_options_file = input_db->getString("petsc_options_file");
139 PetscOptionsInsertFile(PETSC_COMM_WORLD, nullptr, petsc_options_file.c_str(), PETSC_TRUE);
140 }
141
142 // Get various standard options set in the input file.
143 const bool dump_viz_data = app_initializer->dumpVizData();
144 const int viz_dump_interval = app_initializer->getVizDumpInterval();
145 const bool uses_visit = dump_viz_data && !app_initializer->getVisItDataWriter().isNull();
146
147 const bool dump_restart_data = app_initializer->dumpRestartData();
148 const int restart_dump_interval = app_initializer->getRestartDumpInterval();
149 const string restart_dump_dirname = app_initializer->getRestartDumpDirectory();
150
151 const bool dump_postproc_data = app_initializer->dumpPostProcessingData();
152 const int postproc_data_dump_interval = app_initializer->getPostProcessingDataDumpInterval();
153 const string postproc_data_dump_dirname = app_initializer->getPostProcessingDataDumpDirectory();
154 if (dump_postproc_data && (postproc_data_dump_interval > 0) && !postproc_data_dump_dirname.empty())
155 {
156 Utilities::recursiveMkdir(postproc_data_dump_dirname);
157 }
158
159 const bool dump_timer_data = app_initializer->dumpTimerData();
160 const int timer_dump_interval = app_initializer->getTimerDumpInterval();
161
162 // Create major algorithm and data objects that comprise the
163 // application. These objects are configured from the input database
164 // and, if this is a restarted run, from the restart database.
165
166 // INS integrator
167 Pointer<INSStaggeredHierarchyIntegrator> navier_stokes_integrator = new INSStaggeredHierarchyIntegrator(
168 "INSStaggeredHierarchyIntegrator",
169 app_initializer->getComponentDatabase("INSStaggeredHierarchyIntegrator"));
170
171 // CIB method
172 const unsigned int num_structures = input_db->getIntegerWithDefault("num_structures", 1);
173 Pointer<CIBMethod> ib_method_ops =
174 new CIBMethod("CIBMethod", app_initializer->getComponentDatabase("CIBMethod"), num_structures);
175
176 // Krylov solver for INS integrator that solves for [u,p,U,L]
177 Pointer<CIBStaggeredStokesSolver> CIBSolver =
178 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