Changeset 34e0592 for src/builder.cpp


Ignore:
Timestamp:
Aug 20, 2009, 7:48:07 AM (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:
78b73c, 9ba9ee
Parents:
1d9b7aa (diff), 7c14ec (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Frederik Heber <heber@…> (08/19/09 14:40:33)
git-committer:
Frederik Heber <heber@…> (08/20/09 07:48:07)
Message:

Merge branch 'ConcaveHull' of ssh://stud64d-02/home/metzler/workspace/espack into Ticket14

Conflicts:

molecuilder/src/boundary.cpp
molecuilder/src/tesselation.cpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/builder.cpp

    r1d9b7aa r34e0592  
    584584        LinkedCell LCList(mol, 10.);
    585585        class Tesselation *TesselStruct = NULL;
    586         Find_convex_border((ofstream *)&cout, mol, &LCList, NULL);
     586        FindConvexBorder((ofstream *)&cout, mol, &LCList, NULL);
    587587        double clustervolume = VolumeOfConvexEnvelope((ofstream *)&cout, TesselStruct, configuration);
    588588        cout << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl;
     
    644644  Vector x,y,z,n; // coordinates for absolute point in cell volume
    645645  double *factor; // unit factor if desired
    646   double bond, min_bond;
     646  double bond, minBond;
    647647  char choice;  // menu choice char
    648648  bool valid;
     
    683683        first = mol->AskAtom("Enter first (fixed) atom: ");
    684684        second = mol->AskAtom("Enter second (shifting) atom: ");
    685         min_bond = 0.;
     685        minBond = 0.;
    686686        for (int i=NDIM;i--;)
    687           min_bond += (first->x.x[i]-second->x.x[i])*(first->x.x[i] - second->x.x[i]);
    688         min_bond = sqrt(min_bond);
    689         cout << Verbose(0) << "Current Bond length between " << first->type->name << " Atom " << first->nr << " and " << second->type->name << " Atom " << second->nr << ": " << min_bond << " a.u." << endl;
     687          minBond += (first->x.x[i]-second->x.x[i])*(first->x.x[i] - second->x.x[i]);
     688        minBond = sqrt(minBond);
     689        cout << Verbose(0) << "Current Bond length between " << first->type->name << " Atom " << first->nr << " and " << second->type->name << " Atom " << second->nr << ": " << minBond << " a.u." << endl;
    690690        cout << Verbose(0) << "Enter new bond length [a.u.]: ";
    691691        cin >> bond;
    692692        for (int i=NDIM;i--;) {
    693           second->x.x[i] -= (second->x.x[i]-first->x.x[i])/min_bond*(min_bond-bond);
     693          second->x.x[i] -= (second->x.x[i]-first->x.x[i])/minBond*(minBond-bond);
    694694        }
    695695        //cout << Verbose(0) << "New coordinates of Atom " << second->nr << " are: ";
     
    13251325  int j;
    13261326  double volume = 0.;
    1327   enum ConfigStatus config_present = absent;
     1327  enum ConfigStatus configPresent = absent;
    13281328  clock_t start,end;
    13291329  int argptr;
     
    14251425        if (output == NULL) {
    14261426          cout << Verbose(1) << "Specified config file " << argv[1] << " not found." << endl;
    1427           config_present = absent;
     1427          configPresent = absent;
    14281428        } else {
    14291429          cout << "Empty configuration file." << endl;
    14301430          ConfigFileName = argv[1];
    1431           config_present = empty;
     1431          configPresent = empty;
    14321432          output.close();
    14331433        }
     
    14401440            cout << "new syntax." << endl;
    14411441            configuration.Load(ConfigFileName, periode, mol);
    1442             config_present = present;
     1442            configPresent = present;
    14431443            break;
    14441444          case 0:
    14451445            cout << "old syntax." << endl;
    14461446            configuration.LoadOld(ConfigFileName, periode, mol);
    1447             config_present = present;
     1447            configPresent = present;
    14481448            break;
    14491449          default:
    14501450            cout << "Unknown syntax or empty, yet present file." << endl;
    1451             config_present = empty;
     1451            configPresent = empty;
    14521452       }
    14531453      }
    14541454    } else
    1455       config_present = absent;
     1455      configPresent = absent;
    14561456    // 4. parse again through options, now for those depending on elements db and config presence
    14571457    argptr = 1;
     
    14601460      if (argv[argptr][0] == '-') {
    14611461        argptr++;
    1462         if ((config_present == present) || (config_present == empty)) {
     1462        if ((configPresent == present) || (configPresent == empty)) {
    14631463          switch(argv[argptr-1][1]) {
    14641464            case 'p':
     
    14741474                else {
    14751475                  cout << Verbose(2) << "File found and parsed." << endl;
    1476                   config_present = present;
     1476                  configPresent = present;
    14771477                }
    14781478              }
     
    14941494                if (first->type != NULL) {
    14951495                  mol->AddAtom(first);  // add to molecule
    1496                   if ((config_present == empty) && (mol->AtomCount != 0))
    1497                     config_present = present;
     1496                  if ((configPresent == empty) && (mol->AtomCount != 0))
     1497                    configPresent = present;
    14981498                } else
    14991499                  cerr << Verbose(1) << "Could not find the specified element." << endl;
     
    15051505          }
    15061506        }
    1507         if (config_present == present) {
     1507        if (configPresent == present) {
    15081508          switch(argv[argptr-1][1]) {
    15091509            case 'M':
     
    16271627                start = clock();
    16281628                LinkedCell LCList(mol, atof(argv[argptr])*2.);
    1629                 Find_non_convex_border((ofstream *)&cout, mol, &LCList, argv[argptr+1], atof(argv[argptr]));
     1629                FindNonConvexBorder((ofstream *)&cout, mol, &LCList, argv[argptr+1], atof(argv[argptr]));
    16301630                //FindDistributionOfEllipsoids((ofstream *)&cout, &T, &LCList, N, number, filename.c_str());
    16311631                end = clock();
     
    18711871                cout << Verbose(1) << "Storing tecplot data in " << argv[argptr] << "." << endl;
    18721872                LinkedCell LCList(mol, 10.);
    1873                 //Find_convex_border((ofstream *)&cout, mol, &LCList, argv[argptr]);
    1874                 Find_non_convex_border((ofstream *)&cout, mol, &LCList, argv[argptr], 10.);
     1873                //FindConvexBorder((ofstream *)&cout, mol, &LCList, argv[argptr]);
     1874                FindNonConvexBorder((ofstream *)&cout, mol, &LCList, argv[argptr], 10.);
    18751875
    18761876                double volumedifference = ConvexizeNonconvexEnvelope((ofstream *)&cout, mol->TesselStruct, mol, argv[argptr]);
Note: See TracChangeset for help on using the changeset viewer.