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_decl.hpp"
16#include "feddlib/core/AceFemAssembly/specific/AssembleFENavierStokes_decl.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 // void assemblyAceGenTPM( MatrixPtr_Type &A00,
156 // MatrixPtr_Type &A01,
157 // MatrixPtr_Type &A10,
158 // MatrixPtr_Type &A11,
159 // MultiVectorPtr_Type &F0,
160 // MultiVectorPtr_Type &F1,
161 // MapPtr_Type &mapRepeated1,
162 // MapPtr_Type &mapRepeated2,
163 // ParameterListPtr_Type parameterList,
164 // MultiVectorPtr_Type u_repeatedNewton=Teuchos::null,
165 // MultiVectorPtr_Type p_repeatedNewton=Teuchos::null,
166 // MultiVectorPtr_Type u_repeatedTime=Teuchos::null,
167 // MultiVectorPtr_Type p_repeatedTime=Teuchos::null,
168 // bool update=true,
169 // bool updateHistory=true);
170
171
172 void addFE(DomainConstPtr_Type domain);
173
174 void doSetZeros(double eps = 10*Teuchos::ScalarTraits<SC>::eps());
175
176 void assemblyEmptyMatrix(MatrixPtr_Type &A);
177
178 void applyBTinv(vec3D_dbl_ptr_Type& dPhiIn,
179 vec3D_dbl_Type& dPhiOut,
180 SmallMatrix<SC>& Binv);
181
182 void applyBTinv(vec3D_dbl_ptr_Type& dPhiIn,
183 vec3D_dbl_Type& dPhiOut,
184 const SmallMatrix<SC>& Binv);
185
186 void assemblyLaplace(int Dimension,
187 std::string FEType,
188 int degree,
189 MatrixPtr_Type &A,
190 bool callFillComplete = true,
191 int FELocExternal = -1);
192
193 void assemblyMass(int dim,
194 std::string FEType,
195 std::string fieldType,
196 MatrixPtr_Type &A,
197 bool callFillComplete = true);
198
199 // Ueberladung der Assemblierung der Massematrix fuer FSI, da
200 // checkFE sonst auch fuer das Strukturproblem FEloc = 1 liefert (= Fluid)
201 // und somit die welche domain und Map in der Assemblierung genutzt wird.
202 void assemblyMass(int dim,
203 std::string FEType,
204 std::string fieldType,
205 MatrixPtr_Type &A,
206 int FEloc,
207 bool callFillComplete = true);
208
209 void assemblyLaplaceVecField(int dim,
210 std::string FEType,
211 int degree,
212 MatrixPtr_Type &A,
213 bool callFillComplete = true);
214
215 void assemblyLaplaceVecFieldV2(int dim,
216 std::string FEType,
217 int degree,
218 MatrixPtr_Type &A,
219 bool callFillComplete = true);
220
222 int dim, std::string FEType, int degree, MultiVectorPtr_Type u_rep,
223 BlockMatrixPtr_Type &A, BlockMultiVectorPtr_Type &resVec,
224 ParameterListPtr_Type params, std::string assembleMode,
225 bool callFillComplete = true, int FELocExternal = -1);
226
227 // // Assembling the reaction term of the reaction diffusion equation. Maybe add default function.
228 // void assemblyLinearReactionTerm(int dim,
229 // std::string FEType,
230 // MatrixPtr_Type &A,
231 // bool callFillComplete,
232 // std::vector<SC>& funcParameter,
233 // RhsFunc_Type reactionFunc);
234
235 // // Assembling the reaction term of the reaction diffusion equation. Maybe add default function.
236 // void assemblyReactionTerm(int dim,
237 // std::string FEType,
238 // MatrixPtr_Type &A,
239 // MultiVectorPtr_Type u,
240 // bool callFillComplete,
241 // std::vector<SC>& funcParameter,
242 // RhsFunc_Type reactionFunc);
243
244 // // Assembling the reaction term of the reaction diffusion equation. Maybe add default function.
245 // void assemblyDReactionTerm(int dim,
246 // std::string FEType,
247 // MatrixPtr_Type &A,
248 // MultiVectorPtr_Type u,
249 // bool callFillComplete,
250 // std::vector<SC>& funcParameter,
251 // RhsFunc_Type reactionFunc);
252
254 std::string FEType,
255 MatrixPtr_Type &A,
256 MultiVectorPtr_Type eModVec,
257 double nu,
258 bool callFillComplete=true);
259
260 void determineEMod(std::string FEType,
261 MultiVectorPtr_Type solution,
262 MultiVectorPtr_Type &eModVec,
263 DomainConstPtr_Type domain,
264 ParameterListPtr_Type params);
265 void assemblyLaplaceDiffusion(int Dimension,
266 std::string FEType,
267 int degree,
268 MatrixPtr_Type &A,
269 vec2D_dbl_Type diffusionTensor,
270 bool callFillComplete = true,
271 int FELocExternal = -1);
272
273 void assemblyElasticityJacobianAndStressAceFEM(int dim,
274 std::string FEType,
275 MatrixPtr_Type &A,
276 MultiVectorPtr_Type &f,
277 MultiVectorPtr_Type u,
278 ParameterListPtr_Type pList,
279 double C,
280 bool callFillComplete=true);
281
282 void assemblyElasticityJacobianAceFEM(int dim,
283 std::string FEType,
284 MatrixPtr_Type &A,
285 MultiVectorPtr_Type u,
286 std::string material_model,
287 double E,
288 double nu,
289 double C,
290 bool callFillComplete=true);
291
292 void assemblyElasticityStressesAceFEM(int dim,
293 std::string FEType,
294 MultiVectorPtr_Type &f,
295 MultiVectorPtr_Type u,
296 std::string material_model,
297 double E,
298 double nu,
299 double C,
300 bool callFillComplete=true);
301
303 std::string FEType,
304 MatrixPtr_Type &A,
305 MultiVectorPtr_Type u,
306 bool callFillComplete);
307
309 std::string FEType,
310 MatrixPtr_Type &A,
311 MultiVectorPtr_Type u,
312 bool callFillComplete);
313
315 std::string FEType,
316 std::string FETypeV,
317 MatrixPtr_Type &A,
318 MultiVectorPtr_Type u,
319 bool callFillComplete);
320
321 void assemblyDivAndDivT( int dim,
322 std::string FEType1,
323 std::string FEType2,
324 int degree,
325 MatrixPtr_Type &Bmat,
326 MatrixPtr_Type &BTmat,
327 MapConstPtr_Type map1,
328 MapConstPtr_Type map2,
329 bool callFillComplete = true);
330
332 std::string FEType1,
333 std::string FEType2,
334 int degree,
335 MatrixPtr_Type &Bmat,
336 MatrixPtr_Type &BTmat,
337 MapConstPtr_Type map1,
338 MapConstPtr_Type map2,
339 bool callFillComplete = true);
340
341
344 std::string FEType,
345 MatrixPtr_Type &A,
346 bool callFillComplete = true);
347
351 std::string FEType,
352 MatrixPtr_Type &A,
353 CoeffFuncDbl_Type func,
354 double* parameters,
355 bool callFillComplete = true);
356
358 void assemblyStress(int dim,
359 std::string FEType,
360 MatrixPtr_Type &A,
361 CoeffFunc_Type func,
362 int* parameters,
363 bool callFillComplete = true);
364
368 std::string FEType,
369 MatrixPtr_Type &A,
370 double lambda,
371 double mu,
372 bool callFillComplete = true);
373
381 std::string FEType,
382 MatrixPtr_Type &A,
383 MultiVectorPtr_Type w,
384 bool callFillComplete = true);
385
386 // Das ist Assemblierungsroutine fuer die Kopplungsbloecke C1, C2 und C3 und deren Transponierte.
387 // Die entsprechende Skalierung wird hinterher in dem Problem gemacht. Hier wird die entsprechende
388 // Einheitsmatrix (auf den Interfaceknoten) gesetzt.
389 void assemblyFSICoupling(int dim,
390 std::string FEType,
391 MatrixPtr_Type &C,
392 MatrixPtr_Type &C_T,
393 int FEloc1, // 0 = Fluid, 2 = Struktur
394 int FEloc2,
395 MapConstPtr_Type map1, // DomainMap: InterfaceMapVecFieldUnique = Spalten von C_T
396 MapConstPtr_Type map2, // RangeMap: this->getDomain(0)->getMapVecFieldUnique() = Zeilen von C_T
397 bool callFillComplete = true);
398
399 void assemblyDummyCoupling( int dim,
400 std::string FEType,
401 MatrixPtr_Type &C,
402 int FEloc, // 0 = Fluid, 2 = Struktur
403 bool callFillComplete);
404
405
406 // Das ist Assemblierungsroutine fuer den Kopplungsblock C4, der
407 // Geometrie und Struktur koppelt. Ist nur bei geometrisch implizit von Noeten.
408 void assemblyGeometryCoupling(int dim,
409 std::string FEType,
410 MatrixPtr_Type &C,
411 int FEloc, // wie oben. Allerdings 4 = Geometrie (= 0)
412 MapConstPtr_Type map1, // Fluid-Interface-Map
413 MapConstPtr_Type map2, // DomainMap: this->getDomain(2)->getMapVecFieldUnique() = Spalten von C
414 MapConstPtr_Type map3, // RangeMap: this->getDomain(4)->getMapVecFieldUnique() = Zeilen von C
415 bool callFillComplete = true);
416
417 // Shape-Derivatives fuer die Geschwindigkeit; die Hauptvariable ist \delta d und Testfunktion ist v:
418 // Spannung 1: DK1 = - \mu \int [ \grad(u) \grad(\delta d) + [\grad(\delta d)]^T [\grad(u)]^T ] : \grad(v) d\Omega
419 // Spannung 2: DK2 = \int [ \sigma \eta ] : \grad(v) d\Omega
420 // mit \sigma = \mu ( \grad(u) + [\grad(u)]^T ) - pI und \eta = I (\nabla \cdot \delta d) - [\grad(\delta d)]^T.
421 // Konvektion: DN = \rho \int (u - w)^T \eta [\grad(u)]^T v d\Omega
422 // Impliziter Anteil der Konvektion: DW = - \rho \frac{1}{k} \int (\delta d \cdot \nabla) u v d\Omega
423 // aehnlich zur Newton-Matrix W aus Navier-Stokes, wobei k = dt = Zeitschrittweite
424 // Zusaetzlicher Term wg. non-conservatie: DP = - \rho \int ( \grad(w) : \eta ) u \cdot v d\Omega
425 // Massematrix und impliziter Anteil wg. non-conservative:
426 // DM = \rho \frac{1.5}{k} \int (\nabla \cdot \delta d) u \cdot v d\Omega (Massematrix aus BDF2)
427 // - \rho \frac{1}{k} \int (\nabla \cdot \delta d) u \cdot v d\Omega
428 // = \rho \frac{0.5}{k} \int (\nabla \cdot \delta d) u \cdot v d\Omega
429 // ACHTUNG: Der erste Koeffizient \frac{1.5}{k} ist durch den fuehrenden Koeffizienten
430 // bei der BDF2-Zeitintegration nach Normierung gegeben (bei BDF2 also 3/2 = 1.5).
431 void assemblyShapeDerivativeVelocity(int dim,
432 std::string FEType1,
433 std::string FEType2,
434 MatrixPtr_Type &D,
435 int FEloc, // 4 = Fluid (Velocity)
436 MultiVectorPtr_Type u, // Geschwindigkeit
437 MultiVectorPtr_Type w, // Beschleunigung Gitter
438 MultiVectorPtr_Type p, // Druck
439 double dt, // Zeitschrittweite
440 double rho, // Dichte vom Fluid
441 double nu, // Viskositaet vom Fluid
442 bool callFillComplete = true);
443
444
445 // Shape-Derivatives fuer Div-Nebenbedingung; Hauptvariable ist \delta d und Testfunktion ist q:
446 // Divergenz: DB = - \int q \grad(u) : \eta d\Omega
447 void assemblyShapeDerivativeDivergence(int dim,
448 std::string FEType1,
449 std::string FEType2,
450 MatrixPtr_Type &DB,
451 int FEloc1, // 1 = Fluid-Pressure
452 int FEloc2, // 4 = Fluid-Velocity
453 MapConstPtr_Type map1_unique, // Pressure-Map
454 MapConstPtr_Type map2_unique, // Velocity-Map unique als VecField
455 MultiVectorPtr_Type u, // Geschwindigkeit
456 bool callFillComplete = true);
457
458
463 void assemblyPressureMeanValue(int dim, std::string FEType, MatrixPtr_Type a, MatrixPtr_Type aT);
464
465 void assemblyRHS(int dim,
466 std::string FEType,
467 MultiVectorPtr_Type a,
468 std::string fieldType,
469 RhsFunc_Type func,
470 std::vector<SC>& funcParameter
471 );
472
473 void assemblyRHSDegTest( int dim,
474 std::string FEType,
475 MultiVectorPtr_Type a,
476 std::string fieldType,
477 RhsFunc_Type func,
478 std::vector<SC>& funcParameter,
479 int degree) ;
480
481 void buildFullDPhi(vec3D_dbl_ptr_Type dPhi, Teuchos::Array<SmallMatrix<double> >& dPhiMat);
482
483 void fillMatrixArray(SmallMatrix<double> &matIn, double* matArrayOut, std::string order, int offset=0);
484
485 void epsilonTensor(vec_dbl_Type &basisValues, SmallMatrix<SC> &epsilonValues, int activeDof);
486
488 std::string FETypeVelocity,
489 std::string FETypePressure,
490 int degree,
491 int dofsVelocity,
492 int dofsPressure,
493 MultiVectorPtr_Type u_rep,
494 MultiVectorPtr_Type p_rep,
495 BlockMatrixPtr_Type &A,
496 BlockMultiVectorPtr_Type &resVec,
497 SmallMatrix_Type coeff,
498 ParameterListPtr_Type params,
499 bool reAssemble,
500 std::string assembleMode,
501 bool callFillComplete = true,
502 int FELocExternal=-1);
503
505 std::string FEType,
506 int degree,
507 int dofs,
508 BlockMatrixPtr_Type &A,
509 bool callFillComplete,
510 int FELocExternal=-1);
511
513 std::string FETypeChem,
514 std::string FETypeSolid,
515 int degree,
516 int dofsChem,
517 int dofsSolid,
518 MultiVectorPtr_Type c_rep,
519 MultiVectorPtr_Type d_rep,
520 BlockMatrixPtr_Type &A,
521 BlockMultiVectorPtr_Type &resVec,
522 ParameterListPtr_Type params,
523 std::string assembleMode,
524 bool callFillComplete = true,
525 int FELocExternal=-1);
526
528 std::string FETypeChem,
529 std::string FETypeSolid,
530 int degree,
531 int dofsChem,
532 int dofsSolid,
533 MultiVectorPtr_Type c_rep,
534 MultiVectorPtr_Type d_rep,
535 BlockMatrixPtr_Type &A,
536 int blockRow,
537 int blockCol,
538 BlockMultiVectorPtr_Type &resVec,
539 int block,
540 ParameterListPtr_Type params,
541 std::string assembleMode,
542 bool callFillComplete = true,
543 int FELocExternal=-1);
544
545 void advanceInTimeAssemblyFEElements(double dt ,MultiVectorPtr_Type d_rep , MultiVectorPtr_Type c_rep)
546 {
547 //UN FElocChem = 1; //checkFE(dim,FETypeChem); // Checks for different domains which belongs to a certain fetype
548 UN FElocSolid = 0; //checkFE(dim,FETypeSolid); // Checks for different domains which belongs to a certain fetype
549
550 //ElementsPtr_Type elementsChem= domainVec_.at(FElocChem)->getElementsC();
551
552 ElementsPtr_Type elementsSolid = domainVec_.at(FElocSolid)->getElementsC();
553
554 vec_dbl_Type solution_c;
555 vec_dbl_Type solution_d;
556 for (UN T=0; T<assemblyFEElements_.size(); T++) {
557 vec_dbl_Type solution(0);
558
559 solution_c = getSolution(elementsSolid->getElement(T).getVectorNodeList(), c_rep,1);
560 solution_d = getSolution(elementsSolid->getElement(T).getVectorNodeList(), d_rep,3);
561 // First Solid, then Chemistry
562 solution.insert( solution.end(), solution_d.begin(), solution_d.end() );
563 solution.insert( solution.end(), solution_c.begin(), solution_c.end() );
564
565 assemblyFEElements_[T]->updateSolution(solution);
566
567 assemblyFEElements_[T]->advanceInTime(dt);
568 }
569
570 }
571
573 std::string FEType,
574 int degree,
575 int dofs,
576 MultiVectorPtr_Type d_rep,
577 BlockMatrixPtr_Type &A,
578 BlockMultiVectorPtr_Type &resVec,
579 ParameterListPtr_Type params,
580 bool reAssemble,
581 std::string assembleMode,
582 bool callFillComplete=true,
583 int FELocExternal=-1);
584
586 std::string FEType,
587 int degree,
588 int dofs,
589 MultiVectorPtr_Type d_rep,
590 BlockMatrixPtr_Type &A,
591 BlockMultiVectorPtr_Type &resVec,
592 ParameterListPtr_Type params,
593 bool callFillComplete=true,
594 int FELocExternal=-1);
595
597 std::string FEType,
598 int degree,
599 int dofs,
600 MultiVectorPtr_Type d_rep,
601 BlockMatrixPtr_Type &A,
602 BlockMultiVectorPtr_Type &resVec,
603 ParameterListPtr_Type params,
604 DomainConstPtr_Type domain,
605 MultiVectorPtr_Type eModVec,
606 bool callFillComplete = true,
607 int FELocExternal=-1);
608
609 void checkMeshOrientation(int dim, std::string FEType);
610
611 /* Given a converged velocity solution this function
612 computes the averaged viscosity estimate in each cell at the center of mass
613 - CM stands for center of mass so the values at the node are averaged to obtain one value
614 */
616 std::string FETypeVelocity,
617 std::string FETypePressure,
618 int dofsVelocity,
619 int dofsPressure,
620 MultiVectorPtr_Type u_rep,
621 MultiVectorPtr_Type p_rep,
622 ParameterListPtr_Type params);
623
624 // Write prostprocessing output fields like e.g. the viscosity based on velocity, pressure .. solution
625 // inside this BMV -> For visualization or postprocessing
626 BlockMultiVectorPtr_Type const_output_fields;
627
628
629/* ----------------------------------------------------------------------------------------*/
630private:
631 void addFeBlockMatrix(BlockMatrixPtr_Type &A, SmallMatrixPtr_Type elementMatrix, FiniteElement element1,FiniteElement element2, MapConstPtr_Type mapFirstColumn,MapConstPtr_Type mapSecondColumn, tuple_disk_vec_ptr_Type problemDisk);
632
633 void addFeBlock(BlockMatrixPtr_Type &A, SmallMatrixPtr_Type elementMatrix, FiniteElement element, MapConstPtr_Type mapFirstRow, int row, int column, tuple_disk_vec_ptr_Type problemDisk);
634
635 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);
636
637 void addFeBlockMv(BlockMultiVectorPtr_Type &res, vec_dbl_ptr_Type rhsVec, FiniteElement elementBlock1,FiniteElement elementBlock2, int dofs1, int dofs2 );
638
639 void addFeBlockMv(BlockMultiVectorPtr_Type &res, vec_dbl_ptr_Type rhsVec, FiniteElement elementBlock, int dofs);
640
641 void computeSurfaceNormal(int dim,vec2D_dbl_ptr_Type pointsRep,vec_int_Type nodeList,vec_dbl_Type &v_E, double &norm_v_E);
642
643
644 AssembleFEPtr_vec_Type assemblyFEElements_;
645
646 vec2D_dbl_Type getCoordinates(vec_LO_Type localIDs, vec2D_dbl_ptr_Type points);
647 vec_dbl_Type getSolution(vec_LO_Type localIDs, MultiVectorPtr_Type u_rep, int dofsVelocity);
648
649 //Start of AceGen code
658 void nh3d(double* v, double (*E), double (*Nu), double** F , double** Pmat, double**** Amat);
659
669 void mr3d(double* v, double (*E), double (*Nu), double (*C), double** F, double** Pmat, double**** Amat);
670
679 void stvk3d(double* v,double (*lam),double (*mue),double** F,double** Pmat,double**** Amat);
680
689 void stvk2d(double* v, double (*lam),double (*mue),double** F ,double** Pmat,double**** Amat);
690
691 // void SMTSetElSpecBiot(ElementSpec *es,int *idata/*not needed*/,int ic,int ng, vec_dbl_Type& paraVec);
692
693 // void SMTSetElSpecBiotStVK(ElementSpec *es,int *idata/*not needed*/,int ic,int ng, vec_dbl_Type& paraVec);
694
695 // void SMTSetElSpecBiot3D(ElementSpec *es,int *idata/*not needed*/,int ic,int ng, vec_dbl_Type& paraVec);
696
697 // void SKR_Biot(double* v,ElementSpec *es,ElementData *ed, NodeSpec **ns, NodeData **nd,double *rdata,int *idata,double *p,double **s);
698
699 // void SKR_Biot_StVK(double* v,ElementSpec *es,ElementData *ed, NodeSpec **ns, NodeData **nd,double *rdata,int *idata,double *p,double **s);
700
701 // void SKR_Biot3D(double* v,ElementSpec *es,ElementData *ed, NodeSpec **ns, NodeData **nd,double *rdata,int *idata,double *p,double **s);
702
703 //End of AceGen code
704
705 void buildTransformation(const vec_int_Type& element,
706 vec2D_dbl_ptr_Type pointsRep,
708 std::string FEType="P");
709
710 void buildTransformation(const vec_int_Type& element,
711 vec2D_dbl_ptr_Type pointsRep,
713 vec_dbl_Type& b,
714 std::string FEType="P");
715
716
717 void buildTransformationSurface(const vec_int_Type& element,
718 vec2D_dbl_ptr_Type pointsRep,
720 vec_dbl_Type& b,
721 std::string FEType="P");
722
723 void applyDiff(vec3D_dbl_Type& dPhiIn,
724 vec3D_dbl_Type& dPhiOut,
725 SmallMatrix<SC>& diffT);
726
727
728 void phi( int Dimension,
729 int intFE,
730 int i,
731 vec_dbl_Type &QuadPts,
732 double* value);
733
734
735 void gradPhi( int Dimension,
736 int intFE,
737 int i,
738 vec_dbl_Type &QuadPts,
739 vec_dbl_ptr_Type &value);
740
742 void getQuadratureValues(int Dimension,
743 int Degree,
744 vec2D_dbl_ptr_Type &QuadPts,
745 vec_dbl_ptr_Type &QuadW,
746 std::string FEType);
747
748 int getPhi( vec2D_dbl_ptr_Type &Phi,
749 vec_dbl_ptr_Type &weightsPhi,
750 int Dimension,
751 std::string FEType,
752 int Degree,
753 std::string FETypeQuadPoints="");
754
755 int getPhiGlobal(vec2D_dbl_ptr_Type &Phi,
756 vec_dbl_ptr_Type &weightsPhi,
757 int Dimension,
758 std::string FEType,
759 int Degree);
760
761 int getDPhi( vec3D_dbl_ptr_Type &DPhi,
762 vec_dbl_ptr_Type &weightsDPhi,
763 int Dimension,
764 std::string FEType,
765 int Degree);
766
767 int checkFE(int Dimension,
768 std::string FEType);
769
770
771 bool setZeros_;
772 SC myeps_;
773 std::vector<Teuchos::RCP<DataElement> > ed_;
774 bool saveAssembly_;
775};
776}
777#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:23
Definition BlockMultiVector_decl.hpp:25
Definition Domain_decl.hpp:20
Definition Elements.hpp:22
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:7011
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:3881
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:3968
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:4457
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:4192
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:4098
void assemblyPressureMeanValue(int dim, std::string FEType, MatrixPtr_Type a, MatrixPtr_Type aT)
Assembling Pressure Integral to determine pressure mean value.
Definition FE_def.hpp:7475
void assemblyLaplaceXDim(int dim, std::string FEType, MatrixPtr_Type &A, CoeffFuncDbl_Type func, double *parameters, bool callFillComplete=true)
Definition FE_def.hpp:4275
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:3696
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:3790
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:1252
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:5147
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:2735
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:5459
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:1863
void assemblyLinElasXDim(int dim, std::string FEType, MatrixPtr_Type &A, double lambda, double mu, bool callFillComplete=true)
Definition FE_def.hpp:4791
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
Definition FiniteElement.hpp:17
Definition Matrix_decl.hpp:34
Definition MeshUnstructured_decl.hpp:31
Definition MultiVector_decl.hpp:36
This class represents a templated small Matrix of type T. Primarily created for 2x2 and 3x3 matrices....
Definition SmallMatrix.hpp:22
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement_decl.hpp:33