v0.16.0
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 &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< BcDispVecbcDispPtr
 
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 205 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 206 of file EshelbianTopologicalDerivativeOperators.cpp.

214 J_ptr, vec, tag),
215 brokenSideDataPtr(broken_side_data_ptr), bcDispPtr(bc_disp_ptr),
216 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 1189 of file EshelbianTopologicalDerivativeOperators.cpp.

1189 {
1191 locJ = 0;
1192
1193#ifndef NDEBUG
1194 if (!brokenSideDataPtr)
1195 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1196 "Broken side data pointer is null");
1197#endif // NDEBUG
1198
1199
1200 const int nb_dofs = data.getIndices().size();
1201 if (!nb_dofs)
1203
1204 const int nb_integration_pts = getGaussPts().size2();
1205 const int nb_base_functions = data.getN().size2();
1206
1207 if (data.getDiffN().size1() != nb_integration_pts)
1208 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1209 "Differential of base functions should have the same number of "
1210 "integration points as the data");
1211 if (data.getDiffN().size2() != nb_base_functions * 2)
1212 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1213 "Differential of base functions should have the same number of "
1214 "base functions as the data");
1215
1216 double time = getFEMethod()->ts_t;
1219
1221
1224
1225 const EntityHandle fe_ent = getFEEntityHandle();
1226 for (auto &bc : *bcDispPtr) {
1227 if (bc.faces.find(fe_ent) == bc.faces.end())
1228 continue;
1229
1230 double scale = 1;
1231 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
1232 scale *= scalingMethodsMap.at(bc.blockName)->getScale(time);
1233 } else {
1234 MOFEM_LOG("SELF", Sev::warning)
1235 << "No scaling method found for " << bc.blockName;
1236 }
1237
1238 FTensor::Tensor1<double, SPACE_DIM> t_bc_disp(bc.vals[0], bc.vals[1],
1239 bc.vals[2]);
1240 t_bc_disp(i) *= scale;
1241
1242 for (auto &bd : *brokenSideDataPtr) {
1243 auto t_w = getFTensor0IntegrationWeight();
1244 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1245 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1246 auto t_var_flux =
1247 getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(bd.getVarFlux());
1248 auto t_diff_base = data.getFTensor1DiffN<2>();
1249
1250 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1251 const double a = 0.5 * bd.getSense() * t_w;
1252
1254 t_normal(j) =
1255 (FTensor::levi_civita(i, j, k) * t_tangent1(k)) * t_tangent2(i);
1256
1257 locJ += a * t_bc_disp(i) * (t_var_flux(i, j) * t_normal(j));
1258
1259 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(nF);
1260 int bb = 0;
1261 for (; bb != nb_dofs / SPACE_DIM; ++bb) {
1262 // The H(div) contravariant Piola trace P . n dA is invariant with
1263 // respect to material-position perturbations. The normal variation is
1264 // cancelled by the Piola variation of the flux, so this BC contributes
1265 // to locJ but not to the exact dX vector.
1266 ++t_nf;
1267 ++t_diff_base;
1268 }
1269 for (; bb != nb_base_functions; ++bb)
1270 ++t_diff_base;
1271
1272 ++t_w;
1273 ++t_tangent1;
1274 ++t_tangent2;
1275 ++t_var_flux;
1276 }
1277 }
1278
1279 }
1280
1281
1283}
#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
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
double scale
Definition plastic.cpp:124

Member Data Documentation

◆ bcDispPtr

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

Definition at line 222 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ brokenSideDataPtr

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

Definition at line 221 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ scalingMethodsMap

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

Definition at line 223 of file EshelbianTopologicalDerivativeOperators.cpp.


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