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);
172 void addFE(DomainConstPtr_Type domain);
174 void doSetZeros(
double eps = 10*Teuchos::ScalarTraits<SC>::eps());
176 void assemblyEmptyMatrix(MatrixPtr_Type &A);
178 void applyBTinv(vec3D_dbl_ptr_Type& dPhiIn,
179 vec3D_dbl_Type& dPhiOut,
182 void applyBTinv(vec3D_dbl_ptr_Type& dPhiIn,
183 vec3D_dbl_Type& dPhiOut,
186 void assemblyLaplace(
int Dimension,
190 bool callFillComplete =
true,
191 int FELocExternal = -1);
193 void assemblyMass(
int dim,
195 std::string fieldType,
197 bool callFillComplete =
true);
202 void assemblyMass(
int dim,
204 std::string fieldType,
207 bool callFillComplete =
true);
209 void assemblyLaplaceVecField(
int dim,
213 bool callFillComplete =
true);
215 void assemblyLaplaceVecFieldV2(
int dim,
219 bool callFillComplete =
true);
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);
256 MultiVectorPtr_Type eModVec,
258 bool callFillComplete=
true);
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,
269 vec2D_dbl_Type diffusionTensor,
270 bool callFillComplete =
true,
271 int FELocExternal = -1);
273 void assemblyElasticityJacobianAndStressAceFEM(
int dim,
276 MultiVectorPtr_Type &f,
277 MultiVectorPtr_Type u,
278 ParameterListPtr_Type pList,
280 bool callFillComplete=
true);
282 void assemblyElasticityJacobianAceFEM(
int dim,
285 MultiVectorPtr_Type u,
286 std::string material_model,
290 bool callFillComplete=
true);
292 void assemblyElasticityStressesAceFEM(
int dim,
294 MultiVectorPtr_Type &f,
295 MultiVectorPtr_Type u,
296 std::string material_model,
300 bool callFillComplete=
true);
305 MultiVectorPtr_Type u,
306 bool callFillComplete);
311 MultiVectorPtr_Type u,
312 bool callFillComplete);
318 MultiVectorPtr_Type u,
319 bool callFillComplete);
325 MatrixPtr_Type &Bmat,
326 MatrixPtr_Type &BTmat,
327 MapConstPtr_Type map1,
328 MapConstPtr_Type map2,
329 bool callFillComplete =
true);
335 MatrixPtr_Type &Bmat,
336 MatrixPtr_Type &BTmat,
337 MapConstPtr_Type map1,
338 MapConstPtr_Type map2,
339 bool callFillComplete =
true);
346 bool callFillComplete =
true);
353 CoeffFuncDbl_Type func,
355 bool callFillComplete =
true);
363 bool callFillComplete =
true);
372 bool callFillComplete =
true);
383 MultiVectorPtr_Type w,
384 bool callFillComplete =
true);
389 void assemblyFSICoupling(
int dim,
395 MapConstPtr_Type map1,
396 MapConstPtr_Type map2,
397 bool callFillComplete =
true);
399 void assemblyDummyCoupling(
int dim,
403 bool callFillComplete);
408 void assemblyGeometryCoupling(
int dim,
412 MapConstPtr_Type map1,
413 MapConstPtr_Type map2,
414 MapConstPtr_Type map3,
415 bool callFillComplete =
true);
431 void assemblyShapeDerivativeVelocity(
int dim,
436 MultiVectorPtr_Type u,
437 MultiVectorPtr_Type w,
438 MultiVectorPtr_Type p,
442 bool callFillComplete =
true);
447 void assemblyShapeDerivativeDivergence(
int dim,
453 MapConstPtr_Type map1_unique,
454 MapConstPtr_Type map2_unique,
455 MultiVectorPtr_Type u,
456 bool callFillComplete =
true);
465 void assemblyRHS(
int dim,
467 MultiVectorPtr_Type a,
468 std::string fieldType,
470 std::vector<SC>& funcParameter
473 void assemblyRHSDegTest(
int dim,
475 MultiVectorPtr_Type a,
476 std::string fieldType,
478 std::vector<SC>& funcParameter,
481 void buildFullDPhi(vec3D_dbl_ptr_Type dPhi, Teuchos::Array<
SmallMatrix<double> >& dPhiMat);
483 void fillMatrixArray(
SmallMatrix<double> &matIn,
double* matArrayOut, std::string order,
int offset=0);
485 void epsilonTensor(vec_dbl_Type &basisValues,
SmallMatrix<SC> &epsilonValues,
int activeDof);
488 std::string FETypeVelocity,
489 std::string FETypePressure,
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,
500 std::string assembleMode,
501 bool callFillComplete =
true,
502 int FELocExternal=-1);
508 BlockMatrixPtr_Type &A,
509 bool callFillComplete,
510 int FELocExternal=-1);
513 std::string FETypeChem,
514 std::string FETypeSolid,
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);
528 std::string FETypeChem,
529 std::string FETypeSolid,
533 MultiVectorPtr_Type c_rep,
534 MultiVectorPtr_Type d_rep,
535 BlockMatrixPtr_Type &A,
538 BlockMultiVectorPtr_Type &resVec,
540 ParameterListPtr_Type params,
541 std::string assembleMode,
542 bool callFillComplete =
true,
543 int FELocExternal=-1);
545 void advanceInTimeAssemblyFEElements(
double dt ,MultiVectorPtr_Type d_rep , MultiVectorPtr_Type c_rep)
552 ElementsPtr_Type elementsSolid = domainVec_.at(FElocSolid)->getElementsC();
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);
559 solution_c = getSolution(elementsSolid->getElement(T).getVectorNodeList(), c_rep,1);
560 solution_d = getSolution(elementsSolid->getElement(T).getVectorNodeList(), d_rep,3);
562 solution.insert( solution.end(), solution_d.begin(), solution_d.end() );
563 solution.insert( solution.end(), solution_c.begin(), solution_c.end() );
565 assemblyFEElements_[T]->updateSolution(solution);
567 assemblyFEElements_[T]->advanceInTime(dt);
576 MultiVectorPtr_Type d_rep,
577 BlockMatrixPtr_Type &A,
578 BlockMultiVectorPtr_Type &resVec,
579 ParameterListPtr_Type params,
581 std::string assembleMode,
582 bool callFillComplete=
true,
583 int FELocExternal=-1);
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);
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);
609 void checkMeshOrientation(
int dim, std::string FEType);
616 std::string FETypeVelocity,
617 std::string FETypePressure,
620 MultiVectorPtr_Type u_rep,
621 MultiVectorPtr_Type p_rep,
622 ParameterListPtr_Type params);
626 BlockMultiVectorPtr_Type const_output_fields;
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);
633 void addFeBlock(BlockMatrixPtr_Type &A, SmallMatrixPtr_Type elementMatrix,
FiniteElement element, MapConstPtr_Type mapFirstRow,
int row,
int column, tuple_disk_vec_ptr_Type problemDisk);
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);
637 void addFeBlockMv(BlockMultiVectorPtr_Type &res, vec_dbl_ptr_Type rhsVec,
FiniteElement elementBlock1,
FiniteElement elementBlock2,
int dofs1,
int dofs2 );
639 void addFeBlockMv(BlockMultiVectorPtr_Type &res, vec_dbl_ptr_Type rhsVec,
FiniteElement elementBlock,
int dofs);
641 void computeSurfaceNormal(
int dim,vec2D_dbl_ptr_Type pointsRep,vec_int_Type nodeList,vec_dbl_Type &v_E,
double &norm_v_E);
644 AssembleFEPtr_vec_Type assemblyFEElements_;
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);
658 void nh3d(
double* v,
double (*E),
double (*Nu),
double** F ,
double** Pmat,
double**** Amat);
669 void mr3d(
double* v,
double (*E),
double (*Nu),
double (*C),
double** F,
double** Pmat,
double**** Amat);
679 void stvk3d(
double* v,
double (*lam),
double (*mue),
double** F,
double** Pmat,
double**** Amat);
689 void stvk2d(
double* v,
double (*lam),
double (*mue),
double** F ,
double** Pmat,
double**** Amat);
705 void buildTransformation(
const vec_int_Type& element,
706 vec2D_dbl_ptr_Type pointsRep,
708 std::string FEType=
"P");
710 void buildTransformation(
const vec_int_Type& element,
711 vec2D_dbl_ptr_Type pointsRep,
714 std::string FEType=
"P");
717 void buildTransformationSurface(
const vec_int_Type& element,
718 vec2D_dbl_ptr_Type pointsRep,
721 std::string FEType=
"P");
723 void applyDiff(vec3D_dbl_Type& dPhiIn,
724 vec3D_dbl_Type& dPhiOut,
728 void phi(
int Dimension,
731 vec_dbl_Type &QuadPts,
735 void gradPhi(
int Dimension,
738 vec_dbl_Type &QuadPts,
739 vec_dbl_ptr_Type &value);
742 void getQuadratureValues(
int Dimension,
744 vec2D_dbl_ptr_Type &QuadPts,
745 vec_dbl_ptr_Type &QuadW,
748 int getPhi( vec2D_dbl_ptr_Type &Phi,
749 vec_dbl_ptr_Type &weightsPhi,
753 std::string FETypeQuadPoints=
"");
755 int getPhiGlobal(vec2D_dbl_ptr_Type &Phi,
756 vec_dbl_ptr_Type &weightsPhi,
761 int getDPhi( vec3D_dbl_ptr_Type &DPhi,
762 vec_dbl_ptr_Type &weightsDPhi,
767 int checkFE(
int Dimension,
773 std::vector<Teuchos::RCP<DataElement> > ed_;