ORIGINAL PAPER C.-T. Yang Æ S.-H. Hsieh An object-oriented framework for versatile discrete objects simulation using design patterns Received: 30 May 2004 / Accepted: 5 July 2004 / Published online: 14 April 2005 Ó Springer-Verlag 2005 Abstract This paper proposes a framework for versatile discrete objects simulation. The framework, named VEDO, is developed using object-oriented technology with design patterns. VEDO is capable of handling simultaneously discrete objects of various shapes and various mechanisms of interactions between discrete objects. It also has great flexibility in facilitating addi- tions of new discrete object shapes and solution algo- rithms for discrete object interactions. Based on the proposed framework, a discrete objects simulation sys- tem, named Knight&Anne, has been implemented in Cþþ in this study. In addition, some application examples are given to demonstrate the capability and flexibility of the framework. Keywords Discrete objects simulation Æ Object-oriented design Æ Design patterns Æ Particle simulation 1 Introduction Discrete objects simulation is widely used in science and engineering, such as, for example, in studies of the mechanics of rocks and soil [10], simulations of the flow of concrete [2][14] and colloidal dynamics [7][13]. A simulation system, which models discrete objects and applies physical equations of motion to simulate their dynamic behaviors, is called a Discrete Object Simula- tion System (DOSS) hereinafter. The methodology employed by DOSS usually has two major parts. One is the construction of models of discrete objects with various geometries. The other is the modeling of the mechanisms of interactions among discrete objects, to mimic the behavior of real materials. In some applications, because the simulation results are highly sensitive to the shapes of discrete objects, DOSS should be able to handle the complexity of the geome- tries of discrete objects. Therefore, research in this field progressed from 2D geometrical models to 3D models and from simple spherical models to complicated poly- hedral models. In the other applications, DOSS should be able to handle various mechanisms that operate among various discrete objects when materials are composite. Consider, for example, the simulation of concrete flowing [2][14]. Concrete comprises of two materials - discontinuous aggregates and continuous mortar. Clearly, the mechanism of interactions between the aggregates is different from that between the aggre- gates and the mortar. However, most existing DOSS packages usually can only handle either various shapes or various mechanisms but not both. For example, PFC 3D [6], a popular com- mercial package, can handle various mechanisms but has only spherical discrete objects in 3D. Most of DOSS packages developed by academic researchers, e.g., DEM3D [3] and the one by Hong [7], usually meet only the requirements for carrying out their research work and often can not be easily extended (if not impossible) to handle more object shapes and interaction mechanisms for more general applications. To build a versatile DOSS, which is one that can simultaneously handle various shapes and various mechanisms, a flexible underlying software framework is very important. The framework must be flexible enough to incorporate systematically and correctly numerous mathematical models for representing dis- crete objects and solution algorithms for interactions among discrete objects. Therefore, this study employs Comput Mech (2005) 36: 85–99 DOI 10.1007/s00466-004-0612-y The support from the National Science Council of Republic of China under Grant No. NSC91-2211-E-002-097 and NSC91-2211- E-399-001 is greatly appreciated. In addition, the authors would like to thank Prof. Chuin-Shan Chen of National Taiwan Uni- versity for his review and suggestions on the design and imple- mentation of the proposed framework as well as Mr. Li-Shin Lin and Mr. Jenn-Feng Li for their help on example studies. C.-T. Yang Æ S.-H. Hsieh (&) Department of Civil Engineering, National Taiwan University, Taipei 10617, Taiwan e-mail: shhsieh@ntu.edu.tw