MFEM  v4.1.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mfem::BilinearForm Class Reference

#include <bilinearform.hpp>

Inheritance diagram for mfem::BilinearForm:
[legend]
Collaboration diagram for mfem::BilinearForm:
[legend]

Public Member Functions

 BilinearForm (FiniteElementSpace *f)
 Creates bilinear form associated with FE space *f. More...
 
 BilinearForm (FiniteElementSpace *f, BilinearForm *bf, int ps=0)
 Create a BilinearForm on the FiniteElementSpace f, using the same integrators as the BilinearForm bf. More...
 
int Size () const
 Get the size of the BilinearForm as a square matrix. More...
 
void SetAssemblyLevel (AssemblyLevel assembly_level)
 Set the desired assembly level. The default is AssemblyLevel::FULL. More...
 
AssemblyLevel GetAssemblyLevel ()
 Get the assembly level. More...
 
void EnableStaticCondensation ()
 
bool StaticCondensationIsEnabled () const
 
FiniteElementSpaceSCFESpace () const
 Return the trace FE space associated with static condensation. More...
 
void EnableHybridization (FiniteElementSpace *constr_space, BilinearFormIntegrator *constr_integ, const Array< int > &ess_tdof_list)
 
void UsePrecomputedSparsity (int ps=1)
 
void UseSparsity (int *I, int *J, bool isSorted)
 Use the given CSR sparsity pattern to allocate the internal SparseMatrix. More...
 
void UseSparsity (SparseMatrix &A)
 Use the sparsity of A to allocate the internal SparseMatrix. More...
 
void AllocateMatrix ()
 
Array< BilinearFormIntegrator * > * GetDBFI ()
 Access all integrators added with AddDomainIntegrator(). More...
 
Array< BilinearFormIntegrator * > * GetBBFI ()
 Access all integrators added with AddBoundaryIntegrator(). More...
 
Array< Array< int > * > * GetBBFI_Marker ()
 Access all boundary markers added with AddBoundaryIntegrator(). If no marker was specified when the integrator was added, the corresponding pointer (to Array<int>) will be NULL. More...
 
Array< BilinearFormIntegrator * > * GetFBFI ()
 Access all integrators added with AddInteriorFaceIntegrator(). More...
 
Array< BilinearFormIntegrator * > * GetBFBFI ()
 Access all integrators added with AddBdrFaceIntegrator(). More...
 
Array< Array< int > * > * GetBFBFI_Marker ()
 Access all boundary markers added with AddBdrFaceIntegrator(). If no marker was specified when the integrator was added, the corresponding pointer (to Array<int>) will be NULL. More...
 
const double & operator() (int i, int j)
 
virtual double & Elem (int i, int j)
 Returns reference to a_{ij}. More...
 
virtual const double & Elem (int i, int j) const
 Returns constant reference to a_{ij}. More...
 
virtual void Mult (const Vector &x, Vector &y) const
 Matrix vector multiplication. More...
 
void FullMult (const Vector &x, Vector &y) const
 
virtual void AddMult (const Vector &x, Vector &y, const double a=1.0) const
 
void FullAddMult (const Vector &x, Vector &y) const
 
virtual void AddMultTranspose (const Vector &x, Vector &y, const double a=1.0) const
 
void FullAddMultTranspose (const Vector &x, Vector &y) const
 
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 error. More...
 
double InnerProduct (const Vector &x, const Vector &y) const
 
virtual MatrixInverseInverse () const
 Returns a pointer to (approximation) of the matrix inverse. More...
 
virtual void Finalize (int skip_zeros=1)
 Finalizes the matrix initialization. More...
 
const SparseMatrixSpMat () const
 Returns a reference to the sparse matrix. More...
 
SparseMatrixSpMat ()
 
SparseMatrixLoseMat ()
 
const SparseMatrixSpMatElim () const
 Returns a reference to the sparse matrix of eliminated b.c. More...
 
SparseMatrixSpMatElim ()
 
void AddDomainIntegrator (BilinearFormIntegrator *bfi)
 Adds new Domain Integrator. Assumes ownership of bfi. More...
 
void AddBoundaryIntegrator (BilinearFormIntegrator *bfi)
 Adds new Boundary Integrator. Assumes ownership of bfi. More...
 
void AddBoundaryIntegrator (BilinearFormIntegrator *bfi, Array< int > &bdr_marker)
 Adds new Boundary Integrator, restricted to specific boundary attributes. More...
 
void AddInteriorFaceIntegrator (BilinearFormIntegrator *bfi)
 Adds new interior Face Integrator. Assumes ownership of bfi. More...
 
void AddBdrFaceIntegrator (BilinearFormIntegrator *bfi)
 Adds new boundary Face Integrator. Assumes ownership of bfi. More...
 
void AddBdrFaceIntegrator (BilinearFormIntegrator *bfi, Array< int > &bdr_marker)
 Adds new boundary Face Integrator, restricted to specific boundary attributes. More...
 
void operator= (const double a)
 
void Assemble (int skip_zeros=1)
 Assembles the form i.e. sums over all domain/bdr integrators. More...
 
void AssembleDiagonal (Vector &diag) const
 Assemble the diagonal of the bilinear form into diag. More...
 
virtual const OperatorGetProlongation () const
 Get the finite element space prolongation matrix. More...
 
virtual const OperatorGetRestriction () const
 Get the finite element space restriction matrix. More...
 
