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

Public Member Functions

 OpDispBc_dX (const std::string &field_name, boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_side_data_ptr, boost::shared_ptr< BcDispVec > 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, 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< BcDispVec > bcDispPtr
 
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< DataAtIntegrationPts > dataAtPts
 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< double > JPtr
 
SmartPetscObj< Vec > assembleVec
 
Tag topoTag
 
boost::shared_ptr< TopologicalData > topoData
 

Detailed Description

Definition at line 201 of file EshelbianTopologicalDerivativeOperators.cpp.

Constructor & Destructor Documentation

◆ OpDispBc_dX()

EshelbianPlasticity::OpDispBc_dX::OpDispBc_dX ( const std::string &  field_name,
boost::shared_ptr< std::vector< BrokenBaseSideData > >  broken_side_data_ptr,
boost::shared_ptr< BcDispVec >  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 202 of file EshelbianTopologicalDerivativeOperators.cpp.

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

Member Function Documentation

◆ integrate()

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

Definition at line 1154 of file EshelbianTopologicalDerivativeOperators.cpp.

1154 {
1156 locJ = 0;
1157
1158#ifndef NDEBUG
1159 if (!brokenSideDataPtr)
1160 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1161 "Broken side data pointer is null");
1162#endif // NDEBUG
1163
1164 const int nb_dofs = data.getIndices().size();
1165 if (!nb_dofs)
1167
1168 const int nb_integration_pts = getGaussPts().size2();
1169 const int nb_base_functions = data.getN().size2();
1170
1171#ifndef NDEBUG
1172 if (data.getDiffN().size1() != nb_integration_pts)
1173 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1174 "Differential of base functions should have the same number of "
1175 "integration points as the data");
1176 if (data.getDiffN().size2() != nb_base_functions * 2)
1177 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1178 "Differential of base functions should have the same number of "
1179 "base functions as the data");
1180#endif // NDEBUG
1181
1182 double time = getFEMethod()->ts_t;
1185
1187
1190
1191 const EntityHandle fe_ent = getFEEntityHandle();
1192 for (auto &bc : *bcDispPtr) {
1193 if (bc.faces.find(fe_ent) == bc.faces.end())
1194 continue;
1195
1196 double scale = 1;
1197 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
1198 scale *= scalingMethodsMap.at(bc.blockName)->getScale(time);
1199 } else {
1200 MOFEM_LOG("SELF", Sev::warning)
1201 << "No scaling method found for " << bc.blockName;
1202 }
1203
1204 FTensor::Tensor1<double, SPACE_DIM> t_bc_disp(bc.vals[0], bc.vals[1],
1205 bc.vals[2]);
1206 t_bc_disp(i) *= scale;
1207
1208 for (auto &bd : *brokenSideDataPtr) {
1209 auto t_w = getFTensor0IntegrationWeight();
1210 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1211 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1212 auto t_var_flux =
1213 getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(bd.getVarFlux());
1214 auto t_diff_base = data.getFTensor1DiffN<2>();
1215
1216 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1217 const double a = 0.5 * bd.getSense() * t_w;
1218
1220 t_normal(j) =
1221 (FTensor::levi_civita(i, j, k) * t_tangent1(k)) * t_tangent2(i);
1222
1223 locJ += a * t_bc_disp(i) * (t_var_flux(i, j) * t_normal(j));
1224
1225 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(nF);
1226 int bb = 0;
1227 for (; bb != nb_dofs / SPACE_DIM; ++bb) {
1228 // The H(div) contravariant Piola trace P . n dA is invariant with
1229 // respect to material-position perturbations. The normal variation is
1230 // cancelled by the Piola variation of the flux, so this BC
1231 // contributes to locJ but not to the exact dX vector.
1232 ++t_nf;
1233 ++t_diff_base;
1234 }
1235 for (; bb != nb_base_functions; ++bb)
1236 ++t_diff_base;
1237
1238 ++t_w;
1239 ++t_tangent1;
1240 ++t_tangent2;
1241 ++t_var_flux;
1242 }
1243 }
1244 }
1245
1247}
boost::shared_ptr< DataAtIntegrationPts > data
#define FTENSOR_INDEXES(DIM,...)
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()
#define MOFEM_LOG(channel, severity)
Log.
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
VectorDouble nF
local right hand side vector
double scale
Definition plastic.cpp:124

Member Data Documentation

◆ bcDispPtr

boost::shared_ptr<BcDispVec> EshelbianPlasticity::OpDispBc_dX::bcDispPtr
private

Definition at line 218 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ brokenSideDataPtr

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

Definition at line 217 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ scalingMethodsMap

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

Definition at line 219 of file EshelbianTopologicalDerivativeOperators.cpp.


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