53 vtkErrorMacro(
"VelocityArrayName not specified!");
61 vtkErrorMacro(
"VelocityArray with name specified does not exist!");
65 if (velocityArray->GetNumberOfComponents() != 3)
67 vtkErrorMacro(
"VelocityArray must have 3 components!");
72 int numberOfVariables = 1;
82 int numberOfCells = this->
DataSet->GetNumberOfCells();
84 for (k=0; k<numberOfCells; k++)
86 vtkCell* cell = this->
DataSet->GetCell(k);
87 if (cell->GetCellDimension() != dimension)
91 gaussQuadrature->
Initialize(cell->GetCellType());
94 double quadraturePCoords[3];
95 int numberOfCellPoints = cell->GetNumberOfPoints();
98 for (q=0; q<numberOfQuadraturePoints; q++)
102 double jacobian = feShapeFunctions->
GetJacobian(q);
105 double velocityValue[3];
108 double vorticityComponent = 0.0;
109 for (i=0; i<numberOfCellPoints; i++)
111 vtkIdType iId = cell->GetPointId(i);
112 feShapeFunctions->
GetDPhi(q,i,dphii);
113 velocityArray->GetTuple(iId,velocityValue);
119 vorticityComponent += velocityValue[2] * dphii[1] - velocityValue[1] * dphii[2];
123 vorticityComponent += velocityValue[0] * dphii[2] - velocityValue[2] * dphii[0];
127 vorticityComponent += velocityValue[1] * dphii[0] - velocityValue[0] * dphii[1];
130 for (i=0; i<numberOfCellPoints; i++)
132 vtkIdType iId = cell->GetPointId(i);
133 phii = feShapeFunctions->
GetPhi(q,i);
137 double value = jacobian * quadratureWeight * vorticityComponent * phii;
142 for (j=0; j<numberOfCellPoints; j++)
144 vtkIdType jId = cell->GetPointId(j);
145 phij = feShapeFunctions->
GetPhi(q,j);
146 double value = jacobian * quadratureWeight * phii * phij;
150 this->
Matrix->AddElement(iId,jId,value);
156 gaussQuadrature->Delete();
157 feShapeFunctions->Delete();