735 {
737
738 if (row_type != MBVERTEX) {
740 }
741
744
745 AuxFunctions<double> auxFun;
746 auxFun.currentCoords.resize(9, false);
747
748 int nb_dofs = row_data.getFieldData().size();
749 for (
int dd = 0;
dd != nb_dofs;
dd++)
750 auxFun.currentCoords[dd] = row_data.getFieldData()[
dd];
751
754 int nb_gauss_pts = row_data.getN().size1();
755 int nb_base_row = row_data.getFieldData().size() / 3;
756 int nb_base_col = col_data.getFieldData().size() / 3;
757
758 int row_nb_dofs = row_data.getIndices().size();
759 mat.resize(9, 9,
false);
761
764 auto get_ftensor_from_vec = [](
auto &
v) {
766 };
767
770 &
m(3 * r + 0, 3 *
c + 0), &
m(3 * r + 0, 3 *
c + 1),
771 &
m(3 * r + 0, 3 *
c + 2), &
m(3 * r + 1, 3 *
c + 0),
772 &
m(3 * r + 1, 3 *
c + 1), &
m(3 * r + 1, 3 *
c + 2),
773 &
m(3 * r + 2, 3 *
c + 0), &
m(3 * r + 2, 3 *
c + 1),
774 &
m(3 * r + 2, 3 *
c + 2));
775 };
776
777 for (int gg = 0; gg != nb_gauss_pts; gg++) {
778
779 double val = getGaussPts()(2, gg) * 0.5;
780
781 auxFun.calculateGriffithForce(1, 1, row_data.getDiffN(gg));
782
783 auto t_griffith = get_ftensor_from_vec(auxFun.griffithForce);
785 for (int rrr = 0; rrr != nb_base_row; rrr++) {
786
789 k(
i,
j) = t_diff_rho(
j) * t_griffith(
i) *
a;
790
791 auto tt_mat = get_tensor2(
mat, rrr, rrr);
792 tt_mat(
i,
j) +=
k(
i,
j);
793
794 ++t_diff_rho;
795 ++t_griffith;
797 }
798 }
799
800 int col_nb_dofs = col_data.getIndices().size();
801
804 &*col_data.getIndices().data().begin(),
805 &*
mat.data().begin(), ADD_VALUES);
806
808 }
#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
const double c
speed of light (cm/ns)
const double v
phase velocity of light in medium (cm/ns)
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
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)
UBlasMatrix< double > MatrixDouble
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.
MatrixDouble diffRho
for lhs with heterogeneous gc
VectorDouble densityRho
gc * rho^beta