www.mooseframework.org
MultiPlasticityRawComponentAssembler.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
12 /* */
13 /* All contents are licensed under LGPL V2.1 */
14 /* See LICENSE for full restrictions */
15 /****************************************************************/
16 
18 #include "UserObjectInterface.h"
19 
21 
22 template <>
24 
44 class MultiPlasticityRawComponentAssembler : public UserObjectInterface
45 {
46 public:
47  static InputParameters validParams();
48 
49  MultiPlasticityRawComponentAssembler(const MooseObject * moose_object);
50 
52 
53 protected:
54  const InputParameters & _params;
55 
57  unsigned int _num_models;
58 
66  unsigned int _num_surfaces;
67 
69  std::vector<std::vector<unsigned int>> _surfaces_given_model;
70 
72  MooseEnum _specialIC;
73 
75  std::vector<const TensorMechanicsPlasticModel *> _f;
76 
84  virtual void yieldFunction(const RankTwoTensor & stress,
85  const std::vector<Real> & intnl,
86  const std::vector<bool> & active,
87  std::vector<Real> & f);
88 
97  virtual void dyieldFunction_dstress(const RankTwoTensor & stress,
98  const std::vector<Real> & intnl,
99  const std::vector<bool> & active,
100  std::vector<RankTwoTensor> & df_dstress);
101 
110  virtual void dyieldFunction_dintnl(const RankTwoTensor & stress,
111  const std::vector<Real> & intnl,
112  const std::vector<bool> & active,
113  std::vector<Real> & df_dintnl);
114 
122  virtual void flowPotential(const RankTwoTensor & stress,
123  const std::vector<Real> & intnl,
124  const std::vector<bool> & active,
125  std::vector<RankTwoTensor> & r);
126 
135  virtual void dflowPotential_dstress(const RankTwoTensor & stress,
136  const std::vector<Real> & intnl,
137  const std::vector<bool> & active,
138  std::vector<RankFourTensor> & dr_dstress);
139 
148  virtual void dflowPotential_dintnl(const RankTwoTensor & stress,
149  const std::vector<Real> & intnl,
150  const std::vector<bool> & active,
151  std::vector<RankTwoTensor> & dr_dintnl);
152 
163  virtual void hardPotential(const RankTwoTensor & stress,
164  const std::vector<Real> & intnl,
165  const std::vector<bool> & active,
166  std::vector<Real> & h);
167 
177  virtual void dhardPotential_dstress(const RankTwoTensor & stress,
178  const std::vector<Real> & intnl,
179  const std::vector<bool> & active,
180  std::vector<RankTwoTensor> & dh_dstress);
181 
192  virtual void dhardPotential_dintnl(const RankTwoTensor & stress,
193  const std::vector<Real> & intnl,
194  const std::vector<bool> & active,
195  std::vector<Real> & dh_dintnl);
196 
207  virtual void buildActiveConstraints(const std::vector<Real> & f,
208  const RankTwoTensor & stress,
209  const std::vector<Real> & intnl,
210  const RankFourTensor & Eijkl,
211  std::vector<bool> & act);
212 
214  unsigned int modelNumber(unsigned int surface);
215 
217  bool anyActiveSurfaces(int model, const std::vector<bool> & active);
218 
226  void activeModelSurfaces(int model,
227  const std::vector<bool> & active,
228  std::vector<unsigned int> & active_surfaces_of_model);
229 
237  void activeSurfaces(int model,
238  const std::vector<bool> & active,
239  std::vector<unsigned int> & active_surfaces);
240 
280  bool returnMapAll(const RankTwoTensor & trial_stress,
281  const std::vector<Real> & intnl_old,
282  const RankFourTensor & E_ijkl,
283  Real ep_plastic_tolerance,
284  RankTwoTensor & stress,
285  std::vector<Real> & intnl,
286  std::vector<Real> & pm,
287  std::vector<Real> & cumulative_pm,
288  RankTwoTensor & delta_dp,
289  std::vector<Real> & yf,
290  unsigned & num_successful_plastic_returns,
291  unsigned & custom_model);
292 
293 private:
295  std::vector<unsigned int> _model_given_surface;
296 
298  std::vector<unsigned int> _model_surface_given_surface;
299 
311  void buildActiveConstraintsRock(const std::vector<Real> & f,
312  const RankTwoTensor & stress,
313  const std::vector<Real> & intnl,
314  const RankFourTensor & Eijkl,
315  std::vector<bool> & act);
316 
328  void buildActiveConstraintsJoint(const std::vector<Real> & f,
329  const RankTwoTensor & stress,
330  const std::vector<Real> & intnl,
331  const RankFourTensor & Eijkl,
332  std::vector<bool> & act);
333 };
MultiPlasticityRawComponentAssembler::dflowPotential_dintnl
virtual void dflowPotential_dintnl(const RankTwoTensor &stress, const std::vector< Real > &intnl, const std::vector< bool > &active, std::vector< RankTwoTensor > &dr_dintnl)
The derivative of the active flow potentials with respect to the active internal parameters The UserO...
Definition: MultiPlasticityRawComponentAssembler.C:235
MultiPlasticityRawComponentAssembler::modelNumber
unsigned int modelNumber(unsigned int surface)
returns the model number, given the surface number
Definition: MultiPlasticityRawComponentAssembler.C:785
MultiPlasticityRawComponentAssembler::dhardPotential_dintnl
virtual void dhardPotential_dintnl(const RankTwoTensor &stress, const std::vector< Real > &intnl, const std::vector< bool > &active, std::vector< Real > &dh_dintnl)
The derivative of the active hardening potentials with respect to the active internal parameters.
Definition: MultiPlasticityRawComponentAssembler.C:317
MultiPlasticityRawComponentAssembler::_model_given_surface
std::vector< unsigned int > _model_given_surface
given a surface number, this returns the model number
Definition: MultiPlasticityRawComponentAssembler.h:295
MultiPlasticityRawComponentAssembler::flowPotential
virtual void flowPotential(const RankTwoTensor &stress, const std::vector< Real > &intnl, const std::vector< bool > &active, std::vector< RankTwoTensor > &r)
The active flow potential(s) - one for each yield function.
Definition: MultiPlasticityRawComponentAssembler.C:180
MultiPlasticityRawComponentAssembler::_specialIC
MooseEnum _specialIC
Allows initial set of active constraints to be chosen optimally.
Definition: MultiPlasticityRawComponentAssembler.h:72
MultiPlasticityRawComponentAssembler::MultiPlasticityRawComponentAssembler
MultiPlasticityRawComponentAssembler(const MooseObject *moose_object)
Definition: MultiPlasticityRawComponentAssembler.C:38
MultiPlasticityRawComponentAssembler::~MultiPlasticityRawComponentAssembler
virtual ~MultiPlasticityRawComponentAssembler()
Definition: MultiPlasticityRawComponentAssembler.h:51
MultiPlasticityRawComponentAssembler::_num_surfaces
unsigned int _num_surfaces
Number of surfaces within the plastic models.
Definition: MultiPlasticityRawComponentAssembler.h:66
MultiPlasticityRawComponentAssembler::hardPotential
virtual void hardPotential(const RankTwoTensor &stress, const std::vector< Real > &intnl, const std::vector< bool > &active, std::vector< Real > &h)
The active hardening potentials (one for each internal parameter and for each yield function) by assu...
Definition: MultiPlasticityRawComponentAssembler.C:262
MultiPlasticityRawComponentAssembler::returnMapAll
bool returnMapAll(const RankTwoTensor &trial_stress, const std::vector< Real > &intnl_old, const RankFourTensor &E_ijkl, Real ep_plastic_tolerance, RankTwoTensor &stress, std::vector< Real > &intnl, std::vector< Real > &pm, std::vector< Real > &cumulative_pm, RankTwoTensor &delta_dp, std::vector< Real > &yf, unsigned &num_successful_plastic_returns, unsigned &custom_model)
Performs a returnMap for each plastic model using their inbuilt returnMap functions.
Definition: MultiPlasticityRawComponentAssembler.C:599
TensorMechanicsPlasticModel.h
MultiPlasticityRawComponentAssembler::_f
std::vector< const TensorMechanicsPlasticModel * > _f
User objects that define the yield functions, flow potentials, etc.
Definition: MultiPlasticityRawComponentAssembler.h:75
MultiPlasticityRawComponentAssembler
MultiPlasticityRawComponentAssembler holds and computes yield functions, flow directions,...
Definition: MultiPlasticityRawComponentAssembler.h:44
MultiPlasticityRawComponentAssembler::dyieldFunction_dintnl
virtual void dyieldFunction_dintnl(const RankTwoTensor &stress, const std::vector< Real > &intnl, const std::vector< bool > &active, std::vector< Real > &df_dintnl)
The derivative of active yield function(s) with respect to their internal parameters (the user object...
Definition: MultiPlasticityRawComponentAssembler.C:153
validParams< MultiPlasticityRawComponentAssembler >
InputParameters validParams< MultiPlasticityRawComponentAssembler >()
MultiPlasticityRawComponentAssembler::validParams
static InputParameters validParams()
Definition: MultiPlasticityRawComponentAssembler.C:16
MultiPlasticityRawComponentAssembler::buildActiveConstraints
virtual void buildActiveConstraints(const std::vector< Real > &f, const RankTwoTensor &stress, const std::vector< Real > &intnl, const RankFourTensor &Eijkl, std::vector< bool > &act)
Constructs a set of active constraints, given the yield functions, f.
Definition: MultiPlasticityRawComponentAssembler.C:344
MultiPlasticityRawComponentAssembler::dhardPotential_dstress
virtual void dhardPotential_dstress(const RankTwoTensor &stress, const std::vector< Real > &intnl, const std::vector< bool > &active, std::vector< RankTwoTensor > &dh_dstress)
The derivative of the active hardening potentials with respect to stress By assumption in the Userobj...
Definition: MultiPlasticityRawComponentAssembler.C:289
MultiPlasticityRawComponentAssembler::dyieldFunction_dstress
virtual void dyieldFunction_dstress(const RankTwoTensor &stress, const std::vector< Real > &intnl, const std::vector< bool > &active, std::vector< RankTwoTensor > &df_dstress)
The derivative of the active yield function(s) with respect to stress.
Definition: MultiPlasticityRawComponentAssembler.C:125
MultiPlasticityRawComponentAssembler::activeModelSurfaces
void activeModelSurfaces(int model, const std::vector< bool > &active, std::vector< unsigned int > &active_surfaces_of_model)
Returns the internal surface number(s) of the active surfaces of the given model This may be of size=...
Definition: MultiPlasticityRawComponentAssembler.C:811
MultiPlasticityRawComponentAssembler::_num_models
unsigned int _num_models
Number of plastic models for this material.
Definition: MultiPlasticityRawComponentAssembler.h:57
MultiPlasticityRawComponentAssembler::anyActiveSurfaces
bool anyActiveSurfaces(int model, const std::vector< bool > &active)
returns true if any internal surfaces of the given model are active according to 'active'
Definition: MultiPlasticityRawComponentAssembler.C:791
RankFourTensorTempl< Real >
MultiPlasticityRawComponentAssembler::_params
const InputParameters & _params
Definition: MultiPlasticityRawComponentAssembler.h:54
MultiPlasticityRawComponentAssembler::buildActiveConstraintsJoint
void buildActiveConstraintsJoint(const std::vector< Real > &f, const RankTwoTensor &stress, const std::vector< Real > &intnl, const RankFourTensor &Eijkl, std::vector< bool > &act)
"Joint" version Constructs a set of active constraints, given the yield functions,...
Definition: MultiPlasticityRawComponentAssembler.C:381
MultiPlasticityRawComponentAssembler::yieldFunction
virtual void yieldFunction(const RankTwoTensor &stress, const std::vector< Real > &intnl, const std::vector< bool > &active, std::vector< Real > &f)
The active yield function(s)
Definition: MultiPlasticityRawComponentAssembler.C:98
RankTwoTensorTempl< Real >
MultiPlasticityRawComponentAssembler::activeSurfaces
void activeSurfaces(int model, const std::vector< bool > &active, std::vector< unsigned int > &active_surfaces)
Returns the external surface number(s) of the active surfaces of the given model This may be of size=...
Definition: MultiPlasticityRawComponentAssembler.C:800
MultiPlasticityRawComponentAssembler::dflowPotential_dstress
virtual void dflowPotential_dstress(const RankTwoTensor &stress, const std::vector< Real > &intnl, const std::vector< bool > &active, std::vector< RankFourTensor > &dr_dstress)
The derivative of the active flow potential(s) with respect to stress.
Definition: MultiPlasticityRawComponentAssembler.C:207
MultiPlasticityRawComponentAssembler::_model_surface_given_surface
std::vector< unsigned int > _model_surface_given_surface
given a surface number, this returns the corresponding-model's internal surface number
Definition: MultiPlasticityRawComponentAssembler.h:298
MultiPlasticityRawComponentAssembler::_surfaces_given_model
std::vector< std::vector< unsigned int > > _surfaces_given_model
_surfaces_given_model[model_number] = vector of surface numbers for this model
Definition: MultiPlasticityRawComponentAssembler.h:69
MultiPlasticityRawComponentAssembler::buildActiveConstraintsRock
void buildActiveConstraintsRock(const std::vector< Real > &f, const RankTwoTensor &stress, const std::vector< Real > &intnl, const RankFourTensor &Eijkl, std::vector< bool > &act)
"Rock" version Constructs a set of active constraints, given the yield functions, f.
Definition: MultiPlasticityRawComponentAssembler.C:422