MFEM v4.9.0
Finite element discretization library
Loading...
Searching...
No Matches
mortarintegrator.hpp
Go to the documentation of this file.
1// Copyright (c) 2010-2025, Lawrence Livermore National Security, LLC. Produced
2// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3// LICENSE and NOTICE for details. LLNL-CODE-806117.
4//
5// This file is part of the MFEM library. For more information and source code
6// availability visit https://mfem.org.
7//
8// MFEM is free software; you can redistribute it and/or modify it under the
9// terms of the BSD-3 license. We welcome feedback and contributions, see file
10// CONTRIBUTING.md for details.
11
12#ifndef MFEML2_MORTAR_INTEGRATOR_HPP
13#define MFEML2_MORTAR_INTEGRATOR_HPP
14
16
17#ifdef MFEM_USE_MOONOLITH
18
19#include "../fem.hpp"
20
21namespace mfem
22{
23
24/*!
25 * @brief Interface for mortar element assembly.
26 * The MortarIntegrator interface is used for performing Petrov-Galerkin
27 * finite element assembly on intersections between elements.
28 * The quadrature rules are to be generated by a cut algorithm (e.g.,
29 * mfem::Cut). The quadrature rules are defined in the respective trial and test
30 * reference frames. Trial and test spaces can be associated with different
31 * element shapes (e.g., triangles and quadrilaterals) and different polynomial
32 * orders (e.g., 1 and 4). This class is designed to work in conjunction with
33 * the MFEM/moonolith module but it can be used also for other applications.
34 */
36{
37public:
38 /*!
39 * @brief Implements the assembly routine
40 * @param trial is the master/source element
41 * @param trial_ir is the quadrature formula for evaluating quantities within
42 * the trial element
43 * @param trial_Trans the geometric transformation of the trial element
44 * @param test is the slave/destination element
45 * @param test_ir is the quadrature formula for evaluating quantities within
46 * the test element
47 * @param test_Trans the geometric transformation of the test element
48 * @param elemmat the result of the assembly
49 */
50 virtual void AssembleElementMatrix(const FiniteElement &trial,
51 const IntegrationRule &trial_ir,
52 ElementTransformation &trial_Trans,
53 const FiniteElement &test,
54 const IntegrationRule &test_ir,
55 ElementTransformation &test_Trans,
56 DenseMatrix &elemmat) = 0;
57
58 /*!
59 * @return the additional orders of quadrature required by the integrator.
60 * It is 0 by default, override method to change that.
61 */
62 virtual int GetQuadratureOrder() const { return 0; }
63
64 virtual ~MortarIntegrator() {}
65
66 /*!
67 * @return an equivalent BilinearFormIntegrator
68 */
70};
71
72/*!
73 * @brief Integrator for scalar finite elements
74 * $$ (u, v)_{L^2(\mathcal{T}_m \cap \mathcal{T}_s)}, u \in U(\mathcal{T}_m )
75 * and v \in V(\mathcal{T}_s ) $$
76 */
78{
79public:
80 void AssembleElementMatrix(const FiniteElement &trial,
81 const IntegrationRule &trial_ir,
82 ElementTransformation &trial_Trans,
83 const FiniteElement &test,
84 const IntegrationRule &test_ir,
85 ElementTransformation &test_Trans,
86 DenseMatrix &elemmat) override;
87
89};
90
91/*!
92 * @brief Integrator for vector finite elements. Experimental.
93 * $$ (u, v)_{L^2(\mathcal{T}_m \cap \mathcal{T}_s)}, u \in U(\mathcal{T}_m )
94 * and v \in V(\mathcal{T}_s ) $$
95 */
97{
98public:
99#ifndef MFEM_THREAD_SAFE
105#endif
106
107public:
109
110 VectorL2MortarIntegrator() { Init(NULL, NULL, NULL); }
111 VectorL2MortarIntegrator(Coefficient *_q) { Init(_q, NULL, NULL); }
114
115 void AssembleElementMatrix(const FiniteElement &trial,
116 const IntegrationRule &trial_ir,
117 ElementTransformation &trial_Trans,
118 const FiniteElement &test,
119 const IntegrationRule &test_ir,
120 ElementTransformation &test_Trans,
121 DenseMatrix &elemmat) override;
122
123private:
124 Coefficient *Q;
127
129 {
130 Q = q;
131 VQ = vq;
132 MQ = mq;
133 }
134};
135
136/*!
137 * @brief Integrator for Lagrange vector finite elements. Experimental.
138 * $$ (u, v)_{L^2(\mathcal{T}_m \cap \mathcal{T}_s)}, u \in U(\mathcal{T}_m )
139 * and v \in V(\mathcal{T}_s ) $$
140 */
142{
143public:
144#ifndef MFEM_THREAD_SAFE
152#endif
153
154public:
156
157 LagrangeVectorL2MortarIntegrator() : vdim(-1) { Init(NULL, NULL, NULL); }
158 LagrangeVectorL2MortarIntegrator(Coefficient *_q) : vdim(-1) { Init(_q, NULL, NULL); }
159 LagrangeVectorL2MortarIntegrator(VectorCoefficient *_vq) : vdim(-1) { Init(NULL, _vq, NULL); }
160 LagrangeVectorL2MortarIntegrator(MatrixCoefficient *_mq) : vdim(-1) { Init(NULL, NULL, _mq); }
161 inline void SetVDim(const int _vdim) { vdim = _vdim; }
162
163 void AssembleElementMatrix(const FiniteElement &trial,
164 const IntegrationRule &trial_ir,
165 ElementTransformation &trial_Trans,
166 const FiniteElement &test,
167 const IntegrationRule &test_ir,
168 ElementTransformation &test_Trans,
169 DenseMatrix &elemmat) override;
170
171private:
172 int vdim;
173 Coefficient *Q;
176
178 {
179 Q = q;
180 VQ = vq;
181 MQ = mq;
182 }
183};
184
185} // namespace mfem
186
187#endif // MFEM_USE_MOONOLITH
188#endif // MFEML2_MORTAR_INTEGRATOR_HPP
Abstract base class BilinearFormIntegrator.
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
Data type dense matrix using column-major storage.
Definition densemat.hpp:24
Abstract class for all finite elements.
Definition fe_base.hpp:247
A class to initialize the size of a Tensor.
Definition dtensor.hpp:57
Class for an integration rule - an Array of IntegrationPoint.
Definition intrules.hpp:100
Integrator for scalar finite elements.
BilinearFormIntegrator * newBFormIntegrator() const override
void AssembleElementMatrix(const FiniteElement &trial, const IntegrationRule &trial_ir, ElementTransformation &trial_Trans, const FiniteElement &test, const IntegrationRule &test_ir, ElementTransformation &test_Trans, DenseMatrix &elemmat) override
Implements the assembly routine.
Integrator for Lagrange vector finite elements. Experimental.
void AssembleElementMatrix(const FiniteElement &trial, const IntegrationRule &trial_ir, ElementTransformation &trial_Trans, const FiniteElement &test, const IntegrationRule &test_ir, ElementTransformation &test_Trans, DenseMatrix &elemmat) override
Implements the assembly routine.
BilinearFormIntegrator * newBFormIntegrator() const override
LagrangeVectorL2MortarIntegrator(MatrixCoefficient *_mq)
LagrangeVectorL2MortarIntegrator(VectorCoefficient *_vq)
Base class for Matrix Coefficients that optionally depend on time and space.
Interface for mortar element assembly. The MortarIntegrator interface is used for performing Petrov-G...
virtual int GetQuadratureOrder() const
virtual void AssembleElementMatrix(const FiniteElement &trial, const IntegrationRule &trial_ir, ElementTransformation &trial_Trans, const FiniteElement &test, const IntegrationRule &test_ir, ElementTransformation &test_Trans, DenseMatrix &elemmat)=0
Implements the assembly routine.
virtual BilinearFormIntegrator * newBFormIntegrator() const =0
Base class for vector Coefficients that optionally depend on time and space.
Integrator for vector finite elements. Experimental.
VectorL2MortarIntegrator(VectorCoefficient *_vq)
BilinearFormIntegrator * newBFormIntegrator() const override
VectorL2MortarIntegrator(MatrixCoefficient *_mq)
void AssembleElementMatrix(const FiniteElement &trial, const IntegrationRule &trial_ir, ElementTransformation &trial_Trans, const FiniteElement &test, const IntegrationRule &test_ir, ElementTransformation &test_Trans, DenseMatrix &elemmat) override
Implements the assembly routine.
Vector data type.
Definition vector.hpp:82