31using namespace boost::multi_index;
32using namespace boost::multiprecision;
33using namespace boost::numeric;
37#ifdef ENABLE_PYTHON_BINDING
38 #include <boost/python.hpp>
39 #include <boost/python/def.hpp>
40 #include <boost/python/numpy.hpp>
41namespace bp = boost::python;
42namespace np = boost::python::numpy;
48static char help[] =
"...\n\n";
50int main(
int argc,
char *argv[]) {
53 const char param_file[] =
"param_file.petsc";
57 auto core_log = logging::core::get();
66#ifdef ENABLE_PYTHON_BINDING
69 MOFEM_LOG(
"EP", Sev::inform) <<
"Python initialised";
71 MOFEM_LOG(
"EP", Sev::inform) <<
"Python NOT initialised";
82 PetscBool flg = PETSC_TRUE;
87 DMType dm_name =
"DMMOFEM";
89 DMType dm_name_mg =
"DMMOFEM_MG";
94 moab::Interface &moab = moab_core;
96 ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
98 pcomm =
new ParallelComm(&moab, PETSC_COMM_WORLD);
100 PetscBool fully_distributed = PETSC_FALSE;
102 &fully_distributed, PETSC_NULLPTR);
103 if (fully_distributed) {
105 if (pcomm->proc_config().proc_size() == 1)
108 option =
"PARALLEL=READ_PART;"
109 "PARALLEL_RESOLVE_SHARED_ENTS;"
110 "PARTITION=PARALLEL_PARTITION";
131 auto get_adj = [&](
Range ents,
int dim) {
133 CHKERR moab.get_adjacencies(ents, dim,
false, adj,
134 moab::Interface::UNION);
166#ifdef ENABLE_PYTHON_BINDING
167 if (Py_FinalizeEx() < 0) {
Eshelbian plasticity interface.
#define CATCH_ERRORS
Catch errors.
#define MYPCOMM_INDEX
default communicator number PCOMM
#define CHKERR
Inline error check.
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
MoFEMErrorCode DMRegister_MGViaApproxOrders(const char sname[])
Register DM for Multi-Grid via approximation orders.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
implementation of Data Operators for Forces and Sources
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
auto get_temp_meshset_ptr(moab::Interface &moab)
Create smart pointer to temporary meshset.
MoFEMErrorCode createCrackSurfaceMeshset()
MoFEMErrorCode projectGeometry(const EntityHandle meshset=0)
MoFEMErrorCode addCrackSurfaces(const bool debug=false)
MoFEMErrorCode createExchangeVectors(Sev sev)
static Range getPartEntities(moab::Interface &moab, int part)
static MoFEMErrorCode loadFileRootProcAllRestDistributed(moab::Interface &moab, const char *file_name, int dim, LoadFileFun proc_skin_fun=defaultProcSkinFun, const char *options="PARALLEL=BCAST;PARTITION=")
Root proc has whole mesh, other procs only part of it.
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.
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.
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
static boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.