https://mooseframework.inl.gov
Loading...
Searching...
No Matches
LinearViscoelasticityManager.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
11#include "libmesh/quadrature.h"
12
14
17{
19 params.addClassDescription("Manages the updating of the semi-implicit "
20 "single-step first-order finite difference "
21 "time-stepping scheme");
22 params.addRequiredParam<std::string>("viscoelastic_model",
23 "name of the LinearViscoelasticityBase object to manage");
24 params.addParam<std::string>(
25 "stress_name", "stress", "name of the stress tensor used for the viscoelastic update");
26 params.addParam<std::string>("creep_strain_name",
27 "creep_strain",
28 "name of the creep strain tensor used for the viscoelastic update");
29 params.addParam<std::string>(
30 "elastic_strain_name",
31 "elastic_strain",
32 "name of the elastic strain tensor used for the viscoelastic update");
33 params.set<ExecFlagEnum>("execute_on") = {EXEC_TIMESTEP_BEGIN, EXEC_TIMESTEP_END};
34 params.suppressParameter<ExecFlagEnum>("execute_on");
35 return params;
36}
37
39 : ElementUserObject(parameters),
40 _stress_name(getParam<std::string>("stress_name")),
41 _stress(getMaterialPropertyByName<RankTwoTensor>(_stress_name)),
42 _creep_strain_name(getParam<std::string>("creep_strain_name")),
43 _creep_strain(getMaterialPropertyByName<RankTwoTensor>(_creep_strain_name)),
44 _elastic_strain_name(getParam<std::string>("elastic_strain_name")),
45 _elastic_strain(getMaterialPropertyByName<RankTwoTensor>(_elastic_strain_name)),
46 _viscoelastic_model_name(getParam<std::string>("viscoelastic_model")),
47 _viscoelastic_model(nullptr)
48{
49}
50
51void
53{
54 MaterialBase * test = &getMaterialByName(_viscoelastic_model_name, /*no_warn =*/true);
55 if (!test)
56 mooseError(_viscoelastic_model_name + " does not exist");
57
58 _viscoelastic_model = dynamic_cast<LinearViscoelasticityBase *>(test);
60 mooseError(_viscoelastic_model_name + " is not a LinearViscoelasticityBase object");
61}
62
63void
65{
67 {
68 for (unsigned int _qp = 0; _qp < _qrule->n_points(); ++_qp)
70 }
71}
registerMooseObject("SolidMechanicsApp", LinearViscoelasticityManager)
const ExecFlagType EXEC_TIMESTEP_END
const ExecFlagType EXEC_TIMESTEP_BEGIN
static InputParameters validParams()
const QBase *const & _qrule
const ExecFlagType & getCurrentExecuteOnFlag() const
void suppressParameter(const std::string &name)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
This class is a base class for materials consisting of an assembly of linear springs and dashpots.
void recomputeQpApparentProperties(unsigned int qp)
Compute the apparent properties at a quadrature point.
This class manages a LinearViscoelasticityBase object.
LinearViscoelasticityBase * _viscoelastic_model
Pointer to the viscoelastic model to update.
std::string _viscoelastic_model_name
Name of the viscoelastic model to update.
LinearViscoelasticityManager(const InputParameters &parameters)
MaterialBase & getMaterialByName(const std::string &name, bool no_warn=false)
FEProblemBase & _mi_feproblem
void mooseError(Args &&... args) const