Skip to content

Note

Click here to download the full example code

Gu et al. (2017)

Anisotropic elasticity of Toyoura sand 1.

import pandas as pd

from micromechanical.cli.plot import PlotCLI, PlotConfig

config: PlotConfig = PlotCLI.loadConfig("../../calibrations/micromechanical-plots.yaml")

Out:

/home/runner/work/micromechanical/micromechanical/micromechanical/cli/plot.py:52: UserWarning: Calibration file /home/runner/work/micromechanical/micromechanical/calibrations/Calibrations/Gu2024-CT-Dense-Static.json not found, skipping.
  warnings.warn(f"Calibration file {path.as_posix()} not found, skipping.")
/home/runner/work/micromechanical/micromechanical/micromechanical/cli/plot.py:52: UserWarning: Calibration file /home/runner/work/micromechanical/micromechanical/calibrations/Calibrations/Gu2024-CT-Dense-Kinematic.json not found, skipping.
  warnings.warn(f"Calibration file {path.as_posix()} not found, skipping.")
/home/runner/work/micromechanical/micromechanical/micromechanical/cli/plot.py:52: UserWarning: Calibration file /home/runner/work/micromechanical/micromechanical/calibrations/Calibrations/Gu2024-CT-Medium-Dense-Static.json not found, skipping.
  warnings.warn(f"Calibration file {path.as_posix()} not found, skipping.")
/home/runner/work/micromechanical/micromechanical/micromechanical/cli/plot.py:52: UserWarning: Calibration file /home/runner/work/micromechanical/micromechanical/calibrations/Calibrations/Gu2024-CT-Medium-Dense-Kinematic.json not found, skipping.
  warnings.warn(f"Calibration file {path.as_posix()} not found, skipping.")

Kinematic Hypothesis

plot_name = "Gu2017-Isotropic-Kinematic"
plot_config = config.plots[plot_name]
pd.DataFrame(
    {
        key.replace("micromechanical.calibrationkey:MaterialFabricCoefficientKey(car,F)", "F"): value
        for key, value in plot_config.calibration.read(config.root).parameters.items()
        if key not in ["F1", "F2", "F12", "F13", "F23", "sigc", "sig1", "sig2", "sig3", "cc", "ncc", "force_numerical",
                       "force_dependent_stiffness", "major_axes", "voigt_notation", "unit",
                       "car", "car_anisotropy_type", "car_anisotropy_major_axes"]
    },
    index=["Gu2017"],
)  # fmt: skip
CN0 Gg cr kn krr F n npv nr nug radius
Gu2017 5.937076 4.779100e+10 6.090662 80.0 1.203 1.254599 0.351 2.000000e+11 0.425 0.2 0.000108

Static Hypothesis

plot_name = "Gu2017-Isotropic-Static"
plot_config = config.plots[plot_name]
pd.DataFrame(
    {
        key.replace("micromechanical.calibrationkey:MaterialFabricCoefficientKey(car,F)", "F"): value
        for key, value in plot_config.calibration.read(config.root).parameters.items()
        if key not in ["F1", "F2", "F12", "F13", "F23", "sigc", "sig1", "sig2", "sig3", "cc", "ncc", "force_numerical",
                       "force_dependent_stiffness", "major_axes", "voigt_notation", "unit",
                       "car", "car_anisotropy_type", "car_anisotropy_major_axes"]
    },
    index=["Gu2017"],
)  # fmt: skip
CN0 Gg cr kn krr F n npv nr nug radius
Gu2017 5.937076 4.779100e+10 2.776362 80.0 0.993 1.216263 0.351 2.000000e+11 0.396 0.2 0.000108

Figures

for plot_name, plot_config in config.plots.items():
    if not plot_name.startswith("Gu2017"):
        continue

    plot_config.plot(plot_name, grids=config.grids, save=False, overwrite=False)
    (a), (b)(a), (b)(a), (b)plot gu2017(a), (b)(a), (b)

Total running time of the script: ( 0 minutes 25.644 seconds)

Download Python source code: plot_gu2017.py

Download Jupyter notebook: plot_gu2017.ipynb

Gallery generated by mkdocs-gallery


  1. Gu, X., Hu, J., & Huang, M. (2017). Anisotropy of elasticity and fabric of granular soils. Granular Matter, 19(2), 33. https://doi.org/10.1007/s10035-017-0717-6