[vtk-developers] how to handle FEM data in VTK?

Francois Bertel francois.bertel at kitware.com
Wed Jul 16 13:30:55 EDT 2008


Hello Pierre,

Here is how the adaptor framework works:

The fundamental class is vtkGenericDataSet (VTK/Filtering). This an
abstract one.
You have to write a derived class which implements all the pure
virtual methods of vtkGenericDataSet.
This derivation has to be done in C++.

Let's call this class myFEMDataSet.

Once this class is written and other related abstract classes, you can
wrap them automatically in any other programming language
supported by VTK (Tcl, Python, Java).

The other abstract classes (alll in VTK/Filtering) you have to implement are:
vtkGenericAdaptorCell, (it is not called vtkGenericCell because this
name was already taken by another VTK class for a totally different
purpose...)
vtkGenericAttributeCollection,
vtkGenericAttribute,
vtkGenericCellIterator,
and vtkGenericPointIterator.

There are a couple of filters (all concrete classes) which can digest
generic datasets (in VTK/GenericFiltering):
vtkGenericClip, vtkGenericContourFilter, vtkGenericCutter,
vtkGenericDataSetTessellator,
vtkGenericGeometryFilter, vtkGenericGlyph3DFilter,
vtkGenericOutlineFilter and vtkGenericStreamTracer.

VTK doesn't know about the actual interpolation functions and
parameters (can be gauss points for you, can be B-spline for other
people ) used to describe the geometry or the attribute
values. (Forget about the DOF nodes, it is not used by the concrete
class which performs the tessellation of a cell
(vtkSimpleCellTessellator) ). It just calls requests on the
vtkGenericCellIterator for the geometry and on vtkGenericAttribute for
the attribute values.

For instance, in the derived class of vtkGenericCellIterator, you will
implement EvaluateLocation() with the interpolation function and
parameters
used for the geometry, you will implement InterpolateTuple() with the
interpolation function and parameters used for the attributes.

In VTK, we test the classes with some regression tests located in
VTK/GenericFiltering/Testing/Cxx. We have a concrete implementation
(vtkBridgeDataSet and other vtkBridge*) in the testing directory which
implements vtkGenericDataSet for the VTK classes themselves. This is a
good starting point for implementing your own myFEM* classes.


Once you are done with the dataset itself, you also have to write a
source (for example a reader) capable of generating a
vtkGenericDataSet/myFEMDataSet. To achieve that, you derive a class
from the abstract class vtkGenericDataSetAlgorithm (in VTK/Filtering).

No, the vtkLSDynaReader is not using the adaptor framework (otherwise
vtkGenericDataSetAlgorithm would be one of its superclasses ).  ref:
http://www.vtk.org/doc/nightly/html/classvtkLSDynaReader.html

Regards.

