An Object Oriented Finite Element Library

Similar documents
An Object Oriented Finite Element Toolkit

An Introduction to MATLAB Programming

Finite Element Implementation

A numerical grid and grid less (Mesh less) techniques for the solution of 2D Laplace equation

OOFEM An Object Oriented Framework for Finite Element Analysis B. Patzák, Z. Bittnar

ANSYS 5.6 Tutorials Lecture # 2 - Static Structural Analysis

Method of Finite Elements I

Modeling and Simulation in Scilab/Scicos with ScicosLab 4.4

Finite Element Analysis using ANSYS Mechanical APDL & ANSYS Workbench

ViennaFEM User Manual. Institute for Microelectronics Gußhausstraße / E360 A-1040 Vienna, Austria/Europe

EFFICIENT SOLVER FOR LINEAR ALGEBRAIC EQUATIONS ON PARALLEL ARCHITECTURE USING MPI

Contents. I The Basic Framework for Stationary Problems 1

Introduction to Design Optimization

An Introduction to MATLAB. Lab tutor : Dennis Yang LIU Lab 1: Sept. 11, 2014

Developing Microsoft.NET Applications for Windows (Visual Basic.NET)

Object Oriented Finite Element Modeling

New Programming Paradigms

ME 345: Modeling & Simulation. Introduction to Finite Element Method

Journal of Engineering Research and Studies E-ISSN

Microsoft Visual Basic 2005: Reloaded

Software Tools and Systems Programming: Assignment 3

Computational Fluid Dynamics - Incompressible Flows

Mathematica for Scientists and Engineers

Presented by Wayne Arter CCFE, Culham Science Centre, Abingdon, Oxon., UK

ADMINISTRATIVE MANAGEMENT COLLEGE

Finite Element Analysis Prof. Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology, Madras. Lecture - 24

2D & 3D Finite Element Method Packages of CEMTool for Engineering PDE Problems

Multiple Choice Questions. Chapter 5

MA400: Financial Mathematics

Object Orientated Analysis and Design. Benjamin Kenwright

1.2 Numerical Solutions of Flow Problems

Netgen/NGSolve Tutorial Part 3 - Programming with Netgen/NGSolve

The numerical simulation of complex PDE problems. A numerical simulation project The finite element method for solving a boundary-value problem in R 2

MATLAB is a multi-paradigm numerical computing environment fourth-generation programming language. A proprietary programming language developed by

Netgen/NGSolve Tutorial Part 3 - Programming with Netgen/NGSolve

ENGINEERING PROBLEM SOLVING WITH C++

MATLAB 7. The Language of Technical Computing KEY FEATURES

Programming in Visual Basic with Microsoft Visual Studio 2010

What is Multigrid? They have been extended to solve a wide variety of other problems, linear and nonlinear.

MATLAB. Miran H. S. Mohammed. Lecture 1

Computer Vision. Matlab

PROGRAMMING IN VISUAL BASIC WITH MICROSOFT VISUAL STUDIO Course: 10550A; Duration: 5 Days; Instructor-led

Matlab Programming MET 164 1/24

A Parallel Implementation of the BDDC Method for Linear Elasticity

ERCIM Alain Bensoussan Fellowship Scientific Report

Object-oriented programming in boundary element methods using C11

Finite Element Analysis Prof. Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology, Madras. Lecture - 36

A PARALLEL IMPLEMENTATION OF A FEM SOLVER IN SCILAB

Introduction to Matlab

The Application of EXCEL in Teaching Finite Element Analysis to Final Year Engineering Students.

Computer Life (CPL) ISSN: Finite Element Analysis of Bearing Box on SolidWorks

Inverse Kinematics. Given a desired position (p) & orientation (R) of the end-effector

MATLAB The first steps. Edited by Péter Vass

: What is Finite Element Analysis (FEA)?

Using Periodic Boundary Conditions

Figure E3-1 A plane struss structure under applied loading. Start MARC Designer. From the main menu, select STATIC STRESS ANALYSIS.

UEE1302 (1102) F10: Introduction to Computers and Programming

How does your Swiss cheese deform?

CHAPTER 5 GENERAL OOP CONCEPTS

