12 #include "../config/config.hpp"
17 #include "../general/sort_pairs.hpp"
47 int s1 = lelem_ldof.
Size(), s2 = nelem_ndof.
Size();
48 const int *I1 = lelem_ldof.
GetI(), *J1 = lelem_ldof.
GetJ();
49 const int *I2 = nelem_ndof.
GetI(), *J2 = nelem_ndof.
GetJ();
50 const int nnz1 = I1[s1], nnz2 = I2[s2];
52 elem_dof.
SetDims(s1 + s2, nnz1 + nnz2);
54 int *I = elem_dof.
GetI(), *J = elem_dof.
GetJ();
55 for (
int i = 0; i <= s1; i++)
59 for (
int j = 0; j < nnz1; j++)
63 for (
int i = 0; i <= s2; i++)
65 I[s1+i] = I2[i] + nnz1;
67 for (
int j = 0; j < nnz2; j++)
69 J[nnz1+j] = J2[j] +
height;
106 mfem::Mult(*face_lelem, lelem_ldof, face_ldof);
114 int *I = dof_dof.
GetI();
115 int *J = dof_dof.
GetJ();
116 int nrows = dof_dof.
Size();
117 double *data =
new double[I[nrows]];
127 if (m == NULL) {
return NULL; }
129 MFEM_VERIFY(m->
Finalized(),
"local matrix needs to be finalized for "
133 if (
fbfi.Size() == 0)
148 for (
int i = 0; i < glob_J.Size(); i++)
151 glob_J[i] = J[i] + ldof_offset;
155 glob_J[i] = face_nbr_glob_ldof[J[i] - lvsize];
179 for (
int i = 0; i < nfaces; i++)
184 vdofs1.
Copy(vdofs_all);
185 for (
int j = 0; j < vdofs2.
Size(); j++)
190 for (
int k = 0; k <
fbfi.Size(); k++)
209 if (
mat == NULL &&
fbfi.Size() > 0)
230 pfes->GetEssentialTrueDofs(bdr_attr_is_ess, dof_list);
250 MFEM_VERIFY(
fbfi.Size() == 0,
"the case of interior face integrators is not"
305 ess_rtdof_list,
X, B);
306 if (!copy_interior) { X.SetSubVectorComplement(ess_rtdof_list, 0.0); }
371 MFEM_VERIFY(
pfes != NULL,
"nfes must be a ParFiniteElementSpace!");
382 MFEM_ASSERT(
mat,
"matrix is not assembled");
383 MFEM_ASSERT(
mat->
Finalized(),
"matrix is not finalized");
394 MFEM_VERIFY(
mat->
Finalized(),
"local matrix needs to be finalized for "
401 RLP->GetBlocks(blocks,
429 const double a)
const
int Size() const
Logical size of the array.
void EliminateRowsCols(const Array< int > &rows_cols, const HypreParVector &X, HypreParVector &B)
virtual int NumNonZeroElems() const
Returns the number of the nonzero elements in the matrix.
void ReduceRHS(const Vector &b, Vector &sc_b) const
void MakeRef(const HypreParMatrix &master)
Make this HypreParMatrix a reference to 'master'.
HypreParMatrix * LeftDiagMult(const SparseMatrix &D, HYPRE_Int *row_starts=NULL) const
void SetSize(int s)
Resizes the vector if the new size is different.
HYPRE_Int MultTranspose(HypreParVector &x, HypreParVector &y, double alpha=1.0, double beta=0.0)
Computes y = alpha * A^t * x + beta * y.
void GetElementVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom in array dofs for i'th element.
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
HypreParMatrix & GetParallelMatrix()
Return the parallel hybridized matrix.
int GetNSharedFaces() const
Return the number of shared faces (3D), edges (2D), vertices (1D)
void SetDims(int rows, int nnz)
void Copy(Array ©) const
Create a copy of the current array.
void BuildElementToDofTable()
HYPRE_Int * GetDofOffsets()
Data type dense matrix using column-major storage.
int Size() const
Returns the size of the vector.
void LoseData()
Call this if data has been stolen.
Abstract parallel finite element space.
virtual const SparseMatrix * GetRestrictionMatrix()
Get the R matrix which restricts a local dof vector to true dof vector.
ParFiniteElementSpace * ParFESpace()
void ComputeSolution(const Vector &b, const Vector &sc_sol, Vector &sol) const
const HYPRE_Int * GetFaceNbrGlobalDofMap()
HYPRE_Int Mult(HypreParVector &x, HypreParVector &y, double alpha=1.0, double beta=0.0)
Computes y = alpha * A * x + beta * y.
HYPRE_Int GetMyDofOffset() const
HYPRE_Int * GetTrueDofOffsets()
void EliminateBC(HypreParMatrix &A, HypreParMatrix &Ae, const Array< int > &ess_dof_list, const Vector &X, Vector &B)
void GetFaceNbrElementVDofs(int i, Array< int > &vdofs) const
void SetSize(int m, int n)
const FiniteElement * GetFaceNbrFE(int i) const
void ExchangeFaceNbrData()
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows.
int Append(const T &el)
Append element to array, resize if necessary.
Mesh * GetMesh() const
Returns the mesh.
void ComputeSolution(const Vector &b, const Vector &sol_r, Vector &sol) const
HypreParMatrix * RAP(HypreParMatrix *A, HypreParMatrix *P)
Returns the matrix P^t * A * P.
HypreParMatrix & GetParallelMatrix()
Return the parallel Schur complement matrix.
void Transpose(const Table &A, Table &At, int _ncols_A)
Transpose a Table.
int Size() const
Returns the number of TYPE I elements.
int GetVDim() const
Returns vector dimension.
double * GetData() const
Return element data.
void AddSubMatrix(const Array< int > &rows, const Array< int > &cols, const DenseMatrix &subm, int skip_zeros=1)
int * GetI() const
Return the array I.
void SetSubVectorComplement(const Array< int > &dofs, const double val)
Set all vector entries NOT in the 'dofs' array to the given 'val'.
HypreParMatrix * Dof_TrueDof_Matrix()
The true dof-to-dof interpolation matrix.
int GetOrdering() const
Return the ordering method.
HypreParMatrix * ParallelAssemble() const
Returns the matrix "assembled" on the true dofs.
Wrapper for hypre's parallel vector class.
ParFiniteElementSpace * domain_fes
Abstract finite element space.
virtual void Mult(const Vector &x, Vector &y) const
Matrix vector multiplication.
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list)
void Finalize()
Finalize the construction of the Schur complement matrix.
void Distribute(const Vector *tv)
void EliminateReducedTrueDofs(const Array< int > &ess_rtdof_list, int keep_diagonal)
Eliminate the given reduced true dofs from the Schur complement matrix S.
HypreParMatrix & GetParallelMatrixElim()
Return the eliminated part of the parallel Schur complement matrix.
Table * GetFaceToElementTable() const
Table face_nbr_element_dof
ParFiniteElementSpace * range_fes
bool HasEliminatedBC() const
void MultTranspose(const Vector &x, Vector &y) const
Multiply a vector with the transposed matrix. y = At * x.
const FiniteElement * GetFE(int i) const
Returns pointer to the FiniteElement associated with i'th element.
int GetFaceNbrVSize() const
void GetParBlocks(Array2D< HypreParMatrix * > &blocks) const
void ReduceRHS(const Vector &b, Vector &b_r) const
const Table & GetElementToDofTable() const
void ReduceSolution(const Vector &sol, Vector &sc_sol) const
Table * GetFaceToAllElementTable() const
FaceElementTransformations * GetSharedFaceTransformations(int)
Wrapper for hypre's ParCSR matrix class.
int * GetJ() const
Return the array J.
Class for parallel meshes.
void ConvertListToReducedTrueDofs(const Array< int > &ess_tdof_list, Array< int > &ess_rtdof_list) const