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 &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)
 

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 1285 of file EshelbianTopologicalDerivativeOperators.cpp.

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