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

Definition at line 921 of file GriffithForceElement.hpp.

924  : MyTriangleFE(m_field), lambdaFieldName(lambda_field_name),
925  blockData(block_data), deltaVec(delta_vec) {}

Member Function Documentation

◆ postProcess()

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

Definition at line 987 of file GriffithForceElement.hpp.

987  {
990  }

◆ 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()) ==
945  mField.get_comm_rank()) {
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()) ==
959  mField.get_comm_rank()) {
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  }

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:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
FractureMechanics::GriffithForceElement::BlockData::r
double r
regularity parameter
Definition: GriffithForceElement.hpp:77
MOFEM_LOG_CHANNEL
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:284
FractureMechanics::calMax
static double calMax(double a, double b, double r)
Definition: GriffithForceElement.hpp:24
MoFEM::CoreInterface::get_field_bit_number
virtual FieldBitNumber get_field_bit_number(const std::string name) const =0
get field bit number
MoFEM::CoreInterface::get_comm_rank
virtual int get_comm_rank() const =0
FractureMechanics::GriffithForceElement::MyTriangleFEConstrains::lambdaFieldName
const std::string lambdaFieldName
Definition: GriffithForceElement.hpp:917
W
double W
Definition: free_surface.cpp:166
MOFEM_LOG_FUNCTION
#define MOFEM_LOG_FUNCTION()
Set scope.
Definition: LogManager.hpp:325
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
_IT_NUMEREDDOF_ROW_BY_BITNUMBER_FOR_LOOP_
#define _IT_NUMEREDDOF_ROW_BY_BITNUMBER_FOR_LOOP_(PROBLEMPTR, FIELD_BIT_NUMBER, IT)
Definition: ProblemsMultiIndices.hpp:338
FractureMechanics::GriffithForceElement::MyTriangleFE::MyTriangleFE
MyTriangleFE(MoFEM::Interface &m_field)
Definition: GriffithForceElement.hpp:44
delta
static constexpr double delta
Definition: prism_elements_from_surface.cpp:18
MOFEM_LOG_C
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:311
FractureMechanics::GriffithForceElement::BlockData::E
double E
Young modulus.
Definition: GriffithForceElement.hpp:76
MOFEM_LOG_TAG
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
lambda
static double lambda
Definition: incompressible_elasticity.cpp:199
FractureMechanics::diffCalMax_a
static double diffCalMax_a(double a, double b, double r)
Definition: GriffithForceElement.hpp:28
FractureMechanics::GriffithForceElement::MyTriangleFEConstrains::deltaVec
SmartPetscObj< Vec > deltaVec
Definition: GriffithForceElement.hpp:919
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
FractureMechanics::GriffithForceElement::mField
MoFEM::Interface & mField
Definition: GriffithForceElement.hpp:37
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
FractureMechanics::GriffithForceElement::MyTriangleFEConstrains::blockData
BlockData & blockData
Definition: GriffithForceElement.hpp:918
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359