MFEM  v3.3
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
pbilinearform.cpp
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
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #include "../config/config.hpp"
13 
14 #ifdef MFEM_USE_MPI
15 
16 #include "fem.hpp"
17 #include "../general/sort_pairs.hpp"
18 
19 namespace mfem
20 {
21 
23 {
24  int nbr_size = pfes->GetFaceNbrVSize();
25 
26  if (precompute_sparsity == 0 || fes->GetVDim() > 1)
27  {
28  if (keep_nbr_block)
29  {
30  mat = new SparseMatrix(height + nbr_size, width + nbr_size);
31  }
32  else
33  {
34  mat = new SparseMatrix(height, width + nbr_size);
35  }
36  return;
37  }
38 
39  // the sparsity pattern is defined from the map: face->element->dof
40  const Table &lelem_ldof = fes->GetElementToDofTable(); // <-- dofs
41  const Table &nelem_ndof = pfes->face_nbr_element_dof; // <-- vdofs
42  Table elem_dof; // element + nbr-element <---> dof
43  if (nbr_size > 0)
44  {
45  // merge lelem_ldof and nelem_ndof into elem_dof
46  int s1 = lelem_ldof.Size(), s2 = nelem_ndof.Size();
47  const int *I1 = lelem_ldof.GetI(), *J1 = lelem_ldof.GetJ();
48  const int *I2 = nelem_ndof.GetI(), *J2 = nelem_ndof.GetJ();
49  const int nnz1 = I1[s1], nnz2 = I2[s2];
50 
51  elem_dof.SetDims(s1 + s2, nnz1 + nnz2);
52 
53  int *I = elem_dof.GetI(), *J = elem_dof.GetJ();
54  for (int i = 0; i <= s1; i++)
55  {
56  I[i] = I1[i];
57  }
58  for (int j = 0; j < nnz1; j++)
59  {
60  J[j] = J1[j];
61  }
62  for (int i = 0; i <= s2; i++)
63  {
64  I[s1+i] = I2[i] + nnz1;
65  }
66  for (int j = 0; j < nnz2; j++)
67  {
68  J[nnz1+j] = J2[j] + height;
69  }
70  }
71  // dof_elem x elem_face x face_elem x elem_dof (keep_nbr_block = true)
72  // ldof_lelem x lelem_face x face_elem x elem_dof (keep_nbr_block = false)
73  Table dof_dof;
74  {
75  Table face_dof; // face_elem x elem_dof
76  {
77  Table *face_elem = pfes->GetParMesh()->GetFaceToAllElementTable();
78  if (nbr_size > 0)
79  {
80  mfem::Mult(*face_elem, elem_dof, face_dof);
81  }
82  else
83  {
84  mfem::Mult(*face_elem, lelem_ldof, face_dof);
85  }
86  delete face_elem;
87  if (nbr_size > 0)
88  {
89  elem_dof.Clear();
90  }
91  }
92 
93  if (keep_nbr_block)
94  {
95  Table dof_face;
96  Transpose(face_dof, dof_face, height + nbr_size);
97  mfem::Mult(dof_face, face_dof, dof_dof);
98  }
99  else
100  {
101  Table ldof_face;
102  {
103  Table face_ldof;
104  Table *face_lelem = fes->GetMesh()->GetFaceToElementTable();
105  mfem::Mult(*face_lelem, lelem_ldof, face_ldof);
106  delete face_lelem;
107  Transpose(face_ldof, ldof_face, height);
108  }
109  mfem::Mult(ldof_face, face_dof, dof_dof);
110  }
111  }
112 
113  int *I = dof_dof.GetI();
114  int *J = dof_dof.GetJ();
115  int nrows = dof_dof.Size();
116  double *data = new double[I[nrows]];
117 
118  mat = new SparseMatrix(I, J, data, nrows, height + nbr_size);
119  *mat = 0.0;
120 
121  dof_dof.LoseData();
122 }
123 
125 {
126  A.Clear();
127 
128  if (A_local == NULL) { return; }
129  MFEM_VERIFY(A_local->Finalized(), "the local matrix must be finalized");
130 
131  OperatorHandle dA(A.Type()), Ph(A.Type()), hdA;
132 
133  if (fbfi.Size() == 0)
134  {
135  // construct a parallel block-diagonal matrix 'A' based on 'a'
137  pfes->GetDofOffsets(), A_local);
138  }
139  else
140  {
141  // handle the case when 'a' contains offdiagonal
142  int lvsize = pfes->GetVSize();
143  const HYPRE_Int *face_nbr_glob_ldof = pfes->GetFaceNbrGlobalDofMap();
144  HYPRE_Int ldof_offset = pfes->GetMyDofOffset();
145 
146  Array<HYPRE_Int> glob_J(A_local->NumNonZeroElems());
147  int *J = A_local->GetJ();
148  for (int i = 0; i < glob_J.Size(); i++)
149  {
150  if (J[i] < lvsize)
151  {
152  glob_J[i] = J[i] + ldof_offset;
153  }
154  else
155  {
156  glob_J[i] = face_nbr_glob_ldof[J[i] - lvsize];
157  }
158  }
159 
160  // TODO - construct dA directly in the A format
161  hdA.Reset(
162  new HypreParMatrix(pfes->GetComm(), lvsize, pfes->GlobalVSize(),
163  pfes->GlobalVSize(), A_local->GetI(), glob_J,
164  A_local->GetData(), pfes->GetDofOffsets(),
165  pfes->GetDofOffsets()));
166  // - hdA owns the new HypreParMatrix
167  // - the above constructor copies all input arrays
168  glob_J.DeleteAll();
169  dA.ConvertFrom(hdA);
170  }
171 
172  // TODO - assemble the Dof_TrueDof_Matrix directly in the required format?
173  Ph.ConvertFrom(pfes->Dof_TrueDof_Matrix());
174 
175  A.MakePtAP(dA, Ph);
176 }
177 
179 {
181  ParallelAssemble(Mh, m);
182  Mh.SetOperatorOwner(false);
183  return Mh.As<HypreParMatrix>();
184 }
185 
187 {
188  ParMesh *pmesh = pfes->GetParMesh();
190  Array<int> vdofs1, vdofs2, vdofs_all;
192 
193  int nfaces = pmesh->GetNSharedFaces();
194  for (int i = 0; i < nfaces; i++)
195  {
196  T = pmesh->GetSharedFaceTransformations(i);
197  pfes->GetElementVDofs(T->Elem1No, vdofs1);
198  pfes->GetFaceNbrElementVDofs(T->Elem2No, vdofs2);
199  vdofs1.Copy(vdofs_all);
200  for (int j = 0; j < vdofs2.Size(); j++)
201  {
202  vdofs2[j] += height;
203  }
204  vdofs_all.Append(vdofs2);
205  for (int k = 0; k < fbfi.Size(); k++)
206  {
207  fbfi[k]->AssembleFaceMatrix(*pfes->GetFE(T->Elem1No),
208  *pfes->GetFaceNbrFE(T->Elem2No),
209  *T, elemmat);
210  if (keep_nbr_block)
211  {
212  mat->AddSubMatrix(vdofs_all, vdofs_all, elemmat, skip_zeros);
213  }
214  else
215  {
216  mat->AddSubMatrix(vdofs1, vdofs_all, elemmat, skip_zeros);
217  }
218  }
219  }
220 }
221 
222 void ParBilinearForm::Assemble(int skip_zeros)
223 {
224  if (mat == NULL && fbfi.Size() > 0)
225  {
227  pAllocMat();
228  }
229 
230  BilinearForm::Assemble(skip_zeros);
231 
232  if (fbfi.Size() > 0)
233  {
234  AssembleSharedFaces(skip_zeros);
235  }
236 }
237 
238 void ParBilinearForm
240  HypreParMatrix &A, const HypreParVector &X,
241  HypreParVector &B) const
242 {
243  Array<int> dof_list;
244 
245  pfes->GetEssentialTrueDofs(bdr_attr_is_ess, dof_list);
246 
247  // do the parallel elimination
248  A.EliminateRowsCols(dof_list, X, B);
249 }
250 
253  HypreParMatrix &A) const
254 {
255  Array<int> dof_list;
256 
257  pfes->GetEssentialTrueDofs(bdr_attr_is_ess, dof_list);
258 
259  return A.EliminateRowsCols(dof_list);
260 }
261 
262 void ParBilinearForm::TrueAddMult(const Vector &x, Vector &y, const double a)
263 const
264 {
265  MFEM_VERIFY(fbfi.Size() == 0, "the case of interior face integrators is not"
266  " implemented");
267 
268  if (X.ParFESpace() != pfes)
269  {
270  X.SetSpace(pfes);
271  Y.SetSpace(pfes);
272  }
273 
274  X.Distribute(&x);
275  mat->Mult(X, Y);
276  pfes->Dof_TrueDof_Matrix()->MultTranspose(a, Y, 1.0, y);
277 }
278 
280  const Array<int> &ess_tdof_list, Vector &x, Vector &b,
281  OperatorHandle &A, Vector &X, Vector &B, int copy_interior)
282 {
283  // Finish the matrix assembly and perform BC elimination, storing the
284  // eliminated part of the matrix.
285  FormSystemMatrix(ess_tdof_list, A);
286 
288  const SparseMatrix &R = *pfes->GetRestrictionMatrix();
289 
290  // Transform the system and perform the elimination in B, based on the
291  // essential BC values from x. Restrict the BC part of x in X, and set the
292  // non-BC part to zero. Since there is no good initial guess for the Lagrange
293  // multipliers, set X = 0.0 for hybridization.
294  if (static_cond)
295  {
296  // Schur complement reduction to the exposed dofs
297  static_cond->ReduceSystem(x, b, X, B, copy_interior);
298  }
299  else if (hybridization)
300  {
301  // Reduction to the Lagrange multipliers system
302  HypreParVector true_X(pfes), true_B(pfes);
303  P.MultTranspose(b, true_B);
304  R.Mult(x, true_X);
305  p_mat.EliminateBC(p_mat_e, ess_tdof_list, true_X, true_B);
306  R.MultTranspose(true_B, b);
307  hybridization->ReduceRHS(true_B, B);
308  X.SetSize(B.Size());
309  X = 0.0;
310  }
311  else
312  {
313  // Variational restriction with P
314  X.SetSize(pfes->TrueVSize());
315  B.SetSize(X.Size());
316  P.MultTranspose(b, B);
317  R.Mult(x, X);
318  p_mat.EliminateBC(p_mat_e, ess_tdof_list, X, B);
319  if (!copy_interior) { X.SetSubVectorComplement(ess_tdof_list, 0.0); }
320  }
321 }
322 
324  OperatorHandle &A)
325 {
326  // Finish the matrix assembly and perform BC elimination, storing the
327  // eliminated part of the matrix.
328  if (static_cond)
329  {
331  {
332  static_cond->SetEssentialTrueDofs(ess_tdof_list);
335  }
337  }
338  else
339  {
340  if (mat)
341  {
342  const int remove_zeros = 0;
343  Finalize(remove_zeros);
344  MFEM_VERIFY(p_mat.Ptr() == NULL && p_mat_e.Ptr() == NULL,
345  "The ParBilinearForm must be updated with Update() before "
346  "re-assembling the ParBilinearForm.");
348  delete mat;
349  mat = NULL;
350  delete mat_e;
351  mat_e = NULL;
352  p_mat_e.EliminateRowsCols(p_mat, ess_tdof_list);
353  }
354  if (hybridization)
355  {
357  }
358  else
359  {
360  A = p_mat;
361  }
362  }
363 }
364 
366  const Vector &X, const Vector &b, Vector &x)
367 {
369 
370  if (static_cond)
371  {
372  // Private dofs back solve
373  static_cond->ComputeSolution(b, X, x);
374  }
375  else if (hybridization)
376  {
377  // Primal unknowns recovery
378  HypreParVector true_X(pfes), true_B(pfes);
379  P.MultTranspose(b, true_B);
380  const SparseMatrix &R = *pfes->GetRestrictionMatrix();
381  R.Mult(x, true_X); // get essential b.c. from x
382  hybridization->ComputeSolution(true_B, X, true_X);
383  x.SetSize(P.Height());
384  P.Mult(true_X, x);
385  }
386  else
387  {
388  // Apply conforming prolongation
389  x.SetSize(P.Height());
390  P.Mult(X, x);
391  }
392 }
393 
395 {
396  BilinearForm::Update(nfes);
397 
398  if (nfes)
399  {
400  pfes = dynamic_cast<ParFiniteElementSpace *>(nfes);
401  MFEM_VERIFY(pfes != NULL, "nfes must be a ParFiniteElementSpace!");
402  }
403 
404  p_mat.Clear();
405  p_mat_e.Clear();
406 }
407 
408 
410 {
411  // construct the block-diagonal matrix A
412  HypreParMatrix *A =
418  mat);
419 
422 
423  delete A;
424 
425  return rap;
426 }
427 
429 {
430  // construct the rectangular block-diagonal matrix dA
431  OperatorHandle dA(A.Type());
437  mat);
438 
439  OperatorHandle P_test(A.Type()), P_trial(A.Type());
440 
441  // TODO - construct the Dof_TrueDof_Matrix directly in the required format.
443  P_trial.ConvertFrom(trial_pfes->Dof_TrueDof_Matrix());
444 
445  A.MakeRAP(P_test, dA, P_trial);
446 }
447 
448 /// Compute y += a (P^t A P) x, where x and y are vectors on the true dofs
450  const double a) const
451 {
452  if (X.ParFESpace() != trial_pfes)
453  {
456  }
457 
458  X.Distribute(&x);
459  mat->Mult(X, Y);
461 }
462 
463 
465 {
466  MFEM_ASSERT(mat, "matrix is not assembled");
467  MFEM_ASSERT(mat->Finalized(), "matrix is not finalized");
471  delete RA;
472  return RAP;
473 }
474 
476 const
477 {
478  MFEM_VERIFY(mat->Finalized(), "local matrix needs to be finalized for "
479  "GetParBlocks");
480 
482 
483  blocks.SetSize(range_fes->GetVDim(), domain_fes->GetVDim());
484 
485  RLP->GetBlocks(blocks,
488 
489  delete RLP;
490 }
491 
492 }
493 
494 #endif
Ordering::Type GetOrdering() const
Return the ordering method.
Definition: fespace.hpp:175
int Size() const
Logical size of the array.
Definition: array.hpp:109
void EliminateRowsCols(const Array< int > &rows_cols, const HypreParVector &X, HypreParVector &B)
Definition: hypre.cpp:1263
int GetVSize() const
Definition: fespace.hpp:163
virtual int NumNonZeroElems() const
Returns the number of the nonzero elements in the matrix.
Definition: sparsemat.cpp:972
void ConvertFrom(OperatorHandle &A)
Convert the given OperatorHandle A to the currently set type id.
Definition: handle.cpp:163
OpType * As() const
Return the Operator pointer statically cast to a specified OpType. Similar to the method Get()...
Definition: handle.hpp:91
int * GetJ()
Definition: table.hpp:108
void SetSpace(ParFiniteElementSpace *f)
Definition: pgridfunc.cpp:71
Array< BilinearFormIntegrator * > fbfi
Set of interior face Integrators to be applied.
void Assemble(int skip_zeros=1)
Assembles the form i.e. sums over all domain/bdr integrators.
void FormLinearSystem(const Array< int > &ess_tdof_list, Vector &x, Vector &b, OperatorHandle &A, Vector &X, Vector &B, int copy_interior=0)
HypreParMatrix * LeftDiagMult(const SparseMatrix &D, HYPRE_Int *row_starts=NULL) const
Definition: hypre.cpp:1019
void SetSize(int s)
Resize the vector to size s.
Definition: vector.hpp:310
HYPRE_Int MultTranspose(HypreParVector &x, HypreParVector &y, double alpha=1.0, double beta=0.0)
Computes y = alpha * A^t * x + beta * y.
Definition: hypre.cpp:1013
void GetElementVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom in array dofs for i&#39;th element.
Definition: fespace.cpp:133
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
Definition: table.cpp:468
HypreParMatrix & GetParallelMatrix()
Return the parallel hybridized matrix.
int GetNSharedFaces() const
Return the number of shared faces (3D), edges (2D), vertices (1D)
Definition: pmesh.cpp:2005
Pointer to an Operator of a specified type.
Definition: handle.hpp:34
void SetDims(int rows, int nnz)
Definition: table.cpp:132
Operator::Type Type() const
Get the currently set operator type id.
Definition: handle.hpp:86
void Copy(Array &copy) const
Create a copy of the current array.
Definition: array.hpp:160
void EliminateBC(const OperatorHandle &A_e, const Array< int > &ess_dof_list, const Vector &X, Vector &B) const
Eliminate essential dofs from the solution X into the r.h.s. B.
Definition: handle.cpp:236
HYPRE_Int * GetDofOffsets()
Definition: pfespace.hpp:169
Data type dense matrix using column-major storage.
Definition: densemat.hpp:22
int Size() const
Returns the size of the vector.
Definition: vector.hpp:106
void TrueAddMult(const Vector &x, Vector &y, const double a=1.0) const
Compute y += a (P^t A P) x, where x and y are vectors on the true dofs.
void ReduceSystem(Vector &x, Vector &b, Vector &X, Vector &B, int copy_interior=0) const
Set the reduced solution X and r.h.s B vectors from the full linear system solution x and r...
Definition: staticcond.cpp:417
OperatorHandle p_mat_e
void LoseData()
Call this if data has been stolen.
Definition: table.hpp:141
Abstract parallel finite element space.
Definition: pfespace.hpp:28
virtual const SparseMatrix * GetRestrictionMatrix()
Get the R matrix which restricts a local dof vector to true dof vector.
Definition: pfespace.hpp:244
void AssembleSharedFaces(int skip_zeros=1)
void ComputeSolution(const Vector &b, const Vector &sc_sol, Vector &sol) const
Definition: staticcond.cpp:477
const HYPRE_Int * GetFaceNbrGlobalDofMap()
Definition: pfespace.hpp:254
HYPRE_Int Mult(HypreParVector &x, HypreParVector &y, double alpha=1.0, double beta=0.0)
Computes y = alpha * A * x + beta * y.
Definition: hypre.cpp:943
HYPRE_Int GetMyDofOffset() const
Definition: pfespace.cpp:612
void DeleteAll()
Delete whole array.
Definition: array.hpp:481
HypreParMatrix * ParallelAssemble()
Returns the matrix assembled on the true dofs, i.e. P^t A P.
virtual void Update(FiniteElementSpace *nfes=NULL)
HYPRE_Int * GetTrueDofOffsets()
Definition: pfespace.hpp:170
HypreParMatrix * ParallelAssemble()
Returns the matrix assembled on the true dofs, i.e. P_test^t A P_trial.
void GetFaceNbrElementVDofs(int i, Array< int > &vdofs) const
Definition: pfespace.cpp:842
void SetSize(int m, int n)
Definition: array.hpp:282
ParFiniteElementSpace * pfes
const FiniteElement * GetFaceNbrFE(int i) const
Definition: pfespace.cpp:876
Data type sparse matrix.
Definition: sparsemat.hpp:38
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
Definition: operator.hpp:36
StaticCondensation * static_cond
int Append(const T &el)
Append element to array, resize if necessary.
Definition: array.hpp:394
Mesh * GetMesh() const
Returns the mesh.
Definition: fespace.hpp:136
void Clear()
Definition: table.cpp:363
SparseMatrix * mat
Sparse matrix to be associated with the form.
void ComputeSolution(const Vector &b, const Vector &sol_r, Vector &sol) const
void EliminateRowsCols(OperatorHandle &A, const Array< int > &ess_dof_list)
Reset the OperatorHandle to be the eliminated part of A after elimination of the essential dofs ess_d...
Definition: handle.cpp:194
FaceElementTransformations * GetSharedFaceTransformations(int sf, bool fill2=true)
Definition: pmesh.cpp:1920
HypreParMatrix * RAP(HypreParMatrix *A, HypreParMatrix *P)
Returns the matrix P^t * A * P.
Definition: hypre.cpp:1385
HypreParMatrix & GetParallelMatrix()
Return the parallel Schur complement matrix.
Definition: staticcond.hpp:159
void Assemble(int skip_zeros=1)
Assemble the local matrix.
void Transpose(const Table &A, Table &At, int _ncols_A)
Transpose a Table.
Definition: table.cpp:408
virtual void Update(FiniteElementSpace *nfes=NULL)
ParFiniteElementSpace * test_pfes
int Size() const
Returns the number of TYPE I elements.
Definition: table.hpp:86
int GetVDim() const
Returns vector dimension.
Definition: fespace.hpp:153
double * GetData() const
Return element data, i.e. array A.
Definition: sparsemat.hpp:135
void AddSubMatrix(const Array< int > &rows, const Array< int > &cols, const DenseMatrix &subm, int skip_zeros=1)
Definition: sparsemat.cpp:1850
Operator * Ptr() const
Access the underlying Operator pointer.
Definition: handle.hpp:83
int * GetI() const
Return the array I.
Definition: sparsemat.hpp:131
void SetSubVectorComplement(const Array< int > &dofs, const double val)
Set all vector entries NOT in the &#39;dofs&#39; array to the given &#39;val&#39;.
Definition: vector.cpp:598
bool Finalized() const
Definition: sparsemat.hpp:283
HypreParMatrix * ParallelAssemble() const
Returns the matrix &quot;assembled&quot; on the true dofs.
SparseMatrix * mat_e
Matrix used to eliminate b.c.
Wrapper for hypre&#39;s parallel vector class.
Definition: hypre.hpp:72
ParFiniteElementSpace * domain_fes
virtual void Mult(const Vector &x, Vector &y) const
Matrix vector multiplication.
Definition: sparsemat.cpp:475
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list)
Definition: pfespace.cpp:521
void Finalize()
Finalize the construction of the Schur complement matrix.
Definition: staticcond.cpp:235
void Clear()
Clear the OperatorHandle, deleting the held Operator (if owned), while leaving the type id unchanged...
Definition: handle.hpp:111
void Distribute(const Vector *tv)
Definition: pgridfunc.cpp:92
void EliminateReducedTrueDofs(const Array< int > &ess_rtdof_list, int keep_diagonal)
Eliminate the given reduced true dofs from the Schur complement matrix S.
Definition: staticcond.cpp:288
virtual void RecoverFEMSolution(const Vector &X, const Vector &b, Vector &x)
int height
Dimension of the output / number of rows in the matrix.
Definition: operator.hpp:24
Table * GetFaceToElementTable() const
Definition: mesh.cpp:3803
void FormSystemMatrix(const Array< int > &ess_tdof_list, OperatorHandle &A)
Form the linear system matrix A, see FormLinearSystem() for details.
void SetOperatorOwner(bool own=true)
Set the ownership flag for the held Operator.
Definition: handle.hpp:107
void MakeSquareBlockDiag(MPI_Comm comm, HYPRE_Int glob_size, HYPRE_Int *row_starts, SparseMatrix *diag)
Reset the OperatorHandle to hold a parallel square block-diagonal matrix using the currently set type...
Definition: handle.cpp:48
virtual void Finalize(int skip_zeros=1)
Finalizes the matrix initialization.
ParFiniteElementSpace * range_fes
bool HasEliminatedBC() const
Return true if essential boundary conditions have been eliminated from the Schur complement matrix...
Definition: staticcond.hpp:142
void MultTranspose(const Vector &x, Vector &y) const
Multiply a vector with the transposed matrix. y = At * x.
Definition: sparsemat.cpp:552
FiniteElementSpace * fes
FE space on which the form lives.
void ParallelEliminateEssentialBC(const Array< int > &bdr_attr_is_ess, HypreParMatrix &A, const HypreParVector &X, HypreParVector &B) const
Eliminate essential boundary DOFs from a parallel assembled system.
const FiniteElement * GetFE(int i) const
Returns pointer to the FiniteElement associated with i&#39;th element.
Definition: fespace.cpp:1134
DenseMatrix elemmat
void MakeRectangularBlockDiag(MPI_Comm comm, HYPRE_Int glob_num_rows, HYPRE_Int glob_num_cols, HYPRE_Int *row_starts, HYPRE_Int *col_starts, SparseMatrix *diag)
Reset the OperatorHandle to hold a parallel rectangular block-diagonal matrix using the currently set...
Definition: handle.cpp:72
ParFiniteElementSpace * trial_pfes
int GetFaceNbrVSize() const
Definition: pfespace.hpp:249
OperatorHandle p_mat
Vector data type.
Definition: vector.hpp:36
void GetParBlocks(Array2D< HypreParMatrix * > &blocks) const
Hybridization * hybridization
void ReduceRHS(const Vector &b, Vector &b_r) const
int * GetI()
Definition: table.hpp:107
const Table & GetElementToDofTable() const
Definition: fespace.hpp:288
void SetEssentialTrueDofs(const Array< int > &ess_tdof_list)
Determine and save internally essential reduced true dofs.
Definition: staticcond.hpp:128
Table * GetFaceToAllElementTable() const
Definition: pmesh.cpp:1832
Wrapper for hypre&#39;s ParCSR matrix class.
Definition: hypre.hpp:174
void TrueAddMult(const Vector &x, Vector &y, const double a=1.0) const
Compute y += a (P^t A P) x, where x and y are vectors on the true dofs.
HypreParMatrix * Dof_TrueDof_Matrix()
The true dof-to-dof interpolation matrix.
Definition: pfespace.hpp:193
int * GetJ() const
Return the array J.
Definition: sparsemat.hpp:133
Class for parallel meshes.
Definition: pmesh.hpp:28
void MakePtAP(OperatorHandle &A, OperatorHandle &P)
Reset the OperatorHandle to hold the product P^t A P.
Definition: handle.cpp:98
int width
Dimension of the input / number of columns in the matrix.
Definition: operator.hpp:25
void MakeRAP(OperatorHandle &Rt, OperatorHandle &A, OperatorHandle &P)
Reset the OperatorHandle to hold the product R A P, where R = Rt^t.
Definition: handle.cpp:130
ParFiniteElementSpace * ParFESpace() const
Definition: pgridfunc.hpp:75