virtual const OperatorGetOutputProlongation () const
 Get the output finite element space prolongation matrix. More...
 
virtual const OperatorGetOutputRestriction () const
 Get the output finite element space restriction matrix. More...
 
virtual void FormLinearSystem (const Array< int > &ess_tdof_list, Vector &x, Vector &b, OperatorHandle &A, Vector &X, Vector &B, int copy_interior=0)
 Form the linear system A X = B, corresponding to this bilinear form and the linear form b(.). More...
 
template<typename OpType >
void FormLinearSystem (const Array< int > &ess_tdof_list, Vector &x, Vector &b, OpType &A, Vector &X, Vector &B, int copy_interior=0)
 Form the linear system A X = B, corresponding to this bilinear form and the linear form b(.). More...
 
virtual void FormSystemMatrix (const Array< int > &ess_tdof_list, OperatorHandle &A)
 Form the linear system matrix A, see FormLinearSystem() for details. More...
 
template<typename OpType >
void FormSystemMatrix (const Array< int > &ess_tdof_list, OpType &A)
 Form the linear system matrix A, see FormLinearSystem() for details. More...
 
virtual void RecoverFEMSolution (const Vector &X, const Vector &b, Vector &x)
 Recover the solution of a linear system formed with FormLinearSystem(). More...
 
void ComputeElementMatrices ()
 Compute and store internally all element matrices. More...
 
void FreeElementMatrices ()
 Free the memory used by the element matrices. More...
 
void ComputeElementMatrix (int i, DenseMatrix &elmat)
 Compute the element matrix of the given element. More...
 
void ComputeBdrElementMatrix (int i, DenseMatrix &elmat)
 Compute the boundary element matrix of the given boundary element. More...
 
void AssembleElementMatrix (int i, const DenseMatrix &elmat, int skip_zeros=1)
 Assemble the given element matrix. More...
 
void AssembleElementMatrix (int i, const DenseMatrix &elmat, Array< int > &vdofs, int skip_zeros=1)
 Assemble the given element matrix. More...
 
void AssembleBdrElementMatrix (int i, const DenseMatrix &elmat, int skip_zeros=1)
 Assemble the given boundary element matrix. More...
 
void AssembleBdrElementMatrix (int i, const DenseMatrix &elmat, Array< int > &vdofs, int skip_zeros=1)
 Assemble the given boundary element matrix. More...
 
void EliminateEssentialBC (const Array< int > &bdr_attr_is_ess, const Vector &sol, Vector &rhs, DiagonalPolicy dpolicy=DIAG_ONE)
 Eliminate essential boundary DOFs from the system. More...
 
void EliminateEssentialBC (const Array< int > &bdr_attr_is_ess, DiagonalPolicy dpolicy=DIAG_ONE)
 Eliminate essential boundary DOFs from the system matrix. More...
 
void EliminateEssentialBCDiag (const Array< int > &bdr_attr_is_ess, double value)
 Perform elimination and set the diagonal entry to the given value. More...
 
void EliminateVDofs (const Array< int > &vdofs, const Vector &sol, Vector &rhs, DiagonalPolicy dpolicy=DIAG_ONE)
 Eliminate the given vdofs. NOTE: here, vdofs is a list of DOFs. More...
 
void EliminateVDofs (const Array< int > &vdofs, DiagonalPolicy dpolicy=DIAG_ONE)
 Eliminate the given vdofs, storing the eliminated part internally. More...
 
void EliminateEssentialBCFromDofs (const Array< int > &ess_dofs, const Vector &sol, Vector &rhs, DiagonalPolicy dpolicy=DIAG_ONE)
 Similar to EliminateVDofs(const Array<int> &, const Vector &, Vector &, DiagonalPolicy) but here ess_dofs is a marker (boolean) array on all vector-dofs (ess_dofs[i] < 0 is true). More...
 
void EliminateEssentialBCFromDofs (const Array< int > &ess_dofs, DiagonalPolicy dpolicy=DIAG_ONE)
 Similar to EliminateVDofs(const Array<int> &, DiagonalPolicy) but here ess_dofs is a marker (boolean) array on all vector-dofs (ess_dofs[i] < 0 is true). More...
 
void EliminateEssentialBCFromDofsDiag (const Array< int > &ess_dofs, double value)
 Perform elimination and set the diagonal entry to the given value. More...
 
void EliminateVDofsInRHS (const Array< int > &vdofs, const Vector &x, Vector &b)
 Use the stored eliminated part of the matrix (see EliminateVDofs(const Array<int> &, DiagonalPolicy)) to modify the r.h.s. b; vdofs is a list of DOFs (non-directional, i.e. >= 0). More...
 
double FullInnerProduct (const Vector &x, const Vector &y) const
 
virtual void Update (FiniteElementSpace *nfes=NULL)
 
FiniteElementSpaceGetFES ()
 (DEPRECATED) Return the FE space associated with the BilinearForm. More...
 
FiniteElementSpaceFESpace ()
 Return the FE space associated with the BilinearForm. More...
 
const FiniteElementSpaceFESpace () const
 Read-only access to the associated FiniteElementSpace. More...
 
void SetDiagonalPolicy (DiagonalPolicy policy)
 Sets diagonal policy used upon construction of the linear system. More...
 
void UseExternalIntegrators ()
 Indicate that integrators are not owned by the BilinearForm. More...
 
virtual ~BilinearForm ()
 Destroys bilinear form. More...
 
