39 #ifndef _ELEMOPERSTRUCTURE_H_INCLUDED 40 #define _ELEMOPERSTRUCTURE_H_INCLUDED 46 #include <Epetra_LAPACK.h> 47 #include <Epetra_BLAS.h> 48 #include <Epetra_SerialDenseMatrix.h> 49 #include <Epetra_SerialDenseVector.h> 51 #include <lifev/core/array/MatrixElemental.hpp> 52 #include <lifev/core/array/VectorElemental.hpp> 54 #include <lifev/core/LifeV.hpp> 56 #include <lifev/core/fem/FESpace.hpp> 57 #include <lifev/core/fem/CurrentFEManifold.hpp> 58 #include <lifev/core/fem/CurrentFE.hpp> 59 #include <lifev/core/fem/DOF.hpp> 61 #include <lifev/core/array/VectorEpetra.hpp> 63 #include <boost/shared_ptr.hpp> 70 typedef boost::numeric::ublas::matrix<Real> Matrix;
71 typedef boost::numeric::ublas::vector<Real> Vector;
72 typedef boost::numeric::ublas::zero_matrix<Real> ZeroMatrix;
82 namespace AssemblyElementalStructure
92 template<
typename FunctorType,
typename MeshType,
typename MapType>
93 void saveVectorAccordingToFunctor (
const std::shared_ptr<FESpace<MeshType, MapType> > dispFESpace,
94 const FunctorType functor,
96 const std::shared_ptr<VectorEpetra> statusVector,
97 const std::shared_ptr<VectorEpetra> saveVector,
100 UInt dim = dispFESpace->dim();
101 UInt nTotDof = dispFESpace->dof().numTotalDof();
104 for(
UInt i(0); i < nTotDof; ++i )
106 if( originVector.blockMap().LID(
static_cast<EpetraInt_Type>(i) ) != -1 )
109 bool variable = functor( i, nTotDof, offset );
114 for ( UInt iComp = 0; iComp < dispFESpace->fieldDim(); ++iComp )
116 Int LIDid = originVector.blockMap().LID (
static_cast<EpetraInt_Type>(i + iComp * dim + offset));
117 Int GIDid = originVector.blockMap().GID (LIDid);
119 if( (*statusVector)( GIDid ) != 1.0 )
122 (*saveVector)( GIDid ) = originVector( GIDid );
125 (*statusVector) ( GIDid ) = 1.0;
133 template<
typename FunctorType,
typename MeshType,
typename MapType>
134 void saveBooleanVectorAccordingToFunctor (
const std::shared_ptr<FESpace<MeshType, MapType> > dispFESpace,
135 const FunctorType& functor,
136 const std::shared_ptr<VectorEpetra> originVector,
137 std::shared_ptr<VectorEpetra> saveVector,
140 UInt dim = dispFESpace->dim();
141 UInt nTotDof = dispFESpace->dof().numTotalDof();
144 for(
UInt i(0); i < nTotDof; ++i )
146 if( originVector->blockMap().LID(
static_cast<EpetraInt_Type>(i) ) != -1 )
149 bool variable = functor( i, nTotDof, offset );
154 for ( UInt iComp = 0; iComp < dispFESpace->fieldDim(); ++iComp )
156 Int LIDid = originVector->blockMap().LID (
static_cast<EpetraInt_Type>(i + iComp * dim + offset));
157 Int GIDid = originVector->blockMap().GID (LIDid);
159 (*saveVector)( GIDid ) = 1.0;
173 void computeGradientLocalDisplacement (boost::multi_array<Real, 3>& gradientLocalDisplacement,
const VectorElemental& uk_loc,
const CurrentFE& fe );
182 void computeLocalDeformationGradient (
const VectorElemental& uk_loc, std::vector<Epetra_SerialDenseMatrix>& tensorF,
const CurrentFE& fe );
191 void computeLocalDeformationGradientWithoutIdentity (
const VectorElemental& uk_loc, std::vector<Epetra_SerialDenseMatrix>& tensorF,
const CurrentFE& fe );
212 void stiff_derdiv (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
MatrixElemental& elmat,
const CurrentFE& fe );
224 void stiff_dergradbis (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
MatrixElemental& elmat,
const CurrentFE& fe );
260 void stiff_dergrad_gradbis (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
MatrixElemental& elmat,
const CurrentFE& fe );
272 void stiff_dergrad_gradbis_Tr (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
MatrixElemental& elmat,
const CurrentFE& fe );
300 void stiff_dergrad (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
MatrixElemental& elmat,
const CurrentFE& fe );
312 void stiff_divgrad_2 (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
MatrixElemental& elmat,
const CurrentFE& fe );
324 void stiff_gradgrad_2 (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
MatrixElemental& elmat,
const CurrentFE& fe );
336 void stiff_dergrad_gradbis_2 (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
MatrixElemental& elmat,
const CurrentFE& fe );
348 void stiff_dergrad_gradbis_Tr_2 (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
MatrixElemental& elmat,
const CurrentFE& fe );
360 void stiff_gradgradTr_gradbis_2 (
Real coef,
const boost::multi_array<Real, 3>& gradientLocalDisplacement,
MatrixElemental& elmat,
const CurrentFE& fe );
390 void source_Pvol (
Real coef,
const boost::multi_array<Real, 3>& CofFk,
const std::vector<Real>& Jk,
VectorElemental& elvec,
const CurrentFE& fe);
404 void stiff_Jac_Pvol_1term (
Real coef,
const boost::multi_array<Real, 3 >& CofFk,
const std::vector<Real>& Jk,
MatrixElemental& elmat,
const CurrentFE& fe );
417 void stiff_Jac_Pvol_2term (
Real coef,
const boost::multi_array<Real, 3 >& CofFk,
const std::vector<Real>& Jk,
MatrixElemental& elmat,
const CurrentFE& fe );
434 void source_P1iso_NH (
Real coef,
const boost::multi_array<Real, 3 >& CofFk,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
VectorElemental& elvec,
const CurrentFE& fe);
445 void computeInvariantsRightCauchyGreenTensor (std::vector<LifeV::Real>& invariants,
446 const Epetra_SerialDenseMatrix& tensorF,
447 Epetra_SerialDenseMatrix& cofactorF);
449 void computeInvariantsRightCauchyGreenTensor (std::vector<LifeV::Real>& invariants,
450 const Epetra_SerialDenseMatrix& tensorF);
461 void computeCauchyStressTensor (Epetra_SerialDenseMatrix& cauchy,
462 Epetra_SerialDenseMatrix& firstPiola,
464 Epetra_SerialDenseMatrix& tensorF);
471 void computeEigenvalues (
const Epetra_SerialDenseMatrix& cauchy,
472 std::vector<LifeV::Real>& eigenvaluesR,
473 std::vector<LifeV::Real>& eigenvaluesI);
488 void stiff_Jac_P1iso_NH_1term (
Real coef,
const boost::multi_array<Real, 3 >& CofFk,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Jk,
MatrixElemental& elmat,
const CurrentFE& fe );
502 void stiff_Jac_P1iso_NH_2term (
Real coef,
const boost::multi_array<Real, 3 >& CofFk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
MatrixElemental& elmat,
const CurrentFE& fe );
528 void stiff_Jac_P1iso_NH_4term (
Real coef,
const boost::multi_array<Real, 3 >& CofFk,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Jk,
MatrixElemental& elmat,
const CurrentFE& fe );
542 void stiff_Jac_P1iso_NH_5term (
Real coef,
const boost::multi_array<Real, 3 >& CofFk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
MatrixElemental& elmat,
const CurrentFE& fe );
560 void source_P1iso_Exp (
Real coef,
Real coefExp,
const boost::multi_array<Real, 3 >& CofFk,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
VectorElemental& elvec,
const CurrentFE& fe );
577 void stiff_Jac_P1iso_Exp_1term (
Real coef,
Real coefExp,
const boost::multi_array<Real, 3 >& CofFk,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
MatrixElemental& elmat,
const CurrentFE& fe );
592 void stiff_Jac_P1iso_Exp_2term (
Real coef,
Real coefExp,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
MatrixElemental& elmat,
const CurrentFE& fe );
607 void stiff_Jac_P1iso_Exp_3term (
Real coef,
Real coefExp,
const boost::multi_array<Real, 3 >& CofFk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
MatrixElemental& elmat,
const CurrentFE& fe );
623 void stiff_Jac_P1iso_Exp_4term (
Real coef,
Real coefExp,
const boost::multi_array<Real, 3 >& CofFk,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
MatrixElemental& elmat,
const CurrentFE& fe );
636 void stiff_Jac_P1iso_Exp_5term (
Real coef,
Real coefExp,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
MatrixElemental& elmat,
const CurrentFE& fe );
650 void stiff_Jac_P1iso_Exp_6term (
Real coef,
Real coefExp,
const boost::multi_array<Real, 3 >& CofFk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
MatrixElemental& elmat,
const CurrentFE& fe );
668 void source_P1iso_VKPenalized (
Real lambda,
Real mu,
const boost::multi_array<Real, 3 >& FkMinusTransposed,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Ic_isok,
const std::vector<Real>& Ic_k,
const std::vector<Real>& Jack_k,
VectorElemental& elvec,
const CurrentFE& fe );
682 void source_P2iso_VKPenalized (
Real mu,
const boost::multi_array<Real, 3 >& FkMinusTransposed,
const boost::multi_array<Real, 3 >& FkCk,
const std::vector<Real>& Ic_Squared,
const std::vector<Real>& Jk,
VectorElemental& elvec,
const CurrentFE& fe );
698 void stiff_Jac_P1iso_VKPenalized_0term (
Real lambda,
Real mu,
const boost::multi_array<Real, 3 >& FkMinusTransposed,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_k,
const std::vector<Real>& IcIso_k,
MatrixElemental& elmat,
const CurrentFE& fe );
712 void stiff_Jac_P1iso_VKPenalized_1term (
Real coeff,
const boost::multi_array<Real, 3 >& FkMinusTransposed,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_k,
MatrixElemental& elmat,
const CurrentFE& fe );
725 void stiff_Jac_P1iso_VKPenalized_2term (
Real coef,
const boost::multi_array<Real, 3 >& FkMinusTransposed,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_k,
MatrixElemental& elmat,
const CurrentFE& fe );
738 void stiff_Jac_P1iso_VKPenalized_3term (
Real coef,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Jk,
MatrixElemental& elmat,
const CurrentFE& fe );
752 void stiff_Jac_P1iso_VKPenalized_4term (
Real coef,
const boost::multi_array<Real, 3 >& FkMinusTransposed,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_k,
MatrixElemental& elmat,
const CurrentFE& fe );
764 void stiff_Jac_P1iso_VKPenalized_5term (
Real coef,
Real secondCoef,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
MatrixElemental& elmat,
const CurrentFE& fe );
777 void stiff_Jac_P1iso_VKPenalized_6term (
Real coef,
Real secondCoef,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
const boost::multi_array<Real, 3 >& Fk,
const boost::multi_array<Real, 3 >& FkMinusTransposed,
MatrixElemental& elmat,
const CurrentFE& fe );
792 void stiff_Jac_P1iso_VKPenalized_7term (
Real coef,
Real secondCoef,
const boost::multi_array<Real, 3 >& FkMinusTransposed,
const std::vector<Real>& Ic_isok,
const std::vector<Real>& Ic_k,
const std::vector<Real>& Jk,
MatrixElemental& elmat,
const CurrentFE& fe );
806 void stiff_Jac_P1iso_VKPenalized_8term (
Real coef,
const std::vector<Real>& Jack_k,
const boost::multi_array<Real, 3 >& FkMinusTransposed,
const boost::multi_array<Real, 3 >& FkCk,
MatrixElemental& elmat,
const CurrentFE& fe );
821 void stiff_Jac_P1iso_VKPenalized_9term (
Real coef,
const std::vector<Real>& Jack_k,
const std::vector<Real>& Ic_kSquared,
const boost::multi_array<Real, 3 >& FkMinusTransposed,
MatrixElemental& elmat,
const CurrentFE& fe );
833 void stiff_Jac_P1iso_VKPenalized_10term (
Real coef,
const std::vector<Real>& Jack_k,
const boost::multi_array<Real, 3 >& Ck,
MatrixElemental& elmat,
const CurrentFE& fe );
845 void stiff_Jac_P1iso_VKPenalized_11term (
Real coef,
const std::vector<Real>& Jk,
const boost::multi_array<Real, 3 >& Fk,
MatrixElemental& elmat,
const CurrentFE& fe );
857 void stiff_Jac_P1iso_VKPenalized_12term (
Real coef,
const std::vector<Real>& Jk,
const boost::multi_array<Real, 3 >& Fk,
MatrixElemental& elmat,
const CurrentFE& fe );
870 void stiff_Jac_P1iso_VKPenalized_13term (
Real coef,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_kSquared,
const boost::multi_array<Real, 3 >& FkMinusTransposed,
MatrixElemental& elmat,
const CurrentFE& fe );
884 void stiff_Jac_P1iso_VKPenalized_14term (
Real coef,
const std::vector<Real>& Jk,
const boost::multi_array<Real, 3 >& FkCk,
const boost::multi_array<Real, 3 >& FkMinusTransposed,
MatrixElemental& elmat,
const CurrentFE& fe );
888 void source_P1iso_SecondOrderExponential (
Real coef,
Real coefExp,
const boost::multi_array<Real, 3 >& CofFk,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Jk,
const std::vector<Real>& trCisok,
VectorElemental& elvec,
const CurrentFE& fe );
904 void stiff_Jac_P1iso_SecondOrderExp_1term (
Real coef,
Real coefExp,
const boost::multi_array<Real, 3 >& CofFk,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
MatrixElemental& elmat,
const CurrentFE& fe );
919 void stiff_Jac_P1iso_SecondOrderExp_2term (
Real coef,
Real coefExp,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
MatrixElemental& elmat,
const CurrentFE& fe );
933 void stiff_Jac_P1iso_SecondOrderExp_3term (
Real coef,
Real coefExp,
const boost::multi_array<Real, 3 >& CofFk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
MatrixElemental& elmat,
const CurrentFE& fe );
949 void stiff_Jac_P1iso_SecondOrderExp_4term (
Real coef,
Real coefExp,
const boost::multi_array<Real, 3 >& CofFk,
const boost::multi_array<Real, 3 >& Fk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
const std::vector<Real>& Ic_k,
MatrixElemental& elmat,
const CurrentFE& fe );
962 void stiff_Jac_P1iso_SecondOrderExp_5term (
Real coef,
Real coefExp,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
MatrixElemental& elmat,
const CurrentFE& fe );
976 void stiff_Jac_P1iso_SecondOrderExp_6term (
Real coef,
Real coefExp,
const boost::multi_array<Real, 3 >& CofFk,
const std::vector<Real>& Jk,
const std::vector<Real>& Ic_isok,
MatrixElemental& elmat,
const CurrentFE& fe );
VectorEpetra - The Epetra Vector format Wrapper.
void updateInverseJacobian(const UInt &iQuadPt)
double Real
Generic real data.
CurrentFE - A primordial class for the assembly of the local matrices/vectors retaining the values on...
uint32_type UInt
generic unsigned integer (used mainly for addressing)