Skip to content

Commit 42ecf32

Browse files
Add elasticity calculation (#621)
Co-authored-by: Elliott Kasoar <45317199+ElliottKasoar@users.noreply.github.com>
1 parent 895305b commit 42ecf32

File tree

18 files changed

+1890
-1
lines changed

18 files changed

+1890
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ Current and planned features include:
115115
- MACE
116116
- [x] Rare events simulations
117117
- PLUMED
118+
- [x] Elasticity
118119

119120

120121
## Python interface
@@ -154,6 +155,7 @@ directory. This currently includes examples for:
154155

155156
- [Nudged Elastic Band](docs/source/tutorials/python/neb.ipynb) [![badge](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/stfc/janus-core/blob/main/docs/source/tutorials/python/neb.ipynb)
156157

158+
- [Elasticity](docs/source/tutorials/python/elasticity.ipynb) [![badge](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/stfc/janus-core/blob/main/docs/source/tutorials/python/elasticity.ipynb)
157159

158160
### Calculation outputs
159161

@@ -221,6 +223,7 @@ janus neb
221223
janus train
222224
janus descriptors
223225
janus preprocess
226+
janus elasticity
224227
```
225228

226229
For example, a single point calcuation (using the [MACE-MP](https://github.com/ACEsuit/mace-mp) "small" force-field) can be performed by running:
@@ -321,7 +324,7 @@ This currently includes examples for:
321324

322325
- [Nudged Elastic Band](docs/source/tutorials/cli/neb.ipynb) [![badge](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/stfc/janus-core/blob/main/docs/source/tutorials/cli/neb.ipynb)
323326

324-
327+
- [Elasticity](docs/source/tutorials/cli/elasticity.ipynb) [![badge](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/stfc/janus-core/blob/main/docs/source/tutorials/cli/elasticity.ipynb)
325328

326329
### Using configuration files
327330

docs/source/apidoc/janus_core.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ janus\_core.calculations.eos module
4444
:undoc-members:
4545
:show-inheritance:
4646

47+
janus\_core.calculations.elasticity module
48+
------------------------------------------
49+
50+
.. automodule:: janus_core.calculations.elasticity
51+
:members:
52+
:special-members:
53+
:private-members:
54+
:undoc-members:
55+
:show-inheritance:
56+
4757
janus\_core.calculations.geom\_opt module
4858
-----------------------------------------
4959

@@ -117,6 +127,17 @@ janus\_core.cli.eos module
117127
:undoc-members:
118128
:show-inheritance:
119129

130+
janus\_core.cli.elasticity module
131+
---------------------------------
132+
133+
.. automodule:: janus_core.cli.elasticity
134+
:members:
135+
:special-members:
136+
:private-members:
137+
:undoc-members:
138+
:show-inheritance:
139+
140+
120141
janus\_core.cli.geomopt module
121142
------------------------------
122143

docs/source/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"torch": ("https://pytorch.org/docs/stable", None),
5858
"matplotlib": ("https://matplotlib.org/stable/", None),
5959
"rich": ("https://rich.readthedocs.io/en/stable/", None),
60+
"pymatgen": ("https://pymatgen.org",None),
6061
}
6162

6263
# Add any paths that contain templates here, relative to this directory.
@@ -244,4 +245,5 @@
244245
("py:class", "ProgressBar"),
245246
("py:class", "typer.models.CallbackParam"),
246247
("py:class", "SumCalculator"),
248+
("py:class", "ElasticTensor"),
247249
]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
==========
2+
Elasticity
3+
==========
4+
5+
A minimal example configuration file for ``janus elasticity`` is:
6+
7+
.. literalinclude:: minimal/elasticity.yml
8+
9+
An example configuration file with all parameters set for ``janus elasticity`` is:
10+
11+
.. literalinclude:: full/elasticity.yml
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
arch: mace_mp
2+
device: cpu
3+
model: "tests/models/mace_mp_small.model"
4+
calc_kwargs:
5+
dispersion: True
6+
7+
struct: "tests/data/NaCl.cif"
8+
fmax: 0.1
9+
log: null
10+
minimize: true
11+
minimize_all: true
12+
minimize_kwargs:
13+
filter_kwargs:
14+
constant_volume: True
15+
16+
n_strains: 2
17+
normal_magnitude: 0.01
18+
shear_magnitude: 0.1
19+
20+
file_prefix: NaCl
21+
write_structures: true
22+
write_voigt: true
23+
read_kwargs:
24+
index: "0"
25+
write_kwargs:
26+
invalidate_calc: True
27+
28+
log: elasticity-log.yml
29+
summary: elasticity-summary.yml
30+
tracker: False

docs/source/examples/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ Example configurations
1212
eos
1313
neb
1414
descriptors
15+
elasticity
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
arch: mace_mp
2+
3+
struct: "tests/data/NaCl.cif"

0 commit comments

Comments
 (0)