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;
56 typedef Teuchos::RCP<Mesh<SC,LO,GO,NO> > MeshPtr_Type;
58 typedef Teuchos::RCP<MeshUnstr_Type> MeshUnstrPtr_Type;
61 typedef Teuchos::RCP<Elements_Type> ElementsPtr_Type;
62 typedef Teuchos::RCP<const Elements_Type> ElementsConstPtr_Type;
65 typedef Teuchos::RCP<Matrix_Type> MatrixPtr_Type;
67 typedef typename Matrix_Type::MapPtr_Type MapPtr_Type;
68 typedef typename Matrix_Type::MapConstPtr_Type MapConstPtr_Type;
71 typedef Teuchos::RCP<MultiVector_Type> MultiVectorPtr_Type;
72 typedef Teuchos::RCP<const MultiVector_Type> MultiVectorConstPtr_Type;
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;
79 typedef boost::function<void(
double* x,
double* res,
double t,
const double* parameters)> BC_func_Type;
82 typedef Teuchos::RCP<AssembleFE_Type> AssembleFEPtr_Type;
85 typedef Teuchos::RCP<AssembleFENavierStokes_Type> AssembleFENavierStokesPtr_Type;
88 typedef Teuchos::RCP<AssembleFEGeneralizedNewtonian_Type> AssembleFEGeneralizedNewtonianPtr_Type;
91 typedef Teuchos::RCP<AssembleFE_SCI_SMC_Active_Growth_Reorientation_Type> AssembleFE_SCI_SMC_Active_Growth_Reorientation_Ptr_Type;
93 typedef std::vector<AssembleFEPtr_Type> AssembleFEPtr_vec_Type;
96 typedef Teuchos::RCP<BlockMatrix_Type> BlockMatrixPtr_Type;
99 typedef Teuchos::RCP<BlockMultiVector_Type> BlockMultiVectorPtr_Type;
102 typedef Teuchos::RCP<SmallMatrix_Type> SmallMatrixPtr_Type;
104 DomainConstPtr_vec_Type domainVec_;
105 Teuchos::RCP<ElementSpec> es_;
109 FE(
bool saveAssembly=
false);
111 void assemblyIdentity(MatrixPtr_Type &A);
113 void assemblySurfaceRobinBC(
int dim,
116 MultiVectorPtr_Type u,
118 std::vector<SC> &funcParameter,
120 ParameterListPtr_Type params);
122 void assemblySurfaceIntegral(
int dim,
124 MultiVectorPtr_Type a,
125 std::string fieldType,
127 std::vector<SC>& funcParameter);
129 void assemblySurfaceIntegralExternal(
int dim,
131 MultiVectorPtr_Type f,
132 MultiVectorPtr_Type d_rep,
133 std::vector<SC>& funcParameter,
135 ParameterListPtr_Type params,
140 MultiVectorPtr_Type f,
141 MultiVectorPtr_Type d_rep,
142 MatrixPtr_Type &Kext,
143 std::vector<SC>& funcParameter,
145 ParameterListPtr_Type params,
148 void assemblySurfaceIntegralFlag(
int dim,
150 MultiVectorPtr_Type a,
151 std::string fieldType,
153 std::vector<SC>& funcParameter);
155 double assemblyResistanceBoundary(
int dim,
157 MultiVectorPtr_Type f,
158 MultiVectorPtr_Type u_rep,
159 vec_dbl_Type flowRate_vec,
160 std::vector<SC>& funcParameter,
162 ParameterListPtr_Type params,
164 double assemblyAbsorbingBoundary(
int dim,
166 MultiVectorPtr_Type f,
167 MultiVectorPtr_Type u_rep,
168 vec_dbl_Type flowRate_vec,
169 std::vector<SC>& funcParameter,
171 double areaOutlet_init,
173 ParameterListPtr_Type params,
176 double assemblyAbsorbingBoundaryPaper(
int dim,
178 MultiVectorPtr_Type f,
179 MultiVectorPtr_Type u_rep,
180 vec_dbl_Type flowRate_vec,
181 std::vector<SC>& funcParameter,
183 double areaOutlet_init,
185 ParameterListPtr_Type params,
187 double assemblyAbsorbingResistanceBoundary(
int dim,
189 MultiVectorPtr_Type f,
190 MultiVectorPtr_Type u_rep,
191 vec_dbl_Type flowRate_vec,
192 std::vector<SC>& funcParameter,
194 double areaOutlet_init,
195 ParameterListPtr_Type params,
197 void assemblyArea(
int dim,
202 int assemblyFlowRate(
int dim,
203 double &flowRateParabolic,
207 MultiVectorPtr_Type solution_rep,
210 void assemblyAverageVelocity(
int dim,
211 double &averageVelocity,
214 MultiVectorPtr_Type solution_rep,
236 void addFE(DomainConstPtr_Type domain);
238 void doSetZeros(
double eps = 10*Teuchos::ScalarTraits<SC>::eps());
240 void assemblyEmptyMatrix(MatrixPtr_Type &A);
242 void applyBTinv(vec3D_dbl_ptr_Type& dPhiIn,
243 vec3D_dbl_Type& dPhiOut,
246 void applyBTinv(vec3D_dbl_ptr_Type& dPhiIn,
247 vec3D_dbl_Type& dPhiOut,
250 void assemblyLaplace(
int Dimension,
254 bool callFillComplete =
true,
255 int FELocExternal = -1);
257 void assemblyMass(
int dim,
259 std::string fieldType,
261 bool callFillComplete =
true);
266 void assemblyMass(
int dim,
268 std::string fieldType,
271 bool callFillComplete =
true);
273 void assemblyLaplaceVecField(
int dim,
277 bool callFillComplete =
true);
279 void assemblyLaplaceVecFieldV2(
int dim,
283 bool callFillComplete =
true);
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);
320 MultiVectorPtr_Type eModVec,
322 bool callFillComplete=
true);
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,
333 vec2D_dbl_Type diffusionTensor,
334 bool callFillComplete =
true,
335 int FELocExternal = -1);
337 void assemblyElasticityJacobianAndStressAceFEM(
int dim,
340 MultiVectorPtr_Type &f,
341 MultiVectorPtr_Type u,
342 ParameterListPtr_Type pList,
344 bool callFillComplete=
true);
346 void assemblyElasticityJacobianAceFEM(
int dim,
349 MultiVectorPtr_Type u,
350 std::string material_model,
354 bool callFillComplete=
true);
356 void assemblyElasticityStressesAceFEM(
int dim,
358 MultiVectorPtr_Type &f,
359 MultiVectorPtr_Type u,
360 std::string material_model,
364 bool callFillComplete=
true);
369 MultiVectorPtr_Type u,
370 bool callFillComplete);
375 MultiVectorPtr_Type u,
376 bool callFillComplete);
382 MultiVectorPtr_Type u,
383 bool callFillComplete);
389 MatrixPtr_Type &Bmat,
390 MatrixPtr_Type &BTmat,
391 MapConstPtr_Type map1,
392 MapConstPtr_Type map2,
393 bool callFillComplete =
true);
399 MatrixPtr_Type &Bmat,
400 MatrixPtr_Type &BTmat,
401 MapConstPtr_Type map1,
402 MapConstPtr_Type map2,
403 bool callFillComplete =
true);
410 bool callFillComplete =
true);
417 CoeffFuncDbl_Type func,
419 bool callFillComplete =
true);
427 bool callFillComplete =
true);
436 bool callFillComplete =
true);
447 MultiVectorPtr_Type w,
448 bool callFillComplete =
true);
453 void assemblyFSICoupling(
int dim,
459 MapConstPtr_Type map1,
460 MapConstPtr_Type map2,
461 bool callFillComplete =
true);
463 void assemblyDummyCoupling(
int dim,
467 bool callFillComplete);
472 void assemblyGeometryCoupling(
int dim,
476 MapConstPtr_Type map1,
477 MapConstPtr_Type map2,
478 MapConstPtr_Type map3,
479 bool callFillComplete =
true);
495 void assemblyShapeDerivativeVelocity(
int dim,
500 MultiVectorPtr_Type u,
501 MultiVectorPtr_Type w,
502 MultiVectorPtr_Type p,
506 bool callFillComplete =
true);
511 void assemblyShapeDerivativeDivergence(
int dim,
517 MapConstPtr_Type map1_unique,
518 MapConstPtr_Type map2_unique,
519 MultiVectorPtr_Type u,
520 bool callFillComplete =
true);
523 void assemblyRHS(
int dim,
525 MultiVectorPtr_Type a,
526 std::string fieldType,
528 std::vector<SC>& funcParameter
531 void assemblyRHSDegTest(
int dim,
533 MultiVectorPtr_Type a,
534 std::string fieldType,
536 std::vector<SC>& funcParameter,
539 void buildFullDPhi(vec3D_dbl_ptr_Type dPhi, Teuchos::Array<
SmallMatrix<double> >& dPhiMat);
541 void fillMatrixArray(
SmallMatrix<double> &matIn,
double* matArrayOut, std::string order,
int offset=0);
543 void epsilonTensor(vec_dbl_Type &basisValues,
SmallMatrix<SC> &epsilonValues,
int activeDof);
546 std::string FETypeVelocity,
547 std::string FETypePressure,
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,
558 std::string assembleMode,
559 bool callFillComplete =
true,
560 int FELocExternal=-1);
566 BlockMatrixPtr_Type &A,
567 bool callFillComplete,
568 int FELocExternal=-1);
571 std::string FETypeChem,
572 std::string FETypeSolid,
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);
586 std::string FETypeChem,
587 std::string FETypeSolid,
591 MultiVectorPtr_Type c_rep,
592 MultiVectorPtr_Type d_rep,
593 BlockMatrixPtr_Type &A,
596 BlockMultiVectorPtr_Type &resVec,
598 ParameterListPtr_Type params,
599 std::string assembleMode,
600 bool callFillComplete =
true,
601 int FELocExternal=-1);
603 void advanceInTimeAssemblyFEElements(
double dt ,MultiVectorPtr_Type d_rep , MultiVectorPtr_Type c_rep)
610 ElementsPtr_Type elementsSolid = domainVec_.at(FElocSolid)->getElementsC();
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);
617 solution_c = getSolution(elementsSolid->getElement(T).getVectorNodeList(), c_rep,1);
618 solution_d = getSolution(elementsSolid->getElement(T).getVectorNodeList(), d_rep,3);
620 solution.insert( solution.end(), solution_d.begin(), solution_d.end() );
621 solution.insert( solution.end(), solution_c.begin(), solution_c.end() );
623 assemblyFEElements_[T]->updateSolution(solution);
625 assemblyFEElements_[T]->advanceInTime(dt);
634 MultiVectorPtr_Type d_rep,
635 BlockMatrixPtr_Type &A,
636 BlockMultiVectorPtr_Type &resVec,
637 ParameterListPtr_Type params,
639 std::string assembleMode,
640 bool callFillComplete=
true,
641 int FELocExternal=-1);
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);
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);
667 void checkMeshOrientation(
int dim, std::string FEType);
674 std::string FETypeVelocity,
675 std::string FETypePressure,
678 MultiVectorPtr_Type u_rep,
679 MultiVectorPtr_Type p_rep,
680 ParameterListPtr_Type params);
687 BlockMultiVectorPtr_Type const_output_fields;
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);
696 void addFeBlock(BlockMatrixPtr_Type &A, SmallMatrixPtr_Type elementMatrix,
FiniteElement element, MapConstPtr_Type mapFirstRow,
int row,
int column, tuple_disk_vec_ptr_Type problemDisk);
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);
700 void addFeBlockMv(BlockMultiVectorPtr_Type &res, vec_dbl_ptr_Type rhsVec,
FiniteElement elementBlock1,
FiniteElement elementBlock2,
int dofs1,
int dofs2 );
702 void addFeBlockMv(BlockMultiVectorPtr_Type &res, vec_dbl_ptr_Type rhsVec,
FiniteElement elementBlock,
int dofs);
704 void computeSurfaceNormal(
int dim,vec2D_dbl_ptr_Type pointsRep,vec_int_Type nodeList,vec_dbl_Type &v_E,
double &norm_v_E);
707 AssembleFEPtr_vec_Type assemblyFEElements_;
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);
721 void nh3d(
double* v,
double (*E),
double (*Nu),
double** F ,
double** Pmat,
double**** Amat);
732 void mr3d(
double* v,
double (*E),
double (*Nu),
double (*C),
double** F,
double** Pmat,
double**** Amat);
742 void stvk3d(
double* v,
double (*lam),
double (*mue),
double** F,
double** Pmat,
double**** Amat);
752 void stvk2d(
double* v,
double (*lam),
double (*mue),
double** F ,
double** Pmat,
double**** Amat);
768 void buildTransformation(
const vec_int_Type& element,
769 vec2D_dbl_ptr_Type pointsRep,
771 std::string FEType=
"P");
773 void buildTransformation(
const vec_int_Type& element,
774 vec2D_dbl_ptr_Type pointsRep,
777 std::string FEType=
"P");
780 void buildTransformationSurface(
const vec_int_Type& element,
781 vec2D_dbl_ptr_Type pointsRep,
784 std::string FEType=
"P");
786 void applyDiff(vec3D_dbl_Type& dPhiIn,
787 vec3D_dbl_Type& dPhiOut,
791 void phi(
int Dimension,
794 vec_dbl_Type &QuadPts,
798 void gradPhi(
int Dimension,
801 vec_dbl_Type &QuadPts,
802 vec_dbl_ptr_Type &value);
805 void getQuadratureValues(
int Dimension,
807 vec2D_dbl_ptr_Type &QuadPts,
808 vec_dbl_ptr_Type &QuadW,
811 int getPhi( vec2D_dbl_ptr_Type &Phi,
812 vec_dbl_ptr_Type &weightsPhi,
816 std::string FETypeQuadPoints=
"");
818 int getPhiGlobal(vec2D_dbl_ptr_Type &Phi,
819 vec_dbl_ptr_Type &weightsPhi,
824 int getDPhi( vec3D_dbl_ptr_Type &DPhi,
825 vec_dbl_ptr_Type &weightsDPhi,
830 int checkFE(
int Dimension,
836 std::vector<Teuchos::RCP<DataElement> > ed_;