Esempio n. 1
0
int main () {
  //PDBFile pdb ("quartz_100_short.pdb");
  PDBFile pdb ("beta-cristobalite.pdb");

  // create the quartz unitcell
  Molecule * uc = pdb.Molecules(0);

  //make copies of the quartz unitcell and shift them around
  //VecR x_shift (4.91, 0.0, 0.0);
  VecR x_shift (10.0, 0.0, 0.0);
  VecR y_shift (0.0, 10.0, 0.0);
  VecR z_shift (0.0, 0.0, 0.0);

  // Create the slab by creating and shifting copies of the unit cell
  Mol_ptr_vec mols = UnitCellToSlab(uc, x_shift, y_shift, z_shift);

  Molecule * mol = MakeSingleMolecule (mols);

  //AddDanglingHydrogens (mol);

  // Take care of renaming the atoms and the residue before printing it out
  FixSingleMoleculeNaming (mol);

  PrintMoleculePDB (mol);

  return 0;
}
Esempio n. 2
0
int main () {

  PDBFile pdb ("temp.pdb");

  Molecule * mol = pdb.Molecules(0);
  mol->Name("qtz");
  std::vector<Atom *> atoms = mol->Atoms();

  /* cycle through each atom in order of the pdb file */
  RUN (atoms)
  {
	Atom * atom = atoms[i];
	atom->Residue("qtz");
	VecR pos = atom->Position();

	/* find the surface Oxygens */
	if (atom->Name().find("O") != string::npos && pos[z] > -7.9)
	{
	  /* add H's to the surface */
	  Atom * h = new Atom ("H", pos + VecR (0.0, 0.0, 1.1));
	  mol->AddAtom(h);
	}
  }
  std::vector<Molecule *> mols;
  mols.push_back(mol);
  PDBFile::WritePDB(mols);
}
Esempio n. 3
0
int main () {
  // The unitcell's PDB file - must have a "TER" after the residue
  PDBFile pdb ("octadecane.pdb");
  string name = "odn";
  double spacing = 5.528;	// inter-chain spacing

  GridParams params (pdb.Molecules(0), name, spacing, 7, 1, 6);

  // Create the slab by creating and shifting copies of the unit cell
  Mol_ptr_vec mols = UnitCellToSlab(params);

  //Molecule * mol = MakeSingleMolecule (params);

  //AddDanglingHydrogens (params);

  // Take care of renaming the atoms and the residue before printing it out
  //FixSingleMoleculeNaming (params);

  PrintMoleculesPDB (mols);

  return 0;
}