a
     ɝh                      @   sH   d dl Z d dlZd dlmZ d dlZd dlZd dlZdd Zdd Z	dS )    N)Imagec                 C   sF   t | *}tjd|  ddd W d    n1 s80    Y  d S )Nz<style>z</style>Tunsafe_allow_html)openstmarkdownread)	file_namef r   $/var/www/html/AI4Kappa/Pages/home.py	local_css   s    
r   c                  C   s(  t jt jt jt} t j| d}t j|r>t| t	 . t
d td td W d    n1 sz0    Y  t	 . td td td W d    n1 s0    Y  t	  td td td	\}}|. td
 td td W d    n1 s00    Y  |. td td td W d    n1 st0    Y  W d    n1 s0    Y  t	 . td td td W d    n1 s0    Y  t	  td td td	\}}|$ td td W d    n1 sB0    Y  |$ td td W d    n1 s|0    Y  W d    n1 s0    Y  t	  td td t j| dd}t j|r^zBt|}|d}| }|  |d}tj|ddd W n6 tyZ }	 ztd|	  W Y d }	~	n
d }	~	0 0 ntd|  W d    n1 s0    Y  t	 6 td td  d!}
tj|
d"d# W d    n1 s0    Y  t	 , td d$}tj|d"d# W d    n1 s0    Y  d S )%Nzstyle/style.cssz2Welcome to Lattice Thermal Conductivity Calculatorz;A Powerful Tool for Lattice Thermal Conductivity PredictionaN  
            Lattice thermal conductivity is a crucial property that determines heat conduction in crystalline materials. 
            This application provides three advanced methods for calculating lattice thermal conductivity:
            - **KappaP**: Based on the Slack model
            - **PINK**: Based on an interpretable formula published in [Materials Today Physics](https://doi.org/10.1016/j.mtphys.2024.101549)
            - **Custom Calculator**: Allows you to input your own elastic parameters and calculate thermal conductivity using both models (up to 5 files)
            z---z
How to Usea=  
        1. **File Upload**
           - Upload your CIF files using the sidebar
           - Files must be in valid CIF format
        
        2. **Choose Method**
           - KappaP: Traditional Slack model approach
           - MTP: Materials Today Physics model
           - Custom Calculator: Combine both methods with your parameters (maximum 5 files)
        
        3. **Get Results**
           - Comprehensive output including:
             - Lattice thermal conductivity
             - Intermediate parameters
             - Crystal structure details
        zCalculation Methods   u   🔬 Physical Model (KappaP)a  
                - Based on the Slack model
                - Calculates lattice thermal conductivity using:
                    - Crystal structure parameters
                    - Elastic properties
                    - Thermal properties
                - Provides detailed intermediate results
                - Suitable for fundamental research and materials design
                z5\kappa_L = A\frac{M V^{1/3} \theta_a^3}{\gamma^2 T n}u(   🤖 PINK Model (Physics Informed Kappa)a  
                - Based on Physics Informed Kappa (PINK) model
                - Features:
                    - Fast prediction
                    - Physics-informed approach
                    - Handles complex structures
                - Derived from theoretical analysis in [Materials Today Physics](https://doi.org/10.1016/j.mtphys.2024.101549)
                - Ideal for rapid screening
                z6\kappa_L = \frac{G v_s V^{1/3}}{N T} \cdot e^{-\gamma}zCustom Calculatoru  
            Combine both KappaP and PINK methods with your own parameters:
            - Input your experimental/calculated parameters:
                - Bulk modulus
                - Shear modulus
                - Grüneisen parameter (optional)
            - Compare results between KappaP and PINK methods
            - Process multiple structures (up to 5 files)
            - Explore parameter sensitivity
            
            Perfect for researchers who:
            - Have their own measured/calculated parameters
            - Want to compare different calculation approaches
            - Need to process multiple structures efficiently
            zTechnical DetailszCalculated Propertiesua  
                - Basic structural properties
                    - Number of atoms
                    - Density
                    - Volume
                    - Total atomic mass
                - Mechanical properties
                    - Transverse sound velocity
                    - Longitude sound velocity
                    - Speed of sound
                    - Poisson ratio
                - Thermal properties
                    - Acoustic Debye temperature
                    - Grüneisen parameter
                    - Lattice thermal conductivity
                    
                zSupported File Formatsa+  
                - CIF (Crystallographic Information File)
                - Requirements:
                    - Valid crystal structure
                    - Complete atomic positions
                    - Proper space group information
                - Validation checks included
                zSoftware Certificateimageu   R20250315-软件证书.pdfr   pngi  )captionwidthzError processing PDF file: zCertificate file not found at: zContact Informationa  
        <p style='font-size: 18px;'>
        For questions, suggestions, or collaboration opportunities:<br><br>
        
        <b>Principal Investigator:</b><br>
        Prof. Zhibin Gao<br>
        Email: zhibin.gao@xjtu.edu.cn<br>
        Website: <a href="https://gr.xjtu.edu.cn/web/zhibin.gao">https://gr.xjtu.edu.cn/web/zhibin.gao</a><br><br>
        
        <b>Technical Support:</b><br>
        Yujie Liu<br>
        Email: liu_yujie@stu.xjtu.edu.cn
        </p>
        Tr   a  
        <p style='font-size: 18px;'>
        We strive to provide clear documentation and examples to help users effectively utilize our lattice thermal conductivity calculation tools. 
        While we are happy to address issues in the documentation and examples, please note that extensive user support 
        and training are primarily available to our collaborators.
        </p>
        )ospathdirnameabspath__file__joinexistsr   r   	containertitle	subheaderwriteheadercolumnslatexfitzr   Z	load_pageZ
get_pixmapclosetobytesr   	Exceptionerrorwarningr   )Zproject_rootr	   col1col2Z	cert_pathdocpageZpix	img_byteseZcontact_infodeclarationr   r   r   app   s    


"


(



*
J


$



$
D





(0


.

r.   )
r   	streamlitr   PILr   base64r!   ior   r.   r   r   r   r   <module>   s   