v0.14.0
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 915 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 987 of file GriffithForceElement.hpp.

987 {
990 }
#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 927 of file GriffithForceElement.hpp.

927 {
929
930 MOFEM_LOG_CHANNEL("WORLD");
932 MOFEM_LOG_TAG("WORLD", "GriffithConstrain");
933
934 const double *delta;
935 CHKERR VecGetArrayRead(deltaVec, &delta);
936 double sum_of_delta = 0;
937 double sum_of_lambda = 0;
938 const auto bit_field_number =
940 switch (snes_ctx) {
941 case CTX_SNESSETFUNCTION: {
943 bit_field_number, dit)) {
944 if (static_cast<int>(dit->get()->getPart()) ==
946 int local_idx = dit->get()->getPetscLocalDofIdx();
947 double lambda = dit->get()->getFieldData();
948 double W = lambda - blockData.E * delta[local_idx];
949 double val = lambda - calMax(W, 0, blockData.r);
950 int global_idx = dit->get()->getPetscGlobalDofIdx();
951 CHKERR VecSetValue(snes_f, global_idx, val, ADD_VALUES);
952 }
953 }
954 } break;
955 case CTX_SNESSETJACOBIAN: {
957 bit_field_number, dit)) {
958 if (static_cast<int>(dit->get()->getPart()) ==
960 int local_idx = dit->get()->getPetscLocalDofIdx();
961 double lambda = dit->get()->getFieldData();
962 double W = lambda - blockData.E * delta[local_idx];
963 double diffW = 1;
964 double val = 1 - diffCalMax_a(W, 0, blockData.r) * diffW;
965 int global_idx = dit->get()->getPetscGlobalDofIdx();
966 MOFEM_LOG_C("WORLD", Sev::verbose,
967 "Constrains on node %lu diag = %+3.5e "
968 "delta = %+3.5e lambda = %+3.5e",
969 dit->get()->getEnt(), val, delta[local_idx], lambda);
970 CHKERR MatSetValue(snes_B, global_idx, global_idx, val, ADD_VALUES);
971 sum_of_delta += delta[local_idx];
972 sum_of_lambda += lambda;
973 }
974 }
975 MOFEM_LOG_C("WORLD", Sev::noisy,
976 "Sum of delta = %+6.4e Sum of lambda = %+6.4e",
977 sum_of_delta, sum_of_lambda);
978
979 } break;
980 default:
981 break;
982 }
983 CHKERR VecRestoreArrayRead(deltaVec, &delta);
985 }
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:311
#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
double W
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:284
#define MOFEM_LOG_FUNCTION()
Set scope.
Definition: LogManager.hpp:325
#define _IT_NUMEREDDOF_ROW_BY_BITNUMBER_FOR_LOOP_(PROBLEMPTR, FIELD_BIT_NUMBER, IT)
static double lambda
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 918 of file GriffithForceElement.hpp.

◆ deltaVec

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

Definition at line 919 of file GriffithForceElement.hpp.

◆ lambdaFieldName

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

Definition at line 917 of file GriffithForceElement.hpp.


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