OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
element.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 
35 #include "element.h"
36 #include "crosssection.h"
37 #include "integrationrule.h"
38 #include "errorestimator.h"
39 #include "intarray.h"
40 #include "floatarray.h"
41 #include "floatmatrix.h"
42 #include "primaryfield.h"
43 #include "verbose.h"
45 #include "error.h"
46 #include "classfactory.h"
47 #include "datastream.h"
49 #include "contextioerr.h"
50 #include "mathfem.h"
51 #include "feinterpol.h"
52 #include "feinterpol1d.h"
53 #include "feinterpol2d.h"
54 #include "feinterpol3d.h"
55 #include "function.h"
56 #include "dofmanager.h"
57 #include "node.h"
58 #include "gausspoint.h"
59 #include "unknownnumberingscheme.h"
60 #include "dynamicinputrecord.h"
61 #include "matstatmapperint.h"
62 #include "cltypes.h"
63 
64 #ifdef __OOFEG
65  #include "oofeggraphiccontext.h"
66 #endif
67 
68 #include <cstdio>
69 
70 namespace oofem {
71 Element :: Element(int n, Domain *aDomain) :
72  FEMComponent(n, aDomain), dofManArray(), crossSection(0), bodyLoadArray(), boundaryLoadArray(), integrationRulesArray()
73 {
74  material = 0;
75  numberOfDofMans = 0;
77 }
78 
79 
81 {
82 }
83 
84 
85 void
87 {
88  IntArray dofIDMask;
89  FloatMatrix G2L;
90  FloatArray vec;
91 
92  answer.reserve( this->computeNumberOfGlobalDofs() );
93 
94  for ( int i = 1; i <= this->giveNumberOfDofManagers(); i++ ) {
95  this->giveDofManDofIDMask(i, dofIDMask);
96  this->giveDofManager(i)->giveUnknownVector(vec, dofIDMask, u, tStep, true);
97  answer.append(vec);
98  }
99 
100  for ( int i = 1; i <= giveNumberOfInternalDofManagers(); i++ ) {
101  this->giveInternalDofManDofIDMask(i, dofIDMask);
102  this->giveInternalDofManager(i)->giveUnknownVector(vec, dofIDMask, u, tStep, true);
103  answer.append(vec);
104  }
105 
106  if ( this->computeGtoLRotationMatrix(G2L) ) {
107  answer.rotatedWith(G2L, 'n');
108  }
109 }
110 
111 
112 void
113 Element :: computeVectorOf(const IntArray &dofIDMask, ValueModeType u, TimeStep *tStep, FloatArray &answer, bool padding)
114 {
115  FloatMatrix G2L;
116  FloatArray vec;
117 
118  answer.reserve( dofIDMask.giveSize() * ( this->giveNumberOfDofManagers() + this->giveNumberOfInternalDofManagers() ) );
119 
120  for ( int i = 1; i <= this->giveNumberOfDofManagers(); i++ ) {
121  this->giveDofManager(i)->giveUnknownVector(vec, dofIDMask, u, tStep, padding);
122  answer.append(vec);
123  }
124 
125  for ( int i = 1; i <= giveNumberOfInternalDofManagers(); i++ ) {
126  this->giveInternalDofManager(i)->giveUnknownVector(vec, dofIDMask, u, tStep, padding);
127  answer.append(vec);
128  }
129 
131  if ( this->computeGtoLRotationMatrix(G2L) ) {
132  OOFEM_WARNING("The transformation matrix from global -> element local c.s. is not fully supported for this function (yet)");
133  answer.rotatedWith(G2L, 'n');
134  }
135 }
136 
137 
138 void
139 Element :: computeBoundaryVectorOf(const IntArray &bNodes, const IntArray &dofIDMask, ValueModeType u, TimeStep *tStep, FloatArray &answer, bool padding)
140 {
141  FloatMatrix G2L;
142  FloatArray vec;
143 
144  answer.reserve( dofIDMask.giveSize() * bNodes.giveSize() );
145 
146  for ( int bNode: bNodes ) {
147  this->giveDofManager( bNode )->giveUnknownVector(vec, dofIDMask, u, tStep, padding);
148  answer.append(vec);
149  }
150 
151  if ( this->computeGtoLRotationMatrix(G2L) ) {
152  OOFEM_ERROR("Local coordinate system is not implemented yet");
153  }
154 }
155 
156 
157 void
158 Element :: computeVectorOf(PrimaryField &field, const IntArray &dofIDMask, ValueModeType u, TimeStep *tStep, FloatArray &answer, bool padding)
159 {
160  FloatMatrix G2L;
161  FloatArray vec;
162  answer.reserve( this->computeNumberOfGlobalDofs() );
163 
164  for ( int i = 1; i <= this->giveNumberOfDofManagers(); i++ ) {
165  this->giveDofManager(i)->giveUnknownVector(vec, dofIDMask, field, u, tStep);
166  answer.append(vec);
167  }
168 
169  for ( int i = 1; i <= giveNumberOfInternalDofManagers(); i++ ) {
170  this->giveInternalDofManager(i)->giveUnknownVector(vec, dofIDMask, field, u, tStep);
171  answer.append(vec);
172  }
173 
174  if ( this->computeGtoLRotationMatrix(G2L) ) {
175  answer.rotatedWith(G2L, 'n');
176  }
177 }
178 
179 
180 void
182 {
183  IntArray dofIDMask;
184  FloatMatrix G2L;
185  FloatArray vec;
186 
187  answer.reserve( this->computeNumberOfGlobalDofs() );
188 
189  for ( int i = 1; i <= this->giveNumberOfDofManagers(); i++ ) {
190  this->giveDofManDofIDMask(i, dofIDMask);
191  this->giveDofManager(i)->givePrescribedUnknownVector(vec, dofIDMask, u, tStep);
192  answer.append(vec);
193  }
194 
195  for ( int i = 1; i <= giveNumberOfInternalDofManagers(); i++ ) {
196  this->giveInternalDofManDofIDMask(i, dofIDMask);
197  this->giveInternalDofManager(i)->givePrescribedUnknownVector(vec, dofIDMask, u, tStep);
198  answer.append(vec);
199  }
200 
201  if ( this->computeGtoLRotationMatrix(G2L) ) {
202  answer.rotatedWith(G2L, 'n');
203  }
204 
205 }
206 
207 
208 void
210 {
211  FloatMatrix G2L;
212  FloatArray vec;
213 
214  answer.reserve( dofIDMask.giveSize() * this->computeNumberOfGlobalDofs() );
215 
216  for ( int i = 1; i <= this->giveNumberOfDofManagers(); i++ ) {
217  this->giveDofManager(i)->givePrescribedUnknownVector(vec, dofIDMask, mode, tStep);
218  answer.append(vec);
219  }
220 
221  for ( int i = 1; i <= giveNumberOfInternalDofManagers(); i++ ) {
222  this->giveInternalDofManager(i)->givePrescribedUnknownVector(vec, dofIDMask, mode, tStep);
223  answer.append(vec);
224  }
225 
226  if ( this->computeGtoLRotationMatrix(G2L) ) {
227  answer.rotatedWith(G2L, 'n');
228  }
229 }
230 
231 
232 int
234 {
235  return this->computeNumberOfDofs();
236 }
237 
238 
239 int
241 {
242  int answer = 0;
243  IntArray nodeDofIDMask;
244 
245  for ( int i = 1; i <= this->giveNumberOfDofManagers(); i++ ) {
246  this->giveDofManDofIDMask(i, nodeDofIDMask);
247  answer += this->giveDofManager(i)->giveNumberOfPrimaryMasterDofs(nodeDofIDMask);
248  }
249 
250  for ( int i = 1; i <= giveNumberOfInternalDofManagers(); i++ ) {
251  this->giveInternalDofManDofIDMask(i, nodeDofIDMask);
252  answer += this->giveInternalDofManager(i)->giveNumberOfPrimaryMasterDofs(nodeDofIDMask);
253  }
254  return answer;
255 }
256 
257 
258 bool
260 {
261  bool is_GtoL, is_NtoG;
262  FloatMatrix GtoL, NtoG;
263  IntArray nodes;
264  nodes.enumerate( this->giveNumberOfDofManagers() );
265 
266  is_GtoL = this->computeGtoLRotationMatrix(GtoL);
267  is_NtoG = this->computeDofTransformationMatrix(NtoG, nodes, true);
268 
269 #ifdef DEBUG
270  if ( is_GtoL ) {
271  if ( GtoL.giveNumberOfColumns() != this->computeNumberOfGlobalDofs() ) {
272  OOFEM_ERROR("GtoL transformation matrix size mismatch in columns");
273  }
274  if ( GtoL.giveNumberOfRows() != this->computeNumberOfDofs() ) {
275  OOFEM_ERROR("GtoL transformation matrix size mismatch in rows");
276  }
277  }
278  if ( is_NtoG ) {
279  if ( NtoG.giveNumberOfColumns() != this->computeNumberOfPrimaryMasterDofs() ) {
280  OOFEM_ERROR("NtoG transformation matrix size mismatch in columns");
281  }
282  if ( NtoG.giveNumberOfRows() != this->computeNumberOfGlobalDofs() ) {
283  OOFEM_ERROR("NtoG transformation matrix size mismatch in rows");
284  }
285  }
286 #endif
287 
288  if ( is_GtoL && NtoG.isNotEmpty() ) {
289  answer.beProductOf(GtoL, NtoG);
290  } else if ( is_GtoL ) {
291  answer = GtoL;
292  } else if ( is_NtoG ) {
293  answer = NtoG;
294  } else {
295  answer.clear();
296  return false;
297  }
298  return true;
299 }
300 
301 
302 bool
303 Element :: computeDofTransformationMatrix(FloatMatrix &answer, const IntArray &nodes, bool includeInternal)
304 {
305  bool flag = false;
306 
307  // test if transformation is necessary
308  for ( int n : nodes ) {
309  flag = flag || this->giveDofManager( n )->requiresTransformation();
310  }
311 
312  if ( !flag ) {
313  answer.clear();
314  return false;
315  }
316 
317  // initialize answer
318  int gsize = this->computeNumberOfPrimaryMasterDofs();
319  answer.resize(this->computeNumberOfGlobalDofs(), gsize);
320  answer.zero();
321 
322  FloatMatrix dofManT;
323  IntArray dofIDmask;
324  int nr, nc, lastRowPos = 0, lastColPos = 0;
325  // loop over nodes
326  for ( int n : nodes ) {
327  this->giveDofManDofIDMask(n, dofIDmask);
328  if ( !this->giveDofManager( n )->computeM2GTransformation(dofManT, dofIDmask) ) {
329  dofManT.resize( dofIDmask.giveSize(), dofIDmask.giveSize() );
330  dofManT.zero();
331  dofManT.beUnitMatrix();
332  }
333  nc = dofManT.giveNumberOfColumns();
334  nr = dofManT.giveNumberOfRows();
335  for ( int j = 1; j <= nr; j++ ) {
336  for ( int k = 1; k <= nc; k++ ) {
337  // localize node contributions
338  answer.at(lastRowPos + j, lastColPos + k) = dofManT.at(j, k);
339  }
340  }
341 
342  lastRowPos += nr;
343  lastColPos += nc;
344  }
345  if ( includeInternal ) {
346  for ( int i = 1; i <= this->giveNumberOfInternalDofManagers(); i++ ) {
347  this->giveInternalDofManDofIDMask(i, dofIDmask);
348  if ( !this->giveInternalDofManager( nodes.at(i) )->computeM2GTransformation(dofManT, dofIDmask) ) {
349  dofManT.resize( dofIDmask.giveSize(), dofIDmask.giveSize() );
350  dofManT.zero();
351  dofManT.beUnitMatrix();
352  }
353  nc = dofManT.giveNumberOfColumns();
354  nr = dofManT.giveNumberOfRows();
355  for ( int j = 1; j <= nr; j++ ) {
356  for ( int k = 1; k <= nc; k++ ) {
357  // localize node contributions
358  answer.at(lastRowPos + j, lastColPos + k) = dofManT.at(j, k);
359  }
360  }
361 
362  lastRowPos += nr;
363  lastColPos += nc;
364  }
365  }
366  answer.resizeWithData(lastRowPos, lastColPos);
367  return true;
368 }
369 
370 
371 IntArray *
373 // Returns the array which contains the number of every body load that act
374 // on the receiver.
375 {
376  return & bodyLoadArray;
377 }
378 
379 
380 IntArray *
382 // Returns the array which contains the number of every body load that act
383 // on the receiver.
384 {
385  return & boundaryLoadArray;
386 }
387 
388 
389 void
390 Element :: giveLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s, IntArray *dofIdArray) const
391 {
392  IntArray masterDofIDs, nodalArray, ids;
393  locationArray.clear();
394  if ( dofIdArray ) {
395  dofIdArray->clear();
396  }
397  for ( int i = 1; i <= this->giveNumberOfDofManagers(); i++ ) {
398  this->giveDofManDofIDMask(i, ids);
399  this->giveDofManager(i)->giveLocationArray(ids, nodalArray, s);
400  locationArray.followedBy(nodalArray);
401  if ( dofIdArray ) {
402  this->giveDofManager(i)->giveMasterDofIDArray(ids, masterDofIDs);
403  dofIdArray->followedBy(masterDofIDs);
404  }
405  }
406  for ( int i = 1; i <= this->giveNumberOfInternalDofManagers(); i++ ) {
407  this->giveInternalDofManDofIDMask(i, ids);
408  this->giveInternalDofManager(i)->giveLocationArray(ids, nodalArray, s);
409  locationArray.followedBy(nodalArray);
410  if ( dofIdArray ) {
411  this->giveInternalDofManager(i)->giveMasterDofIDArray(ids, masterDofIDs);
412  dofIdArray->followedBy(masterDofIDs);
413  }
414  }
415 }
416 
417 
418 void
419 Element :: giveLocationArray(IntArray &locationArray, const IntArray &dofIDMask, const UnknownNumberingScheme &s, IntArray *dofIdArray) const
420 {
421  IntArray masterDofIDs, nodalArray;
422  locationArray.clear();
423  if ( dofIdArray ) {
424  dofIdArray->clear();
425  }
426  for ( int i = 1; i <=this->giveNumberOfDofManagers(); i++ ) {
427  this->giveDofManager(i)->giveLocationArray(dofIDMask, nodalArray, s);
428  locationArray.followedBy(nodalArray);
429  if ( dofIdArray ) {
430  this->giveDofManager(i)->giveMasterDofIDArray(dofIDMask, masterDofIDs);
431  dofIdArray->followedBy(masterDofIDs);
432  }
433  }
434  for ( int i = 1; i <= this->giveNumberOfInternalDofManagers(); i++ ) {
435  this->giveInternalDofManager(i)->giveLocationArray(dofIDMask, nodalArray, s);
436  locationArray.followedBy(nodalArray);
437  if ( dofIdArray ) {
438  this->giveInternalDofManager(i)->giveMasterDofIDArray(dofIDMask, masterDofIDs);
439  dofIdArray->followedBy(masterDofIDs);
440  }
441  }
442 }
443 
444 
445 void
446 Element :: giveBoundaryLocationArray(IntArray &locationArray, const IntArray &bNodes, const UnknownNumberingScheme &s, IntArray *dofIdArray)
447 {
448  IntArray masterDofIDs, nodalArray, dofIDMask;
449  locationArray.clear();
450  if ( dofIdArray ) {
451  dofIdArray->clear();
452  }
453  for ( int i = 1; i <= bNodes.giveSize(); i++ ) {
454  this->giveDofManDofIDMask(bNodes.at(i), dofIDMask);
455  this->giveDofManager( bNodes.at(i) )->giveLocationArray(dofIDMask, nodalArray, s);
456  locationArray.followedBy(nodalArray);
457  if ( dofIdArray ) {
458  this->giveDofManager( bNodes.at(i) )->giveMasterDofIDArray(dofIDMask, masterDofIDs);
459  dofIdArray->followedBy(masterDofIDs);
460  }
461  }
462 }
463 
464 
465 void
466 Element :: giveBoundaryLocationArray(IntArray &locationArray, const IntArray &bNodes, const IntArray &dofIDMask, const UnknownNumberingScheme &s, IntArray *dofIdArray)
467 {
468  IntArray masterDofIDs, nodalArray;
469  locationArray.clear();
470  if ( dofIdArray ) {
471  dofIdArray->clear();
472  }
473  for ( int i = 1; i <= bNodes.giveSize(); i++ ) {
474  this->giveDofManager( bNodes.at(i) )->giveLocationArray(dofIDMask, nodalArray, s);
475  locationArray.followedBy(nodalArray);
476  if ( dofIdArray ) {
477  this->giveDofManager( bNodes.at(i) )->giveMasterDofIDArray(dofIDMask, masterDofIDs);
478  dofIdArray->followedBy(masterDofIDs);
479  }
480  }
481 }
482 
483 
485 {
486 #ifdef DEBUG
487  if ( !material ) {
488  OOFEM_ERROR("material not defined");
489  }
490 #endif
491  return domain->giveMaterial(material);
492 }
493 
494 
496 {
497 #ifdef DEBUG
498  if ( !crossSection ) {
499  OOFEM_ERROR("crossSection not defined");
500  }
501 #endif
503 }
504 
505 
506 int
508 {
509  return this->giveCrossSection()->giveNumber();
510 }
511 
512 
513 DofManager *
515 {
516 #ifdef DEBUG
517  if ( ( i <= 0 ) || ( i > dofManArray.giveSize() ) ) {
518  OOFEM_ERROR("Node %i is not defined", i);
519  }
520 #endif
521  return domain->giveDofManager( dofManArray.at(i) );
522 }
523 
524 void
526 {
527 #ifdef DEBUG
528  if ( dMan == NULL ) {
529  OOFEM_ERROR("Element :: addDofManager - dMan is a null pointer");
530  }
531 #endif
532  int size = dofManArray.giveSize();
533  this->dofManArray.resizeWithValues( size + 1 );
534  this->dofManArray.at(size + 1) = dMan->giveGlobalNumber();
535 }
536 
537 ElementSide *
539 {
540 #ifdef DEBUG
541  if ( ( i <= 0 ) || ( i > dofManArray.giveSize() ) ) {
542  OOFEM_ERROR("Side is not defined");
543  }
544 #endif
545  return domain->giveSide( dofManArray.at(i) );
546 }
547 
548 
549 void
551 {
552  this->dofManArray = _dmans;
553 }
554 
555 void
557 {
558  this->bodyLoadArray = _bodyLoads;
559 }
560 
561 void
562 Element :: setIntegrationRules(std :: vector< std :: unique_ptr< IntegrationRule > > irlist)
563 {
564  integrationRulesArray = std :: move(irlist);
565 }
566 
567 
568 void
570  CharType mtrx, TimeStep *tStep)
571 //
572 // returns characteristics matrix of receiver according to mtrx
573 //
574 {
575  OOFEM_ERROR("Unknown Type of characteristic mtrx.");
576 }
577 
578 
579 void
581 //
582 // returns characteristics vector of receiver according to mtrx
583 //
584 {
585  OOFEM_ERROR("Unknown Type of characteristic mtrx.");
586 }
587 
588 
589 void
591 {
592  answer.clear();
593  OOFEM_ERROR("Unknown load type.");
594 }
595 
596 
597 void
598 Element :: computeBoundarySurfaceLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global)
599 {
600  answer.clear();
601  OOFEM_ERROR("Unknown load type.");
602 }
603 
604 
605 void
607 {
608  answer.clear();
609 }
610 
611  void
613 {
614  answer.clear();
615 }
616 
617 void
619 {
621  answer.clear();
622  OOFEM_ERROR("Unknown load type.");
623 }
624 
625 
626 double
628 //
629 // returns characteristics value of receiver according to CharType
630 //
631 {
632  OOFEM_ERROR("Unknown Type of characteristic mtrx.");
633  return 0.;
634 }
635 
636 
639 {
640  IRResultType result; // Required by IR_GIVE_FIELD macro
641 
642 # ifdef VERBOSE
643  // VERBOSE_PRINT1("Instanciating element ",number);
644 # endif
645  //IR_GIVE_FIELD(ir, material, _IFT_Element_mat);
646  material = 0;
648 
649  //IR_GIVE_FIELD(ir, crossSection, _IFT_Element_crosssect);
650  crossSection = 0;
652 
654 
657 
660 
661  elemLocalCS.clear();
662 
663  if ( ir->hasField(_IFT_Element_lcs) ) { //local coordinate system
664  double n1 = 0.0, n2 = 0.0;
665  FloatArray triplets;
667  elemLocalCS.resize(3, 3);
668  for ( int j = 1; j <= 3; j++ ) {
669  elemLocalCS.at(j, 1) = triplets.at(j);
670  n1 += triplets.at(j) * triplets.at(j);
671  elemLocalCS.at(j, 2) = triplets.at(j + 3);
672  n2 += triplets.at(j + 3) * triplets.at(j + 3);
673  }
674 
675  n1 = sqrt(n1);
676  n2 = sqrt(n2);
677  for ( int j = 1; j <= 3; j++ ) { // normalize e1' e2'
678  elemLocalCS.at(j, 1) /= n1;
679  elemLocalCS.at(j, 2) /= n2;
680  }
681 
682  // vector e3' computed from vector product of e1', e2'
683  elemLocalCS.at(1, 3) = ( elemLocalCS.at(2, 1) * elemLocalCS.at(3, 2) - elemLocalCS.at(3, 1) * elemLocalCS.at(2, 2) );
684  elemLocalCS.at(2, 3) = ( elemLocalCS.at(3, 1) * elemLocalCS.at(1, 2) - elemLocalCS.at(1, 1) * elemLocalCS.at(3, 2) );
685  elemLocalCS.at(3, 3) = ( elemLocalCS.at(1, 1) * elemLocalCS.at(2, 2) - elemLocalCS.at(2, 1) * elemLocalCS.at(1, 2) );
686  }
687 
688  partitions.clear();
690  if ( ir->hasField(_IFT_Element_remote) ) {
692  } else {
694  }
695 
698 
700 
701  return IRRT_OK;
702 }
703 
704 
705 void
707 {
709 
711 
713 
715 
716  if ( bodyLoadArray.giveSize() > 0 ) {
718  }
719 
720 
721  if ( boundaryLoadArray.giveSize() > 0 ) {
723  }
724 
725 
726  if ( elemLocalCS.giveNumberOfRows() > 0 ) {
727  FloatArray triplets(6);
728  for ( int j = 1; j <= 3; j++ ) {
729  triplets.at(j) = elemLocalCS.at(j, 1);
730  triplets.at(j + 3) = elemLocalCS.at(j, 2);
731  }
732  input.setField(triplets, _IFT_Element_lcs);
733  }
734 
735 
736  if ( partitions.giveSize() > 0 ) {
738  if ( this->parallel_mode == Element_remote ) {
740  }
741  }
742 
743  if ( activityTimeFunction > 0 ) {
745  }
746 
748 }
749 
750 
751 void
753 {
754  this->computeGaussPoints();
755 }
756 
757 
758 void
760 {
761  fprintf( file, "element %d (%8d) :\n", this->giveLabel(), this->giveNumber() );
762 
763  for ( int i = 1; i <= this->giveNumberOfInternalDofManagers(); ++i ) {
764  DofManager *dman = this->giveInternalDofManager(i);
765  dman->printOutputAt(file, tStep);
766  }
767 
768  if (this->isActivated(tStep) ) {
769  for ( auto &iRule: integrationRulesArray ) {
770  iRule->printOutputAt(file, tStep);
771  }
772  } else {
773  fprintf(file, "is not active in current time step\n");
774  }
775 }
776 
777 
778 void
780 // Updates the receiver at end of step.
781 {
782 # ifdef VERBOSE
783  // VERBOSE_PRINT1("Updating Element ",number)
784 # endif
785 
786  for ( auto &iRule: integrationRulesArray ) {
787  iRule->updateYourself(tStep);
788  }
789 }
790 
791 
792 bool
794 {
795  if ( activityTimeFunction ) {
796  if ( tStep ) {
797  return ( domain->giveFunction(activityTimeFunction)->evaluateAtTime( tStep->giveIntrinsicTime() ) > 1.e-3 );
798  } else {
799  return false;
800  }
801  } else {
802  return true;
803  }
804 }
805 
806 
807 
808 bool
810 {
811 
812  // this approach used to work when material was assigned to element
813  // if ( tStep->giveIntrinsicTime() >= this->giveMaterial()->giveCastingTime() )
814 
815 
816  if ( tStep ) {
817 
818  double castingTime;
819  double tNow = tStep->giveIntrinsicTime();
820 
821  if ( integrationRulesArray.size() > 0 ) {
822 
823  for ( int i = 0; i < (int)integrationRulesArray.size(); i++ ) {
824  IntegrationRule *iRule;
825  iRule = integrationRulesArray [ i ].get();
826 
827  for ( GaussPoint *gp: *iRule ) {
828  castingTime = this->giveCrossSection()->giveMaterial(gp)->giveCastingTime();
829 
830  if (tNow < castingTime ) {
831  return false;
832  }
833  }
834  }
835  }
836 
837  return true;
838 
839  } else {
840  return false;
841  }
842 
843 }
844 
845 void
847 // initializes receiver to new time step or can be used
848 // if current time step must be restarted
849 {
850  for ( auto &iRule: integrationRulesArray ) {
851  for ( auto &gp: *iRule ) {
852  this->giveCrossSection()->giveMaterial(gp)->initTempStatus(gp);
853  }
854  }
855 }
856 
857 
858 
859 void
861 {
862  this->giveInterpolation()->boundaryEdgeGiveNodes(bNodes, boundary);
863 }
864 
865 void
867 {
868  this->giveInterpolation()->boundarySurfaceGiveNodes(bNodes, boundary);
869 }
870 
873 {
874  return this->giveInterpolation()->giveBoundaryEdgeIntegrationRule(order, boundary);
875 }
876 
879 {
880  return this->giveInterpolation()->giveBoundarySurfaceIntegrationRule(order, boundary);
881 }
882 
883 
884 
886 // saves full element context (saves state variables, that completely describe current state)
887 {
888  contextIOResultType iores;
889  int _val;
890 
891  if ( ( iores = FEMComponent :: saveContext(stream, mode, obj) ) != CIO_OK ) {
892  THROW_CIOERR(iores);
893  }
894 
895  if ( ( mode & CM_Definition ) ) {
896  if ( !stream.write(numberOfDofMans) ) {
898  }
899 
900  if ( !stream.write(material) ) {
902  }
903 
904  if ( !stream.write(crossSection) ) {
906  }
907 
908  if ( mode & CM_DefinitionGlobal ) {
909  // send global numbers instead of local ones
910  int s = dofManArray.giveSize();
911  IntArray globDN(s);
912  for ( int i = 1; i <= s; i++ ) {
913  globDN.at(i) = this->giveDofManager(i)->giveGlobalNumber();
914  }
915 
916  if ( ( iores = globDN.storeYourself(stream) ) != CIO_OK ) {
917  THROW_CIOERR(iores);
918  }
919  } else {
920  if ( ( iores = dofManArray.storeYourself(stream) ) != CIO_OK ) {
921  THROW_CIOERR(iores);
922  }
923  }
924 
925  if ( ( iores = bodyLoadArray.storeYourself(stream) ) != CIO_OK ) {
926  THROW_CIOERR(iores);
927  }
928 
929  if ( ( iores = boundaryLoadArray.storeYourself(stream) ) != CIO_OK ) {
930  THROW_CIOERR(iores);
931  }
932 
933  int numberOfIntegrationRules = (int)integrationRulesArray.size();
934  if ( !stream.write(numberOfIntegrationRules) ) {
936  }
937 
938  for ( auto &iRule: integrationRulesArray ) {
939  _val = iRule->giveIntegrationRuleType();
940  if ( !stream.write(_val) ) {
942  }
943  }
944 
945  int _mode;
946  if ( !stream.write(globalNumber) ) {
948  }
949 
950  _mode = parallel_mode;
951  if ( !stream.write(_mode) ) {
953  }
954 
955  if ( ( iores = partitions.storeYourself(stream) ) != CIO_OK ) {
956  THROW_CIOERR(iores);
957  }
958  }
959 
960  for ( auto &iRule: integrationRulesArray ) {
961  if ( ( iores = iRule->saveContext(stream, mode, obj) ) != CIO_OK ) {
962  THROW_CIOERR(iores);
963  }
964  }
965 
966  return CIO_OK;
967 }
968 
969 
971 // restores full element context (saves state variables, that completely describe current state)
972 {
973  contextIOResultType iores;
974  int _nrules;
975 
976  if ( ( iores = FEMComponent :: restoreContext(stream, mode, obj) ) != CIO_OK ) {
977  THROW_CIOERR(iores);
978  }
979 
980  if ( mode & CM_Definition ) {
981  if ( !stream.read(numberOfDofMans) ) {
983  }
984 
985  if ( !stream.read(material) ) {
987  }
988 
989  if ( !stream.read(crossSection) ) {
991  }
992 
993  if ( ( iores = dofManArray.restoreYourself(stream) ) != CIO_OK ) {
994  THROW_CIOERR(iores);
995  }
996 
997  if ( ( iores = bodyLoadArray.restoreYourself(stream) ) != CIO_OK ) {
998  THROW_CIOERR(iores);
999  }
1000 
1001  if ( ( iores = boundaryLoadArray.restoreYourself(stream) ) != CIO_OK ) {
1002  THROW_CIOERR(iores);
1003  }
1004 
1005  if ( !stream.read(_nrules) ) {
1007  }
1008 
1009  // restore integration rules
1010  IntArray dtypes(_nrules);
1011  for ( int i = 1; i <= _nrules; i++ ) {
1012  if ( !stream.read(dtypes.at(i)) ) {
1014  }
1015  }
1016 
1017  if ( _nrules != (int)integrationRulesArray.size() ) {
1018 
1019  // AND ALLOCATE NEW ONE
1020  integrationRulesArray.resize( _nrules );
1021  for ( int i = 0; i < _nrules; i++ ) {
1022  integrationRulesArray [ i ].reset( classFactory.createIRule( ( IntegrationRuleType ) dtypes(i), i + 1, this ) );
1023  }
1024  } else {
1025  for ( int i = 0; i < _nrules; i++ ) {
1026  if ( integrationRulesArray [ i ]->giveIntegrationRuleType() != dtypes(i) ) {
1027  integrationRulesArray [ i ].reset( classFactory.createIRule( ( IntegrationRuleType ) dtypes(i), i + 1, this ) );
1028  }
1029  }
1030  }
1031 
1032  int _mode;
1033  if ( !stream.read(globalNumber) ) {
1035  }
1036 
1037  if ( !stream.read(_mode) ) {
1039  }
1040 
1041  parallel_mode = ( elementParallelMode ) _mode;
1042  if ( ( iores = partitions.restoreYourself(stream) ) != CIO_OK ) {
1043  THROW_CIOERR(iores);
1044  }
1045  }
1046 
1047 
1048  for ( auto &iRule: integrationRulesArray ) {
1049  if ( ( iores = iRule->restoreContext(stream, mode, this) ) != CIO_OK ) {
1050  THROW_CIOERR(iores);
1051  }
1052  }
1053 
1054  return CIO_OK;
1055 }
1056 
1057 
1058 double
1060 // the element computes its volume, area or length
1061 // (depending on the spatial dimension of that element)
1062 {
1063  double answer = 0.;
1065  if ( iRule ) {
1066  for ( GaussPoint *gp: *iRule ) {
1067  answer += this->computeVolumeAround(gp);
1068  }
1069 
1070  return answer;
1071  }
1072 
1073  return -1.; // means "cannot be evaluated"
1074 }
1075 
1076 
1077 double
1079 // Computes the size of the element defined as its length,
1080 // square root of area or cube root of volume (depending on spatial dimension)
1081 {
1082  double volume = this->computeVolumeAreaOrLength();
1083  if ( volume < 0. ) {
1084  return -1.; // means "cannot be evaluated"
1085  }
1086 
1087  int dim = this->giveSpatialDimension();
1088  switch ( dim ) {
1089  case 1: return volume;
1090 
1091  case 2: return sqrt(volume);
1092 
1093  case 3: return cbrt(volume);
1094  }
1095 
1096  return -1.; // means "cannot be evaluated"
1097 }
1098 
1099 
1100 double
1102 {
1103  FEInterpolation3d *fei = dynamic_cast< FEInterpolation3d * >( this->giveInterpolation() );
1104 #ifdef DEBUG
1105  if ( !fei ) {
1106  OOFEM_ERROR("Function not overloaded and necessary interpolator isn't available");
1107  return 0.0;
1108  }
1109 #endif
1110  return fei->giveVolume( FEIElementGeometryWrapper(this) );
1111 }
1112 
1113 
1114 double
1116 {
1117  FEInterpolation2d *fei = dynamic_cast< FEInterpolation2d * >( this->giveInterpolation() );
1118 #ifdef DEBUG
1119  if ( !fei ) {
1120  OOFEM_ERROR("Function not overloaded and necessary interpolator isn't available");
1121  return 0.0;
1122  }
1123 #endif
1124  return fei->giveArea( FEIElementGeometryWrapper(this) );
1125 }
1126 
1127 
1128 double
1130 {
1131  FEInterpolation1d *fei = dynamic_cast< FEInterpolation1d * >( this->giveInterpolation() );
1132 #ifdef DEBUG
1133  if ( !fei ) {
1134  OOFEM_ERROR("Function not overloaded and necessary interpolator isn't available");
1135  return 0.0;
1136  }
1137 #endif
1138  return fei->giveLength( FEIElementGeometryWrapper(this) );
1139 }
1140 
1141 
1142 double
1143 Element :: giveLengthInDir(const FloatArray &normalToCrackPlane)
1144 //
1145 // returns receiver's size projected onto the direction given by normalToCrackPlane
1146 // (exploited by the crack band approach)
1147 //
1148 {
1149  FloatArray *coords;
1150  double maxDis, minDis, dis;
1151  int nnode = giveNumberOfNodes();
1152 
1153  coords = this->giveNode(1)->giveCoordinates();
1154  minDis = maxDis = normalToCrackPlane.dotProduct( * coords, coords->giveSize() );
1155 
1156  for ( int i = 2; i <= nnode; i++ ) {
1157  coords = this->giveNode(i)->giveCoordinates();
1158  dis = normalToCrackPlane.dotProduct( * coords, coords->giveSize() );
1159  if ( dis > maxDis ) {
1160  maxDis = dis;
1161  } else if ( dis < minDis ) {
1162  minDis = dis;
1163  }
1164  }
1165 
1166  return maxDis - minDis;
1167 }
1168 
1169 double
1171 //
1172 // returns receiver's size projected onto the direction given by normalToCrackPlane
1173 // or, if that direction is not in-plane, the square root of element area
1174 // (this can happen if the crack normal is set to the maximum principal stress direction
1175 // and the in-plane principal stresses are negative)
1176 //
1177 {
1178  if ( normalToCrackPlane.at(3) < 0.5 ) { // check whether the projection direction is in-plane
1179  return this->giveLengthInDir(normalToCrackPlane);
1180  } else { // if not, compute the size from element area
1181  return this->computeMeanSize();
1182  }
1183 }
1184 
1185 double
1187 //
1188 // returns receiver's size projected onto the direction given by normalToCrackPlane
1189 // or, if that direction is not in-plane, the distance from the axis of symmetry
1190 // multiplied by pi, assuming that two symmetrically located radial cracks will form
1191 // (this can happen if the cracking is caused by the hoop stress)
1192 //
1193 {
1194  if ( normalToCrackPlane.at(3) < 0.5 ) { // check whether the projection direction is in-plane
1195  return this->giveLengthInDir(normalToCrackPlane);
1196  } else { // if not, take the average distance from axis of symmetry multiplied by pi
1197  double r = 0.;
1198  for ( int i = 1; i <= this->giveNumberOfDofManagers(); i++ ) {
1199  r += this->giveNode(i)->giveCoordinate(1);
1200  }
1201  r = r * M_PI / ( ( double ) this->giveNumberOfDofManagers() );
1202  return r;
1203  }
1204 }
1205 
1206 int
1208 {
1209  FEInterpolation *fei = this->giveInterpolation();
1210 #ifdef DEBUG
1211  if ( !fei ) {
1212  answer.clear();
1213  return false;
1214  }
1215 #endif
1216  fei->local2global( answer, lcoords, FEIElementGeometryWrapper(this) );
1217  return true;
1218 }
1219 
1220 
1221 bool
1223 {
1224  FEInterpolation *fei = this->giveInterpolation();
1225  if ( fei ) {
1226  return fei->global2local( answer, gcoords, FEIElementGeometryWrapper(this) );
1227  } else {
1228  return false;
1229  }
1230 }
1231 
1232 
1233 int
1235 {
1236  if ( elemLocalCS.isNotEmpty() ) {
1237  answer = elemLocalCS;
1238  return 1;
1239  } else {
1240  answer.clear();
1241  }
1242 
1243  return 0;
1244 }
1245 
1246 
1247 void
1249 // valid only for plane elements (shells, plates, ....)
1250 // computes mid-plane normal at gaussPoint - for materials with orthotrophy
1251 {
1252  OOFEM_ERROR("Unable to compute mid-plane normal, not supported");
1253 }
1254 
1255 
1256 int
1258 {
1259  if ( type == IST_ErrorIndicatorLevel ) {
1260  ErrorEstimator *ee = this->giveDomain()->giveErrorEstimator();
1261  if ( ee ) {
1262  answer.resize(1);
1265  answer.at(1) = ee->giveElementError(internalStressET, this, tStep);
1266  } else {
1267  answer.clear();
1268  return 0;
1269  }
1270 
1271  return 1;
1272  } else if ( type == IST_InternalStressError ) {
1273  ErrorEstimator *ee = this->giveDomain()->giveErrorEstimator();
1274  if ( ee ) {
1275  answer.resize(1);
1276  answer.at(1) = ee->giveElementError(internalStressET, this, tStep);
1277  } else {
1278  answer.clear();
1279  return 0;
1280  }
1281  return 1;
1282  } else if ( type == IST_PrimaryUnknownError ) {
1283  ErrorEstimator *ee = this->giveDomain()->giveErrorEstimator();
1284  if ( ee ) {
1285  answer.resize(1);
1286  answer.at(1) = ee->giveElementError(primaryUnknownET, this, tStep);
1287  } else {
1288  answer.clear();
1289  return 0;
1290  }
1291  return 1;
1292  } else if ( type == IST_CrossSectionNumber ) {
1293  answer.resize(1);
1294  answer.at(1) = gp->giveCrossSection()->giveNumber();
1295  return 1;
1296  } else if ( type == IST_ElementNumber ) {
1297  answer.resize(1);
1298  answer.at(1) = this->giveNumber();
1299  return 1;
1300  } else {
1301  return this->giveCrossSection()->giveIPValue(answer, gp, type, tStep);
1302  }
1303 }
1304 
1305 int
1307 {
1309  if ( elemLocalCS.isNotEmpty() && valtype != ISVT_SCALAR ) {
1310  FloatArray ans;
1311  FloatMatrix full;
1312  int ret = this->giveIPValue(ans, gp, type, tStep);
1313  if ( ret == 0 ) return 0;
1314  if ( valtype == ISVT_VECTOR ) {
1316  answer.beProductOf(elemLocalCS, ans);
1317  return 1;
1318  }
1319 
1320  // Tensors are more complicated to transform, easiest to write them in matrix form first
1321  if ( valtype == ISVT_TENSOR_S3E ) {
1322  ans.at(4) *= 0.5;
1323  ans.at(5) *= 0.5;
1324  ans.at(6) *= 0.5;
1325  } else if ( valtype != ISVT_TENSOR_G && valtype != ISVT_TENSOR_S3 ) {
1326  OOFEM_ERROR("Unsupported internal state value type for computing global IP value");
1327  }
1329  full.beMatrixForm(ans);
1330  full.rotatedWith(elemLocalCS, 'n');
1331  answer.beVectorForm(full);
1332  if ( valtype == ISVT_TENSOR_S3 ) {
1333  answer.resizeWithValues(6);
1334  } else if ( valtype == ISVT_TENSOR_S3E ) {
1335  answer.at(4) += answer.at(7);
1336  answer.at(5) += answer.at(8);
1337  answer.at(6) += answer.at(9);
1338  answer.resizeWithValues(6);
1339  }
1340  return 1;
1341  } else {
1342  return this->giveIPValue(answer, gp, type, tStep);
1343  }
1344 }
1345 
1346 int
1348 {
1350  switch ( this->giveGeometryType() ) {
1351  case EGT_point:
1352  return 0;
1353 
1354  case EGT_line_1:
1355  case EGT_line_2:
1356  return 1;
1357 
1358  case EGT_triangle_1:
1359  case EGT_triangle_2:
1360  case EGT_quad_1:
1361  case EGT_quad_2:
1362  case EGT_quad9_2:
1363  case EGT_quad_1_interface:
1364  case EGT_quad_21_interface:
1365  return 2;
1366 
1367  case EGT_tetra_1:
1368  case EGT_tetra_2:
1369  case EGT_hexa_1:
1370  case EGT_hexa_2:
1371  case EGT_hexa_27:
1372  case EGT_wedge_1:
1373  case EGT_wedge_2:
1374  return 3;
1375 
1376  case EGT_Composite:
1377  case EGT_unknown:
1378  break;
1379  }
1380 
1381  OOFEM_ERROR("failure (maybe new element type was registered)");
1382  return 0; //to make compiler happy
1383 }
1384 
1385 
1386 int
1388 {
1390  switch ( this->giveGeometryType() ) {
1391  case EGT_point:
1392  return 0;
1393 
1394  case EGT_line_1:
1395  case EGT_line_2:
1396  case EGT_quad_1_interface:
1397  case EGT_quad_21_interface:
1398  return 2;
1399 
1400  case EGT_triangle_1:
1401  case EGT_triangle_2:
1402  return 3;
1403 
1404  case EGT_quad_1:
1405  case EGT_quad_2:
1406  case EGT_quad9_2:
1407  return 4;
1408 
1409  case EGT_tetra_1:
1410  case EGT_tetra_2:
1411  return 4;
1412 
1413  case EGT_wedge_1:
1414  case EGT_wedge_2:
1415  return 5;
1416 
1417  case EGT_hexa_1:
1418  case EGT_hexa_2:
1419  case EGT_hexa_27:
1420  return 6;
1421 
1422  case EGT_Composite:
1423  case EGT_unknown:
1424  break;
1425  }
1426 
1427  OOFEM_ERROR("failure, unsupported geometry type (%s)",
1429  return 0; // to make compiler happy
1430 }
1431 
1432 
1433 int
1435 {
1436  int result = 1;
1437  CrossSection *cs = this->giveCrossSection();
1438 
1439  for ( auto &iRule: integrationRulesArray ) {
1440  for ( auto &gp: *iRule ) {
1441  MaterialModelMapperInterface *interface = static_cast< MaterialModelMapperInterface * >
1443  if ( interface ) {
1444  result &= interface->MMI_map(gp, oldd, tStep);
1445  } else {
1446  result = 0;
1447  }
1448  }
1449  }
1450 
1451  return result;
1452 }
1453 
1454 int
1456 {
1457  int result = 1;
1458 
1459  // create source set (this is quite inefficient here as done for each element.
1460  // the alternative MaterialModelMapperInterface approach allows to cache sets on material model
1461  Set sourceElemSet = Set(0, & iOldDom);
1462  int materialNum = this->giveMaterial()->giveNumber();
1463  sourceElemSet.setElementList( iOldDom.giveElementsWithMaterialNum(materialNum) );
1464 
1465  for ( auto &iRule: integrationRulesArray ) {
1466  for ( GaussPoint *gp: *iRule ) {
1467 
1468  MaterialStatus *ms = dynamic_cast< MaterialStatus * >( gp->giveMaterialStatus() );
1469  if ( ms == NULL ) {
1470  OOFEM_ERROR("failed to fetch MaterialStatus.");
1471  }
1472 
1473  MaterialStatusMapperInterface *interface = dynamic_cast< MaterialStatusMapperInterface * >(ms);
1474  if ( interface == NULL ) {
1475  OOFEM_ERROR("Failed to fetch MaterialStatusMapperInterface.");
1476  }
1477 
1478  result &= interface->MSMI_map( *gp, iOldDom, sourceElemSet, iTStep, * ( ms ) );
1479  }
1480  }
1481 
1482  return result;
1483 }
1484 
1485 
1486 int
1488 {
1489  MaterialModelMapperInterface *interface = static_cast< MaterialModelMapperInterface * >
1491 
1492  if ( !interface ) {
1493  return 0;
1494  }
1495 #if 0
1496  int result = 1;
1497  for ( auto &iRule: integrationRulesArray ) {
1498  for ( GaussPoint *gp: *iRule ) {
1499  result &= interface->MMI_finish(tStep);
1500  }
1501  }
1502 
1503  return result;
1504 #else
1505  return interface->MMI_finish(tStep);
1506 #endif
1507 }
1508 
1509 
1510 void
1512 {
1513  for ( auto &dnum : dofManArray ) {
1514  dnum = f(dnum, ERS_DofManager);
1515  }
1516 
1517 }
1518 
1519 
1522 {
1523  FEInterpolation *fei = this->giveInterpolation();
1524  return fei ? fei->giveIntegrationDomain() : _UnknownIntegrationDomain;
1525 }
1526 
1527 
1530 {
1531  FEInterpolation *fei = this->giveInterpolation();
1532  return fei ? fei->giveGeometryType() : EGT_unknown;
1533 }
1534 
1535 
1536 bool
1538 {
1539  answer.clear();
1540  return false;
1541 }
1542 
1543 
1544 int
1546 {
1547  int result = 1;
1548 
1549  for ( auto &iRule: integrationRulesArray ) {
1550  for ( GaussPoint *gp: *iRule ) {
1551  result &= this->giveCrossSection()->packUnknowns( buff, tStep, gp );
1552  }
1553  }
1554 
1555  return result;
1556 }
1557 
1558 
1559 int
1561 {
1562  int result = 1;
1563 
1564  for ( auto &iRule: integrationRulesArray ) {
1565  for ( GaussPoint *gp: *iRule ) {
1566  result &= this->giveCrossSection()->unpackAndUpdateUnknowns( buff, tStep, gp );
1567  }
1568  }
1569 
1570  return result;
1571 }
1572 
1573 
1574 int
1576 {
1577  int result = 0;
1578 
1579  for ( auto &iRule: integrationRulesArray ) {
1580  for ( GaussPoint *gp: *iRule ) {
1581  result += this->giveCrossSection()->estimatePackSize( buff, gp );
1582  }
1583  }
1584 
1585  return result;
1586 }
1587 
1588 
1589 double
1591 {
1592  double wgt = 0;
1594  for ( GaussPoint *gp: *iRule ) {
1595  wgt += this->giveCrossSection()->predictRelativeComputationalCost( gp );
1596  }
1597 
1598  return ( this->giveRelativeSelfComputationalCost() * wgt );
1599 }
1600 
1601 
1602 #ifdef __OOFEG
1603 void
1605 {
1607 
1608  if ( mode == OGC_rawGeometry ) {
1609  this->drawRawGeometry(gc, tStep);
1610  } else if ( mode == OGC_elementAnnotation ) {
1611  this->drawAnnotation(gc, tStep);
1612  } else if ( mode == OGC_deformedGeometry ) {
1613  this->drawDeformedGeometry(gc, tStep, DisplacementVector);
1614  } else if ( mode == OGC_eigenVectorGeometry ) {
1615  this->drawDeformedGeometry(gc, tStep, EigenVector);
1616  } else if ( mode == OGC_scalarPlot ) {
1617  this->drawScalar(gc, tStep);
1618  } else if ( mode == OGC_elemSpecial ) {
1619  this->drawSpecial(gc, tStep);
1620  } else {
1621  OOFEM_ERROR("unsupported mode");
1622  }
1623 }
1624 
1625 
1626 void
1628 {
1629  int count = 0;
1630  Node *node;
1631  WCRec p [ 1 ]; /* point */
1632  GraphicObj *go;
1633  char num [ 30 ];
1634 
1635  p [ 0 ].x = p [ 0 ].y = p [ 0 ].z = 0.0;
1636  // compute element center
1637  for ( int i = 1; i <= numberOfDofMans; i++ ) {
1638  if ( ( node = this->giveNode(i) ) ) {
1639  p [ 0 ].x += node->giveCoordinate(1);
1640  p [ 0 ].y += node->giveCoordinate(2);
1641  p [ 0 ].z += node->giveCoordinate(3);
1642  count++;
1643  }
1644  }
1645 
1646  p [ 0 ].x /= count;
1647  p [ 0 ].y /= count;
1648  p [ 0 ].z /= count;
1649 
1650  EASValsSetLayer(OOFEG_ELEMENT_ANNOTATION_LAYER);
1651  EASValsSetColor( gc.getElementColor() );
1652  sprintf( num, "%d(%d)", this->giveNumber(), this->giveGlobalNumber() );
1653 
1654  go = CreateAnnText3D(p, num);
1655  EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK, go);
1656  EMAddGraphicsToModel(ESIModel(), go);
1657 }
1658 
1659 
1660 int
1662  int node, TimeStep *tStep)
1663 {
1664  if ( type == IST_RelMeshDensity ) {
1665  ErrorEstimator *ee = this->giveDomain()->giveErrorEstimator();
1666  if ( ee ) {
1667  answer.resize(1);
1668  answer.at(1) = this->giveDomain()->giveErrorEstimator()->giveRemeshingCrit()->
1669  giveRequiredDofManDensity(this->giveNode(node)->giveNumber(), tStep, 1);
1670  return 1;
1671  } else {
1672  answer.clear();
1673  return 0;
1674  }
1675  } else {
1676  if ( mode == ISM_recovered ) {
1677  const FloatArray *nodval;
1678  NodalRecoveryModel *smoother = this->giveDomain()->giveSmoother();
1679  int result = smoother->giveNodalVector( nodval, this->giveNode(node)->giveNumber() );
1680  if ( nodval ) {
1681  answer = * nodval;
1682  } else {
1683  answer.clear();
1684  }
1685 
1686  return result;
1687  } else {
1688  return 0;
1689  }
1690  }
1691 }
1692 
1693 
1694 #endif
1695 } // end namespace oofem
CrossSection * giveCrossSection()
Definition: element.C:495
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
void setField(int item, InputFieldType id)
virtual bool isActivated(TimeStep *tStep)
Definition: element.C:793
virtual void computeBoundaryEdgeLoadVector(FloatArray &answer, BoundaryLoad *load, int edge, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true)
Computes the contribution of the given load at the given boundary edge.
Definition: element.C:618
contextIOResultType storeYourself(DataStream &stream) const
Stores array to output stream.
Definition: intarray.C:289
int giveNumberOfColumns() const
Returns number of columns of receiver.
Definition: floatmatrix.h:158
void enumerate(int maxVal)
Resizes receiver and enumerates from 1 to the maximum value given.
Definition: intarray.C:136
virtual void postInitialize()
Performs post initialization steps.
Definition: element.C:752
IntArray dofManArray
Array containing dofmanager numbers.
Definition: element.h:151
integrationDomain
Used by integrator class to supply integration points for proper domain to be integrated (Area...
int giveRegionNumber()
Definition: element.C:507
IntArray * giveBoundaryLoadArray()
Returns array containing load numbers of boundary loads acting on element.
Definition: element.C:381
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
Definition: element.C:1257
elementParallelMode parallel_mode
Determines the parallel mode of the element.
Definition: element.h:191
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 * giveBoundaryEdgeIntegrationRule(int order, int boundary)
Sets up a suitable integration rule for integrating over the requested boundary.
Definition: feinterpol.C:74
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Access method for default integration rule.
Definition: element.h:822
virtual double computeLength()
Computes the length (zero for all but 1D geometries)
Definition: element.C:1129
virtual int computeNumberOfDofs()
Computes or simply returns total number of element&#39;s local DOFs.
Definition: element.h:424
virtual int adaptiveMap(Domain *oldd, TimeStep *tStep)
Initializes the internal state variables stored in all IPs according to state in given domain...
Definition: element.C:1434
Element_Geometry_Type
Enumerative type used to classify element geometry Possible values are: EGT_point - point in space EG...
int giveGlobalNumber() const
Definition: dofmanager.h:501
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition: femcmpnn.h:82
double computeMeanSize()
Computes the size of the element defined as its length.
Definition: element.C:1078
virtual double computeVolume()
Computes the volume.
Definition: element.C:1101
virtual double giveRelativeSelfComputationalCost()
Returns the weight representing relative computational cost of receiver The reference element is tria...
Definition: element.h:1129
Abstract class representing field of primary variables (those, which are unknown and are typically as...
Definition: primaryfield.h:104
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
#define _IFT_Element_lcs
Definition: element.h:68
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
int packUnknowns(DataStream &buff, TimeStep *tStep)
Pack all necessary data of element (according to its parallel_mode) integration points into given com...
Definition: element.C:1545
int giveGlobalNumber() const
Definition: element.h:1059
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
double giveCastingTime()
Definition: material.h:156
void setIntegrationRules(std::vector< std::unique_ptr< IntegrationRule > > irlist)
Sets integration rules.
Definition: element.C:562
Class implementing element body load, acting over whole element volume (e.g., the dead weight)...
Definition: bodyload.h:49
The class representing the general material model adaptive mapping interface.
Class representing a general abstraction for surface finite element interpolation class...
Definition: feinterpol2d.h:45
void clear()
Clears receiver (zero size).
Definition: floatarray.h:206
virtual void giveInternalDofManDofIDMask(int inode, IntArray &answer) const
Returns internal dofmanager dof mask for node.
Definition: element.h:489
virtual ElementSide * giveSide(int i) const
Returns reference to the i-th side of element.
Definition: element.C:538
virtual void boundarySurfaceGiveNodes(IntArray &answer, int boundary)=0
Gives the boundary nodes for requested boundary number.
virtual void computeTangentFromEdgeLoad(FloatMatrix &answer, EdgeLoad *load, int boundary, MatResponseMode rmode, TimeStep *tStep)
Computes the tangent contribution of the given load at the given boundary.
Definition: element.C:612
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 giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Definition: element.C:706
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
Definition: element.C:779
virtual bool hasField(InputFieldType id)=0
Returns true if record contains field identified by idString keyword.
void beVectorForm(const FloatMatrix &aMatrix)
Reciever will be a vector with 9 components formed from a 3x3 matrix.
Definition: floatarray.C:992
virtual void initForNewStep()
Initializes receivers state to new time step.
Definition: element.C:846
InternalStateValueType
Determines the type of internal variable.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: femcmpnn.C:51
symmetric 3x3 tensor, packed with off diagonal components multiplied by 2 (engineering strain vector...
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol1d.h:44
Base class for dof managers.
Definition: dofmanager.h:113
General IO error.
int crossSection
Number of associated cross section.
Definition: element.h:155
virtual double giveLength(const FEICellGeometry &cellgeo) const
Computes the exact length.
Definition: feinterpol1d.h:85
NodalRecoveryModel * giveSmoother()
Returns the actual Smoother associated to receiver.
Definition: domain.C:1141
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Prints output of receiver to stream, for given time step.
Definition: dofmanager.C:510
virtual void giveCharacteristicMatrix(FloatMatrix &answer, CharType type, TimeStep *tStep)
Computes characteristic matrix of receiver of requested type in given time step.
Definition: element.C:569
int unpackAndUpdateUnknowns(DataStream &buff, TimeStep *tStep)
Unpack and updates all necessary data of element (according to its parallel_mode) integration points ...
Definition: element.C:1560
virtual double giveCoordinate(int i)
Definition: node.C:82
virtual ~Element()
Virtual destructor.
Definition: element.C:80
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Definition: femcmpnn.C:77
Class implementing an array of integers.
Definition: intarray.h:61
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
virtual int read(int *data, int count)=0
Reads count integer values into array pointed by data.
MatResponseMode
Describes the character of characteristic material matrix.
virtual void computeLoadVector(FloatArray &answer, BodyLoad *load, CharType type, ValueModeType mode, TimeStep *tStep)
Computes the contribution of the given body load (volumetric).
Definition: element.C:590
virtual int giveNumberOfDofManagers() const
Definition: element.h:656
void setElementList(IntArray newElements)
Sets list of elements within set.
Definition: set.C:204
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
virtual FEInterpolation * giveInterpolation() const
Definition: element.h:629
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
Definition: element.h:1158
Element(int n, Domain *aDomain)
Constructor.
Definition: element.C:71
void rotatedWith(FloatMatrix &r, char mode)
Returns the receiver a rotated according the change-of-base matrix r.
Definition: floatarray.C:799
virtual double giveVolume(const FEICellGeometry &cellgeo) const
Computes the exact volume.
Definition: feinterpol3d.C:40
virtual void drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
Definition: element.h:1007
Abstract base class representing integration rule.
#define _IFT_Element_bodyload
Definition: element.h:66
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: element.C:970
virtual double computeVolumeAreaOrLength()
Computes the volume, area or length of the element depending on its spatial dimension.
Definition: element.C:1059
virtual void giveBoundarySurfaceNodes(IntArray &bNodes, int boundary)
Returns list of receiver boundary nodes for given surface.
Definition: element.C:866
Base abstract class representing cross section in finite element mesh.
Definition: crosssection.h:107
void computeVectorOfPrescribed(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of prescribed unknowns.
Definition: element.C:181
virtual int giveNumberOfNodes() const
Returns number of nodes of receiver.
Definition: element.h:662
void beMatrixForm(const FloatArray &aArray)
Definition: floatmatrix.C:1657
ErrorEstimator * giveErrorEstimator()
Returns Error Estimator associated to receiver.
Definition: domain.C:1429
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol.h:132
virtual int write(const int *data, int count)=0
Writes count integer values from array pointed by data.
bool isNotEmpty() const
Tests for empty matrix.
Definition: floatmatrix.h:162
ElementSide * giveSide(int n)
Service for accessing particular domain element side.
Definition: domain.C:293
int activityTimeFunction
Element activity time function. If defined, nonzero value indicates active receiver, zero value inactive element.
Definition: element.h:176
CrossSection * giveCrossSection(int n)
Service for accessing particular domain cross section model.
Definition: domain.C:339
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Prints output of receiver to stream, for given time step.
Definition: element.C:759
#define _IFT_Element_partitions
Definition: element.h:69
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
Definition: element.h:518
virtual IntegrationRule * giveBoundarySurfaceIntegrationRule(int order, int boundary)
Sets up a suitable integration rule for integrating over the requested boundary.
Definition: feinterpol.C:85
IntegrationRule * createIRule(IntegrationRuleType name, int number, Element *e)
Definition: classfactory.C:416
FloatMatrix elemLocalCS
Transformation material matrix, used in orthotropic and anisotropic materials, global->local transfor...
Definition: element.h:173
void giveUnknownVector(FloatArray &answer, const IntArray &dofMask, ValueModeType mode, TimeStep *tStep, bool padding=false)
Assembles the vector of unknowns in global c.s for given dofs of receiver.
Definition: dofmanager.C:685
virtual bool computeDofTransformationMatrix(FloatMatrix &answer, const IntArray &nodes, bool includeInternal)
Returns transformation matrix for DOFs from global coordinate system to local coordinate system in no...
Definition: element.C:303
virtual double giveArea(const FEICellGeometry &cellgeo) const
Computes the exact area.
Definition: feinterpol2d.C:60
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 IntegrationRule * giveBoundaryEdgeIntegrationRule(int order, int boundary)
Returns boundary edge integration rule.
Definition: element.C:872
Material * giveMaterial(int n)
Service for accessing particular domain material model.
Definition: domain.C:281
int globalNumber
In parallel mode, globalNumber contains globally unique DoFManager number.
Definition: element.h:183
virtual void boundaryEdgeGiveNodes(IntArray &answer, int boundary)=0
Gives the boundary nodes for requested boundary number.
#define M_PI
Definition: mathfem.h:52
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
Definition: floatarray.C:463
virtual int estimatePackSize(DataStream &buff, GaussPoint *ip)=0
Estimates the necessary pack size to hold all packed data of receiver.
int giveNodalVector(const FloatArray *&ptr, int node)
Returns vector of recovered values for given node and region.
#define OOFEM_ERROR(...)
Definition: error.h:61
virtual bool requiresTransformation()
Indicates, whether dofManager requires the transformation.
Definition: dofmanager.C:944
void clear()
Clears the array (zero size).
Definition: intarray.h:177
int material
Number of associated material.
Definition: element.h:153
virtual int packUnknowns(DataStream &buff, TimeStep *tStep, GaussPoint *ip)=0
Pack all necessary data of integration point (according to element parallel_mode) into given communic...
void resizeWithData(int, int)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1369
#define _IFT_Element_boundaryload
Definition: element.h:67
void giveMasterDofIDArray(const IntArray &dofIDArry, IntArray &masterDofIDs) const
Returns master dof ID array of receiver.
Definition: dofmanager.C:209
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
#define _IFT_Element_nodes
Definition: element.h:65
Set of elements, boundaries, edges and/or nodes.
Definition: set.h:66
virtual int MMI_finish(TimeStep *tStep)=0
Finishes the mapping for given time step.
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
CrossSection * giveCrossSection()
Returns reference to cross section associated to related element of receiver.
Definition: gausspoint.h:200
void rotatedWith(const FloatMatrix &r, char mode= 'n')
Returns the receiver &#39;a&#39; transformed using give transformation matrix r.
Definition: floatmatrix.C:1557
Abstract base class representing an edge load (force, momentum, ...) that acts directly on a edge bou...
Definition: boundaryload.h:200
Wrapper around element definition to provide FEICellGeometry interface.
Definition: feinterpol.h:95
IntArray * giveBodyLoadArray()
Returns array containing load numbers of loads acting on element.
Definition: element.C:372
void resizeWithValues(int n, int allocChunk=0)
Checks size of receiver towards requested bounds.
Definition: intarray.C:115
virtual int global2local(FloatArray &answer, const FloatArray &gcoords, const FEICellGeometry &cellgeo)=0
Evaluates local coordinates from given global ones.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
IntArray bodyLoadArray
Array containing indexes of loads (body loads and boundary loads are kept separately), that apply on receiver.
Definition: element.h:160
virtual bool giveRotationMatrix(FloatMatrix &answer)
Transformation matrices updates rotation matrix between element-local and primary DOFs...
Definition: element.C:259
virtual double giveCharacteristicValue(CharType type, TimeStep *tStep)
Computes characteristic value of receiver of requested type in given time step.
Definition: element.C:627
double giveCharacteristicLengthForAxisymmElements(const FloatArray &normalToCrackPlane)
Returns the size of an axisymmetric element in the given direction if the direction is in the XY plan...
Definition: element.C:1186
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
int giveGlobalIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Definition: element.C:1306
void resizeWithValues(int s, int allocChunk=0)
Checks size of receiver towards requested bounds.
Definition: floatarray.C:615
virtual int computeNumberOfGlobalDofs()
Computes the total number of element&#39;s global dofs.
Definition: element.C:233
virtual RemeshingCriteria * giveRemeshingCrit()=0
Returns reference to associated remeshing criteria.
virtual double giveLengthInDir(const FloatArray &normalToCrackPlane)
Default implementation returns length of element projection into specified direction.
Definition: element.C:1143
Abstract base class for all material models.
Definition: material.h:95
virtual int giveLocalCoordinateSystem(FloatMatrix &answer)
Returns local coordinate system of receiver Required by material models with ortho- and anisotrophy...
Definition: element.C:1234
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
elementParallelMode
In parallel mode, this type indicates the mode of element.
Definition: element.h:100
virtual int mapStateVariables(Domain &iOldDom, const TimeStep &iTStep)
Maps the internal state variables stored in all IPs from the old domain to the new domain...
Definition: element.C:1455
double giveIntrinsicTime()
Returns intrinsic time, e.g. time in which constitutive model is evaluated.
Definition: timestep.h:148
void reserve(int s)
Allocates enough size to fit s, and clears the array.
Definition: floatarray.C:608
const IntArray & giveElementsWithMaterialNum(int iMaterialNum) const
Returns array with indices of elements that have a given material number.
Definition: domain.C:209
virtual DofManager * giveInternalDofManager(int i) const
Returns i-th internal element dof manager of the receiver.
Definition: element.h:238
virtual void drawAnnotation(oofegGraphicContext &gc, TimeStep *tStep)
Definition: element.C:1627
contextIOResultType restoreYourself(DataStream &stream)
Restores array from image on stream.
Definition: intarray.C:305
void setDofManagers(const IntArray &dmans)
Sets receiver dofManagers.
Definition: element.C:550
Function * giveFunction(int n)
Service for accessing particular domain load time function.
Definition: domain.C:268
The base class for all error estimation or error indicator algorithms.
int numberOfGaussPoints
Number of integration points as specified by nip.
Definition: element.h:188
virtual integrationDomain giveIntegrationDomain() const
Returns integration domain for receiver, used to initialize integration point over receiver volume...
Definition: element.C:1521
Abstract base class representing a material status information.
Definition: matstatus.h:84
virtual int giveNumberOfBoundarySides()
Definition: element.C:1387
Symmetric 3x3 tensor.
#define _IFT_Element_mat
Definition: element.h:63
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
Class representing vector of real numbers.
Definition: floatarray.h:82
int estimatePackSize(DataStream &buff)
Estimates the necessary pack size to hold all packed data of receiver.
Definition: element.C:1575
void addDofManager(DofManager *dMan)
Definition: element.C:525
Abstract base class representing a surface load (force, momentum, ...) that acts directly on a surfac...
Definition: boundaryload.h:218
Element is local, there are no contributions from other domains to this element.
Definition: element.h:101
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
#define _IFT_Element_remote
Definition: element.h:70
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
#define _IFT_Element_crosssect
Definition: element.h:64
double cbrt(double x)
Returns the cubic root of x.
Definition: mathfem.h:109
virtual int giveIPValue(FloatArray &answer, GaussPoint *ip, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
Definition: crosssection.C:89
virtual double computeArea()
Computes the area (zero for all but 2d geometries).
Definition: element.C:1115
void givePrescribedUnknownVector(FloatArray &answer, const IntArray &dofMask, ValueModeType mode, TimeStep *tStep)
Assembles the vector of prescribed unknowns in nodal c.s for given dofs of receiver.
Definition: dofmanager.C:748
double giveCharacteristicLengthForPlaneElements(const FloatArray &normalToCrackPlane)
Returns the size of element in the given direction if the direction is in the XY plane, otherwise gives the mean size defined as the square root of the element area.
Definition: element.C:1170
virtual IntegrationRule * giveBoundarySurfaceIntegrationRule(int order, int boundary)
Returns boundary surface integration rule.
Definition: element.C:878
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 double predictRelativeComputationalCost()
Returns the weight representing relative computational cost of receiver The reference element is tria...
Definition: element.C:1590
Class representing a general abstraction for surface finite element interpolation class...
Definition: feinterpol3d.h:44
void setBodyLoads(const IntArray &bodyLoads)
Sets receiver bodyLoadArray.
Definition: element.C:556
#define CM_DefinitionGlobal
Definition: contextmode.h:48
virtual double predictRelativeComputationalCost(GaussPoint *ip)
Returns the weight representing relative computational cost of receiver The reference cross section i...
Definition: crosssection.C:178
void append(const FloatArray &a)
Appends array to reciever.
Definition: floatarray.C:664
Class implementing element side having some DOFs in finite element mesh.
Definition: elementside.h:60
const char * __Element_Geometry_TypeToString(Element_Geometry_Type _value)
Definition: cltypes.C:318
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
Definition: intarray.C:145
virtual int giveNumberOfInternalDofManagers() const
Definition: element.h:232
virtual integrationDomain giveIntegrationDomain() const =0
Returns the integration domain of the interpolator.
virtual int adaptiveFinish(TimeStep *tStep)
Finishes the mapping for given time step.
Definition: element.C:1487
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: element.C:885
virtual void drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType)
Definition: element.h:1006
int computeNumberOfPrimaryMasterDofs()
Computes the total number of element&#39;s primary master DOFs.
Definition: element.C:240
virtual void giveBoundaryLocationArray(IntArray &locationArray, const IntArray &bNodes, const UnknownNumberingScheme &s, IntArray *dofIds=NULL)
Returns the location array for the boundary of the element.
Definition: element.C:446
virtual Interface * giveInterface(InterfaceType t)
Interface requesting service.
Definition: femcmpnn.h:179
Class representing the a dynamic Input Record.
#define _IFT_Element_activityTimeFunction
Definition: element.h:71
ClassFactory & classFactory
Definition: classfactory.C:59
virtual bool computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
Computes the element local coordinates from given global coordinates.
Definition: element.C:1222
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
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
#define CM_Definition
Definition: contextmode.h:47
Element in active domain is only mirror of some remote element.
Definition: element.h:102
virtual int MMI_map(GaussPoint *gp, Domain *oldd, TimeStep *tStep)=0
Maps the required internal state variables from old mesh oldd to given ip.
virtual FloatArray * giveCoordinates()
Definition: node.h:114
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
Domain * giveDomain() const
Definition: femcmpnn.h:100
IntArray partitions
List of partition sharing the shared element or remote partition containing remote element counterpar...
Definition: element.h:197
virtual Element_Geometry_Type giveGeometryType() const =0
Returns the geometry type fo the interpolator.
virtual int unpackAndUpdateUnknowns(DataStream &buff, TimeStep *tStep, GaussPoint *ip)=0
Unpack and updates all necessary data of given integration point (according to element parallel_mode)...
void beUnitMatrix()
Sets receiver to unity matrix.
Definition: floatmatrix.C:1332
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: femcmpnn.C:64
IntegrationRuleType
virtual void giveCharacteristicVector(FloatArray &answer, CharType type, ValueModeType mode, TimeStep *tStep)
Computes characteristic vector of receiver of requested type in given time step.
Definition: element.C:580
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
Definition: floatmatrix.C:337
InternalStateValueType giveInternalStateValueType(InternalStateType type)
Definition: cltypes.C:77
virtual bool computeGtoLRotationMatrix(FloatMatrix &answer)
Returns transformation matrix from global c.s.
Definition: element.C:1537
int giveSize() const
Definition: intarray.h:203
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
#define OOFEG_ELEMENT_ANNOTATION_LAYER
virtual Element_Geometry_Type giveGeometryType() const
Returns the element geometry type.
Definition: element.C:1529
int giveLabel() const
Definition: element.h:1055
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual double giveElementError(EE_ErrorType type, Element *elem, TimeStep *tStep)=0
Returns the element error.
int giveNumberOfPrimaryMasterDofs(const IntArray &dofIDArray) const
Returns the number of primary dofs on which receiver dofs (given in dofArray) depend on...
Definition: dofmanager.C:303
DofManager * giveDofManager(int i) const
Definition: element.C:514
void clear()
Sets size of receiver to be an empty matrix. It will have zero rows and zero columns size...
Definition: floatmatrix.h:516
Class implementing node in finite element mesh.
Definition: node.h:87
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...
Definition: element.C:598
virtual void updateLocalNumbering(EntityRenumberingFunctor &f)
Local renumbering support.
Definition: element.C:1511
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
virtual bool isCast(TimeStep *tStep)
Definition: element.C:809
virtual void initTempStatus(GaussPoint *gp)
Initializes temporary variables stored in integration point status at the beginning of new time step...
Definition: material.C:267
int giveNumber() const
Definition: femcmpnn.h:107
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
Definition: domain.C:314
The base class for all recovery models, which perform nodal averaging or projection processes for int...
Node * giveNode(int i) const
Returns reference to the i-th node of element.
Definition: element.h:610
int giveNumberOfRows() const
Returns number of rows of receiver.
Definition: floatmatrix.h:156
void computeBoundaryVectorOf(const IntArray &bNodes, const IntArray &dofIDMask, ValueModeType u, TimeStep *tStep, FloatArray &answer, bool padding=false)
Boundary version of computeVectorOf.
Definition: element.C:139
void giveLocationArray(const IntArray &dofIDArry, IntArray &locationArray, const UnknownNumberingScheme &s) const
Returns location array (array containing for each requested dof related equation number) for given nu...
Definition: dofmanager.C:177
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
Definition: element.h:1005
virtual double evaluateAtTime(double t)
Returns the value of the function at given time.
Definition: function.C:76
virtual void computeTangentFromSurfaceLoad(FloatMatrix &answer, SurfaceLoad *load, int boundary, MatResponseMode rmode, TimeStep *tStep)
Computes the tangent contribution of the given load at the given boundary.
Definition: element.C:606
Class representing integration point in finite element program.
Definition: gausspoint.h:93
#define OOFEM_WARNING(...)
Definition: error.h:62
virtual void computeMidPlaneNormal(FloatArray &answer, const GaussPoint *gp)
Computes mid-plane normal of receiver at integration point.
Definition: element.C:1248
virtual void giveBoundaryEdgeNodes(IntArray &bNodes, int boundary)
Returns list of receiver boundary nodes for given edge.
Definition: element.C:860
IntArray boundaryLoadArray
Definition: element.h:160
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
The top abstract class of all classes constituting the finite element mesh.
Definition: femcmpnn.h:76
virtual void drawSpecial(oofegGraphicContext &gc, TimeStep *tStep)
Definition: element.h:1008
int numberOfDofMans
Number of dofmanagers.
Definition: element.h:149
InternalStateMode
Determines the mode of internal variable.
virtual void local2global(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates global coordinates from given local ones.
#define _IFT_Element_nip
Definition: element.h:72
virtual Material * giveMaterial()
Definition: element.C:484
virtual void drawYourself(oofegGraphicContext &gc, TimeStep *tStep)
Definition: element.C:1604
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631
virtual Material * giveMaterial(IntegrationPoint *ip)=0
Returns the material associated with the GP.
OGC_PlotModeType giveIntVarPlotMode()

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:28 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011