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.
I’ve found three filters in paraview:
-
Generate quadrature scheme dictionary: it appears the following error message:
“Filter data has not been configured correctly. Aborting”. -
Generate quadrature points: I can show my quadrature points:
-
InterpolatetoQuadraturePoints: it appears the same error message than using Generate quadrature scheme dictionary.
I do not how can I use these filters or another way to show stresses interpolating to gauss points.