Changeset e4b5de for src


Ignore:
Timestamp:
Jun 8, 2010, 1:49:27 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:
8540f0
Parents:
48ab70a
Message:

Case 'f' is now handled by CommandLineUI.

  • FragmentationFragmentationAction::handle() has not been implemented, copied from ParseCommandLineOptions()
  • FIX: FragmentationFragmentationAction had wrong NAME.
  • World has new ExitFlag variable and getter and setter functions.
  • TESTFIX: Fragmentation/3 does not copy all BondFragment* files from pre but runs Fragmentation twice and tests the ExitFlag. This makes the test more independent and closer to what it's suppose to test (i.e. iterative fragmentation with increasing order).
  • TESTFIX: removed all Fragmentation/3/pre/BondFragment* files
  • FIX: CommandLineWindow::populateFragmentationActions() was missing two of its three actions still.
Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/FragmentationAction/FragmentationAction.cpp

    r48ab70a re4b5de  
    2525#include "Actions/MapOfActions.hpp"
    2626
    27 const char FragmentationFragmentationAction::NAME[] = "subspace-dissect";
     27const char FragmentationFragmentationAction::NAME[] = "fragment-mol";
    2828
    2929FragmentationFragmentationAction::FragmentationFragmentationAction() :
     
    3636Action::state_ptr FragmentationFragmentationAction::performCall() {
    3737  Dialog *dialog = UIFactory::getInstance().makeDialog();
     38  clock_t start,end;
     39  molecule *mol = NULL;
     40  double distance = -1.;
     41  int order = 0;
     42  config *configuration = World::getInstance().getConfig();
     43  int ExitFlag = 0;
    3844
    39   dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME));
     45  cout << "pre-dialog"<< endl;
     46  dialog->queryMolecule(NAME, &mol, MapOfActions::getInstance().getDescription(NAME));
     47  dialog->queryDouble("distance", &distance, MapOfActions::getInstance().getDescription("distance"));
     48  dialog->queryInt("order", &order, MapOfActions::getInstance().getDescription("order"));
    4049
    4150  if(dialog->display()) {
     51    cout << "POST-dialog"<< endl;
     52    ASSERT(mol != NULL, "No molecule has been picked for fragmentation.");
     53    DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with bond distance " << distance << " angstroem, order of " << order << "." << endl);
     54    DoLog(0) && (Log() << Verbose(0) << "Creating connection matrix..." << endl);
     55    start = clock();
     56    mol->CreateAdjacencyList(distance, configuration->GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL);
     57    DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl);
     58    if (mol->hasBondStructure()) {
     59      ExitFlag = mol->FragmentMolecule(order, configuration);
     60    }
     61    World::getInstance().setExitFlag(ExitFlag);
     62    end = clock();
     63    DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl);
    4264    delete dialog;
    4365    return Action::success;
  • src/Actions/MapOfActions.cpp

    r48ab70a re4b5de  
    120120  DescriptionMap["MaxDistance"] = "maximum distance in space";
    121121  DescriptionMap["molecule-by-id"] = "index of a molecule";
     122  DescriptionMap["order"] = "order of a discretization, dissection, ...";
    122123  DescriptionMap["output-file"] = "name of the output file";
    123124  DescriptionMap["periodic"] = "system is constraint to periodic boundary conditions (y/n)";
     
    216217  TypeMap["MaxDistance"] = Double;
    217218  TypeMap["molecule-by-id"] = Molecule;
     219  TypeMap["order"] = Integer;
    218220  TypeMap["output-file"] = String;
    219221  TypeMap["periodic"] = Boolean;
     
    241243//      generic.insert("fastparsing");
    242244  generic.insert("fill-molecule");
    243 //  generic.insert("fragment-mol");
     245  generic.insert("fragment-mol");
    244246  generic.insert("help");
    245247//      generic.insert("linear-interpolate");
     
    285287
    286288    // hidden arguments
    287 //  generic.insert("distance");
    288     generic.insert("DoRotate");
    289     generic.insert("distances");
    290     generic.insert("lengths");
    291     generic.insert("MaxDistance");
    292     generic.insert("molecule-by-id");
     289  generic.insert("distance");
     290  generic.insert("DoRotate");
     291  generic.insert("distances");
     292  generic.insert("lengths");
     293  generic.insert("MaxDistance");
     294  generic.insert("molecule-by-id");
     295  generic.insert("order");
    293296}
    294297
  • src/UIElements/CommandLineUI/CommandLineWindow.cpp

    r48ab70a re4b5de  
    2626#include "Actions/FragmentationAction/DepthFirstSearchAction.hpp"
    2727#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
     28#include "Actions/FragmentationAction/FragmentationAction.hpp"
    2829#include "Actions/MoleculeAction/BondFileAction.hpp"
    2930#include "Actions/MoleculeAction/ChangeNameAction.hpp"
     
    119120{
    120121  new FragmentationDepthFirstSearchAction();
     122  new FragmentationFragmentationAction();
     123  new FragmentationSubgraphDissectionAction();
    121124}
    122125
  • src/World.cpp

    r48ab70a re4b5de  
    9696};
    9797
     98int World::getExitFlag() {
     99  return ExitFlag;
     100}
     101
     102void World::setExitFlag(int flag) {
     103  if (ExitFlag < flag)
     104    ExitFlag = flag;
     105}
    98106
    99107/******************** Methods to change World state *********************/
     
    279287    periode(new periodentafel),
    280288    configuration(new config),
     289    ExitFlag(0),
    281290    atoms(),
    282291    currAtomId(0),
  • src/World.hpp

    r48ab70a re4b5de  
    142142  void setDefaultName(char * name);
    143143
     144  /*
     145   * get the ExitFlag
     146   */
     147  int getExitFlag();
     148
     149  /*
     150   * set the ExitFlag
     151   */
     152  void setExitFlag(int flag);
     153
    144154  /***** Methods to work with the World *****/
    145155
     
    244254  static double *cell_size;
    245255  static char *defaultName;
     256  int ExitFlag;
    246257public:
    247258  AtomSet atoms;
  • src/builder.cpp

    r48ab70a re4b5de  
    22372237            case 'f':
    22382238              if (ExitFlag == 0) ExitFlag = 1;
    2239               if ((argptr+1 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1]))) {
     2239              if ((argptr+1 >= argc) || (argv[argptr][0] == '-')) {
    22402240                ExitFlag = 255;
    22412241                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for fragmentation: -f <max. bond distance> <bond order>" << endl);
    22422242                performCriticalExit();
    22432243              } else {
    2244                 DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with bond distance " << argv[argptr] << " angstroem, order of " << argv[argptr+1] << "." << endl);
    2245                 DoLog(0) && (Log() << Verbose(0) << "Creating connection matrix..." << endl);
    2246                 start = clock();
    2247                 mol->CreateAdjacencyList(atof(argv[argptr]), configuration.GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL);
    2248                 DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl);
    2249                 if (mol->hasBondStructure()) {
    2250                   ExitFlag = mol->FragmentMolecule(atoi(argv[argptr+1]), &configuration);
    2251                 }
    2252                 end = clock();
    2253                 DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl);
    2254                 argptr+=2;
     2244                ArgcList.insert(argptr-1);
     2245                ArgcList.insert(argptr);
     2246                ArgcList.insert(argptr+1);
     2247                ArgcList.insert(argptr+2);
     2248                ArgcList.insert(argptr+3);
     2249                ArgcList.insert(argptr+4);
     2250                argptr+=5;
    22552251              }
    22562252              break;
     
    24092405      // handle arguments by ParseCommandLineOptions()
    24102406      ExitFlag = ParseCommandLineOptions(argc,argv,World::getInstance().getMolecules(),World::getInstance().getPeriode(),*World::getInstance().getConfig(), &ConfigFileName, ArgcList);
     2407      World::getInstance().setExitFlag(ExitFlag);
    24112408      // copy all remaining arguments to a new argv
    24122409      Arguments = new char *[ArgcList.size()];
     
    24492446  delete[](ConfigFileName);
    24502447
     2448  ExitFlag = World::getInstance().getExitFlag();
    24512449  return (ExitFlag == 1 ? 0 : ExitFlag);
    24522450}
Note: See TracChangeset for help on using the changeset viewer.