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

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

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

Public Member Functions

 OpMWLSRhoAtGaussUsingPrecalulatedCoeffs (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 rho_tag_name, const bool calculate_derivative, const bool calculate_2nd_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 rhoTagName
 
const bool calculateDerivative
 
const bool calculate2ndDerivative
 
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 302 of file MWLS.hpp.

Constructor & Destructor Documentation

◆ OpMWLSRhoAtGaussUsingPrecalulatedCoeffs()

FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussUsingPrecalulatedCoeffs::OpMWLSRhoAtGaussUsingPrecalulatedCoeffs ( 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  rho_tag_name,
const bool  calculate_derivative,
const bool  calculate_2nd_derivative,
bool  testing = false 
)
inline

Definition at line 309 of file MWLS.hpp.

316  : OpMWLSBase<VolumeElementForcesAndSourcesCore>(
317  mat_pos_at_pts_ptr, mat_grad_pos_at_pts_ptr, fe_singular_ptr,
318  mwls_approx, testing),
319  rhoTagName(rho_tag_name), calculateDerivative(calculate_derivative),
320  calculate2ndDerivative(calculate_2nd_derivative), testing(testing) {}

Member Function Documentation

◆ doMWLSWork()

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

1294  {
1296 
1297  if (testing)
1298  cerr << "Element " << getFEEntityHandle() << endl;
1299  const bool use_global_base =
1300  mwlsApprox->getUseGlobalBaseAtMaterialReferenceConfiguration();
1301  if (use_global_base)
1302  SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE,
1303  "Coefficients can be precalculated only for local base in "
1304  "reference configuration");
1305 
1307 
1308  Tag th;
1309  CHKERR mwlsApprox->mwlsMoab.tag_get_handle(rhoTagName.c_str(), th);
1310 
1311  const int nb_gauss_pts = data.getN().size1();
1312  auto &inv_AB_map = mwlsApprox->invABMap.at(getFEEntityHandle());
1313  auto &influence_nodes_map =
1314  mwlsApprox->influenceNodesMap.at(getFEEntityHandle());
1315  auto &dm_nodes_map = mwlsApprox->dmNodesMap.at(this->getFEEntityHandle());
1316 
1317  VectorDouble &rho = *mwlsApprox->rhoAtGaussPts;
1318  rho.resize(nb_gauss_pts, false);
1319  MatrixDouble &diff_rho = *mwlsApprox->diffRhoAtGaussPts;
1320  diff_rho.resize(3, nb_gauss_pts, false);
1321  MatrixDouble &diff_diff_rho = *mwlsApprox->diffDiffRhoAtGaussPts;
1323  diff_diff_rho.resize(9, nb_gauss_pts, false);
1324 
1325  auto t_mwls_material_positions =
1326  getFTensor1FromMat<3>(mwlsApprox->mwlsMaterialPositions);
1327  auto t_approx_base_point = getFTensor1FromMat<3>(mwlsApprox->approxBasePoint);
1328 
1329  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
1330 
1331  FTensor::Tensor1<double, 3> t_mat_pos;
1332  t_mat_pos(i) = t_mwls_material_positions(i);
1333 
1334  if (testing) {
1335  cerr << "material_positions " << t_mwls_material_positions << endl;
1336  }
1337 
1338  for (int dd : {0, 1, 2})
1339  mwlsApprox->approxPointCoords[dd] = t_approx_base_point(dd);
1340 
1341  mwlsApprox->influenceNodes = influence_nodes_map[gg];
1342  mwlsApprox->invAB = inv_AB_map[gg];
1343  mwlsApprox->shortenDm = dm_nodes_map[gg];
1344 
1345  CHKERR mwlsApprox->evaluateApproxFun(&t_mat_pos(0));
1346  CHKERR mwlsApprox->evaluateFirstDiffApproxFun(&t_mat_pos(0),
1347  use_global_base);
1349  CHKERR mwlsApprox->evaluateSecondDiffApproxFun(&t_mat_pos(0),
1350  use_global_base);
1351 
1352  CHKERR mwlsApprox->getTagData(th);
1353  const auto &vals = mwlsApprox->getDataApprox();
1354 
1355  rho(gg) = vals[0];
1356  if (calculateDerivative) {
1357  const auto &diff_vals = mwlsApprox->getDiffDataApprox();
1358  for (int ii = 0; ii != 3; ++ii) {
1359  diff_rho(ii, gg) = diff_vals(ii, 0);
1360  }
1361  }
1362 
1363  if (calculate2ndDerivative) {
1364  const auto &diff_diff_vals = mwlsApprox->getDiffDiffDataApprox();
1365  for (int ii = 0; ii != 3; ++ii) {
1366  for (int jj = 0; jj != 3; ++jj)
1367  diff_diff_rho(jj * 3 + ii, gg) = diff_diff_vals(jj * 3 + ii, 0);
1368  }
1369  }
1370 
1371  ++t_mwls_material_positions;
1372  ++t_approx_base_point;
1373  }
1374 
1375  if (testing) {
1376  cerr << "rho " << rho << endl;
1377  cerr << endl;
1378  }
1379 
1381 }

Member Data Documentation

◆ calculate2ndDerivative

const bool FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussUsingPrecalulatedCoeffs::calculate2ndDerivative

Definition at line 307 of file MWLS.hpp.

◆ calculateDerivative

const bool FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussUsingPrecalulatedCoeffs::calculateDerivative

Definition at line 306 of file MWLS.hpp.

◆ rhoTagName

std::string FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussUsingPrecalulatedCoeffs::rhoTagName

Definition at line 305 of file MWLS.hpp.

◆ testing

const bool FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussUsingPrecalulatedCoeffs::testing

Definition at line 308 of file MWLS.hpp.


The documentation for this struct was generated from the following files:
FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussUsingPrecalulatedCoeffs::testing
const bool testing
Definition: MWLS.hpp:308
FractureMechanics::MWLSApprox::OpMWLSBase< VolumeElementForcesAndSourcesCore >::mwlsApprox
boost::shared_ptr< MWLSApprox > mwlsApprox
Definition: MWLS.hpp:242
FTensor::Tensor1< double, 3 >
rho
double rho
Definition: plastic.cpp:191
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:535
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', 3 >
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
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussUsingPrecalulatedCoeffs::calculateDerivative
const bool calculateDerivative
Definition: MWLS.hpp:306
FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussUsingPrecalulatedCoeffs::rhoTagName
std::string rhoTagName
Definition: MWLS.hpp:305
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussUsingPrecalulatedCoeffs::calculate2ndDerivative
const bool calculate2ndDerivative
Definition: MWLS.hpp:307