- Public Member Functions inherited from mfem::Matrix
 Matrix (int s)
 Creates a square matrix of size s. More...
 
 Matrix (int h, int w)
 Creates a matrix of the given height and width. More...
 
bool IsSquare () const
 Returns whether the matrix is a square matrix. More...
 
virtual void Print (std::ostream &out=mfem::out, int width_=4) const
 Prints matrix to stream out. More...
 
virtual ~Matrix ()
 Destroys matrix. More...
 
- Public Member Functions inherited from mfem::Operator
void InitTVectors (const Operator *Po, const Operator *Ri, const Operator *Pi, Vector &x, Vector &b, Vector &X, Vector &B) const
 Initializes memory for true vectors of linear system. More...
 
 Operator (int s=0)
 Construct a square Operator with given size s (default 0). More...
 
 Operator (int h, int w)
 Construct an Operator with the given height (output size) and width (input size). More...
 
int Height () const
 Get the height (size of output) of the Operator. Synonym with NumRows(). More...
 
int NumRows () const
 Get the number of rows (size of output) of the Operator. Synonym with Height(). More...
 
int Width () const
 Get the width (size of input) of the Operator. Synonym with NumCols(). More...
 
int NumCols () const
 Get the number of columns (size of input) of the Operator. Synonym with Width(). More...
 
virtual MemoryClass GetMemoryClass () const
 Return the MemoryClass preferred by the Operator. More...
 
virtual OperatorGetGradient (const Vector &x) const
 Evaluate the gradient operator at the point x. The default behavior in class Operator is to generate an error. More...
 
void FormLinearSystem (const Array< int > &ess_tdof_list, Vector &x, Vector &b, Operator *&A, Vector &X, Vector &B, int copy_interior=0)
 Form a constrained linear system using a matrix-free approach. More...
 
void FormRectangularLinearSystem (const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, Vector &x, Vector &b, Operator *&A, Vector &X, Vector &B)
 Form a column-constrained linear system using a matrix-free approach. More...
 
void FormSystemOperator (const Array< int > &ess_tdof_list, Operator *&A)
 Return in A a parallel (on truedofs) version of this square operator. More...
 
void FormRectangularSystemOperator (const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, Operator *&A)
 Return in A a parallel (on truedofs) version of this rectangular operator (including constraints). More...
 
void FormDiscreteOperator (Operator *&A)
 Return in A a parallel (on truedofs) version of this rectangular operator. More...
 
void PrintMatlab (std::ostream &out, int n=0, int m=0) const
 Prints operator with input size n and output size m in Matlab format. More...
 
virtual ~Operator ()
 Virtual destructor. More...
 
Type GetType () const
 Return the type ID of the Operator class. More...
 

Protected Member Functions

void AllocMat ()
 
void ConformingAssemble ()
 
 BilinearForm ()
 
- Protected Member Functions inherited from mfem::Operator
void FormConstrainedSystemOperator (const Array< int > &ess_tdof_list, ConstrainedOperator *&Aout)
 see FormSystemOperator() More...
 
void FormRectangularConstrainedSystemOperator (const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, RectangularConstrainedOperator *&Aout)
 see FormRectangularSystemOperator() More...
 
OperatorSetupRAP (const Operator *Pi, const Operator *Po)
 Returns RAP Operator of this, taking in input/output Prolongation matrices. More...
 

Protected Attributes

SparseMatrixmat
 Sparse matrix to be associated with the form. Owned. More...
 
SparseMatrixmat_e
 Matrix used to eliminate b.c. Owned. More...
 
FiniteElementSpacefes
 FE space on which the form lives. Not owned. More...
 
AssemblyLevel assembly
 The assembly level of the form (full, partial, etc.) More...
 
int batch
 Element batch size used in the form action (1, 8, num_elems, etc.) More...
 
BilinearFormExtensionext
 
long sequence
 
int extern_bfs
 Indicates the BilinearFormIntegrators stored in dbfi, bbfi, fbfi, and bfbfi are owned by another BilinearForm. More...
 
Array< BilinearFormIntegrator * > dbfi
 Set of Domain Integrators to be applied. More...
 
Array< BilinearFormIntegrator * > bbfi
 Set of Boundary Integrators to be applied. More...
 
Array< Array< int > * > bbfi_marker
 Entries are not owned. More...
 
Array< BilinearFormIntegrator * > fbfi
 Set of interior face Integrators to be applied. More...
 
Array< BilinearFormIntegrator * > bfbfi
 Set of boundary face Integrators to be applied. More...
 
Array< Array< int > * > bfbfi_marker
 Entries are not owned. More...
 
DenseMatrix elemmat
 
Array< int > vdofs
 
DenseTensorelement_matrices
 Owned. More...
 
StaticCondensationstatic_cond
 Owned. More...
 
Hybridizationhybridization
 Owned. More...
 
DiagonalPolicy diag_policy
 
int precompute_sparsity
 
- Protected Attributes inherited from mfem::Operator
int height
 Dimension of the output / number of rows in the matrix. More...
 
int width
 Dimension of the input / number of columns in the matrix. More...
 

Additional Inherited Members

- Public Types inherited from mfem::Matrix
enum  DiagonalPolicy { DIAG_ZERO, DIAG_ONE, DIAG_KEEP }
 
