1119 {
1120
1121 const string default_options = "-ksp_type fgmres \n"
1122 "-pc_type lu \n"
1123 "-pc_factor_mat_solver_type mumps\n"
1124 "-mat_mumps_icntl_20 0\n"
1125 "-ksp_monitor \n"
1126 "-ksp_atol 1e-10 \n"
1127 "-ksp_rtol 1e-10 \n"
1128 "-snes_monitor \n"
1129 "-snes_type newtonls \n"
1130 "-snes_linesearch_type l2 \n"
1131 "-snes_linesearch_monitor \n"
1132 "-snes_max_it 16 \n"
1133 "-snes_atol 1e-8 \n"
1134 "-snes_rtol 1e-8 \n"
1135 "-snes_converged_reason \n";
1136
1137 string param_file = "param_file.petsc";
1138 if (!static_cast<bool>(ifstream(param_file))) {
1139 std::ofstream
file(param_file.c_str(), std::ios::ate);
1140 if (
file.is_open()) {
1141 file << default_options;
1143 }
1144 }
1146
1147 auto core_log = logging::core::get();
1148 core_log->add_sink(
1152
1153 try {
1154 moab::Core mb_instance;
1155 moab::Interface &moab = mb_instance;
1156
1158 CHKERR example.runProblem();
1159 }
1161
1163
1164 return 0;
1165}
#define CATCH_ERRORS
Catch errors.
#define CHKERR
Inline error check.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
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.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.