VMTK
Loading...
Searching...
No Matches
vtkvmtkPolyDataFELaplaceAssembler Class Reference

Construct a Laplacian-based finite element calculation on a surface. More...

#include <vtkvmtkPolyDataFELaplaceAssembler.h>

Inheritance diagram for vtkvmtkPolyDataFELaplaceAssembler:
[legend]
Collaboration diagram for vtkvmtkPolyDataFELaplaceAssembler:
[legend]

Public Types

typedef vtkvmtkFEAssembler Superclass
Public Types inherited from vtkvmtkFEAssembler
typedef vtkObject Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkPolyDataFELaplaceAssembler * NewInstance () const
virtual void Build () override
Public Member Functions inherited from vtkvmtkFEAssembler
vtkvmtkFEAssembler * NewInstance () const
virtual int GetNumberOfVariables ()
void DeepCopy (vtkvmtkFEAssembler *src)
void ShallowCopy (vtkvmtkFEAssembler *src)
virtual void SetDataSet (vtkDataSet *)
virtual vtkDataSet * GetDataSet ()
virtual void SetMatrix (vtkvmtkSparseMatrix *)
virtual vtkvmtkSparseMatrix * GetMatrix ()
virtual void SetRHSVector (vtkvmtkDoubleVector *)
virtual vtkvmtkDoubleVector * GetRHSVector ()
virtual void SetSolutionVector (vtkvmtkDoubleVector *)
virtual vtkvmtkDoubleVector * GetSolutionVector ()
virtual void SetQuadratureOrder (int)
virtual int GetQuadratureOrder ()

Static Public Member Functions

static vtkvmtkPolyDataFELaplaceAssembler * New ()
static int IsTypeOf (const char *type)
static vtkvmtkPolyDataFELaplaceAssembler * SafeDownCast (vtkObjectBase *o)
Static Public Member Functions inherited from vtkvmtkFEAssembler
static int IsTypeOf (const char *type)
static vtkvmtkFEAssembler * SafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkPolyDataFELaplaceAssembler ()
 ~vtkvmtkPolyDataFELaplaceAssembler ()
Protected Member Functions inherited from vtkvmtkFEAssembler
 vtkvmtkFEAssembler ()
 ~vtkvmtkFEAssembler ()
void Initialize (int numberOfVariables)

Additional Inherited Members

Protected Attributes inherited from vtkvmtkFEAssembler
vtkDataSet * DataSet
vtkvmtkSparseMatrix * Matrix
vtkvmtkDoubleVector * RHSVector
vtkvmtkDoubleVector * SolutionVector
int NumberOfVariables
int QuadratureOrder

Detailed Description

Construct a Laplacian-based finite element calculation on a surface.

vtkvmtkPolyDataFELaplaceAssembler implements vtkvmtkFEAssembler::Build() to assemble the piecewise-linear finite-element stiffness matrix of the surface Laplace-Beltrami operator over every 2D (triangle) cell of DataSet: for each cell, Gauss quadrature (order QuadratureOrder, inherited from vtkvmtkFEAssembler, via vtkvmtkGaussQuadrature / vtkvmtkFEShapeFunctions) is used to integrate the dot product of shape function gradients, and the contributions are accumulated into Matrix. No right-hand-side terms are added (the RHS is expected to be supplied by boundary conditions, e.g. vtkvmtkDirichletBoundaryConditions). Solving the resulting linear system yields the discrete harmonic function used, for instance, by vtkvmtkPolyDataHarmonicMappingFilter.

See also
vtkvmtkFEAssembler, vtkvmtkPolyDataHarmonicMappingFilter, vtkvmtkPolyDataFEGradientAssembler

Definition at line 40 of file vtkvmtkPolyDataFELaplaceAssembler.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkvmtkPolyDataFELaplaceAssembler()

vtkvmtkPolyDataFELaplaceAssembler::vtkvmtkPolyDataFELaplaceAssembler ( )
protected

Definition at line 32 of file vtkvmtkPolyDataFELaplaceAssembler.cxx.

33{
34}

◆ ~vtkvmtkPolyDataFELaplaceAssembler()

vtkvmtkPolyDataFELaplaceAssembler::~vtkvmtkPolyDataFELaplaceAssembler ( )
protected

