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

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

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

Public Member Functions

 MyTriangleFEConstrains (MoFEM::Interface &m_field, const std::string &lambda_field_name, BlockData &block_data, SmartPetscObj< Vec > &delta_vec)
 
MoFEMErrorCode preProcess ()
 
MoFEMErrorCode postProcess ()
 
- Public Member Functions inherited from FractureMechanics::GriffithForceElement::MyTriangleFE
 MyTriangleFE (MoFEM::Interface &m_field)
 
int getRule (int order)
 

Public Attributes

const std::string lambdaFieldName
 
BlockDatablockData
 
SmartPetscObj< Vec > deltaVec
 
- Public Attributes inherited from FractureMechanics::GriffithForceElement::MyTriangleFE
Mat B
 
Vec F
 

Detailed Description

Definition at line 913 of file GriffithForceElement.hpp.

Constructor & Destructor Documentation

◆ MyTriangleFEConstrains()

FractureMechanics::GriffithForceElement::MyTriangleFEConstrains::MyTriangleFEConstrains ( MoFEM::Interface m_field,
const std::string &  lambda_field_name,
BlockData block_data,
SmartPetscObj< Vec > &  delta_vec 
)
inline

Member Function Documentation

◆ postProcess()

MoFEMErrorCode FractureMechanics::GriffithForceElement::MyTriangleFEConstrains::postProcess ( )
inline

Definition at line 985 of file GriffithForceElement.hpp.

985 {
988 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440

◆ preProcess()

MoFEMErrorCode FractureMechanics::GriffithForceElement::MyTriangleFEConstrains::preProcess ( )
inline

Definition at line 925 of file GriffithForceElement.hpp.

925 {
927
928 MOFEM_LOG_CHANNEL("WORLD");
930 MOFEM_LOG_TAG("WORLD", "GriffithConstrain");
931
932 const double *delta;
933 CHKERR VecGetArrayRead(deltaVec, &delta);
934 double sum_of_delta = 0;
935 double sum_of_lambda = 0;
936 const auto bit_field_number =
938 switch (snes_ctx) {
939 case CTX_SNESSETFUNCTION: {
941 bit_field_number, dit)) {
942 if (static_cast<int>(dit->get()->getPart()) ==
944 int local_idx = dit->get()->getPetscLocalDofIdx();
945 double lambda = dit->get()->getFieldData();
946 double W = lambda - blockData.E * delta[local_idx];
947 double val = lambda - calMax(W, 0, blockData.r);
948 int global_idx = dit->get()->getPetscGlobalDofIdx();
949 CHKERR VecSetValue(snes_f, global_idx, val, ADD_VALUES);
950 }
951 }
952 } break;
953 case CTX_SNESSETJACOBIAN: {
955 bit_field_number, dit)) {
956 if (static_cast<int>(dit->get()->getPart()) ==
958 int local_idx = dit->get()->getPetscLocalDofIdx();
959 double lambda = dit->get()->getFieldData();
960 double W = lambda - blockData.E * delta[local_idx];
961 double diffW = 1;
962 double val = 1 - diffCalMax_a(W, 0, blockData.r) * diffW;
963 int global_idx = dit->get()->getPetscGlobalDofIdx();
964 MOFEM_LOG_C("WORLD", Sev::verbose,
965 "Constrains on node %lu diag = %+3.5e "
966 "delta = %+3.5e lambda = %+3.5e",
967 dit->get()->getEnt(), val, delta[local_idx], lambda);
968 CHKERR MatSetValue(snes_B, global_idx, global_idx, val, ADD_VALUES);
969 sum_of_delta += delta[local_idx];
970 sum_of_lambda += lambda;
971 }
972 }
973 MOFEM_LOG_C("WORLD", Sev::noisy,
974 "Sum of delta = %+6.4e Sum of lambda = %+6.4e",
975 sum_of_delta, sum_of_lambda);
976
977 } break;
978 default:
979 break;
980 }
981 CHKERR VecRestoreArrayRead(deltaVec, &delta);
983 }
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:304
#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
constexpr double lambda
constexpr double W
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:332
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:277
#define MOFEM_LOG_FUNCTION()
Set scope.
Definition: LogManager.hpp:318
#define _IT_NUMEREDDOF_ROW_BY_BITNUMBER_FOR_LOOP_(PROBLEMPTR, FIELD_BIT_NUMBER, IT)
static double diffCalMax_a(double a, double b, double r)
static double calMax(double a, double b, double r)
static constexpr double delta
virtual FieldBitNumber get_field_bit_number(const std::string name) const =0
get field bit number
virtual int get_comm_rank() const =0

Member Data Documentation

◆ blockData

BlockData& FractureMechanics::GriffithForceElement::MyTriangleFEConstrains::blockData

Definition at line 916 of file GriffithForceElement.hpp.

◆ deltaVec

SmartPetscObj<Vec> FractureMechanics::GriffithForceElement::MyTriangleFEConstrains::deltaVec

Definition at line 917 of file GriffithForceElement.hpp.

◆ lambdaFieldName

const std::string FractureMechanics::GriffithForceElement::MyTriangleFEConstrains::lambdaFieldName

Definition at line 915 of file GriffithForceElement.hpp.


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