OOFEM 3.0
Loading...
Searching...
No Matches
up.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 - 2025 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
36#include "mpm.h"
37#include "termlibrary.h"
38#include "element.h"
39#include "gausspoint.h"
40#include "feinterpol.h"
41#include "intarray.h"
42#include "classfactory.h"
44
45#include "fei3dtetlin.h"
46#include "fei3dtetquad.h"
47#include "fei3dhexalin.h"
48#include "fei2dquadlin.h"
49#include "mathfem.h"
50
51#include "material.h"
52#include "matstatus.h"
53
54#include "boundaryload.h"
56
57namespace oofem {
58
59
64class UPElement : public MPElement {
65
66 public:
67 UPElement(int n, Domain* d):
68 MPElement(n,d) { }
69
70 // Note: performance can be probably improved once it will be possible
71 // to directly assemble multiple term contributions to the system matrix.
72 // template metaprogramming?
73 void giveCharacteristicMatrix(FloatMatrix &answer, CharType type, TimeStep *tStep) override {
75
76 if (type == MomentumBalance_StiffnessMatrix) {
77 int udofs = this->giveNumberOfUDofs();
78 answer.resize(udofs,udofs);
79 answer.zero();
80 this->integrateTerm_dw (answer, BTSigTerm(getU(),getU()), ir, tStep) ;
81 } else if (type == MomentumBalance_PressureCouplingMatrix) {
82 answer.resize(this->giveNumberOfUDofs(),this->giveNumberOfPDofs());
83 answer.zero();
84 this->integrateTerm_dw (answer, BTamNTerm(getU(),getP()), ir, tStep) ;
85 } else if (type == MassBalance_PermeabilityMatrix) {
86 int pdofs = this->giveNumberOfPDofs();
87 answer.resize(pdofs,pdofs);
88 answer.zero();
89 this->integrateTerm_dw (answer, gNTfTerm(getP(), getP(), Permeability, FluidMassBalancePressureContribution), ir, tStep) ;
90 } else if (type == MassBalance_CompresibilityMatrix) {
91 int pdofs = this->giveNumberOfPDofs();
92 answer.resize(pdofs,pdofs);
93 answer.zero();
94 this->integrateTerm_dw (answer, NTcN(getP(), getP(), CompressibilityCoefficient), ir, tStep) ;
95 } else if (type == MassBalance_StressCouplingMatrix) {
96 answer.resize(this->giveNumberOfPDofs(),this->giveNumberOfUDofs());
97 answer.zero();
98 this->integrateTerm_dw (answer, NTamTBTerm(getP(), getU()), ir, tStep) ;
99 } else {
100 OOFEM_ERROR("Unknown characteristic matrix type");
101 }
102 }
103
104 void giveCharacteristicVector(FloatArray &answer, CharType type, ValueModeType mode, TimeStep *tStep) override {
106 if (type == MomentumBalance_StressResidual) {
107 answer.resize(this->giveNumberOfUDofs());
108 answer.zero();
109 this->integrateTerm_c (answer, BTSigTerm(getU(),getU()), ir, tStep) ;
110 } else if (type == MomentumBalance_PressureResidual) {
111 answer.resize(this->giveNumberOfUDofs());
112 answer.zero();
113 this->integrateTerm_c(answer, BTamNTerm(getU(),getP()), ir, tStep) ;
114 } else if (type == MassBalance_StressRateResidual) {
115 answer.resize(this->giveNumberOfPDofs());
116 answer.zero();
117 this->integrateTerm_c (answer, NTamTBTerm(getP(), getU()), ir, tStep) ;
118 } else if (type == MassBalance_PressureResidual) {
119 answer.resize(this->giveNumberOfPDofs());
120 answer.zero();
121 this->integrateTerm_c (answer, gNTfTerm(getP(), getP(), Permeability, FluidMassBalancePressureContribution), ir, tStep) ;
122 } else if (type == MassBalance_PressureRateResidual) {
123 answer.resize(this->giveNumberOfPDofs());
124 answer.zero();
125 this->integrateTerm_c (answer, NTcN(getP(), getP(), CompressibilityCoefficient), ir, tStep) ;
126 } else if (type == ExternalForcesVector) {
127 answer.zero();
128 } else {
129 OOFEM_ERROR("Unknown characteristic vector type");
130 }
131 }
132
133 void computeBoundarySurfaceLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global = true) override {
134 answer.resize(giveNumberOfDofs());
135 answer.zero();
136 if ( type != ExternalForcesVector ) {
137 return;
138 }
139
140 IntArray locu, locp;
141 FloatArray contrib, contrib2;
142 getSurfaceLocalCodeNumbers (locu, Variable::VariableQuantity::Displacement) ;
143 getSurfaceLocalCodeNumbers (locp, Variable::VariableQuantity::Pressure) ;
144
145 // integrate traction contribution (momentum balance)
147 std::unique_ptr<IntegrationRule> ir = this->getGeometryInterpolation()->giveBoundarySurfaceIntegrationRule(o, boundary, this->giveGeometryType());
148 this->integrateSurfaceTerm_c(contrib, NTf_Surface(getU(), BoundaryFluxFunctor(load, boundary, getU()->dofIDs, 's'), boundary), ir.get(), boundary, tStep);
149
150 answer.resize(this->getNumberOfSurfaceDOFs());
151 answer.zero();
152 answer.assemble(contrib, locu);
153
154 // integrate mass (fluid) flux normal to the boundary (mass balance)
156 std::unique_ptr<IntegrationRule> ir2 = this->getGeometryInterpolation()->giveBoundarySurfaceIntegrationRule(o, boundary, this->giveGeometryType());
157 this->integrateSurfaceTerm_c(contrib2, NTf_Surface(getP(), BoundaryFluxFunctor(load, boundary, getP()->dofIDs,'s'), boundary), ir2.get(), boundary, tStep);
158 answer.assemble(contrib2, locp);
159 }
160
161 void computeBoundaryEdgeLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true) override {
162 answer.resize(giveNumberOfDofs());
163 answer.zero();
164 if ( type != ExternalForcesVector ) {
165 return;
166 }
167
168 IntArray locu, locp;
169 FloatArray contrib, contrib2;
170 getEdgeLocalCodeNumbers (locu, Variable::VariableQuantity::Displacement) ;
171 getEdgeLocalCodeNumbers (locp, Variable::VariableQuantity::Pressure) ;
172
173 // integrate traction contribution (momentum balance)
175 std::unique_ptr<IntegrationRule> ir = this->getGeometryInterpolation()->giveBoundaryEdgeIntegrationRule(o, boundary, this->giveGeometryType());
176 this->integrateEdgeTerm_c(contrib, NTf_Edge(getU(), BoundaryFluxFunctor(load, boundary, getU()->dofIDs,'e'), boundary), ir.get(), boundary, tStep);
177
178 answer.resize(this->getNumberOfEdgeDOFs());
179 answer.zero();
180 answer.assemble(contrib, locu);
181
182 // integrate mass (fluid) flux normal to the boundary (mass balance)
184 std::unique_ptr<IntegrationRule> ir2 = this->getGeometryInterpolation()->giveBoundaryEdgeIntegrationRule(o, boundary, this->giveGeometryType());
185 this->integrateEdgeTerm_c(contrib2, NTf_Edge(getP(), BoundaryFluxFunctor(load, boundary, getP()->dofIDs,'e'), boundary), ir2.get(), boundary, tStep);
186 answer.assemble(contrib2, locp);
187 }
188
189
190 int computeFluxLBToLRotationMatrix(FloatMatrix &answer, int iSurf, const FloatArray& lc, const Variable::VariableQuantity q, char btype) override {
191 if (q == Variable::VariableQuantity::Displacement) {
192 // better to integrate this into FEInterpolation class
193 FloatArray nn, h1(3), h2(3);
194 answer.resize(3,3);
195 if (btype == 's') {
197 } else {
198 OOFEM_ERROR ("Unsupported boundary entity");
199 }
200 nn.normalize();
201 for ( int i = 1; i <= 3; i++ ) {
202 answer.at(i, 3) = nn.at(i);
203 }
204
205 // determine lcs of surface
206 // local x axis in xy plane
207 double test = fabs(fabs( nn.at(3) ) - 1.0);
208 if ( test < 1.e-5 ) {
209 h1.at(1) = answer.at(1, 1) = 1.0;
210 h1.at(2) = answer.at(2, 1) = 0.0;
211 } else {
212 h1.at(1) = answer.at(1, 1) = answer.at(2, 3);
213 h1.at(2) = answer.at(2, 1) = -answer.at(1, 3);
214 }
215
216 h1.at(3) = answer.at(3, 1) = 0.0;
217 // local y axis perpendicular to local x,z axes
218 h2.beVectorProductOf(nn, h1);
219 for ( int i = 1; i <= 3; i++ ) {
220 answer.at(i, 2) = h2.at(i);
221 }
222
223 return 1;
224 } else {
225 answer.clear();
226 return 0;
227 }
228 }
229 //virtual void getLocalCodeNumbers (IntArray& answer, const Variable::VariableQuantity q ) const = 0;
230 //virtual void giveDofManDofIDMask(int inode, IntArray &answer) const =0;
231 private:
232 virtual int giveNumberOfUDofs() const = 0;
233 virtual int giveNumberOfPDofs() const = 0;
234 virtual const Variable* getU() const = 0;
235 virtual const Variable* getP() const = 0;
236};
237
242class UPTetra21 : public UPElement {
243 protected:
244 //FEI3dTetLin pInterpol;
245 //FEI3dTetQuad uInterpol;
246 const static FEI3dTetLin pInterpol;
248 const static Variable p;
249 const static Variable u;
250
251
252 public:
253 UPTetra21(int n, Domain* d):
254 UPElement(n,d)
255 {
256 numberOfDofMans = 10;
258 this->computeGaussPoints();
259 }
260
261 void getDofManLocalCodeNumbers (IntArray& answer, const Variable::VariableQuantity q, int num ) const override {
262 /* dof ordering: u1 v1 w1 p1 u2 v2 w2 p2 u3 v3 w3 p3 u4 v4 w4 u5 v5 w5 u6 v6 w6*/
263 if (q == Variable::VariableQuantity::Displacement) {
264 //answer={1,2,3, 5,6,7, 9,10,11, 13,14,15, 17,18,19, 20,21,22, 23,24,25, 26,27,28, 29,30,31, 32,33,34 };
265 int o = (num-1)*4+1-(num>4)*(num-5);
266 answer = {o, o+1, o+2};
267 } else if (q == Variable::VariableQuantity::Pressure) {
268 if (num<=4) {
269 //answer = {4, 8, 12, 16};
270 answer={num*4};
271 } else {
272 answer={};
273 }
274 }
275 }
276 void getInternalDofManLocalCodeNumbers (IntArray& answer, const Variable::VariableQuantity q, int num ) const override {
277 answer={};
278 }
279
280 void giveDofManDofIDMask(int inode, IntArray &answer) const override {
281 if (inode >0 && inode <5) {
282 answer = {1,2,3,11};
283 } else {
284 answer= {1,2,3};
285 }
286 }
287 int giveNumberOfDofs() override { return 34; }
288 const char *giveInputRecordName() const override {return "uptetra21";}
289 const FEInterpolation* getGeometryInterpolation() const override {return &this->uInterpol;}
290
292 return EGT_tetra_2;
293 }
294 int getNumberOfSurfaceDOFs() const override {return 21;}
295 int getNumberOfEdgeDOFs() const override {return 0;}
296 void getSurfaceLocalCodeNumbers(IntArray& answer, const Variable::VariableQuantity q) const override {
297 if (q == Variable::VariableQuantity::Displacement) {
298 answer={1,2,3, 5,6,7, 9,10,11, 13,14,15, 16,17,18, 19,20,21};
299 } else {
300 answer ={4, 8, 12};
301 }
302 }
303 void getEdgeLocalCodeNumbers(IntArray& answer, const Variable::VariableQuantity q) const override {}
304
305 private:
306 virtual int giveNumberOfUDofs() const override {return 30;}
307 virtual int giveNumberOfPDofs() const override {return 4;}
308 virtual const Variable* getU() const override {return &u;}
309 virtual const Variable* getP() const override {return &p;}
310 void computeGaussPoints() override {
311 if ( integrationRulesArray.size() == 0 ) {
312 integrationRulesArray.resize( 1 );
313 integrationRulesArray [ 0 ] = std::make_unique<GaussIntegrationRule>(1, this);
314 integrationRulesArray [ 0 ]->SetUpPointsOnTetrahedra(numberOfGaussPoints, _3dUP);
315 }
316 }
317};
318
319const FEI3dTetQuad UPTetra21::uInterpol;
320const FEI3dTetLin UPTetra21::pInterpol;
321const Variable UPTetra21::p(&UPTetra21::pInterpol, Variable::VariableQuantity::Pressure, Variable::VariableType::scalar, 1, NULL, {11});
322const Variable UPTetra21::u(&UPTetra21::uInterpol, Variable::VariableQuantity::Displacement, Variable::VariableType::vector, 3, NULL, {1,2,3});
323
324#define _IFT_UPTetra21_Name "uptetra21"
326
327
331class UPBrick11 : public UPElement, public ZZNodalRecoveryModelInterface {
332 protected:
333 //FEI3dTetLin pInterpol;
334 //FEI3dTetQuad uInterpol;
335 const static FEI3dHexaLin pInterpol;
336 const static FEI3dHexaLin uInterpol;
337 const static Variable p;
338 const static Variable u;
339
340 public:
341 UPBrick11(int n, Domain* d):
343 {
344 numberOfDofMans = 8;
345 numberOfGaussPoints = 8;
346 this->computeGaussPoints();
347 }
348
349 void getDofManLocalCodeNumbers (IntArray& answer, const Variable::VariableQuantity q, int num ) const override {
350 /* dof ordering: u1 v1 w1 p1 u2 v2 w2 p2 u3 v3 w3 p3 u4 v4 w4 u5 v5 w5 u6 v6 w6*/
351 if (q == Variable::VariableQuantity::Displacement) {
352 //answer={1,2,3, 5,6,7, 9,10,11, 13,14,15, 17,18,19, 21,22,23, 25,26,27, 29,30,31 };
353 int o = (num-1)*4+1;
354 answer={o, o+1, o+2};
355 } else if (q == Variable::VariableQuantity::Pressure) {
356 //answer = {4, 8, 12, 16, 20, 24, 28, 32};
357 answer={num*4};
358 }
359 }
360 void getInternalDofManLocalCodeNumbers (IntArray& answer, const Variable::VariableQuantity q, int num ) const override {
361 answer={};
362 }
363
364 void giveDofManDofIDMask(int inode, IntArray &answer) const override {
365 answer = {1,2,3,11};
366 }
367 int giveNumberOfDofs() override { return 32; }
368 const char *giveInputRecordName() const override {return "upbrick11";}
369 const char *giveClassName() const override { return "UPBrick11"; }
370
371
372 const FEInterpolation* getGeometryInterpolation() const override {return &this->pInterpol;}
373
374 Element_Geometry_Type giveGeometryType() const override {
375 return EGT_hexa_1;
376 }
377 int getNumberOfSurfaceDOFs() const override {return 16;}
378 int getNumberOfEdgeDOFs() const override {return 0;}
379 void getSurfaceLocalCodeNumbers(IntArray& answer, const Variable::VariableQuantity q) const override {
380 if (q == Variable::VariableQuantity::Displacement) {
381 answer={1,2,3, 5,6,7, 9,10,11, 13,14,15};
382 } else {
383 answer ={4, 8, 12, 16};
384 }
385 }
386 void getEdgeLocalCodeNumbers(IntArray& answer, const Variable::VariableQuantity q) const override {}
387 Interface *giveInterface(InterfaceType it) override {
389 return this;
390 } else {
391 return NULL;
392 }
393 }
394
395
396
397private:
398 virtual int giveNumberOfUDofs() const override {return 24;}
399 virtual int giveNumberOfPDofs() const override {return 8;}
400 virtual const Variable* getU() const override {return &u;}
401 virtual const Variable* getP() const override {return &p;}
402 void computeGaussPoints() override {
403 if ( integrationRulesArray.size() == 0 ) {
404 integrationRulesArray.resize( 1 );
405 integrationRulesArray [ 0 ] = std::make_unique<GaussIntegrationRule>(1, this);
406 integrationRulesArray [ 0 ]->SetUpPointsOnCube(numberOfGaussPoints, _3dUP);
407 }
408 }
409};
410
411const FEI3dHexaLin UPBrick11::uInterpol;
412const FEI3dHexaLin UPBrick11::pInterpol;
413const Variable UPBrick11::p(&UPBrick11::pInterpol, Variable::VariableQuantity::Pressure, Variable::VariableType::scalar, 1, NULL, {11});
414const Variable UPBrick11::u(&UPBrick11::uInterpol, Variable::VariableQuantity::Displacement, Variable::VariableType::vector, 3, NULL, {1,2,3});
415
416#define _IFT_UPBrick11_Name "upbrick11"
418
419
423class UPQuad11 : public UPElement {
424 protected:
425 //FEI3dTetLin pInterpol;
426 //FEI3dTetQuad uInterpol;
427 const static FEI2dQuadLin pInterpol;
428 const static FEI2dQuadLin uInterpol;
429 const static Variable p;
430 const static Variable u;
431
432 public:
433 UPQuad11(int n, Domain* d):
434 UPElement(n,d)
435 {
436 numberOfDofMans = 4;
437 numberOfGaussPoints = 4;
438 this->computeGaussPoints();
439 }
440
441 void getDofManLocalCodeNumbers (IntArray& answer, const Variable::VariableQuantity q, int num ) const override {
442 /* dof ordering: u1 v1 w1 p1 u2 v2 w2 p2 u3 v3 w3 p3 u4 v4 w4 p4*/
443 if (q == Variable::VariableQuantity::Displacement) {
444 //answer={1,2,3, 5,6,7, 9,10,11, 13,14,15 };
445 int o = (num-1)*3+1;
446 answer={o, o+1};
447 } else if (q == Variable::VariableQuantity::Pressure) {
448 //answer = {4, 8, 12, 16};
449 answer={num*3};
450 }
451 }
452 void getInternalDofManLocalCodeNumbers (IntArray& answer, const Variable::VariableQuantity q, int num ) const override {
453 answer={};
454 }
455
456 void giveDofManDofIDMask(int inode, IntArray &answer) const override {
457 answer = {1,2,11};
458 }
459 int giveNumberOfDofs() override { return 12; }
460 const char *giveInputRecordName() const override {return "upquad11";}
461
462 const FEInterpolation* getGeometryInterpolation() const override {return &this->pInterpol;}
463
464 Element_Geometry_Type giveGeometryType() const override {
465 return EGT_quad_1;
466 }
467 int getNumberOfSurfaceDOFs() const override {return 0;}
468 void getSurfaceLocalCodeNumbers(IntArray& answer, const Variable::VariableQuantity q) const override {
469 answer={};
470 }
471
472 int getNumberOfEdgeDOFs() const override {return 6;}
473 void getEdgeLocalCodeNumbers(IntArray& answer, const Variable::VariableQuantity q) const override {
474 if (q == Variable::VariableQuantity::Displacement) {
475 answer={1,2, 4,5};
476 } else {
477 answer ={3, 6};
478 }
479 }
480
481
482
483private:
484 virtual int giveNumberOfUDofs() const override {return 8;}
485 virtual int giveNumberOfPDofs() const override {return 4;}
486 virtual const Variable* getU() const override {return &u;}
487 virtual const Variable* getP() const override {return &p;}
488 void computeGaussPoints() override {
489 if ( integrationRulesArray.size() == 0 ) {
490 integrationRulesArray.resize( 1 );
491 integrationRulesArray [ 0 ] = std::make_unique<GaussIntegrationRule>(1, this);
492 integrationRulesArray [ 0 ]->SetUpPointsOnSquare(numberOfGaussPoints, _2dUP);
493 }
494 }
495};
496
497const FEI2dQuadLin UPQuad11::uInterpol(1,2);
498const FEI2dQuadLin UPQuad11::pInterpol(1,2);
499const Variable UPQuad11::p(&UPQuad11::pInterpol, Variable::VariableQuantity::Pressure, Variable::VariableType::scalar, 1, NULL, {11});
500const Variable UPQuad11::u(&UPQuad11::uInterpol, Variable::VariableQuantity::Displacement, Variable::VariableType::vector, 2, NULL, {1,2});
501
502#define _IFT_UPQuad11_Name "upquad11"
504
505
506
507#define _IFT_UPSimpleMaterial_Name "upm"
508#define _IFT_UPSimpleMaterial_E "e"
509#define _IFT_UPSimpleMaterial_nu "nu"
510#define _IFT_UPSimpleMaterial_k "k"
511#define _IFT_UPSimpleMaterial_alpha "alpha"
512#define _IFT_UPSimpleMaterial_c "c"
513
514class UPMaterialStatus : public MaterialStatus
515{
516protected:
518 FloatArray strainVector;
520 FloatArray stressVector;
522 FloatArray tempStressVector;
524 FloatArray tempStrainVector;
525public:
527 UPMaterialStatus (GaussPoint * g) : MaterialStatus(g), strainVector(), stressVector(),
528 tempStressVector(), tempStrainVector()
529 {}
530
532 const FloatArray &giveStrainVector() const { return strainVector; }
534 const FloatArray &giveStressVector() const { return stressVector; }
536 const FloatArray &giveTempStrainVector() const { return tempStrainVector; }
538 const FloatArray &giveTempStressVector() const { return tempStressVector; }
540 void letTempStressVectorBe(const FloatArray &v) { tempStressVector = v; }
542 void letTempStrainVectorBe(const FloatArray &v) { tempStrainVector = v; }
543
544 void printOutputAt(FILE *file, TimeStep *tStep) const override {
545 MaterialStatus :: printOutputAt(file, tStep);
546 fprintf(file, " strains ");
547 for ( auto &var : strainVector ) {
548 fprintf( file, " %+.4e", var );
549 }
550
551 fprintf(file, "\n stresses");
552 for ( auto &var : stressVector ) {
553 fprintf( file, " %+.4e", var );
554 }
555 fprintf(file, "\n");
556 }
557
558 void initTempStatus() override {
559 MaterialStatus :: initTempStatus();
560 tempStressVector = stressVector;
561 tempStrainVector = strainVector;
562 }
563 void updateYourself(TimeStep *tStep) override {
564 MaterialStatus :: updateYourself(tStep);
565 stressVector = tempStressVector;
566 strainVector = tempStrainVector;
567 }
568 const char *giveClassName() const override {return "UPMaterialStatus";}
569
570};
571
573 protected:
574 double e, nu; // elastic isotropic constants
575 double k; // isotropic permeability
576 double alpha; // Biot constant = 1-K_t/K_s (Kt bulk moduli of the porous medium, Ks bulk moduli of solid phase)
577 double c; // 1/Q, where Q is combined compressibility of the fluid and solid phases (1/Q=n/Kt+(b-n)/Ks, where n is porosity)
578 double muw; // dynamic viscosity of water
579 public:
580 UPSimpleMaterial (int n, Domain* d) : Material (n,d) {e=1.0; nu=0.15; k=1.0; alpha=1.0; c=0.1; muw = 1.0;}
581
582 void giveCharacteristicMatrix(FloatMatrix &answer, MatResponseMode type, GaussPoint* gp, TimeStep *tStep) const override {
583 MaterialMode mmode = gp->giveMaterialMode();
584 if (type == TangentStiffness) {
585 double ee;
586
587 ee = e / ( ( 1. + nu ) * ( 1. - 2. * nu ) );
588 answer.resize(6, 6);
589 answer.zero();
590
591 answer.at(1, 1) = 1. - nu;
592 answer.at(1, 2) = nu;
593 answer.at(1, 3) = nu;
594 answer.at(2, 1) = nu;
595 answer.at(2, 2) = 1. - nu;
596 answer.at(2, 3) = nu;
597 answer.at(3, 1) = nu;
598 answer.at(3, 2) = nu;
599 answer.at(3, 3) = 1. - nu;
600
601 answer.at(4, 4) = ( 1. - 2. * nu ) * 0.5;
602 answer.at(5, 5) = ( 1. - 2. * nu ) * 0.5;
603 answer.at(6, 6) = ( 1. - 2. * nu ) * 0.5;
604
605 answer.times(ee);
606 } else if (type == Permeability) {
607 if (mmode == _3dUP) {
608 answer.resize(3,3);
609 answer.beUnitMatrix();
610 answer.times(this->k/this->muw);
611 } else if (mmode == _2dUP) {
612 answer.resize(2,2);
613 answer.beUnitMatrix();
614 answer.times(this->k);
615 }
616 }
617 }
618
619 void giveCharacteristicVector(FloatArray &answer, FloatArray& flux, MatResponseMode type, GaussPoint* gp, TimeStep *tStep) const override {
620 if (type == Stress) {
621 FloatMatrix d;
622 UPMaterialStatus *status = static_cast< UPMaterialStatus * >( this->giveStatus(gp) );
623
624 this->giveCharacteristicMatrix(d, TangentStiffness, gp, tStep);
625 answer.beProductOf(d, flux);
626 // update gp status
627 status->letTempStrainVectorBe(flux);
628 status->letTempStressVectorBe(answer);
629
630 }else if (type == FluidMassBalancePressureContribution) {
631 FloatMatrix _k;
632 this->giveCharacteristicMatrix(_k, Permeability, gp, tStep);
633 answer.beProductOf(_k, flux);
634 }
635 }
636
637
638 double giveCharacteristicValue(MatResponseMode type, GaussPoint* gp, TimeStep *tStep) const override {
639 if (type == BiotConstant) {
640 return alpha;
641 } else if (type == CompressibilityCoefficient) {
642 return c;
643 } else {
644 return 0.0;
645 }
646 };
647
658 // void giveInputRecord(DynamicInputRecord &input) override {};
659 void giveInputRecord(DynamicInputRecord &input) override {};
660 std::unique_ptr<MaterialStatus> CreateStatus(GaussPoint *gp) const override { return std::make_unique<UPMaterialStatus>(gp); }
661
662 const char *giveClassName() const override {return "UPSimpleMaterial";}
663 const char *giveInputRecordName() const override {return _IFT_UPSimpleMaterial_Name;}
664 int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep) override {
665 UPMaterialStatus *status = static_cast< UPMaterialStatus * >( this->giveStatus(gp) );
666 if ( type == IST_StrainTensor ) {
667 answer = status->giveStrainVector();
668 return 1;
669 }
670 if ( type == IST_StressTensor ) {
671 answer = status->giveStressVector();
672 return 1;
673 } else {
674 return Material::giveIPValue(answer, gp, type, tStep);
675 }
676 }
677
678};
679REGISTER_Material(UPSimpleMaterial)
680
681} // end namespace oofem
#define REGISTER_Material(class)
#define REGISTER_Element(class)
A Linear momentum balance equation term ($B^T\sigma(u)$).
Definition termlibrary.h:52
A continuity equation term $Qp=(B)^T \alpha\bf{m}N_p$.
int giveApproxOrder() override=0
virtual int giveNumberOfDofs()
Definition element.h:239
virtual const FEInterpolation * getGeometryInterpolation() const
Definition element.h:660
int numberOfDofMans
Number of dofmanagers.
Definition element.h:136
std::vector< std ::unique_ptr< IntegrationRule > > integrationRulesArray
Definition element.h:157
int numberOfGaussPoints
Definition element.h:175
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Definition element.h:886
virtual Element_Geometry_Type giveGeometryType() const =0
virtual std::unique_ptr< IntegrationRule > giveBoundaryEdgeIntegrationRule(int order, int boundary, const Element_Geometry_Type) const
Definition feinterpol.C:112
virtual std::unique_ptr< IntegrationRule > giveBoundarySurfaceIntegrationRule(int order, int boundary, const Element_Geometry_Type) const
Definition feinterpol.C:123
int giveInterpolationOrder() const
Definition feinterpol.h:199
virtual double boundarySurfaceEvalNormal(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
void assemble(const FloatArray &fe, const IntArray &loc)
Definition floatarray.C:616
void resize(Index s)
Definition floatarray.C:94
double & at(Index i)
Definition floatarray.h:202
void zero()
Zeroes all coefficients of receiver.
Definition floatarray.C:683
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Definition floatarray.C:689
void beVectorProductOf(const FloatArray &v1, const FloatArray &v2)
Definition floatarray.C:476
void times(double f)
void resize(Index rows, Index cols)
Definition floatmatrix.C:79
*Sets size of receiver to be an empty matrix It will have zero rows and zero columns size void clear()
void zero()
Zeroes all coefficient of receiver.
double at(std::size_t i, std::size_t j) const
void beUnitMatrix()
Sets receiver to unity matrix.
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition gausspoint.h:190
virtual int getNumberOfSurfaceDOFs() const =0
virtual void getEdgeLocalCodeNumbers(IntArray &answer, const Variable::VariableQuantity q) const =0
virtual int getNumberOfEdgeDOFs() const =0
void integrateSurfaceTerm_c(FloatArray &answer, const Term &term, IntegrationRule *iRule, int isurf, TimeStep *tstep)
Definition mpm.h:329
virtual void getSurfaceLocalCodeNumbers(IntArray &answer, const Variable::VariableQuantity q) const =0
MPElement(int n, Domain *aDomain)
Definition mpm.h:285
void integrateEdgeTerm_c(FloatArray &answer, const Term &term, IntegrationRule *iRule, int iedge, TimeStep *tstep)
Definition mpm.h:353
void integrateTerm_c(FloatArray &answer, const Term &term, IntegrationRule *iRule, TimeStep *tstep)
Definition mpm.h:305
void integrateTerm_dw(FloatMatrix &answer, const Term &term, IntegrationRule *iRule, TimeStep *tstep)
Definition mpm.h:293
Material(int n, Domain *d)
Definition material.C:46
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Definition material.C:138
A continuity equation term $Q^T(du\over dt)=(N)^T \alpha\bf{m}^TB du\over dt$.
A continuity equation compressibility matrix $S=(N_p)^T c\ N_p$, where $c=({\alpha-n}...
A external flux term $S=(N)^T f$, where $f$ is functor evaluating the flux.
A external flux term $S=(N)^T f$, where $f$ is functor evaluating the flux.
Base class for (3D) UP elements.
Definition up.C:64
virtual int giveNumberOfUDofs() const =0
virtual int giveNumberOfPDofs() const =0
void giveCharacteristicMatrix(FloatMatrix &answer, CharType type, TimeStep *tStep) override
Definition up.C:73
void computeBoundarySurfaceLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true) override
Definition up.C:133
virtual const Variable * getP() const =0
UPElement(int n, Domain *d)
Definition up.C:67
void computeBoundaryEdgeLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true) override
Definition up.C:161
void giveCharacteristicVector(FloatArray &answer, CharType type, ValueModeType mode, TimeStep *tStep) override
Definition up.C:104
virtual const Variable * getU() const =0
int computeFluxLBToLRotationMatrix(FloatMatrix &answer, int iSurf, const FloatArray &lc, const Variable::VariableQuantity q, char btype) override
Definition up.C:190
double giveCharacteristicValue(MatResponseMode type, GaussPoint *gp, TimeStep *tStep) const override
Returns characteristic value of the receiver.
Definition up.C:638
const char * giveInputRecordName() const override
Definition up.C:663
void initializeFrom(InputRecord &ir) override
Definition up.C:648
void giveInputRecord(DynamicInputRecord &input) override
Definition up.C:659
std::unique_ptr< MaterialStatus > CreateStatus(GaussPoint *gp) const override
Definition up.C:660
UPSimpleMaterial(int n, Domain *d)
Definition up.C:580
void giveCharacteristicMatrix(FloatMatrix &answer, MatResponseMode type, GaussPoint *gp, TimeStep *tStep) const override
Returns characteristic matrix of the receiver.
Definition up.C:582
const char * giveClassName() const override
Definition up.C:662
void giveCharacteristicVector(FloatArray &answer, FloatArray &flux, MatResponseMode type, GaussPoint *gp, TimeStep *tStep) const override
Returns characteristic vector of the receiver.
Definition up.C:619
int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep) override
Definition up.C:664
3D Tetrahedra element with quadratic interpolation for displacements, linear interpolation for pressu...
Definition up.C:242
int giveNumberOfDofs() override
Definition up.C:287
void giveDofManDofIDMask(int inode, IntArray &answer) const override
Definition up.C:280
void getDofManLocalCodeNumbers(IntArray &answer, const Variable::VariableQuantity q, int num) const override
Definition up.C:261
virtual int giveNumberOfUDofs() const override
Definition up.C:306
static const FEI3dTetLin pInterpol
Definition up.C:246
int getNumberOfSurfaceDOFs() const override
Definition up.C:294
static const Variable u
Definition up.C:249
Element_Geometry_Type giveGeometryType() const override
Definition up.C:291
int getNumberOfEdgeDOFs() const override
Definition up.C:295
virtual int giveNumberOfPDofs() const override
Definition up.C:307
UPTetra21(int n, Domain *d)
Definition up.C:253
const FEInterpolation * getGeometryInterpolation() const override
Definition up.C:289
void getInternalDofManLocalCodeNumbers(IntArray &answer, const Variable::VariableQuantity q, int num) const override
Definition up.C:276
void getEdgeLocalCodeNumbers(IntArray &answer, const Variable::VariableQuantity q) const override
Definition up.C:303
static const FEI3dTetQuad uInterpol
Definition up.C:247
void computeGaussPoints() override
Definition up.C:310
void getSurfaceLocalCodeNumbers(IntArray &answer, const Variable::VariableQuantity q) const override
Definition up.C:296
virtual const Variable * getU() const override
Definition up.C:308
const char * giveInputRecordName() const override
Definition up.C:288
virtual const Variable * getP() const override
Definition up.C:309
static const Variable p
Definition up.C:248
oofem::VariableQuantity VariableQuantity
Definition mpm.h:92
const FEInterpolation * interpolation
Definition mpm.h:94
A continuity equation term ($Hp=(\grad N_p)^T f(p)$, where $f=\bf{k}/\mu \grad p$.
Definition termlibrary.h:92
#define OOFEM_ERROR(...)
Definition error.h:79
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75
@ ZZNodalRecoveryModelInterfaceType
#define _IFT_UPSimpleMaterial_E
#define _IFT_UPSimpleMaterial_nu
#define _IFT_UPSimpleMaterial_alpha
#define _IFT_UPSimpleMaterial_c
#define _IFT_UPSimpleMaterial_Name
#define _IFT_UPSimpleMaterial_k

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011