1 #include <lifev/fsi_blocks/solver/LinearElasticity.hpp> 6 LinearElasticity::LinearElasticity(
const commPtr_Type& communicator ):
14 M_thinLayerThickness(0.0),
15 M_thinLayerDensity(0.0),
16 M_thinLayerLameI(0.0),
17 M_thinLayerLameII(0.0),
21 LinearElasticity::~LinearElasticity()
25 LinearElasticity::setCoefficients (
const Real density,
const Real young,
const Real poisson)
37 M_lambda = ( M_young * M_poisson ) / ( ( 1.0 + M_poisson ) * ( 1.0 - 2.0 * M_poisson ) );
39 M_mu = M_young / ( 2.0 * ( 1.0 + M_poisson ) );
44 LinearElasticity::setCoefficientsThinLayer (
const Real density,
const Real young,
const Real poisson,
const Real thickness,
const UInt interface )
47 M_thinLayerThickness = thickness;
48 M_thinLayerDensity = density;
49 M_interfaceFlag = interface;
50 M_thinLayerLameI = young / ( 2 * ( 1.0 + poisson ) );
51 M_thinLayerLameII = ( young * poisson ) / ( ( 1.0 + poisson ) * ( 1.0 - poisson ) );
52 M_mass_no_bc_thin.reset(
new matrix_Type ( M_displacementFESpace->map() ) );
53 M_stiffness_no_bc_thin.reset(
new matrix_Type ( M_displacementFESpace->map() ) );
57 LinearElasticity::setup(
const meshPtr_Type& mesh,
const std::string dOrder)
63 M_displacementFESpace.reset (
new FESpace<mesh_Type, map_Type> (mesh, M_dOrder, 3, M_comm) );
65 M_displacementFESpace_ETA.reset(
new ETFESpace_displacement ( M_displacementFESpace->mesh(), &(M_displacementFESpace->refFE()), M_comm));
69 M_mass_no_bc.reset(
new matrix_Type(M_displacementFESpace->map() ) );
71 M_stiffness_no_bc.reset(
new matrix_Type(M_displacementFESpace->map() ) );
73 M_jacobian.reset(
new matrix_Type(M_displacementFESpace->map() ) );
79 M_stiffness_no_bc->zero();
85 LinearElasticity::assemble_matrices (
const Real timestep,
const Real coeff, bcPtr_Type & bc,
bool useBDF )
87 ASSERT( M_density != 0.0,
"density coefficient has not been set in LinearElasticity");
88 ASSERT( M_young != 0.0,
"young coefficient has not been set in LinearElasticity");
89 ASSERT( M_poisson != 0.0,
"poisson coefficient has not been set in LinearElasticity");
91 using namespace ExpressionAssembly;
94 integrate ( elements (M_displacementFESpace_ETA->mesh() ),
95 M_displacementFESpace->qr(),
96 M_displacementFESpace_ETA,
97 M_displacementFESpace_ETA,
98 value(M_density) * dot ( phi_i, phi_j )
103 QuadratureBoundary myBDQR (buildTetraBDQR (quadRuleTria7pt) );
104 M_mass_no_bc_thin->zero();
106 integrate ( boundary ( M_displacementFESpace_ETA->mesh(), M_interfaceFlag ),
108 M_displacementFESpace_ETA,
109 M_displacementFESpace_ETA,
110 value ( M_thinLayerDensity ) * dot ( phi_i , phi_j )
111 ) >> M_mass_no_bc_thin;
113 M_mass_no_bc_thin->globalAssemble();
114 *M_mass_no_bc += *M_mass_no_bc_thin;
117 M_mass_no_bc->globalAssemble();
120 integrate ( elements (M_displacementFESpace_ETA->mesh() ),
121 M_displacementFESpace->qr(),
122 M_displacementFESpace_ETA,
123 M_displacementFESpace_ETA,
124 value( M_mu ) * dot ( grad(phi_i) , grad(phi_j) + transpose( grad(phi_j) ) ) +
125 value( M_lambda ) * div(phi_i) * div(phi_j)
126 ) >> M_stiffness_no_bc;
130 QuadratureBoundary myBDQR (buildTetraBDQR (quadRuleTria7pt) );
131 M_stiffness_no_bc_thin->zero();
133 MatrixSmall<3, 3> Eye;
138 using namespace ExpressionAssembly;
140 integrate ( boundary ( M_displacementFESpace_ETA->mesh(), M_interfaceFlag ),
142 M_displacementFESpace_ETA,
143 M_displacementFESpace_ETA,
144 value( M_thinLayerThickness * M_thinLayerLameII ) *
146 ( grad (phi_j) + (-1) * grad (phi_j) * outerProduct ( Nface, Nface ) ) +
147 transpose (grad (phi_j) + (-1) * grad (phi_j) * outerProduct ( Nface, Nface ) ),
148 ( grad (phi_i) + ( (-1) * grad (phi_i) * outerProduct ( Nface, Nface ) ) )
150 + value( M_thinLayerThickness * M_thinLayerLameI ) *
151 dot ( value ( Eye ) , ( grad (phi_j) + (-1) * grad (phi_j) * outerProduct ( Nface, Nface ) ) ) *
152 dot ( value ( Eye ) , ( grad (phi_i) + (-1) * grad (phi_i) * outerProduct ( Nface, Nface ) ) )
153 ) >> M_stiffness_no_bc_thin;
155 M_stiffness_no_bc_thin->globalAssemble();
156 *M_stiffness_no_bc += *M_stiffness_no_bc_thin;
159 M_stiffness_no_bc->globalAssemble();
163 *M_jacobian += *M_mass_no_bc;
167 *M_jacobian *= ( 1.0/( timestep*timestep ) * coeff );
171 *M_jacobian *= ( 1.0/( timestep*timestep*coeff ) );
174 *M_jacobian += *M_stiffness_no_bc;
178 bc->bcUpdate ( *M_displacementFESpace->mesh(), M_displacementFESpace->feBd(), M_displacementFESpace->dof() );
180 bcManageMatrix( *M_jacobian, *M_displacementFESpace->mesh(), M_displacementFESpace->dof(), *bc, M_displacementFESpace->feBd(), 1.0, 0.0);
182 M_jacobian->globalAssemble();
184 if ( M_comm->MyPID() == 0 )
185 std::cout <<
"\nAssembly of structure done\n\n";