#define SINGULARITY
using namespace boost::multi_index;
using namespace boost::multiprecision;
using namespace boost::numeric;
#ifdef PYTHON_SDF
#include <boost/python.hpp>
#include <boost/python/def.hpp>
#include <boost/python/numpy.hpp>
namespace bp = boost::python;
namespace np = boost::python::numpy;
#endif
static char help[] =
"...\n\n";
int main(
int argc,
char *argv[]) {
const char param_file[] = "param_file.petsc";
auto core_log = logging::core::get();
#ifdef PYTHON_SDF
Py_Initialize();
np::initialize();
MOFEM_LOG(
"EP", Sev::inform) <<
"Python initialised";
#else
MOFEM_LOG(
"EP", Sev::inform) <<
"Python NOT initialised";
#endif
core_log->add_sink(
try {
PetscBool flg = PETSC_TRUE;
255, &flg);
255, &flg);
char restart_file[255];
PetscBool restart_flg = PETSC_TRUE;
&restart_flg);
double time = 0;
DMType dm_name = "DMMOFEM";
DMType dm_name_mg = "DMMOFEM_MG";
ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
if (pcomm == NULL)
pcomm = new ParallelComm(&moab, PETSC_COMM_WORLD);
const char *option;
if (pcomm->proc_config().proc_size() == 1)
option = "";
else
option = "PARALLEL=READ_PART;"
"PARALLEL_RESOLVE_SHARED_ENTS;"
"PARTITION=PARALLEL_PARTITION";
0, 3, bit_level0);
enum MaterialModel {
StVenantKirchhoff,
MooneyRivlin,
Hencky,
Neohookean,
LastMaterial
};
const char *list_materials[LastMaterial] = {
"stvenant_kirchhoff", "mooney_rivlin", "hencky", "neo_hookean"};
PetscInt choice_material = MooneyRivlin;
LastMaterial, &choice_material, PETSC_NULL);
switch (choice_material) {
case StVenantKirchhoff:
MOFEM_LOG(
"EP", Sev::inform) <<
"StVenantKirchhoff material model";
break;
case MooneyRivlin:
MOFEM_LOG(
"EP", Sev::inform) <<
"MooneyRivlin material model";
MOFEM_LOG(
"EP", Sev::inform) <<
"MU(1, 0)/2 = " <<
MU(1, 0) / 2;
break;
case Hencky:
MOFEM_LOG(
"EP", Sev::inform) <<
"Hencky material model";
break;
case Neohookean:
MOFEM_LOG(
"EP", Sev::inform) <<
"Neohookean material model";
break;
default:
break;
}
CHKERR VecSetOption(f_elastic, VEC_IGNORE_NEGATIVE_INDICES, PETSC_TRUE);
if (restart_flg) {
PetscViewer viewer;
CHKERR PetscViewerBinaryOpen(PETSC_COMM_WORLD, restart_file,
FILE_MODE_READ, &viewer);
CHKERR VecLoad(x_elastic, viewer);
CHKERR PetscViewerDestroy(&viewer);
SCATTER_REVERSE);
}
auto ts_elastic =
createTS(PETSC_COMM_WORLD);
CHKERR TSSetType(ts_elastic, TSBEULER);
TSAdapt adapt;
CHKERR TSGetAdapt(ts_elastic, &adapt);
CHKERR TSSetTime(ts_elastic, time);
}
#ifdef PYTHON_SDF
if (Py_FinalizeEx() < 0) {
exit(120);
}
#endif
}