36 "subdomain1",
"The subdomains on the 1st side of the boundary.");
38 "subdomain2",
"The subdomains on the 2nd side of the boundary.");
40 "variable1",
"The name of the first variable that this interface kernel applies to");
41 params.
addParam<NonlinearVariableName>(
43 "The name of the second variable that this interface kernel applies to. If not supplied, " 44 "variable1 will be used.");
45 params.
addParam<
bool>(
"use_displaced_mesh",
47 "Whether or not this object should use the " 48 "displaced mesh for computation. Note that " 49 "in the case this is true but no " 50 "displacements are provided in the Mesh block " 51 "the undisplaced mesh will still be used.");
53 params.
addParam<
unsigned short>(
"ghost_layers", 1,
"The number of layers of elements to ghost.");
54 params.
addParam<
bool>(
"use_point_neighbors",
56 "Whether to use point neighbors, which introduces additional ghosting to " 57 "that used for simple face neighbors.");
64 "ElementSideNeighborLayers",
69 rm_params.
set<
unsigned short>(
"layers") = obj_params.
get<
unsigned short>(
"ghost_layers");
70 rm_params.
set<
bool>(
"use_point_neighbors") = obj_params.
get<
bool>(
"use_point_neighbors");
78 params.
set<
bool>(
"_residual_object") =
true;
96 this, false, false, true),
100 _subproblem(*getCheckedPointerParam<
SubProblem *>(
"_subproblem")),
101 _var1(_subproblem.getVariable(_tid, getParam<NonlinearVariableName>(
"variable1"))
103 .getFVVariable<
Real>(_tid, getParam<NonlinearVariableName>(
"variable1"))),
106 isParamValid(
"variable2") ? getParam<NonlinearVariableName>(
"variable2")
107 : getParam<NonlinearVariableName>(
"variable1"))
109 .getFVVariable<
Real>(_tid,
110 isParamValid(
"variable2")
111 ? getParam<NonlinearVariableName>(
"variable2")
112 : getParam<NonlinearVariableName>(
"variable1"))),
113 _assembly(_subproblem.assembly(_tid, _var1.sys().number())),
114 _mesh(_subproblem.
mesh())
116 if (getParam<bool>(
"use_displaced_mesh"))
117 paramError(
"use_displaced_mesh",
"FV interface kernels do not yet support displaced mesh");
123 for (
const auto & sub_name :
getParam<std::vector<SubdomainName>>(
"subdomain1"))
125 for (
const auto & sub_name :
getParam<std::vector<SubdomainName>>(
"subdomain2"))
130 "variable1 does not exist on all the blocks specified by the subdomain1 parameter");
134 const std::string var_name = var2_provided ?
"variable2" :
"variable1";
137 " does not exist on all the blocks specified by the subdomain2 parameter",
139 :
".\nNote that you did not provide the variable2 parameter, " 140 "so variable1 was implicitly used on subdomain2");
158 (
_elem_is_one && (ft1 == ft_elem || ft1 == ft_both) && (ft2 == ft_neigh || ft2 == ft_both)) ||
159 (!
_elem_is_one && (ft1 == ft_neigh || ft1 == ft_both) &&
160 (ft2 == ft_elem || ft2 == ft_both)),
161 "Face type was not recognized. Check that the specified boundaries are interfaces.");
176 const Real scaling_factor)
179 std::array<ADReal, 1>{{resid}},
180 std::array<dof_id_type, 1>{{dof_index}},
194 "The interface kernel should contribute to the system which variable1 belongs to!");
216 "The interface kernel should contribute to the system which variable1 belongs to!");
244 const bool correct_skewness,
250 const bool defined_on_elem_side = variable.
hasBlocks(fi->
elem().subdomain_id());
251 bool defined_on_neighbor_side =
false;
255 const Elem *
const elem = defined_on_elem_side && defined_on_neighbor_side
259 return {fi, limiter_type,
true, correct_skewness, elem, state_limiter};
virtual const std::vector< dof_id_type > & dofIndicesNeighbor() const final
Get neighbor DOF indices for currently selected element.
MooseVariableFV< Real > & _var1
const FaceInfo * _face_info
The face that this object is currently operating on.
MooseVariableFV< Real > & _var2
A class for requiring an object to be boundary restricted.
void addResidualsAndJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided incoming residuals and derivatives for the Jacobian, corresponding to the provided d...
static InputParameters validParams()
void computeResidual(const FaceInfo &fi) override
Compute the residual on the supplied face.
virtual void haveADObjects(bool have_ad_objects)
Method for setting whether we have any ad objects.
void accumulateTaggedLocalResidual()
Local residual blocks will be appended by adding the current local kernel residual.
unsigned int number() const
Get variable number coming from libMesh.
virtual unsigned int currentNlSysNum() const =0
std::set< SubdomainID > _subdomain1
const Elem & elem() const
virtual ADReal computeQpResidual()=0
std::set< SubdomainID > _subdomain2
static InputParameters validParams()
Real & faceCoord()
Sets/gets the coordinate transformation factor (for e.g.
static InputParameters validParams()
static InputParameters validParams()
static InputParameters validParams()
DualNumber< Real, DNDerivativeType, true > ADReal
Real faceArea() const
Returns the face area of face id.
static InputParameters validParams()
bool _elem_is_one
Whether the current element is associated with variable/subdomain 1 or 2.
An interface for accessing Moose::Functors for systems that care about automatic differentiation, e.g.
Assembly & _assembly
The Assembly object.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Interface for objects that needs transient capabilities.
This data structure is used to store geometric and variable related metadata about each cell face in ...
static InputParameters validParams()
const Elem * neighborPtr() const
SubProblem & _subproblem
The SubProblem.
Interface for notifications that the mesh has changed.
void computeJacobian(const FaceInfo &fi) override
Compute the jacobian on the supplied face.
A structure defining a "face" evaluation calling argument for Moose functors.
Every object that can be built by the factory should be derived from this class.
Interface for objects that need to use distributions.
void computeResidualAndJacobian(const FaceInfo &fi) override
Compute the residual and Jacobian on the supplied face.
const Elem & neighbor() const
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
A structure that is used to evaluate Moose functors logically at an element/cell center.
Interface for objects that need to use UserObjects.
const Point & normal() const
Returns the unit normal vector for the face oriented outward from the face's elem element...
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
unsigned int number() const
Gets the number of this system.
static InputParameters validParams()
static InputParameters validParams()
ADRealVectorValue _normal
The normal.
void setupData(const FaceInfo &fi)
setup data useful for this object
const Elem * elemPtr() const
static InputParameters validParams()
Moose::ElemArg neighborArg(bool correct_skenewss=false) const
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
void prepareVectorTagNeighbor(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual the according to active tags for DG and interface kernels...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::set< SubdomainID > EMPTY_BLOCK_IDS
Generic class for solving transient nonlinear problems.
bool hasBlocks(const SubdomainID id) const override
Returns whether the functor is defined on this block.
Moose::FaceArg singleSidedFaceArg(const MooseVariableFV< Real > &variable, const FaceInfo *fi=nullptr, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false, const Moose::StateArg *state_limiter=nullptr) const
Determine the single sided face argument when evaluating a functor on a face.
static InputParameters validParams()
DenseVector< Number > _local_re
Holds local residual entries as they are accumulated by this Kernel.
Moose::ElemArg elemArg(bool correct_skewness=false) const
bool hasFaceSide(const FaceInfo &fi, bool fi_elem_side) const override
This interface is designed for DGKernel, InternalSideUserObject, InterfaceUserObject, where material properties on a side of both its primary side (face) and its secondary side (neighbor) all required.
State argument for evaluating functors.
void addJacobian(const ADReal &resid, dof_id_type dof_index, Real scaling_factor)
Process the derivatives for the provided residual and dof index.
FVInterfaceKernel(const InputParameters ¶meters)
Class constructor.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
static InputParameters validParams()
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual according to active tags.
void addResidual(Real resid, unsigned int var_num, bool neighbor)
Process the provided residual given var_num and whether this is on the neighbor side.
static InputParameters validParams()
static InputParameters validParams()
SystemBase & sys()
Get the system this variable is part of.
Interface for objects that need to use functions.
void scalingFactor(const std::vector< Real > &factor)
Set the scaling factor for this variable.
Interface class for classes which interact with Postprocessors.
virtual const std::vector< dof_id_type > & dofIndices() const final
Get local DoF indices.
static InputParameters validParams()
VarFaceNeighbors faceType(const std::pair< unsigned int, unsigned int > &var_sys) const
Returns which side(s) the given variable-system number pair is defined on for this face...
SubdomainID getSubdomainID(const SubdomainName &subdomain_name) const
Get the associated subdomain ID for the subdomain name.