v0.14.0
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.

725  "MESH_NODE_POSITIONS", "MESH_NODE_POSITIONS",
727  betaGC(beta_gc), AuxOp(tag, block_data, 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;
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  }

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:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
MoFEM::MatSetValues
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
Definition: EntitiesFieldData.hpp:1631
FractureMechanics::GriffithForceElement::AuxOp::AuxOp
AuxOp(int tag, BlockData &block_data, CommonData &common_data)
Definition: GriffithForceElement.hpp:221
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
rho
double rho
Definition: plastic.cpp:191
FractureMechanics::GriffithForceElement::AuxOp::setIndices
MoFEMErrorCode setIndices(DataForcesAndSourcesCore::EntData &data)
Definition: GriffithForceElement.hpp:232
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPROWCOL
@ OPROWCOL
operator doWork is executed on FE rows &columns
Definition: ForcesAndSourcesCore.hpp:569
FractureMechanics::GriffithForceElement::BlockData::gc
double gc
Griffith energy.
Definition: GriffithForceElement.hpp:75
sdf.r
int r
Definition: sdf.py:8
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
FractureMechanics::GriffithForceElement::AuxOp::setVariables
MoFEMErrorCode setVariables(FaceElementForcesAndSourcesCore::UserDataOperator *fe_ptr, DataForcesAndSourcesCore::EntData &data)
Definition: GriffithForceElement.hpp:261
c
const double c
speed of light (cm/ns)
Definition: initial_diffusion.cpp:39
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
a
constexpr double a
Definition: approx_sphere.cpp:30
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
FractureMechanics::GriffithForceElement::AuxOp::blockData
BlockData & blockData
Definition: GriffithForceElement.hpp:218
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', 3 >
FractureMechanics::GriffithForceElement::OpHeterogeneousGcLhs::mat
MatrixDouble mat
Definition: GriffithForceElement.hpp:729
FractureMechanics::GriffithForceElement::OpHeterogeneousGcLhs::betaGC
const double betaGC
Definition: GriffithForceElement.hpp:730
FractureMechanics::GriffithForceElement::CommonData::diffRho
MatrixDouble diffRho
for lhs with heterogeneous gc
Definition: GriffithForceElement.hpp:70
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
FTensor::dd
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
FractureMechanics::GriffithForceElement::CommonData::densityRho
VectorDouble densityRho
gc * rho^beta
Definition: GriffithForceElement.hpp:69
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
FractureMechanics::GriffithForceElement::AuxOp::rowIndices
ublas::vector< int > rowIndices
Definition: GriffithForceElement.hpp:222
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
FractureMechanics::GriffithForceElement::AuxOp::commonData
CommonData & commonData
Definition: GriffithForceElement.hpp:219
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346