Global matrix assembling

void BilinearForm :: Assemble ()
{
  int i, j;

  ARRAY<int> dnums;
  DenseMatrix elmat;
  ElementTransformation eltrans;
      
  int ndof = fespace.GetNDof();
      
  BaseMatrix * mat = mats.Last();
  mat->SetScalar (0);
      
  LocalHeap locheap (1000000);

  int ne = ma.GetNE();
  for (i = 1; i <= ne; i++)
    {
      locheap.CleanUp();
      if (!fespace.DefinedOn (ma.GetElIndex (i))) continue;

      ma.GetElementTransformation (i, eltrans);

      const FiniteElement & fel = fespace.GetFE (i);
      fespace.GetDofNrs (i, dnums);

      for (j = 1; j <= parts.Size(); j++)
	{
	  const BilinearFormIntegrator & bfi = *parts.Get(j);
	  if (bfi.BoundaryForm()) continue;
	      
	  bfi.AssembleElementMatrix (fel, eltrans, elmat, &locheap);
	  fespace.TransformMatrix (i, elmat);
	  mat->AddElementMatrix (dnums, elmat);
	}
    }
       
  int nse = ma.GetNSE();
  for (i = 1; i <= nse; i++)
    {
      locheap.CleanUp();
      if (!fespace.DefinedOnBoundary (ma.GetSElIndex (i))) continue;

      ma.GetSurfaceElementTransformation (i, eltrans);

      const FiniteElement & fel = fespace.GetSFE (i);
      fespace.GetSDofNrs (i, dnums);

      for (j = 1; j <= parts.Size(); j++)
	{
	  const BilinearFormIntegrator & bfi = *parts.Get(j);
	  if (!bfi.BoundaryForm()) continue;
	      
	  bfi.AssembleElementMatrix (fel, eltrans, elmat, &locheap);
	  fespace.TransformSurfMatrix (i, elmat);
	  mat->AddElementMatrix (dnums, elmat);
	}
    }
}

Alphabetic index Hierarchy of classes



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