39 #ifndef GETFEM_PLASTICITY_H__ 40 #define GETFEM_PLASTICITY_H__ 50 enum plasticity_unknowns_type {
51 DISPLACEMENT_ONLY = 0,
52 DISPLACEMENT_AND_PLASTIC_MULTIPLIER = 1,
53 DISPLACEMENT_AND_PRESSURE = 2,
54 DISPLACEMENT_AND_PLASTIC_MULTIPLIER_AND_PRESSURE = 3
135 (model &md,
const mesh_im &mim,
136 std::string lawname, plasticity_unknowns_type unknowns_type,
137 const std::vector<std::string> &varnames,
138 const std::vector<std::string> ¶ms,
153 (model &md,
const mesh_im &mim,
154 std::string lawname, plasticity_unknowns_type unknowns_type,
155 const std::vector<std::string> &varnames,
156 const std::vector<std::string> ¶ms,
167 (model &md,
const mesh_im &mim,
168 std::string lawname, plasticity_unknowns_type unknowns_type,
169 const std::vector<std::string> &varnames,
170 const std::vector<std::string> ¶ms,
171 const mesh_fem &mf_vm, model_real_plain_vector &VM,
192 virtual void do_projection(
const base_matrix& tau,
193 scalar_type stress_threshold,
197 flag_hyp(flag_hyp_) {}
201 typedef std::shared_ptr<const abstract_constraints_projection>
202 pconstraints_projection;
213 template<
typename MAT>
214 void tau_m_Id(
const MAT& tau, MAT &taumid)
const {
215 scalar_type trace = gmm::mat_trace(tau);
216 size_type size_of_tau = gmm::mat_nrows(tau);
217 gmm::copy(gmm::identity_matrix(),taumid);
218 gmm::scale(taumid, trace / scalar_type(size_of_tau));
222 template<
typename MAT>
223 void tau_d(
const MAT& tau, MAT &taud)
const {
225 gmm::scale(taud, scalar_type(-1));
235 scalar_type stress_threshold,
240 GMM_ASSERT1(flag_proj == 0 || flag_proj ==1,
241 "wrong value for the projection flag, " 245 GMM_ASSERT1(stress_threshold>=0.,
"s is not a positive number " 246 << stress_threshold <<
". You need to set " 247 <<
"s as a positive number");
250 size_type projsize = (flag_proj == 0) ? N : gmm::sqr(N);
251 scalar_type normtaud;
254 base_matrix taumId(N, N);
255 tau_m_Id(tau, taumId);
258 base_matrix taud(N,N);
259 gmm::add(gmm::scaled(taumId, scalar_type(-1)), tau, taud);
264 GMM_ASSERT1(!N,
"wrong value for CALCULATION HYPOTHESIS, " 265 "must be /=1 SINCE n/=2");
268 base_matrix tau_aux(3,3); gmm::clear(tau_aux);
269 gmm::copy(tau,gmm::sub_matrix
270 (tau_aux,gmm::sub_interval(0,2)));
272 base_matrix taud_aux(3,3);
273 tau_d(tau_aux, taud_aux);
274 normtaud=gmm::mat_euclidean_norm(taud_aux);
276 else normtaud=gmm::mat_euclidean_norm(taud);
281 gmm::resize(proj, projsize, projsize);
283 if (normtaud <= stress_threshold) {
285 case 0: gmm::copy(tau, proj);
break;
286 case 1: gmm::copy(gmm::identity_matrix(), proj);
break;
292 gmm::copy(gmm::scaled(taud, stress_threshold/normtaud),
294 gmm::add(taumId,proj);
297 base_matrix Igrad(projsize, projsize);
298 gmm::copy(gmm::identity_matrix(),Igrad);
299 base_matrix Igrad2(projsize, projsize);
303 base_vector aux(projsize);
305 aux[i*N + i] = scalar_type(1);
309 gmm::copy(aux, gmm::mat_col(Igrad2, i*N + i));
312 base_matrix Id_grad(projsize, projsize);
313 scalar_type rr = scalar_type(1)/scalar_type(N);
314 gmm::copy(gmm::scaled(Igrad2, -rr), Id_grad);
315 gmm::add(Igrad, Id_grad);
319 base_matrix ngrad2(projsize, projsize);
321 base_matrix un(N, N);
322 gmm::copy(gmm::scaled(taud, 1./normtaud),un);
326 std::copy(un.begin(), un.end(), aux.begin());
330 gmm::copy(gmm::scaled(aux,aux[j]),
331 gmm::mat_col(ngrad2,j));
335 gmm::copy(gmm::identity_matrix(), proj);
336 gmm::add(gmm::scaled(ngrad2, scalar_type(-1)), proj);
337 base_matrix aux2(projsize, projsize);
338 gmm::copy(gmm::scaled(proj, stress_threshold/normtaud),
340 gmm::mult(aux2,Id_grad,proj);
341 gmm::add(gmm::scaled(Igrad2, rr),proj);
363 (
const std::string &name, scalar_type sigma_y0, scalar_type H,
bool frobenius=
true);
373 (
const std::string &name,
374 scalar_type sigma_ref, scalar_type eps_ref, scalar_type n,
375 bool frobenius=
false);
385 (
const std::string &name, scalar_type sigma_ref, scalar_type E,
386 scalar_type alpha, scalar_type n,
bool frobenius=
false) {
388 (name, sigma_ref, alpha*sigma_ref/E, n, frobenius);
425 std::string lawname, plasticity_unknowns_type unknowns_type,
426 const std::vector<std::string> &varnames,
427 const std::vector<std::string> ¶ms,
442 std::string lawname, plasticity_unknowns_type unknowns_type,
443 const std::vector<std::string> &varnames,
444 const std::vector<std::string> ¶ms,
454 std::string lawname, plasticity_unknowns_type unknowns_type,
455 const std::vector<std::string> &varnames,
456 const std::vector<std::string> ¶ms,
457 const mesh_fem &mf_vm, model_real_plain_vector &VM,
495 const pconstraints_projection &ACP,
496 const std::string &varname,
497 const std::string &previous_dep_name,
498 const std::string &datalambda,
499 const std::string &datamu,
500 const std::string &datathreshold,
501 const std::string &datasigma,
518 const std::string &varname,
519 const std::string &previous_dep_name,
520 const pconstraints_projection &ACP,
521 const std::string &datalambda,
522 const std::string &datamu,
523 const std::string &datathreshold,
524 const std::string &datasigma);
534 const std::string &datasigma,
536 model_real_plain_vector &VM,
547 const std::string &varname,
548 const std::string &previous_dep_name,
549 const pconstraints_projection &ACP,
550 const std::string &datalambda,
551 const std::string &datamu,
552 const std::string &datathreshold,
553 const std::string &datasigma,
554 model_real_plain_vector &plast);
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 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...
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...
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...
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
Describe an integration method linked to a mesh.
``Model'' variables store the variables, the data and the description of a model. ...
size_t size_type
used as the common size type in the library
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...
Model representation in Getfem.
Interpolation of fields from a mesh_fem onto another.
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_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.
Abstract projection of a stress tensor onto a set of admissible stress tensors.
GEneric Tool for Finite Element Methods.
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 ...
Describe a finite element method linked to a mesh.
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...
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...
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...
Generic assembly implementation.
Compute the gradient of a field on a getfem::mesh_fem.
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...