How to interpolate array data using gauss points (quadrature)

I need to interpolate a result (stress) using gauss points.
I understand that I should use Quadrature Scheme.

I’ve created a quadrature definition:


vtkNew gauss_points_triangle;
gauss_points_triangle->Initialize(VTK_TRIANGLE, 3, 3, Ngauss3, Wi);

where 3 is the number of nodes, 3 the number of quadrature points, Ngauss is an array with the shape functions of each gauss points (dimension=9), Wi is the quadrature weights (dimension 3).

Afterwards I create an offset:

vtkDataArray* offsets = layer->GetOffsetsArray();

Afterwards I create my array with stress results (my unstructured grid contains 2 triangles):

vtkNew Stress_si;
Stress_si->SetNumberOfComponents(1);
Stress_si->SetName(“Stress Si”);
Stress_si->InsertNextValue(1385);
Stress_si->InsertNextValue(1385);
Stress_si->InsertNextValue(847);
Stress_si->InsertNextValue(1385);
Stress_si->InsertNextValue(1385);
Stress_si->InsertNextValue(847);

Afterwards I connect the quadrature scheme with Stress array:

auto* key = vtkQuadratureSchemeDefinition::DICTIONARY();
key->Append(Stress_si->GetInformation(),gauss_points_triangle);
Stress_si->GetInformation()->Set(vtkQuadratureSchemeDefinition::QUADRATURE_OFFSET_ARRAY_NAME(), offsets->GetName());

Afterwards I add stress array into unstructured grid.

ug->GetCellData()->AddArray(Stress_si);

I think that the vtu file is correct:
example_vtk.vtu (2.4 KB)

However when I open this file in paraview I do not know how can I show my stresses interpolated.