12 #include "../config/config.hpp"
17 #include "../general/sort_pairs.hpp"
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];
51 elem_dof.
SetDims(s1 + s2, nnz1 + nnz2);
53 int *I = elem_dof.
GetI(), *J = elem_dof.
GetJ();
54 for (
int i = 0; i <= s1; i++)
58 for (
int j = 0; j < nnz1; j++)
62 for (
int i = 0; i <= s2; i++)
64 I[s1+i] = I2[i] + nnz1;
66 for (
int j = 0; j < nnz2; j++)
68 J[nnz1+j] = J2[j] +
height;
105 mfem::Mult(*face_lelem, lelem_ldof, face_ldof);
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]];
128 if (A_local == NULL) {
return; }
129 MFEM_VERIFY(A_local->
Finalized(),
"the local matrix must be finalized");
133 if (
fbfi.Size() == 0)
147 int *J = A_local->
GetJ();
148 for (
int i = 0; i < glob_J.Size(); i++)
152 glob_J[i] = J[i] + ldof_offset;
156 glob_J[i] = face_nbr_glob_ldof[J[i] - lvsize];
194 for (
int i = 0; i < nfaces; i++)
199 vdofs1.
Copy(vdofs_all);
200 for (
int j = 0; j < vdofs2.
Size(); j++)
205 for (
int k = 0; k <
fbfi.Size(); k++)
224 if (
mat == NULL &&
fbfi.Size() > 0)
245 pfes->GetEssentialTrueDofs(bdr_attr_is_ess, dof_list);
265 MFEM_VERIFY(
fbfi.Size() == 0,
"the case of interior face integrators is not"
342 const int remove_zeros = 0;
345 "The ParBilinearForm must be updated with Update() before "
346 "re-assembling the ParBilinearForm.");
401 MFEM_VERIFY(
pfes != NULL,
"nfes must be a ParFiniteElementSpace!");
445 A.
MakeRAP(P_test, dA, P_trial);
450 const double a)
const
466 MFEM_ASSERT(
mat,
"matrix is not assembled");
467 MFEM_ASSERT(
mat->
Finalized(),
"matrix is not finalized");
478 MFEM_VERIFY(
mat->
Finalized(),
"local matrix needs to be finalized for "
485 RLP->GetBlocks(blocks,
virtual const Operator * GetProlongationMatrix()
Ordering::Type GetOrdering() const
Return the ordering method.
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.
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1)
void ConvertFrom(OperatorHandle &A)
Convert the given OperatorHandle A to the currently set type id.
OpType * As() const
Return the Operator pointer statically cast to a specified OpType. Similar to the method Get()...
HypreParMatrix * RAP(const HypreParMatrix *A, const HypreParMatrix *P)
Returns the matrix P^t * A * P.
HYPRE_Int * GetDofOffsets() const
HypreParMatrix * LeftDiagMult(const SparseMatrix &D, HYPRE_Int *row_starts=NULL) const
void SetSize(int s)
Resize the vector to size s.
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)
Pointer to an Operator of a specified type.
void SetDims(int rows, int nnz)
Operator::Type Type() const
Get the currently set operator type id.
void Copy(Array ©) const
Create a copy of the current array.
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.
Data type dense matrix using column-major storage.
int Size() const
Returns the size of the vector.
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 LoseData()
Call this if data has been stolen.
virtual void Mult(const Vector &x, Vector &y) const =0
Operator application: y=A(x).
virtual void SetSpace(FiniteElementSpace *f)
Associate a new FiniteElementSpace with the ParGridFunction.
Abstract parallel finite element space.
virtual const SparseMatrix * GetRestrictionMatrix()
Get the R matrix which restricts a local dof vector to true dof vector.
void ComputeSolution(const Vector &b, const Vector &sc_sol, Vector &sol) const
const HYPRE_Int * GetFaceNbrGlobalDofMap()
HYPRE_Int GetMyDofOffset() const
void DeleteAll()
Delete whole array.
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 ...
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
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...
FaceElementTransformations * GetSharedFaceTransformations(int sf, bool fill2=true)
HypreParMatrix * Dof_TrueDof_Matrix() const
The true dof-to-dof interpolation matrix.
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, i.e. array A.
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.
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'.
HYPRE_Int GlobalVSize() const
HypreParMatrix * ParallelAssemble() const
Returns the matrix "assembled" on the true dofs.
Wrapper for hypre's parallel vector class.
ParFiniteElementSpace * domain_fes
virtual void Mult(const Vector &x, Vector &y) const
Matrix vector multiplication.
void Finalize()
Finalize the construction of the Schur complement matrix.
void Clear()
Clear the OperatorHandle, deleting the held Operator (if owned), while leaving the type id unchanged...
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.
int height
Dimension of the output / number of rows in the matrix.
Table * GetFaceToElementTable() const
void SetOperatorOwner(bool own=true)
Set the ownership flag for the held Operator.
Table face_nbr_element_dof
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...
ParFiniteElementSpace * range_fes
bool HasEliminatedBC() const
Return true if essential boundary conditions have been eliminated from the Schur complement matrix...
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.
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...
int GetFaceNbrVSize() const
HYPRE_Int * GetTrueDofOffsets() const
void GetParBlocks(Array2D< HypreParMatrix * > &blocks) const
void ReduceRHS(const Vector &b, Vector &b_r) const
const Table & GetElementToDofTable() const
void SetEssentialTrueDofs(const Array< int > &ess_tdof_list)
Determine and save internally essential reduced true dofs.
Table * GetFaceToAllElementTable() const
Wrapper for hypre's ParCSR matrix class.
int * GetJ() const
Return the array J.
Class for parallel meshes.
void MakePtAP(OperatorHandle &A, OperatorHandle &P)
Reset the OperatorHandle to hold the product P^t A P.
int width
Dimension of the input / number of columns in the matrix.
void MakeRAP(OperatorHandle &Rt, OperatorHandle &A, OperatorHandle &P)
Reset the OperatorHandle to hold the product R A P, where R = Rt^t.
ParFiniteElementSpace * ParFESpace() const