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 
40 {
41 public:
43 
45 
47 
48 protected:
50 
52  unsigned int _num_models;
53 
61  unsigned int _num_surfaces;
62 
64  std::vector<std::vector<unsigned int>> _surfaces_given_model;
65 
68 
70  std::vector<const SolidMechanicsPlasticModel *> _f;
71 
79  virtual void yieldFunction(const RankTwoTensor & stress,
80  const std::vector<Real> & intnl,
81  const std::vector<bool> & active,
82  std::vector<Real> & f);
83 
92  virtual void dyieldFunction_dstress(const RankTwoTensor & stress,
93  const std::vector<Real> & intnl,
94  const std::vector<bool> & active,
95  std::vector<RankTwoTensor> & df_dstress);
96 
105  virtual void dyieldFunction_dintnl(const RankTwoTensor & stress,
106  const std::vector<Real> & intnl,
107  const std::vector<bool> & active,
108  std::vector<Real> & df_dintnl);
109 
117  virtual void flowPotential(const RankTwoTensor & stress,
118  const std::vector<Real> & intnl,
119  const std::vector<bool> & active,
120  std::vector<RankTwoTensor> & r);
121 
130  virtual void dflowPotential_dstress(const RankTwoTensor & stress,
131  const std::vector<Real> & intnl,
132  const std::vector<bool> & active,
133  std::vector<RankFourTensor> & dr_dstress);
134 
143  virtual void dflowPotential_dintnl(const RankTwoTensor & stress,
144  const std::vector<Real> & intnl,
145  const std::vector<bool> & active,
146  std::vector<RankTwoTensor> & dr_dintnl);
147 
158  virtual void hardPotential(const RankTwoTensor & stress,
159  const std::vector<Real> & intnl,
160  const std::vector<bool> & active,
161  std::vector<Real> & h);
162 
172  virtual void dhardPotential_dstress(const RankTwoTensor & stress,
173  const std::vector<Real> & intnl,
174  const std::vector<bool> & active,
175  std::vector<RankTwoTensor> & dh_dstress);
176 
187  virtual void dhardPotential_dintnl(const RankTwoTensor & stress,
188  const std::vector<Real> & intnl,
189  const std::vector<bool> & active,
190  std::vector<Real> & dh_dintnl);
191 
202  virtual void buildActiveConstraints(const std::vector<Real> & f,
203  const RankTwoTensor & stress,
204  const std::vector<Real> & intnl,
205  const RankFourTensor & Eijkl,
206  std::vector<bool> & act);
207 
209  unsigned int modelNumber(unsigned int surface);
210 
212  bool anyActiveSurfaces(int model, const std::vector<bool> & active);
213 
221  void activeModelSurfaces(int model,
222  const std::vector<bool> & active,
223  std::vector<unsigned int> & active_surfaces_of_model);
224 
232  void activeSurfaces(int model,
233  const std::vector<bool> & active,
234  std::vector<unsigned int> & active_surfaces);
235 
275  bool returnMapAll(const RankTwoTensor & trial_stress,
276  const std::vector<Real> & intnl_old,
277  const RankFourTensor & E_ijkl,
278  Real ep_plastic_tolerance,
279  RankTwoTensor & stress,
280  std::vector<Real> & intnl,
281  std::vector<Real> & pm,
282  std::vector<Real> & cumulative_pm,
283  RankTwoTensor & delta_dp,
284  std::vector<Real> & yf,
285  unsigned & num_successful_plastic_returns,
286  unsigned & custom_model);
287 
288 private:
290  std::vector<unsigned int> _model_given_surface;
291 
293  std::vector<unsigned int> _model_surface_given_surface;
294 
306  void buildActiveConstraintsRock(const std::vector<Real> & f,
307  const RankTwoTensor & stress,
308  const std::vector<Real> & intnl,
309  const RankFourTensor & Eijkl,
310  std::vector<bool> & act);
311 
323  void buildActiveConstraintsJoint(const std::vector<Real> & f,
324  const RankTwoTensor & stress,
325  const std::vector<Real> & intnl,
326  const RankFourTensor & Eijkl,
327  std::vector<bool> & act);
328 };
std::vector< std::vector< unsigned int > > _surfaces_given_model
_surfaces_given_model[model_number] = vector of surface numbers for this model
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=...
std::vector< unsigned int > _model_surface_given_surface
given a surface number, this returns the corresponding-model&#39;s internal surface number ...
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.
MooseEnum _specialIC
Allows initial set of active constraints to be chosen optimally.
unsigned int modelNumber(unsigned int surface)
returns the model number, given the surface number
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.
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...
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.
std::vector< unsigned int > _model_given_surface
given a surface number, this returns the model number
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)
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...
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...
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, f.
unsigned int _num_surfaces
Number of surfaces within the plastic models.
MultiPlasticityRawComponentAssembler holds and computes yield functions, flow directions, etc, for use in FiniteStrainMultiPlasticity.
Real f(Real x)
Test function for Brents method.
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...
bool anyActiveSurfaces(int model, const std::vector< bool > &active)
returns true if any internal surfaces of the given model are active according to &#39;active&#39; ...
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.
const PertinentGeochemicalSystem model(database, {"H2O", "H+", "HCO3-", "O2(aq)", "Ca++", ">(s)FeOH", "radius_neg1", "radius_neg1.5"}, {"Calcite"}, {}, {"Calcite_asdf"}, {"CH4(aq)"}, {">(s)FeOCa+"}, "O2(aq)", "e-")
unsigned int _num_models
Number of plastic models for this material.
MultiPlasticityRawComponentAssembler(const MooseObject *moose_object)
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.
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...
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...
std::vector< const SolidMechanicsPlasticModel * > _f
User objects that define the yield functions, flow potentials, etc.
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=...