MFEM v4.10.0
Finite element discretization library
Loading...
Searching...
No Matches
lor_dg.hpp
Go to the documentation of this file.
1// Copyright (c) 2010-2026, 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 MFEM_LOR_DG
13#define MFEM_LOR_DG
14
15#include "lor_batched.hpp"
16
17namespace mfem
18{
19
20// BatchedLORKernel specialization for DG spaces. Not user facing. See the
21// classes BatchedLORAssembly and BatchedLORKernel .
23{
24 IntegrationRule ir_face; ///< Collocated Gauss-Lobatto face quadrature rule.
25 real_t kappa; ///< DG penalty parameter.
26 bool has_bdr_integ; ///< Is there a boundary integrator?
27 const Array<int> *bdr_markers; ///< Boundary integrator markers.
28public:
29 template <int ORDER, int SDIM> void Assemble2D();
30 template <int ORDER> void Assemble3D();
32 FiniteElementSpace &fes_ho_,
33 Vector &X_vert_,
34 Vector &sparse_ij_,
35 Array<int> &sparse_mapping_)
36 : BatchedLORKernel(fes_ho_, X_vert_, sparse_ij_, sparse_mapping_),
37 ir_face(GetLobattoIntRule(fes_ho_.GetMesh()->GetTypicalFaceGeometry(),
38 fes_ho_.GetMaxElementOrder() + 1))
39 {
42
44 {
45 kappa = integ->GetPenaltyParameter();
46 }
47 else
48 {
49 kappa = 0.0;
50 }
51
52 has_bdr_integ = false;
53 auto *bdr_face_integs = a.GetBFBFI();
54 for (int i = 0; i < bdr_face_integs->Size(); ++i)
55 {
56 if (auto *integ = dynamic_cast<DGDiffusionIntegrator*>((*bdr_face_integs)[i]))
57 {
58 kappa = integ->GetPenaltyParameter();
59 bdr_markers = (*a.GetBFBFI_Marker())[i];
60 has_bdr_integ = true;
61 break;
62 }
63 }
64 }
65
66 /// @brief Compute and return the face info array.
67 ///
68 /// The face info array has shape (6, nf), where @a nf is the number of
69 /// faces. For each face @a i, the column (:,i) has entries (e0, f0, o0, e1,
70 /// f1, o1), where @a e is adjacent element, @a f is the local face index,
71 /// and @a o is the orientation. For boundary and shared faces, (e1, f1, o1)
72 /// are all set to -1.
73 Array<int> GetFaceInfo() const;
74
75 /// @brief Compute and return the boundary penalty factor.
76 ///
77 /// The returned vector has shape (nq, nf), where @a nq is the number of
78 /// nodes per face, and @a nf is the number of faces.
79 ///
80 /// The boundary penalty factor is $J_f / h = J_f^2 / J_e$ (since $h = J_e /
81 /// J_f$), where $J_f$ is the face Jacobian determinant, and $J_e$ is the
82 /// element Jacobian determinant.
84
85 /// Assemble the face penalty terms in the matrix @a sparse_ij.
86 void AssembleFaceTerms();
87};
88
89}
90
91#include "lor_dg_impl.hpp"
92
93#endif
Abstract base class for the batched LOR assembly kernels.
CoefficientVector c2
Coefficient of second integrator.
CoefficientVector c1
Coefficient of first integrator.
BatchedLOR_DG(BilinearForm &a, FiniteElementSpace &fes_ho_, Vector &X_vert_, Vector &sparse_ij_, Array< int > &sparse_mapping_)
Definition lor_dg.hpp:31
Array< int > GetFaceInfo() const
Compute and return the face info array.
void AssembleFaceTerms()
Assemble the face penalty terms in the matrix sparse_ij.
Vector GetBdrPenaltyFactor() const
Compute and return the boundary penalty factor.
A "square matrix" operator for the associated FE space and BLFIntegrators The sum of all the BLFInteg...
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition fespace.hpp:210
Class for an integration rule - an Array of IntegrationPoint.
Definition intrules.hpp:96
Vector data type.
Definition vector.hpp:82
real_t kappa
Definition ex24.cpp:54
Mesh * GetMesh(int type)
Definition ex29.cpp:218
real_t a
Definition lissajous.cpp:41
T * GetInteriorFaceIntegrator(BilinearForm &a)
IntegrationRule GetLobattoIntRule(Geometry::Type geom, int nd1d)
Return the Gauss-Lobatto rule for geometry geom with nd1d points per dimension.
void ProjectLORCoefficient(BilinearForm &a, CoefficientVector &coeff_vector)
float real_t
Definition config.hpp:46