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

Construct a harmonic function over each vascular mesh segment used during mapping order to stretch the longitudinal metric to correctly account for the presence of insertion regions at bifurcations. More...

#include <vtkvmtkUnstructuredGridHarmonicMappingFilter.h>

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

Public Types

typedef vtkUnstructuredGridAlgorithm Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkUnstructuredGridHarmonicMappingFilter * NewInstance () const
virtual void SetBoundaryPointIds (vtkIdList *)
virtual vtkIdList * GetBoundaryPointIds ()
virtual void SetBoundaryValues (vtkDoubleArray *)
virtual vtkDoubleArray * GetBoundaryValues ()
virtual void SetHarmonicMappingArrayName (const char *)
virtual char * GetHarmonicMappingArrayName ()
virtual void SetConvergenceTolerance (double)
virtual double GetConvergenceTolerance ()
virtual void SetQuadratureOrder (int)
virtual int GetQuadratureOrder ()

Static Public Member Functions

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

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkUnstructuredGridHarmonicMappingFilter ()
 ~vtkvmtkUnstructuredGridHarmonicMappingFilter ()
virtual int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) override

Protected Attributes

vtkIdList * BoundaryPointIds
vtkDoubleArray * BoundaryValues
char * HarmonicMappingArrayName
double ConvergenceTolerance
int QuadratureOrder

Detailed Description

Construct a harmonic function over each vascular mesh segment used during mapping order to stretch the longitudinal metric to correctly account for the presence of insertion regions at bifurcations.

Solves the Laplace equation (assembled with vtkvmtkUnstructuredGridFELaplaceAssembler, Gauss quadrature order QuadratureOrder) over the input mesh with Dirichlet boundary conditions given by BoundaryValues at the points listed in BoundaryPointIds, writing the resulting harmonic scalar field into the point data array named HarmonicMappingArrayName. The linear system is solved iteratively to ConvergenceTolerance.

See also
vtkvmtkUnstructuredGridFELaplaceAssembler, vtkvmtkPolyDataHarmonicMappingFilter

Definition at line 40 of file vtkvmtkUnstructuredGridHarmonicMappingFilter.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkvmtkUnstructuredGridHarmonicMappingFilter()

◆ ~vtkvmtkUnstructuredGridHarmonicMappingFilter()

vtkvmtkUnstructuredGridHarmonicMappingFilter::~vtkvmtkUnstructuredGridHarmonicMappingFilter ( )
protected

Definition at line 50 of file vtkvmtkUnstructuredGridHarmonicMappingFilter.cxx.

51{
52 if (this->BoundaryPointIds)
53 {
54 this->BoundaryPointIds->Delete();
55 this->BoundaryPointIds = NULL;
56 }
57
58 if (this->BoundaryValues)
59 {
60 this->BoundaryValues->Delete();
61 this->BoundaryValues = NULL;
62 }
63
65 {
66 delete[] this->HarmonicMappingArrayName;
67 this->HarmonicMappingArrayName = NULL;
68 }
69}

Member Function Documentation

◆ New()

vtkvmtkUnstructuredGridHarmonicMappingFilter * vtkvmtkUnstructuredGridHarmonicMappingFilter::New ( )
static

◆ IsTypeOf()

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

◆ IsA()

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

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkUnstructuredGridHarmonicMappingFilter::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkUnstructuredGridHarmonicMappingFilter * vtkvmtkUnstructuredGridHarmonicMappingFilter::NewInstance ( ) const

◆ SetBoundaryPointIds()

virtual void vtkvmtkUnstructuredGridHarmonicMappingFilter::SetBoundaryPointIds ( vtkIdList * )
virtual

Set/Get the ids of the mesh points where a Dirichlet boundary value is imposed (parallel to BoundaryValues). Required input.

◆ GetBoundaryPointIds()

virtual vtkIdList * vtkvmtkUnstructuredGridHarmonicMappingFilter::GetBoundaryPointIds ( )
virtual

Set/Get the ids of the mesh points where a Dirichlet boundary value is imposed (parallel to BoundaryValues). Required input.

◆ SetBoundaryValues()