- Public Types inherited from mfem::Operator
enum  Type {
  ANY_TYPE, MFEM_SPARSEMAT, Hypre_ParCSR, PETSC_MATAIJ,
  PETSC_MATIS, PETSC_MATSHELL, PETSC_MATNEST, PETSC_MATHYPRE,
  PETSC_MATGENERIC, Complex_Operator, MFEM_ComplexSparseMat, Complex_Hypre_ParCSR
}
 Enumeration defining IDs for some classes derived from Operator. More...
 

Detailed Description

Class for bilinear form - "Matrix" with associated FE space and BLFIntegrators.

Definition at line 49 of file bilinearform.hpp.

Constructor & Destructor Documentation

mfem::BilinearForm::BilinearForm ( )
inlineprotected

Definition at line 111 of file bilinearform.hpp.

mfem::BilinearForm::BilinearForm ( FiniteElementSpace f)

Creates bilinear form associated with FE space *f.

The pointer f is not owned by the newly constructed object.

Definition at line 66 of file bilinearform.cpp.

mfem::BilinearForm::BilinearForm ( FiniteElementSpace f,
BilinearForm bf,
int  ps = 0 
)

Create a BilinearForm on the FiniteElementSpace f, using the same integrators as the BilinearForm bf.

The pointer f is not owned by the newly constructed object.

The integrators in bf are copied as pointers and they are not owned by the newly constructed BilinearForm.

The optional parameter ps is used to initialize the internal flag precompute_sparsity, see UsePrecomputedSparsity() for details.

Definition at line 84 of file bilinearform.cpp.

mfem::BilinearForm::~BilinearForm ( )
virtual

Destroys bilinear form.

Definition at line 1048 of file bilinearform.cpp.

Member Function Documentation

void mfem::BilinearForm::AddBdrFaceIntegrator ( BilinearFormIntegrator bfi)

Adds new boundary Face Integrator. Assumes ownership of bfi.

Definition at line 259 of file bilinearform.cpp.

void mfem::BilinearForm::AddBdrFaceIntegrator ( BilinearFormIntegrator bfi,
Array< int > &  bdr_marker 
)

Adds new boundary Face Integrator, restricted to specific boundary attributes.

Assumes ownership of bfi. The array bdr_marker is stored internally as a pointer to the given Array<int> object.

Definition at line 265 of file bilinearform.cpp.

void mfem::BilinearForm::AddBoundaryIntegrator ( BilinearFormIntegrator bfi)

Adds new Boundary Integrator. Assumes ownership of bfi.

Definition at line 241 of file bilinearform.cpp.

void mfem::BilinearForm::AddBoundaryIntegrator ( BilinearFormIntegrator bfi,
Array< int > &  bdr_marker 
)

Adds new Boundary Integrator, restricted to specific boundary attributes.

Assumes ownership of bfi. The array bdr_marker is stored internally as a pointer to the given Array<int> object.

Definition at line 247 of file bilinearform.cpp.

void mfem::BilinearForm::AddDomainIntegrator ( BilinearFormIntegrator bfi)

Adds new Domain Integrator. Assumes ownership of bfi.

Definition at line 236 of file bilinearform.cpp.

void mfem::BilinearForm::AddInteriorFaceIntegrator ( BilinearFormIntegrator bfi)

Adds new interior Face Integrator. Assumes ownership of bfi.

Definition at line 254 of file bilinearform.cpp.

virtual void mfem::BilinearForm::AddMult ( const Vector x,
Vector y,
const double  a = 1.0 
) const
inlinevirtual

Definition at line 236 of file bilinearform.hpp.

virtual void mfem::BilinearForm::AddMultTranspose ( const Vector x,
Vector y,
const double  a = 1.0 
) const
inlinevirtual

Definition at line 242 of file bilinearform.hpp.

void mfem::BilinearForm::AllocateMatrix ( )
inline

Pre-allocate the internal SparseMatrix before assembly. If the flag 'precompute sparsity' is set, the matrix is allocated in CSR format (i.e. finalized) and the entries are initialized with zeros.

Definition at line 200 of file bilinearform.hpp.

void mfem::BilinearForm::AllocMat ( )
protected

Definition at line 21 of file bilinearform.cpp.

void mfem::BilinearForm::Assemble ( int  skip_zeros = 1)

Assembles the form i.e. sums over all domain/bdr integrators.

Definition at line 377 of file bilinearform.cpp.

void mfem::BilinearForm::AssembleBdrElementMatrix ( int  i,
const DenseMatrix elmat,
int  skip_zeros = 1 
)

Assemble the given boundary element matrix.

The boundary element matrix elmat is assembled for the boundary element i, i.e. added to the system matrix. The flag skip_zeros skips the zero elements of the matrix, unless they are breaking the symmetry of the system matrix.

Definition at line 349 of file bilinearform.cpp.

void mfem::BilinearForm::AssembleBdrElementMatrix ( int  i,
const DenseMatrix elmat,
Array< int > &  vdofs,
int  skip_zeros = 1 
)

Assemble the given boundary element matrix.

The boundary element matrix elmat is assembled for the boundary element i, i.e. added to the system matrix. The vdofs of the element are returned in vdofs. The flag skip_zeros skips the zero elements of the matrix, unless they are breaking the symmetry of the system matrix.

Definition at line 355 of file bilinearform.cpp.

void mfem::BilinearForm::AssembleDiagonal ( Vector diag) const

Assemble the diagonal of the bilinear form into diag.

For adaptively refined meshes, this returns P^T d_e, where d_e is the locally assembled diagonal on each element and P^T is the transpose of the conforming prolongation. In general this is not the correct diagonal for an AMR mesh.

