MFEM v4.9.0
Finite element discretization library
Loading...
Searching...
No Matches
pbilinearform.hpp
Go to the documentation of this file.
1// Copyright (c) 2010-2025, 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_PBILINEARFORM
13#define MFEM_PBILINEARFORM
14
15#include "../config/config.hpp"
16
17#ifdef MFEM_USE_MPI
18
19#include <mpi.h>
20#include "pfespace.hpp"
21#include "pgridfunc.hpp"
22#include "bilinearform.hpp"
23
24namespace mfem
25{
26
27/// Class for parallel bilinear form
29{
31protected:
32 ParFiniteElementSpace *pfes; ///< Points to the same object as #fes
33
34 /// Auxiliary vectors used in TrueAddMult(): L-, L-, and T-vector, resp.
35 mutable Vector Xaux, Yaux, Ytmp;
36
38
40
41 // Allocate mat - called when (mat == NULL && fbfi.Size() > 0)
42 void pAllocMat();
43
44 void AssembleSharedFaces(int skip_zeros = 1);
45
46private:
47 /// Copy construction is not supported; body is undefined.
49
50 /// Copy assignment is not supported; body is undefined.
51 ParBilinearForm &operator=(const ParBilinearForm &);
52
53public:
54 /// Creates parallel bilinear form associated with the FE space @a *pf.
55 /** The pointer @a pf is not owned by the newly constructed object. */
60
61 /** @brief Create a ParBilinearForm on the ParFiniteElementSpace @a *pf,
62 using the same integrators as the ParBilinearForm @a *bf.
63
64 The pointer @a pf is not owned by the newly constructed object.
65
66 The integrators in @a bf are copied as pointers and they are not owned by
67 the newly constructed ParBilinearForm. */
72
73 /** When set to true and the ParBilinearForm has interior face integrators,
74 the local SparseMatrix will include the rows (in addition to the columns)
75 corresponding to face-neighbor dofs. The default behavior is to disregard
76 those rows. Must be called before the first Assemble() call. */
77 void KeepNbrBlock(bool knb = true) { keep_nbr_block = knb; }
78
79 /** @brief Set the operator type id for the parallel matrix/operator when
80 using AssemblyLevel::LEGACY. */
81 /** If using static condensation or hybridization, call this method *after*
82 enabling it. */
84 {
85 p_mat.SetType(tid); p_mat_e.SetType(tid);
86 if (hybridization) { hybridization->SetOperatorType(tid); }
87 if (static_cond) { static_cond->SetOperatorType(tid); }
88 }
89
90 /// Assemble the local matrix
91 void Assemble(int skip_zeros = 1);
92
93 /** @brief Assemble the diagonal of the bilinear form into @a diag. Note that
94 @a diag is a true-dof Vector.
95
96 When the AssemblyLevel is not LEGACY, and the mesh is nonconforming,
97 this method returns |P^T| d_l, where d_l is the local diagonal of the
98 form before applying parallel/conforming assembly, P^T is the transpose
99 of the parallel/conforming prolongation, and |.| denotes the entry-wise
100 absolute value. In general, this is just an approximation of the exact
101 diagonal for this case. */
102 void AssembleDiagonal(Vector &diag) const override;
103
104 /// Returns the matrix assembled on the true dofs, i.e. P^t A P.
105 /** The returned matrix is the internal one, owned by the form. It is not
106 reassembled if it has been already constructed. If FormSystemMatrix()
107 has been called before, it is the system matrix with eliminated
108 essential DOFs, otherwise the parallel matrix is assembled here without
109 the elimination process. */
111
112 /// Returns the matrix assembled on the true dofs, i.e. P^t A P.
113 /** The returned matrix has to be deleted by the caller. */
115
116 /// Returns the eliminated matrix assembled on the true dofs, i.e. P^t A_e P.
117 /** The returned matrix has to be deleted by the caller. */
119
120 /// Return the matrix @a m assembled on the true dofs, i.e. P^t A P.
121 /** The returned matrix has to be deleted by the caller. */
123
124 /** @brief Compute parallel RAP operator and store it in @a A as a HypreParMatrix.
125
126 @param[in] loc_A The rank-local `SparseMatrix`.
127 @param[out] A The `OperatorHandle` containing the global `HypreParMatrix`.
128 @param[in] steal_loc_A Have the `HypreParMatrix` in @a A take ownership of
129 the memory objects in @a loc_A.
130 */
131 void ParallelRAP(SparseMatrix &loc_A,
133 bool steal_loc_A = false);
134
135 /** @brief Returns the matrix assembled on the true dofs, i.e.
136 @a A = P^t A_local P, in the format (type id) specified by @a A. */
138
139 /** Returns the eliminated matrix assembled on the true dofs, i.e.
140 @a A_elim = P^t A_elim_local P in the format (type id) specified by @a A.
141 */
144
145 /** Returns the matrix @a A_local assembled on the true dofs, i.e.
146 @a A = P^t A_local P in the format (type id) specified by @a A. */
148
149 /// Eliminate essential boundary DOFs from a parallel assembled system.
150 /** The array @a bdr_attr_is_ess marks boundary attributes that constitute
151 the essential part of the boundary. */
152 void ParallelEliminateEssentialBC(const Array<int> &bdr_attr_is_ess,
154 const HypreParVector &X,
155 HypreParVector &B) const;
156
157 /// Eliminate essential boundary DOFs from the parallel system matrix.
158 /** The array @a bdr_attr_is_ess marks boundary attributes that constitute
159 the essential part of the boundary. */
160 void ParallelEliminateEssentialBC(const Array<int> &bdr_attr_is_ess,
161 const HypreParVector &X,
162 HypreParVector &B);
163
164 /// Eliminate essential boundary DOFs from a parallel assembled matrix @a A.
165 /** The array @a bdr_attr_is_ess marks boundary attributes that constitute
166 the essential part of the boundary. The eliminated part is stored in a
167 matrix A_elim such that A_original = A_new + A_elim. Returns a pointer to
168 the newly allocated matrix A_elim which should be deleted by the caller.
169 The matrices @a A and A_elim can be used to eliminate boundary conditions
170 in multiple right-hand sides, by calling the function EliminateBC() (from
171 hypre.hpp). */
173 HypreParMatrix &A) const;
174
175 /// Eliminate essential boundary DOFs from the parallel system matrix.
176 /** The array @a bdr_attr_is_ess marks boundary attributes that constitute
177 the essential part of the boundary. This method relies on
178 ParallelEliminateTDofs(const Array<int> &), see it for details. */
179 void ParallelEliminateEssentialBC(const Array<int> &bdr_attr_is_ess);
180
181 /// Eliminate essential true DOFs from a parallel assembled matrix @a A.
182 /** Given a list of essential true dofs and the parallel assembled matrix
183 @a A, eliminate the true dofs from the matrix, storing the eliminated
184 part in a matrix A_elim such that A_original = A_new + A_elim. Returns a
185 pointer to the newly allocated matrix A_elim which should be deleted by
186 the caller. The matrices @a A and A_elim can be used to eliminate
187 boundary conditions in multiple right-hand sides, by calling the function
188 EliminateBC() (from hypre.hpp). */
190 HypreParMatrix &A) const
191 { return A.EliminateRowsCols(tdofs_list); }
192
193 /// Eliminate essential true DOFs from the parallel system matrix.
194 /** Given a list of essential true dofs, eliminate the true dofs from
195 the parallel assembled system matrix, storing the eliminated part
196 internally. This method works in conjunction with
197 ParallelEliminateTDofsInRHS() and allows elimination of boundary
198 conditions in multiple right-hand sides. */
199 void ParallelEliminateTDofs(const Array<int> &tdofs_list);
200
201 /** @brief Use the stored eliminated part of the parallel system matrix for
202 elimination of boundary conditions in the r.h.s. */
203 /** Given a list of essential true dofs, eliminate the true dofs from the
204 right-hand side @a b using the solution vector @a x and the previously
205 stored eliminated part of the parallel assembled system matrix produced
206 by ParallelEliminateTDofs(const Array<int> &). */
207 void ParallelEliminateTDofsInRHS(const Array<int> &tdofs, const Vector &x,
208 Vector &b);
209
210 /// @deprecated Use ParallelEliminateTDofsInRHS() instead.
211 MFEM_DEPRECATED void EliminateVDofsInRHS(const Array<int> &vdofs,
212 const Vector &x, Vector &b)
214
215 /** @brief Compute @a y += @a a (P^t A P) @a x, where @a x and @a y are
216 vectors on the true dofs. */
217 void TrueAddMult(const Vector &x, Vector &y, const real_t a = 1.0) const;
218
219 /// Compute $ y^T M x $
220 /** @warning The calculation is performed on local dofs, assuming that
221 the local vectors are consistent with the prolongations of the true
222 vectors (see ParGridFunction::Distribute()). If this is not the case,
223 use TrueInnerProduct(const ParGridFunction &, const ParGridFunction &)
224 instead.
225 @note It is assumed that the local matrix is assembled and it has
226 not been replaced by the parallel matrix through FormSystemMatrix().
227 @see TrueInnerProduct(const ParGridFunction&, const ParGridFunction&) */
229 const ParGridFunction &y) const;
230
231 /// Compute $ y^T M x $ on true dofs (grid function version)
232 /** @note The ParGridFunction%s are restricted to the true-vectors for
233 for calculation.
234 @note It is assumed that the parallel system matrix is assembled,
235 see FormSystemMatrix().
236 @see ParInnerProduct(const ParGridFunction&, const ParGridFunction&) */
238 const ParGridFunction &y) const;
239
240 /// Compute $ y^T M x $ on true dofs (Hypre vector version)
241 /** @note It is assumed that the parallel system matrix is assembled,
242 see FormSystemMatrix(). */
244
245 /// Compute $ y^T M x $ on true dofs (true-vector version)
246 /** @note It is assumed that the parallel system matrix is assembled,
247 see FormSystemMatrix(). */
248 real_t TrueInnerProduct(const Vector &x, const Vector &y) const;
249
250 /// Return the parallel FE space associated with the ParBilinearForm.
252
253 /// Return the parallel trace FE space associated with static condensation.
255 { return static_cond ? static_cond->GetParTraceFESpace() : NULL; }
256
257 /// Get the parallel finite element space prolongation matrix
258 const Operator *GetProlongation() const override
259 { return pfes->GetProlongationMatrix(); }
260 /// Get the transpose of GetRestriction, useful for matrix-free RAP
261 virtual const Operator *GetRestrictionTranspose() const
263 /// Get the parallel finite element space restriction matrix
264 const Operator *GetRestriction() const override
265 { return pfes->GetRestrictionMatrix(); }
266
269
270 void FormLinearSystem(const Array<int> &ess_tdof_list, Vector &x,
271 Vector &b, OperatorHandle &A, Vector &X,
272 Vector &B, int copy_interior = 0) override;
273
274 void FormSystemMatrix(const Array<int> &ess_tdof_list,
275 OperatorHandle &A) override;
276
277 /** Call this method after solving a linear system constructed using the
278 FormLinearSystem method to recover the solution as a ParGridFunction-size
279 vector in x. Use the same arguments as in the FormLinearSystem call. */
280 void RecoverFEMSolution(const Vector &X, const Vector &b, Vector &x) override;
281
282 void Update(FiniteElementSpace *nfes = NULL) override;
283
284 virtual ~ParBilinearForm() { }
285};
286
287/// Class for parallel bilinear form using different test and trial FE spaces.
289{
290protected:
291 /// Points to the same object as #trial_fes
293 /// Points to the same object as #test_fes
295 /// Auxiliary objects used in TrueAddMult().
297
298 /// Matrix and eliminated matrix
300
302
303 // Allocate mat - called when (mat == NULL && fbfi.Size() > 0)
304 void pAllocMat();
305
306 void AssembleSharedFaces(int skip_zeros = 1);
307
308private:
309 /// Copy construction is not supported; body is undefined.
311
312 /// Copy assignment is not supported; body is undefined.
313 ParMixedBilinearForm &operator=(const ParMixedBilinearForm &);
314
315public:
316 /** @brief Construct a ParMixedBilinearForm on the given FiniteElementSpace%s
317 @a trial_fes and @a test_fes. */
318 /** The pointers @a trial_fes and @a test_fes are not owned by the newly
319 constructed object. */
329
330 /** @brief Create a ParMixedBilinearForm on the given FiniteElementSpace%s
331 @a trial_fes and @a test_fes, using the same integrators as the
332 ParMixedBilinearForm @a mbf.
333
334 The pointers @a trial_fes and @a test_fes are not owned by the newly
335 constructed object.
336
337 The integrators in @a mbf are copied as pointers and they are not owned
338 by the newly constructed ParMixedBilinearForm. */
349
350 /** When set to true and the ParMixedBilinearForm has interior face
351 integrators, the local SparseMatrix will include the rows (in addition
352 to the columns) corresponding to face-neighbor dofs. The default
353 behavior is to disregard those rows. Must be called before the first
354 Assemble() call. */
355 void KeepNbrBlock(bool knb = true) { keep_nbr_block = knb; }
356
357 /// Assemble the local matrix
358 void Assemble(int skip_zeros = 1);
359
360 /// Returns the matrix assembled on the true dofs, i.e. P_test^t A P_trial.
361 /** The returned matrix is the internal one, owned by the form. It is not
362 reassembled if it has been already constructed. If
363 FormRectangularSystemMatrix() has been called before, it is the system
364 matrix with eliminated essential DOFs, otherwise the parallel matrix is
365 assembled here without the elimination process. */
367
368 /// Returns the matrix assembled on the true dofs, i.e. P_test^t A P_trial.
369 /** The returned matrix has to be deleted by the caller. */
371
372 /** @brief Returns the eliminated matrix assembled on the true dofs, i.e.
373 P_test^t A_local P_trial. */
374 /** The returned matrix has to be deleted by the caller. */
376
377 /** @brief Return the matrix @a m assembled on the true dofs, i.e. P_test^t
378 A_local P_trial. */
379 /** The returned matrix has to be deleted by the caller. */
381
382 /** @brief Returns the matrix assembled on the true dofs, i.e.
383 @a A = P_test^t A_local P_trial, in the format (type id) specified by
384 @a A. */
386
387 /** Returns the eliminated matrix assembled on the true dofs, i.e.
388 @a A_elim = P^t A_elim_local P in the format (type id) specified by @a A.
389 */
392
393 /** Returns the matrix @a A_local assembled on the true dofs, i.e.
394 @a A = P_test^t A_local P_trial in the format (type id) specified by
395 @a A. */
397
398 /// Eliminate essential boundary trial DOFs from the parallel system matrix.
399 /** The array @a bdr_attr_is_ess marks boundary attributes that constitute
400 the essential part of the boundary. This method relies on
401 ParallelEliminateTrialTDofs(const Array<int> &), see it for details. */
402 void ParallelEliminateTrialEssentialBC(const Array<int> &bdr_attr_is_ess);
403
404 /// Eliminate essential trial true DOFs from the parallel system matrix.
405 /** Given a list of essential trial true dofs, eliminate the trial true dofs
406 from the parallel assembled system matrix, storing the eliminated part
407 internally. This method works in conjunction with
408 ParallelEliminateTrialTDofsInRHS() and allows elimination of boundary
409 conditions in multiple right-hand sides. */
410 void ParallelEliminateTrialTDofs(const Array<int> &trial_tdof_list);
411
412 /** @brief Use the stored eliminated part of the parallel system matrix for
413 elimination of boundary conditions in the r.h.s. */
414 /** Given a list of essential trial true dofs, eliminate the trial true dofs
415 from the right-hand side @a B using the solution vector @a X and the
416 previously stored eliminated part of the parallel assembled system
417 matrix produced by ParallelEliminateTrialTDofs(const Array<int> &). */
418 void ParallelEliminateTrialTDofsInRHS(const Array<int> &trial_tdof_list,
419 const Vector &X, Vector &B);
420
421 /// Eliminate essential boundary test DOFs from the parallel system matrix.
422 /** The array @a bdr_attr_is_ess marks boundary attributes that constitute
423 the essential part of the boundary. */
424 void ParallelEliminateTestEssentialBC(const Array<int> &bdr_attr_is_ess);
425
426 /// Eliminate essential test true DOFs from the parallel system matrix.
427 /** Given a list of essential test true dofs, eliminate the test true dofs
428 from the parallel assembled system matrix. */
429 void ParallelEliminateTestTDofs(const Array<int> &test_tdof_list);
430
433
434 /** @brief Return in @a A a parallel (on truedofs) version of this operator.
435
436 This returns the same operator as FormRectangularLinearSystem(), but does
437 without the transformations of the right-hand side. */
438 void FormRectangularSystemMatrix(const Array<int> &trial_tdof_list,
439 const Array<int> &test_tdof_list,
440 OperatorHandle &A) override;
441
442 /** @brief Form the parallel linear system A X = B, corresponding to this mixed
443 bilinear form and the linear form @a b(.).
444
445 Return in @a A a *reference* to the system matrix that is column-constrained.
446 The reference will be invalidated when SetOperatorType(), Update(), or the
447 destructor is called. */
448 void FormRectangularLinearSystem(const Array<int> &trial_tdof_list,
449 const Array<int> &test_tdof_list, Vector &x,
450 Vector &b, OperatorHandle &A, Vector &X,
451 Vector &B) override;
452
453 /// Compute y += a (P^t A P) x, where x and y are vectors on the true dofs
454 void TrueAddMult(const Vector &x, Vector &y, const real_t a = 1.0) const;
455
457};
458
459/** The parallel matrix representation a linear operator between parallel finite
460 element spaces */
462{
463protected:
464 /// Points to the same object as #trial_fes
466 /// Points to the same object as #test_fes
468
469private:
470 /// Copy construction is not supported; body is undefined.
472
473 /// Copy assignment is not supported; body is undefined.
475
476public:
477 /** @brief Construct a ParDiscreteLinearOperator on the given
478 FiniteElementSpace%s @a dfes (domain FE space) and @a rfes (range FE
479 space). */
480 /** The pointers @a dfes and @a rfes are not owned by the newly constructed
481 object. */
485
486 /// Returns the matrix "assembled" on the true dofs
488
489 /** @brief Returns the matrix assembled on the true dofs, i.e.
490 @a A = R_test A_local P_trial, in the format (type id) specified by
491 @a A. */
493
494 /** Extract the parallel blocks corresponding to the vector dimensions of the
495 domain and range parallel finite element spaces */
496 void GetParBlocks(Array2D<HypreParMatrix *> &blocks) const;
497
499
500 /** @brief Return in @a A a parallel (on truedofs) version of this operator. */
502
504};
505
506}
507
508#endif // MFEM_USE_MPI
509
510#endif
Dynamic 2D array using row-major layout.
Definition array.hpp:430
A "square matrix" operator for the associated FE space and BLFIntegrators The sum of all the BLFInteg...
SparseMatrix * mat
Sparse matrix to be associated with the form. Owned.
std::unique_ptr< StaticCondensation > static_cond
virtual void FormLinearSystem(const Array< int > &ess_tdof_list, Vector &x, Vector &b, OperatorHandle &A, Vector &X, Vector &B, int copy_interior=0)
Form the linear system A X = B, corresponding to this bilinear form and the linear form b(....
std::unique_ptr< Hybridization > hybridization
virtual void FormSystemMatrix(const Array< int > &ess_tdof_list, OperatorHandle &A)
Form the linear system matrix A, see FormLinearSystem() for details.
SparseMatrix * mat_e
Sparse Matrix used to store the eliminations from the b.c. Owned. .
Data and methods for fully-assembled bilinear forms.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition fespace.hpp:208
const Operator * GetRestrictionTransposeOperator() const
Return an operator that performs the transpose of GetRestrictionOperator.
Definition fespace.cpp:1448
Wrapper for hypre's ParCSR matrix class.
Definition hypre.hpp:419
void EliminateRowsCols(const Array< int > &rows_cols, const HypreParVector &X, HypreParVector &B)
Definition hypre.cpp:2399
Wrapper for hypre's parallel vector class.
Definition hypre.hpp:230
virtual void FormRectangularSystemMatrix(const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, OperatorHandle &A)
Return in A that is column-constrained.
SparseMatrix * mat
Owned.
virtual void FormRectangularLinearSystem(const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, Vector &x, Vector &b, OperatorHandle &A, Vector &X, Vector &B)
Form the linear system A X = B, corresponding to this mixed bilinear form and the linear form b(....
SparseMatrix * mat_e
Owned.
FiniteElementSpace * trial_fes
Not owned.
FiniteElementSpace * test_fes
Not owned.
Pointer to an Operator of a specified type.
Definition handle.hpp:34
void SetType(Operator::Type tid)
Invoke Clear() and set a new type id.
Definition handle.hpp:132
Abstract operator.
Definition operator.hpp:25
Type
Enumeration defining IDs for some classes derived from Operator.
Definition operator.hpp:296
@ Hypre_ParCSR
ID for class HypreParMatrix.
Definition operator.hpp:299
Class for parallel bilinear form.
void SetOperatorType(Operator::Type tid)
Set the operator type id for the parallel matrix/operator when using AssemblyLevel::LEGACY.
Vector Xaux
Auxiliary vectors used in TrueAddMult(): L-, L-, and T-vector, resp.
const Operator * GetProlongation() const override
Get the parallel finite element space prolongation matrix.
ParBilinearForm(ParFiniteElementSpace *pf)
Creates parallel bilinear form associated with the FE space *pf.
ParFiniteElementSpace * pfes
Points to the same object as fes.
void ParallelRAP(SparseMatrix &loc_A, OperatorHandle &A, bool steal_loc_A=false)
Compute parallel RAP operator and store it in A as a HypreParMatrix.
HypreParMatrix * ParallelAssembleInternalMatrix()
Returns the matrix assembled on the true dofs, i.e. P^t A P.
void RecoverFEMSolution(const Vector &X, const Vector &b, Vector &x) override
HypreParMatrix * ParallelAssemble()
Returns the matrix assembled on the true dofs, i.e. P^t A P.
HypreParMatrix * ParallelAssembleElim()
Returns the eliminated matrix assembled on the true dofs, i.e. P^t A_e P.
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.
real_t ParInnerProduct(const ParGridFunction &x, const ParGridFunction &y) const
Compute .
void Assemble(int skip_zeros=1)
Assemble the local matrix.
void FormSystemMatrix(const Array< int > &ess_tdof_list, OperatorHandle &A) override
Form the linear system matrix A, see FormLinearSystem() for details.
void AssembleSharedFaces(int skip_zeros=1)
ParFiniteElementSpace * SCParFESpace() const
Return the parallel trace FE space associated with static condensation.
const Operator * GetRestriction() const override
Get the parallel finite element space restriction matrix.
void ParallelEliminateTDofsInRHS(const Array< int > &tdofs, const Vector &x, Vector &b)
Use the stored eliminated part of the parallel system matrix for elimination of boundary conditions i...
void ParallelAssemble(OperatorHandle &A)
Returns the matrix assembled on the true dofs, i.e. A = P^t A_local P, in the format (type id) specif...
void Update(FiniteElementSpace *nfes=NULL) override
Update the FiniteElementSpace and delete all data associated with the old one.
MFEM_DEPRECATED void EliminateVDofsInRHS(const Array< int > &vdofs, const Vector &x, Vector &b)
HypreParMatrix * ParallelEliminateTDofs(const Array< int > &tdofs_list, HypreParMatrix &A) const
Eliminate essential true DOFs from a parallel assembled matrix A.
ParFiniteElementSpace * ParFESpace() const
Return the parallel FE space associated with the ParBilinearForm.
ParBilinearForm(ParFiniteElementSpace *pf, ParBilinearForm *bf)
Create a ParBilinearForm on the ParFiniteElementSpace *pf, using the same integrators as the ParBilin...
void KeepNbrBlock(bool knb=true)
void AssembleDiagonal(Vector &diag) const override
Assemble the diagonal of the bilinear form into diag. Note that diag is a true-dof Vector.
virtual const Operator * GetRestrictionTranspose() const
Get the transpose of GetRestriction, useful for matrix-free RAP.
void ParallelAssembleElim(OperatorHandle &A_elim)
void FormLinearSystem(const Array< int > &ess_tdof_list, Vector &x, Vector &b, OperatorHandle &A, Vector &X, Vector &B, int copy_interior=0) override
Form the linear system A X = B, corresponding to this bilinear form and the linear form b(....
real_t TrueInnerProduct(const ParGridFunction &x, const ParGridFunction &y) const
Compute on true dofs (grid function version)
void TrueAddMult(const Vector &x, Vector &y, const real_t a=1.0) const
Compute y += a (P^t A P) x, where x and y are vectors on the true dofs.
void GetParBlocks(Array2D< HypreParMatrix * > &blocks) const
ParFiniteElementSpace * range_fes
Points to the same object as test_fes.
HypreParMatrix * ParallelAssemble() const
Returns the matrix "assembled" on the true dofs.
ParFiniteElementSpace * domain_fes
Points to the same object as trial_fes.
ParDiscreteLinearOperator(ParFiniteElementSpace *dfes, ParFiniteElementSpace *rfes)
Construct a ParDiscreteLinearOperator on the given FiniteElementSpaces dfes (domain FE space) and rfe...
virtual void FormRectangularSystemMatrix(OperatorHandle &A)
Return in A a parallel (on truedofs) version of this operator.
Abstract parallel finite element space.
Definition pfespace.hpp:31
const Operator * GetProlongationMatrix() const override
const SparseMatrix * GetRestrictionMatrix() const override
Get the R matrix which restricts a local dof vector to true dof vector.
Definition pfespace.hpp:470
Class for parallel grid function.
Definition pgridfunc.hpp:50
Class for parallel bilinear form using different test and trial FE spaces.
void Assemble(int skip_zeros=1)
Assemble the local matrix.
ParGridFunction Xaux
Auxiliary objects used in TrueAddMult().
void FormRectangularSystemMatrix(const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, OperatorHandle &A) override
Return in A a parallel (on truedofs) version of this operator.
void ParallelEliminateTrialTDofsInRHS(const Array< int > &trial_tdof_list, const Vector &X, Vector &B)
Use the stored eliminated part of the parallel system matrix for elimination of boundary conditions i...
void ParallelEliminateTrialEssentialBC(const Array< int > &bdr_attr_is_ess)
Eliminate essential boundary trial DOFs from the parallel system matrix.
OperatorHandle p_mat
Matrix and eliminated matrix.
void TrueAddMult(const Vector &x, Vector &y, const real_t a=1.0) const
Compute y += a (P^t A P) x, where x and y are vectors on the true dofs.
void ParallelAssembleElim(OperatorHandle &A_elim)
void AssembleSharedFaces(int skip_zeros=1)
HypreParMatrix * ParallelAssembleElim()
Returns the eliminated matrix assembled on the true dofs, i.e. P_test^t A_local P_trial.
HypreParMatrix * ParallelAssemble()
Returns the matrix assembled on the true dofs, i.e. P_test^t A P_trial.
ParFiniteElementSpace * test_pfes
Points to the same object as test_fes.
ParFiniteElementSpace * trial_pfes
Points to the same object as trial_fes.
void ParallelEliminateTestEssentialBC(const Array< int > &bdr_attr_is_ess)
Eliminate essential boundary test DOFs from the parallel system matrix.
void KeepNbrBlock(bool knb=true)
void FormRectangularLinearSystem(const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, Vector &x, Vector &b, OperatorHandle &A, Vector &X, Vector &B) override
Form the parallel linear system A X = B, corresponding to this mixed bilinear form and the linear for...
ParMixedBilinearForm(ParFiniteElementSpace *trial_fes, ParFiniteElementSpace *test_fes, ParMixedBilinearForm *mbf)
Create a ParMixedBilinearForm on the given FiniteElementSpaces trial_fes and test_fes,...
void ParallelEliminateTestTDofs(const Array< int > &test_tdof_list)
Eliminate essential test true DOFs from the parallel system matrix.
void ParallelEliminateTrialTDofs(const Array< int > &trial_tdof_list)
Eliminate essential trial true DOFs from the parallel system matrix.
HypreParMatrix * ParallelAssembleInternalMatrix()
Returns the matrix assembled on the true dofs, i.e. P_test^t A P_trial.
ParMixedBilinearForm(ParFiniteElementSpace *trial_fes, ParFiniteElementSpace *test_fes)
Construct a ParMixedBilinearForm on the given FiniteElementSpaces trial_fes and test_fes.
void ParallelAssemble(OperatorHandle &A)
Returns the matrix assembled on the true dofs, i.e. A = P_test^t A_local P_trial, in the format (type...
Data type sparse matrix.
Definition sparsemat.hpp:51
Vector data type.
Definition vector.hpp:82
real_t b
Definition lissajous.cpp:42
real_t a
Definition lissajous.cpp:41
float real_t
Definition config.hpp:46