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

Function main

tests/fe_mechanics/fe_mechanics_ex0.cpp:209–577  ·  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

207 * *
208 *******************************************************************************/
209int
210main(int argc, char* argv[])
211{
212 // Initialize libMesh and SAMRAI.
213 LibMeshInit init(argc, argv);
214 SAMRAI_MPI::setCommunicator(PETSC_COMM_WORLD);
215 SAMRAIManager::startup();
216
217 // Since this is a test we do not want to print file names or line numbers
218 // to output files:
219 Pointer<Logger::Appender> abort_append(new TestAppender());
220 Logger::getInstance()->setAbortAppender(abort_append);
221
222 { // cleanup dynamically allocated objects prior to shutdown
223
224 // Parse command line options, set some standard options from the input
225 // file, initialize the restart database (if this is a restarted run),
226 // and enable file logging.
227 Pointer<AppInitializer> app_initializer = new AppInitializer(argc, argv, "IB.log");
228 Pointer<Database> input_db = app_initializer->getInputDatabase();
229
230 // Get various standard options set in the input file.
231 const bool dump_viz_data = app_initializer->dumpVizData();
232 const int viz_dump_interval = app_initializer->getVizDumpInterval();
233#ifdef LIBMESH_HAVE_EXODUS_API
234 const bool uses_exodus = dump_viz_data && !app_initializer->getExodusIIFilename().empty();
235#else
236 const bool uses_exodus = false;
237 if (!app_initializer->getExodusIIFilename().empty())
238 {
239 plog << "WARNING: libMesh was compiled without Exodus support, so no "
240 << "Exodus output will be written in this program.\n";
241 }
242#endif
243 const string exodus_filename = app_initializer->getExodusIIFilename();
244
245 const bool dump_restart_data = app_initializer->dumpRestartData();
246 const int restart_dump_interval = app_initializer->getRestartDumpInterval();
247 const string restart_dump_dirname = app_initializer->getRestartDumpDirectory();
248
249 const bool dump_timer_data = app_initializer->dumpTimerData();
250 const int timer_dump_interval = app_initializer->getTimerDumpInterval();
251
252 // Create a simple FE mesh.
253 Mesh mesh(init.comm(), NDIM);
254 if (input_db->keyExists("MESH_NAME"))
255 {
256 mesh.read(input_db->getString("MESH_NAME"));
257 }
258 else
259 {
260 const string elem_type = input_db->getStringWithDefault("ELEM_TYPE", "TRI3");
261 int ps_x = input_db->getDouble("N_X");
262 int ps_y = (NDIM > 1 ? input_db->getDouble("N_Y") : 0);
263 int ps_z = (NDIM > 2 ? input_db->getDouble("N_Z") : 0);
264
265 // Build grid mesh
266 MeshTools::Generation::build_cube(mesh,

Callers

nothing calls this directly

Calls 15

rel_equal_epsFunction · 0.85
jacobianFunction · 0.85
sumReductionFunction · 0.85
maxReductionFunction · 0.85
getInputDatabaseMethod · 0.80
dumpVizDataMethod · 0.80
getVizDumpIntervalMethod · 0.80
getExodusIIFilenameMethod · 0.80
dumpRestartDataMethod · 0.80

Tested by

no test coverage detected