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

Evaluate density at integration points. More...

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

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

Public Member Functions

 OpMWLSRhoAtGaussPts (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

Evaluate density at integration points.

Definition at line 330 of file MWLS.hpp.

Constructor & Destructor Documentation

◆ OpMWLSRhoAtGaussPts()

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

344  : OpMWLSBase<VolumeElementForcesAndSourcesCore>(
345  mat_pos_at_pts_ptr, mat_grad_pos_at_pts_ptr, fe_singular_ptr,
346  mwls_approx, testing),
347  rhoTagName(rho_tag_name), calculateDerivative(calculate_derivative),
348  calculate2ndDerivative(calculate_2nd_derivative), testing(testing) {}

Member Function Documentation

◆ doMWLSWork()

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

1384  {
1386  if (testing)
1387  cerr << "Element " << getFEEntityHandle() << endl;
1388 
1390 
1391  const int nb_gauss_pts = data.getN().size1();
1392  const bool use_global_base =
1393  mwlsApprox->getUseGlobalBaseAtMaterialReferenceConfiguration();
1394  Tag th;
1395  CHKERR mwlsApprox->mwlsMoab.tag_get_handle(rhoTagName.c_str(), th);
1396 
1397  VectorDouble &rho = *mwlsApprox->rhoAtGaussPts;
1398  rho.resize(nb_gauss_pts, false);
1399  MatrixDouble &diff_rho = *mwlsApprox->diffRhoAtGaussPts;
1400  diff_rho.resize(3, nb_gauss_pts, false);
1401  MatrixDouble &diff_diff_rho = *mwlsApprox->diffDiffRhoAtGaussPts;
1403  diff_diff_rho.resize(9, nb_gauss_pts, false);
1404 
1405  auto t_mwls_material_positions =
1406  getFTensor1FromMat<3>(mwlsApprox->mwlsMaterialPositions);
1407  auto t_approx_base_point = getFTensor1FromMat<3>(mwlsApprox->approxBasePoint);
1408  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
1409 
1410  FTensor::Tensor1<double, 3> t_mat_pos;
1411  t_mat_pos(i) = t_mwls_material_positions(i);
1412  FTensor::Tensor1<double, 3> t_approx_base_pos;
1413  t_approx_base_pos(i) = t_approx_base_point(i);
1414 
1415  if (testing) {
1416  cerr << "material_positions " << t_mwls_material_positions << endl;
1417  cerr << "approx_base_point " << t_approx_base_point << endl;
1418  }
1419  CHKERR mwlsApprox->getInfluenceNodes(&t_approx_base_pos(0));
1420  CHKERR mwlsApprox->calculateApproxCoeff(true, use_global_base);
1421  CHKERR mwlsApprox->evaluateApproxFun(&t_mat_pos(0));
1422  CHKERR mwlsApprox->evaluateFirstDiffApproxFun(&t_mat_pos(0),
1423  use_global_base);
1425  CHKERR mwlsApprox->evaluateSecondDiffApproxFun(&t_mat_pos(0),
1426  use_global_base);
1427  CHKERR mwlsApprox->getTagData(th);
1428  const auto &vals = mwlsApprox->getDataApprox();
1429 
1430  rho(gg) = vals[0];
1431  if (calculateDerivative) {
1432  const auto &diff_vals = mwlsApprox->getDiffDataApprox();
1433  for (int ii = 0; ii != 3; ++ii) {
1434  diff_rho(ii, gg) = diff_vals(ii, 0);
1435  }
1436  }
1437 
1438  if (calculate2ndDerivative) {
1439  const auto &diff_diff_vals = mwlsApprox->getDiffDiffDataApprox();
1440  for (int ii = 0; ii != 3; ++ii) {
1441  for (int jj = 0; jj != 3; ++jj)
1442  diff_diff_rho(ii + 3 * jj, gg) = diff_diff_vals(jj, ii);
1443  }
1444  }
1445 
1446  ++t_mwls_material_positions;
1447  ++t_approx_base_point;
1448  }
1449 
1450  if (testing) {
1451  cerr << "rho " << rho << endl;
1452  cerr << endl;
1453  }
1454 
1456 }

Member Data Documentation

◆ calculate2ndDerivative

const bool FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussPts::calculate2ndDerivative

Definition at line 334 of file MWLS.hpp.

◆ calculateDerivative

const bool FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussPts::calculateDerivative

Definition at line 333 of file MWLS.hpp.

◆ rhoTagName

std::string FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussPts::rhoTagName

Definition at line 331 of file MWLS.hpp.

◆ testing

const bool FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussPts::testing

Definition at line 335 of file MWLS.hpp.


The documentation for this struct was generated from the following files:
FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussPts::testing
const bool testing
Definition: MWLS.hpp:335
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
FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussPts::calculateDerivative
const bool calculateDerivative
Definition: MWLS.hpp:333
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
MoFEM::th
Tag th
Definition: Projection10NodeCoordsOnField.cpp:122
FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussPts::calculate2ndDerivative
const bool calculate2ndDerivative
Definition: MWLS.hpp:334
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
FractureMechanics::MWLSApprox::OpMWLSRhoAtGaussPts::rhoTagName
std::string rhoTagName
Definition: MWLS.hpp:331
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', 3 >
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
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