1 #ifndef _compressible_neo_hookean_h_
2 #define _compressible_neo_hookean_h_
5 #include <deal2lkit/parsed_function.h>
22 template <
int dim,
int spacedim>
25 typedef FEValuesCache<dim,spacedim> Scratch;
26 typedef Assembly::CopyData::piDoMUSPreconditioner<dim,dim> CopyPreconditioner;
27 typedef Assembly::CopyData::piDoMUSSystem<dim,dim> CopySystem;
45 template<
typename Number>
49 Number &energy)
const;
51 template<
typename Number>
55 Number &energy)
const;
70 mutable shared_ptr<TrilinosWrappers::PreconditionAMG> Amg_preconditioner;
71 mutable shared_ptr<TrilinosWrappers::PreconditionJacobi> Mp_preconditioner;
72 mutable shared_ptr<TrilinosWrappers::PreconditionJacobi> T_preconditioner;
76 template <
int dim,
int spacedim>
79 "FESystem[FE_Q(1)^d]",
80 "u,u,u",
"1",
"1",
"1")
84 template <
int dim,
int spacedim>
85 template<
typename Number>
88 CopyPreconditioner &data,
91 Number alpha = this->alpha;
92 this->reinit(alpha, cell, fe_cache);
95 auto &us = fe_cache.get_values(
"solution",
"u", displacement, alpha);
97 const unsigned int n_q_points = us.size();
99 auto &JxW = fe_cache.get_JxW_values();
101 for (
unsigned int q=0; q<n_q_points; ++q)
105 energy += 0.5*(u*u)*JxW[q];
109 template <
int dim,
int spacedim>
110 template<
typename Number>
114 Number &energy)
const
116 Number alpha = this->alpha;
117 this->reinit(alpha, cell, fe_cache);
120 auto &us = fe_cache.get_values(
"solution",
"u", displacement, alpha);
121 auto &us_dot = fe_cache.get_values(
"solution_dot",
"u_dot", displacement, alpha);
122 auto &Fs = fe_cache.get_deformation_gradients(
"solution",
"Fu", displacement, alpha);
124 const unsigned int n_q_points = us.size();
126 auto &JxW = fe_cache.get_JxW_values();
128 for (
unsigned int q=0; q<n_q_points; ++q)
136 Number Ic = trace(C);
137 Number J = determinant(F);
138 Number lnJ = std::log (J);
140 Number psi = (
mu/2.)*(Ic-dim) -
mu*lnJ + (lambda/2.)*(lnJ)*(lnJ);
142 energy += (psi)*JxW[q];
149 template <
int dim,
int spacedim>
153 this->add_parameter(prm, &E,
"Young's modulus",
"10.0",
Patterns::Double(0.0));
154 this->add_parameter(prm, &nu,
"Poisson's ratio",
"0.3",
Patterns::Double(0.0));
157 template <
int dim,
int spacedim>
161 mu = E/(2.0*(1.+nu));
162 lambda = (E *nu)/((1.+nu)*(1.-2.*nu));
Definition: conservative.h:20
Definition: lac_type.h:33
void declare_parameters(ParameterHandler &prm)
Definition: compressible_neo_hookean.h:63
ActiveSelector::active_cell_iterator active_cell_iterator
Definition: compressible_neo_hookean.h:14
CompressibleNeoHookeanInterface()
Definition: compressible_neo_hookean.h:54
void preconditioner_energy(const typename DoFHandler< dim, spacedim >::active_cell_iterator &, Scratch &, CopyPreconditioner &, Number &energy) const
Definition: compressible_neo_hookean.h:92
void compute_system_operators(const DoFHandler< dim, spacedim > &, const std::vector< shared_ptr< LATrilinos::BlockMatrix > >, LinearOperator< LATrilinos::VectorType > &, LinearOperator< LATrilinos::VectorType > &) const
Definition: compressible_neo_hookean.h:130
~CompressibleNeoHookeanInterface()
Definition: compressible_neo_hookean_direct.h:33
void parse_parameters_call_back()
Definition: compressible_neo_hookean.h:71
void system_energy(const typename DoFHandler< dim, spacedim >::active_cell_iterator &, Scratch &, CopySystem &, Number &energy) const
Definition: compressible_neo_hookean.h:117