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

Public Member Functions

 OpBrokenTractionBc_dX (std::string field_name, boost::shared_ptr< TractionBcVec > 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< TractionBcVecbcData
 
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 277 of file EshelbianTopologicalDerivativeOperators.cpp.

Constructor & Destructor Documentation

◆ OpBrokenTractionBc_dX()

EshelbianPlasticity::OpBrokenTractionBc_dX::OpBrokenTractionBc_dX ( std::string  field_name,
boost::shared_ptr< TractionBcVec 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::OpBrokenTractionBc_dX::integrate ( int  side,
EntityType  type,
EntData data 
)
override

Definition at line 1368 of file EshelbianTopologicalDerivativeOperators.cpp.

1369 {
1371 locJ = 0;
1372
1376
1377 int nb_dofs = data.getFieldData().size();
1378 int nb_integration_pts = getGaussPts().size2();
1379 int nb_base_functions = data.getN().size2();
1380
1381 double time = getFEMethod()->ts_t;
1384 }
1385
1386#ifndef NDEBUG
1387 if (this->nF.size() != nb_dofs)
1388 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1389 "Size of nF %ld != nb_dofs %d", this->nF.size(), nb_dofs);
1390#endif // NDEBUG
1391
1392 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
1394
1395 auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
1396 auto t_diff_base = data.getFTensor1DiffN<2>();
1397 auto t_w = getFTensor0IntegrationWeight();
1398 auto t_coords = getFTensor1CoordsAtGaussPts();
1399
1400 auto t_var_u_gamma = getFTensor1FromMat<SPACE_DIM>(lambdaHybridPtr);
1401 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1402 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1403
1404 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1405
1407 t_normal(j) =
1408 (FTensor::levi_civita(i, j, k) * t_tangent1(k)) * t_tangent2(i);
1409
1410 double a = sqrt(t_normal(i) * t_normal(i));
1412 t_da(i) = t_normal(i) / a;
1413 a /= 2.;
1414 t_da(i) /= 2.;
1415
1416 const auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
1417 locJ -= (time_scale * t_w * a * tau) * (t_val(i) * t_var_u_gamma(i));
1418
1419 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(nF);
1420 int rr = 0;
1421 for (; rr != nb_dofs / SPACE_DIM; ++rr) {
1423 t_normal_dX(j, I) =
1424 (FTensor::levi_civita(i, j, I) * t_tangent2(i)) * t_diff_base(N0) +
1425 (FTensor::levi_civita(I, j, k) * t_tangent1(k)) * t_diff_base(N1);
1426 t_nf(I) -= (time_scale * t_w * tau) * (t_val(i) * t_var_u_gamma(i)) *
1427 (t_da(i) * t_normal_dX(i, I));
1428 ++t_diff_base;
1429 ++t_nf;
1430 }
1431 for (; rr != nb_base_functions; ++rr)
1432 ++t_diff_base;
1433
1434 ++t_w;
1435 ++t_coords;
1436 ++t_var_u_gamma;
1437 ++t_tangent1;
1438 ++t_tangent2;
1439 }
1440
1442 };
1443
1444 // get entity of face
1445 EntityHandle fe_ent = getFEEntityHandle();
1446 for (auto &bc : *(bcData)) {
1447 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1448
1449 double time_scale = 1;
1450 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
1451 time_scale *= scalingMethodsMap.at(bc.blockName)->getScale(time);
1452 }
1453
1454 if (nb_dofs) {
1455 if (std::regex_match(bc.blockName, std::regex(".*COOK.*"))) {
1456 auto calc_tau = [](double, double y, double) {
1457 y -= 44;
1458 y /= (60 - 44);
1459 return -y * (y - 1) / 0.25;
1460 };
1461 CHKERR integrate_rhs(bc, calc_tau, time_scale);
1462 } else {
1463 CHKERR integrate_rhs(
1464 bc, [](double, double, double) { return 1; }, time_scale);
1465 }
1466 }
1467 }
1468 }
1470}
#define FTENSOR_INDEXES(DIM,...)
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
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
constexpr IntegrationType I
static PetscBool physicalTimeFlg
static double currentPhysicalTime
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<TractionBcVec> EshelbianPlasticity::OpBrokenTractionBc_dX::bcData
protected

Definition at line 294 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ lambdaHybridPtr

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

Definition at line 295 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ scalingMethodsMap

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

Definition at line 297 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ topoData

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

Definition at line 296 of file EshelbianTopologicalDerivativeOperators.cpp.


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