virtual void vtkvmtkUnstructuredGridHarmonicMappingFilter::SetBoundaryValues ( vtkDoubleArray * )
virtual

Set/Get the Dirichlet boundary values imposed at the points listed in BoundaryPointIds (parallel array). Required input.

◆ GetBoundaryValues()

virtual vtkDoubleArray * vtkvmtkUnstructuredGridHarmonicMappingFilter::GetBoundaryValues ( )
virtual

Set/Get the Dirichlet boundary values imposed at the points listed in BoundaryPointIds (parallel array). Required input.

◆ SetHarmonicMappingArrayName()

virtual void vtkvmtkUnstructuredGridHarmonicMappingFilter::SetHarmonicMappingArrayName ( const char * )
virtual

Set/Get the name of the output point data array where the computed harmonic scalar field is stored. Commonly named "HarmonicMapping".

◆ GetHarmonicMappingArrayName()

virtual char * vtkvmtkUnstructuredGridHarmonicMappingFilter::GetHarmonicMappingArrayName ( )
virtual

Set/Get the name of the output point data array where the computed harmonic scalar field is stored. Commonly named "HarmonicMapping".

◆ SetConvergenceTolerance()

virtual void vtkvmtkUnstructuredGridHarmonicMappingFilter::SetConvergenceTolerance ( double )
virtual

Set/Get the convergence tolerance of the iterative linear solver used to solve the Laplace system.

◆ GetConvergenceTolerance()

virtual double vtkvmtkUnstructuredGridHarmonicMappingFilter::GetConvergenceTolerance ( )
virtual

Set/Get the convergence tolerance of the iterative linear solver used to solve the Laplace system.

◆ SetQuadratureOrder()

virtual void vtkvmtkUnstructuredGridHarmonicMappingFilter::SetQuadratureOrder ( int )
virtual

Set/Get the order of the Gauss quadrature rule used to integrate the finite-element matrices in vtkvmtkUnstructuredGridFELaplaceAssembler.

◆ GetQuadratureOrder()

virtual int vtkvmtkUnstructuredGridHarmonicMappingFilter::GetQuadratureOrder ( )
virtual

Set/Get the order of the Gauss quadrature rule used to integrate the finite-element matrices in vtkvmtkUnstructuredGridFELaplaceAssembler.

◆ RequestData()

int vtkvmtkUnstructuredGridHarmonicMappingFilter::RequestData ( vtkInformation * ,
vtkInformationVector ** ,
vtkInformationVector *  )
overrideprotectedvirtual

Definition at line 71 of file vtkvmtkUnstructuredGridHarmonicMappingFilter.cxx.

