Changeset a5b2c3a for src/builder.cpp


Ignore:
Timestamp:
Jul 3, 2009, 2:25:17 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:
375b458
Parents:
c54da3
Message:

Removing of atoms via command line possible

-R switchs allows for the removal of single atoms
-Left and Right Boundary are now called Upper and Lower Boundary which makes more sense

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/builder.cpp

    rc54da3 ra5b2c3a  
    474474                        cout << Verbose(0) << "Which axis is it: ";
    475475                        cin >> axis;
    476                         cout << Verbose(0) << "Left inward boundary: ";
     476                        cout << Verbose(0) << "Lower boundary: ";
    477477                        cin >> tmp1;
    478                         cout << Verbose(0) << "Right inward boundary: ";
     478                        cout << Verbose(0) << "Upper boundary: ";
    479479                        cin >> tmp2;
    480480                        first = mol->start;
    481                         while(first->next != mol->end) {
    482                                 first = first->next;
    483                                 if ((first->x.x[axis] > tmp2) || (first->x.x[axis] < tmp1)) // out of boundary ...
     481      second = first->next;
     482      while(second != mol->end) {
     483        first = second;
     484        second = first->next;
     485                                if ((first->x.x[axis] < tmp1) || (first->x.x[axis] > tmp2)) {// out of boundary ...
     486                                  //cout << "Atom " << *first << " with " << first->x.x[axis] << " on axis " << axis << " is out of bounds [" << tmp1 << "," << tmp2 << "]." << endl;
    484487                                        mol->RemoveAtom(first);
     488                                }
    485489                        }
    486490                        break;
     
    12681272                                                cout << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl;
    12691273                                                cout << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl;
    1270                                                 cout << "\t-N\tGet non-convex-envelope." << endl;
     1274                                                cout << "\t-N <radius> <file>\tGet non-convex-envelope." << endl;
    12711275                                                cout << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl;
    12721276                                                cout << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl;
    12731277                                                cout << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl;
    12741278                                                cout << "\t-r\t\tConvert file from an old pcp syntax." << endl;
     1279                                                cout << "\t-R\t\tRemove all atoms out of sphere around a given one." << endl;
    12751280                                                cout << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl;
    12761281                                                cout << "\t-T <file> Store temperatures from the config file in <file>." << endl;
     
    14951500                                                                LinkedCell LCList(mol, atof(argv[argptr]));             // \NOTE not twice the radius??
    14961501                                                                Find_non_convex_border((ofstream *)&cout, mol, &T, &LCList, argv[argptr+1], atof(argv[argptr]));
    1497                                                                 FindDistributionOfEllipsoids((ofstream *)&cout, &T, &LCList, N, number, filename.c_str());
     1502                                                                //FindDistributionOfEllipsoids((ofstream *)&cout, &T, &LCList, N, number, filename.c_str());
    14981503                                                                argptr+=2;
    14991504                                                        }
     
    15311536                                                        }
    15321537                                                        break;
     1538            case 'R':
     1539              ExitFlag = 1;
     1540              if ((argptr+1 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])))  {
     1541                ExitFlag = 255;
     1542                cerr << "Not enough or invalid arguments given for removing atoms: -R <id> <distance>" << endl;
     1543              } else {
     1544                SaveFlag = true;
     1545                cout << Verbose(1) << "Removing atoms around " << argv[argptr] << " with radius " << argv[argptr+1] << "." << endl;
     1546                double tmp1 = atof(argv[argptr+1]);
     1547                atom *third = mol->FindAtom(atoi(argv[argptr]));
     1548                atom *first = mol->start;
     1549                if ((third != NULL) && (first != mol->end)) {
     1550                  atom *second = first->next;
     1551                  while(second != mol->end) {
     1552                    first = second;
     1553                    second = first->next;
     1554                    if (first->x.DistanceSquared((const Vector *)&third->x) > tmp1*tmp1) // distance to first above radius ...
     1555                      mol->RemoveAtom(first);
     1556                  }
     1557                } else {
     1558                  cerr << "Removal failed due to missing atoms on molecule or wrong id." << endl;
     1559                }
     1560                argptr+=2;
     1561              }
     1562              break;
    15331563                                                case 't':
    15341564                                                        ExitFlag = 1;
Note: See TracChangeset for help on using the changeset viewer.