MFEM v4.8.0
Finite element discretization library
Loading...
Searching...
No Matches
bilininteg_convection_mf.cpp
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#include "../bilininteg.hpp"
13#include "../gridfunc.hpp"
15
16namespace mfem
17{
18
20{
21 // Assuming the same element type
22 Mesh *mesh = fes.GetMesh();
23 if (mesh->GetNE() == 0) { return; }
24 const FiniteElement &el = *fes.GetTypicalFE();
26 const IntegrationRule *ir = IntRule ? IntRule : &GetRule(el, Trans);
27 if (DeviceCanUseCeed())
28 {
29 delete ceedOp;
30 const bool mixed = mesh->GetNumGeometries(mesh->Dimension()) > 1 ||
31 fes.IsVariableOrder();
32 if (mixed)
33 {
35 }
36 else
37 {
39 }
40 return;
41 }
42 MFEM_ABORT("Error: ConvectionIntegrator::AssembleMF only implemented with"
43 " libCEED");
44}
45
47{
48 if (DeviceCanUseCeed())
49 {
50 ceedOp->GetDiagonal(diag);
51 }
52 else
53 {
54 MFEM_ABORT("Error: ConvectionIntegrator::AssembleDiagonalMF only"
55 " implemented with libCEED");
56 }
57}
58
60{
61 if (DeviceCanUseCeed())
62 {
63 ceedOp->AddMult(x, y);
64 }
65 else
66 {
67 MFEM_ABORT("Error: ConvectionIntegrator::AddMultMF only implemented with"
68 " libCEED");
69 }
70}
71
72}
void AssembleMF(const FiniteElementSpace &fes) override
Method defining matrix-free assembly.
static const IntegrationRule & GetRule(const FiniteElement &el, const ElementTransformation &Trans)
VectorCoefficient * Q
void AddMultMF(const Vector &, Vector &) const override
void AssembleDiagonalMF(Vector &diag) override
Assemble diagonal and add it to Vector diag.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition fespace.hpp:244
bool IsVariableOrder() const
Returns true if the space contains elements of varying polynomial orders.
Definition fespace.hpp:709
Mesh * GetMesh() const
Returns the mesh.
Definition fespace.hpp:679
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:3871
Abstract class for all finite elements.
Definition fe_base.hpp:244
Class for an integration rule - an Array of IntegrationPoint.
Definition intrules.hpp:100
const IntegrationRule * IntRule
Mesh data type.
Definition mesh.hpp:64
int GetNE() const
Returns number of elements.
Definition mesh.hpp:1282
int Dimension() const
Dimension of the reference space used within the elements.
Definition mesh.hpp:1216
ElementTransformation * GetTypicalElementTransformation()
If the local mesh is not empty return GetElementTransformation(0); otherwise, return the identity tra...
Definition mesh.cpp:390
int GetNumGeometries(int dim) const
Return the number of geometries of the given dimension present in the mesh.
Definition mesh.cpp:7243
Vector data type.
Definition vector.hpp:82
Represent a ConvectionIntegrator with AssemblyLevel::None using libCEED.
void GetDiagonal(mfem::Vector &diag) const
Definition operator.cpp:104
void AddMult(const mfem::Vector &x, mfem::Vector &y, const real_t a=1.0) const override
Operator application: y+=A(x) (default) or y+=a*A(x).
Definition operator.cpp:72
bool DeviceCanUseCeed()
Function that determines if a CEED kernel should be used, based on the current mfem::Device configura...
Definition util.cpp:33