MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
lor_ads.hpp
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#ifndef MFEM_LOR_ADS
13#define MFEM_LOR_ADS
14
16
17#ifdef MFEM_USE_MPI
18
19#include "lor_rt.hpp"
20#include "lor_ams.hpp"
22
23namespace mfem
24{
25
26// Helper class for assembling the discrete curl, gradient and coordinate
27// vectors needed by the ADS solver. Generally, this class should *not* be
28// directly used by users, instead use LORSolver<HypreADS> (which internally
29// uses this class).
31{
32protected:
33 ParFiniteElementSpace &face_fes; ///< The RT space.
34 static constexpr int dim = 3; ///< Spatial dimension, always 3.
35 const int order; ///< Polynomial degree.
36 ND_FECollection edge_fec; ///< The associated Nedelec collection.
37 ParFiniteElementSpace edge_fes; ///< The associated Nedelec space.
38 BatchedLOR_AMS ams; ///< The associated AMS object.
39 HypreParMatrix *C; ///< The discrete curl matrix.
40
41 /// Form the local elementwise discrete curl matrix.
42 void Form3DFaceToEdge(Array<int> &face2edge);
43public:
44 /// @brief Construct the BatchedLOR_AMS object associated with the 3D RT
45 /// space @a pfes_ho_.
46 ///
47 /// The vector @a X_vert represents the LOR mesh coordinates in E-vector
48 /// format, see BatchedLORAssembly::GetLORVertexCoordinates.
50 const Vector &X_vert);
51 /// @brief Steal ownership of the discrete curl matrix.
52 ///
53 /// The caller assumes ownership and must delete the object. Subsequent calls
54 /// will return nullptr.
56 /// @brief Return the discrete curl matrix.
57 ///
58 /// The caller does not assume ownership, and must not delete the object.
59 HypreParMatrix *GetCurlMatrix() const { return C; };
60 /// Return the associated BatchedLOR_AMS object.
61 BatchedLOR_AMS &GetAMS() { return ams; }
62
63 // The following should be protected, but contain mfem::forall kernels
64
65 /// Form the discrete curl matrix (not part of the public API).
66 void FormCurlMatrix();
68};
69
70}
71
72#endif
73
74#endif
ParFiniteElementSpace & face_fes
The RT space.
Definition lor_ads.hpp:33
HypreParMatrix * StealCurlMatrix()
Steal ownership of the discrete curl matrix.
Definition lor_ads.cpp:184
BatchedLOR_AMS & GetAMS()
Return the associated BatchedLOR_AMS object.
Definition lor_ads.hpp:61
HypreParMatrix * C
The discrete curl matrix.
Definition lor_ads.hpp:39
ND_FECollection edge_fec
The associated Nedelec collection.
Definition lor_ads.hpp:36
void FormCurlMatrix()
Form the discrete curl matrix (not part of the public API).
Definition lor_ads.cpp:81
ParFiniteElementSpace edge_fes
The associated Nedelec space.
Definition lor_ads.hpp:37
HypreParMatrix * GetCurlMatrix() const
Return the discrete curl matrix.
Definition lor_ads.hpp:59
const int order
Polynomial degree.
Definition lor_ads.hpp:35
static constexpr int dim
Spatial dimension, always 3.
Definition lor_ads.hpp:34
BatchedLOR_ADS(ParFiniteElementSpace &pfes_ho_, const Vector &X_vert)
Construct the BatchedLOR_AMS object associated with the 3D RT space pfes_ho_.
Definition lor_ads.cpp:21
BatchedLOR_AMS ams
The associated AMS object.
Definition lor_ads.hpp:38
void Form3DFaceToEdge(Array< int > &face2edge)
Form the local elementwise discrete curl matrix.
Definition lor_ads.cpp:33
Wrapper for hypre's ParCSR matrix class.
Definition hypre.hpp:388
Arbitrary order H(curl)-conforming Nedelec finite elements.
Definition fe_coll.hpp:465
Abstract parallel finite element space.
Definition pfespace.hpp:29
Vector data type.
Definition vector.hpp:80