VMTK
Loading...
Searching...
No Matches
vtkvmtkFEAssembler Class Referenceabstract

Serves as the base class on which specific finite element routines are built. More...

#include <vtkvmtkFEAssembler.h>

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

Public Types

typedef vtkObject Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkFEAssembler * NewInstance () const
virtual int GetNumberOfVariables ()
virtual void Build ()=0
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 int IsTypeOf (const char *type)
static vtkvmtkFEAssembler * SafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkFEAssembler ()
 ~vtkvmtkFEAssembler ()
void Initialize (int numberOfVariables)

Protected Attributes

vtkDataSet * DataSet
vtkvmtkSparseMatrix * Matrix
vtkvmtkDoubleVector * RHSVector
vtkvmtkDoubleVector * SolutionVector
int NumberOfVariables
int QuadratureOrder

Detailed Description

Serves as the base class on which specific finite element routines are built.

Supports common operations needed during setup of a finite element solver run.

vtkvmtkFEAssembler holds the mesh (DataSet) and the finite-element linear-system pieces built from it: the sparse system Matrix and the RHSVector / SolutionVector double vectors, all sized for NumberOfVariables unknowns per mesh point. Concrete subclasses override Build() to loop over the cells of DataSet, evaluate element-level contributions (typically with the help of vtkvmtkGaussQuadrature and vtkvmtkFEShapeFunctions, at the quadrature order given by QuadratureOrder), and assemble them into Matrix and RHSVector. Initialize() is a protected helper that subclasses call from their constructor/Build() to allocate Matrix and the vectors for a given number of variables.

See also
vtkvmtkGaussQuadrature, vtkvmtkFEShapeFunctions, vtkvmtkLinearSystem, vtkvmtkDoubleVector

Definition at line 46 of file vtkvmtkFEAssembler.h.

Member Typedef Documentation

◆ Superclass

typedef vtkObject vtkvmtkFEAssembler::Superclass

Definition at line 50 of file vtkvmtkFEAssembler.h.

Constructor & Destructor Documentation

◆ vtkvmtkFEAssembler()

vtkvmtkFEAssembler::vtkvmtkFEAssembler ( )
protected

Definition at line 29 of file vtkvmtkFEAssembler.cxx.

30{
31 this->DataSet = NULL;
32 this->Matrix = NULL;
33 this->RHSVector = NULL;
34 this->SolutionVector = NULL;
35 this->NumberOfVariables = 1;
36 this->QuadratureOrder = 1;
37}
vtkvmtkSparseMatrix * Matrix
vtkvmtkDoubleVector * RHSVector
vtkvmtkDoubleVector * SolutionVector

◆ ~vtkvmtkFEAssembler()

vtkvmtkFEAssembler::~vtkvmtkFEAssembler ( )
protected

Definition at line 39 of file vtkvmtkFEAssembler.cxx.

40{
41 if (this->DataSet)
42 {
43 this->DataSet->Delete();
44 this->DataSet = NULL;
45 }
46 if (this->Matrix)
47 {
48 this->Matrix->Delete();
49 this->Matrix = NULL;
50 }
51 if (this->RHSVector)
52 {
53 this->RHSVector->Delete();
54 this->RHSVector = NULL;
55 }
56 if (this->SolutionVector)
57 {
58 this->SolutionVector->Delete();
59 this->SolutionVector = NULL;
60 }
61}

Member Function Documentation

◆ IsTypeOf()

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

◆ IsA()

◆ SafeDownCast()

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

◆ NewInstanceInternal()

◆ NewInstance()

vtkvmtkFEAssembler * vtkvmtkFEAssembler::NewInstance ( ) const

◆ SetDataSet()

virtual void vtkvmtkFEAssembler::SetDataSet ( vtkDataSet * )
virtual

Set/get the mesh (data set) that the finite element system is assembled over.

◆ GetDataSet()

virtual vtkDataSet * vtkvmtkFEAssembler::GetDataSet ( )
virtual

Set/get the mesh (data set) that the finite element system is assembled over.

◆ SetMatrix()

virtual void vtkvmtkFEAssembler::SetMatrix ( vtkvmtkSparseMatrix * )
virtual

Set/get the sparse matrix that Build() assembles the finite-element system matrix into.

◆ GetMatrix()

virtual vtkvmtkSparseMatrix * vtkvmtkFEAssembler::GetMatrix ( )
virtual

Set/get the sparse matrix that Build() assembles the finite-element system matrix into.

◆ SetRHSVector()

virtual void vtkvmtkFEAssembler::SetRHSVector ( vtkvmtkDoubleVector * )
virtual

Set/get the vector that Build() assembles the finite-element system's right-hand side into.

◆ GetRHSVector()

virtual vtkvmtkDoubleVector * vtkvmtkFEAssembler::GetRHSVector ( )
virtual

