Element matrix assembling for BDB integrators:

Many bilinear-forms are of the structure

where is some differential operator, i.e., the gradient, and is the material tensor. Then, the finite elemen matrix is computed as

The elements of the matrix are the values of the differential operator applied to the shape functions in the integration point, i.e., .

The BDBIntegrator is a derived class from BilinearFormIntegrator. Here, the differential operator and the material tensor are defined by template arguments.

  template <class DIFFOP, class DMATOP>
  void BDBIntegrator<DIFFOP,DMATOP> :: 
  AssembleElementMatrix (const FiniteElement & fel, 
			 const ElementTransformation & eltrans, 
			 Matrix & elmat,
			 LocalHeap & locheap) const
  {
    enum { DIM_SPACE   = DIFFOP::DIM_SPACE };
    enum { DIM_ELEMENT = DIFFOP::DIM_ELEMENT };
    enum { DIM_DMAT    = DIFFOP::DIM_DMAT };
    enum { DIM         = DIFFOP::DIM };

    int ndof = fel.GetNDof();
   
    elmat.AssignMemory (ndof*DIM, ndof*DIM, locheap);
    elmat = 0;
	
    MatrixFixHeight<DIM_DMAT> bmat (ndof * DIM, locheap);
    MatrixFixHeight<DIM_DMAT> dbmat (ndof * DIM, locheap);
    Mat<DIM_DMAT,DIM_DMAT> dmat;

    const IntegrationRule & ir = GetIntegrationRule (fel);

    // optimized memory management
    void * heapp = locheap.GetPointer();

    for (int i = 0; i < ir.GetNIP(); i++)
      {
        // the mapped point, including Jacobian
	SpecificIntegrationPoint<DIM_ELEMENT,DIM_SPACE> 
	  sip(ir, i, eltrans, locheap);

	DIFFOP::GenerateMatrix (fel, sip, bmat, locheap);
	dmatop.GenerateMatrix (fel, sip, dmat, locheap);

	double fac = fabs (sip.GetJacobiDet()) * sip.IP().Weight();

	dbmat = dmat * bmat;
	elmat += fac * (Trans (bmat) * dbmat);

	locheap.CleanUp (heapp);
      } 
    }

Alphabetic index Hierarchy of classes



This page was generated with the help of DOC++.