MFEM v4.10.0
Finite element discretization library
Loading...
Searching...
No Matches
lininteg_domain_vectorfe.cpp
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
13#include "../../fem/kernels.hpp"
14#include "../fem.hpp"
15
17
18namespace mfem
19{
20
21VectorFEDomainLFIntegrator::Kernels::Kernels()
22{
31
40
49
58}
59
60/// \cond DO_NOT_DOCUMENT
62VectorFEDomainLFIntegrator::AssembleKernels::Fallback(
63 FiniteElement::DerivType TestType, int DIM, int, int)
64{
65 if (TestType == FiniteElement::DIV)
66 {
67 if (DIM == 2)
68 {
69 return HdivDLFAssemble2D<0, 0>;
70 }
71 if (DIM == 3)
72 {
73 return HdivDLFAssemble3D<0, 0>;
74 }
75 }
76 else if (TestType == FiniteElement::CURL)
77 {
78 if (DIM == 3)
79 {
80 return HcurlDLFAssemble3D<0, 0>;
81 }
82 }
83 MFEM_ABORT("");
84}
85/// \endcond DO_NOT_DOCUMENT
86
88 const Array<int> &markers,
89 Vector &b)
90{
91 const FiniteElement &fe = *fes.GetTypicalFE();
92 const int qorder = 2 * fe.GetOrder();
93 const Geometry::Type gtype = fe.GetGeomType();
94 const IntegrationRule *ir = IntRule ? IntRule : &IntRules.Get(gtype, qorder);
95
96 QuadratureSpace qs(*fes.GetMesh(), *ir);
98
99 const FiniteElement::DerivType fe_type =
100 static_cast<FiniteElement::DerivType>(fe.GetDerivType());
101
102 Mesh &mesh = *fes.GetMesh();
103 const int dim = mesh.Dimension();
104 const FiniteElement *el = fes.GetTypicalFE();
105 const auto *vel = dynamic_cast<const VectorTensorFiniteElement *>(el);
106 MFEM_VERIFY(vel != nullptr, "Must be VectorTensorFiniteElement");
108 const DofToQuad &maps_o = vel->GetDofToQuadOpen(*ir, DofToQuad::TENSOR);
109 const DofToQuad &maps_c = vel->GetDofToQuad(*ir, DofToQuad::TENSOR);
110 const int d = maps_c.ndof, q = maps_c.nqpt;
111 constexpr int flags = GeometricFactors::JACOBIANS;
112 const GeometricFactors *geom = mesh.GetGeometricFactors(*ir, flags, mt);
113
114 AssembleKernels::Run(fe_type, dim, d, q, mesh.GetNE(), markers, geom->J,
115 ir->GetWeights(), maps_o.B, maps_c.B, coeff, b, d, q);
116}
117
118} // namespace mfem
Class to represent a coefficient evaluated at quadrature points.
static MemoryType GetDeviceMemoryType()
Get the current Device MemoryType. This is the MemoryType used by most MFEM classes when allocating m...
Definition device.hpp:298
Structure representing the matrices/tensors needed to evaluate (in reference space) the values,...
Definition fe_base.hpp:141
@ TENSOR
Tensor product representation using 1D matrices/tensors with dimensions using 1D number of quadrature...
Definition fe_base.hpp:165
Array< real_t > B
Basis functions evaluated at quadrature points.
Definition fe_base.hpp:201
int ndof
Number of degrees of freedom = number of basis functions. When mode is TENSOR, this is the 1D number.
Definition fe_base.hpp:186
int nqpt
Number of quadrature points. When mode is TENSOR, this is the 1D number.
Definition fe_base.hpp:190
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition fespace.hpp:210
Mesh * GetMesh() const
Returns the mesh.
Definition fespace.hpp:639
const FiniteElement * GetTypicalFE() const
Return GetFE(0) if the local mesh is not empty; otherwise return a typical FE based on the Geometry t...
Definition fespace.cpp:3896
Abstract class for all finite elements.
Definition fe_base.hpp:294
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
Definition fe_base.hpp:414
int GetDerivType() const
Returns the FiniteElement::DerivType of the element describing the spatial derivative method implemen...
Definition fe_base.hpp:441
Geometry::Type GetGeomType() const
Returns the Geometry::Type of the reference element.
Definition fe_base.hpp:407
DerivType
Enumeration for DerivType: defines which derivative method is implemented.
Definition fe_base.hpp:363
@ DIV
Implements CalcDivShape methods.
Definition fe_base.hpp:366
@ CURL
Implements CalcCurlShape methods.
Definition fe_base.hpp:367
Structure for storing mesh geometric factors: coordinates, Jacobians, and determinants of the Jacobia...
Definition mesh.hpp:3119
Vector J
Jacobians of the element transformations at all quadrature points.
Definition mesh.hpp:3158
Class for an integration rule - an Array of IntegrationPoint.
Definition intrules.hpp:96
const Array< real_t > & GetWeights() const
Return the quadrature weights in a contiguous array.
Definition intrules.cpp:98
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
const IntegrationRule * IntRule
Mesh data type.
Definition mesh.hpp:67
int GetNE() const
Returns number of elements.
Definition mesh.hpp:1390
int Dimension() const
Dimension of the reference space used within the elements.
Definition mesh.hpp:1314
const GeometricFactors * GetGeometricFactors(const IntegrationRule &ir, const int flags, MemoryType d_mt=MemoryType::DEFAULT)
Return the mesh geometric factors corresponding to the given integration rule.
Definition mesh.cpp:958
Class representing the storage layout of a QuadratureFunction.
Definition qspace.hpp:164
void AssembleDevice(const FiniteElementSpace &fes, const Array< int > &markers, Vector &b) override
Method defining assembly on device.
void(*)(const int NE, const Array< int > &markers, const Vector &jac, const Array< real_t > &weights, const Array< real_t > &testBO, const Array< real_t > &testBC, const Vector &coeff, Vector &y, const int testd1d, const int q1d) AssembleKernelType
Definition lininteg.hpp:403
Vector data type.
Definition vector.hpp:82
int dim
Definition ex24.cpp:53
real_t b
Definition lissajous.cpp:42
constexpr int DIM
@ COMPRESSED
Enable all above compressions.
MemoryType
Memory types supported by MFEM.
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
Definition intrules.hpp:549
void vel(const Vector &x, real_t t, Vector &u)