38 #ifndef _HOLZAPFELGENERALIZEDMATERIAL_H_ 39 #define _HOLZAPFELGENERALIZEDMATERIAL_H_ 41 #pragma GCC diagnostic ignored "-Wunused-variable" 42 #pragma GCC diagnostic ignored "-Wunused-parameter" 45 #include <lifev/structure/solver/anisotropic/StructuralAnisotropicConstitutiveLaw.hpp> 47 #define PI 3.14159265359
51 template <
typename MeshType>
58 typedef StructuralAnisotropicConstitutiveLaw<MeshType>
super;
139 const std::shared_ptr<
const MapEpetra>& monolithicMap,
245 const Epetra_SerialDenseMatrix& tensorF,
246 const Epetra_SerialDenseMatrix& cofactorF,
247 const std::vector<Real>& invariants,
277 return super::M_jacobian;
346 template <
typename MeshType>
358 template <
typename MeshType>
366 template <
typename MeshType>
370 const std::shared_ptr<
const MapEpetra>& monolithicMap,
375 this->M_dataMaterial = dataMaterial;
376 this->M_dispFESpace = dFESpace;
377 this->M_dispETFESpace = dETFESpace;
378 this->M_localMap = monolithicMap;
379 this->M_offset = offset;
383 M_identity (0, 0) = 1.0;
384 M_identity (0, 1) = 0.0;
385 M_identity (0, 2) = 0.0;
386 M_identity (1, 0) = 0.0;
387 M_identity (1, 1) = 1.0;
388 M_identity (1, 2) = 0.0;
389 M_identity (2, 0) = 0.0;
390 M_identity (2, 1) = 0.0;
391 M_identity (2, 2) = 1.0;
393 this->M_epsilon =
this->M_dataMaterial->smoothness();
437 template <
typename MeshType>
448 UInt nbFamilies = (*vectorOfFibers).size();
450 ASSERT( nbFamilies ==
this->M_dataMaterial->numberFibersFamilies(),
451 " The number of families set in the test is different from the one in the data" );
453 this->M_vectorOfFibers->resize( nbFamilies );
455 for(
UInt k(0); k < nbFamilies; k++ )
457 ( *(
this->M_vectorOfFibers) )[ k ] = ( *vectorOfFibers )[ k ];
461 this->M_vectorInterpolated.resize( nbFamilies );
463 for(
UInt k(0); k < nbFamilies; k++ )
465 this->M_vectorInterpolated[ k ].reset(
new vector_Type(*
this->M_localMap) );
466 this->M_dispFESpace->interpolate ( *( ( *(
this->M_vectorOfFibers) )[ k ] ) ,
467 * ( (
this->M_vectorInterpolated )[ k ] ),
474 template <
typename MeshType>
486 template <
typename MeshType>
494 this->M_jacobian.reset (
new matrix_Type (*
this->M_localMap) );
496 displayer->leaderPrint (
" \n*********************************\n ");
498 displayer->leaderPrint (
" \n*********************************\n ");
502 template <
typename MeshType>
517 tensorF_Type F = ExpressionDefinitions::deformationGradient(
this->M_dispETFESpace, disp,
this->M_offset,
this->M_identity );
534 displayer->leaderPrint (
" Non-Linear S - updating non linear terms in the Jacobian Matrix (N fibers HolzapfelGeneralized): \n");
536 for(
UInt i(0); i <
this->M_vectorInterpolated.size(); i++ )
539 displayer->leaderPrint (
" ", i + 1,
"-th fiber family \n" );
542 interpolatedValue_Type fiberIth = ExpressionDefinitions::interpolateFiber(
this->M_dispETFESpace, *(
this->M_vectorInterpolated[ i ] ) );
555 Real IVact =
this->M_dataMaterial->ithCharacteristicStretch(i) *
this->M_dataMaterial->ithCharacteristicStretch(i);
556 Real alpha =
this->M_dataMaterial->ithStiffnessFibers( i );
557 Real gamma =
this->M_dataMaterial->ithNonlinearityFibers( i );
559 integrate( elements (
this->M_dispETFESpace->mesh() ),
560 this->M_dispFESpace->qr(),
561 this->M_dispETFESpace,
562 this->M_dispETFESpace,
563 value( 2.0 ) * value( alpha ) *
564 ( derAtan( IVithBar - value( IVact ),
this->M_epsilon, ( 1.0 /
PI ) ) * ( IVithBar - value( IVact ) ) +
565 atan( IVithBar - value( IVact ),
this->M_epsilon, ( 1 /
PI ), (1.0/2.0) ) *
566 ( value( 1.0 ) + value(2.0)*value(gamma)*( IVithBar - value( IVact ) ) * ( IVithBar - value( IVact ) ) ) ) *
567 exp( value( gamma ) * ( IVithBar - value( IVact) ) * ( IVithBar - value( IVact) ) ) * Jel *
568 ( value(-2.0/3.0) * IVithBar * dot( F_T, grad(phi_j) ) + Jel * dot( transpose(grad(phi_j)) * F + transpose(F) * grad(phi_j), Mith) ) *
569 dot( F * Mith - value(1.0/3.0) * IVith * F_T, grad(phi_i) )
572 integrate( elements (
this->M_dispETFESpace->mesh() ),
573 this->M_dispFESpace->qr(),
574 this->M_dispETFESpace,
575 this->M_dispETFESpace,
576 value( 2.0 ) * value( alpha ) *
577 atan( IVithBar - value( IVact ),
this->M_epsilon, ( 1 /
PI ), (1.0/2.0) ) *
578 ( IVithBar - value( IVact ) ) *
579 exp( value( gamma ) * ( IVithBar - value( IVact) ) * ( IVithBar - value( IVact) ) ) *
580 value(-2.0/3.0) * Jel * dot( F_T, grad(phi_j) ) *
581 dot( F * Mith - value(1.0/3.0) * IVith * F_T, grad(phi_i) )
584 integrate( elements (
this->M_dispETFESpace->mesh() ),
585 this->M_dispFESpace->qr(),
586 this->M_dispETFESpace,
587 this->M_dispETFESpace,
588 value( 2.0 ) * value( alpha ) *
589 atan( IVithBar - value( IVact ),
this->M_epsilon, ( 1 /
PI ), (1.0/2.0) ) *
590 ( IVithBar - value( IVact ) ) *
591 exp( value( gamma ) * ( IVithBar - value( IVact) ) * ( IVithBar - value( IVact) ) ) * Jel *
592 dot( grad(phi_j) * Mith - value(1.0/3.0) * dot( transpose(grad(phi_j)) * F + transpose(F) * grad(phi_j) , Mith ) * F_T +
593 value( 1.0/3.0 ) * IVith * F_T * transpose(grad(phi_j)) * F_T , grad(phi_i) )
598 jacobian->globalAssemble();
605 template <
typename MeshType>
620 displayer->leaderPrint (
" \n*********************************\n ");
621 displayer->leaderPrint (
" Non-Linear S- Computing the HolzapfelGeneralized nonlinear stiffness vector (N fibers HolzapfelGeneralized)");
622 displayer->leaderPrint (
" \n*********************************\n ");
633 tensorF_Type F = ExpressionDefinitions::deformationGradient(
this->M_dispETFESpace, disp,
this->M_offset,
this->M_identity );
647 for(
UInt i(0); i <
this->M_vectorInterpolated.size() ; i++ )
654 interpolatedValue_Type fiberIth = ExpressionDefinitions::interpolateFiber(
this->M_dispETFESpace, *(
this->M_vectorInterpolated[ i ] ) );
667 Real IVact =
this->M_dataMaterial->ithCharacteristicStretch(i) *
this->M_dataMaterial->ithCharacteristicStretch(i);
671 integrate ( elements (
this->M_dispETFESpace->mesh() ),
672 this->M_dispFESpace->qr(),
673 this->M_dispETFESpace,
674 atan( IVithBar -
value( IVact
) ,
this->M_epsilon, ( 1 /
PI ), ( 1.0/2.0 ) ) *
675 value( 2.0
) * value(
this->M_dataMaterial->ithStiffnessFibers( i ) ) * Jel * ( IVithBar -
value( IVact
) ) *
676 exp( value(
this->M_dataMaterial->ithNonlinearityFibers( i ) ) * ( IVithBar-
value( IVact
) ) * ( IVithBar-
value( IVact
) ) ) *
681 this->M_stiff->globalAssemble();
685 template <
typename MeshType>
694 template <
typename MeshType>
705 template <
typename MeshType>
707 const Epetra_SerialDenseMatrix& tensorF,
708 const Epetra_SerialDenseMatrix& cofactorF,
709 const std::vector<Real>& invariants,
717 template <
typename MeshType>
728 tensorF_Type F = ExpressionDefinitions::deformationGradient(
this->M_dispETFESpace, *disp,
this->M_offset,
this->M_identity );
742 for(
UInt i(0); i <
this->M_vectorInterpolated.size() ; i++ )
749 interpolatedValue_Type fiberIth = ExpressionDefinitions::interpolateFiber(
this->M_dispETFESpace, *(
this->M_vectorInterpolated[ i ] ) );
762 Real IVact =
this->M_dataMaterial->ithCharacteristicStretch(i) *
this->M_dataMaterial->ithCharacteristicStretch(i);
767 evaluateNode( elements(
this->M_dispETFESpace->mesh() ),
769 this->M_dispETFESpace,
770 meas_K * dot( vectorFromMatrix( ( 1 / J ) *
771 ( atan( IVithBar -
value( IVact
) ,
this->M_epsilon, ( 1 /
PI ), ( 1.0/2.0 ) ) *
772 value( 2.0
) * value(
this->M_dataMaterial->ithStiffnessFibers( i ) ) * Jel * ( IVithBar -
value( IVact
) ) *
773 exp( value(
this->M_dataMaterial->ithNonlinearityFibers( i ) ) * ( IVithBar-
value( IVact
) ) * ( IVithBar-
value( IVact
) ) ) *
775 transpose(F) , 0 ),
phi_i )
781 evaluateNode( elements(
this->M_dispETFESpace->mesh() ),
783 this->M_dispETFESpace,
784 meas_K * dot( vectorFromMatrix( ( 1 / J ) *
785 ( atan( IVithBar -
value( IVact
) ,
this->M_epsilon, ( 1 /
PI ), ( 1.0/2.0 ) ) *
786 value( 2.0
) * value(
this->M_dataMaterial->ithStiffnessFibers( i ) ) * Jel * ( IVithBar -
value( IVact
) ) *
787 exp( value(
this->M_dataMaterial->ithNonlinearityFibers( i ) ) * ( IVithBar-
value( IVact
) ) * ( IVithBar-
value( IVact
) ) ) *
790 transpose(F) , 0 ),
phi_i )
792 sigma_1->globalAssemble();
794 evaluateNode( elements(
this->M_dispETFESpace->mesh() ),
796 this->M_dispETFESpace,
797 meas_K * dot( vectorFromMatrix( ( 1 / J ) *
798 ( atan( IVithBar -
value( IVact
) ,
this->M_epsilon, ( 1 /
PI ), ( 1.0/2.0 ) ) *
799 value( 2.0
) * value(
this->M_dataMaterial->ithStiffnessFibers( i ) ) * Jel * ( IVithBar -
value( IVact
) ) *
800 exp( value(
this->M_dataMaterial->ithNonlinearityFibers( i ) ) * ( IVithBar-
value( IVact
) ) * ( IVithBar-
value( IVact
) ) ) *
802 transpose(F) , 1 ),
phi_i )
805 evaluateNode( elements(
this->M_dispETFESpace->mesh() ),
807 this->M_dispETFESpace,
808 meas_K * dot( vectorFromMatrix( ( 1 / J ) *
809 ( atan( IVithBar -
value( IVact
) ,
this->M_epsilon, ( 1 /
PI ), ( 1.0/2.0 ) ) *
810 value( 2.0
) * value(
this->M_dataMaterial->ithStiffnessFibers( i ) ) * Jel * ( IVithBar -
value( IVact
) ) *
811 exp( value(
this->M_dataMaterial->ithNonlinearityFibers( i ) ) * ( IVithBar-
value( IVact
) ) * ( IVithBar-
value( IVact
) ) ) *
814 transpose(F) , 1 ),
phi_i )
816 sigma_2->globalAssemble();
818 evaluateNode( elements(
this->M_dispETFESpace->mesh() ),
820 this->M_dispETFESpace,
821 meas_K * dot( vectorFromMatrix( ( 1 / J ) *
822 ( atan( IVithBar -
value( IVact
) ,
this->M_epsilon, ( 1 /
PI ), ( 1.0/2.0 ) ) *
823 value( 2.0
) * value(
this->M_dataMaterial->ithStiffnessFibers( i ) ) * Jel * ( IVithBar -
value( IVact
) ) *
824 exp( value(
this->M_dataMaterial->ithNonlinearityFibers( i ) ) * ( IVithBar-
value( IVact
) ) * ( IVithBar-
value( IVact
) ) ) *
826 transpose(F) , 2 ),
phi_i )
829 evaluateNode( elements(
this->M_dispETFESpace->mesh() ),
831 this->M_dispETFESpace,
832 meas_K * dot( vectorFromMatrix( ( 1 / J ) *
833 ( atan( IVithBar -
value( IVact
) ,
this->M_epsilon, ( 1 /
PI ), ( 1.0/2.0 ) ) *
834 value( 2.0
) * value(
this->M_dataMaterial->ithStiffnessFibers( i ) ) * Jel * ( IVithBar -
value( IVact
) ) *
835 exp( value(
this->M_dataMaterial->ithNonlinearityFibers( i ) ) * ( IVithBar-
value( IVact
) ) * ( IVithBar-
value( IVact
) ) ) *
838 transpose(F) , 2 ),
phi_i )
840 sigma_3->globalAssemble();
846 template <
typename MeshType>
super::stretch_Type stretch_Type
super::fiberFunctionPtr_Type fiberFunctionPtr_Type
super::determinantF_Type determinantF_Type
void assignFunction(bcBase_Type &base)
Assign the function to the base of the BCHandler.
vectorPtr_Type const activatedDeterminant(const UInt) const
Get the activation displacement.
std::vector< UInt > vectorIndexes_Type
super::mapMarkerIndexes_Type mapMarkerIndexes_Type
super::data_Type data_Type
void setup(const FESpacePtr_Type &dFESpace, const ETFESpacePtr_Type &dETFESpace, const std::shared_ptr< const MapEpetra > &monolithicMap, const UInt offset, const dataPtr_Type &dataMaterial)
Setup the created object of the class StructuralIsotropicConstitutiveLaw.
super::powerExpression_Type powerExpression_Type
std::shared_ptr< vectorVolumes_Type > vectorVolumesPtr_Type
super::mapMarkerVolumesPtr_Type mapMarkerVolumesPtr_Type
super::mapMarkerVolumes_Type mapMarkerVolumes_Type
void updateNonLinearJacobianTerms(matrixPtr_Type &jacobian, const vector_Type &disp, const dataPtr_Type &dataMaterial, const mapMarkerVolumesPtr_Type, const mapMarkerIndexesPtr_Type, const displayerPtr_Type &displayer)
Updates the nonlinear terms in the Jacobian matrix in StructualSolver::updateJacobian.
super::matrixPtr_Type matrixPtr_Type
virtual ~HolzapfelGeneralizedMaterialNonLinear()
static const LifeV::UInt elm_nodes_num[]
super::fiberFunction_Type fiberFunction_Type
super::ETFESpacePtr_Type ETFESpacePtr_Type
void setupFiberDirections(vectorFiberFunctionPtr_Type vectorOfFibers)
super::mapMarkerIndexesPtr_Type mapMarkerIndexesPtr_Type
matrixPtr_Type const stiffMatrix() const
Get the Stiffness matrix.
std::vector< typename MeshType::element_Type * > vectorVolumes_Type
std::shared_ptr< vectorIndexes_Type > vectorIndexesPtr_Type
super::vectorsParameters_Type vectorsParameters_Type
vectorPtr_Type const selectionCriterion(const UInt) const
Specific for multimechanism.
MatrixSmall< 3, 3 > matrixSmall_Type
super::vectorFiberFunctionPtr_Type vectorFiberFunctionPtr_Type
super::isochoricStretch_Type isochoricStretch_Type
super::FESpacePtr_Type FESpacePtr_Type
vectorPtr_Type const stiffVector() const
Get the stiffness vector.
vectorPtr_Type const activationDisplacement(const UInt) const
Get the activation displacement.
super::interpolatedValue_Type interpolatedValue_Type
super::matrix_Type matrix_Type
super::displayerPtr_Type displayerPtr_Type
HolzapfelGeneralizedMaterialNonLinear()
matrixSmall_Type M_identity
super::tensorC_Type tensorC_Type
StructuralAnisotropicConstitutiveLaw< MeshType > super
mapMarkerIndexes_Type::const_iterator mapIteratorIndex_Type
void updateJacobianMatrix(const vector_Type &disp, const dataPtr_Type &dataMaterial, const mapMarkerVolumesPtr_Type mapsMarkerVolumes, const mapMarkerIndexesPtr_Type mapsMarkerIndexes, const displayerPtr_Type &displayer)
Updates the Jacobian matrix in StructualSolver::updateJacobian.
void computeKinematicsVariables(const VectorElemental &dk_loc)
Computes the new Stiffness vector for Neo-Hookean and HolzapfelGeneralized materials in StructuralSol...
double Real
Generic real data.
void computeStiffness(const vector_Type &disp, const UInt iter, Real factor, const dataPtr_Type &dataMaterial, const mapMarkerVolumesPtr_Type, const mapMarkerIndexesPtr_Type, const displayerPtr_Type &displayer)
Interface method to compute the new Stiffness matrix in StructuralSolver::evalResidual and in Structu...
super::vectorsParametersPtr_Type vectorsParametersPtr_Type
super::minusT_Type minusT_Type
void evaluateActivationFibers(const vector_Type &displacement, vector_Type &fourthInvariant)
void showMe(std::string const &fileNameVectStiff, std::string const &fileNameJacobain)
Computes the deformation Gradient F, the cofactor of F Cof(F), the determinant of F J = det(F)...
void computeLocalFirstPiolaKirchhoffTensor(Epetra_SerialDenseMatrix &firstPiola, const Epetra_SerialDenseMatrix &tensorF, const Epetra_SerialDenseMatrix &cofactorF, const std::vector< Real > &invariants, const UInt marker)
Compute the First Piola Kirchhoff Tensor.
void apply(const vector_Type &sol, vector_Type &res, const mapMarkerVolumesPtr_Type mapsMarkerVolumes, const mapMarkerIndexesPtr_Type mapsMarkerIndexes, const displayerPtr_Type displayer)
super::vectorPtr_Type vectorPtr_Type
void computeReferenceConfigurations(const vector_Type &disp, const dataPtr_Type &dataMaterial, const displayerPtr_Type &displayer)
ExpressionScalar value(const Real &myValue)
Simple function to be used in the construction of an expression.
mapMarkerVolumes_Type::const_iterator mapIterator_Type
super::tensorF_Type tensorF_Type
super::dataPtr_Type dataPtr_Type
const ExpressionMeas meas_K
Instance to be used in the expressions.
void computeCauchyStressTensor(const vectorPtr_Type disp, const QuadratureRule &evalQuad, vectorPtr_Type sigma_1, vectorPtr_Type sigma_2, vectorPtr_Type sigma_3)
Compute the First Piola Kirchhoff Tensor.
StructuralAnisotropicConstitutiveLaw< MeshType > * createHolzapfelGeneralizedMaterialNonLinear()
super::vectorFiberFunction_Type vectorFiberFunction_Type
vectorPtr_Type M_stiff
construct the vectors for the parameters
super::vector_Type vector_Type
super::traceTensor_Type traceTensor_Type
super::FESpace_Type FESpace_Type
QuadratureRule - The basis class for storing and accessing quadrature rules.
vectorPtr_Type const activatedUnitFiber(const UInt) const
Get the activation displacement.
void computeLinearStiff(dataPtr_Type &, const mapMarkerVolumesPtr_Type, const mapMarkerIndexesPtr_Type)
Compute the Stiffness matrix in StructuralSolver::buildSystem()
super::outerProduct_Type outerProduct_Type
const ExpressionPhiI phi_i
Simple function to be used in the construction of an expression.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
ExpressionDphiI grad(const ExpressionPhiI &)
Simple function to be used in the construction of an expression.