46 const int NE = fes->
GetNE();
48 for (
int i = 0; i < NE; i++)
54 for (
int i = 0; i < NE; i++)
57 const int nsd = vdofs.
Size()/vdim;
59 const int *dofs = vdofs.
GetData();
60 for (
int vd = 0; vd < vdim; vd++)
63 for (
int j = 0; j < nspd; j++)
65 MFEM_ASSERT(dofs[nsd-nspd+j] >= 0,
"");
76 "incompatible volume and trace FE spaces");
80 for (
int i = 0; i < NE; i++)
84 const int nsd = vdofs.
Size()/vdim;
85 const int nsrd = rvdofs.
Size()/vdim;
86 for (
int vd = 0; vd < vdim; vd++)
88 for (
int j = 0; j < nsrd; j++)
90 int rvdof = rvdofs[j+nsrd*vd];
91 int vdof = vdofs[j+nsd*vd];
97 MFEM_ASSERT(vdof >= 0,
"incompatible volume and trace FE spaces");
98 rdof_edof[rvdof] = vdof;
136 const int NE = fes->
GetNE();
140 A_offsets[0] = A_ipiv_offsets[0] = 0;
142 for (
int i = 0; i < NE; i++)
145 const int ned = rvdofs.
Size();
146 const int npd = elem_pdof.
RowSize(i);
147 A_offsets[i+1] = A_offsets[i] + npd*(npd + (symm ? 1 : 2)*ned);
148 A_ipiv_offsets[i+1] = A_ipiv_offsets[i] + npd;
150 A_data =
new double[A_offsets[NE]];
151 A_ipiv =
new int[A_ipiv_offsets[NE]];
152 const int nedofs = tr_fes->
GetVSize();
158 Table elem_rdof, rdof_elem;
160 for (
int i = 0; i < NE; i++)
166 for (
int i = 0; i < NE; i++)
177 nedofs, nedofs,
true,
true,
false);
193 const int vdim = fes->
GetVDim();
194 const int nvpd = elem_pdof.
RowSize(el);
195 const int nved = rvdofs.
Size();
196 DenseMatrix A_pp(A_data + A_offsets[el], nvpd, nvpd);
199 if (symm) { A_ep.
SetSize(nved, nvpd); }
200 else { A_ep.UseExternalData(A_pe.Data() + nvpd*nved, nved, nvpd); }
203 const int npd = nvpd/vdim;
204 const int ned = nved/vdim;
205 const int nd = npd + ned;
207 for (
int i = 0; i < vdim; i++)
209 for (
int j = 0; j < vdim; j++)
211 A_pp.
CopyMN(elmat, npd, npd, i*nd+ned, j*nd+ned, i*npd, j*npd);
212 A_pe.CopyMN(elmat, npd, ned, i*nd+ned, j*nd, i*npd, j*ned);
213 A_ep.CopyMN(elmat, ned, npd, i*nd, j*nd+ned, i*ned, j*npd);
214 A_ee.
CopyMN(elmat, ned, ned, i*nd, j*nd, i*ned, j*ned);
220 lu.BlockFactor(nvpd, nved, A_pe.Data(), A_ep.Data(), A_ee.
Data());
223 const int skip_zeros = 0;
231 const int skip_zeros = 0;
239 const int skip_zeros = 0;
241 if (S_e) { S_e->
Finalize(skip_zeros); }
287 const Array<int> &ess_rtdof_list,
int keep_diagonal)
289 if (!Parallel() || S)
295 for (
int i = 0; i < ess_rtdof_list.
Size(); i++)
303 MFEM_ASSERT(pS_e == NULL,
"essential b.c. already eliminated");
313 MFEM_ASSERT(b.
Size() == fes->
GetVSize(),
"'b' has incorrect size");
315 const int NE = fes->
GetNE();
316 const int nedofs = tr_fes->
GetVSize();
328 for (
int i = 0; i < nedofs; i++)
330 b_r(i) = b(rdof_edof[i]);
336 for (
int i = 0; i < NE; i++)
339 const int ned = rvdofs.
Size();
340 const int *rd = rvdofs.
GetData();
341 const int npd = elem_pdof.
RowSize(i);
342 const int *pd = elem_pdof.
GetRow(i);
345 for (
int j = 0; j < npd; j++)
350 LUFactors lu(A_data + A_offsets[i], A_ipiv + A_ipiv_offsets[i]);
362 L_ep.
Mult(b_p, b_ep);
364 for (
int j = 0; j < ned; j++)
366 if (rd[j] >= 0) { b_r(rd[j]) -= b_ep(j); }
367 else { b_r(-1-rd[j]) += b_ep(j); }
390 MFEM_ASSERT(sol.
Size() == fes->
GetVSize(),
"'sol' has incorrect size");
392 const int nedofs = tr_fes->
GetVSize();
404 for (
int i = 0; i < nedofs; i++)
406 sol_r(i) = sol(rdof_edof[i]);
411 tr_R->
Mult(sol_r, sc_sol);
418 const int nedofs = tr_fes->
GetVSize();
423 ess_dof_marker.
MakeRef(ess_tdof_marker);
434 ess_rtdof_marker.
SetSize(nedofs);
435 ess_rdof_marker.
MakeRef(ess_rtdof_marker);
439 ess_rdof_marker.
SetSize(nedofs);
441 for (
int i = 0; i < nedofs; i++)
443 ess_rdof_marker[i] = ess_dof_marker[rdof_edof[i]];
448 tr_R->
BooleanMult(ess_rdof_marker, ess_rtdof_marker);
458 MFEM_ASSERT(b.
Size() == fes->
GetVSize(),
"'b' has incorrect size");
460 const int nedofs = tr_fes->
GetVSize();
472 tr_cP->
Mult(sc_sol, sol_r);
483 for (
int i = 0; i < nedofs; i++)
485 sol(rdof_edof[i]) = sol_r(i);
487 const int NE = fes->
GetNE();
490 for (
int i = 0; i < NE; i++)
493 const int ned = rvdofs.
Size();
494 const int npd = elem_pdof.
RowSize(i);
495 const int *pd = elem_pdof.
GetRow(i);
498 for (
int j = 0; j < npd; j++)
504 LUFactors lu(A_data + A_offsets[i], A_ipiv + A_ipiv_offsets[i]);
508 for (
int j = 0; j < npd; j++)
int Size() const
Logical size of the array.
void EliminateRowsCols(const Array< int > &rows_cols, const HypreParVector &X, HypreParVector &B)
virtual FiniteElementCollection * GetTraceCollection() const
~StaticCondensation()
Destroy a StaticCondensation object.
void AddColumnsInRow(int r, int ncol)
bool ReducesTrueVSize() const
void ReduceRHS(const Vector &b, Vector &sc_b) const
void MakeI(int nrows)
Next 7 methods are used together with the default constructor.
HYPRE_Int MultTranspose(HypreParVector &x, HypreParVector &y, double alpha=1.0, double beta=0.0)
Computes y = alpha * A^t * x + beta * y.
void SetSize(int s)
Resizes the vector if the new size is different.
void GetElementVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom in array dofs for i'th element.
void BooleanMult(const Array< int > &x, Array< int > &y) const
y = A * x, but treat all elements as booleans (zero=false, nonzero=true).
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols.
void BlockBackSolve(int m, int n, int r, const double *U12, const double *X2, double *Y1) const
void GetSubVector(const Array< int > &dofs, Vector &elemvect) const
T * GetData()
Returns the data.
HYPRE_Int * GetDofOffsets()
HYPRE_Int GlobalTrueVSize()
void EliminateRowCol(int rc, const double sol, Vector &rhs, int d=0)
Data type dense matrix using column-major storage.
int Size() const
Returns the size of the vector.
void GetRow(int i, Array< int > &row) const
Return row i in array row (the Table must be finalized)
int GetNumElementInteriorDofs(int i) const
void LoseData()
Call this if data has been stolen.
Abstract parallel finite element space.
StaticCondensation(FiniteElementSpace *fespace)
Construct a StaticCondensation object.
void ComputeSolution(const Vector &b, const Vector &sc_sol, Vector &sol) const
HYPRE_Int Mult(HypreParVector &x, HypreParVector &y, double alpha=1.0, double beta=0.0)
Computes y = alpha * A * x + beta * y.
int Size_of_connections() const
void BooleanMultTranspose(const Array< int > &x, Array< int > &y) const
y = At * x, but treat all elements as booleans (zero=false, nonzero=true).
void AddConnections(int r, const int *c, int nc)
int GetNE() const
Returns number of elements in the mesh.
void MultTranspose(const double *x, double *y) const
Multiply a vector with the transpose matrix.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows.
Mesh * GetMesh() const
Returns the mesh.
HypreParMatrix * RAP(HypreParMatrix *A, HypreParMatrix *P)
Returns the matrix P^t * A * P.
void LSolve(int m, int n, double *X) const
void Transpose(const Table &A, Table &At, int _ncols_A)
Transpose a Table.
const SparseMatrix * GetConformingProlongation()
int GetVDim() const
Returns vector dimension.
virtual void Finalize(int skip_zeros=1)
virtual const SparseMatrix * GetRestrictionMatrix()
void AddSubMatrix(const Array< int > &rows, const Array< int > &cols, const DenseMatrix &subm, int skip_zeros=1)
HypreParMatrix * Dof_TrueDof_Matrix()
The true dof-to-dof interpolation matrix.
int GetOrdering() const
Return the ordering method.
double * Data() const
Returns vector of the elements.
Abstract finite element space.
virtual void Mult(const Vector &x, Vector &y) const
Matrix vector multiplication.
void Finalize()
Finalize the construction of the Schur complement matrix.
void SetSize(int nsize)
Change logical size of the array, keep existing entries.
void SetDataAndSize(double *d, int s)
void AssembleBdrMatrix(int el, const DenseMatrix &elmat)
void EliminateReducedTrueDofs(const Array< int > &ess_rtdof_list, int keep_diagonal)
Eliminate the given reduced true dofs from the Schur complement matrix S.
virtual int GetTrueVSize()
Return the number of vector true (conforming) dofs.
void AssembleMatrix(int el, const DenseMatrix &elmat)
void MultTranspose(const Vector &x, Vector &y) const
Multiply a vector with the transposed matrix. y = At * x.
void MakeRef(T *, int)
Make this Array a reference to a pointer.
const FiniteElementCollection * FEColl() const
void Mult(const double *x, double *y) const
Matrix vector multiplication.
void CopyMN(const DenseMatrix &A, int m, int n, int Aro, int Aco)
Copy the m x n submatrix of A at row/col offsets Aro/Aco to *this.
void ReduceSolution(const Vector &sol, Vector &sc_sol) const
void UseExternalData(double *d, int h, int w)
void GetBdrElementVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom for i'th boundary element.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
Wrapper for hypre's ParCSR matrix class.
void Init(bool symmetric, bool block_diagonal)
void ConvertMarkerToReducedTrueDofs(const Array< int > &ess_tdof_marker, Array< int > &ess_rtdof_marker) const
static void AdjustVDofs(Array< int > &vdofs)