MFEM  v4.5.2
Finite element discretization library
convection.cpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2023, 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 "convection.hpp"
13 
14 #include "../../../../config/config.hpp"
15 #ifdef MFEM_USE_CEED
16 #include "convection_qf.h"
17 #endif
18 
19 namespace mfem
20 {
21 
22 namespace ceed
23 {
24 
25 #ifdef MFEM_USE_CEED
26 struct ConvectionOperatorInfo : public OperatorInfo
27 {
28  ConvectionContext ctx;
29  ConvectionOperatorInfo(int dim, double alpha)
30  {
31  header = "/integrators/convection/convection_qf.h";
32  build_func_const = ":f_build_conv_const";
33  build_qf_const = &f_build_conv_const;
34  build_func_quad = ":f_build_conv_quad";
35  build_qf_quad = &f_build_conv_quad;
36  apply_func = ":f_apply_conv";
37  apply_qf = &f_apply_conv;
38  apply_func_mf_const = ":f_apply_conv_mf_const";
39  apply_qf_mf_const = &f_apply_conv_mf_const;
40  apply_func_mf_quad = ":f_apply_conv_mf_quad";
41  apply_qf_mf_quad = &f_apply_conv_mf_quad;
42  trial_op = EvalMode::Grad;
43  test_op = EvalMode::Interp;
44  qdatasize = dim * (dim + 1) / 2;
45  ctx.alpha = alpha;
46  }
47 };
48 #endif
49 
51  const mfem::FiniteElementSpace &fes,
52  const mfem::IntegrationRule &irm,
54  const double alpha)
55  : PAIntegrator()
56 {
57 #ifdef MFEM_USE_CEED
58  ConvectionOperatorInfo info(fes.GetMesh()->Dimension(), alpha);
59  Assemble(info, fes, irm, Q);
60 #else
61  MFEM_ABORT("MFEM must be built with MFEM_USE_CEED=YES to use libCEED.");
62 #endif
63 }
64 
66  const ConvectionIntegrator &integ,
67  const mfem::FiniteElementSpace &fes,
69  const double alpha)
70 {
71 #ifdef MFEM_USE_CEED
72  ConvectionOperatorInfo info(fes.GetMesh()->Dimension(), alpha);
73  Assemble(integ, info, fes, Q);
74 #else
75  MFEM_ABORT("MFEM must be built with MFEM_USE_CEED=YES to use libCEED.");
76 #endif
77 }
78 
80  const mfem::FiniteElementSpace &fes,
81  const mfem::IntegrationRule &irm,
83  const double alpha)
84  : MFIntegrator()
85 {
86 #ifdef MFEM_USE_CEED
87  ConvectionOperatorInfo info(fes.GetMesh()->Dimension(), alpha);
88  Assemble(info, fes, irm, Q);
89 #else
90  MFEM_ABORT("MFEM must be built with MFEM_USE_CEED=YES to use libCEED.");
91 #endif
92 }
93 
95  const ConvectionIntegrator &integ,
96  const mfem::FiniteElementSpace &fes,
98  const double alpha)
99 {
100 #ifdef MFEM_USE_CEED
101  ConvectionOperatorInfo info(fes.GetMesh()->Dimension(), alpha);
102  Assemble(integ, info, fes, Q);
103 #else
104  MFEM_ABORT("MFEM must be built with MFEM_USE_CEED=YES to use libCEED.");
105 #endif
106 }
107 
108 } // namespace ceed
109 
110 } // namespace mfem
Class for an integration rule - an Array of IntegrationPoint.
Definition: intrules.hpp:90
Base class for vector Coefficients that optionally depend on time and space.
int Dimension() const
Definition: mesh.hpp:1047
MFConvectionIntegrator(const mfem::FiniteElementSpace &fes, const mfem::IntegrationRule &ir, mfem::VectorCoefficient *Q, const double alpha)
Definition: convection.cpp:79
void Assemble(CeedOperatorInfo &info, const mfem::FiniteElementSpace &fes, const mfem::IntegrationRule &ir, CoeffType *Q)
This method assembles the PAIntegrator with the given CeedOperatorInfo info, an mfem::FiniteElementSp...
Definition: integrator.hpp:112
void Assemble(const Integrator &integ, CeedOperatorInfo &info, const mfem::FiniteElementSpace &fes, CoeffType *Q)
Mesh * GetMesh() const
Returns the mesh.
Definition: fespace.hpp:441
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition: fespace.hpp:96
void Assemble(CeedOperatorInfo &info, const mfem::FiniteElementSpace &fes, const mfem::IntegrationRule &ir, CoeffType *Q)
This method assembles the MFIntegrator with the given CeedOperatorInfo info, an mfem::FiniteElementSp...
Definition: integrator.hpp:468
PAConvectionIntegrator(const mfem::FiniteElementSpace &fes, const mfem::IntegrationRule &ir, mfem::VectorCoefficient *Q, const double alpha)
Definition: convection.cpp:50
int dim
Definition: ex24.cpp:53
MixedMFConvectionIntegrator(const ConvectionIntegrator &integ, const mfem::FiniteElementSpace &fes, mfem::VectorCoefficient *Q, const double alpha)
Definition: convection.cpp:94
const double alpha
Definition: ex15.cpp:369
MixedPAConvectionIntegrator(const ConvectionIntegrator &integ, const mfem::FiniteElementSpace &fes, mfem::VectorCoefficient *Q, const double alpha)
Definition: convection.cpp:65
alpha (q . grad u, v)