https://mooseframework.inl.gov
Loading...
Searching...
No Matches
EqualGradientLagrangeMultiplier.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 "MooseVariable.h"
14
16
19{
21 params.addClassDescription("Lagrange multiplier kernel for EqualGradientLagrangeInterface.");
22 params.addRequiredParam<unsigned int>("component", "Gradient component to constrain");
23 params.addCoupledVar("element_var",
24 "The gradient constrained variable on this side of the interface.");
25 params.addParam<Real>("jacobian_fill",
26 0.0,
27 "Compensate on diagonal Jacobian fill term when "
28 "using a NullKernel on the Lagrange multiplier "
29 "variable");
30 return params;
31}
32
34 : InterfaceKernel(parameters),
35 _component(getParam<unsigned int>("component")),
36 _grad_element_value(getVar("element_var", 0)->gradSln()),
37 _element_jvar(getVar("element_var", 0)->number()),
38 _neighbor_jvar(_neighbor_var.number()),
39 _jacobian_fill(getParam<Real>("jacobian_fill"))
40{
41}
42
43Real
52
53Real
64
65Real
67 unsigned int jvar)
68{
70 return _grad_phi[_j][_qp](_component) * _test[_i][_qp];
71
72 return 0.0;
73}
registerMooseObject("PhaseFieldApp", EqualGradientLagrangeMultiplier)
void ErrorVector unsigned int
Lagrange multiplier "FaceKernel" that is used in conjunction with EqualGradientLagrangeInterface.
virtual Real computeQpOffDiagJacobian(Moose::DGJacobianType type, unsigned int jvar) override
const Real _jacobian_fill
compensate Jacobian fill term from NullKernel
EqualGradientLagrangeMultiplier(const InputParameters &parameters)
const VariableGradient & _grad_element_value
variable to control gradient on the primary side of the interface
const unsigned int _component
x,y,z component of the gradient to constrain
virtual Real computeQpResidual(Moose::DGResidualType type) override
virtual Real computeQpJacobian(Moose::DGJacobianType type) override
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)
void addCoupledVar(const std::string &name, const std::string &doc_string)
const TemplateVariablePhiGradient & _grad_phi_neighbor
const TemplateVariablePhiGradient & _grad_phi
const TemplateVariableGradient & _grad_neighbor_value
static InputParameters validParams()
const TemplateVariableTestValue & _test
const std::string & type() const
DGResidualType
DGJacobianType
ElementElement
ElementNeighbor