from NanoLanguage import *

def Li_metal4(lattice_vector=3.43931245):
    # Set up lattice
    lattice = BodyCenteredCubic(lattice_vector*Angstrom)

    # Define elements
    elements = [Lithium]
    
    # Define coordinates
    fractional_coordinates = [[ 0.,  0.,  0.]]
    
    # Set up configuration
    bulk_configuration = BulkConfiguration(
        bravais_lattice=lattice,
        elements=elements,
        fractional_coordinates=fractional_coordinates
        )
    
    return bulk_configuration

def FePO4(a=9.914198,b=5.885501,c=4.860633):
    # Set up lattice
    lattice = SimpleOrthorhombic(a*Angstrom, b*Angstrom, c*Angstrom)

    # Define elements
    elements = [Iron, Iron, Iron, Iron, Phosphorus, Phosphorus, Phosphorus,
                Phosphorus, Oxygen, Oxygen, Oxygen, Oxygen, Oxygen, Oxygen, Oxygen,
                Oxygen, Oxygen, Oxygen, Oxygen, Oxygen, Oxygen, Oxygen, Oxygen,
                Oxygen]

    # Define coordinates
    fractional_coordinates = [[ 0.225944,  0.25    ,  0.549117],
                              [ 0.774056,  0.75    ,  0.450883],
                              [ 0.274056,  0.75    ,  0.049117],
                              [ 0.725944,  0.25    ,  0.950883],
                              [ 0.093816,  0.75    ,  0.598631],
                              [ 0.906184,  0.25    ,  0.401369],
                              [ 0.406184,  0.25    ,  0.098631],
                              [ 0.593816,  0.75    ,  0.901369],
                              [ 0.167108,  0.546205,  0.747213],
                              [ 0.832892,  0.453795,  0.252787],
                              [ 0.332892,  0.453795,  0.247213],
                              [ 0.667108,  0.546205,  0.752787],
                              [ 0.667108,  0.953795,  0.752787],
                              [ 0.332892,  0.046205,  0.247213],
                              [ 0.832892,  0.046205,  0.252787],
                              [ 0.167108,  0.953795,  0.747213],
                              [ 0.057218,  0.25    ,  0.346913],
                              [ 0.942782,  0.75    ,  0.653087],
                              [ 0.442782,  0.75    ,  0.846913],
                              [ 0.557218,  0.25    ,  0.153087],
                              [ 0.12032 ,  0.75    ,  0.288833],
                              [ 0.87968 ,  0.25    ,  0.711167],
                              [ 0.37968 ,  0.25    ,  0.788833],
                              [ 0.62032 ,  0.75    ,  0.211167]]   

    # Set up configuration
    bulk_configuration = BulkConfiguration(
        bravais_lattice=lattice,
        elements=elements,
        fractional_coordinates=fractional_coordinates
        )
        
    return bulk_configuration

def LiFePO4(a=10.23619605,b=5.9707551,c=4.65491719):
    # Set up lattice
    lattice = SimpleOrthorhombic(a*Angstrom, b*Angstrom, c*Angstrom)

    # Define elements
    elements = [Lithium, Lithium, Lithium, Lithium, Iron, Iron, Iron, Iron,
                Phosphorus, Phosphorus, Phosphorus, Phosphorus, Oxygen, Oxygen,
                Oxygen, Oxygen, Oxygen, Oxygen, Oxygen, Oxygen, Oxygen, Oxygen,
                Oxygen, Oxygen, Oxygen, Oxygen, Oxygen, Oxygen]

    # Define coordinates
    fractional_coordinates = [[ 0.        ,  0.        ,  0.        ],
                              [ 0.5       ,  0.        ,  0.5       ],
                              [ 0.5       ,  0.5       ,  0.5       ],
                              [ 0.        ,  0.5       ,  0.        ],
                              [ 0.21884873,  0.25      ,  0.52986573],
                              [ 0.78115127,  0.75      ,  0.47013427],
                              [ 0.28115127,  0.75      ,  0.02986573],
                              [ 0.71884873,  0.25      ,  0.97013427],
                              [ 0.0938663 ,  0.75      ,  0.58137743],
                              [ 0.9061337 ,  0.25      ,  0.41862257],
                              [ 0.4061337 ,  0.25      ,  0.08137743],
                              [ 0.5938663 ,  0.75      ,  0.91862257],
                              [ 0.16584548,  0.54555803,  0.71373534],
                              [ 0.83415452,  0.45444197,  0.28626466],
                              [ 0.33415452,  0.45444197,  0.21373534],
                              [ 0.66584548,  0.54555803,  0.78626466],
                              [ 0.66584548,  0.95444197,  0.78626466],
                              [ 0.33415452,  0.04555803,  0.21373534],
                              [ 0.83415452,  0.04555803,  0.28626466],
                              [ 0.16584548,  0.95444197,  0.71373534],
                              [ 0.04430856,  0.25      ,  0.29013555],
                              [ 0.95569144,  0.75      ,  0.70986445],
                              [ 0.45569144,  0.75      ,  0.79013555],
                              [ 0.54430856,  0.25      ,  0.20986445],
                              [ 0.09423067,  0.75      ,  0.25521344],
                              [ 0.90576933,  0.25      ,  0.74478656],
                              [ 0.40576933,  0.25      ,  0.75521344],
                              [ 0.59423067,  0.75      ,  0.24478656]]

    # Set up configuration
    bulk_configuration = BulkConfiguration(
        bravais_lattice=lattice,
        elements=elements,
        fractional_coordinates=fractional_coordinates
        )

    return bulk_configuration
