Skip to content

Commit 1bd2e9a

Browse files
Merge branch 'Diegom_sobol' of github.com:diegomartinez2/python-sscha into Diegom_sobol
2 parents 70cf55b + f53b505 commit 1bd2e9a

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

Modules/Relax.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
__RELAX_TARGET_PRESSURE__ = "target_pressure"
3333
__RELAX_FIXVOLUME__ = "fix_volume"
3434
__RELAX_BULK_MODULUS__ = "bulk_modulus"
35+
__RELAX_SOBOL__ = "sobol_sampling"
36+
__RELAX_SOBOL_SCATTER__ = "sobol_scatter"
3537

3638
__TYPE_SINGLE__ = "sscha"
3739
__TYPE_RELAX__ = "relax"
@@ -203,6 +205,14 @@ def setup_from_namelist(self, namelist):
203205
if __RELAX_FIXVOLUME__ in keys:
204206
self.fix_volume = bool(c_info[__RELAX_FIXVOLUME__])
205207

208+
# ****Diegom_test****
209+
self.sobol = False
210+
if __RELAX_SOBOL__ in keys:
211+
self.sobol = bool(c_info[__RELAX_SOBOL__])
212+
213+
self.sobol_scatter = 0.0
214+
if __RELAX_SOBOL_SCATTER__ in keys:
215+
self.sobol_scatter = np.float64(c_info[__RELAX_SOBOL_SCATTER__])
206216

207217
# Check the allowed keys
208218
for k in keys:
@@ -257,7 +267,7 @@ def setup_custom_functions(self, custom_function_pre = None,
257267

258268

259269
def relax(self, restart_from_ens = False, get_stress = False,
260-
ensemble_loc = None, start_pop = None, sobol = False, sobol_scramble = False, sobol_scatter = 0.0):
270+
ensemble_loc = None, start_pop = None, sobol = self.sobol, sobol_scramble = False, sobol_scatter = self.sobol_scatter):
261271
"""
262272
COSTANT VOLUME RELAX
263273
====================
@@ -382,7 +392,7 @@ def relax(self, restart_from_ens = False, get_stress = False,
382392
def vc_relax(self, target_press = 0, static_bulk_modulus = 100,
383393
restart_from_ens = False,
384394
ensemble_loc = None, start_pop = None, stress_numerical = False,
385-
cell_relax_algorithm = "sd", fix_volume = False, sobol = False, sobol_scramble = False, sobol_scatter = 0.0):
395+
cell_relax_algorithm = "sd", fix_volume = False, sobol = self.sobol, sobol_scramble = False, sobol_scatter = self.sobol_scatter):
386396
"""
387397
VARIABLE CELL RELAX
388398
====================

0 commit comments

Comments
 (0)