您好,欢迎来到华拓科技网。
搜索
您的当前位置:首页FERView An Interactive Finite Element Post-Processor

FERView An Interactive Finite Element Post-Processor

来源:华拓科技网
COMPUTATIONAL MECHANICS

WCCM VI in conjunction with APCOM’04, Sept. 5-10, 2004, Beijing, China© 2004 Tsinghua University Press & Springer-Verlag

FER/View – An Interactive Finite Element Post-Processor

Z.Q. Feng*, Z.G. Feng

Laboratoire de Mécanique d'Evry, Université d'Evry, 40, rue du Pelvoux, 91020 Evry, Francee-mail: feng@iup.univ-evry.fr

Abstract Development of user-friendly and flexible scientific programs is a key to their usage,extension and maintenance. This paper describes the main features of FER/View, an interactive finiteelement post-processor developed by using an OOP (Object-Oriented Programming) approach and thegraphic standard OpenGL. This software has been specifically designed to fulfill most of the commonrequirements of engineers and numericians, in the context of finite element simulations. This program israther intuitive with a friendly GUI and, therefore, the user does not really need any specific learningstage prior to be able to use it. Several post-processing examples with graphical representations illustratesome functionalities of the program: to visualize and manipulate mesh data structures via the mouse, todeal with scalar/tensor values associated with a mesh and to deal with more advanced features (e.g.,interactive animations, cutting planes or texture transparency, etc.).

Key words: post-processing, object-oriented programming, graphical user interface, finite elementINTRODUCTION

Numerical modeling is a powerful technique for the solution of complex engineering problems. Thefinite element method is the most used in engineering computations. One of the significant requirementsin the design of a scientific computing program is the ability to store, retrieve, and process data thatmaybe complex and varied. Numerous applications of numerical simulations based on finiteelement/volume methods involve a mesh of the computational domain as spatial support. In this context,it is often necessary to visualize this mesh and the solutions associated with mesh entities. This istypically the aim of a scientific visualization tool (also called a post-processing tool). Hence, the use ofgraphical devices allows, provided the software is well-suited to the problem considered, the user toappreciate and even to analyze a mesh and/or a solution. To be efficient and pertinent, this tool must befast and should offer various features, if possible, in a user-friendly environment (i.e., convivial andinteractive). To the users of such a program, it is important not only to have a powerful solver, but also towork in a convivial graphical interface environment. On the other hand, as the problems to solve havegrown in size and complexity, the codes have also grown with complex mathematical procedures anddata control. This places a high demand for maintenance, new developments and re-use on theprogramming strategy and language chosen. It exists a lot of finite element analysis programs such asANSYS, ABAQUS, etc. which have their own post processors. There are also some specific post-processing tools such as GiD [1], Tecplot [2] …

The aim of this paper is to present the development of the program FER/View: an interactive finiteelement post processor with friendly graphical user interfaces. FER/View cannot be considered as asubstitute to the existing graphical tools, but it is more a simple alternative to users that need to quicklylook at a result within a convivial interface rather than a complex GUI.

The primary goal of the present paper is to illustrate the capabilities and effectiveness of FER/View.Section 1 outlines some concepts of the object-oriented approach in developing scientific programs.Section 2 describes the general organization of FER/View and its main features. Section 3 gives severalpost-processing examples to illustrate some functionalities of FER/View, described in Section 2.

1. Object-Oriented Programming in C++

This section describes some concepts and terminology of object-oriented programming. The basicconcept of object-oriented programming is the encapsulation of data structure and a set of functions(procedures) manipulating the data in prepackaged software components called objects. By using anobject-oriented language such as C++, a natural way of manipulating finite element objects such as node,element, boundary conditions, matrix, vector can be adopted. The notion of \"object\" has been widelyemployed in many computer science fields. As compared with the traditional function-orientedprogramming technique, object-oriented programming is more structured and modular, yieldingprograms that are easily maintained, resilient, and powerful because of its basic features: dataabstraction, encapsulation and data-hiding, modularity, classes, hierarchy and inheritance, polymorphismand dynamic binding etc. However, this notion is not largely used in the field of numerical simulation.We know that most programs in scientific computing are written in FORTRAN, in which it is difficult towrite structural and object-oriented programs even though a concerted effort has been made in this field.Of the many possible programming languages, C++ is being increasingly used in engineeringapplications because it was designed to support data abstraction structure and object-orientedprogramming. In addition, C++ is the extension of the popular language C. So it is becoming the firstchoice for scientists and engineers to develop object-oriented programs for the analysis of engineeringproblems [3-8].

