45 const int NE = fes->
GetNE();
47 for (
int i = 0; i < NE; i++)
53 for (
int i = 0; i < NE; i++)
56 const int nsd = vdofs.
Size()/vdim;
58 const int *dofs = vdofs.
GetData();
59 for (
int vd = 0; vd < vdim; vd++)
62 for (
int j = 0; j < nspd; j++)
64 MFEM_ASSERT(dofs[nsd-nspd+j] >= 0,
"");
75 "incompatible volume and trace FE spaces");
79 for (
int i = 0; i < NE; i++)
83 const int nsd = vdofs.
Size()/vdim;
84 const int nsrd = rvdofs.
Size()/vdim;
85 for (
int vd = 0; vd < vdim; vd++)
87 for (
int j = 0; j < nsrd; j++)
89 int rvdof = rvdofs[j+nsrd*vd];
90 int vdof = vdofs[j+nsd*vd];
96 MFEM_ASSERT(vdof >= 0,
"incompatible volume and trace FE spaces");
97 rdof_edof[rvdof] = vdof;
134 const int NE = fes->
GetNE();
138 A_offsets[0] = A_ipiv_offsets[0] = 0;
140 for (
int i = 0; i < NE; i++)
143 const int ned = rvdofs.
Size();
144 const int npd = elem_pdof.
RowSize(i);
145 A_offsets[i+1] = A_offsets[i] + npd*(npd + (symm ? 1 : 2)*ned);
146 A_ipiv_offsets[i+1] = A_ipiv_offsets[i] + npd;
150 const int nedofs = tr_fes->
GetVSize();
156 Table elem_rdof, rdof_elem;
158 for (
int i = 0; i < NE; i++)
164 for (
int i = 0; i < NE; i++)
175 nedofs, nedofs,
true,
false,
false);
191 const int vdim = fes->
GetVDim();
192 const int nvpd = elem_pdof.
RowSize(el);
193 const int nved = rvdofs.
Size();
194 DenseMatrix A_pp(A_data + A_offsets[el], nvpd, nvpd);
197 if (symm) { A_ep.
SetSize(nved, nvpd); }
198 else { A_ep.UseExternalData(A_pe.Data() + nvpd*nved, nved, nvpd); }
201 const int npd = nvpd/vdim;
202 const int ned = nved/vdim;
203 const int nd = npd + ned;
205 for (
int i = 0; i < vdim; i++)
207 for (
int j = 0; j < vdim; j++)
209 A_pp.
CopyMN(elmat, npd, npd, i*nd+ned, j*nd+ned, i*npd, j*npd);
210 A_pe.CopyMN(elmat, npd, ned, i*nd+ned, j*nd, i*npd, j*ned);
211 A_ep.CopyMN(elmat, ned, npd, i*nd, j*nd+ned, i*ned, j*npd);
212 A_ee.
CopyMN(elmat, ned, ned, i*nd, j*nd, i*ned, j*ned);
218 lu.BlockFactor(nvpd, nved, A_pe.Data(), A_ep.Data(), A_ee.
Data());
221 const int skip_zeros = 0;
229 const int skip_zeros = 0;
235 const int skip_zeros = 0;
239 if (S_e) { S_e->
Finalize(skip_zeros); }
262 if (S_e) { S_e->
Finalize(skip_zeros); }
289 if (!Parallel() || S)
295 for (
int i = 0; i < ess_rtdof_list_.
Size(); i++)
303 MFEM_ASSERT(pS_e.
Ptr() == 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(const_cast<double*>((
const double*)A_data) + A_offsets[i],
351 const_cast<int*>((
const int*)A_ipiv) + A_ipiv_offsets[i]);
363 L_ep.
Mult(b_p, b_ep);
365 for (
int j = 0; j < ned; j++)
367 if (rd[j] >= 0) { b_r(rd[j]) -= b_ep(j); }
368 else { b_r(-1-rd[j]) += b_ep(j); }
391 MFEM_ASSERT(sol.
Size() == fes->
GetVSize(),
"'sol' has incorrect size");
393 const int nedofs = tr_fes->
GetVSize();
405 for (
int i = 0; i < nedofs; i++)
407 sol_r(i) = sol(rdof_edof[i]);
412 tr_R->
Mult(sol_r, sc_sol);
417 Vector &B,
int copy_interior)
const
429 MFEM_ASSERT(pS.
Type() == pS_e.
Type(),
"type id mismatch");
442 const int nedofs = tr_fes->
GetVSize();
447 ess_dof_marker.
MakeRef(ess_tdof_marker);
458 ess_rtdof_marker.
SetSize(nedofs);
459 ess_rdof_marker.
MakeRef(ess_rtdof_marker);
463 ess_rdof_marker.
SetSize(nedofs);
465 for (
int i = 0; i < nedofs; i++)
467 ess_rdof_marker[i] = ess_dof_marker[rdof_edof[i]];
472 tr_R->
BooleanMult(ess_rdof_marker, ess_rtdof_marker);
482 MFEM_ASSERT(b.
Size() == fes->
GetVSize(),
"'b' has incorrect size");
484 const int nedofs = tr_fes->
GetVSize();
496 tr_cP->
Mult(sc_sol, sol_r);
507 for (
int i = 0; i < nedofs; i++)
509 sol(rdof_edof[i]) = sol_r(i);
511 const int NE = fes->
GetNE();
514 for (
int i = 0; i < NE; i++)
517 const int ned = rvdofs.
Size();
518 const int npd = elem_pdof.
RowSize(i);
519 const int *pd = elem_pdof.
GetRow(i);
522 for (
int j = 0; j < npd; j++)
528 LUFactors lu(const_cast<double*>((
const double*)A_data) + A_offsets[i],
529 const_cast<int*>((
const int*)A_ipiv) + A_ipiv_offsets[i]);
533 for (
int j = 0; j < npd; j++)
Ordering::Type GetOrdering() const
Return the ordering method.
int Size() const
Return the logical size of the array.
int GetVSize() const
Return the number of vector dofs, i.e. GetNDofs() x GetVDim().
virtual FiniteElementCollection * GetTraceCollection() const
const SparseMatrix * GetConformingProlongation() const
The returned SparseMatrix is owned by the FiniteElementSpace.
~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.
virtual void Finalize(int skip_zeros=1)
Finalize the matrix initialization, switching the storage format from LIL to CSR. ...
virtual const Operator * GetProlongationMatrix() const
The returned Operator is owned by the FiniteElementSpace.
void SetSize(int s)
Resize the vector to size s.
void Delete()
Delete the owned pointers and reset the Memory object.
void BooleanMult(const Array< int > &x, Array< int > &y) const
y = A * x, treating all entries 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().
Pointer to an Operator of a specified type.
Operator::Type Type() const
Get the currently set operator type id.
void BlockBackSolve(int m, int n, int r, const double *U12, const double *X2, double *Y1) const
HYPRE_BigInt GlobalTrueVSize() const
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.
void GetSubVector(const Array< int > &dofs, Vector &elemvect) const
Extract entries listed in dofs to the output Vector elemvect.
T * GetData()
Returns the data.
Data type dense matrix using column-major storage.
void AddMult(const Vector &x, Vector &y, const double a=1.0) const
y += A * x (default) or y += a * A * x
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 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...
void EliminateReducedTrueDofs(const Array< int > &ess_rtdof_list, Matrix::DiagonalPolicy dpolicy)
Eliminate the given reduced true dofs from the Schur complement matrix S.
void LoseData()
Call this if data has been stolen.
virtual void Mult(const Vector &x, Vector &y) const =0
Operator application: y=A(x).
Abstract parallel finite element space.
StaticCondensation(FiniteElementSpace *fespace)
Construct a StaticCondensation object.
void ComputeSolution(const Vector &b, const Vector &sc_sol, Vector &sol) const
double * GetData() const
Return a pointer to the beginning of the Vector data.
int Size_of_connections() const
void BooleanMultTranspose(const Array< int > &x, Array< int > &y) const
y = At * x, treating all entries as booleans (zero=false, nonzero=true).
void AddConnections(int r, const int *c, int nc)
virtual void MultTranspose(const Vector &x, Vector &y) const
Action of the transpose operator: y=A^t(x). The default behavior in class Operator is to generate an ...
DofTransformation * GetBdrElementVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom for i'th boundary element.
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.
HYPRE_BigInt GlobalVSize() const
DofTransformation * GetElementVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom in array dofs for i'th element.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
Mesh * GetMesh() const
Returns the mesh.
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...
HypreParMatrix * Dof_TrueDof_Matrix() const
The true dof-to-dof interpolation matrix.
void LSolve(int m, int n, double *X) const
virtual int GetTrueVSize() const
Return the number of vector true (conforming) dofs.
int GetVDim() const
Returns vector dimension.
void RAP(const DenseMatrix &A, const DenseMatrix &P, DenseMatrix &RAP)
HYPRE_BigInt * GetDofOffsets() const
void AddSubMatrix(const Array< int > &rows, const Array< int > &cols, const DenseMatrix &subm, int skip_zeros=1)
Operator * Ptr() const
Access the underlying Operator pointer.
void SetSubVectorComplement(const Array< int > &dofs, const double val)
Set all vector entries NOT in the dofs Array to the given val.
double * Data() const
Returns the matrix data array.
void MakeSquareBlockDiag(MPI_Comm comm, HYPRE_BigInt glob_size, HYPRE_BigInt *row_starts, SparseMatrix *diag)
Reset the OperatorHandle to hold a parallel square block-diagonal matrix using the currently set type...
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
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 the logical size of the array, keep existing entries.
void EliminateRowCol(int rc, const double sol, Vector &rhs, DiagonalPolicy dpolicy=DIAG_ONE)
Eliminate row rc and column rc and modify the rhs using sol.
void Transpose(const Table &A, Table &At, int ncols_A_)
Transpose a Table.
void SetDataAndSize(double *d, int s)
Set the Vector data and size.
void AssembleBdrMatrix(int el, const DenseMatrix &elmat)
void AssembleMatrix(int el, const DenseMatrix &elmat)
DiagonalPolicy
Defines operator diagonal policy upon elimination of rows and/or columns.
virtual bool Factor(int m, double TOL=0.0)
Compute the LU factorization of the current matrix.
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.
ID for class HypreParMatrix.
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)
Change the data array and the size of the DenseMatrix.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
virtual const SparseMatrix * GetRestrictionMatrix() const
The returned SparseMatrix is owned by the FiniteElementSpace.
void Init(bool symmetric, bool block_diagonal)
void ConvertMarkerToReducedTrueDofs(const Array< int > &ess_tdof_marker, Array< int > &ess_rtdof_marker) const
void MakePtAP(OperatorHandle &A, OperatorHandle &P)
Reset the OperatorHandle to hold the product P^t A P.
static void AdjustVDofs(Array< int > &vdofs)
void SetType(Operator::Type tid)
Invoke Clear() and set a new type id.
void PartMult(const Array< int > &rows, const Vector &x, Vector &y) const