On Sun, Jul 13, 2008 at 2:53 PM, Pierre JUILLARD
<pierre.juillard at gmail.com> wrote:
> Dear Mr. Schroeder and Mr. Bertel,
>
>
> I thank you to point me out the paper
> http://www.vtk.org/pdf/AdaptorFramework.pdf
> I read it as thoroughly as possible for a non-expert..., and saw that
> actually, the part of interest for me is maybe the simplest one: part 3.1
> "Adaptator Framework".
>
> However, if it briefly lists the classes with which one should deal with, I
> remain lost...
> So I dare send you this additional e-mail gathering questions with the hope
> to shed bright sunny day light on this topic.
>
> ===================================================================
> "implementation strategy"
>
> One difficulty for me is that I don't really see how to use it.
> According to your previous e-mail:
> "The point is, rather than trying to shoehorn FEM data structures into VTK
> (which is not pretty), you can build adaptors from VTK to native FEM codes
> and data structures."
>
> However, after reading your article, I don't really see the difference
> between the first and second strategy.
> In any case, I will need to write a small code to read FEM data and store
> them in a VTK file (using the adptator framework new classes) if I want to
> visualize results in ParaView, won't I?
>
> ===================================================================
> "dealing with interpolation function information"
>
> Because from structural mechanic FE solvers, results are given as stress and
> strain tensors given at integration points, I guess that some of the
> information related to these integration points are also needed in the VTK
> file.
>
> It seems to me that you write an interesting paragraph on that subject in
> the article:
> "A new concept that we refer to as DOF nodes was introduced into the design.
> These nodes represent collections of coefficients at each topological entity
> of a cell, [...].The coefficients define the interpolation function on the
> particular topological entity with which the DOF node is associated. [...]"
>
> I enclosed a png file showing the information related to the integration
> points that I think are needed: their corresponding location and weight
> factor for a reduced quadrangle using the Gauss quadrature for the
> out-of-plane integration.
> In any case, I don't have much more information about the interpolation
> function than this information, but I think it will do... Could you please
> confirm me that we can store this information thanks to the adaptator
> framework new classes, and that the DOF nodes are indeed the appropriate
> candidates for such a purpose?
>
> ===================================================================
> "time for an application"
>
> I had a look in the documentation on the CD:
> VTK/Source/VTK/GenericFiltering/README.html
> Here again, I had no real success in having the beginning of a clue as to
> how making use of the adaptator framework.
>
> I also checked the class documentation:
> http://www.vtk.org/doc/nightly/html/classvtkGenericAdaptorCell.html
> http://www.vtk.org/doc/nightly/html/classvtkGenericDataSet.html
> http://www.vtk.org/doc/nightly/html/classvtkGenericPointIterator.html
> http://www.vtk.org/doc/nightly/html/classvtkGenericCellIterator.html
> http://www.vtk.org/doc/nightly/html/classvtkGenericAttribute.html
>
> My conclusion is that I'm doubting of my brain, no jocking...
> The first class is speaking about DOF nodes, but I see nowhere how I could
> initialize the coefficients which would define the interpolation functions.
>
> Based on my previous example, how should I write that I have 5 out-of-plane
> integration points, as well as their corresponding weights and locations
> (assuming that I'm right in wanting to store this information in a VTK
> file)?
> Once that is done, how ordering the cell attribute data (my 5 stress and
> strain tensors) such that I know which one is related to the 1st integration
> point, which one to the second integration point, and so on...?
>
> ===================================================================
> "miscellaneous"
>
> ______________________________________________________________________
>
> Are we forced to use C++ to make use of the framework?
>
> I indeed read in:
> http://www.vtk.org/doc/nightly/html/classvtkGenericAdaptorCell.html
> "vtkGenericAdaptorCell [...] also adopts modern C++ practices including
> using iterators."
> while in:
> The VTK User's Guide, chapt. 3.3, p. 34
> "One major limitation you'll find is that some C++ applications cannot be
> converted to the other three laguages because of pointer manipulation."
>
> Does it mean that I won't be able to do it using the java language?
> ______________________________________________________________________
>
> Is the LSDynaReader making use of the Adaptator FrameWork?
>
> ===================================================================
> "vocabulary"
>
> I see in the references listed in the
> http://www.vtk.org/pdf/AdaptorFramework.pdf the book:
> [5] R.D. Cook, D.S. Malkus, and M.E. Plesha. Concepts and Applications of
> Finite Element Analysis. John-Wiley, third edition, 1989
>
> What I'm calling integration point is refered to in this book as sampling
> point
> (p.210: Table 6.3-1: sampling point location and qeight factors for Gauss
> quadrature)
> (well, I have the fourth edition, 2002)
>
> ===================================================================
>
>
> I am very sorry not to show a great understanding of the documentation, and
> I thank you very much for all the help you could provide me on this complex
> subject.
>
> Best regards,
>
>
> Pierre
>
>
>
>
> 2008/7/8 Will Schroeder <will.schroeder at kitware.com>:
>>
>> Please read the paper http://www.vtk.org/pdf/AdaptorFramework.pdf. This
>> may help shed light on the topic. The point is, rather than trying to
>> shoehorn FEM data structures into VTK (which is not pretty), you can build
>> adaptors from VTK to native FEM codes and data structures.
>> W
>>
>> 2008/7/3 Pierre JUILLARD <pierre.juillard at gmail.com>:
>>>
>>> Hi all,
>>>
>>> I would like to have information about the best way to handle FEM data in
>>> VTK file.
>>>
>>> Mainly, we use shell meshes (triangles or quadrangles) and the following
>>> data would be manipulated in VTK:
>>> - reduced element or fully integrated (1 or 4 integration point in the
>>> neutral fibre)
>>> - different integration point over thickness per element (1, 3, 5, 7, 9,
>>> 11, ...)
>>> - different integration algorithms over thickness (GAUSS, SIMPSON, ....)
>>> defining different weight and locations of these integration points over
>>> thickness
>>> - stress tensor at each integration point over thickness
>>> - strain tensor at each integration point over thickness
>>> - effective plastic strain at each integration point over thickness
>>> - thickness at each integration point in the neutral fibre
>>> and possibly additional results per integration points...
>>>
>>> This topic seems to have already been tackled.
>>> Indeed, I have read several posts about the vtkLSDynaReader class, as
>>> well as its documentation on
>>> http://public.kitware.com/VTK/doc/nightly/html/classvtkLSDynaReader.html
>>>
>>> As it is indicated in one of the post, the ultimate goal would be to
>>> benefit from vtk format/library to manipulate FEM data, and  from ParaView
>>> as PostProcessor
>>>
>>> However, from these posts, it seems that VTK is not really fitted to
>>> store FEM data, and for such a purpose, a good knowledge in VTK is
>>> necessary. It may also be necessary to extend it.
>>>
>>> Most notably, it seems currently possible to have only one scalar field,
>>> vector field, and tensor field per element. In the last VTK versions, has
>>> this "limitation" been overriden?
>>> Is it possible to store several fields of different types per element?
>>>
>>> Would you have some advices about the best way to proceed?
>>> Is there somewhere some guidelines/tutorials?
>>>
>>> It the VTK format has still some limitations, is it foreseen to override
>>> them in the next release?
>>>
>>> I thank you for your help.
>>>
>>> Cheers,
>>> _______________________________________________
>>> vtk-developers mailing list
>>> vtk-developers at vtk.org
>>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>>
>>
>>
>>
>> --
>> William J. Schroeder, PhD
>> Kitware, Inc.
>> 28 Corporate Drive
>> Clifton Park, NY 12065
>> will.schroeder at kitware.com
>> http://www.kitware.com
>> 518-371-3971 (phone and fax)
>



-- 
François Bertel, PhD | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
 | Clifton Park NY 12065, USA



More information about the vtk-developers mailing list