43 for (
int j = 0; j <
lfis_r.Size(); j++)
130 "ComplexDPGWeakFrom::AddTrialIntegrator: trial fespace index out of bounds");
132 "ComplexDPGWeakFrom::AddTrialIntegrator: test fecol index out of bounds");
150 "ComplexDPGWeakFrom::AdTestIntegrator: test fecol index out of bounds");
167 "ComplexDPGWeakFrom::AddDomainLFIntegrator: test fecol index out of bounds");
184 for (
int i = 0; i<
nblocks; i++)
206 for (
int i = 0; i <
nblocks; i++)
208 for (
int j = 0; j <
nblocks; j++)
232 for (
int i = 0; i<
nblocks; i++)
234 for (
int j = 0; j<
nblocks; j++)
262 for (
int i = 0; i <
nblocks; i++)
264 for (
int j = 0; j <
nblocks; j++)
289 for (
int i = 0; i <
nblocks; i++)
291 for (
int j = 0; j <
nblocks; j++)
333 Vector vec_e_r, vec_r, b_r;
334 Vector vec_e_i, vec_i, b_i;
338 for (
int iel = 0; iel <
mesh -> GetNE(); iel++)
354 MFEM_ABORT(
"ComplexDPGWeakForm::Assemble: dim > 3 not supported");
356 int numfaces = faces.
Size();
368 for (
int j = 0; j <
trial_fes.Size(); j++)
372 for (
int ie = 0; ie < faces.
Size(); ie++)
375 faces[ie])->GetDof();
403 for (
int k = 0; k <
lfis_r[j]->Size(); k++)
405 (*
lfis_r[j])[k]->AssembleRHSElementVect(test_fe, *eltrans, vec_e_r);
409 for (
int k = 0; k <
lfis_i[j]->Size(); k++)
411 (*
lfis_i[j])[k]->AssembleRHSElementVect(test_fe,*eltrans,vec_e_i);
427 (*
test_integs_r(i,j))[k]->AssembleElementMatrix(test_fe, *eltrans, Ge_r);
431 (*
test_integs_r(i,j))[k]->AssembleElementMatrix2(test_fe_i, test_fe, *eltrans,
442 (*
test_integs_i(i,j))[k]->AssembleElementMatrix(test_fe,*eltrans,Ge_i);
446 (*
test_integs_i(i,j))[k]->AssembleElementMatrix2(test_fe_i,test_fe,*eltrans,
453 for (
int i = 0; i <
trial_fes.Size(); i++)
460 int face_dof_offs = 0;
461 for (
int ie = 0; ie < numfaces; ie++)
463 int iface = faces[ie];
466 (*
trial_integs_r(i,j))[k]->AssembleTraceFaceMatrix(iel, tfe, test_fe, *ftr,
468 B_r.
AddSubMatrix(test_offs[j], trial_offs[i]+face_dof_offs, Be_r);
469 face_dof_offs += Be_r.
Width();
475 int face_dof_offs = 0;
476 for (
int ie = 0; ie < numfaces; ie++)
478 int iface = faces[ie];
481 (*
trial_integs_i(i,j))[k]->AssembleTraceFaceMatrix(iel,tfe,test_fe,*ftr,Be_i);
482 B_i.
AddSubMatrix(test_offs[j], trial_offs[i]+face_dof_offs, Be_i);
483 face_dof_offs += Be_i.
Width();
494 (*
trial_integs_r(i,j))[k]->AssembleElementMatrix2(fe,test_fe,*eltrans,Be_r);
500 (*
trial_integs_i(i,j))[k]->AssembleElementMatrix2(fe, test_fe, *eltrans, Be_i);
543 doftrans_i =
nullptr;
547 for (
int k = 0; k < numfaces; k++)
549 int iface = faces[k];
550 trial_fes[i]->GetFaceVDofs(iface, face_vdofs);
551 vdofs_i.
Append(face_vdofs);
556 doftrans_i =
trial_fes[i]->GetElementVDofs(iel, vdofs_i);
558 for (
int j = 0; j <
trial_fes.Size(); j++)
561 doftrans_j =
nullptr;
566 for (
int k = 0; k < numfaces; k++)
568 int iface = faces[k];
569 trial_fes[j]->GetFaceVDofs(iface, face_vdofs);
570 vdofs_j.
Append(face_vdofs);
575 doftrans_j =
trial_fes[j]->GetElementVDofs(iel, vdofs_j);
580 trial_offs[j],trial_offs[j+1], Ae_r);
582 trial_offs[j],trial_offs[j+1], Ae_i);
583 if (doftrans_i || doftrans_j)
590 mfem::out <<
"null matrix " << std::endl;
597 Vector vec1_r(b_r,trial_offs[i],trial_offs[i+1]-trial_offs[i]);
598 Vector vec1_i(b_i,trial_offs[i],trial_offs[i+1]-trial_offs[i]);
648 for (
int i = 0; i<
nblocks; i++)
669 for (
int i = 0; i<
nblocks; i++)
707 bool conforming =
true;
708 for (
int i = 0; i<
nblocks; i++)
718 const int remove_zeros = 0;
755 int h = offsets[i+1] - offsets[i];
758 int w = offsets[j+1] - offsets[j];
793 for (
int i = 0; i<
nblocks; i++)
849 for (
int k = 0; k <
lfis_r.Size(); k++)
851 for (
int i = 0; i <
lfis_r[k]->Size(); i++)
856 for (
int i = 0; i <
lfis_i[k]->Size(); i++)
871 delete mat;
mat =
nullptr;
874 delete y;
y =
nullptr;
875 delete y_r;
y_r =
nullptr;
876 delete y_i;
y_i =
nullptr;
880 delete P;
P =
nullptr;
881 delete R;
R =
nullptr;
903 for (
int i = 0; i <
Bmat.Size(); i++)
910 for (
int i = 0; i <
Bmat.Size(); i++)
927 "Matrices needed for the residual are not store. Call ComplexDPGWeakForm::StoreMatrices()")
941 for (
int iel = 0; iel <
mesh -> GetNE(); iel++)
957 MFEM_ABORT(
"ComplexDPGWeakForm::ComputeResidual: "
958 "dim > 3 not supported");
960 int numfaces = faces.
Size();
964 for (
int j = 0; j <
trial_fes.Size(); j++)
968 for (
int ie = 0; ie < faces.
Size(); ie++)
970 trial_offs[j+1] +=
trial_fes[j]->GetFaceElement(faces[ie])->GetDof();
981 int nn = trial_offs.
Last();
991 for (
int k = 0; k < numfaces; k++)
993 int iface = faces[k];
994 trial_fes[i]->GetFaceVDofs(iface, face_vdofs);
1000 doftrans =
trial_fes[i]->GetElementVDofs(iel, vdofs);
1004 vec1_r.
MakeRef(
u, trial_offs[i], trial_offs[i+1]-trial_offs[i]);
1005 vec1_i.
MakeRef(
u, trial_offs[i]+nn, trial_offs[i+1]-trial_offs[i]);
1017 Bmat[iel]->Mult(
u,v);
1028 delete mat;
mat =
nullptr;
1031 delete y;
y =
nullptr;
1032 delete y_r;
y_r =
nullptr;
1033 delete y_i;
y_i =
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.
A class to handle Vectors in a block fashion.
Vector & GetBlock(int i)
Get the i-th vector in the block.
Class that performs static condensation of interior dofs for multiple FE spaces for complex systems (...
void Finalize(int skip_zeros=0)
Finalize the construction of the Schur complement matrix.
void AssembleReducedSystem(int el, ComplexDenseMatrix &elmat, Vector &elvect_r, Vector &elvect_i)
bool HasEliminatedBC() const
void FormSystemMatrix(Operator::DiagonalPolicy diag_policy)
void SetEssentialTrueDofs(const Array< int > &ess_tdof_list)
Determine and save internally essential reduced true dofs.
void ComputeSolution(const Vector &sc_sol, Vector &sol) 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....
ComplexOperator & GetSchurComplexOperator()
void LSolve(int m, int n, real_t *X_r, real_t *X_i) const
virtual bool Factor(int m, real_t TOL=0.0)
Compute the Cholesky factorization of the current matrix.
Specialization of the ComplexOperator built from a pair of Dense Matrices. The purpose of this specia...
virtual DenseMatrix & real()
Real or imaginary part accessor methods.
virtual DenseMatrix & imag()
Mimic the action of a complex operator using two real operators.
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 ...
Data type dense matrix using column-major storage.
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.
@ DIAG_ZERO
Set the diagonal value to zero.
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 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)
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
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.