https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
16namespace libMesh
17{
18template <typename T>
19class SparseMatrix;
20}
21
28 : public Constraint,
31{
32public:
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
72protected:
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::unordered_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
116public:
118 const SparseMatrix<Number> * _jacobian;
120 std::vector<dof_id_type> _connected_dof_indices;
122 DenseMatrix<Number> _Kne;
124 DenseMatrix<Number> _Kee;
125};
OutputTools< Real >::VariablePhiValue VariablePhiValue
Definition MooseTypes.h:353
OutputTools< Real >::VariableTestValue VariableTestValue
Definition MooseTypes.h:358
Base class for all Constraint types.
Definition Constraint.h:20
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Intermediate base class that ties together all the interfaces for getting MooseVariables with the Moo...
Enhances MooseVariableInterface interface provide values from neighbor elements.
A NodeElemConstraintBase is used when you need to create constraints between a secondary node and a p...
const Node *const & _current_node
current node being processed
const SparseMatrix< Number > * _jacobian
system Jacobian, provides pre-constraint Jacobian for nonAD kinematic constraints
DenseMatrix< Number > _Kee
stiffness matrix holding secondary-secondary jacobian
const VariablePhiValue & _phi_primary
Side shape function.
virtual Real computeQpSecondaryValue()=0
Compute the value the secondary node should have at the beginning of a timestep.
virtual MooseVariable & primaryVariable() const
The variable on the primary elem.
unsigned short _primary
primary block id
virtual bool shouldApply()
Whether or not this constraint should be applied.
bool _overwrite_secondary_residual
Whether or not the secondary's residual should be overwritten.
const MooseVariable & variable() const override
The variable number that this object operates on.
VariableTestValue _test_secondary
Shape function on the secondary side. This will always only have one entry and that entry will always...
VariablePhiValue _phi_secondary
Shape function on the secondary side.
DenseMatrix< Number > _Kne
stiffness matrix holding primary-secondary jacobian
static InputParameters validParams()
const VariableTestValue & _test_primary
Side test function.
MooseVariable & _var
secondary node variable
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
const std::unordered_map< dof_id_type, std::vector< dof_id_type > > & _node_to_elem_map
MooseMesh map of current nodes to the connected elements.
MooseVariable & _primary_var
Primary side variable.
virtual bool overwriteSecondaryJacobian() const
Whether or not the secondary's Jacobian row should be overwritten.
virtual bool overwriteSecondaryResidual() const
Whether or not the secondary's residual should be overwritten.
unsigned short _secondary
secondary block id
std::vector< dof_id_type > _connected_dof_indices
dofs connected to the secondary node
void computeSecondaryValue(NumericVector< Number > &current_solution)
Compute the value the secondary node should have at the beginning of a timestep.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...