5 #ifndef _free_swelling_three_fields_h_
6 #define _free_swelling_three_fields_h_
9 #include <deal2lkit/parsed_function.h>
32 template <
int dim,
int spacedim>
35 typedef FEValuesCache<dim,spacedim> Scratch;
36 typedef Assembly::CopyData::piDoMUSPreconditioner<dim,spacedim> CopyPreconditioner;
37 typedef Assembly::CopyData::piDoMUSSystem<dim,spacedim> CopySystem;
55 template<
typename Number>
59 Number &energy)
const;
61 template<
typename Number>
65 Number &energy)
const;
95 template <
int dim,
int spacedim>
98 "FESystem[FE_Q(2)^d-FE_Q(1)-FE_Q(2)]",
99 "u,u,u,p,c",
"1,1,0;1,0,1;0,1,1",
"1,0,0;0,1,0;0,0,1",
"1,0,0")
103 template <
int dim,
int spacedim>
104 template<
typename Number>
107 CopyPreconditioner &data,
108 Number &energy)
const
110 Number alpha = this->alpha;
111 this->reinit(alpha, cell, fe_cache);
114 auto &us = fe_cache.get_values(
"solution",
"u", displacement, alpha);
115 auto &us_dot = fe_cache.get_values(
"solution_dot",
"u", displacement, alpha);
120 auto &ps = fe_cache.get_values(
"solution",
"p", pressure, alpha);
121 auto &cs = fe_cache.get_values(
"solution",
"c", concentration, alpha);
123 const unsigned int n_q_points = us.size();
125 auto &JxW = fe_cache.get_JxW_values();
127 for (
unsigned int q=0; q<n_q_points; ++q)
140 template <
int dim,
int spacedim>
141 template<
typename Number>
145 Number &energy)
const
147 Number alpha = this->alpha;
148 this->reinit(alpha, cell, fe_cache);
151 auto &us = fe_cache.get_values(
"solution",
"u", displacement, alpha);
152 auto &us_dot = fe_cache.get_values(
"solution_dot",
"u_dot", displacement, alpha);
153 auto &Fs = fe_cache.get_deformation_gradients(
"solution",
"Fu", displacement, alpha);
158 auto &ps = fe_cache.get_values(
"solution",
"p", pressure, alpha);
159 auto &cs = fe_cache.get_values(
"solution",
"c", concentration, alpha);
161 const unsigned int n_q_points = us.size();
163 auto &JxW = fe_cache.get_JxW_values();
165 for (
unsigned int q=0; q<n_q_points; ++q)
176 Number J = determinant(F);
179 Number psi = ( 0.5*G*l0_3*(l02*I - dim)
181 + (l0_3*R*T/Omega)*((Omega*l03*c)*std::log((Omega*l03*c)/(1.+Omega*l03*c))
182 + chi*((Omega*l03*c)/(1.+Omega*l03*c)) )
184 - (mu0)*c - p*(J-l0_3-Omega*c)) ;
186 energy += (u*u_dot + psi)*JxW[q];
192 template <
int dim,
int spacedim>
204 template <
int dim,
int spacedim>
213 mu0 = R*T*(std::log((l03-1.)/l03) + l0_3 + chi*l0_6) + G*Omega/l0;
Definition: conservative.h:20
~FreeSwellingThreeFields()
Definition: free_swelling_three_fields.h:43
Definition: lac_type.h:33
FreeSwellingThreeFields()
Definition: free_swelling_three_fields.h:96
void parse_parameters_call_back()
Definition: free_swelling_three_fields.h:205
ActiveSelector::active_cell_iterator active_cell_iterator
Definition: free_swelling_three_fields.h:33
void system_energy(const typename DoFHandler< dim, spacedim >::active_cell_iterator &, Scratch &, CopySystem &, Number &energy) const
Definition: free_swelling_three_fields.h:142
void preconditioner_energy(const typename DoFHandler< dim, spacedim >::active_cell_iterator &, Scratch &, CopyPreconditioner &, Number &energy) const
Definition: free_swelling_three_fields.h:105
LADealII LAC
Definition: free_swelling_three_fields.h:28
void declare_parameters(ParameterHandler &prm)
Definition: free_swelling_three_fields.h:193