Skip to content

mengtongwqh/CGpaper

 
 

Repository files navigation

====================================================================================== ReadMe.txt for the package

This MATLAB package is provided as a supplementary material for

An optimal scheme for numerical evaluation of Eshelby tensors and its implementation in a MATLAB package for simulating the motion of viscous ellipsoids in slow flows Mengmeng Qu, Dazhi Jiang, Lucy X. Lu Computers & Geosciences Volume 96, November 2016, Pages 98–108

Publications and/or presentations using this, or derived, code to produce figures or other content should cite this paper. An acknowledgment for the use of this code is also appreciated.

Please let us know about any bug or error: [email protected] [email protected] [email protected]

May 2016

NOTES

  1. The MATLAB functions are wrriten in MATLAB version R2015a;

  2. Before executing these functions, one needs to add all folders and subfolders to current path in MATLAB;

  3. "partTGL.mexw64" and "partTLeb.mexw64" in "Routines" are two MEX(MATLAB Executable) files, written in C language and then compiled using the MATLAB's built-in mex function and the Microsoft Visual C++ 2015 compiler on Win64 platform using MATLAB version R2016a. So if your default C/C++ compiler in MATLAB and/or the platform and/or the MATLAB version are different from above, the compiled files (i.e.,"partTGL.mexw64" and "partTLeb.mexw64") may not run properly. You need to re-compile the C codes:

    Step 1. Open MATLAB, and type the following command in MATLAB command window,

        >> mex -setup
        
        mex will locate the installed compilers and choose a default compiler. 
        If you do not have an avialable compiler installed on your machine, you can
        visit the Mathworks website and check the supported compilers for your MATLAB
        (google "supported compilers for MATLAB version####"). Install a compiler, and
        then re-do Step 1.
    

    Step 2. Set the sudfolder "C codes" in "Routines" as the current folder in the MATLAB toolbar. You will see the two C codes (partTGL.c, partTLeb.c) in the MATLAB current folder.

    Step 3. Compile the two C codes by running the following command in the command window,

        >> mex partTGL.c
        >> mex partTLeb.c
    
        The c-mex invokes the selected compiler to compile, link, and generate the 
        binaries, "partTGL.mex###" and "partTLeb.mex###". 	
    

    Step 4. Copy the new mex files, "partTGL.mex###" and "partTLeb.mex###", to the folder "Routines", and delete the previous "partTGL.mexw64" and "partTLeb.mexw64".

    Step 5. Add all folders and subfolders to current path in MATLAB, and have fun! :)

  4. You can run the two functions ("DEFval.m", "RGDval.m") in the folder "Validations", and obtain the Figs.7&8 in the paper.

  5. You can run SGLRGD and SLGDEF without changing inputs, and obtain the Figs.9&10 in the paper.

  6. The initial uniformly-distributed orientations and shapes of ellipsoids, used for running the two multiple inclusion functions (MLTRGD and MLTDEF), were generated following the method of Jiang(2007a) (“RandAANG.m” in “Routines”). If one wants to use some special inputs of shapes and orientations of ellipsoids, one can simply delete the “RandAANG” line in MLTRGD or MLTDEF, and use the new inputs.

About

The matlab package for the CG paper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • MATLAB 95.0%
  • C 5.0%