santex.material package#

Submodules#

santex.material.material module#

class santex.material.material.Material(database_path='/home/docs/checkouts/readthedocs.org/user_builds/santex/envs/latest/lib/python3.9/site-packages/santex/material/data/materials_database.json', database_path2='/home/docs/checkouts/readthedocs.org/user_builds/santex/envs/latest/lib/python3.9/site-packages/santex/material/data/derivatives_P.json', database_path3='/home/docs/checkouts/readthedocs.org/user_builds/santex/envs/latest/lib/python3.9/site-packages/santex/material/data/derivatives_T.json')#

Bases: object

available_crystal_systems()#

Generate a formatted table listing available crystal systems along with their associated phases.

Returns: - str: A formatted table listing available crystal systems.

available_phases()#

Generate a formatted table listing available phases along with their crystal systems and primary phases.

Returns: - str: A formatted table listing available phases.

available_primary_phases()#

Generate a formatted table listing available primary phases along with their crystal systems and phases.

Returns: - str: A formatted table listing available primary phases.

get_pressure_properties_by_phase(phase)#

Get the pressure properties of a material based on the given phase.

Parameters: - phase (str): The phase of the material.

Returns: - dict or None: The pressure properties or None if not found.

get_properties_by_phase(phase)#

Get the properties of a material based on the given phase.

Parameters: - phase (str): The phase of the material.

Returns: - dict or None: The properties of the material or None if not found.

get_temperature_properties_by_phase(phase)#

Get the temperature properties of a material based on the given phase.

Parameters: - phase (str): The phase of the material.

Returns: - dict or None: The temperature properties or None if not found.

get_voigt_matrix(phase)#

Calculate and return the Voigt matrix of a material based on the given phase.

Parameters: - phase (str): The phase of the material.

Returns: - numpy array or None: The Voigt matrix or None if data not available.

get_voigt_matrix_pressure(phase)#
get_voigt_matrix_temperature(phase)#
load_density(phase, pressure=None, temperature=None)#

Load the density of a material based on the given phase.

Parameters: - phase (str): The phase of the material. - pressure (float or None): The pressure in MPa (optional). - temperature (float or None): The temperature in Kelvin (optional).

Returns: - float or None: The density in g/cm³ or None if data not available.

load_materials_data(database_path)#

Load materials data from a JSON file.

Parameters: - database_path (str): The file path to the materials database JSON file.

Returns: - dict: A dictionary containing the loaded materials data.

load_pressure_deriv(database_path2)#

Load pressure derivatives from a JSON file.

Parameters: - database_path (str): The file path to the pressure derivatives JSON file.

Returns: - dict: A dictionary containing the loaded pressure derivatives data.

load_temperature_deriv(database_path3)#

Load temperature derivatives from a JSON file.

Parameters: - database_path (str): The file path to the temperature derivatives JSON file.

Returns: - dict: A dictionary containing the loaded temperature derivatives data.

modal_rock(rock, fraction, pressure, temperature, melt=0)#

Calculate the average Voigt matrix and density of a rock composed of multiple minerals.

Parameters: - rock (list): An array of minerals. - fraction (list): Fractions corresponding to each mineral in the rock. - pressure (float): The pressure in MPa. - temperature (float): The temperature in Kelvin. - melt (float): Amount of melting (default 0).

Returns: - tuple: Average Voigt matrix as a numpy array and average density as a float.

# Rock is an array of minerals and fraction is another array corresponding to the particular phase. eg. rock = [“Forsterite”, “Diopside”, “Enstatite”], fraction = [0.2, 0.5, 0.3]

modal_rock_from_excel(excel_path, pressure, temperature, melt=0)#

Calculate the average Voigt matrix and density of rocks from an Excel worksheet.

Parameters: - excel_path (str): Path to the Excel worksheet. - pressure (float): The pressure in MPa. - temperature (float): The temperature in Kelvin. - melt (float): Amount of melting (default 0).

Returns: - tuple: Average Voigt matrix as a numpy array and average density as a float.

voigt_high_PT(phase, PRESSURE=0, TEMP=300)#

Perform calculations to obtain the Voigt matrix at high pressure and temperature conditions.

Parameters: - phase (str): The phase of the material. - PRESSURE (float): The pressure in MPa (default 0). - TEMP (float): The temperature in Kelvin (default 300).

Returns: - numpy array or None: The calculated Voigt matrix or None if data not available.

Module contents#