Agent-based Modeling using L S D

Demo problem: Solution of a "free-boundary" Poisson problem in an "elastic" domain revisited -- this time with AlgebraicElements

IMPLEMENTATION OF AN OPTIMAL MATRIX-CHAIN PRODUCT EXPLOITING MATRIX SPECIALIZATION

Introduction to MATLAB

MATFOR In Visual C# ANCAD INCORPORATED. TEL: +886(2) FAX: +886(2)

Static analysis of eolicblade through finite element method and OOP C++

CPS221 Lecture: Operating System Functions

Interpolation & Polynomial Approximation. Cubic Spline Interpolation II

PetIGA. A Framework for High Performance Isogeometric Analysis. Santa Fe, Argentina. Knoxville, United States. Thuwal, Saudi Arabia

Generalized framework for solving 2D FE problems

Instruction Manual: Relaxation Algorithm

CHAPTER 1. Introduction

STABILIZED FINITE ELEMENT METHODS FOR INCOMPRESSIBLE FLOWS WITH EMPHASIS ON MOVING BOUNDARIES AND INTERFACES

Object-Oriented Software Engineering. Chapter 2: Review of Object Orientation

Demo problem: Upgrading a GeomObject to a GeneralisedElement -- how to parametrise unknown domain boundaries

Computer Programming C++ (wg) CCOs