Definition at line 614 of file bilinearform.cpp.

void mfem::BilinearForm::AssembleElementMatrix ( int  i,
const DenseMatrix elmat,
int  skip_zeros = 1 
)

Assemble the given element matrix.

The element matrix elmat is assembled for the element i, i.e. added to the system matrix. The flag skip_zeros skips the zero elements of the matrix, unless they are breaking the symmetry of the system matrix.

Definition at line 321 of file bilinearform.cpp.

void mfem::BilinearForm::AssembleElementMatrix ( int  i,
const DenseMatrix elmat,
Array< int > &  vdofs,
int  skip_zeros = 1 
)

Assemble the given element matrix.

The element matrix elmat is assembled for the element i, i.e. added to the system matrix. The vdofs of the element are returned in vdofs. The flag skip_zeros skips the zero elements of the matrix, unless they are breaking the symmetry of the system matrix.

Definition at line 327 of file bilinearform.cpp.

void mfem::BilinearForm::ComputeBdrElementMatrix ( int  i,
DenseMatrix elmat 
)

Compute the boundary element matrix of the given boundary element.

Definition at line 300 of file bilinearform.cpp.

void mfem::BilinearForm::ComputeElementMatrices ( )

Compute and store internally all element matrices.

Definition at line 809 of file bilinearform.cpp.

void mfem::BilinearForm::ComputeElementMatrix ( int  i,
DenseMatrix elmat 
)

Compute the element matrix of the given element.

The element matrix is computed by calling the domain integrators or the one stored internally by a prior call of ComputeElementMatrices() is returned when available.

Definition at line 272 of file bilinearform.cpp.

void mfem::BilinearForm::ConformingAssemble ( )
protected

Definition at line 579 of file bilinearform.cpp.

double & mfem::BilinearForm::Elem ( int  i,
int  j 
)
virtual

Returns reference to a_{ij}.

Implements mfem::Matrix.

Definition at line 210 of file bilinearform.cpp.

const double & mfem::BilinearForm::Elem ( int  i,
int  j 
) const
virtual

Returns constant reference to a_{ij}.

Implements mfem::Matrix.

Definition at line 215 of file bilinearform.cpp.

void mfem::BilinearForm::EliminateEssentialBC ( const Array< int > &  bdr_attr_is_ess,
const Vector sol,
Vector rhs,
DiagonalPolicy  dpolicy = DIAG_ONE 
)

Eliminate essential boundary DOFs from the system.

The array bdr_attr_is_ess marks boundary attributes that constitute the essential part of the boundary. By default, the diagonal at the essential DOFs is set to 1.0. This behavior is controlled by the argument dpolicy.

Definition at line 851 of file bilinearform.cpp.

void mfem::BilinearForm::EliminateEssentialBC ( const Array< int > &  bdr_attr_is_ess,
DiagonalPolicy  dpolicy = DIAG_ONE 
)

Eliminate essential boundary DOFs from the system matrix.

Definition at line 869 of file bilinearform.cpp.

void mfem::BilinearForm::EliminateEssentialBCDiag ( const Array< int > &  bdr_attr_is_ess,
double  value 
)

Perform elimination and set the diagonal entry to the given value.

Definition at line 886 of file bilinearform.cpp.

void mfem::BilinearForm::EliminateEssentialBCFromDofs ( const Array< int > &  ess_dofs,
const Vector sol,
Vector rhs,
DiagonalPolicy  dpolicy = DIAG_ONE 
)

Similar to EliminateVDofs(const Array<int> &, const Vector &, Vector &, DiagonalPolicy) but here ess_dofs is a marker (boolean) array on all vector-dofs (ess_dofs[i] < 0 is true).

Definition at line 943 of file bilinearform.cpp.

void mfem::BilinearForm::EliminateEssentialBCFromDofs ( const Array< int > &  ess_dofs,
DiagonalPolicy  dpolicy = DIAG_ONE 
)

Similar to EliminateVDofs(const Array<int> &, DiagonalPolicy) but here ess_dofs is a marker (boolean) array on all vector-dofs (ess_dofs[i] < 0 is true).

Definition at line 958 of file bilinearform.cpp.

void mfem::BilinearForm::EliminateEssentialBCFromDofsDiag ( const Array< int > &  ess_dofs,
double  value 
)

Perform elimination and set the diagonal entry to the given value.

Definition at line 970 of file bilinearform.cpp.

void mfem::BilinearForm::EliminateVDofs ( const Array< int > &  vdofs,
const Vector sol,
Vector rhs,
DiagonalPolicy  dpolicy = DIAG_ONE 
)

Eliminate the given vdofs. NOTE: here, vdofs is a list of DOFs.

Definition at line 903 of file bilinearform.cpp.

void mfem::BilinearForm::EliminateVDofs ( const Array< int > &  vdofs,
DiagonalPolicy  dpolicy = DIAG_ONE 
)

Eliminate the given vdofs, storing the eliminated part internally.

This method works in conjunction with EliminateVDofsInRHS() and allows elimination of boundary conditions in multiple right-hand sides. In this method, vdofs is a list of DOFs.

Definition at line 921 of file bilinearform.cpp.

void mfem::BilinearForm::EliminateVDofsInRHS ( const Array< int > &  vdofs,
const Vector x,
Vector b 
)

