MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
change_basis.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 CHANGE_BASIS_HPP
13#define CHANGE_BASIS_HPP
14
15#include "mfem.hpp"
16
17namespace mfem
18{
19
20/// @brief Change of basis operator between L2 spaces.
21///
22/// This represents the change-of-basis operator from the given L2 space to a
23/// space using the IntegratedGLL basis.
25{
26private:
27 const int ne; ///< Number of elements in the mesh.
28 mutable DofToQuad dof2quad; ///< 1D basis transformation.
29 Array<real_t> B_1d; ///< 1D basis transformation matrix.
30 Array<real_t> Bt_1d; ///< 1D basis transformation matrix transpose.
31 bool no_op; ///< If the basis types are the same, the operation is a no-op.
32public:
34 void Mult(const Vector &x, Vector &y) const override;
35 void MultTranspose(const Vector &x, Vector &y) const override;
36};
37
38/// Change of basis operator between RT spaces.
39///
40/// This represents the change-of-basis operator from the given RT space to a
41/// space using Gauss-Lobatto as the "open" basis and IntegratedGLL as the
42/// "closed" basis.
44{
45public:
46 // Should be private, nvcc limitation...
47 enum Mode
48 {
52 };
53private:
54 FiniteElementSpace &fes; ///< The finite element space.
55 const int dim; ///< Dimension of the mesh.
56 const int ne; ///< Number of elements.
57 const int p; ///< Polynomial degree.
58 const ElementRestriction *elem_restr; ///< Element restriction operator.
59 Array<real_t> Bc_1d; ///< 1D closed basis transformation matrix.
60 Array<real_t> Bci_1d; ///< 1D closed basis transformation matrix inverse.
61 Array<real_t> Bct_1d; ///< 1D closed basis transformation matrix transpose.
62 Array<real_t> Bo_1d; ///< 1D open basis transformation matrix.
63 Array<real_t> Boi_1d; ///< 1D open basis transformation matrix inverse.
64 Array<real_t> Bot_1d; ///< 1D open basis transformation matrix transpose.
65
66 mutable Vector x_l, y_l; ///< L-vector layout
67 mutable Vector x_e, y_e; ///< E-vector layout
68
69 bool no_op; ///< If the spaces are the same, the operation is a no-op.
70
71 void Mult(const Vector &x, Vector &y, Mode mode) const;
72 const real_t *GetOpenMap(Mode mode) const;
73 const real_t *GetClosedMap(Mode mode) const;
74public:
76 void Mult(const Vector &x, Vector &y) const override;
77 void MultTranspose(const Vector &x, Vector &y) const override;
78 void MultInverse(const Vector &x, Vector &y) const;
79 // The following should be considered private, public because of compiler
80 // limitations
81 void MultRT_2D(const Vector &x, Vector &y, Mode mode) const;
82 void MultRT_3D(const Vector &x, Vector &y, Mode mode) const;
83};
84
85} // namespace mfem
86
87#endif
Change of basis operator between L2 spaces.
void MultTranspose(const Vector &x, Vector &y) const override
Action of the transpose operator: y=A^t(x). The default behavior in class Operator is to generate an ...
void Mult(const Vector &x, Vector &y) const override
Operator application: y=A(x).
void MultTranspose(const Vector &x, Vector &y) const override
Action of the transpose operator: y=A^t(x). The default behavior in class Operator is to generate an ...
void MultInverse(const Vector &x, Vector &y) const
void MultRT_2D(const Vector &x, Vector &y, Mode mode) const
void MultRT_3D(const Vector &x, Vector &y, Mode mode) const
Structure representing the matrices/tensors needed to evaluate (in reference space) the values,...
Definition: fe_base.hpp:137
Operator that converts FiniteElementSpace L-vectors to E-vectors.
Definition: restriction.hpp:41
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition: fespace.hpp:220
Abstract operator.
Definition: operator.hpp:25
Vector data type.
Definition: vector.hpp:80
float real_t
Definition: config.hpp:43