| 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 "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 |
|
| 50 |
PAConvectionIntegrator::PAConvectionIntegrator( |
| 51 |
const mfem::FiniteElementSpace &fes, |
| 52 |
const mfem::IntegrationRule &irm, |
| 53 |
mfem::VectorCoefficient *Q, |
| 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 |
|
| 65 |
MixedPAConvectionIntegrator::MixedPAConvectionIntegrator( |
| 66 |
const ConvectionIntegrator &integ, |
| 67 |
const mfem::FiniteElementSpace &fes, |
| 68 |
mfem::VectorCoefficient *Q, |
| 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 |
|
| 79 |
MFConvectionIntegrator::MFConvectionIntegrator( |
| 80 |
const mfem::FiniteElementSpace &fes, |
| 81 |
const mfem::IntegrationRule &irm, |
| 82 |
mfem::VectorCoefficient *Q, |
| 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 |
|
| 94 |
MixedMFConvectionIntegrator::MixedMFConvectionIntegrator( |
| 95 |
const ConvectionIntegrator &integ, |
| 96 |
const mfem::FiniteElementSpace &fes, |
| 97 |
mfem::VectorCoefficient *Q, |
| 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 |