# VTK/VTK integration point support: Difference between revisions

Line 64: | Line 64: | ||

work with the modified vtkUnstructuredGrid without problems. | work with the modified vtkUnstructuredGrid without problems. | ||

==== Implementation and modification of classes ==== | |||

The following classes should be new implemented: | |||

* ''vtkIntegrationPointData'' A class derived from vtkDataSetAttributes which stores all scalars, vectors and tensors which are defined in the integration points | * ''vtkIntegrationPointData'' A class derived from vtkDataSetAttributes which stores all scalars, vectors and tensors which are defined in the integration points | ||

Line 100: | Line 102: | ||

* All classes which process vtkUnstructuredGrids() (inputs and outputs are ugrids) must be modified to support integration points. This should, of course, be implemented successively, because only a few ugrid filters may be relevant for integration point processing. | * All classes which process vtkUnstructuredGrids() (inputs and outputs are ugrids) must be modified to support integration points. This should, of course, be implemented successively, because only a few ugrid filters may be relevant for integration point processing. | ||

==== The ''shell element'' issue ==== | |||

The compuation model of many FEA programs are based on finite element types named: ''shell elements'' or ''thin shells''. | |||

The VTK equivalents are two dimensional cells like VTK_TRIANGLE, VTK_QUAD, VTK_QUADRATIC_QUAD and so on. | |||

Additionally within these elements integration points are defined, which are | |||

distributed across the element. The distribution is three dimensional, based on the thickness of the element and is ordered in layers. | |||

The combination of ''shell elements'' and the three dimensional distribution of integration points must be handled in VTK, because | |||

''shell elements'' are used most of the time in FEA. | |||

That means, the quadrature and integration model must handle the schemes. A thickness must be provided for each element, node or | |||

integration point. Based on the thickness, the three dimensional parametric coordinates of the quadrature and the element normals, | |||

the position of an integration point within, below or upper the element can be computed. | |||

Classes derived from ''vtkIntegrationMethodBase'' should implement such algorithms. The thickness must be provide as optional | |||

parameter to the computation method. | |||

==== Other issues ==== | |||

This approach is just a simple sketch and may be modified and extended in the future. An UML diagram may follow. | This approach is just a simple sketch and may be modified and extended in the future. An UML diagram may follow. | ||

'''An important issue is, how to store such data in the VTK XML format?''' | '''An important issue is, how to store such data in the VTK XML format?''' |

## Revision as of 13:19, 19 February 2009

# Integration point support in VTK

## Introduction

### What are integration points?

In Finite Element Analysis (FEA) the simulation results are managed in so called integration points. Integration points are used to control and monitor values inside of a finite element.

Integration points are located within a finite element and therefore strongly connected to them. The position of an integration point inside a finite element is based on the quadrature and the integration method (gauss, newton-cotes).

Important for the understanding of integration points and there implementation is, that the values which are defined in the integration points (stress and strain tensors, hardening, thickness and others) are representative for the element at this discrete point. Usually the distribution function of these values are unknown within the element. They are not related to the shape functions of the element (the position of the integration point is, but not the values). Therefore discrete points inside the element are used to compute, mostly based on the displacement vectors which are defined in the mesh nodes, stress and strain inside the finite element.

Stress and Strain as well as other values defined in the integration points are very important to analyse and evaluate the result of a FEM simulation (forming, welding, crash, structural analyses ...). Because of that, there is a strong need to handle integration points correctly to process, analyse and visualize them.

### Why should VTK support integration points?

To analyze/visualize and process data from FEA simulation programs, it is highly recommended to handle the integration points as a part of a finite element.

As far as i can tell, VTK is widely used to analyze and process FEA simulation results. Because of that there is a need to handle, processes and visualize integration points with VTK. Currently several different approaches are implemented independently from each other to handle integration points in VTK.

Based on several opinions (accordingly the VTK developers mailing list) would it be very useful to implement integration point support into the official VTK version. This would avoid parallel incompatible implementations.

Many FEA analysts may benefit from a native approach, because analysing and processing of integration points are handled in each FEA simulation program differently. VTK can provide a unified interface to analyse and process integration point data, if import classes for specific FEA programs are available.

## How to implement integration point support in VTK?

### Approach *heavy invasive*

