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

Function main

tests/IBFE/explicit_ex4.cpp:163–780  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161 *******************************************************************************/
162
163int
164main(int argc, char** argv)
165{
166 // Initialize IBAMR and libraries. Deinitialization is handled by this object as well.
167 IBTKInit ibtk_init(argc, argv, MPI_COMM_WORLD);
168 const LibMeshInit& init = ibtk_init.getLibMeshInit();
169
170 // suppress warnings caused by using a refinement ratio of 4 and not
171 // setting up coarsening correctly
172 SAMRAI::tbox::Logger::getInstance()->setWarning(false);
173
174 PetscOptionsSetValue(nullptr, "-ksp_rtol", "1e-16");
175 // use lower tolerances in 2D
176 if (NDIM == 2)
177 {
178 PetscOptionsSetValue(nullptr, "-stokes_ksp_atol", "1e-14");
179 PetscOptionsSetValue(nullptr, "-stokes_ksp_rtol", "1e-14");
180 }
181 else
182 {
183 PetscOptionsSetValue(nullptr, "-stokes_ksp_atol", "1e-12");
184 PetscOptionsSetValue(nullptr, "-stokes_ksp_rtol", "1e-12");
185 }
186
187 { // cleanup dynamically allocated objects prior to shutdown
188 // prevent a warning about timer initializations
189 TimerManager::createManager(nullptr);
190
191 // Parse command line options, set some standard options from the input
192 // file, initialize the restart database (if this is a restarted run),
193 // and enable file logging.
194 Pointer<AppInitializer> app_initializer = new AppInitializer(argc, argv, "IB.log");
195 Pointer<Database> input_db = app_initializer->getInputDatabase();
196
197 const bool dump_restart_data = app_initializer->dumpRestartData();
198 const int restart_dump_interval = app_initializer->getRestartDumpInterval();
199 const string restart_dump_dirname = app_initializer->getRestartDumpDirectory();
200 const string restart_read_dirname = app_initializer->getRestartReadDirectory();
201 const int restart_restore_num = app_initializer->getRestartRestoreNumber();
202
203 // Create a simple FE mesh.
204 ReplicatedMesh mesh(init.comm(), NDIM);
205 string elem_type = input_db->getString("ELEM_TYPE");
206 const double R = 0.2;
207 if (NDIM == 2 && (elem_type == "TRI3" || elem_type == "TRI6"))
208 {
209 XdrIO io_in(mesh);
210 io_in.read(std::string(SOURCE_DIR) + "/" + input_db->getString("mesh_file"));
211 if (elem_type == "TRI6") mesh.all_second_order();
212 }
213 else
214 {
215 MeshTools::Generation::build_sphere(mesh, 0.01, 1, Utility::string_to_enum<ElemType>(elem_type));
216 }
217 mesh.prepare_for_use();
218
219 // Possibly assign boundary elements to a finer patch level (depending
220 // on what is in the input file)

Callers

nothing calls this directly

Calls 15

rel_equal_epsFunction · 0.85
copy_and_synchFunction · 0.85
jacobianFunction · 0.85
sumReductionFunction · 0.85
getInputDatabaseMethod · 0.80
dumpRestartDataMethod · 0.80
readMethod · 0.80
getComponentDatabaseMethod · 0.80

Tested by

no test coverage detected