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
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
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)






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
-
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 ↩