1 #ifndef _pidoums_compressible_neo_hookean_h_
2 #define _pidoums_compressible_neo_hookean_h_
13 template <
int dim,
int spacedim,
typename LAC=LATrilinos>
27 template <
typename EnergyType,
typename Res
idualType>
29 FEValuesCache<dim,spacedim> &scratch,
30 std::vector<EnergyType> &energies,
31 std::vector<std::vector<ResidualType> > &local_residuals,
32 bool compute_only_system_terms)
const;
36 const std::vector<shared_ptr<LATrilinos::BlockMatrix> >,
46 mutable shared_ptr<TrilinosWrappers::PreconditionJacobi> preconditioner;
52 template <
int dim,
int spacedim,
typename LAC>
57 "FESystem[FE_Q(1)^d]",
62 template <
int dim,
int spacedim,
typename LAC>
66 this->add_parameter(prm, &E,
"Young's modulus",
"10.0",
Patterns::Double(0.0));
67 this->add_parameter(prm, &nu,
"Poisson's ratio",
"0.3",
Patterns::Double(0.0));
70 template <
int dim,
int spacedim,
typename LAC>
74 lambda = (E *nu)/((1.+nu)*(1.-2.*nu));
79 template <
int dim,
int spacedim,
typename LAC>
80 template <
typename EnergyType,
typename Res
idualType>
84 FEValuesCache<dim,spacedim> &fe_cache,
85 std::vector<EnergyType> &energies,
86 std::vector<std::vector<ResidualType> > &,
87 bool compute_only_system_terms)
const
94 this->reinit (et, cell, fe_cache);
95 auto &us = fe_cache.get_values(
"solution",
"u", displacement, et);
96 auto &Fs = fe_cache.get_deformation_gradients(
"solution",
"Fu", displacement, et);
98 const unsigned int n_q_points = us.size();
99 auto &JxW = fe_cache.get_JxW_values();
102 for (
unsigned int q=0; q<n_q_points; ++q)
107 auto C = transpose(F)*F;
110 auto J = determinant(F);
111 auto lnJ = std::log (J);
113 EnergyType psi = (
mu/2.)*(Ic-dim) -
mu*lnJ + (lambda/2.)*(lnJ)*(lnJ);
115 energies[0] += (psi)*JxW[q];
117 if (!compute_only_system_terms)
118 energies[1] += 0.5*u*u*JxW[q];
120 (void)compute_only_system_terms;
128 template <
int dim,
int spacedim,
typename LAC>
131 const std::vector<shared_ptr<LATrilinos::BlockMatrix> > matrices,
137 preconditioner->initialize(matrices[1]->block(0,0));
138 auto P = linear_operator<LATrilinos::VectorType::BlockType>(matrices[1]->block(0,0));
140 auto A = linear_operator<LATrilinos::VectorType::BlockType>( matrices[0]->block(0,0) );
149 system_op = block_operator<1, 1, LATrilinos::VectorType>({{
154 prec_op = block_operator<1, 1, LATrilinos::VectorType>({{
Definition: lac_type.h:33
void declare_parameters(ParameterHandler &prm)
Definition: compressible_neo_hookean.h:63
void energies_and_residuals(const typename DoFHandler< dim, spacedim >::active_cell_iterator &cell, FEValuesCache< dim, spacedim > &scratch, std::vector< EnergyType > &energies, std::vector< std::vector< ResidualType > > &local_residuals, bool compute_only_system_terms) const
Definition: compressible_neo_hookean.h:83
ActiveSelector::active_cell_iterator active_cell_iterator
This is the class that users should derive from.
Definition: pde_system_interface.h:46
Definition: compressible_neo_hookean.h:14
CompressibleNeoHookeanInterface()
Definition: compressible_neo_hookean.h:54
LinearOperator< typename Solver::vector_type, typename Solver::vector_type > inverse_operator(const LinearOperator< typename Solver::vector_type, typename Solver::vector_type > &op, Solver &solver, const Preconditioner &preconditioner)
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.h:18
void parse_parameters_call_back()
Definition: compressible_neo_hookean.h:71