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 assemblySurfaceIntegral(
int dim,
115 MultiVectorPtr_Type a,
116 std::string fieldType,
118 std::vector<SC>& funcParameter);
120 void assemblySurfaceIntegralExternal(
int dim,
122 MultiVectorPtr_Type f,
123 MultiVectorPtr_Type d_rep,
124 std::vector<SC>& funcParameter,
126 ParameterListPtr_Type params,
131 MultiVectorPtr_Type f,
132 MultiVectorPtr_Type d_rep,
133 MatrixPtr_Type &Kext,
134 std::vector<SC>& funcParameter,
136 ParameterListPtr_Type params,
139 void assemblySurfaceIntegralFlag(
int dim,
141 MultiVectorPtr_Type a,
142 std::string fieldType,
144 std::vector<SC>& funcParameter);
146 void assemblyAceGenTPM( MatrixPtr_Type &A00,
150 MultiVectorPtr_Type &F0,
151 MultiVectorPtr_Type &F1,
152 MapPtr_Type &mapRepeated1,
153 MapPtr_Type &mapRepeated2,
154 ParameterListPtr_Type parameterList,
155 MultiVectorPtr_Type u_repeatedNewton=Teuchos::null,
156 MultiVectorPtr_Type p_repeatedNewton=Teuchos::null,
157 MultiVectorPtr_Type u_repeatedTime=Teuchos::null,
158 MultiVectorPtr_Type p_repeatedTime=Teuchos::null,
160 bool updateHistory=
true);
163 void addFE(DomainConstPtr_Type domain);
165 void doSetZeros(
double eps = 10*Teuchos::ScalarTraits<SC>::eps());
167 void assemblyEmptyMatrix(MatrixPtr_Type &A);
169 void applyBTinv(vec3D_dbl_ptr_Type& dPhiIn,
170 vec3D_dbl_Type& dPhiOut,
173 void applyBTinv(vec3D_dbl_ptr_Type& dPhiIn,
174 vec3D_dbl_Type& dPhiOut,
177 void assemblyLaplace(
int Dimension,
181 bool callFillComplete =
true,
182 int FELocExternal = -1);
184 void assemblyMass(
int dim,
186 std::string fieldType,
188 bool callFillComplete =
true);
193 void assemblyMass(
int dim,
195 std::string fieldType,
198 bool callFillComplete =
true);
200 void assemblyLaplaceVecField(
int dim,
204 bool callFillComplete =
true);
206 void assemblyLaplaceVecFieldV2(
int dim,
210 bool callFillComplete =
true);
213 int dim, std::string FEType,
int degree, MultiVectorPtr_Type u_rep,
214 BlockMatrixPtr_Type &A, BlockMultiVectorPtr_Type &resVec,
215 ParameterListPtr_Type params, std::string assembleMode,
216 bool callFillComplete =
true,
int FELocExternal = -1);
247 MultiVectorPtr_Type eModVec,
249 bool callFillComplete=
true);
251 void determineEMod(std::string FEType,
252 MultiVectorPtr_Type solution,
253 MultiVectorPtr_Type &eModVec,
254 DomainConstPtr_Type domain,
255 ParameterListPtr_Type params);
256 void assemblyLaplaceDiffusion(
int Dimension,
260 vec2D_dbl_Type diffusionTensor,
261 bool callFillComplete =
true,
262 int FELocExternal = -1);
264 void assemblyElasticityJacobianAndStressAceFEM(
int dim,
267 MultiVectorPtr_Type &f,
268 MultiVectorPtr_Type u,
269 ParameterListPtr_Type pList,
271 bool callFillComplete=
true);
273 void assemblyElasticityJacobianAceFEM(
int dim,
276 MultiVectorPtr_Type u,
277 std::string material_model,
281 bool callFillComplete=
true);
283 void assemblyElasticityStressesAceFEM(
int dim,
285 MultiVectorPtr_Type &f,
286 MultiVectorPtr_Type u,
287 std::string material_model,
291 bool callFillComplete=
true);
296 MultiVectorPtr_Type u,
297 bool callFillComplete);
302 MultiVectorPtr_Type u,
303 bool callFillComplete);
309 MatrixPtr_Type &Bmat,
310 MatrixPtr_Type &BTmat,
311 MapConstPtr_Type map1,
312 MapConstPtr_Type map2,
313 bool callFillComplete =
true);
319 MatrixPtr_Type &Bmat,
320 MatrixPtr_Type &BTmat,
321 MapConstPtr_Type map1,
322 MapConstPtr_Type map2,
323 bool callFillComplete =
true);
330 bool callFillComplete =
true);
337 CoeffFuncDbl_Type func,
339 bool callFillComplete =
true);
347 bool callFillComplete =
true);
356 bool callFillComplete =
true);
367 MultiVectorPtr_Type w,
368 bool callFillComplete =
true);
373 void assemblyFSICoupling(
int dim,
379 MapConstPtr_Type map1,
380 MapConstPtr_Type map2,
381 bool callFillComplete =
true);
383 void assemblyDummyCoupling(
int dim,
387 bool callFillComplete);
392 void assemblyGeometryCoupling(
int dim,
396 MapConstPtr_Type map1,
397 MapConstPtr_Type map2,
398 MapConstPtr_Type map3,
399 bool callFillComplete =
true);
415 void assemblyShapeDerivativeVelocity(
int dim,
420 MultiVectorPtr_Type u,
421 MultiVectorPtr_Type w,
422 MultiVectorPtr_Type p,
426 bool callFillComplete =
true);
431 void assemblyShapeDerivativeDivergence(
int dim,
437 MapConstPtr_Type map1_unique,
438 MapConstPtr_Type map2_unique,
439 MultiVectorPtr_Type u,
440 bool callFillComplete =
true);
449 void assemblyRHS(
int dim,
451 MultiVectorPtr_Type a,
452 std::string fieldType,
454 std::vector<SC>& funcParameter
457 void assemblyRHSDegTest(
int dim,
459 MultiVectorPtr_Type a,
460 std::string fieldType,
462 std::vector<SC>& funcParameter,
465 void buildFullDPhi(vec3D_dbl_ptr_Type dPhi, Teuchos::Array<
SmallMatrix<double> >& dPhiMat);
467 void fillMatrixArray(
SmallMatrix<double> &matIn,
double* matArrayOut, std::string order,
int offset=0);
469 void epsilonTensor(vec_dbl_Type &basisValues,
SmallMatrix<SC> &epsilonValues,
int activeDof);
472 std::string FETypeVelocity,
473 std::string FETypePressure,
477 MultiVectorPtr_Type u_rep,
478 MultiVectorPtr_Type p_rep,
479 BlockMatrixPtr_Type &A,
480 BlockMultiVectorPtr_Type &resVec,
481 SmallMatrix_Type coeff,
482 ParameterListPtr_Type params,
484 std::string assembleMode,
485 bool callFillComplete =
true,
486 int FELocExternal=-1);
492 BlockMatrixPtr_Type &A,
493 bool callFillComplete,
494 int FELocExternal=-1);
497 std::string FETypeChem,
498 std::string FETypeSolid,
502 MultiVectorPtr_Type c_rep,
503 MultiVectorPtr_Type d_rep,
504 BlockMatrixPtr_Type &A,
505 BlockMultiVectorPtr_Type &resVec,
506 ParameterListPtr_Type params,
507 std::string assembleMode,
508 bool callFillComplete =
true,
509 int FELocExternal=-1);
512 std::string FETypeChem,
513 std::string FETypeSolid,
517 MultiVectorPtr_Type c_rep,
518 MultiVectorPtr_Type d_rep,
519 BlockMatrixPtr_Type &A,
522 BlockMultiVectorPtr_Type &resVec,
524 ParameterListPtr_Type params,
525 std::string assembleMode,
526 bool callFillComplete =
true,
527 int FELocExternal=-1);
529 void advanceInTimeAssemblyFEElements(
double dt ,MultiVectorPtr_Type d_rep , MultiVectorPtr_Type c_rep)
536 ElementsPtr_Type elementsSolid = domainVec_.at(FElocSolid)->getElementsC();
538 vec_dbl_Type solution_c;
539 vec_dbl_Type solution_d;
540 for (UN T=0; T<assemblyFEElements_.size(); T++) {
541 vec_dbl_Type solution(0);
543 solution_c = getSolution(elementsSolid->getElement(T).getVectorNodeList(), c_rep,1);
544 solution_d = getSolution(elementsSolid->getElement(T).getVectorNodeList(), d_rep,3);
546 solution.insert( solution.end(), solution_d.begin(), solution_d.end() );
547 solution.insert( solution.end(), solution_c.begin(), solution_c.end() );
549 assemblyFEElements_[T]->updateSolution(solution);
551 assemblyFEElements_[T]->advanceInTime(dt);
560 MultiVectorPtr_Type d_rep,
561 BlockMatrixPtr_Type &A,
562 BlockMultiVectorPtr_Type &resVec,
563 ParameterListPtr_Type params,
565 std::string assembleMode,
566 bool callFillComplete=
true,
567 int FELocExternal=-1);
573 MultiVectorPtr_Type d_rep,
574 BlockMatrixPtr_Type &A,
575 BlockMultiVectorPtr_Type &resVec,
576 ParameterListPtr_Type params,
577 bool callFillComplete=
true,
578 int FELocExternal=-1);
584 MultiVectorPtr_Type d_rep,
585 BlockMatrixPtr_Type &A,
586 BlockMultiVectorPtr_Type &resVec,
587 ParameterListPtr_Type params,
588 DomainConstPtr_Type domain,
589 MultiVectorPtr_Type eModVec,
590 bool callFillComplete =
true,
591 int FELocExternal=-1);
593 void checkMeshOrientation(
int dim, std::string FEType);
600 std::string FETypeVelocity,
601 std::string FETypePressure,
604 MultiVectorPtr_Type u_rep,
605 MultiVectorPtr_Type p_rep,
606 ParameterListPtr_Type params);
610 BlockMultiVectorPtr_Type const_output_fields;
615 void addFeBlockMatrix(BlockMatrixPtr_Type &A, SmallMatrixPtr_Type elementMatrix,
FiniteElement element1,
FiniteElement element2, MapConstPtr_Type mapFirstColumn,MapConstPtr_Type mapSecondColumn, tuple_disk_vec_ptr_Type problemDisk);
617 void addFeBlock(BlockMatrixPtr_Type &A, SmallMatrixPtr_Type elementMatrix,
FiniteElement element, MapConstPtr_Type mapFirstRow,
int row,
int column, tuple_disk_vec_ptr_Type problemDisk);
619 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);
621 void addFeBlockMv(BlockMultiVectorPtr_Type &res, vec_dbl_ptr_Type rhsVec,
FiniteElement elementBlock1,
FiniteElement elementBlock2,
int dofs1,
int dofs2 );
623 void addFeBlockMv(BlockMultiVectorPtr_Type &res, vec_dbl_ptr_Type rhsVec,
FiniteElement elementBlock,
int dofs);
625 void computeSurfaceNormal(
int dim,vec2D_dbl_ptr_Type pointsRep,vec_int_Type nodeList,vec_dbl_Type &v_E,
double &norm_v_E);
628 AssembleFEPtr_vec_Type assemblyFEElements_;
630 vec2D_dbl_Type getCoordinates(vec_LO_Type localIDs, vec2D_dbl_ptr_Type points);
631 vec_dbl_Type getSolution(vec_LO_Type localIDs, MultiVectorPtr_Type u_rep,
int dofsVelocity);
642 void nh3d(
double* v,
double (*E),
double (*Nu),
double** F ,
double** Pmat,
double**** Amat);
653 void mr3d(
double* v,
double (*E),
double (*Nu),
double (*C),
double** F,
double** Pmat,
double**** Amat);
655 void stvk3d(
double* v,
double (*lam),
double (*mue),
double** F,
double** Pmat,
double**** Amat);
657 void stvk2d(
double* v,
double (*lam),
double (*mue),
double** F ,
double** Pmat,
double**** Amat);
659 void SMTSetElSpecBiot(
ElementSpec *es,
int *idata,
int ic,
int ng, vec_dbl_Type& paraVec);
661 void SMTSetElSpecBiotStVK(
ElementSpec *es,
int *idata,
int ic,
int ng, vec_dbl_Type& paraVec);
663 void SMTSetElSpecBiot3D(
ElementSpec *es,
int *idata,
int ic,
int ng, vec_dbl_Type& paraVec);
673 void buildTransformation(
const vec_int_Type& element,
674 vec2D_dbl_ptr_Type pointsRep,
676 std::string FEType=
"P");
678 void buildTransformation(
const vec_int_Type& element,
679 vec2D_dbl_ptr_Type pointsRep,
682 std::string FEType=
"P");
685 void buildTransformationSurface(
const vec_int_Type& element,
686 vec2D_dbl_ptr_Type pointsRep,
689 std::string FEType=
"P");
691 void applyDiff(vec3D_dbl_Type& dPhiIn,
692 vec3D_dbl_Type& dPhiOut,
696 void phi(
int Dimension,
699 vec_dbl_Type &QuadPts,
703 void gradPhi(
int Dimension,
706 vec_dbl_Type &QuadPts,
707 vec_dbl_ptr_Type &value);
710 void getQuadratureValues(
int Dimension,
712 vec2D_dbl_ptr_Type &QuadPts,
713 vec_dbl_ptr_Type &QuadW,
716 int getPhi( vec2D_dbl_ptr_Type &Phi,
717 vec_dbl_ptr_Type &weightsPhi,
721 std::string FETypeQuadPoints=
"");
723 int getPhiGlobal(vec2D_dbl_ptr_Type &Phi,
724 vec_dbl_ptr_Type &weightsPhi,
729 int getDPhi( vec3D_dbl_ptr_Type &DPhi,
730 vec_dbl_ptr_Type &weightsDPhi,
735 int checkFE(
int Dimension,
741 std::vector<Teuchos::RCP<DataElement> > ed_;