40 #ifndef GETFEM_PLASTICITY_H__
41 #define GETFEM_PLASTICITY_H__
51 enum plasticity_unknowns_type {
52 DISPLACEMENT_ONLY = 0,
53 DISPLACEMENT_AND_PLASTIC_MULTIPLIER = 1,
54 DISPLACEMENT_AND_PRESSURE = 2,
55 DISPLACEMENT_AND_PLASTIC_MULTIPLIER_AND_PRESSURE = 3
136 (model &md,
const mesh_im &mim,
137 std::string lawname, plasticity_unknowns_type unknowns_type,
138 const std::vector<std::string> &varnames,
139 const std::vector<std::string> ¶ms,
154 (model &md,
const mesh_im &mim,
155 std::string lawname, plasticity_unknowns_type unknowns_type,
156 const std::vector<std::string> &varnames,
157 const std::vector<std::string> ¶ms,
168 (model &md,
const mesh_im &mim,
169 std::string lawname, plasticity_unknowns_type unknowns_type,
170 const std::vector<std::string> &varnames,
171 const std::vector<std::string> ¶ms,
172 const mesh_fem &mf_vm, model_real_plain_vector &VM,
193 virtual void do_projection(
const base_matrix& tau,
194 scalar_type stress_threshold,
198 flag_hyp(flag_hyp_) {}
202 typedef std::shared_ptr<const abstract_constraints_projection>
203 pconstraints_projection;
214 template<
typename MAT>
215 void tau_m_Id(
const MAT& tau, MAT &taumid)
const {
216 scalar_type trace = gmm::mat_trace(tau);
217 size_type size_of_tau = gmm::mat_nrows(tau);
218 gmm::copy(gmm::identity_matrix(),taumid);
219 gmm::scale(taumid, trace / scalar_type(size_of_tau));
223 template<
typename MAT>
224 void tau_d(
const MAT& tau, MAT &taud)
const {
226 gmm::scale(taud, scalar_type(-1));
236 scalar_type stress_threshold,
241 GMM_ASSERT1(flag_proj == 0 || flag_proj ==1,
242 "wrong value for the projection flag, "
246 GMM_ASSERT1(stress_threshold>=0.,
"s is not a positive number "
247 << stress_threshold <<
". You need to set "
248 <<
"s as a positive number");
251 size_type projsize = (flag_proj == 0) ? N : gmm::sqr(N);
252 scalar_type normtaud;
255 base_matrix taumId(N, N);
256 tau_m_Id(tau, taumId);
259 base_matrix taud(N,N);
260 gmm::add(gmm::scaled(taumId, scalar_type(-1)), tau, taud);
265 GMM_ASSERT1(!N,
"wrong value for CALCULATION HYPOTHESIS, "
266 "must be /=1 SINCE n/=2");
269 base_matrix tau_aux(3,3); gmm::clear(tau_aux);
270 gmm::copy(tau,gmm::sub_matrix
271 (tau_aux,gmm::sub_interval(0,2)));
273 base_matrix taud_aux(3,3);
274 tau_d(tau_aux, taud_aux);
275 normtaud=gmm::mat_euclidean_norm(taud_aux);
277 else normtaud=gmm::mat_euclidean_norm(taud);
282 gmm::resize(proj, projsize, projsize);
284 if (normtaud <= stress_threshold) {
286 case 0: gmm::copy(tau, proj);
break;
287 case 1: gmm::copy(gmm::identity_matrix(), proj);
break;
293 gmm::copy(gmm::scaled(taud, stress_threshold/normtaud),
295 gmm::add(taumId,proj);
298 base_matrix Igrad(projsize, projsize);
299 gmm::copy(gmm::identity_matrix(),Igrad);
300 base_matrix Igrad2(projsize, projsize);
304 base_vector aux(projsize);
306 aux[i*N + i] = scalar_type(1);
310 gmm::copy(aux, gmm::mat_col(Igrad2, i*N + i));
313 base_matrix Id_grad(projsize, projsize);
314 scalar_type rr = scalar_type(1)/scalar_type(N);
315 gmm::copy(gmm::scaled(Igrad2, -rr), Id_grad);
316 gmm::add(Igrad, Id_grad);
320 base_matrix ngrad2(projsize, projsize);
322 base_matrix un(N, N);
323 gmm::copy(gmm::scaled(taud, 1./normtaud),un);
327 std::copy(un.begin(), un.end(), aux.begin());
331 gmm::copy(gmm::scaled(aux,aux[j]),
332 gmm::mat_col(ngrad2,j));
336 gmm::copy(gmm::identity_matrix(), proj);
337 gmm::add(gmm::scaled(ngrad2, scalar_type(-1)), proj);
338 base_matrix aux2(projsize, projsize);
339 gmm::copy(gmm::scaled(proj, stress_threshold/normtaud),
341 gmm::mult(aux2,Id_grad,proj);
342 gmm::add(gmm::scaled(Igrad2, rr),proj);
364 (
const std::string &name, scalar_type sigma_y0, scalar_type H,
bool frobenius=
true);
374 (
const std::string &name,
375 scalar_type sigma_ref, scalar_type eps_ref, scalar_type n,
376 bool frobenius=
false);
386 (
const std::string &name, scalar_type sigma_ref, scalar_type E,
387 scalar_type alpha, scalar_type n,
bool frobenius=
false) {
389 (name, sigma_ref, alpha*sigma_ref/E, n, frobenius);
426 std::string lawname, plasticity_unknowns_type unknowns_type,
427 const std::vector<std::string> &varnames,
428 const std::vector<std::string> ¶ms,
443 std::string lawname, plasticity_unknowns_type unknowns_type,
444 const std::vector<std::string> &varnames,
445 const std::vector<std::string> ¶ms,
455 std::string lawname, plasticity_unknowns_type unknowns_type,
456 const std::vector<std::string> &varnames,
457 const std::vector<std::string> ¶ms,
458 const mesh_fem &mf_vm, model_real_plain_vector &VM,
496 const pconstraints_projection &ACP,
497 const std::string &varname,
498 const std::string &previous_dep_name,
499 const std::string &datalambda,
500 const std::string &datamu,
501 const std::string &datathreshold,
502 const std::string &datasigma,
519 const std::string &varname,
520 const std::string &previous_dep_name,
521 const pconstraints_projection &ACP,
522 const std::string &datalambda,
523 const std::string &datamu,
524 const std::string &datathreshold,
525 const std::string &datasigma);
535 const std::string &datasigma,
537 model_real_plain_vector &VM,
548 const std::string &varname,
549 const std::string &previous_dep_name,
550 const pconstraints_projection &ACP,
551 const std::string &datalambda,
552 const std::string &datamu,
553 const std::string &datathreshold,
554 const std::string &datasigma,
555 model_real_plain_vector &plast);
virtual void do_projection(const base_matrix &tau, scalar_type stress_threshold, base_matrix &proj, size_type flag_proj) const
the Von Mises projection computation
Abstract projection of a stress tensor onto a set of admissible stress tensors.
Describe a finite element method linked to a mesh.
Describe an integration method linked to a mesh.
`‘Model’' variables store the variables, the data and the description of a model.
Generic assembly implementation.
Compute the gradient of a field on a getfem::mesh_fem.
Interpolation of fields from a mesh_fem onto another.
Model representation in Getfem.
size_t size_type
used as the common size type in the library
GEneric Tool for Finite Element Methods.
void ga_define_linear_hardening_function(const std::string &name, scalar_type sigma_y0, scalar_type H, bool frobenius=true)
Add a linear function with the name specified by name to represent linear isotropoc hardening in plas...
void compute_plastic_part(model &md, const mesh_im &mim, const mesh_fem &mf_pl, const std::string &varname, const std::string &previous_dep_name, const pconstraints_projection &ACP, const std::string &datalambda, const std::string &datamu, const std::string &datathreshold, const std::string &datasigma, model_real_plain_vector &plast)
This function computes on mf_pl the plastic part, that could appear after a load and an unload,...
void compute_small_strain_elastoplasticity_Von_Mises(model &md, const mesh_im &mim, std::string lawname, plasticity_unknowns_type unknowns_type, const std::vector< std::string > &varnames, const std::vector< std::string > ¶ms, const mesh_fem &mf_vm, model_real_plain_vector &VM, size_type region=size_type(-1))
This function computes the Von Mises stress field with respect to a small strain elastoplasticity ter...
void finite_strain_elastoplasticity_next_iter(model &md, const mesh_im &mim, std::string lawname, plasticity_unknowns_type unknowns_type, const std::vector< std::string > &varnames, const std::vector< std::string > ¶ms, size_type region=size_type(-1))
This function permits to update the state variables for a finite strain elastoplasticity brick,...
size_type add_finite_strain_elastoplasticity_brick(model &md, const mesh_im &mim, std::string lawname, plasticity_unknowns_type unknowns_type, const std::vector< std::string > &varnames, const std::vector< std::string > ¶ms, size_type region=size_type(-1))
Add a finite strain elastoplasticity brick to the model.
void elastoplasticity_next_iter(model &md, const mesh_im &mim, const std::string &varname, const std::string &previous_dep_name, const pconstraints_projection &ACP, const std::string &datalambda, const std::string &datamu, const std::string &datathreshold, const std::string &datasigma)
This function permits to compute the new stress constraints values supported by the material after a ...
void compute_elastoplasticity_Von_Mises_or_Tresca(model &md, const std::string &datasigma, const mesh_fem &mf_vm, model_real_plain_vector &VM, bool tresca)
This function computes on mf_vm the Von Mises or Tresca stress of a field for elastoplasticity and re...
void ga_define_Ramberg_Osgood_hardening_function(const std::string &name, scalar_type sigma_ref, scalar_type eps_ref, scalar_type n, bool frobenius=false)
Add a Ramberg-Osgood hardening function with the name specified by name, for reference stress and str...
size_type add_small_strain_elastoplasticity_brick(model &md, const mesh_im &mim, std::string lawname, plasticity_unknowns_type unknowns_type, const std::vector< std::string > &varnames, const std::vector< std::string > ¶ms, size_type region=size_type(-1))
Adds a small strain plasticity term to the model md.
void compute_finite_strain_elastoplasticity_Von_Mises(model &md, const mesh_im &mim, std::string lawname, plasticity_unknowns_type unknowns_type, const std::vector< std::string > &varnames, const std::vector< std::string > ¶ms, const mesh_fem &mf_vm, model_real_plain_vector &VM, size_type region=size_type(-1))
This function computes the Von Mises stress field with respect to a finite strain elastoplasticity te...
void small_strain_elastoplasticity_next_iter(model &md, const mesh_im &mim, std::string lawname, plasticity_unknowns_type unknowns_type, const std::vector< std::string > &varnames, const std::vector< std::string > ¶ms, size_type region=size_type(-1))
Function that allows to pass from a time step to another for the small strain plastic brick.
size_type add_elastoplasticity_brick(model &md, const mesh_im &mim, const pconstraints_projection &ACP, const std::string &varname, const std::string &previous_dep_name, const std::string &datalambda, const std::string &datamu, const std::string &datathreshold, const std::string &datasigma, size_type region=size_type(-1))
Add a nonlinear elastoplasticity term to the model for small deformations and an isotropic material,...