354 {
355
357 "-pc_type lu \n"
358 "-pc_factor_mat_solver_type mumps \n"
359 "-mat_mumps_icntl_20 0 \n"
360 "-ksp_monitor\n";
361
363 if (!
static_cast<bool>(ifstream(
param_file))) {
364 std::ofstream file(
param_file.c_str(), std::ios::ate);
365 if (file.is_open()) {
367 file.close();
368 }
369 }
370
372
373 try {
374
375 moab::Core mb_instance;
376 moab::Interface &moab = mb_instance;
377 int rank;
378 MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
379
380
381 PetscBool flg = PETSC_TRUE;
385 if (flg != PETSC_TRUE) {
387 "*** ERROR -my_file (MESH FILE NEEDED)");
388 }
389
390 const char *option;
391 option = "";
393
394
397
398
402
403 PetscPrintf(PETSC_COMM_WORLD,
404 "Read meshsets add added meshsets for bc.cfg\n");
406 PetscPrintf(PETSC_COMM_WORLD, "%s",
407 static_cast<std::ostringstream &>(
408 std::ostringstream().seekp(0) << *it << endl)
409 .str()
410 .c_str());
411 cerr << *it << endl;
412 }
413
414
416 ref_level.set(0);
418 0, 3, ref_level);
419
420
421
422
425 &flg);
426 if (flg != PETSC_TRUE) {
428 }
429
430
431
434
435
436
438 CHKERR ufe.addFiniteElements(
"FLUXES",
"VALUES");
439
440 CHKERR ufe.addBoundaryElements(ref_level);
441 CHKERR ufe.buildProblem(ref_level);
442 CHKERR ufe.createMatrices();
443 CHKERR ufe.solveLinearProblem();
444 CHKERR ufe.calculateResidual();
445 CHKERR ufe.evaluateError();
446 CHKERR ufe.destroyMatrices();
447 CHKERR ufe.postProc(
"out_0.h5m");
448
450
452 PETSC_NULL);
453
454
455
456 for (
int ll = 1; ll !=
nb_levels; ll++) {
461 bc_flux_map.clear();
462 CHKERR ufe.addBoundaryElements(ref_level);
463 CHKERR ufe.buildProblem(ref_level);
464 CHKERR ufe.createMatrices();
465 CHKERR ufe.solveLinearProblem();
466 CHKERR ufe.calculateResidual();
467 CHKERR ufe.evaluateError();
468 CHKERR ufe.destroyMatrices();
470 static_cast<std::ostringstream &>(std::ostringstream().seekp(0)
472 .str());
473 }
474 }
476
478
479 return 0;
480}
const std::string default_options
#define CATCH_ERRORS
Catch errors.
#define CHKERR
Inline error check.
#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT)
Iterator that loops over all the Cubit MeshSets in a moFEM field.
map< int, BcFluxData > BcFluxMap
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Deprecated interface functions.
Interface for managing meshsets containing materials and boundary conditions.
MoFEMErrorCode setMeshsetFromFile(const string file_name, const bool clean_file_options=true)
add blocksets reading config file
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
Application of mix transport data structure.