jochym / Elastic

A module for ASE for elastic constants calculation.
GNU General Public License v3.0
35 stars 23 forks source link

Inconsistent treatment of strain throughout the code #64

Open yuzie007 opened 5 months ago

yuzie007 commented 5 months ago

First of all, thank you so much @jochym for sharing your Elastic code with the community.

Here I would like to report my concern about the convention of strain in the code.

To my best knowledge, in the common definition of the Voigt notation for strain, the strain values $\epsilon_1, \cdots, \epsilon_6$ are related to the tensor components as follows,

$$ \begin{pmatrix} \epsilon{11} & \epsilon{12} & \epsilon{13} \ \epsilon{21} & \epsilon{22} & \epsilon{23} \ \epsilon{31} & \epsilon{32} & \epsilon{33} \end{pmatrix} = \begin{pmatrix} \epsilon{1} & \epsilon{6} / 2 & \epsilon{5} / 2 \ \epsilon{6} / 2 & \epsilon{2} & \epsilon{4} / 2 \ \epsilon{5} / 2 & \epsilon{4} / 2 & \epsilon{3} \end{pmatrix}, $$

i.e., $\epsilon4 = 2 \epsilon{23}$, where we have the coefficient 2. This is different from the convention for the stress (without the coefficient 2). Formally, the shear components in the Voigt notation are equal to “engineering” shear strains. At least in the context of elastic properties, the Voigt notation is not just replacements of indices. And, the common stress-strain relation like (for cubic):

$$ \begin{align} \begin{pmatrix} \sigma{1} \ \sigma{2} \ \sigma{3} \ \sigma{4} \ \sigma{5} \ \sigma{6} \ \end{pmatrix} &= \begin{pmatrix} B{11} & B{12} & B{12} & 0 & 0 & 0 \ B{12} & B{11} & B{12} & 0 & 0 & 0 \ B{12} & B{12} & B{11} & 0 & 0 & 0 \ 0 & 0 & 0 & B{44} & 0 & 0 \ 0 & 0 & 0 & 0 & B{44} & 0 \ 0 & 0 & 0 & 0 & 0 & B{44} \ \end{pmatrix} \begin{pmatrix} \epsilon{1} \ \epsilon{2} \ \epsilon{3} \ \epsilon{4} \ \epsilon{5} \ \epsilon{6} \ \end{pmatrix} \end{align} $$

is written using the above common Voigt notation. I confirmed these points with several textbooks (Nye and Grimvall).

My concern is that the strain treatment is not well consistent through the code. Specifically,

Particularly for the non-Voigt convention of get_strain may cause confusion for readers in realistic cases:

To demonstrate the issue, I made a test using ASE EMT potential Cu_EMT.zip:

To solve the issue, I wish to suggest:

It would be very appreciated if you kindly think of these points above. Thank you so much for your help in advance.

jochym commented 5 months ago

@yuzie007 Thank you for pointing out potential problems. The stress notations are indeed confusing. I believe I have followed L&L conventions. Nevertheless, I will review your comments and also your proposed modifications. I will get back to you.

yuzie007 commented 5 months ago

Thank you very much @jochym for your prompt and kind response! It would be very helpful if you cross-check.

jochym commented 5 months ago

@yuzie007 It seems you are right regarding the inconsistency of the code vs. textbook definition of the Voight notation. I still believe I have followed L&L conventions (except for errors ;), but they are indeed confusing. I think the code is internally consistent, but should be corrected to follow textbook definitions. My proposal is as follows: I will update the build/publishing system to follow modern standards. Then, as a first new release, I will publish the fixed code (tetragonal and hexagonal coeff.). Then, I will work on changing the convention to the new one. If you would like to help with this, I will naturally be happy to accept pull requests or any other input.

yuzie007 commented 5 months ago

Thank you so much @jochym for the kind and careful review. I agree on the procedure you suggested. It would be really helpful for myself as well as any other users if Elastic has a new release with fixed hexagonal and tetragonal coefficients as well as new conventions. I would be very happy if I can help something for new releases. I actually have a few things in mind, but before opening issues I would like to check by myself.