OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
solidshell.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  * Copyright (C) 1993 - 2014 Borek Patzak
14  *
15  *
16  *
17  * Czech Technical University, Faculty of Civil Engineering,
18  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  * Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; if not, write to the Free Software
32  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
36 #include <Materials/structuralms.h>
37 #include "classfactory.h"
38 #include "fei3dhexalin.h"
39 #include "gausspoint.h"
40 #include "gaussintegrationrule.h"
42 
43 namespace oofem {
44 REGISTER_Element(SolidShell);
45 
46 FEI3dHexaLin SolidShell :: interpolation;
47 
48 SolidShell :: SolidShell(int n, Domain *aDomain) : LSpace(n, aDomain)
49 {
50  numberOfDofMans = 8;
52 
53 }
54 
55 
56 void
58 
60 
61 
62  int numEASparam = 0;
63 
64  switch ( this->EAS_type) {
65  case 1:
66  numEASparam = 1;
67  break;
68 
69  case 2:
70  numEASparam = 3;
71  break;
72  }
73 
74  this->u_k.resize(numberOfDofMans*3);
75  this->u_k.zero();
76  this->fE.resize(numEASparam);
77  this->fE.zero();
78  this->KEC.resize(numEASparam, numberOfDofMans*3);
79  this->KEC.zero();
80  this->invKEE.resize(numEASparam, numEASparam);
81  this->invKEE.zero();
82  this->alpha.resize(numEASparam);
83  this->alpha.zero();
84 
85 }
86 
87 void
89 // Sets up the array containing the four Gauss points of the receiver.
90 {
91  if ( integrationRulesArray.size() == 0 ) {
92  integrationRulesArray.resize( 1 );
93  integrationRulesArray [ 0 ] = new GaussIntegrationRule(1, this, 1, 6);
95  }
96 }
97 
99 
100 
103 {
106  if ( result != IRRT_OK ) {
107  return result;
108  }
109 
110 
111  // Check if EAS should be used
112  this->EAS_type = 0;
113  if ( ir->hasField(_IFT_SolidShell_EAS_type) ) {
114 
116 
117  }
118 
119 
120  return IRRT_OK;
121 }
122 
123 
124 
125 void
127 // Returns the [ 6 x (8*3) ] strain-displacement matrix {B} of the receiver, eva-
128 // luated at gp.
129 // B matrix - 6 rows : epsilon-X, epsilon-Y, epsilon-Z, gamma-YZ, gamma-ZX, gamma-XY :
130 {
131  FEInterpolation *interp = this->giveInterpolation();
132  FloatMatrix dNdx;
133  FloatArray lCoords = * gp->giveNaturalCoordinates();
134  interp->evaldNdx( dNdx, lCoords, FEIElementGeometryWrapper(this) );
135 
136  answer.resize(6, dNdx.giveNumberOfRows() * 3);
137  answer.zero();
138 
139  // Do ANS
140  // Need to evaluate strain at four points
141  FloatArray A = { 0.0, -1.0, 0.0};
142  FloatArray B = { 1.0, 0.0, 0.0};
143  FloatArray C = { 0.0, 1.0, 0.0};
144  FloatArray D = {-1.0, 0.0, 0.0};
145 
146  FloatMatrix dNdxA, dNdxB, dNdxC, dNdxD;
147  interp->evaldNdx( dNdxA, A, FEIElementGeometryWrapper(this) );
148  interp->evaldNdx( dNdxB, B, FEIElementGeometryWrapper(this) );
149  interp->evaldNdx( dNdxC, C, FEIElementGeometryWrapper(this) );
150  interp->evaldNdx( dNdxD, D, FEIElementGeometryWrapper(this) );
151 
152  FloatMatrix dNdx0;
153  interp->evaldNdx( dNdx0, {lCoords.at(1), lCoords.at(2), 0.0}, FEIElementGeometryWrapper(this) );
154 
155 
156  double NA = 0.5 * ( 1.0 - lCoords.at(2) );
157  double NC = 0.5 * ( 1.0 + lCoords.at(2) );
158  double NB = 0.5 * ( 1.0 - lCoords.at(1) );
159  double ND = 0.5 * ( 1.0 + lCoords.at(1) );
160 
161  // E_xz = E(5) = N_A(gp) * B(A)(5,:) + N_C(gp) * B(C)(5,:)
162  // E_yz = E(4) = N_B(gp) * B(B)(4,:) + N_D(gp) * B(D)(4,:)
163 
164  for ( int i = 1; i <= dNdx.giveNumberOfRows(); i++ ) {
165  answer.at(1, 3 * i - 2) = dNdx.at(i, 1);
166  answer.at(2, 3 * i - 1) = dNdx.at(i, 2);
167  answer.at(6, 3 * i - 2) = dNdx.at(i, 2);
168  answer.at(6, 3 * i - 1) = dNdx.at(i, 1);
169 
170  // Evaluate thickness strain at the mid-surface
171  //answer.at(3, 3 * i - 0) = dNdx.at(i, 3);
172  answer.at(3, 3 * i - 0) = dNdx0.at(i, 3);
173 
174  answer.at(4, 3 * i - 1) = NB * dNdxB.at(i, 3) + ND * dNdxD.at(i, 3);
175  answer.at(4, 3 * i - 0) = NB * dNdxB.at(i, 2) + ND * dNdxD.at(i, 2);
176 
177 
178  answer.at(5, 3 * i - 2) = NA * dNdxA.at(i, 3) + NC * dNdxC.at(i, 3);
179  answer.at(5, 3 * i - 0) = NA * dNdxA.at(i, 1) + NC * dNdxC.at(i, 1);
180  }
181 }
182 
183 
184 void
186 // Returns the [ 6 x (8*3) ] strain-displacement matrix {B} of the receiver, eva-
187 // luated at gp.
188 // B matrix - 6 rows : epsilon-X, epsilon-Y, epsilon-Z, gamma-YZ, gamma-ZX, gamma-XY :
189 {
190 
191 #if 1
192  FEInterpolation *interp = this->giveInterpolation();
193  FloatMatrix dNdx;
194  interp->evaldNdx( dNdx, lCoords, FEIElementGeometryWrapper(this) );
195 
196  answer.resize(9, dNdx.giveNumberOfRows() * 3);
197  answer.zero();
198  for ( int i = 1; i <= dNdx.giveNumberOfRows(); i++ ) {
199  answer.at(1, 3 * i - 2) = dNdx.at(i, 1); // du/dx
200  answer.at(2, 3 * i - 1) = dNdx.at(i, 2); // dv/dy
201  answer.at(3, 3 * i - 0) = dNdx.at(i, 3); // dw/dz
202  answer.at(4, 3 * i - 1) = dNdx.at(i, 3); // dv/dz
203  answer.at(7, 3 * i - 0) = dNdx.at(i, 2); // dw/dy
204  answer.at(5, 3 * i - 2) = dNdx.at(i, 3); // du/dz
205  answer.at(8, 3 * i - 0) = dNdx.at(i, 1); // dw/dx
206  answer.at(6, 3 * i - 2) = dNdx.at(i, 2); // du/dy
207  answer.at(9, 3 * i - 1) = dNdx.at(i, 1); // dv/dx
208  }
209 
210 #else
211  FEInterpolation *interp = this->giveInterpolation();
212  FloatMatrix dNdx;
213  interp->evaldNdx( dNdx, lCoords, FEIElementGeometryWrapper(this) );
214 
215  answer.resize(9, dNdx.giveNumberOfRows() * 3);
216  answer.zero();
217 
218 
219  // Need to evaluate strain at four points
220  FloatArray A = { 0.0, -1.0, 0.0};
221  FloatArray B = { 1.0, 0.0, 0.0};
222  FloatArray C = { 0.0, 1.0, 0.0};
223  FloatArray D = {-1.0, 0.0, 0.0};
224 
225 
226  FloatMatrix dNdxA, dNdxB, dNdxC, dNdxD;
227  interp->evaldNdx( dNdxA, A, FEIElementGeometryWrapper(this) );
228  interp->evaldNdx( dNdxB, B, FEIElementGeometryWrapper(this) );
229  interp->evaldNdx( dNdxC, C, FEIElementGeometryWrapper(this) );
230  interp->evaldNdx( dNdxD, D, FEIElementGeometryWrapper(this) );
231 
232  FloatMatrix dNdx0;
233  interp->evaldNdx( dNdx0, {lCoords.at(1), lCoords.at(2), 0.0}, FEIElementGeometryWrapper(this) );
234 
235 
236  double NA = 0.5 * ( 1.0 - lCoords.at(2) );
237  double NC = 0.5 * ( 1.0 + lCoords.at(2) );
238  double NB = 0.5 * ( 1.0 - lCoords.at(1) );
239  double ND = 0.5 * ( 1.0 + lCoords.at(1) );
240 
241  // E_xz = E(5) = N_A(gp) * B(A)(5,:) + N_C(gp) * B(C)(5,:)
242  // E_yz = E(4) = N_B(gp) * B(B)(4,:) + N_D(gp) * B(D)(4,:)
243 
244  for ( int i = 1; i <= dNdx.giveNumberOfRows(); i++ ) {
245  answer.at(1, 3 * i - 2) = dNdx.at(i, 1);
246  answer.at(2, 3 * i - 1) = dNdx.at(i, 2);
247  answer.at(6, 3 * i - 2) = dNdx.at(i, 2); // du/dy
248  answer.at(9, 3 * i - 1) = dNdx.at(i, 1); // dv/dx
249 
250  // Evaluate thickness strain at the mid-surface
251  //answer.at(3, 3 * i - 0) = dNdx.at(i, 3);
252  answer.at(3, 3 * i - 0) = dNdx0.at(i, 3);
253 
254  answer.at(4, 3 * i - 1) = NB * dNdxB.at(i, 3) + ND * dNdxD.at(i, 3);
255  answer.at(7, 3 * i - 0) = NB * dNdxB.at(i, 2) + ND * dNdxD.at(i, 2);
256 
257  answer.at(5, 3 * i - 2) = NA * dNdxA.at(i, 3) + NC * dNdxC.at(i, 3);
258  answer.at(8, 3 * i - 0) = NA * dNdxA.at(i, 1) + NC * dNdxC.at(i, 1);
259  }
260 #endif
261 }
262 
263 
264 void
266 // Returns the [ 6 x (8*3) ] strain-displacement matrix {B} of the receiver, eva-
267 // luated at gp.
268 // B matrix - 6 rows : epsilon-X, epsilon-Y, epsilon-Z, gamma-YZ, gamma-ZX, gamma-XY :
269 {
270 
271  this->computeBHmatrixAt( *gp->giveNaturalCoordinates(), answer);
272 
273 }
274 
275 
276 void
278 {
279 
280  FloatArray lCoords = *gp->giveNaturalCoordinates();
281  double xi = lCoords.at(1);
282  double eta = lCoords.at(2);
283  double zeta = lCoords.at(3);
284  FloatMatrix M;
285 
286  switch ( this->EAS_type) {
287  case 1:
288 
289  // alt 1
290  M.resize(6,1);
291  M.zero();
292  M.at(3,1) = zeta;
293  break;
294 
295  case 2:
296  // alt 2
297  M.resize(6,3);
298  M.zero();
299  M.at(1,1) = xi;
300  M.at(2,2) = eta;
301  M.at(3,3) = zeta;
302  break;
303  }
304 
305  FEInterpolation *interp = this->giveInterpolation();
306  FloatMatrix J0mat;
307  FloatArray center = {0.0, 0.0, 0.0};
308 
309  interp->giveJacobianMatrixAt(J0mat, center, FEIElementGeometryWrapper(this) );
310 // double J0 = interp->giveTransformationJacobian(center, FEIElementGeometryWrapper(this) );
311  double J0 = J0mat.giveDeterminant();
312  double J = interp->giveTransformationJacobian(lCoords, FEIElementGeometryWrapper(this) );
313 
314  FloatMatrix T(6,6);
315  this->computeBondTransformationMatrix(T, J0mat);
316  //T.printYourself("T");
317 
318  //T.beUnitMatrix();
319  answer.clear();
320  answer.plusProductUnsym(T, M, J/J0);
321 
322 
323 }
324 
325 
326 
327 void
329 {
330  // given a bases {g1, g2, g3} compute the Bond (Voigt form) transformation matrix.
331  // TODO is this with OOFEM ordering of components?
332  FloatArray x, y, z;
333  x.beColumnOf(base,1);
334  y.beColumnOf(base,2);
335  z.beColumnOf(base,3);
336  answer = {
337  { x(0) * x(0), x(1) * x(1), x(2) * x(2), x(1) * x(2), x(0) * x(2), x(0) * x(1) },
338  { y(0) * y(0), y(1) * y(1), y(2) * y(2), y(1) * y(2), y(0) * y(2), y(0) * y(1) },
339  { z(0) * z(0), z(1) * z(1), z(2) * z(2), z(1) * z(2), z(0) * z(2), z(0) * z(1) },
340  { 2 * y(0) * z(0), 2 * y(1) * z(1), 2 * y(2) * z(2), y(2) * z(1) + y(1) * z(2), y(2) * z(0) + y(0) * z(2), y(1) * z(0) + y(0) * z(1) },
341  { 2 * x(0) * z(0), 2 * x(1) * z(1), 2 * x(2) * z(2), x(2) * z(1) + x(1) * z(2), x(2) * z(0) + x(0) * z(2), x(1) * z(0) + x(0) * z(1) },
342  { 2 * x(0) * y(0), 2 * x(1) * y(1), 2 * x(2) * y(2), x(2) * y(1) + x(1) * y(2), x(2) * y(0) + x(0) * y(2), x(1) * y(0) + x(0) * y(1) }
343  };
344 
345 }
346 
347 void
349 {
350  // compute alpha based on displacement update
351  FloatArray deltaU;
352  deltaU.beDifferenceOf(u,this->u_k);
353 
354  FloatMatrix KEE_inv = this->invKEE;
355  FloatArray fE = this->fE;
356  FloatMatrix KEC = this->KEC;
357  FloatArray temp, deltaAlpha;
358  temp.beProductOf(KEC, deltaU);
359  temp.add(fE);
360  deltaAlpha.beProductOf(KEE_inv,temp);
361 
362  FloatArray oldAlpha = this->alpha; // last converged values
363  answer = this->alpha - deltaAlpha;
364 
365 
366  // set current u-displcement
367  this->u_k = u;
368 }
369 
370 void
371 SolidShell :: giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord)
372 {
373  if ( this->EAS_type ) {
374  FloatArray fC, fE, strain, u, vStrainC, vStrainE, vStress;
375  FloatMatrix KEE, KBE, BC, BE, D;
376  fE.clear();
377  fC.clear();
378 
379  KEE.clear();
380 
381  this->computeVectorOf(VM_Total, tStep, u);
383  this->computeAlpha(alpha, u );
385  for ( GaussPoint *gp: *this->giveDefaultIntegrationRulePtr() ) {
386 
387  if ( nlGeometry == 0 ) {
388  computeBmatrixAt(gp, BC);
389  this->computeEASBmatrixAt(gp, BE);
390 
391  vStrainC.beProductOf(BC, u);
392  vStrainE.beProductOf(BE, alpha);
393  vStrainC.add(vStrainE);
394  //this->computeStressVector(vStress, vStrainC, gp, tStep);
395  cs->giveRealStresses(vStress, gp, vStrainC, tStep);
396 
397  } else if ( nlGeometry == 1 ) { // First Piola-Kirchhoff stress
398 
399  this->computeBHmatrixAt(gp, BC);
400  FloatArray vFC, VFE;
401  vFC.beProductOf(BC, u);
402  //vFE.beProductOf(BE, alpha);
403  //vFC.add(VFE);
404  cs->giveFirstPKStresses(vStress, gp, vFC, tStep);
405 
406  } else if ( nlGeometry == 2 ) { // Second Piola-Kirchhoff stress
407 
408  this->computeBEmatrixAt(gp, BC, tStep);
409  this->computeEASBmatrixAt(gp, BE);
410 
411  this->computeEVector(vStrainC, *gp->giveNaturalCoordinates(), u);
412  vStrainE.beProductOf(BE, alpha);
413  vStrainC.add(vStrainE);
414  cs->giveRealStresses(vStress, gp, vStrainC, tStep);
415 
416  }
417 
418 
419  double dV = this->computeVolumeAround(gp);
420 
421 
422  // Compute nodal internal forces at nodes as f = B^T*Stress dV
423  fC.plusProduct(BC, vStress, dV);
424  fE.plusProduct(BE, vStress, dV);
425 
426  }
427  this->fE = fE;
428 
429  FloatMatrix KEE_inv, KEC;
430  KEE_inv = this->invKEE;
431  KEC = this->KEC;
432 
433  FloatArray temp, f;
434  temp.beProductOf(KEE_inv,fE);
435  answer = fC;
436  answer.plusProduct(KEC, temp, -1.0);
437 
438  } else {
439 
440  LSpace :: giveInternalForcesVector(answer, tStep, useUpdatedGpRecord);
441 
442  }
443 
444 
445 }
446 
447 
448 void
450 {
451  if ( this->EAS_type ) {
452  FloatArray fC, fE, strain, u, vStrainC, vStrainE, vStress;
453  FloatMatrix KEE, KEC, KCC, KCC_geo, BC, BE, D, DBC, DBE;
454 
455  KEC.clear();
456  KEE.clear();
457  KCC.clear();
458 
460  for ( GaussPoint *gp: *this->giveDefaultIntegrationRulePtr() ) {
461  if ( nlGeometry == 0 ) {
462  this->computeBmatrixAt(gp, BC);
463  this->computeEASBmatrixAt(gp, BE);
464  double dV = this->computeVolumeAround(gp);
465 
466  this->computeConstitutiveMatrixAt(D, rMode, gp, tStep);
467  DBC.beProductOf(D, BC);
468  DBE.beProductOf(D, BE);
469 
470  KCC.plusProductUnsym(BC, DBC, dV);
471  KEC.plusProductUnsym(BE, DBC, dV);
472  KEE.plusProductUnsym(BE, DBE, dV);
473 
474  } else if ( nlGeometry == 1 ) {
475  this->computeBHmatrixAt(gp, BC);
476  cs->giveStiffnessMatrix_dPdF(D, rMode, gp, tStep);
477 
478  } else if ( nlGeometry == 2 ) {
479  this->computeBEmatrixAt(gp, BC, tStep);
480  this->computeEASBmatrixAt(gp, BE);
481  double dV = this->computeVolumeAround(gp);
482 
483  this->computeConstitutiveMatrixAt(D, rMode, gp, tStep);
484  DBC.beProductOf(D, BC);
485  DBE.beProductOf(D, BE);
486 
487  KCC.plusProductUnsym(BC, DBC, dV);
488  KEC.plusProductUnsym(BE, DBC, dV);
489  KEE.plusProductUnsym(BE, DBE, dV);
490 
491  //TODO add geometric stiffness
492  this->computeGeometricStiffness(KCC_geo, gp, tStep);
493  KCC.add(dV, KCC_geo);
494 
495  }
496  }
497 
498 
499  FloatMatrix KEE_inv;
500  KEE_inv.beInverseOf(KEE);
501  this->invKEE = KEE_inv;
502  this->KEC = KEC;
503 
504  answer= KCC;
505 
506  FloatMatrix K, tempmat;
507  tempmat.beProductOf(KEE_inv, KEC);
508 
509  answer.plusProductUnsym(KEC, tempmat, -1.0);
510 
511  } else {
512 
513  LSpace :: computeStiffnessMatrix(answer, rMode, tStep);
514 
515  }
516 }
517 
518 
519 
520 
521 void
523 {
524  FloatMatrix dN, F;
525  FloatArray vF;
526  // compute the derivatives of shape functions
528 
529  FloatArray u;
530  this->computeVectorOf(VM_Total, tStep, u); // solution vector
531 
532  this->computeFVector(vF, *gp->giveNaturalCoordinates(), u);
533  F.beMatrixForm(vF);
534 
535  answer.resize(6, 24);
536  answer.zero();
537 #if 1
538  for ( int i = 1, col = 0; i <= dN.giveNumberOfRows(); i++, col += 3 ) {
539  for ( int j = 1; j <= 3; j++ ) {
540  answer.at(1,col + j) = F.at(j,1) * dN.at(i, 1);
541  answer.at(2,col + j) = F.at(j,2) * dN.at(i, 2);
542  answer.at(3,col + j) = F.at(j,3) * dN.at(i, 3);
543  answer.at(4,col + j) = F.at(j,2) * dN.at(i, 3) + F.at(j,3) * dN.at(i, 2);
544  answer.at(5,col + j) = F.at(j,1) * dN.at(i, 3) + F.at(j,3) * dN.at(i, 1);
545  answer.at(6,col + j) = F.at(j,1) * dN.at(i, 2) + F.at(j,2) * dN.at(i, 1);
546  }
547  }
548 
549 #else
550 
551  FEInterpolation *interp = this->giveInterpolation();
552  FloatMatrix dNdx;
553  FloatArray lCoords = * gp->giveNaturalCoordinates();
554  interp->evaldNdx( dNdx, lCoords, FEIElementGeometryWrapper(this) );
555 
556 // Do ANS
557  // Need to evaluate strain at four points
558  FloatArray A = { 0.0, -1.0, 0.0};
559  FloatArray B = { 1.0, 0.0, 0.0};
560  FloatArray C = { 0.0, 1.0, 0.0};
561  FloatArray D = {-1.0, 0.0, 0.0};
562 
563  FloatMatrix dNdxA, dNdxB, dNdxC, dNdxD;
564  interp->evaldNdx( dNdxA, A, FEIElementGeometryWrapper(this) );
565  interp->evaldNdx( dNdxB, B, FEIElementGeometryWrapper(this) );
566  interp->evaldNdx( dNdxC, C, FEIElementGeometryWrapper(this) );
567  interp->evaldNdx( dNdxD, D, FEIElementGeometryWrapper(this) );
568 
569  // Eval deformation gradients
570  FloatArray vFA, vFB, vFC, vFD;
571  this->computeFVector(vFA, A, u);
572  this->computeFVector(vFB, B, u);
573  this->computeFVector(vFC, C, u);
574  this->computeFVector(vFD, D, u);
575  FloatMatrix FA, FB, FC, FD;
576  FA.beMatrixForm(vFA);
577  FB.beMatrixForm(vFB);
578  FC.beMatrixForm(vFC);
579  FD.beMatrixForm(vFD);
580 
581  FloatMatrix dNdx0;
582  interp->evaldNdx( dNdx0, {lCoords.at(1), lCoords.at(2), 0.0}, FEIElementGeometryWrapper(this) );
583 
584 
585  double NA = 0.5 * ( 1.0 - lCoords.at(2) );
586  double NC = 0.5 * ( 1.0 + lCoords.at(2) );
587  double NB = 0.5 * ( 1.0 - lCoords.at(1) );
588  double ND = 0.5 * ( 1.0 + lCoords.at(1) );
589 
590  // E_xz = E(5) = N_A(gp) * B(A)(5,:) + N_C(gp) * B(C)(5,:)
591  // E_yz = E(4) = N_B(gp) * B(B)(4,:) + N_D(gp) * B(D)(4,:)
592 
593 
594  for ( int i = 1, col = 0; i <= dN.giveNumberOfRows(); i++, col += 3 ) {
595  for ( int j = 1; j <= 3; j++ ) {
596  answer.at(1,col + j) = F.at(j,1) * dN.at(i, 1);
597  answer.at(2,col + j) = F.at(j,2) * dN.at(i, 2);
598  answer.at(3,col + j) = F.at(j,3) * dN.at(i, 3);
599  answer.at(6,col + j) = F.at(j,1) * dN.at(i, 2) + F.at(j,2) * dN.at(i, 1);
600 
601  answer.at(4,col + j) = NB * ( FB.at(j,2) * dNdxB.at(i, 3) + FB.at(j,3) * dNdxB.at(i, 2) ) + ND * ( FD.at(j,2) * dNdxD.at(i, 3) + FD.at(j,3) * dNdxD.at(i, 2) ) ;
602  answer.at(5,col + j) = NA * ( FA.at(j,1) * dNdxA.at(i, 3) + FA.at(j,3) * dNdxA.at(i, 1) ) + NC * ( FC.at(j,1) * dNdxC.at(i, 3) + FC.at(j,3) * dNdxC.at(i, 1) );
603 
604  }
605  }
606 
607 
608 #endif
609 
610 
611 
612 }
613 
614 
615 
616 void
618 {
619 
620  FloatMatrix B;
621  this->computeBHmatrixAt(lCoords, B);
622  answer.beProductOf(B, ae);
623 
624  answer.at(1) += 1.0;
625  answer.at(2) += 1.0;
626  answer.at(3) += 1.0;
627 
628 }
629 
630 
631 
632 void
634 {
635  FloatArray vF;
636  this->computeFVector(vF, lCoords, u);
637 
638 #if 0
639  FloatMatrix F, E;
640  F.beMatrixForm(vF);
641  E.beTProductOf(F, F);
642  E.at(1, 1) -= 1.0;
643  E.at(2, 2) -= 1.0;
644  E.at(3, 3) -= 1.0;
645  E.times(0.5);
646  answer.beSymVectorFormOfStrain(E);
647 
648 #else
649 
650  FloatMatrix F, E;
651  F.beMatrixForm(vF);
652  E.beTProductOf(F, F);
653  E.at(1, 1) -= 1.0;
654  E.at(2, 2) -= 1.0;
655  E.at(3, 3) -= 1.0;
656  E.times(0.5);
657  answer.beSymVectorFormOfStrain(E);
658 
659 
660 
661  // Need to evaluate strain at four points
662  FloatArray A = { 0.0, -1.0, 0.0};
663  FloatArray B = { 1.0, 0.0, 0.0};
664  FloatArray C = { 0.0, 1.0, 0.0};
665  FloatArray D = {-1.0, 0.0, 0.0};
666 
667 
668  // Eval deformation gradients
669  FloatArray vFA, vFB, vFC, vFD;
670  this->computeFVector(vFA, A, u);
671  this->computeFVector(vFB, B, u);
672  this->computeFVector(vFC, C, u);
673  this->computeFVector(vFD, D, u);
674  FloatMatrix FA, FB, FC, FD, EA, EB, EC, ED;
675  FA.beMatrixForm(vFA);
676  FB.beMatrixForm(vFB);
677  FC.beMatrixForm(vFC);
678  FD.beMatrixForm(vFD);
679 
680  EA.beTProductOf(FA,FA); EA.times(0.5);
681  EB.beTProductOf(FB,FB); EB.times(0.5);
682  EC.beTProductOf(FC,FC); EC.times(0.5);
683  ED.beTProductOf(FD,FD); ED.times(0.5);
684 
685 // FloatMatrix dNdx0;
686 // interp->evaldNdx( dNdx0, {lCoords.at(1), lCoords.at(2), 0.0}, FEIElementGeometryWrapper(this) );
687 
688 
689  double NA = 0.5 * ( 1.0 - lCoords.at(2) );
690  double NC = 0.5 * ( 1.0 + lCoords.at(2) );
691  double NB = 0.5 * ( 1.0 - lCoords.at(1) );
692  double ND = 0.5 * ( 1.0 + lCoords.at(1) );
693 
694  answer.at(4) = NB * EB.at(2,3) + ND * ED.at(2,3);
695  answer.at(5) = NA * EA.at(2,3) + NC * EC.at(2,3);
696 
697 #endif
698 
699 }
700 
701 void
703 {
704 
705  answer.resize(24,24);
706  answer.zero();
707 
708  StructuralMaterialStatus *matStat = static_cast< StructuralMaterialStatus * >( gp->giveMaterialStatus() );
709  if ( !matStat ) { // no matstat created yet
710  return;
711  }
712  FloatArray vS;
713  vS = matStat->giveStressVector();
714 
715  FloatMatrix S, dNdx, temp, G_ij;
716  S.beMatrixFormOfStress(vS);
718 
719  temp.beProductTOf(S,dNdx);
720  G_ij.beProductOf(dNdx, temp);
721  FloatMatrix K_ij(3,3);
722  K_ij.zero();
723 
724  for ( int i = 1; i <= dNdx.giveNumberOfRows(); i++ ) {
725  for ( int j = i; j <= dNdx.giveNumberOfRows(); j++ ) {
726  K_ij.at(1,1) = K_ij.at(2,2) = K_ij.at(3,3) = G_ij.at(i,j);
727  answer.assemble(K_ij, { (i-1)*3 + 1, (i-1)*3 + 2, (i-1)*3 + 3 }, { (j-1)*3 + 1, (j-1)*3 + 2, (j-1)*3 + 3 } );
728  }
729  }
730  answer.symmetrized();
731 
732 }
733 
734 
735 } // end namespace oofem
double giveDeterminant() const
Returns the trace (sum of diagonal components) of the receiver.
Definition: floatmatrix.C:1408
CrossSection * giveCrossSection()
Definition: element.C:495
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
Definition: solidshell.C:88
virtual void postInitialize()
Performs post initialization steps.
Definition: element.C:752
FloatMatrix KEC
Definition: solidshell.h:91
int nlGeometry
Flag indicating if geometrical nonlinearities apply.
Class and object Domain.
Definition: domain.h:115
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of unknowns.
Definition: element.C:86
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Access method for default integration rule.
Definition: element.h:822
virtual double giveTransformationJacobian(const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation.
Definition: feinterpol.C:43
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
FloatMatrix invKEE
Definition: solidshell.h:90
This class implements a structural material status information.
Definition: structuralms.h:65
void clear()
Clears receiver (zero size).
Definition: floatarray.h:206
static FEI3dHexaLin interpolation
Definition: solidshell.h:59
virtual void computeBmatrixAt(GaussPoint *gp, FloatMatrix &answer, int lowerIndx=1, int upperIndx=ALL_STRAINS)
Computes the geometrical matrix of receiver in given integration point.
Definition: solidshell.C:126
virtual bool hasField(InputFieldType id)=0
Returns true if record contains field identified by idString keyword.
virtual double evaldNdx(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of derivatives of interpolation functions (shape functions) at given point...
Definition: fei3dhexalin.C:63
virtual void computeEASBmatrixAt(GaussPoint *gp, FloatMatrix &answer)
Definition: solidshell.C:277
void computeEVector(FloatArray &answer, FloatArray &lCoords, FloatArray &ae)
Definition: solidshell.C:633
#define _IFT_SolidShell_EAS_type
Definition: solidshell.h:44
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: solidshell.C:102
void computeFVector(FloatArray &answer, FloatArray &lCoords, FloatArray &ae)
Definition: solidshell.C:617
#define S(p)
Definition: mdm.C:481
void computeBondTransformationMatrix(FloatMatrix &answer, FloatMatrix &base)
Definition: solidshell.C:328
MatResponseMode
Describes the character of characteristic material matrix.
virtual void computeBHmatrixAt(GaussPoint *gp, FloatMatrix &answer)
Computes a matrix which, multiplied by the column matrix of nodal displacements, gives the displaceme...
Definition: solidshell.C:265
FloatArray u_k
Definition: solidshell.h:89
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
Definition: floatarray.C:341
void beColumnOf(const FloatMatrix &mat, int col)
Reciever will be set to a given column in a matrix.
Definition: floatarray.C:1114
void beMatrixForm(const FloatArray &aArray)
Definition: floatmatrix.C:1657
virtual void giveStiffnessMatrix_dPdF(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
Computes the material stiffness matrix dPdF of receiver in a given integration point, respecting its history.
virtual void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
Computes constitutive matrix of receiver.
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol.h:132
void plusProductUnsym(const FloatMatrix &a, const FloatMatrix &b, double dV)
Adds to the receiver the product .
Definition: floatmatrix.C:780
void x(int arg1)
#define E(p)
Definition: mdm.C:368
REGISTER_Element(LSpace)
SolidShell(int n, Domain *d)
Definition: solidshell.C:48
virtual void giveFirstPKStresses(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedFIncrement, TimeStep *tStep)=0
Computes the First Piola-Kirchoff stress vector for a given deformation gradient and integration poin...
StructuralCrossSection * giveStructuralCrossSection()
Helper function which returns the structural cross-section for the element.
void times(double f)
Multiplies receiver by factor f.
Definition: floatmatrix.C:1594
Wrapper around element definition to provide FEICellGeometry interface.
Definition: feinterpol.h:95
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
void giveRealStresses(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)
Computes the real stress vector for given strain and integration point.
virtual int setupIntegrationPoints(IntegrationRule &irule, int npoints, Element *element)
Sets up integration rule for the given element.
Definition: crosssection.C:54
int numberOfGaussPoints
Number of integration points as specified by nip.
Definition: element.h:188
Class representing vector of real numbers.
Definition: floatarray.h:82
virtual void postInitialize()
Performs post initialization steps.
Definition: solidshell.C:57
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
void beMatrixFormOfStress(const FloatArray &aArray)
Reciever will be a 3x3 matrix formed from a vector with either 9 or 6 components. ...
Definition: floatmatrix.C:1774
virtual void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
Computes the stiffness matrix of receiver.
const FloatArray & giveStressVector() const
Returns the const pointer to receiver&#39;s stress vector.
Definition: structuralms.h:107
IntegrationPointStatus * giveMaterialStatus()
Returns reference to associated material status (NULL if not defined).
Definition: gausspoint.h:205
virtual void giveJacobianMatrixAt(FloatMatrix &jacobianMatrix, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Gives the jacobian matrix at the local coordinates.
Definition: feinterpol.h:232
FloatArray fE
Definition: solidshell.h:92
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1358
This class implements a Linear 3d 8-node finite element for stress analysis.
Definition: lspace.h:60
Class representing the general Input Record.
Definition: inputrecord.h:101
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 FEInterpolation * giveInterpolation() const
Definition: solidshell.C:98
FloatArray alpha
Definition: solidshell.h:88
void computeAlpha(FloatArray &answer, FloatArray &u)
Definition: solidshell.C:348
virtual void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
Computes the stiffness matrix of receiver.
Definition: solidshell.C:449
std::vector< std::unique_ptr< IntegrationRule > > integrationRulesArray
List of integration rules of receiver (each integration rule contains associated integration points a...
Definition: element.h:170
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual void giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord)
Evaluates nodal representation of real internal forces.
Definition: solidshell.C:371
void beProductTOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
Definition: floatmatrix.C:397
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
virtual void computeBEmatrixAt(GaussPoint *gp, FloatMatrix &answer, TimeStep *tStep)
Definition: solidshell.C:522
virtual void giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord=0)
Evaluates nodal representation of real internal forces.
void beSymVectorFormOfStrain(const FloatMatrix &aMatrix)
Definition: floatarray.C:1014
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
Definition: floatmatrix.C:337
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 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
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
void beInverseOf(const FloatMatrix &src)
Modifies receiver to become inverse of given parameter.
Definition: floatmatrix.C:835
int giveNumberOfRows() const
Returns number of rows of receiver.
Definition: floatmatrix.h:156
void symmetrized()
Initializes the lower half of the receiver according to the upper half.
Definition: floatmatrix.C:1576
Class representing integration point in finite element program.
Definition: gausspoint.h:93
void computeGeometricStiffness(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep)
Definition: solidshell.C:702
Class representing solution step.
Definition: timestep.h:80
int numberOfDofMans
Number of dofmanagers.
Definition: element.h:149
void add(const FloatArray &src)
Adds array src to receiver.
Definition: floatarray.C:156
virtual double evaldNdx(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the matrix of derivatives of interpolation functions (shape functions) at given point...
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
Definition: gausspoint.h:138
Class representing Gaussian-quadrature integration rule.
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:31 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011