617 {
619
620 if (row_type != MBVERTEX) {
622 }
623
631
632 AuxFunctions<double> auxFun;
633 auxFun.currentCoords.resize(9, false);
634
635 int nb_dofs = row_data.getFieldData().size();
636 for (
int dd = 0;
dd != nb_dofs;
dd++)
637 auxFun.currentCoords[dd] = row_data.getFieldData()[
dd];
638
641 int nb_gauss_pts = row_data.getN().size1();
642 int nb_base_row = row_data.getFieldData().size() / 3;
643 int nb_base_col = col_data.getFieldData().size() / 3;
644 int row_nb_dofs = row_data.getIndices().size();
645
646 mat.resize(9, 9,
false);
653 auxFun.t_Tangent2_eta(
k) * t_diff(
N0);
654
655 return t_d_n;
656 };
657
658 CHKERR auxFun.calculateAreaAndNormal(col_data.getDiffN());
659 auto t_normal = auxFun.t_Normal;
660 const double coefficient_1 = 0.5 * pow((t_normal(
i) * t_normal(
i)), -0.5);
661 const double coefficient_2 = 0.5 * pow((t_normal(
i) * t_normal(
i)), -1.5);
662
663
665 if (rho_v.empty() || rho_v.size() != nb_base_row) {
666 rho_v.resize(nb_base_row, false);
667 }
668 auto rho = getFTensor0FromVec(rho_v);
669 for (int gg = 0; gg != nb_gauss_pts; gg++) {
670
671 double val = getGaussPts()(2, gg) * 0.5;
672 auto t_row_diff = row_data.getFTensor1DiffN<2>(gg, 0);
673 for (int rrr = 0; rrr != nb_base_row; rrr++) {
674
676 &
mat(3 * rrr + 0, 0), &
mat(3 * rrr + 0, 1), &
mat(3 * rrr + 0, 2),
677 &
mat(3 * rrr + 1, 0), &
mat(3 * rrr + 1, 1), &
mat(3 * rrr + 1, 2),
678 &
mat(3 * rrr + 2, 0), &
mat(3 * rrr + 2, 1), &
mat(3 * rrr + 2, 2),
679 3);
680
681 auto t_tan_row = calculate_derivative(t_row_diff);
682 auto t_col_diff = col_data.getFTensor1DiffN<2>(gg, 0);
684 for (int ccc = 0; ccc != nb_base_col; ccc++) {
685
686 auto t_tan_col = calculate_derivative(t_col_diff);
687
688 t_mat(
i,
j) -= coefficient_1 *
689 (t_tan_row(
i,
l) * t_tan_col(
l,
j) +
691 t_row_diff(
N1) * t_normal(
k) -
693 t_row_diff(
N0) * t_normal(
k));
694
695 t_mat(
i,
j) += coefficient_2 * (t_tan_row(
i,
k) * t_normal(
k)) *
696 (t_tan_col(
l,
j) * t_normal(
l));
697
699 ++t_col_diff;
700 ++t_mat;
701 }
702 ++t_row_diff;
704 }
705 }
706
707 int col_nb_dofs = col_data.getIndices().size();
708
711 &*col_data.getIndices().data().begin(),
712 &*
mat.data().begin(), ADD_VALUES);
713
715 }
#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 ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'm', SPACE_DIM > m
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
ublas::vector< int > rowIndices
MoFEMErrorCode setVariables(FaceElementForcesAndSourcesCore::UserDataOperator *fe_ptr, DataForcesAndSourcesCore::EntData &data)
MoFEMErrorCode setIndices(DataForcesAndSourcesCore::EntData &data)
double gc
Griffith energy.
VectorDouble densityRho
gc * rho^beta