OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
structuralelement.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 - 2013 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 
38 #include "Materials/structuralms.h"
42 #include "feinterpol.h"
43 #include "domain.h"
44 #include "material.h"
45 #include "nonlocalmaterialext.h"
46 #include "load.h"
47 #include "boundaryload.h"
48 #include "pointload.h"
49 #include "gausspoint.h"
50 #include "gaussintegrationrule.h"
51 #include "intarray.h"
52 #include "floatarray.h"
53 #include "floatmatrix.h"
55 #include "mathfem.h"
57 #include "unknownnumberingscheme.h"
58 #include "set.h"
59 
60 #ifdef __OOFEG
61  #include "oofeggraphiccontext.h"
62  #include "connectivitytable.h"
63 #endif
64 
65 
66 namespace oofem {
68  Element(n, aDomain)
69 {}
70 
71 
73 {}
74 
75 #if 0
76 void
78  MatResponseMode rMode, GaussPoint *gp,
79  TimeStep *tStep)
80 // Returns the material matrix {E} of the receiver.
81 // type of matrix is determined by this->giveMaterialMode()
82 // rMode parameter determines type of stiffness matrix to be requested
83 // (tangent, secant, ...)
84 {
85  this->giveStructuralCrossSection()->giveCharMaterialStiffnessMatrix(answer, rMode, gp, tStep);
86 }
87 #endif
88 
90 {
91  if ( type != ExternalForcesVector ) {
92  answer.clear();
93  return;
94  }
95  // Just a wrapper for the deadweight body load computations:
96  PointLoad *p = dynamic_cast< PointLoad * >(load);
97  if ( p ) {
98  FloatArray lcoords;
99  if ( this->computeLocalCoordinates( lcoords, p->giveCoordinates() ) ) {
100  this->computePointLoadVectorAt(answer, load, tStep, mode);
101  }
102  } else {
104  this->computeBodyLoadVectorAt(answer, load, tStep, mode);
105  }
106 }
107 
108 void StructuralElement :: computeBoundarySurfaceLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global)
109 {
110  answer.clear();
111  if ( type != ExternalForcesVector ) {
112  return;
113  }
114 
115  FEInterpolation *fei = this->giveInterpolation();
116  if ( !fei ) {
117  OOFEM_ERROR("No interpolator available");
118  }
119 
120  FloatArray n_vec;
121  FloatMatrix n, T;
122  FloatArray force, globalIPcoords;
123  //int nsd = fei->giveNsd();
124 
125  std :: unique_ptr< IntegrationRule >iRule( this->giveBoundarySurfaceIntegrationRule(load->giveApproxOrder(), boundary) );
126 
127  for ( GaussPoint *gp : *iRule ) {
128  const FloatArray &lcoords = gp->giveNaturalCoordinates();
129 
130  if ( load->giveFormulationType() == Load :: FT_Entity ) {
131  load->computeValueAt(force, tStep, lcoords, mode);
132  } else {
133  fei->boundaryLocal2Global( globalIPcoords, boundary, lcoords, FEIElementGeometryWrapper(this) );
134  load->computeValueAt(force, tStep, globalIPcoords, mode);
135  }
136 
138  // We always want the global values in the end, so we might as well compute them here directly:
139  // transform force
140  if ( load->giveCoordSystMode() == Load :: CST_Global ) {
141  // then just keep it in global c.s
142  } else {
144  // transform from local boundary to element local c.s
145  /*if ( this->computeLoadLSToLRotationMatrix(T, boundary, gp) ) {
146  * force.rotatedWith(T, 'n');
147  * }*/
148  // then to global c.s
149  if ( this->computeLoadGToLRotationMtrx(T) ) {
150  force.rotatedWith(T, 't');
151  }
152  }
153 
154  // Construct n-matrix
155  this->computeSurfaceNMatrix(n, boundary, lcoords); // to allow adapttation on element level
156 
158  double thickness = 1.0; // Should be the circumference for axisymm-elements.
159  double dV = thickness * this->computeSurfaceVolumeAround(gp, boundary);
160  answer.plusProduct(n, force, dV);
161  }
162 }
163 
164 double
166 {
167  FEInterpolation *fei = this->giveInterpolation();
168  const FloatArray &lcoords = gp->giveNaturalCoordinates();
169  double J = fei->boundarySurfaceGiveTransformationJacobian( iSurf, lcoords, FEIElementGeometryWrapper(this) );
170 
171  return ( gp->giveWeight() * J );
172 }
173 
174 void
175 StructuralElement :: computeSurfaceNMatrix(FloatMatrix &answer, int boundaryID, const FloatArray &lcoords)
176 {
177  FloatArray n_vec;
178  this->giveInterpolation()->boundarySurfaceEvalN( n_vec, boundaryID, lcoords, FEIElementGeometryWrapper(this) );
179  answer.beNMatrixOf( n_vec, this->giveInterpolation()->giveNsd() );
180 }
181 
182 
183 void StructuralElement :: computeBoundaryEdgeLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global)
184 {
185  answer.clear();
186  if ( type != ExternalForcesVector ) {
187  return;
188  }
189 
190  FEInterpolation *fei = this->giveInterpolation();
191  if ( !fei ) {
192  OOFEM_ERROR("No interpolator available");
193  }
194 
195  FloatMatrix n, T;
196  FloatArray force, globalIPcoords;
197 
198  std :: unique_ptr< IntegrationRule >iRule( this->giveBoundaryEdgeIntegrationRule(load->giveApproxOrder(), boundary) );
199 
200  for ( GaussPoint *gp : *iRule ) {
201  const FloatArray &lcoords = gp->giveNaturalCoordinates();
202 
203  if ( load->giveFormulationType() == Load :: FT_Entity ) {
204  load->computeValueAt(force, tStep, lcoords, mode);
205  } else {
206  fei->boundaryEdgeLocal2Global( globalIPcoords, boundary, lcoords, FEIElementGeometryWrapper(this) );
207  load->computeValueAt(force, tStep, globalIPcoords, mode);
208  }
209 
211  // We always want the global values in the end, so we might as well compute them here directly:
212  // transform force
213  if ( load->giveCoordSystMode() == Load :: CST_Global ) {
214  // then just keep it in global c.s
215  } else {
217  // transform from local boundary to element local c.s
218  if ( this->computeLoadLEToLRotationMatrix(T, boundary, gp) ) {
219  force.rotatedWith(T, 'n');
220  }
221  // then to global c.s
222  if ( this->computeLoadGToLRotationMtrx(T) ) {
223  force.rotatedWith(T, 't');
224  }
225  }
226 
227  // Construct n-matrix
228  //fei->boundaryEdgeEvalN( n_vec, boundary, lcoords, FEIElementGeometryWrapper(this) );
229  //n.beNMatrixOf(n_vec, nsd);
230  this->computeEdgeNMatrix(n, boundary, lcoords); // to allow adapttation on element level
231 
232  double dV = this->computeEdgeVolumeAround(gp, boundary);
233  answer.plusProduct(n, force, dV);
234  }
235 }
236 
237 double
239 {
240  FEInterpolation *fei = this->giveInterpolation();
241  const FloatArray &lcoords = gp->giveNaturalCoordinates();
242  double J = fei->boundaryEdgeGiveTransformationJacobian( iEdge, lcoords, FEIElementGeometryWrapper(this) );
243 
244  return ( gp->giveWeight() * J );
245 }
246 
247 void
248 StructuralElement :: computeEdgeNMatrix(FloatMatrix &answer, int boundaryID, const FloatArray &lcoords)
249 {
250  FloatArray n_vec;
251  this->giveInterpolation()->boundaryEdgeEvalN( n_vec, boundaryID, lcoords, FEIElementGeometryWrapper(this) );
252  answer.beNMatrixOf( n_vec, this->giveInterpolation()->giveNsd() );
253 }
254 
255 
256 
257 
258 void
260 // Computes numerically the load vector of the receiver due to the body
261 // loads, at tStep.
262 // load is assumed to be in global cs.
263 // load vector is then transformed to coordinate system in each node.
264 // (should be global coordinate system, but there may be defined
265 // different coordinate system in each node)
266 {
267  double dens, dV;
268  FloatArray force, ntf;
269  FloatMatrix n, T;
270 
271  if ( ( forLoad->giveBCGeoType() != BodyLoadBGT ) || ( forLoad->giveBCValType() != ForceLoadBVT ) ) {
272  OOFEM_ERROR("unknown load type");
273  }
274 
275  // note: force is assumed to be in global coordinate system.
276  forLoad->computeComponentArrayAt(force, tStep, mode);
277  // transform from global to element local c.s
278  if ( this->computeLoadGToLRotationMtrx(T) ) {
279  force.rotatedWith(T, 'n');
280  }
281 
282  answer.clear();
283 
284  if ( force.giveSize() ) {
285  for ( GaussPoint *gp : *this->giveDefaultIntegrationRulePtr() ) {
287  dV = this->computeVolumeAround(gp);
288  dens = this->giveCrossSection()->give('d', gp);
289  ntf.beTProductOf(n, force);
290  answer.add(dV * dens, ntf);
291  }
292  } else {
293  return;
294  }
295 }
296 
297 void
299 {
300  FloatArray force, lcoords;
301  FloatMatrix T, n;
302 
303  PointLoad *pointLoad = dynamic_cast< PointLoad * >(load);
304  FloatArray coords = pointLoad->giveCoordinates();
305  pointLoad->computeValueAt(force, tStep, coords, mode);
306  if ( this->computeLocalCoordinates( lcoords, pointLoad->giveCoordinates() ) ) {
307  this->computeNmatrixAt(lcoords, n);
308  answer.beTProductOf(n, force);
309  } else {
310  OOFEM_WARNING("point load outside element");
311  }
312 
313  // transform force
314  if ( pointLoad->giveCoordSystMode() == Load :: CST_Global ) {
315  // transform from global to element local c.s
316  if ( this->computeLoadGToLRotationMtrx(T) ) {
317  answer.rotatedWith(T, 'n');
318  }
319  }
320 }
321 
322 int
324 {
325  IntegrationRule *iRule = this->giveIntegrationRule(0);
326  // returns necessary number of ip to integrate the mass matrix
327  // \int_V N^T*N dV => (order of the approximation)*2 (constant density assumed)
329  int order = this->giveInterpolation()->giveInterpolationOrder();
331 }
332 
333 void
334 StructuralElement :: computeConsistentMassMatrix(FloatMatrix &answer, TimeStep *tStep, double &mass, const double *ipDensity)
335 // Computes numerically the consistent (full) mass matrix of the receiver.
336 {
337  int ndofs = computeNumberOfDofs();
338  double density, dV;
339  FloatMatrix n;
340  GaussIntegrationRule iRule(1, this, 1, 1);
341  IntArray mask;
342 
343  answer.resize(ndofs, ndofs);
344  answer.zero();
345  if ( !this->isActivated(tStep) ) {
346  return;
347  }
348 
349  this->setupIRForMassMtrxIntegration(iRule);
350 
351  this->giveMassMtrxIntegrationgMask(mask);
352 
353  mass = 0.;
354 
355  for ( GaussPoint *gp : iRule ) {
357  density = this->giveCrossSection()->give('d', gp);
358 
359  if ( ipDensity != NULL ) {
360  // Override density if desired
361  density = * ipDensity;
362  }
363 
364  dV = this->computeVolumeAround(gp);
365  mass += density * dV;
366 
367  if ( mask.isEmpty() ) {
368  answer.plusProductSymmUpper(n, n, density * dV);
369  } else {
370  for ( int i = 1; i <= ndofs; i++ ) {
371  for ( int j = i; j <= ndofs; j++ ) {
372  double summ = 0.;
373  for ( int k = 1; k <= n.giveNumberOfRows(); k++ ) {
374  if ( mask.at(k) == 0 ) {
375  continue;
376  }
377 
378  summ += n.at(k, i) * n.at(k, j);
379  }
380 
381  answer.at(i, j) += summ * density * dV;
382  }
383  }
384  }
385  }
386 
387  answer.symmetrized();
388 }
389 
390 void
392 {
393  int nip;
394  if ( ( nip = this->giveNumberOfIPForMassMtrxIntegration() ) == 0 ) {
395  OOFEM_ERROR("no integration points available");
396  }
397  iRule.setUpIntegrationPoints( this->giveIntegrationDomain(), nip, this->giveMaterialMode() );
398 }
399 
400 void
402 // Returns the lumped mass matrix of the receiver.
403 {
404  double mass;
405 
406  this->computeConsistentMassMatrix(answer, tStep, mass);
407 }
408 
409 void
411 // Returns the lumped mass matrix of the receiver.
412 {
413  double mass = 0.;
414 
415  IntArray nodeDofIDMask, dimFlag(3);
416  int indx = 0, ldofs, dim;
417  double summ;
418 
419  if ( !this->isActivated(tStep) ) {
420  int ndofs = computeNumberOfDofs();
421  answer.resize(ndofs, ndofs);
422  answer.zero();
423  return;
424  }
425 
426  this->computeConsistentMassMatrix(answer, tStep, mass);
427  ldofs = answer.giveNumberOfRows();
428 
429  for ( int i = 1; i <= this->giveNumberOfDofManagers(); i++ ) {
430  this->giveDofManDofIDMask(i, nodeDofIDMask);
431  //this->giveDofManager(i)->giveLocationArray(nodeDofIDMask, nodalArray);
432  for ( int j = 1; j <= nodeDofIDMask.giveSize(); j++ ) {
433  indx++;
434  // zero all off-diagonal terms
435  for ( int k = 1; k <= ldofs; k++ ) {
436  if ( k != indx ) {
437  answer.at(indx, k) = 0.;
438  answer.at(k, indx) = 0.;
439  }
440  }
441 
442  if ( ( nodeDofIDMask.at(j) != D_u ) && ( nodeDofIDMask.at(j) != D_v ) && ( nodeDofIDMask.at(j) != D_w ) ) {
443  // zero corresponding diagonal member too <= no displacement dof
444  answer.at(indx, indx) = 0.;
445  } else if ( nodeDofIDMask.at(j) == D_u ) {
446  dimFlag.at(1) = 1;
447  } else if ( nodeDofIDMask.at(j) == D_v ) {
448  dimFlag.at(2) = 1;
449  } else if ( nodeDofIDMask.at(j) == D_w ) {
450  dimFlag.at(3) = 1;
451  }
452  }
453  }
454 
455  if ( indx != ldofs ) {
456  OOFEM_ERROR("internal consistency check failed");
457  }
458 
459  dim = dimFlag.at(1) + dimFlag.at(2) + dimFlag.at(3);
460  summ = 0.;
461  for ( int k = 1; k <= ldofs; k++ ) {
462  summ += answer.at(k, k);
463  }
464 
465  answer.times(dim * mass / summ);
466 }
467 
468 
469 void
471 // Computes at tStep the resulting force due to all temperature loads that act
472 // on the receiver. This force is used by the element for computing its
473 // body load vector.
474 {
475  int n, nLoads;
476  Load *load;
477  FloatArray gCoords, temperature;
479 
480  if ( this->computeGlobalCoordinates( gCoords, gp->giveNaturalCoordinates() ) == 0 ) {
481  OOFEM_ERROR("computeGlobalCoordinates failed");
482  }
483 
484  answer.clear();
485  nLoads = this->giveBodyLoadArray()->giveSize();
486  for ( int i = 1; i <= nLoads; i++ ) {
487  n = bodyLoadArray.at(i);
488  load = domain->giveLoad(n);
489  if ( load->giveBCValType() == TemperatureBVT ) {
490  load->computeValueAt(temperature, tStep, gCoords, mode);
491  answer.add(temperature);
492  }
493  }
494 
495 
496  // new approach using sets
497 
498  for ( int i = 1; i <= nbc; ++i ) {
499 
501 
502  if (( load = dynamic_cast< StructuralTemperatureLoad * >(bc) )) {
503 
504  if ( bc->giveSetNumber() && bc->isImposed(tStep) ) {
505  if ( load->giveBCValType() == TemperatureBVT ) {
506 
507  Set *set = domain->giveSet( bc->giveSetNumber() );
508  const IntArray &elements = set->giveElementList();
509 
510  if (elements.contains(this->giveNumber() ) ) {
511  load->computeValueAt(temperature, tStep, gCoords, mode);
512  answer.add(temperature);
513  }
514  }
515  }
516  }
517  }
518 
519 }
520 
521 void
523 // Computes at tStep all eigenstrains that act on the receiver. Eigenstrains are used by the element for computing its body load vector.
524 {
525  int n, nLoads;
526  Load *load;
527  FloatArray gCoords, eigenstrain;
529 
530  if ( this->computeGlobalCoordinates( gCoords, gp->giveNaturalCoordinates() ) == 0 ) {
531  OOFEM_ERROR("computeGlobalCoordinates failed");
532  }
533 
534  answer.clear();
535 
536  // old approach preserved for compatibility
537 
538  nLoads = this->giveBodyLoadArray()->giveSize();
539  for ( int i = 1; i <= nLoads; i++ ) {
540  n = bodyLoadArray.at(i);
541  load = domain->giveLoad(n);
542  if ( load->giveBCValType() == EigenstrainBVT ) {
543  load->computeValueAt(eigenstrain, tStep, gCoords, mode);
544  answer.add(eigenstrain);
545  }
546  }
547 
548  // new approach using sets
549 
550  for ( int i = 1; i <= nbc; ++i ) {
551 
553 
554  if (( load = dynamic_cast< StructuralEigenstrainLoad * >(bc) )) {
555  if ( bc->giveSetNumber() && bc->isImposed(tStep) ) {
556  if ( load->giveBCValType() == EigenstrainBVT ) {
557 
558  Set *set = domain->giveSet( bc->giveSetNumber() );
559  const IntArray &elements = set->giveElementList();
560 
561  if (elements.contains(this->giveNumber() ) ) {
562  load->computeValueAt(eigenstrain, tStep, gCoords, mode);
563  answer.add(eigenstrain);
564  }
565  }
566  }
567  }
568  }
569 }
570 
571 
572 void
574 {
575  FloatArray u;
576  FloatMatrix n;
577  this->computeNmatrixAt(lcoords, n);
578  this->computeVectorOf(mode, tStep, u);
579  answer.beProductOf(n, u);
580 }
581 
582 void
584  TimeStep *tStep)
585 // Computes numerically the stiffness matrix of the receiver.
586 {
587  int iStartIndx, iEndIndx, jStartIndx, jEndIndx;
588  double dV;
589  FloatMatrix d, bi, bj, dbj, dij;
590  bool matStiffSymmFlag = this->giveCrossSection()->isCharacteristicMtrxSymmetric(rMode);
591 
592  answer.clear();
593 
594  if ( !this->isActivated(tStep) ) {
595  return;
596  }
597 
598  if ( integrationRulesArray.size() > 1 ) {
599  for ( int i = 0; i < ( int ) integrationRulesArray.size(); i++ ) {
600  iStartIndx = integrationRulesArray [ i ]->getStartIndexOfLocalStrainWhereApply();
601  iEndIndx = integrationRulesArray [ i ]->getEndIndexOfLocalStrainWhereApply();
602  for ( int j = 0; j < ( int ) integrationRulesArray.size(); j++ ) {
603  IntegrationRule *iRule;
604  jStartIndx = integrationRulesArray [ j ]->getStartIndexOfLocalStrainWhereApply();
605  jEndIndx = integrationRulesArray [ j ]->getEndIndexOfLocalStrainWhereApply();
606  if ( i == j ) {
607  iRule = integrationRulesArray [ i ].get();
608  } else if ( integrationRulesArray [ i ]->giveNumberOfIntegrationPoints() < integrationRulesArray [ j ]->giveNumberOfIntegrationPoints() ) {
609  iRule = integrationRulesArray [ i ].get();
610  } else {
611  iRule = integrationRulesArray [ j ].get();
612  }
613 
614  for ( GaussPoint *gp : *iRule ) {
615  this->computeBmatrixAt(gp, bi, iStartIndx, iEndIndx);
616  this->computeConstitutiveMatrixAt(d, rMode, gp, tStep);
617  dij.beSubMatrixOf(d, iStartIndx, iEndIndx, jStartIndx, jEndIndx);
618  if ( i != j ) {
619  this->computeBmatrixAt(gp, bj, jStartIndx, jEndIndx);
620  } else {
621  bj = bi;
622  }
623 
624  dV = this->computeVolumeAround(gp);
625  dbj.beProductOf(dij, bj);
626  if ( matStiffSymmFlag ) {
627  answer.plusProductSymmUpper(bi, dbj, dV);
628  } else {
629  answer.plusProductUnsym(bi, dbj, dV);
630  }
631  }
632  }
633  }
634  } else {
635  for ( GaussPoint *gp : *this->giveDefaultIntegrationRulePtr() ) {
636  this->computeBmatrixAt(gp, bj);
637  this->computeConstitutiveMatrixAt(d, rMode, gp, tStep);
638  dV = this->computeVolumeAround(gp);
639  dbj.beProductOf(d, bj);
640  if ( matStiffSymmFlag ) {
641  answer.plusProductSymmUpper(bj, dbj, dV);
642  } else {
643  answer.plusProductUnsym(bj, dbj, dV);
644  }
645  }
646  }
647 
648  if ( matStiffSymmFlag ) {
649  answer.symmetrized();
650  }
651 }
652 
654  MatResponseMode rMode, TimeStep *tStep)
655 {
656  FloatMatrix temp, bj, d, dbj;
657  int ndofs = this->computeNumberOfDofs();
658  bool matStiffSymmFlag = this->giveCrossSection()->isCharacteristicMtrxSymmetric(rMode);
659  IntArray irlocnum;
660 
661  answer.resize(ndofs, ndofs);
662  answer.zero();
663 
664  FloatMatrix *m = & answer;
665  if ( this->giveInterpolation() && this->giveInterpolation()->hasSubPatchFormulation() ) {
666  m = & temp;
667  }
668 
669  // loop over individual integration rules
670  for ( auto &iRule : integrationRulesArray ) {
671  // loop over individual integration points
672  for ( GaussPoint *gp : *iRule ) {
673  double dV = this->computeVolumeAround(gp);
674  this->computeBmatrixAt(gp, bj);
675  this->computeConstitutiveMatrixAt(d, rMode, gp, tStep);
676 
677  dbj.beProductOf(d, bj);
678  if ( matStiffSymmFlag ) {
679  m->plusProductSymmUpper(bj, dbj, dV);
680  } else {
681  m->plusProductUnsym(bj, dbj, dV);
682  }
683  }
684 
685  // localize irule contribution into element matrix
686  if ( this->giveIntegrationRuleLocalCodeNumbers(irlocnum, * iRule) ) {
687  answer.assemble(* m, irlocnum);
688  m->clear();
689  }
690  } // end loop over irules
691 
692  if ( matStiffSymmFlag ) {
693  answer.symmetrized();
694  }
695 }
696 
697 
698 void
700 // Computes the vector containing the strains at the Gauss point gp of
701 // the receiver, at time step tStep. The nature of these strains depends
702 // on the element's type.
703 {
704  FloatMatrix b;
705  FloatArray u;
706 
707  if ( !this->isActivated(tStep) ) {
709  answer.zero();
710  return;
711  }
712 
713  this->computeBmatrixAt(gp, b);
714  this->computeVectorOf(VM_Total, tStep, u);
715 
716  // subtract initial displacements, if defined
717  if ( initialDisplacements ) {
719  }
720  answer.beProductOf(b, u);
721 }
722 
723 #if 0
724 void
726 {
727  this->giveStructuralCrossSection()->giveRealStresses(answer, gp, strain, tStep);
728 }
729 #endif
730 
731 void
733  TimeStep *tStep, int useUpdatedGpRecord)
734 //
735 // returns nodal representation of real internal forces - necessary only for
736 // non-linear analysis.
737 // if useGpRecord == 1 then data stored in gp->giveStressVector() are used
738 // instead computing stressVector through this->ComputeStressVector();
739 // this must be done after you want internal forces after element->updateYourself()
740 // has been called for the same time step.
741 //
742 {
743  FloatMatrix b;
744  FloatArray u, stress, strain;
745 
746  // This function can be quite costly to do inside the loops when one has many slave dofs.
747  this->computeVectorOf(VM_Total, tStep, u);
748  // subtract initial displacements, if defined
749  if ( initialDisplacements ) {
751  }
752 
753  // zero answer will resize accordingly when adding first contribution
754  answer.clear();
755 
756  for ( GaussPoint *gp : *this->giveDefaultIntegrationRulePtr() ) {
757  StructuralMaterialStatus *matStat = static_cast< StructuralMaterialStatus * >( gp->giveMaterialStatus() );
758  this->computeBmatrixAt(gp, b);
759 
760  if ( useUpdatedGpRecord == 1 ) {
761  stress = matStat->giveStressVector();
762  } else {
763  if ( !this->isActivated(tStep) ) {
765  strain.zero();
766  }
767  strain.beProductOf(b, u);
768  this->computeStressVector(stress, strain, gp, tStep);
769  }
770 
771  // updates gp stress and strain record acording to current
772  // increment of displacement
773  if ( stress.giveSize() == 0 ) {
774  break;
775  }
776 
777  // now every gauss point has real stress vector
778  // compute nodal representation of internal forces using f = B^T*Sigma dV
779  double dV = this->computeVolumeAround(gp);
780  if ( stress.giveSize() == 6 ) {
781  // It may happen that e.g. plane strain is computed
782  // using the default 3D implementation. If so,
783  // the stress needs to be reduced.
784  // (Note that no reduction will take place if
785  // the simulation is actually 3D.)
786  FloatArray stressTemp;
788  answer.plusProduct(b, stressTemp, dV);
789  } else {
790  answer.plusProduct(b, stress, dV);
791  }
792  }
793 
794  // if inactive update state, but no contribution to global system
795  if ( !this->isActivated(tStep) ) {
796  answer.zero();
797  return;
798  }
799 }
800 
801 
802 
803 void
805  TimeStep *tStep, int useUpdatedGpRecord)
806 //
807 // returns nodal representation of real internal forces - necessary only for
808 // non-linear analysis.
809 // if useGpRecord == 1 then data stored in gp->giveStressVector() are used
810 // instead computing stressVector through this->ComputeStressVector();
811 // this must be done after you want internal forces after element->updateYourself()
812 // has been called for the same time step.
813 //
814 {
815  FloatMatrix b;
816  FloatArray temp, u, stress, strain;
817  IntArray irlocnum;
818 
819  // This function can be quite costly to do inside the loops when one has many slave dofs.
820  this->computeVectorOf(VM_Total, tStep, u);
821  // subtract initial displacements, if defined
822  if ( initialDisplacements ) {
824  }
825 
826  // zero answer will resize accordingly when adding first contribution
827  answer.clear();
828 
829  FloatArray *m = & answer;
830  if ( this->giveInterpolation() && this->giveInterpolation()->hasSubPatchFormulation() ) {
831  m = & temp;
832  }
833 
834  // loop over individual integration rules
835  for ( auto &iRule : integrationRulesArray ) {
836  for ( GaussPoint *gp : *iRule ) {
837  StructuralMaterialStatus *matStat = static_cast< StructuralMaterialStatus * >( gp->giveMaterialStatus() );
838  this->computeBmatrixAt(gp, b);
839 
840  if ( useUpdatedGpRecord == 1 ) {
841  stress = matStat->giveStressVector();
842  } else {
843  if ( !this->isActivated(tStep) ) {
845  strain.zero();
846  }
847  strain.beProductOf(b, u);
848  this->computeStressVector(stress, strain, gp, tStep);
849  }
850 
851  //
852  // updates gp stress and strain record acording to current
853  // increment of displacement
854  //
855  if ( stress.giveSize() == 0 ) {
856  break;
857  }
858 
859  //
860  // now every gauss point has real stress vector
861  //
862  // compute nodal representation of internal forces using f = B^T*Sigma dV
863  //
864  double dV = this->computeVolumeAround(gp);
865  m->plusProduct(b, stress, dV);
866 
867  // localize irule contribution into element matrix
868  if ( this->giveIntegrationRuleLocalCodeNumbers(irlocnum, * iRule) ) {
869  answer.assemble(* m, irlocnum);
870  m->clear();
871  }
872  }
873  }
874 
875  // if inactive update state, but no contribution to global system
876  if ( !this->isActivated(tStep) ) {
877  answer.zero();
878  return;
879  }
880 }
881 
882 
883 void
885  CharType mtrx, TimeStep *tStep)
886 //
887 // returns characteristics matrix of receiver according to mtrx
888 //
889 {
890  if ( mtrx == TangentStiffnessMatrix ) {
891  this->computeStiffnessMatrix(answer, TangentStiffness, tStep);
892  } else if ( mtrx == SecantStiffnessMatrix ) {
893  this->computeStiffnessMatrix(answer, SecantStiffness, tStep);
894  } else if ( mtrx == ElasticStiffnessMatrix ) {
895  this->computeStiffnessMatrix(answer, ElasticStiffness, tStep);
896  } else if ( mtrx == MassMatrix ) {
897  this->computeMassMatrix(answer, tStep);
898  } else if ( mtrx == LumpedMassMatrix ) {
899  this->computeLumpedMassMatrix(answer, tStep);
900  } else if ( mtrx == InitialStressMatrix ) {
901  this->computeInitialStressMatrix(answer, tStep);
902  } else {
903  OOFEM_ERROR( "Unknown Type of characteristic mtrx (%s)", __CharTypeToString(mtrx) );
904  }
905 }
906 
907 
908 
909 void
911  TimeStep *tStep)
912 //
913 // returns characteristics vector of receiver according to mtrx
914 //
915 {
916  if ( mtrx == ExternalForcesVector ) {
917  //this->computeForceLoadVector(answer, tStep, mode); // bp: assembled by emodel
918  answer.resize(0);
919  } else if ( ( mtrx == InternalForcesVector ) && ( mode == VM_Total ) ) {
920  this->giveInternalForcesVector(answer, tStep);
921  } else if ( ( mtrx == LastEquilibratedInternalForcesVector ) && ( mode == VM_Total ) ) {
922  /* here tstep is not relevant, we set useUpdatedGpRecord = 1
923  * and this will cause to integrate internal forces using existing (nontemp, equlibrated) stresses in
924  * statuses. Mainly used to compute reaction forces */
925  this->giveInternalForcesVector(answer, tStep, 1);
926  } else if ( mtrx == LumpedMassMatrix ) {
927  FloatMatrix M;
928  this->computeLumpedMassMatrix(M, tStep);
929  answer.resize( M.giveNumberOfColumns() );
930  for ( int i = 0; i < M.giveNumberOfColumns(); ++i ) {
931  answer [ i ] = M(i, i);
932  }
933  } else {
934  OOFEM_ERROR( "Unknown Type of characteristic mtrx (%s)", __CharTypeToString(mtrx) );
935  }
936 }
937 
938 void
940 {
942 
943  // record initial displacement if element not active
944  if ( activityTimeFunction && !isActivated(tStep) ) {
945  if ( !initialDisplacements ) {
946  initialDisplacements.reset( new FloatArray() );
947  }
948 
949  this->computeVectorOf(VM_Total, tStep, * initialDisplacements);
950  }
951 }
952 
953 
954 void
956 // Updates the receiver at end of step.
957 {
958  FloatArray stress, strain;
959 
960  // force updating strains & stresses
961  for ( auto &iRule : integrationRulesArray ) {
962  for ( GaussPoint *gp : *iRule ) {
963  this->computeStrainVector(strain, gp, tStep);
964  this->computeStressVector(stress, strain, gp, tStep);
965  }
966  }
967 }
968 
969 void
971 // Updates the local material quantities before nonlocal averaging
972 {
973  /*
974  * Nonlocal material, related to receiver is also passed, because it is not possible to
975  * ask receiver for its material model pointer using giveMaterial() service (returns Material type)
976  * and then to cast this Material pointer into NonlocalMaterial pointer type,
977  * because it is possible to cast only the pointer of derived class to pointer to base class.
978  */
979  FloatArray epsilon;
980 
981  if ( this->giveParallelMode() == Element_remote ) {
982  return;
983  }
984 
985  // force updating local quantities
986  for ( auto &iRule : integrationRulesArray ) {
987  for ( GaussPoint *gp : *iRule ) {
988  this->computeStrainVector(epsilon, gp, tStep);
989  // provide material local strain increment - as is provided to computeRealStresVector
990  // allows to update internal vars to be averaged to new state
991 
992  // not possible - produces wrong result
994  materialExt = static_cast< StructuralNonlocalMaterialExtensionInterface * >( this->giveStructuralCrossSection()->
995  giveMaterialInterface(NonlocalMaterialExtensionInterfaceType, gp) );
996 
997  if ( !materialExt ) {
998  return; //_error("updateBeforeNonlocalAverage: material with no StructuralNonlocalMaterial support");
999  }
1000  materialExt->updateBeforeNonlocAverage(epsilon, gp, tStep);
1001  }
1002  }
1003 }
1004 
1005 
1006 int
1008 //
1009 // check internal consistency
1010 // mainly tests, whether crossSection data
1011 // are safe for conversion to "Structural" version
1012 //
1013 {
1014  int result = 1;
1015  if ( !this->giveCrossSection()->testCrossSectionExtension(CS_StructuralCapability) ) {
1016  OOFEM_WARNING( "cross-section %s without structural support", this->giveCrossSection()->giveClassName() );
1017  result = 0;
1018  }
1019 
1020  return result;
1021 }
1022 
1023 void
1025 {
1026  int numNodes = this->giveNumberOfDofManagers();
1027  FloatArray N(numNodes);
1028 
1029  int dim = this->giveSpatialDimension();
1030 
1031  answer.resize(dim, dim * numNodes);
1032  answer.zero();
1033  giveInterpolation()->evalN( N, iLocCoord, FEIElementGeometryWrapper(this) );
1034 
1035  answer.beNMatrixOf(N, dim);
1036 }
1037 
1038 void
1040 {
1041  /*
1042  * function for condensation of stiffness matrix and if requested of load vector and
1043  * initial stress or mass matrices (if mass and load arguments are nonzero (not NULL) then
1044  * their condensation is done).
1045  * Based on Rayleigh-Ritz method
1046  */
1047  int i, ii, j, k;
1048  int nkon = what->giveSize();
1049  int size = stiff->giveNumberOfRows();
1050  double coeff, dii, lii = 0;
1051  FloatArray gaussCoeff;
1052  // stored gauss coefficient
1053  // for mass condensation
1054 
1055  // check
1056  if ( !stiff->isSquare() ) {
1057  OOFEM_ERROR("stiffness size mismatch");
1058  }
1059 
1060  if ( mass ) {
1061  if ( !( mass->isSquare() && mass->giveNumberOfRows() == size ) ) {
1062  OOFEM_ERROR("mass size mismatch");
1063  }
1064  }
1065 
1066  if ( load ) {
1067  if ( !( load->giveSize() == size ) ) {
1068  OOFEM_ERROR("load size mismatch");
1069  }
1070  }
1071 
1072  // create gauss coeff array if mass condensation requested
1073  if ( mass ) {
1074  gaussCoeff.resize(size);
1075  }
1076 
1077  for ( i = 1; i <= nkon; i++ ) {
1078  ii = what->at(i);
1079  if ( ( ii > size ) || ( ii <= 0 ) ) {
1080  OOFEM_ERROR("wrong dof number");
1081  }
1082 
1083  dii = stiff->at(ii, ii);
1084  if ( load ) {
1085  lii = load->at(ii);
1086  }
1087 
1088  // stiffness matrix condensation
1089  for ( j = 1; j <= size; j++ ) {
1090  coeff = -stiff->at(j, ii) / dii;
1091  if ( ii != j ) {
1092  for ( k = 1; k <= size; k++ ) {
1093  stiff->at(j, k) += stiff->at(ii, k) * coeff;
1094  }
1095  }
1096 
1097  if ( load ) {
1098  load->at(j) += coeff * lii;
1099  }
1100 
1101  if ( mass ) {
1102  gaussCoeff.at(j) = coeff;
1103  }
1104  }
1105 
1106  for ( k = 1; k <= size; k++ ) {
1107  stiff->at(ii, k) = 0.;
1108  stiff->at(k, ii) = 0.;
1109  }
1110 
1111  // mass or initial stress matrix condensation
1112  // uses gauss coefficients stored in gaussCoeff.
1113  if ( mass ) {
1114  for ( j = 1; j <= size; j++ ) {
1115  for ( k = 1; k <= size; k++ ) {
1116  if ( ( ii != j ) && ( ii != k ) ) {
1117  mass->at(j, k) += mass->at(j, ii) * gaussCoeff.at(k) +
1118  mass->at(ii, k) * gaussCoeff.at(j) +
1119  mass->at(ii, ii) * gaussCoeff.at(j) * gaussCoeff.at(k);
1120  }
1121  }
1122  }
1123 
1124  for ( k = 1; k <= size; k++ ) {
1125  mass->at(ii, k) = 0.;
1126  mass->at(k, ii) = 0.;
1127  }
1128  }
1129  }
1130 }
1131 
1132 
1133 int
1135 {
1136  if ( type == IST_DisplacementVector ) {
1137  FloatArray u;
1138  FloatMatrix N;
1139  this->computeVectorOf(VM_Total, tStep, u);
1141  answer.beProductOf(N, u);
1142  return 1;
1143  }
1144  return Element :: giveIPValue(answer, gp, type, tStep);
1145 }
1146 
1147 
1148 void
1150 {
1151  IntArray elemLocArry;
1152 
1153  locationArray.clear();
1154  // loop over element IP
1155  for ( IntegrationPoint *ip : *this->giveDefaultIntegrationRulePtr() ) {
1156  auto interface = static_cast< NonlocalMaterialStiffnessInterface * >( this->giveStructuralCrossSection()->
1157  giveMaterialInterface(NonlocalMaterialStiffnessInterfaceType, ip) );
1158 
1159 
1160  if ( interface == NULL ) {
1161  locationArray.clear();
1162  return;
1163  }
1164 
1165  auto integrationDomainList = interface->
1166  NonlocalMaterialStiffnessInterface_giveIntegrationDomainList(ip);
1167  // loop over IP influencing IPs, extract corresponding element numbers and their code numbers
1168  for ( auto &lir : *integrationDomainList ) {
1169  lir.nearGp->giveElement()->giveLocationArray(elemLocArry, s);
1170  /*
1171  * Currently no care given to multiple occurences of code number in locationArray.
1172  */
1173  locationArray.followedBy(elemLocArry, 20);
1174  }
1175  } // end loop over IPs
1176 }
1177 
1178 
1179 void
1181 {
1183 
1184  if ( !this->isActivated(tStep) ) {
1185  return;
1186  }
1187 
1188  // loop over element IP
1189  for ( IntegrationPoint *ip : *this->giveDefaultIntegrationRulePtr() ) {
1190  auto interface = static_cast< NonlocalMaterialStiffnessInterface * >( this->giveStructuralCrossSection()->
1191  giveMaterialInterface(NonlocalMaterialStiffnessInterfaceType, ip) );
1192  if ( interface == NULL ) {
1193  return;
1194  }
1195 
1196  interface->NonlocalMaterialStiffnessInterface_addIPContribution(dest, s, ip, tStep);
1197  }
1198 }
1199 
1200 
1201 int
1203 {
1204  int result = 1;
1205  FloatArray strain;
1206 
1207  for ( auto &iRule : integrationRulesArray ) {
1208  for ( IntegrationPoint *ip : *iRule ) {
1209  auto interface = static_cast< MaterialModelMapperInterface * >( this->giveStructuralCrossSection()->
1210  giveMaterialInterface(MaterialModelMapperInterfaceType, ip) );
1211 
1212  if ( interface == NULL ) {
1213  return 0;
1214  }
1215  this->computeStrainVector(strain, ip, tStep);
1216  result &= interface->MMI_update(ip, tStep, & strain);
1217  }
1218  }
1219 
1220  return result;
1221 }
1222 
1225 {
1226  return Element :: initializeFrom(ir);
1227 }
1228 
1230 {
1232 
1234 }
1235 
1236 
1238 {
1239  return static_cast< StructuralCrossSection * >( this->giveCrossSection() );
1240 }
1241 
1243 {
1245  for ( auto &iRule : integrationRulesArray ) {
1246  for ( GaussPoint *gp : *iRule ) {
1247  cs->createMaterialStatus(* gp);
1248  }
1249  }
1250 }
1251 
1252 
1253 #ifdef __OOFEG
1254 
1255 //
1256 int
1258 {
1259  if ( type == IST_DisplacementVector ) {
1260  Node *n = this->giveNode(node);
1261  answer.resize(3);
1262  answer.at(1) = n->giveUpdatedCoordinate(1, tStep) - n->giveCoordinate(1);
1263  answer.at(2) = n->giveUpdatedCoordinate(2, tStep) - n->giveCoordinate(2);
1264  answer.at(3) = n->giveUpdatedCoordinate(3, tStep) - n->giveCoordinate(3);
1265  return 1;
1266  } else {
1267  return Element :: giveInternalStateAtNode(answer, type, mode, node, tStep);
1268  }
1269 }
1270 
1271 
1272 
1273 void
1275 {
1276  if ( mtrx == TangentStiffnessMatrix ||
1277  mtrx == SecantStiffnessMatrix || mtrx == ElasticStiffnessMatrix ) {
1278  int i, j, n;
1279  IntArray loc;
1281 
1282  WCRec p [ 4 ];
1283  GraphicObj *go;
1284 
1285  EASValsSetLineWidth(OOFEG_SPARSE_PROFILE_WIDTH);
1286  EASValsSetColor( gc.getStandardSparseProfileColor() );
1287  EASValsSetLayer(OOFEG_SPARSE_PROFILE_LAYER);
1288  EASValsSetFillStyle(FILL_SOLID);
1289 
1290  n = loc.giveSize();
1291  for ( i = 1; i <= n; i++ ) {
1292  if ( loc.at(i) == 0 ) {
1293  continue;
1294  }
1295 
1296  for ( j = i; j <= n; j++ ) {
1297  if ( loc.at(j) == 0 ) {
1298  continue;
1299  }
1300 
1301  if ( gc.getSparseProfileMode() == 0 ) {
1302  p [ 0 ].x = ( FPNum ) loc.at(i) - 0.5;
1303  p [ 0 ].y = ( FPNum ) loc.at(j) - 0.5;
1304  p [ 0 ].z = 0.;
1305  p [ 1 ].x = ( FPNum ) loc.at(i) + 0.5;
1306  p [ 1 ].y = ( FPNum ) loc.at(j) - 0.5;
1307  p [ 1 ].z = 0.;
1308  p [ 2 ].x = ( FPNum ) loc.at(i) + 0.5;
1309  p [ 2 ].y = ( FPNum ) loc.at(j) + 0.5;
1310  p [ 2 ].z = 0.;
1311  p [ 3 ].x = ( FPNum ) loc.at(i) - 0.5;
1312  p [ 3 ].y = ( FPNum ) loc.at(j) + 0.5;
1313  p [ 3 ].z = 0.;
1314  go = CreateQuad3D(p);
1315  EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | LAYER_MASK, go);
1316  EMAddGraphicsToModel(ESIModel(), go);
1317 
1318  p [ 0 ].x = ( FPNum ) loc.at(j) - 0.5;
1319  p [ 0 ].y = ( FPNum ) loc.at(i) - 0.5;
1320  p [ 0 ].z = 0.;
1321  p [ 1 ].x = ( FPNum ) loc.at(j) + 0.5;
1322  p [ 1 ].y = ( FPNum ) loc.at(i) - 0.5;
1323  p [ 1 ].z = 0.;
1324  p [ 2 ].x = ( FPNum ) loc.at(j) + 0.5;
1325  p [ 2 ].y = ( FPNum ) loc.at(i) + 0.5;
1326  p [ 2 ].z = 0.;
1327  p [ 3 ].x = ( FPNum ) loc.at(j) - 0.5;
1328  p [ 3 ].y = ( FPNum ) loc.at(i) + 0.5;
1329  p [ 3 ].z = 0.;
1330  go = CreateQuad3D(p);
1331  EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | LAYER_MASK, go);
1332  EMAddGraphicsToModel(ESIModel(), go);
1333  } else {
1334  p [ 0 ].x = ( FPNum ) loc.at(i);
1335  p [ 0 ].y = ( FPNum ) loc.at(j);
1336  p [ 0 ].z = 0.;
1337 
1338  EASValsSetMType(SQUARE_MARKER);
1339  go = CreateMarker3D(p);
1340  EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | VECMTYPE_MASK, go);
1341  EMAddGraphicsToModel(ESIModel(), go);
1342 
1343  p [ 0 ].x = ( FPNum ) loc.at(j);
1344  p [ 0 ].y = ( FPNum ) loc.at(i);
1345  p [ 0 ].z = 0.;
1346 
1347  EASValsSetMType(SQUARE_MARKER);
1348  go = CreateMarker3D(p);
1349  EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | VECMTYPE_MASK, go);
1350  EMAddGraphicsToModel(ESIModel(), go);
1351  }
1352  }
1353  }
1354  }
1355 }
1356 
1357 void
1359 {
1360  if ( mtrx == TangentStiffnessMatrix ) {
1361  // loop over element IP
1362  for ( IntegrationPoint *ip : *this->giveDefaultIntegrationRulePtr() ) {
1363  auto interface = static_cast< NonlocalMaterialStiffnessInterface * >( this->giveStructuralCrossSection()->
1364  giveMaterialInterface(NonlocalMaterialStiffnessInterfaceType, ip) );
1365 
1366  if ( interface == NULL ) {
1367  return;
1368  }
1369  interface->NonlocalMaterialStiffnessInterface_showSparseMtrxStructure(ip, gc, tStep);
1370  }
1371  }
1372 }
1373 
1374 #endif
1375 } // end namespace oofem
static int giveSizeOfVoigtSymVector(MaterialMode mmode)
Returns the size of symmetric part of a reduced stress/strain vector according to given mode...
bool contains(int value) const
Definition: intarray.h:283
CrossSection * giveCrossSection()
Definition: element.C:495
virtual bool isImposed(TimeStep *tStep)
Returns nonzero if receiver representing BC is imposed at given time, otherwise returns zero...
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
Abstract base class for all nonlocal structural materials.
virtual bool isActivated(TimeStep *tStep)
Definition: element.C:793
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
int giveNumberOfColumns() const
Returns number of columns of receiver.
Definition: floatmatrix.h:158
The representation of EngngModel default unknown numbering.
void subtract(const FloatArray &src)
Subtracts array src to receiver.
Definition: floatarray.C:258
virtual void computeResultingIPTemperatureAt(FloatArray &answer, TimeStep *tStep, GaussPoint *gp, ValueModeType mode)
Computes at given time (tStep) the the resulting temperature component array.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
Definition: element.C:1257
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the array of interpolation functions (shape functions) at given point.
#define OOFEG_SPARSE_PROFILE_WIDTH
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 int computeNumberOfDofs()
Computes or simply returns total number of element&#39;s local DOFs.
Definition: element.h:424
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
Base class for all matrices stored in sparse format.
Definition: sparsemtrx.h:60
int giveNumberOfBoundaryConditions() const
Returns number of boundary conditions in domain.
Definition: domain.h:440
virtual void computeLumpedMassMatrix(FloatMatrix &answer, TimeStep *tStep)
Computes lumped mass matrix of receiver.
const FloatArray & giveSubPatchCoordinates()
Returns local sub-patch coordinates of the receiver.
Definition: gausspoint.h:144
virtual void createMaterialStatus(GaussPoint &iGP)=0
bool isEmpty() const
Checks if receiver is empty (i.e., zero sized).
Definition: intarray.h:208
Load is specified in global c.s.
Definition: load.h:70
virtual void createMaterialStatus()
std::unique_ptr< FloatArray > initialDisplacements
Initial displacement vector, describes the initial nodal displacements when element has been casted...
virtual void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)=0
Computes constitutive matrix of receiver.
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
virtual void showExtendedSparseMtrxStructure(CharType mtrx, oofegGraphicContext &gc, TimeStep *tStep)
Shows extended sparse structure (for example, due to nonlocal interactions for tangent stiffness) ...
virtual int giveInternalStateAtNode(FloatArray &answer, InternalStateType type, InternalStateMode mode, int node, TimeStep *tStep)
Returns internal state variable (like stress,strain) at node of element in Reduced form...
void beSubMatrixOf(const FloatMatrix &src, int topRow, int bottomRow, int topCol, int bottomCol)
Assigns to the receiver the sub-matrix of another matrix.
Definition: floatmatrix.C:962
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
Class implementing element body load, acting over whole element volume (e.g., the dead weight)...
Definition: bodyload.h:49
virtual void updateBeforeNonlocAverage(const FloatArray &strainVector, GaussPoint *gp, TimeStep *tStep)=0
Declares the service updating local variables in given integration points, which take part in nonloca...
This class implements a structural material status information.
Definition: structuralms.h:65
void clear()
Clears receiver (zero size).
Definition: floatarray.h:206
int giveInterpolationOrder()
Returns the interpolation order.
Definition: feinterpol.h:159
virtual ~StructuralElement()
Destructor.
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
virtual void giveDofManDofIDMask(int inode, IntArray &answer) const
Returns dofmanager dof mask for node.
Definition: element.h:476
virtual void computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode)=0
Computes components values of load at given point - global coordinates (coordinates given)...
virtual void computeEdgeNMatrix(FloatMatrix &answer, int boundaryID, const FloatArray &lcoords)
computes edge interpolation matrix
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Definition: element.C:706
#define OOFEG_SPARSE_PROFILE_LAYER
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
Definition: element.C:779
virtual CoordSystType giveCoordSystMode()
Returns receiver&#39;s coordinate system.
Definition: boundaryload.h:151
virtual void boundarySurfaceEvalN(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the array of edge interpolation functions (shape functions) at given point.
Abstract base class for all finite elements.
Definition: element.h:145
bool isSquare() const
Returns nonzero if receiver is square matrix.
Definition: floatmatrix.h:160
virtual void giveNonlocalLocationArray(IntArray &locationArray, const UnknownNumberingScheme &us)
Returns the "nonlocal" location array of receiver.
virtual MaterialMode giveMaterialMode()
Returns material mode for receiver integration points.
Definition: element.h:691
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
virtual void computeComponentArrayAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
Computes boundary condition value - its components values at given time.
Definition: load.C:82
virtual int computeLoadLEToLRotationMatrix(FloatMatrix &answer, int iEdge, GaussPoint *gp)
Returns transformation matrix from local edge c.s to element local coordinate system of load vector c...
virtual double giveCoordinate(int i)
Definition: node.C:82
virtual void computeNmatrixAt(const FloatArray &iLocCoord, FloatMatrix &answer)
Computes interpolation matrix for element unknowns.
virtual int adaptiveUpdate(TimeStep *tStep)
Updates the internal state variables stored in all IPs according to already mapped state...
Class implementing an array of integers.
Definition: intarray.h:61
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
MatResponseMode
Describes the character of characteristic material matrix.
virtual double computeEdgeVolumeAround(GaussPoint *gp, int iEdge)
Computes volume related to integration point on local edge.
virtual void setupIRForMassMtrxIntegration(IntegrationRule &iRule)
Setup Integration Rule Gauss Points for Mass Matrix integration.
virtual int giveNumberOfDofManagers() const
Definition: element.h:656
virtual void giveCharMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
Computes the stiffness matrix of receiver in given integration point, respecting its history...
virtual FEInterpolation * giveInterpolation() const
Definition: element.h:629
virtual void showSparseMtrxStructure(CharType mtrx, oofegGraphicContext &gc, TimeStep *tStep)
Shows sparse structure.
void rotatedWith(FloatMatrix &r, char mode)
Returns the receiver a rotated according the change-of-base matrix r.
Definition: floatarray.C:799
Abstract base class representing integration rule.
Distributed body load.
Definition: bcgeomtype.h:43
GeneralBoundaryCondition * giveBc(int n)
Service for accessing particular domain bc.
Definition: domain.C:243
void condense(FloatMatrix *stiff, FloatMatrix *mass, FloatArray *load, IntArray *what)
General service for condensation of stiffness and optionally load vector and mass or initial stress m...
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
int activityTimeFunction
Element activity time function. If defined, nonzero value indicates active receiver, zero value inactive element.
Definition: element.h:176
virtual void computeLoadVector(FloatArray &answer, BodyLoad *load, CharType type, ValueModeType mode, TimeStep *tStep)
Computes the contribution of the given body load (volumetric).
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
Definition: element.h:518
int giveSetNumber()
Gives the set number which boundary condition is applied to.
virtual void computeBodyLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode)
Computes the load vector due to body load acting on receiver, at given time step. ...
static void giveReducedSymVectorForm(FloatArray &answer, const FloatArray &vec, MaterialMode matMode)
Converts the full unsymmetric Voigt vector (2nd order tensor) to reduced form.
Abstract base class representing a boundary load (force, momentum, ...) that acts directly on a bound...
Definition: boundaryload.h:110
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: element.C:638
virtual void computeBoundarySurfaceLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true)
Computes the contribution of the given load at the given boundary surface in global coordinate system...
void computeStiffnessMatrix_withIRulesAsSubcells(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
virtual IntegrationRule * giveBoundaryEdgeIntegrationRule(int order, int boundary)
Returns boundary edge integration rule.
Definition: element.C:872
#define OOFEM_ERROR(...)
Definition: error.h:61
virtual CoordSystType giveCoordSystMode()
Returns receiver&#39;s coordinate system.
Definition: pointload.h:89
void clear()
Clears the array (zero size).
Definition: intarray.h:177
virtual void giveInternalForcesVector_withIRulesAsSubcells(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord=0)
virtual int computeLoadGToLRotationMtrx(FloatMatrix &answer)
Returns transformation matrix from global coordinate system to local element coordinate system for el...
virtual double giveWeight()
Returns integration weight of receiver.
Definition: gausspoint.h:181
virtual void boundaryLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Maps the local boundary coordinates to global.
virtual FormulationType giveFormulationType()
Specifies is load should take local or global coordinates.
Definition: load.h:155
void giveLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s, IntArray *dofIds=NULL) const
Returns the location array (array of code numbers) of receiver for given numbering scheme...
Definition: element.C:390
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
virtual void updateInternalState(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
Set of elements, boundaries, edges and/or nodes.
Definition: set.h:66
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
virtual void computeStressVector(FloatArray &answer, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep)=0
Computes the stress vector of receiver at given integration point, at time step tStep.
Wrapper around element definition to provide FEICellGeometry interface.
Definition: feinterpol.h:95
virtual double boundaryEdgeGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the determinant of the transformation Jacobian on the requested boundary.
virtual void boundaryEdgeEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the basis functions on the requested boundary.
const char * __CharTypeToString(CharType _value)
Definition: cltypes.C:339
virtual bool isCharacteristicMtrxSymmetric(MatResponseMode rMode)
Check for symmetry of stiffness matrix.
Definition: crosssection.h:172
IntArray * giveBodyLoadArray()
Returns array containing load numbers of loads acting on element.
Definition: element.C:372
Set * giveSet(int n)
Service for accessing particular domain set.
Definition: domain.C:363
virtual double boundarySurfaceGiveTransformationJacobian(int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the edge jacobian of transformation between local and global coordinates.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
virtual double giveUpdatedCoordinate(int ic, TimeStep *tStep, double scale=1.)
Returns updated ic-th coordinate of receiver.
Definition: node.C:245
IntArray bodyLoadArray
Array containing indexes of loads (body loads and boundary loads are kept separately), that apply on receiver.
Definition: element.h:160
virtual void computeStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
Compute strain vector of receiver evaluated at given integration point at given time step from elemen...
#define N(p, q)
Definition: mdm.C:367
void plusProductSymmUpper(const FloatMatrix &a, const FloatMatrix &b, double dV)
Adds to the receiver the product .
Definition: floatmatrix.C:698
virtual int giveInternalStateAtNode(FloatArray &answer, InternalStateType type, InternalStateMode mode, int node, TimeStep *tStep)
Returns internal state variable (like stress,strain) at node of element in Reduced form...
Definition: element.C:1661
Abstract base class for all boundary conditions of problem.
const FloatArray & giveCoordinates() const
Gives coordinates of the receiver.
Definition: pointload.h:87
virtual int giveApproxOrder()=0
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
virtual void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
Computes numerically stiffness matrix of receiver.
virtual int giveIntegrationRuleLocalCodeNumbers(IntArray &answer, IntegrationRule &ie)
Assembles the code numbers of given integration element (sub-patch) This is done by obtaining list of...
Definition: element.h:700
void giveRealStresses(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)
Computes the real stress vector for given strain and integration point.
void beNMatrixOf(const FloatArray &n, int nsd)
Assigns the receiver to be a repeated diagonal matrix.
Definition: floatmatrix.C:505
virtual integrationDomain giveIntegrationDomain() const
Returns integration domain for receiver, used to initialize integration point over receiver volume...
Definition: element.C:1521
Class representing vector of real numbers.
Definition: floatarray.h:82
elementParallelMode giveParallelMode() const
Return elementParallelMode of receiver.
Definition: element.h:1069
virtual void giveCharacteristicVector(FloatArray &answer, CharType type, ValueModeType mode, TimeStep *tStep)
Computes characteristic vector of receiver of requested type in given time step.
virtual int giveSpatialDimension()
Returns the element spatial dimension (1, 2, or 3).
Definition: element.C:1347
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 double give(CrossSectionProperty a, GaussPoint *gp)
Returns the value of cross section property at given point.
Definition: crosssection.C:151
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
virtual IntegrationRule * giveBoundarySurfaceIntegrationRule(int order, int boundary)
Returns boundary surface integration rule.
Definition: element.C:878
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 computeBoundaryEdgeLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true)
Computes the contribution of the given load at the given boundary edge.
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
CharType
Definition: chartype.h:87
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
virtual void computeSurfaceNMatrix(FloatMatrix &answer, int boundaryID, const FloatArray &lcoords)
Computes surface interpolation matrix.
virtual void giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord=0)
Returns equivalent nodal forces vectors.
virtual int getRequiredNumberOfIntegrationPoints(integrationDomain dType, int approxOrder)
Abstract service.
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
Definition: intarray.C:145
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
virtual bcGeomType giveBCGeoType() const
Returns geometry character of boundary condition.
Class representing the a dynamic Input Record.
StructuralElement(int n, Domain *d)
Constructor.
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.
virtual bool computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
Computes the element local coordinates from given global coordinates.
Definition: element.C:1222
virtual void computeInitialStressMatrix(FloatMatrix &answer, TimeStep *tStep)
Computes initial stress matrix for linear stability problem.
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 void computeField(ValueModeType mode, TimeStep *tStep, const FloatArray &lcoords, FloatArray &answer)
Computes the unknown vector interpolated at the specified local coordinates.
virtual int checkConsistency()
Performs consistency check.
Element in active domain is only mirror of some remote element.
Definition: element.h:102
virtual void updateBeforeNonlocalAverage(TimeStep *tStep)
Updates internal element state (in all integration points of receiver) before nonlocal averaging take...
int setUpIntegrationPoints(integrationDomain intdomain, int nPoints, MaterialMode matMode)
Initializes the receiver.
virtual double computeSurfaceVolumeAround(GaussPoint *gp, int iSurf)
Computes volume related to integration point on local surface.
virtual void giveCharacteristicMatrix(FloatMatrix &answer, CharType, TimeStep *tStep)
Computes characteristic matrix of receiver of requested type in given time step.
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
virtual int giveNumberOfIPForMassMtrxIntegration()
Return desired number of integration points for consistent mass matrix computation, if required.
virtual void computeMassMatrix(FloatMatrix &answer, TimeStep *tStep)
Computes mass matrix of receiver.
Load is base abstract class for all loads.
Definition: load.h:61
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
Definition: floatmatrix.C:337
virtual const char * giveClassName() const
virtual void boundaryEdgeLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Maps the local boundary coordinates to global.
int giveSize() const
Definition: intarray.h:203
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
Abstract base class for all structural cross section models.
virtual void computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode)
Computes components values of load at given point - global coordinates (coordinates given)...
Definition: pointload.C:45
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
virtual void computePointLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode, bool global=true)
Computes point load vector contribution of receiver for given load (should has BoundaryLoad Base)...
void clear()
Sets size of receiver to be an empty matrix. It will have zero rows and zero columns size...
Definition: floatmatrix.h:516
virtual bcValType giveBCValType() const
Returns receiver load type.
Class implementing node in finite element mesh.
Definition: node.h:87
Node * giveNode(int i) const
Returns reference to the i-th node of element.
Definition: element.h:610
virtual void computeResultingIPEigenstrainAt(FloatArray &answer, TimeStep *tStep, GaussPoint *gp, ValueModeType mode)
Computes at given time the resulting eigenstrain component array.
virtual void computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode)
Computes components values of load at given point - global coordinates (coordinates given)...
Definition: boundaryload.C:58
int giveNumberOfRows() const
Returns number of rows of receiver.
Definition: floatmatrix.h:156
Load * giveLoad(int n)
Service for accessing particular domain load.
Definition: domain.C:222
void symmetrized()
Initializes the lower half of the receiver according to the upper half.
Definition: floatmatrix.C:1576
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual void addNonlocalStiffnessContributions(SparseMtrx &dest, const UnknownNumberingScheme &s, TimeStep *tStep)
Adds the "nonlocal" contribution to stiffness matrix, to account for nonlocality of material model...
Class representing integration point in finite element program.
Definition: gausspoint.h:93
#define OOFEM_WARNING(...)
Definition: error.h:62
Class representing solution step.
Definition: timestep.h:80
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Computes the global coordinates from given element&#39;s local coordinates.
Definition: element.C:1207
InternalStateMode
Determines the mode of internal variable.
void add(const FloatArray &src)
Adds array src to receiver.
Definition: floatarray.C:156
virtual void computeConsistentMassMatrix(FloatMatrix &answer, TimeStep *tStep, double &mass, const double *ipDensity=NULL)
Computes consistent mass matrix of receiver using numerical integration over element volume...
virtual void giveMassMtrxIntegrationgMask(IntArray &answer)
Returns mask indicating, which unknowns (their type and ordering is the same as element unknown vecto...
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
Definition: gausspoint.h:138
Class representing Gaussian-quadrature integration rule.
Abstract base class representing a point load (force, momentum, ...) that acts directly on or inside ...
Definition: pointload.h:63
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