MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
diffusion.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 "diffusion.hpp"
13
15#ifdef MFEM_USE_CEED
16#include "diffusion_qf.h"
17#endif
18
19namespace mfem
20{
21
22namespace ceed
23{
24
25#ifdef MFEM_USE_CEED
26struct DiffusionOperatorInfo : public OperatorInfo
27{
28 DiffusionContext ctx;
29 DiffusionOperatorInfo(int dim)
30 {
31 header = "/integrators/diffusion/diffusion_qf.h";
32 build_func_const = ":f_build_diff_const";
33 build_qf_const = &f_build_diff_const;
34 build_func_quad = ":f_build_diff_quad";
35 build_qf_quad = &f_build_diff_quad;
36 apply_func = ":f_apply_diff";
37 apply_qf = &f_apply_diff;
38 apply_func_mf_const = ":f_apply_diff_mf_const";
39 apply_qf_mf_const = &f_apply_diff_mf_const;
40 apply_func_mf_quad = ":f_apply_diff_mf_quad";
41 apply_qf_mf_quad = &f_apply_diff_mf_quad;
44 qdatasize = dim*(dim+1)/2;
45 }
46};
47#endif
48
50 const mfem::FiniteElementSpace &fes,
51 const mfem::IntegrationRule &irm,
53 : PAIntegrator()
54{
55#ifdef MFEM_USE_CEED
56 DiffusionOperatorInfo info(fes.GetMesh()->Dimension());
57 Assemble(info, fes, irm, Q);
58#else
59 MFEM_ABORT("MFEM must be built with MFEM_USE_CEED=YES to use libCEED.");
60#endif
61}
62
64 const DiffusionIntegrator &integ,
65 const mfem::FiniteElementSpace &fes,
67{
68#ifdef MFEM_USE_CEED
69 DiffusionOperatorInfo info(fes.GetMesh()->Dimension());
70 Assemble(integ, info, fes, Q);
71#else
72 MFEM_ABORT("MFEM must be built with MFEM_USE_CEED=YES to use libCEED.");
73#endif
74}
75
77 const VectorDiffusionIntegrator &integ,
78 const mfem::FiniteElementSpace &fes,
80{
81#ifdef MFEM_USE_CEED
82 DiffusionOperatorInfo info(fes.GetMesh()->Dimension());
83 Assemble(integ, info, fes, Q);
84#else
85 MFEM_ABORT("MFEM must be built with MFEM_USE_CEED=YES to use libCEED.");
86#endif
87}
88
90 const mfem::FiniteElementSpace &fes,
91 const mfem::IntegrationRule &irm,
93 : MFIntegrator()
94{
95#ifdef MFEM_USE_CEED
96 DiffusionOperatorInfo info(fes.GetMesh()->Dimension());
97 Assemble(info, fes, irm, Q);
98#else
99 MFEM_ABORT("MFEM must be built with MFEM_USE_CEED=YES to use libCEED.");
100#endif
101}
102
104 const DiffusionIntegrator &integ,
105 const mfem::FiniteElementSpace &fes,
107{
108#ifdef MFEM_USE_CEED
109 DiffusionOperatorInfo info(fes.GetMesh()->Dimension());
110 Assemble(integ, info, fes, Q);
111#else
112 MFEM_ABORT("MFEM must be built with MFEM_USE_CEED=YES to use libCEED.");
113#endif
114}
115
117 const VectorDiffusionIntegrator &integ,
118 const mfem::FiniteElementSpace &fes,
120{
121#ifdef MFEM_USE_CEED
122 DiffusionOperatorInfo info(fes.GetMesh()->Dimension());
123 Assemble(integ, info, fes, Q);
124#else
125 MFEM_ABORT("MFEM must be built with MFEM_USE_CEED=YES to use libCEED.");
126#endif
127}
128
129} // namespace ceed
130
131} // namespace mfem
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
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
MFDiffusionIntegrator(const mfem::FiniteElementSpace &fes, const mfem::IntegrationRule &ir, mfem::Coefficient *Q)
Definition diffusion.cpp:89
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)
MixedMFDiffusionIntegrator(const DiffusionIntegrator &integ, const mfem::FiniteElementSpace &fes, mfem::Coefficient *Q)
MixedPADiffusionIntegrator(const DiffusionIntegrator &integ, const mfem::FiniteElementSpace &fes, mfem::Coefficient *Q)
Definition diffusion.cpp:63
PADiffusionIntegrator(const mfem::FiniteElementSpace &fes, const mfem::IntegrationRule &ir, mfem::Coefficient *Q)
Definition diffusion.cpp:49
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...
int dim
Definition ex24.cpp:53
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