https://mooseframework.inl.gov
Loading...
Searching...
No Matches
EqualGradientLagrangeInterface.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("Enforce componentwise gradient continuity between two different "
22 "variables across a subdomain boundary using a Lagrange multiplier");
23 params.addRequiredParam<unsigned int>("component", "Gradient component to constrain");
24 params.addCoupledVar("lambda",
25 "The gradient constrained variable on this side of the interface.");
26 return params;
27}
28
30 : InterfaceKernel(parameters),
31 _component(getParam<unsigned int>("component")),
32 _lambda(getVar("lambda", 0)->sln()),
33 _lambda_jvar(getVar("lambda", 0)->number())
34{
35}
36
37Real
39{
40 switch (type)
41 {
42 case Moose::Element:
44
45 case Moose::Neighbor:
47 }
48
49 mooseError("Internal error.");
50}
51
52Real
57
58Real
60 unsigned int jvar)
61{
62 if (jvar != _lambda_jvar)
63 return 0.0;
64
65 // lambda is only solved on the element side
66 switch (type)
67 {
69 return _phi[_j][_qp] * _grad_test[_i][_qp](_component);
70
73
74 default:
75 return 0.0;
76 }
77}
registerMooseObject("PhaseFieldApp", EqualGradientLagrangeInterface)
void ErrorVector unsigned int
InterfaceKernel to enforce a Lagrange-Multiplier based componentwise continuity of a variable gradien...
virtual Real computeQpOffDiagJacobian(Moose::DGJacobianType type, unsigned int jvar) override
const VariableValue & _lambda
Lagrange multiplier.
virtual Real computeQpResidual(Moose::DGResidualType type) override
virtual Real computeQpJacobian(Moose::DGJacobianType type) override
EqualGradientLagrangeInterface(const InputParameters &parameters)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
const TemplateVariableTestGradient & _grad_test_neighbor
const TemplateVariableTestGradient & _grad_test
static InputParameters validParams()
const TemplateVariablePhiValue & _phi
const std::string & type() const
void mooseError(Args &&... args) const
DGResidualType
DGJacobianType
ElementElement
NeighborElement