1086 {
1088
1089 if (row_type != MBVERTEX || col_type != MBVERTEX)
1091
1095
1097 a_auxFun.referenceCoords.resize(9,
false);
1098 a_auxFun.currentCoords.resize(9,
false);
1099
1103 for (
int dd = 0;
dd != 9;
dd++) {
1104 double val = getCoords()[
dd];
1107 }
1108 for (
int dd = 0;
dd != 9;
dd++) {
1109 double val = row_data.getFieldData()[
dd];
1112 }
1113
1114 CHKERR a_auxFun.calculateGriffithForce(1, getGaussPts()(2, 0) * 0.5,
1115 row_data.getDiffN(0));
1116
1117
1119 for (int nn = 0; nn != 3; nn++) {
1120 if (col_data.getIndices()[nn] == -1)
1121 continue;
1124 "data inconsistency");
1125 }
1126 for (
int dd = 0;
dd != 3;
dd++) {
1127 int idx = 3 * nn +
dd;
1128 if (row_data.getFieldDofs()[idx]->getEnt() !=
1129 col_data.getFieldDofs()[nn]->getEnt()) {
1131 "data inconsistency");
1132 }
1136 }
1137 }
1138 for (int nn = 0; nn != 3; nn++) {
1140 }
1141 trace_off();
1142
1145 for (int nn = 0; nn != 3; nn++) {
1147 }
1148
1149 {
1151
1153 if (r < 3) {
1155 "ADOL-C function evaluation with error r = %d", r);
1156 }
1157 }
1158
1159 const double *
delta;
1160 Vec delta_vec_local;
1162 int vec_size;
1163 CHKERR VecGetSize(delta_vec_local, &vec_size);
1165 nG_dX.resize(3, 9,
false);
1167 for (int nn = 0; nn != 3; ++nn) {
1168 int local_idx = col_data.getLocalIndices()[nn];
1171 "data inconsistency");
1172 }
1173 if (local_idx == -1)
1174 continue;
1175 if (vec_size < local_idx) {
1176 int g_vec_size;
1179 "data inconsistency %d < %d (%d)", vec_size, local_idx,
1180 g_vec_size);
1181 }
1184 for (
int dd = 0;
dd != 9;
dd++) {
1186 nG_dX(nn, dd) = diff_constrain * diffW;
1187 }
1188 }
1189 CHKERR VecRestoreArrayRead(delta_vec_local, &
delta);
1192 &*col_data.getIndices().data().begin(), 9,
1193 &*row_data.getIndices().data().begin(),
1194 &*
nG_dX.data().begin(), ADD_VALUES);
1195
1196
1197
1198
1200 d_dA.resize(9,
false);
1201 a_dA.resize(9,
false);
1203 a_auxFun.referenceCoords.resize(9,
false);
1204
1206 for (
int dd = 0;
dd != 9;
dd++) {
1207 double val = getCoords()[
dd];
1210 }
1211 for (
int dd = 0;
dd != 9;
dd++) {
1212 double val = row_data.getFieldData()[
dd];
1215 }
1216 for (int nn = 0; nn != 3; nn++) {
1217 double val = col_data.getFieldData()[nn];
1220 }
1221
1222 CHKERR a_auxFun.calculateGriffithForce(1, getGaussPts()(2, 0) * 0.5,
1223 row_data.getDiffN(0));
1224
1225 std::fill(
a_dA.begin(),
a_dA.end(), 0);
1226 for (int nn = 0; nn != 3; nn++) {
1227 if (col_data.getIndices()[nn] == -1)
1228 continue;
1229 for (
int dd = 0;
dd != 3;
dd++) {
1230 int idx = 3 * nn +
dd;
1232 }
1233 }
1234 for (
int dd = 0;
dd != 9;
dd++) {
1236 }
1237 trace_off();
1238
1241 for (
int dd = 0;
dd != 9; ++
dd) {
1244 }
1245
1246 {
1248
1251 if (r < 3) {
1253 "ADOL-C function evaluation with error r = %d", r);
1254 }
1255 }
1256
1258 for (int rr = 0; rr != 9; rr++) {
1259 for (int cc = 0; cc != 3; cc++) {
1261 }
1262 }
1264 3, &*col_data.getIndices().data().begin(),
1266
1267 nF_dX.resize(9, 9,
false);
1268 for (int rr = 0; rr != 9; rr++) {
1269 for (int cc = 0; cc != 9; cc++) {
1271 }
1272 }
1274 9, &*row_data.getIndices().data().begin(),
1275 &*
nF_dX.data().begin(), ADD_VALUES);
1276
1278 }
#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_OPERATION_UNSUCCESSFUL
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
const FTensor::Tensor2< T, Dim, Dim > Vec
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
static double diffCalMax_a(double a, double b, double r)
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
static constexpr double delta
MoFEMErrorCode setLambdaNodes(FaceElementForcesAndSourcesCore::UserDataOperator *fe_ptr, const std::string &lambda_field_name)
ublas::vector< int > rowIndices
MoFEMErrorCode setLambdaIndices(FaceElementForcesAndSourcesCore::UserDataOperator *fe_ptr, const std::string &lambda_field_name)
VectorInt3 rowLambdaIndices
VectorInt3 rowLambdaIndicesLocal
VectorDouble activeVariables
MoFEMErrorCode setIndices(DataForcesAndSourcesCore::EntData &data)
double r
regularity parameter
vector< double * > tangentGriffithForceRowPtr
Pointers to rows of tangent matrix.
MatrixDouble tangentGriffithForce
Tangent matrix.
ublas::vector< adouble > a_dA
ublas::vector< adouble > a_Delta
AuxFunctions< adouble > a_auxFun
ublas::vector< adouble > a_lambdaAtNodes
ublas::vector< double * > jacDeltaPtr