Use the stored eliminated part of the matrix (see EliminateVDofs(const Array<int> &, DiagonalPolicy)) to modify the r.h.s. b; vdofs is a list of DOFs (non-directional, i.e. >= 0).

Definition at line 982 of file bilinearform.cpp.

void mfem::BilinearForm::EnableHybridization ( FiniteElementSpace constr_space,
BilinearFormIntegrator constr_integ,
const Array< int > &  ess_tdof_list 
)

Enable hybridization; for details see the description for class Hybridization in fem/hybridization.hpp. This method should be called before assembly.

Definition at line 167 of file bilinearform.cpp.

void mfem::BilinearForm::EnableStaticCondensation ( )

Enable the use of static condensation. For details see the description for class StaticCondensation in fem/staticcond.hpp This method should be called before assembly. If the number of unknowns after static condensation is not reduced, it is not enabled.

Definition at line 144 of file bilinearform.cpp.

FiniteElementSpace* mfem::BilinearForm::FESpace ( )
inline

Return the FE space associated with the BilinearForm.

Definition at line 536 of file bilinearform.hpp.

const FiniteElementSpace* mfem::BilinearForm::FESpace ( ) const
inline

Read-only access to the associated FiniteElementSpace.

Definition at line 538 of file bilinearform.hpp.

void mfem::BilinearForm::Finalize ( int  skip_zeros = 1)
virtual

Finalizes the matrix initialization.

Reimplemented from mfem::Matrix.

Definition at line 225 of file bilinearform.cpp.

void mfem::BilinearForm::FormLinearSystem ( const Array< int > &  ess_tdof_list,
Vector x,
Vector b,
OperatorHandle A,
Vector X,
Vector B,
int  copy_interior = 0 
)
virtual

Form the linear system A X = B, corresponding to this bilinear form and the linear form b(.).

This method applies any necessary transformations to the linear system such as: eliminating boundary conditions; applying conforming constraints for non-conforming AMR; parallel assembly; static condensation; hybridization.

The GridFunction-size vector x must contain the essential b.c. The BilinearForm and the LinearForm-size vector b must be assembled.

The vector X is initialized with a suitable initial guess: when using hybridization, the vector X is set to zero; otherwise, the essential entries of X are set to the corresponding b.c. and all other entries are set to zero (copy_interior == 0) or copied from x (copy_interior != 0).

This method can be called multiple times (with the same ess_tdof_list array) to initialize different right-hand sides and boundary condition values.

After solving the linear system, the finite element solution x can be recovered by calling RecoverFEMSolution() (with the same vectors X, b, and x).

NOTE: If there are no transformations, X simply reuses the data of x.

Reimplemented in mfem::ParBilinearForm.

Definition at line 639 of file bilinearform.cpp.

template<typename OpType >
void mfem::BilinearForm::FormLinearSystem ( const Array< int > &  ess_tdof_list,
Vector x,
Vector b,
OpType &  A,
Vector X,
Vector B,
int  copy_interior = 0 
)
inline

Form the linear system A X = B, corresponding to this bilinear form and the linear form b(.).

Version of the method FormLinearSystem() where the system matrix is returned in the variable A, of type OpType, holding a reference to the system matrix (created with the method OpType::MakeRef()). The reference will be invalidated when SetOperatorType(), Update(), or the destructor is called.

Currently, this method can be used only with AssemblyLevel::FULL.

Definition at line 384 of file bilinearform.hpp.

void mfem::BilinearForm::FormSystemMatrix ( const Array< int > &  ess_tdof_list,
OperatorHandle A 
)
virtual

Form the linear system matrix A, see FormLinearSystem() for details.

Reimplemented in mfem::ParBilinearForm.

Definition at line 708 of file bilinearform.cpp.

template<typename OpType >
void mfem::BilinearForm::FormSystemMatrix ( const Array< int > &  ess_tdof_list,
OpType &  A 
)
inline

Form the linear system matrix A, see FormLinearSystem() for details.

Version of the method FormSystemMatrix() where the system matrix is returned in the variable A, of type OpType, holding a reference to the system matrix (created with the method OpType::MakeRef()). The reference will be invalidated when SetOperatorType(), Update(), or the destructor is called.

Currently, this method can be used only with AssemblyLevel::FULL.

Definition at line 408 of file bilinearform.hpp.

void mfem::BilinearForm::FreeElementMatrices ( )
inline

Free the memory used by the element matrices.

Definition at line 428 of file bilinearform.hpp.

void mfem::BilinearForm::FullAddMult ( const Vector x,
Vector y 
) const
inline

Definition at line 239 of file bilinearform.hpp.

void mfem::BilinearForm::FullAddMultTranspose ( const Vector x,
Vector y 
) const
inline

Definition at line 246 of file bilinearform.hpp.

double mfem::BilinearForm::FullInnerProduct ( const Vector x,
const Vector y 
) const
inline

Definition at line 526 of file bilinearform.hpp.

void mfem::BilinearForm::FullMult ( const Vector x,
Vector y 
) const
inline

Definition at line 233 of file bilinearform.hpp.

AssemblyLevel mfem::BilinearForm::GetAssemblyLevel ( )
inline

Get the assembly level.

Definition at line 155 of file bilinearform.hpp.

Array<BilinearFormIntegrator*>* mfem::BilinearForm::GetBBFI ( )
inline

Access all integrators added with AddBoundaryIntegrator().

Definition at line 206 of file bilinearform.hpp.

Array<Array<int>*>* mfem::BilinearForm::GetBBFI_Marker ( )
inline

