MFEM v2.0
|
#include <bilinearform.hpp>
Public Member Functions | |
BilinearForm (FiniteElementSpace *f) | |
Creates bilinear form associated with FE space *f. | |
BilinearForm (FiniteElementSpace *f, BilinearForm *bf) | |
Array< BilinearFormIntegrator * > * | GetDBFI () |
Array< BilinearFormIntegrator * > * | GetBBFI () |
Array< BilinearFormIntegrator * > * | GetFBFI () |
Array< BilinearFormIntegrator * > * | GetBFBFI () |
const double & | operator() (int i, int j) |
virtual double & | Elem (int i, int j) |
Returns reference to a_{ij}. Index i, j = 0 .. size-1. | |
virtual const double & | Elem (int i, int j) const |
Returns constant reference to a_{ij}. Index i, j = 0 .. size-1. | |
virtual void | Mult (const Vector &x, Vector &y) const |
Matrix vector multiplication. | |
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 |
double | InnerProduct (const Vector &x, const Vector &y) const |
virtual MatrixInverse * | Inverse () const |
Returns a pointer to (approximation) of the matrix inverse. | |
virtual void | Finalize (int skip_zeros=1) |
Finalizes the matrix initialization. | |
const SparseMatrix & | SpMat () const |
Returns a reference to the sparse martix. | |
SparseMatrix & | SpMat () |
void | AddDomainIntegrator (BilinearFormIntegrator *bfi) |
Adds new Domain Integrator. | |
void | AddBoundaryIntegrator (BilinearFormIntegrator *bfi) |
Adds new Boundary Integrator. | |
void | AddInteriorFaceIntegrator (BilinearFormIntegrator *bfi) |
Adds new interior Face Integrator. | |
void | AddBdrFaceIntegrator (BilinearFormIntegrator *bfi) |
Adds new boundary Face Integrator. | |
void | operator= (const double a) |
void | Assemble (int skip_zeros=1) |
Assembles the form i.e. sums over all domain/bdr integrators. | |
void | ComputeElementMatrices () |
Compute and store internally all element matrices. | |
void | FreeElementMatrices () |
Free the memory used by the element matrices. | |
void | ComputeElementMatrix (int i, DenseMatrix &elmat) |
void | AssembleElementMatrix (int i, const DenseMatrix &elmat, Array< int > &vdofs, int skip_zeros=1) |
void | EliminateEssentialBC (Array< int > &bdr_attr_is_ess, Vector &sol, Vector &rhs, int d=0) |
void | EliminateVDofs (Array< int > &vdofs, Vector &sol, Vector &rhs, int d=0) |
Here, vdofs is a list of DOFs. | |
void | EliminateVDofs (Array< int > &vdofs, int d=0) |
void | EliminateVDofsInRHS (Array< int > &vdofs, const Vector &x, Vector &b) |
double | FullInnerProduct (const Vector &x, const Vector &y) const |
void | EliminateEssentialBC (Array< int > &bdr_attr_is_ess, int d=0) |
void | EliminateEssentialBCFromDofs (Array< int > &ess_dofs, Vector &sol, Vector &rhs, int d=0) |
void | EliminateEssentialBCFromDofs (Array< int > &ess_dofs, int d=0) |
void | Update (FiniteElementSpace *nfes=NULL) |
FiniteElementSpace * | GetFES () |
virtual | ~BilinearForm () |
Destroys bilinear form. | |
Protected Member Functions | |
BilinearForm () | |
Protected Attributes | |
SparseMatrix * | mat |
Sparse matrix to be associated with the form. | |
SparseMatrix * | mat_e |
FiniteElementSpace * | fes |
FE space on which the form lives. | |
int | extern_bfs |
Array< BilinearFormIntegrator * > | dbfi |
Set of Domain Integrators to be applied. | |
Array< BilinearFormIntegrator * > | bbfi |
Set of Boundary Integrators to be applied. | |
Array< BilinearFormIntegrator * > | fbfi |
Set of interior face Integrators to be applied. | |
Array< BilinearFormIntegrator * > | bfbfi |
Set of boundary face Integrators to be applied. | |
DenseMatrix | elemmat |
Array< int > | vdofs |
DenseTensor * | element_matrices |
Class for bilinear form - "Matrix" with asociated FE space and BLFIntegrators.
Definition at line 18 of file bilinearform.hpp.
BilinearForm::BilinearForm | ( | ) | [inline, protected] |
Definition at line 50 of file bilinearform.hpp.
References element_matrices, extern_bfs, fes, mat, and mat_e.
BilinearForm::BilinearForm | ( | FiniteElementSpace * | f | ) |
Creates bilinear form associated with FE space *f.
Definition at line 17 of file bilinearform.cpp.
References element_matrices, extern_bfs, fes, mat, and mat_e.
BilinearForm::BilinearForm | ( | FiniteElementSpace * | f, |
BilinearForm * | bf | ||
) |
Definition at line 26 of file bilinearform.cpp.
References bbfi, bfbfi, dbfi, element_matrices, extern_bfs, fbfi, fes, GetBBFI(), GetBFBFI(), GetDBFI(), GetFBFI(), mat, mat_e, Array< T >::SetSize(), Array< T >::Size(), and Operator::size.
BilinearForm::~BilinearForm | ( | ) | [virtual] |
Destroys bilinear form.
Definition at line 390 of file bilinearform.cpp.
References bbfi, bfbfi, dbfi, element_matrices, extern_bfs, fbfi, mat, mat_e, and Array< T >::Size().
void BilinearForm::AddBdrFaceIntegrator | ( | BilinearFormIntegrator * | bfi | ) |
Adds new boundary Face Integrator.
Definition at line 101 of file bilinearform.cpp.
References Array< T >::Append(), and bfbfi.
void BilinearForm::AddBoundaryIntegrator | ( | BilinearFormIntegrator * | bfi | ) |
Adds new Boundary Integrator.
Definition at line 91 of file bilinearform.cpp.
References Array< T >::Append(), and bbfi.
void BilinearForm::AddDomainIntegrator | ( | BilinearFormIntegrator * | bfi | ) |
Adds new Domain Integrator.
Definition at line 86 of file bilinearform.cpp.
References Array< T >::Append(), and dbfi.
Referenced by main().
void BilinearForm::AddInteriorFaceIntegrator | ( | BilinearFormIntegrator * | bfi | ) |
Adds new interior Face Integrator.
Definition at line 96 of file bilinearform.cpp.
References Array< T >::Append(), and fbfi.
virtual void BilinearForm::AddMult | ( | const Vector & | x, |
Vector & | y, | ||
const double | a = 1.0 |
||
) | const [inline, virtual] |
Definition at line 81 of file bilinearform.hpp.
References AddMult(), and mat.
Referenced by AddMult().
void BilinearForm::Assemble | ( | int | skip_zeros = 1 | ) |
Assembles the form i.e. sums over all domain/bdr integrators.
Definition at line 145 of file bilinearform.cpp.
References SparseMatrix::AddSubMatrix(), Array< T >::Append(), AssembleElementMatrix(), bbfi, bfbfi, ComputeElementMatrices(), dbfi, element_matrices, elemmat, fbfi, fes, FreeElementMatrices(), FiniteElementSpace::GetBE(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), mat, Array< T >::Size(), Operator::size, and vdofs.
Referenced by main().
void BilinearForm::AssembleElementMatrix | ( | int | i, |
const DenseMatrix & | elmat, | ||
Array< int > & | vdofs, | ||
int | skip_zeros = 1 |
||
) |
Definition at line 136 of file bilinearform.cpp.
References SparseMatrix::AddSubMatrix(), fes, FiniteElementSpace::GetElementVDofs(), mat, and Operator::size.
Referenced by Assemble().
void BilinearForm::ComputeElementMatrices | ( | ) |
Compute and store internally all element matrices.
Definition at line 253 of file bilinearform.cpp.
References DenseMatrix::ClearExternalData(), dbfi, element_matrices, fes, DenseTensor::GetData(), FiniteElement::GetDof(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetFE(), FiniteElementSpace::GetNE(), FiniteElementSpace::GetVDim(), mfem_error(), and Array< T >::Size().
Referenced by Assemble().
void BilinearForm::ComputeElementMatrix | ( | int | i, |
DenseMatrix & | elmat | ||
) |
Definition at line 106 of file bilinearform.cpp.
References dbfi, element_matrices, elemmat, fes, DenseTensor::GetData(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), DenseMatrix::SetSize(), Array< T >::Size(), DenseTensor::SizeI(), DenseTensor::SizeJ(), and vdofs.
double & BilinearForm::Elem | ( | int | i, |
int | j | ||
) | [virtual] |
Returns reference to a_{ij}. Index i, j = 0 .. size-1.
Implements Matrix.
Definition at line 59 of file bilinearform.cpp.
References mat.
Referenced by Elem().
const double & BilinearForm::Elem | ( | int | i, |
int | j | ||
) | const [virtual] |
Returns constant reference to a_{ij}. Index i, j = 0 .. size-1.
Implements Matrix.
Definition at line 64 of file bilinearform.cpp.
void BilinearForm::EliminateEssentialBC | ( | Array< int > & | bdr_attr_is_ess, |
int | d = 0 |
||
) |
Definition at line 345 of file bilinearform.cpp.
References fes, mat, Array< T >::Size(), and vdofs.
void BilinearForm::EliminateEssentialBC | ( | Array< int > & | bdr_attr_is_ess, |
Vector & | sol, | ||
Vector & | rhs, | ||
int | d = 0 |
||
) |
If d == 0 the diagonal at the ess. b.c. is set to 1.0, otherwise leave it the same.
Definition at line 293 of file bilinearform.cpp.
References fes, mat, Array< T >::Size(), and vdofs.
Referenced by main().
void BilinearForm::EliminateEssentialBCFromDofs | ( | Array< int > & | ess_dofs, |
Vector & | sol, | ||
Vector & | rhs, | ||
int | d = 0 |
||
) |
Similar to EliminateVDofs but here ess_dofs is a marker (boolean) array on all vdofs (ess_dofs[i] < 0 is true).
Definition at line 362 of file bilinearform.cpp.
References mat, and Array< T >::Size().
Referenced by main().
void BilinearForm::EliminateEssentialBCFromDofs | ( | Array< int > & | ess_dofs, |
int | d = 0 |
||
) |
Similar to EliminateVDofs but here ess_dofs is a marker (boolean) array on all vdofs (ess_dofs[i] < 0 is true).
Definition at line 370 of file bilinearform.cpp.
References mat, and Array< T >::Size().
Here, vdofs is a list of DOFs.
Definition at line 310 of file bilinearform.cpp.
References mat, and Array< T >::Size().
void BilinearForm::EliminateVDofs | ( | Array< int > & | vdofs, |
int | d = 0 |
||
) |
Eliminate the given vdofs storing the eliminated part internally; vdofs is a list of DOFs.
Definition at line 323 of file bilinearform.cpp.
References mat, mat_e, Array< T >::Size(), and Operator::size.
Use the stored eliminated part of the matrix to modify r.h.s.; vdofs is a list of DOFs (non-directional, i.e. >= 0).
Definition at line 338 of file bilinearform.cpp.
References SparseMatrix::AddMult(), mat, mat_e, and SparseMatrix::PartMult().
void BilinearForm::Finalize | ( | int | skip_zeros = 1 | ) | [virtual] |
void BilinearForm::FreeElementMatrices | ( | ) | [inline] |
Free the memory used by the element matrices.
Definition at line 122 of file bilinearform.hpp.
References element_matrices.
Referenced by Assemble(), and Update().
Definition at line 84 of file bilinearform.hpp.
References SparseMatrix::AddMult(), mat, and mat_e.
Definition at line 145 of file bilinearform.hpp.
References SparseMatrix::InnerProduct(), mat, and mat_e.
Definition at line 78 of file bilinearform.hpp.
References SparseMatrix::AddMult(), mat, mat_e, and SparseMatrix::Mult().
Array<BilinearFormIntegrator*>* BilinearForm::GetBBFI | ( | ) | [inline] |
Array<BilinearFormIntegrator*>* BilinearForm::GetBFBFI | ( | ) | [inline] |
Array<BilinearFormIntegrator*>* BilinearForm::GetDBFI | ( | ) | [inline] |
Array<BilinearFormIntegrator*>* BilinearForm::GetFBFI | ( | ) | [inline] |
FiniteElementSpace* BilinearForm::GetFES | ( | ) | [inline] |
Definition at line 161 of file bilinearform.hpp.
References fes.
Definition at line 87 of file bilinearform.hpp.
References SparseMatrix::InnerProduct(), and mat.
MatrixInverse * BilinearForm::Inverse | ( | ) | const [virtual] |
Returns a pointer to (approximation) of the matrix inverse.
Implements Matrix.
Definition at line 74 of file bilinearform.cpp.
References mat.
Matrix vector multiplication.
Implements Operator.
Definition at line 69 of file bilinearform.cpp.
References mat.
const double& BilinearForm::operator() | ( | int | i, |
int | j | ||
) | [inline] |
Definition at line 67 of file bilinearform.hpp.
References mat.
void BilinearForm::operator= | ( | const double | a | ) | [inline] |
Definition at line 112 of file bilinearform.hpp.
SparseMatrix& BilinearForm::SpMat | ( | ) | [inline] |
Definition at line 98 of file bilinearform.hpp.
References mat.
const SparseMatrix& BilinearForm::SpMat | ( | ) | const [inline] |
Returns a reference to the sparse martix.
Definition at line 97 of file bilinearform.hpp.
References mat.
Referenced by main().
void BilinearForm::Update | ( | FiniteElementSpace * | nfes = NULL | ) |
Definition at line 377 of file bilinearform.cpp.
References fes, FreeElementMatrices(), FiniteElementSpace::GetVSize(), mat, mat_e, and Operator::size.
Array<BilinearFormIntegrator*> BilinearForm::bbfi [protected] |
Set of Boundary Integrators to be applied.
Definition at line 36 of file bilinearform.hpp.
Referenced by AddBoundaryIntegrator(), Assemble(), BilinearForm(), GetBBFI(), and ~BilinearForm().
Array<BilinearFormIntegrator*> BilinearForm::bfbfi [protected] |
Set of boundary face Integrators to be applied.
Definition at line 42 of file bilinearform.hpp.
Referenced by AddBdrFaceIntegrator(), Assemble(), BilinearForm(), GetBFBFI(), and ~BilinearForm().
Array<BilinearFormIntegrator*> BilinearForm::dbfi [protected] |
Set of Domain Integrators to be applied.
Definition at line 33 of file bilinearform.hpp.
Referenced by AddDomainIntegrator(), Assemble(), BilinearForm(), ComputeElementMatrices(), ComputeElementMatrix(), GetDBFI(), and ~BilinearForm().
DenseTensor* BilinearForm::element_matrices [protected] |
Definition at line 47 of file bilinearform.hpp.
Referenced by Assemble(), BilinearForm(), ComputeElementMatrices(), ComputeElementMatrix(), FreeElementMatrices(), and ~BilinearForm().
DenseMatrix BilinearForm::elemmat [protected] |
Definition at line 44 of file bilinearform.hpp.
Referenced by Assemble(), and ComputeElementMatrix().
int BilinearForm::extern_bfs [protected] |
Definition at line 30 of file bilinearform.hpp.
Referenced by BilinearForm(), and ~BilinearForm().
Array<BilinearFormIntegrator*> BilinearForm::fbfi [protected] |
Set of interior face Integrators to be applied.
Definition at line 39 of file bilinearform.hpp.
Referenced by AddInteriorFaceIntegrator(), Assemble(), BilinearForm(), GetFBFI(), and ~BilinearForm().
FiniteElementSpace* BilinearForm::fes [protected] |
FE space on which the form lives.
Definition at line 28 of file bilinearform.hpp.
Referenced by Assemble(), AssembleElementMatrix(), BilinearForm(), ComputeElementMatrices(), ComputeElementMatrix(), EliminateEssentialBC(), GetFES(), and Update().
SparseMatrix* BilinearForm::mat [protected] |
Sparse matrix to be associated with the form.
Definition at line 22 of file bilinearform.hpp.
Referenced by AddMult(), Assemble(), AssembleElementMatrix(), BilinearForm(), Elem(), EliminateEssentialBC(), EliminateEssentialBCFromDofs(), EliminateVDofs(), EliminateVDofsInRHS(), Finalize(), FullAddMult(), FullInnerProduct(), FullMult(), InnerProduct(), Inverse(), Mult(), operator()(), operator=(), ParBilinearForm::ParallelAssemble(), SpMat(), Update(), and ~BilinearForm().
SparseMatrix* BilinearForm::mat_e [protected] |
Definition at line 25 of file bilinearform.hpp.
Referenced by BilinearForm(), EliminateVDofs(), EliminateVDofsInRHS(), Finalize(), FullAddMult(), FullInnerProduct(), FullMult(), operator=(), ParBilinearForm::ParallelAssembleElim(), Update(), and ~BilinearForm().
Array<int> BilinearForm::vdofs [protected] |
Definition at line 45 of file bilinearform.hpp.
Referenced by Assemble(), ComputeElementMatrix(), and EliminateEssentialBC().