Definition at line 36 of file vtkvmtkPolyDataFELaplaceAssembler.cxx.

37{
38}

Member Function Documentation

◆ New()

vtkvmtkPolyDataFELaplaceAssembler * vtkvmtkPolyDataFELaplaceAssembler::New ( )
static

◆ IsTypeOf()

int vtkvmtkPolyDataFELaplaceAssembler::IsTypeOf ( const char * type)
static

◆ IsA()

virtual int vtkvmtkPolyDataFELaplaceAssembler::IsA ( const char * type)
virtual

Reimplemented from vtkvmtkFEAssembler.

◆ SafeDownCast()

vtkvmtkPolyDataFELaplaceAssembler * vtkvmtkPolyDataFELaplaceAssembler::SafeDownCast ( vtkObjectBase * o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkPolyDataFELaplaceAssembler::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkvmtkFEAssembler.

◆ NewInstance()

vtkvmtkPolyDataFELaplaceAssembler * vtkvmtkPolyDataFELaplaceAssembler::NewInstance ( ) const

◆ Build()

void vtkvmtkPolyDataFELaplaceAssembler::Build ( )
overridevirtual

Assemble the finite-element system (Matrix and RHSVector) from DataSet. Implemented by subclasses for a specific PDE/discretization.

Implements vtkvmtkFEAssembler.

Definition at line 40 of file vtkvmtkPolyDataFELaplaceAssembler.cxx.

41{
42 int numberOfVariables = 1;
43 this->Initialize(numberOfVariables);
44
45 vtkvmtkGaussQuadrature* gaussQuadrature = vtkvmtkGaussQuadrature::New();
46 gaussQuadrature->SetOrder(this->QuadratureOrder);
47
48 vtkvmtkFEShapeFunctions* feShapeFunctions = vtkvmtkFEShapeFunctions::New();
49
50 int dimension = 2;
51
52 int numberOfCells = this->DataSet->GetNumberOfCells();
53 int k;
54 for (k=0; k<numberOfCells; k++)
55 {
56 vtkCell* cell = this->DataSet->GetCell(k);
57 if (cell->GetCellDimension() != dimension)
58 {
59 continue;
60 }
61 gaussQuadrature->Initialize(cell->GetCellType());
62 feShapeFunctions->Initialize(cell,gaussQuadrature->GetQuadraturePoints());
63 int numberOfQuadraturePoints = gaussQuadrature->GetNumberOfQuadraturePoints();
64 double quadraturePCoords[3];
65 int numberOfCellPoints = cell->GetNumberOfPoints();
66 int i, j;
67 int q;
68 for (q=0; q<numberOfQuadraturePoints; q++)
69 {
70 gaussQuadrature->GetQuadraturePoint(q,quadraturePCoords);
71 double quadratureWeight = gaussQuadrature->GetQuadratureWeight(q);
72 double jacobian = feShapeFunctions->GetJacobian(q);
73 double dphii[3], dphij[3];
74 for (i=0; i<numberOfCellPoints; i++)
75 {
76 vtkIdType iId = cell->GetPointId(i);
77 feShapeFunctions->GetDPhi(q,i,dphii);
78 for (j=0; j<numberOfCellPoints; j++)
79 {
80 vtkIdType jId = cell->GetPointId(j);
81 feShapeFunctions->GetDPhi(q,j,dphij);
82 double gradphii_gradphij = vtkMath::Dot(dphii,dphij);
83 double value = jacobian * quadratureWeight * gradphii_gradphij;
84 this->Matrix->AddElement(iId,jId,value);
85 }
86 }
87 }
88 }
89
90 gaussQuadrature->Delete();
91 feShapeFunctions->Delete();
92}
vtkvmtkSparseMatrix * Matrix
void Initialize(int numberOfVariables)
void Initialize(vtkCell *cell, vtkDoubleArray *pcoords)
static vtkvmtkFEShapeFunctions * New()
double * GetDPhi(vtkIdType id, vtkIdType i)
double * GetQuadraturePoint(vtkIdType id)
virtual vtkDoubleArray * GetQuadraturePoints()
static vtkvmtkGaussQuadrature * New()
void Initialize(vtkIdType cellType)
double GetQuadratureWeight(vtkIdType id)
virtual void SetOrder(int)

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