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");
120 "DPGWeakFrom::AdTestIntegrator: test fecol index out of bounds");
129 "DPGWeakFrom::AddDomainLFIntegrator: test fecol index out of bounds");
130 lfis[n]->Append(lfi);
139 for (
int i = 0; i<
nblocks; i++)
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();
296 for (
int j = 0; j <
trial_fes.Size(); j++)
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,
356 for (
int i = 0; i <
trial_fes.Size(); i++)
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)
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();
755 for (
int j = 0; j <
trial_fes.Size(); j++)
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());
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;
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Size() const
Return the logical size of the array.
void PartialSum()
Fill the entries of the array with the cumulative sum of the entries.
void MakeRef(T *data_, int size_, bool own_data=false)
Make this Array a reference to a pointer.
int Append(const T &el)
Append element 'el' to array, resize if necessary.
T & Last()
Return the last element in the array.
virtual void AddMult(const Vector &x, Vector &y, const real_t val=1.) const
Matrix-Vector Multiplication y = y + val*A*x.
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....
void SetBlock(int i, int j, SparseMatrix *mat)
Set A(i,j) = mat.
int NumColBlocks() const
Return the number of column blocks.
int IsZeroBlock(int i, int j) const
Check if block (i,j) is a zero block.
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...
SparseMatrix & GetBlock(int i, int j)
Return a reference to block (i,j). Reference may be invalid if Aij(i,j) == NULL.
int owns_blocks
If owns_blocks the SparseMatrix objects Aij will be deallocated.
virtual void Finalize(int skip_zeros=1)
Finalize all the submatrices.
virtual void Mult(const Vector &x, Vector &y) const
Matrix-Vector Multiplication y = A*x.
virtual void MultTranspose(const Vector &x, Vector &y) const
MatrixTranspose-Vector Multiplication y = A'*x.
int NumRowBlocks() const
Return the number of row blocks.
Class that performs static condensation of interior dofs for multiple FE spaces. This class is used i...
BlockMatrix & GetSchurMatrix()
Return the serial Schur complement matrix.
void FormSystemMatrix(Operator::DiagonalPolicy diag_policy)
void SetEssentialTrueDofs(const Array< int > &ess_tdof_list)
Determine and save internally essential reduced true dofs.
bool HasEliminatedBC() const
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 ComputeSolution(const Vector &sc_sol, Vector &sol) const
void Finalize(int skip_zeros=0)
Finalize the construction of the Schur complement matrix.
void AssembleReducedSystem(int el, DenseMatrix &elmat, Vector &elvect)
A class to handle Vectors in a block fashion.
Vector & GetBlock(int i)
Get the i-th vector in the block.
virtual bool Factor(int m, real_t TOL=0.0)
Compute the Cholesky factorization of the current matrix.
void LSolve(int m, int n, real_t *X) const
Data type dense matrix using column-major storage.
void MultTranspose(const real_t *x, real_t *y) const
Multiply a vector with the transpose matrix.
void GetSubMatrix(const Array< int > &idx, DenseMatrix &A) const
real_t * GetData() const
Returns the matrix data array.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
void AddSubMatrix(const Array< int > &idx, const DenseMatrix &A)
(*this)(idx[i],idx[j]) += A(i,j)
Abstract class for all finite elements.
virtual FaceElementTransformations * GetFaceElementTransformations(int FaceNo, int mask=31)
void GetElementVertices(int i, Array< int > &v) const
Returns the indices of the vertices of element i.
int GetNE() const
Returns number of elements.
int Dimension() const
Dimension of the reference space used within the elements.
void GetElementTransformation(int i, IsoparametricTransformation *ElTr) const
Builds the transformation defining the i-th element in ElTr. ElTr must be allocated in advance and wi...
void GetElementFaces(int i, Array< int > &faces, Array< int > &ori) const
Return the indices and the orientations of all faces of element i.
void GetElementEdges(int i, Array< int > &edges, Array< int > &cor) const
Return the indices and the orientations of all edges of element i.
Pointer to an Operator of a specified type.
void Reset(OpType *A, bool own_A=true)
Reset the OperatorHandle to the given OpType pointer, A.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
DiagonalPolicy
Defines operator diagonal policy upon elimination of rows and/or columns.
@ DIAG_ONE
Set the diagonal value to one.
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
void AddSubMatrix(const Array< int > &rows, const Array< int > &cols, const DenseMatrix &subm, int skip_zeros=1)
void SetVector(const Vector &v, int offset)
void SetDataAndSize(real_t *d, int s)
Set the Vector data and size.
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 AddSubVector(const Vector &v, int offset)
real_t Norml2() const
Returns the l2 norm of the vector.
void SyncMemory(const Vector &v) const
Update the memory location of the vector to match v.
int Size() const
Returns the size of the vector.
void SetSize(int s)
Resize the vector to size s.
real_t * GetData() const
Return a pointer to the beginning of the Vector data.
void SetSubVectorComplement(const Array< int > &dofs, const real_t val)
Set all vector entries NOT in the dofs Array to the given val.
void GetSubVector(const Array< int > &dofs, Vector &elemvect) const
Extract entries listed in dofs to the output Vector elemvect.
void MakeRef(Vector &base, int offset, int size)
Reset the Vector to be a reference to a sub-vector of base.
real_t u(const Vector &xvec)
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
void TransformDual(const DofTransformation *ran_dof_trans, const DofTransformation *dom_dof_trans, DenseMatrix &elmat)
void Transpose(const Table &A, Table &At, int ncols_A_)
Transpose a Table.
ComplexDenseMatrix * MultAtB(const ComplexDenseMatrix &A, const ComplexDenseMatrix &B)
Multiply the complex conjugate transpose of a matrix A with a matrix B. A^H*B.