1 // Copyright (c) 2010-2021, 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_PRESTRICTION
13 #define MFEM_PRESTRICTION
14 
15 #include "../config/config.hpp"
16 
17 #ifdef MFEM_USE_MPI
18 
19 #include "restriction.hpp"
20 
21 namespace mfem
22 {
23 
24 class ParFiniteElementSpace;
25 
26 /// Operator that extracts Face degrees of freedom in parallel.
27 /** Objects of this type are typically created and owned by FiniteElementSpace
28     objects, see FiniteElementSpace::GetFaceRestriction(). */
29 class ParL2FaceRestriction : public L2FaceRestriction
30 {
31 public:
32    ParL2FaceRestriction(const ParFiniteElementSpace&, ElementDofOrdering,
33                         FaceType type,
34                         L2FaceValues m = L2FaceValues::DoubleValued);
35    void Mult(const Vector &x, Vector &y) const;
36    /** Fill the I array of SparseMatrix corresponding to the sparsity pattern
37        given by this L2FaceRestriction. */
38    virtual void FillI(SparseMatrix &mat, const bool keep_nbr_block = false) const;
39    /** Fill the I array of SparseMatrix corresponding to the sparsity pattern
40        given by this L2FaceRestriction. @a mat contains the interior dofs
41        contribution, the @a face_mat contains the shared dofs contribution.*/
42    virtual void FillI(SparseMatrix &mat, SparseMatrix &face_mat) const;
43    /** Fill the J and Data arrays of SparseMatrix corresponding to the sparsity
44        pattern given by this L2FaceRestriction, and the values of ea_data.
45        @a mat contains the interior dofs contribution, the @a face_mat contains
46        the shared dofs contribution.*/
47    virtual void FillJAndData(const Vector &ea_data,
48                              SparseMatrix &mat,
49                              SparseMatrix &face_mat) const;
50 
51    virtual void FillJAndData(const Vector &ea_data,
52                              SparseMatrix &mat,
53                              const bool keep_nbr_block = false) const;
54 };
55 
56 }
57 
58 #endif // MFEM_USE_MPI
59 
60 #endif // MFEM_PRESTRICTION
61