* 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 * *
| 56 | * * |
| 57 | *******************************************************************************/ |
| 58 | int |
| 59 | main(int argc, char* argv[]) |
| 60 | { |
| 61 | // Initialize IBAMR and libraries. Deinitialization is handled by this object as well. |
| 62 | IBTKInit ibtk_init(argc, argv, MPI_COMM_WORLD); |
| 63 | |
| 64 | { // cleanup dynamically allocated objects prior to shutdown |
| 65 | |
| 66 | // prevent a warning about timer initialization |
| 67 | TimerManager::createManager(nullptr); |
| 68 | |
| 69 | // Parse command line options, set some standard options from the input |
| 70 | // file, initialize the restart database (if this is a restarted run), |
| 71 | // and enable file logging. |
| 72 | Pointer<AppInitializer> app_initializer = new AppInitializer(argc, argv, "adv_diff.log"); |
| 73 | Pointer<Database> input_db = app_initializer->getInputDatabase(); |
| 74 | Pointer<Database> main_db = app_initializer->getComponentDatabase("Main"); |
| 75 | |
| 76 | // Create major algorithm and data objects that comprise the |
| 77 | // application. |
| 78 | Pointer<CartesianGridGeometry<NDIM>> grid_geometry = new CartesianGridGeometry<NDIM>( |
| 79 | "CartesianGeometry", app_initializer->getComponentDatabase("CartesianGeometry")); |
| 80 | Pointer<PatchHierarchy<NDIM>> patch_hierarchy = new PatchHierarchy<NDIM>("PatchHierarchy", grid_geometry); |
| 81 | Pointer<StandardTagAndInitialize<NDIM>> error_detector = new StandardTagAndInitialize<NDIM>( |
| 82 | "StandardTagAndInitialize", nullptr, app_initializer->getComponentDatabase("StandardTagAndInitialize")); |
| 83 | Pointer<BergerRigoutsos<NDIM>> box_generator = new BergerRigoutsos<NDIM>(); |
| 84 | Pointer<LoadBalancer<NDIM>> load_balancer = |
| 85 | new LoadBalancer<NDIM>("LoadBalancer", app_initializer->getComponentDatabase("LoadBalancer")); |
| 86 | Pointer<GriddingAlgorithm<NDIM>> gridding_algorithm = |
| 87 | new GriddingAlgorithm<NDIM>("GriddingAlgorithm", |
| 88 | app_initializer->getComponentDatabase("GriddingAlgorithm"), |
| 89 | error_detector, |
| 90 | box_generator, |
| 91 | load_balancer); |
| 92 | |
| 93 | Pointer<VisItDataWriter<NDIM>> visit_writer = app_initializer->getVisItDataWriter(); |
| 94 | |
| 95 | auto var_db = VariableDatabase<NDIM>::getDatabase(); |
| 96 | Pointer<VariableContext> var_ctx = var_db->getContext("Context"); |
| 97 | Pointer<CellVariable<NDIM, double>> q_var = new CellVariable<NDIM, double>("CC_var"); |
| 98 | Pointer<CellVariable<NDIM, double>> convec_var = new CellVariable<NDIM, double>("Convec var"); |
| 99 | Pointer<CellVariable<NDIM, double>> exact_var = new CellVariable<NDIM, double>("Exact var"); |
| 100 | Pointer<FaceVariable<NDIM, double>> u_var = new FaceVariable<NDIM, double>("U"); |
| 101 | |
| 102 | const int q_idx = var_db->registerVariableAndContext(q_var, var_ctx); |
| 103 | const int convec_idx = var_db->registerVariableAndContext(convec_var, var_ctx); |
| 104 | const int exact_idx = var_db->registerVariableAndContext(exact_var, var_ctx); |
| 105 | const int u_idx = var_db->registerVariableAndContext(u_var, var_ctx); |
| 106 | // #define OUTPUT_VIZ_FILES // Comment out if you want to draw things |
| 107 | #ifdef OUTPUT_VIZ_FILES |
| 108 | visit_writer->registerPlotQuantity("Q", "SCALAR", q_idx); |
| 109 | visit_writer->registerPlotQuantity("Convec", "SCALAR", convec_idx); |
| 110 | visit_writer->registerPlotQuantity("Error", "SCALAR", exact_idx); |
| 111 | #endif |
| 112 | |
| 113 | Pointer<muParserCartGridFunction> u_fcn = |
| 114 | new muParserCartGridFunction("U", app_initializer->getComponentDatabase("U"), grid_geometry); |
| 115 | Pointer<muParserCartGridFunction> q_fcn = |
nothing calls this directly
no test coverage detected