https://mooseframework.inl.gov
NodeElemConstraintBase.h
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 #pragma once
11 
12 // MOOSE includes
13 #include "Constraint.h"
15 
16 namespace libMesh
17 {
18 template <typename T>
19 class SparseMatrix;
20 }
21 
28  : public Constraint,
31 {
32 public:
34 
37 
39  void computeSecondaryValue(NumericVector<Number> & current_solution);
40 
45  virtual bool shouldApply() { return true; }
46 
52  virtual bool overwriteSecondaryResidual() const;
53 
59  virtual bool overwriteSecondaryJacobian() const { return overwriteSecondaryResidual(); };
60 
65  virtual MooseVariable & primaryVariable() const { return _primary_var; }
66 
70  const MooseVariable & variable() const override { return _var; }
71 
72 protected:
74  virtual Real computeQpSecondaryValue() = 0;
75 
80 
82  unsigned short _secondary;
84  unsigned short _primary;
85 
87  const Node * const & _current_node;
89  const Elem * const & _current_elem;
90 
95 
98 
101 
103  const std::map<dof_id_type, std::vector<dof_id_type>> & _node_to_elem_map;
104 
106  std::map<dof_id_type, dof_id_type> _secondary_to_primary_map;
107 
115 
116 public:
120  std::vector<dof_id_type> _connected_dof_indices;
125 };
std::map< dof_id_type, dof_id_type > _secondary_to_primary_map
maps secondary node ids to primary element ids
const Elem *const & _current_elem
current element being processed
virtual bool shouldApply()
Whether or not this constraint should be applied.
const MooseVariable & variable() const override
The variable number that this object operates on.
virtual bool overwriteSecondaryResidual() const
Whether or not the secondary&#39;s residual should be overwritten.
Class for stuff related to variables.
Definition: Adaptivity.h:31
Intermediate base class that ties together all the interfaces for getting MooseVariables with the Moo...
Base class for all Constraint types.
Definition: Constraint.h:19
virtual MooseVariable & primaryVariable() const
The variable on the primary elem.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
bool _overwrite_secondary_residual
Whether or not the secondary&#39;s residual should be overwritten.
void computeSecondaryValue(NumericVector< Number > &current_solution)
Compute the value the secondary node should have at the beginning of a timestep.
const SparseMatrix< Number > * _jacobian
system Jacobian, provides pre-constraint Jacobian for nonAD kinematic constraints ...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
VariableTestValue _test_secondary
Shape function on the secondary side. This will always only have one entry and that entry will always...
NodeElemConstraintBase(const InputParameters &parameters)
MooseVariable & _var
secondary node variable
unsigned short _secondary
secondary block id
virtual Real computeQpSecondaryValue()=0
Compute the value the secondary node should have at the beginning of a timestep.
Enhances MooseVariableInterface interface provide values from neighbor elements.
VariablePhiValue _phi_secondary
Shape function on the secondary side.
const Node *const & _current_node
current node being processed
OutputTools< Real >::VariableTestValue VariableTestValue
Definition: MooseTypes.h:324
MooseVariable & _primary_var
Primary side variable.
const std::map< dof_id_type, std::vector< dof_id_type > > & _node_to_elem_map
MooseMesh map of current nodes to the connected elements.
DenseMatrix< Number > _Kee
stiffness matrix holding secondary-secondary jacobian
unsigned short _primary
primary block id
forward declarations
std::vector< dof_id_type > _connected_dof_indices
dofs connected to the secondary node
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
DenseMatrix< Number > _Kne
stiffness matrix holding primary-secondary jacobian
static InputParameters validParams()
const InputParameters & parameters() const
Get the parameters of the object.
A NodeElemConstraintBase is used when you need to create constraints between a secondary node and a p...
const VariablePhiValue & _phi_primary
Side shape function.
virtual bool overwriteSecondaryJacobian() const
Whether or not the secondary&#39;s Jacobian row should be overwritten.
const VariableTestValue & _test_primary
Side test function.