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

Public Member Functions

 OpAnalyticalDispBc_dX (const std::string &field_name, boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_side_data_ptr, boost::shared_ptr< AnalyticalDisplacementBcVec > bc_disp_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv, boost::shared_ptr< TopologicalData > topo_ptr, 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 &)
 
virtual MoFEMErrorCode integrate (int, EntityType, EntData &data)
 
virtual MoFEMErrorCode integrate (EntData &, EntData &)
 
virtual MoFEMErrorCode assemble (EntData &data)
 
virtual MoFEMErrorCode assemble (int, EntityType, EntData &data)
 
virtual MoFEMErrorCode assemble (int, int, EntityType, EntityType, 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)
 

Private Attributes

boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenSideDataPtr
 
boost::shared_ptr< AnalyticalDisplacementBcVecbcDispPtr
 
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
 

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
 
- Protected Attributes inherited from EshelbianPlasticity::OpAssembleTopologicalObjectiveDerivativeImplBase< OpAssembleFace >
double locJ
 
boost::shared_ptr< doubleJPtr
 
SmartPetscObj< Vec > assembleVec
 
Tag topoTag
 
boost::shared_ptr< TopologicalDatatopoData
 

Detailed Description

Definition at line 256 of file EshelbianTopologicalDerivativeOperators.cpp.

Constructor & Destructor Documentation

◆ OpAnalyticalDispBc_dX()

EshelbianPlasticity::OpAnalyticalDispBc_dX::OpAnalyticalDispBc_dX ( const std::string &  field_name,
boost::shared_ptr< std::vector< BrokenBaseSideData > >  broken_side_data_ptr,
boost::shared_ptr< AnalyticalDisplacementBcVec bc_disp_ptr,
std::map< std::string, boost::shared_ptr< ScalingMethod > >  smv,
boost::shared_ptr< TopologicalData topo_ptr,
SmartPetscObj< Vec >  vec,
boost::shared_ptr< double J_ptr = nullptr,
Tag  tag = Tag() 
)
inline

Definition at line 257 of file EshelbianTopologicalDerivativeOperators.cpp.

265 J_ptr, vec, tag),
266 brokenSideDataPtr(broken_side_data_ptr), bcDispPtr(bc_disp_ptr),
267 scalingMethodsMap(smv) {}
constexpr auto field_name
boost::shared_ptr< AnalyticalDisplacementBcVec > bcDispPtr
boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenSideDataPtr
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap

Member Function Documentation

◆ integrate()

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

Definition at line 1289 of file EshelbianTopologicalDerivativeOperators.cpp.

1290 {
1292 locJ = 0;
1293
1294#ifndef NDEBUG
1295 if (!brokenSideDataPtr)
1296 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1297 "Broken side data pointer is null");
1298#endif // NDEBUG
1299
1300 const int nb_dofs = data.getIndices().size();
1301 if (!nb_dofs)
1303
1304 const int nb_integration_pts = getGaussPts().size2();
1305 const int nb_base_functions = data.getN().size2();
1306
1307 if (data.getDiffN().size1() != nb_integration_pts)
1308 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1309 "Differential of base functions should have the same number of "
1310 "integration points as the data");
1311 if (data.getDiffN().size2() != nb_base_functions * 2)
1312 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1313 "Differential of base functions should have the same number of "
1314 "base functions as the data");
1315
1319
1320 const EntityHandle fe_ent = getFEEntityHandle();
1321 for (auto &bc : *bcDispPtr) {
1322 if (bc.faces.find(fe_ent) == bc.faces.end())
1323 continue;
1324
1325 auto v_analytical_expr =
1326 getTopologicalAnalyticalExpr(this, bc.blockName);
1327
1328 for (auto &bd : *brokenSideDataPtr) {
1329 auto t_w = getFTensor0IntegrationWeight();
1330 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1331 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1332 auto t_var_flux =
1333 getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(bd.getVarFlux());
1334 auto t_diff_base = data.getFTensor1DiffN<2>();
1335 auto t_bc_disp =
1336 getFTensor1FromMat<SPACE_DIM, -1, DL>(v_analytical_expr);
1337
1338 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1339 const double a = 0.5 * bd.getSense() * t_w;
1340
1342 t_normal(j) =
1343 (FTensor::levi_civita(i, j, k) * t_tangent1(k)) * t_tangent2(i);
1344
1345 locJ += a * t_bc_disp(i) * (t_var_flux(i, j) * t_normal(j));
1346
1347 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(nF);
1348 int bb = 0;
1349 for (; bb != nb_dofs / SPACE_DIM; ++bb) {
1350 // The H(div) contravariant Piola trace P . n dA is invariant with
1351 // respect to material-position perturbations. The normal variation is
1352 // cancelled by the Piola variation of the flux, so this BC contributes
1353 // to locJ but not to the exact dX vector.
1354 ++t_nf;
1355 ++t_diff_base;
1356 }
1357 for (; bb != nb_base_functions; ++bb)
1358 ++t_diff_base;
1359
1360 ++t_w;
1361 ++t_tangent1;
1362 ++t_tangent2;
1363 ++t_var_flux;
1364 ++t_bc_disp;
1365 }
1366 }
1367 }
1368
1370}
#define FTENSOR_INDEX(DIM, I)
constexpr double a
constexpr int SPACE_DIM
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#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()
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.
MatrixDouble & getDiffN(const FieldApproximationBase base)
get derivatives of base functions
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 VectorInt & getIndices() const
Get global indices of degrees of freedom on entity.
VectorDouble nF
local right hand side vector

Member Data Documentation

◆ bcDispPtr

boost::shared_ptr<AnalyticalDisplacementBcVec> EshelbianPlasticity::OpAnalyticalDispBc_dX::bcDispPtr
private

Definition at line 273 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ brokenSideDataPtr

boost::shared_ptr<std::vector<BrokenBaseSideData> > EshelbianPlasticity::OpAnalyticalDispBc_dX::brokenSideDataPtr
private

Definition at line 272 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ scalingMethodsMap

std::map<std::string, boost::shared_ptr<ScalingMethod> > EshelbianPlasticity::OpAnalyticalDispBc_dX::scalingMethodsMap
private

Definition at line 274 of file EshelbianTopologicalDerivativeOperators.cpp.


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