7#ifndef __SURFACE_SLIDING_CONSTRAINS_HPP__
8#define __SURFACE_SLIDING_CONSTRAINS_HPP__
25 boost::shared_ptr<VectorDouble> &active_variables_ptr)
29 MoFEMErrorCode
doWork(
int side, EntityType type,
30 EntitiesFieldData::EntData &data) {
32 if (type == MBVERTEX) {
33 for (
unsigned int dd = 0; dd != data.getFieldData().size(); ++dd)
40 template <
int SizeLambda>
46 boost::shared_ptr<VectorDouble> &active_variables_ptr)
50 MoFEMErrorCode
doWork(
int side, EntityType type,
51 EntitiesFieldData::EntData &data) {
53 if (type == MBVERTEX) {
54 for (
unsigned int dd = 0; dd != data.getFieldData().size(); ++dd)
61 template <
int SizeLambda,
int SizePositions>
67 boost::shared_ptr<VectorDouble> &results_ptr)
72 MoFEMErrorCode
doWork(
int side, EntityType type,
73 EntitiesFieldData::EntData &data) {
77 VectorInt &indices = data.getIndices();
81 else if (indices.size() == SizeLambda)
83 else if (indices.size() == SizePositions)
87 "Element %s: Data inconsistency nb of indices %ld",
90 CHKERR VecSetOption(
getSNESf(), VEC_IGNORE_NEGATIVE_INDICES, PETSC_TRUE);
96 template <
int SizeLambda,
int SizePositions>
102 const std::string field_name_col,
103 boost::shared_ptr<MatrixDouble> &jacobian_ptr)
110 MoFEMErrorCode
doWork(
int row_side,
int col_side, EntityType row_type,
112 EntitiesFieldData::EntData &row_data,
113 EntitiesFieldData::EntData &col_data) {
115 if (row_type != MBVERTEX)
117 if (col_type != MBVERTEX)
119 VectorInt &row_indices = row_data.getIndices();
120 VectorInt &col_indices = col_data.getIndices();
121 if (row_indices.empty() || col_indices.empty())
125 if (row_indices.size() == SizeLambda)
127 else if (row_indices.size() == SizePositions)
128 shift_row = SizeLambda;
131 "Data inconsistency");
134 if (col_indices.size() == SizeLambda)
136 else if (col_indices.size() == SizePositions)
137 shift_col = SizeLambda;
140 "Data inconsistency");
142 MatrixDouble jac(row_indices.size(), col_indices.size());
143 for (
unsigned int rr = 0; rr != row_indices.size(); ++rr) {
144 for (
unsigned int cc = 0; cc != col_indices.size(); ++cc) {
145 jac(rr, cc) = (*jacobianPtr)(shift_row + rr, shift_col + cc);
146 if (jac(rr, cc) != jac(rr, cc))
148 "Jacobian assemble not a number jac(rr,cc) = %3.4f",
152 CHKERR MatSetValues(
getSNESB(), row_indices.size(), &row_indices[0],
153 col_indices.size(), &col_indices[0], &jac(0, 0),
338 virtual MoFEMErrorCode
370 if (
B != PETSC_NULLPTR) {
374 if (
F != PETSC_NULLPTR) {
394 PetscOptionsBegin(PETSC_COMM_WORLD,
"",
395 "Get surface sliding constrains element scaling",
"none");
396 CHKERR PetscOptionsScalar(
"-surface_sliding_alpha",
"scaling parameter",
"",
409 CHKERRABORT(PETSC_COMM_WORLD,
ierr);
427 boost::shared_ptr<VectorDouble> &active_variables_ptr,
428 boost::shared_ptr<VectorDouble> &results_ptr,
429 boost::shared_ptr<MatrixDouble> &jacobian_ptr,
439 MoFEMErrorCode
doWork(
int side, EntityType type,
440 EntitiesFieldData::EntData &data) {
442 if (type != MBVERTEX)
445 VectorInt &indices = data.getIndices();
449 ublas::vector<adouble> lambda_dofs(3);
450 for (
int dd = 0; dd != 3; ++dd) {
451 lambda_dofs[dd] <<= (*activeVariablesPtr)[dd];
453 ublas::vector<adouble> position_dofs(9);
454 for (
int dd = 0; dd != 9; ++dd) {
455 position_dofs[dd] <<= (*activeVariablesPtr)[3 + dd];
469 int nb_gauss_pts = data.getN().size1();
470 int nb_base_functions = data.getN().size2();
471 auto t_base1 = data.getFTensor0N();
472 auto t_base2 = data.getFTensor0N();
473 auto t_diff_base = data.getFTensor1DiffN<2>();
481 ublas::vector<adouble> c_vec(3);
482 ublas::vector<adouble> f_vec(9);
488 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
491 &position_dofs[0], &position_dofs[1], &position_dofs[2], 3);
495 t_position_ksi(
i) = 0;
496 t_position_eta(
i) = 0;
499 for (
int bb = 0; bb != nb_base_functions; ++bb) {
500 t_position(
i) += t_base1 * t_position_dofs(
i);
501 t_position_ksi(
i) += t_diff_base(N0) * t_position_dofs(
i);
502 t_position_eta(
i) += t_diff_base(N1) * t_position_dofs(
i);
503 lambda += t_base1 * t_lambda_dof;
510 t_delta(
i) = t_position(
i) - t_coord_ref(
i);
518 adouble area = sqrt(t_normal(
i) * t_normal(
i));
520 for (
int bb = 0; bb != nb_base_functions; ++bb) {
521 if (indices[bb] != -1) {
522 val = w * eo * t_base2;
523 t_c += val * t_normal(
i) * t_delta(
i);
525 t_f(
i) += val * t_normal(
i);
535 for (
int rr = 0; rr != 3; ++rr)
538 for (
int rr = 0; rr != 9; ++rr)
539 f_vec(rr) >>= (*resultsPtr)[3 + rr];
544 double *jac_ptr[3 + 9];
545 for (
int rr = 0; rr != 3 + 9; ++rr)
553 "ADOL-C function evaluation with error");
561 const std::string lagrange_multipliers_field_name,
562 const std::string material_field_name,
563 const double *alpha =
nullptr) {
566 if (alpha !=
nullptr) {
570 boost::shared_ptr<VectorDouble> active_variables_ptr(
571 new VectorDouble(3 + 9));
572 boost::shared_ptr<VectorDouble> results_ptr(
new VectorDouble(3 + 9));
573 boost::shared_ptr<MatrixDouble> jacobian_ptr(
574 new MatrixDouble(3 + 9, 3 + 9));
578 lagrange_multipliers_field_name, active_variables_ptr));
580 material_field_name, active_variables_ptr));
582 tag, lagrange_multipliers_field_name, active_variables_ptr, results_ptr,
592 lagrange_multipliers_field_name, active_variables_ptr));
594 material_field_name, active_variables_ptr));
596 tag, lagrange_multipliers_field_name, active_variables_ptr, results_ptr,
599 lagrange_multipliers_field_name, material_field_name, jacobian_ptr));
601 material_field_name, lagrange_multipliers_field_name, jacobian_ptr));
603 material_field_name, material_field_name, jacobian_ptr));
610 const std::string lagrange_multipliers_field_name,
611 const std::string material_field_name) {
614 boost::shared_ptr<VectorDouble> active_variables_ptr(
615 new VectorDouble(3 + 9));
616 boost::shared_ptr<VectorDouble> results_ptr(
new VectorDouble(3 + 9));
617 boost::shared_ptr<MatrixDouble> jacobian_ptr(
618 new MatrixDouble(3 + 9, 3 + 9));
623 lagrange_multipliers_field_name, active_variables_ptr));
625 material_field_name, active_variables_ptr));
627 tag, lagrange_multipliers_field_name, active_variables_ptr, results_ptr,
630 lagrange_multipliers_field_name, material_field_name, jacobian_ptr));
643 double def_val[] = {0, 0, 0};
644 CHKERR moab.tag_get_handle(
"EDGE_BASE0", 3, MB_TYPE_DOUBLE, th0,
645 MB_TAG_CREAT | MB_TAG_SPARSE, def_val);
646 CHKERR moab.tag_get_handle(
"EDGE_BASE1", 3, MB_TYPE_DOUBLE, th1,
647 MB_TAG_CREAT | MB_TAG_SPARSE, def_val);
648 int def_numb_val[] = {-1};
649 CHKERR moab.tag_get_handle(
"PATCH_NUMBER", 1, MB_TYPE_INTEGER, th2,
650 MB_TAG_CREAT | MB_TAG_SPARSE, def_numb_val);
651 int def_orientation_val[] = {1};
652 CHKERR moab.tag_get_handle(
"PATCH_ORIENTATION", 1, MB_TYPE_INTEGER, th3,
653 MB_TAG_CREAT | MB_TAG_SPARSE,
654 def_orientation_val);
663 auto get_edges = [&](
const Range &ents) {
665 CHKERR moab.get_adjacencies(ents, 1,
false, edges,
666 moab::Interface::UNION);
670 auto get_face_adj = [&, get_edges](
const Range &faces) {
672 CHKERR moab.get_adjacencies(subtract(get_edges(faces), edges), 2,
false,
673 adj_faces, moab::Interface::UNION);
674 return intersect(adj_faces, tris);
677 auto get_patch = [&, get_face_adj](
const EntityHandle face) {
679 patch_ents.insert(face);
682 nb0 = patch_ents.size();
683 patch_ents.merge(get_face_adj(patch_ents));
684 }
while (nb0 != patch_ents.size());
688 auto get_patches = [&]() {
689 std::vector<Range> patches;
690 while (!tris.empty()) {
691 patches.push_back(get_patch(tris[0]));
692 tris = subtract(tris, patches.back());
697 Tag th0, th1, th2, th3;
700 auto patches = get_patches();
702 for (
auto patch : patches) {
705 std::vector<int> tags_vals(patch.size(), pp);
706 CHKERR moab.tag_set_data(th2, patch, &*tags_vals.begin());
714 moab::Interface &moab,
Range edges,
Range tris,
715 bool number_pathes =
true,
716 boost::shared_ptr<SurfaceSlidingConstrains::DriverElementOrientation>
717 surface_orientation =
nullptr,
720 Tag th0, th1, th2, th3;
725 for (
auto edge : edges) {
727 CHKERR moab.get_adjacencies(&edge, 1, 2,
false, adj_faces);
728 adj_faces = intersect(adj_faces, tris);
729 if (adj_faces.size() != 2) {
731 "Should be 2 faces adjacent to edge but is %ld",
734 VectorDouble3
v[2] = {VectorDouble3(3), VectorDouble3(3)};
735 auto get_tensor_from_vec = [](VectorDouble3 &
v) {
737 &
v[0], &
v[1], &
v[2]);
744 std::array<double, 3> areas;
745 auto calculate_normals = [&, get_tensor_from_vec]() {
747 for (
auto face : adj_faces) {
748 double &x = (
v[ff])[0];
749 double &y = (
v[ff])[1];
750 double &z = (
v[ff])[2];
751 moab::Util::normal(&moab, face, x, y, z);
752 auto t_n = get_tensor_from_vec(
v[ff]);
753 areas[ff] = sqrt(t_n(
i) * t_n(
i));
757 CHKERR moab.tag_get_data(th3, &face, 1, &orientation);
758 if (orientation == -1) {
761 if (surface_orientation && m_field_ptr) {
762 CHKERR surface_orientation->getElementOrientation(*m_field_ptr,
764 int eo = surface_orientation->elementOrientation;
774 auto get_patch_number = [&]() {
775 std::vector<int> p = {0, 0};
776 CHKERR moab.tag_get_data(th2, adj_faces, &*p.begin());
780 std::array<EntityHandle, 2> faces_handles = {adj_faces[0],
782 auto order_normals = [&, get_patch_number]() {
783 auto p = get_patch_number();
786 faces_handles[0] = adj_faces[1];
787 faces_handles[1] = adj_faces[0];
793 auto t_n0 = get_tensor_from_vec(
v[0]);
794 auto t_n1 = get_tensor_from_vec(
v[1]);
797 auto get_base_for_coplanar_faces = [&]() {
800 std::vector<EntityHandle> face_conn;
801 CHKERR moab.get_connectivity(&faces_handles[1], 1, face_conn,
true);
802 std::vector<EntityHandle> edge_conn;
803 CHKERR moab.get_connectivity(&edge, 1, edge_conn,
true);
804 std::sort(face_conn.begin(), face_conn.end());
805 std::sort(edge_conn.begin(), edge_conn.end());
808 if (face_conn[
n] != edge_conn[
n])
810 VectorDouble3 coords_face(3);
811 CHKERR moab.get_coords(&face_conn[
n], 1,
812 &*coords_face.data().begin());
813 VectorDouble6 coords_edge(6);
814 CHKERR moab.get_coords(&edge_conn[0], 2,
815 &*coords_edge.data().begin());
817 coords_edge[0], coords_edge[1], coords_edge[2]);
819 coords_edge[3], coords_edge[4], coords_edge[5]);
820 auto t_face_n = get_tensor_from_vec(coords_face);
821 t_face_n(
i) -= t_edge_n0(
i);
823 t_delta(
i) = t_edge_n1(
i) - t_edge_n0(
i);
824 t_delta(
i) /= sqrt(t_delta(
i) * t_delta(
i));
826 if (t_n1(
i) * t_face_n(
i) < 0)
832 auto get_base_for_not_planar_faces = [&]() {
835 t_n1(
i) /= sqrt(t_n1(
i) * t_n1(
i));
840 constexpr double tol = 1e-6;
841 if ((t_cross(
i) * t_cross(
i)) <
tol)
842 CHKERR get_base_for_coplanar_faces();
844 CHKERR get_base_for_not_planar_faces();
846 VectorDouble3 &v0 =
v[0];
847 VectorDouble3 &v1 =
v[1];
848 CHKERR moab.tag_set_data(th0, &edge, 1, &v0[0]);
849 CHKERR moab.tag_set_data(th1, &edge, 1, &v1[0]);
854 static MoFEMErrorCode
saveEdges(moab::Interface &moab, std::string name,
860 CHKERR moab.create_meshset(MESHSET_SET, meshset);
861 CHKERR moab.add_entities(meshset, edges);
862 if (faces !=
nullptr) {
863 CHKERR moab.add_entities(meshset, *faces);
865 CHKERR moab.write_file(name.c_str(),
"VTK",
"", &meshset, 1, ths, 4);
866 CHKERR moab.delete_entities(&meshset, 1);
888 if (
B != PETSC_NULLPTR) {
892 if (
F != PETSC_NULLPTR) {
911 PetscOptionsBegin(PETSC_COMM_WORLD,
"",
912 "Get edge sliding constrains element scaling",
914 CHKERR PetscOptionsScalar(
"-edge_sliding_alpha",
"scaling parameter",
"",
925 CHKERRABORT(PETSC_COMM_WORLD,
ierr);
940 boost::shared_ptr<VectorDouble> &active_variables_ptr,
941 boost::shared_ptr<VectorDouble> &results_ptr,
942 boost::shared_ptr<MatrixDouble> &jacobian_ptr,
943 bool evaluate_jacobian,
const double &alpha)
950 MoFEMErrorCode
doWork(
int side, EntityType type,
951 EntitiesFieldData::EntData &data) {
953 if (type != MBVERTEX)
961 Tag th0, th1, th2, th3;
971 VectorInt &indices = data.getIndices();
975 ublas::vector<adouble> lambda_dofs(4);
976 for (
int dd = 0; dd != 4; ++dd) {
977 lambda_dofs[dd] <<= (*activeVariablesPtr)[dd];
979 ublas::vector<adouble> position_dofs(6);
980 for (
int dd = 0; dd != 6; ++dd) {
981 position_dofs[dd] <<= (*activeVariablesPtr)[4 + dd];
985 &position_dofs[0], &position_dofs[1], &position_dofs[2]);
987 &position_dofs[3], &position_dofs[4], &position_dofs[5]);
990 t_tangent(
i) = t_node1(
i) - t_node0(
i);
991 adouble l = sqrt(t_tangent(
i) * t_tangent(
i));
995 t_dot0 = t_edge_base0(
i) * t_tangent(
i);
996 t_dot1 = t_edge_base1(
i) * t_tangent(
i);
999 t_base0(
i) = t_edge_base0(
i) - t_dot0 * t_tangent(
i);
1000 t_base1(
i) = t_edge_base1(
i) - t_dot1 * t_tangent(
i);
1001 t_base0(
i) /= sqrt(t_base0(
i) * t_base0(
i));
1002 t_base1(
i) /= sqrt(t_base1(
i) * t_base1(
i));
1004 auto t_base_fun1 = data.getFTensor0N();
1005 auto t_base_fun2 = data.getFTensor0N();
1011 ublas::vector<adouble> c_vec(4);
1012 ublas::vector<adouble> f_vec(6);
1016 int nb_gauss_pts = data.getN().size1();
1017 int nb_base_functions = data.getN().size2();
1018 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
1021 &position_dofs[0], &position_dofs[1], &position_dofs[2], 3);
1023 &lambda_dofs[1], 2);
1027 for (
int bb = 0; bb != nb_base_functions; ++bb) {
1028 t_position(
i) += t_base_fun1 * t_position_dofs(
i);
1029 t_lambda(
j) += t_base_fun1 * t_lambda_dof(
j);
1035 t_delta(
i) = t_position(
i) - t_coord_ref(
i);
1043 for (
int bb = 0; bb != nb_base_functions; ++bb) {
1044 if (indices[2 * bb] != -1) {
1045 val = w * t_base_fun2;
1046 t_c(N0) += val * dot0;
1047 t_c(N1) += val * dot1;
1048 val1 = val * t_lambda(N0);
1049 val2 = val * t_lambda(N1);
1050 t_f(
i) += val1 * t_base0(
i) + val2 * t_base1(
i);
1060 for (
int rr = 0; rr != 4; ++rr) {
1061 c_vec[rr] >>= (*resultsPtr)[rr];
1063 for (
int rr = 0; rr != 6; ++rr) {
1064 f_vec(rr) >>= (*resultsPtr)[4 + rr];
1070 double *jac_ptr[4 + 6];
1071 for (
int rr = 0; rr != 4 + 6; ++rr) {
1072 jac_ptr[rr] = &(*jacobianPtr)(rr, 0);
1079 "ADOL-C function evaluation with error");
1088 const std::string lagrange_multipliers_field_name,
1089 const std::string material_field_name) {
1094 material_field_name);
1099 const std::string lagrange_multipliers_field_name,
1100 const std::string material_field_name,
1101 const double *alpha =
nullptr) {
1108 boost::shared_ptr<VectorDouble> active_variables_ptr(
1109 new VectorDouble(4 + 6));
1110 boost::shared_ptr<VectorDouble> results_ptr(
new VectorDouble(4 + 6));
1111 boost::shared_ptr<MatrixDouble> jacobian_ptr(
1112 new MatrixDouble(4 + 6, 4 + 6));
1116 lagrange_multipliers_field_name, active_variables_ptr));
1118 material_field_name, active_variables_ptr));
1120 tag, lagrange_multipliers_field_name, active_variables_ptr, results_ptr,
1121 jacobian_ptr,
false,
aLpha));
1130 lagrange_multipliers_field_name, active_variables_ptr));
1132 material_field_name, active_variables_ptr));
1134 tag, lagrange_multipliers_field_name, active_variables_ptr, results_ptr,
1135 jacobian_ptr,
true,
aLpha));
1137 lagrange_multipliers_field_name, material_field_name, jacobian_ptr));
1139 material_field_name, lagrange_multipliers_field_name, jacobian_ptr));
1141 material_field_name, material_field_name, jacobian_ptr));
1148 const std::string lagrange_multipliers_field_name,
1149 const std::string material_field_name) {
1155 material_field_name);
1161 const std::string lagrange_multipliers_field_name,
1162 const std::string material_field_name) {
1165 boost::shared_ptr<VectorDouble> active_variables_ptr(
1166 new VectorDouble(4 + 6));
1167 boost::shared_ptr<VectorDouble> results_ptr(
new VectorDouble(4 + 6));
1168 boost::shared_ptr<MatrixDouble> jacobian_ptr(
1169 new MatrixDouble(4 + 6, 4 + 6));
1174 lagrange_multipliers_field_name, active_variables_ptr));
1176 material_field_name, active_variables_ptr));
1178 tag, lagrange_multipliers_field_name, active_variables_ptr, results_ptr,
1179 jacobian_ptr,
true,
aLpha));
1181 lagrange_multipliers_field_name, material_field_name, jacobian_ptr));
ForcesAndSourcesCore::UserDataOperator UserDataOperator
static PetscErrorCode ierr
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_DATA_INCONSISTENCY
#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 ...
FTensor::Index< 'i', SPACE_DIM > i
const double v
phase velocity of light in medium (cm/ns)
const double n
refractive index of diffusive medium
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
auto cross(const Tensor1_Expr< A, T, 3, i > &a, const Tensor1_Expr< B, U, 3, j > &b, const Index< k, 3 > &)
implementation of Data Operators for Forces and Sources
constexpr auto field_name
static MoFEMErrorCode numberSurfaces(moab::Interface &moab, Range edges, Range tris)
static MoFEMErrorCode createTag(moab::Interface &moab, Tag &th0, Tag &th1, Tag &th2, Tag &th3)
static MoFEMErrorCode setTags(moab::Interface &moab, Range edges, Range tris, bool number_pathes=true, boost::shared_ptr< SurfaceSlidingConstrains::DriverElementOrientation > surface_orientation=nullptr, MoFEM::Interface *m_field_ptr=nullptr)
static MoFEMErrorCode saveEdges(moab::Interface &moab, std::string name, Range edges, Range *faces=nullptr)
MoFEMErrorCode preProcess()
function is run at the beginning of loop
MyEdgeFE(MoFEM::Interface &m_field)
boost::shared_ptr< VectorDouble > activeVariablesPtr
boost::shared_ptr< VectorDouble > resultsPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
OpJacobian(int tag, const std::string field_name, boost::shared_ptr< VectorDouble > &active_variables_ptr, boost::shared_ptr< VectorDouble > &results_ptr, boost::shared_ptr< MatrixDouble > &jacobian_ptr, bool evaluate_jacobian, const double &alpha)
boost::shared_ptr< MatrixDouble > jacobianPtr
MoFEMErrorCode setOperators(int tag, Range edges, Range faces, const std::string lagrange_multipliers_field_name, const std::string material_field_name)
EdgeSlidingConstrains(MoFEM::Interface &m_field)
boost::shared_ptr< MyEdgeFE > feRhsPtr
MoFEM::Interface & mField
MyEdgeFE & getLoopFeRhs()
MyEdgeFE & getLoopFeLhs()
MoFEMErrorCode setOperators(int tag, const std::string lagrange_multipliers_field_name, const std::string material_field_name, const double *alpha=nullptr)
MoFEMErrorCode getOptions()
boost::shared_ptr< MyEdgeFE > feLhsPtr
MoFEMErrorCode setOperatorsConstrainOnly(int tag, Range edges, Range faces, const std::string lagrange_multipliers_field_name, const std::string material_field_name)
MoFEMErrorCode setOperatorsConstrainOnly(int tag, const std::string lagrange_multipliers_field_name, const std::string material_field_name)
boost::shared_ptr< MatrixDouble > jacobianPtr
OpAssembleLhs(const std::string field_name_row, const std::string field_name_col, boost::shared_ptr< MatrixDouble > &jacobian_ptr)
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
OpAssembleRhs(const std::string field_name, boost::shared_ptr< VectorDouble > &results_ptr)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
boost::shared_ptr< VectorDouble > resultsPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
OpGetActiveDofsLambda(const std::string field_name, boost::shared_ptr< VectorDouble > &active_variables_ptr)
boost::shared_ptr< VectorDouble > activeVariablesPtr
OpGetActiveDofsPositions(const std::string field_name, boost::shared_ptr< VectorDouble > &active_variables_ptr)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
boost::shared_ptr< VectorDouble > activeVariablesPtr
Implementation of surface sliding constrains.
virtual ~GenericSliding()=default
virtual moab::Interface & get_moab()=0
bool sYmm
If true assume that matrix is symmetric structure.
Deprecated interface functions.
default operator for EDGE element
const EdgeElementForcesAndSourcesCore * getEdgeFE()
get pointer to this finite element
default operator for TRI element
FaceElementForcesAndSourcesCore * getFaceFE()
return pointer to Generic Triangle Finite Element object
EntityHandle getFEEntityHandle() const
Return finite element entity handle.
auto getFTensor1CoordsAtGaussPts()
Get coordinates at integration points assuming linear geometry.
friend class ForcesAndSourcesCore
std::string getFEName() const
Get name of the element.
@ OPCOL
operator doWork function is executed on FE columns
@ OPROW
operator doWork function is executed on FE rows
@ OPROWCOL
operator doWork is executed on FE rows &columns
const FEMethod * getFEMethod() const
Return raw pointer to Finite Element Method object.
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
virtual MoFEMErrorCode preProcess()
function is run at the beginning of loop
boost::ptr_deque< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
Mat & snes_B
preconditioner of jacobian matrix
Class implemented by user to detect face orientation.
virtual MoFEMErrorCode getElementOrientation(MoFEM::Interface &m_field, const EntityHandle face)
virtual MoFEMErrorCode getElementOrientation(MoFEM::Interface &m_field, const FEMethod *fe_method_ptr)
MoFEMErrorCode preProcess()
function is run at the beginning of loop
MyTriangleFE(MoFEM::Interface &m_field)
OpJacobian(int tag, const std::string field_name, boost::shared_ptr< VectorDouble > &active_variables_ptr, boost::shared_ptr< VectorDouble > &results_ptr, boost::shared_ptr< MatrixDouble > &jacobian_ptr, DriverElementOrientation &orientation, bool evaluate_jacobian, const double &alpha)
boost::shared_ptr< VectorDouble > resultsPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
DriverElementOrientation & oRientation
boost::shared_ptr< VectorDouble > activeVariablesPtr
boost::shared_ptr< MatrixDouble > jacobianPtr
Shape preserving constrains, i.e. nodes sliding on body surface.
boost::shared_ptr< MyTriangleFE > feRhsPtr
virtual ~SurfaceSlidingConstrains()=default
DriverElementOrientation & crackFrontOrientation
boost::shared_ptr< MyTriangleFE > feLhsPtr
MyTriangleFE & getLoopFeLhs()
MoFEM::Interface & mField
SurfaceSlidingConstrains(MoFEM::Interface &m_field, DriverElementOrientation &orientation)
MoFEMErrorCode getOptions()
MoFEMErrorCode setOperators(int tag, const std::string lagrange_multipliers_field_name, const std::string material_field_name, const double *alpha=nullptr)
MyTriangleFE & getLoopFeRhs()
MoFEMErrorCode setOperatorsConstrainOnly(int tag, const std::string lagrange_multipliers_field_name, const std::string material_field_name)