Skip to content

Commit

Permalink
Modifications to build and internal constants
Browse files Browse the repository at this point in the history
- changes for static MKL linking
- covalent radii for more elements
  • Loading branch information
thch-dohm authored and awvwgk committed Jun 2, 2020
1 parent 5e12e14 commit f72317e
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 15 deletions.
2 changes: 1 addition & 1 deletion GSM/bmat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ int ICoord::bmatp_to_U()
// printf(" %8.5f",G[i1*len+j]);
// printf("\n");
#endif
lowev++;
// lowev++;
}
if (lowev>0)
printf(" lowev: %i",lowev);
Expand Down
97 changes: 86 additions & 11 deletions GSM/icoord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void ICoord::create_xyz()
return;
}

///creates the internal coordinates

int ICoord::ic_create()
{
make_bonds();
Expand Down Expand Up @@ -286,41 +286,92 @@ void ICoord::hbond_frags()
a3 = b2;
if (b2==a1 && anumbers[b1]==1)
a3 = b1;
water[3*nwater+0] = a1;
water[3*nwater+1] = a2;
water[3*nwater+2] = a3;
nwater++;
break;
if (a3>-1)
{
water[3*nwater+0] = a1;
water[3*nwater+1] = a2;
water[3*nwater+2] = a3;
nwater++;
break;
}
}
} //loop j over nbonds

} //loop i over oxygen atoms

// printf(" found %2i water molecules \n",nwater);
// for (int i=0;i<nwater;i++)
// printf(" OHH: %2i %2i %2i \n",water[3*i+0]+1,water[3*i+1]+1,water[3*i+2]+1);
#if 0
for (int i=0;i<nwater;i++)
if (water[3*i+0]==-1 || water[3*i+1]==-1 || water[3*i+2]==-1)
{
printf(" removing water %i \n",i);
nwater--;
}
#endif

printf(" found %2i water molecules \n",nwater);
for (int i=0;i<nwater;i++)
printf(" OHH: %2i %2i %2i \n",water[3*i+0]+1,water[3*i+1]+1,water[3*i+2]+1);

int* addw = new int[nwater];
for (int i=0;i<nwater;i++) addw[i] = 0;

for (int i=0;i<nwater;i++)
for (int j=0;j<nwater;j++)
if (i!=j)
{
// printf(" bond check on: %i %i \n",water[3*i+0],water[3*j+1]);
// printf(" bond check on: %i %i - %4.2f %4.2f \n",water[3*i+0],water[3*j+1],distance(water[3*i+0],water[3*j+1]),distance(water[3*i+0],water[3*j+2]));
if (distance(water[3*i+0],water[3*j+1])<2.0 && !bond_exists(water[3*i+0],water[3*j+1]))
{
printf(" adding H-bond as bond: %i %i \n",water[3*i+0]+1,water[3*j+1]+1);
bonds[nbonds][0] = water[3*i+0];
bonds[nbonds][1] = water[3*j+1];
nbonds++;
addw[i]++; addw[j]++;
}
if (distance(water[3*i+0],water[3*j+2])<2.0 && !bond_exists(water[3*i+0],water[3*j+2]))
{
printf(" adding H-bond as bond: %i %i \n",water[3*i+0]+1,water[3*j+2]+1);
bonds[nbonds][0] = water[3*i+0];
bonds[nbonds][1] = water[3*j+2];
nbonds++;
addw[i] = 1; addw[j]++;
}
}

printf("\n addw:");
for (int i=0;i<nwater;i++)
printf(" %i",addw[i]);
printf("\n");

for (int i=0;i<nwater;i++)
if (addw[i]<2)
{
printf(" need water bond for %2i \n",i+1);
for (int j=0;j<nwater;j++)
if (i!=j)
{
if (distance(water[3*i+0],water[3*j+1])<3.0 && !bond_exists(water[3*i+0],water[3*j+1]))
{
printf(" adding H-bond as bond: %i %i \n",water[3*i+0]+1,water[3*j+1]+1);
bonds[nbonds][0] = water[3*i+0];
bonds[nbonds][1] = water[3*j+1];
nbonds++;
addw[i] = 1; addw[j]++;
}
if (distance(water[3*i+0],water[3*j+2])<3.0 && !bond_exists(water[3*i+0],water[3*j+2]))
{
printf(" adding H-bond as bond: %i %i \n",water[3*i+0]+1,water[3*j+2]+1);
bonds[nbonds][0] = water[3*i+0];
bonds[nbonds][1] = water[3*j+2];
nbonds++;
addw[i] = 1; addw[j]++;
}
}
}

delete [] addw;
delete [] water;

return;
}

