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

Function main

examples/CIB/ex4/example.cpp:109–414  ·  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

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