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

Serves as the base class that stores nodes, value, and the linear system composing a boundary condition. More...

#include <vtkvmtkBoundaryConditions.h>

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

Public Types

typedef vtkObject Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkBoundaryConditions * NewInstance () const
virtual void Apply ()
virtual void SetLinearSystem (vtkvmtkLinearSystem *)
virtual vtkvmtkLinearSystem * GetLinearSystem ()
virtual void SetBoundaryNodes (vtkIdList *)
virtual vtkIdList * GetBoundaryNodes ()
virtual void SetBoundaryValues (vtkDoubleArray *)
virtual vtkDoubleArray * GetBoundaryValues ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkvmtkBoundaryConditions * SafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkBoundaryConditions ()
 ~vtkvmtkBoundaryConditions ()

Protected Attributes

vtkvmtkLinearSystem * LinearSystem
vtkIdList * BoundaryNodes
vtkDoubleArray * BoundaryValues

Detailed Description

Serves as the base class that stores nodes, value, and the linear system composing a boundary condition.

vtkvmtkBoundaryConditions holds the three ingredients needed to impose a boundary condition on a finite-element linear system: the vtkvmtkLinearSystem to modify, the list of node (row) ids the condition applies to (BoundaryNodes), and the prescribed value at each of those nodes (BoundaryValues). Apply() checks that all three are consistently set (in particular that BoundaryNodes and BoundaryValues have the same length) but performs no actual modification of the linear system; concrete subclasses (e.g. vtkvmtkDirichletBoundaryConditions) override Apply() to carry out the specific boundary condition type.

See also
vtkvmtkDirichletBoundaryConditions, vtkvmtkLinearSystem, vtkvmtkEllipticProblem

Definition at line 44 of file vtkvmtkBoundaryConditions.h.

Member Typedef Documentation

◆ Superclass

Definition at line 48 of file vtkvmtkBoundaryConditions.h.

Constructor & Destructor Documentation

◆ vtkvmtkBoundaryConditions()

vtkvmtkBoundaryConditions::vtkvmtkBoundaryConditions ( )
protected

Definition at line 27 of file vtkvmtkBoundaryConditions.cxx.

28 {
29 this->LinearSystem = NULL;
30
31 this->BoundaryNodes = NULL;
32 this->BoundaryValues = NULL;
33 }

◆ ~vtkvmtkBoundaryConditions()

vtkvmtkBoundaryConditions::~vtkvmtkBoundaryConditions ( )
protected

Definition at line 35 of file vtkvmtkBoundaryConditions.cxx.

36{
37 if (this->LinearSystem)
38 {
39 this->LinearSystem->Delete();
40 this->LinearSystem = NULL;
41 }
42
43 if (this->BoundaryNodes)
44 {
45 this->BoundaryNodes->Delete();
46 this->BoundaryNodes = NULL;
47 }
48
49 if (this->BoundaryValues)
50 {
51 this->BoundaryValues->Delete();
52 this->BoundaryValues = NULL;
53 }
54}

Member Function Documentation

◆ IsTypeOf()

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

◆ IsA()

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

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkBoundaryConditions::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkBoundaryConditions * vtkvmtkBoundaryConditions::NewInstance ( ) const

◆ SetLinearSystem()

virtual void vtkvmtkBoundaryConditions::SetLinearSystem ( vtkvmtkLinearSystem * )
virtual

Set/get the linear system that the boundary condition is applied to when Apply() is called.

◆ GetLinearSystem()

virtual vtkvmtkLinearSystem * vtkvmtkBoundaryConditions::GetLinearSystem ( )
virtual

Set/get the linear system that the boundary condition is applied to when Apply() is called.

◆ SetBoundaryNodes()

virtual void vtkvmtkBoundaryConditions::SetBoundaryNodes ( vtkIdList * )
virtual

Set/get the list of node (linear system row) ids that the boundary condition applies to, in the same order as BoundaryValues.

◆ GetBoundaryNodes()

virtual vtkIdList * vtkvmtkBoundaryConditions::GetBoundaryNodes ( )
virtual

Set/get the list of node (linear system row) ids that the boundary condition applies to, in the same order as BoundaryValues.

◆ SetBoundaryValues()

virtual void vtkvmtkBoundaryConditions::SetBoundaryValues ( vtkDoubleArray * )
virtual

Set/get the prescribed value at each node listed in BoundaryNodes, one value per node and in the same order.

◆ GetBoundaryValues()

virtual vtkDoubleArray * vtkvmtkBoundaryConditions::GetBoundaryValues ( )
virtual

Set/get the prescribed value at each node listed in BoundaryNodes, one value per node and in the same order.

◆ Apply()

void vtkvmtkBoundaryConditions::Apply ( )
virtual

Impose the boundary condition on LinearSystem. This base class implementation only validates that LinearSystem, BoundaryNodes, and BoundaryValues are set and mutually consistent (same number of nodes and values); subclasses override this method to actually modify the system matrix and right-hand side.

Reimplemented in vtkvmtkDirichletBoundaryConditions.

Definition at line 56 of file vtkvmtkBoundaryConditions.cxx.

57 {
58 if (this->LinearSystem==NULL)
59 {
60 vtkErrorMacro(<< "Linear system not set!");
61 return;
62 }
63
64 if (this->BoundaryNodes==NULL)
65 {
66 vtkErrorMacro(<< "Boundary nodes not set!");
67 return;
68 }
69
70 if (this->BoundaryValues==NULL)
71 {
72 vtkErrorMacro(<< "Boundary values not set!");
73 return;
74 }
75
76 if (this->BoundaryNodes->GetNumberOfIds() != this->BoundaryValues->GetNumberOfTuples())
77 {
78 vtkErrorMacro(<< "Boundary nodes list and boundary values array do not have the same size!");
79 return;
80 }
81
82 }

Member Data Documentation

◆ LinearSystem

vtkvmtkLinearSystem* vtkvmtkBoundaryConditions::LinearSystem
protected

Definition at line 88 of file vtkvmtkBoundaryConditions.h.

◆ BoundaryNodes

vtkIdList* vtkvmtkBoundaryConditions::BoundaryNodes
protected

Definition at line 90 of file vtkvmtkBoundaryConditions.h.

◆ BoundaryValues

vtkDoubleArray* vtkvmtkBoundaryConditions::BoundaryValues
protected

Definition at line 91 of file vtkvmtkBoundaryConditions.h.


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