38 for (
int j = 0; j <
lfis.Size(); j++)
109 "DPGWeakFrom::AddTrialIntegrator: trial fespace index out of bounds");
111 "DPGWeakFrom::AddTrialIntegrator: test fecol index out of bounds");
119 MFEM_VERIFY(n>=0 && n<test_fecols.Size() && m>=0 && m<test_fecols.Size(),
120 "DPGWeakFrom::AdTestIntegrator: test fecol index out of bounds");
121 test_integs(n,m)->Append(bfi);
129 "DPGWeakFrom::AddDomainLFIntegrator: test fecol index out of bounds");
130 lfis[n]->Append(lfi);
139 for (
int i = 0; i<
nblocks; i++)
145 P->
SetBlock(i,i,const_cast<SparseMatrix*>(P_));
146 R->
SetBlock(i,i,const_cast<SparseMatrix*>(R_));
159 for (
int i = 0; i<
nblocks; i++)
161 for (
int j = 0; j<
nblocks; j++)
179 for (
int i = 0; i<
nblocks; i++)
181 for (
int j = 0; j<
nblocks; j++)
202 for (
int i = 0; i<
nblocks; i++)
204 for (
int j = 0; j<
nblocks; j++)
223 for (
int i = 0; i<
nblocks; i++)
225 for (
int j = 0; j<
nblocks; j++)
265 for (
int iel = 0; iel <
mesh -> GetNE(); iel++)
281 MFEM_ABORT(
"DPGWeakForm::Assemble: dim > 3 not supported");
283 int numfaces = faces.
Size();
300 for (
int ie = 0; ie<faces.
Size(); ie++)
303 faces[ie])->GetDof();
328 for (
int k = 0; k <
lfis[j]->Size(); k++)
330 (*
lfis[j])[k]->AssembleRHSElementVect(test_fe,*eltrans,vec_e);
345 (*
test_integs(i,j))[k]->AssembleElementMatrix(test_fe,*eltrans,Ge);
349 (*
test_integs(i,j))[k]->AssembleElementMatrix2(test_fe_i,test_fe,*eltrans,
362 int face_dof_offs = 0;
363 for (
int ie = 0; ie < numfaces; ie++)
365 int iface = faces[ie];
368 (*
trial_integs(i,j))[k]->AssembleTraceFaceMatrix(iel,tfe,test_fe,*ftr,Be);
369 B.
AddSubMatrix(test_offs[j], trial_offs[i]+face_dof_offs, Be);
370 face_dof_offs+=Be.
Width();
380 (*
trial_integs(i,j))[k]->AssembleElementMatrix2(fe,test_fe,*eltrans,Be);
415 doftrans_i =
nullptr;
419 for (
int k = 0; k < numfaces; k++)
421 int iface = faces[k];
422 trial_fes[i]->GetFaceVDofs(iface, face_vdofs);
423 vdofs_i.
Append(face_vdofs);
428 doftrans_i =
trial_fes[i]->GetElementVDofs(iel, vdofs_i);
433 doftrans_j =
nullptr;
438 for (
int k = 0; k < numfaces; k++)
440 int iface = faces[k];
441 trial_fes[j]->GetFaceVDofs(iface, face_vdofs);
442 vdofs_j.
Append(face_vdofs);
447 doftrans_j =
trial_fes[j]->GetElementVDofs(iel, vdofs_j);
452 trial_offs[j],trial_offs[j+1], Ae);
453 if (doftrans_i || doftrans_j)
461 double * data =
b.GetData();
465 trial_offs[i+1]-trial_offs[i]);
480 Vector &B,
int copy_interior)
502 for (
int i = 0; i<
nblocks; i++)
516 for (
int i = 0; i<
nblocks; i++)
548 bool conforming =
true;
549 for (
int i = 0; i<
nblocks; i++)
559 const int remove_zeros = 0;
587 int h = offsets[i+1] - offsets[i];
590 int w = offsets[j+1] - offsets[j];
617 for (
int i = 0; i<
nblocks; i++)
659 for (
int k = 0; k <
lfis.Size(); k++)
661 for (
int i = 0; i <
lfis[k]->Size(); i++)
663 delete (*
lfis[k])[i];
674 delete mat;
mat =
nullptr;
675 delete y;
y =
nullptr;
679 delete P;
P =
nullptr;
680 delete R;
R =
nullptr;
702 for (
int i = 0; i<
Bmat.Size(); i++)
709 for (
int i = 0; i<
Bmat.Size(); i++)
732 for (
int iel = 0; iel <
mesh -> GetNE(); iel++)
748 MFEM_ABORT(
"DPGWeakForm::ComputeResidual: " 749 "dim > 3 not supported");
751 int numfaces = faces.
Size();
759 for (
int ie = 0; ie<faces.
Size(); ie++)
761 trial_offs[j+1] +=
trial_fes[j]->GetFaceElement(faces[ie])->GetDof();
772 u.SetSize(trial_offs.
Last());
773 double * data =
u.GetData();
782 for (
int k = 0; k < numfaces; k++)
784 int iface = faces[k];
785 trial_fes[i]->GetFaceVDofs(iface, face_vdofs);
791 doftrans =
trial_fes[i]->GetElementVDofs(iel, vdofs);
795 trial_offs[i+1]-trial_offs[i]);
804 Bmat[iel]->Mult(
u,v);
814 delete mat;
mat =
nullptr;
815 delete y;
y =
nullptr;
Abstract class for all finite elements.
void SetVector(const Vector &v, int offset)
void GetElementEdges(int i, Array< int > &edges, Array< int > &cor) const
Return the indices and the orientations of all edges of element i.
A class to handle Vectors in a block fashion.
void PartMult(const Array< int > &rows, const Vector &x, Vector &y) const
Partial matrix vector multiplication of (*this) with x involving only the rows given by rows...
int Dimension() const
Dimension of the reference space used within the elements.
int owns_blocks
If owns_blocks the SparseMatrix objects Aij will be deallocated.
void SyncMemory(const Vector &v) const
Update the memory location of the vector to match v.
void SetSize(int s)
Resize the vector to size s.
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
Pointer to an Operator of a specified type.
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
int Size() const
Returns the size of the vector.
Data type dense matrix using column-major storage.
void GetSubVector(const Array< int > &dofs, Vector &elemvect) const
Extract entries listed in dofs to the output Vector elemvect.
void FormSystemMatrix(Operator::DiagonalPolicy diag_policy)
virtual FaceElementTransformations * GetFaceElementTransformations(int FaceNo, int mask=31)
Class that performs static condensation of interior dofs for multiple FE spaces. This class is used i...
void AddSubVector(const Vector &v, int offset)
BlockMatrix & GetSchurMatrix()
Return the serial Schur complement matrix.
void SetBlock(int i, int j, SparseMatrix *mat)
Set A(i,j) = mat.
int NumRowBlocks() const
Return the number of row blocks.
virtual void Finalize(int skip_zeros=1)
Finalize all the submatrices.
void ReduceSystem(Vector &x, 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 GetElementFaces(int i, Array< int > &faces, Array< int > &ori) const
Return the indices and the orientations of all faces of element i.
double * GetData() const
Returns the matrix data array.
int Append(const T &el)
Append element 'el' to array, resize if necessary.
void MultTranspose(const double *x, double *y) const
Multiply a vector with the transpose matrix.
virtual void MultTranspose(const Vector &x, Vector &y) const
MatrixTranspose-Vector Multiplication y = A'*x.
void GetElementVertices(int i, Array< int > &v) const
Returns the indices of the vertices of element i.
int NumColBlocks() const
Return the number of column blocks.
bool HasEliminatedBC() const
Set the diagonal value to one.
void AddElementVector(const Array< int > &dofs, const Vector &elemvect)
Add elements of the elemvect Vector to the entries listed in dofs. Negative dof values cause the -dof...
void AddSubMatrix(const Array< int > &rows, const Array< int > &cols, const DenseMatrix &subm, int skip_zeros=1)
void Finalize(int skip_zeros=0)
Finalize the construction of the Schur complement matrix.
void SetSubVectorComplement(const Array< int > &dofs, const double val)
Set all vector entries NOT in the dofs Array to the given val.
double * GetData() const
Return a pointer to the beginning of the Vector data.
ComplexDenseMatrix * MultAtB(const ComplexDenseMatrix &A, const ComplexDenseMatrix &B)
Multiply the complex conjugate transpose of a matrix A with a matrix B. A^H*B.
virtual bool Factor(int m, double TOL=0.0)
Compute the Cholesky factorization of the current matrix.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
void PartialSum()
Fill the entries of the array with the cumulative sum of the entries.
void Transpose(const Table &A, Table &At, int ncols_A_)
Transpose a Table.
virtual void Mult(const Vector &x, Vector &y) const
Matrix-Vector Multiplication y = A*x.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
void SetDataAndSize(double *d, int s)
Set the Vector data and size.
void SetEssentialTrueDofs(const Array< int > &ess_tdof_list)
Determine and save internally essential reduced true dofs.
int GetNE() const
Returns number of elements.
void AssembleReducedSystem(int el, DenseMatrix &elmat, Vector &elvect)
void GetElementTransformation(int i, IsoparametricTransformation *ElTr)
void GetSubMatrix(const Array< int > &idx, DenseMatrix &A) const
DiagonalPolicy
Defines operator diagonal policy upon elimination of rows and/or columns.
SparseMatrix & GetBlock(int i, int j)
Return a reference to block (i,j). Reference may be invalid if Aij(i,j) == NULL.
double Norml2() const
Returns the l2 norm of the vector.
virtual void AddMult(const Vector &x, Vector &y, const double val=1.) const
Matrix-Vector Multiplication y = y + val*A*x.
int Size() const
Return the logical size of the array.
T & Last()
Return the last element in the array.
void MakeRef(T *, int)
Make this Array a reference to a pointer.
void ComputeSolution(const Vector &sc_sol, Vector &sol) const
void MakeRef(Vector &base, int offset, int size)
Reset the Vector to be a reference to a sub-vector of base.
void TransformDual(const DofTransformation *ran_dof_trans, const DofTransformation *dom_dof_trans, DenseMatrix &elmat)
double u(const Vector &xvec)
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
void EliminateRowCols(const Array< int > &vdofs, BlockMatrix *Ae, DiagonalPolicy dpolicy=DIAG_ONE)
Eliminate the rows and columns corresponding to the entries in vdofs + save the eliminated entries in...
void AddSubMatrix(const Array< int > &idx, const DenseMatrix &A)
(*this)(idx[i],idx[j]) += A(i,j)
int IsZeroBlock(int i, int j) const
Check if block (i,j) is a zero block.
void Reset(OpType *A, bool own_A=true)
Reset the OperatorHandle to the given OpType pointer, A.
Vector & GetBlock(int i)
Get the i-th vector in the block.