v0.13.2
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
FractureMechanics::GriffithForceElement::OpHeterogeneousGcLhs Struct Reference

#include <users_modules/fracture_mechanics/src/GriffithForceElement.hpp>

Inheritance diagram for FractureMechanics::GriffithForceElement::OpHeterogeneousGcLhs:
[legend]
Collaboration diagram for FractureMechanics::GriffithForceElement::OpHeterogeneousGcLhs:
[legend]

Public Member Functions

 OpHeterogeneousGcLhs (int tag, BlockData &block_data, CommonData &common_data, const double beta_gc)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
 
- Public Member Functions inherited from FractureMechanics::GriffithForceElement::AuxOp
 AuxOp (int tag, BlockData &block_data, CommonData &common_data)
 
MoFEMErrorCode setIndices (DataForcesAndSourcesCore::EntData &data)
 
MoFEMErrorCode setVariables (FaceElementForcesAndSourcesCore::UserDataOperator *fe_ptr, DataForcesAndSourcesCore::EntData &data)
 
MoFEMErrorCode setLambdaNodes (FaceElementForcesAndSourcesCore::UserDataOperator *fe_ptr, const std::string &lambda_field_name)
 
MoFEMErrorCode setLambdaIndices (FaceElementForcesAndSourcesCore::UserDataOperator *fe_ptr, const std::string &lambda_field_name)
 

Public Attributes

MatrixDouble mat
 
const double betaGC
 
- Public Attributes inherited from FractureMechanics::GriffithForceElement::AuxOp
int tAg
 
BlockDatablockData
 
CommonDatacommonData
 
ublas::vector< int > rowIndices
 
ublas::vector< int > rowIndicesLocal
 
VectorInt3 rowLambdaIndices
 
VectorInt3 rowLambdaIndicesLocal
 
VectorDouble3 lambdaAtNodes
 
VectorDouble activeVariables
 

Detailed Description

Definition at line 718 of file GriffithForceElement.hpp.

Constructor & Destructor Documentation

◆ OpHeterogeneousGcLhs()

FractureMechanics::GriffithForceElement::OpHeterogeneousGcLhs::OpHeterogeneousGcLhs ( int  tag,
BlockData block_data,
CommonData common_data,
const double  beta_gc 
)
inline

Definition at line 722 of file GriffithForceElement.hpp.

724 : FaceElementForcesAndSourcesCore::UserDataOperator(
725 "MESH_NODE_POSITIONS", "MESH_NODE_POSITIONS",
726 UserDataOperator::OPROWCOL),
727 betaGC(beta_gc), AuxOp(tag, block_data, common_data) {}
AuxOp(int tag, BlockData &block_data, CommonData &common_data)

Member Function Documentation

◆ doWork()

MoFEMErrorCode FractureMechanics::GriffithForceElement::OpHeterogeneousGcLhs::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
DataForcesAndSourcesCore::EntData &  row_data,
DataForcesAndSourcesCore::EntData &  col_data 
)
inline

Definition at line 732 of file GriffithForceElement.hpp.

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
752 CHKERR setIndices(row_data);
753 CHKERR setVariables(this, row_data);
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);
760 mat.clear();
761
762 const double &gc = blockData.gc;
763 auto rho = getFTensor0FromVec(commonData.densityRho);
764 auto get_ftensor_from_vec = [](auto &v) {
765 return FTensor::Tensor1<double *, 3>(&v(0), &v(1), &v(2), 3);
766 };
767
768 auto get_tensor2 = [](MatrixDouble &m, const int r, const int c) {
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);
784 auto t_diff_rho = getFTensor1FromMat<3>(commonData.diffRho);
785 for (int rrr = 0; rrr != nb_base_row; rrr++) {
786
787 const double a = val * gc * pow(rho, betaGC - 1.) * betaGC;
789 k(i, j) = t_diff_rho(j) * t_griffith(i) * a;
790 // there is no dependence on the other nodes so row == col
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;
796 ++rho;
797 }
798 }
799
800 int col_nb_dofs = col_data.getIndices().size();
801
802 CHKERR MatSetValues(getFEMethod()->snes_B, row_nb_dofs,
803 &*rowIndices.data().begin(), col_nb_dofs,
804 &*col_data.getIndices().data().begin(),
805 &*mat.data().begin(), ADD_VALUES);
806
808 }
constexpr double a
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
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)
Definition: ddTensor0.hpp:33
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
int r
Definition: sdf.py:5
double rho
Definition: plastic.cpp:101
MoFEMErrorCode setVariables(FaceElementForcesAndSourcesCore::UserDataOperator *fe_ptr, DataForcesAndSourcesCore::EntData &data)
MoFEMErrorCode setIndices(DataForcesAndSourcesCore::EntData &data)
MatrixDouble diffRho
for lhs with heterogeneous gc

Member Data Documentation

◆ betaGC

const double FractureMechanics::GriffithForceElement::OpHeterogeneousGcLhs::betaGC

Definition at line 730 of file GriffithForceElement.hpp.

◆ mat

MatrixDouble FractureMechanics::GriffithForceElement::OpHeterogeneousGcLhs::mat

Definition at line 729 of file GriffithForceElement.hpp.


The documentation for this struct was generated from the following file: