Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
FE_decl.hpp
1#ifndef FE_DECL_hpp
2#define FE_DECL_hpp
3
4
5#include "feddlib/core/FEDDCore.hpp"
6#include "feddlib/core/General/SmallMatrix.hpp"
7#include "feddlib/core/General/DefaultTypeDefs.hpp"
8#include "feddlib/core/LinearAlgebra/Matrix.hpp"
9#include "feddlib/core/LinearAlgebra/MultiVector.hpp"
10#include "feddlib/core/LinearAlgebra/BlockMatrix.hpp"
11#include "Domain.hpp"
12#include "Helper.hpp"
13#include "sms.hpp"
14#include "feddlib/core/AceFemAssembly/AssembleFE.hpp"
15#include "feddlib/core/AceFemAssembly/specific/AssembleFE_SCI_SMC_Active_Growth_Reorientation.hpp"
16#include "feddlib/core/AceFemAssembly/specific/AssembleFENavierStokes.hpp"
17
18#include "feddlib/core/AceFemAssembly/AssembleFEFactory.hpp"
19
20#include <Teuchos_Array.hpp>
21#include <Teuchos_BLAS.hpp>
22
23#include <boost/function.hpp>
24
33
34namespace FEDD {
35class DataElement {
36 public:
37 DataElement();
38 DataElement(int size);
39 std::vector<double> getHp();
40 std::vector<double> getHt();
41 void setHp( double* ht);
42 private:
43 std::vector<double> ht_;
44 std::vector<double> hp_;
45};
46
47template <class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
48class FE {
49 public:
50
51 typedef Domain<SC,LO,GO,NO> Domain_Type;
52 typedef Teuchos::RCP<Domain_Type> DomainPtr_Type;
53 typedef Teuchos::RCP<const Domain_Type> DomainConstPtr_Type;
54 typedef std::vector<DomainConstPtr_Type> DomainConstPtr_vec_Type;
55
56 typedef Teuchos::RCP<Mesh<SC,LO,GO,NO> > MeshPtr_Type;
57 typedef MeshUnstructured<SC,LO,GO,NO> MeshUnstr_Type;
58 typedef Teuchos::RCP<MeshUnstr_Type> MeshUnstrPtr_Type;
59
60 typedef Elements Elements_Type;
61 typedef Teuchos::RCP<Elements_Type> ElementsPtr_Type;
62 typedef Teuchos::RCP<const Elements_Type> ElementsConstPtr_Type;
63
64 typedef Matrix<SC,LO,GO,NO> Matrix_Type;
65 typedef Teuchos::RCP<Matrix_Type> MatrixPtr_Type;
66
67 typedef typename Matrix_Type::MapPtr_Type MapPtr_Type;
68 typedef typename Matrix_Type::MapConstPtr_Type MapConstPtr_Type;
69
70 typedef MultiVector<SC,LO,GO,NO> MultiVector_Type;
71 typedef Teuchos::RCP<MultiVector_Type> MultiVectorPtr_Type;
72 typedef Teuchos::RCP<const MultiVector_Type> MultiVectorConstPtr_Type;
73
74 typedef std::vector<GO> vec_GO_Type;
75 typedef std::vector<vec_GO_Type> vec2D_GO_Type;
76 typedef std::vector<vec2D_GO_Type> vec3D_GO_Type;
77 typedef Teuchos::RCP<vec3D_GO_Type> vec3D_GO_ptr_Type;
78
79 typedef boost::function<void(double* x, double* res, double t, const double* parameters)> BC_func_Type;
80
81 typedef AssembleFE<SC,LO,GO,NO> AssembleFE_Type;
82 typedef Teuchos::RCP<AssembleFE_Type> AssembleFEPtr_Type;
83
84 typedef AssembleFENavierStokes<SC,LO,GO,NO> AssembleFENavierStokes_Type;
85 typedef Teuchos::RCP<AssembleFENavierStokes_Type> AssembleFENavierStokesPtr_Type;
86
87 typedef AssembleFEGeneralizedNewtonian<SC,LO,GO,NO> AssembleFEGeneralizedNewtonian_Type;
88 typedef Teuchos::RCP<AssembleFEGeneralizedNewtonian_Type> AssembleFEGeneralizedNewtonianPtr_Type;
89
90 typedef AssembleFE_SCI_SMC_Active_Growth_Reorientation<SC,LO,GO,NO> AssembleFE_SCI_SMC_Active_Growth_Reorientation_Type;
91 typedef Teuchos::RCP<AssembleFE_SCI_SMC_Active_Growth_Reorientation_Type> AssembleFE_SCI_SMC_Active_Growth_Reorientation_Ptr_Type;
92
93 typedef std::vector<AssembleFEPtr_Type> AssembleFEPtr_vec_Type;
94
95 typedef BlockMatrix<SC,LO,GO,NO> BlockMatrix_Type ;
96 typedef Teuchos::RCP<BlockMatrix_Type> BlockMatrixPtr_Type;
97
98 typedef BlockMultiVector<SC,LO,GO,NO> BlockMultiVector_Type ;
99 typedef Teuchos::RCP<BlockMultiVector_Type> BlockMultiVectorPtr_Type;
100
101 typedef SmallMatrix<SC> SmallMatrix_Type;
102 typedef Teuchos::RCP<SmallMatrix_Type> SmallMatrixPtr_Type;
103
104 DomainConstPtr_vec_Type domainVec_;
105 Teuchos::RCP<ElementSpec> es_;
106
107 /* ###################################################################### */
108
109 FE(bool saveAssembly=false);
110
111 void assemblyIdentity(MatrixPtr_Type &A);
112
113 void assemblySurfaceRobinBC(int dim,
114 std::string FETypeP,
115 std::string FETypeV,
116 MultiVectorPtr_Type u,
117 MatrixPtr_Type A,
118 std::vector<SC> &funcParameter,
119 RhsFunc_Type func,
120 ParameterListPtr_Type params);
121
122 void assemblySurfaceIntegral(int dim,
123 std::string FEType,
124 MultiVectorPtr_Type a,
125 std::string fieldType,
126 RhsFunc_Type func,
127 std::vector<SC>& funcParameter);
128
129 void assemblySurfaceIntegralExternal(int dim,
130 std::string FEType,
131 MultiVectorPtr_Type f,
132 MultiVectorPtr_Type d_rep,
133 std::vector<SC>& funcParameter,
134 RhsFunc_Type func,
135 ParameterListPtr_Type params,
136 int FEloc=0);
137
139 std::string FEType,
140 MultiVectorPtr_Type f,
141 MultiVectorPtr_Type d_rep,
142 MatrixPtr_Type &Kext,
143 std::vector<SC>& funcParameter,
144 RhsFunc_Type func,
145 ParameterListPtr_Type params,
146 int FEloc = 0);
147
148 void assemblySurfaceIntegralFlag(int dim,
149 std::string FEType,
150 MultiVectorPtr_Type a,
151 std::string fieldType,
152 BC_func_Type func,
153 std::vector<SC>& funcParameter);
154
155 double assemblyResistanceBoundary(int dim,
156 std::string FEType,
157 MultiVectorPtr_Type f,
158 MultiVectorPtr_Type u_rep,
159 vec_dbl_Type flowRate_vec,
160 std::vector<SC>& funcParameter,
161 RhsFunc_Type func,
162 ParameterListPtr_Type params,
163 int FEloc=0);
164 double assemblyAbsorbingBoundary(int dim,
165 std::string FEType,
166 MultiVectorPtr_Type f,
167 MultiVectorPtr_Type u_rep,
168 vec_dbl_Type flowRate_vec,
169 std::vector<SC>& funcParameter,
170 RhsFunc_Type func,
171 double areaOutlet_init,
172 double areaOutlet_T,
173 ParameterListPtr_Type params,
174 int FEloc=0);
175
176 double assemblyAbsorbingBoundaryPaper(int dim,
177 std::string FEType,
178 MultiVectorPtr_Type f,
179 MultiVectorPtr_Type u_rep,
180 vec_dbl_Type flowRate_vec,
181 std::vector<SC>& funcParameter,
182 RhsFunc_Type func,
183 double areaOutlet_init,
184 double areaOutlet_T,
185 ParameterListPtr_Type params,
186 int FEloc=0);
187 double assemblyAbsorbingResistanceBoundary(int dim,
188 std::string FEType,
189 MultiVectorPtr_Type f,
190 MultiVectorPtr_Type u_rep,
191 vec_dbl_Type flowRate_vec,
192 std::vector<SC>& funcParameter,
193 RhsFunc_Type func,
194 double areaOutlet_init,
195 ParameterListPtr_Type params,
196 int FEloc=0);
197 void assemblyArea(int dim,
198 double &area,
199 int inflowFlag,
200 int FEloc=0);
201
202 int assemblyFlowRate(int dim,
203 double &flowRateParabolic,
204 std::string FEType,
205 int dofs,
206 int inflowFlag,
207 MultiVectorPtr_Type solution_rep,
208 int FEloc=0) ;
209
210 void assemblyAverageVelocity(int dim,
211 double &averageVelocity,
212 std::string FEType,
213 int dofs, int flag,
214 MultiVectorPtr_Type solution_rep,
215 int FEloc=0);
216
217 void assemblyPressureMeanValue(int dim, std::string FEType, MultiVectorPtr_Type a);
218
219 // void assemblyAceGenTPM( MatrixPtr_Type &A00,
220 // MatrixPtr_Type &A01,
221 // MatrixPtr_Type &A10,
222 // MatrixPtr_Type &A11,
223 // MultiVectorPtr_Type &F0,
224 // MultiVectorPtr_Type &F1,
225 // MapPtr_Type &mapRepeated1,
226 // MapPtr_Type &mapRepeated2,
227 // ParameterListPtr_Type parameterList,
228 // MultiVectorPtr_Type u_repeatedNewton=Teuchos::null,
229 // MultiVectorPtr_Type p_repeatedNewton=Teuchos::null,
230 // MultiVectorPtr_Type u_repeatedTime=Teuchos::null,
231 // MultiVectorPtr_Type p_repeatedTime=Teuchos::null,
232 // bool update=true,
233 // bool updateHistory=true);
234
235
236 void addFE(DomainConstPtr_Type domain);
237
238 void doSetZeros(double eps = 10*Teuchos::ScalarTraits<SC>::eps());
239
240 void assemblyEmptyMatrix(MatrixPtr_Type &A);
241
242 void applyBTinv(vec3D_dbl_ptr_Type& dPhiIn,
243 vec3D_dbl_Type& dPhiOut,
244 SmallMatrix<SC>& Binv);
245
246 void applyBTinv(vec3D_dbl_ptr_Type& dPhiIn,
247 vec3D_dbl_Type& dPhiOut,
248 const SmallMatrix<SC>& Binv);
249
250 void assemblyLaplace(int Dimension,
251 std::string FEType,
252 int degree,
253 MatrixPtr_Type &A,
254 bool callFillComplete = true,
255 int FELocExternal = -1);
256
257 void assemblyMass(int dim,
258 std::string FEType,
259 std::string fieldType,
260 MatrixPtr_Type &A,
261 bool callFillComplete = true);
262
263 // Ueberladung der Assemblierung der Massematrix fuer FSI, da
264 // checkFE sonst auch fuer das Strukturproblem FEloc = 1 liefert (= Fluid)
265 // und somit die welche domain und Map in der Assemblierung genutzt wird.
266 void assemblyMass(int dim,
267 std::string FEType,
268 std::string fieldType,
269 MatrixPtr_Type &A,
270 int FEloc,
271 bool callFillComplete = true);
272
273 void assemblyLaplaceVecField(int dim,
274 std::string FEType,
275 int degree,
276 MatrixPtr_Type &A,
277 bool callFillComplete = true);
278
279 void assemblyLaplaceVecFieldV2(int dim,
280 std::string FEType,
281 int degree,
282 MatrixPtr_Type &A,
283 bool callFillComplete = true);
284
286 int dim, std::string FEType, int degree, MultiVectorPtr_Type u_rep,
287 BlockMatrixPtr_Type &A, BlockMultiVectorPtr_Type &resVec,
288 ParameterListPtr_Type params, std::string assembleMode,
289 bool callFillComplete = true, int FELocExternal = -1);
290
291 // // Assembling the reaction term of the reaction diffusion equation. Maybe add default function.
292 // void assemblyLinearReactionTerm(int dim,
293 // std::string FEType,
294 // MatrixPtr_Type &A,
295 // bool callFillComplete,
296 // std::vector<SC>& funcParameter,
297 // RhsFunc_Type reactionFunc);
298
299 // // Assembling the reaction term of the reaction diffusion equation. Maybe add default function.
300 // void assemblyReactionTerm(int dim,
301 // std::string FEType,
302 // MatrixPtr_Type &A,
303 // MultiVectorPtr_Type u,
304 // bool callFillComplete,
305 // std::vector<SC>& funcParameter,
306 // RhsFunc_Type reactionFunc);
307
308 // // Assembling the reaction term of the reaction diffusion equation. Maybe add default function.
309 // void assemblyDReactionTerm(int dim,
310 // std::string FEType,
311 // MatrixPtr_Type &A,
312 // MultiVectorPtr_Type u,
313 // bool callFillComplete,
314 // std::vector<SC>& funcParameter,
315 // RhsFunc_Type reactionFunc);
316
318 std::string FEType,
319 MatrixPtr_Type &A,
320 MultiVectorPtr_Type eModVec,
321 double nu,
322 bool callFillComplete=true);
323
324 void determineEMod(std::string FEType,
325 MultiVectorPtr_Type solution,
326 MultiVectorPtr_Type &eModVec,
327 DomainConstPtr_Type domain,
328 ParameterListPtr_Type params);
329 void assemblyLaplaceDiffusion(int Dimension,
330 std::string FEType,
331 int degree,
332 MatrixPtr_Type &A,
333 vec2D_dbl_Type diffusionTensor,
334 bool callFillComplete = true,
335 int FELocExternal = -1);
336
337 void assemblyElasticityJacobianAndStressAceFEM(int dim,
338 std::string FEType,
339 MatrixPtr_Type &A,
340 MultiVectorPtr_Type &f,
341 MultiVectorPtr_Type u,
342 ParameterListPtr_Type pList,
343 double C,
344 bool callFillComplete=true);
345
346 void assemblyElasticityJacobianAceFEM(int dim,
347 std::string FEType,
348 MatrixPtr_Type &A,
349 MultiVectorPtr_Type u,
350 std::string material_model,
351 double E,
352 double nu,
353 double C,
354 bool callFillComplete=true);
355
356 void assemblyElasticityStressesAceFEM(int dim,
357 std::string FEType,
358 MultiVectorPtr_Type &f,
359 MultiVectorPtr_Type u,
360 std::string material_model,
361 double E,
362 double nu,
363 double C,
364 bool callFillComplete=true);
365
367 std::string FEType,
368 MatrixPtr_Type &A,
369 MultiVectorPtr_Type u,
370 bool callFillComplete);
371
373 std::string FEType,
374 MatrixPtr_Type &A,
375 MultiVectorPtr_Type u,
376 bool callFillComplete);
377
379 std::string FEType,
380 std::string FETypeV,
381 MatrixPtr_Type &A,
382 MultiVectorPtr_Type u,
383 bool callFillComplete);
384
385 void assemblyDivAndDivT( int dim,
386 std::string FEType1,
387 std::string FEType2,
388 int degree,
389 MatrixPtr_Type &Bmat,
390 MatrixPtr_Type &BTmat,
391 MapConstPtr_Type map1,
392 MapConstPtr_Type map2,
393 bool callFillComplete = true);
394
396 std::string FEType1,
397 std::string FEType2,
398 int degree,
399 MatrixPtr_Type &Bmat,
400 MatrixPtr_Type &BTmat,
401 MapConstPtr_Type map1,
402 MapConstPtr_Type map2,
403 bool callFillComplete = true);
404
405
408 std::string FEType,
409 MatrixPtr_Type &A,
410 bool callFillComplete = true);
411
415 std::string FEType,
416 MatrixPtr_Type &A,
417 CoeffFuncDbl_Type func,
418 double* parameters,
419 bool callFillComplete = true);
420
422 void assemblyStress(int dim,
423 std::string FEType,
424 MatrixPtr_Type &A,
425 CoeffFunc_Type func,
426 int* parameters,
427 bool callFillComplete = true);
428
432 std::string FEType,
433 MatrixPtr_Type &A,
434 double lambda,
435 double mu,
436 bool callFillComplete = true);
437
445 std::string FEType,
446 MatrixPtr_Type &A,
447 MultiVectorPtr_Type w,
448 bool callFillComplete = true);
449
450 // Das ist Assemblierungsroutine fuer die Kopplungsbloecke C1, C2 und C3 und deren Transponierte.
451 // Die entsprechende Skalierung wird hinterher in dem Problem gemacht. Hier wird die entsprechende
452 // Einheitsmatrix (auf den Interfaceknoten) gesetzt.
453 void assemblyFSICoupling(int dim,
454 std::string FEType,
455 MatrixPtr_Type &C,
456 MatrixPtr_Type &C_T,
457 int FEloc1, // 0 = Fluid, 2 = Struktur
458 int FEloc2,
459 MapConstPtr_Type map1, // DomainMap: InterfaceMapVecFieldUnique = Spalten von C_T
460 MapConstPtr_Type map2, // RangeMap: this->getDomain(0)->getMapVecFieldUnique() = Zeilen von C_T
461 bool callFillComplete = true);
462
463 void assemblyDummyCoupling( int dim,
464 std::string FEType,
465 MatrixPtr_Type &C,
466 int FEloc, // 0 = Fluid, 2 = Struktur
467 bool callFillComplete);
468
469
470 // Das ist Assemblierungsroutine fuer den Kopplungsblock C4, der
471 // Geometrie und Struktur koppelt. Ist nur bei geometrisch implizit von Noeten.
472 void assemblyGeometryCoupling(int dim,
473 std::string FEType,
474 MatrixPtr_Type &C,
475 int FEloc, // wie oben. Allerdings 4 = Geometrie (= 0)
476 MapConstPtr_Type map1, // Fluid-Interface-Map
477 MapConstPtr_Type map2, // DomainMap: this->getDomain(2)->getMapVecFieldUnique() = Spalten von C
478 MapConstPtr_Type map3, // RangeMap: this->getDomain(4)->getMapVecFieldUnique() = Zeilen von C
479 bool callFillComplete = true);
480
481 // Shape-Derivatives fuer die Geschwindigkeit; die Hauptvariable ist \delta d und Testfunktion ist v:
482 // Spannung 1: DK1 = - \mu \int [ \grad(u) \grad(\delta d) + [\grad(\delta d)]^T [\grad(u)]^T ] : \grad(v) d\Omega
483 // Spannung 2: DK2 = \int [ \sigma \eta ] : \grad(v) d\Omega
484 // mit \sigma = \mu ( \grad(u) + [\grad(u)]^T ) - pI und \eta = I (\nabla \cdot \delta d) - [\grad(\delta d)]^T.
485 // Konvektion: DN = \rho \int (u - w)^T \eta [\grad(u)]^T v d\Omega
486 // Impliziter Anteil der Konvektion: DW = - \rho \frac{1}{k} \int (\delta d \cdot \nabla) u v d\Omega
487 // aehnlich zur Newton-Matrix W aus Navier-Stokes, wobei k = dt = Zeitschrittweite
488 // Zusaetzlicher Term wg. non-conservatie: DP = - \rho \int ( \grad(w) : \eta ) u \cdot v d\Omega
489 // Massematrix und impliziter Anteil wg. non-conservative:
490 // DM = \rho \frac{1.5}{k} \int (\nabla \cdot \delta d) u \cdot v d\Omega (Massematrix aus BDF2)
491 // - \rho \frac{1}{k} \int (\nabla \cdot \delta d) u \cdot v d\Omega
492 // = \rho \frac{0.5}{k} \int (\nabla \cdot \delta d) u \cdot v d\Omega
493 // ACHTUNG: Der erste Koeffizient \frac{1.5}{k} ist durch den fuehrenden Koeffizienten
494 // bei der BDF2-Zeitintegration nach Normierung gegeben (bei BDF2 also 3/2 = 1.5).
495 void assemblyShapeDerivativeVelocity(int dim,
496 std::string FEType1,
497 std::string FEType2,
498 MatrixPtr_Type &D,
499 int FEloc, // 4 = Fluid (Velocity)
500 MultiVectorPtr_Type u, // Geschwindigkeit
501 MultiVectorPtr_Type w, // Beschleunigung Gitter
502 MultiVectorPtr_Type p, // Druck
503 double dt, // Zeitschrittweite
504 double rho, // Dichte vom Fluid
505 double nu, // Viskositaet vom Fluid
506 bool callFillComplete = true);
507
508
509 // Shape-Derivatives fuer Div-Nebenbedingung; Hauptvariable ist \delta d und Testfunktion ist q:
510 // Divergenz: DB = - \int q \grad(u) : \eta d\Omega
511 void assemblyShapeDerivativeDivergence(int dim,
512 std::string FEType1,
513 std::string FEType2,
514 MatrixPtr_Type &DB,
515 int FEloc1, // 1 = Fluid-Pressure
516 int FEloc2, // 4 = Fluid-Velocity
517 MapConstPtr_Type map1_unique, // Pressure-Map
518 MapConstPtr_Type map2_unique, // Velocity-Map unique als VecField
519 MultiVectorPtr_Type u, // Geschwindigkeit
520 bool callFillComplete = true);
521
522
523 void assemblyRHS(int dim,
524 std::string FEType,
525 MultiVectorPtr_Type a,
526 std::string fieldType,
527 RhsFunc_Type func,
528 std::vector<SC>& funcParameter
529 );
530
531 void assemblyRHSDegTest( int dim,
532 std::string FEType,
533 MultiVectorPtr_Type a,
534 std::string fieldType,
535 RhsFunc_Type func,
536 std::vector<SC>& funcParameter,
537 int degree) ;
538
539 void buildFullDPhi(vec3D_dbl_ptr_Type dPhi, Teuchos::Array<SmallMatrix<double> >& dPhiMat);
540
541 void fillMatrixArray(SmallMatrix<double> &matIn, double* matArrayOut, std::string order, int offset=0);
542
543 void epsilonTensor(vec_dbl_Type &basisValues, SmallMatrix<SC> &epsilonValues, int activeDof);
544
546 std::string FETypeVelocity,
547 std::string FETypePressure,
548 int degree,
549 int dofsVelocity,
550 int dofsPressure,
551 MultiVectorPtr_Type u_rep,
552 MultiVectorPtr_Type p_rep,
553 BlockMatrixPtr_Type &A,
554 BlockMultiVectorPtr_Type &resVec,
555 SmallMatrix_Type coeff,
556 ParameterListPtr_Type params,
557 bool reAssemble,
558 std::string assembleMode,
559 bool callFillComplete = true,
560 int FELocExternal=-1);
561
563 std::string FEType,
564 int degree,
565 int dofs,
566 BlockMatrixPtr_Type &A,
567 bool callFillComplete,
568 int FELocExternal=-1);
569
571 std::string FETypeChem,
572 std::string FETypeSolid,
573 int degree,
574 int dofsChem,
575 int dofsSolid,
576 MultiVectorPtr_Type c_rep,
577 MultiVectorPtr_Type d_rep,
578 BlockMatrixPtr_Type &A,
579 BlockMultiVectorPtr_Type &resVec,
580 ParameterListPtr_Type params,
581 std::string assembleMode,
582 bool callFillComplete = true,
583 int FELocExternal=-1);
584
586 std::string FETypeChem,
587 std::string FETypeSolid,
588 int degree,
589 int dofsChem,
590 int dofsSolid,
591 MultiVectorPtr_Type c_rep,
592 MultiVectorPtr_Type d_rep,
593 BlockMatrixPtr_Type &A,
594 int blockRow,
595 int blockCol,
596 BlockMultiVectorPtr_Type &resVec,
597 int block,
598 ParameterListPtr_Type params,
599 std::string assembleMode,
600 bool callFillComplete = true,
601 int FELocExternal=-1);
602
603 void advanceInTimeAssemblyFEElements(double dt ,MultiVectorPtr_Type d_rep , MultiVectorPtr_Type c_rep)
604 {
605 //UN FElocChem = 1; //checkFE(dim,FETypeChem); // Checks for different domains which belongs to a certain fetype
606 UN FElocSolid = 0; //checkFE(dim,FETypeSolid); // Checks for different domains which belongs to a certain fetype
607
608 //ElementsPtr_Type elementsChem= domainVec_.at(FElocChem)->getElementsC();
609
610 ElementsPtr_Type elementsSolid = domainVec_.at(FElocSolid)->getElementsC();
611
612 vec_dbl_Type solution_c;
613 vec_dbl_Type solution_d;
614 for (UN T=0; T<assemblyFEElements_.size(); T++) {
615 vec_dbl_Type solution(0);
616
617 solution_c = getSolution(elementsSolid->getElement(T).getVectorNodeList(), c_rep,1);
618 solution_d = getSolution(elementsSolid->getElement(T).getVectorNodeList(), d_rep,3);
619 // First Solid, then Chemistry
620 solution.insert( solution.end(), solution_d.begin(), solution_d.end() );
621 solution.insert( solution.end(), solution_c.begin(), solution_c.end() );
622
623 assemblyFEElements_[T]->updateSolution(solution);
624
625 assemblyFEElements_[T]->advanceInTime(dt);
626 }
627
628 }
629
631 std::string FEType,
632 int degree,
633 int dofs,
634 MultiVectorPtr_Type d_rep,
635 BlockMatrixPtr_Type &A,
636 BlockMultiVectorPtr_Type &resVec,
637 ParameterListPtr_Type params,
638 bool reAssemble,
639 std::string assembleMode,
640 bool callFillComplete=true,
641 int FELocExternal=-1);
642
644 std::string FEType,
645 int degree,
646 int dofs,
647 MultiVectorPtr_Type d_rep,
648 BlockMatrixPtr_Type &A,
649 BlockMultiVectorPtr_Type &resVec,
650 ParameterListPtr_Type params,
651 bool callFillComplete=true,
652 int FELocExternal=-1);
653
655 std::string FEType,
656 int degree,
657 int dofs,
658 MultiVectorPtr_Type d_rep,
659 BlockMatrixPtr_Type &A,
660 BlockMultiVectorPtr_Type &resVec,
661 ParameterListPtr_Type params,
662 DomainConstPtr_Type domain,
663 MultiVectorPtr_Type eModVec,
664 bool callFillComplete = true,
665 int FELocExternal=-1);
666
667 void checkMeshOrientation(int dim, std::string FEType);
668
669 /* Given a converged velocity solution this function
670 computes the averaged viscosity estimate in each cell at the center of mass
671 - CM stands for center of mass so the values at the node are averaged to obtain one value
672 */
674 std::string FETypeVelocity,
675 std::string FETypePressure,
676 int dofsVelocity,
677 int dofsPressure,
678 MultiVectorPtr_Type u_rep,
679 MultiVectorPtr_Type p_rep,
680 ParameterListPtr_Type params);
681
682 // Change for all assembleFEElements the linearization type to the specified ones
683 void changeLinearizationFE(std::string linearization);
684
685 // Write prostprocessing output fields like e.g. the viscosity based on velocity, pressure .. solution
686 // inside this BMV -> For visualization or postprocessing
687 BlockMultiVectorPtr_Type const_output_fields;
688
689
690
691
692/* ----------------------------------------------------------------------------------------*/
693private:
694 void addFeBlockMatrix(BlockMatrixPtr_Type &A, SmallMatrixPtr_Type elementMatrix, FiniteElement element1,FiniteElement element2, MapConstPtr_Type mapFirstColumn,MapConstPtr_Type mapSecondColumn, tuple_disk_vec_ptr_Type problemDisk);
695
696 void addFeBlock(BlockMatrixPtr_Type &A, SmallMatrixPtr_Type elementMatrix, FiniteElement element, MapConstPtr_Type mapFirstRow, int row, int column, tuple_disk_vec_ptr_Type problemDisk);
697
698 void initAssembleFEElements(std::string elementType, tuple_disk_vec_ptr_Type problemDisk, ElementsPtr_Type elements, ParameterListPtr_Type params, vec2D_dbl_ptr_Type pointsRep, MapConstPtr_Type elementMap);
699
700 void addFeBlockMv(BlockMultiVectorPtr_Type &res, vec_dbl_ptr_Type rhsVec, FiniteElement elementBlock1,FiniteElement elementBlock2, int dofs1, int dofs2 );
701
702 void addFeBlockMv(BlockMultiVectorPtr_Type &res, vec_dbl_ptr_Type rhsVec, FiniteElement elementBlock, int dofs);
703
704 void computeSurfaceNormal(int dim,vec2D_dbl_ptr_Type pointsRep,vec_int_Type nodeList,vec_dbl_Type &v_E, double &norm_v_E);
705
706
707 AssembleFEPtr_vec_Type assemblyFEElements_;
708
709 vec2D_dbl_Type getCoordinates(vec_LO_Type localIDs, vec2D_dbl_ptr_Type points);
710 vec_dbl_Type getSolution(vec_LO_Type localIDs, MultiVectorPtr_Type u_rep, int dofsVelocity);
711
712 //Start of AceGen code
721 void nh3d(double* v, double (*E), double (*Nu), double** F , double** Pmat, double**** Amat);
722
732 void mr3d(double* v, double (*E), double (*Nu), double (*C), double** F, double** Pmat, double**** Amat);
733
742 void stvk3d(double* v,double (*lam),double (*mue),double** F,double** Pmat,double**** Amat);
743
752 void stvk2d(double* v, double (*lam),double (*mue),double** F ,double** Pmat,double**** Amat);
753
754 // void SMTSetElSpecBiot(ElementSpec *es,int *idata/*not needed*/,int ic,int ng, vec_dbl_Type& paraVec);
755
756 // void SMTSetElSpecBiotStVK(ElementSpec *es,int *idata/*not needed*/,int ic,int ng, vec_dbl_Type& paraVec);
757
758 // void SMTSetElSpecBiot3D(ElementSpec *es,int *idata/*not needed*/,int ic,int ng, vec_dbl_Type& paraVec);
759
760 // void SKR_Biot(double* v,ElementSpec *es,ElementData *ed, NodeSpec **ns, NodeData **nd,double *rdata,int *idata,double *p,double **s);
761
762 // void SKR_Biot_StVK(double* v,ElementSpec *es,ElementData *ed, NodeSpec **ns, NodeData **nd,double *rdata,int *idata,double *p,double **s);
763
764 // void SKR_Biot3D(double* v,ElementSpec *es,ElementData *ed, NodeSpec **ns, NodeData **nd,double *rdata,int *idata,double *p,double **s);
765
766 //End of AceGen code
767
768 void buildTransformation(const vec_int_Type& element,
769 vec2D_dbl_ptr_Type pointsRep,
771 std::string FEType="P");
772
773 void buildTransformation(const vec_int_Type& element,
774 vec2D_dbl_ptr_Type pointsRep,
776 vec_dbl_Type& b,
777 std::string FEType="P");
778
779
780 void buildTransformationSurface(const vec_int_Type& element,
781 vec2D_dbl_ptr_Type pointsRep,
783 vec_dbl_Type& b,
784 std::string FEType="P");
785
786 void applyDiff(vec3D_dbl_Type& dPhiIn,
787 vec3D_dbl_Type& dPhiOut,
788 SmallMatrix<SC>& diffT);
789
790
791 void phi( int Dimension,
792 int intFE,
793 int i,
794 vec_dbl_Type &QuadPts,
795 double* value);
796
797
798 void gradPhi( int Dimension,
799 int intFE,
800 int i,
801 vec_dbl_Type &QuadPts,
802 vec_dbl_ptr_Type &value);
803
805 void getQuadratureValues(int Dimension,
806 int Degree,
807 vec2D_dbl_ptr_Type &QuadPts,
808 vec_dbl_ptr_Type &QuadW,
809 std::string FEType);
810
811 int getPhi( vec2D_dbl_ptr_Type &Phi,
812 vec_dbl_ptr_Type &weightsPhi,
813 int Dimension,
814 std::string FEType,
815 int Degree,
816 std::string FETypeQuadPoints="");
817
818 int getPhiGlobal(vec2D_dbl_ptr_Type &Phi,
819 vec_dbl_ptr_Type &weightsPhi,
820 int Dimension,
821 std::string FEType,
822 int Degree);
823
824 int getDPhi( vec3D_dbl_ptr_Type &DPhi,
825 vec_dbl_ptr_Type &weightsDPhi,
826 int Dimension,
827 std::string FEType,
828 int Degree);
829
830 int checkFE(int Dimension,
831 std::string FEType);
832
833
834 bool setZeros_;
835 SC myeps_;
836 std::vector<Teuchos::RCP<DataElement> > ed_;
837 bool saveAssembly_;
838};
839}
840#endif
Definition AssembleFEGeneralizedNewtonian_decl.hpp:21
Definition AssembleFENavierStokes_decl.hpp:13
Definition AssembleFE_SCI_SMC_Active_Growth_Reorientation_decl.hpp:29
This abstract class defining the interface for any type of element assembly rountines in the FEDDLib.
Definition AssembleFE_decl.hpp:61
Definition BlockMatrix_decl.hpp:25
Definition BlockMultiVector_decl.hpp:25
Definition Domain_decl.hpp:20
Definition Elements.hpp:23
void assemblyNonlinearSurfaceIntegralExternal(int dim, std::string FEType, MultiVectorPtr_Type f, MultiVectorPtr_Type d_rep, MatrixPtr_Type &Kext, std::vector< SC > &funcParameter, RhsFunc_Type func, ParameterListPtr_Type params, int FEloc=0)
assemblyNonlinearSurfaceIntegralExternal -
Definition FE_def.hpp:8184
void assemblyAdvectionVecFieldScalar(int dim, std::string FEType, std::string FETypeV, MatrixPtr_Type &A, MultiVectorPtr_Type u, bool callFillComplete)
Assembly of operator \int ((u_h \cdot \nabla ) p_h)p_h dx.
Definition FE_def.hpp:3895
void assemblyDivAndDivT(int dim, std::string FEType1, std::string FEType2, int degree, MatrixPtr_Type &Bmat, MatrixPtr_Type &BTmat, MapConstPtr_Type map1, MapConstPtr_Type map2, bool callFillComplete=true)
Assembly of \int q_h (nabla \cdot v_h) dx.
Definition FE_def.hpp:3982
void assemblyStress(int dim, std::string FEType, MatrixPtr_Type &A, CoeffFunc_Type func, int *parameters, bool callFillComplete=true)
(\grad u + (\grad u)^T, \grad v ); symmetrischer Gradient, wenn func = 1.0
Definition FE_def.hpp:4471
void changeLinearizationFE(std::string linearization)
Method to loop over all assembleFESpecific elements and set the defined linearization.
Definition FE_def.hpp:1246
void assemblyAceDeformDiffuBlock(int dim, std::string FETypeChem, std::string FETypeSolid, int degree, int dofsChem, int dofsSolid, MultiVectorPtr_Type c_rep, MultiVectorPtr_Type d_rep, BlockMatrixPtr_Type &A, int blockRow, int blockCol, BlockMultiVectorPtr_Type &resVec, int block, ParameterListPtr_Type params, std::string assembleMode, bool callFillComplete=true, int FELocExternal=-1)
Definition FE_def.hpp:822
void assemblyNonLinearElasticity(int dim, std::string FEType, int degree, int dofs, MultiVectorPtr_Type d_rep, BlockMatrixPtr_Type &A, BlockMultiVectorPtr_Type &resVec, ParameterListPtr_Type params, bool callFillComplete=true, int FELocExternal=-1)
Assembly of Jacobian for nonlinear Elasticity.
Definition FE_def.hpp:449
void assemblyLinearElasticity(int dim, std::string FEType, int degree, int dofs, MultiVectorPtr_Type d_rep, BlockMatrixPtr_Type &A, BlockMultiVectorPtr_Type &resVec, ParameterListPtr_Type params, bool reAssemble, std::string assembleMode, bool callFillComplete=true, int FELocExternal=-1)
Assembly of Jacobian.
Definition FE_def.hpp:362
void assemblyBDStabilization(int dim, std::string FEType, MatrixPtr_Type &A, bool callFillComplete=true)
Bochev- Dohrmann Stabilization.
Definition FE_def.hpp:4206
void assemblyNonLinearElasticity(int dim, std::string FEType, int degree, int dofs, MultiVectorPtr_Type d_rep, BlockMatrixPtr_Type &A, BlockMultiVectorPtr_Type &resVec, ParameterListPtr_Type params, DomainConstPtr_Type domain, MultiVectorPtr_Type eModVec, bool callFillComplete=true, int FELocExternal=-1)
Assembly of Jacobian for nonlinear Elasticity.
Definition FE_def.hpp:538
void assemblyDivAndDivTFast(int dim, std::string FEType1, std::string FEType2, int degree, MatrixPtr_Type &Bmat, MatrixPtr_Type &BTmat, MapConstPtr_Type map1, MapConstPtr_Type map2, bool callFillComplete=true)
Assembly of \int q_h (nabla \cdot v_h) dx.
Definition FE_def.hpp:4112
void assemblyLaplaceXDim(int dim, std::string FEType, MatrixPtr_Type &A, CoeffFuncDbl_Type func, double *parameters, bool callFillComplete=true)
Definition FE_def.hpp:4289
void assemblyAdvectionVecField(int dim, std::string FEType, MatrixPtr_Type &A, MultiVectorPtr_Type u, bool callFillComplete)
Assembly of operator \int ((u_h \cdot \nabla ) v_h)v_h dx.
Definition FE_def.hpp:3710
void assemblyAdvectionInUVecField(int dim, std::string FEType, MatrixPtr_Type &A, MultiVectorPtr_Type u, bool callFillComplete)
Assembly of operator \int ((v_h \cdot \nabla ) u_h)v_h dx.
Definition FE_def.hpp:3804
void computeSteadyViscosityFE_CM(int dim, std::string FETypeVelocity, std::string FETypePressure, int dofsVelocity, int dofsPressure, MultiVectorPtr_Type u_rep, MultiVectorPtr_Type p_rep, ParameterListPtr_Type params)
Postprocessing: Using a converged velocity solution -> compute averaged viscosity inside an element a...
Definition FE_def.hpp:1266
void assemblyLinElasXDimE(int dim, std::string FEType, MatrixPtr_Type &A, MultiVectorPtr_Type eModVec, double nu, bool callFillComplete=true)
Same as assemblyLinElasXDim except for changing E Module Value.
Definition FE_def.hpp:6320
void assemblyNonlinearLaplace(int dim, std::string FEType, int degree, MultiVectorPtr_Type u_rep, BlockMatrixPtr_Type &A, BlockMultiVectorPtr_Type &resVec, ParameterListPtr_Type params, std::string assembleMode, bool callFillComplete=true, int FELocExternal=-1)
Assembly of Jacobian for nonlinear Laplace example.
Definition FE_def.hpp:2749
void assemblyAdditionalConvection(int dim, std::string FEType, MatrixPtr_Type &A, MultiVectorPtr_Type w, bool callFillComplete=true)
Addional Matrix due to ALE derivation: \int \rho_f div(w) u_h \cdot v_f dx, with mesh velocity w.
Definition FE_def.hpp:6632
void assemblyNavierStokes(int dim, std::string FETypeVelocity, std::string FETypePressure, int degree, int dofsVelocity, int dofsPressure, MultiVectorPtr_Type u_rep, MultiVectorPtr_Type p_rep, BlockMatrixPtr_Type &A, BlockMultiVectorPtr_Type &resVec, SmallMatrix_Type coeff, ParameterListPtr_Type params, bool reAssemble, std::string assembleMode, bool callFillComplete=true, int FELocExternal=-1)
Assembly of Jacobian for NavierStokes.
Definition FE_def.hpp:1078
void assemblyLaplaceAssFE(int dim, std::string FEType, int degree, int dofs, BlockMatrixPtr_Type &A, bool callFillComplete, int FELocExternal=-1)
Assembly of constant stiffness matix for laplacian operator .
Definition FE_def.hpp:1877
void assemblyLinElasXDim(int dim, std::string FEType, MatrixPtr_Type &A, double lambda, double mu, bool callFillComplete=true)
Definition FE_def.hpp:5965
void assemblyAceDeformDiffu(int dim, std::string FETypeChem, std::string FETypeSolid, int degree, int dofsChem, int dofsSolid, MultiVectorPtr_Type c_rep, MultiVectorPtr_Type d_rep, BlockMatrixPtr_Type &A, BlockMultiVectorPtr_Type &resVec, ParameterListPtr_Type params, std::string assembleMode, bool callFillComplete=true, int FELocExternal=-1)
Definition FE_def.hpp:644
void assemblyPressureMeanValue(int dim, std::string FEType, MultiVectorPtr_Type a)
Assembling \int p \dx = 0. Thus, we need the integral part for the mean pressure value.
Definition FE_def.hpp:8649
Definition FiniteElement.hpp:17
Definition Matrix_decl.hpp:30
Definition MeshUnstructured_decl.hpp:33
Definition MultiVector_decl.hpp:61
This class represents a templated small Matrix of type T. Primarily created for 2x2 and 3x3 matrices....
Definition SmallMatrix.hpp:20
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement_decl.hpp:36