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

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

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

Public Member Functions

 OpMWLSStressAtGaussUsingPrecalulatedCoeffs (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)
 
- 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
 
- 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

Definition at line 377 of file MWLS.hpp.

Constructor & Destructor Documentation

◆ OpMWLSStressAtGaussUsingPrecalulatedCoeffs()

FractureMechanics::MWLSApprox::OpMWLSStressAtGaussUsingPrecalulatedCoeffs::OpMWLSStressAtGaussUsingPrecalulatedCoeffs ( 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 384 of file MWLS.hpp.

391  : OpMWLSBase<VolumeElementForcesAndSourcesCore>(
392  mat_pos_at_pts_ptr, mat_grad_pos_at_pts_ptr, fe_singular_ptr,
393  mwls_approx, testing),
394  stressTagName(stress_tag_name),
395  calculateDerivative(calculate_derivative), testing(testing) {}

Member Function Documentation

◆ doMWLSWork()

MoFEMErrorCode FractureMechanics::MWLSApprox::OpMWLSStressAtGaussUsingPrecalulatedCoeffs::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 1504 of file MWLS.cpp.

1505  {
1507 
1508  if (testing)
1509  cerr << "Element " << getFEEntityHandle() << endl;
1510 
1511  const bool use_global_base =
1512  mwlsApprox->getUseGlobalBaseAtMaterialReferenceConfiguration();
1513  if (use_global_base)
1514  SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE,
1515  "Coefficients can be precalculated only for local base in "
1516  "reference configuration");
1517 
1519 
1520  Tag th;
1521  CHKERR mwlsApprox->mwlsMoab.tag_get_handle(stressTagName.c_str(), th);
1522 
1523  const int nb_gauss_pts = data.getN().size1();
1524  auto &inv_AB_map = mwlsApprox->invABMap.at(getFEEntityHandle());
1525  auto &influence_nodes_map =
1526  mwlsApprox->influenceNodesMap.at(getFEEntityHandle());
1527  auto &dm_nodes_map = mwlsApprox->dmNodesMap.at(this->getFEEntityHandle());
1528 
1529  MatrixDouble &stress = mwlsApprox->stressAtGaussPts;
1530  stress.resize(6, nb_gauss_pts, false);
1531  MatrixDouble &diff_stress = mwlsApprox->diffStressAtGaussPts;
1532  diff_stress.resize(18, nb_gauss_pts, false);
1533 
1534  auto t_mwls_material_positions =
1535  getFTensor1FromMat<3>(mwlsApprox->mwlsMaterialPositions);
1536  auto t_approx_base_point = getFTensor1FromMat<3>(mwlsApprox->approxBasePoint);
1537 
1538  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
1539 
1540  FTensor::Tensor1<double, 3> t_mat_pos;
1541  t_mat_pos(i) = t_mwls_material_positions(i);
1542 
1543  if (testing) {
1544  cerr << "material_positions " << t_mwls_material_positions << endl;
1545  }
1546 
1547  for (int dd : {0, 1, 2})
1548  mwlsApprox->approxPointCoords[dd] = t_approx_base_point(dd);
1549 
1550  mwlsApprox->influenceNodes = influence_nodes_map[gg];
1551  mwlsApprox->invAB = inv_AB_map[gg];
1552  mwlsApprox->shortenDm = dm_nodes_map[gg];
1553 
1554  CHKERR mwlsApprox->evaluateApproxFun(&t_mat_pos(0));
1555  CHKERR mwlsApprox->evaluateFirstDiffApproxFun(&t_mat_pos(0),
1556  use_global_base);
1557 
1558  CHKERR mwlsApprox->getTagData(th);
1559  const auto &vals = mwlsApprox->getDataApprox();
1560 
1561  for (int ii = 0; ii != 6; ++ii)
1562  stress(ii, gg) = vals[ii];
1563  if (calculateDerivative) {
1564  const auto &diff_vals = mwlsApprox->getDiffDataApprox();
1565  for (int ii = 0; ii != 6; ++ii) {
1566  for (int jj = 0; jj != 3; ++jj)
1567  diff_stress(jj * 6 + ii, gg) = diff_vals(jj, ii);
1568  }
1569  }
1570  ++t_mwls_material_positions;
1571  ++t_approx_base_point;
1572  }
1573 
1574  if (testing) {
1575  cerr << "stress " << stress << endl;
1576  cerr << endl;
1577  }
1578 
1580 }

Member Data Documentation

◆ calculateDerivative

const bool FractureMechanics::MWLSApprox::OpMWLSStressAtGaussUsingPrecalulatedCoeffs::calculateDerivative

Definition at line 381 of file MWLS.hpp.

◆ stressTagName

std::string FractureMechanics::MWLSApprox::OpMWLSStressAtGaussUsingPrecalulatedCoeffs::stressTagName

Definition at line 380 of file MWLS.hpp.

◆ testing

const bool FractureMechanics::MWLSApprox::OpMWLSStressAtGaussUsingPrecalulatedCoeffs::testing

Definition at line 382 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 >
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
MoFEM::th
Tag th
Definition: Projection10NodeCoordsOnField.cpp:122
MOFEM_IMPOSSIBLE_CASE
@ MOFEM_IMPOSSIBLE_CASE
Definition: definitions.h:35
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
FractureMechanics::MWLSApprox::OpMWLSStressAtGaussUsingPrecalulatedCoeffs::calculateDerivative
const bool calculateDerivative
Definition: MWLS.hpp:381
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', 3 >
FractureMechanics::MWLSApprox::OpMWLSStressAtGaussUsingPrecalulatedCoeffs::stressTagName
std::string stressTagName
Definition: MWLS.hpp:380
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::MWLSApprox::OpMWLSStressAtGaussUsingPrecalulatedCoeffs::testing
const bool testing
Definition: MWLS.hpp:382
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