www.mooseframework.org
GeneralizedPlaneStrain.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 
10 // MOOSE includes
11 #include "Assembly.h"
13 #include "MooseVariableScalar.h"
14 #include "SystemBase.h"
15 
16 template <>
17 InputParameters
19 {
20  InputParameters params = validParams<ScalarKernel>();
21  params.addClassDescription("Generalized Plane Strain Scalar Kernel");
22  params.addRequiredParam<UserObjectName>("generalized_plane_strain",
23  "The name of the GeneralizedPlaneStrainUserObject");
24  params.addParam<unsigned int>(
25  "scalar_out_of_plane_strain_index",
26  "The index number of scalar_out_of_plane_strain this kernel acts on");
27 
28  return params;
29 }
30 
31 GeneralizedPlaneStrain::GeneralizedPlaneStrain(const InputParameters & parameters)
32  : ScalarKernel(parameters),
33  _gps(getUserObject<GeneralizedPlaneStrainUserObject>("generalized_plane_strain")),
34  _scalar_var_id(isParamValid("scalar_out_of_plane_strain_index")
35  ? getParam<unsigned int>("scalar_out_of_plane_strain_index")
36  : 0)
37 {
38 }
39 
40 void
42 {
43  DenseVector<Number> & re = _assembly.residualBlock(_var.number());
44  for (_i = 0; _i < re.size(); ++_i)
46 }
47 
53 void
55 {
56  DenseMatrix<Number> & ke = _assembly.jacobianBlock(_var.number(), _var.number());
57  for (_i = 0; _i < ke.m(); ++_i)
58  ke(_i, _i) += _gps.returnJacobian(_scalar_var_id);
59 }
virtual Real returnJacobian(unsigned int scalar_var_id=0) const
const unsigned int _scalar_var_id
virtual Real returnResidual(unsigned int scalar_var_id=0) const
virtual void computeJacobian()
method to provide the diagonal jacobian term for scalar variable using value returned from Postproces...
const GeneralizedPlaneStrainUserObject & _gps
GeneralizedPlaneStrain(const InputParameters &parameters)
InputParameters validParams< GeneralizedPlaneStrain >()