v0.13.1
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 716 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 720 of file GriffithForceElement.hpp.

722 : FaceElementForcesAndSourcesCore::UserDataOperator(
723 "MESH_NODE_POSITIONS", "MESH_NODE_POSITIONS",
724 UserDataOperator::OPROWCOL),
725 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 730 of file GriffithForceElement.hpp.

733 {
735
736 if (row_type != MBVERTEX) {
738 }
739
742
743 AuxFunctions<double> auxFun;
744 auxFun.currentCoords.resize(9, false);
745
746 int nb_dofs = row_data.getFieldData().size();
747 for (int dd = 0; dd != nb_dofs; dd++)
748 auxFun.currentCoords[dd] = row_data.getFieldData()[dd];
749
750 CHKERR setIndices(row_data);
751 CHKERR setVariables(this, row_data);
752 int nb_gauss_pts = row_data.getN().size1();
753 int nb_base_row = row_data.getFieldData().size() / 3;
754 int nb_base_col = col_data.getFieldData().size() / 3;
755
756 int row_nb_dofs = row_data.getIndices().size();
757 mat.resize(9, 9, false);
758 mat.clear();
759
760 const double &gc = blockData.gc;
761 auto rho = getFTensor0FromVec(commonData.densityRho);
762 auto get_ftensor_from_vec = [](auto &v) {
763 return FTensor::Tensor1<double *, 3>(&v(0), &v(1), &v(2), 3);
764 };
765
766 auto get_tensor2 = [](MatrixDouble &m, const int r, const int c) {
768 &m(3 * r + 0, 3 * c + 0), &m(3 * r + 0, 3 * c + 1),
769 &m(3 * r + 0, 3 * c + 2), &m(3 * r + 1, 3 * c + 0),
770 &m(3 * r + 1, 3 * c + 1), &m(3 * r + 1, 3 * c + 2),
771 &m(3 * r + 2, 3 * c + 0), &m(3 * r + 2, 3 * c + 1),
772 &m(3 * r + 2, 3 * c + 2));
773 };
774
775 for (int gg = 0; gg != nb_gauss_pts; gg++) {
776
777 double val = getGaussPts()(2, gg) * 0.5;
778
779 auxFun.calculateGriffithForce(1, 1, row_data.getDiffN(gg));
780
781 auto t_griffith = get_ftensor_from_vec(auxFun.griffithForce);
782 auto t_diff_rho = getFTensor1FromMat<3>(commonData.diffRho);
783 for (int rrr = 0; rrr != nb_base_row; rrr++) {
784
785 const double a = val * gc * pow(rho, betaGC - 1.) * betaGC;
787 k(i, j) = t_diff_rho(j) * t_griffith(i) * a;
788 // there is no dependence on the other nodes so row == col
789 auto tt_mat = get_tensor2(mat, rrr, rrr);
790 tt_mat(i, j) += k(i, j);
791
792 ++t_diff_rho;
793 ++t_griffith;
794 ++rho;
795 }
796 }
797
798 int col_nb_dofs = col_data.getIndices().size();
799
800 CHKERR MatSetValues(getFEMethod()->snes_B, row_nb_dofs,
801 &*rowIndices.data().begin(), col_nb_dofs,
802 &*col_data.getIndices().data().begin(),
803 &*mat.data().begin(), ADD_VALUES);
804
806 }
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
const double r
rate factor
double rho
Definition: plastic.cpp:98
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 728 of file GriffithForceElement.hpp.

◆ mat

MatrixDouble FractureMechanics::GriffithForceElement::OpHeterogeneousGcLhs::mat

Definition at line 727 of file GriffithForceElement.hpp.


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