v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
EshelbianPlasticity::OpBrokenAnalyticalTractionBc_dX Struct Reference
Inheritance diagram for EshelbianPlasticity::OpBrokenAnalyticalTractionBc_dX:
[legend]
Collaboration diagram for EshelbianPlasticity::OpBrokenAnalyticalTractionBc_dX:
[legend]

Public Member Functions

 OpBrokenAnalyticalTractionBc_dX (std::string field_name, boost::shared_ptr< AnalyticalTractionBcVec > bc_data, boost::shared_ptr< MatrixDouble > lambda_hybrid_ptr, boost::shared_ptr< TopologicalData > topo_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv, SmartPetscObj< Vec > vec, boost::shared_ptr< double > J_ptr=nullptr, Tag tag=Tag())
 
MoFEMErrorCode integrate (int side, EntityType type, EntData &data) override
 
- Public Member Functions inherited from EshelbianPlasticity::OpAssembleTopologicalObjectiveDerivativeImplBase< OpAssembleFace >
 OpAssembleTopologicalObjectiveDerivativeImplBase (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< TopologicalData > topo_ptr, boost::shared_ptr< double > J_ptr, SmartPetscObj< Vec > assemble_vec, Tag topo_tag)
 
MoFEMErrorCode assemble (int side, EntityType type, EntData &data) override
 
- Public Member Functions inherited from OpAssembleBasic< FaceUserDataOperator >
 OpAssembleBasic (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)
 
 OpAssembleBasic (std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type, const bool assemble_symmetry, ScaleOff scale_off=[]() { return 1;})
 
 OpAssembleBasic (const FieldSpace space)
 
virtual MoFEMErrorCode integrate (EntData &data)
 
virtual MoFEMErrorCode integrate (int row_side, EntityType row_type, EntData &data)
 
virtual MoFEMErrorCode integrate (EntData &row_data, EntData &col_data)
 
virtual MoFEMErrorCode assemble (EntData &data)
 
virtual MoFEMErrorCode assemble (int row_side, EntityType row_type, EntData &data)
 
