Changeset 09048c


Ignore:
Timestamp:
Oct 17, 2009, 4:54:46 PM (15 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
44a59b
Parents:
ad8b0d
Message:

Added case 'C' to ParseCommandLineOptions with CorrelationToSurface().

  • new case 'C' with CorrelationToSurface()
  • lots of changes in ParseCommandLineOptions() as all of the tests for ...[0] != '-' were wrong for numbers (e.g. -t -1. 0. 0. in translation case)
  • small fix to BinData() as 0. was given instead of 0 for second argument of outmap (but should be integer)
Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/analysis_correlation.hpp

    rad8b0d r09048c  
    114114    end = BinEnd;
    115115    for (double runner = start; runner <= end; runner += BinWidth)
    116       outmap->insert( pair<double, int> (runner, 0.) );
     116      outmap->insert( pair<double, int> (runner, 0) );
    117117  }
    118118
  • src/builder.cpp

    rad8b0d r09048c  
    15071507            case 'a':
    15081508              if (ExitFlag == 0) ExitFlag = 1;
    1509               if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr+1]))) {
     1509              if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3]))) {
    15101510                ExitFlag = 255;
    15111511                cerr << "Not enough or invalid arguments for adding atom: -a <element> <x> <y> <z>" << endl;
     
    15791579            case 'C':
    15801580              if (ExitFlag == 0) ExitFlag = 1;
    1581               if ((argptr+1 >= argc) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-')) {
     1581              if ((argptr+2 >= argc) || (argv[argptr][0] == '-') || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-')) {
    15821582                ExitFlag = 255;
    1583                 cerr << "Not enough or invalid arguments given for pair correlation analysis: -C <output> <bin output>" << endl;
     1583                cerr << "Not enough or invalid arguments given for pair correlation analysis: -C <boundary conf> <output> <bin output>" << endl;
    15841584              } else {
    15851585                SaveFlag = false;
    1586                 ofstream output(argv[argptr]);
    1587                 ofstream binoutput(argv[argptr+1]);
    1588                 class Tesselation T;
     1586                ofstream output(argv[argptr+1]);
     1587                ofstream binoutput(argv[argptr+2]);
    15891588                const double radius = 5.;
    1590                 LinkedCell LCList(mol, 2.*radius);
     1589
     1590                // get the boundary
     1591                class molecule *Boundary = new molecule(periode);
     1592                struct ConfigFileBuffer *FileBuffer = NULL;
     1593                PrepareFileBuffer(argv[argptr], FileBuffer);
     1594                LoadMolecule(Boundary, FileBuffer, periode, false);
     1595                LinkedCell LCList(Boundary, 2.*radius);
    15911596                element *oxygen = periode->FindElement(8);
    1592                 FindNonConvexBorder((ofstream *)&cout, mol, &LCList, radius, NULL);
    1593                 CorrelationToSurfaceMap *surfacemap = CorrelationToSurface( (ofstream *)&cout, mol, oxygen, mol->TesselStruct, &LCList );
     1597                FindNonConvexBorder((ofstream *)&cout, Boundary, &LCList, radius, NULL);
     1598
     1599                CorrelationToSurfaceMap *surfacemap = CorrelationToSurface( (ofstream *)&cout, mol, oxygen, Boundary->TesselStruct, &LCList );
    15941600                BinPairMap *binmap = BinData( (ofstream *)&cout, surfacemap, 0.5, 0., 0. );
    15951601                OutputCorrelation ( &binoutput, binmap );
    15961602                output.close();
    15971603                binoutput.close();
    1598                 argptr+=2;
     1604                delete(FileBuffer);
     1605                delete(Boundary);
     1606                argptr+=3;
    15991607              }
    16001608              break;
     
    17591767            case 't':
    17601768              if (ExitFlag == 0) ExitFlag = 1;
    1761               if ((argptr+2 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
     1769              if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
    17621770                ExitFlag = 255;
    17631771                cerr << "Not enough or invalid arguments given for translation: -t <x> <y> <z>" << endl;
     
    17741782            case 'T':
    17751783              if (ExitFlag == 0) ExitFlag = 1;
    1776               if ((argptr+2 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
     1784              if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
    17771785                ExitFlag = 255;
    17781786                cerr << "Not enough or invalid arguments given for periodic translation: -T <x> <y> <z>" << endl;
     
    17891797            case 's':
    17901798              if (ExitFlag == 0) ExitFlag = 1;
    1791               if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) ) {
     1799              if ((argptr >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
    17921800                ExitFlag = 255;
    1793                 cerr << "Not enough or invalid arguments given for scaling: -s <factor/[factor_x]> [factor_y] [factor_z]" << endl;
     1801                cerr << "Not enough or invalid arguments given for scaling: -s <factor_x> [factor_y] [factor_z]" << endl;
    17941802              } else {
    17951803                SaveFlag = true;
     
    17981806                factor = new double[NDIM];
    17991807                factor[0] = atof(argv[argptr]);
    1800                 if ((argptr < argc) && (IsValidNumber(argv[argptr])))
    1801                   argptr++;
    1802                 factor[1] = atof(argv[argptr]);
    1803                 if ((argptr < argc) && (IsValidNumber(argv[argptr])))
    1804                   argptr++;
    1805                 factor[2] = atof(argv[argptr]);
     1808                factor[1] = atof(argv[argptr+1]);
     1809                factor[2] = atof(argv[argptr+2]);
    18061810                mol->Scale(&factor);
    18071811                for (int i=0;i<NDIM;i++) {
     
    18111815                }
    18121816                delete[](factor);
    1813                 argptr+=1;
     1817                argptr+=3;
    18141818              }
    18151819              break;
Note: See TracChangeset for help on using the changeset viewer.