75{
76 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
77 vtkInformation *outInfo = outputVector->GetInformationObject(0);
78
79 vtkUnstructuredGrid *input = vtkUnstructuredGrid::SafeDownCast(
80 inInfo->Get(vtkDataObject::DATA_OBJECT()));
81 vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast(
82 outInfo->Get(vtkDataObject::DATA_OBJECT()));
83
84 if (!this->BoundaryPointIds)
85 {
86 vtkErrorMacro(<<"BoundaryPointIds not set.");
87 return 1;
88 }
89
90 if (!this->BoundaryValues)
91 {
92 vtkErrorMacro(<<"BoundaryValues not set.");
93 return 1;
94 }
95
96 if (!this->HarmonicMappingArrayName)
97 {
98 vtkErrorMacro(<<"HarmonicMappingArrayName not set.");
99 return 1;
100 }
101
102 int numberOfInputPoints = input->GetNumberOfPoints();
103
104 vtkvmtkSparseMatrix* sparseMatrix = vtkvmtkSparseMatrix::New();
105
106 vtkvmtkDoubleVector* rhsVector = vtkvmtkDoubleVector::New();
107 rhsVector->SetNormTypeToLInf();
108
109 vtkvmtkDoubleVector* solutionVector = vtkvmtkDoubleVector::New();
110 solutionVector->SetNormTypeToLInf();
111
112 vtkvmtkUnstructuredGridFELaplaceAssembler* assembler = vtkvmtkUnstructuredGridFELaplaceAssembler::New();
113 assembler->SetDataSet(input);
114 assembler->SetMatrix(sparseMatrix);
115 assembler->SetRHSVector(rhsVector);
116 assembler->SetSolutionVector(solutionVector);
117 assembler->SetQuadratureOrder(this->QuadratureOrder);
118 assembler->Build();
119
120 vtkvmtkLinearSystem* linearSystem = vtkvmtkLinearSystem::New();
121 linearSystem->SetA(sparseMatrix);
122 linearSystem->SetB(rhsVector);
123 linearSystem->SetX(solutionVector);
124
125 vtkvmtkDirichletBoundaryConditions* dirichetBoundaryConditions = vtkvmtkDirichletBoundaryConditions::New();
126 dirichetBoundaryConditions->SetLinearSystem(linearSystem);
127 dirichetBoundaryConditions->SetBoundaryNodes(this->BoundaryPointIds);
128 dirichetBoundaryConditions->SetBoundaryValues(this->BoundaryValues);
129 dirichetBoundaryConditions->Apply();
130
131 vtkvmtkOpenNLLinearSystemSolver* solver = vtkvmtkOpenNLLinearSystemSolver::New();
132 solver->SetLinearSystem(linearSystem);
134 solver->SetMaximumNumberOfIterations(numberOfInputPoints);
135 solver->SetSolverTypeToCG();
137 solver->Solve();
138
139 vtkDoubleArray* harmonicMappingArray = vtkDoubleArray::New();
140 harmonicMappingArray->SetName(this->HarmonicMappingArrayName);
141 harmonicMappingArray->SetNumberOfComponents(1);
142 harmonicMappingArray->SetNumberOfTuples(numberOfInputPoints);
143
144 solutionVector->CopyIntoArrayComponent(harmonicMappingArray,0);
145
146 output->DeepCopy(input);
147
148 output->GetPointData()->AddArray(harmonicMappingArray);
149
150 assembler->Delete();
151 solver->Delete();
152 harmonicMappingArray->Delete();
153 sparseMatrix->Delete();
154 rhsVector->Delete();
155 solutionVector->Delete();
156 linearSystem->Delete();
157 dirichetBoundaryConditions->Delete();
158
159 return 1;
160}
virtual void SetBoundaryValues(vtkDoubleArray *)
virtual void SetBoundaryNodes(vtkIdList *)
virtual void SetLinearSystem(vtkvmtkLinearSystem *)
static vtkvmtkDirichletBoundaryConditions * New()
static vtkvmtkDoubleVector * New()
void CopyIntoArrayComponent(vtkDataArray *array, int component)
virtual void SetSolutionVector(vtkvmtkDoubleVector *)
virtual void SetDataSet(vtkDataSet *)
virtual void SetRHSVector(vtkvmtkDoubleVector *)
virtual void SetMatrix(vtkvmtkSparseMatrix *)
virtual void SetQuadratureOrder(int)
virtual void SetConvergenceTolerance(double)
virtual void SetMaximumNumberOfIterations(int)
virtual void SetLinearSystem(vtkvmtkLinearSystem *)
virtual void SetX(vtkvmtkDoubleVector *)
virtual void SetA(vtkvmtkSparseMatrix *)
virtual void SetB(vtkvmtkDoubleVector *)
static vtkvmtkLinearSystem * New()
static vtkvmtkOpenNLLinearSystemSolver * New()
static vtkvmtkSparseMatrix * New()
static vtkvmtkUnstructuredGridFELaplaceAssembler * New()

Member Data Documentation

◆ BoundaryPointIds

vtkIdList* vtkvmtkUnstructuredGridHarmonicMappingFilter::BoundaryPointIds
protected

◆ BoundaryValues

vtkDoubleArray* vtkvmtkUnstructuredGridHarmonicMappingFilter::BoundaryValues
protected

◆ HarmonicMappingArrayName

char* vtkvmtkUnstructuredGridHarmonicMappingFilter::HarmonicMappingArrayName
protected

◆ ConvergenceTolerance

double vtkvmtkUnstructuredGridHarmonicMappingFilter::ConvergenceTolerance
protected

◆ QuadratureOrder

int vtkvmtkUnstructuredGridHarmonicMappingFilter::QuadratureOrder
protected

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