Access all boundary markers added with AddBoundaryIntegrator(). If no marker was specified when the integrator was added, the corresponding pointer (to Array<int>) will be NULL.

Definition at line 210 of file bilinearform.hpp.

Array<BilinearFormIntegrator*>* mfem::BilinearForm::GetBFBFI ( )
inline

Access all integrators added with AddBdrFaceIntegrator().

Definition at line 216 of file bilinearform.hpp.

Array<Array<int>*>* mfem::BilinearForm::GetBFBFI_Marker ( )
inline

Access all boundary markers added with AddBdrFaceIntegrator(). If no marker was specified when the integrator was added, the corresponding pointer (to Array<int>) will be NULL.

Definition at line 220 of file bilinearform.hpp.

Array<BilinearFormIntegrator*>* mfem::BilinearForm::GetDBFI ( )
inline

Access all integrators added with AddDomainIntegrator().

Definition at line 203 of file bilinearform.hpp.

Array<BilinearFormIntegrator*>* mfem::BilinearForm::GetFBFI ( )
inline

Access all integrators added with AddInteriorFaceIntegrator().

Definition at line 213 of file bilinearform.hpp.

FiniteElementSpace* mfem::BilinearForm::GetFES ( )
inline

(DEPRECATED) Return the FE space associated with the BilinearForm.

Deprecated:
Use FESpace() instead.

Definition at line 533 of file bilinearform.hpp.

virtual const Operator* mfem::BilinearForm::GetOutputProlongation ( ) const
inlinevirtual

Get the output finite element space prolongation matrix.

Reimplemented from mfem::Operator.

Definition at line 338 of file bilinearform.hpp.

virtual const Operator* mfem::BilinearForm::GetOutputRestriction ( ) const
inlinevirtual

Get the output finite element space restriction matrix.

Reimplemented from mfem::Operator.

Definition at line 341 of file bilinearform.hpp.

virtual const Operator* mfem::BilinearForm::GetProlongation ( ) const
inlinevirtual

Get the finite element space prolongation matrix.

Reimplemented from mfem::Operator.

Reimplemented in mfem::ParBilinearForm.

Definition at line 332 of file bilinearform.hpp.

virtual const Operator* mfem::BilinearForm::GetRestriction ( ) const
inlinevirtual

Get the finite element space restriction matrix.

Reimplemented from mfem::Operator.

Reimplemented in mfem::ParBilinearForm.

Definition at line 335 of file bilinearform.hpp.

double mfem::BilinearForm::InnerProduct ( const Vector x,
const Vector y 
) const
inline

Definition at line 252 of file bilinearform.hpp.

MatrixInverse * mfem::BilinearForm::Inverse ( ) const
virtual

Returns a pointer to (approximation) of the matrix inverse.

Implements mfem::Matrix.

Definition at line 220 of file bilinearform.cpp.

SparseMatrix* mfem::BilinearForm::LoseMat ( )
inline

Definition at line 272 of file bilinearform.hpp.

void mfem::BilinearForm::Mult ( const Vector x,
Vector y 
) const
virtual

Matrix vector multiplication.

Implements mfem::Operator.

Definition at line 989 of file bilinearform.cpp.

virtual void mfem::BilinearForm::MultTranspose ( const Vector x,
Vector y 
) const
inlinevirtual

Action of the transpose operator: y=A^t(x). The default behavior in class Operator is to generate an error.

Reimplemented from mfem::Operator.

Definition at line 249 of file bilinearform.hpp.

const double& mfem::BilinearForm::operator() ( int  i,
int  j 
)
inline

Definition at line 222 of file bilinearform.hpp.

void mfem::BilinearForm::operator= ( const double  a)
inline

Definition at line 314 of file bilinearform.hpp.

void mfem::BilinearForm::RecoverFEMSolution ( const Vector X,
const Vector b,
Vector x 
)
virtual

Recover the solution of a linear system formed with FormLinearSystem().

Call this method after solving a linear system constructed using the FormLinearSystem() method to recover the solution as a GridFunction-size vector in x. Use the same arguments as in the FormLinearSystem() call.

Reimplemented from mfem::Operator.

Reimplemented in mfem::ParBilinearForm.

Definition at line 751 of file bilinearform.cpp.

FiniteElementSpace* mfem::BilinearForm::SCFESpace ( ) const
inline

Return the trace FE space associated with static condensation.

Definition at line 168 of file bilinearform.hpp.

void mfem::BilinearForm::SetAssemblyLevel ( AssemblyLevel  assembly_level)

Set the desired assembly level. The default is AssemblyLevel::FULL.

This method must be called before assembly.

Definition at line 115 of file bilinearform.cpp.

void mfem::BilinearForm::SetDiagonalPolicy ( DiagonalPolicy  policy)

Sets diagonal policy used upon construction of the linear system.

Definition at line 1043 of file bilinearform.cpp.

int mfem::BilinearForm::Size ( ) const
inline

Get the size of the BilinearForm as a square matrix.

Definition at line 148 of file bilinearform.hpp.

const SparseMatrix& mfem::BilinearForm::SpMat ( ) const
inline

Returns a reference to the sparse matrix.

Definition at line 262 of file bilinearform.hpp.

SparseMatrix& mfem::BilinearForm::SpMat ( )
inline

Definition at line 267 of file bilinearform.hpp.

const SparseMatrix& mfem::BilinearForm::SpMatElim ( ) const
inline

