v0.14.0
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
FractureMechanics::MWLSApprox::OpMWLSStressAtGaussPts Struct Reference

Evaluate stress at integration points. More...

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

Inheritance diagram for FractureMechanics::MWLSApprox::OpMWLSStressAtGaussPts:
[legend]
Collaboration diagram for FractureMechanics::MWLSApprox::OpMWLSStressAtGaussPts:
[legend]

Public Member Functions

 OpMWLSStressAtGaussPts (boost::shared_ptr< MatrixDouble > mat_pos_at_pts_ptr, boost::shared_ptr< MatrixDouble > mat_grad_pos_at_pts_ptr, boost::shared_ptr< CrackFrontElement > fe_singular_ptr, boost::shared_ptr< MWLSApprox > mwls_approx, const std::string stress_tag_name, bool calculate_derivative, bool testing=false)
 
virtual ~OpMWLSStressAtGaussPts ()=default
 
- Public Member Functions inherited from FractureMechanics::MWLSApprox::OpMWLSBase< VolumeElementForcesAndSourcesCore >
 OpMWLSBase (boost::shared_ptr< MatrixDouble > mat_pos_at_pts_ptr, boost::shared_ptr< MatrixDouble > mat_grad_pos_at_pts_ptr, boost::shared_ptr< CrackFrontElement > fe_singular_ptr, boost::shared_ptr< MWLSApprox > mwls_approx, bool testing=false)
 
virtual ~OpMWLSBase ()=default
 
MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 

Public Attributes

std::string stressTagName
 
const bool calculateDerivative
 
const bool testing
 
boost::shared_ptr< MatrixDouble > matGradPosAtPtsPtr
 
- Public Attributes inherited from FractureMechanics::MWLSApprox::OpMWLSBase< VolumeElementForcesAndSourcesCore >
boost::shared_ptr< MatrixDouble > matPosAtPtsPtr
 
boost::shared_ptr< MatrixDouble > matGradPosAtPtsPtr
 
boost::weak_ptr< CrackFrontElementfeSingularPtr
 
boost::shared_ptr< MWLSApproxmwlsApprox
 

Protected Member Functions

MoFEMErrorCode doMWLSWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 Do specific work in operator. More...
 

Detailed Description

Evaluate stress at integration points.

Definition at line 404 of file MWLS.hpp.

Constructor & Destructor Documentation

◆ OpMWLSStressAtGaussPts()

FractureMechanics::MWLSApprox::OpMWLSStressAtGaussPts::OpMWLSStressAtGaussPts ( boost::shared_ptr< MatrixDouble >  mat_pos_at_pts_ptr,
boost::shared_ptr< MatrixDouble >  mat_grad_pos_at_pts_ptr,
boost::shared_ptr< CrackFrontElement fe_singular_ptr,
boost::shared_ptr< MWLSApprox mwls_approx,
const std::string  stress_tag_name,
bool  calculate_derivative,
bool  testing = false 
)
inline

Definition at line 410 of file MWLS.hpp.

417  : OpMWLSBase<VolumeElementForcesAndSourcesCore>(
418  mat_pos_at_pts_ptr, mat_grad_pos_at_pts_ptr, fe_singular_ptr,
419  mwls_approx, testing),
420  matGradPosAtPtsPtr(mat_pos_at_pts_ptr),
421  stressTagName(stress_tag_name),
422  calculateDerivative(calculate_derivative), testing(testing) {}

◆ ~OpMWLSStressAtGaussPts()

virtual FractureMechanics::MWLSApprox::OpMWLSStressAtGaussPts::~OpMWLSStressAtGaussPts ( )
virtualdefault

Member Function Documentation

◆ doMWLSWork()

MoFEMErrorCode FractureMechanics::MWLSApprox::OpMWLSStressAtGaussPts::doMWLSWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)
protectedvirtual

Do specific work in operator.

Is protected to prevent direct call. This can be only called by doWork method.

Parameters
side
type
data
Returns
MoFEMErrorCode

Implements FractureMechanics::MWLSApprox::OpMWLSBase< VolumeElementForcesAndSourcesCore >.

Definition at line 1582 of file MWLS.cpp.

1583  {
1585 
1586  if (testing)
1587  cerr << "Element " << getFEEntityHandle() << endl;
1588 
1590 
1591  const int nb_gauss_pts = data.getN().size1();
1592  const bool use_global_base =
1593  mwlsApprox->getUseGlobalBaseAtMaterialReferenceConfiguration();
1594  Tag th;
1595  CHKERR mwlsApprox->mwlsMoab.tag_get_handle(stressTagName.c_str(), th);
1596 
1597  MatrixDouble &stress = mwlsApprox->stressAtGaussPts;
1598  stress.resize(6, nb_gauss_pts, false);
1599  MatrixDouble &diff_stress = mwlsApprox->diffStressAtGaussPts;
1600  diff_stress.resize(18, nb_gauss_pts, false);
1601 
1602  auto t_mwls_material_positions =
1603  getFTensor1FromMat<3>(mwlsApprox->mwlsMaterialPositions);
1604  auto t_approx_base_point = getFTensor1FromMat<3>(mwlsApprox->approxBasePoint);
1605  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
1606 
1607  auto t_material_positions = getFTensor1FromMat<3>(*matPosAtPtsPtr);
1608 
1609  FTensor::Tensor1<double, 3> t_mat_pos;
1610  t_mat_pos(i) = t_mwls_material_positions(i);
1611  FTensor::Tensor1<double, 3> t_approx_base_pos;
1612  t_approx_base_pos(i) = t_approx_base_point(i);
1613 
1614  if (testing) {
1615  cerr << "material_positions " << t_mwls_material_positions << endl;
1616  cerr << "approx_base_point " << t_approx_base_point << endl;
1617  }
1618  CHKERR mwlsApprox->getInfluenceNodes(&t_approx_base_pos(0));
1619  CHKERR mwlsApprox->calculateApproxCoeff(true, use_global_base);
1620  CHKERR mwlsApprox->evaluateApproxFun(&t_mat_pos(0));
1621  CHKERR mwlsApprox->evaluateFirstDiffApproxFun(&t_mat_pos(0),
1622  use_global_base);
1623 
1624  CHKERR mwlsApprox->getTagData(th);
1625  const auto &vals = mwlsApprox->getDataApprox();
1626 
1627  for (int ii = 0; ii != 6; ++ii)
1628  stress(ii, gg) = vals[ii];
1629  if (calculateDerivative) {
1630  const auto &diff_vals = mwlsApprox->getDiffDataApprox();
1631  for (int ii = 0; ii != 6; ++ii) {
1632  for (int jj = 0; jj != 3; ++jj)
1633  diff_stress(jj * 6 + ii, gg) = diff_vals(jj, ii);
1634  }
1635  }
1636  ++t_mwls_material_positions;
1637  ++t_approx_base_point;
1638  }
1639 
1640  if (testing) {
1641  cerr << "stress " << stress << endl;
1642  cerr << endl;
1643  }
1644 
1646 }

Member Data Documentation

◆ calculateDerivative

const bool FractureMechanics::MWLSApprox::OpMWLSStressAtGaussPts::calculateDerivative

Definition at line 407 of file MWLS.hpp.

◆ matGradPosAtPtsPtr

boost::shared_ptr<MatrixDouble> FractureMechanics::MWLSApprox::OpMWLSStressAtGaussPts::matGradPosAtPtsPtr

Definition at line 409 of file MWLS.hpp.

◆ stressTagName

std::string FractureMechanics::MWLSApprox::OpMWLSStressAtGaussPts::stressTagName

Definition at line 406 of file MWLS.hpp.

◆ testing

const bool FractureMechanics::MWLSApprox::OpMWLSStressAtGaussPts::testing

Definition at line 408 of file MWLS.hpp.


The documentation for this struct was generated from the following files:
FractureMechanics::MWLSApprox::OpMWLSBase< VolumeElementForcesAndSourcesCore >::mwlsApprox
boost::shared_ptr< MWLSApprox > mwlsApprox
Definition: MWLS.hpp:242
FTensor::Tensor1< double, 3 >
FractureMechanics::MWLSApprox::OpMWLSStressAtGaussPts::matGradPosAtPtsPtr
boost::shared_ptr< MatrixDouble > matGradPosAtPtsPtr
Definition: MWLS.hpp:409
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
MoFEM::th
Tag th
Definition: Projection10NodeCoordsOnField.cpp:122
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
FractureMechanics::MWLSApprox::OpMWLSStressAtGaussPts::testing
const bool testing
Definition: MWLS.hpp:408
FractureMechanics::MWLSApprox::OpMWLSStressAtGaussPts::stressTagName
std::string stressTagName
Definition: MWLS.hpp:406
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', 3 >
FractureMechanics::MWLSApprox::OpMWLSBase< VolumeElementForcesAndSourcesCore >::matPosAtPtsPtr
boost::shared_ptr< MatrixDouble > matPosAtPtsPtr
Definition: MWLS.hpp:239
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
FractureMechanics::MWLSApprox::OpMWLSStressAtGaussPts::calculateDerivative
const bool calculateDerivative
Definition: MWLS.hpp:407