19 #include "libmesh/string_to_enum.h" 28 "The variable on the primary side of the domain");
41 _secondary(_mesh.
getSubdomainID(getParam<SubdomainName>(
"secondary"))),
42 _primary(_mesh.
getSubdomainID(getParam<SubdomainName>(
"primary"))),
43 _var(_sys.getFieldVariable<
Real>(_tid, parameters.
get<NonlinearVariableName>(
"variable"))),
45 _primary_q_point(_assembly.qPoints()),
46 _primary_qrule(_assembly.qRule()),
48 _current_node(_var.node()),
49 _current_elem(_var.neighbor()),
51 _u_secondary(_var.dofValues()),
52 _u_secondary_old(_var.dofValuesOld()),
56 _primary_var(*getVar(
"primary_variable", 0)),
57 _primary_var_num(_primary_var.number()),
59 _phi_primary(_assembly.phiNeighbor(_primary_var)),
60 _grad_phi_primary(_assembly.gradPhiNeighbor(_primary_var)),
62 _test_primary(_var.phiNeighbor()),
63 _grad_test_primary(_var.gradPhiNeighbor()),
65 _u_primary(_primary_var.slnNeighbor()),
66 _u_primary_old(_primary_var.slnOldNeighbor()),
67 _grad_u_primary(_primary_var.gradSlnNeighbor()),
69 _dof_map(_sys.dofMap()),
70 _node_to_elem_map(_mesh.nodeToElemMap()),
72 _overwrite_secondary_residual(false)
184 std::set<dof_id_type> unique_dof_indices;
187 mooseAssert(node_to_elem_pair !=
_node_to_elem_map.end(),
"Missing entry in node to elem map");
188 const std::vector<dof_id_type> & elems = node_to_elem_pair->second;
191 for (
const auto & cur_elem : elems)
193 std::vector<dof_id_type> dof_indices;
197 for (
const auto & dof : dof_indices)
198 unique_dof_indices.insert(dof);
201 for (
const auto & dof : unique_dof_indices)
MooseMesh & _mesh
Reference to this Kernel's mesh object.
virtual Real computeQpOffDiagJacobian(Moose::ConstraintJacobianType, unsigned int)
This is the virtual that derived classes should override for computing the off-diag Jacobian...
static InputParameters validParams()
NodeElemConstraint(const InputParameters ¶meters)
const VariableTestValue & _test_primary
Side test function.
void accumulateTaggedLocalResidual()
Local residual blocks will be appended by adding the current local kernel residual.
virtual Elem * elemPtr(const dof_id_type i)
bool _overwrite_secondary_residual
Whether or not the secondary's residual should be overwritten.
DenseMatrix< Number > _Kee
stiffness matrix holding secondary-secondary jacobian
unsigned int number() const
Get variable number coming from libMesh.
virtual Real computeQpResidual(Moose::ConstraintType type)=0
This is the virtual that derived classes should override for computing the residual.
const std::map< dof_id_type, std::vector< dof_id_type > > & _node_to_elem_map
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
Base class for all Constraint types.
virtual void computeJacobian() override
Computes the jacobian for the current element.
virtual void getDofIndices(const Elem *, std::vector< dof_id_type > &) const
virtual Real computeQpJacobian(Moose::ConstraintJacobianType type)=0
This is the virtual that derived classes should override for computing the Jacobian.
This class provides an interface for common operations on field variables of both FE and FV types wit...
virtual const dof_id_type & nodalDofIndex() const =0
virtual bool overwriteSecondaryResidual()
Whether or not the secondary's residual should be overwritten.
DenseMatrix< Number > _local_ke
Holds local Jacobian entries as they are accumulated by this Kernel.
SubdomainID getSubdomainID(const SubdomainName &subdomain_name, const MeshBase &mesh)
Gets the subdomain ID associated with the given SubdomainName.
virtual Real computeQpSecondaryValue()=0
Compute the value the secondary node should have at the beginning of a timestep.
SystemBase & _sys
Reference to the EquationSystem object.
void prepareMatrixTagNeighbor(Assembly &assembly, unsigned int ivar, unsigned int jvar, Moose::DGJacobianType type)
Prepare data for computing element jacobian according to the active tags for DG and interface kernels...
virtual void getConnectedDofIndices(unsigned int var_num)
Gets the indices for all dofs connected to the constraint.
void errorIfDistributedMesh(std::string name) const
Generate a unified error message if the underlying libMesh mesh is a DistributedMesh.
Enhances MooseVariableInterface interface provide values from neighbor elements.
unsigned int size() const
The number of elements that can currently be stored in the array.
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes d-residual / d-jvar...
VarKindType
Framework-wide stuff.
virtual ~NodeElemConstraint()
void accumulateTaggedLocalMatrix()
Local Jacobian blocks will be appended by adding the current local kernel Jacobian.
Assembly & _assembly
Reference to this Kernel's assembly object.
MooseVariable & _primary_var
Primary side variable.
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
const VariablePhiValue & _phi_primary
Side shape function.
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 dof_id_type & nodalDofIndex() const override
void computeSecondaryValue(NumericVector< Number > ¤t_solution)
Compute the value the secondary node should have at the beginning of a timestep.
virtual void computeResidual() override
Computes the residual Nodal residual.
void release()
Manually deallocates the data pointer.
const Node *const & _current_node
current node being processed
std::vector< dof_id_type > _connected_dof_indices
dofs connected to the secondary node
DenseVector< Number > _local_re
Holds local residual entries as they are accumulated by this Kernel.
void resize(const unsigned int new_m, const unsigned int new_n)
void resize(unsigned int size)
Change the number of elements the array can store.
virtual void set(const numeric_index_type i, const Number value)=0
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
MooseVariableFieldBase & getVariable(THREAD_ID tid, const std::string &var_name) const
Gets a reference to a variable of with specified name.
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual according to active tags.
VariableTestValue _test_secondary
Shape function on the secondary side. This will always only have one entry and that entry will always...
DenseMatrix< Number > _Kne
stiffness matrix holding primary-secondary jacobian
VariablePhiValue _phi_secondary
Shape function on the secondary side.
static InputParameters validParams()