ArticlePDF Available

Abstract and Figures

This article presents the implementation of the material point method (MPM) using Julia. Julia is an open source, multi-platform, high-level, high-performance dynamic programming language for technical computing, with syntax that is familiar to Matlab and Python programmers. MPM is a hybrid particle-grid approach that combines the advantages of Eulerian and Lagrangian methods and is suitable for complex solid mechanics problems involving contact, impact and large deformations. We will show that a Julia based MPM code, which is short, compact and readable and uses only Julia built in features, performs much better (with speed up of up to 8) than a similar Matlab based MPM code for large strain solid mechanics simulations. We share our experiences of implementing MPM in Julia and demonstrate that Julis is a very interesting platform for rapid development in the field of scientific computing.
Content may be subject to copyright.
Programming the material point method in Julia
Sina Sinaiea,1, Vinh Phu Nguyen a,2,, Chi Thanh Nguyena,3, Stephane Bordasb,4
aDepartment of Civil Engineering, Monash University, Clayton, Victoria 3800, Australia
bFacult´e des Sciences, de la Technologie et de la Communication, University of Luxembourg,
6, rue Richard Coudenhove-Kalergi, 1359 , Luxembourg City, Luxembourg
Abstract
This article presents the implementation of the material point method (MPM) using Julia. Julia is an
open source, multi-platform, high-level, high-performance dynamic programming language for technical
computing, with syntax that is familiar to Matlab and Python programmers. MPM is a hybrid particle-grid
approach that combines the advantages of Eulerian and Lagrangian methods and is suitable for complex
solid mechanics problems involving contact, impact and large deformations. We will show that a Julia based
MPM code, which is short, compact and readable and uses only Julia built in features, performs much
better (with speed up of up to 8) than a similar Matlab based MPM code for large strain solid mechanics
simulations. We share our experiences of implementing MPM in Julia and demonstrate that Julis is a very
interesting platform for rapid development in the field of scientific computing.
Keywords: Julia, material point method (MPM), high-performance dynamic programming language,
technical computing
1. Introduction
Many researchers, including us, today do their day-to-day work in dynamic languages such as Matlab
[1], Python [2], Mathmematica [3]. The reasons are several: (i) these languages are easy to use, (ii) they
provide a friendly user interface that integrates computing and graphics into one single platform, (iii) they
are ideal for rapid prototyping and (iv) they can be used perfectly for educational purposes. However they
are usually slow and not suitable for computationally intensive problems as static languages such as Fortran
and C/C++. The ’ideal’ programming language, from the point of view of a researcher, is the one that
is as easy to use as Matlab/Python and as fast as Fortran/C++ so that time would be spent on testing
new scientific ideas rather than on studying difficult programming topics and code optimization techniques.
In the search for such a language, Julia was created in 2012 [4,5]. Julia is designed to be easy and fast
thanks to the LLVM-based just-in-time (JIT) compilation [6]. In other words, with Julia, one can have
machine performance without sacrificing human convenience [4]. The aim of this article is, within the
context of computational solid mechanics, to test the high performance capacity of Julia as reported in [7]
by comparing it with Matlab–a very popular dynamic language for scientic computing. To this end, we
implement the Material Point Method (MPM) for large deformation solid mechanics in Julia and Matlab.
Different aspects of using Julia for implementing MPM such as vectorized vs de-vectorized codes, efficient use
of composite types and the choice of concrete types over abstract types etc. are discussed. Many interesting
features of Julia including multiple dispatch, generic programming, easy use of existing Fortran/C routines
are, however, not used in our code as we aimed for a simple, easy to understand Julia code that is relatively
Corresponding author
1sina.sinaie@monash.edu
2phu.nguyen@monash.edu
3chi.t.nguyen@monash.edu
4stephane.bordas@alum.northwestern.edu
Preprint submitted to Elsevier January 19, 2017
similar to our Matlab code for a fair comparison. There are a few attempts in comparing the performance
of Julia finite element codes with C++ codes. For example, in [8], a simple finite element code in Julia for
solving the two dimensional Poisson equation over a unit square was presened with performance as good as
the C++ FEM code FEniCS [9] for N–the number of elements– ranging from 102to 106.
MPM is a hybrid grid/particle method in which a continuum body is discretized by a finite set of La-
grangian material points (or particles) in the original configuration that is overlaid over a background grid
[10,11,12]. The terms particle and material point will be used interchangeably throughout this manuscript.
Since each material point contains a fixed amount of mass during the course of the simulation, mass conserva-
tion is automatically satisfied. In MPM, the space where the simulated bodies might occupy is discretized by
a finite element grid where the equation of balance of momentum is solved. This is in contrast to other mesh-
free/particle methods where the momentum equations are solved directly on the particles. In other words,
particles do not interact with each other directly, but rather the particle information is accumulated onto the
grid, where the equations of motion are integrated over time. This avoids the time-consuming neighbor search
in the evaluation of meshfree approximants/interpolants using Eulerian kernels [13,14,15,16,17,18,19].
The particles interact with other particles in the same body, with other solid bodies, or with fluids through
a background grid. Most often, a fixed regular Cartesian grid is used throughout the simulation. This is
the key difference between MPM and the updated Lagrange FEM and makes the method distortion-free.
MPM has found applications in large strain problems including landslide [20], silo discharging [21,22,23],
anchor pull-out [24], large deformations of saturated porous media [25,26,27,28]. In the context of contact
mechanics, [29,30] used their contact model [31,32] to model the compression of foam micro-structures
to full densification. Applications of the MPM are emerging in sea ice models for climate simulation [33]
as well as more traditional explosive-related simulations e.g., explosive welding [34], cutting processes [35],
high melting explosive with cavities [36], blast and fragmentation [37,38,39], high strain rate penetration
problems [40] and biomechanics [41].
The results reported in this article demonstrate that a Julia based MPM code, which is short, compact,
readable and uses only Julia standard library, performs much better (with speed up of up to 8) than a
similar Matlab based MPM code. For a high velocity impact simulation that involves 15000 particles, the
Julia code took about half an hour whereas the Matlab code completed in 5 hours. This plus the fact that
Julia is open source with a growing user/developer community5makes Julia a very promising language for
scientific computing, particularly for rapid prototyping of complex scientific algorithms. As MPM is similar
to explicit updated Lagrangian finite elements [42], our finding on the superior performance of Julia codes
carries over to explicit dynamics simulations using finite elements.
The remainder of the paper is organized as follows. MPM is briefly presented in Section 2followed
by Section 3which is devoted to the Julia implementation of MPM. Numerical examples are presented in
Section 4, followed by concluding remarks in the last section.
2. A brief introduction to the material point method
This section gives a brief introduction to MPM for solid mechanics. We refer to [12] for a comprehensive
treatment of MPM and to the note [43] for beginners where implementation details with Matlab codes are
presented. The discussion is confined to explicit time integration as it is the most widely used time integrator
in MPM. The space possibly occupied by the solid under consideration is discretized by a Cartesian grid
and the solid is represented by a set of material points as illustrated in Fig. 1for two dimensional problems.
Subscript prefers to ’particle’ whereas subscript Ito the ’grid nodes’.
2.1. General procedure
An MPM computational cycle consists of three phases as illustrated in Fig. 2, (i) initialization phase
where particle data are mapped (or projected) to the grid as the grid does not carry permanent data, (ii)
Lagrangian phase in which the momentum equation is solved and (iii) convective phase where the grid is
5As the time of this writing there is 1064 registered packages at http://pkg.julialang.org.
2
reset. Algorithmically, an MPM cycle from step tto step t+∆tproceeds as follows (steps a – c) according to
the update stress last scheme [12] and note that with a slight change, the central difference time integration
scheme can be included [44,45].
(a) Particle to node mapping
mt
I=X
p
φI(xt
p)Mpmass
(mv)t
I=X
p
φI(xt
p)(Mv)t
pmomentum
fext,t
I=X
p
φI(xt
p)Mpbexternal force
fint,t
I=X
pVt
pσt
pφI(xt
p) internal force
(1)
(b) Update nodal momenta and fix Dirichlet nodes
(mv)t+∆t
I= (mv)t
I+ft
Itmomentum
(mv)t+∆t
I=0
ft
I=0
for fixed nodes I
(2)
where ft
I=fext,t
I+fint,t
I.
(c) Update particle positions, velocities and stresses
vt+∆t
p=vt
p+ ∆tX
I
φI(xt
p)ft
I
mt
I
velocity
xt+∆t
p=xt
p+ ∆tX
I
φI(xt
p)(mv)t+∆t
I
mt
I
position
vt+∆t
I=(mv)t+∆t
I
mt
I
nodal velocity
Lt+∆t
p=X
IφI(xt
p)vt+∆t
Igradient velocity
Ft+∆t
p= (I+Lt+∆t
pt)Ft
pgradient deformation
Vt+∆t
p= det Ft+∆t
pV0
pvolume
σt+∆t
p=σt
p+ ∆σpstress
(3)
where Mp,xp,vp,σp, Vp,Lp,Fpare the particle mass, positions, velocities, Cauchy stress6, volume, gradient
velocity tensor and deformation gradient, respectively. Body forces are denoted by band the time step is
denoted by ∆t. The weighting and gradient weighting functions are designated by φIand φI, respectively.
These functions are kept abstract for the moment as their forms depend on which MPM formulation is being
used. Note that the grid node positions were not updated.
6Or an objective stress rate such as Jaumann or Truesdell rate can be used here.
3
Figure 1: Material point method: Lagrangian material points overlaid on a Eulerian grid.
initialization phase
(particles to nodes)
convective phase
(reset grid)
Lagrangian phase
(update nodal momenta,
nodes to particles)
Figure 2: Material point method: a computational step consists of three phases: (1) initialization phase where information is
mapped from particles to nodes, (2) momentum equations are solved for the nodes, the updated nodes are then mapped back
to the particles to update their positions and velocities and (3) convective phase where the grid is reset.
4
2.2. Generalized interpolation material point method
In GIMP7the weighting and gradient weighting functions φI(xp) and φI(xp) are given by [46].
φIp φI(xp) = 1
VpZp
χ(xxp)NI(x)dΩ
φIp ≡ ∇φI(xp) = 1
VpZp
χ(xxp)NI(x)dΩ
(4)
where NIrepresents the standard grid functions, which form a Partition of Unity (PoU), and χ(x) is the
particle characteristic function. Note that short notation φIp is used to represent φI(xp).
Typically, piece-wise constant particle characteristic functions, also known as top-hat functions, are used
χp(x) = (1 if xp
0 otherwise (5)
which result in the following GIMP weighting functions (simplification of Equation (4))
φIp =1
VpZp
NI(x)dΩ
φIp =1
VpZpNI(x)dΩ
(6)
How the integrals in Equation (6) are evaluated and how the particle domains Ωpare defined/updated result
in various GIMP formulations. Fig. 3illustrates existing GIMP methods to be discussed in what follows.
In the approach referred to as uGIMP (unchanged GIMP) Ωpis a rectangle in 2D and is kept fixed. The
integrals in Equation (6) can thus be exactly integrated resulting in analytical expressions for φIp and φIp
[46]. A more complicated approach, known as cpGIMP (contiguous particle GIMP), updates the particle
domain using the deformation gradient Fwithout taking shear deformation into account. Even though
cell-crossing noise is mitigated, as the material deforms, the particle domains cannot fill the material space
under general loading conditions. Convected Particle Domain Interpolation (CPDI) [47,48,49] is the next
logical development of GIMP where the integrals of Equation (6) are also analytically evaluated thanks to
the use of alternative basis functions and the space is tiled without gaps.
2.3. Convected particle domain interpolations
The GIMP weighting function in Equation (6) now becomes
φIp =1
VpZp
Nalt
I(x)dΩ
=1
Vp
4
X
c=1 "Zp
Mc(x)dΩ#NI(xc) =
4
X
c=1
wf
cNI(xc)
(7)
and similarly the gradient φIp is written as
φIp =1
VpZpNalt
I(x)dΩ
=1
Vp
4
X
c=1 "ZpMc(x)dΩ#NI(xc) =
4
X
c=1
wg
cNI(xc)
(8)
What makes CPDI an efficient GIMP is the fact that the integrals in the square brackets of Equations (7)
and (8) can be exactly computed in terms of the geometry of the particle domains.
7GIMP is short for generalized interpolation material point.
5
Figure 3: Tracking particle domains in GIPM: space cannot be tiled in a general multi-dimension domain using rectilinear Ωp
in uGIMP and cpGIMP. By consider each particle as a quadrilateral, in CPDI, space is filled without gaps.
Figure 4: Two dimensional CPDI: background grid and particle domains. Each particle domain is a four-node quadrilateral.
Note that particle corners do not carry any information. They are present to precisely track the particle geometries.
6
2.3.1. Two dimensional bilinear quadrilateral CPDI
If the particles are represented by four-node quadrilateral elements, the corresponding CPDI-Q4 weight-
ing function and first derivatives are given by
φIp =1
36Vp(4c1+ 2c2+ 2c3+c4)NI(x1)
+(2c1+ 4c2+c3+ 2c4)NI(x2)
+(c1+ 2c2+ 2c3+ 4c4)NI(x3)
+(2c1+c2+ 4c3+ 2c4)NI(x4)
(9)
φIp =1
2VpNI(x1)y24
x42+NI(x2)y31
x13
+NI(x3)y42
x24+NI(x4)y13
x31 (10)
where c1= (x21y41 y21 x41), c2= (x21 y32 y21x32), c3= (x34 y41 y34x41 ), c4= (x34y32 y34x32 ) and
xij =xixjand yij =yiyjare the corner coordinate differences. The area of the particle domain is
given by Vp= 0.5[(x1y2x2y1)+(x2y3x3y2)+(x3y4x4y3)+(x4y1x1y4)].
2.3.2. Two dimensional constant triangular CPDI
If the particles are represented by three-node triangular elements, the corresponding CPDI-T3 weighting
and gradient weighting functions are given by [50]
φIp =1
VpVp
3NI(x1) + Vp
3NI(x2) + Vp
3NI(x3)
φIp =1
VpNI(x1)1
2y23
x32+NI(x2)1
2y31
x13
+NI(x3)1
2y12
x21
(11)
where Vpdenote the area of the particle triangle.
2.3.3. Three dimensional linear tetraheron CPDI
If the particles are represented by linear tetrahedron elements, the corresponding CPDI-Tet4 weighting
and gradient weighting functions are given by [51]
φIp =1
4NI(x1) + 1
4NI(x2) + 1
4NI(x3) + 1
4NI(x4)
φIp =1
6Vp
NI(x1)
a1
b1
c1
+NI(x2)
a2
b2
c2
+NI(x3)
a3
b3
c3
+NI(x4)
a4
b4
c4
(12)
where 6Vp=x21(y23 z34 y34z23 ) + x32(y34z12 y12 z34) + x43 (y12z23 y23z12 ); a1=y42z32 y32 z42,
a2=y31z43 y34 z13,a3=y24 z14 y14z24,a4=y13 z21 y12z31 ,b1=x32z42 x42z32 ,b2=x43z31 x13 z34,
7
b3=x14z24 x24 z14,b4=x21 z13 x31z12,c1=x42 y32 x32y42 ,c2=x31y43 x34y13 ,c3=x24y14 x14 y24
and c4=x13y21 x12 y31. Note that Vpis a signed quantity and a proper node numbering was used to have
a positive value.
3. Julia-based implementation of MPM
This section investigates some implementation aspects of the Julia programming language. With the
intention of producing codes that are optimized for speed, some processes common to an MPM implemen-
tation are addressed. In order to help the transition from Matlab to Julia, we provide a list of some syntax
differences between Matlab and Julia in Table A.1. This section will present some code snippets written in
Julia where boldface font is used for the Julia built-in features. Julia can be downloaded for free, under
the MIT licence, from the web page http://julialang.org/downloads. There are a couple of ways to
interact with Julia. First, Julia comes with a full-featured interactive command-line REPL (read-eval-print
loop) built into the julia executable. Alternatively, Julia can be launched from a web browser using this
link https://juliabox.org. If an IDE (integrated development environment) is preferred there is Juno at
http://junolab.org. In some code snippets one will see variable::type name which is to declare a variable
of a certain type such as x::Int64 to indicate that xis an 64 bit integer.
3.1. Using ‘for’ loops versus vectorization
Performing a fixed set of operations on large arrays of data (consisting of nodal data and material
point data) encompasses a significant part of an MPM implementation. In Julia, similar to Matlab, such
operations can be carried out using either for-loops or vectorized operators. While vectorized operators
produce condensed code, for-loops are considered to be more intuitive. From this point of view, the choice is
subjective. On the other hand, from a performance point of view, for-loops tend to be faster than vectorized
operators in Julia. However, this depends on how the for-loop is implemented.
The performance of for-loops and a vectorized operator is examined using the code given in Listing 1.
Herein, performance is evaluated in terms of ’Iterations/run-time second’ i.e., the more iterations per second
the more efficient the code. For this purpose, three arrays are created and assigned with initial values, where
after a summation operation is performed on the first two arrays and assigned to the third array. A simple
summation has been selected, so that the run time is more representative of the iterations, rather than the
calculations. Each approach is iterated 1000 times, whereby the time duration is monitored using the tic()
and toc() functions. The initial values assigned to the arrays are arbitrary.
Table 1shows the results of comparing vectorized and for-loop operations. The first observation made by
these results is the very poor performance of abstract data types. Although Julia allows the use of abstract
data types such as ‘Real’, which has attractive design implication towards polymorphism, it is always best
to declare variables using concrete types when performance is an issue. This is readily seen by comparing
the first two rows of Table 1. As a result, the ‘Float64’ concrete data type is used in this study.
It is observed from Table 1that, in Julia, for-loops can perform better than vectorized operators. For one-
dimensional arrays the speed at which for loops are carried out is more than twice the speed of vectorized
operators. However, for two-dimensional arrays, in order to have noticeable advantage over vectorized
operators, nested for-loops have to be consistent with the ‘column-major’ order of which data is stored in
memory. In other words, the inner loop should iterate over the first index of the two-dimensional array.
Such order is termed as ‘j-i loop’ in Listing 1and Table 1. Albeit irrelevant here, Julia is very well suited for
non-vectorized problems such as those arising from stochastic processes modeled by Monte Carlo methods.
3.2. Composite types versus arrays
Given the common use of composite types (similar to struct in C and can be thought of as roughly
equivalent to a class without behavior in object-oriented languages such as C++), the performance of
an array of such types are compared to the performance of multi-dimensional arrays. The code used to
benchmark the performance of two-dimensional arrays is similar to the one presented in Listing 1(j-i for
loop) and is not repeated here. Listing 2shows the code use to compare different methods of access to
8
Table 1: Performance comparison of for-loops against vectorized operators on large data arrays in Julia.
Iterations/sec.
Array size Type i-j loop j-i loop vectorized
106Real 2.70 - 2.52
106Float64 668.90 - 293.00
106×2 Float64 55.07 296.00 158.70
106×10 Float64 33.39 60.90 32.05
10 ×106Float64 9.17 35.57 32.21
Listing 1: Julia code listing for vectorized operations versus for loops. Lines with # at the beginning are comments. Julia
discourages the used of semicolons to end statements.
1# c r e a t e an d a s s i g n a r r a y s
2# v a l u e s o f m an d n d e f i n e d i n Ta bl e 1
3A01 = Array{Float64 }(m , n ) # m by n 2D a r ra y o f Fl o a t 6 4 nu mb er s
4A02 = Array{Float64 }(m , n )
5A03 = Array{Float64 }(m , n )
6
7f o r i = 1 : 1 :m
8f o r j = 1 : 1 : n
9A01 [ i , j ] = 1 . 0 i
10 A02 [ i , j ] = 1.0i
11 A03 [ i , j ] = 0
12 end
13 end
14
15 I t e r a t i o n s = 1 00 0
16
17 # u s i n g f o r i j loop
18 t i c ( )
19 f o r count i n 1 : 1 : I t e r a t i o n s
20 f o r i = 1 : 1 :m
21 f o r j = 1 : 1 : n
22 A03 [ i , j ] = A01 [ i , j ] + A02 [ i , j ]
23 end
24 end
25 end
26 to c ()
27
28 # u s i n g f o r j i l o o p , s h o u l d b e u s e d
29 t i c ( )
30 f o r count i n 1 : 1 : I t e r a t i o n s
31 f o r j = 1 : 1 : n
32 f o r i = 1 : 1 :m
33 A03 [ i , j ] = A01 [ i , j ] + A02 [ i , j ]
34 end
35 end
36 end
37 to c ()
38
39 # using vectorization
40 t i c ( )
41 f o r count i n 1 : 1 : I t e r a t i o n s
42 A03 = A01 + A02
43 end
44 to c ()
9
the members of a composite types, the results of which are given in Table 2. These results indicate a
consistent performance advantage of multi-dimensional arrays over composite types. However, Table 2
also demonstrates that removing redundant access calls to the members of a composite type improves the
performance of operations on composite types (compare column 5 with columns 3 and 4).
While the performance advantage of multi-dimensional arrays as opposed to composite types is significant
enough to be taken advantage of, one also has to consider the benefits derived from composite types in terms
of code organization and readability. Taking this into account, composite types are used for the purpose of
this paper and for the numerical examples considered in the next section. Note that our aim is not to write a
highly optimized MPM code in Julia but to have a fast MPM platform for future fundamental development
of the method.
Table 2: Performance comparison of accessing elements of an array as opposed to members of a composite type. Methods 1–3
refer to different methods of access specified in Listing 2.
Iterations/sec.
Array size array method 1 method 2 method 3
106×10 58.51 17.85 22.15 25.36
106×100 5.77 1.88 2.50 3.01
3.3. A simple MPM code in Julia
Having discussed some implementation choices for common operations in MPM, we now proceed to a
simple implementation of MPM in Julia for solid mechanics. Composite types are used in this study to
store the attributes of grid points and material points. The declaration of these types are presented in
Listings 3and 4. Note that whether the vectors are initialized to be 2D or 3D depends on the problem that
is being solved. Next, one defines an array of grid points and array(s) of particles. We refer to Listing 5
for an example of generating an array of particles. Listing 6presents the implementation of a 2D MPM
for elastic bodies. Extension to 3D and inelastic materials is straightforward. Note that for simplicity only
constant time steps are coded but consideration of adaptive time steps should not pose any difficulties. The
implementation of the CPDI-Tet4 for a Neo-Hookean hyperelastic material is given in Listing 7. Note that
the implementation of CPDI-Q4 and CPDI-T3 is similar and they are programmed in our code even though
not used in the reported examples. The code organization is discussed in Appendix B. We would like to
emphasize that this is just our experimental MPM code in Julia.
4. Numerical examples
This section presents some numerical examples demonstrating the performance advantage of Julia as a
development tool for MPM simulations. All simulations are carried out using in-house MPM codes written
in Matlab and Julia. The Matlab codes are described in [43]. In Julia, just like in Python, accessing external
packages is very simple. Most of the images presented in the following text, are created in Julia using the
PyPlot graphical package [52].
There are three primary variants affecting the accuracy of MPM solutions: the time-step size, the grid
density and the particle density. Decreasing the time-step size will increase the number of time-integration
steps needed to complete the analysis, and hence, will increase run-time. Given the trivial relation between
time-step size and run-time, i.e. a linear scaling between the two, there is no need to examine it here.
However, what is worth examining is the scaling of run-time with grid and particle density. In order to
eliminate the effect of time-step size in this process, performance is evaluated in terms of ‘Iterations/run-
time seconds’. Note that each iteration constitutes a single loop of the analysis as described in Section 2,
and run-time refers to the actual time it takes to complete the analysis using a single thread on an Intel Core
i7-6700 CPU with a RAM of 16 GB. We also provide the total runtime of all the conducted simulations.
Julia commands used to measure the time of the following simulations are given in Appendix B.
10
Listing 2: Julia code listing for performance testing of operations on composite types.
1# d e c l a r a t i o n o f a u s er d e f i n e d t y pe , na med ’ D a ta S tr u ct u r e
2# w it h o ne member named M w hi ch i s 1d i m e n s i o n a l ar r a y
3# i n wh at f o l l o w s , v al u e s o f n an d m v a r i e d f o l l o w i n g Ta b le 2
4type DataStructure
5M : : Array{Float64}# t h e s ym bo l : : us e d t o d e f i n e a TYPE
6function D a t a S t r u c t u r e ( )
7new(zeros( n ) )
8end
9end
10
11 # c r e a t e a nd a s s i g n t y pe memb ers
12 S0 1 = Array {D a t a S t r u c t u r e }(m)
13 S0 2 = Array {D a t a S t r u c t u r e }(m)
14 S0 3 = Array {D a t a S t r u c t u r e }(m)
15 # t h e f o l l o w i n g c an be s i mp l i e d : f o r i = 1:m
16 f o r i = 1 : 1 :m
17 S0 1 [ i ] = D a t a S t r u c t u r e ( )
18 S0 2 [ i ] = D a t a S t r u c t u r e ( )
19 S0 3 [ i ] = D a t a S t r u c t u r e ( )
20 f o r j = 1 : 1 : n
21 S0 1 [ i ] .M [ j ] = 1 . 0 i
22 S0 2 [ i ] .M[ j ] = 1.0i
23 S0 3 [ i ] .M[ j ] = 0
24 end
25 end
26
27 # me tho d 1 , u si n g co m po s it e t y pe o b j ec t d i r e c t l y
28 t i c ( )
29 f o r count i n 1:1: iIterations
30 f o r i = 1 : 1 :m
31 f o r j = 1 : 1 : n
32 S0 3 [ i ] .M[ j ] = S 01 [ i ] . M[ j ] + S0 2 [ i ] . M[ j ]
33 end
34 end
35 end
36 to c ()
37
38 # me tho d 2 , u s in g r e f e r e n c e t o c om p os i te t yp e o b j e c t s
39 t i c ( )
40 f o r count i n 1:1: iIterations
41 f o r i = 1 : 1 :m
42 t h i s 0 1 = S0 1 [ i ]
43 t h i s 0 2 = S0 2 [ i ]
44 t h i s 0 3 = S0 3 [ i ]
45 f o r j = 1 : 1 : n
46 t h i s 0 3 .M[ j ] = t h i s 0 1 .M[ j ] + t h i s 0 2 .M[ j ]
47 end
48 end
49 end
50 to c ()
51
52 # me tho d 3 , u s in g r e f e r e n c e t o th e memb er o f c o m po s it e ty p e o b j e c t s
53 # me tho d o f c h o i c e
54 t i c ( )
55 f o r count i n 1:1: iIterations
56 f o r i = 1 : 1 :m
57 t h i s 0 1 = S0 1 [ i ] . M
58 t h i s 0 2 = S0 2 [ i ] . M
59 t h i s 0 3 = S0 3 [ i ] . M
60 f o r j = 1 : 1 : n
61 t h i s 0 3 [ j ] = t h i s 0 1 [ j ] + t h i s 0 2 [ j ]
62 end
63 end
64 end
65 to c ()
11
Listing 3: Julia code listing for the declaration of ‘Grid Point’ composite type.
1# c o m po s it e t yp e d e c l a r a t i o n f o r G ri d P oi n t
2type GridPoint
3Fi xe d : : Array{B oo l }# f i x a t i o n i n d i f f e r e n t d i r e c t i o n s
4Mas s : : Float64
5P o s i t i o n : : Array{Float64 }
6Momentum : : Array{Float64}
7Force :: Array {Float64}# t o t a l f o r c e =i n t e r n a l f o r c e+ e x te r n a l f o r c e
8
9function GridPoint ()
10 # c o n s t r u c t o r , s e t a l l v a l u e s t o ze r o , t h e f o l l o w i n g i s f o r 2D p r o bl e m s
11 new (
12 [f a l s e ;f a l s e ] ,
13 0 . 0 ,
14 zeros ( 2 ) ,
15 zeros ( 2 ) ,
16 zeros (2)
17 ) ;
18 end
19 end
Listing 4: Julia code listing for the declaration of ‘Material Point’ composite type.
1# c o m po s it e t yp e d e c l a r a t i o n f o r M a t e ri a l P oi n t
2type MaterialPoint
3Mas s : : Float64
4VolumeInitial : : Float64
5Volume : : Float64
6Cent r o i d : : Array{Float64}
7V e l o c i t y : : Array{Float64}
8Momentum : : Array{Float64}
9ExternalForce : : Array {Float64}
10 DeformationGradient : : Array{Float64}
11 # s t r a i n / s t r e s s a s v e c t o r s ( V o i gt n o t a t i o n )
12 S t r e s s : : Array{Float64 }
13 S t r a i n : : Array{Float64 }
14 P l a s t i c S t r a i n : : Array{Float64}
15 Al pha : : Float64 # e q u i v a l e n t i n t e r n a l p l a s t i c p ar a me t e r
16
17 ElasticModulus :: Float64
18 P o i s s o n R a t i o : : Float64
19 Y i e l d S t r e s s : : Float64
20 # t h e f o l l o w i n g f o r CP DIs
21 Co rn er : : Array {Float64}
22
23 function MaterialPoint ()
24 # c o n s t r u c t o r , s e t a l l ab o ve v a r i a b l e s t o z e r o
25 end
26 end
Listing 5: Julia code listing for generation of material points.
1thisMaterialDomain = Array{MaterialPoint }(0)
2# r e pe a t t he f o l l o w i n g u n t i l t he d e s i r e d numb er o f p a r t i c l e s i s ob t a i ne d
3t h i s M a t e r i a l P o i n t = M a t e ri a l P o i n t ( )
4t h i s M a t e r i a l P o i n t . Ce n t r oi d = [ 1 . 0 ; 1 . 0 ]
5# a p p en d i n g t o t h e e nd o f a r r a y s , s i m i l a r t o p u s h b a c k i n C++ STL
6pu sh ! ( t h i sM a t er i a lD o m ai n , t h i s M a t e r i a l P o i n t )
12
Listing 6: Time-integration loop for standard MPM implementation. All grid points and material points are stored into arrays
denoted by allGP and allMP, respectively. GP: Grid Point, MP: Material Point, AGP: Adjacent Grid Point. The prefix ‘this’
indicates the reference of the object currently being processed.
1f o r Time = 0 : dT : TimeE nd
2# r e s e t g r i d −−−−−−−−
3f o r in dex GP = 1 : size ( a ll GP )
4al l GP [ i nde xGP ] . Mas s = 0 . 0
5al lG P [ index GP ] . Momentum = [ 0 . 0 ; 0 . 0 ]
6al l GP [ i nde xGP ] . V e l o c i t y = [ 0 . 0 ; 0 . 0 ]
7end
8# m a t e r i a l p o i nt t o g r i d −−−−
9f o r ind exMP = 1 : size ( a llM P )
10 th isMP = al lMP [ i ndexMP ]
11 al lAG P = ge tAGP ( t his MP , al l GP )
12 f o r indexAGP = 1 : size ( al lAG P )
13 th isAG P = a llAG P [ indexA GP ]
14 # s h ap e f u n c t i o n v a l u e an d g r a d i e n t
15 B a si s V a l u e = g e t B a s i s V a l u e ( t his MP , th is AGP )
16 B a s i s G r a d i e n t = g e t B a s i s G r a d i e n t ( t his MP , t his AG P )
17 th isAG P . M ass += B as i s Va l ue t his MP . Mas s
18 th isA GP . Momentum += B a si s V a lu e t hisM P . Mass thi sM P . V e l o c i t y
19 th isAG P . F o rc e += B a s is V al u e this MP . F or ce BasisGradientth isM P . S t r e s s t hisM P . Volu me
20 end
21 # u p da te g r i d −−−−−−−−
22 f o r in dex GP = 1 : size ( a ll GP )
23 th isG P = all GP [ i ndexGP ]
24 th isG P .Momentum += t his GP . F orce dT
25 # a p pl y bo un da ry c o n d i t i o n s wi t h momentum = 0 a nd f o r c e = 0
26 end
27 # g r i d t o m a t e r i a l p o i n t −−−−
28 f o r ind exMP = 1 : size ( a llM P )
29 th isMP = al lMP [ i ndexMP ]
30 al lAG P = ge tAGP ( t his MP , al l GP )
31 DeformationGradientIncrement = [1 0; 0 1]
32 f o r indexAGP = 1 : size ( al lAG P )
33 th isAG P = a llAG P [ indexA GP ]
34 # s h ap e f u n c t i o n v a l u e an d g r a d i e n t
35 B a si s V a l u e = g e t B a s i s V a l u e ( th is MP , th isA GP )
36 B a s i s G r a d i e n t = g e t B a s i s G r a d i e n t ( t his MP , t hi sAG P )
37 i f ( t hisA GP . m ass >1 . 0 e 8)
38 v e l o c i t y = t hisA GP . Momentum / th isAG P . M ass
39 th is MP . V e l o c i t y += B a s i sV a l u e th isAG P . Fo rc e/ thi sAGP . Ma ss dT
40 PositionIncrement += BasisValue t hisA GP .Momentum/ thi sAGP . Ma ss dT
41 end
42 DeformationGradientIncrement += ve lo ci ty BasisGradient ’ dT
43 end
44 th is MP . P o s i t i o n += P o s i t i o n I n c r e m e n t
45 th is MP . S t r a i n [ 1 ] += D e f or m a t io n G r ad i e n tI n c r em e n t [ 1 , 1 ] 1.0
46 th is MP . S t r a i n [ 2 ] += D e f or m a t io n G r ad i e n tI n c r em e n t [ 1 , 1 ] 1.0
47 th isM P . S t r a in [ 3 ] += D ef or m at i on G ra di e nt I nc r em en t [ 1 , 2 ] + D ef or m at i on Gr a di e nt [ 2 , 1 ]
48 th isM P . S t r e s s = th isM P . S t i f f n e s s M a t r i x t hi sM P . S t r a i n
49 th is MP . Deforma ti on Gr ad ie nt = D ef or ma t i o n G r a d i entIncrement th isMP . Defor ma ti on Gr ad ie nt
50 th isMP . V olume = d et ( th isM P . D ef o rm a ti o nG ra d ie n t ) th is MP . I n i t i a l V o l u m e
51 end
52 end
13
Listing 7: Time-integration loop for CPDI implementation. All grid points and material points are stored into arrays denoted
by allGP and allMP, respectively. GP: Grid Point, MP: Material Point, AGP: Adjacent Grid Point. The prefix ‘this’ indicates
the reference of the object currently being processed.
1f o r Time = 0 . 0 : dT : TimeE nd
2# r e s e t g r i d −−−−−−
3f o r indexGP i n 1 : 1 : t h i s G r i d . i N od e s
4al l GP [ i nde xGP ] . Mas s = 0 . 0
5al lG P [ in dex GP ] . Momentum = [ 0 . 0 ; 0 . 0 ; 0 . 0 ]
6al lG P [ index GP ] . F or ce = [ 0 . 0 ; 0 . 0 ; 0 . 0 ]
7end
8# m a t e r i a l to g r i d −−
9f o r ind exMP = 1 : 1 : l eng th ( a llM P )
10 th isMP = al lMP [ i ndexMP ]
11 al l GP = getAG P ( th is MP , a l l GP )
12 f o r inde xAGP = 1 : 1 : size ( a llA GP )
13 th isAG P = a ll GP [ in dexAGP ]
14 B a si s V a l u e = g e t B a s i s V a l u e ( t his MP , t his AG P )
15 B a s i s G r a d i e n t = g e t B a s i s G r a d i e n t ( t his MP , t hi sAG P )
16 th isAG P . M ass += B as i s Va l ue t his MP . Mas s
17 th isA GP . Momentum += B a si s V al u e t his MP . Momentum
18 th isAG P . F o rc e += B a s is V al u e this MP . F or ce BasisGradientth isM P . S t r e s s t hisM P . Volu me
19 end
20 end
21 # u p da t e g r i d momentum an d a pp l y b o un da ry c o n d i t i o n s , s i m i l a r t o s ta n d a rd MPM
22
23 # g r i d t o m a t e r i a l p o i n t s −−
24 f o r ind exMP = 1 : 1 : size( a ll MP )
25 th isMP = al lMP [ i ndexMP ]
26 al lAG P = ge tAGP ( t his MP , al l GP )
27 DeformationGradientIncrement = [ 0 . 0 ; 0. 0; 0 .0 ]
28 f o r inde xAGP = 1 : 1 : size ( a llA GP )
29 th isAG P = a ll GP [ i ndexAGP ]
30 B a si s V a l u e = g e t B a s i s V a l u e ( th is MP , th isA GP )
31 B a s i s G r a d i e n t = g e t B a s i s G r a d i e n t ( t his MP , t hi sAG P )
32 i f ( t hisA GP . M ass >1 . 0 e 16)
33 v e l o c i t y = t his AGP . Momentum / t hisA GP . Ma ss
34 th is MP . V e l o c i t y += ( B a si s V a l ue th isG P . F orce / t his GP . Mass ) dT
35 end
36 DeformationGradientIncrement += ve lo ci ty BasisGradient ’ dT ;
37 end
38 th is MP . Deforma ti on Gr ad ie nt = D ef or ma t i o n G r a d i entIncrement th isMP . Defor ma ti on Gr ad ie nt
39 # f o r a N eo H ook ea n m od el
40 E = t hi sM P . E l a s t i c M o d u l u s
41 Nu = t hi sM P . P o i s s o n R a t i o
42 Lame1 = 0 . 5 E / ( 1 . 0 + Nu)
43 Lame2 = NuE / ( ( 1+ Nu) (1.0 2.0Nu ) )
44 F = t hisM P . De fo rm at io nG ra dient
45 J = d et (F)
46 th isM P . S t r e s s = Lame2 l o g ( J ) / J e ye ( 3 ) + Lame1 / J (FF’ e y e ( 3 ) )
47 th is MP . Momentum = th is MP . V e l o c i t y th isMP . M ass
48 end
49 # u pd a te c or n e r p o s i t i o n s
50 f o r ind exMP = 1 : 1 : size( a ll MP )
51 th isMP = al lMP [ i ndexMP ]
52 f o r i n de x Co r ne r = 1 : 1 : 4
53 t h i s C o r n e r = t hi sM P . C o rn e r [ : , i n d e x Co r n e r ]
54 C or ne rI nc re me nt = [ 0 . 0 ; 0 . 0 ; 0 . 0 ]
55 th isA GP = getAGP ( t h i s C o r n e r , a l lG P )
56 f o r inde xAGP = 1 : 1 : l eng th ( th isA GP )
57 th isAG P = al lG P [ inde xAGP ]
58 B as i s Va l u e = g e t B a s i s V a l u e C l a s s i c ( th isM P , thi sAG P )
59 i f ( t h i s G r i d P o i n t . fM a ss >1 . 0 e 16)
60 v e l o c i t y = th isAG P . Momentum / t his AGP . M ass
61 end
62 Cor n e r I n c r e m e n t += B a s i s V a l u e v e l o c i t y dT
63 end
64 th isMP . Co rn er [ : , in d ex Co rn er ] += C or ne rI n cr em en t
65 end
66 th isMP . V olume = d et ( th isM P . D ef o rm a ti o nG ra d ie n t ) th is MP . V o l u m e I n i t i a l
67 end
68 end
14
A
B
Figure 5: Geometry and initial conditions for the impact of two elastic bodies (units in N and mm).
Figure 6: Variation of kinetic energy (K) and strain energy (U) over the time for the impact of two elastic bodies.
4.1. Impact of two elastic bodies
Fig. 5shows the problem of impact between two identical elastic disks moving towards each other [10].
The computational domain is a square, of which side is 1 mm and is discretized into a mesh of 20 ×20
elements. The radius of the disks is 0.2 mm. A plane strain condition is assumed and simulations are
performed in the absence of gravity. This problem serves to verify the MPM codes developed for this study.
It is also used to evaluate the performance of Matlab and Julia codes and how they scale as the number of
particles and grid points increases.
The 20 ×20 mesh and the particle distribution are shown in Fig. 7. In this case, each disk consists of 208
particles placed at regular intervals to create the circular domains. The initial condition for this problem is
the initial velocities of the particles, vp=vfor lower-left particles and vp=vfor upper-right particles.
No boundary conditions are required here since the simulation is set to stop before the particles move out of
the computational box after impact. A constant time step of ∆t= 0.001 s is used over the entire simulation.
In order to avoid numerical problems caused by division by very small numbers, a simple cutoff algorithm
is used to detect small nodal masses [12]. A cutoff value of 108is used in this case.
In order to check for energy conservation in this problem, the values of strain energy and kinetic energy
are computed at each time step. These are defined as
U=
np
X
p=1
upVp, K =1
2
np
X
p=1
vp·vpMp(13)
where up= 1/2σp,ij p,ij denotes the strain energy density of particle p, and is explicitly calculated by
up=1
4µκ+ 1
4(σ2
p,xx +σ2
p,yy )2(σp,xxσp,y y σ2
p,xy)(14)
with µand κrepresenting the shear modulus and the Kolosov constant, respectively.
The movement of the two disks and their impact are illustrated in Fig. 5. The collision occurs in a
physically realistic fashion, although no contact law has been specified. Fig. 6plots the evolution of the
15
t= 0.5 s t= 1.0 s t= 1.5 s
t= 2.0 s t= 2.5 s t= 3.0 s
Figure 7: Snapshots for the impact of two elastic bodies before, during and after impact. These images were created using
the PyPlot graphical package [52].
kinetic (K), strain (U) and total energy (K+U). All of the initial energy is kinetic energy and equal
to K= 2 ×(0.5×(v2+v2)×ρ×π×r2)=2.513. The kinetic energy decreases during impact, but is
mostly recovered upon separation. The strain energy reaches its maximum value at the point of maximum
deformation during impact and then decreases to a value associated with free vibration of the disk. The
result is consistent to the ones reported in [10,53,54] which confirms the implementation. However the
contact does occur earlier than it should. The correct contact time is t=AB/(22v) = 1.59 s where
v= 0.1. In the simulation, contact happened at t= 1.24 s. This result is expected as the contact is resolved
at the grid nodes not the particles. This means that contact is detected even when the particles of the
two bodies are one cell apart. Consequently, increasing the resolution of the grid will give a more accurate
estimation for the time of impact.
Table 3shows the performance results for different cases of number of particles and number of grid
points, whereby it is shown that Julia code is consistently faster than Matlab. Note that increasing the
number of particles or making the grid more dense, causes the performance ratio to vary. However, for all
cases, Julia code is observed to perform more than 5 times faster than Matlab. In fact, the performance
ratio is rather significant, especially when it comes to simulations that can potentially take hours or days to
complete. For example, the simulation given in the last row of Table 3took 2.6 hours with the Matlab code
and only 0.46 hours with the Julia code. One might argue that MEX functions8can be used to enhance the
computational efficiency of Matlab codes. However, this technique is not considered here even though it was
coded in our Matlab code as we want to employ only dynamic languages for rapid development. If needed,
existing quality C/Fortran functions can be called directly by Julia, with no glue code, or boilerplate code.
Table 3: Performance comparison of Julia and Matlab code for the two-disk impact problem.
Iterations/sec. Total time [s]
Particles Grid Matlab Julia Matlab Julia Ratio
416 20x20 20.16 132.80 148.81 22.59 6.59
1624 20x20 5.30 33.37 566.36 89.90 6.30
1624 40x40 5.07 26.45 591.25 113.42 5.21
25784 80x80 0.32 1.82 9375.00 1651.07 5.68
8A MEX file is an interface between MATLAB and functions written in C or Fortran. It stands for ”MATLAB executable”.
16
Figure 8: Compliant cantilever beam example. The left face (shaded) is fixed. The dot denotes the point of which vertical
displacement is tracked in time.
Figure 9: Cantilever beam comprising of 1041 tetrahedral elements and the grid points representing a fixed constraint (dark
circles).
4.2. Cantilever beam
As another example, we consider the cantilever beam shown in Fig. 8. A Neo-Hookean constitutive model
is used with E= 1.0×106Pa and µ= 0.3. Large deformation vibration of this cantilever beam is induced
by its own weight with the sudden activation of gravity (g= 10 m/s2) at t= 0 s. This example is analyzed
using constant time steps of ∆t= 0.001 s up to t= 3.0 s. The problem makes use of 1041 material points
and implements the CPDI-Tet4 formulation described in Section 2as standard MPM and cpGIMP would
result in numerical fractures [47,48,49]. Created using Gmsh [55], the material points consist of four-node
tetrahedral elements, whereby the entire body is illustrated in Fig. 9. Note that neighbouring particles share
nodes along the common faces in our implementation and thus particle separation (or fracture) cannot be
captured. However, failure is not occurring in this example. If fracture is to be modelled with CPDI each
particle must have their own nodes/corners and the free code described in [56] can be used for this purpose
just as in cohesive crack modelling with interface elements, e.g., [57].
The codes used for this problem are verified against the results reported by [47], whereby the response
is confirmed through Fig. 11. This figure shows the vertical displacement of the corner point at the free end
of the beam. In order to show the performance advantages of Julia, three background grids of 16 ×16 ×2,
32 ×32 ×4 and 64 ×64 ×8 cells are considered. The number of elements or particles is not changed for
these analyses.
The runtime duration of Julia and Matlab codes are presented in Table 4. By comparison, the perfor-
mance advantage of Julia is clearly evident. However, another important observation made from the results
is the increasing performance advantage of Julia over Matlab, as the computations become more intense with
the increase in the number of grid points–the last simulation took 3 hours with the Matlab code whereas
the Julia code completed in just 0.6 hours.
4.3. High-velocity impact
The third and final example showcased in this study is a 2D simulation involving the impact of an
elastic steel disk with a plastic aluminum target. The geometry and initial conditions are given in Fig. 12.
17
t= 0.0 s t= 0.6 s t= 1.2 s
t= 1.8 s t= 2.4 s t= 3.0 s
Figure 10: Snapshots of the dynamic response of the cantilever beam problem.
Figure 11: Time-deflection response for the cantilever beam problem. Deflection values correspond to the bottom corner of
the free end (Fig. 8).
Table 4: Performance comparison of Julia and Matlab code for the cantilever beam problem.
Iterations/sec. Total time [s]
Particles Grid Matlab Julia Matlab Julia Ratio
1041 16x16x2 0.63 2.51 4783.16 1195.22 4.00
1041 32x32x4 0.46 1.97 6574.62 1521.22 4.32
1041 64x64x8 0.29 1.36 10384.22 2204.26 4.71
18
6061-T6 aluminium
Figure 12: Setup and initial conditions for the high-velocity impact problem.
t= 0µst= 10µst= 20µst= 30µst= 40µs
Figure 13: Snapshots for the high-velocity impact problem as the steel disk penetrated into the aluminum target. The color
represents the equivalent plastic strain. These images were created using the PyPlot graphical package [52].
The background grid has a 50 ×50 layout, however, is not shown in the figures to avoid clutter. The
simulation consists of a total of 6908 particles, 208 of which constitute the steel disk and 6700 particles for
the aluminium target. The simulation was performed over constant time increments of ∆t= 108s up to
t= 40.0×106s.
The code used to carry out this simulation is similar to the one used for the first example (impact of
two disks), except for the stress update algorithm which now involves a perfectly plastic von-Mises model.
Fig. 13 shows the penetration of the disk into the target at four different time states. The results are very
similar to the ones reported by [54], which serves as verification for the codes implemented in this study.
Table 5compares the performance of the Julia implementation to the one in Matlab. The results indicate
a significant speed advantage of more than 7 times for Julia. Given that this problem is representative of
actual engineering problems that can be solved using MPM, such an advantage is of significant interest
where the run-time of simulations is in the order of hours or even days.
Table 5: Performance comparison of the Julia and Matlab code for the high-velocity impact problem.
Iterations/sec. Total time [s]
Particles Grid Matlab Julia Matlab Julia Ratio
6908 50x50 0.54 4.27 7380.07 936.33 7.88
15448 50x50 0.23 1.92 17746.23 2088.77 8.50
5. Conclusions
This paper investigated the performance advantages of the Julia programming language as opposed to
Matlab in the context of computational solid mechanics. Using similar implementations of the Material
19
Point Method (MPM) for codes written in Julia and Matlab, run time of the two platforms were compared.
The following conclusions can be drawn from the reported results:
1. Both programming languages allow rapid development of models. This is enhanced by the fact that
both languages provide graphical tools to easily visualize the results.
2. Codes written in Julia are generally faster than those written in Matlab. The understanding of how
objects are accessed and passed through functions in Julia, allows some implementation techniques to
be used to further enhance the performance of the program.
3. In contrast to Matlab where vectorized operations are more favorable against for-loops [58,59], Julia
code runs faster when iterative operations are not vectorized [5]. This is important when it comes
to MPM implementations since such loops are extensively used to iterate over nodal grid points and
material points.
4. Using composite types (synonymous to ‘struct’ in C) is commonly used in software design given its
contribution to the organization and readability of the code. However, utilizing composite types instead
of multi-dimensional arrays is shown to decrease the performance of the code. Through benchmark
testing, this paper demonstrates that removing redundant calls to the members of composite types
and replacing them with a single reference access can narrow the performance gap between composite
types and multi-dimensional arrays.
In conclusion, Julia enables writing efficient codes without losing productivity and we no longer need
to know two programming languages as people have been using Fortran/C in their Matlab/Python codes
within the paradigm of mixed language programming. However, our debugging experiences with Julia is
negative as Julia lacks a matured interactive debugger that Matlab provides. This is not suprising as Julia
is a relatively young language of about 4 year old and the current version is only 0.4.5, and work has been
initiated on a debugger for Julia (https://github.com/toivoh/Debug.jl).
Acknowledgements
Funding support from the Australian Research Council via project DE160100577 (Vinh Phu Nguyen) is
gratefully acknowledged. The first author also acknowledges the financial support from the Civil Engineering
Department at Monash University.
Appendix A. Some syntax differences between Matlab and Julia
Several typical syntax differences between Matlab and Julia are given in Table A.1. A comprehen-
sive list can be found at http://hyperpolyglot.org/numerical-analysis even with a script to convert
Matlab codes to Julia. Another source for this is http://docs.julialang.org/en/release-0.4/manual/
noteworthy-differences/.
Appendix B. Code organization
Our complete MPM code is organized into four Julia files as shown in Table B.1. Julia comes with a
full-featured interactive command-line REPL (read-eval-print loop) built into the julia executable. In order
to run the simulations one launches the Julia REPL using the julia command, and change to the directory
where the source code is found9and type include(”Main.jl”). We used @time include(”Main.jl”) to measure
the runtime of the examples presented in this article.
9If the code is in the folder /Users/vingu/my-codes/JuliaCodes/, then the command would be cd(”/Users/vingu/my-
codes/JuliaCodes/”).
20
Table A.1: Some syntax differences between Matlab and Julia
Matlab Julia
File extension .m .jl
Comments % comment # comment
Quotes ‘Quote’ ‘Quote’
“Quote”
In-line functions f = @(x,y) x+y f(x,y) = x+y
Functions function [a,b] = f(x,y) function f(x,y)
a=x+y; a=x+y
b = x * y; b = x * y;
end (optional) return [a b]
end
Array index K(i,j) K[i,j]
Conditional expression none x >0 ? x : x
Table B.1: Organization of the presented MPM code.
Main.jl main script 379 lines (including plotting)
Basis.jl shape functions 53 lines
Grid.jl grid and grid points 104 lines
MaterialPoint.jl material points 139 lines
References
[1] MathWorks. http://www.mathworks.com.
[2] Python Software Foundation. https://www.python.org/.
[3] Mathematica. http://www.mathematica.com.
[4] J. Bezanson, S. K., V. B. Shah, and A. Edelman. Julia: A fast dynamic language for technical computing. CoRR,
abs/1209.5145, 2012.
[5] J. Bezanson, A. Edelman, S. K., and V. B. Shah. Julia: A fresh approach to numerical computing. CoRR, abs/1411.1607,
2014.
[6] C. Lattner and Vikram A. LLVM: A compilation framework for lifelong program analysis & transformation. In Proceedings
of the International Symposium on Code Generation and Optimization: Feedback-directed and Runtime Optimization,
CGO ’04, pages 75–. IEEE Computer Society, 2004.
[7] J. B., S. K., V. B. Shah, and A. Edelman. Julia: A fast dynamic language for technical computing. CoRR, abs/1209.5145,
2012.
[8] A. A. Ramabathiran. Finite element programming in Julia. http://www.codeproject.com/Articles/579983/
Finite-Element- programming-in- Julia.
[9] A. Logg, K.-A. Mardal, G. N. Wells, et al. Automated Solution of Differential Equations by the Finite Element Method.
Springer, 2012.
[10] D. Sulsky, Z. Chen, and H.L. Schreyer. A particle method for history-dependent materials. Computer Methods in Applied
Mechanics and Engineering, 5:179–196, 1994.
[11] D. Sulsky, S.J. Zhou, and H. L. Schreyer. Application of a particle-in-cell method to solid mechanics. Computer Physics
Communications, 87(1-2):236–252, 1995.
[12] D. Sulsky and H.L. Schreyer. Axisymmetric form of the material point method with applications to upsetting and Taylor
impact problems. Computer Methods in Applied Mechanics and Engineering, 139:409–429, 1996.
[13] T. Rabczuk, T. Belytschko, and S.P. Xiao. Stable particle methods based on Lagrangian kernels. Computer Methods in
Applied Mechanics and Engineering, 193(12-14):1035 – 1063, 2004.
[14] T. Rabczuk and T. Belytschko. Cracking particles: a simplified meshfree method for arbitrary evolving cracks. Interna-
tional Journal for Numerical Methods in Engineering, 61(13):2316–2343, 2004.
[15] T. Belytschko, Y. Krongauz, D. Organ, M. Fleming, and P. Krysl. Meshless methods: An overview and recent develop-
ments. Computer Methods in Applied Mechanics and Engineering, 139:3–47, 1996.
[16] T. Rabczuk, S. Bordas, and G. Zi. A three-dimensional meshfree method for continuous multiple-crack initiation, propa-
gation and junction in statics and dynamics. Computational Mechanics, 40(3):473–495, 2007.
[17] T. Rabczuk and T. Belytschko. A three-dimensional large deformation meshfree method for arbitrary evolving cracks.
Computer Methods in Applied Mechanics and Engineering, 196(29):2777–2799, 2007.
21
[18] V.P. Nguyen, T. Rabczuk, S. Bordas, and M. Duflot. Meshless methods: A review and computer implementation aspects.
Mathematics and Computers in Simulation, 79(3):763–813, 2008.
[19] T. Rabczuk, G. Zi, S. Bordas, and H. Nguyen-Xuan. A simple and robust three-dimensional cracking-particle method
without enrichment. Computer Methods in Applied Mechanics and Engineering, 199(37):2437–2455, 2010.
[20] S. Andersen and L. Andersen. Modelling of landslides with the material-point method. Computational Geosciences,
14(1):137–147, 2010.
[21] Z. Wie¸ckowski, Sung-kie Y., and Jeoung-heum Y. A Particle-in-cell solution to the silo discharging problem. International
Journal For Numerical Methods in Engineering, 45:1203–1225, 1999.
[22] Z. Wie¸ckowski. The material point method in large strain engineering problems. Computer Methods in Applied Mechanics
and Engineering, 193(39-41):4417–4438, 2004.
[23] H.-B. M¨uhlhaus, H. Sakaguchi, L. Moresi, and M. Fahey. Discrete and continuum modelling of granular materials. In
P.A. Vermeer, H.J. Herrmann, S. Luding, W. Ehlers, S. Diebels, and E. Ramm, editors, Continuous and Discontinuous
Modelling of Cohesive-Frictional Materials, volume 568 of Lecture Notes in Physics, pages 185–204. Springer Berlin
Heidelberg, 2001.
[24] C. J. Coetzee, P. A. Vermeer, and A. H. Basson. The modelling of anchors using the material point method. International
Journal for Numerical and Analytical Methods in Geomechanics, 29(9):879–895, 2005.
[25] H.W. Zhang, K.P. Wang, and Z. Chen. Material point method for dynamic analysis of saturated porous media under
external contact/impact of solid bodies. Computer Methods in Applied Mechanics and Engineering, 198(17-20):1456–1472,
2009.
[26] L. Beuth, Z. Wieckowski, and P. A. Vermeer. Solution of quasi-static large-strain problems by the material point method.
International Journal for Numerical and Analytical Methods in Geomechanics, 35(13):1451–1465, 2011.
[27] J. Ma, D. Wang, and M.F. Randolph. A new contact algorithm in the material point method for geotechnical simulations.
International Journal for Numerical and Analytical Methods in Geomechanics, 38(11):1197–1210, 2014.
[28] A. Yerro, E.E. Alonso, and N.M. Pinyol. The material point method for unsaturated soils. eotechnique, 65:201–217(16),
2015.
[29] S.G. Bardenhagen, A.D. Brydon, and J.E. Guilkey. Insight into the physics of foam densification via numerical simulation.
Journal of the Mechanics and Physics of Solids, 53(3):597 – 617, 2005.
[30] A.D. Brydon, S.G. Bardenhagen, E.A. Miller, and G.T. Seidler. Simulation of the densification of real open-celled foam
microstructures. Journal of the Mechanics and Physics of Solids, 53(12):2638 – 2660, 2005.
[31] S.G. Bardenhagen, J.U. Brackbill, and D. Sulsky. The material-point method for granular materials. Computer Methods
in Applied Mechanics and Engineering, 187(3-4):529–541, 2000.
[32] S.G. Bardenhagen, J.E. Guilkey, K.M. Roessig, J.U. Brackbill, W.M. Witzel, and J.C. Foster. Improved contact algo-
rithm for the material point method and application to stress propagation in granular material. Computer Modeling in
Engineering and Sciences, 2(4):509–522, 2001.
[33] D. Sulsky, H.L. Schreyer, K. Peterson, R. Kwok, and M. Coon. Using the material-point method to model sea ice dynamics.
Journal of Geophysical Research, 112(C2):C02S90, 2007.
[34] Y. Wang, H.G. Beom, M. Sun, and S. Lin. Numerical simulation of explosive welding using the material point method.
International Journal of Impact Engineering, 38(1):51–60, 2011.
[35] R. Ambati, X. Pan, H. Yuan, and X. Zhang. Application of material point methods for cutting process simulations.
Computational Materials Science, 57:102–110, 2012.
[36] X. F. Pan, A. Xu, G. Zhang, and J. Zhu. Generalized interpolation material point approach to high melting explosive
with cavities under shock. Journal of Physics D: Applied Physics, 41(1):015401, 2008.
[37] W. Hu and Z. Chen. Model-based simulation of the synergistic effects of blast and fragmentation on a concrete wall using
the MPM. International Journal of Impact Engineering, 32(12):2066 – 2096, 2006.
[38] B. Banerjee. Material point method simulations of fragmenting cylinders. In 17th ASCE Engineering Mechanics Confer-
ence, University of Delaware, Newark, DE, June 2004.
[39] J.E. Guilkey, T.B. Harman, and B. Banerjee. An Eulerian-Lagrangian approach for simulating explosions of energetic
devices. Computers & Structures, 85(11-14):660–674, 2007.
[40] J. Burghardt, B. Leavy, J. Guilkey, Z. Xue, and R. Brannon. Application of Uintah-MPM to shaped charge jet penetration
of aluminum. IOP Conference Series: Materials Science and Engineering, 10(1):012223, 2010.
[41] James E. Guilkey, James B. Hoying, and Jeffrey A. Weiss. Computational modeling of multicellular constructs with the
material point method. Journal of Biomechanics, 39(11):2074 – 2086, 2006.
[42] T. Belytschko, W. K. Liu, and B. Moran. Nonlinear Finite Elements for Continua and Structures. John Wiley & Sons,
Chichester, England, 2000.
[43] V. P. Nguyen. Material point method: basics and applications. https://www.researchgate.net/publication/262415477_
Material_point_method_basics_and_applications_Contents, 2014. Online.
[44] P.C. Wallstedt and J.E. Guilkey. An evaluation of explicit time integration schemes for use with the generalized interpo-
lation material point method. Journal of Computational Physics, 227(22):9628 – 9642, 2008.
[45] M. Steffen, R. M. Kirby, and M. Berzins. Decoupling and balancing of space and time errors in the material point method
(MPM). International Journal for Numerical Methods in Engineering, 82(10):1207–1243, 2010.
[46] S.G. Bardenhagen and E.M. Kober. The generalized interpolation material point method. Computer Modeling in Engi-
neering and Sciences, 5(6):477–495, 2004.
[47] A. Sadeghirad, R. M. Brannon, and J. Burghardt. A convected particle domain interpolation technique to extend appli-
cability of the material point method for problems involving massive deformations. International Journal for Numerical
Methods in Engineering, 86(12):1435–1456, 2011.
22
[48] A. Sadeghirad, R.M. Brannon, and J.E. Guilkey. Second-order convected particle domain interpolation (CPDI2) with
enrichment for weak discontinuities at material interfaces. International Journal for Numerical Methods in Engineering,
95(11):928–952, 2013.
[49] M. A. Homel, R. M. Brannon, and J. Guilkey. Controlling the onset of numerical fracture in parallelized implementations
of the material point method (MPM) with convective particle domain interpolation (CPDI) domain scaling. International
Journal for Numerical Methods in Engineering, 107(1):31–48, 2017.
[50] V.P. Nguyen and G.D. Nguyen. A Voronoi cell material point method for large deformation solid mechanics problems.
In Advances of Computational Mechanics in Australia, volume 846 of Applied Mechanics and Materials, pages 108–113,
2016.
[51] V.P. Nguyen, C.T. Nguyen, S. Najatarajan, and T. Rabczuk. On a family of convected particle domain interpolations in
the material point method. Finite Elements in Analysis and Design, 126:50–64, 2017.
[52] S. G. Johnson. PyPlot module for Julia. https://github.com/stevengj/PyPlot.jl, 2012.
[53] O Buzzi, DM Pedroso, and A Giacomini. Caveats on the implementation of the generalized material point method.
Computer Modeling in Engineering and Sciences, 1(1):1–21, 2008.
[54] C. J. Coetzee. The Modelling of Granular Flow Using the Particle-in-Cell Method. PhD thesis, University of Stellenbosch,
2003.
[55] C. Geuzaine and J. F. Remacle. Gmsh: a three-dimensional finite element mesh generator with built-in pre- and post-
processing facilities. International Journal for Numerical Methods in Engineering, 79(11):1309–1331, 2009.
[56] V.P. Nguyen. An open source program to generate zero-thickness cohesive interface elements. Advances in Engineering
Software, 74:27–39, 2014.
[57] V.P. Nguyen. Discontinuous Galerkin/Extrinsic cohesive zone modeling: implementation caveats and applications in
computational fracture mechanics. Engineering Fracture Mechanics, 128:37–68, 2014.
[58] MathWorks. Using vectorization in Matlab. https://au.mathworks.com/help/matlab/matlab_prog/vectorization.html,
2016.
[59] MathWorks. Techniques to improve performance. https://au.mathworks.com/help/matlab/matlab_prog/
techniques-for- improving-performance.html, 2016.
23
... This difference is expected since these functions originally necessitate an extensive use of two nested for-loops to calculate i) the material point contribution or ii) the interpolation of updated nodal solutions. between the actual implementation and the one used by Sinaie et al. (2017); the latter is based on a USL variant with a cutoff algorithm, whereas our implementation relies on the MUSL (or double mapping) procedure, which necessitates a double mapping procedure. The initial geometry and parameters are the same as those used in Sinaie et al. (2017). ...
... between the actual implementation and the one used by Sinaie et al. (2017); the latter is based on a USL variant with a cutoff algorithm, whereas our implementation relies on the MUSL (or double mapping) procedure, which necessitates a double mapping procedure. The initial geometry and parameters are the same as those used in Sinaie et al. (2017). ...
... Our CPDI2q implementation ,in MATLAB R2018a, is, ad minima, 2.8 times faster than the Julia implementation proposed by Sinaie et al. (2017) for similar hardware (see Table 3). Sinaie et al. (2017) completed the analysis with an Intel Core i7-6700 ...
Preprint
Full-text available
In this contribution, we present an efficient MATLAB-based implementation of the material point method (MPM) and its most recent variants. MPM has gained popularity over the last decade, especially for problems in solid mechanics in which large deformations are involved, i.e., cantilever beam problems, granular collapses and even large-scale snow avalanches. Although its numerical accuracy is lower than that of the widely accepted finite element method (FEM), MPM has been proven useful in overcoming some of the limitations of FEM, such as excessive mesh distortions. We demonstrate that MATLAB is an efficient high-level language for MPM implementations that solve elasto-dynamic and elasto-plastic problems, such as the cantilever beam and granular collapses, respectively. We report a computational efficiency factor of 20 for a vectorized code compared to a classical iterative version. In addition, the numerical efficiency of the solver surpassed those of previously reported MPM implementations in Julia, ad minima 2.5 times faster under a similar computational architecture.
... As MPM and FEM are similar in their structure, we aim to improve the performance of MATLAB up to the level reported by Sinaie et al. (2017) using the Julia language environment. In principal, Julia is significantly faster than MAT-LAB for an MPM implementation. ...
... Then, we present both the efficiency and the numerical performance for a selected case, e.g. the elasto-plastic collapse. We offer conclusions on and compare the performance of the solver with respect to the specific case of an impact of two elastic discs previously implemented in a Julia language environment by Sinaie et al. (2017). ...
... The cantilever beam problem (Sinaie et al., 2017;Sadeghirad et al., 2011) is the second benchmark that demonstrates the robustness of the MPM solver. Two MPM variants are implemented, namely (i) the contiguous GIMPM (cpGIMPM), which relies on the stretching part of the deformation gradient (see Charlton et al., 2017) to update the particle domain as large rotations are expected during the deformation of the beam, and (ii) the convected particle domain interpolation (CPDI, Leavy et al., 2019;Sadeghirad et al., 2011). ...
Article
Full-text available
We present an efficient MATLAB-based implementation of the material point method (MPM) and its most recent variants. MPM has gained popularity over the last decade, especially for problems in solid mechanics in which large deformations are involved, such as cantilever beam problems, granular collapses and even large-scale snow avalanches. Although its numerical accuracy is lower than that of the widely accepted finite element method (FEM), MPM has proven useful for overcoming some of the limitations of FEM, such as excessive mesh distortions. We demonstrate that MATLAB is an efficient high-level language for MPM implementations that solve elasto-dynamic and elasto-plastic problems. We accelerate the MATLAB-based implementation of the MPM method by using the numerical techniques recently developed for FEM optimization in MATLAB. These techniques include vectorization, the use of native MATLAB functions and the maintenance of optimal RAM-to-cache communication, among others. We validate our in-house code with classical MPM benchmarks including (i) the elastic collapse of a column under its own weight; (ii) the elastic cantilever beam problem; and (iii) existing experimental and numerical results, i.e. granular collapses and slumping mechanics respectively. We report an improvement in performance by a factor of 28 for a vectorized code compared with a classical iterative version. The computational performance of the solver is at least 2.8 times greater than those of previously reported MPM implementations in Julia under a similar computational architecture.
... We think that beginners to the field should implement the MPM themselves using a high-level language such as Matlab, Python, or Julia; as it is the only way to fully understand the method. To that end, the note of Nguyen [2014b] and the Julia implementation 5 in Sinaie et al. [2017] can be consulted. On the other hand, to solve large scale problems, one would need a more efficient MPM code, usually implemented in a low-level language such as Fortran or C++. ...
... The latter results in reusable codes for future projects, but slows down the research progress due to low-level engineering. Open source MPM codes belong to the former category can be found for example in Sinaie et al. [2017] who presented a Julia implementation and at https: //csmbrannon.net/2018/11/09/matlab-and-mms-source-files/ for a Matlab code. ...
Chapter
Full-text available
It has been 25 years since Sulsky and her co-workers developed the first version of the material point method (MPM): a quasi particle method to solve continuum mechanics problems. In the MPM, the continua are discretized by Lagrangian particles moving over a fixed Eulerian background grid. As a result, large deformation and contact can be treated effortlessly. Since then, many improved instances of the MPM have been developed and the MPM has found applications in many fields from geoengineering to movie industry. As the MPM has now been matured and a large body of literature on it exists, it is a good time to ponder and reflect on the developments of the method to date. To this end, this manuscript provides a concise introduction to the MPM, covering theory, implementation and applications. All the algorithms required to have a working MPM implementation for the simulations of solids, fluids and their interactions are provided. We have coded these algorithms in in-house open source programs and used them to study the performance of different MPM variants for large deformation solid mechanics problems. These problems exhibit large plastic deformation, fractures and contacts. Convergence of different MPMs (CPDI, GIMP, B-splines, Total Lagrangian MPM, improved MPMs) are studied. Furthermore, MPM formulations for fluids/gases and heat conduction are also covered. Potential areas for improvement on the method have been identified. The paper is the first review of the MPM and presents a state-of-the-art of the current MPM literature covering 339 references.
... The latter results in reusable codes for future projects, but slows down the research progress due to low-level engineering. Open source MPM codes belonging to the former category can be found for example in Sinaie et al. [2017], who presented a Julia implementation, and at https://csmbrannon.net/2018/11/09/matlaband-mms-source-files/ for a Matlab code. There exist a few MPM implementations belonging to the second category. ...
Article
Full-text available
A simple and robust C++ code for the material point method (MPM) called Karamelo is presented here. It was designed to provide an open source, fast, light and easy-to-modify framework for both conducting research on the MPM and research using the MPM, instead of a finite element package. This paper presents the overall philosophy, the main design choices and some of the original algorithms implemented in Karamelo. Simulations of solids and fluids involving extreme deformation are provided to illustrate the capabilities of the code.
... We implemented GPIC in Julia, which provides a platform for fast prototyping and fast codes close to static languages such as C/Fortran (Bezanson et al., 2012). We refer to Sinaie et al. (2017) for implementation details. FE meshes are generated using gmsh (Geuzaine and Remacle, 2009) and visualization is done with either Paraview for GPIC and Ovito for the MPM (Stukowski, 2009). ...
Article
Full-text available
Within the framework of the material point method, a generalized particle in cell method for explicit solid dynamics is presented. In this method, the solids are discretized by finite element meshes, and these meshes are embedded in a background Eulerian grid. The external and internal forces of the solids are calculated on their respective finite element meshes and are mapped to the background grid for solving the momentum equation. Two formulations for computing these forces are presented: one using the original configuration of the solids and the other employs the current configuration. Two and three dimensional numerical examples, covering massive tensile, compressive elastic and plastic deformation, demonstrate that the former formulation performs much better for extremely large deformation problems. Compared with previous material point methods, the proposed method offers these advantages: (i) better representation of solid boundaries, (ii) seamless enforcement of Dirichlet and Neumann boundary conditions, (iii) seamless treatment of material interfaces and (iv) higher efficiency. All of these are achieved with the introduction of a finite element mesh in a supposedly meshfree method.
... We implemented GPIC in Julia, which provides a platform for fast prototyping and fast codes close to static languages such as C/Fortran (Bezanson et al., 2012). We refer to Sinaie et al. (2017) for implementation details. FE meshes are generated using gmsh (Geuzaine and Remacle, 2009) and visualization is done with either Paraview for GPIC and Ovito for the MPM (Stukowski, 2009). ...
Preprint
Full-text available
Within the framework of the material point method, a generalized particle in cell method for explicit solid dynamics is presented. In this method, the solids are discretized by finite element meshes, and these meshes are embedded in a background Eulerian grid. The external and internal forces of the solids are calculated on their finite element meshes and are mapped to the background grid for solving the momentum equation. Two formulations of computing these forces, one using the original configuration of the solids and the other employs the current configuration are presented. Two and three dimensional numerical examples, covering massive tensile, compressive elastic and plastic deformation, demonstrate that the former formulation performs much better for extremely large deformation problems. Compared with previous material point methods, the proposed method offers these advantages: (i) better representation of solid boundaries, (ii) seamless enforcement of Dirichlet and Neumann boundary conditions, (iii) seamless treatment of material interfaces and (iv) higher efficiency. All of these are achieved with the introduction of a finite element mesh in a supposedly meshfree method.
Article
Full-text available
In this paper, a parallel Smoothed Finite Element Method (S-FEM) package epSFEM using incremental theory to solve elastoplastic problems is developed by employing the Julia language on a multicore CPU. The S-FEM, a new numerical method combining the Finite Element Method (FEM) and strain smoothing technique, was proposed by Liu G.R. in recent years. The S-FEM model is softer than the FEM model for identical grid structures, has lower sensitivity to mesh distortion, and usually produces more accurate solutions and a higher convergence speed. Julia, as an efficient, user-friendly and open-source programming language, balances computational performance, programming difficulty and code readability. We validate the performance of the epSFEM with two sets of benchmark tests. The benchmark results indicate that (1) the calculation accuracy of epSFEM is higher than that of the FEM when employing the same mesh model; (2) the commercial FEM software requires 10,619 s to calculate an elastoplastic model consisting of approximately 2.45 million triangular elements, while in comparison, epSFEM requires only 5876.3 s for the same computational model; and (3) epSFEM executed in parallel on a 24-core CPU is approximately 10.6 times faster than the corresponding serial version.
Article
Numerical methods are the most popular tools in computational mechanics and have been used to tackle various practical engineering problems. However, the most common programming languages used for implementing numerical methods do not effectively balance the demands of productivity and efficiency. To address the most computationally intensive areas of numerical computing with the increased abstraction and productivity provided by a high-level language, the Julia language was released by the Massachusetts Institute of Technology (MIT) in 2012. The Julia language is an open-source programming language that presents simple syntax and satisfactory performance; this is particularly useful for scientific computing. In this paper, we present a comprehensive survey on the use of the Julia language in computational mechanics. First, we introduce the existing numerical computing packages developed in the Julia language and their relevant applications. Second, we analyze the capabilities of the Julia language in the development of software packages for computational mechanics. Finally, we discuss the open issues regarding the Julia language and the challenges faced when using the Julia language in computational mechanics.
Chapter
Time series are sequences of data indexed by time. Such data are collected in various domains, often in massive amounts, such that storing them proves challenging. Thus, time series are commonly stored in a compressed format. An important compression approach is piecewise linear approximation (PLA), which only keeps a small set of time points and interpolates the remainder linearly. Picking a subset of time points such that the PLA minimizes the mean squared error to the original time series is a challenging task, naturally lending itself to heuristics. We propose the piecewise linear approximation genetic algorithm (PLA-GA) for compressing time series by PLA. The PLA-GA is a memetic (\mu + \lambda) GA that makes use of two distinct operators tailored to time series compression. First, we add special individuals to the initial population that are derived using established PLA heuristics. Second, we propose a novel local search operator that greedily improves a compressed time series. We compare the PLA-GA empirically with existing evolutionary approaches and with a deterministic PLA algorithm, known as Bellman's algorithm, that is optimal for the restricted setting of sampling. In both cases, the PLA-GA approximates the original time series better and quicker. Further, it drastically outperforms Bellman's algorithm with increasing instance size with respect to run time until finding a solution of equal or better quality - we observe speed-up factors between 7 and 100 for instances of 90,000 to 100,000 data points.
Article
Full-text available
Mesh-based numerical methods such as the Finite Element Method (FEM) and Finite Difference Method (FDM) are widely used in various fields of science and engineering. However, the shortcomings of mesh-based methods are becoming increasingly obvious mainly due to the distorted or broken elements when analyzing the problems of large deformation or crack propagation. To overcome the above problems, meshfree methods such as the Meshless Local Petrov-Galerkin (MLPG) and Radial Point Interpolation Method (RPIM) were proposed, which can eliminate or partially eliminate the difficulties triggered by mesh-dependence. In geotechnics, the numerical modeling of deformations and failures of soil and rock masses is one of the most important approaches to understand and prevent geohazards, such as landslides and ground subsidence. In this paper, a local RPIM-based meshfree software package GeoMFree3D is specifically developed for analyzing the deformations and failures of soil and rock masses. To enhance the computing capability of GeoMFree3D, (1) effective memory storage strategies are adopted to solve the memory requirement bottleneck; and (2) parallel computing strategies are utilized and heterogeneously implemented on multi-core CPU and many-core GPU to improve the computational efficiency. To demonstrate the performance of GeoMFree3D, three simple verification examples and one application case are presented in this paper. The verification examples indicate that the computational accuracy and efficiency of the package GeoMFree3D is acceptable. Furthermore,the application case indicates that GeoMFree3D is capable of analyzing the displacements of complex rock slopes. GeoMFree3D is currently under intensive development, plans for future work on the development of GeoMFree3D are also introduced.
Article
Full-text available
We present a family of convected particle domain interpolations (CPDIs) within the framework of the material point method (MPM). That includes two dimensional triangular, quadrilateral, and polygonal CPDIs and three dimensional tetrahedron and polyhedron CPDIs. Theoretical derivations as well as computer implementation aspects are provided. A new perspective of CPDIs is given to link it to the recent works on the coupling of MPM and finite element method. Numerical examples are given to demonstrate the proposed method.
Article
Full-text available
Particle methods have been increasingly used in numerical simulations of complex prob- lems in both sciences and engineering. A plethora of different particle methods exists of which the material point method (MPM) is a promising method that is able to deal with high strain rate problems that involve contact, impact, damage and fragmentation. Particle domains in the MPM are currently represented by quadrilaterals in two dimensions. Extension to polygonal particle domains is presented based on a simple sub-division of the polygons into sub-triangles. This allows MPM simulations to be carried out for structures and materials discretized by Voronoi tessellations. Performances of the proposed method are illustrated by means of numerical simulations.
Article
Full-text available
The paper describes a three-phase single-point material point method formulation of coupled flow (water and air) for hydro-mechanical analysis of geotechnical problems involving unsaturated soils. The governing balance and dynamic momentum equations are discretised and adapted to material point method characteristics: an Eulerian computational mesh and a Lagrangian analysis of material points. General mathematical expressions for the terms of the set of governing equations are given. A suction-dependent elastoplastic Mohr–Coulomb model, expressed in terms of net stress and suction variables is implemented. The instability of a slope subjected to rain infiltration, inspired from a real case, is solved and discussed. The model shows the development of the initial failure surface in a region of deviatoric strain localisation, the evolution of stress and suction states in some characteristic locations, the progressive large strain deformation of the slope and the dynamics of the motion characterised by the history of displacement, velocity and acceleration of the unstable mass.
Article
Full-text available
Contact between deformable bodies is a difficult problem in the analysis of engineering systems. A new approach to contact has been implemented using the Material Point Method for solid mechanics. Here two improvements to the algorithm are described. The first is to include the normal traction in the contact logic to more appropriately determine the free separation criterion. The second is to provide numerical stability by scaling the contact impulse when computational grid information is suspect, a condition which can be expected to occur occasionally as material bodies move through the computational grid. The modifications described preserve important properties of the original algorithm, namely conservation of momentum, and the use of global quantities which obviate the need for neighbor searches and result in the computational cost scaling linearly with the number of contacting bodies. The algorithm is demonstrated on several examples. Deformable body solutions compare favorably with several problems which, for rigid bodies, have analytical solutions. A much more demanding simulation of stress propagation through idealized granular material, for which high fidelity data has been obtained, is examined in detail. Excellent qualitative agreement is found for a variety of contact conditions. Important material parameters needed for more quantitative comparisons are identified.
Article
Full-text available
Bridging cultures that have often been distant, Julia combines expertise from the diverse fields of computer science and computational science to create a new approach to numerical computing. Julia is designed to be easy and fast. Julia questions notions generally held as “laws of nature” by practitioners of numerical computing: 1. High-level dynamic programs have to be slow, 2. One must prototype in one language and then rewrite in another language for speed or deploy- ment, and 3. There are parts of a system for the programmer, and other parts best left untouched as they are built by the experts. We introduce the Julia programming language and its design — a dance between specialization and abstraction. Specialization allows for custom treatment. Multiple dispatch, a technique from computer science, picks the right algorithm for the right circumstance. Abstraction, what good computation is really about, recognizes what remains the same after differences are stripped away. Abstractions in mathematics are captured as code through another technique from computer science, generic programming. Julia shows that one can have machine performance without sacrificing human convenience.
Article
Full-text available
Computer implementation of the hybrid discontinuous Galerkin/cohesive zone model method (dG/CZM) for crack modeling is presented. The dG/CZM constitutes a (volumetric) locking free single field yet highly scalable method for nonlinear solid/fracture mechanics problems, particularly dynamic fracture analyses with crack branching and fragmentation. In the dG/CZM cohesive interface elements are placed at interelement boundaries prior to the simulation of which artificial compliance is removed by a dG formulation. The formulation is switched to a standard extrinsic cohesive crack model upon satisfaction of a failure criterion. We provide details on the preprocessing step where interface elements are inserted into the finite element mesh and on the computation of the internal force vector and the tangent stiffness matrix. Various examples that consist of (in)compressible elasticity, microcracking of fiber reinforced composite materials and dynamic fracture are investigated to verify the model and its implementation. This paper is addressed to researchers who would like to have a quick working implementation of dG/CZM methods.
Article
The Material Point Method (MPM) is well suited for large-deformation problems in solid mechanics, but requires modification to avoid cell-crossing errors as well as extension instabilities that lead to numerical (nonphysical) fracture. A promising solution is convected particle domain interpolation (CPDI), in which the integration domain used to map data between particles and the background grid deforms with the particle, based on the material deformation gradient. While eliminating the extension instability can be a benefit, it is often desirable to allow material separation to avoid nonphysical stretching. Additionally, large stretches in material points can complicate parallel implementation of CPDI if a single particle domain spans multiple computational patches. A straightforward modification to the CPDI algorithm allows a user-specified scaling of the particle integration domain to control the numerical fracture response, which facilitates parallelization. Combined with particle splitting, the method can accommodate materials with arbitrarily large failure strains. Used with a smeared damage/softening model, this approach will prevent nonphysical numerical fracture in situations where the material should remain intact, but the effect of a single velocity field on localization may still produce errors in the post-failure response. Details are given for both 2-D and 3-D implementations of the scaling algorithm. This article is protected by copyright. All rights reserved.
Conference Paper
A new approach for modelling discrete cracks in meshfree methods is described. In this method, the crack can be arbitrarily oriented, but its growth is represented discretely by activation of crack surfaces at individual particles, so no representation of the crack's topology is needed. The crack is modelled by a local enrichment of the test and trial functions with a sign function (a variant of the Heaviside step function), so that the discontinuities are along the direction of the crack. The discontinuity consists of cylindrical planes centred at the particles in three dimensions, lines centred at the particles in two dimensions. The model is applied to several 2D problems and compared to experimental data. Copyright © 2004 John Wiley & Sons, Ltd.