www.mooseframework.org
MortarConstraintBase.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #include "MooseMesh.h"
16 #include "MooseVariableInterface.h"
19 
20 // Forward Declarations
21 class FEProblemBase;
22 namespace libMesh
23 {
24 class QBase;
25 }
26 
46  public MooseVariableInterface<Real>
47 {
48 public:
50 
52 
56  virtual void computeResidual() override;
57 
61  virtual void computeJacobian() override;
62 
66  virtual void computeResidual(Moose::MortarType mortar_type) = 0;
67 
71  virtual void computeJacobian(Moose::MortarType mortar_type) = 0;
72 
76  const MooseVariable & variable() const override { return *_var; }
77 
81  const MooseVariable * variablePtr() const { return _var; }
82 
86  bool useDual() const { return _use_dual; }
87 
91  virtual void post() {}
92 
96  virtual void incorrectEdgeDroppingPost(const std::unordered_set<const Node *> &) {}
97 
101  void zeroInactiveLMDofs(const std::unordered_set<const Node *> & inactive_lm_nodes,
102  const std::unordered_set<const Elem *> & inactive_lm_elems);
103 
104 protected:
105  const FEProblemBase & feProblem() const { return _fe_problem; }
106 
109 
112 
115 
118 
121 
124 
127 
129  const bool _use_dual;
130 
133 
136 
138  const std::vector<Point> & _q_point;
139 
142 
144  const MooseVariable * const _aux_lm_var;
145 
148 
151 
154 
157 
160 
162  const Elem * const & _interior_secondary_elem;
163 
165  const Elem * const & _interior_primary_elem;
166 
168  const bool _displaced;
169 };
User for mortar methods.
const std::vector< Point > & _q_point
The quadrature points in physical space.
MooseVariableField< Real > & _secondary_var
Reference to the secondary variable.
const Elem *const & _interior_secondary_elem
the higher-dimensional secondary face element
const VariableTestValue & _test_secondary
The shape functions corresponding to the secondary interior primal variable.
Class for stuff related to variables.
Definition: Adaptivity.h:31
const VariableTestGradient & _grad_test_primary
The shape function gradients corresponding to the primary interior primal variable.
Intermediate base class that ties together all the interfaces for getting MooseVariables with the Moo...
virtual void incorrectEdgeDroppingPost(const std::unordered_set< const Node *> &)
This method will be called after the loop over the mortar segment mesh.
MortarType
Definition: MooseTypes.h:683
void zeroInactiveLMDofs(const std::unordered_set< const Node *> &inactive_lm_nodes, const std::unordered_set< const Elem *> &inactive_lm_elems)
A post routine for zeroing all inactive LM DoFs.
Base class for all Constraint types.
Definition: Constraint.h:19
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const bool _compute_primal_residuals
Whether to compute primal residuals.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
const Elem *const & _interior_primary_elem
the higher-dimensional primary face element
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
MortarConstraintBase(const InputParameters &parameters)
virtual void computeResidual() override
Method for computing the residual.
An interface for accessing mortar mesh data.
const VariableTestValue & _test
The shape functions corresponding to the lagrange multiplier variable.
static InputParameters validParams()
virtual void post()
This method will be called after the loop over the mortar segment mesh.
FEProblemBase & _fe_problem
Reference to the finite element problem.
const MooseVariable * variablePtr() const
The variable number that this object operates on (pointer).
const MooseArray< std::vector< Point > > & _tangents
Tangent vectors on the secondary faces (libmesh)
OutputTools< Real >::VariableTestValue VariableTestValue
Definition: MooseTypes.h:312
bool useDual() const
Whether to use dual mortar.
const FEProblemBase & feProblem() const
const bool _use_dual
Whether to use the dual motar approach.
const bool _displaced
Whether this object operates on the displaced mesh.
MooseVariable *const _var
Pointer to the lagrange multipler variable. nullptr if none.
forward declarations
Definition: MooseArray.h:17
const bool _use_petrov_galerkin
Whether to use Petrov-Galerkin approach.
const MooseVariable & variable() const override
The variable number that this object operates on.
const MooseVariable *const _aux_lm_var
The auxiliary Lagrange multiplier variable (used together whith the Petrov-Galerkin approach) ...
virtual void computeJacobian() override
Method for computing the Jacobian.
Interface for objects that need to get values of MooseVariables.
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.
const VariableTestGradient & _grad_test_secondary
The shape function gradients corresponding to the secondary interior primal variable.
const InputParameters & parameters() const
Get the parameters of the object.
const MooseArray< Real > & _coord
Member for handling change of coordinate systems (xyz, rz, spherical)
OutputTools< Real >::VariableTestGradient VariableTestGradient
Definition: MooseTypes.h:313
const VariableTestValue & _test_primary
The shape functions corresponding to the primary interior primal variable.
const VariableTestValue _test_dummy
A dummy object useful for constructing _test when not using Lagrange multipliers. ...
const bool _compute_lm_residuals
Whether to compute lagrange multiplier residuals.
MooseVariableField< Real > & _primary_var
Reference to the primary variable.