19using namespace boost::numeric;
22 -my_file mesh file name\n\
23 -my_sr reduction of step size\n\
24 -my_its_d desired number of steps\n\
25 -my_ms maximal number of steps\n\n";
27#define DATAFILENAME "load_disp.txt"
35 boost::shared_ptr<ArcLengthCtx> &arc_ptr)
41 rval =
mOab.get_entities_by_type(meshset, MBVERTEX, nodes,
true);
46 PetscPrintf(PETSC_COMM_WORLD,
"Nb. PostProcNodes %lu\n",
53 PetscFOpen(PETSC_COMM_SELF,
DATAFILENAME,
"a+", &datafile);
56 boost::shared_ptr<NumeredDofEntity_multiIndex> numered_dofs_rows =
57 problemPtr->getNumeredRowDofsPtr();
58 auto lit = numered_dofs_rows->lower_bound(
60 auto hi_lit = numered_dofs_rows->upper_bound(
63 if (lit == numered_dofs_rows->end()) {
66 }
else if (std::distance(lit, hi_lit) != 1) {
68 "Only one DOF is expected");
73 NumeredDofEntityByEnt::iterator dit, hi_dit;
74 dit = numered_dofs_rows->get<
Ent_mi_tag>().lower_bound(*nit);
75 hi_dit = numered_dofs_rows->get<
Ent_mi_tag>().upper_bound(*nit);
78 for (; dit != hi_dit; dit++) {
79 PetscPrintf(PETSC_COMM_WORLD,
"%s [ %d ] %6.4e -> ",
80 lit->get()->getName().c_str(), lit->get()->getDofCoeffIdx(),
81 lit->get()->getFieldData());
82 PetscPrintf(PETSC_COMM_WORLD,
"%s [ %d ] %6.4e ",
83 dit->get()->getName().c_str(), dit->get()->getDofCoeffIdx(),
84 dit->get()->getFieldData());
85 PetscPrintf(PETSC_COMM_WORLD,
"-> %3.4f %3.4f %3.4f\n", coords[0],
86 coords[1], coords[2]);
87 PetscFPrintf(PETSC_COMM_WORLD, datafile,
"%6.4e %6.4e ",
88 dit->get()->getFieldData(), lit->get()->getFieldData());
91 PetscFPrintf(PETSC_COMM_WORLD, datafile,
"\n");
104 boost::shared_ptr<ArcLengthCtx> &arc_ptr)
115 CHKERR VecGhostUpdateBegin(
snes_f, INSERT_VALUES, SCATTER_FORWARD);
116 CHKERR VecGhostUpdateEnd(
snes_f, INSERT_VALUES, SCATTER_FORWARD);
131 CHKERR VecGhostUpdateBegin(
snes_f, ADD_VALUES, SCATTER_REVERSE);
132 CHKERR VecGhostUpdateEnd(
snes_f, ADD_VALUES, SCATTER_REVERSE);
138 PetscPrintf(PETSC_COMM_WORLD,
"\tlambda = %6.4e\n",
143 PetscPrintf(PETSC_COMM_WORLD,
"\tfnorm = %6.4e\n", fnorm);
157int main(
int argc,
char *argv[]) {
161 "-pc_factor_mat_solver_type mumps\n"
162 "-mat_mumps_icntl_20 0\n"
167 "-snes_type newtonls \n"
168 "-snes_linesearch_type l2 \n"
169 "-snes_linesearch_monitor \n"
173 "-snes_converged_reason \n";
176 if (!
static_cast<bool>(ifstream(
param_file))) {
177 std::ofstream file(
param_file.c_str(), std::ios::ate);
178 if (file.is_open()) {
187 moab::Core mb_instance;
188 moab::Interface &moab = mb_instance;
190 MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
193 PetscBool flg = PETSC_TRUE;
197 if (flg != PETSC_TRUE) {
199 "*** ERROR -my_file (MESH FILE NEEDED)");
202 PetscScalar step_size_reduction;
204 &step_size_reduction, &flg);
205 if (flg != PETSC_TRUE) {
206 step_size_reduction = 1.;
212 if (flg != PETSC_TRUE) {
218 if (flg != PETSC_TRUE) {
225 if (flg != PETSC_TRUE) {
231 if (std::string(
mesh_file_name).find(
"restart") == std::string::npos) {
241 Tag th_step_size, th_step;
242 double def_step_size = 1;
243 rval = moab.tag_get_handle(
"_STEPSIZE", 1, MB_TYPE_DOUBLE, th_step_size,
244 MB_TAG_CREAT | MB_TAG_MESH, &def_step_size);
245 if (
rval == MB_ALREADY_ALLOCATED)
249 rval = moab.tag_get_handle(
"_STEP", 1, MB_TYPE_INTEGER, th_step,
250 MB_TAG_CREAT | MB_TAG_MESH, &def_step);
251 if (
rval == MB_ALREADY_ALLOCATED)
254 const void *tag_data_step_size[1];
256 CHKERR moab.tag_get_by_ptr(th_step_size, &root, 1, tag_data_step_size);
257 double &step_size = *(
double *)tag_data_step_size[0];
258 const void *tag_data_step[1];
259 CHKERR moab.tag_get_by_ptr(th_step, &root, 1, tag_data_step);
260 int &step = *(
int *)tag_data_step[0];
262 CHKERR PetscPrintf(PETSC_COMM_WORLD,
263 "Start step %D and step_size = %6.4e\n", step,
276 "_MY_REFINEMENT_LEVEL",
sizeof(
BitRefLevel), MB_TYPE_OPAQUE,
277 th_my_ref_level, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES,
281 CHKERR m_field.
get_moab().tag_get_by_ptr(th_my_ref_level, &root_meshset, 1,
282 (
const void **)&ptr_bit_level0);
292 std::vector<BitRefLevel> bit_levels;
299 CHKERR PetscPrintf(PETSC_COMM_WORLD,
"Insert Interface %d\n",
300 cit->getMeshsetId());
305 CHKERR moab.create_meshset(MESHSET_SET, ref_level_meshset);
307 ->getEntitiesByTypeAndRefLevel(bit_levels.back(),
311 ->getEntitiesByTypeAndRefLevel(bit_levels.back(),
314 Range ref_level_tets;
315 CHKERR moab.get_entities_by_handle(ref_level_meshset, ref_level_tets,
318 CHKERR interface_ptr->
getSides(cubit_meshset, bit_levels.back(),
true,
324 cubit_meshset,
true,
true, 0);
326 CHKERR moab.delete_entities(&ref_level_meshset, 1);
332 ->updateMeshsetByEntitiesChildren(cubit_meshset,
334 cubit_meshset, MBMAXTYPE,
true);
338 bit_level0 = bit_levels.back();
339 problem_bit_level = bit_level0;
366 "ELASTIC",
"MESH_NODE_POSITIONS");
381 "INTERFACE",
"MESH_NODE_POSITIONS");
420 problem_bit_level,
BitRefLevel().set(),
"ELASTIC", MBTET);
422 problem_bit_level,
BitRefLevel().set(),
"INTERFACE", MBPRISM);
429 const double coords[] = {0, 0, 0};
431 Range range_no_field_vertex;
432 range_no_field_vertex.insert(no_field_vertex);
438 range_no_field_vertex);
443 CHKERR moab.create_meshset(MESHSET_SET, meshset_fe_arc_length);
444 CHKERR moab.add_entities(meshset_fe_arc_length, &no_field_vertex, 1);
450 meshset_fe_arc_length,
"ARC_LENGTH",
false);
502 CHKERR m_field.
get_moab().get_entities_by_type(it->meshset, MBTET, tets,
515 "MESH_NODE_POSITIONS");
545 Vec
F, F_body_force,
D;
547 "ELASTIC_MECHANICS",
COL, &
F);
549 CHKERR VecDuplicate(
F, &F_body_force);
552 ->createMPIAIJWithArrays<PetscGlobalIdx_mi_tag>(
"ELASTIC_MECHANICS",
559 boost::ptr_vector<CohesiveInterfaceElement::PhysicalEquation>
565 cout << std::endl << *it << std::endl;
568 string name = it->getName();
570 if (name.compare(0, 11,
"MAT_ELASTIC") == 0) {
572 CHKERR it->getAttributeDataStructure(mydata);
576 }
else if (name.compare(0, 10,
"MAT_INTERF") == 0) {
578 CHKERR it->getAttributeDataStructure(mydata);
581 interface_materials.push_back(
583 interface_materials.back().h = 1;
584 interface_materials.back().youngModulus = mydata.
data.alpha;
585 interface_materials.back().beta = mydata.
data.beta;
586 interface_materials.back().ft = mydata.
data.ft;
587 interface_materials.back().Gf = mydata.
data.Gf;
591 rval = moab.get_entities_by_type(meshset, MBTRI, tris,
true);
594 rval = moab.get_adjacencies(tris, 3,
false, ents3d,
595 moab::Interface::UNION);
597 interface_materials.back().pRisms = ents3d.subset_by_type(MBPRISM);
602 boost::ptr_vector<CohesiveInterfaceElement::PhysicalEquation>::iterator
603 pit = interface_materials.begin();
604 for (; pit != interface_materials.end(); pit++) {
609 boost::shared_ptr<ArcLengthCtx> arc_ctx = boost::shared_ptr<ArcLengthCtx>(
611 boost::scoped_ptr<ArcLengthElement> my_arc_method_ptr(
613 ArcLengthSnesCtx snes_ctx(m_field,
"ELASTIC_MECHANICS", arc_ctx);
620 boost::shared_ptr<Hooke<adouble>> hooke_adouble_ptr(
new Hooke<adouble>);
621 boost::shared_ptr<Hooke<double>> hooke_double_ptr(
new Hooke<double>);
628 elastic.
setOfBlocks[id].materialDoublePtr = hooke_double_ptr;
629 elastic.
setOfBlocks[id].materialAdoublePtr = hooke_adouble_ptr;
634 false,
false,
false);
636 false,
false,
false);
638 false,
false,
false);
643 CHKERR cohesive_elements.
addOps(
"DISPLACEMENT", interface_materials);
648 MatGetLocalSize(Aij, &
m, &
n);
649 boost::scoped_ptr<ArcLengthMatShell> mat_ctx(
652 CHKERR MatCreateShell(PETSC_COMM_WORLD,
m,
n,
M,
N, (
void *)mat_ctx.get(),
654 CHKERR MatShellSetOperation(ShellAij, MATOP_MULT,
664 CHKERR VecZeroEntries(F_body_force);
665 CHKERR VecGhostUpdateBegin(F_body_force, INSERT_VALUES, SCATTER_FORWARD);
666 CHKERR VecGhostUpdateEnd(F_body_force, INSERT_VALUES, SCATTER_FORWARD);
669 CHKERR VecGhostUpdateBegin(F_body_force, ADD_VALUES, SCATTER_REVERSE);
670 CHKERR VecGhostUpdateEnd(F_body_force, ADD_VALUES, SCATTER_REVERSE);
671 CHKERR VecAssemblyBegin(F_body_force);
672 CHKERR VecAssemblyEnd(F_body_force);
675 boost::ptr_map<std::string, NeumannForcesSurface> neumann_forces;
676 string fe_name_str =
"FORCE_FE";
679 neumann_forces.at(fe_name_str).getLoopFe(),
false,
683 CHKERR neumann_forces.at(fe_name_str)
684 .addForce(
"DISPLACEMENT", arc_ctx->F_lambda, it->getMeshsetId());
686 fe_name_str =
"PRESSURE_FE";
689 neumann_forces.at(fe_name_str).getLoopFe(),
false,
693 CHKERR neumann_forces.at(fe_name_str)
694 .addPressure(
"DISPLACEMENT", arc_ctx->F_lambda, it->getMeshsetId());
697 boost::ptr_map<std::string, NodalForce> nodal_forces;
698 fe_name_str =
"FORCE_FE";
699 nodal_forces.insert(fe_name_str,
new NodalForce(m_field));
702 CHKERR nodal_forces.at(fe_name_str)
703 .addForce(
"DISPLACEMENT", arc_ctx->F_lambda, it->getMeshsetId());
707 CHKERR SNESCreate(PETSC_COMM_WORLD, &snes);
708 CHKERR SNESSetApplicationContext(snes, &snes_ctx);
710 CHKERR SNESSetJacobian(snes, ShellAij, Aij,
SnesMat, &snes_ctx);
711 CHKERR SNESSetFromOptions(snes);
714 CHKERR SNESGetKSP(snes, &ksp);
716 CHKERR KSPGetPC(ksp, &pc);
717 boost::scoped_ptr<PCArcLengthCtx> pc_ctx(
719 CHKERR PCSetType(pc, PCSHELL);
720 CHKERR PCShellSetContext(pc, pc_ctx.get());
726 snes_ctx.get_loops_to_do_Rhs();
727 snes_ctx.get_preProcess_to_do_Rhs().push_back(&my_dirichlet_bc);
728 snes_ctx.get_preProcess_to_do_Rhs().push_back(&pre_post_proc_fe);
730 "INTERFACE", &cohesive_elements.
getFeRhs()));
731 loops_to_do_Rhs.push_back(
733 loops_to_do_Rhs.push_back(
735 snes_ctx.get_postProcess_to_do_Rhs().push_back(&pre_post_proc_fe);
736 snes_ctx.get_postProcess_to_do_Rhs().push_back(&my_dirichlet_bc);
740 snes_ctx.get_loops_to_do_Mat();
741 snes_ctx.get_preProcess_to_do_Mat().push_back(&my_dirichlet_bc);
743 "INTERFACE", &cohesive_elements.
getFeLhs()));
744 loops_to_do_Mat.push_back(
746 loops_to_do_Mat.push_back(
748 snes_ctx.get_postProcess_to_do_Mat().push_back(&my_dirichlet_bc);
750 double gamma = 0.5, reduction = 1;
753 step_size = step_size_reduction;
755 reduction = step_size_reduction;
759 boost::ptr_map<std::string, NeumannForcesSurface>::iterator mit =
760 neumann_forces.begin();
761 CHKERR VecZeroEntries(arc_ctx->F_lambda);
762 CHKERR VecGhostUpdateBegin(arc_ctx->F_lambda, INSERT_VALUES,
764 CHKERR VecGhostUpdateEnd(arc_ctx->F_lambda, INSERT_VALUES, SCATTER_FORWARD);
765 for (; mit != neumann_forces.end(); mit++) {
767 mit->second->getLoopFe());
769 CHKERR VecGhostUpdateBegin(arc_ctx->F_lambda, ADD_VALUES, SCATTER_REVERSE);
770 CHKERR VecGhostUpdateEnd(arc_ctx->F_lambda, ADD_VALUES, SCATTER_REVERSE);
771 CHKERR VecAssemblyBegin(arc_ctx->F_lambda);
772 CHKERR VecAssemblyEnd(arc_ctx->F_lambda);
773 for (std::vector<int>::iterator vit = my_dirichlet_bc.
dofsIndices.begin();
775 CHKERR VecSetValue(arc_ctx->F_lambda, *vit, 0, INSERT_VALUES);
777 CHKERR VecAssemblyBegin(arc_ctx->F_lambda);
778 CHKERR VecAssemblyEnd(arc_ctx->F_lambda);
780 CHKERR VecDot(arc_ctx->F_lambda, arc_ctx->F_lambda, &arc_ctx->F_lambda2);
781 PetscPrintf(PETSC_COMM_WORLD,
"\tFlambda2 = %6.4e\n", arc_ctx->F_lambda2);
785 "ELASTIC_MECHANICS",
COL,
D, INSERT_VALUES, SCATTER_FORWARD);
787 "ELASTIC_MECHANICS",
"DISPLACEMENT",
"X0_DISPLACEMENT",
COL,
788 arc_ctx->x0, INSERT_VALUES, SCATTER_FORWARD);
790 CHKERR VecNorm(arc_ctx->x0, NORM_2, &x0_nrm);
791 CHKERR PetscPrintf(PETSC_COMM_WORLD,
792 "\tRead x0_nrm = %6.4e dlambda = %6.4e\n", x0_nrm,
794 CHKERR arc_ctx->setAlphaBeta(1, 0);
797 CHKERR arc_ctx->setAlphaBeta(0, 1);
810 bool converged_state =
false;
811 for (; step < max_steps; step++) {
814 CHKERR PetscPrintf(PETSC_COMM_WORLD,
"Load Step %D step_size = %6.4e\n",
816 CHKERR arc_ctx->setS(step_size);
817 CHKERR arc_ctx->setAlphaBeta(0, 1);
818 CHKERR VecCopy(
D, arc_ctx->x0);
820 CHKERR my_arc_method_ptr->calculate_init_dlambda(&dlambda);
821 CHKERR my_arc_method_ptr->set_dlambda_to_x(
D, dlambda);
822 }
else if (step == 2) {
823 CHKERR arc_ctx->setAlphaBeta(1, 0);
824 CHKERR my_arc_method_ptr->calculate_dx_and_dlambda(
D);
825 CHKERR my_arc_method_ptr->calculate_lambda_int(step_size);
826 CHKERR arc_ctx->setS(step_size);
827 double dlambda = arc_ctx->dLambda;
829 CHKERR VecNorm(arc_ctx->dx, NORM_2, &dx_nrm);
830 CHKERR PetscPrintf(PETSC_COMM_WORLD,
831 "Load Step %D step_size = %6.4e dlambda0 = %6.4e "
832 "dx_nrm = %6.4e dx2 = %6.4e\n",
833 step, step_size, dlambda, dx_nrm, arc_ctx->dx2);
834 CHKERR VecCopy(
D, arc_ctx->x0);
835 CHKERR VecAXPY(
D, 1., arc_ctx->dx);
836 CHKERR my_arc_method_ptr->set_dlambda_to_x(
D, dlambda);
838 CHKERR my_arc_method_ptr->calculate_dx_and_dlambda(
D);
839 CHKERR my_arc_method_ptr->calculate_lambda_int(step_size);
842 step_size *= reduction;
843 CHKERR arc_ctx->setS(step_size);
844 double dlambda = reduction * arc_ctx->dLambda;
845 CHKERR VecScale(arc_ctx->dx, reduction);
847 CHKERR VecNorm(arc_ctx->dx, NORM_2, &dx_nrm);
848 CHKERR PetscPrintf(PETSC_COMM_WORLD,
849 "Load Step %D step_size = %6.4e dlambda0 = %6.4e "
850 "dx_nrm = %6.4e dx2 = %6.4e\n",
851 step, step_size, dlambda, dx_nrm, arc_ctx->dx2);
852 CHKERR VecCopy(
D, arc_ctx->x0);
853 CHKERR VecAXPY(
D, 1., arc_ctx->dx);
854 CHKERR my_arc_method_ptr->set_dlambda_to_x(
D, dlambda);
857 CHKERR SNESSolve(snes, PETSC_NULL,
D);
861 "ELASTIC_MECHANICS",
COL,
D, INSERT_VALUES, SCATTER_REVERSE);
866 CHKERR my_arc_method_ptr->remove_damaged_prisms_nodes();
869 CHKERR SNESGetIterationNumber(snes, &its);
870 CHKERR PetscPrintf(PETSC_COMM_WORLD,
"number of Newton iterations = %D\n",
873 SNESConvergedReason reason;
874 CHKERR SNESGetConvergedReason(snes, &reason);
877 CHKERR arc_ctx->setAlphaBeta(1, 0);
879 converged_state =
false;
882 if (step > 1 && converged_state) {
883 reduction = pow((
double)its_d / (
double)(its + 1), gamma);
884 CHKERR PetscPrintf(PETSC_COMM_WORLD,
"reduction step_size = %6.4e\n",
890 "ELASTIC_MECHANICS",
COL,
D, INSERT_VALUES, SCATTER_REVERSE);
892 "ELASTIC_MECHANICS",
"DISPLACEMENT",
"X0_DISPLACEMENT",
COL,
893 arc_ctx->x0, INSERT_VALUES, SCATTER_REVERSE);
894 converged_state =
true;
899 PetscFOpen(PETSC_COMM_SELF,
DATAFILENAME,
"a+", &datafile);
900 PetscFPrintf(PETSC_COMM_WORLD, datafile,
"%d %d ", reason, its);
902 CHKERR my_arc_method_ptr->postProcessLoadPath();
909 std::ostringstream ss;
910 ss <<
"out_values_" << step <<
".h5m";
917 "ELASTIC_MECHANICS",
COL,
D, INSERT_VALUES, SCATTER_REVERSE);
922 CHKERR VecDestroy(&F_body_force);
924 CHKERR SNESDestroy(&snes);
925 CHKERR MatDestroy(&ShellAij);
Implementation of linear interface element.
const std::string default_options
Implementation of linear elastic material.
Implementation of arc-lebgth control for cohesive elements.
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
#define MOAB_THROW(err)
Check error code of MoAB function and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ NOFIELD
scalar or vector of scalars describe (no true field)
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
@ BODYFORCESSET
block name is "BODY_FORCES"
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'n', SPACE_DIM > n
FTensor::Index< 'm', SPACE_DIM > m
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 add_ents_to_finite_element_by_bit_ref(const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name, EntityType type, int verb=DEFAULT_VERBOSITY)=0
add TET entities from given refinement level to finite element database given by name
virtual EntityHandle get_finite_element_meshset(const std::string name) const =0
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 add_ents_to_finite_element_by_MESHSET(const EntityHandle meshset, const std::string &name, const bool recursive=false)=0
add MESHSET element to finite element database given by name
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.
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"
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_NAME_FOR_LOOP_(MESHSET_MANAGER, NAME, IT)
Iterator that loops over Cubit BlockSet having a particular name.
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT)
Iterator that loops over all the Cubit MeshSets in a moFEM field.
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
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< 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 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 PetscOptionsGetReal(PetscOptions *, const char pre[], const char name[], PetscReal *dval, 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.
MoFEMErrorCode addHOOpsFace3D(const std::string field, E &e, bool hcurl, bool hdiv)
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)
Store variables for ArcLength analysis.
shell matrix for arc-length method
MoFEMErrorCode addBlock(const std::string field_name, Vec F, int ms_id)
MoFEMErrorCode postProcessLoadPath()
MoFEM::Interface & mField
ArcLengthElement(MoFEM::Interface &m_field, boost::shared_ptr< ArcLengthCtx > &arc_ptr)
MoFEMErrorCode postProcess()
function is run at the end of loop
MoFEM::Interface & mField
AssembleRhsVectors(MoFEM::Interface &m_field, Vec &body_force, boost::shared_ptr< ArcLengthCtx > &arc_ptr)
boost::shared_ptr< ArcLengthCtx > arcPtr
MoFEMErrorCode preProcess()
function is run at the beginning of loop
Constitutive (physical) equation for interface.
Cohesive element implementation.
MoFEMErrorCode addOps(const std::string field_name, boost::ptr_vector< CohesiveInterfaceElement::PhysicalEquation > &interfaces)
Driver function settting all operators needed for interface element.
Set Dirichlet boundary conditions on displacements.
std::vector< int > dofsIndices
virtual MoFEMErrorCode iNitialize()
const Problem * problemPtr
raw pointer to problem
virtual int get_comm_size() const =0
virtual FieldBitNumber get_field_bit_number(const std::string name) const =0
get field bit number
virtual moab::Interface & get_moab()=0
virtual EntityHandle get_field_meshset(const std::string name) const =0
get field meshset
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 UId getHiBitNumberUId(const FieldBitNumber bit_number)
static UId getLoBitNumberUId(const FieldBitNumber bit_number)
Elastic material data structure.
Linear interface data structure.
Matrix manager is used to build and partition problems.
Interface for managing meshsets containing materials and boundary conditions.
MoFEMErrorCode printForceSet() const
print meshsets with force boundary conditions data structure
MoFEMErrorCode printMaterialsSet() const
print meshsets with material data structure set on it
MoFEMErrorCode printDisplacementSet() const
print meshsets with displacement boundary conditions data structure
Create interface from given surface and insert flat prisms in-between.
MoFEMErrorCode getSides(const int msId, const CubitBCType cubit_bc_type, const BitRefLevel mesh_bit_level, const bool recursive, int verb=QUIET)
Store tetrahedra from each side of the interface separately in two child meshsets of the parent meshs...
MoFEMErrorCode splitSides(const EntityHandle meshset, const BitRefLevel &bit, const int msId, const CubitBCType cubit_bc_type, const bool add_interface_entities, const bool recursive=false, int verb=QUIET)
Split nodes and other entities of tetrahedra on both sides of the interface and insert flat prisms in...
Problem manager is used to build and partition problems.
Projection of edge entities with one mid-node on hierarchical basis.
MoFEM::FEMethodsSequence FEMethodsSequence
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
Vector manager is used to create vectors \mofem_vectors.
Finite element and operators to apply force/pressures applied to surfaces.
structure grouping operators and data used for calculation of nonlinear elastic element
MyVolumeFE & getLoopFeLhs()
get lhs volume element
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.
structure for Arc Length pre-conditioner
Operator post-procesing stresses for Hook isotropic material.
std::vector< EntityHandle > mapGaussPts
moab::Interface & postProcMesh
MoFEMErrorCode generateReferenceElementMesh()
Generate reference mesh on single element.