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.ANCHORED,
    anchor_atom_index=0,
    site_type='ontop_Platinum',
    distribution=Random
)
generator.addAnchorAtom(
    molecule_key='Water',
    atom_index=2,
    site_type='bridge',
    distribution=Random
)

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