MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
convection.cpp
Go to the documentation of this file.
1// Copyright (c) 2010-2024, 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
15#ifdef MFEM_USE_CEED
16#include "convection_qf.h"
17#endif
18
19namespace mfem
20{
21
22namespace ceed
23{
24
25#ifdef MFEM_USE_CEED
26struct 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;
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 FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition fespace.hpp:220
Mesh * GetMesh() const
Returns the mesh.
Definition fespace.hpp:559
Class for an integration rule - an Array of IntegrationPoint.
Definition intrules.hpp:100
int Dimension() const
Dimension of the reference space used within the elements.
Definition mesh.hpp:1160
Base class for vector Coefficients that optionally depend on time and space.
MFConvectionIntegrator(const mfem::FiniteElementSpace &fes, const mfem::IntegrationRule &ir, mfem::VectorCoefficient *Q, const double alpha)
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...
void Assemble(const Integrator &integ, CeedOperatorInfo &info, const mfem::FiniteElementSpace &fes, CoeffType *Q)
MixedMFConvectionIntegrator(const ConvectionIntegrator &integ, const mfem::FiniteElementSpace &fes, mfem::VectorCoefficient *Q, const double alpha)
MixedPAConvectionIntegrator(const ConvectionIntegrator &integ, const mfem::FiniteElementSpace &fes, mfem::VectorCoefficient *Q, const double alpha)
PAConvectionIntegrator(const mfem::FiniteElementSpace &fes, const mfem::IntegrationRule &ir, mfem::VectorCoefficient *Q, const double alpha)
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...
const real_t alpha
Definition ex15.cpp:369
int dim
Definition ex24.cpp:53
struct s_NavierContext ctx
CeedQFunctionUser apply_qf_mf_const
const char * apply_func_mf_quad
const char * apply_func_mf_const
CeedQFunctionUser build_qf_const
CeedQFunctionUser apply_qf
CeedQFunctionUser build_qf_quad
CeedQFunctionUser apply_qf_mf_quad
const char * build_func_const
const char * build_func_quad