Integration points are related to a finite element. A finite element is represented in VTK as a cell. The most of the finite elements used in FEA programs are covered in VTK. They are available in vtkUnstructuredGrid. Therefore integration point support should be implemented in vtkUnstructuredGrid and VTK cells.

The approach i prefer will be very invasive and would require an review of many vtkUnstructuredGrid processing classes to provide consistent integration point support. The main idea is to handle integration points as part of a cell and to store the data which is defined in the integration points as an additional data array within the vtkUnstructuredGrid.

This approach should be implemented in a way, that the existing functionality of VTK is not interferred. The visualization and all vtkUnstructuredGrid filter should work with the modified vtkUnstructuredGrid without problems.

#### Implementation and modification of classes

The following classes should be new implemented:

*vtkIntegrationPointData*A class derived from vtkDataSetAttributes which stores all scalars, vectors and tensors which are defined in the integration points*vtkIntegrationPointDataCollection*A collection of vtkIntegrationPointData*vtkIntegrationMethodBase*An abstract class which defines the interface for any integration method and quadrature which may appear in FEA.- A specific integration model must be derived from vtkIntegrationMethodBase and implement the interface defined in the abstract class (same principle as vtkCell and derived classes). Typical integration models may be provided by VTK, other can be created very easily for specific purposes outside of VTK.
- The interface of
*vtkIntegrationMethodBase*should define the following variables and methods:- The type of the integration model (layered/not layered/...)
- The distribution of the integration points within the cell (quadrature) as parametric coordinates
- The number of integration points within the cell
- The number of layers (optionally)
- Methods to extrapolate the integration point values into cell nodes
- Methods to compute the x, y and z position in global coordinates for all integration points of a cell, based on the interpolation functions defined in the corresponding cell and the parametric coordinates of the integration point.
- Methods to extract the integration points in global coordinates with related point data (scalars, vectors and tensors). It should be possible to extract all integration points as vertices's with point data from an vtkUnstructuredGrid by using these methods.
- Methods to create a triangular or vertices's dataset used by mapper/actor/renderer?

*vtkIntegrationMethodCollection*a collection to store the specified integration method objects- An object array storing the links to specific integration models

The following classes should be modified:

*vtkCell*- Adding a link to the corresponding integration method and the access methods (Set/Get/Has)

*vtkUnstructuredGrid*:- Adding an additional a vtkDataSetAttribute named vtkIntegrationPointData
- Adding a collection to store all integration-method-objects which appear in the dataset. Normally only a few integration models are used within a dataset. The total number of usual integration models may be 50 - 60?
- Adding an array of size(NumberOfCells) to store a link to the corresponding integration model for each cell
- Change the GetCell(cellid) method to apply the corresponding integration method to the delivered cell
- Implementation of GetIntegrationModel(cellid) which delivers a specific integration model and apply the corresponding cell to the model (to have access to the interpolation methods of the cell)
- Implementation of SetIntegrationModel(cellid, model) to set the integration model of a specific cell (adding a link to the link array) and, in case a new integration model is added, insert the model into the collection
- Adding the method HasIntegrationPoints() to check for integration points support in the ugrid

- All classes which process vtkUnstructuredGrids() (inputs and outputs are ugrids) must be modified to support integration points. This should, of course, be implemented successively, because only a few ugrid filters may be relevant for integration point processing.

#### The *shell element* issue

The compuation model of many FEA programs are based on finite element types named: *shell elements* or *thin shells*.
The VTK equivalents are two dimensional cells like VTK_TRIANGLE, VTK_QUAD, VTK_QUADRATIC_QUAD and so on.
Additionally within these elements integration points are defined, which are
distributed across the element. The distribution is three dimensional, based on the thickness of the element and is ordered in layers.

The combination of *shell elements* and the three dimensional distribution of integration points must be handled in VTK, because
*shell elements* are used most of the time in FEA.

That means, the quadrature and integration model must handle the schemes. A thickness must be provided for each element, node or integration point. Based on the thickness, the three dimensional parametric coordinates of the quadrature and the element normals, the position of an integration point within, below or upper the element can be computed.

Classes derived from *vtkIntegrationMethodBase* should implement such algorithms. The thickness must be provide as optional
parameter to the computation method.

#### Other issues

This approach is just a simple sketch and may be modified and extended in the future. An UML diagram may follow.

**An important issue is, how to store such data in the VTK XML format?**