Commit 873d1338 authored by Sam Schoenholz's avatar Sam Schoenholz
Browse files

Added utility to compute bulk modulus.

parent 9a953fd7
......@@ -138,3 +138,7 @@ def pair_correlation(displacement_or_metric, rs, sigma):
def box_size_at_number_density(
particle_count, number_density, spatial_dimension):
return np.power(particle_count / number_density, 1 / spatial_dimension)
def bulk_modulus(elastic_tensor):
return np.einsum('iijj->', elastic_tensor) / elastic_tensor.shape[0] ** 2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment