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

Public Member Functions

 OpTauStabilisation_dX (const std::string &field_name, boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_disp_data_ptr, boost::shared_ptr< MatrixDouble > hybrid_disp_ptr, boost::shared_ptr< MatrixDouble > var_hybrid_disp_ptr, boost::shared_ptr< TopologicalData > topo_ptr, const double alpha_tau, 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 > > brokenDispDataPtr
 
boost::shared_ptr< MatrixDouble > hybridDispPtr
 
boost::shared_ptr< MatrixDouble > varHybridDispPtr
 
double alphaTau
 

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

Constructor & Destructor Documentation

◆ OpTauStabilisation_dX()

EshelbianPlasticity::OpTauStabilisation_dX::OpTauStabilisation_dX ( const std::string &  field_name,
boost::shared_ptr< std::vector< BrokenBaseSideData > >  broken_disp_data_ptr,
boost::shared_ptr< MatrixDouble >  hybrid_disp_ptr,
boost::shared_ptr< MatrixDouble >  var_hybrid_disp_ptr,
boost::shared_ptr< TopologicalData topo_ptr,
const double  alpha_tau,
SmartPetscObj< Vec >  vec,
boost::shared_ptr< double J_ptr = nullptr,
Tag  tag = Tag() 
)
inline

Member Function Documentation

◆ integrate()

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

Definition at line 1069 of file EshelbianTopologicalDerivativeOperators.cpp.

1070 {
1072 locJ = 0;
1073
1074#ifndef NDEBUG
1075 if (!topoData)
1076 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1077 "Topological data pointer is null");
1078 if (!brokenDispDataPtr)
1079 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1080 "Broken displacement data pointer is null");
1081 if (!hybridDispPtr)
1082 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1083 "Hybrid displacement pointer is null");
1084 if (!varHybridDispPtr)
1085 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1086 "Adjoint hybrid displacement pointer is null");
1087#endif // NDEBUG
1088
1089 const int nb_dofs = data.getIndices().size();
1090 if (!nb_dofs)
1092
1093 const int nb_integration_pts = getGaussPts().size2();
1094 const int nb_base_functions = data.getN().size2();
1095
1096#ifndef NDEBUG
1097 if (this->nF.size() != nb_dofs)
1098 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1099 "Size of nF %ld != nb_dofs %d", this->nF.size(), nb_dofs);
1100 if (data.getDiffN().size1() != nb_integration_pts)
1101 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1102 "Differential of base functions should have the same number of "
1103 "integration points as the data");
1104 if (data.getDiffN().size2() != nb_base_functions * 2)
1105 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1106 "Differential of base functions should have the same number of "
1107 "base functions as the data");
1108#endif // NDEBUG
1109
1113
1114 auto &coords = getCoords();
1115 // Tau scale is based on the mesh triangle coordinates, not on the perturbed
1116 // material-position field. Treat h as constant with respect to X.
1117 const double h = std::get<2>(Tools::getTricircumcenter3d(coords.data().data()));
1118
1119 auto t_w = getFTensor0IntegrationWeight();
1120 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1121 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1122 auto t_u_hybrid = getFTensor1FromMat<SPACE_DIM, -1, DL>(*hybridDispPtr);
1123 auto t_var_u_hybrid =
1124 getFTensor1FromMat<SPACE_DIM, -1, DL>(*varHybridDispPtr);
1125 auto t_diff_base = data.getFTensor1DiffN<2>();
1126
1127 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1129 t_normal(j) =
1130 (FTensor::levi_civita(i, j, k) * t_tangent1(k)) * t_tangent2(i);
1131
1132 double area = std::sqrt(t_normal(i) * t_normal(i));
1134 t_da(i) = t_normal(i) / area;
1135 area /= 2.;
1136 t_da(i) /= 2.;
1137
1138 double tau_density = 0;
1139 for (auto &bd : *brokenDispDataPtr) {
1140 auto t_u_broken =
1141 getFTensor1FromMat<SPACE_DIM, -1, DL>(bd.getFlux(), nb_integration_pts);
1142 auto t_var_u_broken = getFTensor1FromMat<SPACE_DIM, -1, DL>(
1143 bd.getVarFlux(), nb_integration_pts);
1144 for (int ss = 0; ss != gg; ++ss) {
1145 ++t_u_broken;
1146 ++t_var_u_broken;
1147 }
1148
1149 // This is the adjoint-weighted material derivative of the four tau
1150 // stabilisation residual blocks:
1151 // u_gamma-u_gamma, L2-L2, u_gamma-L2, and L2-u_gamma.
1152 const double hybrid_hybrid = t_var_u_hybrid(i) * t_u_hybrid(i);
1153 const double broken_broken = t_var_u_broken(i) * t_u_broken(i);
1154 const double hybrid_broken = -t_var_u_hybrid(i) * t_u_broken(i);
1155 const double broken_hybrid = -t_var_u_broken(i) * t_u_hybrid(i);
1156 tau_density +=
1157 hybrid_hybrid + broken_broken + hybrid_broken + broken_hybrid;
1158 }
1159
1160 const double tau = alphaTau / h;
1161 locJ += t_w * tau * area * tau_density;
1162
1163 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(nF);
1164 int rr = 0;
1165 for (; rr != nb_dofs / SPACE_DIM; ++rr) {
1167 t_normal_dX(j, I) =
1168 (FTensor::levi_civita(i, j, I) * t_tangent2(i)) * t_diff_base(N0) +
1169 (FTensor::levi_civita(I, j, k) * t_tangent1(k)) * t_diff_base(N1);
1170
1171 t_nf(I) +=
1172 t_w * alphaTau * tau_density * (t_da(i) * t_normal_dX(i, I)) / h;
1173 ++t_diff_base;
1174 ++t_nf;
1175 }
1176 for (; rr != nb_base_functions; ++rr)
1177 ++t_diff_base;
1178
1179 ++t_w;
1180 ++t_tangent1;
1181 ++t_tangent2;
1182 ++t_u_hybrid;
1183 ++t_var_u_hybrid;
1184 }
1185
1187}
#define FTENSOR_INDEXES(DIM,...)
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
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.
constexpr IntegrationType I
double h
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

◆ alphaTau

double EshelbianPlasticity::OpTauStabilisation_dX::alphaTau
private

Definition at line 202 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ brokenDispDataPtr

boost::shared_ptr<std::vector<BrokenBaseSideData> > EshelbianPlasticity::OpTauStabilisation_dX::brokenDispDataPtr
private

Definition at line 199 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ hybridDispPtr

boost::shared_ptr<MatrixDouble> EshelbianPlasticity::OpTauStabilisation_dX::hybridDispPtr
private

Definition at line 200 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ varHybridDispPtr

boost::shared_ptr<MatrixDouble> EshelbianPlasticity::OpTauStabilisation_dX::varHybridDispPtr
private

Definition at line 201 of file EshelbianTopologicalDerivativeOperators.cpp.


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