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

Construct a laplacian based finite element calculation on a mesh. More...

#include <vtkvmtkUnstructuredGridFELaplaceAssembler.h>

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

Public Types

typedef vtkvmtkFEAssembler Superclass
Public Types inherited from vtkvmtkFEAssembler
typedef vtkObject Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkUnstructuredGridFELaplaceAssembler * 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 vtkvmtkUnstructuredGridFELaplaceAssembler * New ()
static int IsTypeOf (const char *type)
static vtkvmtkUnstructuredGridFELaplaceAssembler * 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
 vtkvmtkUnstructuredGridFELaplaceAssembler ()
 ~vtkvmtkUnstructuredGridFELaplaceAssembler ()
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 mesh.

Assembles, over a vtkUnstructuredGrid, the finite-element stiffness matrix for the Laplace operator (used e.g. by vtkvmtkUnstructuredGridHarmonicMappingFilter to solve for a harmonic function with given boundary values).

See also
vtkvmtkFEAssembler, vtkvmtkUnstructuredGridHarmonicMappingFilter

Definition at line 35 of file vtkvmtkUnstructuredGridFELaplaceAssembler.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkvmtkUnstructuredGridFELaplaceAssembler()

vtkvmtkUnstructuredGridFELaplaceAssembler::vtkvmtkUnstructuredGridFELaplaceAssembler ( )
protected

Definition at line 32 of file vtkvmtkUnstructuredGridFELaplaceAssembler.cxx.

33{
34}

◆ ~vtkvmtkUnstructuredGridFELaplaceAssembler()

vtkvmtkUnstructuredGridFELaplaceAssembler::~vtkvmtkUnstructuredGridFELaplaceAssembler ( )
protected

Definition at line 36 of file vtkvmtkUnstructuredGridFELaplaceAssembler.cxx.

37{
38}

Member Function Documentation

◆ New()

vtkvmtkUnstructuredGridFELaplaceAssembler * vtkvmtkUnstructuredGridFELaplaceAssembler::New ( )
static

◆ IsTypeOf()

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

◆ IsA()

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

Reimplemented from vtkvmtkFEAssembler.

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkUnstructuredGridFELaplaceAssembler::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkvmtkFEAssembler.

◆ NewInstance()

vtkvmtkUnstructuredGridFELaplaceAssembler * vtkvmtkUnstructuredGridFELaplaceAssembler::NewInstance ( ) const

◆ Build()

void vtkvmtkUnstructuredGridFELaplaceAssembler::Build ( )
overridevirtual

Assemble the Laplace stiffness matrix.

Implements vtkvmtkFEAssembler.

Definition at line 40 of file vtkvmtkUnstructuredGridFELaplaceAssembler.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 = 3;
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: