MFEM v4.10.0
Finite element discretization library
Loading...
Searching...
No Matches
nonlininteg_vecconvection_pa_grad.cpp
Go to the documentation of this file.
1// Copyright (c) 2010-2026, 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
13#include "./nonlininteg_vecconvection_pa_grad.hpp" // IWYU pragma: keep
14
15namespace mfem
16{
17
19 const Vector &u, const FiniteElementSpace &fes)
20{
21 MFEM_VERIFY(!DeviceCanUseCeed(),
22 "VectorConvectionNLFIntegrator PA gradients are not supported "
23 "with the libCEED backend");
24
25 this->pa_u = u;
26 AssemblePA(fes);
27}
28
30 Vector &y) const
31{
32 MFEM_VERIFY(!DeviceCanUseCeed(),
33 "VectorConvectionNLFIntegrator PA gradients are not supported "
34 "with the libCEED backend");
35
36 if (dim == 2)
37 {
38 AddMultGradPA2D::Run(d1d, q1d, ne,
39 maps->B.Read(),
40 maps->G.Read(),
41 pa_adj.Read(),
42 pa_u.Read(),
43 x.Read(),
44 y.ReadWrite(),
45 d1d, q1d);
46 }
47 else if (dim == 3)
48 {
49 AddMultGradPA3D::Run(d1d, q1d, ne,
50 maps->B.Read(),
51 maps->G.Read(),
52 pa_adj.Read(),
53 pa_u.Read(),
54 x.Read(),
55 y.ReadWrite(),
56 d1d, q1d);
57 }
58 else
59 {
60 MFEM_ABORT("Unsupported dimension");
61 }
62}
63
64} // namespace mfem
const T * Read(bool on_dev=true) const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
Definition array.hpp:410
Array< real_t > G
Gradients/divergences/curls of basis functions evaluated at quadrature points.
Definition fe_base.hpp:222
Array< real_t > B
Basis functions evaluated at quadrature points.
Definition fe_base.hpp:201
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition fespace.hpp:210
void AssemblePA(const FiniteElementSpace &fes) override
Method defining partial assembly.
void AddMultGradPA(const Vector &x, Vector &y) const override
Method for partially assembled gradient action.
void AssembleGradPA(const Vector &x, const FiniteElementSpace &fes) override
Prepare the integrator for partial assembly (PA) gradient evaluations on the given FE space fes at th...
Vector data type.
Definition vector.hpp:82
virtual const real_t * Read(bool on_dev=true) const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), on_dev).
Definition vector.hpp:520
virtual real_t * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), on_dev).
Definition vector.hpp:536
real_t u(const Vector &xvec)
Definition lor_mms.hpp:22
bool DeviceCanUseCeed()
Function that determines if a CEED kernel should be used, based on the current mfem::Device configura...
Definition util.cpp:33