Expand Down Expand Up @@ -854,6 +905,7 @@ void ICoord::bond_frags()
b1 = -1;
b2 = -1;
mclose2 = 1000.;
if (a1>-1 && a2>-1)
for (int i=0;i<natoms;i++)
for (int j=0;j<natoms;j++)
if (frags[i]==n1 && frags[j]==n2)
Expand Down Expand Up @@ -881,6 +933,8 @@ void ICoord::bond_frags()
c1 = -1;
c2 = -1;
mclose3 = 1000.;
if (a1>-1 && a2>-1)
if (b1>-1 && b2>-1)
for (int i=0;i<natoms;i++)
for (int j=0;j<natoms;j++)
if (frags[i]==n1 && frags[j]==n2)
Expand Down Expand Up @@ -1586,24 +1640,45 @@ double ICoord::getR(int i){
else if (anumbers[i]==28) value = 3.0;
else if (anumbers[i]==29) value = 3.0;
else if (anumbers[i]==30) value = 3.0;
else if (anumbers[i]==31) value = 2.8; //CRA guess
else if (anumbers[i]==32) value = 2.8; //CRA guess
else if (anumbers[i]==33) value = 2.7; //CRA scale based on 3rd row
else if (anumbers[i]==34) value = 2.55; //CRA scale based on 3rd row
else if (anumbers[i]==35) value = 2.7;
else if (anumbers[i]==37) value = 4.0; //CRA same as 4th row
else if (anumbers[i]==38) value = 3.5; //CRA same as 4th row
else if (anumbers[i]==39) value = 4.5; //CRA same as 4th row
else if (anumbers[i]==40) value = 3.35;
else if (anumbers[i]==41) value = 3.3; //CRA guess
else if (anumbers[i]==42) value = 3.3; //CRA guess
else if (anumbers[i]==43) value = 3.3; //CRA guess; radioactive
else if (anumbers[i]==44) value = 3.2;
else if (anumbers[i]==45) value = 3.15;
else if (anumbers[i]==46) value = 3.15;
else if (anumbers[i]==47) value = 3.25;
else if (anumbers[i]==48) value = 3.27; //CRA scale same as Zn
else if (anumbers[i]==49) value = 3.0; //CRA guess
else if (anumbers[i]==50) value = 3.0; //CRA guess
else if (anumbers[i]==51) value = 2.9; //CRA guess
else if (anumbers[i]==52) value = 2.9; //CRA guess
else if (anumbers[i]==53) value = 2.8; //iodine
else if (anumbers[i]==55) value = 4.2;
else if (anumbers[i]==72) value = 3.3; //CRA guess
else if (anumbers[i]==73) value = 3.3;
else if (anumbers[i]==74) value = 3.3;
else if (anumbers[i]==75) value = 3.3;
else if (anumbers[i]==76) value = 3.3;
else if (anumbers[i]==77) value = 3.35;
else if (anumbers[i]==78) value = 3.35;
else if (anumbers[i]==79) value = 3.45;
else if (anumbers[i]==81) value = 3.25; //CRA guess
else if (anumbers[i]==82) value = 3.25; //CRA guess
else if (anumbers[i]==83) value = 3.25; //CRA guess
else if (anumbers[i]==84) value = 3.25; //CRA guess
else if (anumbers[i]==85) value = 3.25; //CRA guess
else
{
printf(" Need to add atomic number %i to getR! \n",anumbers[i]);
printf(" Need to add atomic number %i (of atom %i) to getR! \n",anumbers[i],i+1);
exit(1);
}
// else value = 0.;
Expand Down
3 changes: 2 additions & 1 deletion GSM/mopac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ using namespace std;
#include "constants.h"

//#define MOPAC_LEVEL "PM6 NOSYM 1SCF GRADIENTS UHF TRIPLET CHARGE=1"
#define MOPAC_LEVEL "PM6 NOSYM 1SCF GRADIENTS UHF AUX "
//#define MOPAC_LEVEL "PM6-DH2 NOSYM 1SCF GRADIENTS UHF AUX "
#define MOPAC_LEVEL "PM7 NOSYM 1SCF GRADIENTS UHF AUX "
//#define MOPAC_LEVEL "PM6 NOSYM 1SCF GRADIENTS UHF AUX CHARGE=1 "

void Mopac::write_ic_input(ofstream& inpfile, int anum, ICoord ic){
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ F95ROOT = $(MKLROOT)
#LINKERFLAGS = -L$(MKLROOT)/lib/em64t $(F95ROOT)/lib/em64t/libmkl_lapack95_lp64.a -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm
#Intel parallel openmp (only w/icpc compiler)
#LINKERFLAGS = -L$(MKLROOT)/lib/em64t -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lpthread -lm
LINKERFLAGS = -L$(MKLROOT)/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lpthread -lm
LINKERFLAGS = -static -L$(MKLROOT)/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lpthread -lm
# MAC OS linkers
#LINKERFLAGS = -lm -framework Accelerate


OFLAGS = # optimization
OFLAGS = -axAVX -xHOST -fast # optimization



Expand Down
2 changes: 2 additions & 0 deletions ProjectName.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
SET(PROJECT_NAME GSM)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")

0 comments on commit f72317e

Please sign in to comment.