from example_configurations import substrate, water

# -------------------------------------------------------------
# Create surface with adsorbed molecules.
# -------------------------------------------------------------
# Instantiate the AdsorbedSurfaceGenerator with the substrate and find adsorption sites.
generator = AdsorbedSurfaceGenerator(
    substrate=substrate,
    search_depth=0.9 * Angstrom,
    distance=1.0 * Angstrom,
    grouping_precision=1.0
)

# Add molecules.
generator.addMolecule(
    molecule_key='Water',
    molecule=water,
    count=9,
    orientation=ORIENTATIONS.VERTICAL,
    anchor_atom_index=1,
    site_type='ontop_Platinum',
    distribution=Random
)

# Generate a configuration with the molecules adsorbed to the substrate surface.
configuration = generator.generateAdsorbedSurface()
