MFEM  v3.1 Finite element discretization library
hybridization.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
10 // Software Foundation) version 2.1 dated February 1999.
11
12 #ifndef MFEM_HYBRIDIZATION
13 #define MFEM_HYBRIDIZATION
14
15 #include "../config/config.hpp"
16 #include "fespace.hpp"
17 #include "bilininteg.hpp"
18
19 #ifdef MFEM_USE_MPI
20 #include "../linalg/hypre.hpp"
21 #endif
22
23 namespace mfem
24 {
25
65 {
66 protected:
69
71
74  double *Af_data;
75  int *Af_ipiv;
76
77 #ifdef MFEM_USE_MPI
79 #endif
80
81  void GetIBDofs(int el, Array<int> &i_dofs, Array<int> &b_dofs) const;
82
83  // Compute depending on mode:
84  // - mode 0: bf = Af^{-1} Rf^t b, where
85  // the non-"boundary" part of bf is set to 0;
86  // - mode 1: bf = Af^{-1} ( Rf^t b - Cf^t lambda ), where
87  // the "essential" part of bf is set to 0.
88  // Input: size(b) = fes->GetConformingVSize()
89  // size(lambda) = c_fes->GetConformingVSize()
90  void MultAfInv(const Vector &b, const Vector &lambda, Vector &bf,
91  int mode) const;
92
93 public:
98
103  { delete c_bfi; c_bfi = c_integ; }
104
106  void Init(const Array<int> &ess_tdof_list);
107
109  void AssembleMatrix(int el, const DenseMatrix &A);
110
112  void Finalize();
113
115  SparseMatrix &GetMatrix() { return *H; }
116
117 #ifdef MFEM_USE_MPI
118  HypreParMatrix &GetParallelMatrix() { return *pH; }
120 #endif
121
124  void ReduceRHS(const Vector &b, Vector &b_r) const;
125
129  void ComputeSolution(const Vector &b, const Vector &sol_r,
130  Vector &sol) const;
131 };
132
133 }
134
135 #endif
Array< int > Af_offsets
FiniteElementSpace * c_fes
Array< int > Af_f_offsets
void SetConstraintIntegrator(BilinearFormIntegrator *c_integ)
HypreParMatrix & GetParallelMatrix()
Return the parallel hybridized matrix.
Data type dense matrix using column-major storage.
Definition: densemat.hpp:22
SparseMatrix * Ct
void Finalize()
Finalize the construction of the hybridized matrix.
Data type sparse matrix.
Definition: sparsemat.hpp:38
SparseMatrix & GetMatrix()
Return the serial hybridized matrix.
void ComputeSolution(const Vector &b, const Vector &sol_r, Vector &sol) const
Array< int > hat_offsets
void MultAfInv(const Vector &b, const Vector &lambda, Vector &bf, int mode) const
BilinearFormIntegrator * c_bfi
Abstract base class BilinearFormIntegrator.
Definition: bilininteg.hpp:22
SparseMatrix * H
void AssembleMatrix(int el, const DenseMatrix &A)
Assemble the element matrix A into the hybridized system matrix.
Abstract finite element space.
Definition: fespace.hpp:62
void GetIBDofs(int el, Array< int > &i_dofs, Array< int > &b_dofs) const
~Hybridization()
Destructor.
FiniteElementSpace * fes
Array< int > hat_dofs_marker
HypreParMatrix * pH
Vector data type.
Definition: vector.hpp:33
void ReduceRHS(const Vector &b, Vector &b_r) const
void Init(const Array< int > &ess_tdof_list)
Prepare the Hybridization object for assembly.
Wrapper for hypre&#39;s ParCSR matrix class.
Definition: hypre.hpp:143
Hybridization(FiniteElementSpace *fespace, FiniteElementSpace *c_fespace)
Constructor.