The benefit of an object-oriented approach in C++ is mainly due to the definition of classes. A class isdefined by the groups of objects that have the same kind of data and procedures. Objects are calledinstances of a class in the same sense as standard FORTRAN variables are instances of a given data type.The class concept can be reviewed as an extension of the record concept in Pascal or struct concept in Cto provide a set of attached procedures acting on the data. Unlike conventional programming techniques,which require the developer to represent data and procedures separately, an object in C++ is a user-defined and self-contained entity composed of data (private or public) and procedures. This allowsdevelopers to design objects which know how to behave. Box 1 shows an example of the classELEMENT used in FER/View.

class ELEMENT {protected:int m_number;// element numberint m_nnel;// number of nodesint m_imat;// material number VECTINT elem_node;// element connectivity public:static NODE *node;static CONTROL *control;static POSTPRO *postpro;static BOOL CalculateNormal(float*, float*, float*);virtual void DrawMesh(){};virtual void DrawContour(){};virtual void WriteAsc(fstream& ASC);int getNumero(){ return m_ number; };ELEMENT();ELEMENT(int id, int *elemtype, int *elemnode);virtual ~ELEMENT();};Box 1. ELEMENT class definition

In this class, m_number, m_nnel, etc. are protected data of type integer, and elem_node is an instance ofthe class VECTINT that is another user-defined class defining an integer vector. DrawMesh, WriteAsc,etc. are member functions (procedures) of object ELEMENT. ELEMENT() and ~ELEMENT() arerespectively the default constructor and destructor. A high-level object can be created by assembling agroup of objects. This new object has the collective functionality of its sub-objects. This concept ofobject abstraction can be extended to the complete software applications. A program assembled from

objects can itself be an object and thus be included in another program. This method has been appliedwhen building the solid mechanics analysis program FER/Solid by adding the finite element solver intoFER/View [9].

One of the fundamental techniques in object-oriented programming is the use of inheritance. Inheritanceis a way of creating new classes called derived classes, which extend the facilities of existing classes byincluding new data and function members, as well as changing existing functions. For instance, thedevelopment of FER/View requires the creation of class CFerMechApp which is the derived class ofMFC class CWinApp for Windows applications [10] (Box 2).

class CFerMechApp : public CWinApp {public:CFerMechApp();// ClassWizard generated virtual function overrides//{{AFX_VIRTUAL(CFerMechApp)public:virtual BOOL InitInstance();//}}AFX_VIRTUAL//{{AFX_MSG(CFerMechApp)afx_msg void OnAppAbout();//}}AFX_MSGDECLARE_MESSAGE_MAP()};Box 2. Derived classes

It is noted that objects communicate with each other by sending messages. When an object receives amessage, it interprets that message, and executes one of its procedures. That procedure operates on theprivate data of the object. So the internal details of how it functions are hidden from the program thatuses the object. This also means that the internal function of an object could be modified without havingto change the rest of the program. Thus, the program becomes modular and easy to read. Withoutentering into the details, Fig. 1 shows the principal database mapping of FER/View.

NODECONTROLCOLORXYPLOTMESHVECTORELEMENTELEM_SOLID2DELEM_SOLID3DELEM_SHELLFER/ViewMATRIXPLOT2DPLOT3DFILE_IOFig. 1. Principal class diagram of FER/View

The class CONTROL stores some control flags about light, plot symmetry, animation, dynamic rotationor move, etc. XYPLOT stores the numerical result date and procedures for time history curve plot ofdynamic response. ELEM_SOLID2D, ELEM_SHELL, etc. are inherited from the base class ELEMENT. It is worth noting that many components of FER/View have directly been used to create another multi-body dynamics analysis program FER/Mech [10]. Object-oriented programming makes this possible and

allows rapid development of new software. Reusability is so becoming a key issue in softwaredevelopment.

2. General Organization of FER/View

FER/View is an integrated environment composed of several functional modules. Fig. 2 summarizes themain ones.

FER/ViewInput/OutputIsoValue interpolationAnimationGraphical InterfaceXY plotFig. 2. General organization of FER/View

MFC (Microsoft Foundation Class) [11] has been proposed by Microsoft for the easy development ofWindows applications. In this project, MFC is largely used to design the user-interface objects such asDialog boxes, Menu, Icons, Tool Bar, String Table, etc. OpenGL [12] is a relatively new industrystandard that in only a few years has gained an enormous following. It is now a standard graphics libraryintegrated in Windows or UNIX systems. OpenGL is a procedural rather than a descriptive graphicslanguage. Instead of describing the scene and how it should appear, the programmer actually describesthe steps necessary to achieve a certain appearance or effect. These steps involve calls to a highlyportable API (Application Programming Interface) that includes approximately 120 commands andfunctions. These are used to draw graphics primitives such as points, lines, and polygons in threedimensions. In addition, OpenGL supports lighting and shading, texture mapping, animation, and otherspecial effects. A lot of these capabilities have been implemented in FER/View. The result issatisfactory. The user-interface of the program is shown in Fig. 3.

Fig. 3. Friendly user-interface of FER/View

FER/View has many functionalities, some main features being summarized as follows:

• Load the model (neutral file) and the results (output file)

• Available not only for the general finite element static or dynamic analysis, but also for the model

with variable numbers of nodes and elements during computation (i.e. using remeshing method)• Plot node, element mesh and geometry shape

• Display mesh deformation. All visualization techniques use the deformed mesh with undeformedmesh overlay

• Display different colors according to the element property• Display node, element or material number• Plot contours, iso-line, iso-surface and vector

• Display minimum and/or maximum values of data for the current time step or for all time steps• Change the color division number for contour or iso-line etc. plot• Add or cancel light effects and wire frame• Display selected elements group• Display time history of multiple data

• Display the distribution curve of data on a line path

• Use mouse operation for rotation, pan and zoom as well as node and element picking• Save and print images and curves

• Animate the results in any case of display mode• Plot cutting plane

• Construct automatically feature edges• Show transparent view.3. Demonstrated examples

In order to illustrate and validate the functions of FER/View, discussed above, several post-processingexamples of different nature have been realized. It is interesting to note that although the program is ofsmall size (1.07 Mo), it can be used for different engineering problems: solid mechanics, fluid dynamics,geometry analysis, etc.

3.1 Plasma spray process: a multi-physics problem

We consider a fully molten pure aluminum particle impacting onto a rigid steel substrate withsimultaneous heat transfer [13]. Fig.4 shows the deformation of the mesh during the impact process. It isnoted that the mesh is always uniform in the computation due to an automatic remeshing technique. Thenumber of elements is so changed at each time step. Such situation makes it difficult to use thecommercial software such as ANSYS, I-DEAS, etc. to visualize the results. This particular case isaccounted for in FER/View. In addition, a three-dimensional animation can be generated from the bi-dimensional computations and the velocity field can be represented by the vector plot (Fig.5).

t=0

t=0.2 µs

t=0.6 µs

Fig.4. Plasma spray process: deformed meshes at different time

Fig.5. Three-dimensional animation and vector plot

3.2 Performance test

In order to show the efficiency of FER/View, we propose two tests performed on a PC with the OSWindows XP. The specifications of the PC used are: Pentium4, 2.8Ghz, 1 Go (SDRam at 333 MHz),video Nvidia GeForce Ti4200 128 Mo, hard disc IDE 80 Go.

The first test deals with a mesh with 150 779 tetrahedral elements and with one sequence of results (threetranslations and seven stress components on each node), as shown in Fig. 3. The elapsed time to open thefile and to plot the model is about 3s. The animation, rotation, zoom, pan,… are quite fluid.

The second example is the biggest model viewed up to now by FER/View: 1329865 nodes and 2673604three-dimensional triangular elements (Fig. 6). The elapsed time to open the file and to plot the model isabout 30s.

Fig.6. Huge model viewed by FER/View

3.3 Iso-surface and streamline plot in CFD – Computational Fluid Dynamics

The first CFD example simulates the incompressible swirling flow inside a cylindrical tank, generated bythe rotation of one lid [14]. This model is composed of 320000 nodes and 313632 three-dimensionalhexahedral elements. Fig.7 displays the iso-surfaces of the fluctuating axial velocity with respect to asteady axisymmetric base flow. It is worth noting that the generation and the visualization of the iso-surfaces take only about 2s.

Fig.7. Iso-surface plot

The second CFD example deals with the aerodynamic flowfield around a rectangular obstacle [15]. Fig.8shows the streamlines from which we can see the separation bubbles and the vortex shedding.

Fig.8. Streamlines plot

3.4 Cutting plane plot

Sometimes, when modeling complex three-dimensional solids, we need to see what happens inside thestructure. This task can be easily realized by picking three nodes directly on the screen to define a cuttingplane, as shown in Fig. 9.

Fig.9. Cutting plane

3.5 Transparent view and feature edge

In FER/View, it is also possible to make some areas to be transparent in order to have a global view ofcomplex structures, as shown in Fig. 10 and Fig. 11. From the mesh model (i.e. the nodes and theelements), we can create automatically the feature edges with FER/View, as shown in Fig. 11.

Fig.10. Transparent view

Fig.11. Feature edges

4. Conclusions

In this paper, we have presented the software prototype FER/View. The development of FER/View hasbeen focused on the simplicity, speed, effectiveness and the conviviality. The open architecture of theprogram due to the object-oriented programming technique facilitates further developments and adapts tosuit specific needs easily and quickly. Moreover, the proposed graphical user interface has proved to besatisfactory and flexible as we can see from the post-processing examples. Some advanced features havebeen developed in FER/View and the results are encouraging as illustrated by the examples. We wouldconclude that FER/View helps effectively the solver developers to examine their results quickly andeasily. The authors feel confident that object-oriented programming in C++ will promote thedevelopment of computational tools for engineering sciences and GUI applications.

Acknowledgements The authors gratefully acknowledge Prof. Olivier Daube and Dr. Grégory Turbelinfor providing the CFD examples. The mesh models (Fig. 6 and Fig. 10) are downloaded from the site ofINRIA [16].

REFERENCES

[1] http://gid.cimne.upc.es/[2] http://www.tecplot.com/

[3] B.W.R. Forde, R.O. Foschi, S.F. Stiemer, Object-oriented finite element analysis, Computers &

Structures, 34, (1990), 355-374.[4] R.I. Mackie, Object-oriented programming of the finite element method, Int. J. Num. Meth. Eng.,

35, (1992), 425-436.[5] S.P Scholz, Elements of an object-oriented FEM++ program in C++, Computers & Structures, 43,

(1992), 517-529.[6] Z.Q. Feng, K. Aazizou, F. Hourlier, Modélisation des problèmes de contact avec frottement –

Implantation en C++ dans le code ZéBuLoN, Colloque National en Calcul des Structures, 11-14mai Giens, France, 2, (1993),1141-1156.[7] Y. Duboispelerin, T. Zimmermann, Object-oriented finite element programming, 3. An efficient

implementation in C++, Comput. Meth. App. Mech. Eng., 108, (1993), 165-183.[8] G.W. Zeglinski, R.P.S. Han, P. Aitchison, Object-oriented matrix classes for use in a finite element

code using C++, Int. J. Num. Meth. Eng., 37,(1994), 3921-3937.[9] http://gmfe16.cemif.univ-evry.fr:8080/~feng/FerSystem.html.

[10] Z.Q. Feng, P. Joli, N. Séguy, FER/Mech - A software with interactive graphics for the dynamic

analysis of multibody systems, Advances in Engineering Software, 35, (2004), 1-8. [11] M. Brain, L. Lovette, Developing professional applications for Windows 95 and NT using MFC,

Prentice Hall PTR, 1997. [12] R.S. Jr. Wright, M. Sweet, OpenGL Superbible: the complete guide to OpenGL programming for

Windows NT and Windows 95, Waite Group Press, (1996).[13] Z.G. Feng, Z.Q. Feng, M. Domaszewski, G. Montavon, Lagrangian method and remeshing

technique for modeling of spreading of liquid particle during plasma spray process, IDMME’98 –2nd International Conference on Integrated Design and Manufacturing in Mechanical Engineering,Compiègne, France, 1, (27-29 May, 1998), 175-182.[14] E. Barbosa, O. Daube, Multiple solutions for three-dimensional swirling flow, C.A. Mecanique,

330, (2002), 791-796.[15] G. Turbelin, R.J. Gibert, CFD calculations of indicial lift responses for bluff bodies, Wind &

Structures, 5, (2002), 245-256.[16] http://www-rocq1.inria.fr/Eric.Saltel/download/

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- huatuo6.cn 版权所有 赣ICP备2024042791号-9

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务