本文整理汇总了C++中OBAtom::GetZ方法的典型用法代码示例。如果您正苦于以下问题:C++ OBAtom::GetZ方法的具体用法?C++ OBAtom::GetZ怎么用?C++ OBAtom::GetZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OBAtom
的用法示例。
在下文中一共展示了OBAtom::GetZ方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteMolecule
bool JaguarInputFormat::WriteMolecule(OBBase* pOb, OBConversion* pConv)
{
OBMol* pmol = dynamic_cast<OBMol*>(pOb);
if(pmol==NULL) return false;
//Define some references so we can use the old parameter names
ostream &ofs = *pConv->GetOutStream();
OBMol &mol = *pmol;
unsigned int i;
char buffer[BUFF_SIZE];
OBAtom *atom;
ofs << mol.GetTitle() << endl << endl;
ofs << "&gen" << endl;
ofs << "&" << endl;
ofs << "&zmat" << endl;
for (i = 1;i <= mol.NumAtoms(); i++)
{
atom = mol.GetAtom(i);
snprintf(buffer, BUFF_SIZE, " %s%d %12.7f %12.7f %12.7f",
etab.GetSymbol(atom->GetAtomicNum()), i,
atom->GetX(),
atom->GetY(),
atom->GetZ());
ofs << buffer << endl;
}
ofs << "&" << endl;
return(true);
}
示例2: WriteXYZ
bool WriteXYZ(ostream &ofs,OBMol &mol)
{
unsigned int i;
char buffer[BUFF_SIZE];
sprintf(buffer,"%d", mol.NumAtoms());
ofs << buffer << endl;
sprintf(buffer,"%s\tEnergy: %15.7f", mol.GetTitle(), mol.GetEnergy());
ofs << buffer << endl;
OBAtom *atom;
string str,str1;
for(i = 1;i <= mol.NumAtoms(); i++)
{
atom = mol.GetAtom(i);
sprintf(buffer,"%3s%15.5f%15.5f%15.5f",
etab.GetSymbol(atom->GetAtomicNum()),
atom->GetX(),
atom->GetY(),
atom->GetZ());
ofs << buffer << endl;
}
return(true);
}
示例3: WriteViewMol
bool WriteViewMol(ostream &ofs,OBMol &mol)
{
unsigned int i;
char buffer[BUFF_SIZE];
if (strlen(mol.GetTitle()) > 0)
ofs << "$title" << endl << mol.GetTitle() << endl;
ofs << "$coord 1.0" << endl;
OBAtom *atom;
for(i = 1;i <= mol.NumAtoms(); i++)
{
atom = mol.GetAtom(i);
sprintf(buffer,"%22.14f%22.14f%22.14f %s",
atom->GetX(),
atom->GetY(),
atom->GetZ(),
etab.GetSymbol(atom->GetAtomicNum()));
ofs << buffer << endl;
}
ofs << "$end" << endl;
return(true);
}
示例4: WriteMolecule
bool PQSFormat::WriteMolecule(OBBase* pOb, OBConversion* pConv)
{
OBMol* pmol = dynamic_cast<OBMol*>(pOb);
if(pmol==NULL)
return false;
//Define some references so we can use the old parameter names
ostream &ofs = *pConv->GetOutStream();
OBMol &mol = *pmol;
unsigned int i;
char buffer[BUFF_SIZE];
OBAtom *atom;
ofs<<"TEXT="<<mol.GetTitle()<<endl;
ofs<<"GEOM=PQS"<<endl;
for (i=1; i<=mol.NumAtoms(); i++)
{
atom=mol.GetAtom(i);
snprintf(buffer, BUFF_SIZE, "%s %10.6lf %10.6lf %10.6lf",
OBElements::GetSymbol(atom->GetAtomicNum()),
atom->GetX(),
atom->GetY(),
atom->GetZ());
ofs<<buffer<<endl;
}
return(true);
}
示例5: WriteMolecule
bool TurbomoleFormat::WriteMolecule(OBBase* pOb, OBConversion* pConv)
{
OBMol* pmol = dynamic_cast<OBMol*>(pOb);
if(pmol==NULL)
return false;
//Define some references so we can use the old parameter names
ostream &ofs = *pConv->GetOutStream();
OBMol &mol = *pmol;
double UnitConv=AAU;
if(pConv->IsOption("a"))
UnitConv=1;
ofs << "$coord" <<endl;
char buffer[BUFF_SIZE];
OBAtom *atom;
vector<OBAtom*>::iterator i;
for (atom = mol.BeginAtom(i);atom;atom = mol.NextAtom(i))
{
char symb[8];
strcpy(symb,OBElements::GetSymbol(atom->GetAtomicNum()));
snprintf(buffer, BUFF_SIZE, "%20.14f %20.14f %20.14f %s",
atom->GetX()/UnitConv,
atom->GetY()/UnitConv,
atom->GetZ()/UnitConv,
strlwr(symb) );
ofs << buffer << endl;
}
ofs << "$end" << endl;
return true;
}
示例6: WriteAlchemy
bool WriteAlchemy(ostream &ofs,OBMol &mol)
{
unsigned int i;
char buffer[BUFF_SIZE];
char bond_string[10];
snprintf(buffer, BUFF_SIZE, "%5d ATOMS, %5d BONDS, 0 CHARGES",
mol.NumAtoms(),
mol.NumBonds());
ofs << buffer << endl;
ttab.SetFromType("INT"); ttab.SetToType("ALC");
OBAtom *atom;
string str,str1;
for(i = 1;i <= mol.NumAtoms(); i++)
{
atom = mol.GetAtom(i);
str = atom->GetType();
ttab.Translate(str1,str);
snprintf(buffer, BUFF_SIZE, "%5d %-6s%8.4f %8.4f %8.4f 0.0000",
i,
(char*)str1.c_str(),
atom->GetX(),
atom->GetY(),
atom->GetZ());
ofs << buffer << endl;
}
OBBond *bond;
vector<OBEdgeBase*>::iterator j;
for (bond = mol.BeginBond(j);bond;bond = mol.NextBond(j))
{
switch(bond->GetBO())
{
case 1 : strcpy(bond_string,"SINGLE"); break;
case 2 : strcpy(bond_string,"DOUBLE"); break;
case 3 : strcpy(bond_string,"TRIPLE"); break;
case 5 : strcpy(bond_string,"AROMATIC"); break;
default : strcpy(bond_string,"SINGLE");
}
snprintf(buffer, BUFF_SIZE, "%5d %4d %4d %s",
bond->GetIdx()+1,
bond->GetBeginAtomIdx(),
bond->GetEndAtomIdx(),
bond_string);
ofs << buffer << endl;
}
return(true);
}
示例7: atomPos
BoundingBox
NXOpenGLRenderingEngine::GetBoundingBox(OBMol *const molPtr)
{
BoundingBox bbox;
OBAtomIterator atomIter;
OBAtom *atomPtr = NULL;
for(atomPtr = molPtr->BeginAtom(atomIter);
atomPtr != NULL;
atomPtr = molPtr->NextAtom(atomIter))
{
Vector atomPos(real(atomPtr->GetX()),
real(atomPtr->GetY()),
real(atomPtr->GetZ()));
bbox += atomPos;
}
return bbox;
}
示例8: WriteHIN
bool WriteHIN(ostream &ofs,OBMol &mol)
{
unsigned int i, file_num = 1;
string str,str1;
char buffer[BUFF_SIZE];
OBAtom *atom;
OBBond *bond;
vector<OBEdgeBase*>::iterator j;
char bond_char;
ofs << "mol " << file_num << " " << mol.GetTitle() << endl;;
for(i = 1;i <= mol.NumAtoms(); i++)
{
atom = mol.GetAtom(i);
sprintf(buffer,"atom %d - %-3s ** - %8.5f %8.5f %8.5f %8.5f %d ",
i,
etab.GetSymbol(atom->GetAtomicNum()),
atom->GetPartialCharge(),
atom->GetX(),
atom->GetY(),
atom->GetZ(),
atom->GetValence());
ofs << buffer;
for (bond = atom->BeginBond(j); bond; bond = atom->NextBond(j))
{
switch(bond->GetBO())
{
case 1 : bond_char = 's'; break;
case 2 : bond_char = 'd'; break;
case 3 : bond_char = 't'; break;
case 5 : bond_char = 'a'; break;
default: bond_char = 's'; break;
}
sprintf(buffer,"%d %c ", (bond->GetNbrAtom(atom))->GetIdx(), bond_char);
ofs << buffer;
}
ofs << endl;
}
ofs << "endmol " << file_num << endl;
return(true);
}
示例9: WriteMolecule
bool TinkerFormat::WriteMolecule(OBBase* pOb, OBConversion* pConv)
{
OBMol* pmol = dynamic_cast<OBMol*>(pOb);
if(pmol==NULL)
return false;
//Define some references so we can use the old parameter names
ostream &ofs = *pConv->GetOutStream();
OBMol &mol = *pmol;
bool mmffTypes = pConv->IsOption("m",OBConversion::OUTOPTIONS) != NULL;
unsigned int i;
char buffer[BUFF_SIZE];
OBBond *bond;
vector<OBBond*>::iterator j;
// Before we try output of MMFF94 atom types, check if it works
OBForceField *ff = OpenBabel::OBForceField::FindForceField("MMFF94");
if (mmffTypes && ff && ff->Setup(mol))
mmffTypes = ff->GetAtomTypes(mol);
else
mmffTypes = false; // either the force field isn't available, or it doesn't work
if (!mmffTypes)
snprintf(buffer, BUFF_SIZE, "%6d %-20s MM2 parameters\n",mol.NumAtoms(),mol.GetTitle());
else
snprintf(buffer, BUFF_SIZE, "%6d %-20s MMFF94 parameters\n",mol.NumAtoms(),mol.GetTitle());
ofs << buffer;
ttab.SetFromType("INT");
OBAtom *atom;
string str,str1;
for(i = 1;i <= mol.NumAtoms(); i++)
{
atom = mol.GetAtom(i);
str = atom->GetType();
ttab.SetToType("MM2");
ttab.Translate(str1,str);
if (mmffTypes) {
// Override the MM2 typing
OBPairData *type = (OpenBabel::OBPairData*)atom->GetData("FFAtomType");
if (type)
str1 = type->GetValue().c_str();
}
snprintf(buffer, BUFF_SIZE, "%6d %2s %12.6f%12.6f%12.6f %5d",
i,
etab.GetSymbol(atom->GetAtomicNum()),
atom->GetX(),
atom->GetY(),
atom->GetZ(),
atoi((char*)str1.c_str()));
ofs << buffer;
for (bond = atom->BeginBond(j); bond; bond = atom->NextBond(j))
{
snprintf(buffer, BUFF_SIZE, "%6d", (bond->GetNbrAtom(atom))->GetIdx());
ofs << buffer;
}
ofs << endl;
}
return(true);
}
示例10: WriteMolecule
//.........这里部分代码省略.........
OBUnitCell *pUC = (OBUnitCell*)pmol->GetData(OBGenericDataType::UnitCell);
if(pUC->GetSpaceGroup()){
string tmpHM=pUC->GetSpaceGroup()->GetHMName();
// Do we have an extended HM symbol, with origin choice as ":1" or ":2" ? If so, remove it.
size_t n=tmpHM.find(":");
if(n!=string::npos) tmpHM=tmpHM.substr(0,n);
snprintf(buffer, BUFF_SIZE,
"CRYST1%9.3f%9.3f%9.3f%7.2f%7.2f%7.2f %-11s 1",
pUC->GetA(), pUC->GetB(), pUC->GetC(),
pUC->GetAlpha(), pUC->GetBeta(), pUC->GetGamma(),
tmpHM.c_str());
}
else
snprintf(buffer, BUFF_SIZE,
"CRYST1%9.3f%9.3f%9.3f%7.2f%7.2f%7.2f %-11s 1",
pUC->GetA(), pUC->GetB(), pUC->GetC(),
pUC->GetAlpha(), pUC->GetBeta(), pUC->GetGamma(),
"P1");
ofs << buffer << endl;
}
// before we write any records, we should check to see if any coord < -1000
// which will cause errors in the formatting
double minX, minY, minZ;
minX = minY = minZ = -999.0f;
FOR_ATOMS_OF_MOL(a, mol)
{
if (a->GetX() < minX)
minX = a->GetX();
if (a->GetY() < minY)
minY = a->GetY();
if (a->GetZ() < minZ)
minZ = a->GetZ();
}
vector3 transV = VZero;
if (minX < -999.0)
transV.SetX(-1.0*minX - 900.0);
if (minY < -999.0)
transV.SetY(-1.0*minY - 900.0);
if (minZ < -999.0)
transV.SetZ(-1.0*minZ - 900.0);
// if minX, minY, or minZ was never changed, shift will be 0.0f
// otherwise, move enough so that smallest coord is > -999.0f
mol.Translate(transV);
OBAtom *atom;
OBResidue *res;
for (i = 1; i <= mol.NumAtoms(); i++)
{
atom = mol.GetAtom(i);
strncpy(type_name, etab.GetSymbol(atom->GetAtomicNum()), sizeof(type_name));
type_name[sizeof(type_name) - 1] = '\0';
//two char. elements are on position 13 and 14 one char. start at 14
if (strlen(type_name) > 1)
type_name[1] = toupper(type_name[1]);
else
{
char tmp[10];
strncpy(tmp, type_name, 9); // make sure to null-terminate tmp
snprintf(type_name, sizeof(type_name), " %-3s", tmp);
}
示例11: WriteMolecule
bool PDBFormat::WriteMolecule(OBBase* pOb, OBConversion* pConv)
{
OBMol* pmol = dynamic_cast<OBMol*>(pOb);
if(pmol==NULL)
return false;
//Define some references so we can use the old parameter names
ostream &ofs = *pConv->GetOutStream();
OBMol &mol = *pmol;
unsigned int i;
char buffer[BUFF_SIZE];
char type_name[10], padded_name[10];
char the_res[10];
char the_chain = ' ';
const char *element_name;
int res_num;
bool het=true;
int model_num = 0;
if (!pConv->IsLast() || pConv->GetOutputIndex() > 1)
{ // More than one molecule record
model_num = pConv->GetOutputIndex(); // MODEL 1-based index
snprintf(buffer, BUFF_SIZE, "MODEL %8d", model_num);
ofs << buffer << endl;
}
if (strlen(mol.GetTitle()) > 0)
snprintf(buffer, BUFF_SIZE, "COMPND %s ",mol.GetTitle());
else
snprintf(buffer, BUFF_SIZE, "COMPND UNNAMED");
ofs << buffer << endl;
snprintf(buffer, BUFF_SIZE, "AUTHOR GENERATED BY OPEN BABEL %s",BABEL_VERSION);
ofs << buffer << endl;
// Write CRYST1 record, containing unit cell parameters, space group
// and Z value (supposed to be 1)
if (pmol->HasData(OBGenericDataType::UnitCell))
{
OBUnitCell *pUC = (OBUnitCell*)pmol->GetData(OBGenericDataType::UnitCell);
snprintf(buffer, BUFF_SIZE,
"CRYST1%9.3f%9.3f%9.3f%7.2f%7.2f%7.2f %-11s 1",
pUC->GetA(), pUC->GetB(), pUC->GetC(),
pUC->GetAlpha(), pUC->GetBeta(), pUC->GetGamma(),
pUC->GetSpaceGroup() ?
pUC->GetSpaceGroup()->GetHMName().c_str() : "P1");
ofs << buffer << endl;
}
// before we write any records, we should check to see if any coord < -1000
// which will cause errors in the formatting
double minX, minY, minZ;
minX = minY = minZ = -999.0f;
FOR_ATOMS_OF_MOL(a, mol)
{
if (a->GetX() < minX)
minX = a->GetX();
if (a->GetY() < minY)
minY = a->GetY();
if (a->GetZ() < minZ)
minZ = a->GetZ();
}
vector3 transV = VZero;
if (minX < -999.0)
transV.SetX(-1.0*minX - 900.0);
if (minY < -999.0)
transV.SetY(-1.0*minY - 900.0);
if (minZ < -999.0)
transV.SetZ(-1.0*minZ - 900.0);
// if minX, minY, or minZ was never changed, shift will be 0.0f
// otherwise, move enough so that smallest coord is > -999.0f
mol.Translate(transV);
OBAtom *atom;
OBResidue *res;
for (i = 1; i <= mol.NumAtoms(); i++)
{
atom = mol.GetAtom(i);
strncpy(type_name, etab.GetSymbol(atom->GetAtomicNum()), sizeof(type_name));
type_name[sizeof(type_name) - 1] = '\0';
//two char. elements are on position 13 and 14 one char. start at 14
if (strlen(type_name) > 1)
type_name[1] = toupper(type_name[1]);
else
{
char tmp[10];
strncpy(tmp, type_name, 10);
snprintf(type_name, sizeof(type_name), " %-3s", tmp);
}
if ( (res = atom->GetResidue()) != 0 )
{
het = res->IsHetAtom(atom);
snprintf(the_res,4,"%s",(char*)res->GetName().c_str());
snprintf(type_name,5,"%s",(char*)res->GetAtomID(atom).c_str());
the_chain = res->GetChain();
//.........这里部分代码省略.........
示例12: WriteMolecule
bool HINFormat::WriteMolecule(OBBase* pOb, OBConversion* pConv)
{
OBMol* pmol = dynamic_cast<OBMol*>(pOb);
if(pmol==NULL)
return false;
//Define some references so we can use the old parameter names
ostream &ofs = *pConv->GetOutStream();
OBMol &mol = *pmol;
unsigned int i, file_num = 1;
string str,str1;
char buffer[BUFF_SIZE];
OBAtom *atom;
OBBond *bond;
vector<OBBond*>::iterator j;
char bond_char;
// make sure to escape titles in double quotes
// PR#1501694
ofs << "mol " << file_num << " \"" << mol.GetTitle() << "\"\n";
for(i = 1;i <= mol.NumAtoms(); i++)
{
atom = mol.GetAtom(i);
snprintf(buffer, BUFF_SIZE, "atom %d - %-3s ** - %8.5f %8.5f %8.5f %8.5f %d ",
i,
etab.GetSymbol(atom->GetAtomicNum()),
atom->GetPartialCharge(),
atom->GetX(),
atom->GetY(),
atom->GetZ(),
atom->GetValence());
ofs << buffer;
for (bond = atom->BeginBond(j); bond; bond = atom->NextBond(j))
{
switch(bond->GetBO())
{
case 1 :
bond_char = 's';
break;
case 2 :
bond_char = 'd';
break;
case 3 :
bond_char = 't';
break;
case 5 :
bond_char = 'a';
break;
default:
bond_char = 's';
break;
}
if (bond->IsAromatic())
bond_char = 'a';
snprintf(buffer,BUFF_SIZE, "%d %c ", (bond->GetNbrAtom(atom))->GetIdx(), bond_char);
ofs << buffer;
}
ofs << endl;
}
ofs << "endmol " << file_num << endl;
return(true);
}
示例13: WriteMolecule
bool TinkerFormat::WriteMolecule(OBBase* pOb, OBConversion* pConv)
{
OBMol* pmol = dynamic_cast<OBMol*>(pOb);
if(pmol==NULL)
return false;
//Define some references so we can use the old parameter names
ostream &ofs = *pConv->GetOutStream();
OBMol &mol = *pmol;
bool mm2Types = false;
bool mmffTypes = pConv->IsOption("m",OBConversion::OUTOPTIONS) != NULL;
bool mm3Types = pConv->IsOption("3",OBConversion::OUTOPTIONS) != NULL;
bool classTypes = pConv->IsOption("c", OBConversion::OUTOPTIONS) != NULL;
unsigned int i;
char buffer[BUFF_SIZE];
OBBond *bond;
vector<OBBond*>::iterator j;
// Before we try output of MMFF94 atom types, check if it works
OBForceField *ff = OpenBabel::OBForceField::FindForceField("MMFF94");
if (mmffTypes && ff && ff->Setup(mol))
mmffTypes = ff->GetAtomTypes(mol);
else
mmffTypes = false; // either the force field isn't available, or it doesn't work
if (!mmffTypes && !mm3Types && !classTypes) {
snprintf(buffer, BUFF_SIZE, "%6d %-20s MM2 parameters\n",mol.NumAtoms(),mol.GetTitle());
mm2Types = true;
}
else if (mm3Types)
snprintf(buffer, BUFF_SIZE, "%6d %-20s MM3 parameters\n",mol.NumAtoms(),mol.GetTitle());
else if (classTypes)
snprintf(buffer, BUFF_SIZE, "%6d %-20s Custom parameters\n",mol.NumAtoms(),mol.GetTitle());
else
snprintf(buffer, BUFF_SIZE, "%6d %-20s MMFF94 parameters\n",mol.NumAtoms(),mol.GetTitle());
ofs << buffer;
ttab.SetFromType("INT");
OBAtom *atom;
string str,str1;
int atomType;
for(i = 1;i <= mol.NumAtoms(); i++)
{
atom = mol.GetAtom(i);
str = atom->GetType();
atomType = 0; // Something is very wrong if this doesn't get set below
if (mm2Types) {
ttab.SetToType("MM2");
ttab.Translate(str1,str);
atomType = atoi((char*)str1.c_str());
}
if (mmffTypes) {
// Override the MM2 typing
OBPairData *type = (OpenBabel::OBPairData*)atom->GetData("FFAtomType");
if (type) {
str1 = type->GetValue().c_str();
atomType = atoi((char*)str1.c_str());
}
}
if (mm3Types) {
// convert to integer for MM3 typing
atomType = SetMM3Type(atom);
}
if (classTypes) {
// Atom classes are set by the user, so use those
OBGenericData *data = atom->GetData("Atom Class");
if (data) {
OBPairInteger* acdata = dynamic_cast<OBPairInteger*>(data); // Could replace with C-style cast if willing to live dangerously
if (acdata) {
int ac = acdata->GetGenericValue();
if (ac >= 0)
atomType = ac;
}
}
}
snprintf(buffer, BUFF_SIZE, "%6d %2s %12.6f%12.6f%12.6f %5d",
i,
OBElements::GetSymbol(atom->GetAtomicNum()),
atom->GetX(),
atom->GetY(),
atom->GetZ(),
atomType);
ofs << buffer;
for (bond = atom->BeginBond(j); bond; bond = atom->NextBond(j))
{
snprintf(buffer, BUFF_SIZE, "%6d", (bond->GetNbrAtom(atom))->GetIdx());
ofs << buffer;
}
ofs << endl;
}
return(true);
}
示例14: WriteMolecule
bool AlchemyFormat::WriteMolecule(OBBase* pOb, OBConversion* pConv)
{
OBMol* pmol = dynamic_cast<OBMol*>(pOb);
if(pmol==NULL)
return false;
//Define some references so we can use the old parameter names
ostream &ofs = *pConv->GetOutStream();
OBMol &mol = *pmol;
unsigned int i;
char buffer[BUFF_SIZE];
char bond_string[10];
snprintf(buffer, BUFF_SIZE, "%5d ATOMS, %5d BONDS, 0 CHARGES",
mol.NumAtoms(),
mol.NumBonds());
ofs << buffer << endl;
OBAtom *atom;
string str,str1;
for(i = 1;i <= mol.NumAtoms(); i++)
{
atom = mol.GetAtom(i);
str = atom->GetType();
ttab.SetFromType("INT");
ttab.SetToType("ALC");
ttab.Translate(str1,str);
snprintf(buffer, BUFF_SIZE, "%5d %-6s%8.4f %8.4f %8.4f 0.0000",
i,
(char*)str1.c_str(),
atom->GetX(),
atom->GetY(),
atom->GetZ());
ofs << buffer << endl;
}
OBBond *bond;
vector<OBBond*>::iterator j;
for (bond = mol.BeginBond(j);bond;bond = mol.NextBond(j))
{
switch(bond->GetBO())
{
case 1 :
strcpy(bond_string,"SINGLE");
break;
case 2 :
strcpy(bond_string,"DOUBLE");
break;
case 3 :
strcpy(bond_string,"TRIPLE");
break;
case 5 :
strcpy(bond_string,"AROMATIC");
break;
default :
strcpy(bond_string,"SINGLE");
}
snprintf(buffer, BUFF_SIZE, "%5d %4d %4d %s",
bond->GetIdx()+1,
bond->GetBeginAtomIdx(),
bond->GetEndAtomIdx(),
bond_string);
ofs << buffer << endl;
}
return(true);
}
示例15: WriteMolecule
//.........这里部分代码省略.........
break;
}
}
orbitals = valenceE / 2;
if (charged)
{
orbitals = (valenceE / 2) - 1;
valenceE -= 1;
}
ofs << " $TITLEI" << endl;
ofs << endl;
ofs << " " << mol.GetTitle() << endl;
ofs << endl;
ofs << " $END" << endl;
ofs << endl;
ofs << " $CONTRL" << endl;
ofs << endl;
if (charged)
ofs << " SCFTYP ROHF RUNTYP CI ENTTYP COORD" << endl;
else
ofs << " SCFTYP RHF RUNTYP CI ENTTYP COORD" << endl;
ofs << " UNITS ANGS INTTYP 1 IAPX 3" << endl;
if (charged)
{
ofs << endl;
ofs << " NOP = 1 " << endl;
ofs << " NDT = 1 " << endl;
snprintf(buffer, BUFF_SIZE, " FOP(1) =% 4d% 10.6f",
valenceE - 1, 1.0);
ofs << buffer << endl;
}
snprintf(buffer, BUFF_SIZE, " NAT %4d NEL %4d MULT 1",
mol.NumAtoms(),
valenceE);
ofs << buffer << endl;
ofs << " IPRINT -1 ITMAX 100" << endl;
ofs << endl;
ofs << "! ***** BASIS SET AND C. I. SIZE INFORMATION ***** " << endl;
ofs << endl;
snprintf(buffer, BUFF_SIZE, " DYNAL(1) = 0%5d%5d 0 0 1200%5d",
mol.NumAtoms() - mol.NumHvyAtoms(),
mol.NumHvyAtoms(),
orbitals + 25);
ofs << buffer << endl;
ofs << endl;
ofs << " INTFA(1) = 1.000000 1.267000 0.680000 1.000000 1.000000 " << endl;
ofs << endl;
ofs << "! ***** OUTPUT FILE NAME ***** " << endl;
ofs << endl;
ofs << " ONAME = zindo " << endl;
ofs << endl;
ofs << " $END" << endl;
ofs << endl;
ofs << " $DATAIN " << endl;
ofs << endl;
for (atom = mol.BeginAtom(i); atom; atom = mol.NextAtom(i))
{
snprintf(buffer, BUFF_SIZE, "% 10.6f% 10.6f% 10.6f%5d",
atom->GetX(),
atom->GetY(),
atom->GetZ(),
atom->GetAtomicNum());
ofs << buffer << endl;
}
ofs << endl;
ofs << " $END " << endl;
ofs << endl;
ofs << " $CIINPU" << endl;
ofs << endl;
ofs << "! ***** C. I. SPECIFICATION *****" << endl;
ofs << endl;
ofs << " 2 1 25 1 0 0 0 1 10 1 10" << endl;
ofs << " -60000.0 0.0000000" << endl;
ofs << endl;
if (charged)
snprintf(buffer, BUFF_SIZE, "%5d%5d%5d%5d", 1, orbitals, orbitals, orbitals + 1);
else
snprintf(buffer, BUFF_SIZE, "%5d%5d%5d", 1, orbitals, orbitals);
ofs << buffer << endl;
if (charged)
snprintf(buffer, BUFF_SIZE, "%5d%5d%5d%5d%5d",
21, (orbitals - 8), orbitals + 1, orbitals + 1, orbitals + 11);
else
snprintf(buffer, BUFF_SIZE, "%5d%5d%5d%5d%5d",
21, (orbitals - 9), orbitals, orbitals + 1, orbitals + 10);
ofs << buffer << endl;
ofs << endl;
ofs << " $END" << endl;
return(true);
}