Introduction to Programming Microsoft.NET Applications with Visual Studio 2008 (C#)

Adaptive numerical methods

BDDCML. solver library based on Multi-Level Balancing Domain Decomposition by Constraints copyright (C) Jakub Šístek version 1.

Just the Facts Small-Sliding Contact in ANSYS Mechanical

PV-WAVE 8.5 Installation Guide

Centre de Calcul de l Institut National de Physique Nucléaire et de Physique des Particules. Singularity overview. Vanessa HAMAR

Python Scripting for Computational Science

Linear Algebra libraries in Debian. DebConf 10 New York 05/08/2010 Sylvestre

GUT. GUT Installation Guide

Interfacing with C++

Multiple-Threaded Nearest Point Algorithm Operating Systems (CSCI-4210) --- A Project Report

Operating Systems CMPSCI 377, Lec 2 Intro to C/C++ Prashant Shenoy University of Massachusetts Amherst

Module 1: Introduction to Finite Element Analysis. Lecture 4: Steps in Finite Element Analysis

Advantages of Object Oriented Programming :- Features of Object Oriented Programming :- Advantages Of Object Oriented Programming :

CHOICE BASED CREDIT SYSTEM (With effect from )

CPSC 427a: Object-Oriented Programming

Introduction to MATLAB

HPC Python Tutorial: Introduction to FEniCS 4/23/2012. Instructor: Yaakoub El Khamra, Research Associate, TACC

Meshing of flow and heat transfer problems

Abaqus Technology Brief. Two-Pass Rolling Simulation

A higher-order finite volume method with collocated grid arrangement for incompressible flows

Getting Started Guide Bayesian Filtering Library. Tinne De Laet, Wim Meeussen, Klaas Gadeyne

Large-scale Structural Analysis Using General Sparse Matrix Technique

Secure coding practices

Navier-Stokes solver. English tutorial. June

Transcription:

An Object Oriented Finite Element Library Release 3.1.0

Rachid Touzani Laboratoire de Mathématiques Blaise Pascal Université Clermont Auvergne 63177 Aubière, France e-mail: Rachid.Touzani@univ-bpclermont.fr i

ii

This document is a brief presentation of a library of C++ classes for the development of object oriented finite element codes. The library (called OFELI for Object Finite Element Library) is a toolkit of utility functions. The numerical solution of the linear system of equations can be performed either using direct methods or more sophisticated preconditioned iteration techniques. The package contains a set of examples of finite element codes that can serve as prototypes for more sophisticated applications. The OFELI library was mainly developed by R. Touzani. Other people have contributed to this development either by writing a particular class, or by testing some parts of the library or simply by fruitful discussions. Rachid Touzani March 2016 iii

iv

Contents 1 Introduction 1 2 The OFELI Package 1 3 License Agreement 1 4 Programming Considerations 2 4.1 Namespaces................................ 2 4.2 Variable Names.............................. 2 4.3 Inheritance................................. 2 4.4 Template classes.............................. 2 4.5 Pre and Post Processing......................... 2 5 Classes in OFELI 2 5.1 Mesh data................................. 3 5.2 Vectors................................... 3 5.3 Matrices.................................. 3 5.4 Boundary conditions, Forces,........................ 3 5.5 Material data............................... 3 5.6 Finite Element Equations......................... 3 5.7 Finite Element Shapes........................... 3 5.8 OFELI Files................................ 4 6 Installation 4 6.1 Installation Procedure on UNIX-like systems............... 4 6.2 Installation Procedure on Windows systems............... 4 v

vi

1 Introduction 2 The OFELI Package 3 License Agreement Object oriented programming is widely used in scientific computing and particularly in finite element coding. The finite element method is well adapted to object oriented coding for the following reasons: 1. Finite element mesh data structuring is handled in an elegant and efficient way. Moreover, for adaptive mesh strategies, object techniques are well adapted to manipulating mesh elements and nodes. For instance, removing or adding an element can be easily handled by using list structures to store element data. 2. Implementation of algorithms for the linear system of equations has to take matrix storage schemes into account. For this, overloading and template features in C++ are well adapted and help implement storage independent codes. 3. Using other C++ finite element libraries is handled more efficiently thanks to encapsulation properties of this language. This document presents an object oriented library of classes for finite element solution of boundary and initial value problems. The library is called OFELI (Object Finite Element Library). It provides a finite element developer tools to write concise and user friendly codes either for simple finite element programs or for large scale applications using sophisticated solution techniques like preconditioned iteration algorithms. The library OFELI is written in ANSI C++ and was tested on the most used computer systems. As in any C++ code, OFELI is programmed in such a way that a finite element code developer manipulates objects rather than data. Hence, a collection of classes is defined. Each class corresponds to a particular type of information in a Finite Element computation. This document constitutes a general overview in which we review some considerations about the implementation of the OFELI library and then describe the most used classes. The structure of our standard mesh data is then given. We then define the installation procedure for both Windows and Unix like systems. The OFELI package is more than a finite element code. Actually, OFELI is a (toolkit) library of classes for Finite Element developments. The current version of the package contains extensive documentation: 1. OFELI, An object Finite Element Library: The present document. 2. OFELI, User s Guide : Here we present some examples and then a tutorial to develop finite element codes and new classes in OFELI. 3. OFELI, Reference Guide : This document contains a detailed description of each class of the kernel library. Naturally, only public members and attributes of classes are outlined. Notice that problem dependent classes are not in this document. For this, the following documents are to be consulted. 4. OFELI, Mathematical Foundations: This document is currently in preparation. OFELI is free but Copyrighted software. It is distributed under the terms of the GNU Lesser General Public License (LGPL). Details of the LGPL are in the file COPYING that comes with the OFELI software package. More details can be found in the site http://www.gnu.org/licenses/. 1

4 Programming Considerations 4.1 Namespaces 4.2 Variable Names 4.3 Inheritance 4.4 Template classes 4.5 Pre and Post Processing 5 Classes in OFELI Let us outline some of the principles we have followed in programming the OFELI library. The whole package OFELI is included in the namespace OFELI. This feature allows combining the use of OFELI with other packages. To clarify the programming, all classes have names that start with a capital letter like Node or Mesh. Moreover, all public members and attributes share this property, private or protected members having no capital letters and beginning with an underscore sign. For efficiency reasons, we did not make an extensive use of inheritance between classes. The only inheritances are from abstract classes and are therefore transparent for a developer. Of course inheritance advantages can be exploited by a developer to complete the OFELI classes. 1. All matrix classes inherit from a template abstract matrix class called Matrix<>. This was useful for implementing some general purpose manipulation of matrices that do not depend on the storage. 2. All finite element equation classes derive from the template abstract template class AbsEqua<>. 3. Finite element shape classes inherit from an abstract class (called FEShape). 4. Mesh oriented vectors all inherit from an abstract class called AbsVect. We have made use of template classes in vector and matrix classes as well as in finite element equation abstract class. This feature enables implementing for instance complex valued problems. The OFELI library contains a two-dimensional mesh generator without graphics facilities. The package also contains utility applications to convert input and output files for most popular mesh generators and graphical postprocessors. For any pre or postprocessing, we recommend the use of most popular opensource software (see documentation on file converters). To each type of data and each phase in a finite element computation corresponds a C++ class. For the sake of clarity, we shall outline hereafter these classes through the steps of execution of a finite element code. The reader can consult the details of each class and its members in the reference manual. 2

5.1 Mesh data Mesh data are introduced by a class called Mesh. This class allows to read, manipulate and store mesh data. Moreover, to each type of mesh data corresponds a class. Thus, an instance of class Mesh is a collection of instances of classes Node, Element, and Side. A finite element mesh is defined by a list of nodes given by their coordinates and a list of elements given by their node numbers. Moreover, to each node is associated its number of degrees of freedom and a code to each degree of freedom. This code is useful to prescribe node boundary conditions data (Dirichlet). In addition, to take Neumann like boundary conditions into account, a mesh can contain a collection of sides. In practice these must be sides on the boundary of the domain but any side can be defined with the help of mesh nodes. 5.2 Vectors These classes were developed to facilitate basic operations on vectors. An overloading of operators (), [] and most algebraic operations is implemented to simplify this access. 5.3 Matrices 5.4 Boundary conditions, Forces,... 5.5 Material data 5.6 Finite Element Equations 5.7 Finite Element Shapes In order to consider several types of storage for finite element matrices, the library OFELI contains a class for each storage type. Moreover, to handle operations that are independent of these storage types we have a template abstract class called Matrix. The implemented storage schemes are tridiagonal, skyline and sparse. A finite element computation needs several types of data. These data can be either given manually or via a class written by the developer and that inherits from an abstract class called UserData. Another way to introduce data is to describe them through prescription files. In order to define material properties, material data files are given in a specific directory. Each material has its own file that contains corresponding physical constants and expressions. A default material is defined with default values for constants. A crucial step in the implementation of the finite element method consists in building up finite element equations for each element and assembling them into a global linear system of equations. A nonlinear problem is solved by an iteration algorithm where each iteration consists in solving a linear problem. At the element level, finite element equations are to be declared as instances of a class of finite element equations. Clearly, the finite element equation depends on the problem to solve. For this, some classes of typical problems (Thermics, Elasticity, Fluid,... ) are already developed and can serve as prototypes for developing classes for new problems. The above classes need information about finite element interpolation (choice of element geometry, shape functions,... ). The OFELI library provides a family of classes that implement several types for finite element shapes. For instance, class Triang3 corresponds to P 1 (or three-node) triangle. 3

5.8 OFELI Files The library defines a standard for input and output files: All input and output files are XML files as described in the User s guide of the library. 6 Installation The OFELI library can be installed on any computer provided with an ANSI C++ compiler. The library is hosted by the Sourceforge server with the home page: http://www.ofeli.net This web page contains a brief presentation of OFELI and offers the possibility to download the package. 6.1 Installation Procedure on UNIX-like systems The following instructions apply to UNIX (like) systems only. The only thing you need is a C++ compiler. A clean installation can be performed in the following steps: gunzip and untar the downloaded file. Execute the configuration script by typing :./configure A first execution with argument --help displays a short manual of the script. A typical execution looks like:./configure --prefix=/home/me/ofeli --libdir=/home/me/lib --bindir=/home/me/bin --enable-release Then you can build the library by executing the commands make make install The test suite can be run through the command test ofeli.sh 6.2 Installation Procedure on Windows systems To install on Windows systems, you can use either the Visual C++ compiler or the CodeBlocks free software. The installation procedure depends on the file you have downloaded. If this is a zip file then you must unzip it, go the subdirectory Win32 where you can find Visual C++ workspace to install the library, utilities, examples, and demos. You can also go to directory Win32/DevCpp and make use of DevCpp projects. If this is an exe file, than this is a standard windows setup installer. The library, example files and demo files are already compiled. You can also recompile using Visual C++ workspace. 4