35 Table face_dof, dof_face;
52 int *I = dof_dof.
GetI();
53 int *J = dof_dof.
GetJ();
54 double *data =
new double[I[
height]];
86 for (i = 0; i < bfi->
Size(); i++)
91 for (i = 0; i < bfi->
Size(); i++)
96 for (i = 0; i < bfi->
Size(); i++)
101 for (i = 0; i < bfi->
Size(); i++)
102 bfbfi[i] = (*bfi)[i];
167 dbfi[0]->AssembleElementMatrix(fe, *eltrans, elmat);
168 for (
int k = 1; k <
dbfi.Size(); k++)
170 dbfi[k]->AssembleElementMatrix(fe, *eltrans,
elemmat);
201 #ifdef MFEM_USE_OPENMP
202 int free_element_matrices = 0;
206 free_element_matrices = 1;
212 for (i = 0; i <
fes -> GetNE(); i++)
223 for (
int k = 0; k <
dbfi.Size(); k++)
225 dbfi[k]->AssembleElementMatrix(fe, *eltrans,
elemmat);
234 for (i = 0; i <
fes -> GetNBE(); i++)
237 fes -> GetBdrElementVDofs (i,
vdofs);
238 eltrans =
fes -> GetBdrElementTransformation (i);
239 for (
int k=0; k <
bbfi.Size(); k++)
253 for (i = 0; i < nfaces; i++)
255 tr = mesh -> GetInteriorFaceTransformations (i);
258 fes -> GetElementVDofs (tr -> Elem1No,
vdofs);
259 fes -> GetElementVDofs (tr -> Elem2No, vdofs2);
261 for (
int k = 0; k <
fbfi.Size(); k++)
263 fbfi[k] -> AssembleFaceMatrix (*
fes -> GetFE (tr -> Elem1No),
264 *
fes -> GetFE (tr -> Elem2No),
277 for (i = 0; i <
fes -> GetNBE(); i++)
279 tr = mesh -> GetBdrFaceTransformations (i);
282 fes -> GetElementVDofs (tr -> Elem1No,
vdofs);
283 for (
int k = 0; k <
bfbfi.Size(); k++)
285 bfbfi[k] -> AssembleFaceMatrix (*
fes -> GetFE (tr -> Elem1No),
293 #ifdef MFEM_USE_OPENMP
294 if (free_element_matrices)
347 #ifdef MFEM_USE_OPENMP
348 #pragma omp parallel for private(tmp,eltrans)
350 for (
int i = 0; i < num_elements; i++)
353 num_dofs_per_el, num_dofs_per_el);
356 if (num_dofs_per_el != fe.GetDof()*
fes->
GetVDim())
357 mfem_error(
"BilinearForm::ComputeElementMatrices:"
358 " all elements must have same number of dofs");
362 dbfi[0]->AssembleElementMatrix(fe, eltrans, elmat);
363 for (
int k = 1; k <
dbfi.Size(); k++)
366 dbfi[k]->AssembleElementMatrix(fe, eltrans, tmp);
392 for (
int i = 0; i < vdofs.
Size(); i++)
396 mat -> EliminateRowCol (vdof, sol(vdof), rhs, d);
398 mat -> EliminateRowCol (-1-vdof, sol(-1-vdof), rhs, d);
407 for (
int i = 0; i < vdofs.
Size(); i++)
411 mat -> EliminateRowCol (vdof, *
mat_e, d);
413 mat -> EliminateRowCol (-1-vdof, *
mat_e, d);
442 MFEM_ASSERT(ess_dofs.
Size() ==
height,
"incorrect dof Array size");
443 MFEM_ASSERT(sol.
Size() ==
height,
"incorrect sol Vector size");
444 MFEM_ASSERT(rhs.
Size() ==
height,
"incorrect rhs Vector size");
446 for (
int i = 0; i < ess_dofs.
Size(); i++)
448 mat -> EliminateRowCol (i, sol(i), rhs, d);
453 MFEM_ASSERT(ess_dofs.
Size() ==
height,
"incorrect dof Array size");
455 for (
int i = 0; i < ess_dofs.
Size(); i++)
457 mat -> EliminateRowCol (i, d);
462 if (nfes)
fes = nfes;
482 for (k=0; k <
dbfi.Size(); k++)
delete dbfi[k];
483 for (k=0; k <
bbfi.Size(); k++)
delete bbfi[k];
484 for (k=0; k <
fbfi.Size(); k++)
delete fbfi[k];
485 for (k=0; k <
bfbfi.Size(); k++)
delete bfbfi[k];
492 :
Matrix(te_fes->GetVSize(), tr_fes->GetVSize())
515 const double a)
const
521 const double a)
const
541 " Both trial and test spaces must use Ordering::byNODES!");
577 for (i = 0; i <
test_fes -> GetNE(); i++)
579 trial_fes -> GetElementVDofs (i, tr_vdofs);
580 test_fes -> GetElementVDofs (i, te_vdofs);
581 eltrans =
test_fes -> GetElementTransformation (i);
582 for (k = 0; k <
dom.Size(); k++)
584 dom[k] -> AssembleElementMatrix2 (*
trial_fes -> GetFE(i),
587 mat -> AddSubMatrix (te_vdofs, tr_vdofs, elemmat, skip_zeros);
594 for (i = 0; i <
test_fes -> GetNBE(); i++)
596 trial_fes -> GetBdrElementVDofs (i, tr_vdofs);
597 test_fes -> GetBdrElementVDofs (i, te_vdofs);
598 eltrans =
test_fes -> GetBdrElementTransformation (i);
599 for (k = 0; k <
bdr.Size(); k++)
601 bdr[k] -> AssembleElementMatrix2 (*
trial_fes -> GetBE(i),
604 mat -> AddSubMatrix (te_vdofs, tr_vdofs, elemmat, skip_zeros);
616 for (i = 0; i < nfaces; i++)
626 te_vdofs.
Append(te_vdofs2);
631 for (
int k = 0; k <
skt.Size(); k++)
633 skt[k]->AssembleFaceMatrix(*trial_face_fe, *test_fe1, *test_fe2,
674 for (i = 0; i <
trial_fes -> GetNBE(); i++)
675 if (bdr_attr_is_ess[
trial_fes -> GetBdrAttribute (i)-1])
677 trial_fes -> GetBdrElementVDofs (i, tr_vdofs);
678 for (j = 0; j < tr_vdofs.
Size(); j++)
680 if ( (k = tr_vdofs[j]) < 0 )
685 mat -> EliminateCols (cols_marker, &sol, &rhs);
691 mat -> EliminateCols (marked_vdofs, &sol, &rhs);
699 for (i = 0; i <
test_fes -> GetNBE(); i++)
700 if (bdr_attr_is_ess[
test_fes -> GetBdrAttribute (i)-1])
702 test_fes -> GetBdrElementVDofs (i, te_vdofs);
703 for (j = 0; j < te_vdofs.
Size(); j++)
705 if ( (k = te_vdofs[j]) < 0 )
707 mat -> EliminateRow (k);
725 for (i = 0; i <
dom.Size(); i++)
delete dom[i];
726 for (i = 0; i <
bdr.Size(); i++)
delete bdr[i];
727 for (i = 0; i <
skt.Size(); i++)
delete skt[i];
750 dom[0]->AssembleElementMatrix2(*dom_fe, *ran_fe, *T, totelmat);
751 for (
int j = 1; j <
dom.Size(); j++)
753 dom[j]->AssembleElementMatrix2(*dom_fe, *ran_fe, *T, elmat);
Abstract class for Finite Elements.
int Size() const
Logical size of the array.
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols.
void BuildElementToDofTable()
void AddMult(const Vector &x, Vector &y, const double a=1.0) const
y += A * x (default) or y += a * A * x
int Size() const
Returns the size of the vector.
Abstract data type for matrix inverse.
void LoseData()
Call this if data has been stolen.
const FiniteElement * GetFaceElement(int i) const
FaceElementTransformations * GetFaceElementTransformations(int FaceNo, int mask=31)
void GetBlocks(Array2D< SparseMatrix * > &blocks) const
SparseMatrix * GetConformingProlongation()
int GetNumFaces() const
Return the number of faces (3D), edges (2D) or vertices (1D).
int GetNE() const
Returns number of elements in the mesh.
void SetSize(int m, int n)
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.
Abstract data type matrix.
HypreParMatrix * RAP(HypreParMatrix *A, HypreParMatrix *P)
Returns the matrix P^t * A * P.
void Transpose(const Table &A, Table &At, int _ncols_A)
Transpose a Table.
int GetVDim() const
Returns vector dimension.
void AddSubMatrix(const Array< int > &rows, const Array< int > &cols, const DenseMatrix &subm, int skip_zeros=1)
void SetSubMatrix(const Array< int > &rows, const Array< int > &cols, const DenseMatrix &subm, int skip_zeros=1)
int GetOrdering() const
Return the ordering method.
ElementTransformation * GetElementTransformation(int i) const
Returns ElementTransformation for the i'th element.
Abstract finite element space.
int GetDof() const
Returns the degrees of freedom in the FE space.
void mfem_error(const char *msg)
void GetElementVDofs(int i, Array< int > &dofs) const
Returns indexes of degrees of freedom in array dofs for i'th element.
virtual void GetEssentialVDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_dofs) const
Determine the boundary degrees of freedom.
void GetFaceVDofs(int iF, Array< int > &dofs) const
Returns indexes of degrees of freedom for i'th face element (2D and 3D).
Table * GetFaceToElementTable() const
void ConvertToConformingVDofs(const Array< int > &dofs, Array< int > &cdofs)
const FiniteElement * GetFE(int i) const
Returns pointer to the FiniteElement associated with i'th element.
const Table & GetElementToDofTable() const
const FiniteElement * GetBE(int i) const
Returns pointer to the FiniteElement for the i'th boundary element.
void SetSize(int s)
If the matrix is not a square matrix of size s then recreate it.
virtual void Assemble(int skip_zeros=1)
Rank 3 tensor (array of matrices)
void PartMult(const Array< int > &rows, const Vector &x, Vector &y) const