https://mooseframework.inl.gov
Loading...
Searching...
No Matches
InterfaceKernelBase.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
10#include "InterfaceKernelBase.h"
11
12// MOOSE includes
13#include "Assembly.h"
14#include "MooseVariableFE.h"
15#include "SystemBase.h"
16
17#include "libmesh/quadrature.h"
18
21{
25
26 params.addParam<bool>("use_displaced_mesh",
27 false,
28 "Whether or not this object should use the "
29 "displaced mesh for computation. Note that in "
30 "the case this is true but no displacements "
31 "are provided in the Mesh block the "
32 "undisplaced mesh will still be used.");
33 params.addParamNamesToGroup("use_displaced_mesh", "Advanced");
34
35 params.declareControllable("enable");
36 params.addRequiredCoupledVar("neighbor_var", "The variable on the other side of the interface.");
37 params.registerBase("InterfaceKernel");
38 params.registerSystemAttributeName("InterfaceKernel");
39 params.addDeprecatedParam<std::vector<AuxVariableName>>(
40 "save_in",
41 {},
42 "The name of auxiliary variables to save this Kernel's residual contributions to. "
43 " Everything about that variable must match everything about this variable (the "
44 "type, what blocks it's on, etc.)",
45 "Add this object's residual to a tagged vector with 'extra_vector_tags', then transfer that "
46 "vector into an auxiliary variable with a TagVectorAux");
47 params.addDeprecatedParam<std::vector<AuxVariableName>>(
48 "diag_save_in",
49 {},
50 "The name of auxiliary variables to save this Kernel's diagonal Jacobian "
51 "contributions to. Everything about that variable must match everything "
52 "about this variable (the type, what blocks it's on, etc.)",
53 "Add this object's Jacobian to a tagged matrix with 'extra_matrix_tags', then transfer that "
54 "matrix diagonal into an auxiliary variable with a TagMatrixAux");
55
56 MultiMooseEnum save_in_var_side("m s");
58 "save_in_var_side",
59 save_in_var_side,
60 "This parameter must exist if save_in variables are specified and must have the same length "
61 "as save_in. This vector specifies whether the corresponding aux_var should save-in "
62 "residual contributions from the primary ('p') or secondary side ('s').",
63 "Add this object's residual to a tagged vector with 'extra_vector_tags', then transfer that "
64 "vector into an auxiliary variable with a TagVectorAux");
66 "diag_save_in_var_side",
67 save_in_var_side,
68 "This parameter must exist if diag_save_in variables are specified and must have the same "
69 "length as diag_save_in. This vector specifies whether the corresponding aux_var should "
70 "save-in jacobian contributions from the primary ('p') or secondary side ('s').",
71 "Add this object's Jacobian to a tagged matrix with 'extra_matrix_tags', then transfer that "
72 "matrix diagonal into an auxiliary variable with a TagMatrixAux");
73 params.addParamNamesToGroup("diag_save_in save_in save_in_var_side diag_save_in_var_side",
74 "Residual and Jacobian debug output");
75
76 // InterfaceKernels always need one layer of ghosting.
77 params.addRelationshipManager("ElementSideNeighborLayers",
81 return params;
82}
83
85 : NeighborResidualObject(parameters),
86 BoundaryRestrictable(this, false), // false for _not_ nodal
88 TwoMaterialPropertyInterface(this, Moose::EMPTY_BLOCK_IDS, boundaryIDs()),
90 _current_elem(_assembly.elem()),
91 _current_elem_volume(_assembly.elemVolume()),
92 _neighbor_elem(_assembly.neighbor()),
93 _neighbor_elem_volume(_assembly.neighborVolume()),
94 _current_side(_assembly.side()),
95 _current_side_elem(_assembly.sideElem()),
96 _current_side_volume(_assembly.sideElemVolume()),
97 _coord_sys(_assembly.coordSystem()),
98 _q_point(_assembly.qPointsFace()),
99 _qrule(_assembly.qRuleFace()),
100 _JxW(_assembly.JxWFace()),
101 _coord(_assembly.coordTransformation()),
102 _save_in_var_side(parameters.get<MultiMooseEnum>("save_in_var_side")),
103 _save_in_strings(parameters.get<std::vector<AuxVariableName>>("save_in")),
104 _diag_save_in_var_side(parameters.get<MultiMooseEnum>("diag_save_in_var_side")),
105 _diag_save_in_strings(parameters.get<std::vector<AuxVariableName>>("diag_save_in"))
106{
107}
108
109const Real &
114
115void
116InterfaceKernelBase::prepareShapes(const unsigned int var_num)
117{
119}
const Real & neighborVolume()
Returns the reference to the current neighbor volume.
Definition Assembly.h:504
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void registerSystemAttributeName(const std::string &value)
This method is used to define the MOOSE system name that is used by the TheWarehouse object for stori...
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Declare the given parameters as controllable.
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
This method takes a space delimited list of parameter names and adds them to the specified group name...
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
void registerBase(const std::string &value)
This method must be called from every base "Moose System" to create linkage with the Action System.
void addRelationshipManager(const std::string &name, Moose::RelationshipManagerType rm_type, Moose::RelationshipManagerInputParameterCallback input_parameter_callback=nullptr)
Tells MOOSE about a RelationshipManager that this object needs.
static InputParameters validParams()
void prepareShapes(unsigned int var_num) override final
Prepare shape functions.
InterfaceKernelBase(const InputParameters &parameters)
const Real & getNeighborElemVolume()
The volume of the current neighbor.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type.
Intermediate base class that ties together all the interfaces for getting MooseVariables with the Moo...
This is a base class for objects that can provide residual contributions for both local and neighbor ...
static InputParameters validParams()
THREAD_ID _tid
The thread ID for this kernel.
Assembly & _assembly
Reference to this Kernel's assembly object.
SubProblem & _subproblem
Reference to this kernel's SubProblem.
virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid)=0
This interface is designed for DGKernel, InternalSideUserObject, InterfaceUserObject,...
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...