88 |
|
|
89 |
|
|
90 |
|
|
91 |
< |
if( !strcmp( force_field, "TraPPE" ) ) the_ff = new TraPPEFF(); |
92 |
< |
else if( !strcmp( force_field, "DipoleTest" ) ) the_ff = new DipoleTestFF(); |
93 |
< |
else if( !strcmp( force_field, "TraPPE_Ex" ) ) the_ff = new TraPPE_ExFF(); |
91 |
> |
if( !strcmp( force_field, "TraPPE_Ex" ) ) the_ff = new TraPPE_ExFF(); |
92 |
|
else if( !strcmp( force_field, "LJ" ) ) the_ff = new LJ_FF(); |
93 |
|
else{ |
94 |
|
sprintf( painCave.errMsg, |
335 |
|
|
336 |
|
|
337 |
|
if( simnfo->n_SRI ){ |
338 |
+ |
|
339 |
+ |
std::cerr << "n_SRI = " << simnfo->n_SRI << "\n"; |
340 |
+ |
|
341 |
|
Exclude::createArray(simnfo->n_SRI); |
342 |
|
the_excludes = new Exclude*[simnfo->n_SRI]; |
343 |
+ |
for( int ex=0; ex<simnfo->n_SRI; ex++) the_excludes[ex] = new Exclude(ex); |
344 |
|
simnfo->globalExcludes = new int; |
345 |
|
simnfo->n_exclude = tot_SRI; |
346 |
|
} |
358 |
|
// set the arrays into the SimInfo object |
359 |
|
|
360 |
|
simnfo->atoms = the_atoms; |
361 |
+ |
simnfo->molecules = the_molecules; |
362 |
|
simnfo->nGlobalExcludes = 0; |
363 |
|
simnfo->excludes = the_excludes; |
364 |
|
|
657 |
|
|
658 |
|
// new AllLong( simnfo ); |
659 |
|
|
657 |
– |
if( !strcmp( force_field, "TraPPE" ) ) new Verlet( *simnfo, the_ff ); |
658 |
– |
if( !strcmp( force_field, "DipoleTest" ) ) new Symplectic( simnfo, the_ff ); |
660 |
|
if( !strcmp( force_field, "TraPPE_Ex" ) ) new Symplectic( simnfo, the_ff ); |
661 |
|
if( !strcmp( force_field, "LJ" ) ) new Verlet( *simnfo, the_ff ); |
662 |
|
|
700 |
|
BondStamp* currentBond; |
701 |
|
BendStamp* currentBend; |
702 |
|
TorsionStamp* currentTorsion; |
703 |
+ |
|
704 |
+ |
bond_pair* theBonds; |
705 |
+ |
bend_set* theBends; |
706 |
+ |
torsion_set* theTorsions; |
707 |
+ |
|
708 |
|
|
709 |
|
//init the forceField paramters |
710 |
|
|
711 |
|
the_ff->readParams(); |
712 |
|
|
713 |
|
|
714 |
< |
// init the molecules |
714 |
> |
// init the atoms |
715 |
|
|
716 |
+ |
double ux, uy, uz, u, uSqr; |
717 |
+ |
|
718 |
|
atomOffset = 0; |
719 |
|
excludeOffset = 0; |
720 |
|
for(i=0; i<simnfo->n_mol; i++){ |
731 |
|
info.myExcludes = &the_excludes[excludeOffset]; |
732 |
|
info.myBonds = new Bond*[info.nBonds]; |
733 |
|
info.myBends = new Bend*[info.nBends]; |
734 |
< |
info.myTorsions = new Torsions*[info.nTorsions]; |
734 |
> |
info.myTorsions = new Torsion*[info.nTorsions]; |
735 |
|
|
736 |
|
theBonds = new bond_pair[info.nBonds]; |
737 |
|
theBends = new bend_set[info.nBends]; |
741 |
|
|
742 |
|
for(j=0; j<info.nAtoms; j++){ |
743 |
|
|
744 |
< |
currentAtom = theComponents[stampID]->getAtom( j ); |
744 |
> |
currentAtom = comp_stamps[stampID]->getAtom( j ); |
745 |
|
if( currentAtom->haveOrientation() ){ |
746 |
|
|
747 |
|
dAtom = new DirectionalAtom(j + atomOffset); |
814 |
|
|
815 |
|
if( currentBend->haveExtras() ){ |
816 |
|
|
817 |
< |
extras = current_bend->getExtras(); |
817 |
> |
extras = currentBend->getExtras(); |
818 |
|
current_extra = extras; |
819 |
|
|
820 |
|
while( current_extra != NULL ){ |
931 |
|
|
932 |
|
the_molecules[i].initialize( info ); |
933 |
|
atomOffset += info.nAtoms; |
934 |
+ |
delete[] theBonds; |
935 |
+ |
delete[] theBends; |
936 |
+ |
delete[] theTorsions; |
937 |
|
} |
938 |
|
|
939 |
|
// clean up the forcefield |