Returns a reference to the sparse matrix of eliminated b.c.

Definition at line 275 of file bilinearform.hpp.

SparseMatrix& mfem::BilinearForm::SpMatElim ( )
inline

Definition at line 280 of file bilinearform.hpp.

bool mfem::BilinearForm::StaticCondensationIsEnabled ( ) const
inline

Check if static condensation was actually enabled by a previous call to EnableStaticCondensation().

Definition at line 165 of file bilinearform.hpp.

void mfem::BilinearForm::Update ( FiniteElementSpace nfes = NULL)
virtual

Reimplemented in mfem::ParBilinearForm.

Definition at line 1001 of file bilinearform.cpp.

void mfem::BilinearForm::UseExternalIntegrators ( )
inline

Indicate that integrators are not owned by the BilinearForm.

Definition at line 544 of file bilinearform.hpp.

void mfem::BilinearForm::UsePrecomputedSparsity ( int  ps = 1)
inline

For scalar FE spaces, precompute the sparsity pattern of the matrix (assuming dense element matrices) based on the types of integrators present in the bilinear form.

Definition at line 181 of file bilinearform.hpp.

void mfem::BilinearForm::UseSparsity ( int *  I,
int *  J,
bool  isSorted 
)

Use the given CSR sparsity pattern to allocate the internal SparseMatrix.

  • The I and J arrays must define a square graph with size equal to GetVSize() of the associated FiniteElementSpace.
  • This method should be called after enabling static condensation or hybridization, if used.
  • In the case of static condensation, I and J are not used.
  • The ownership of the arrays I and J remains with the caller.

Definition at line 184 of file bilinearform.cpp.

void mfem::BilinearForm::UseSparsity ( SparseMatrix A)

Use the sparsity of A to allocate the internal SparseMatrix.

Definition at line 200 of file bilinearform.cpp.

Member Data Documentation

AssemblyLevel mfem::BilinearForm::assembly
protected

The assembly level of the form (full, partial, etc.)

Definition at line 62 of file bilinearform.hpp.

int mfem::BilinearForm::batch
protected

Element batch size used in the form action (1, 8, num_elems, etc.)

Definition at line 64 of file bilinearform.hpp.

Array<BilinearFormIntegrator*> mfem::BilinearForm::bbfi
protected

Set of Boundary Integrators to be applied.

Definition at line 81 of file bilinearform.hpp.

Array<Array<int>*> mfem::BilinearForm::bbfi_marker
protected

Entries are not owned.

Definition at line 82 of file bilinearform.hpp.

Array<BilinearFormIntegrator*> mfem::BilinearForm::bfbfi
protected

Set of boundary face Integrators to be applied.

Definition at line 88 of file bilinearform.hpp.

Array<Array<int>*> mfem::BilinearForm::bfbfi_marker
protected

Entries are not owned.

Definition at line 89 of file bilinearform.hpp.

Array<BilinearFormIntegrator*> mfem::BilinearForm::dbfi
protected

Set of Domain Integrators to be applied.

Definition at line 78 of file bilinearform.hpp.

DiagonalPolicy mfem::BilinearForm::diag_policy
protected

This data member allows one to specify what should be done to the diagonal matrix entries and corresponding RHS values upon elimination of the constrained DoFs.

Definition at line 102 of file bilinearform.hpp.

DenseTensor* mfem::BilinearForm::element_matrices
protected

Owned.

Definition at line 94 of file bilinearform.hpp.

DenseMatrix mfem::BilinearForm::elemmat
protected

Definition at line 91 of file bilinearform.hpp.

BilinearFormExtension* mfem::BilinearForm::ext
protected

Extension for supporting Full Assembly (FA), Element Assembly (EA), Partial Assembly (PA), or Matrix Free assembly (MF).

Definition at line 67 of file bilinearform.hpp.

int mfem::BilinearForm::extern_bfs
protected

Indicates the BilinearFormIntegrators stored in dbfi, bbfi, fbfi, and bfbfi are owned by another BilinearForm.

Definition at line 75 of file bilinearform.hpp.

Array<BilinearFormIntegrator*> mfem::BilinearForm::fbfi
protected

Set of interior face Integrators to be applied.

Definition at line 85 of file bilinearform.hpp.

FiniteElementSpace* mfem::BilinearForm::fes
protected

FE space on which the form lives. Not owned.

Definition at line 59 of file bilinearform.hpp.

Hybridization* mfem::BilinearForm::hybridization
protected

Owned.

Definition at line 97 of file bilinearform.hpp.

SparseMatrix* mfem::BilinearForm::mat
protected

Sparse matrix to be associated with the form. Owned.

Definition at line 53 of file bilinearform.hpp.

SparseMatrix* mfem::BilinearForm::mat_e
protected

Matrix used to eliminate b.c. Owned.

Definition at line 56 of file bilinearform.hpp.

int mfem::BilinearForm::precompute_sparsity
protected

Definition at line 104 of file bilinearform.hpp.

long mfem::BilinearForm::sequence
protected

Indicates the Mesh::sequence corresponding to the current state of the BilinearForm.

Definition at line 71 of file bilinearform.hpp.

StaticCondensation* mfem::BilinearForm::static_cond
protected

Owned.

Definition at line 96 of file bilinearform.hpp.

Array<int> mfem::BilinearForm::vdofs
protected

Definition at line 92 of file bilinearform.hpp.


The documentation for this class was generated from the following files: