28static char help[] =
"...\n\n";
34 std::map<int, NonlinearElasticElement::BlockData> &
setOfBlocks;
47 std::map<int, NonlinearElasticElement::BlockData> &set_of_blocks,
59 "_TsStep_", 1, MB_TYPE_INTEGER, th_step,
60 MB_TAG_CREAT | MB_TAG_EXCL | MB_TAG_MESH, &def_t_val);
61 if (
rval == MB_ALREADY_ALLOCATED) {
63 (
const void **)&
step));
68 (
const void **)&
step));
71 PetscBool flg = PETSC_TRUE;
73 "-my_output_prt", &
pRT, &flg),
74 "Can not get option");
75 if (flg != PETSC_TRUE) {
93 std::map<int, NonlinearElasticElement::BlockData>::iterator sit =
106 std::ostringstream sss;
107 sss <<
"out_values_" << (*step) <<
".h5m";
121 "DYNAMIC", Sev::inform,
122 "%d Time %3.2e Elastic energy %3.2e Kinetic Energy %3.2e Total %3.2e\n",
147 double def_t_val = 0;
153 "_TsTime_", 1, MB_TYPE_DOUBLE, th_time,
154 MB_TAG_CREAT | MB_TAG_EXCL | MB_TAG_MESH, &def_t_val);
155 if (
rval == MB_ALREADY_ALLOCATED) {
156 rval = m_field.
get_moab().tag_get_by_ptr(th_time, &root_meshset, 1,
157 (
const void **)&
time);
160 CHKERRABORT(PETSC_COMM_WORLD,
ierr);
162 rval = m_field.
get_moab().tag_set_data(th_time, &root_meshset, 1,
165 rval = m_field.
get_moab().tag_get_by_ptr(th_time, &root_meshset, 1,
166 (
const void **)&
time);
171 "_TsStep_", 1, MB_TYPE_INTEGER, th_step,
172 MB_TAG_CREAT | MB_TAG_EXCL | MB_TAG_MESH, &def_t_val);
173 if (
rval == MB_ALREADY_ALLOCATED) {
174 rval = m_field.
get_moab().tag_get_by_ptr(th_step, &root_meshset, 1,
175 (
const void **)&
step);
178 rval = m_field.
get_moab().tag_set_data(th_step, &root_meshset, 1,
181 rval = m_field.
get_moab().tag_get_by_ptr(th_step, &root_meshset, 1,
182 (
const void **)&
step);
186 PetscBool flg = PETSC_TRUE;
189 CHKERRABORT(PETSC_COMM_WORLD,
ierr);
190 if (flg != PETSC_TRUE) {
226int main(
int argc,
char *argv[]) {
230 "-pc_factor_mat_solver_type mumps \n"
231 "-mat_mumps_icntl_20 0 \n"
235 "-snes_type newtonls \n"
236 "-snes_linesearch_type basic \n"
237 "-snes_max_it 100 \n"
244 if (!
static_cast<bool>(ifstream(
param_file))) {
245 std::ofstream file(
param_file.c_str(), std::ios::ate);
246 if (file.is_open()) {
255 auto core_log = logging::core::get();
263 moab::Core mb_instance;
264 moab::Interface &moab = mb_instance;
266 ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
267 auto moab_comm_wrap =
268 boost::make_shared<WrapMPIComm>(PETSC_COMM_WORLD,
false);
270 pcomm =
new ParallelComm(&moab, moab_comm_wrap->get_comm());
274 PetscBool is_partitioned = PETSC_FALSE;
275 PetscBool linear = PETSC_TRUE;
276 PetscInt disp_order = 1;
277 PetscInt vel_order = 1;
278 PetscBool is_solve_at_time_zero = PETSC_FALSE;
280 auto read_command_line_parameters = [&]() {
282 PetscBool flg = PETSC_TRUE;
285 if (flg != PETSC_TRUE)
286 SETERRQ(PETSC_COMM_SELF, 1,
"Error -my_file (mesh file needed)");
291 &is_partitioned, &flg);
296 enum bases { LEGENDRE, LOBATTO, BERNSTEIN_BEZIER, LASBASETOP };
297 const char *list_bases[] = {
"legendre",
"lobatto",
"bernstein_bezier"};
298 PetscInt choice_base_value = BERNSTEIN_BEZIER;
300 LASBASETOP, &choice_base_value, PETSC_NULL);
301 if (choice_base_value == LEGENDRE)
303 else if (choice_base_value == LOBATTO)
305 else if (choice_base_value == BERNSTEIN_BEZIER)
310 if (flg != PETSC_TRUE)
315 if (flg != PETSC_TRUE)
316 vel_order = disp_order;
319 "-my_solve_at_time_zero",
320 &is_solve_at_time_zero, &flg);
325 auto read_mesh = [&]() {
327 if (is_partitioned == PETSC_TRUE) {
330 option =
"PARALLEL=BCAST_DELETE;"
331 "PARALLEL_RESOLVE_SHARED_ENTS;"
332 "PARTITION=PARALLEL_PARTITION;";
342 CHKERR read_command_line_parameters();
352 CHKERR moab.create_meshset(MESHSET_SET, meshset_level0);
367 bool check_if_spatial_field_exist = m_field.
check_field(
"DISPLACEMENT");
392 "DISPLACEMENT", PETSC_NULL,
false,
true);
444 false,
false,
false);
459 string name =
"-my_accelerogram";
460 char time_file_name[255];
463 time_file_name, 255, &flg);
464 if (flg == PETSC_TRUE) {
486 "DAMPER",
"MESH_NODE_POSITIONS");
488 std::map<int, KelvinVoigtDamper::BlockMaterialData>::iterator
bit =
491 bit->second.lInear = linear;
520 if (!check_if_spatial_field_exist) {
522 "MESH_NODE_POSITIONS");
538 "FLUID_PRESSURE_FE");
543 if (is_partitioned) {
562 "FLUID_PRESSURE_FE");
572 if (is_partitioned) {
591 CHKERR TSCreate(PETSC_COMM_WORLD, &ts);
592 CHKERR TSSetType(ts, TSBEULER);
598 ->createMPIAIJWithArrays<PetscGlobalIdx_mi_tag>(
"Kuu",
600 CHKERR MatDuplicate(shellAij_ctx->
K, MAT_DO_NOT_COPY_VALUES,
604 D,
"DYNAMICS",
COL, shellAij_ctx->
u,
"Kuu",
COL,
607 D,
"DYNAMICS",
"VELOCITY",
COL, shellAij_ctx->
v,
"Kuu",
"DISPLACEMENT",
615 problem_ptr->
getNbDofsRow(), (
void *)shellAij_ctx, &shell_Aij);
616 CHKERR MatShellSetOperation(shell_Aij, MATOP_MULT,
618 CHKERR MatShellSetOperation(
619 shell_Aij, MATOP_ZERO_ENTRIES,
622 ConvectiveMassElement::ShellMatrixElement shell_matrix_element(m_field);
624 m_field,
"DISPLACEMENT", shellAij_ctx->
barK, PETSC_NULL, PETSC_NULL);
627 shell_matrix_element.problemName =
"Kuu";
628 shell_matrix_element.shellMatCtx = shellAij_ctx;
629 shell_matrix_element.DirichletBcPtr = &shell_dirichlet_bc;
630 shell_matrix_element.loopK.push_back(
631 ConvectiveMassElement::ShellMatrixElement::PairNameFEMethodPtr(
634 shell_matrix_element.loopK.push_back(
635 ConvectiveMassElement::ShellMatrixElement::PairNameFEMethodPtr(
636 "ELASTIC", &damper.
feLhs));
640 "MESH_NODE_POSITIONS", linear);
644 shell_matrix_element.loopM.push_back(
645 ConvectiveMassElement::ShellMatrixElement::PairNameFEMethodPtr(
649 shell_matrix_element.loopAuxM.push_back(
650 ConvectiveMassElement::ShellMatrixElement::PairNameFEMethodPtr(
658 boost::ptr_map<std::string, NeumannForcesSurface> surface_forces;
660 string fe_name_str =
"FORCE_FE";
663 surface_forces.at(fe_name_str).getLoopFe(),
false,
667 CHKERR surface_forces.at(fe_name_str)
668 .addForce(
"DISPLACEMENT", PETSC_NULL, it->getMeshsetId(),
true);
669 surface_forces.at(fe_name_str)
674 boost::ptr_map<std::string, NeumannForcesSurface> surface_pressure;
676 string fe_name_str =
"PRESSURE_FE";
679 surface_pressure.at(fe_name_str).getLoopFe(),
false,
683 CHKERR surface_pressure.at(fe_name_str)
684 .addPressure(
"DISPLACEMENT", PETSC_NULL, it->getMeshsetId(),
true);
685 surface_pressure.at(fe_name_str)
691 boost::ptr_map<std::string, EdgeForce> edge_forces;
693 string fe_name_str =
"FORCE_FE";
694 edge_forces.insert(fe_name_str,
new EdgeForce(m_field));
697 CHKERR edge_forces.at(fe_name_str)
698 .addForce(
"DISPLACEMENT", PETSC_NULL, it->getMeshsetId(),
true);
699 edge_forces.at(fe_name_str).methodsOp.push_back(
new TimeForceScale());
704 boost::ptr_map<std::string, NodalForce> nodal_forces;
706 string fe_name_str =
"FORCE_FE";
707 nodal_forces.insert(fe_name_str,
new NodalForce(m_field));
710 CHKERR nodal_forces.at(fe_name_str)
711 .addForce(
"DISPLACEMENT",
F, it->getMeshsetId(),
true);
712 nodal_forces.at(fe_name_str).methodsOp.push_back(
new TimeForceScale());
718 m_field, ts,
"VELOCITY",
"DISPLACEMENT");
731 auto add_static_rhs = [&](
auto &loops_to_do_Rhs) {
733 loops_to_do_Rhs.push_back(
735 for (
auto fit = surface_forces.begin(); fit != surface_forces.end();
737 loops_to_do_Rhs.push_back(
740 for (
auto fit = surface_pressure.begin(); fit != surface_pressure.end();
742 loops_to_do_Rhs.push_back(
745 for (
auto fit = edge_forces.begin(); fit != edge_forces.end(); fit++) {
746 loops_to_do_Rhs.push_back(
749 for (
auto fit = nodal_forces.begin(); fit != nodal_forces.end(); fit++) {
750 loops_to_do_Rhs.push_back(
754 "FLUID_PRESSURE_FE", &fluid_pressure_fe.
getLoopFe()));
758 CHKERR add_static_rhs(loops_to_do_Rhs);
761 loops_to_do_Rhs.push_back(
778 loopsMonitor.push_back(
780 loopsMonitor.push_back(
789 CHKERR TSSetDuration(ts, PETSC_DEFAULT, ftime);
791 CHKERR TSSetFromOptions(ts);
794 CHKERR TSGetSNES(ts, &snes);
797 CHKERR SNESGetKSP(snes, &ksp);
798 CHKERR KSPSetFromOptions(ksp);
800 CHKERR KSPGetPC(ksp, &pc);
801 CHKERR PCSetType(pc, PCSHELL);
803 CHKERR PCShellSetContext(pc, (
void *)&pc_shell_ctx);
809 CHKERR VecGhostUpdateBegin(
D, INSERT_VALUES, SCATTER_FORWARD);
810 CHKERR VecGhostUpdateEnd(
D, INSERT_VALUES, SCATTER_FORWARD);
812 "DYNAMICS",
COL,
D, INSERT_VALUES, SCATTER_REVERSE);
815 if (is_solve_at_time_zero) {
817 Mat Aij = shellAij_ctx->
K;
825 "Kuu",
COL,
D, INSERT_VALUES, SCATTER_FORWARD);
826 CHKERR VecGhostUpdateBegin(
D, INSERT_VALUES, SCATTER_FORWARD);
827 CHKERR VecGhostUpdateEnd(
D, INSERT_VALUES, SCATTER_FORWARD);
829 SnesCtx snes_ctx(m_field,
"Kuu");
832 CHKERR SNESCreate(PETSC_COMM_WORLD, &snes);
833 CHKERR SNESSetApplicationContext(snes, &snes_ctx);
836 CHKERR SNESSetFromOptions(snes);
845 CHKERR add_static_rhs(loops_to_do_Rhs);
851 loops_to_do_Mat.push_back(
861 "Kuu",
COL,
D, INSERT_VALUES, SCATTER_FORWARD);
863 CHKERR SNESSolve(snes, PETSC_NULL,
D);
865 CHKERR SNESGetIterationNumber(snes, &its);
866 MOFEM_LOG_C(
"DYNAMIC", Sev::inform,
"number of Newton iterations = %d\n",
871 "Kuu",
COL,
D, INSERT_VALUES, SCATTER_REVERSE);
875 CHKERR SNESDestroy(&snes);
878 if (is_solve_at_time_zero) {
880 "DYNAMICS",
COL,
D, INSERT_VALUES, SCATTER_FORWARD);
881 CHKERR VecGhostUpdateBegin(
D, INSERT_VALUES, SCATTER_FORWARD);
882 CHKERR VecGhostUpdateEnd(
D, INSERT_VALUES, SCATTER_FORWARD);
886#if PETSC_VERSION_GE(3, 7, 0)
887 CHKERR TSSetExactFinalTime(ts, TS_EXACTFINALTIME_STEPOVER);
890 CHKERR TSGetTime(ts, &ftime);
892 PetscInt steps, snesfails, rejects, nonlinits, linits;
893 CHKERR TSGetTimeStepNumber(ts, &steps);
894 CHKERR TSGetSNESFailures(ts, &snesfails);
895 CHKERR TSGetStepRejections(ts, &rejects);
896 CHKERR TSGetSNESIterations(ts, &nonlinits);
897 CHKERR TSGetKSPIterations(ts, &linits);
899 "steps %d (%d rejected, %D SNES fails), ftime %g, nonlinits "
901 steps, rejects, snesfails, ftime, nonlinits, linits);
906 CHKERR MatDestroy(&shellAij_ctx->
K);
907 CHKERR MatDestroy(&shellAij_ctx->
M);
910 CHKERR MatDestroy(&shell_Aij);
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 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 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 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_row(const std::string &fe_name, const std::string name_row)=0
set field row 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 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.
MoFEMErrorCode writeFile(const std::string file_name, const char *file_type="MOAB", const char *file_options="PARALLEL=WRITE_PART")
wrote results in (MOAB) format, use "file_name.h5m"
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.
MoFEMErrorCode buildProblemOnDistributedMesh(const std::string name, const bool square_matrix, int verb=VERBOSE)
build problem data structures, assuming that mesh is distributed (collective)
MoFEMErrorCode partitionGhostDofs(const std::string name, int verb=VERBOSE)
determine ghost nodes
MoFEMErrorCode buildProblem(const std::string name, const bool square_matrix, int verb=VERBOSE)
build problem data structures
MoFEMErrorCode partitionProblem(const std::string name, int verb=VERBOSE)
partition problem dofs (collective)
MoFEMErrorCode partitionFiniteElements(const std::string name, bool part_from_moab=false, int low_proc=-1, int hi_proc=-1, int verb=VERBOSE)
partition finite elements
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
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
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)
MoFEMErrorCode addHOOpsVol(const std::string field, E &e, bool h1, bool hcurl, bool hdiv, bool l2)
definition of volume element
MatShellCtx * shellMatCtx
pointer to shell matrix
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)
MoFEMErrorCode setShellMatrixMassOperators(string velocity_field_name, string spatial_position_field_name, string material_position_field_name="MESH_NODE_POSITIONS", bool linear=false)
MoFEMErrorCode addVelocityElement(string element_name, string velocity_field_name, string spatial_position_field_name, string material_position_field_name="MESH_NODE_POSITIONS", bool ale=false, BitRefLevel bit=BitRefLevel())
static MoFEMErrorCode PCShellDestroy(PC pc)
MoFEMErrorCode addConvectiveMassElement(string element_name, string velocity_field_name, string spatial_position_field_name, string material_position_field_name="MESH_NODE_POSITIONS", bool ale=false, BitRefLevel bit=BitRefLevel())
static MoFEMErrorCode PCShellApplyOp(PC pc, Vec f, Vec x)
apply pre-conditioner for shell matrix
MoFEMErrorCode addHOOpsVol()
MyVolumeFE & getLoopFeMassRhs()
get rhs volume element
MyVolumeFE & getLoopFeEnergy()
get kinetic energy element
boost::ptr_vector< MethodForForceScaling > methodsOp
std::map< int, BlockData > setOfBlocks
maps block set id with appropriate BlockData
MyVolumeFE & getLoopFeMassLhs()
get lhs volume element
static MoFEMErrorCode PCShellSetUpOp(PC pc)
MyVolumeFE & getLoopFeMassAuxLhs()
get lhs volume element for Kuu shell matrix
Set Dirichlet boundary conditions on displacements.
Force on edges and lines.
Manage setting parameters and constitutive equations for nonlinear/linear elastic materials.
MyTriangleFE & getLoopFe()
MoFEMErrorCode setNeumannFluidPressureFiniteElementOperators(string field_name, Vec F, bool allow_negative_pressure=true, bool ho_geometry=false)
MoFEMErrorCode addNeumannFluidPressureBCElements(const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
Dumper material parameters.
Common data for nonlinear_elastic_elem model.
string spatialPositionNameDot
string spatialPositionName
Constitutive model functions.
Implementation of Kelvin Voigt Damper.
ConstitutiveEquationMap constitutiveEquationMap
std::map< int, BlockMaterialData > blockMaterialDataMap
MoFEMErrorCode setOperators(const int tag)
virtual moab::Interface & get_moab()=0
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.
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.
structure for User Loop Methods on finite elements
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.
Matrix manager is used to build and partition problems.
keeps basic data about problem
DofIdx getNbLocalDofsRow() const
DofIdx getNbDofsRow() const
DofIdx getNbLocalDofsCol() const
Problem manager is used to build and partition problems.
Projection of edge entities with one mid-node on hierarchical basis.
Interface for nonlinear (SNES) solver.
FEMethodsSequence & getSetOperators()
BasicMethodsSequence & getPreProcSetOperators()
MoFEM::FEMethodsSequence FEMethodsSequence
BasicMethodsSequence & getPostProcComputeRhs()
BasicMethodsSequence & getPostProcSetOperators()
BasicMethodsSequence & getPreProcComputeRhs()
FEMethodsSequence & getComputeRhs()
PetscInt ts_step
time step number
Interface for Time Stepping (TS) solver.
BasicMethodsSequence & getPostProcessIJacobian()
Get the postProcess to do IJacobian object.
MoFEM::FEMethodsSequence FEMethodsSequence
FEMethodsSequence & getLoopsMonitor()
Get the loops to do Monitor object.
BasicMethodsSequence & getPostProcessIFunction()
Get the postProcess to do IFunction object.
FEMethodsSequence & getLoopsIFunction()
Get the loops to do IFunction object.
BasicMethodsSequence & getPreProcessIFunction()
Get the preProcess to do IFunction object.
BasicMethodsSequence & getPreProcessIJacobian()
Get the preProcess to do IJacobian object.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
Vector manager is used to create vectors \mofem_vectors.
NonlinearElasticElement::MyVolumeFE & feElasticEnergy
calculate elastic energy
MoFEMErrorCode postProcess()
function is run at the end of loop
MoFEMErrorCode operator()()
function is run for every finite element
MoFEMErrorCode preProcess()
function is run at the beginning of loop
MoFEM::Interface & mField
std::map< int, NonlinearElasticElement::BlockData > & setOfBlocks
ConvectiveMassElement::MyVolumeFE & feKineticEnergy
calculate elastic energy
MonitorPostProc(MoFEM::Interface &m_field, std::map< int, NonlinearElasticElement::BlockData > &set_of_blocks, NonlinearElasticElement::MyVolumeFE &fe_elastic_energy, ConvectiveMassElement::MyVolumeFE &fe_kinetic_energy)
PostProcVolumeOnRefinedMesh postProc
MonitorRestart(MoFEM::Interface &m_field, TS ts)
MoFEMErrorCode preProcess()
function is run at the beginning of loop
MoFEMErrorCode postProcess()
function is run at the end of loop
MoFEMErrorCode operator()()
function is run for every finite element
MoFEM::Interface & mField
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
MyVolumeFE & getLoopFeLhs()
get lhs volume element
MoFEMErrorCode addElement(const std::string element_name, const std::string spatial_position_field_name, const std::string material_position_field_name="MESH_NODE_POSITIONS", const bool ale=false)
std::map< int, BlockData > setOfBlocks
maps block set id with appropriate BlockData
MyVolumeFE & getLoopFeRhs()
get rhs volume element
MyVolumeFE & getLoopFeEnergy()
get energy fe
MoFEMErrorCode setOperators(const std::string spatial_position_field_name, const std::string material_position_field_name="MESH_NODE_POSITIONS", const bool ale=false, const bool field_disp=false)
Set operators to calculate left hand tangent matrix and right hand residual.
std::vector< EntityHandle > mapGaussPts
moab::Interface & postProcMesh
MoFEMErrorCode generateReferenceElementMesh()
Generate reference mesh on single element.
Force scale operator for reading two columns.