Changeset 978bcd


Ignore:
Timestamp:
Mar 1, 2010, 8:41:21 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
075d08
Parents:
c0c33f
Message:

FIX: ParseCommandLineOptions - case 'C' used wrong LC width, case 'F' nows parses filler from file.

ParseCommandLineOptions:

  • case 'C': Linked Cell width was set to fixed double of radius and was hence uncorrelated to the BinWidth. This is bad for subsequent DistanceToSurface() searches which use LC.
  • case 'F': Filler molecules was encoded by hand so far, is now parsed from xyz file and the bond structure created by BondGraph.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/builder.cpp

    rc0c33f r978bcd  
    14191419            Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl;
    14201420            Log() << Verbose(0) << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl;
    1421             Log() << Verbose(0) << "\t-F <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl;
    1422             Log() << Verbose(0) << "\t-FF <MaxDistance> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl;
     1421            Log() << Verbose(0) << "\t-F <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl;
     1422            Log() << Verbose(0) << "\t-FF <MaxDistance> <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl;
    14231423            Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl;
    14241424            Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl;
     
    17501750                        ofstream output(argv[argptr+2]);
    17511751                        ofstream binoutput(argv[argptr+3]);
    1752                         const double radius = 5.;
     1752                        const double radius = 4.;
    17531753                        const double BinStart = atof(argv[argptr+4]);
    17541754                        const double BinEnd = atof(argv[argptr+5]);
     1755                        double LCWidth = 20.;
     1756                        if (BinEnd > 0) {
     1757                          if (BinEnd > 2.*radius)
     1758                              LCWidth = BinEnd;
     1759                          else
     1760                            LCWidth = 2.*radius;
     1761                        }
    17551762
    17561763                        // get the boundary
     
    17721779                          (*BigFinder)->ActiveFlag = (*BigFinder == Boundary) ? false : true;
    17731780                        }
    1774                         LCList = new LinkedCell(Boundary, 2.*radius);
     1781                        LCList = new LinkedCell(Boundary, LCWidth);
    17751782                        element *elemental = periode->FindElement((const int) atoi(argv[argptr+1]));
    17761783                        FindNonConvexBorder(Boundary, TesselStruct, LCList, radius, NULL);
    1777                         int ranges[NDIM] = {1,1,1};
    1778                         CorrelationToSurfaceMap *surfacemap = PeriodicCorrelationToSurface( molecules, elemental, TesselStruct, LCList, ranges );
     1784                        //int ranges[NDIM] = {1,1,1};
     1785                        CorrelationToSurfaceMap *surfacemap = CorrelationToSurface( molecules, elemental, TesselStruct, LCList); // for Periodic..(): ..., ranges );
    17791786                        OutputCorrelationToSurface(&output, surfacemap);
     1787                        // check whether radius was appropriate
     1788                        {
     1789                        double start; double end;
     1790                        GetMinMax( surfacemap, start, end);
     1791                        if (LCWidth < end)
     1792                          eLog() << Verbose(1) << "Linked Cell width is smaller than the found range of values! Bins can only be correct up to: " << radius << "." << endl;
     1793                        }
    17801794                        BinPairMap *binmap = BinData( surfacemap, 0.5, BinStart, BinEnd );
    17811795                        OutputCorrelation ( &binoutput, binmap );
     
    18241838                Log() << Verbose(0) << "Filling with maximum layer distance of " << MaxDistance << "." << endl;
    18251839              }
    1826               if (argptr+6 >=argc) {
     1840              if ((argptr+7 >=argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) || (!IsValidNumber(argv[argptr+6])) || (!IsValidNumber(argv[argptr+7]))) {
    18271841                ExitFlag = 255;
    1828                 eLog() << Verbose(0) << "Not enough or invalid arguments given for filling box with water: -F <dist_x> <dist_y> <dist_z> <boundary> <randatom> <randmol> <DoRotate>" << endl;
     1842                eLog() << Verbose(0) << "Not enough or invalid arguments given for filling box with water: -F <xyz of filler> <dist_x> <dist_y> <dist_z> <boundary> <randatom> <randmol> <DoRotate>" << endl;
    18291843                performCriticalExit();
    18301844              } else {
     
    18331847                // construct water molecule
    18341848                molecule *filler = new molecule(periode);
     1849                if (!filler->AddXYZFile(argv[argptr])) {
     1850                  eLog() << Verbose(0) << "Could not parse filler molecule from " << argv[argptr] << "." << endl;
     1851                }
     1852                filler->SetNameFromFilename(argv[argptr]);
     1853                configuration.BG->ConstructBondGraph(filler);
    18351854                molecule *Filling = NULL;
    1836                 atom *second = NULL, *third = NULL;
    1837 //                first = new atom();
    1838 //                first->type = periode->FindElement(5);
    1839 //                first->x.Zero();
    1840 //                filler->AddAtom(first);
    1841                 first = new atom();
    1842                 first->type = periode->FindElement(1);
    1843                 first->x.Init(0.441, -0.143, 0.);
    1844                 filler->AddAtom(first);
    1845                 second = new atom();
    1846                 second->type = periode->FindElement(1);
    1847                 second->x.Init(-0.464, 1.137, 0.0);
    1848                 filler->AddAtom(second);
    1849                 third = new atom();
    1850                 third->type = periode->FindElement(8);
    1851                 third->x.Init(-0.464, 0.177, 0.);
    1852                 filler->AddAtom(third);
    1853                 filler->AddBond(first, third, 1);
    1854                 filler->AddBond(second, third, 1);
    18551855                // call routine
    18561856                double distance[NDIM];
    18571857                for (int i=0;i<NDIM;i++)
    1858                   distance[i] = atof(argv[argptr+i]);
    1859                 Filling = FillBoxWithMolecule(molecules, filler, configuration, MaxDistance, distance, atof(argv[argptr+3]), atof(argv[argptr+4]), atof(argv[argptr+5]), atoi(argv[argptr+6]));
     1858                  distance[i] = atof(argv[argptr+i+1]);
     1859                Filling = FillBoxWithMolecule(molecules, filler, configuration, MaxDistance, distance, atof(argv[argptr+4]), atof(argv[argptr+5]), atof(argv[argptr+6]), atoi(argv[argptr+7]));
    18601860                if (Filling != NULL) {
    18611861                  Filling->ActiveFlag = false;
Note: See TracChangeset for help on using the changeset viewer.