pyiron.atomistics.master.elastic module¶
-
class
pyiron.atomistics.master.elastic.
ElasticTensor
(project, job_name)[source]¶ Bases:
pyiron.atomistics.master.parallel.AtomisticParallelMaster
Class to calculate the elastic tensor and isotropic elastic constants.
Example:
>>> job = pr.create_job('SomeAtomisticJob', 'atomistic') >>> job.structure = pr.create_structure('Fe', 'bcc', 2.83) >>> elastic = job.create_job('ElasticTensor', 'elastic') >>> elastic.run()
Input parameters:
- min_num_measurements (int): Minimum number of measurements/simulations
to be launched
- min_num_points (int): Minimum number of data points to fit data
(number of measurements times number of symmetry operations)
polynomial_order (int): Polynomial order to use (default: 2) additional_points (int): Additional points for linearly dependent
strains. Twice the number of strains will be created for +-strain. If additional_points > 0, polynomial order should be at least 3.
- strain_matrices (numpy.ndarray): Strain tensors to be applied on
simulation boxes (optional)
rotations (numpy.ndarray): Rotation matrices for box symmetry normalize_magnitude (bool): Whether to normalize strains following
Frobenius norm or not. When polynomial_order = 2, strains should not be normalized in order for the fit to get both large and small strains. When polynomial order > 2, then they should be normalized to not get too small strains which could destabilize higher order fitting.
- use_symmetry (bool): Whether or not exploit box symmetry (ignored if
rotations already specified)
- use_elements (bool): Whether or not respect chemical elements for box
symmetry (ignored if rotations already specified)
- fit_first_order (bool): Whether or not fit first order strains. In
principle it should not be necessary, but might stabilize the calculation if the reference structure is not exactly in the zero pressure state. Setting this to True does not correct the second order strains
The default input parameters might not be chosen adequately. If you have a large computation power, increase min_num_measurements. At the same time, make sure to choose an orientation which maximizes the number symmetry operations. Also if the child job does not support pressure, better increase the number of measurements - without pressure the constants must be fit to total cell energies, which contain only a fraction of the data that the pressure matrix does. This lack can be compensated by sampling more rotations.
-
pyiron.atomistics.master.elastic.
calc_elastic_tensor
(strain, stress=None, energy=None, volume=None, rotations=None, return_score=False, max_polynomial_order=None, fit_first_order=False)[source]¶ Calculate 6x6-elastic tensor from the strain and stress or strain and energy+volume.
Rotations matrices can be added to take box symmetries into account (unit matrix can be added but does not have to be included in the list)
- Parameters
strain (numpy.ndarray) – nx3x3 strain tensors
stress (numpy.ndarray) – nx3x3 stress tensors
energy (numpy.ndarray) – n energy values
volume (numpy.ndarray) – n volume values
rotations (numpy.ndarray) – mx3x3 rotation matrices
return_score (numpy.ndarray) – return regression score (cf. sklearn.linear_mode.LinearRegression)
-
pyiron.atomistics.master.elastic.
get_strain
(max_strain=0.05, n_set=10, polynomial_order=2, additional_points=0, normalize=False)[source]¶ - Parameters
max_strain (float) – Maximum strain (for each component)
n_set (int) – Number of strain values to return
polynomial_order (int) – This value determines the number of linear-dependent strain values. For a polynomial order of two, there will be +-strain and for 3, there will be +-strain and +-0.5*strain etc.
additional_points (int) – Additional linear-dependent points
normalize (bool) – Whether to normalize the strain values. If True, the norm (Frobenius norm) of all outer most strain (i.e. the greatest strain within the linear-dependent strains) will be equal to max_strain
Returns: numpy.ndarray of strains (n, 3, 3)