Set/get the vector that Build() assembles the finite-element system's right-hand side into.

◆ SetSolutionVector()

virtual void vtkvmtkFEAssembler::SetSolutionVector ( vtkvmtkDoubleVector * )
virtual

Set/get the vector holding the (unknown, to be solved for) solution of the assembled system.

◆ GetSolutionVector()

virtual vtkvmtkDoubleVector * vtkvmtkFEAssembler::GetSolutionVector ( )
virtual

Set/get the vector holding the (unknown, to be solved for) solution of the assembled system.

◆ GetNumberOfVariables()

virtual int vtkvmtkFEAssembler::GetNumberOfVariables ( )
virtual

Get the number of unknowns per mesh point, as set by the last call to Initialize().

◆ SetQuadratureOrder()

virtual void vtkvmtkFEAssembler::SetQuadratureOrder ( int )
virtual

Set/get the order of the Gauss quadrature rule used to numerically integrate element contributions during assembly (see vtkvmtkGaussQuadrature). Default: 1.

◆ GetQuadratureOrder()

virtual int vtkvmtkFEAssembler::GetQuadratureOrder ( )
virtual

Set/get the order of the Gauss quadrature rule used to numerically integrate element contributions during assembly (see vtkvmtkGaussQuadrature). Default: 1.

◆ Build()

virtual void vtkvmtkFEAssembler::Build ( )
pure virtual

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

Implemented in vtkvmtkPolyDataFEGradientAssembler, vtkvmtkPolyDataFELaplaceAssembler, vtkvmtkUnstructuredGridFEGradientAssembler, vtkvmtkUnstructuredGridFELaplaceAssembler, and vtkvmtkUnstructuredGridFEVorticityAssembler.

◆ DeepCopy()

void vtkvmtkFEAssembler::DeepCopy ( vtkvmtkFEAssembler * src)

Deep-copy DataSet, Matrix, RHSVector, SolutionVector, NumberOfVariables and QuadratureOrder from src into this assembler.

Definition at line 76 of file vtkvmtkFEAssembler.cxx.

77{
78 this->DataSet->DeepCopy(src->DataSet);
79 this->Matrix->DeepCopy(src->Matrix);
80 this->RHSVector->DeepCopy(src->RHSVector);
81 this->SolutionVector->DeepCopy(src->SolutionVector);
84}

◆ ShallowCopy()

void vtkvmtkFEAssembler::ShallowCopy ( vtkvmtkFEAssembler * src)

Share (reference-count, without copying) DataSet, Matrix, RHSVector and SolutionVector with src, and copy NumberOfVariables and QuadratureOrder.

Definition at line 86 of file vtkvmtkFEAssembler.cxx.

87{
88 this->DataSet = src->DataSet;
89 this->DataSet->Register(this);
90 this->Matrix = src->Matrix;
91 this->Matrix->Register(this);
92 this->RHSVector = src->RHSVector;
93 this->RHSVector->Register(this);
94 this->SolutionVector = src->SolutionVector;
95 this->SolutionVector->Register(this);
98}

◆ Initialize()

void vtkvmtkFEAssembler::Initialize ( int numberOfVariables)
protected

Definition at line 63 of file vtkvmtkFEAssembler.cxx.

64{
65 this->NumberOfVariables = numberOfVariables;
66
67 this->Matrix->AllocateRowsFromDataSet(this->DataSet,this->NumberOfVariables);
68
69 this->RHSVector->Allocate(this->DataSet->GetNumberOfPoints(),this->NumberOfVariables);
70 this->RHSVector->Fill(0.0);
71
72 this->SolutionVector->Allocate(this->DataSet->GetNumberOfPoints(),this->NumberOfVariables);
73 this->SolutionVector->Fill(0.0);
74}

Member Data Documentation

◆ DataSet

vtkDataSet* vtkvmtkFEAssembler::DataSet
protected

Definition at line 122 of file vtkvmtkFEAssembler.h.

◆ Matrix

vtkvmtkSparseMatrix* vtkvmtkFEAssembler::Matrix
protected

Definition at line 123 of file vtkvmtkFEAssembler.h.

◆ RHSVector

vtkvmtkDoubleVector* vtkvmtkFEAssembler::RHSVector
protected

Definition at line 124 of file vtkvmtkFEAssembler.h.

◆ SolutionVector

vtkvmtkDoubleVector* vtkvmtkFEAssembler::SolutionVector
protected

Definition at line 125 of file vtkvmtkFEAssembler.h.

◆ NumberOfVariables

int vtkvmtkFEAssembler::NumberOfVariables
protected

Definition at line 127 of file vtkvmtkFEAssembler.h.

◆ QuadratureOrder

int vtkvmtkFEAssembler::QuadratureOrder
protected

Definition at line 128 of file vtkvmtkFEAssembler.h.


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