https://mooseframework.inl.gov
Loading...
Searching...
No Matches
GeneralizedPlaneStrain.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
12// MOOSE includes
13#include "Assembly.h"
15#include "MooseVariableScalar.h"
16#include "SystemBase.h"
18#include "InputParameters.h"
19
20#include <algorithm>
21
23
26{
28 params.addClassDescription("Generalized Plane Strain Scalar Kernel");
29 params.addRequiredParam<UserObjectName>("generalized_plane_strain",
30 "The name of the GeneralizedPlaneStrainUserObject");
31 params.addParam<unsigned int>(
32 "scalar_out_of_plane_strain_index",
33 "The index number of scalar_out_of_plane_strain this kernel acts on");
34
35 return params;
36}
37
39 : ScalarKernel(parameters),
40 _gps(getUserObject<GeneralizedPlaneStrainUOInterface>("generalized_plane_strain")),
41 _scalar_var_id(isParamValid("scalar_out_of_plane_strain_index")
42 ? getParam<unsigned int>("scalar_out_of_plane_strain_index")
43 : 0)
44{
45}
46
47void
49{
50 prepareVectorTag(_assembly, _var.number(), TaggingInterface::ResidualTagType::NonReference);
51 for (_i = 0; _i < _local_re.size(); ++_i)
54
55 prepareVectorTag(_assembly, _var.number(), TaggingInterface::ResidualTagType::Reference);
56 for (_i = 0; _i < _local_re.size(); ++_i)
59}
60
66void
registerMooseObject("SolidMechanicsApp", GeneralizedPlaneStrain)
void ErrorVector unsigned int
Interface class for user objects that interface with the generalized plane strain kernel.
virtual Real returnResidual(unsigned int scalar_var_id=0) const =0
virtual Real returnReferenceResidual(unsigned int scalar_var_id=0) const =0
virtual Real returnJacobian(unsigned int scalar_var_id=0) const =0
virtual void computeResidual() override
GeneralizedPlaneStrain(const InputParameters &parameters)
virtual void computeJacobian() override
method to provide the diagonal jacobian term for scalar variable using value returned from Postproces...
static InputParameters validParams()
const GeneralizedPlaneStrainUOInterface & _gps
const unsigned int _scalar_var_id
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)
unsigned int number() const
Assembly & _assembly
unsigned int _i
MooseVariableScalar & _var
static InputParameters validParams()
DenseMatrix< Number > _local_ke
void accumulateTaggedLocalMatrix()
void prepareMatrixTag(Assembly &assembly, unsigned int ivar, unsigned int jvar)
void accumulateTaggedLocalResidual()
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
DenseVector< Number > _local_re
unsigned int m() const
virtual unsigned int size() const override final