<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://micro.stanford.edu/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Yfwang09</id>
	<title>Micro and Nano Mechanics Group - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://micro.stanford.edu/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Yfwang09"/>
	<link rel="alternate" type="text/html" href="http://micro.stanford.edu/wiki/Special:Contributions/Yfwang09"/>
	<updated>2026-07-05T09:21:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Perform_Nanoindentation_on_Al-Mg_Alloy&amp;diff=6823</id>
		<title>Perform Nanoindentation on Al-Mg Alloy</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Perform_Nanoindentation_on_Al-Mg_Alloy&amp;diff=6823"/>
		<updated>2022-10-12T04:47:44Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Retrieve the Forth-Depth Curve of Nanoindentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=&amp;quot;+3&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
Nanoindentation on Al-Mg Alloy using LAMMPS &amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Yifan Wang&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;/DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt; Created May 2017&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial explains how to create an FCC sample of Al-Mg alloy and perform nanoindentation on the sample in LAMMPS.&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Prerequisite==&lt;br /&gt;
&lt;br /&gt;
For this simulation, we will use the LAMMPS 5 Nov 2016 version. The newer version may have changes of the commands. When compiling LAMMPS, please switch on the package MANYBODY in order to use the EAM potential. More details about compiling LAMMPS, please see the manual page (http://lammps.sandia.gov/doc/Section_start.html) for more information.&lt;br /&gt;
&lt;br /&gt;
== Prepare The Sample of Al-Mg Alloy ==&lt;br /&gt;
&lt;br /&gt;
In this note, we will use the following geometric parameters as an example, to show how to perform nanoindentation MD simulation in LAMMPS:&lt;br /&gt;
&lt;br /&gt;
: Weight percentage: 0.6% (~0.67% atomic percentage)&lt;br /&gt;
: Simulation Box: 32.4x32.4x32.4nm (free surface on z-direction, pbc on x- and y-directions)&lt;br /&gt;
: Indenter radius: 16.2nm&lt;br /&gt;
&lt;br /&gt;
=== Thermodynamics ===&lt;br /&gt;
&lt;br /&gt;
According to the phase diagram of Al-Mg alloy (Fig.1), the solubility of Mg in Al is smaller than 1% at room temperature. For our case, since the atomic concentration is 0.67%, we can generate the sample by first creating pure FCC Al metal, and then randomly exchange required Al atoms to Mg.&lt;br /&gt;
&lt;br /&gt;
[[Image:Al-Mg_phase_diagram.jpg | thumb | 500px | center | Fig.1 Phase Diagram of Aluminum-Magnesium (Murray, 1982)]]&lt;br /&gt;
[[Image:Al-Mg_size_factor.jpg | thumb | 500px | center | Fig.2 Size Factors of Al-Mg solid solution (Cai&amp;amp;Nix, 2016)]]&lt;br /&gt;
&lt;br /&gt;
However, the size factor of Mg as the solute in Al is not negligible (Fig.2). We have to consider the volume change of the sample by adding Mg into pure Al. There are two ways to account for the size effect:&lt;br /&gt;
&lt;br /&gt;
# Relax the sample under zero pressure after we generate the Al-Mg alloy.&lt;br /&gt;
# Estimate the volume change theoretically from the size factor.&lt;br /&gt;
&lt;br /&gt;
Although the first method is more correct in the physical sense, the relaxation process will create surface steps on the free surface which will interfere the nanoindentation process. Here we estimate the volume change by correcting the lattice constant:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&amp;lt;math&amp;gt; a_{\text{alloy}} = a_{\text{Al}}(1+\chi_{\text{Mg}}l_{sf}) &amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For now, we use the linear size factor from King&#039;s table. For a more accurate value, a constant pressure relaxation can be performed to determine the size factor.&lt;br /&gt;
&lt;br /&gt;
=== Generate the Sample of Al-Mg Alloy ===&lt;br /&gt;
&lt;br /&gt;
First we generate the simulation box of 32.4x32.4x32.4nm. We set up the simulation based on the lattice so that the entire simulation box is filled with atoms. First we define the lattice in LAMMPS ( indentation surface (001) ):&lt;br /&gt;
&lt;br /&gt;
 lattice         fcc 4.053 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1&lt;br /&gt;
 region          BOX block -40.0 40.0 -40.0 40.0 -80.0 0.0 units lattice&lt;br /&gt;
&lt;br /&gt;
Here the lattice constant 4.053 is the size after we consider the size effect, and 80 lattice distance is around 32.4nm. Note that if we change the indentation surface to other FCC planes ((110), (111), etc.), we should change the orientation in lattice definition, for example if we take (110) plane as the indentation surface, the setting should be:&lt;br /&gt;
&lt;br /&gt;
 lattice         fcc 4.053 orient x 0.707 0 -0.707 orient y 0 1 0 orient z 0.707 0 0.707&lt;br /&gt;
 region          BOX block -40.0 40.0 -40.0 40.0 -80.0 0.0 units lattice&lt;br /&gt;
&lt;br /&gt;
Then we create the simulation box and the Al atoms based on the region we defined:&lt;br /&gt;
&lt;br /&gt;
 create_box      2 BOX&lt;br /&gt;
 create_atoms    1 region BOX&lt;br /&gt;
 set             region BOX type 1&lt;br /&gt;
&lt;br /&gt;
And we randomly change 0.67% atoms to Mg atoms:&lt;br /&gt;
&lt;br /&gt;
 set             region BOX type/fraction 2 0.0067 20170517  # random seed&lt;br /&gt;
&lt;br /&gt;
Finally, after we add the Mg atoms, we perform relaxation to the entire sample to make the sample equilibrated. In this simulation, we use the EAM potential from Liu and Adams (1998) (https://www.ctcms.nist.gov/potentials/Download/Al-Mg-LA/almg.liu):&lt;br /&gt;
&lt;br /&gt;
 pair_style      eam/alloy&lt;br /&gt;
 pair_coeff      * * almg.liu.eam.alloy Al Mg&lt;br /&gt;
 minimize        1e-9 1e-9 10000 10000&lt;br /&gt;
&lt;br /&gt;
We can visualize the sample as shown in Fig.3.&lt;br /&gt;
&lt;br /&gt;
[[Image:Al-Mg_sample.jpg | thumb | 300px | center | Fig.3 Visualization of the Al-Mg alloy sample. Red: Al atoms; Blue: Mg atoms]]&lt;br /&gt;
&lt;br /&gt;
== Perform MD Simulation of Nanoindentation on The Alloy Sample ==&lt;br /&gt;
&lt;br /&gt;
Before the actual simulation, we first determine the dynamics of the indenter:&lt;br /&gt;
&lt;br /&gt;
: Indenter stiffness constant K: 1.0eV/&amp;amp;Aring;&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
: Temperature T: 1.0K&lt;br /&gt;
: Indent rate: 0.81&amp;amp;Aring;/ps = 81m/s&lt;br /&gt;
: Loading steps: 40000 (0.001ps/step)&lt;br /&gt;
: Indent depth: 3.24nm&lt;br /&gt;
&lt;br /&gt;
Note: The units are defined by units command in LAMMPS, we use metal units (http://lammps.sandia.gov/doc/99/units.html)&lt;br /&gt;
&lt;br /&gt;
=== The Force Field for the Indenter ===&lt;br /&gt;
&lt;br /&gt;
In LAMMPS, a spherical indeter exerts a force of magnitude:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F(r) = -K (r - R)^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on each atom where K is the indenter stiffness constant, r is the distance from the atom to the center of the indenter, and R is the radius of the indenter. The force is repulsive and F(r)=0 for r&amp;gt;R.&lt;br /&gt;
&lt;br /&gt;
We have tested the K value ranging from 1 to 1000. Note that with this force field function, the indenter is not an elastic sphere. The effective elastic modulus of the indenter is shown in Fig.4. We can see that the K value does not have significant influence on the effective modulus of the indenter. In our simulation, we choose K = 1.0eV/&amp;amp;Aring; for all the simulation.&lt;br /&gt;
&lt;br /&gt;
[[Image:Indenter_K_Modulus.png | thumb | 500px | center | Fig.4 The Effective Modulus of the Indenter in Terms of the Indent Depth.]]&lt;br /&gt;
&lt;br /&gt;
=== Fix the bottom ===&lt;br /&gt;
&lt;br /&gt;
First, We define 5 bottom layers as the bottom layer, these atom layers will be fixed to support the entire sample. Otherwise the sample will move downwards during the indentation.&lt;br /&gt;
&lt;br /&gt;
 region          fixed_region block INF INF INF INF INF -75.0 units lattice&lt;br /&gt;
 group           bottom region fixed_region&lt;br /&gt;
 group           mobile subtract all bottom&lt;br /&gt;
 fix             bottom bottom setforce 0.0 0.0 0.0&lt;br /&gt;
 velocity        bottom set 0.0 0.0 0.0&lt;br /&gt;
&lt;br /&gt;
Then we set up the temperature for the system:&lt;br /&gt;
&lt;br /&gt;
 compute         new mobile temp&lt;br /&gt;
 velocity        mobile create 1.0 20110723 temp new     # create temperature&lt;br /&gt;
 fix             ensemble mobile nvt temp 1.0 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
=== Loading and Unloading ===&lt;br /&gt;
&lt;br /&gt;
Fig.5 is a diagram showing the loading process of the nanoindentation.&lt;br /&gt;
&lt;br /&gt;
[[Image:example_nanoindentation.png | thumb | 150px | center | Fig.5 Loading of the nanoindentation process]]&lt;br /&gt;
&lt;br /&gt;
In LAMMPS, the command used for indentation is &amp;quot;fix indent&amp;quot;. This command can use the information of time steps and thus perform dynamic indentation during the MD simulation.&lt;br /&gt;
&lt;br /&gt;
1. Calculate the indentation depth&lt;br /&gt;
&lt;br /&gt;
 variable        indent_rate equal 0.81    # indent rate = 0.81&amp;amp;Aring;/ps&lt;br /&gt;
 variable        depth equal step*dt*${indent_rate}&lt;br /&gt;
&lt;br /&gt;
2. Calculate the z-direction position of the indenter center for loading steps:&lt;br /&gt;
&lt;br /&gt;
 variable        indenter_R equal 162&lt;br /&gt;
 variable        z equal &amp;quot;v_indenter_R - v_depth&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that you cannot use ${depth} in this expression, otherwise only the depth value at the first time step will be substituted here and no time step information will be kept.&lt;br /&gt;
&lt;br /&gt;
3. Fix the indenter. To use the standard units defined by units command, remember to add &amp;quot;units box&amp;quot; at the end of the fix command:&lt;br /&gt;
&lt;br /&gt;
 variable        indent_K equal 1.0&lt;br /&gt;
 fix             indent all indent ${indent_K} sphere 0.0 0.0 v_z ${indenter_R} units box&lt;br /&gt;
&lt;br /&gt;
Since the indenter is a &amp;quot;fix&amp;quot; command, the responsive force of the fixed constraint can be retrieved from variable &amp;quot;f_indent&amp;quot;, which is a 3-component vector that represents the responsive force of this fixed constraint. In our case, we only need the force on z-direction, i.e. f_indent[3].&lt;br /&gt;
&lt;br /&gt;
4. Run MD simulation to perform the loading steps:&lt;br /&gt;
&lt;br /&gt;
 variable        loading_steps equal 40000&lt;br /&gt;
 run             ${loading_steps}&lt;br /&gt;
&lt;br /&gt;
5. Similarly, when we perform the unloading steps, we recalculate the depth and z position of the indenter:&lt;br /&gt;
&lt;br /&gt;
 variable        depth equal (2*${loading_steps}-step)*dt*${indent_rate}&lt;br /&gt;
 variable        z equal &amp;quot;v_indent_R - v_depth&amp;quot;&lt;br /&gt;
 fix             indent all indent ${indent_K} sphere 0.0 0.0 v_z ${indenter_R} units box&lt;br /&gt;
 run             ${loading_steps}&lt;br /&gt;
&lt;br /&gt;
== Post processing ==&lt;br /&gt;
&lt;br /&gt;
LAMMPS provides multiple ways to output the results of MD simulation. In this section, we discuss the two mostly used output: &amp;quot;dump&amp;quot; and &amp;quot;thermo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Retrieve the dislocation structure from MD simulation ===&lt;br /&gt;
&lt;br /&gt;
To obtain the dislocation structure, we need the detailed atom location information during the simulation. In LAMMPS, &amp;quot;dump&amp;quot; command is designed for the output of the atom profile.&lt;br /&gt;
&lt;br /&gt;
Simply add the following lines before the &amp;quot;run&amp;quot; command, the atom profile will be dumped into dump file &amp;quot;dump.${timestep}.indent&amp;quot; for further analysis.&lt;br /&gt;
&lt;br /&gt;
 variable        dumpfreq equal 1000&lt;br /&gt;
 dump            loading all atom ${dumpfreq} dump.*.indent&lt;br /&gt;
 run             40000&lt;br /&gt;
&lt;br /&gt;
If you want to set different dump frequency for unloading, you have to cancel the previous dump setting, and set up a different dump setting.&lt;br /&gt;
&lt;br /&gt;
 undump          loading&lt;br /&gt;
 dump            unloading all atom 100 dump.*.unload&lt;br /&gt;
 run             40000&lt;br /&gt;
 undump          unloading&lt;br /&gt;
&lt;br /&gt;
For more settings about dump command, please read LAMMPS manual (http://lammps.sandia.gov/doc/dump.html).&lt;br /&gt;
&lt;br /&gt;
After we get the atom profiles during the simulation, we can perform the dislocation analysis and get the dislocation structure, as shown in Fig.6:&lt;br /&gt;
&lt;br /&gt;
[[Image:dislocation_analysis.png | thumb | 500px | center | Fig.6 dislocation nucleation during nanoindentation]]&lt;br /&gt;
&lt;br /&gt;
=== Retrieve the Force-Depth Curve of Nanoindentation ===&lt;br /&gt;
&lt;br /&gt;
As we discussed in section 3.3, the responsive force on the indenter is recorded in variable &amp;quot;f_indent[3]&amp;quot;, the indentation depth is calculated and recorded in variable &amp;quot;v_depth&amp;quot;. Therefore, we add the following lines before the &amp;quot;run&amp;quot; command in section 3.3, then we can retrieve the forth-depth curve from the simulation:&lt;br /&gt;
&lt;br /&gt;
 thermo          100           # output per 100 timestep&lt;br /&gt;
 thermo_style    custom step v_depth f_indent[3]&lt;br /&gt;
&lt;br /&gt;
Then the information of timestep, depth and indentation force will be recorded in the log file. More details of &amp;quot;thermo&amp;quot; command can be found in LAMMPS official manual (http://lammps.sandia.gov/doc/thermo.html)&lt;br /&gt;
&lt;br /&gt;
The force-depth curves for different indentation direction are shown below in Fig.7.&lt;br /&gt;
&lt;br /&gt;
[[Image:FD_curve_orientation.png | thumb | 500px | center | Fig.7 Force-depth curve of nanoindation performed on different orientations]]&lt;br /&gt;
&lt;br /&gt;
In addition, because we have periodic boundary condition on both x- and y- direction, there are actually infinite indenter images exerting infinite force on the sample. Therefore, the sample is not touching the indenter at very beginning, and the actual indentation process started at finite indentation depth. In the results, we manually corrected the indentation depth so that it starts from the position where the indenter is exactly touching the sample.&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=M11_MD%2B%2B_Powered_by_Python&amp;diff=6811</id>
		<title>M11 MD++ Powered by Python</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=M11_MD%2B%2B_Powered_by_Python&amp;diff=6811"/>
		<updated>2019-10-12T03:37:19Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MD++ with Python scripting language ([http://micro.stanford.edu/~caiwei/Forum/2004-12-12-MD++/PDF_Manuals/M11_MD++_v3.pdf Python])&lt;br /&gt;
&lt;br /&gt;
commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mdpp.cmd(command_string)&lt;br /&gt;
&#039;&#039;&#039;Execute one command or multiple commands in MD++&lt;br /&gt;
Parameters&lt;br /&gt;
----------&lt;br /&gt;
command_string : string&lt;br /&gt;
    a string that follows MD++ script command format&lt;br /&gt;
Returns&lt;br /&gt;
-------&lt;br /&gt;
exit_code : int&lt;br /&gt;
    0 if success&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mdpp.get(varname)&lt;br /&gt;
&#039;&#039;&#039;Obtain the value of a variable in MD++ object&lt;br /&gt;
Parameters&lt;br /&gt;
----------&lt;br /&gt;
varname : string&lt;br /&gt;
    variable name to obtain from the MD++ object&lt;br /&gt;
Returns&lt;br /&gt;
-------&lt;br /&gt;
value : int, long, double, or string&lt;br /&gt;
    depends on the type of the variable&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mdpp.get_array(array_name, istart, iend, iskip=0)&lt;br /&gt;
&#039;&#039;&#039;Obtain an array from MD++ object to a python list&lt;br /&gt;
Parameters&lt;br /&gt;
----------&lt;br /&gt;
array_name : string&lt;br /&gt;
    array name to obtain from the MD++ object&lt;br /&gt;
istart,iend,iskip : int&lt;br /&gt;
    the starting position, end position, and number of elements to skip&lt;br /&gt;
Returns&lt;br /&gt;
-------&lt;br /&gt;
array : list&lt;br /&gt;
    flattened list of requested array in MD++ object&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mdpp.set_array(input_list, array_name, istart, iskip=0)&lt;br /&gt;
&#039;&#039;&#039;Obtain an array from MD++ object to a python list&lt;br /&gt;
Parameters&lt;br /&gt;
----------&lt;br /&gt;
input_list : list&lt;br /&gt;
    1D python list of flattened array values to be inserted.&lt;br /&gt;
array_name : string&lt;br /&gt;
    array name to set in the MD++ object&lt;br /&gt;
istart,iskip : int&lt;br /&gt;
    the starting position, and number of elements to skip&lt;br /&gt;
Returns&lt;br /&gt;
-------&lt;br /&gt;
exit_code : int&lt;br /&gt;
    0 if success&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example scripts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
  &amp;lt;LI&amp;gt; [http://micro.stanford.edu/~caiwei/Forum/2004-12-12-MD++/Python/si.py si.py]&lt;br /&gt;
  &amp;lt;LI&amp;gt; [http://micro.stanford.edu/~caiwei/Forum/2004-12-12-MD++/Python/si2.py si2.py]&lt;br /&gt;
  &amp;lt;LI&amp;gt; [http://micro.stanford.edu/~caiwei/Forum/2004-12-12-MD++/Python/si-arg.py si-arg.py]&lt;br /&gt;
  &amp;lt;LI&amp;gt; [http://micro.stanford.edu/~caiwei/Forum/2004-12-12-MD++/Python/si-temp.py si-temp.py]&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=M11_MD%2B%2B_Powered_by_Python&amp;diff=6810</id>
		<title>M11 MD++ Powered by Python</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=M11_MD%2B%2B_Powered_by_Python&amp;diff=6810"/>
		<updated>2019-10-12T03:36:38Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MD++ with Python scripting language ([http://micro.stanford.edu/~caiwei/Forum/2004-12-12-MD++/PDF_Manuals/M11_MD++_v3.pdf Python])&lt;br /&gt;
&lt;br /&gt;
commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mdpp.cmd(command_string)&lt;br /&gt;
&#039;&#039;&#039;Execute one command or multiple commands in MD++&lt;br /&gt;
Parameters&lt;br /&gt;
----------&lt;br /&gt;
command_string : string&lt;br /&gt;
    a string that follows MD++ script command format&lt;br /&gt;
Returns&lt;br /&gt;
-------&lt;br /&gt;
exit_code : int&lt;br /&gt;
    0 if success&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mdpp.get(varname)&lt;br /&gt;
&#039;&#039;&#039;Obtain the value of a variable in MD++ object&lt;br /&gt;
Parameters&lt;br /&gt;
----------&lt;br /&gt;
varname : string&lt;br /&gt;
    variable name to obtain from the MD++ object&lt;br /&gt;
Returns&lt;br /&gt;
-------&lt;br /&gt;
value : int, long, double, or string&lt;br /&gt;
    depends on the type of the variable&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mdpp.get_array(array_name, istart, iend, iskip=0)&lt;br /&gt;
&#039;&#039;&#039;Obtain an array from MD++ object to a python list&lt;br /&gt;
Parameters&lt;br /&gt;
----------&lt;br /&gt;
array_name : string&lt;br /&gt;
    array name to obtain from the MD++ object&lt;br /&gt;
istart,iend,iskip : int&lt;br /&gt;
    the starting position, end position, and number of elements to skip&lt;br /&gt;
Returns&lt;br /&gt;
-------&lt;br /&gt;
array : list&lt;br /&gt;
    flattened list of requested array in MD++ object&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mdpp.set_array(input_list, array_name, istart, iskip=0)&lt;br /&gt;
&#039;&#039;&#039;Obtain an array from MD++ object to a python list&lt;br /&gt;
Parameters&lt;br /&gt;
----------&lt;br /&gt;
input_list : list&lt;br /&gt;
    1D python list of flattened array values to be inserted.&lt;br /&gt;
array_name : string&lt;br /&gt;
    array name to set in the MD++ object&lt;br /&gt;
istart,iskip : int&lt;br /&gt;
    the starting position, and number of elements to skip&lt;br /&gt;
Returns&lt;br /&gt;
-------&lt;br /&gt;
exit_code : int&lt;br /&gt;
    0 if success&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example scripts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;UL&amp;gt;&lt;br /&gt;
  &amp;lt;LI&amp;gt; [http://micro.stanford.edu/~caiwei/Forum/2004-12-12-MD++/Python/si.py si.py]&lt;br /&gt;
  &amp;lt;LI&amp;gt; [http://micro.stanford.edu/~caiwei/Forum/2004-12-12-MD++/Python/si2.py si2.py]&lt;br /&gt;
  &amp;lt;LI&amp;gt; [http://micro.stanford.edu/~caiwei/Forum/2004-12-12-MD++/Python/si-arg.py si-arg.py]&lt;br /&gt;
  &amp;lt;LI&amp;gt; [http://micro.stanford.edu/~caiwei/Forum/2004-12-12-MD++/Python/si-temp.py si-temp.py]&lt;br /&gt;
&amp;lt;/UL&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito_g(r).png&amp;diff=6804</id>
		<title>File:Ovito g(r).png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito_g(r).png&amp;diff=6804"/>
		<updated>2019-05-10T18:40:14Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito_histogram_displacement.png&amp;diff=6803</id>
		<title>File:Ovito histogram displacement.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito_histogram_displacement.png&amp;diff=6803"/>
		<updated>2019-04-19T15:56:22Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito_displacement_vector.png&amp;diff=6802</id>
		<title>File:Ovito displacement vector.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito_displacement_vector.png&amp;diff=6802"/>
		<updated>2019-04-19T15:55:38Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito_animation.gif&amp;diff=6801</id>
		<title>File:Ovito animation.gif</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito_animation.gif&amp;diff=6801"/>
		<updated>2019-04-19T15:54:44Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito_time_series.png&amp;diff=6800</id>
		<title>File:Ovito time series.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito_time_series.png&amp;diff=6800"/>
		<updated>2019-04-19T15:53:31Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Voronoi_analysis.png&amp;diff=6799</id>
		<title>File:Voronoi analysis.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Voronoi_analysis.png&amp;diff=6799"/>
		<updated>2019-04-19T04:28:02Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: Yfwang09 uploaded a new version of &amp;amp;quot;File:Voronoi analysis.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Voronoi_analysis.png&amp;diff=6798</id>
		<title>File:Voronoi analysis.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Voronoi_analysis.png&amp;diff=6798"/>
		<updated>2019-04-19T04:19:27Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Fcc_layers.png&amp;diff=6797</id>
		<title>File:Fcc layers.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Fcc_layers.png&amp;diff=6797"/>
		<updated>2019-04-19T03:34:00Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: Yfwang09 uploaded a new version of &amp;amp;quot;File:Fcc layers.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Fcc_layers.png&amp;diff=6796</id>
		<title>File:Fcc layers.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Fcc_layers.png&amp;diff=6796"/>
		<updated>2019-04-19T03:31:51Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:CNA_modifier.png&amp;diff=6795</id>
		<title>File:CNA modifier.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:CNA_modifier.png&amp;diff=6795"/>
		<updated>2019-04-19T03:30:47Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: Yfwang09 uploaded a new version of &amp;amp;quot;File:CNA modifier.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:CNA_modifier.png&amp;diff=6794</id>
		<title>File:CNA modifier.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:CNA_modifier.png&amp;diff=6794"/>
		<updated>2019-04-19T03:29:51Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Cu_supercell.png&amp;diff=6793</id>
		<title>File:Cu supercell.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Cu_supercell.png&amp;diff=6793"/>
		<updated>2019-04-19T03:25:46Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: Yfwang09 uploaded a new version of &amp;amp;quot;File:Cu supercell.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Cu_supercell.png&amp;diff=6792</id>
		<title>File:Cu supercell.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Cu_supercell.png&amp;diff=6792"/>
		<updated>2019-04-18T05:05:32Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito_GUI.png&amp;diff=6791</id>
		<title>File:Ovito GUI.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito_GUI.png&amp;diff=6791"/>
		<updated>2019-04-18T02:22:00Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito.png&amp;diff=6790</id>
		<title>File:Ovito.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito.png&amp;diff=6790"/>
		<updated>2019-04-18T02:04:51Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: Yfwang09 uploaded a new version of &amp;amp;quot;File:Ovito.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito.png&amp;diff=6789</id>
		<title>File:Ovito.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Ovito.png&amp;diff=6789"/>
		<updated>2019-04-18T02:03:01Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Edit_.bashrc.png&amp;diff=6788</id>
		<title>File:Edit .bashrc.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Edit_.bashrc.png&amp;diff=6788"/>
		<updated>2019-04-03T06:18:55Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:MD%2B%2B_jupyter_scripts.png&amp;diff=6786</id>
		<title>File:MD++ jupyter scripts.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:MD%2B%2B_jupyter_scripts.png&amp;diff=6786"/>
		<updated>2019-04-01T04:57:25Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:MD%2B%2B_jupyter_notebook.png&amp;diff=6785</id>
		<title>File:MD++ jupyter notebook.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:MD%2B%2B_jupyter_notebook.png&amp;diff=6785"/>
		<updated>2019-04-01T04:56:44Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Run_si_example.png&amp;diff=6784</id>
		<title>File:Run si example.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Run_si_example.png&amp;diff=6784"/>
		<updated>2019-04-01T04:55:34Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Jupyter_notebook.png&amp;diff=6783</id>
		<title>File:Jupyter notebook.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Jupyter_notebook.png&amp;diff=6783"/>
		<updated>2019-04-01T04:54:26Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Jupyter_nbextensions_toc2.png&amp;diff=6782</id>
		<title>File:Jupyter nbextensions toc2.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Jupyter_nbextensions_toc2.png&amp;diff=6782"/>
		<updated>2019-04-01T04:53:24Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Jupyter_nbextensions.png&amp;diff=6781</id>
		<title>File:Jupyter nbextensions.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Jupyter_nbextensions.png&amp;diff=6781"/>
		<updated>2019-04-01T04:52:56Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Edit_si_example.png&amp;diff=6780</id>
		<title>File:Edit si example.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Edit_si_example.png&amp;diff=6780"/>
		<updated>2019-04-01T04:50:33Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6779</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6779"/>
		<updated>2019-02-20T01:06:30Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Generate coefficients */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
[https://doi.org/10.1016/j.jmps.2019.01.020 doi:10.1016/j.jmps.2019.01.020]&lt;br /&gt;
&lt;br /&gt;
[https://arxiv.org/abs/1806.11165 arXiv]&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== Suggested Installation of SHTOOLS (pip) ==&lt;br /&gt;
&lt;br /&gt;
If you have python3 and pip installed on your machine, you can simply install everything by: &lt;br /&gt;
&lt;br /&gt;
 python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose pyshtools&lt;br /&gt;
&lt;br /&gt;
== Generate coefficients ==&lt;br /&gt;
&lt;br /&gt;
The coefficients up to lmax = 60 is pre-computed and included in the repository. If you want to use higher mode spherical harmonic basis, please continue reading.&lt;br /&gt;
&lt;br /&gt;
Please change the first few lines in `ShElastic/scripts/generate_modes.py`:&lt;br /&gt;
&lt;br /&gt;
 lKfull = 10&lt;br /&gt;
 lJfull = lKfull + 3&lt;br /&gt;
 savepath = &#039;../module/lmax%dmodes&#039;%lKfull&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then we can generate the mode files by calling:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic/scripts&lt;br /&gt;
 python3 generate_modes.py&lt;br /&gt;
&lt;br /&gt;
The mode files will be saved in the savepath folder.&lt;br /&gt;
&lt;br /&gt;
== Reproduce results from the paper ==&lt;br /&gt;
&lt;br /&gt;
The results showing in the paper can be reproduced by running the jupyter notebooks in `ShElastic/notebook` folder.&lt;br /&gt;
&lt;br /&gt;
Numerical Case 1: `Case01-Uniform_Tensile_Hole.ipynb`&lt;br /&gt;
&lt;br /&gt;
Numerical Case 2: `Case02-Void_Dislocation_Interaction.ipynb`&lt;br /&gt;
&lt;br /&gt;
Numerical Case 3: `Case03-Prismatic_Dislocation_Loop.ipynb`&lt;br /&gt;
&lt;br /&gt;
Launch the jupyter notebook by:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic&lt;br /&gt;
 jupyter notebook&lt;br /&gt;
&lt;br /&gt;
After you run through the notebooks, the result files will be saved in `ShElastic/figures`. The figures in the paper can be reproduced by running plotdata.m in matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 generated figures for the paper&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Case1_results.png | (a) Case 1&lt;br /&gt;
Image:Case2_results.png | (b) Case 2&lt;br /&gt;
Image:Case3_results.png | (c) Case 3&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6778</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6778"/>
		<updated>2019-02-20T01:05:13Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
[https://doi.org/10.1016/j.jmps.2019.01.020 doi:10.1016/j.jmps.2019.01.020]&lt;br /&gt;
&lt;br /&gt;
[https://arxiv.org/abs/1806.11165 arXiv]&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== Suggested Installation of SHTOOLS (pip) ==&lt;br /&gt;
&lt;br /&gt;
If you have python3 and pip installed on your machine, you can simply install everything by: &lt;br /&gt;
&lt;br /&gt;
 python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose pyshtools&lt;br /&gt;
&lt;br /&gt;
== Generate coefficients ==&lt;br /&gt;
&lt;br /&gt;
The coefficients up to l_{max} = 60 is pre-computed and included in the repository. If you want to use higher mode spherical harmonic basis, please continue reading.&lt;br /&gt;
&lt;br /&gt;
Please change the first few lines in `ShElastic/scripts/generate_modes.py`:&lt;br /&gt;
&lt;br /&gt;
 lKfull = 10&lt;br /&gt;
 lJfull = lKfull + 3&lt;br /&gt;
 savepath = &#039;../module/lmax%dmodes&#039;%lKfull&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then we can generate the mode files by calling:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic/scripts&lt;br /&gt;
 python3 generate_modes.py&lt;br /&gt;
&lt;br /&gt;
The mode files will be saved in the savepath folder.&lt;br /&gt;
&lt;br /&gt;
== Reproduce results from the paper ==&lt;br /&gt;
&lt;br /&gt;
The results showing in the paper can be reproduced by running the jupyter notebooks in `ShElastic/notebook` folder.&lt;br /&gt;
&lt;br /&gt;
Numerical Case 1: `Case01-Uniform_Tensile_Hole.ipynb`&lt;br /&gt;
&lt;br /&gt;
Numerical Case 2: `Case02-Void_Dislocation_Interaction.ipynb`&lt;br /&gt;
&lt;br /&gt;
Numerical Case 3: `Case03-Prismatic_Dislocation_Loop.ipynb`&lt;br /&gt;
&lt;br /&gt;
Launch the jupyter notebook by:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic&lt;br /&gt;
 jupyter notebook&lt;br /&gt;
&lt;br /&gt;
After you run through the notebooks, the result files will be saved in `ShElastic/figures`. The figures in the paper can be reproduced by running plotdata.m in matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 generated figures for the paper&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Case1_results.png | (a) Case 1&lt;br /&gt;
Image:Case2_results.png | (b) Case 2&lt;br /&gt;
Image:Case3_results.png | (c) Case 3&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6777</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6777"/>
		<updated>2019-02-20T01:04:13Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
[https://doi.org/10.1016/j.jmps.2019.01.020 10.1016/j.jmps.2019.01.020]&lt;br /&gt;
[https://arxiv.org/abs/1806.11165 arXiv]&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== Suggested Installation of SHTOOLS (pip) ==&lt;br /&gt;
&lt;br /&gt;
If you have python3 and pip installed on your machine, you can simply install everything by: &lt;br /&gt;
&lt;br /&gt;
 python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose pyshtools&lt;br /&gt;
&lt;br /&gt;
== Generate coefficients ==&lt;br /&gt;
&lt;br /&gt;
The coefficients up to l_{max} = 60 is pre-computed and included in the repository. If you want to use higher mode spherical harmonic basis, please continue reading.&lt;br /&gt;
&lt;br /&gt;
Please change the first few lines in `ShElastic/scripts/generate_modes.py`:&lt;br /&gt;
&lt;br /&gt;
 lKfull = 10&lt;br /&gt;
 lJfull = lKfull + 3&lt;br /&gt;
 savepath = &#039;../module/lmax%dmodes&#039;%lKfull&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then we can generate the mode files by calling:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic/scripts&lt;br /&gt;
 python3 generate_modes.py&lt;br /&gt;
&lt;br /&gt;
The mode files will be saved in the savepath folder.&lt;br /&gt;
&lt;br /&gt;
== Reproduce results from the paper ==&lt;br /&gt;
&lt;br /&gt;
The results showing in the paper can be reproduced by running the jupyter notebooks in `ShElastic/notebook` folder.&lt;br /&gt;
&lt;br /&gt;
Numerical Case 1: `Case01-Uniform_Tensile_Hole.ipynb`&lt;br /&gt;
&lt;br /&gt;
Numerical Case 2: `Case02-Void_Dislocation_Interaction.ipynb`&lt;br /&gt;
&lt;br /&gt;
Numerical Case 3: `Case03-Prismatic_Dislocation_Loop.ipynb`&lt;br /&gt;
&lt;br /&gt;
Launch the jupyter notebook by:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic&lt;br /&gt;
 jupyter notebook&lt;br /&gt;
&lt;br /&gt;
After you run through the notebooks, the result files will be saved in `ShElastic/figures`. The figures in the paper can be reproduced by running plotdata.m in matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 generated figures for the paper&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Case1_results.png | (a) Case 1&lt;br /&gt;
Image:Case2_results.png | (b) Case 2&lt;br /&gt;
Image:Case3_results.png | (c) Case 3&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6776</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6776"/>
		<updated>2019-02-20T00:51:07Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Reproduce results from the paper */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== Suggested Installation of SHTOOLS (pip) ==&lt;br /&gt;
&lt;br /&gt;
If you have python3 and pip installed on your machine, you can simply install everything by: &lt;br /&gt;
&lt;br /&gt;
 python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose pyshtools&lt;br /&gt;
&lt;br /&gt;
== Generate coefficients ==&lt;br /&gt;
&lt;br /&gt;
The coefficients up to l_{max} = 60 is pre-computed and included in the repository. If you want to use higher mode spherical harmonic basis, please continue reading.&lt;br /&gt;
&lt;br /&gt;
Please change the first few lines in `ShElastic/scripts/generate_modes.py`:&lt;br /&gt;
&lt;br /&gt;
 lKfull = 10&lt;br /&gt;
 lJfull = lKfull + 3&lt;br /&gt;
 savepath = &#039;../module/lmax%dmodes&#039;%lKfull&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then we can generate the mode files by calling:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic/scripts&lt;br /&gt;
 python3 generate_modes.py&lt;br /&gt;
&lt;br /&gt;
The mode files will be saved in the savepath folder.&lt;br /&gt;
&lt;br /&gt;
== Reproduce results from the paper ==&lt;br /&gt;
&lt;br /&gt;
The results showing in the paper can be reproduced by running the jupyter notebooks in `ShElastic/notebook` folder.&lt;br /&gt;
&lt;br /&gt;
Numerical Case 1: `Case01-Uniform_Tensile_Hole.ipynb`&lt;br /&gt;
&lt;br /&gt;
Numerical Case 2: `Case02-Void_Dislocation_Interaction.ipynb`&lt;br /&gt;
&lt;br /&gt;
Numerical Case 3: `Case03-Prismatic_Dislocation_Loop.ipynb`&lt;br /&gt;
&lt;br /&gt;
Launch the jupyter notebook by:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic&lt;br /&gt;
 jupyter notebook&lt;br /&gt;
&lt;br /&gt;
After you run through the notebooks, the result files will be saved in `ShElastic/figures`. The figures in the paper can be reproduced by running plotdata.m in matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 generated figures for the paper&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Case1_results.png | (a) Case 1&lt;br /&gt;
Image:Case2_results.png | (b) Case 2&lt;br /&gt;
Image:Case3_results.png | (c) Case 3&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6775</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6775"/>
		<updated>2019-02-20T00:13:22Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Reproduce results from the paper */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== Suggested Installation of SHTOOLS (pip) ==&lt;br /&gt;
&lt;br /&gt;
If you have python3 and pip installed on your machine, you can simply install everything by: &lt;br /&gt;
&lt;br /&gt;
 python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose pyshtools&lt;br /&gt;
&lt;br /&gt;
== Generate coefficients ==&lt;br /&gt;
&lt;br /&gt;
The coefficients up to l_{max} = 60 is pre-computed and included in the repository. If you want to use higher mode spherical harmonic basis, please continue reading.&lt;br /&gt;
&lt;br /&gt;
Please change the first few lines in `ShElastic/scripts/generate_modes.py`:&lt;br /&gt;
&lt;br /&gt;
 lKfull = 10&lt;br /&gt;
 lJfull = lKfull + 3&lt;br /&gt;
 savepath = &#039;../module/lmax%dmodes&#039;%lKfull&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then we can generate the mode files by calling:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic/scripts&lt;br /&gt;
 python3 generate_modes.py&lt;br /&gt;
&lt;br /&gt;
The mode files will be saved in the savepath folder.&lt;br /&gt;
&lt;br /&gt;
== Reproduce results from the paper ==&lt;br /&gt;
&lt;br /&gt;
The results showing in the paper can be reproduced by running the jupyter notebooks in `ShElastic/notebook` folder.&lt;br /&gt;
&lt;br /&gt;
Numerical Case 1: `Case01-Uniform_Tensile_Hole.ipynb`&lt;br /&gt;
&lt;br /&gt;
Numerical Case 2: `Case02-Void_Dislocation_Interaction.ipynb`&lt;br /&gt;
&lt;br /&gt;
Numerical Case 3: `Case03-Prismatic_Dislocation_Loop.ipynb`&lt;br /&gt;
&lt;br /&gt;
Launch the jupyter notebook by:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic&lt;br /&gt;
 jupyter notebook&lt;br /&gt;
&lt;br /&gt;
The result files will be saved in `ShElastic/figures`. The figures in the paper can be reproduced by running plotdata.m in matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 generated figures for the paper&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Case1_results.png | (a) Case 1&lt;br /&gt;
Image:Case2_results.png | (b) Case 2&lt;br /&gt;
Image:Case3_results.png | (c) Case 3&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6774</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6774"/>
		<updated>2019-02-20T00:13:01Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Reproduce results from the paper */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== Suggested Installation of SHTOOLS (pip) ==&lt;br /&gt;
&lt;br /&gt;
If you have python3 and pip installed on your machine, you can simply install everything by: &lt;br /&gt;
&lt;br /&gt;
 python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose pyshtools&lt;br /&gt;
&lt;br /&gt;
== Generate coefficients ==&lt;br /&gt;
&lt;br /&gt;
The coefficients up to l_{max} = 60 is pre-computed and included in the repository. If you want to use higher mode spherical harmonic basis, please continue reading.&lt;br /&gt;
&lt;br /&gt;
Please change the first few lines in `ShElastic/scripts/generate_modes.py`:&lt;br /&gt;
&lt;br /&gt;
 lKfull = 10&lt;br /&gt;
 lJfull = lKfull + 3&lt;br /&gt;
 savepath = &#039;../module/lmax%dmodes&#039;%lKfull&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then we can generate the mode files by calling:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic/scripts&lt;br /&gt;
 python3 generate_modes.py&lt;br /&gt;
&lt;br /&gt;
The mode files will be saved in the savepath folder.&lt;br /&gt;
&lt;br /&gt;
== Reproduce results from the paper ==&lt;br /&gt;
&lt;br /&gt;
The results showing in the paper can be reproduced by running the jupyter notebooks in `ShElastic/notebook` folder.&lt;br /&gt;
&lt;br /&gt;
Numerical Case 1: `Case01-Uniform_Tensile_Hole.ipynb`&lt;br /&gt;
Numerical Case 2: `Case02-Void_Dislocation_Interaction.ipynb`&lt;br /&gt;
Numerical Case 3: `Case03-Prismatic_Dislocation_Loop.ipynb`&lt;br /&gt;
&lt;br /&gt;
Launch the jupyter notebook by:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic&lt;br /&gt;
 jupyter notebook&lt;br /&gt;
&lt;br /&gt;
The result files will be saved in `ShElastic/figures`. The figures in the paper can be reproduced by running plotdata.m in matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 generated figures for the paper&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Case1_results.png | (a) Case 1&lt;br /&gt;
Image:Case2_results.png | (b) Case 2&lt;br /&gt;
Image:Case3_results.png | (c) Case 3&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Case3_results.png&amp;diff=6773</id>
		<title>File:Case3 results.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Case3_results.png&amp;diff=6773"/>
		<updated>2019-02-20T00:12:37Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Case2_results.png&amp;diff=6772</id>
		<title>File:Case2 results.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Case2_results.png&amp;diff=6772"/>
		<updated>2019-02-20T00:12:17Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6771</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6771"/>
		<updated>2019-02-19T23:34:52Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Generate coefficients */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== Suggested Installation of SHTOOLS (pip) ==&lt;br /&gt;
&lt;br /&gt;
If you have python3 and pip installed on your machine, you can simply install everything by: &lt;br /&gt;
&lt;br /&gt;
 python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose pyshtools&lt;br /&gt;
&lt;br /&gt;
== Generate coefficients ==&lt;br /&gt;
&lt;br /&gt;
The coefficients up to l_{max} = 60 is pre-computed and included in the repository. If you want to use higher mode spherical harmonic basis, please continue reading.&lt;br /&gt;
&lt;br /&gt;
Please change the first few lines in `ShElastic/scripts/generate_modes.py`:&lt;br /&gt;
&lt;br /&gt;
 lKfull = 10&lt;br /&gt;
 lJfull = lKfull + 3&lt;br /&gt;
 savepath = &#039;../module/lmax%dmodes&#039;%lKfull&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then we can generate the mode files by calling:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic/scripts&lt;br /&gt;
 python3 generate_modes.py&lt;br /&gt;
&lt;br /&gt;
The mode files will be saved in the savepath folder.&lt;br /&gt;
&lt;br /&gt;
== Reproduce results from the paper ==&lt;br /&gt;
&lt;br /&gt;
The results showing in the paper can be reproduced by running the jupyter notebooks in `ShElastic/notebook` folder.&lt;br /&gt;
&lt;br /&gt;
Numerical Case 1: `Case01-Uniform_Tensile_Hole.ipynb`&lt;br /&gt;
Numerical Case 2: `Case02-Void_Dislocation_Interaction.ipynb`&lt;br /&gt;
Numerical Case 3: `Case03-Prismatic_Dislocation_Loop.ipynb`&lt;br /&gt;
&lt;br /&gt;
Launch the jupyter notebook by:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic&lt;br /&gt;
 jupyter notebook&lt;br /&gt;
&lt;br /&gt;
The result files will be saved in `ShElastic/figures`. The figures in the paper can be reproduced by running plotdata.m in matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 generated figures for the paper&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Case1_results.png | (a) Case 1&lt;br /&gt;
Image:Case2_results.png | (b) Case 2&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6770</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6770"/>
		<updated>2019-02-19T23:33:28Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Reproduce results from the paper */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== Suggested Installation of SHTOOLS (pip) ==&lt;br /&gt;
&lt;br /&gt;
If you have python3 and pip installed on your machine, you can simply install everything by: &lt;br /&gt;
&lt;br /&gt;
 python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose pyshtools&lt;br /&gt;
&lt;br /&gt;
== Generate coefficients ==&lt;br /&gt;
&lt;br /&gt;
The coefficients up to &amp;lt;math&amp;gt;l_{max} = 60&amp;lt;/math&amp;gt; is pre-computed and included in the repository. If you want to use higher mode spherical harmonic basis, please continue reading.&lt;br /&gt;
&lt;br /&gt;
Please change the first few lines in `ShElastic/scripts/generate_modes.py`:&lt;br /&gt;
&lt;br /&gt;
 lKfull = 10&lt;br /&gt;
 lJfull = lKfull + 3&lt;br /&gt;
 savepath = &#039;../module/lmax%dmodes&#039;%lKfull&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then we can generate the mode files by calling:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic/scripts&lt;br /&gt;
 python3 generate_modes.py&lt;br /&gt;
&lt;br /&gt;
The mode files will be saved in the savepath folder.&lt;br /&gt;
&lt;br /&gt;
== Reproduce results from the paper ==&lt;br /&gt;
&lt;br /&gt;
The results showing in the paper can be reproduced by running the jupyter notebooks in `ShElastic/notebook` folder.&lt;br /&gt;
&lt;br /&gt;
Numerical Case 1: `Case01-Uniform_Tensile_Hole.ipynb`&lt;br /&gt;
Numerical Case 2: `Case02-Void_Dislocation_Interaction.ipynb`&lt;br /&gt;
Numerical Case 3: `Case03-Prismatic_Dislocation_Loop.ipynb`&lt;br /&gt;
&lt;br /&gt;
Launch the jupyter notebook by:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic&lt;br /&gt;
 jupyter notebook&lt;br /&gt;
&lt;br /&gt;
The result files will be saved in `ShElastic/figures`. The figures in the paper can be reproduced by running plotdata.m in matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 generated figures for the paper&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Case1_results.png | (a) Case 1&lt;br /&gt;
Image:Case2_results.png | (b) Case 2&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6769</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6769"/>
		<updated>2019-02-19T23:30:47Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Reproduce results from the paper */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== Suggested Installation of SHTOOLS (pip) ==&lt;br /&gt;
&lt;br /&gt;
If you have python3 and pip installed on your machine, you can simply install everything by: &lt;br /&gt;
&lt;br /&gt;
 python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose pyshtools&lt;br /&gt;
&lt;br /&gt;
== Generate coefficients ==&lt;br /&gt;
&lt;br /&gt;
The coefficients up to &amp;lt;math&amp;gt;l_{max} = 60&amp;lt;/math&amp;gt; is pre-computed and included in the repository. If you want to use higher mode spherical harmonic basis, please continue reading.&lt;br /&gt;
&lt;br /&gt;
Please change the first few lines in `ShElastic/scripts/generate_modes.py`:&lt;br /&gt;
&lt;br /&gt;
 lKfull = 10&lt;br /&gt;
 lJfull = lKfull + 3&lt;br /&gt;
 savepath = &#039;../module/lmax%dmodes&#039;%lKfull&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then we can generate the mode files by calling:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic/scripts&lt;br /&gt;
 python3 generate_modes.py&lt;br /&gt;
&lt;br /&gt;
The mode files will be saved in the savepath folder.&lt;br /&gt;
&lt;br /&gt;
== Reproduce results from the paper ==&lt;br /&gt;
&lt;br /&gt;
The results showing in the paper can be reproduced by running the jupyter notebooks in `ShElastic/notebook` folder.&lt;br /&gt;
&lt;br /&gt;
Numerical Case 1: `Case01-Uniform_Tensile_Hole.ipynb`&lt;br /&gt;
Numerical Case 2: `Case02-Void_Dislocation_Interaction.ipynb`&lt;br /&gt;
Numerical Case 3: `Case03-Prismatic_Dislocation_Loop.ipynb`&lt;br /&gt;
&lt;br /&gt;
Launch the jupyter notebook by:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic&lt;br /&gt;
 jupyter notebook&lt;br /&gt;
&lt;br /&gt;
The result files will be saved in `ShElastic/figures`. The figures in the paper can be reproduced by running plotdata.m in matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 generated figures for the paper&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Case1_results.png | Case 1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6768</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6768"/>
		<updated>2019-02-19T23:30:18Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Reproduce results from the paper */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== Suggested Installation of SHTOOLS (pip) ==&lt;br /&gt;
&lt;br /&gt;
If you have python3 and pip installed on your machine, you can simply install everything by: &lt;br /&gt;
&lt;br /&gt;
 python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose pyshtools&lt;br /&gt;
&lt;br /&gt;
== Generate coefficients ==&lt;br /&gt;
&lt;br /&gt;
The coefficients up to &amp;lt;math&amp;gt;l_{max} = 60&amp;lt;/math&amp;gt; is pre-computed and included in the repository. If you want to use higher mode spherical harmonic basis, please continue reading.&lt;br /&gt;
&lt;br /&gt;
Please change the first few lines in `ShElastic/scripts/generate_modes.py`:&lt;br /&gt;
&lt;br /&gt;
 lKfull = 10&lt;br /&gt;
 lJfull = lKfull + 3&lt;br /&gt;
 savepath = &#039;../module/lmax%dmodes&#039;%lKfull&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then we can generate the mode files by calling:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic/scripts&lt;br /&gt;
 python3 generate_modes.py&lt;br /&gt;
&lt;br /&gt;
The mode files will be saved in the savepath folder.&lt;br /&gt;
&lt;br /&gt;
== Reproduce results from the paper ==&lt;br /&gt;
&lt;br /&gt;
The results showing in the paper can be reproduced by running the jupyter notebooks in `ShElastic/notebook` folder.&lt;br /&gt;
&lt;br /&gt;
Numerical Case 1: `Case01-Uniform_Tensile_Hole.ipynb`&lt;br /&gt;
Numerical Case 2: `Case02-Void_Dislocation_Interaction.ipynb`&lt;br /&gt;
Numerical Case 3: `Case03-Prismatic_Dislocation_Loop.ipynb`&lt;br /&gt;
&lt;br /&gt;
Launch the jupyter notebook by:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic&lt;br /&gt;
 jupyter notebook&lt;br /&gt;
&lt;br /&gt;
The result files will be saved in `ShElastic/figures`. The figures in the paper can be reproduced by running plotdata.m in matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 generated figures for the paper&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Case1_result.png | Case 1&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Case1_results.png&amp;diff=6767</id>
		<title>File:Case1 results.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Case1_results.png&amp;diff=6767"/>
		<updated>2019-02-19T23:29:49Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: Yfwang09 uploaded a new version of &amp;amp;quot;File:Case1 results.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6766</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6766"/>
		<updated>2019-02-19T23:18:40Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Reproduce results from the paper */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== Suggested Installation of SHTOOLS (pip) ==&lt;br /&gt;
&lt;br /&gt;
If you have python3 and pip installed on your machine, you can simply install everything by: &lt;br /&gt;
&lt;br /&gt;
 python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose pyshtools&lt;br /&gt;
&lt;br /&gt;
== Generate coefficients ==&lt;br /&gt;
&lt;br /&gt;
The coefficients up to &amp;lt;math&amp;gt;l_{max} = 60&amp;lt;/math&amp;gt; is pre-computed and included in the repository. If you want to use higher mode spherical harmonic basis, please continue reading.&lt;br /&gt;
&lt;br /&gt;
Please change the first few lines in `ShElastic/scripts/generate_modes.py`:&lt;br /&gt;
&lt;br /&gt;
 lKfull = 10&lt;br /&gt;
 lJfull = lKfull + 3&lt;br /&gt;
 savepath = &#039;../module/lmax%dmodes&#039;%lKfull&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then we can generate the mode files by calling:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic/scripts&lt;br /&gt;
 python3 generate_modes.py&lt;br /&gt;
&lt;br /&gt;
The mode files will be saved in the savepath folder.&lt;br /&gt;
&lt;br /&gt;
== Reproduce results from the paper ==&lt;br /&gt;
&lt;br /&gt;
The results showing in the paper can be reproduced by running the jupyter notebooks in `ShElastic/notebook` folder.&lt;br /&gt;
&lt;br /&gt;
Numerical Case 1: `Case01-Uniform_Tensile_Hole.ipynb`&lt;br /&gt;
Numerical Case 2: `Case02-Void_Dislocation_Interaction.ipynb`&lt;br /&gt;
Numerical Case 3: `Case03-Prismatic_Dislocation_Loop.ipynb`&lt;br /&gt;
&lt;br /&gt;
Launch the jupyter notebook by:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic&lt;br /&gt;
 jupyter notebook&lt;br /&gt;
&lt;br /&gt;
The result files will be saved in `ShElastic/figures`. The figures in the paper can be reproduced by running plotdata.m in matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 generated figures for the paper&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Case1_result.png | (a) Case 1&lt;br /&gt;
Image:case2_result.png | (b) Case 2&lt;br /&gt;
Image:case3_result.png | (c) Case 3&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=File:Case1_results.png&amp;diff=6765</id>
		<title>File:Case1 results.png</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=File:Case1_results.png&amp;diff=6765"/>
		<updated>2019-02-19T23:17:00Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6764</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6764"/>
		<updated>2019-02-19T23:15:34Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Reproduce results from the paper */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== Suggested Installation of SHTOOLS (pip) ==&lt;br /&gt;
&lt;br /&gt;
If you have python3 and pip installed on your machine, you can simply install everything by: &lt;br /&gt;
&lt;br /&gt;
 python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose pyshtools&lt;br /&gt;
&lt;br /&gt;
== Generate coefficients ==&lt;br /&gt;
&lt;br /&gt;
The coefficients up to &amp;lt;math&amp;gt;l_{max} = 60&amp;lt;/math&amp;gt; is pre-computed and included in the repository. If you want to use higher mode spherical harmonic basis, please continue reading.&lt;br /&gt;
&lt;br /&gt;
Please change the first few lines in `ShElastic/scripts/generate_modes.py`:&lt;br /&gt;
&lt;br /&gt;
 lKfull = 10&lt;br /&gt;
 lJfull = lKfull + 3&lt;br /&gt;
 savepath = &#039;../module/lmax%dmodes&#039;%lKfull&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then we can generate the mode files by calling:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic/scripts&lt;br /&gt;
 python3 generate_modes.py&lt;br /&gt;
&lt;br /&gt;
The mode files will be saved in the savepath folder.&lt;br /&gt;
&lt;br /&gt;
== Reproduce results from the paper ==&lt;br /&gt;
&lt;br /&gt;
The results showing in the paper can be reproduced by running the jupyter notebooks in `ShElastic/notebook` folder.&lt;br /&gt;
&lt;br /&gt;
Numerical Case 1: `Case01-Uniform_Tensile_Hole.ipynb`&lt;br /&gt;
Numerical Case 2: `Case02-Void_Dislocation_Interaction.ipynb`&lt;br /&gt;
Numerical Case 3: `Case03-Prismatic_Dislocation_Loop.ipynb`&lt;br /&gt;
&lt;br /&gt;
Launch the jupyter notebook by:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic&lt;br /&gt;
 jupyter notebook&lt;br /&gt;
&lt;br /&gt;
The result files will be saved in `ShElastic/figures`. The figures in the paper can be reproduced by running plotdata.m in matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 generated figures for the paper&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:case1_result.png|(a) Case 1&lt;br /&gt;
Image:case2_result.png|(b) Case 2&lt;br /&gt;
Image:case3_result.png|(c) Case 3&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6763</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6763"/>
		<updated>2019-02-19T23:04:12Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Generate coefficients */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== Suggested Installation of SHTOOLS (pip) ==&lt;br /&gt;
&lt;br /&gt;
If you have python3 and pip installed on your machine, you can simply install everything by: &lt;br /&gt;
&lt;br /&gt;
 python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose pyshtools&lt;br /&gt;
&lt;br /&gt;
== Generate coefficients ==&lt;br /&gt;
&lt;br /&gt;
The coefficients up to &amp;lt;math&amp;gt;l_{max} = 60&amp;lt;/math&amp;gt; is pre-computed and included in the repository. If you want to use higher mode spherical harmonic basis, please continue reading.&lt;br /&gt;
&lt;br /&gt;
Please change the first few lines in `ShElastic/scripts/generate_modes.py`:&lt;br /&gt;
&lt;br /&gt;
 lKfull = 10&lt;br /&gt;
 lJfull = lKfull + 3&lt;br /&gt;
 savepath = &#039;../module/lmax%dmodes&#039;%lKfull&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then we can generate the mode files by calling:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic/scripts&lt;br /&gt;
 python3 generate_modes.py&lt;br /&gt;
&lt;br /&gt;
The mode files will be saved in the savepath folder.&lt;br /&gt;
&lt;br /&gt;
== Reproduce results from the paper ==&lt;br /&gt;
&lt;br /&gt;
The results showing in the paper can be reproduced by running the jupyter notebooks in `ShElastic/notebook` folder.&lt;br /&gt;
&lt;br /&gt;
Numerical Case 1: `Case01-Uniform_Tensile_Hole.ipynb`&lt;br /&gt;
Numerical Case 2: `Case02-Void_Dislocation_Interaction.ipynb`&lt;br /&gt;
Numerical Case 3: `Case03-Prismatic_Dislocation_Loop.ipynb`&lt;br /&gt;
&lt;br /&gt;
Launch the jupyter notebook by:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic&lt;br /&gt;
 jupyter notebook&lt;br /&gt;
&lt;br /&gt;
The result files will be saved in `ShElastic/figures`. The figures in the paper can be reproduced by running plotdata.m in matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 Visualization of Spherical Harmonics&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:sph_harm_Y20.png|(a) &amp;lt;math&amp;gt; Y_{20}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
Image:sph_harm_Y32.png|(b) &amp;lt;math&amp;gt; Y_{32}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
Image:sph_harm_Y11.png|(c) &amp;lt;math&amp;gt; Y_{11}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6762</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6762"/>
		<updated>2019-02-19T23:03:29Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Generate coefficients */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== Suggested Installation of SHTOOLS (pip) ==&lt;br /&gt;
&lt;br /&gt;
If you have python3 and pip installed on your machine, you can simply install everything by: &lt;br /&gt;
&lt;br /&gt;
 python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose pyshtools&lt;br /&gt;
&lt;br /&gt;
== Generate coefficients ==&lt;br /&gt;
&lt;br /&gt;
The coefficients up to &amp;lt;math&amp;gt; l_{max} = 60 &amp;lt;/math&amp;gt; is pre-computed and included in the repository. If you want to use higher mode spherical harmonic basis, please continue reading.&lt;br /&gt;
&lt;br /&gt;
Please change the first few lines in `ShElastic/scripts/generate_modes.py`:&lt;br /&gt;
&lt;br /&gt;
 lKfull = 10&lt;br /&gt;
 lJfull = lKfull + 3&lt;br /&gt;
 savepath = &#039;../module/lmax%dmodes&#039;%lKfull&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then we can generate the mode files by calling:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic/scripts&lt;br /&gt;
 python3 generate_modes.py&lt;br /&gt;
&lt;br /&gt;
The mode files will be saved in the savepath folder.&lt;br /&gt;
&lt;br /&gt;
== Reproduce results from the paper ==&lt;br /&gt;
&lt;br /&gt;
The results showing in the paper can be reproduced by running the jupyter notebooks in `ShElastic/notebook` folder.&lt;br /&gt;
&lt;br /&gt;
Numerical Case 1: `Case01-Uniform_Tensile_Hole.ipynb`&lt;br /&gt;
Numerical Case 2: `Case02-Void_Dislocation_Interaction.ipynb`&lt;br /&gt;
Numerical Case 3: `Case03-Prismatic_Dislocation_Loop.ipynb`&lt;br /&gt;
&lt;br /&gt;
Launch the jupyter notebook by:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic&lt;br /&gt;
 jupyter notebook&lt;br /&gt;
&lt;br /&gt;
The result files will be saved in `ShElastic/figures`. The figures in the paper can be reproduced by running plotdata.m in matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 Visualization of Spherical Harmonics&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:sph_harm_Y20.png|(a) &amp;lt;math&amp;gt; Y_{20}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
Image:sph_harm_Y32.png|(b) &amp;lt;math&amp;gt; Y_{32}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
Image:sph_harm_Y11.png|(c) &amp;lt;math&amp;gt; Y_{11}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6761</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6761"/>
		<updated>2019-02-19T23:02:55Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== Suggested Installation of SHTOOLS (pip) ==&lt;br /&gt;
&lt;br /&gt;
If you have python3 and pip installed on your machine, you can simply install everything by: &lt;br /&gt;
&lt;br /&gt;
 python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose pyshtools&lt;br /&gt;
&lt;br /&gt;
== Generate coefficients ==&lt;br /&gt;
&lt;br /&gt;
The coefficients up to $l_{max} = 60$ is pre-computed and included in the repository. If you want to use higher mode spherical harmonic basis, please continue reading.&lt;br /&gt;
&lt;br /&gt;
Please change the first few lines in `ShElastic/scripts/generate_modes.py`:&lt;br /&gt;
&lt;br /&gt;
 lKfull = 10&lt;br /&gt;
 lJfull = lKfull + 3&lt;br /&gt;
 savepath = &#039;../module/lmax%dmodes&#039;%lKfull&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then we can generate the mode files by calling:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic/scripts&lt;br /&gt;
 python3 generate_modes.py&lt;br /&gt;
&lt;br /&gt;
The mode files will be saved in the savepath folder.&lt;br /&gt;
&lt;br /&gt;
== Reproduce results from the paper ==&lt;br /&gt;
&lt;br /&gt;
The results showing in the paper can be reproduced by running the jupyter notebooks in `ShElastic/notebook` folder.&lt;br /&gt;
&lt;br /&gt;
Numerical Case 1: `Case01-Uniform_Tensile_Hole.ipynb`&lt;br /&gt;
Numerical Case 2: `Case02-Void_Dislocation_Interaction.ipynb`&lt;br /&gt;
Numerical Case 3: `Case03-Prismatic_Dislocation_Loop.ipynb`&lt;br /&gt;
&lt;br /&gt;
Launch the jupyter notebook by:&lt;br /&gt;
&lt;br /&gt;
 cd ShElastic&lt;br /&gt;
 jupyter notebook&lt;br /&gt;
&lt;br /&gt;
The result files will be saved in `ShElastic/figures`. The figures in the paper can be reproduced by running plotdata.m in matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 Visualization of Spherical Harmonics&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:sph_harm_Y20.png|(a) &amp;lt;math&amp;gt; Y_{20}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
Image:sph_harm_Y32.png|(b) &amp;lt;math&amp;gt; Y_{32}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
Image:sph_harm_Y11.png|(c) &amp;lt;math&amp;gt; Y_{11}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6760</id>
		<title>ShElastic Manuals</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=ShElastic_Manuals&amp;diff=6760"/>
		<updated>2019-02-19T20:55:00Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: Created page with &amp;quot;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper  Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitlab.com/micronano/ShElastic ShElastic] is the python code for the paper&lt;br /&gt;
&lt;br /&gt;
Wang, Y., Zhang, X., &amp;amp; Cai, W. (2019). Spherical Harmonics Method for Computing the Image Stress Due to A Spherical Void. Journal of the Mechanics and Physics of Solids.&lt;br /&gt;
&lt;br /&gt;
The code is tested under Ubuntu 16.04 LTS. with package python 3.6, numpy 1.15, scipy 1.0, matplotlib 3.0, jupyter, and SHTOOLS 4.3. Please see [http://micro.stanford.edu/wiki/Install_SHTOOLS Install_SHTOOLS] for more details on installing required packages&lt;br /&gt;
&lt;br /&gt;
== Obtain the ShElastic package ==&lt;br /&gt;
&lt;br /&gt;
Please download the package using git:&lt;br /&gt;
&lt;br /&gt;
 git clone https://gitlab.com/micronano/ShElastic.git&lt;br /&gt;
&lt;br /&gt;
or directly from https://gitlab.com/micronano/ShElastic&lt;br /&gt;
&lt;br /&gt;
== How to Install SHTOOLS on mc2 ==&lt;br /&gt;
&lt;br /&gt;
On mc2 cluster, since we can only install packages for user only, we are not allowed to use sudo command to install the required packages. We need to compile the packages by our own.&lt;br /&gt;
&lt;br /&gt;
For compiling shtools, the required packages are fftw3, lapack, and blas. Libraries for lapack and blas are available on mc2, we can use them directly for compiling shtools. For installing fftw3, please refer to [http://micro.stanford.edu/wiki/Install_FFTW3 Install_FFTW3] for more details.&lt;br /&gt;
&lt;br /&gt;
After you followed the steps in FFTW3 installation (Serial only), you should have all the fftw3 libraries available:&lt;br /&gt;
&lt;br /&gt;
 ~/usr/include/fftw3.h&lt;br /&gt;
 ~/usr/include/fftw3.f&lt;br /&gt;
 ~/usr/lib/libfftw3.a&lt;br /&gt;
 ~/usr/lib/libfftw3.la&lt;br /&gt;
 ~/usr/lib/libfftw3.so&lt;br /&gt;
&lt;br /&gt;
And also, run the command:&lt;br /&gt;
&lt;br /&gt;
 ls /usr/lib64&lt;br /&gt;
&lt;br /&gt;
The libraries for lapack and blas should be available here:&lt;br /&gt;
&lt;br /&gt;
 /usr/lib64/liblapack.a&lt;br /&gt;
 /usr/lib64/liblapack.so&lt;br /&gt;
 /usr/lib64/liblapack.so.3&lt;br /&gt;
 ...&lt;br /&gt;
 /usr/lib64/libblas.a&lt;br /&gt;
 /usr/lib64/libblas.so&lt;br /&gt;
 /usr/lib64/libblas.so.3&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Before we proceed, we need to make sure to have python installed.&lt;br /&gt;
&lt;br /&gt;
=== Install python + scipy + SHTOOLS on local directory ===&lt;br /&gt;
&lt;br /&gt;
We create a local folder .localpython for installing python:&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/.localpython&lt;br /&gt;
&lt;br /&gt;
download python source code:&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/soft&lt;br /&gt;
 cd ~/soft&lt;br /&gt;
 wget http://www.python.org/ftp/python/X.X.X/Python-X.X.X.tgz&lt;br /&gt;
 tar -xvf Python-X.X.X.tgz&lt;br /&gt;
 cd Python-X.X.X&lt;br /&gt;
&lt;br /&gt;
compile python from source and install to local directory:&lt;br /&gt;
&lt;br /&gt;
 make clean&lt;br /&gt;
 ./configure --enable-shared --prefix=${HOME}/.localpython&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Add the following lines to ~/.bashrc:&lt;br /&gt;
&lt;br /&gt;
 export PATH=${HOME}/.localpython/bin:$PATH&lt;br /&gt;
 export PYTHONPATH=${HOME}/.localpython/bin&lt;br /&gt;
 export LIBRARY_PATH=$LIBRARY_PATH:${HOME}/.localpython/lib&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HOME}/.localpython/lib&lt;br /&gt;
&lt;br /&gt;
if python version &amp;lt; 2.7.9, install pip by:&lt;br /&gt;
&lt;br /&gt;
 wget https://bootstrap.pypa.io/get-pip.py&lt;br /&gt;
 python get-pip.py&lt;br /&gt;
 export PATH=${HOME}/.local/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
Install SciPy Stack using pip on user&#039;s directory:&lt;br /&gt;
&lt;br /&gt;
 pip(pip3) install --user numpy scipy matplotlib ipython jupyter pandas sympy nose&lt;br /&gt;
&lt;br /&gt;
Install pyshtools using pip:&lt;br /&gt;
First, we put the pre-compiled FFTW3 libraries into LIBRARY_PATH:&lt;br /&gt;
&lt;br /&gt;
 export LIBRARY_PATH=$LIBRARY_PATH:${HOME}/usr/lib&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HOME}/usr/lib&lt;br /&gt;
&lt;br /&gt;
Then we can install pyshtools through pip on user&#039;s directory:&lt;br /&gt;
&lt;br /&gt;
 pip(pip3) install --user pyshtools&lt;br /&gt;
&lt;br /&gt;
=== Compile SHTOOLS ===&lt;br /&gt;
&lt;br /&gt;
load the python module (we use python 2 as an example):&lt;br /&gt;
&lt;br /&gt;
 module load python/2.7.8 (Whichever is available)&lt;br /&gt;
&lt;br /&gt;
Also make sure you have numpy available:&lt;br /&gt;
&lt;br /&gt;
 pip list&lt;br /&gt;
&lt;br /&gt;
Then you are ready to install shtools on your mc2 account.&lt;br /&gt;
&lt;br /&gt;
First, download the shtools source package from [https://github.com/SHTOOLS/SHTOOLS/releases Releases]&lt;br /&gt;
&lt;br /&gt;
 cd ~/soft&lt;br /&gt;
 wget https://github.com/SHTOOLS/SHTOOLS/archive/v3.4.tar.gz&lt;br /&gt;
 tar -zxvf v3.4.tar.gz&lt;br /&gt;
 cd SHTOOLS-3.4&lt;br /&gt;
&lt;br /&gt;
Then, indicate the libraries and compile the source code:&lt;br /&gt;
&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:&amp;quot;$HOME/usr/lib&amp;quot;&lt;br /&gt;
 make python2 LAPACK=&amp;quot;-L/usr/lib64 -llapack&amp;quot; BLAS=&amp;quot;-L/usr/lib64 -lblas&amp;quot; FFTW=&amp;quot;-L$HOME/usr/lib -lfftw3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output should be something look like [https://shtools.oca.eu/shtools/www/makeout.html this]. Then your package is ready for use. If you are compiling with python 3, just change &amp;quot;python2&amp;quot; to &amp;quot;python3&amp;quot; in the command above.&lt;br /&gt;
&lt;br /&gt;
To load the SHTOOLS module in python, use the following lines:&lt;br /&gt;
&lt;br /&gt;
 import sys&lt;br /&gt;
 sys.path.append(&#039;$HOME/soft/SHTOOLS-3.4&#039;)&lt;br /&gt;
 import pyshtools as shtools&lt;br /&gt;
&lt;br /&gt;
where the &amp;quot;$HOME&amp;quot; has to be substituted by your own home folder path.&lt;br /&gt;
&lt;br /&gt;
== Examples for using SHTOOLS in python ==&lt;br /&gt;
&lt;br /&gt;
We consider a simple example where we do the spherical expansion of function &amp;lt;math&amp;gt;x^2&amp;lt;/math&amp;gt; on the surface of a unit sphere.&lt;br /&gt;
&lt;br /&gt;
First we import the necessary packages:&lt;br /&gt;
&lt;br /&gt;
 from __future__ import print_function # only necessary if using Python 2.x&lt;br /&gt;
&lt;br /&gt;
 import numpy as np&lt;br /&gt;
&lt;br /&gt;
 import sys&lt;br /&gt;
 sys.path.append(&#039;/home/yfwang09/soft/SHTOOLS-3.4&#039;)&lt;br /&gt;
 import pyshtools as psh&lt;br /&gt;
&lt;br /&gt;
Then we generate the mesh grids for the spherical coordinates (Nx2N grids for latitude and longitude variables &amp;lt;math&amp;gt;\phi, \theta&amp;lt;/math&amp;gt;; or &amp;lt;math&amp;gt;\pi/N&amp;lt;/math&amp;gt; latitudinal and &amp;lt;math&amp;gt;2\pi/2N&amp;lt;/math&amp;gt; longitudinal, both start from 0):&lt;br /&gt;
&lt;br /&gt;
 Ngrid = 100&lt;br /&gt;
 phi = np.linspace(0, np.pi, Ngrid)&lt;br /&gt;
 theta = np.linspace(0, 2*np.pi, 2*Ngrid)&lt;br /&gt;
&lt;br /&gt;
 THETA, PHI = np.meshgrid(theta, phi)      # make the grid size as Nx2N&lt;br /&gt;
&lt;br /&gt;
where the grid PHI and THETA both have N rows and 2N columns. Then we translate the Cartesian coordinates into the spherical meshgrids, and generate the target function into spherical coordinates:&lt;br /&gt;
&lt;br /&gt;
 Z = np.cos(PHI);&lt;br /&gt;
 X = np.sin(PHI)*np.cos(THETA);&lt;br /&gt;
 Y = np.sin(PHI)*np.sin(THETA);&lt;br /&gt;
&lt;br /&gt;
 X2 = X**2&lt;br /&gt;
&lt;br /&gt;
Finally we expand the target function into spherical harmonic series:&lt;br /&gt;
&lt;br /&gt;
 cilm = np.empty([2,Ngrid/2,Ngrid/2])&lt;br /&gt;
 filename = &#039;xsquare&#039;&lt;br /&gt;
 cilm = psh.expand.SHExpandDH(X2, sampling=2)&lt;br /&gt;
 np.savetxt(filename+&#039;_clm.txt&#039;, cilm[0,:,:], header=&#039;Row: l, Column: m&#039;)&lt;br /&gt;
 np.savetxt(filename+&#039;_slm.txt&#039;, cilm[1,:,:], header=&#039;Row: l, Column: m&#039;)&lt;br /&gt;
&lt;br /&gt;
where cilm represent the coefficients of different spherical harmonic modes. cilm[0, l, m] and cilm[1, l, m] are the cosine and sine modes of spherical harmonics. The parameter sampling=2 means that we are using the grid Nx2N instead of NxN.&lt;br /&gt;
&lt;br /&gt;
See the page [https://shtools.oca.eu/shtools/www/man/python/pyshexpanddh.html SHExpandDH] for the detailed description of the expanding function and the page [https://shtools.oca.eu/shtools/www/conventions.html Real Spherical Harmonics] for mathematical definition.&lt;br /&gt;
&lt;br /&gt;
== Visualize spherical harmonic modes using scipy ==&lt;br /&gt;
&lt;br /&gt;
We first import the necessary packages:&lt;br /&gt;
&lt;br /&gt;
 import numpy as np&lt;br /&gt;
 from scipy.special import sph_harm&lt;br /&gt;
 import matplotlib.pyplot as plt&lt;br /&gt;
 from matplotlib import cm, colors&lt;br /&gt;
 from mpl_toolkits.mplot3d import Axes3D&lt;br /&gt;
&lt;br /&gt;
For a certain pair of parameters (m, l), we can plot the corresponding spherical harmonic mode Y(l, m) on the surface of a unit sphere using scipy and matplotlib packages. Here we use the meshgrid THETA, PHI, X, Y, and Z we generated in the previous section:&lt;br /&gt;
&lt;br /&gt;
 fvalues = sph_harm(m, l, THETA, PHI).real  # Get the values of spherical harmonic functions&lt;br /&gt;
 fmax, fmin = fvalues.max(), fvalues.min()&lt;br /&gt;
 fcolors = (fvalues - fmin)/(fmax - fmin)    # normalize the values into range [0, 1]&lt;br /&gt;
&lt;br /&gt;
Then we plot Y(l, m) on a sphere:&lt;br /&gt;
&lt;br /&gt;
 fig = plt.figure(figsize=plt.figaspect(1.))  # make the axis with equal aspects&lt;br /&gt;
 ax = fig.add_subplot(111, projection=&#039;3d&#039;)   # add an subplot object with 3D plot&lt;br /&gt;
 ax.plot_surface(x, y, z,  rstride=1, cstride=1, facecolors=cm.Blues(fcolors))&lt;br /&gt;
 plt.show()&lt;br /&gt;
&lt;br /&gt;
For example, the figures for (l, m) = (2, 0), (3, 2), and (1, 1) are shown as below:&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 Visualization of Spherical Harmonics&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:sph_harm_Y20.png|(a) &amp;lt;math&amp;gt; Y_{20}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
Image:sph_harm_Y32.png|(b) &amp;lt;math&amp;gt; Y_{32}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
Image:sph_harm_Y11.png|(c) &amp;lt;math&amp;gt; Y_{11}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Tutorials&amp;diff=6759</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Tutorials&amp;diff=6759"/>
		<updated>2019-02-19T19:20:29Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Simulation Codes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simulation Codes ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[MD++ Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[ParaDiS Manuals]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | [[ParaDiS Workshop Notes]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[DDLab Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[VASP Manuals]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | [[How to compile Qbox]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[NetworCh Manuals]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[How to compile LAMMPS]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | [[How to compile pimc++]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[ParaDiS tools]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[ShElastic Manuals]]&lt;br /&gt;
!width=&amp;quot;300&amp;quot; | &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Computers ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Unix Basics]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Computer Setup]] &lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Computing Clusters | Parallel Clusters]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install Ubuntu]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install FFTW3]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install HDF5]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install GSL]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Standard Tcl Library | Tcl Library]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install the GNU Compiler Collection (GCC)]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Running Hybrid MPI/OpenMP Simulations]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Install SHTOOLS]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scientific Background ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Dislocations]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Science Outreach ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [http://www.youtube.com/watch?v=SgM-Xes16Sw  Outreach interview]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[How to install MD++ in Ubuntu | Install MD++ in Ubuntu]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Introduction to Molecular Dynamics Simulations of Fullerenes | MD of Fullerenes]]&lt;br /&gt;
|-&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Images of Fullerenes]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Android Applications and Information]]&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;!-- (commented out until completion)&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Simulating Solids in MD++]]&lt;br /&gt;
!width=&amp;quot;200&amp;quot; | [[Videos of bucky balls in motion]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Tutorial:Members_Only | Members Only]] ==&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Install_SHTOOLS&amp;diff=6758</id>
		<title>Install SHTOOLS</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Install_SHTOOLS&amp;diff=6758"/>
		<updated>2019-02-19T19:11:31Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Visualization of spherical harmonic modes using scipy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://shtools.oca.eu/shtools/ SHTOOLS] is a package for spherical harmonics transformation and reconstructions. The current version (SHTOOLS3.4) is available in python and Fortran 95. In this article, we are introducing the installation of SHTOOLS python packages on your own computer and mc2 cluster.&lt;br /&gt;
&lt;br /&gt;
== How to Install SHTOOLS on Your Own Computer ==&lt;br /&gt;
&lt;br /&gt;
On Mac or Linux, you will need to have fortran compiler, lapack/blas, and fftw3 available. This can be done simply by running the following commands with homebrew on Mac:&lt;br /&gt;
&lt;br /&gt;
 brew install fftw --with-fortran&lt;br /&gt;
&lt;br /&gt;
or Linux:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install libblas-dev liblapack-dev g++ gfortran libfftw3-dev tcsh&lt;br /&gt;
&lt;br /&gt;
If you have installed python and the package manager pip, you can install the shtools directly by running the command:&lt;br /&gt;
&lt;br /&gt;
 pip install pyshtools&lt;br /&gt;
&lt;br /&gt;
Then if you run command:&lt;br /&gt;
&lt;br /&gt;
 pip list&lt;br /&gt;
&lt;br /&gt;
You will see pyshtools library is available in your python packages.&lt;br /&gt;
&lt;br /&gt;
== How to Install SHTOOLS on mc2 ==&lt;br /&gt;
&lt;br /&gt;
On mc2 cluster, since we can only install packages for user only, we are not allowed to use sudo command to install the required packages. We need to compile the packages by our own.&lt;br /&gt;
&lt;br /&gt;
For compiling shtools, the required packages are fftw3, lapack, and blas. Libraries for lapack and blas are available on mc2, we can use them directly for compiling shtools. For installing fftw3, please refer to [http://micro.stanford.edu/wiki/Install_FFTW3 Install_FFTW3] for more details.&lt;br /&gt;
&lt;br /&gt;
After you followed the steps in FFTW3 installation (Serial only), you should have all the fftw3 libraries available:&lt;br /&gt;
&lt;br /&gt;
 ~/usr/include/fftw3.h&lt;br /&gt;
 ~/usr/include/fftw3.f&lt;br /&gt;
 ~/usr/lib/libfftw3.a&lt;br /&gt;
 ~/usr/lib/libfftw3.la&lt;br /&gt;
 ~/usr/lib/libfftw3.so&lt;br /&gt;
&lt;br /&gt;
And also, run the command:&lt;br /&gt;
&lt;br /&gt;
 ls /usr/lib64&lt;br /&gt;
&lt;br /&gt;
The libraries for lapack and blas should be available here:&lt;br /&gt;
&lt;br /&gt;
 /usr/lib64/liblapack.a&lt;br /&gt;
 /usr/lib64/liblapack.so&lt;br /&gt;
 /usr/lib64/liblapack.so.3&lt;br /&gt;
 ...&lt;br /&gt;
 /usr/lib64/libblas.a&lt;br /&gt;
 /usr/lib64/libblas.so&lt;br /&gt;
 /usr/lib64/libblas.so.3&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Before we proceed, we need to make sure to have python installed.&lt;br /&gt;
&lt;br /&gt;
=== Install python + scipy + SHTOOLS on local directory ===&lt;br /&gt;
&lt;br /&gt;
We create a local folder .localpython for installing python:&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/.localpython&lt;br /&gt;
&lt;br /&gt;
download python source code:&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/soft&lt;br /&gt;
 cd ~/soft&lt;br /&gt;
 wget http://www.python.org/ftp/python/X.X.X/Python-X.X.X.tgz&lt;br /&gt;
 tar -xvf Python-X.X.X.tgz&lt;br /&gt;
 cd Python-X.X.X&lt;br /&gt;
&lt;br /&gt;
compile python from source and install to local directory:&lt;br /&gt;
&lt;br /&gt;
 make clean&lt;br /&gt;
 ./configure --enable-shared --prefix=${HOME}/.localpython&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Add the following lines to ~/.bashrc:&lt;br /&gt;
&lt;br /&gt;
 export PATH=${HOME}/.localpython/bin:$PATH&lt;br /&gt;
 export PYTHONPATH=${HOME}/.localpython/bin&lt;br /&gt;
 export LIBRARY_PATH=$LIBRARY_PATH:${HOME}/.localpython/lib&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HOME}/.localpython/lib&lt;br /&gt;
&lt;br /&gt;
if python version &amp;lt; 2.7.9, install pip by:&lt;br /&gt;
&lt;br /&gt;
 wget https://bootstrap.pypa.io/get-pip.py&lt;br /&gt;
 python get-pip.py&lt;br /&gt;
 export PATH=${HOME}/.local/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
Install SciPy Stack using pip on user&#039;s directory:&lt;br /&gt;
&lt;br /&gt;
 pip(pip3) install --user numpy scipy matplotlib ipython jupyter pandas sympy nose&lt;br /&gt;
&lt;br /&gt;
Install pyshtools using pip:&lt;br /&gt;
First, we put the pre-compiled FFTW3 libraries into LIBRARY_PATH:&lt;br /&gt;
&lt;br /&gt;
 export LIBRARY_PATH=$LIBRARY_PATH:${HOME}/usr/lib&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HOME}/usr/lib&lt;br /&gt;
&lt;br /&gt;
Then we can install pyshtools through pip on user&#039;s directory:&lt;br /&gt;
&lt;br /&gt;
 pip(pip3) install --user pyshtools&lt;br /&gt;
&lt;br /&gt;
=== Compile SHTOOLS ===&lt;br /&gt;
&lt;br /&gt;
load the python module (we use python 2 as an example):&lt;br /&gt;
&lt;br /&gt;
 module load python/2.7.8 (Whichever is available)&lt;br /&gt;
&lt;br /&gt;
Also make sure you have numpy available:&lt;br /&gt;
&lt;br /&gt;
 pip list&lt;br /&gt;
&lt;br /&gt;
Then you are ready to install shtools on your mc2 account.&lt;br /&gt;
&lt;br /&gt;
First, download the shtools source package from [https://github.com/SHTOOLS/SHTOOLS/releases Releases]&lt;br /&gt;
&lt;br /&gt;
 cd ~/soft&lt;br /&gt;
 wget https://github.com/SHTOOLS/SHTOOLS/archive/v3.4.tar.gz&lt;br /&gt;
 tar -zxvf v3.4.tar.gz&lt;br /&gt;
 cd SHTOOLS-3.4&lt;br /&gt;
&lt;br /&gt;
Then, indicate the libraries and compile the source code:&lt;br /&gt;
&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:&amp;quot;$HOME/usr/lib&amp;quot;&lt;br /&gt;
 make python2 LAPACK=&amp;quot;-L/usr/lib64 -llapack&amp;quot; BLAS=&amp;quot;-L/usr/lib64 -lblas&amp;quot; FFTW=&amp;quot;-L$HOME/usr/lib -lfftw3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output should be something look like [https://shtools.oca.eu/shtools/www/makeout.html this]. Then your package is ready for use. If you are compiling with python 3, just change &amp;quot;python2&amp;quot; to &amp;quot;python3&amp;quot; in the command above.&lt;br /&gt;
&lt;br /&gt;
To load the SHTOOLS module in python, use the following lines:&lt;br /&gt;
&lt;br /&gt;
 import sys&lt;br /&gt;
 sys.path.append(&#039;$HOME/soft/SHTOOLS-3.4&#039;)&lt;br /&gt;
 import pyshtools as shtools&lt;br /&gt;
&lt;br /&gt;
where the &amp;quot;$HOME&amp;quot; has to be substituted by your own home folder path.&lt;br /&gt;
&lt;br /&gt;
== Examples for using SHTOOLS in python ==&lt;br /&gt;
&lt;br /&gt;
We consider a simple example where we do the spherical expansion of function &amp;lt;math&amp;gt;x^2&amp;lt;/math&amp;gt; on the surface of a unit sphere.&lt;br /&gt;
&lt;br /&gt;
First we import the necessary packages:&lt;br /&gt;
&lt;br /&gt;
 from __future__ import print_function # only necessary if using Python 2.x&lt;br /&gt;
&lt;br /&gt;
 import numpy as np&lt;br /&gt;
&lt;br /&gt;
 import sys&lt;br /&gt;
 sys.path.append(&#039;/home/yfwang09/soft/SHTOOLS-3.4&#039;)&lt;br /&gt;
 import pyshtools as psh&lt;br /&gt;
&lt;br /&gt;
Then we generate the mesh grids for the spherical coordinates (Nx2N grids for latitude and longitude variables &amp;lt;math&amp;gt;\phi, \theta&amp;lt;/math&amp;gt;; or &amp;lt;math&amp;gt;\pi/N&amp;lt;/math&amp;gt; latitudinal and &amp;lt;math&amp;gt;2\pi/2N&amp;lt;/math&amp;gt; longitudinal, both start from 0):&lt;br /&gt;
&lt;br /&gt;
 Ngrid = 100&lt;br /&gt;
 phi = np.linspace(0, np.pi, Ngrid)&lt;br /&gt;
 theta = np.linspace(0, 2*np.pi, 2*Ngrid)&lt;br /&gt;
&lt;br /&gt;
 THETA, PHI = np.meshgrid(theta, phi)      # make the grid size as Nx2N&lt;br /&gt;
&lt;br /&gt;
where the grid PHI and THETA both have N rows and 2N columns. Then we translate the Cartesian coordinates into the spherical meshgrids, and generate the target function into spherical coordinates:&lt;br /&gt;
&lt;br /&gt;
 Z = np.cos(PHI);&lt;br /&gt;
 X = np.sin(PHI)*np.cos(THETA);&lt;br /&gt;
 Y = np.sin(PHI)*np.sin(THETA);&lt;br /&gt;
&lt;br /&gt;
 X2 = X**2&lt;br /&gt;
&lt;br /&gt;
Finally we expand the target function into spherical harmonic series:&lt;br /&gt;
&lt;br /&gt;
 cilm = np.empty([2,Ngrid/2,Ngrid/2])&lt;br /&gt;
 filename = &#039;xsquare&#039;&lt;br /&gt;
 cilm = psh.expand.SHExpandDH(X2, sampling=2)&lt;br /&gt;
 np.savetxt(filename+&#039;_clm.txt&#039;, cilm[0,:,:], header=&#039;Row: l, Column: m&#039;)&lt;br /&gt;
 np.savetxt(filename+&#039;_slm.txt&#039;, cilm[1,:,:], header=&#039;Row: l, Column: m&#039;)&lt;br /&gt;
&lt;br /&gt;
where cilm represent the coefficients of different spherical harmonic modes. cilm[0, l, m] and cilm[1, l, m] are the cosine and sine modes of spherical harmonics. The parameter sampling=2 means that we are using the grid Nx2N instead of NxN.&lt;br /&gt;
&lt;br /&gt;
See the page [https://shtools.oca.eu/shtools/www/man/python/pyshexpanddh.html SHExpandDH] for the detailed description of the expanding function and the page [https://shtools.oca.eu/shtools/www/conventions.html Real Spherical Harmonics] for mathematical definition.&lt;br /&gt;
&lt;br /&gt;
== Visualize spherical harmonic modes using scipy ==&lt;br /&gt;
&lt;br /&gt;
We first import the necessary packages:&lt;br /&gt;
&lt;br /&gt;
 import numpy as np&lt;br /&gt;
 from scipy.special import sph_harm&lt;br /&gt;
 import matplotlib.pyplot as plt&lt;br /&gt;
 from matplotlib import cm, colors&lt;br /&gt;
 from mpl_toolkits.mplot3d import Axes3D&lt;br /&gt;
&lt;br /&gt;
For a certain pair of parameters (m, l), we can plot the corresponding spherical harmonic mode Y(l, m) on the surface of a unit sphere using scipy and matplotlib packages. Here we use the meshgrid THETA, PHI, X, Y, and Z we generated in the previous section:&lt;br /&gt;
&lt;br /&gt;
 fvalues = sph_harm(m, l, THETA, PHI).real  # Get the values of spherical harmonic functions&lt;br /&gt;
 fmax, fmin = fvalues.max(), fvalues.min()&lt;br /&gt;
 fcolors = (fvalues - fmin)/(fmax - fmin)    # normalize the values into range [0, 1]&lt;br /&gt;
&lt;br /&gt;
Then we plot Y(l, m) on a sphere:&lt;br /&gt;
&lt;br /&gt;
 fig = plt.figure(figsize=plt.figaspect(1.))  # make the axis with equal aspects&lt;br /&gt;
 ax = fig.add_subplot(111, projection=&#039;3d&#039;)   # add an subplot object with 3D plot&lt;br /&gt;
 ax.plot_surface(x, y, z,  rstride=1, cstride=1, facecolors=cm.Blues(fcolors))&lt;br /&gt;
 plt.show()&lt;br /&gt;
&lt;br /&gt;
For example, the figures for (l, m) = (2, 0), (3, 2), and (1, 1) are shown as below:&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 Visualization of Spherical Harmonics&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:sph_harm_Y20.png|(a) &amp;lt;math&amp;gt; Y_{20}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
Image:sph_harm_Y32.png|(b) &amp;lt;math&amp;gt; Y_{32}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
Image:sph_harm_Y11.png|(c) &amp;lt;math&amp;gt; Y_{11}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Install_SHTOOLS&amp;diff=6686</id>
		<title>Install SHTOOLS</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Install_SHTOOLS&amp;diff=6686"/>
		<updated>2018-01-13T01:27:25Z</updated>

		<summary type="html">&lt;p&gt;Yfwang09: /* Install python + scipy + SHTOOLS on local directory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://shtools.oca.eu/shtools/ SHTOOLS] is a package for spherical harmonics transformation and reconstructions. The current version (SHTOOLS3.4) is available in python and Fortran 95. In this article, we are introducing the installation of SHTOOLS python packages on your own computer and mc2 cluster.&lt;br /&gt;
&lt;br /&gt;
== How to Install SHTOOLS on Your Own Computer ==&lt;br /&gt;
&lt;br /&gt;
On Mac or Linux, you will need to have fortran compiler, lapack/blas, and fftw3 available. This can be done simply by running the following commands with homebrew on Mac:&lt;br /&gt;
&lt;br /&gt;
 brew install fftw --with-fortran&lt;br /&gt;
&lt;br /&gt;
or Linux:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install libblas-dev liblapack-dev g++ gfortran libfftw3-dev tcsh&lt;br /&gt;
&lt;br /&gt;
If you have installed python and the package manager pip, you can install the shtools directly by running the command:&lt;br /&gt;
&lt;br /&gt;
 pip install pyshtools&lt;br /&gt;
&lt;br /&gt;
Then if you run command:&lt;br /&gt;
&lt;br /&gt;
 pip list&lt;br /&gt;
&lt;br /&gt;
You will see pyshtools library is available in your python packages.&lt;br /&gt;
&lt;br /&gt;
== How to Install SHTOOLS on mc2 ==&lt;br /&gt;
&lt;br /&gt;
On mc2 cluster, since we can only install packages for user only, we are not allowed to use sudo command to install the required packages. We need to compile the packages by our own.&lt;br /&gt;
&lt;br /&gt;
For compiling shtools, the required packages are fftw3, lapack, and blas. Libraries for lapack and blas are available on mc2, we can use them directly for compiling shtools. For installing fftw3, please refer to [http://micro.stanford.edu/wiki/Install_FFTW3 Install_FFTW3] for more details.&lt;br /&gt;
&lt;br /&gt;
After you followed the steps in FFTW3 installation (Serial only), you should have all the fftw3 libraries available:&lt;br /&gt;
&lt;br /&gt;
 ~/usr/include/fftw3.h&lt;br /&gt;
 ~/usr/include/fftw3.f&lt;br /&gt;
 ~/usr/lib/libfftw3.a&lt;br /&gt;
 ~/usr/lib/libfftw3.la&lt;br /&gt;
 ~/usr/lib/libfftw3.so&lt;br /&gt;
&lt;br /&gt;
And also, run the command:&lt;br /&gt;
&lt;br /&gt;
 ls /usr/lib64&lt;br /&gt;
&lt;br /&gt;
The libraries for lapack and blas should be available here:&lt;br /&gt;
&lt;br /&gt;
 /usr/lib64/liblapack.a&lt;br /&gt;
 /usr/lib64/liblapack.so&lt;br /&gt;
 /usr/lib64/liblapack.so.3&lt;br /&gt;
 ...&lt;br /&gt;
 /usr/lib64/libblas.a&lt;br /&gt;
 /usr/lib64/libblas.so&lt;br /&gt;
 /usr/lib64/libblas.so.3&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Before we proceed, we need to make sure to have python installed.&lt;br /&gt;
&lt;br /&gt;
=== Install python + scipy + SHTOOLS on local directory ===&lt;br /&gt;
&lt;br /&gt;
We create a local folder .localpython for installing python:&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/.localpython&lt;br /&gt;
&lt;br /&gt;
download python source code:&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/soft&lt;br /&gt;
 cd ~/soft&lt;br /&gt;
 wget http://www.python.org/ftp/python/X.X.X/Python-X.X.X.tgz&lt;br /&gt;
 tar -xvf Python-X.X.X.tgz&lt;br /&gt;
 cd Python-X.X.X&lt;br /&gt;
&lt;br /&gt;
compile python from source and install to local directory:&lt;br /&gt;
&lt;br /&gt;
 make clean&lt;br /&gt;
 ./configure --enable-shared --prefix=${HOME}/.localpython&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
Add the following lines to ~/.bashrc:&lt;br /&gt;
&lt;br /&gt;
 export PATH=${HOME}/.localpython/bin:$PATH&lt;br /&gt;
 export PYTHONPATH=${HOME}/.localpython/bin&lt;br /&gt;
 export LIBRARY_PATH=$LIBRARY_PATH:${HOME}/.localpython/lib&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HOME}/.localpython/lib&lt;br /&gt;
&lt;br /&gt;
if python version &amp;lt; 2.7.9, install pip by:&lt;br /&gt;
&lt;br /&gt;
 wget https://bootstrap.pypa.io/get-pip.py&lt;br /&gt;
 python get-pip.py&lt;br /&gt;
 export PATH=${HOME}/.local/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
Install SciPy Stack using pip on user&#039;s directory:&lt;br /&gt;
&lt;br /&gt;
 pip(pip3) install --user numpy scipy matplotlib ipython jupyter pandas sympy nose&lt;br /&gt;
&lt;br /&gt;
Install pyshtools using pip:&lt;br /&gt;
First, we put the pre-compiled FFTW3 libraries into LIBRARY_PATH:&lt;br /&gt;
&lt;br /&gt;
 export LIBRARY_PATH=$LIBRARY_PATH:${HOME}/usr/lib&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HOME}/usr/lib&lt;br /&gt;
&lt;br /&gt;
Then we can install pyshtools through pip on user&#039;s directory:&lt;br /&gt;
&lt;br /&gt;
 pip(pip3) install --user pyshtools&lt;br /&gt;
&lt;br /&gt;
=== Compile SHTOOLS ===&lt;br /&gt;
&lt;br /&gt;
load the python module (we use python 2 as an example):&lt;br /&gt;
&lt;br /&gt;
 module load python/2.7.8 (Whichever is available)&lt;br /&gt;
&lt;br /&gt;
Also make sure you have numpy available:&lt;br /&gt;
&lt;br /&gt;
 pip list&lt;br /&gt;
&lt;br /&gt;
Then you are ready to install shtools on your mc2 account.&lt;br /&gt;
&lt;br /&gt;
First, download the shtools source package from [https://github.com/SHTOOLS/SHTOOLS/releases Releases]&lt;br /&gt;
&lt;br /&gt;
 cd ~/soft&lt;br /&gt;
 wget https://github.com/SHTOOLS/SHTOOLS/archive/v3.4.tar.gz&lt;br /&gt;
 tar -zxvf v3.4.tar.gz&lt;br /&gt;
 cd SHTOOLS-3.4&lt;br /&gt;
&lt;br /&gt;
Then, indicate the libraries and compile the source code:&lt;br /&gt;
&lt;br /&gt;
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:&amp;quot;$HOME/usr/lib&amp;quot;&lt;br /&gt;
 make python2 LAPACK=&amp;quot;-L/usr/lib64 -llapack&amp;quot; BLAS=&amp;quot;-L/usr/lib64 -lblas&amp;quot; FFTW=&amp;quot;-L$HOME/usr/lib -lfftw3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output should be something look like [https://shtools.oca.eu/shtools/www/makeout.html this]. Then your package is ready for use. If you are compiling with python 3, just change &amp;quot;python2&amp;quot; to &amp;quot;python3&amp;quot; in the command above.&lt;br /&gt;
&lt;br /&gt;
To load the SHTOOLS module in python, use the following lines:&lt;br /&gt;
&lt;br /&gt;
 import sys&lt;br /&gt;
 sys.path.append(&#039;$HOME/soft/SHTOOLS-3.4&#039;)&lt;br /&gt;
 import pyshtools as shtools&lt;br /&gt;
&lt;br /&gt;
where the &amp;quot;$HOME&amp;quot; has to be substituted by your own home folder path.&lt;br /&gt;
&lt;br /&gt;
== Examples for using SHTOOLS in python ==&lt;br /&gt;
&lt;br /&gt;
We consider a simple example where we do the spherical expansion of function &amp;lt;math&amp;gt;x^2&amp;lt;/math&amp;gt; on the surface of a unit sphere.&lt;br /&gt;
&lt;br /&gt;
First we import the necessary packages:&lt;br /&gt;
&lt;br /&gt;
 from __future__ import print_function # only necessary if using Python 2.x&lt;br /&gt;
&lt;br /&gt;
 import numpy as np&lt;br /&gt;
&lt;br /&gt;
 import sys&lt;br /&gt;
 sys.path.append(&#039;/home/yfwang09/soft/SHTOOLS-3.4&#039;)&lt;br /&gt;
 import pyshtools as psh&lt;br /&gt;
&lt;br /&gt;
Then we generate the mesh grids for the spherical coordinates (Nx2N grids for latitude and longitude variables &amp;lt;math&amp;gt;\phi, \theta&amp;lt;/math&amp;gt;; or &amp;lt;math&amp;gt;\pi/N&amp;lt;/math&amp;gt; latitudinal and &amp;lt;math&amp;gt;2\pi/2N&amp;lt;/math&amp;gt; longitudinal, both start from 0):&lt;br /&gt;
&lt;br /&gt;
 Ngrid = 100&lt;br /&gt;
 phi = np.linspace(0, np.pi, Ngrid)&lt;br /&gt;
 theta = np.linspace(0, 2*np.pi, 2*Ngrid)&lt;br /&gt;
&lt;br /&gt;
 THETA, PHI = np.meshgrid(theta, phi)      # make the grid size as Nx2N&lt;br /&gt;
&lt;br /&gt;
where the grid PHI and THETA both have N rows and 2N columns. Then we translate the Cartesian coordinates into the spherical meshgrids, and generate the target function into spherical coordinates:&lt;br /&gt;
&lt;br /&gt;
 Z = np.cos(PHI);&lt;br /&gt;
 X = np.sin(PHI)*np.cos(THETA);&lt;br /&gt;
 Y = np.sin(PHI)*np.sin(THETA);&lt;br /&gt;
&lt;br /&gt;
 X2 = X**2&lt;br /&gt;
&lt;br /&gt;
Finally we expand the target function into spherical harmonic series:&lt;br /&gt;
&lt;br /&gt;
 cilm = np.empty([2,Ngrid/2,Ngrid/2])&lt;br /&gt;
 filename = &#039;xsquare&#039;&lt;br /&gt;
 cilm = psh.expand.SHExpandDH(X2, sampling=2)&lt;br /&gt;
 np.savetxt(filename+&#039;_clm.txt&#039;, cilm[0,:,:], header=&#039;Row: l, Column: m&#039;)&lt;br /&gt;
 np.savetxt(filename+&#039;_slm.txt&#039;, cilm[1,:,:], header=&#039;Row: l, Column: m&#039;)&lt;br /&gt;
&lt;br /&gt;
where cilm represent the coefficients of different spherical harmonic modes. cilm[0, l, m] and cilm[1, l, m] are the cosine and sine modes of spherical harmonics. The parameter sampling=2 means that we are using the grid Nx2N instead of NxN.&lt;br /&gt;
&lt;br /&gt;
See the page [https://shtools.oca.eu/shtools/www/man/python/pyshexpanddh.html SHExpandDH] for the detailed description of the expanding function and the page [https://shtools.oca.eu/shtools/www/conventions.html Real Spherical Harmonics] for mathematical definition.&lt;br /&gt;
&lt;br /&gt;
== Visualization of spherical harmonic modes using scipy ==&lt;br /&gt;
&lt;br /&gt;
We first import the necessary packages:&lt;br /&gt;
&lt;br /&gt;
 import numpy as np&lt;br /&gt;
 from scipy.special import sph_harm&lt;br /&gt;
 import matplotlib.pyplot as plt&lt;br /&gt;
 from matplotlib import cm, colors&lt;br /&gt;
 from mpl_toolkits.mplot3d import Axes3D&lt;br /&gt;
&lt;br /&gt;
For a certain pair of parameters (m, l), we can plot the corresponding spherical harmonic mode Y(l, m) on the surface of a unit sphere using scipy and matplotlib packages. Here we use the meshgrid THETA, PHI, X, Y, and Z we generated in the previous section:&lt;br /&gt;
&lt;br /&gt;
 fvalues = sph_harm(m, l, THETA, PHI).real  # Get the values of spherical harmonic functions&lt;br /&gt;
 fmax, fmin = fvalues.max(), fvalues.min()&lt;br /&gt;
 fcolors = (fvalues - fmin)/(fmax - fmin)    # normalize the values into range [0, 1]&lt;br /&gt;
&lt;br /&gt;
Then we plot Y(l, m) on a sphere:&lt;br /&gt;
&lt;br /&gt;
 fig = plt.figure(figsize=plt.figaspect(1.))  # make the axis with equal aspects&lt;br /&gt;
 ax = fig.add_subplot(111, projection=&#039;3d&#039;)   # add an subplot object with 3D plot&lt;br /&gt;
 ax.plot_surface(x, y, z,  rstride=1, cstride=1, facecolors=cm.Blues(fcolors))&lt;br /&gt;
 plt.show()&lt;br /&gt;
&lt;br /&gt;
For example, the figures for (l, m) = (2, 0), (3, 2), and (1, 1) are shown as below:&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Fig.1 Visualization of Spherical Harmonics&amp;quot; widths=&amp;quot;200px&amp;quot; heights=&amp;quot;200px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:sph_harm_Y20.png|(a) &amp;lt;math&amp;gt; Y_{20}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
Image:sph_harm_Y32.png|(b) &amp;lt;math&amp;gt; Y_{32}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
Image:sph_harm_Y11.png|(c) &amp;lt;math&amp;gt; Y_{11}(\theta,\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Yfwang09</name></author>
	</entry>
</feed>