OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
graddpelement.C
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## #### #### ## # ##
6  * ## ## ## ## ## ## ## ##
7  * ## ## ## ## ## ## ## ##
8  * ##### ##### ## ###### ## ##
9  *
10  *
11  * OOFEM : Object Oriented Finite Element Code
12  *
13  *
14  * Copyright (C) 1993 - 2013 Borek Patzak
15  *
16  *
17  *
18  * Czech Technical University, Faculty of Civil Engineering,
19  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
20  *
21  * This library is free software; you can redistribute it and/or
22  * modify it under the terms of the GNU Lesser General Public
23  * License as published by the Free Software Foundation; either
24  * version 2.1 of the License, or (at your option) any later version.
25  *
26  * This program is distributed in the hope that it will be useful,
27  * but WITHOUT ANY WARRANTY; without even the implied warranty of
28  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29  * Lesser General Public License for more details.
30  *
31  * You should have received a copy of the GNU Lesser General Public
32  * License along with this library; if not, write to the Free Software
33  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
34  */
35 
36 
37 #include "../sm/Elements/graddpelement.h"
38 #include "../sm/Materials/structuralms.h"
39 #include "../sm/CrossSections/structuralcrosssection.h"
40 #include "../sm/Elements/nlstructuralelement.h"
41 #include "../sm/Materials/graddpmaterialextensioninterface.h"
42 #include "node.h"
43 #include "material.h"
44 #include "gausspoint.h"
45 #include "gaussintegrationrule.h"
46 #include "floatmatrix.h"
47 #include "floatarray.h"
48 #include "intarray.h"
49 #include "domain.h"
50 #include "cltypes.h"
51 #include "mathfem.h"
52 #include "nonlocalbarrier.h"
53 #include "engngm.h"
54 
55 #include <cstdio>
56 
57 namespace oofem {
59 { }
60 
61 void
63 {
65 
66  for ( int i = 1; i <= totalSize; i++ ) {
67  if ( i < nSecNodes * nPrimVars + 1 ) {
68  locU.at(i) = i + ( int ) ( ( ( i - 1 ) / nPrimVars ) ) * nSecVars;
69  } else if ( i > nSecNodes * ( nPrimVars + nSecVars ) ) {
70  locU.at(i - nSecVars * nSecNodes) = i;
71  }
72  }
73 }
74 
75 void
77 {
79  for ( int i = 1; i <= nlSize; i++ ) {
80  locK.at(i) = i * nPrimVars + i;
81  }
82 }
83 
84 
85 void
87 {
88  this->giveStructuralElement()->computeVectorOf({D_u, D_v, D_w}, VM_Total, tStep, answer);
89 }
90 
92 {
93  this->giveStructuralElement()->computeVectorOf({G_0}, VM_Total, tStep, answer);
94 }
95 
96 void
98 {
100 
101  double nlCumulatedStrain;
102 
103  int nlGeo = elem->giveGeometryMode();
107 
108  if ( !dpmat ) {
109  OOFEM_ERROR("Material doesn't implement the required DpGrad interface!");
110  }
111 
112  this->computeNonlocalCumulatedStrain(nlCumulatedStrain, gp, tStep);
113  if ( nlGeo == 0 ) {
114  FloatArray Epsilon;
115  this->computeLocalStrainVector(Epsilon, gp, tStep);
116  dpmat->giveRealStressVectorGrad(answer, localCumulatedStrain, gp, Epsilon, nlCumulatedStrain, tStep);
117  } else if ( nlGeo == 1 ) {
118  if ( elem->giveDomain()->giveEngngModel()->giveFormulation() == TL ) {
119  FloatArray vF;
120  this->computeDeformationGradientVector(vF, gp, tStep);
121  dpmat->giveFirstPKStressVectorGrad(answer, localCumulatedStrain, gp, vF, nlCumulatedStrain, tStep);
122  } else {
123  FloatArray vF;
124  this->computeDeformationGradientVector(vF, gp, tStep);
125  dpmat->giveCauchyStressVectorGrad(answer, localCumulatedStrain, gp, vF, nlCumulatedStrain, tStep);
126  }
127  }
128 }
129 
130 
131 void
133 {
134  FloatArray u;
135  FloatMatrix b;
137 
138  this->computeDisplacementDegreesOfFreedom(u, tStep);
139  elem->computeBmatrixAt(gp, b);
140  answer.beProductOf(b, u);
141 }
142 
143 void
145 {
146  // Computes the deformation gradient in the Voigt format at the Gauss point gp of
147  // the receiver at time step tStep.
148  // Order of components: 11, 22, 33, 23, 13, 12, 32, 31, 21 in the 3D.
149 
150  // Obtain the current displacement vector of the element and subtract initial displacements (if present)
151  FloatArray u;
152  FloatMatrix B;
154 
155  this->computeDisplacementDegreesOfFreedom(u, tStep);
156  // Displacement gradient H = du/dX
157  elem->computeBHmatrixAt(gp, B);
158  answer.beProductOf(B, u);
159 
160  // Deformation gradient F = H + I
161  MaterialMode matMode = gp->giveMaterialMode();
162  if ( matMode == _3dMat || matMode == _PlaneStrain ) {
163  answer.at(1) += 1.0;
164  answer.at(2) += 1.0;
165  answer.at(3) += 1.0;
166  } else if ( matMode == _PlaneStress ) {
167  answer.at(1) += 1.0;
168  answer.at(2) += 1.0;
169  } else if ( matMode == _1dMat ) {
170  answer.at(1) += 1.0;
171  } else {
172  OOFEM_ERROR( "MaterialMode is not supported yet (%s)", __MaterialModeToString(matMode) );
173  }
174 }
175 
176 void
178 {
179  FloatArray Nk, u;
180 
181  this->computeNkappaMatrixAt(gp, Nk);
182  this->computeNonlocalDegreesOfFreedom(u, tStep);
183  answer = Nk.dotProduct(u);
184 }
185 
186 
187 void
189 {
190  FloatMatrix Bk;
191  FloatArray u;
192 
193  this->computeBkappaMatrixAt(gp, Bk);
194  this->computeNonlocalDegreesOfFreedom(u, tStep);
195  answer.beProductOf(Bk, u);
196 }
197 
198 
199 void
201 {
202  double localCumulatedStrain = 0.;
204  FloatMatrix stiffKappa;
205  FloatArray Nk;
206  FloatArray aux, dKappa, stress;
207 
208  int size = nSecVars * nSecNodes;
209 
210  //set displacement and nonlocal location array
212  this->setNonlocalLocationArray();
213 
214  answer.resize(size);
215  for ( GaussPoint *gp: *elem->giveIntegrationRule(0) ) {
216  this->computeNkappaMatrixAt(gp, Nk);
217 
218  double dV = elem->computeVolumeAround(gp);
219  this->computeStressVectorAndLocalCumulatedStrain(stress, localCumulatedStrain, gp, tStep);
220  aux.add(-dV * localCumulatedStrain, Nk);
221  }
222 
223  this->computeStiffnessMatrix_kk(stiffKappa, TangentStiffness, tStep);
224  this->computeNonlocalDegreesOfFreedom(dKappa, tStep);
225  answer.beProductOf(stiffKappa, dKappa);
226  answer.add(aux);
227 }
228 
229 
230 void
232 {
234  int nlGeo = elem->giveGeometryMode();
235  FloatArray BS, vStress;
236  FloatMatrix B;
237  for ( GaussPoint *gp: *elem->giveIntegrationRule(0) ) {
238 
239  if ( nlGeo == 0 || elem->domain->giveEngngModel()->giveFormulation() == AL ) {
240  elem->computeBmatrixAt(gp, B);
241  } else if ( nlGeo == 1 ) {
242  elem->computeBHmatrixAt(gp, B);
243  }
244  vStress = static_cast< StructuralMaterialStatus * >( gp->giveMaterialStatus() )->giveTempStressVector();
245 
246  if ( vStress.giveSize() == 0 ) {
247  break;
248  }
249 
250  // Compute nodal internal forces at nodes as f = B^T*Stress dV
251  double dV = elem->computeVolumeAround(gp);
252  BS.beTProductOf(B, vStress);
253  answer.add(dV, BS);
254  }
255 }
256 
257 #if 0
258 void
259 GradDpElement :: giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord)
260 {
263  FloatArray answerU, answerK;
264 
265  double localCumulatedStrain = 0.;
266  FloatMatrix stiffKappa, B;
267  FloatArray Nk, aux, dKappa, stress;
268  FloatMatrix lStiff;
269  FloatMatrix Bk;
270  FloatArray gKappa, L_gKappa;
271 
272  //set displacement and nonlocal location array
274  this->setNonlocalLocationArray();
275 
276  this->computeNonlocalDegreesOfFreedom(dKappa, tStep);
277 
278  int nlGeo = elem->giveGeometryMode();
279  for ( auto &gp: *elem->giveIntegrationRule(0) ) {
282  if ( !dpmat ) {
283  OOFEM_ERROR("Material doesn't implement the required DpGrad interface!");
284  }
285 
286  double dV = elem->computeVolumeAround(gp);
287 
288  if ( nlGeo == 0 || elem->domain->giveEngngModel()->giveFormulation() == AL ) {
289  elem->computeBmatrixAt(gp, B);
290  } else if ( nlGeo == 1 ) {
291  elem->computeBHmatrixAt(gp, B);
292  }
293  this->computeStressVectorAndLocalCumulatedStrain(stress, localCumulatedStrain, gp, tStep);
294 
295  answerU.plusProduct(B, stress, dV);
296 
297  // Gradient part:
298  this->computeNkappaMatrixAt(gp, Nk);
299  this->computeBkappaMatrixAt(gp, Bk);
300 
301  dpmat->givePDGradMatrix_kk(lStiff, TangentStiffness, gp, tStep);
302  double kappa = Nk.dotProduct(dKappa);
303  gKappa.beProductOf(Bk, dKappa);
304 
305  answerK.add(-dV * localCumulatedStrain, Nk);
306  answerK.add(kappa * dV, Nk);
307 
308  if ( dpmat->giveAveragingType() == 0 || dpmat->giveAveragingType() == 1 ) {
309  double l = lStiff.at(1, 1);
310  answerK.plusProduct(Bk, gKappa, l * l * dV);
311  } else if ( dpmat->giveAveragingType() == 2 ) {
312  L_gKappa.beProductOf(lStiff, gKappa);
313  answerK.plusProduct(Bk, L_gKappa, dV);
314  }
315  }
316 
317  //this->computeStiffnessMatrix_kk(stiffKappa, TangentStiffness, tStep);
318  //answerK.beProductOf(stiffKappa, dKappa);
319  answerK.add(aux);
320 
321  answer.resize(totalSize);
322  answer.zero();
323  answer.assemble(answerU, locU);
324  answer.assemble(answerK, locK);
325 }
326 #else
327 void
328 GradDpElement :: giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord)
329 {
330  answer.resize(totalSize);
331  answer.zero();
332  FloatArray answerU;
333  answerU.resize(locSize);
334  answer.zero();
335  FloatArray answerK(nlSize);
336  answerK.zero();
337 
340  this->giveNonlocalInternalForcesVector(answerK, tStep, useUpdatedGpRecord);
341  this->giveLocalInternalForcesVector(answerU, tStep, useUpdatedGpRecord);
342 
343 
344  answer.assemble(answerU, locU);
345  answer.assemble(answerK, locK);
346 }
347 #endif
348 
349 /************************************************************************/
350 
351 #if 0
352 void
354 {
355  //set displacement and nonlocal location array
357  this->setNonlocalLocationArray();
358 
361  FloatMatrix B, D, DB;
362  FloatMatrix DkuB, Dku;
363  FloatArray Nk;
364  FloatMatrix SNk, gPSigma;
365  FloatMatrix lStiff;
366  FloatMatrix Bk, LBk;
367  FloatMatrix answer_uu, answer_ku, answer_uk, answer_kk;
368 
369  int nlGeo = elem->giveGeometryMode();
370  bool matStiffSymmFlag = elem->giveCrossSection()->isCharacteristicMtrxSymmetric(rMode);
371 
372  for ( auto &gp : *elem->giveIntegrationRule(0) ) {
375  if ( !dpmat ) {
376  OOFEM_ERROR("Material doesn't implement the required DpGrad interface!");
377  }
378 
379  double dV = elem->computeVolumeAround(gp);
380 
381  if ( nlGeo == 0 ) {
382  elem->computeBmatrixAt(gp, B);
383  } else if ( nlGeo == 1 ) {
384  if ( elem->domain->giveEngngModel()->giveFormulation() == AL ) {
385  elem->computeBmatrixAt(gp, B);
386  } else {
387  elem->computeBHmatrixAt(gp, B);
388  }
389  }
390  this->computeNkappaMatrixAt(gp, Nk);
391  this->computeBkappaMatrixAt(gp, Bk);
392 
393  dpmat->givePDGradMatrix_uu(D, rMode, gp, tStep);
394  dpmat->givePDGradMatrix_ku(Dku, rMode, gp, tStep);
395  dpmat->givePDGradMatrix_uk(gPSigma, rMode, gp, tStep);
396  dpmat->givePDGradMatrix_kk(lStiff, rMode, gp, tStep);
397 
399  DB.beProductOf(D, B);
400  if ( matStiffSymmFlag ) {
401  answer_uu.plusProductSymmUpper(B, DB, dV);
402  } else {
403  answer_uu.plusProductUnsym(B, DB, dV);
404  }
405 
407  DkuB.beProductOf(Dku, B);
408  answer_ku.plusProductUnsym(Nk, DkuB, -dV);
409 
410  if ( dpmat->giveAveragingType() == 2 ) {
411  double dl1, dl2, dl3;
412  FloatMatrix LDB;
413  FloatMatrix GkLDB, MGkLDB;
414  FloatMatrix M22, M12;
415  FloatMatrix dL1(1, 3), dL2(1, 3), dLdS;
416  FloatArray Gk, n1, n2;
417 
418 
419  dpmat->givePDGradMatrix_LD(dLdS, rMode, gp, tStep);
420  this->computeNonlocalGradient(Gk, gp, tStep);
421 
422  dl1 = dLdS.at(3, 3);
423  dl2 = dLdS.at(4, 4);
424  dl3 = dLdS.at(5, 5);
425  n1 = {dLdS.at(1, 1), dLdS.at(2, 1)};
426  n2 = {dLdS.at(1, 2), dLdS.at(2, 2)};
427 
428  // first term Bk^T M22 G L1 D B
429  // M22 = n2 \otimes n2
430  M22.plusDyadUnsym(n2, n2, 1.);
431  // dL1
432  dL1.at(1, 1) = dl1 * n1.at(1) * n1.at(1) + dl2 * n2.at(1) * n2.at(1);
433  dL1.at(1, 2) = dl1 * n1.at(2) * n1.at(2) + dl2 * n2.at(2) * n2.at(2);
434  dL1.at(1, 3) = dl1 * n1.at(1) * n1.at(2) + dl2 * n2.at(1) * n2.at(2);
435 
436  LDB.beProductOf(dL1, DB);
437  GkLDB.beProductOf(Gk, LDB);
438  MGkLDB.beProductOf(M22, GkLDB);
439  answer.plusProductUnsym(Bk, MGkLDB, dV);
440 
441  // M12 + M21 = n1 \otimes n2 + n2 \otimes n1
442  M12.plusDyadUnsym(n1, n2, 1.);
443  M12.plusDyadUnsym(n2, n1, 1.);
444  //dL2
445  dL2.at(1, 1) = dl3 * ( n1.at(1) * n2.at(1) + n1.at(1) * n2.at(1) );
446  dL2.at(1, 2) = dl3 * ( n1.at(2) * n2.at(2) + n1.at(2) * n2.at(2) );
447  dL2.at(1, 3) = dl3 * ( n1.at(2) * n2.at(1) + n1.at(1) * n2.at(2) );
448 
449  // Bk * ((M12 * L2 + M22 * L1) * DB)
450  LDB.beProductOf(dL2, DB);
451  GkLDB.beProductOf(Gk, LDB);
452  MGkLDB.beProductOf(M12, GkLDB);
453  answer.plusProductUnsym(Bk, MGkLDB, dV);
454  }
455 
457  SNk.beProductOf(gPSigma, Nk);
458  answer_uk.plusProductUnsym(B, SNk, -dV); // uk
459 
461  answer_kk.plusProductUnsym(Nk, Nk, dV);
462  if ( dpmat->giveAveragingType() == 0 || dpmat->giveAveragingType() == 1 ) {
463  double l = lStiff.at(1, 1);
464  answer_kk.plusProductUnsym(Bk, Bk, l * l * dV);
465  } else if ( dpmat->giveAveragingType() == 2 ) {
466  LBk.beProductOf(lStiff, Bk);
467  answer_kk.plusProductUnsym(Bk, LBk, dV);
468  }
469  }
470 
471  if ( elem->domain->giveEngngModel()->giveFormulation() == AL ) {
472  FloatMatrix initialStressMatrix;
473  elem->computeInitialStressMatrix(initialStressMatrix, tStep);
474  answer_uu.add(initialStressMatrix);
475  }
476 
477  if ( matStiffSymmFlag ) {
478  answer_uu.symmetrized();
479  }
480 
481  answer.resize(totalSize, totalSize);
482  answer.zero();
483  answer.assemble(answer_uu, locU);
484  answer.assemble(answer_uk, locU, locK);
485  answer.assemble(answer_ku, locK, locU);
486  answer.assemble(answer_kk,locK);
487 }
488 #else
489 
490 void
492 {
493  //set displacement and nonlocal location array
495  this->setNonlocalLocationArray();
496 
497  answer.resize(totalSize, totalSize);
498  answer.zero();
499 
500  FloatMatrix answer1, answer2, answer3, answer4;
501  this->computeStiffnessMatrix_uu(answer1, rMode, tStep);
502  this->computeStiffnessMatrix_uk(answer2, rMode, tStep);
503  this->computeStiffnessMatrix_ku(answer3, rMode, tStep);
504  this->computeStiffnessMatrix_kk(answer4, rMode, tStep);
505  answer.assemble(answer1, locU);
506  answer.assemble(answer2, locU, locK);
507  answer.assemble(answer3, locK, locU);
508  answer.assemble(answer4, locK);
509 }
510 #endif
511 
512 void
514 {
517  FloatMatrix B, D, DB;
518 
519  int nlGeo = elem->giveGeometryMode();
520  bool matStiffSymmFlag = elem->giveCrossSection()->isCharacteristicMtrxSymmetric(rMode);
521  answer.clear();
522  for ( GaussPoint *gp: *elem->giveIntegrationRule(0) ) {
523 
526  if ( !dpmat ) {
527  OOFEM_ERROR("Material doesn't implement the required DpGrad interface!");
528  }
529  if ( nlGeo == 0 ) {
530  elem->computeBmatrixAt(gp, B);
531  } else if ( nlGeo == 1 ) {
532  if ( elem->domain->giveEngngModel()->giveFormulation() == AL ) {
533  elem->computeBmatrixAt(gp, B);
534  } else {
535  elem->computeBHmatrixAt(gp, B);
536  }
537  }
538 
539  dpmat->givePDGradMatrix_uu(D, rMode, gp, tStep);
540  double dV = elem->computeVolumeAround(gp);
541  DB.beProductOf(D, B);
542  if ( matStiffSymmFlag ) {
543  answer.plusProductSymmUpper(B, DB, dV);
544  } else {
545  answer.plusProductUnsym(B, DB, dV);
546  }
547  }
548 
549  if ( elem->domain->giveEngngModel()->giveFormulation() == AL ) {
550  FloatMatrix initialStressMatrix;
551  elem->computeInitialStressMatrix(initialStressMatrix, tStep);
552  answer.add(initialStressMatrix);
553  }
554 
555  if ( matStiffSymmFlag ) {
556  answer.symmetrized();
557  }
558 }
559 
560 
561 void
563 {
564  double dV;
566  FloatArray Nk;
567  FloatMatrix B, DkuB, Dku;
569 
570  answer.clear();
571 
572  int nlGeo = elem->giveGeometryMode();
573 
574  for ( auto &gp: *elem->giveIntegrationRule(0) ) {
575 
578  if ( !dpmat ) {
579  OOFEM_ERROR("Material doesn't implement the required DpGrad interface!");
580  }
581 
582  elem->computeBmatrixAt(gp, B);
583  if ( nlGeo == 1 ) {
584  if ( elem->domain->giveEngngModel()->giveFormulation() == AL ) {
585  elem->computeBmatrixAt(gp, B);
586  } else {
587  elem->computeBHmatrixAt(gp, B);
588  }
589  }
590 
591  dpmat->givePDGradMatrix_ku(Dku, rMode, gp, tStep);
592  this->computeNkappaMatrixAt(gp, Nk);
593  dV = elem->computeVolumeAround(gp);
594  DkuB.beProductOf(Dku, B);
595  answer.plusProductUnsym(Nk, DkuB, -dV);
596 
597  if ( dpmat->giveAveragingType() == 2 ) {
598  double dl1, dl2, dl3;
599  FloatArray Gk;
600  FloatMatrix D, DB, LDB;
601  FloatMatrix Bk, BktM22, BktM22Gk, BktM12, BktM12Gk, M22(2, 2), M12(2, 2);
602  FloatMatrix dL1(1, 3), dL2(1, 3), result1, result2, dLdS, n(2, 2);
603 
604  this->computeBkappaMatrixAt(gp, Bk);
605  dpmat->givePDGradMatrix_uu(D, rMode, gp, tStep);
606  dpmat->givePDGradMatrix_LD(dLdS, rMode, gp, tStep);
607  this->computeNonlocalGradient(Gk, gp, tStep);
608 
609  dl1 = dLdS.at(3, 3);
610  dl2 = dLdS.at(4, 4);
611  dl3 = dLdS.at(5, 5);
612 
613  n.at(1, 1) = dLdS.at(1, 1);
614  n.at(1, 2) = dLdS.at(1, 2);
615  n.at(2, 1) = dLdS.at(2, 1);
616  n.at(2, 2) = dLdS.at(2, 2);
617  // first term Bk^T M22 G L1 D B
618  // M22 = n2 \otimes n2
619  M22.at(1, 1) = n.at(1, 2) * n.at(1, 2);
620  M22.at(1, 2) = n.at(1, 2) * n.at(2, 2);
621  M22.at(2, 1) = n.at(2, 2) * n.at(1, 2);
622  M22.at(2, 2) = n.at(2, 2) * n.at(2, 2);
623  // dL1
624  dL1.at(1, 1) = dl1 * n.at(1, 1) * n.at(1, 1) + dl2 *n.at(1, 2) * n.at(1, 2);
625  dL1.at(1, 2) = dl1 * n.at(2, 1) * n.at(2, 1) + dl2 *n.at(2, 2) * n.at(2, 2);
626  dL1.at(1, 3) = dl1 * n.at(1, 1) * n.at(2, 1) + dl2 *n.at(1, 2) * n.at(2, 2);
627 
628  DB.beProductOf(D, B);
629  LDB.beProductOf(dL1, DB);
630  BktM22.beTProductOf(Bk, M22);
632  //BktM22Gk.beProductOf(BktM22,Gk);
633  result1.beProductOf(BktM22Gk, LDB);
634  answer.add(dV, result1);
635  // This would be slightly shorter and faster;
636  //GkLDB.beProductOf(Gk, LDB);
637  //MGkLDB.beProductOf(M22, GkLDB);
638  //answer.plusProductUnsym(Bk, MGkLDB, dV);
639 
640  // M12 + M21 = n1 \otimes n2 + n2 \otimes n1
641  M12.at(1, 1) = n.at(1, 1) * n.at(1, 2) + n.at(1, 2) * n.at(1, 1);
642  M12.at(1, 2) = n.at(1, 1) * n.at(2, 2) + n.at(1, 2) * n.at(2, 1);
643  M12.at(2, 1) = n.at(2, 1) * n.at(1, 2) + n.at(2, 2) * n.at(1, 1);
644  M12.at(2, 2) = n.at(2, 1) * n.at(2, 2) + n.at(2, 2) * n.at(2, 1);
645  //dL2
646  dL2.at(1, 1) = dl3 * ( n.at(1, 1) * n.at(1, 2) + n.at(1, 1) * n.at(1, 2) );
647  dL2.at(1, 2) = dl3 * ( n.at(2, 1) * n.at(2, 2) + n.at(2, 1) * n.at(2, 2) );
648  dL2.at(1, 3) = dl3 * ( n.at(1, 2) * n.at(2, 1) + n.at(1, 1) * n.at(2, 2) );
649 
650  LDB.beProductOf(dL2, DB);
651  BktM12.beTProductOf(Bk, M12);
653  //BktM12Gk.beProductOf(BktM12,Gk);
654  result2.beProductOf(BktM12Gk, LDB);
655  answer.add(dV, result2);
656  // This would be slightly shorter and faster;
657  //GkLDB.beProductOf(Gk, LDB);
658  //MGkLDB.beProductOf(M12, GkLDB);
659  //answer.plusProductUnsym(Bk, MGkLDB, dV);
660  }
661  }
662 }
663 
664 
665 void
667 {
669  double dV;
670  FloatMatrix lStiff;
671  FloatArray Nk;
672  FloatMatrix Bk, LBk;
674 
675  answer.clear();
676 
677  for ( auto &gp: *elem->giveIntegrationRule(0) ) {
678 
681  if ( !dpmat ) {
682  OOFEM_ERROR("Material doesn't implement the required DpGrad interface!");
683  }
684 
685  this->computeNkappaMatrixAt(gp, Nk);
686  this->computeBkappaMatrixAt(gp, Bk);
687  dV = elem->computeVolumeAround(gp);
688 
689  dpmat->givePDGradMatrix_kk(lStiff, rMode, gp, tStep);
690  answer.plusProductUnsym(Nk, Nk, dV);
691  if ( dpmat->giveAveragingType() == 0 || dpmat->giveAveragingType() == 1 ) {
692  double l = lStiff.at(1, 1);
693  answer.plusProductUnsym(Bk, Bk, l * l * dV);
694  } else if ( dpmat->giveAveragingType() == 2 ) {
695  LBk.beProductOf(lStiff, Bk);
696  answer.plusProductUnsym(Bk, LBk, dV);
697  }
698  }
699 }
700 
701 
702 void
704 {
706  double dV;
708  int nlGeo = elem->giveGeometryMode();
709  FloatArray Nk;
710  FloatMatrix B, SNk, gPSigma;
711 
712  answer.clear();
713 
714  for ( auto &gp: *elem->giveIntegrationRule(0) ) {
715 
718  if ( !dpmat ) {
719  OOFEM_ERROR("Material doesn't implement the required DpGrad interface!");
720  }
721  dpmat->givePDGradMatrix_uk(gPSigma, rMode, gp, tStep);
722  this->computeNkappaMatrixAt(gp, Nk);
723  elem->computeBmatrixAt(gp, B);
724  if ( nlGeo == 1 ) {
725  if ( elem->domain->giveEngngModel()->giveFormulation() == AL ) {
726  elem->computeBmatrixAt(gp, B);
727  } else {
728  elem->computeBHmatrixAt(gp, B);
729  }
730  }
731  dV = elem->computeVolumeAround(gp);
732 
733  SNk.beProductOf(gPSigma, Nk);
734  answer.plusProductUnsym(B, SNk, -dV);
735  }
736 }
737 
738 
741 {
742  //IRResultType result; // Required by IR_GIVE_FIELD macro
743  //nlGeo = 0;
744 
745  return IRRT_OK;
746 }
747 } // end namespace oofem
CrossSection * giveCrossSection()
Definition: element.C:495
virtual void givePDGradMatrix_ku(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
Left lower block.
virtual void computeBkappaMatrixAt(GaussPoint *gp, FloatMatrix &answer)=0
virtual IRResultType initializeFrom(InputRecord *ir)
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
void giveLocalInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord)
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of unknowns.
Definition: element.C:86
void computeDisplacementDegreesOfFreedom(FloatArray &answer, TimeStep *tStep)
Definition: graddpelement.C:86
virtual IntegrationRule * giveIntegrationRule(int i)
Definition: element.h:835
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition: femcmpnn.h:82
void computeStiffnessMatrix(FloatMatrix &, MatResponseMode, TimeStep *)
Abstract base class for "structural" finite elements with geometrical nonlinearities.
Total Lagrange.
Definition: fmode.h:44
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
virtual StructuralElement * giveStructuralElement()=0
This class implements a structural material status information.
Definition: structuralms.h:65
virtual void givePDGradMatrix_LD(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
Stress-based averaging.
Updated Lagrange.
Definition: fmode.h:45
void giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord)
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Definition: domain.C:433
void plusDyadUnsym(const FloatArray &a, const FloatArray &b, double dV)
Adds to the receiver the product .
Definition: floatmatrix.C:811
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
MatResponseMode
Describes the character of characteristic material matrix.
virtual void givePDGradMatrix_uk(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
Right upper block.
virtual void givePDGradMatrix_uu(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
Left upper block.
void computeNonlocalDegreesOfFreedom(FloatArray &answer, TimeStep *tStep)
Definition: graddpelement.C:91
void plusProductUnsym(const FloatMatrix &a, const FloatMatrix &b, double dV)
Adds to the receiver the product .
Definition: floatmatrix.C:780
const char * __MaterialModeToString(MaterialMode _value)
Definition: cltypes.C:314
Abstract base class for all "structural" finite elements.
virtual Interface * giveMaterialInterface(InterfaceType t, IntegrationPoint *ip)
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
Definition: element.h:518
virtual void computeNkappaMatrixAt(GaussPoint *gp, FloatArray &answer)=0
void giveNonlocalInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord)
void computeStiffnessMatrix_uu(FloatMatrix &, MatResponseMode, TimeStep *)
virtual void giveFirstPKStressVectorGrad(FloatArray &answer1, double &answer2, GaussPoint *gp, const FloatArray &totalStrain, double nonlocalDamageDrivningVariable, TimeStep *tStep)
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
Definition: floatarray.C:463
#define OOFEM_ERROR(...)
Definition: error.h:61
StructuralCrossSection * giveStructuralCrossSection()
Helper function which returns the structural cross-section for the element.
Material interface for gradient material models.
virtual void givePDGradMatrix_kk(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
Right lower block.
virtual bool isCharacteristicMtrxSymmetric(MatResponseMode rMode)
Check for symmetry of stiffness matrix.
Definition: crosssection.h:172
virtual fMode giveFormulation()
Indicates type of non linear computation (total or updated formulation).
Definition: engngm.h:1069
void computeLocalStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
void plusProductSymmUpper(const FloatMatrix &a, const FloatMatrix &b, double dV)
Adds to the receiver the product .
Definition: floatmatrix.C:698
void setDisplacementLocationArray()
Definition: graddpelement.C:62
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix^T and anArray.
Definition: floatarray.C:708
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
void computeNonlocalGradient(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
void resize(int n)
Checks size of receiver towards requested bounds.
Definition: intarray.C:124
virtual void giveRealStressVectorGrad(FloatArray &answer1, double &answer2, GaussPoint *gp, const FloatArray &totalStrain, double nonlocalDamageDrivningVariable, TimeStep *tStep)
gradient - based giveRealStressVector
virtual NLStructuralElement * giveNLStructuralElement()=0
void computeStiffnessMatrix_uk(FloatMatrix &, MatResponseMode, TimeStep *)
int giveGeometryMode()
Returns the geometry mode describing the formulation used in the internal work 0 - Engineering (small...
void computeNonlocalCumulatedStrain(double &answer, GaussPoint *gp, TimeStep *tStep)
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual void giveCauchyStressVectorGrad(FloatArray &answer1, double &answer2, GaussPoint *gp, const FloatArray &totalStrain, double nonlocalDamageDrivningVariable, TimeStep *tStep)
void assemble(const FloatArray &fe, const IntArray &loc)
Assembles the array fe (typically, the load vector of a finite element) into the receiver, using loc as location array.
Definition: floatarray.C:551
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1358
Class representing the general Input Record.
Definition: inputrecord.h:101
void computeStressVectorAndLocalCumulatedStrain(FloatArray &answer, double localCumulatedPlasticStrain, GaussPoint *gp, TimeStep *tStep)
Definition: graddpelement.C:97
void add(const FloatMatrix &a)
Adds matrix to the receiver.
Definition: floatmatrix.C:1023
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
void beTProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
Definition: floatmatrix.C:367
virtual void computeBmatrixAt(GaussPoint *gp, FloatMatrix &answer, int lowerIndx=1, int upperIndx=ALL_STRAINS)=0
Computes the geometrical matrix of receiver in given integration point.
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
Domain * giveDomain() const
Definition: femcmpnn.h:100
virtual void computeBHmatrixAt(GaussPoint *gp, FloatMatrix &answer)
Computes a matrix which, multiplied by the column matrix of nodal displacements, gives the displaceme...
void computeDeformationGradientVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
Definition: floatmatrix.C:337
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
Abstract base class for all structural cross section models.
the oofem namespace is to define a context or scope in which all oofem names are defined.
void computeStiffnessMatrix_ku(FloatMatrix &, MatResponseMode, TimeStep *)
void assemble(const FloatMatrix &src, const IntArray &loc)
Assembles the contribution using localization array into receiver.
Definition: floatmatrix.C:251
void clear()
Sets size of receiver to be an empty matrix. It will have zero rows and zero columns size...
Definition: floatmatrix.h:516
void computeStiffnessMatrix_kk(FloatMatrix &, MatResponseMode, TimeStep *)
void symmetrized()
Initializes the lower half of the receiver according to the upper half.
Definition: floatmatrix.C:1576
virtual void computeInitialStressMatrix(FloatMatrix &answer, TimeStep *tStep)
Computes the initial stiffness matrix of receiver.
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
void setNonlocalLocationArray()
Definition: graddpelement.C:76
void add(const FloatArray &src)
Adds array src to receiver.
Definition: floatarray.C:156
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631
void plusProduct(const FloatMatrix &b, const FloatArray &s, double dV)
Adds the product .
Definition: floatarray.C:226

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:29 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011