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

Function main

examples/CIB/ex2/example.cpp:96–375  ·  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

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