Non-linear elastic dynamics.
#include <BasicFiniteElements.hpp>
static char help[] =
"...\n\n";
std::map<int, NonlinearElasticElement::BlockData> &setOfBlocks;
&feElasticEnergy;
&feKineticEnergy;
bool iNit;
int pRT;
int *step;
std::map<int, NonlinearElasticElement::BlockData> &set_of_blocks,
:
FEMethod(), mField(m_field), postProc(m_field),
setOfBlocks(set_of_blocks), feElasticEnergy(fe_elastic_energy),
feKineticEnergy(fe_kinetic_energy), iNit(false) {
double def_t_val = 0;
Tag th_step;
"_TsStep_", 1, MB_TYPE_INTEGER, th_step,
MB_TAG_CREAT | MB_TAG_EXCL | MB_TAG_MESH, &def_t_val);
if (
rval == MB_ALREADY_ALLOCATED) {
(const void **)&step));
} else {
&def_t_val));
(const void **)&step));
}
PetscBool flg = PETSC_TRUE;
"-my_output_prt", &pRT, &flg),
"Can not get option");
if (flg != PETSC_TRUE) {
pRT = 10;
}
}
if (!iNit) {
false);
std::map<int, NonlinearElasticElement::BlockData>::iterator sit =
setOfBlocks.begin();
for (; sit != setOfBlocks.end(); sit++) {
}
iNit = true;
}
if ((*step) % pRT == 0) {
std::ostringstream sss;
sss << "out_values_" << (*step) << ".h5m";
}
feKineticEnergy);
"DYNAMIC", Sev::inform,
"%d Time %3.2e Elastic energy %3.2e Kinetic Energy %3.2e Total %3.2e\n",
ts_step, ts_t,
E,
T,
E +
T);
}
}
}
};
double *time;
int *step;
int pRT;
double def_t_val = 0;
Tag th_time;
"_TsTime_", 1, MB_TYPE_DOUBLE, th_time,
MB_TAG_CREAT | MB_TAG_EXCL | MB_TAG_MESH, &def_t_val);
if (
rval == MB_ALREADY_ALLOCATED) {
rval = m_field.
get_moab().tag_get_by_ptr(th_time, &root_meshset, 1,
(const void **)&time);
ierr = TSSetTime(ts, *time);
CHKERRABORT(PETSC_COMM_WORLD,
ierr);
} else {
rval = m_field.
get_moab().tag_set_data(th_time, &root_meshset, 1,
&def_t_val);
rval = m_field.
get_moab().tag_get_by_ptr(th_time, &root_meshset, 1,
(const void **)&time);
}
Tag th_step;
"_TsStep_", 1, MB_TYPE_INTEGER, th_step,
MB_TAG_CREAT | MB_TAG_EXCL | MB_TAG_MESH, &def_t_val);
if (
rval == MB_ALREADY_ALLOCATED) {
rval = m_field.
get_moab().tag_get_by_ptr(th_step, &root_meshset, 1,
(const void **)&step);
} else {
rval = m_field.
get_moab().tag_set_data(th_step, &root_meshset, 1,
&def_t_val);
rval = m_field.
get_moab().tag_get_by_ptr(th_step, &root_meshset, 1,
(const void **)&step);
}
PetscBool flg = PETSC_TRUE;
&flg);
CHKERRABORT(PETSC_COMM_WORLD,
ierr);
if (flg != PETSC_TRUE) {
pRT = 10;
}
}
(*time) = ts_t;
(*step)++;
}
}
}
};
int main(
int argc,
char *argv[]) {
"-pc_type lu \n"
"-pc_factor_mat_solver_type mumps \n"
"-mat_mumps_icntl_20 0 \n"
"-ksp_atol 1e-10 \n"
"-ksp_rtol 1e-10 \n"
"-snes_monitor \n"
"-snes_type newtonls \n"
"-snes_linesearch_type basic \n"
"-snes_max_it 100 \n"
"-snes_atol 1e-7 \n"
"-snes_rtol 1e-7 \n"
"-ts_monitor \n"
"-ts_type alpha \n";
std::ofstream file(
param_file.c_str(), std::ios::ate);
if (file.is_open()) {
file.close();
}
}
auto core_log = logging::core::get();
core_log->add_sink(
try {
ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
auto moab_comm_wrap =
boost::make_shared<WrapMPIComm>(PETSC_COMM_WORLD, false);
if (pcomm == NULL)
pcomm = new ParallelComm(&moab, moab_comm_wrap->get_comm());
PetscBool is_partitioned = PETSC_FALSE;
PetscBool linear = PETSC_TRUE;
PetscInt disp_order = 1;
PetscInt vel_order = 1;
PetscBool is_solve_at_time_zero = PETSC_FALSE;
auto read_command_line_parameters = [&]() {
PetscBool flg = PETSC_TRUE;
if (flg != PETSC_TRUE)
SETERRQ(PETSC_COMM_SELF, 1, "Error -my_file (mesh file needed)");
&is_partitioned, &flg);
PETSC_NULL);
enum bases { LEGENDRE, LOBATTO, BERNSTEIN_BEZIER, LASBASETOP };
const char *list_bases[] = {"legendre", "lobatto", "bernstein_bezier"};
PetscInt choice_base_value = BERNSTEIN_BEZIER;
LASBASETOP, &choice_base_value, PETSC_NULL);
if (choice_base_value == LEGENDRE)
else if (choice_base_value == LOBATTO)
else if (choice_base_value == BERNSTEIN_BEZIER)
&disp_order, &flg);
if (flg != PETSC_TRUE)
disp_order = 1;
&vel_order, &flg);
if (flg != PETSC_TRUE)
vel_order = disp_order;
"-my_solve_at_time_zero",
&is_solve_at_time_zero, &flg);
};
auto read_mesh = [&]() {
if (is_partitioned == PETSC_TRUE) {
const char *option;
option = "PARALLEL=BCAST_DELETE;"
"PARALLEL_RESOLVE_SHARED_ENTS;"
"PARTITION=PARALLEL_PARTITION;";
} else {
const char *option;
option = "";
}
};
CHKERR read_command_line_parameters();
bit_level0.set(0);
CHKERR moab.create_meshset(MESHSET_SET, meshset_level0);
0, 3, bit_level0);
bool check_if_spatial_field_exist = m_field.
check_field(
"DISPLACEMENT");
else
fluid_pressure_fe.addNeumannFluidPressureBCElements("DISPLACEMENT");
false, false);
fluid_pressure_fe.setNeumannFluidPressureFiniteElementOperators(
"DISPLACEMENT", PETSC_NULL, false, true);
else
disp_order);
else
else
CHKERR elastic_materials.setBlocks(elastic.setOfBlocks);
CHKERR elastic.addElement(
"ELASTIC",
"DISPLACEMENT");
false, false);
false, false);
false, false, false);
CHKERR elastic.setOperators(
"DISPLACEMENT",
"MESH_NODE_POSITIONS",
false,
true);
CHKERR elastic_materials.setBlocks(inertia.setOfBlocks);
CHKERR inertia.addConvectiveMassElement(
"MASS_ELEMENT",
"VELOCITY",
"DISPLACEMENT");
CHKERR inertia.addVelocityElement(
"VELOCITY_ELEMENT",
"VELOCITY",
"DISPLACEMENT");
{
string name = "-my_accelerogram";
char time_file_name[255];
PetscBool flg;
time_file_name, 255, &flg);
if (flg == PETSC_TRUE) {
}
}
CHKERR elastic_materials.setBlocks(damper.blockMaterialDataMap);
{
"DISPLACEMENT");
"DISPLACEMENT");
"DISPLACEMENT");
"DOT_DISPLACEMENT");
"DAMPER", "MESH_NODE_POSITIONS");
}
std::map<int, KelvinVoigtDamper::BlockMaterialData>::iterator
bit =
damper.blockMaterialDataMap.begin();
for (;
bit != damper.blockMaterialDataMap.end();
bit++) {
bit->second.lInear = linear;
damper.constitutiveEquationMap.insert(
material_data));
MBTET, "DAMPER");
}
CHKERR damper.setOperators(3);
}
elastic.getLoopFeEnergy(),
inertia.getLoopFeEnergy());
"DOT_DISPLACEMENT");
"DOT_VELOCITY");
if (!check_if_spatial_field_exist) {
Projection10NodeCoordsOnField ent_method_material(m_field,
"MESH_NODE_POSITIONS");
}
{
"FLUID_PRESSURE_FE");
ProblemsManager *prb_mng_ptr;
if (is_partitioned) {
CHKERR prb_mng_ptr->buildProblemOnDistributedMesh(
"Kuu",
true);
CHKERR prb_mng_ptr->partitionFiniteElements(
"Kuu",
true, 0,
pcomm->size());
} else {
CHKERR prb_mng_ptr->buildProblem(
"Kuu",
true);
CHKERR prb_mng_ptr->partitionProblem(
"Kuu");
CHKERR prb_mng_ptr->partitionFiniteElements(
"Kuu");
}
CHKERR prb_mng_ptr->partitionGhostDofs(
"Kuu");
}
"FLUID_PRESSURE_FE");
"MASS_ELEMENT");
"VELOCITY_ELEMENT");
ProblemsManager *prb_mng_ptr;
if (is_partitioned) {
CHKERR prb_mng_ptr->buildProblemOnDistributedMesh(
"DYNAMICS",
true);
CHKERR prb_mng_ptr->partitionFiniteElements(
"DYNAMICS",
true, 0,
pcomm->size());
} else {
CHKERR prb_mng_ptr->buildProblem(
"DYNAMICS",
true);
CHKERR prb_mng_ptr->partitionProblem(
"DYNAMICS");
CHKERR prb_mng_ptr->partitionFiniteElements(
"DYNAMICS");
}
CHKERR prb_mng_ptr->partitionGhostDofs(
"DYNAMICS");
&F);
TS ts;
CHKERR TSCreate(PETSC_COMM_WORLD, &ts);
CHKERR TSSetType(ts, TSBEULER);
->createMPIAIJWithArrays<PetscGlobalIdx_mi_tag>("Kuu",
CHKERR MatDuplicate(shellAij_ctx->
K, MAT_DO_NOT_COPY_VALUES,
D,
"DYNAMICS",
COL, shellAij_ctx->
u,
"Kuu",
COL,
D,
"DYNAMICS",
"VELOCITY",
COL, shellAij_ctx->
v,
"Kuu",
"DISPLACEMENT",
Mat shell_Aij;
const Problem *problem_ptr;
PETSC_COMM_WORLD, problem_ptr->getNbLocalDofsRow(),
problem_ptr->getNbLocalDofsCol(), problem_ptr->getNbDofsRow(),
problem_ptr->getNbDofsRow(), (void *)shellAij_ctx, &shell_Aij);
CHKERR MatShellSetOperation(shell_Aij, MATOP_MULT,
shell_Aij, MATOP_ZERO_ENTRIES,
ConvectiveMassElement::ShellMatrixElement shell_matrix_element(m_field);
m_field,
"DISPLACEMENT", shellAij_ctx->
barK, PETSC_NULL, PETSC_NULL);
shell_matrix_element.problemName = "Kuu";
shell_matrix_element.shellMatCtx = shellAij_ctx;
shell_matrix_element.DirichletBcPtr = &shell_dirichlet_bc;
shell_matrix_element.loopK.push_back(
ConvectiveMassElement::ShellMatrixElement::PairNameFEMethodPtr(
"ELASTIC", &elastic.getLoopFeLhs()));
shell_matrix_element.loopK.push_back(
ConvectiveMassElement::ShellMatrixElement::PairNameFEMethodPtr(
"ELASTIC", &damper.feLhs));
CHKERR inertia.setShellMatrixMassOperators(
"VELOCITY",
"DISPLACEMENT",
"MESH_NODE_POSITIONS", linear);
shell_matrix_element.loopM.push_back(
ConvectiveMassElement::ShellMatrixElement::PairNameFEMethodPtr(
"ELASTIC", &inertia.getLoopFeMassLhs()));
shell_matrix_element.loopAuxM.push_back(
ConvectiveMassElement::ShellMatrixElement::PairNameFEMethodPtr(
"ELASTIC", &inertia.getLoopFeMassAuxLhs()));
shell_matrix_residual.shellMatCtx = shellAij_ctx;
boost::ptr_map<std::string, NeumannForcesSurface> surface_forces;
{
string fe_name_str = "FORCE_FE";
surface_forces.at(fe_name_str).getLoopFe(), false,
false);
CHKERR surface_forces.at(fe_name_str)
.addForce("DISPLACEMENT", PETSC_NULL, it->getMeshsetId(), true);
surface_forces.at(fe_name_str)
}
}
boost::ptr_map<std::string, NeumannForcesSurface> surface_pressure;
{
string fe_name_str = "PRESSURE_FE";
surface_pressure.at(fe_name_str).getLoopFe(), false,
false);
CHKERR surface_pressure.at(fe_name_str)
.addPressure("DISPLACEMENT", PETSC_NULL, it->getMeshsetId(), true);
surface_pressure.at(fe_name_str)
}
}
boost::ptr_map<std::string, EdgeForce> edge_forces;
{
string fe_name_str = "FORCE_FE";
edge_forces.insert(fe_name_str,
new EdgeForce(m_field));
CHKERR edge_forces.at(fe_name_str)
.addForce("DISPLACEMENT", PETSC_NULL, it->getMeshsetId(), true);
edge_forces.at(fe_name_str).methodsOp.push_back(
new TimeForceScale());
}
}
boost::ptr_map<std::string, NodalForce> nodal_forces;
{
string fe_name_str = "FORCE_FE";
nodal_forces.insert(fe_name_str,
new NodalForce(m_field));
CHKERR nodal_forces.at(fe_name_str)
.addForce("DISPLACEMENT", F, it->getMeshsetId(), true);
nodal_forces.at(fe_name_str).methodsOp.push_back(
new TimeForceScale());
}
}
m_field, ts, "VELOCITY", "DISPLACEMENT");
TsCtx ts_ctx(m_field, "DYNAMICS");
ts_ctx.getPreProcessIFunction().push_back(&update_and_control);
ts_ctx.getPreProcessIFunction().push_back(&my_dirichlet_bc);
auto &loops_to_do_Rhs = ts_ctx.getLoopsIFunction();
auto add_static_rhs = [&](auto &loops_to_do_Rhs) {
loops_to_do_Rhs.push_back(
PairNameFEMethodPtr("ELASTIC", &elastic.getLoopFeRhs()));
for (auto fit = surface_forces.begin(); fit != surface_forces.end();
fit++) {
loops_to_do_Rhs.push_back(
PairNameFEMethodPtr(fit->first, &fit->second->getLoopFe()));
}
for (auto fit = surface_pressure.begin(); fit != surface_pressure.end();
fit++) {
loops_to_do_Rhs.push_back(
PairNameFEMethodPtr(fit->first, &fit->second->getLoopFe()));
}
for (auto fit = edge_forces.begin(); fit != edge_forces.end(); fit++) {
loops_to_do_Rhs.push_back(
PairNameFEMethodPtr(fit->first, &fit->second->getLoopFe()));
}
for (auto fit = nodal_forces.begin(); fit != nodal_forces.end(); fit++) {
loops_to_do_Rhs.push_back(
PairNameFEMethodPtr(fit->first, &fit->second->getLoopFe()));
}
loops_to_do_Rhs.push_back(PairNameFEMethodPtr(
"FLUID_PRESSURE_FE", &fluid_pressure_fe.getLoopFe()));
};
CHKERR add_static_rhs(loops_to_do_Rhs);
loops_to_do_Rhs.push_back(PairNameFEMethodPtr("DAMPER", &damper.feRhs));
loops_to_do_Rhs.push_back(
PairNameFEMethodPtr("MASS_ELEMENT", &inertia.getLoopFeMassRhs()));
ts_ctx.getPreProcessIFunction().push_back(&shell_matrix_residual);
ts_ctx.getPostProcessIFunction().push_back(&my_dirichlet_bc);
ts_ctx.getPreProcessIJacobian().push_back(&update_and_control);
ts_ctx.getPreProcessIJacobian().push_back(&shell_matrix_element);
ts_ctx.getPostProcessIJacobian().push_back(&update_and_control);
ts_ctx.getLoopsMonitor();
loopsMonitor.push_back(
loopsMonitor.push_back(
double ftime = 1;
CHKERR TSSetDuration(ts, PETSC_DEFAULT, ftime);
SNES snes;
KSP ksp;
CHKERR SNESGetKSP(snes, &ksp);
CHKERR KSPSetFromOptions(ksp);
PC pc;
CHKERR PCSetType(pc, PCSHELL);
CHKERR PCShellSetContext(pc, (
void *)&pc_shell_ctx);
CHKERR VecGhostUpdateBegin(
D, INSERT_VALUES, SCATTER_FORWARD);
CHKERR VecGhostUpdateEnd(
D, INSERT_VALUES, SCATTER_FORWARD);
"DYNAMICS",
COL,
D, INSERT_VALUES, SCATTER_REVERSE);
if (is_solve_at_time_zero) {
Mat Aij = shellAij_ctx->
K;
"Kuu",
COL,
D, INSERT_VALUES, SCATTER_FORWARD);
CHKERR VecGhostUpdateBegin(
D, INSERT_VALUES, SCATTER_FORWARD);
CHKERR VecGhostUpdateEnd(
D, INSERT_VALUES, SCATTER_FORWARD);
SNES snes;
CHKERR SNESCreate(PETSC_COMM_WORLD, &snes);
CHKERR SNESSetApplicationContext(snes, &snes_ctx);
CHKERR SNESSetFromOptions(snes);
snes_ctx.get_loops_to_do_Rhs();
snes_ctx.get_preProcess_to_do_Rhs().push_back(&my_dirichlet_bc);
fluid_pressure_fe.getLoopFe().ts_t = 0;
CHKERR add_static_rhs(loops_to_do_Rhs);
snes_ctx.get_postProcess_to_do_Rhs().push_back(&my_dirichlet_bc);
snes_ctx.get_loops_to_do_Mat();
snes_ctx.get_preProcess_to_do_Mat().push_back(&my_dirichlet_bc);
loops_to_do_Mat.push_back(
snes_ctx.get_postProcess_to_do_Mat().push_back(&my_dirichlet_bc);
"DOT_DISPLACEMENT");
"Kuu",
COL,
D, INSERT_VALUES, SCATTER_FORWARD);
CHKERR SNESSolve(snes, PETSC_NULL,
D);
int its;
CHKERR SNESGetIterationNumber(snes, &its);
MOFEM_LOG_C(
"DYNAMIC", Sev::inform,
"number of Newton iterations = %d\n",
its);
"Kuu",
COL,
D, INSERT_VALUES, SCATTER_REVERSE);
}
if (is_solve_at_time_zero) {
"DYNAMICS",
COL,
D, INSERT_VALUES, SCATTER_FORWARD);
CHKERR VecGhostUpdateBegin(
D, INSERT_VALUES, SCATTER_FORWARD);
CHKERR VecGhostUpdateEnd(
D, INSERT_VALUES, SCATTER_FORWARD);
}
#if PETSC_VERSION_GE(3, 7, 0)
CHKERR TSSetExactFinalTime(ts, TS_EXACTFINALTIME_STEPOVER);
#endif
PetscInt steps, snesfails, rejects, nonlinits, linits;
CHKERR TSGetTimeStepNumber(ts, &steps);
CHKERR TSGetSNESFailures(ts, &snesfails);
CHKERR TSGetStepRejections(ts, &rejects);
CHKERR TSGetSNESIterations(ts, &nonlinits);
CHKERR TSGetKSPIterations(ts, &linits);
"steps %d (%d rejected, %D SNES fails), ftime %g, nonlinits "
"%d, linits %D\n",
steps, rejects, snesfails, ftime, nonlinits, linits);
CHKERR MatDestroy(&shellAij_ctx->
K);
CHKERR MatDestroy(&shellAij_ctx->
M);
CHKERR MatDestroy(&shell_Aij);
delete shellAij_ctx;
}
return 0;
}
const std::string default_options
#define MOFEM_LOG_C(channel, severity, format,...)
#define CATCH_ERRORS
Catch errors.
FieldApproximationBase
approximation base
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
#define MOAB_THROW(err)
Check error code of MoAB function and throw MoFEM exception.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MYPCOMM_INDEX
default communicator number PCOMM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
virtual const Problem * get_problem(const std::string problem_name) const =0
Get the problem object.
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string &name_row)=0
set field row which finite element use
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
virtual MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elements.
virtual MoFEMErrorCode add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string &name, const bool recursive=true)=0
add entities to finite element
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string &name_filed)=0
set finite element field data
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string &name_row)=0
set field col which finite element use
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
virtual MoFEMErrorCode set_field_order(const EntityHandle meshset, const EntityType type, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)=0
Set order approximation of the entities in the field.
virtual MoFEMErrorCode add_ents_to_field_by_type(const Range &ents, const EntityType type, const std::string &name, int verb=DEFAULT_VERBOSITY)=0
Add entities to field meshset.
virtual bool check_field(const std::string &name) const =0
check if field is in database
MoFEMErrorCode writeFile(const std::string file_name)
wrote results in (MOAB) format, use "file_name.h5m"
MoFEMErrorCode addFieldValuesGradientPostProc(const std::string field_name, Vec v=PETSC_NULL)
Add operator to post-process L2 or H1 field gradient.
MoFEMErrorCode addFieldValuesPostProc(const std::string field_name, Vec v=PETSC_NULL)
Add operator to post-process L2, H1, Hdiv, Hcurl field value.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
virtual MoFEMErrorCode loop_dofs(const Problem *problem_ptr, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)=0
Make a loop over dofs.
virtual MoFEMErrorCode loop_finite_elements(const std::string &problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)=0
Make a loop over finite elements.
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
virtual MoFEMErrorCode modify_problem_add_finite_element(const std::string &name_problem, const std::string &fe_name)=0
add finite element to problem, this add entities assigned to finite element to a particular problem
virtual MoFEMErrorCode add_problem(const std::string &name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add problem.
virtual MoFEMErrorCode modify_problem_ref_level_add_bit(const std::string &name_problem, const BitRefLevel &bit)=0
add ref level to problem
const FTensor::Tensor2< T, Dim, Dim > Vec
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
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 TsSetIJacobian(TS ts, PetscReal t, Vec u, Vec u_t, PetscReal a, Mat A, Mat B, void *ctx)
Set function evaluating jacobina in TS solver.
PetscErrorCode TsMonitorSet(TS ts, PetscInt step, PetscReal t, Vec u, void *ctx)
Set monitor for TS solver.
PetscErrorCode SnesMat(SNES snes, Vec x, Mat A, Mat B, void *ctx)
This is MoFEM implementation for the left hand side (tangent matrix) evaluation in SNES solver.
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode SnesRhs(SNES snes, Vec x, Vec f, void *ctx)
This is MoFEM implementation for the right hand side (residual vector) evaluation in SNES solver.
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
MoFEMErrorCode addHOOpsFace3D(const std::string field, E &e, bool hcurl, bool hdiv)
PetscErrorCode TsSetIFunction(TS ts, PetscReal t, Vec u, Vec u_t, Vec F, void *ctx)
Set IFunction for TS solver.
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
DeprecatedCoreInterface Interface
MoFEMErrorCode addHOOpsVol(const std::string field, E &e, bool h1, bool hcurl, bool hdiv, bool l2)
const double D
diffusivity
int main(int argc, char *argv[])
definition of volume element
structure grouping operators and data used for calculation of mass (convective) element \ nonlinear_e...
static MoFEMErrorCode MultOpA(Mat A, Vec x, Vec f)
Mult operator for shell matrix.
static MoFEMErrorCode ZeroEntriesOp(Mat A)
static MoFEMErrorCode PCShellDestroy(PC pc)
static MoFEMErrorCode PCShellApplyOp(PC pc, Vec f, Vec x)
apply pre-conditioner for shell matrix
static MoFEMErrorCode PCShellSetUpOp(PC pc)
Set Dirichlet boundary conditions on displacements.
Force on edges and lines.
Manage setting parameters and constitutive equations for nonlinear/linear elastic materials.
Dumper material parameters.
Common data for nonlinear_elastic_elem model.
string spatialPositionNameDot
string spatialPositionName
Implementation of Kelvin Voigt Damper.
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
virtual MoFEMErrorCode add_field(const std::string &name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add field.
virtual moab::Interface & get_moab()=0
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.
boost::ptr_vector< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
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.
MoFEM::PairNameFEMethodPtr PairNameFEMethodPtr
MoFEM::FEMethodsSequence FEMethodsSequence
MoFEM::FEMethodsSequence FEMethodsSequence
MoFEM::PairNameFEMethodPtr PairNameFEMethodPtr
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
Finite element and operators to apply force/pressures applied to surfaces.
definition of volume element
structure grouping operators and data used for calculation of nonlinear elastic element
std::vector< EntityHandle > mapGaussPts
moab::Interface & postProcMesh
MoFEMErrorCode generateReferenceElementMesh()
Generate reference mesh on single element.
Force scale operator for reading two columns.