OOFEM 3.0
Loading...
Searching...
No Matches
prototype2.h
Go to the documentation of this file.
1
2#ifndef prototype2_h
3#define prototype2_h
4
5#include "engngm.h"
6#include "sparselinsystemnm.h"
8#include "sparsemtrx.h"
9#include "primaryfield.h"
10#include "function.h"
13#include "integral.h"
14#include "fei2dquadconst.h"
15#include "fei2dlineconst.h"
16#include "fei2dquadlin.h"
17#include "fei2dlinelin.h"
18#include "fei2dquadquad.h"
19#include "fei2dlinequad.h"
20#include "termlibrary.h"
21#include "crosssection.h"
22#include "material.h"
23#include "masterdof.h"
25#include "dofmanager.h"
26#include "connectivitytable.h"
27#include "matresponsemode.h"
28
30
31#define _IFT_TestProblem_Name "test"
33
34namespace oofem {
35
42 public:
45
46 void giveCellDofMans(IntArray& nodes, IntArray& internalDofMans, Element* elem) const override {
47 return this->getCellInterpolation(elem->giveGeometryType())->giveCellDofMans(nodes,internalDofMans, elem );
48 }
49 void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
50 return this->getCellInterpolation(cellgeo.giveGeometryType())->evalN(answer, lcoords, cellgeo);
51 }
52 double evaldNdx(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
53 return this->getCellInterpolation(cellgeo.giveGeometryType())->evaldNdx(answer, lcoords, cellgeo);
54 }
55 void local2global(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
56 return this->getCellInterpolation(cellgeo.giveGeometryType())->local2global(answer, lcoords, cellgeo);
57 }
58 virtual int global2local(FloatArray &answer, const FloatArray &gcoords, const FEICellGeometry &cellgeo) const override {
59 return this->getCellInterpolation(cellgeo.giveGeometryType())->global2local(answer, gcoords, cellgeo);
60 }
61 double giveTransformationJacobian(const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
62 return this->getCellInterpolation(cellgeo.giveGeometryType())->giveTransformationJacobian(lcoords, cellgeo);
63 }
64 void giveJacobianMatrixAt(FloatMatrix &jacobianMatrix, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
65 return this->getCellInterpolation(cellgeo.giveGeometryType())->giveJacobianMatrixAt(jacobianMatrix, lcoords, cellgeo );
66 }
67 std::unique_ptr<IntegrationRule> giveIntegrationRule(int _order, Element_Geometry_Type egt) const override {
68 return this->getCellInterpolation(egt)->giveIntegrationRule(_order, egt);
69 }
70 virtual void boundaryEdgeEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
71 return this->getCellInterpolation(cellgeo.giveGeometryType())->boundaryEdgeEvalN (answer, boundary, lcoords, cellgeo);
72 }
73 double boundaryEdgeEvalNormal(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
74 return this->getCellInterpolation(cellgeo.giveGeometryType())->boundaryEdgeEvalNormal(answer, boundary, lcoords, cellgeo);
75 }
76 double boundaryEdgeGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
77 return this->getCellInterpolation(cellgeo.giveGeometryType())->boundaryEdgeGiveTransformationJacobian(boundary, lcoords, cellgeo);
78 }
79 void boundaryEdgeLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
80 return this->getCellInterpolation(cellgeo.giveGeometryType())->boundaryEdgeLocal2Global(answer, boundary, lcoords, cellgeo);
81 }
83 return this->getCellInterpolation(egt)->giveBoundaryEdgeIntegrationDomain(boundary, egt);
84 }
85 std::unique_ptr<IntegrationRule> giveBoundaryEdgeIntegrationRule(int _order, int boundary, Element_Geometry_Type egt) const override {
86 return this->getCellInterpolation(egt)->giveBoundaryEdgeIntegrationRule(_order, boundary, egt);
87 }
88 IntArray boundaryEdgeGiveNodes(int boundary, Element_Geometry_Type gt, bool includeHierarchical=false) const override {
89 return this->getCellInterpolation(gt)->boundaryEdgeGiveNodes(boundary, gt, includeHierarchical);
90 }
91
92 void boundarySurfaceEvalN(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
93 return this->getCellInterpolation(cellgeo.giveGeometryType())->boundarySurfaceEvalN(answer, isurf, lcoords, cellgeo);
94 }
95 void boundarySurfaceEvaldNdx(FloatMatrix &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
96 return this->getCellInterpolation(cellgeo.giveGeometryType())->boundarySurfaceEvaldNdx(answer, isurf, lcoords, cellgeo);
97 }
98 double boundarySurfaceEvalNormal(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
99 return this->getCellInterpolation(cellgeo.giveGeometryType())->boundarySurfaceEvalNormal(answer, isurf, lcoords, cellgeo);
100 }
101
102 void boundarySurfaceLocal2global(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
103 return this->getCellInterpolation(cellgeo.giveGeometryType())->boundarySurfaceLocal2global(answer, isurf, lcoords, cellgeo);
104 }
105 double boundarySurfaceGiveTransformationJacobian(int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
106 return this->getCellInterpolation(cellgeo.giveGeometryType())->boundarySurfaceGiveTransformationJacobian(isurf, lcoords, cellgeo);
107 }
109 return this->getCellInterpolation(egt)->giveBoundarySurfaceIntegrationDomain(boundary, egt);
110 }
111 std::unique_ptr<IntegrationRule> giveBoundarySurfaceIntegrationRule(int _order, int boundary, const Element_Geometry_Type egt) const override {
112 return this->getCellInterpolation(egt)->giveBoundarySurfaceIntegrationRule(_order, boundary, egt) ;
113 }
114 IntArray boundarySurfaceGiveNodes(int boundary, const Element_Geometry_Type gt, bool includeHierarchical=false) const override {
115 return this->getCellInterpolation(gt)->boundarySurfaceGiveNodes(boundary, gt, includeHierarchical);
116 }
117
118 IntArray boundaryGiveNodes(int boundary, const Element_Geometry_Type gt) const override {
119 return this->getCellInterpolation(gt)->boundaryGiveNodes(boundary, gt);
120 }
121 void boundaryEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
122 return this->getCellInterpolation(cellgeo.giveGeometryType())->boundaryEvalN(answer, boundary, lcoords, cellgeo);
123 }
124 double boundaryEvalNormal(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
125 return this->getCellInterpolation(cellgeo.giveGeometryType())->boundaryEvalNormal(answer, boundary, lcoords, cellgeo);
126 }
127 double boundaryGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
128 return this->getCellInterpolation(cellgeo.giveGeometryType())->boundaryGiveTransformationJacobian(boundary, lcoords, cellgeo);
129 }
130 void boundaryLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
131 return this->getCellInterpolation(cellgeo.giveGeometryType())->boundaryLocal2Global(answer, boundary, lcoords, cellgeo);
132 }
134 return this->getCellInterpolation(egt)->giveBoundaryIntegrationDomain(boundary,egt);
135 }
136 std::unique_ptr<IntegrationRule> giveBoundaryIntegrationRule(int _order, int boundary, Element_Geometry_Type egt) const override {
137 return this->getCellInterpolation(egt)->giveBoundaryIntegrationRule(_order, boundary, egt);
138 }
139 int giveKnotSpanBasisFuncMask(const IntArray &knotSpan, IntArray &mask) const override{ return 0; }
140 int giveNumberOfKnotSpanBasisFunctions(const IntArray &knotSpan) const override { return 0; }
141 bool hasSubPatchFormulation() const override { return false; }
142 const FloatArray *giveKnotVector() const override { return nullptr; }
143 int giveNumberOfKnotSpans(int dim) const override { return 0; }
144 const FloatArray *giveKnotValues(int dim) const override{ return nullptr; }
145 const IntArray *giveKnotMultiplicity(int dim) const override{ return nullptr; }
146
148 {
149 return this->getCellInterpolation(gt)->giveNumberOfEdges(gt);
150 }
152 {
153 return this->getCellInterpolation(gt)-> giveNumberOfNodes(gt);
154 }
155
163 virtual void giveCellDofManNumberingOffsets(Element_Geometry_Type egt, int order, int &dofManOffset, int&internalDofManOffset) const {
164 if (egt == EGT_line_1) {
165 if ((order == 0) || (order == 1)) { // constant
166 dofManOffset = 0;
167 internalDofManOffset = 0;
168 return;
169 } else if (order == 2) {
170 dofManOffset = 2;
171 internalDofManOffset = 0;
172 return;
173 }
174 } else if (egt==EGT_quad_1) {
175 if ((order == 0) || (order == 1)) { // constant
176 dofManOffset = 0;
177 internalDofManOffset = 0;
178 return;
179 } else if (order == 2) {
180 dofManOffset = 4;
181 internalDofManOffset = 0;
182 return;
183 }
184 }
185 OOFEM_ERROR("Unsupported element geometry type (%d) and interpolation order (%d)", egt, order);
186 }
187
188 };
189
191 private:
194 public:
196
198 if (egt == EGT_quad_1) return _Square;
199 else if (egt == EGT_line_1) return _Line;
200 else return _UnknownIntegrationDomain;
201 }
202 virtual const Element_Geometry_Type giveGeometryType() const override {
203 return EGT_unknown;
204 }
205 virtual const Element_Geometry_Type giveBoundaryGeometryType(int boundary) const override {
206 return EGT_unknown;
207 }
208
209 int giveNsd(const Element_Geometry_Type egt) const override {
210 if (egt == EGT_quad_1) return 2;
211 else if (egt == EGT_line_1) return 1;
212 else return 0;
213 }
214
216 if (egt==EGT_quad_1) return &fei2dQuadConst;
217 else if (egt == EGT_line_1) return &fei2dLineConst;
218 else return NULL;
219 }
220 void initializeCell(Element* e) const override {
221 // initialize cell to be compatible with interpolation
222 // typically 1) new nodes are allocated on shared edges and surfaces with neighboring elements
223 // and (2)new internal dofmans are allocated
224 Domain *d = e->giveDomain();
226 if ((egt == EGT_quad_2) || (egt == EGT_quad_1)) {
227 if (e->giveNumberOfInternalDofManagers() < 1) {
228 std::unique_ptr<DofManager> dm = std::make_unique<DofManager>(1, d);
229 e->setInternalDofManager(1, std::move(dm));
230 }
231 } else {
232 OOFEM_ERROR ("Unsupported element geometry type (%d)", egt);
233 }
234 }
235 };
236
238 private:
241 public:
243
245 if (egt == EGT_quad_1) return _Square;
246 else if (egt == EGT_line_1) return _Line;
247 else return _UnknownIntegrationDomain;
248 }
249 virtual const Element_Geometry_Type giveGeometryType() const override {
250 return EGT_unknown;
251 }
252 virtual const Element_Geometry_Type giveBoundaryGeometryType(int boundary) const override {
253 return EGT_unknown;
254 }
255
256 int giveNsd(const Element_Geometry_Type egt) const override {
257 if (egt == EGT_quad_1) return 2;
258 else if (egt == EGT_line_1) return 1;
259 else return 0;
260 }
261
263 if (egt==EGT_quad_1) return &fei2dQuadLin;
264 else if (egt == EGT_line_1) return &fei2dLineLin;
265 else return NULL;
266 }
267 void initializeCell(Element* e) const override {}
268 };
269
271 private:
274 public:
276
278 if ((egt == EGT_quad_1) || (egt==EGT_quad_2)) return _Square;
279 else if ((egt == EGT_line_1) || (egt == EGT_line_2)) return _Line;
280 else return _UnknownIntegrationDomain;
281 }
282 virtual const Element_Geometry_Type giveGeometryType() const override {
283 return EGT_unknown;
284 }
285 virtual const Element_Geometry_Type giveBoundaryGeometryType(int boundary) const override {
286 return EGT_unknown;
287 }
288
289 int giveNsd(const Element_Geometry_Type egt) const override {
290 if ((egt == EGT_quad_1)||(egt==EGT_quad_2)) return 2;
291 else if ((egt == EGT_line_1)||(egt==EGT_line_2)) return 1;
292 else return 0;
293 }
294
296 if ((egt==EGT_quad_1)||(egt==EGT_quad_2)) return &fei2dQuadQuad;
297 else if ((egt == EGT_line_1)||(egt==EGT_line_2)) return &fei2dLineQuad;
298 else return NULL;
299 }
300 void initializeCell(Element* e) const override {
301 // initialize cell to be compatible with interpolation
302 // typically 1) new nodes are allocated on shared edges and surfaces with neighboring elements
303 // and (2)new internal dofmans are allocated
304 Domain *d = e->giveDomain();
306 if ((egt == EGT_quad_2) || (egt == EGT_line_2)) {
307 return;
308 } else if (egt == EGT_line_1) {
309 this->allocateDofMans(e);
310 if ((e->giveNumberOfDofManagers() > 2) && (e->giveDofManagerNumber(3) ==0)) {
311 int ndm = d->giveNumberOfDofManagers()+1;
312 std::unique_ptr<DofManager> dm = std::make_unique<DofManager>(ndm, d);
313 d->resizeDofManagers(ndm);
314 d->setDofManager(ndm, std::move(dm));
315 e->setDofManager(3, ndm);
316 }
317 } else if (egt == EGT_quad_1) {
318 this->allocateDofMans(e);
319 // loop over edges shared with other element5s
320 const IntArray* edges = e->giveSharedEdgeIDs();
321 for (int i = 1; i<= 4; i++) {
322 if (e->giveDofManagerNumber(4+i) == 0) {
323 int ndm = d->giveNumberOfDofManagers()+1;
324 std::unique_ptr<DofManager> dm= std::make_unique<DofManager>(ndm, d);
325 d->resizeDofManagers(ndm);
326 d->setDofManager(ndm, std::move(dm));
327 e->setDofManager(4+i, ndm);
328
329 // loop over neighbors
331 for (auto ier: sbe->elements) {
332 // find corresponding edge in neighbor element and set DofManager
333 int dofManOffset, internalDofManOffset;
334 giveCellDofManNumberingOffsets(d->giveElement(ier.elementID)->giveGeometryType(), this->giveInterpolationOrder(), dofManOffset, internalDofManOffset);
335 this->allocateDofMans(d->giveElement(ier.elementID));
336 d->giveElement(ier.elementID)->setDofManager(dofManOffset+ier.boundaryID, ndm);
337 }
338 }
339 }
340 } else {
341 OOFEM_ERROR ("Unsupported element geometry type (%d)", egt);
342 }
343 }
344 protected:
345 void allocateDofMans(Element* e) const {
347 if (egt == EGT_line_1) {
348 if (e->giveNumberOfDofManagers() < 3) {
349 IntArray enodes = {e->giveDofManagerNumber(1), e->giveDofManagerNumber(2), 0};
351 e->setDofManagers(enodes);
352 }
353 } if (egt == EGT_quad_1) {
354 const IntArray &nodes = e->giveDofManArray();
355 int nnodes = nodes.giveSize();
356 if (nnodes < 8) {
357 // basic cell with linear geometry
358
359 IntArray enodes(8);
360 for (int i=1; i<=nnodes; i++) {
361 enodes.at(i) = nodes.at(i);
362 }
364 e->setDofManagers(enodes);
365 }
366 }
367 }
368 };
369
370
372 protected:
373 MatResponseMode lhsmatmode = MatResponseMode::TangentStiffness;
374 MatResponseMode rhsmatmode = MatResponseMode::Stress;
375
376 public:
378 BTSigmaTerm2 (const Variable *testField, const Variable* unknownField, MaterialMode m) : MPMSymbolicTerm(testField, unknownField, m) {};
379
387 void evaluate_lin (FloatMatrix& answer, MPElement& e, GaussPoint* gp, TimeStep* tstep) const override {
388 FloatMatrix D, B, DB;
389 e.giveCrossSection()->giveMaterial(gp)->giveCharacteristicMatrix(D, this->lhsmatmode, gp, tstep);
390 this->grad(B, this->field, this->field->interpolation, e, gp->giveNaturalCoordinates(), gp->giveMaterialMode());
391 DB.beProductOf(D, B);
392 //answer.plusProductSymmUpper(B, DB, 1.0);
393 answer.beTProductOf(B,DB);
394 }
395
401 void evaluate (FloatArray& answer, MPElement& cell, GaussPoint* gp, TimeStep* tstep) const override {
402 FloatArray u, eps, sig;
403 FloatMatrix B;
404 cell.getUnknownVector(u, this->field, VM_TotalIntrinsic, tstep);
405 this->grad(B, this->field, this->field->interpolation, cell, gp->giveNaturalCoordinates(), gp->giveMaterialMode());
406 eps.beProductOf(B, u);
407 cell.giveCrossSection()->giveMaterial(gp)->giveCharacteristicVector(sig, eps, this->rhsmatmode, gp, tstep);
408 answer.beTProductOf(B, sig);
409 }
410 void getDimensions(Element& cell) const override {}
411 void initializeFrom(InputRecord &ir, EngngModel* problem) override {
413 int value;
414 if (ir.hasField("lhsmatmode")) {
415 IR_GIVE_FIELD(ir, value, "lhsmatmode");
416 lhsmatmode = (MatResponseMode) value;
417 }
418 if (ir.hasField("rhsmatmode")) {
419 IR_GIVE_FIELD(ir, value, "rhsmatmode");
420 rhsmatmode = (MatResponseMode) value;
421 }
422 }
423
424 protected:
434 void grad(FloatMatrix& answer, const Variable *v, const FEInterpolation* interpol, const MPElement& cell, const FloatArray& coords, const MaterialMode mmode) const {
435 FloatMatrix dn, dndx, jacobianMatrix, inv;
436 int nnodes = interpol->giveNumberOfNodes(cell.giveGeometryType());
437 int ndofs = v->size;
438 // evaluate matrix of derivatives, the member at i,j position contains value of dNi/dxj
439
440 interpol->evaldNdx(dndx, coords, FEIElementGeometryWrapper(&cell)); // won't work for cells with lower geometry intyerpolation than unknown interpolation
441 // use cell geometry interpolation to evaluate jacobian
442 // @TODO would be better if this is handled by interpolation class internally by passing geometry interpolation somhow (part of FEIElementGeometryWrapper?)
443 //interpol->evaldNdxi(dn, coords, FEIElementGeometryWrapper(&cell));
444 //const FEInterpolation *gi = cell.getGeometryInterpolation();
445 //gi->giveJacobianMatrixAt(jacobianMatrix, coords, FEIElementGeometryWrapper(&cell));
446 //inv.beInverseOf(jacobianMatrix);
447 //dndx.beProductTOf(dn, inv);
448
449
450 if ((mmode == _3dUP) || (mmode == _3dUPV) || (mode==_3dMat)) {
451 // 3D mode only now
452 answer.resize(6, nnodes*ndofs);
453 for (int i = 0; i< nnodes; i++) {
454 answer(0, i*ndofs+0) = dndx(i, 0);
455 answer(1, i*ndofs+1) = dndx(i, 1);
456 answer(2, i*ndofs+2) = dndx(i, 2);
457
458 answer(3, i*ndofs+1) = dndx(i, 2);
459 answer(3, i*ndofs+2) = dndx(i, 1);
460
461 answer(4, i*ndofs+0) = dndx(i, 2);
462 answer(4, i*ndofs+2) = dndx(i, 0);
463
464 answer(5, i*ndofs+0) = dndx(i, 1);
465 answer(5, i*ndofs+1) = dndx(i, 0);
466 }
467 } else if ((mmode == _2dUP) || (mmode == _2dUPV)) {
468 answer.resize(6, nnodes*ndofs);
469 for (int i = 0; i< nnodes; i++) {
470 answer(0, i*ndofs+0) = dndx(i, 0);
471 answer(1, i*ndofs+1) = dndx(i, 1);
472
473 answer(5, i*ndofs+0) = dndx(i, 1);
474 answer(5, i*ndofs+1) = dndx(i, 0);
475 }
476 } else if ((mmode == _PlaneStress)) {
477 answer.resize(3, nnodes*ndofs);
478 for (int i = 0; i< nnodes; i++) {
479 answer(0, i*ndofs+0) = dndx(i, 0);
480 answer(1, i*ndofs+1) = dndx(i, 1);
481
482 answer(2, i*ndofs+0) = dndx(i, 1);
483 answer(2, i*ndofs+1) = dndx(i, 0);
484 }
485 } else if (mmode == _PlaneStrain) {
486 answer.resize(4, nnodes*ndofs);
487 for (int i = 0; i< nnodes; i++) {
488 answer(0, i*ndofs+0) = dndx(i, 0);
489 answer(1, i*ndofs+1) = dndx(i, 1);
490
491 answer(3, i*ndofs+0) = dndx(i, 1);
492 answer(3, i*ndofs+1) = dndx(i, 0);
493 }
494 } else {
495 OOFEM_ERROR("Unsupported material mode %d", mmode);
496 }
497 }
498
499 };
500 #define _IFT_BTSigmaTerm2_Name "BTSigmaTerm"
501
502 class NTfTerm : public MPMSymbolicTerm {
503 protected:
505 public:
507 NTfTerm (const Variable *testField, const Variable* unknownField, MaterialMode m) : MPMSymbolicTerm(testField, unknownField, m) {};
508 NTfTerm (const Variable *testField, const Variable* unknownField, MaterialMode m, const FloatArray* f) : MPMSymbolicTerm(testField, unknownField, m) {flux = *f;};
509
510 void evaluate_lin (FloatMatrix& answer, MPElement& e, GaussPoint* gp, TimeStep* tstep) const override {}
511
519 void evaluate (FloatArray& answer, MPElement& e, GaussPoint* gp, TimeStep* tstep) const override {
521 FloatArray nvec;
522 const FloatArray& lc = gp->giveNaturalCoordinates();
523
524 this->testField->interpolation->evalN(nvec, lc, FEIElementGeometryWrapper(&e));
525 N.beNMatrixOf(nvec, testField->size);
526 answer.beTProductOf(N, flux);
527 }
528
529 void getDimensions(Element& cell) const override {}
530 void initializeFrom(InputRecord &ir, EngngModel* problem) override {
532 IR_GIVE_FIELD(ir, flux, "flux");
533 }
534 };
535
536 #define _IFT_NTfTerm_Name "NTfTerm"
537
538 class TestProblem : public EngngModel
539 {
540 protected:
543 std :: unique_ptr< DofDistributedPrimaryField > field;
544
545 std :: unique_ptr< SparseMtrx > effectiveMatrix;
546
550
552 std :: unique_ptr< SparseLinearSystemNM > nMethod;
553
554 // list of integrals contributing to lhs and rhs
557
558 public:
559 TestProblem(int i, EngngModel * _master) : EngngModel(i, _master) { ndomains = 1;}
560
561 void initializeFrom(InputRecord &ir) override {
563 IR_GIVE_FIELD(ir, lhsIntegrals, "lhsterms");
564 IR_GIVE_FIELD(ir, rhsIntegrals, "rhsterms");
565 }
566
567 void postInitialize() override {
568
570 for (const auto& i: integralList) {
571 i->initialize();
572 }
574 // initialize integrals
575 //this->giveDomain(1)->postInitialize();
576 }
577
578 void solveYourselfAt(TimeStep *tStep) override {
579 FloatArray rhs;
580 /*
581 Domain *domain = this->giveDomain(1);
582 Set myset (1, domain);
583 FEI2dQuadLin interpol(1,2);
584 Variable u = Variable(&interpol, Variable::VariableQuantity::Displacement, Variable::VariableType::vector, 2, NULL, {1,2});
585 BTSigmaTerm2 mt(&u,&u, _2dUP);
586 myset.setElementList({1});
587 this->integralList.push_back(std::make_unique<Integral>(domain, &myset, &mt));
588 Integral *i = this->integralList[0].get();
589 i->initialize();
590 */
591
593 OOFEM_LOG_INFO("MPM Symbolic solver\n");
594 OOFEM_LOG_INFO("Number of equations %d\n", this->giveNumberOfDomainEquations( 1, EModelDefaultEquationNumbering()) );
595
596#if 0
597 // print element connectivity and nodes after interpolation initialization
598 for (auto &n: this->giveDomain(1)->dofManagerList) {
599 printf("Node %3d, code numbers: %4d %4d\n", n->giveNumber(), n->giveDofWithID(D_u)->__giveEquationNumber(), n->giveDofWithID(D_v)->__giveEquationNumber());
600 }
601
602 for (auto& e: this->giveDomain(1)->elementList) {
603 printf("Element %4d, nodes ", e->giveNumber());
604 IntArray nodes = e->giveDofManArray();
605 for (auto n: nodes) {
606 printf("%4d ",n);
607 }
608 printf("\n");
609 }
610#endif
611
612 if ( !effectiveMatrix ) {
613 effectiveMatrix = classFactory.createSparseMtrx(sparseMtrxType);
614 effectiveMatrix->buildInternalStructure( this, 1, EModelDefaultEquationNumbering() );
615 }
616 // loop over lhs integrals
617 for (auto i: lhsIntegrals) {
618 Integral* integral = this->integralList[i-1].get();
620 }
621 //effectiveMatrix->printYourself();
622 // assemble rhs
624 // loop over rhs integrals
625 for (auto i: rhsIntegrals) {
626 Integral* integral = this->integralList[i-1].get();
627 integral->assemble_rhs (rhs, EModelDefaultEquationNumbering(), tStep);
628 }
629 //rhs.printYourself();
630 solution.resize(rhs.giveSize());
631 // solve the system
632 nMethod->solve(*effectiveMatrix, rhs, solution);
633 //solution.printYourself();
634
635 }
636
638 {
639 if ( !currentStep ) {
640 // first step -> generate initial step
641 //currentStep = std::make_unique<TimeStep>(*giveSolutionStepWhenIcApply());
642 currentStep = std::make_unique<TimeStep>(giveNumberOfTimeStepWhenIcApply(), this, 1, 0., 1., 0);
643 }
644 previousStep = std :: move(currentStep);
645 currentStep = std::make_unique<TimeStep>(*previousStep, 1.);
646
647 return currentStep.get();
648 }
650 {
651 if ( !nMethod ) {
652 if ( isParallel() ) {
653 if ( ( solverType == ST_Petsc ) || ( solverType == ST_Feti ) ) {
654 nMethod = classFactory.createSparseLinSolver(solverType, this->giveDomain(1), this);
655 }
656 } else {
657 nMethod = classFactory.createSparseLinSolver(solverType, this->giveDomain(1), this);
658 }
659 if ( !nMethod ) {
660 OOFEM_ERROR("linear solver creation failed for lstype %d", solverType);
661 }
662 }
663 return nMethod.get();
664 }
665
666 double giveUnknownComponent(ValueModeType mode, TimeStep *tStep, Domain *d, Dof *dof) override
667 // returns unknown quantity like displacement, velocity of equation eq
668 // This function translates this request to numerical method language
669 {
670 int eq = dof->__giveEquationNumber();
671 #ifdef DEBUG
672 if ( eq == 0 ) {
673 OOFEM_ERROR("invalid equation number");
674 }
675 #endif
676
677 if ( tStep != this->giveCurrentStep() ) {
678 OOFEM_ERROR("unknown time step encountered");
679 }
680
681 switch ( mode ) {
682 case VM_Total:
683 case VM_Incremental:
684 if ( solution.isNotEmpty() ) {
685 return solution.at(eq);
686 } else {
687 return 0.;
688 }
689
690 default:
691 OOFEM_ERROR("Unknown is of undefined type for this problem");
692 }
693
694 return 0.;
695 }
696 // identification
697 const char *giveInputRecordName() const { return _IFT_TestProblem_Name; }
698 const char *giveClassName() const override { return "TestProblem"; }
699 fMode giveFormulation() override { return TL; }
700 };
701
702
703
704 class Q1Element : public MPElement {
705 protected:
707 std::vector<std::shared_ptr<DofManager>> internalDofManagers; // stored in the domain not internally
708 public:
710 numberOfDofMans = 4;
711 }
712 const char *giveInputRecordName() const override {return "Q1";}
713 const char *giveClassName() const override {return "Q1";}
714 const FEInterpolation* getGeometryInterpolation() const override {return &this->gInterpol;}
715
717 return EGT_quad_1;
718 }
719 // MPElement requirements
720 void getDofManLocalCodeNumbers (IntArray& answer, const Variable::VariableQuantity q, int num ) const override {}
721 void getInternalDofManLocalCodeNumbers (IntArray& answer, const Variable::VariableQuantity q, int num ) const override {}
722 int getNumberOfSurfaceDOFs() const override {return 0;}
723 int getNumberOfEdgeDOFs() const override {return 0;}
724 void getSurfaceLocalCodeNumbers(IntArray& answer, const Variable::VariableQuantity q) const override {}
725 void getEdgeLocalCodeNumbers(IntArray& answer, const Variable::VariableQuantity q) const override {}
726 DofManager *giveInternalDofManager(int i) const override {
727 return this->internalDofManagers.at(i-1).get();
728 }
729 void setInternalDofManager(int num, std::unique_ptr<DofManager> dm) override{
730 if (num > (int)this->internalDofManagers.size()) {
731 this->internalDofManagers.resize(num);
732 }
733 this->internalDofManagers[num-1] = std::move(dm);
734 }
735 int giveNumberOfInternalDofManagers() const override { return this->internalDofManagers.size(); }
736
737 IntArray giveBoundaryEdgeNodes(int boundary, bool includeHierarchical=false) const override {
738 IntArray answer = MPElement::giveBoundaryEdgeNodes(boundary, false);
739 int nnodes = this->dofManArray.giveSize();
740 if (includeHierarchical && nnodes > 4) {
741 if (nnodes <= 8) { // qudratic
742 int nbaseenodes = answer.giveSize();
743 int offset = 3+boundary;
744 int nhiernodes = 1;
745 answer.resizeWithValues(nbaseenodes+nhiernodes);
746 for (int i=1; i<=nhiernodes; i++) {
747 answer.at(nbaseenodes+i) = i+offset;
748 }
749 } else {
750 OOFEM_ERROR("Unsupported hierarchical node scheme (nnodes=%d)", nnodes);
751 }
752 }
753 return answer;
754 }
755 };
756 #define _IFT_Q1Element_Name "q1"
757
758 class L1Element : public MPElement {
759 protected:
761 public:
762 L1Element (int n, Domain* d): MPElement(n,d) {
763 numberOfDofMans = 2;
764 }
765 const char *giveInputRecordName() const override {return "L1";}
766 const char *giveClassName() const override {return "L1";}
768 return &this->gInterpol;
769 }
770
772 return EGT_line_1;
773 }
774 // MPElement requirements
775 void getDofManLocalCodeNumbers (IntArray& answer, const Variable::VariableQuantity q, int num ) const override {}
776 void getInternalDofManLocalCodeNumbers (IntArray& answer, const Variable::VariableQuantity q, int num ) const override {}
777 int getNumberOfSurfaceDOFs() const override {return 0;}
778 int getNumberOfEdgeDOFs() const override {return 0;}
779 void getSurfaceLocalCodeNumbers(IntArray& answer, const Variable::VariableQuantity q) const override {}
780 void getEdgeLocalCodeNumbers(IntArray& answer, const Variable::VariableQuantity q) const override {}
781
782 };
783 #define _IFT_L1Element_Name "l1"
784
785} // end namespace oofem
786#endif // prototype2_h
#define N(a, b)
void grad(FloatMatrix &answer, const Variable *v, const FEInterpolation *interpol, const MPElement &cell, const FloatArray &coords, const MaterialMode mmode) const
Evaluates B matrix; i.e. $LN$ where $L$ is operator matrix and $N$ is interpolation matrix of unknown...
Definition prototype2.h:434
MatResponseMode lhsmatmode
Definition prototype2.h:373
void getDimensions(Element &cell) const override
Definition prototype2.h:410
MatResponseMode rhsmatmode
Definition prototype2.h:374
void evaluate_lin(FloatMatrix &answer, MPElement &e, GaussPoint *gp, TimeStep *tstep) const override
Evaluates the linearization of $B^T\sigma(u)$, i.e. $B^TDBu$.
Definition prototype2.h:387
void evaluate(FloatArray &answer, MPElement &cell, GaussPoint *gp, TimeStep *tstep) const override
Evaluates Internal forces vector, i.e. $b^T\sigma(u)$.
Definition prototype2.h:401
BTSigmaTerm2(const Variable *testField, const Variable *unknownField, MaterialMode m)
Definition prototype2.h:378
void initializeFrom(InputRecord &ir, EngngModel *problem) override
Definition prototype2.h:411
void boundaryEdgeLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:79
double boundarySurfaceEvalNormal(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:98
const FloatArray * giveKnotVector() const override
Definition prototype2.h:142
std::unique_ptr< IntegrationRule > giveIntegrationRule(int _order, Element_Geometry_Type egt) const override
Definition prototype2.h:67
void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:49
virtual int global2local(FloatArray &answer, const FloatArray &gcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:58
integrationDomain giveBoundaryEdgeIntegrationDomain(int boundary, Element_Geometry_Type egt) const override
Returns boundary integration domain.
Definition prototype2.h:82
std::unique_ptr< IntegrationRule > giveBoundaryEdgeIntegrationRule(int _order, int boundary, Element_Geometry_Type egt) const override
Definition prototype2.h:85
double boundaryGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:127
std::unique_ptr< IntegrationRule > giveBoundaryIntegrationRule(int _order, int boundary, Element_Geometry_Type egt) const override
Definition prototype2.h:136
IntArray boundaryGiveNodes(int boundary, const Element_Geometry_Type gt) const override
Definition prototype2.h:118
double giveTransformationJacobian(const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:61
integrationDomain giveBoundaryIntegrationDomain(int boundary, Element_Geometry_Type egt) const override
Returns boundary integration domain.
Definition prototype2.h:133
int giveNumberOfKnotSpanBasisFunctions(const IntArray &knotSpan) const override
Definition prototype2.h:140
double boundaryEdgeEvalNormal(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:73
virtual void giveCellDofManNumberingOffsets(Element_Geometry_Type egt, int order, int &dofManOffset, int &internalDofManOffset) const
Definition prototype2.h:163
double evaldNdx(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:52
std::unique_ptr< IntegrationRule > giveBoundarySurfaceIntegrationRule(int _order, int boundary, const Element_Geometry_Type egt) const override
Definition prototype2.h:111
virtual void boundaryEdgeEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:70
void boundarySurfaceLocal2global(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:102
IntArray boundarySurfaceGiveNodes(int boundary, const Element_Geometry_Type gt, bool includeHierarchical=false) const override
Definition prototype2.h:114
void giveJacobianMatrixAt(FloatMatrix &jacobianMatrix, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:64
void giveCellDofMans(IntArray &nodes, IntArray &internalDofMans, Element *elem) const override
Returns list of element nodes (and list of internal dof managers) (including on edges and surfaces) d...
Definition prototype2.h:46
integrationDomain giveBoundarySurfaceIntegrationDomain(int boundary, const Element_Geometry_Type egt) const override
Returns boundary integration domain.
Definition prototype2.h:108
const IntArray * giveKnotMultiplicity(int dim) const override
Definition prototype2.h:145
double boundaryEdgeGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:76
int giveKnotSpanBasisFuncMask(const IntArray &knotSpan, IntArray &mask) const override
Definition prototype2.h:139
double boundaryEvalNormal(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:124
IntArray boundaryEdgeGiveNodes(int boundary, Element_Geometry_Type gt, bool includeHierarchical=false) const override
Definition prototype2.h:88
bool hasSubPatchFormulation() const override
Definition prototype2.h:141
virtual const FEInterpolation * getCellInterpolation(Element_Geometry_Type egt) const =0
int giveNumberOfKnotSpans(int dim) const override
Definition prototype2.h:143
const FloatArray * giveKnotValues(int dim) const override
Definition prototype2.h:144
void boundarySurfaceEvaldNdx(FloatMatrix &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:95
int giveNumberOfNodes(Element_Geometry_Type gt) const override
Definition prototype2.h:151
int giveNumberOfEdges(Element_Geometry_Type gt) const override
Definition prototype2.h:147
void local2global(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:55
void boundaryLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:130
void boundarySurfaceEvalN(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:92
void boundaryEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:121
double boundarySurfaceGiveTransformationJacobian(int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition prototype2.h:105
SharedBoundaryEntity * giveBoundaryEntity(int id)
void buildSharedBoundaryEntities(Domain *d)
virtual const Element_Geometry_Type giveGeometryType() const override
Definition prototype2.h:202
const FEInterpolation * getCellInterpolation(Element_Geometry_Type egt) const override
Definition prototype2.h:215
virtual const Element_Geometry_Type giveBoundaryGeometryType(int boundary) const override
Definition prototype2.h:205
FEI2dQuadConst fei2dQuadConst
Definition prototype2.h:192
FEI2dLineConst fei2dLineConst
Definition prototype2.h:193
virtual integrationDomain giveIntegrationDomain(const Element_Geometry_Type egt) const override
Definition prototype2.h:197
void initializeCell(Element *e) const override
Definition prototype2.h:220
int giveNsd(const Element_Geometry_Type egt) const override
Definition prototype2.h:209
virtual Material * giveMaterial(IntegrationPoint *ip) const =0
hidden by virtual oofem::Material* TransportCrossSection::giveMaterial() const
void resizeDofManagers(int _newSize)
Resizes the internal data structure to accommodate space for _newSize dofManagers.
Definition domain.C:445
ConnectivityTable * giveConnectivityTable()
Definition domain.C:1240
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
Definition domain.h:461
Element * giveElement(int n)
Definition domain.C:165
void setDofManager(int i, std::unique_ptr< DofManager > obj)
Sets i-th component. The component will be further managed and maintained by domain object.
Definition domain.C:466
void setDofManager(int id, int dm)
Definition element.C:596
void setNumberOfDofManagers(int i)
Sets number of element dof managers.
Definition element.h:697
IntArray dofManArray
Array containing dofmanager numbers.
Definition element.h:138
const IntArray & giveDofManArray() const
Definition element.h:611
virtual int giveNumberOfInternalDofManagers() const
Definition element.h:243
const IntArray * giveSharedEdgeIDs() const
Definition element.h:1243
virtual void setInternalDofManager(int num, std::unique_ptr< DofManager > dm)
Definition element.h:252
void setDofManagers(const IntArray &dmans)
Definition element.C:589
int numberOfDofMans
Number of dofmanagers.
Definition element.h:136
virtual int giveNumberOfDofManagers() const
Definition element.h:695
CrossSection * giveCrossSection()
Definition element.C:534
int giveDofManagerNumber(int i) const
Definition element.h:609
virtual Element_Geometry_Type giveGeometryType() const =0
int giveNumberOfTimeStepWhenIcApply()
Returns the time step number, when initial conditions should apply.
Definition engngm.h:787
virtual int forceEquationNumbering()
Definition engngm.C:534
virtual TimeStep * giveCurrentStep(bool force=false)
Definition engngm.h:717
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Definition engngm.C:452
EngngModel(int i, EngngModel *_master=NULL)
Definition engngm.C:99
std ::unique_ptr< TimeStep > previousStep
Previous time step.
Definition engngm.h:243
int ndomains
Number of receiver domains.
Definition engngm.h:215
Domain * giveDomain(int n)
Definition engngm.C:1936
std ::unique_ptr< TimeStep > currentStep
Current time step.
Definition engngm.h:241
virtual void postInitialize()
Definition engngm.C:2072
virtual void initializeFrom(InputRecord &ir)
Definition engngm.C:292
bool isParallel() const
Returns true if receiver in parallel mode.
Definition engngm.h:1152
virtual const Element_Geometry_Type giveGeometryType() const =0
virtual std::unique_ptr< IntegrationRule > giveBoundaryIntegrationRule(int order, int boundary, const Element_Geometry_Type) const
Definition feinterpol.C:101
virtual std::unique_ptr< IntegrationRule > giveBoundaryEdgeIntegrationRule(int order, int boundary, const Element_Geometry_Type) const
Definition feinterpol.C:112
virtual integrationDomain giveBoundarySurfaceIntegrationDomain(int boundary, const Element_Geometry_Type) const =0
Returns boundary integration domain.
virtual void boundarySurfaceEvaldNdx(FloatMatrix &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual IntArray boundaryEdgeGiveNodes(int boundary, const Element_Geometry_Type, bool includeHierarchical=false) const =0
virtual void boundaryEdgeLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual IntArray boundaryGiveNodes(int boundary, const Element_Geometry_Type) const =0
virtual int giveNumberOfNodes(const Element_Geometry_Type) const
Definition feinterpol.h:557
virtual double boundarySurfaceGiveTransformationJacobian(int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual int global2local(FloatArray &answer, const FloatArray &gcoords, const FEICellGeometry &cellgeo) const =0
virtual double boundaryGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual integrationDomain giveBoundaryIntegrationDomain(int boundary, const Element_Geometry_Type) const =0
Returns boundary integration domain.
virtual int giveNumberOfEdges(const Element_Geometry_Type) const
Definition feinterpol.h:550
virtual double boundaryEdgeGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual double giveTransformationJacobian(const FloatArray &lcoords, const FEICellGeometry &cellgeo) const
Definition feinterpol.C:81
virtual void boundaryEdgeEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual void boundarySurfaceLocal2global(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual void boundarySurfaceEvalN(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual IntArray boundarySurfaceGiveNodes(int boundary, const Element_Geometry_Type, bool includeHierarchical=false) const =0
virtual integrationDomain giveBoundaryEdgeIntegrationDomain(int boundary, const Element_Geometry_Type) const =0
Returns boundary integration domain.
virtual void giveJacobianMatrixAt(FloatMatrix &jacobianMatrix, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const
Definition feinterpol.h:284
virtual void giveCellDofMans(IntArray &nodes, IntArray &internalDofMans, Element *elem) const
Returns list of element nodes (and list of internal dof managers) (including on edges and surfaces) d...
Definition feinterpol.h:208
virtual std::unique_ptr< IntegrationRule > giveBoundarySurfaceIntegrationRule(int order, int boundary, const Element_Geometry_Type) const
Definition feinterpol.C:123
virtual double boundaryEdgeEvalNormal(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual std::unique_ptr< IntegrationRule > giveIntegrationRule(int order, const Element_Geometry_Type) const
Definition feinterpol.C:90
virtual void boundaryLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual double evaldNdx(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual double boundarySurfaceEvalNormal(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual double boundaryEvalNormal(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual void boundaryEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual void local2global(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
Domain * giveDomain() const
Definition femcmpnn.h:97
void resize(Index s)
Definition floatarray.C:94
Index giveSize() const
Returns the size of receiver.
Definition floatarray.h:261
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Definition floatarray.C:689
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Definition floatarray.C:721
void resize(Index rows, Index cols)
Definition floatmatrix.C:79
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
void beTProductOf(const FloatMatrix &a, const FloatMatrix &b)
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
Definition gausspoint.h:138
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition gausspoint.h:190
virtual bool hasField(InputFieldType id)=0
Returns true if record contains field identified by idString keyword.
void resizeWithValues(int n, int allocChunk=0)
Definition intarray.C:64
int & at(std::size_t i)
Definition intarray.h:104
int giveSize() const
Definition intarray.h:211
Class representing weak form integral.
Definition integral.h:49
void assemble_lhs(SparseMtrx &dest, const UnknownNumberingScheme &s, TimeStep *tStep) const
Definition integral.h:76
void assemble_rhs(FloatArray &dest, const UnknownNumberingScheme &s, TimeStep *tstep, FloatArray *eNorms=NULL) const
Definition integral.h:98
L1Element(int n, Domain *d)
Definition prototype2.h:762
static const FEInterpolation & gInterpol
Definition prototype2.h:760
const FEInterpolation * getGeometryInterpolation() const override
Definition prototype2.h:767
int getNumberOfSurfaceDOFs() const override
Definition prototype2.h:777
const char * giveInputRecordName() const override
Definition prototype2.h:765
const char * giveClassName() const override
Definition prototype2.h:766
void getDofManLocalCodeNumbers(IntArray &answer, const Variable::VariableQuantity q, int num) const override
Definition prototype2.h:775
void getEdgeLocalCodeNumbers(IntArray &answer, const Variable::VariableQuantity q) const override
Definition prototype2.h:780
void getSurfaceLocalCodeNumbers(IntArray &answer, const Variable::VariableQuantity q) const override
Definition prototype2.h:779
int getNumberOfEdgeDOFs() const override
Definition prototype2.h:778
Element_Geometry_Type giveGeometryType() const override
Definition prototype2.h:771
void getInternalDofManLocalCodeNumbers(IntArray &answer, const Variable::VariableQuantity q, int num) const override
Definition prototype2.h:776
virtual const Element_Geometry_Type giveBoundaryGeometryType(int boundary) const override
Definition prototype2.h:252
void initializeCell(Element *e) const override
Definition prototype2.h:267
virtual const Element_Geometry_Type giveGeometryType() const override
Definition prototype2.h:249
virtual integrationDomain giveIntegrationDomain(const Element_Geometry_Type egt) const override
Definition prototype2.h:244
int giveNsd(const Element_Geometry_Type egt) const override
Definition prototype2.h:256
const FEInterpolation * getCellInterpolation(Element_Geometry_Type egt) const override
Definition prototype2.h:262
Base class for elements based on mp (multi-physics) concept.
Definition mpm.h:282
IntArray giveBoundaryEdgeNodes(int boundary, bool includeHierarchical=false) const override
Definition mpm.h:521
MPElement(int n, Domain *aDomain)
Definition mpm.h:285
virtual const void getUnknownVector(FloatArray &answer, const Variable *field, ValueModeType mode, TimeStep *tstep)
Returns vector of nodal unknowns for given Variable.
Definition mpm.h:473
void initializeFrom(InputRecord &ir, EngngModel *problem) override
Definition mpm.h:168
virtual void giveCharacteristicVector(FloatArray &answer, FloatArray &flux, MatResponseMode type, GaussPoint *gp, TimeStep *tStep) const
Returns characteristic vector of the receiver.
Definition material.h:145
virtual void giveCharacteristicMatrix(FloatMatrix &answer, MatResponseMode type, GaussPoint *gp, TimeStep *tStep) const
Returns characteristic matrix of the receiver.
Definition material.h:140
NTfTerm(const Variable *testField, const Variable *unknownField, MaterialMode m)
Definition prototype2.h:507
void getDimensions(Element &cell) const override
Definition prototype2.h:529
FloatArray flux
Definition prototype2.h:504
NTfTerm(const Variable *testField, const Variable *unknownField, MaterialMode m, const FloatArray *f)
Definition prototype2.h:508
void evaluate(FloatArray &answer, MPElement &e, GaussPoint *gp, TimeStep *tstep) const override
Evaluates the residual contribution (rhs).
Definition prototype2.h:519
void evaluate_lin(FloatMatrix &answer, MPElement &e, GaussPoint *gp, TimeStep *tstep) const override
Definition prototype2.h:510
void initializeFrom(InputRecord &ir, EngngModel *problem) override
Definition prototype2.h:530
void getDofManLocalCodeNumbers(IntArray &answer, const Variable::VariableQuantity q, int num) const override
Definition prototype2.h:720
IntArray giveBoundaryEdgeNodes(int boundary, bool includeHierarchical=false) const override
Definition prototype2.h:737
int giveNumberOfInternalDofManagers() const override
Definition prototype2.h:735
void setInternalDofManager(int num, std::unique_ptr< DofManager > dm) override
Definition prototype2.h:729
Element_Geometry_Type giveGeometryType() const override
Definition prototype2.h:716
const char * giveInputRecordName() const override
Definition prototype2.h:712
const char * giveClassName() const override
Definition prototype2.h:713
Q1Element(int n, Domain *d)
Definition prototype2.h:709
int getNumberOfSurfaceDOFs() const override
Definition prototype2.h:722
const FEInterpolation * getGeometryInterpolation() const override
Definition prototype2.h:714
static const FEInterpolation & gInterpol
Definition prototype2.h:706
int getNumberOfEdgeDOFs() const override
Definition prototype2.h:723
void getEdgeLocalCodeNumbers(IntArray &answer, const Variable::VariableQuantity q) const override
Definition prototype2.h:725
std::vector< std::shared_ptr< DofManager > > internalDofManagers
Definition prototype2.h:707
DofManager * giveInternalDofManager(int i) const override
Definition prototype2.h:726
void getSurfaceLocalCodeNumbers(IntArray &answer, const Variable::VariableQuantity q) const override
Definition prototype2.h:724
void getInternalDofManLocalCodeNumbers(IntArray &answer, const Variable::VariableQuantity q, int num) const override
Definition prototype2.h:721
void initializeCell(Element *e) const override
Definition prototype2.h:300
virtual const Element_Geometry_Type giveBoundaryGeometryType(int boundary) const override
Definition prototype2.h:285
virtual integrationDomain giveIntegrationDomain(const Element_Geometry_Type egt) const override
Definition prototype2.h:277
int giveNsd(const Element_Geometry_Type egt) const override
Definition prototype2.h:289
void allocateDofMans(Element *e) const
Definition prototype2.h:345
virtual const Element_Geometry_Type giveGeometryType() const override
Definition prototype2.h:282
const FEInterpolation * getCellInterpolation(Element_Geometry_Type egt) const override
Definition prototype2.h:295
std::list< elementRec > elements
MaterialMode mode
Definition mpm.h:138
const Variable * field
Definition mpm.h:136
const Variable * testField
Definition mpm.h:137
const char * giveInputRecordName() const
Definition prototype2.h:697
SparseMtrxType sparseMtrxType
Definition prototype2.h:541
std ::unique_ptr< SparseLinearSystemNM > nMethod
Numerical method used to solve the problem.
Definition prototype2.h:552
std ::unique_ptr< SparseMtrx > effectiveMatrix
Definition prototype2.h:545
IntArray rhsIntegrals
Definition prototype2.h:556
fMode giveFormulation() override
Definition prototype2.h:699
LinSystSolverType solverType
Definition prototype2.h:542
std ::unique_ptr< DofDistributedPrimaryField > field
Definition prototype2.h:543
IntArray lhsIntegrals
Definition prototype2.h:555
void initializeFrom(InputRecord &ir) override
Definition prototype2.h:561
void solveYourselfAt(TimeStep *tStep) override
Definition prototype2.h:578
NumericalMethod * giveNumericalMethod(MetaStep *mStep) override
Returns reference to receiver's numerical method.
Definition prototype2.h:649
FloatArray internalForces
Definition prototype2.h:548
TimeStep * giveNextStep() override
Returns next time step (next to current step) of receiver.
Definition prototype2.h:637
const char * giveClassName() const override
Returns class name of the receiver.
Definition prototype2.h:698
FloatArray solution
Definition prototype2.h:547
TestProblem(int i, EngngModel *_master)
Definition prototype2.h:559
void postInitialize() override
Definition prototype2.h:567
double giveUnknownComponent(ValueModeType mode, TimeStep *tStep, Domain *d, Dof *dof) override
Definition prototype2.h:666
oofem::VariableQuantity VariableQuantity
Definition mpm.h:92
#define OOFEM_ERROR(...)
Definition error.h:79
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define OOFEM_LOG_INFO(...)
Definition logger.h:143
@ _UnknownIntegrationDomain
fMode
Definition fmode.h:42
@ TL
Total Lagrange.
Definition fmode.h:44
@ SMT_Skyline
Symmetric skyline.
ClassFactory & classFactory
FloatMatrixF< N, N > inv(const FloatMatrixF< N, N > &mat, double zeropiv=1e-24)
Computes the inverse.
#define _IFT_TestProblem_Name
Definition prototype2.h:31

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