virtual MoFEMErrorCode assemble (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 

Protected Attributes

boost::shared_ptr< AnalyticalTractionBcVecbcData
 
boost::shared_ptr< MatrixDouble > lambdaHybridPtr
 
boost::shared_ptr< TopologicalDatatopoData
 
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
 
- Protected Attributes inherited from EshelbianPlasticity::OpAssembleTopologicalObjectiveDerivativeImplBase< OpAssembleFace >
double locJ
 
boost::shared_ptr< doubleJPtr
 
SmartPetscObj< Vec > assembleVec
 
Tag topoTag
 
boost::shared_ptr< TopologicalDatatopoData
 

Additional Inherited Members

- Public Types inherited from EshelbianPlasticity::OpAssembleTopologicalObjectiveDerivativeImplBase< OpAssembleFace >
using OP = OpAssembleFace
 
- Public Types inherited from OpAssembleBasic< FaceUserDataOperator >
using ScaleOff = boost::function< double()>
 
- Public Attributes inherited from OpAssembleBasic< FaceUserDataOperator >
const bool assembleSymmetry
 
boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts
 
VectorDouble nF
 local right hand side vector
 
MatrixDouble K
 local tangent matrix
 
MatrixDouble transposeK
 
ScaleOff scaleOff
 

Detailed Description

Definition at line 300 of file EshelbianTopologicalDerivativeOperators.cpp.

Constructor & Destructor Documentation

◆ OpBrokenAnalyticalTractionBc_dX()

EshelbianPlasticity::OpBrokenAnalyticalTractionBc_dX::OpBrokenAnalyticalTractionBc_dX ( std::string  field_name,
boost::shared_ptr< AnalyticalTractionBcVec bc_data,
boost::shared_ptr< MatrixDouble >  lambda_hybrid_ptr,
boost::shared_ptr< TopologicalData topo_ptr,
std::map< std::string, boost::shared_ptr< ScalingMethod > >  smv,
SmartPetscObj< Vec >  vec,
boost::shared_ptr< double J_ptr = nullptr,
Tag  tag = Tag() 
)
inline

Member Function Documentation

◆ integrate()

MoFEMErrorCode EshelbianPlasticity::OpBrokenAnalyticalTractionBc_dX::integrate ( int  side,
EntityType  type,
EntData data 
)
override

Definition at line 1472 of file EshelbianTopologicalDerivativeOperators.cpp.

1474 {
1476 locJ = 0;
1477
1484
1485 int nb_dofs = data.getFieldData().size();
1486 int nb_integration_pts = getGaussPts().size2();
1487 int nb_base_functions = data.getN().size2();
1488
1489#ifndef NDEBUG
1490 if (this->nF.size() != nb_dofs)
1491 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1492 "Size of nF %ld != nb_dofs %d", this->nF.size(), nb_dofs);
1493#endif // NDEBUG
1494
1495 auto integrate_rhs = [&](auto &bc) {
1497
1498 auto v_analytical_expr =
1499 getTopologicalAnalyticalExpr(this, bc.blockName);
1500
1501 auto t_val = getFTensor1FromMat<SPACE_DIM, -1, DL>(v_analytical_expr);
1502 auto t_diff_base = data.getFTensor1DiffN<2>();
1503 auto t_w = getFTensor0IntegrationWeight();
1504
1505 auto t_var_u_gamma = getFTensor1FromMat<SPACE_DIM>(lambdaHybridPtr);
1506 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1507 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1508
1509 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1510
1512 t_normal(j) =
1513 (FTensor::levi_civita(i, j, k) * t_tangent1(k)) * t_tangent2(i);
1514
1515 double a = sqrt(t_normal(i) * t_normal(i));
1517 t_da(i) = t_normal(i) / a;
1518 a /= 2.;
1519 t_da(i) /= 2.;
1520
1521 locJ -= (t_w * a) * (t_val(i) * t_var_u_gamma(i));
1522
1523 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(nF);
1524 int rr = 0;
1525 for (; rr != nb_dofs / SPACE_DIM; ++rr) {
1527 t_normal_dX(j, I) =
1528 (FTensor::levi_civita(i, j, I) * t_tangent2(i)) * t_diff_base(N0) +
1529 (FTensor::levi_civita(I, j, k) * t_tangent1(k)) * t_diff_base(N1);
1530 t_nf(I) -= t_w * (t_val(i) * t_var_u_gamma(i)) *
1531 (t_da(i) * t_normal_dX(i, I));
1532 ++t_diff_base;
1533 ++t_nf;
1534 }
1535 for (; rr != nb_base_functions; ++rr)
1536 ++t_diff_base;
1537
1538 ++t_w;
1539 ++t_val;
1540 ++t_var_u_gamma;
1541 ++t_tangent1;
1542 ++t_tangent2;
1543 }
1544
1546 };
1547
1548 EntityHandle fe_ent = getFEEntityHandle();
1549 for (auto &bc : *(bcData)) {
1550 if (bc.faces.find(fe_ent) != bc.faces.end() && nb_dofs) {
1551 CHKERR integrate_rhs(bc);
1552 }
1553 }
1554
1556}
#define FTENSOR_INDEX(DIM, I)
constexpr double a
constexpr int SPACE_DIM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
static MatrixDouble getTopologicalAnalyticalExpr(OP_PTR op_ptr, const std::string &block_name)
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use
auto getFTensor1FromMat(M &data, int rr=0, int cc=0)
Get tensor rank 1 (vector) form data matrix.
constexpr IntegrationType I
auto getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorDouble & getFieldData() const
Get DOF values on entity.
VectorDouble nF
local right hand side vector

Member Data Documentation

◆ bcData

boost::shared_ptr<AnalyticalTractionBcVec> EshelbianPlasticity::OpBrokenAnalyticalTractionBc_dX::bcData
protected

Definition at line 318 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ lambdaHybridPtr

boost::shared_ptr<MatrixDouble> EshelbianPlasticity::OpBrokenAnalyticalTractionBc_dX::lambdaHybridPtr
protected

Definition at line 319 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ scalingMethodsMap

std::map<std::string, boost::shared_ptr<ScalingMethod> > EshelbianPlasticity::OpBrokenAnalyticalTractionBc_dX::scalingMethodsMap
protected

Definition at line 321 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ topoData

boost::shared_ptr<TopologicalData> EshelbianPlasticity::OpBrokenAnalyticalTractionBc_dX::topoData
protected

Definition at line 320 of file EshelbianTopologicalDerivativeOperators.cpp.


The documentation for this struct was generated from the following file: