OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
transportelement.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 "transportelement.h"
36 #include "domain.h"
37 #include "transportmaterial.h"
38 #include "load.h"
39 #include "bodyload.h"
40 #include "boundaryload.h"
41 #include "gausspoint.h"
42 #include "gaussintegrationrule.h"
43 #include "intarray.h"
44 #include "floatarray.h"
45 #include "floatmatrix.h"
46 #include "verbose.h"
47 #include "mathfem.h"
48 #include "crosssection.h"
49 #include "transportcrosssection.h"
50 #include "feinterpol.h"
51 #include "feinterpol2d.h"
52 #include "feinterpol3d.h"
53 #include "dof.h"
55 #include "function.h"
56 #ifdef __CEMHYD_MODULE
57  #include "cemhyd/cemhydmat.h"
58 #endif
59 
60 
61 #ifdef __OOFEG
62  #include "oofeggraphiccontext.h"
63 #endif
64 
65 namespace oofem {
66 
67 const double TransportElement :: stefanBoltzmann = 5.67e-8; //W/m2/K4
68 
70  Element(n, aDomain), emode( em )
71 {
72 }
73 
74 
76 { }
77 
78 
79 void
81 {
82  if ( emode == HeatTransferEM ) {
83  answer = {T_f};
84  } else if ( emode == HeatMass1TransferEM ) {
85  answer = {T_f, C_1};
86  } else if ( emode == Mass1TransferEM ) {
87  answer = {C_1};
88  } else {
89  OOFEM_ERROR("Unknown ElementMode");
90  }
91 }
92 
93 
94 void
96  CharType mtrx, TimeStep *tStep)
97 //
98 // returns characteristics matrix of receiver according to mtrx
99 //
100 {
101  if ( mtrx == TangentStiffnessMatrix ) {
102  FloatMatrix tmp;
103  this->computeConductivityMatrix(answer, Conductivity, tStep);
104  this->computeBCMtrxAt(tmp, tStep, VM_TotalIntrinsic);
105  answer.add(tmp);
106  } else if ( mtrx == ConductivityMatrix ) {
107  this->computeConductivityMatrix(answer, Conductivity, tStep);
108  } else if ( mtrx == CapacityMatrix || mtrx == MassMatrix ) {
109  this->computeCapacityMatrix(answer, tStep);
110  } else if ( mtrx == LumpedMassMatrix ) {
111  this->computeCapacityMatrix(answer, tStep);
112  for ( int i = 1; i <= answer.giveNumberOfRows(); i++ ) {
113  double s = 0.0;
114  for ( int j = 1; j <= answer.giveNumberOfColumns(); j++ ) {
115  s += answer.at(i, j);
116  answer.at(i, j) = 0.0;
117  }
118  answer.at(i, i) = s;
119  }
120  } else {
121  OOFEM_ERROR("Unknown Type of characteristic mtrx (%s)", __CharTypeToString(mtrx));
122  }
123 }
124 
125 
126 void
128  TimeStep *tStep)
129 //
130 // returns characteristics vector of receiver according to requested type
131 //
132 {
133  if ( mtrx == InternalForcesVector ) {
134  this->computeInternalForcesVector(answer, tStep);
135  } else if ( mtrx == ExternalForcesVector ) {
136  //this->computeExternalForcesVector(answer, tStep, mode); // bp: assembled by emodel->updateComponent
137  answer.resize(0);
138  } else if ( mtrx == InertiaForcesVector ) {
139  this->computeInertiaForcesVector(answer, tStep);
140  } else if ( mtrx == LumpedMassMatrix ) {
141  this->computeLumpedCapacityVector(answer, tStep);
142  } else {
143  OOFEM_ERROR( "Unknown Type of characteristic mtrx (%s)",
144  __CharTypeToString(mtrx) );
145  }
146 }
147 
148 
149 int
151 //
152 // check internal consistency
153 // mainly tests, whether material and crossSection data
154 // are safe for conversion to "Structural" versions
155 //
156 {
157  int result = 1;
158  if ( this->material > 0 && !dynamic_cast< TransportMaterial* >( this->giveMaterial() ) ) {
159  OOFEM_WARNING("cross section without support for transport problems");
160  result = 0;
161  }
162 
163 #if 0
164  if ( !this->giveCrossSection()->testCrossSectionExtension(CS_TransportCapability) ) {
165  OOFEM_WARNING("cross-section without support for transport problems", 1);
166  result = 0;
167  }
168 
169 #endif
170  return result;
171 }
172 
173 void
175 {
176  answer.resize( this->computeNumberOfDofs(), this->computeNumberOfDofs() );
177  answer.zero();
178 
179  if ( emode == HeatTransferEM || emode == Mass1TransferEM ) {
180  this->computeCapacitySubMatrix(answer, Capacity, 0, tStep);
181  } else if ( emode == HeatMass1TransferEM ) {
182  FloatMatrix subAnswer;
183  MatResponseMode rmode [ 2 ] = {
184  Capacity_hh, Capacity_ww
185  };
186  //double coeff = 1.0; //this->giveMaterial()->give('d');
187 
188  for ( int i = 1; i <= 2; i++ ) {
189  this->computeCapacitySubMatrix(subAnswer, rmode [ i - 1 ], 0, tStep);
190  this->assembleLocalContribution(answer, subAnswer, 2, i, i);
191  }
192  } else {
193  OOFEM_ERROR("Unknown ElementMode");
194  }
195 }
196 
197 void
199 {
200  answer.resize( this->computeNumberOfDofs(), this->computeNumberOfDofs() );
201  answer.zero();
202  if ( emode == HeatTransferEM || emode == Mass1TransferEM ) {
203  this->computeConductivitySubMatrix(answer, 0, Conductivity_hh, tStep);
204  } else if ( emode == HeatMass1TransferEM ) {
205  FloatMatrix subAnswer;
206  MatResponseMode rmode [ 2 ] [ 2 ] = { { Conductivity_hh, Conductivity_hw }, { Conductivity_wh, Conductivity_ww } };
207 
208  for ( int i = 1; i <= 2; i++ ) {
209  for ( int j = 1; j <= 2; j++ ) {
210  this->computeConductivitySubMatrix(subAnswer, 0, rmode [ i - 1 ] [ j - 1 ], tStep);
211  this->assembleLocalContribution(answer, subAnswer, 2, i, j);
212  }
213  }
214  } else {
215  OOFEM_ERROR("Unknown ElementMode");
216  }
217 }
218 
219 
220 void
222 {
223  this->giveInterpolation()->evalN( answer, lcoord, FEIElementGeometryWrapper(this) );
224 }
225 
226 
227 void
229 {
230  FloatArray n;
231  this->computeNAt(n, lcoords);
232  if ( this->emode == HeatTransferEM || this->emode == Mass1TransferEM ) {
233  answer.beNMatrixOf(n, 1);
234  } else {
235  answer.beNMatrixOf(n, 2);
236  }
237 }
238 
239 
240 void
242 {
243  FloatMatrix dnx;
245  this->giveInterpolation()->evaldNdx( dnx, lcoords, FEIElementGeometryWrapper(this) );
246  if ( emode == HeatTransferEM || emode == Mass1TransferEM ) {
247  answer.beTranspositionOf(dnx);
248  } else if ( this->emode == HeatMass1TransferEM ) {
249  int nodes = dnx.giveNumberOfRows();
250  int nsd = dnx.giveNumberOfColumns();
251  answer.resize(nsd*2, nodes*2);
252  answer.zero();
253  for (int i = 0; i < nodes; ++i) {
254  for (int j = 0; j < nsd; ++j) {
255  answer(j, i*2) = dnx(i, j);
256  answer(j+nsd, i*2+1) = dnx(i, j);
257  }
258  }
259  }
260 }
261 
262 
263 void
265 {
266  FloatMatrix dnx;
267  this->giveInterpolation()->evaldNdx( dnx, lcoords, FEIElementGeometryWrapper(this) );
269  answer.beTranspositionOf(dnx);
270 }
271 
272 
273 void
274 TransportElement :: computeEgdeNAt(FloatArray &answer, int iedge, const FloatArray &lcoords)
275 {
276  FEInterpolation *interp = this->giveInterpolation();
277  if ( dynamic_cast< FEInterpolation2d * >(interp) ) {
278  dynamic_cast< FEInterpolation2d * >(interp)->edgeEvalN( answer, iedge, lcoords, FEIElementGeometryWrapper(this) );
279  } else if ( dynamic_cast< FEInterpolation3d * >(interp) ) {
280  dynamic_cast< FEInterpolation3d * >(interp)->edgeEvalN( answer, iedge, lcoords, FEIElementGeometryWrapper(this) );
281  }
282 }
283 
284 
285 void
287 {
288  FEInterpolation *interp = this->giveInterpolation();
289  if ( dynamic_cast< FEInterpolation2d * >(interp) ) {
290  dynamic_cast< FEInterpolation2d * >(interp)->computeLocalEdgeMapping(answer, iEdge);
291  } else if ( dynamic_cast< FEInterpolation3d * >(interp) ) {
292  dynamic_cast< FEInterpolation3d * >(interp)->computeLocalEdgeMapping(answer, iEdge);
293  }
294 }
295 
296 
297 void
299 {
300  FEInterpolation *interp = this->giveInterpolation();
301  if ( dynamic_cast< FEInterpolation3d * >(interp) ) {
302  dynamic_cast< FEInterpolation3d * >(interp)->surfaceEvalN( answer, iSurf, lcoord, FEIElementGeometryWrapper(this) );
303  }
304 }
305 
306 void
308 {
309  FEInterpolation *interp = this->giveInterpolation();
310  if ( dynamic_cast< FEInterpolation3d * >(interp) ) {
311  dynamic_cast< FEInterpolation3d * >(interp)->computeLocalSurfaceMapping(answer, iSurf);
312  }
313 }
314 
315 int
317 {
318  return this->giveInterpolation()->giveInterpolationOrder();
319 }
320 
321 void
323 {
324  FloatArray n;
325  TransportMaterial *mat = static_cast< TransportMaterial * >( this->giveMaterial() );
326 
327  answer.clear();
328  for ( auto &gp: *integrationRulesArray [ iri ] ) {
329  this->computeNAt( n, gp->giveNaturalCoordinates() );
330  // ask for capacity coefficient. In basic units [J/K/m3]
331  double c = mat->giveCharacteristicValue(rmode, gp, tStep);
332  double dV = this->computeVolumeAround(gp);
333  answer.plusDyadSymmUpper(n, dV * c);
334  }
335 
336  answer.symmetrized();
337 }
338 
339 void
341 {
342  FloatMatrix b, d, db;
343 
344  answer.resize( this->giveNumberOfDofManagers(), this->giveNumberOfDofManagers() );
345  answer.zero();
346  for ( auto &gp: *integrationRulesArray [ iri ] ) {
347  this->computeConstitutiveMatrixAt(d, rmode, gp, tStep);
348  this->computeGradientMatrixAt(b, gp->giveNaturalCoordinates());
349  double dV = this->computeVolumeAround(gp);
350 
351  db.beProductOf(d, b);
352  answer.plusProductSymmUpper(b, db, dV);
353  }
354 
355  answer.symmetrized();
356 }
357 
358 void
360 {
361  // Computes numerically the generator Rhs vector of the receiver due to the generator
362  // at tStep.
363  // // load is first transformed to local cs.
364  // // load vector is then transformed to coordinate system in each node.
365  // // (should be global coordinate system, but there may be defined
366  // // different coordinate system in each node)
367  TransportMaterial *mat = static_cast< TransportMaterial * >( this->giveMaterial() );
368 
369  FloatArray val, n;
370  answer.clear();
371 
372  // add internal source produced by material (if any)
373  if ( mat->hasInternalSource() ) {
374  for ( auto &gp: *this->giveDefaultIntegrationRulePtr() ) {
375  this->computeNAt( n, gp->giveNaturalCoordinates() );
376  double dV = this->computeVolumeAround(gp);
377  mat->computeInternalSourceVector(val, gp, tStep, mode);
378 
379  answer.add(val.at(indx) * dV, n);
380  }
381  }
382 }
383 
384 
385 void
387 {
388  if ( emode == HeatTransferEM || emode == Mass1TransferEM ) {
389  this->computeInternalSourceRhsSubVectorAt(answer, tStep, mode, 1);
390  } else if ( emode == HeatMass1TransferEM ) {
391  FloatArray subAnswer;
392 
393  for ( int i = 1; i <= 2; i++ ) {
394  this->computeInternalSourceRhsSubVectorAt(subAnswer, tStep, mode, i);
395  if ( subAnswer.isNotEmpty() ) {
396  if ( answer.isEmpty() ) {
397  answer.resize( 2 * subAnswer.giveSize() );
398  answer.zero();
399  }
400 
401  this->assembleLocalContribution(answer, subAnswer, 2, i);
402  }
403  }
404  } else {
405  OOFEM_ERROR("Unknown ElementMode");
406  }
407 }
408 
409 
410 void
412 {
413  TransportMaterial *mat = static_cast< TransportMaterial * >( this->giveMaterial() );
414  if ( mat->hasInternalSource() ) {
415  answer.resize( this->computeNumberOfDofs(), this->computeNumberOfDofs() );
416  answer.zero();
417 
418  if ( emode == HeatTransferEM || emode == Mass1TransferEM ) {
419  this->computeIntSourceLHSSubMatrix(answer, IntSource, 0, tStep);
420  } else if ( emode == HeatMass1TransferEM ) {
421  FloatMatrix subAnswer;
422  MatResponseMode rmode [ 2 ] = {
423  IntSource_hh, IntSource_ww
424  };
425  //double coeff = 1.0; //this->giveMaterial()->give('d');
426 
427  for ( int i = 1; i <= 2; i++ ) {
428  this->computeIntSourceLHSSubMatrix(subAnswer, rmode [ i - 1 ], 0, tStep);
429  this->assembleLocalContribution(answer, subAnswer, 2, i, i);
430  }
431  } else {
432  OOFEM_ERROR("Unknown ElementMode");
433  }
434  } else {
435  answer.clear();
436  }
437 }
438 
439 void
441 // computes LHS matrix due to material internal source (dHeat/dTemperature, dWaterSource/dw)
442 // IntSource - Heat transfer
443 // IntSource_hh - HeMo heat source
444 // IntSource_ww - HeMo water content source
445 // hw, wh is not used now
446 {
447  FloatArray n;
448  TransportMaterial *mat = static_cast< TransportMaterial * >( this->giveMaterial() );
449 
450  answer.clear();
451  for ( auto &gp: *integrationRulesArray [ iri ] ) {
452  this->computeNAt( n, gp->giveNaturalCoordinates() );
453  // ask for coefficient from material
454  double c = mat->giveCharacteristicValue(rmode, gp, tStep);
455  double dV = this->computeVolumeAround(gp);
456  answer.plusDyadSymmUpper(n, dV * c);
457  }
458 
459  answer.symmetrized();
460 }
461 
462 
463 void
465  MatResponseMode rMode, GaussPoint *gp,
466  TimeStep *tStep)
467 {
468  static_cast< TransportMaterial * >( this->giveMaterial() )->giveCharacteristicMatrix(answer, rMode, gp, tStep);
469 }
470 
471 void
473 {
474  FloatArray unknowns;
475  this->computeVectorOf(VM_TotalIntrinsic, tStep, unknowns);
476 
477  TransportMaterial *mat = static_cast< TransportMaterial* >( this->giveMaterial() );
478  FloatArray flux, grad, field;
479  FloatMatrix B, N;
480 
481  answer.clear();
482  for ( auto &gp: *integrationRulesArray [ 0 ] ) {
483  const FloatArray &lcoords = gp->giveNaturalCoordinates();
484 
485  this->computeNmatrixAt(N, lcoords);
486  this->computeBmatrixAt(B, lcoords);
487 
488  field.beProductOf(N, unknowns);
489  grad.beProductOf(B, unknowns);
490 
491  mat->giveFluxVector(flux, gp, grad, field, tStep);
492 
493  double dV = this->computeVolumeAround(gp);
494  answer.plusProduct(B, flux, -dV);
495 
497  if ( mat->hasInternalSource() ) {
498  // add internal source produced by material (if any)
499  FloatArray val;
500  mat->computeInternalSourceVector(val, gp, tStep, VM_TotalIntrinsic);
501  answer.plusProduct(N, val, -dV);
502  }
503  }
504  /*
506  // Neumann b.c.s
507  FloatMatrix bc_tangent;
508  this->computeBCMtrxAt(bc_tangent, tStep, VM_TotalIntrinsic);
509  if ( bc_tangent.isNotEmpty() ) {
510  answer.plusProduct(bc_tangent, unknowns, 1.0);
511  }
512  */
513 }
514 
515 
516 void
518 {
519  FloatMatrix cap;
520  FloatArray vel;
521  this->computeVectorOf(VM_Velocity, tStep, vel);
522  this->computeCapacityMatrix(cap, tStep);
523  answer.beProductOf(cap, vel);
524 }
525 
526 
527 void
529 {
530  FloatMatrix cap;
531  this->computeCapacityMatrix(cap, tStep);
532 
533  int size = cap.giveNumberOfRows();
534  answer.resize(size);
535  answer.zero();
536  for ( int i = 1; i <= size; i++ ) {
537  for ( int j = 1; j <= size; j++ ) {
538  answer.at(i) += cap.at(i, j);
539  }
540  }
541 }
542 
543 
544 void
546 {
547  answer.clear();
548 
550 #if 1
551  if ( type != ExternalForcesVector ) {
552  return;
553  }
554 #else
555  if ( !( load->giveType() == TransmissionBC && type == ExternalForcesVector ) &&
556  !( load->giveType() == ConvectionBC && type == InternalForcesVector ) ) {
557  return;
558  }
559 #endif
560 
561  FloatArray gcoords, val, n, unknowns;
562  FloatMatrix N;
563  IntArray dofid;
564  int unknownsPerNode = this->emode == HeatMass1TransferEM ? 2 : 1;
565 
566  this->giveElementDofIDMask(dofid);
567 
569  FEInterpolation *interp = this->giveInterpolation();
570  std :: unique_ptr< IntegrationRule > iRule( interp->giveIntegrationRule( load->giveApproxOrder() + 1 + interp->giveInterpolationOrder()) );
571 
572  if ( load->giveType() == ConvectionBC || load->giveType() == RadiationBC ) {
573  this->computeVectorOf(dofid, VM_TotalIntrinsic, tStep, unknowns);
574  }
575 
576  for ( auto &gp: *iRule ) {
577  const FloatArray &lcoords = gp->giveNaturalCoordinates();
578 
579  interp->evalN( n, lcoords, FEIElementGeometryWrapper(this) );
580  N.beNMatrixOf(n, unknownsPerNode);
581 
582  double dV = this->computeVolumeAround(gp);
583 
584  if ( load->giveFormulationType() == Load :: FT_Entity ) {
585  load->computeValueAt(val, tStep, lcoords, mode);
586  } else {
587  interp->local2global( gcoords, lcoords, FEIElementGeometryWrapper(this) );
588  load->computeValueAt(val, tStep, gcoords, mode);
589  }
590 
591  answer.plusProduct(N, val, dV);
592  }
593 }
594 
595 
596 void
598 {
599  answer.clear();
600 
601  if ( !( load->giveType() == TransmissionBC && type == ExternalForcesVector ) &&
602  !( load->giveType() == ConvectionBC && type == InternalForcesVector ) &&
603  !( load->giveType() == RadiationBC && type == InternalForcesVector ) ) {
604  return;
605  }
606 
607  FloatArray gcoords, val, n, unknowns, field;
608  FloatMatrix N;
609  IntArray dofid;
610  int unknownsPerNode = this->emode == HeatMass1TransferEM ? 2 : 1;
611 
612  this->giveElementDofIDMask(dofid);
613 
615  FEInterpolation *interp = this->giveInterpolation();
616  std :: unique_ptr< IntegrationRule > iRule( this->giveBoundarySurfaceIntegrationRule(load->giveApproxOrder() + interp->giveInterpolationOrder(), boundary) );
617 
618  if ( load->giveType() == ConvectionBC || load->giveType() == RadiationBC ) {
619  IntArray bNodes;
620  interp->boundaryGiveNodes(bNodes, boundary);
621  this->computeBoundaryVectorOf(bNodes, dofid, VM_TotalIntrinsic, tStep, unknowns);
622  }
623 
624  for ( auto &gp: *iRule ) {
625  const FloatArray &lcoords = gp->giveNaturalCoordinates();
626 
627  //this->computeEgdeNAt(n, iEdge, lcoords);
628  interp->boundaryEvalN( n, boundary, lcoords, FEIElementGeometryWrapper(this) );
629  N.beNMatrixOf(n, unknownsPerNode);
630 
631  interp->boundaryLocal2Global( gcoords, boundary, lcoords, FEIElementGeometryWrapper(this) );
632  double detJ = interp->boundaryGiveTransformationJacobian( boundary, lcoords, FEIElementGeometryWrapper(this) );
633  double dA = this->giveThicknessAt(gcoords) * gp->giveWeight() * detJ;
634 
635  //Check external ambient temperature field first
636  FieldPtr tf;
637  if (tf = domain->giveEngngModel()->giveContext()->giveFieldManager()->giveField(FT_TemperatureAmbient)){
638  tf->evaluateAt(val, gcoords, VM_TotalIntrinsic, tStep);
639  } else if ( load->giveFormulationType() == Load :: FT_Entity ) {
640  load->computeValueAt(val, tStep, lcoords, mode);
641  } else {
642  load->computeValueAt(val, tStep, gcoords, mode);
643  }
644 
645  if ( load->giveType() == TransmissionBC ) {
646  val.negated();
647  } else if ( load->giveType() == ConvectionBC ) {
648  field.beProductOf(N, unknowns);
649  val.subtract(field);
650  double a;
651  if ( load->propertyMultExpr.isDefined() ) {
652  if ( unknownsPerNode != 1 ) {
653  OOFEM_ERROR("Not implemented for >=2 coupled fields");
654  }
655  a = load->giveProperty('a', tStep, { { "u", field.at(1) } });
656  } else {
657  a = load->giveProperty('a', tStep);
658  }
659  val.times( -1.0 * a );
660  } else if ( load->giveType() == RadiationBC ) {
661  //actual Temperature in C in field
662  field.beProductOf(N, unknowns); field.add(load->giveTemperOffset()); field.power(4);
663  val.add(load->giveTemperOffset()); val.power(4); val.subtract(field);
664  val.times( -1.0 * load->giveProperty('e', tStep) * stefanBoltzmann );
665  }
666 
667  answer.plusProduct(N, val, dA);
668  }
669 }
670 
671 //Contribution to conductivity matrix from convection and radiation
672 void
674 {
675  answer.clear();
676 
677  if ( load->giveType() != ConvectionBC ) {
678  return;
679  }
680 
681  FloatArray gcoords, n, unknowns;
682  FloatMatrix N;
683  int unknownsPerNode = this->emode == HeatMass1TransferEM ? 2 : 1;
684 
686  FEInterpolation *interp = this->giveInterpolation();
687  std :: unique_ptr< IntegrationRule > iRule( this->giveBoundarySurfaceIntegrationRule(load->giveApproxOrder() + interp->giveInterpolationOrder(), boundary) );
688 
689  if ( load->propertyMultExpr.isDefined() ) {
690  if ( unknownsPerNode != 1 ) {
691  OOFEM_ERROR("Load property multexpr not implemented for coupled fields");
692  }
693  IntArray dofid, bNodes;
694  interp->boundaryGiveNodes(bNodes, boundary);
695  this->giveElementDofIDMask(dofid);
696  this->computeBoundaryVectorOf(bNodes, dofid, VM_TotalIntrinsic, tStep, unknowns);
697  }
698 
699  for ( auto &gp : *iRule ) {
700  const FloatArray &lcoords = gp->giveNaturalCoordinates();
701 
702  interp->boundaryEvalN( n, boundary, lcoords, FEIElementGeometryWrapper(this) );
703  interp->boundaryLocal2Global( gcoords, boundary, lcoords, FEIElementGeometryWrapper(this) );
704  double detJ = interp->boundaryGiveTransformationJacobian( boundary, lcoords, FEIElementGeometryWrapper(this) );
705  double dA = this->giveThicknessAt(gcoords) * gp->giveWeight() * detJ;
706  N.beNMatrixOf(n, unknownsPerNode);
707 
708  if ( load->giveType() == ConvectionBC ){
709  double a;
710  if ( load->propertyMultExpr.isDefined() ) {
711  double value = n.dotProduct(unknowns);
712  a = load->giveProperty('a', tStep, { { "u", value } });
713  } else {
714  a = load->giveProperty('a', tStep);
715  }
716  answer.plusProductSymmUpper(N, N, a * dA);
717  }
718  }
719  answer.symmetrized();
720 }
721 
722 
723 void
725 {
726  answer.clear();
727 
728  if ( load->giveType() != ConvectionBC ) {
729  return;
730  }
731 
732  FloatArray gcoords, n, unknowns;
733  FloatMatrix N;
734  int unknownsPerNode = this->emode == HeatMass1TransferEM ? 2 : 1;
735 
737  FEInterpolation *interp = this->giveInterpolation();
738  std :: unique_ptr< IntegrationRule > iRule( this->giveBoundaryEdgeIntegrationRule(load->giveApproxOrder() + interp->giveInterpolationOrder(), boundary) );
739 
740  if ( load->propertyMultExpr.isDefined() ) {
741  IntArray bNodes, dofid;
742  this->giveElementDofIDMask(dofid);
743  interp->boundaryEdgeGiveNodes(bNodes, boundary);
744  this->giveElementDofIDMask(dofid);
745  this->computeBoundaryVectorOf(bNodes, dofid, VM_TotalIntrinsic, tStep, unknowns);
746  }
747 
748  for ( auto &gp : *iRule ) {
749  const FloatArray &lcoords = gp->giveNaturalCoordinates();
750 
751  interp->boundaryEvalN( n, boundary, lcoords, FEIElementGeometryWrapper(this) );
752  interp->boundaryLocal2Global( gcoords, boundary, lcoords, FEIElementGeometryWrapper(this) );
753  double detJ = interp->boundaryGiveTransformationJacobian( boundary, lcoords, FEIElementGeometryWrapper(this) );
754  double dA = this->giveThicknessAt(gcoords) * gp->giveWeight() * detJ;
755  N.beNMatrixOf(n, unknownsPerNode);
756 
757  if ( load->giveType() == ConvectionBC ){
758  double a;
759  if ( load->propertyMultExpr.isDefined() ) {
760  if ( unknownsPerNode != 1 ) {
761  OOFEM_ERROR("Not implemented for >=2 coupled fields");
762  }
763  FloatArray field, val;
764  field.beProductOf(N, unknowns);
765  val.subtract(field);
766  a = load->giveProperty('a', tStep, { { "u", field.at(1) } });
767  } else {
768  a = load->giveProperty('a', tStep);
769  }
770  answer.plusProductSymmUpper(N, N, a * dA);
771  }
772  }
773  answer.symmetrized();
774 }
775 
776 
777 void
778 TransportElement :: computeBoundaryEdgeLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global)
779 {
781  answer.clear();
782 
783  if ( !( load->giveType() == TransmissionBC && type == ExternalForcesVector ) &&
784  !( load->giveType() == ConvectionBC && type == InternalForcesVector ) &&
785  !( load->giveType() == RadiationBC && type == InternalForcesVector ) ) {
786  return;
787  }
788 
789  if ( !load->isImposed(tStep) ) {
790  return;
791  }
792 
793  FloatArray gcoords, val, n, unknowns, field;
794  FloatMatrix N;
795  int unknownsPerNode = this->emode == HeatMass1TransferEM ? 2 : 1;
796 
798  FEInterpolation *interp = this->giveInterpolation();
799  std :: unique_ptr< IntegrationRule > iRule( this->giveBoundaryEdgeIntegrationRule(load->giveApproxOrder() + interp->giveInterpolationOrder(), boundary) );
800 
801  // get solution vector for InternalForcesVector (Convention or radiation)
802  if ( load->giveType() == ConvectionBC || load->giveType() == RadiationBC ) {
803  IntArray bNodes, dofid;
804  this->giveElementDofIDMask(dofid);
805  interp->boundaryEdgeGiveNodes(bNodes, boundary);
806  this->computeBoundaryVectorOf(bNodes, dofid, VM_TotalIntrinsic, tStep, unknowns);
807  }
808 
809  for ( auto &gp: *iRule ) {
810  const FloatArray &lcoords = gp->giveNaturalCoordinates();
811  //this->computeEgdeNAt(n, boundary, lcoords);
812  interp->boundaryEdgeEvalN( n, boundary, lcoords, FEIElementGeometryWrapper(this) );
813  N.beNMatrixOf(n, unknownsPerNode);
814 
815 
816  //double detJ = interp->boundaryEdgeGiveTransformationJacobian( boundary, lcoords, FEIElementGeometryWrapper(this) );
817  //double dL = this->giveThicknessAt(gcoords) * gp->giveWeight() * detJ;
818  double dV = this->computeEdgeVolumeAround(gp, boundary);
819 
820  FieldPtr tf = domain->giveEngngModel()->giveContext()->giveFieldManager()->giveField(FT_TemperatureAmbient);
821  if ( tf ) {
822  interp->boundaryLocal2Global( gcoords, boundary, lcoords, FEIElementGeometryWrapper(this) );
823  tf->evaluateAt(val, gcoords, VM_TotalIntrinsic, tStep);
824  } else if ( load->giveFormulationType() == Load :: FT_Entity ) {
825  load->computeValueAt(val, tStep, lcoords, mode);
826  } else {
827  interp->boundaryLocal2Global( gcoords, boundary, lcoords, FEIElementGeometryWrapper(this) );
828  load->computeValueAt(val, tStep, gcoords, mode);
829  }
830 
831  if ( load->giveType() == TransmissionBC ) {
832  val.negated();
833  } else if ( load->giveType() == ConvectionBC ) {
834  field.beProductOf(N, unknowns);
835  val.subtract(field);
836  double a;
837 
838  if ( load->propertyMultExpr.isDefined() ) {
839  if ( unknownsPerNode != 1 ) {
840  OOFEM_ERROR("Not implemented for >=2 coupled fields");
841  }
842  a = load->giveProperty('a', tStep, { { "u", field.at(1) } });
843  } else {
844  a = load->giveProperty('a', tStep);
845  }
846  val.times( -1.0 * a );
847  } else if ( load->giveType() == RadiationBC ) {
848  //actual Temperature in C in field
849  field.beProductOf(N, unknowns); field.add(load->giveTemperOffset()); field.power(4);
850  val.add(load->giveTemperOffset()); val.power(4); val.subtract(field);
851  val.times( -1.0 * load->giveProperty('e', tStep) * stefanBoltzmann );
852  }
853  answer.plusProduct(N, val, dV);
854  }
855 }
856 
857 void
859 {
860  this->computeBCVectorAt(answer, tStep, mode);
861 }
862 
863 void
865 {
866  answer.resize( this->computeNumberOfDofs() );
867  answer.zero();
868 
869  if ( emode == HeatTransferEM || emode == Mass1TransferEM ) {
870  this->computeBCSubVectorAt(answer, tStep, mode, 1);
871  } else if ( emode == HeatMass1TransferEM ) {
872  FloatArray subAnswer;
873 
874  for ( int i = 1; i <= 2; i++ ) {
875  this->computeBCSubVectorAt(subAnswer, tStep, mode, i);
876  this->assembleLocalContribution(answer, subAnswer, 2, i);
877  }
878  } else {
879  OOFEM_ERROR("Unknown ElementMode");
880  }
881 }
882 
883 
884 void
886 {
887  int ndofs = this->computeNumberOfDofs();
888  answer.resize(ndofs, ndofs);
889  answer.zero();
890 
891  if ( emode == HeatTransferEM || emode == Mass1TransferEM ) {
892  this->computeBCSubMtrxAt(answer, tStep, mode, 1);
893  } else if ( emode == HeatMass1TransferEM ) {
894  FloatMatrix subAnswer;
895 
896  for ( int i = 1; i <= 2; i++ ) {
897  this->computeBCSubMtrxAt(subAnswer, tStep, mode, i);
898  if ( subAnswer.isNotEmpty() ) {
899  this->assembleLocalContribution(answer, subAnswer, 2, i, i);
900  }
901  }
902  } else {
903  OOFEM_ERROR("Unknown ElementMode");
904  }
905 }
906 
907 
908 void
910 {
911  FloatArray vec;
912 
913  answer.resize( this->giveNumberOfDofManagers() );
914  answer.zero();
915 
916  // loop over boundary load array
917  int nLoads = this->giveBoundaryLoadArray()->giveSize() / 2;
918  for ( int i = 1; i <= nLoads; i++ ) {
919  int n = boundaryLoadArray.at(1 + ( i - 1 ) * 2);
920  int id = boundaryLoadArray.at(i * 2);
921  Load *load = domain->giveLoad(n);
922  if ( load->isDofExcluded(indx) || !load->isImposed(tStep) ) {
923  continue;
924  }
925 
926  bcGeomType ltype = load->giveBCGeoType();
927  if ( ltype == EdgeLoadBGT ) {
928  this->computeEdgeBCSubVectorAt(vec, load, id, tStep, mode, indx);
929  } else if ( ltype == SurfaceLoadBGT ) {
930  this->computeSurfaceBCSubVectorAt(vec, load, id, tStep, mode, indx);
931  } else {
932  OOFEM_ERROR("unsupported bc type encountered");
933  }
934 
935  answer.add(vec);
936  }
937 
938  for ( int i = 1; i <= bodyLoadArray.giveSize(); ++i ) {
939  Load *load = domain->giveLoad(bodyLoadArray.at(i));
940  if ( !load->isImposed(tStep) ) {
941  continue;
942  }
943  this->computeBodyBCSubVectorAt(answer, load, tStep, mode, indx);
944  }
945 }
946 
947 
948 void
950  TimeStep *tStep, ValueModeType mode, int indx)
951 {
952  FloatArray val, globalIPcoords, n;
953  answer.resize( this->giveNumberOfDofManagers() );
954 
955  std :: unique_ptr< IntegrationRule > iRule( this->giveInterpolation()->giveIntegrationRule(load->giveApproxOrder()) );
956  for ( GaussPoint *gp : *iRule ) {
957  double dV = this->computeVolumeAround(gp);
958  this->computeNAt( n, gp->giveNaturalCoordinates() );
959  this->computeGlobalCoordinates( globalIPcoords, gp->giveNaturalCoordinates() );
960  load->computeValueAt(val, tStep, globalIPcoords, mode);
961  answer.add(val.at(indx) * dV, n);
962  }
963 }
964 
965 
966 void
968  TimeStep *tStep, ValueModeType mode, int indx)
969 {
970  answer.resize( this->giveNumberOfDofManagers() );
971  answer.zero();
972 
973  if ( ( load->giveType() == TransmissionBC ) || ( load->giveType() == ConvectionBC ) || load->giveType() == RadiationBC ) {
974  BoundaryLoad *edgeLoad = static_cast< BoundaryLoad * >(load);
975 
976  int approxOrder = edgeLoad->giveApproxOrder() + this->giveApproxOrder(indx);
977  int numberOfEdgeIPs = ( int ) ceil( ( approxOrder + 1.0 ) / 2. );
978  GaussIntegrationRule iRule(1, this, 1, 1);
979  iRule.SetUpPointsOnLine(numberOfEdgeIPs, _Unknown);
980  FloatArray reducedAnswer, val, n;
981  IntArray mask;
982  double dV, coeff = 1.0;
983 
984  for ( GaussPoint *gp: iRule ) {
985  if ( load->giveType() == TransmissionBC ) {
986  coeff = -1.0;
987  } else if ( load->giveType() == ConvectionBC ) {
988  if( edgeLoad->propertyMultExpr.isDefined()) {//dependence on state variable
991  OOFEM_ERROR("Not implemented for >=2 coupled fields");
992  }
993  FloatArray unknowns;
994  IntArray dofid;
995  this->computeEgdeNAt( n, iEdge, gp->giveNaturalCoordinates() );
996  this->giveElementDofIDMask(dofid);
997  this->giveEdgeDofMapping(mask, iEdge);
998  this->computeBoundaryVectorOf(mask, dofid, VM_TotalIntrinsic, tStep, unknowns);
999  double value = n.dotProduct(unknowns);
1000  coeff = edgeLoad->giveProperty('a', tStep, { { "u", value } });
1001  } else {
1002  coeff = edgeLoad->giveProperty('a', tStep);
1003  }
1004  } else if ( load->giveType() == RadiationBC ){
1005  OOFEM_ERROR("Not implemented, use TransientTransport solver");
1006  //coeff = getRadiativeHeatTranferCoef(edgeLoad, tStep);
1007  }
1008 
1009  const FloatArray &lcoords = gp->giveNaturalCoordinates();
1010  this->computeEgdeNAt(n, iEdge, lcoords);
1011  dV = this->computeEdgeVolumeAround(gp, iEdge);
1012 
1013  FieldPtr tf;
1014  FloatArray gcoords;
1015  if (tf = domain->giveEngngModel()->giveContext()->giveFieldManager()->giveField(FT_TemperatureAmbient)){
1016  //this->computeEdgeIpGlobalCoords(gcoords, lcoords, iEdge);
1017  this->giveInterpolation()->boundaryEdgeLocal2Global( gcoords, iEdge, lcoords, FEIElementGeometryWrapper(this) );
1018 
1019  tf->evaluateAt(val, gcoords, VM_TotalIntrinsic, tStep);
1020  } else if ( edgeLoad->giveFormulationType() == Load :: FT_Entity ) {
1021  edgeLoad->computeValueAt(val, tStep, lcoords, mode);
1022  } else {
1023  //this->computeEdgeIpGlobalCoords(gcoords, lcoords, iEdge);
1024  this->giveInterpolation()->boundaryEdgeLocal2Global( gcoords, iEdge, lcoords, FEIElementGeometryWrapper(this) );
1025  edgeLoad->computeValueAt(val, tStep, gcoords, mode);
1026  }
1027 
1028  reducedAnswer.add(val.at(indx) * coeff * dV, n);
1029  }
1030 
1031  this->giveEdgeDofMapping(mask, iEdge);
1032  answer.assemble(reducedAnswer, mask);
1033  } else {
1034  OOFEM_ERROR("unsupported bc type encountered");
1035  }
1036 }
1037 
1038 
1039 void
1041  int iSurf, TimeStep *tStep, ValueModeType mode, int indx)
1042 {
1044  OOFEM_ERROR("no surface load support");
1045  }
1046 
1047  BoundaryLoad *surfLoad = dynamic_cast< BoundaryLoad * >(load);
1048  if ( surfLoad ) {
1049  FloatArray reducedAnswer, val, gcoords, n;
1050  IntArray mask;
1051 
1052  answer.resize( this->giveNumberOfDofManagers() );
1053  answer.zero();
1054 
1055  double coeff=0.;
1056  int approxOrder = surfLoad->giveApproxOrder() + this->giveApproxOrder(indx);
1057 
1058  std :: unique_ptr< IntegrationRule > iRule( this->GetSurfaceIntegrationRule(approxOrder) );
1059  for ( GaussPoint *gp: *iRule ) {
1060  if ( load->giveType() == TransmissionBC ) {
1061  coeff = -1.0;
1062  } else if ( load->giveType() == ConvectionBC ) {
1063  if ( surfLoad->propertyMultExpr.isDefined() ) {
1064  if ( emode != HeatTransferEM && emode != Mass1TransferEM ) {
1066  OOFEM_ERROR("Not implemented for >=2 coupled fields");
1067  }
1068  FloatArray unknowns;
1069  IntArray dofid;
1070  this->computeSurfaceNAt( n, iSurf, gp->giveNaturalCoordinates() );
1071  this->giveElementDofIDMask(dofid);
1072  this->giveSurfaceDofMapping(mask, iSurf);
1073  this->computeBoundaryVectorOf(mask, dofid, VM_TotalIntrinsic, tStep, unknowns);
1074  double value = n.dotProduct(unknowns);
1075  coeff = surfLoad->giveProperty('a', tStep, { { "u", value } });
1076  } else {
1077  coeff = surfLoad->giveProperty('a', tStep);
1078  }
1079  } else if ( load->giveType() == RadiationBC ) {
1080  OOFEM_ERROR("Not implemented, use TransientTransport solver");
1081  //coeff = getRadiativeHeatTranferCoef(surfLoad, tStep);
1082  } else {
1083  OOFEM_ERROR("Unknown load type");
1084  }
1085 
1086  this->computeSurfaceNAt( n, iSurf, gp->giveNaturalCoordinates() );
1087  double dV = this->computeSurfaceVolumeAround(gp, iSurf);
1088 
1089  FieldPtr tf;
1090  if (tf = domain->giveEngngModel()->giveContext()->giveFieldManager()->giveField(FT_TemperatureAmbient)){
1091  //this->computeSurfIpGlobalCoords(gcoords, gp->giveNaturalCoordinates(), iSurf);
1092  this->giveInterpolation()->boundarySurfaceLocal2global(gcoords, iSurf, gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this));
1093  tf->evaluateAt(val, gcoords, VM_TotalIntrinsic, tStep);
1094  } else if ( surfLoad->giveFormulationType() == Load :: FT_Entity ) {
1095  surfLoad->computeValueAt(val, tStep, gp->giveNaturalCoordinates(), mode);
1096  } else {
1097  //this->computeSurfIpGlobalCoords(gcoords, gp->giveNaturalCoordinates(), iSurf);
1098  this->giveInterpolation()->boundarySurfaceLocal2global(gcoords, iSurf, gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this));
1099 
1100  surfLoad->computeValueAt(val, tStep, gcoords, mode);
1101  }
1102 
1103  reducedAnswer.add(val.at(indx) * coeff * dV, n);
1104  }
1105 
1106  this->giveSurfaceDofMapping(mask, iSurf);
1107  answer.assemble(reducedAnswer, mask);
1108  } else {
1109  OOFEM_ERROR("unsupported bc type encountered");
1110  }
1111 }
1112 
1113 
1114 void
1116 {
1117  int defined = 0;
1118 
1119  answer.resize( this->giveNumberOfDofManagers(), this->giveNumberOfDofManagers() );
1120  answer.zero();
1121 
1122  // loop over boundary load array
1123  int nLoads = this->giveBoundaryLoadArray()->giveSize() / 2;
1124  for ( int i = 1; i <= nLoads; i++ ) {
1125  int k = boundaryLoadArray.at(1 + ( i - 1 ) * 2);
1126  int id = boundaryLoadArray.at(i * 2);
1128  if ( load->giveType() == ConvectionBC ) {
1129  bcGeomType ltype = load->giveBCGeoType();
1130  if ( ltype == EdgeLoadBGT ) {
1131  BoundaryLoad *edgeLoad = static_cast< BoundaryLoad * >(load);
1132  if ( edgeLoad->isDofExcluded(indx) || !edgeLoad->isImposed(tStep) ) {
1133  continue;
1134  }
1135 
1136  defined = 1;
1137  int approxOrder = 2 * this->giveApproxOrder(indx);
1138  int numberOfEdgeIPs = ( int ) ceil( ( approxOrder + 1. ) / 2. );
1139  GaussIntegrationRule iRule(1, this, 1, 1);
1140  iRule.SetUpPointsOnLine(numberOfEdgeIPs, _Unknown);
1141  FloatArray n;
1142  IntArray mask;
1143  FloatMatrix subAnswer;
1144 
1145  for ( auto &gp: iRule ) {
1146  this->computeEgdeNAt( n, id, gp->giveNaturalCoordinates() );
1147  double dV = this->computeEdgeVolumeAround(gp, id);
1148  if ( load->giveType() == ConvectionBC ) {
1149  double a;
1150  if( edgeLoad->propertyMultExpr.isDefined() ) {
1151  if ( emode != HeatTransferEM && emode != Mass1TransferEM ) {
1153  OOFEM_ERROR("Not implemented for >=2 coupled fields");
1154  }
1155  FloatArray unknowns;
1156  IntArray dofid;
1157  this->giveElementDofIDMask(dofid);
1158  this->giveEdgeDofMapping(mask, id);
1159  this->computeBoundaryVectorOf(mask, dofid, VM_TotalIntrinsic, tStep, unknowns);
1160  double value = n.dotProduct(unknowns);//unknown in IP
1161  a = edgeLoad->giveProperty('a', tStep, { { "u", value } });
1162  } else {
1163  a = edgeLoad->giveProperty('a', tStep);
1164  }
1165  subAnswer.plusDyadSymmUpper( n, dV * a );
1166  }
1167  }
1168 
1169  subAnswer.symmetrized();
1170  this->giveEdgeDofMapping(mask, id);
1171  answer.assemble(subAnswer, mask);
1172  } else if ( ltype == SurfaceLoadBGT ) {
1173  FloatArray n;
1174  IntArray mask;
1175  FloatMatrix subAnswer;
1176 
1177  BoundaryLoad *surfLoad = static_cast< BoundaryLoad * >(load);
1178  if ( surfLoad->isDofExcluded(indx) || !surfLoad->isImposed(tStep) ) {
1179  continue;
1180  }
1181 
1182  defined = 1;
1183  int approxOrder = 2 * this->giveApproxOrder(indx);
1184  std :: unique_ptr< IntegrationRule > iRule( this->GetSurfaceIntegrationRule(approxOrder) );
1185 
1186  for ( auto &gp: *iRule ) {
1187  this->computeSurfaceNAt( n, id, gp->giveNaturalCoordinates() );
1188  double dV = this->computeSurfaceVolumeAround(gp, id);
1189  if ( load->giveType() == ConvectionBC ) {
1190  double a;
1191  if ( surfLoad->propertyMultExpr.isDefined() ) {
1192  if ( emode != HeatTransferEM && emode != Mass1TransferEM ) {
1194  OOFEM_ERROR("Not implemented for >=2 coupled fields");
1195  }
1196  FloatArray unknowns;
1197  IntArray dofid;
1198  this->giveElementDofIDMask(dofid);
1199  this->giveSurfaceDofMapping(mask, id);
1200  this->computeBoundaryVectorOf(mask, dofid, VM_TotalIntrinsic, tStep, unknowns);
1201  double value = n.dotProduct(unknowns);//unknown in IP
1202  a = surfLoad->giveProperty('a', tStep, { { "u", value } });
1203  } else {
1204  a = surfLoad->giveProperty('a', tStep);
1205  }
1206  subAnswer.plusDyadSymmUpper( n, dV * a );
1207  }
1208  }
1209 
1210  subAnswer.symmetrized();
1211  this->giveSurfaceDofMapping(mask, id);
1212  answer.assemble(subAnswer, mask);
1213  } else {
1214  OOFEM_ERROR("unsupported bc type encountered");
1215  }
1216  }
1217  }
1218 
1219  // end loop over applied bc
1220 
1221  if ( !defined ) {
1222  answer.clear();
1223  }
1224 }
1225 
1226 
1227 void
1229  int ndofs, int rdof, int cdof)
1230 {
1231  int nnodes = this->giveNumberOfDofManagers();
1232 
1233  for ( int i = 1; i <= nnodes; i++ ) {
1234  int ti = ( i - 1 ) * ndofs + rdof;
1235  for ( int j = 1; j <= nnodes; j++ ) {
1236  int tj = ( j - 1 ) * ndofs + cdof;
1237  answer.at(ti, tj) += src.at(i, j);
1238  }
1239  }
1240 }
1241 
1242 
1243 void
1245  int ndofs, int rdof)
1246 {
1247  int nnodes = this->giveNumberOfDofManagers();
1248 
1249  for ( int i = 1; i <= nnodes; i++ ) {
1250  int ti = ( i - 1 ) * ndofs + rdof;
1251  answer.at(ti) += src.at(i);
1252  }
1253 }
1254 
1255 void
1257 {
1258  FloatArray u;
1259  FloatMatrix n;
1260  this->computeNmatrixAt(n, lcoords);
1261  this->computeVectorOf(mode, tStep, u);
1262  answer.beProductOf(n, u);
1263 }
1264 
1265 void
1267 {
1268  FloatArray r, br;
1269  FloatMatrix b, d;
1270  IntArray dofid;
1271 
1272  this->giveElementDofIDMask(dofid);
1273  this->computeVectorOf(dofid, VM_TotalIntrinsic, tStep, r);
1275 
1276  if ( emode == HeatTransferEM || emode == Mass1TransferEM ) {
1277  this->computeConstitutiveMatrixAt(d, Conductivity_hh, gp, tStep);
1278  br.beProductOf(b, r);
1279  answer.beProductOf(d, br);
1280  } else if ( emode == HeatMass1TransferEM ) {
1281  FloatArray r_h, r_w;
1282  FloatMatrix b_tot, d_hh, d_hw, d_wh, d_ww;
1283  r_h.resize(r.giveSize() / 2);
1284  r_h.zero();
1285  r_w.resize(r.giveSize() / 2);
1286  r_w.zero();
1287 
1288  this->computeConstitutiveMatrixAt(d_hh, Conductivity_hh, gp, tStep);
1289  this->computeConstitutiveMatrixAt(d_hw, Conductivity_hw, gp, tStep);
1290  this->computeConstitutiveMatrixAt(d_wh, Conductivity_wh, gp, tStep);
1291  this->computeConstitutiveMatrixAt(d_ww, Conductivity_ww, gp, tStep);
1292 
1293  b_tot.resize( 2 * b.giveNumberOfRows(), 2 * b.giveNumberOfColumns() );
1294  b_tot.setSubMatrix(b, 1, 1);
1295  b_tot.setSubMatrix(b, b.giveNumberOfRows() + 1, b.giveNumberOfColumns() + 1);
1296  br.beProductOf(b_tot, r);
1297 
1298  d.resize( 2 * d_hh.giveNumberOfRows(), 2 * d_hh.giveNumberOfColumns() );
1299  d.setSubMatrix(d_hh, 1, 1);
1300  d.setSubMatrix(d_hw, 1, d_hh.giveNumberOfColumns() + 1);
1301  d.setSubMatrix(d_wh, d_hh.giveNumberOfRows() + 1, 1);
1302  d.setSubMatrix(d_ww, d_hh.giveNumberOfRows() + 1, d_wh.giveNumberOfColumns() + 1);
1303 
1304  answer.beProductOf(d, br);
1305  } else {
1306  OOFEM_ERROR("Unknown element mode");
1307  }
1308 
1309  answer.negated();
1310 
1311  if ( !isActivated(tStep) ) {
1312  answer.zero();
1313  }
1314 }
1315 
1316 
1317 void
1319 // Updates the receiver at the end of a solution step
1320 {
1321  FloatArray stateVector, r;
1322 #if 0
1323  FloatArray gradient, flux;
1324  FloatMatrix B;
1325 #endif
1326  FloatMatrix n;
1327  IntArray dofid;
1328  TransportMaterial *mat = static_cast< TransportMaterial * >( this->giveMaterial() );
1329 
1330 #ifdef __CEMHYD_MODULE //not very efficient here, looping over all GPs in each call
1331  if (dynamic_cast< CemhydMat * >( mat ) && tStep->isIcApply()){
1332  CemhydMat *cem = dynamic_cast< CemhydMat * >( mat );
1333  cem->initMaterial(this); //create microstructures and statuses on specific GPs
1334  }
1335 #endif //__CEMHYD_MODULE
1336 
1337  this->giveElementDofIDMask(dofid);
1338  this->computeVectorOf(dofid, VM_TotalIntrinsic, tStep, r);
1339  // force updating ip values
1340  for ( auto &iRule: integrationRulesArray ) {
1341  for ( GaussPoint *gp: *iRule ) {
1342 
1344  this->computeNmatrixAt( n, gp->giveNaturalCoordinates() );
1345  stateVector.beProductOf(n, r);
1346  mat->updateInternalState(stateVector, gp, tStep);
1347 
1349 #if 0
1350  this->computeGradientMatrixAt( B, gp->giveNaturalCoordinates() );
1351  gradient.beProductOf(B, r);
1352  mat->giveFluxVector(flux, gp, gradient, tStep);
1353 #endif
1354  }
1355  }
1356 
1357 }
1358 
1359 int
1361  const FloatArray &coords, IntArray &dofId, ValueModeType mode,
1362  TimeStep *tStep)
1363 {
1364  int indx;
1365  FloatArray elemvector, lc;
1366  FloatMatrix n;
1367  IntArray elemdofs;
1368  // determine element dof ids
1369  this->giveElementDofIDMask(elemdofs);
1370  // first evaluate element unknown vector
1371  this->computeVectorOf(pf, elemdofs, mode, tStep, elemvector);
1372  // determine corresponding local coordinates
1373  if ( this->computeLocalCoordinates(lc, coords) ) {
1374  // compute interpolation matrix
1375  this->computeNmatrixAt(n, lc);
1376  // compute answer
1377  answer.resize( dofId.giveSize() );
1378  answer.zero();
1379  for ( int i = 1; i <= dofId.giveSize(); i++ ) {
1380  if ( ( indx = elemdofs.findFirstIndexOf( dofId.at(i) ) ) ) {
1381  double sum = 0.0;
1382  for ( int j = 1; j <= elemvector.giveSize(); j++ ) {
1383  sum += n.at(indx, j) * elemvector.at(j);
1384  }
1385 
1386  answer.at(i) = sum;
1387  } else {
1388  //_error("EIPrimaryFieldI_evaluateFieldVectorAt: unknown dof id encountered");
1389  answer.at(i) = 0.0;
1390  }
1391  }
1392 
1393  return 0; // ok
1394  } else {
1395  OOFEM_ERROR("target point not in receiver volume");
1396  return 1; // failed
1397  }
1398 }
1399 
1400 
1403 {
1404  return static_cast< TransportCrossSection* >( this->giveCrossSection() );
1405 }
1406 
1407 
1408 Material *
1410 {
1411  // This method is overloaded in order to have some backwards compatibility
1412  if ( material ) {
1413  return domain->giveMaterial(this->material);
1414  }
1415  return static_cast< TransportCrossSection* >( this->giveCrossSection() )->giveMaterial();
1416 }
1417 
1418 
1419 #ifdef __OOFEG
1420 int
1422  int node, TimeStep *tStep)
1423 {
1424  Node *n = this->giveNode(node);
1425  if ( type == IST_Temperature ) {
1426  auto dofindx = n->findDofWithDofId(T_f);
1427  if ( dofindx != n->end() ) {
1428  answer.resize(1);
1429  answer.at(1) = (*dofindx)->giveUnknown(VM_Total, tStep);
1430  return 1;
1431  } else {
1432  return 0;
1433  }
1434  } else if ( type == IST_MassConcentration_1 ) {
1435  auto dofindx = n->findDofWithDofId(C_1);
1436  if ( dofindx != n->end() ) {
1437  answer.resize(1);
1438  answer.at(1) = (*dofindx)->giveUnknown(VM_Total, tStep);
1439  return 1;
1440  } else {
1441  return 0;
1442  }
1443  } else {
1444  return Element :: giveInternalStateAtNode(answer, type, mode, node, tStep);
1445  }
1446 }
1447 
1448 #endif
1449 } // end namespace oofem
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.
virtual bool isActivated(TimeStep *tStep)
Definition: element.C:793
int giveNumberOfColumns() const
Returns number of columns of receiver.
Definition: floatmatrix.h:158
void subtract(const FloatArray &src)
Subtracts array src to receiver.
Definition: floatarray.C:258
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.
virtual void boundarySurfaceLocal2global(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates edge global coordinates from given local ones.
virtual void computeInternalSourceVector(FloatArray &val, GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
Computes the internal source vector of receiver.
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...
IntArray * giveBoundaryLoadArray()
Returns array containing load numbers of boundary loads acting on element.
Definition: element.C:381
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the array of interpolation functions (shape functions) at given point.
void assembleLocalContribution(FloatMatrix &answer, FloatMatrix &src, int ndofs, int rdof, int cdof)
Assembles the given source matrix of size (ndofs, ndofs) into target matrix answer.
std::shared_ptr< Field > FieldPtr
Definition: field.h:72
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 void computeBCVectorAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
Computes the RHS contribution to balance equation(s) due to boundary conditions.
virtual IntegrationRule * giveIntegrationRule(int i)
Definition: element.h:835
virtual int testElementExtension(ElementExtension ext)
Tests if the element implements required extension.
Definition: element.h:846
virtual void computeCapacityMatrix(FloatMatrix &answer, TimeStep *tStep)
Computes the capacity matrix of the receiver.
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition: femcmpnn.h:82
Abstract class representing field of primary variables (those, which are unknown and are typically as...
Definition: primaryfield.h:104
virtual int checkConsistency()
Performs consistency check.
bcGeomType
Type representing the geometric character of loading.
Definition: bcgeomtype.h:40
Transort cross-section.
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
virtual int giveApproxOrder()
Definition: load.h:159
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
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
int giveInterpolationOrder()
Returns the interpolation order.
Definition: feinterpol.h:159
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 giveCharacteristicMatrix(FloatMatrix &answer, CharType type, TimeStep *tStep)
Computes characteristic matrix of receiver of requested type in given time step.
virtual void computeInternalSourceRhsVectorAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
Computes the contribution to balance equation(s) due to internal sources.
virtual void computeExternalForcesVector(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Definition: domain.C:433
virtual int giveApproxOrder(int unknownIndx)
Stefan-Boltzmann law.
Definition: bctype.h:48
Abstract base class for all finite elements.
Definition: element.h:145
virtual void computeBmatrixAt(FloatMatrix &answer, const FloatArray &lcoords)
bool isDefined() const
True if receiver is defined.
virtual double giveProperty(int aProperty, TimeStep *tStep, const std::map< std::string, FunctionArgument > &valDict)
Definition: boundaryload.C:137
FieldManager * giveFieldManager()
Definition: engngm.h:131
virtual void computeIntSourceLHSMatrix(FloatMatrix &answer, TimeStep *tStep)
Computes the LHS contribution to balance equation(s) due to material internal source.
virtual void computeNAt(FloatArray &answer, const FloatArray &lcoord)
Computes the basis functions.
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 void computeTangentFromEdgeLoad(FloatMatrix &answer, EdgeLoad *load, int boundary, MatResponseMode rmode, TimeStep *tStep)
Computes the tangent contribution of the given load at the given boundary.
virtual void computeConductivityMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
Computes the conductivity matrix of the receiver.
virtual void computeNmatrixAt(FloatMatrix &answer, const FloatArray &lcoords)
Computes the interpolation matrix corresponding to all unknowns.
virtual int giveNumberOfDofManagers() const
Definition: element.h:656
Newton type - transfer coefficient.
Definition: bctype.h:44
virtual void computeGradientMatrixAt(FloatMatrix &answer, const FloatArray &lcoords)
Computes the gradient matrix corresponding to one unknown.
virtual FEInterpolation * giveInterpolation() const
Definition: element.h:629
virtual void computeSurfaceNAt(FloatArray &answer, int iSurf, const FloatArray &lcoord)
virtual void computeInertiaForcesVector(FloatArray &answer, TimeStep *tStep)
Element extension for surface loads.
void setSubMatrix(const FloatMatrix &src, int sr, int sc)
Adds the given matrix as sub-matrix to receiver.
Definition: floatmatrix.C:557
virtual void computeCapacitySubMatrix(FloatMatrix &answer, MatResponseMode rmode, int iri, TimeStep *tStep)
Computes the matrix .
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol.h:132
bool isNotEmpty() const
Tests for empty matrix.
Definition: floatmatrix.h:162
void computeBodyBCSubVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode, int indx)
virtual void computeInternalForcesVector(FloatArray &answer, TimeStep *tStep)
void computeSurfaceBCSubVectorAt(FloatArray &answer, Load *load, int iSurf, TimeStep *tStep, ValueModeType mode, int indx)
Computes the part of RHS due to applied BCs on particular surface.
virtual double computeEdgeVolumeAround(GaussPoint *gp, int iEdge)=0
Computes the length around a integration point on a edge.
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
Definition: element.h:518
virtual int hasInternalSource()
Returns nonzero if receiver generates internal source of state variable(s), zero otherwise.
virtual void computeInternalSourceRhsSubVectorAt(FloatArray &answer, TimeStep *, ValueModeType mode, int indx)
Computes the contribution to balance equation(s) due to internal sources.
Distributed edge load.
Definition: bcgeomtype.h:44
Abstract base class representing a boundary load (force, momentum, ...) that acts directly on a bound...
Definition: boundaryload.h:110
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
virtual void boundaryEdgeGiveNodes(IntArray &answer, int boundary)=0
Gives the boundary nodes for requested boundary number.
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
Definition: floatarray.C:463
#define OOFEM_ERROR(...)
Definition: error.h:61
EngngModelContext * giveContext()
Context requesting service.
Definition: engngm.h:1078
int material
Number of associated material.
Definition: element.h:153
virtual void boundaryLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Maps the local boundary coordinates to global.
virtual void giveSurfaceDofMapping(IntArray &mask, int iSurf)
virtual FormulationType giveFormulationType()
Specifies is load should take local or global coordinates.
Definition: load.h:155
virtual void computeFlow(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
Computes a flow vector in an integration point.
Neumann type (prescribed flux).
Definition: bctype.h:43
virtual int EIPrimaryFieldI_evaluateFieldVectorAt(FloatArray &answer, PrimaryField &pf, const FloatArray &coords, IntArray &dofId, ValueModeType mode, TimeStep *tStep)
Evaluates the value of field at given point of interest (should be located inside receiver&#39;s volume) ...
void power(const double exponent)
Raise each element to its power.
Definition: floatarray.C:1105
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
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
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 double boundaryGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the determinant of the transformation Jacobian on the requested boundary.
#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.
virtual void computeField(ValueModeType mode, TimeStep *tStep, const FloatArray &lcoords, FloatArray &answer)
Computes the unknown vector interpolated at the specified local coordinates.
virtual void giveElementDofIDMask(IntArray &answer) const
Returns element dof mask for node.
Definition: element.h:498
virtual int giveApproxOrder()=0
bool isEmpty() const
Returns true if receiver is empty.
Definition: floatarray.h:222
Abstract base class for all material models.
Definition: material.h:95
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
ScalarFunction propertyMultExpr
Expression to multiply all properties.
Definition: boundaryload.h:172
virtual bcType giveType() const
Returns receiver load type.
Definition: boundaryload.h:166
FieldPtr giveField(FieldType key)
Returns the previously registered field under given key; NULL otherwise.
Definition: fieldmanager.C:63
Distributed surface load.
Definition: bcgeomtype.h:45
virtual void computeLumpedCapacityVector(FloatArray &answer, TimeStep *tStep)
virtual void updateInternalState(const FloatArray &state, GaussPoint *gp, TimeStep *tStep)
Updates internal state of material according to new state vector.
void beNMatrixOf(const FloatArray &n, int nsd)
Assigns the receiver to be a repeated diagonal matrix.
Definition: floatmatrix.C:505
void computeBCSubVectorAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode, int indx)
Computes the part of RHS due to applied BCs.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
virtual void boundaryGiveNodes(IntArray &answer, int boundary)=0
Gives the boundary nodes for requested boundary number.
Class representing vector of real numbers.
Definition: floatarray.h:82
void plusDyadSymmUpper(const FloatArray &a, double dV)
Adds to the receiver the dyadic product .
Definition: floatmatrix.C:756
virtual double computeSurfaceVolumeAround(GaussPoint *gp, int iSurf)
Abstract base class representing a surface load (force, momentum, ...) that acts directly on a surfac...
Definition: boundaryload.h:218
virtual double giveCharacteristicValue(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
Computes the characteristic value of receiver in given integration point, respecting its history...
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
virtual void computeLoadVector(FloatArray &answer, BodyLoad *load, CharType type, ValueModeType mode, TimeStep *tStep)
Computes the contribution of the given body load (volumetric).
virtual void computeConductivitySubMatrix(FloatMatrix &answer, int iri, MatResponseMode rmode, TimeStep *tStep)
Computes the matrix .
virtual double giveThicknessAt(const FloatArray &gcoords)
Gives the thickness at some global coordinate.
virtual IntegrationRule * giveBoundarySurfaceIntegrationRule(int order, int boundary)
Returns boundary surface integration rule.
Definition: element.C:878
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
virtual int initMaterial(Element *element)
Optional function to call specific procedures when initializing a material.
Definition: cemhydmat.C:354
CharType
Definition: chartype.h:87
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1358
Class representing a general abstraction for surface finite element interpolation class...
Definition: feinterpol3d.h:44
std::vector< Dof * >::const_iterator findDofWithDofId(DofIDItem dofID) const
Finds index of DOF with required physical meaning of receiver.
Definition: dofmanager.C:266
void add(const FloatMatrix &a)
Adds matrix to the receiver.
Definition: floatmatrix.C:1023
int isDofExcluded(int index)
Returns the value of dofExcludeMask corresponding to given index.
Definition: load.C:141
virtual void computeIntSourceLHSSubMatrix(FloatMatrix &answer, MatResponseMode rmode, int iri, TimeStep *tStep)
Computes the part of internal source LHS contribution corresponding to unknown identified by rmode pa...
virtual void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
Computes constitutive matrix of receiver.
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
static const double stefanBoltzmann
Stefan–Boltzmann constant W/m2/K4.
virtual bcGeomType giveBCGeoType() const
Returns geometry character of boundary condition.
Abstract base class for all constitutive models for transport problems.
virtual void computeBCMtrxAt(FloatMatrix &answer, TimeStep *tStep, ValueModeType mode)
Computes the LHS contribution to balance equation(s) due to boundary conditions.
void computeEdgeBCSubVectorAt(FloatArray &answer, Load *load, int iEdge, TimeStep *tStep, ValueModeType mode, int indx)
Computes the part of RHS due to applied BCs on particular edge.
void times(double s)
Multiplies receiver with scalar.
Definition: floatarray.C:818
void beTranspositionOf(const FloatMatrix &src)
Assigns to the receiver the transposition of parameter.
Definition: floatmatrix.C:323
virtual bool computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
Computes the element local coordinates from given global coordinates.
Definition: element.C:1222
virtual IntegrationRule * GetSurfaceIntegrationRule(int approxOrder)
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
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
Load is base abstract class for all loads.
Definition: load.h:61
virtual void giveEdgeDofMapping(IntArray &mask, int iEdge)
Gives the node indexes for given edge.
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
Definition: floatmatrix.C:337
virtual void giveFluxVector(FloatArray &answer, GaussPoint *gp, const FloatArray &grad, const FloatArray &field, TimeStep *tStep)=0
Returns the flux for the field and its gradient.
bool isIcApply()
Check if receiver is solution step when initial conditions should apply.
Definition: timestep.C:144
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
TransportCrossSection * giveTransportCrossSection()
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
virtual IntegrationRule * giveIntegrationRule(int order)
Sets up a suitable integration rule for numerical integrating over volume.
Definition: feinterpol.C:52
the oofem namespace is to define a context or scope in which all oofem names are defined.
bool isNotEmpty() const
Returns true if receiver is not empty.
Definition: floatarray.h:220
std::vector< Dof * >::iterator end()
Definition: dofmanager.h:158
void assemble(const FloatMatrix &src, const IntArray &loc)
Assembles the contribution using localization array into receiver.
Definition: floatmatrix.C:251
virtual void giveCharacteristicVector(FloatArray &answer, CharType type, ValueModeType mode, TimeStep *tStep)
Computes characteristic vector of receiver of requested type in given time step.
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 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
void negated()
Switches the sign of every coefficient of receiver.
Definition: floatarray.C:739
TransportElement(int n, Domain *d, ElementMode em=HeatTransferEM)
Node * giveNode(int i) const
Returns reference to the i-th node of element.
Definition: element.h:610
virtual Material * giveMaterial()
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
virtual void updateInternalState(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
virtual int SetUpPointsOnLine(int nPoints, MaterialMode mode)
Sets up receiver&#39;s integration points on unit line integration domain.
void symmetrized()
Initializes the lower half of the receiver according to the upper half.
Definition: floatmatrix.C:1576
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
virtual void boundaryEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the basis functions on the requested boundary.
virtual double giveTemperOffset(void)
Return temperature offset.
Definition: boundaryload.C:164
Class representing integration point in finite element program.
Definition: gausspoint.h:93
#define OOFEM_WARNING(...)
Definition: error.h:62
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
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.
InternalStateMode
Determines the mode of internal variable.
void add(const FloatArray &src)
Adds array src to receiver.
Definition: floatarray.C:156
virtual double evaldNdx(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the matrix of derivatives of interpolation functions (shape functions) at given point...
virtual void giveDofManDofIDMask(int inode, IntArray &answer) const
Returns dofmanager dof mask for node.
void computeBCSubMtrxAt(FloatMatrix &answer, TimeStep *tStep, ValueModeType mode, int indx)
Computes the part of LHS due to applied BCs.
virtual void local2global(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates global coordinates from given local ones.
int findFirstIndexOf(int value) const
Finds index of first occurrence of given value in array.
Definition: intarray.C:331
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
Definition: gausspoint.h:138
Class representing Gaussian-quadrature integration rule.
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631
virtual void computeEgdeNAt(FloatArray &answer, int iEdge, const FloatArray &lcoord)
Computes the basis functions at the edge for one unknown.
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:32 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011