ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE_old/src/mdtools/libmdCode/SimSetup.cpp
(Generate patch)

Comparing trunk/OOPSE_old/src/mdtools/libmdCode/SimSetup.cpp (file contents):
Revision 270 by mmeineke, Fri Feb 14 17:08:46 2003 UTC vs.
Revision 311 by mmeineke, Tue Mar 11 16:27:34 2003 UTC

# Line 4 | Line 4
4  
5   #include "SimSetup.hpp"
6   #include "parse_me.h"
7 #include "LRI.hpp"
7   #include "Integrator.hpp"
8   #include "simError.h"
9  
# Line 82 | Line 81 | void SimSetup::createSim( void ){
81    n_components = the_globals->getNComponents();
82    strcpy( force_field, the_globals->getForceField() );
83    strcpy( ensemble, the_globals->getEnsemble() );
84 +  strcpy( simnfo->ensemble, ensemble );
85  
86 +  strcpy( simnfo->mixingRule, the_globals->getMixingRule() );
87 +  simnfo->usePBC = the_globals->getPBC();
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();
# Line 99 | Line 104 | void SimSetup::createSim( void ){
104    strcpy( checkPointMsg, "ForceField creation successful" );
105    MPIcheckPoint();
106   #endif // is_mpi
107 +
108 +  
109  
110    // get the components and calculate the tot_nMol and indvidual n_mol
111    the_components = the_globals->getComponents();
# Line 703 | Line 710 | void SimSetup::makeBends( void ){
710    int i, j, k, index, offset, molIndex;
711    bend_set* the_bends;
712    BendStamp* current_bend;
713 +  LinkedAssign* extras;
714 +  LinkedAssign* current_extra;
715 +  
716  
717    the_bends = new bend_set[tot_bends];
718    index = 0;
# Line 724 | Line 734 | void SimSetup::makeBends( void ){
734            the_bends[index].b = current_bend->getB() + offset;
735            the_bends[index].c = current_bend->getC() + offset;
736            
737 <          the_excludes[index + tot_bonds].i = the_bends[index].a;
738 <          the_excludes[index + tot_bonds].j = the_bends[index].c;
737 >          if( current_bend->haveExtras ){
738 >            
739 >            extras = current_bend->getExtras();
740 >            current_extra = extras;
741 >            
742 >            while( current_extra != NULL ){
743 >              if( !strcmp( current_extra->getlhs(), "ghostVectorSource" )){
744 >                
745 >                switch( current_extra->getType() ){
746 >                  
747 >                case 0:
748 >                  the_bends[index].ghost =
749 >                    current_extra->getInt() + offset;
750 >                  the_bends[index].isGhost = 1;
751 >                  break;
752 >                  
753 >                case 1:
754 >                  the_bends[index].ghost =
755 >                    (int)current_extra->getDouble() + offset;
756 >                  the_bends[index].isGhost = 1;
757 >                  break;
758 >                  
759 >                default:
760 >                  sprintf( painCave.errMsg,
761 >                           "SimSetup Error: ghostVectorSource was neiter a "
762 >                           "double nor an int.\n"
763 >                           "-->Bend[%d] in %s\n",
764 >                           k, comp_stamps[i]->getID() );
765 >                  painCave.isFatal = 1;
766 >                  simError();
767 >                }
768 >              }
769 >              
770 >              else{
771 >                
772 >                sprintf( painCave.errMsg,
773 >                         "SimSetup Error: unhandled bend assignment:\n"
774 >                         "    -->%s in Bend[%d] in %s\n",
775 >                         current_extra->getlhs(),
776 >                         k, comp_stamps[i]->getID() );
777 >                painCave.isFatal = 1;
778 >                simError();
779 >              }
780 >              
781 >              current_extra = current_extra->next;
782 >            }
783 >          }
784            
785 +          if( !the_bends[index].isGhost ){
786 +            
787 +            the_excludes[index + tot_bonds].i = the_bends[index].a;
788 +            the_excludes[index + tot_bonds].j = the_bends[index].c;
789 +          }
790 +          else{
791 +            
792 +            the_excludes[index + tot_bonds].i = the_bends[index].a;
793 +            the_excludes[index + tot_bonds].j = the_bends[index].b;
794 +          }
795 +          
796            // increment the index and repeat;
797            index++;
798          }
# Line 740 | Line 806 | void SimSetup::makeBends( void ){
806      }
807    }
808  
809 + #ifdef IS_MPI
810 +  sprintf( checkPointMsg,
811 +           "Successfully created the bends list.\n" );
812 +  MPIcheckPoint();
813 + #endif // is_mpi
814 +  
815 +
816    the_ff->initializeBends( the_bends );
817   }
818  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines