Ignore:
Timestamp:
Jun 16, 2010, 12:24:21 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
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:
492279
Parents:
f8e486 (diff), 980dd6 (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.
Message:

Broken: Merge commit 'Gitosis/stable' into stable

Conflicts:

molecuilder/src/Actions/AnalysisAction/PairCorrelationToPointAction.cpp
molecuilder/src/Actions/AnalysisAction/PairCorrelationToSurfaceAction.cpp
molecuilder/src/Makefile.am

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/AnalysisAction/PairCorrelationAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/AnalysisAction/PairCorrelationAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "analysis_correlation.hpp"
     12#include "boundary.hpp"
     13#include "linkedcell.hpp"
    1314#include "log.hpp"
    1415#include "element.hpp"
     16#include "molecule.hpp"
    1517#include "periodentafel.hpp"
     18#include "vector.hpp"
    1619#include "World.hpp"
    1720
     
    3740  Dialog *dialog = UIFactory::getInstance().makeDialog();
    3841  int ranges[3] = {1, 1, 1};
     42  double BinEnd = 0.;
    3943  double BinStart = 0.;
    40   double BinEnd = 0.;
     44  double BinWidth = 0.;
     45  molecule *Boundary = NULL;
    4146  string outputname;
    4247  string binoutputname;
     
    4449  ofstream output;
    4550  ofstream binoutput;
    46   const element *elemental1;
    47   const element *elemental2;
     51  std::vector< element *> elements;
     52  string type;
     53  Vector Point;
     54  BinPairMap *binmap = NULL;
     55  MoleculeListClass *molecules = World::getInstance().getMolecules();
    4856
    49   dialog->queryElement("elements", &elemental1, MapOfActions::getInstance().getDescription("elements"));
    50   dialog->queryElement("elements", &elemental2, MapOfActions::getInstance().getDescription("elements"));
     57  // first dialog: Obtain which type of correlation
     58  dialog->queryString(NAME, &type, MapOfActions::getInstance().getDescription(NAME));
     59  if(dialog->display()) {
     60    delete dialog;
     61  } else {
     62    delete dialog;
     63    return Action::failure;
     64  }
     65
     66  // second dialog: Obtain parameters specific to this type
     67  dialog = UIFactory::getInstance().makeDialog();
     68  if (type == "P")
     69    dialog->queryVector("position", &Point, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription("position"));
     70  if (type == "S")
     71    dialog->queryMolecule("molecule-by-id", &Boundary, MapOfActions::getInstance().getDescription("molecule-by-id"));
     72  dialog->queryElement("elements", &elements, MapOfActions::getInstance().getDescription("elements"));
    5173  dialog->queryDouble("bin-start", &BinStart, MapOfActions::getInstance().getDescription("bin-start"));
     74  dialog->queryDouble("bin-width", &BinWidth, MapOfActions::getInstance().getDescription("bin-width"));
    5275  dialog->queryDouble("bin-end", &BinEnd, MapOfActions::getInstance().getDescription("bin-end"));
    5376  dialog->queryString("output-file", &outputname, MapOfActions::getInstance().getDescription("output-file"));
     
    5982    binoutput.open(binoutputname.c_str());
    6083    PairCorrelationMap *correlationmap = NULL;
    61     if (periodic)
    62       correlationmap = PeriodicPairCorrelation(World::getInstance().getMolecules(), elemental1, elemental2, ranges);
    63     else
    64       correlationmap = PairCorrelation(World::getInstance().getMolecules(), elemental1, elemental2);
    65     //OutputCorrelationToSurface(&output, correlationmap);
    66     BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd );
     84    if (type == "E") {
     85      PairCorrelationMap *correlationmap = NULL;
     86      if (periodic)
     87        correlationmap = PeriodicPairCorrelation(World::getInstance().getMolecules(), elements, ranges);
     88      else
     89        correlationmap = PairCorrelation(World::getInstance().getMolecules(), elements);
     90      //OutputCorrelationToSurface(&output, correlationmap);
     91      binmap = BinData( correlationmap, BinWidth, BinStart, BinEnd );
     92    } else if (type == "P")  {
     93      cout << "Point to correlate to is  " << Point << endl;
     94      CorrelationToPointMap *correlationmap = NULL;
     95      if (periodic)
     96        correlationmap  = PeriodicCorrelationToPoint(molecules, elements, &Point, ranges);
     97      else
     98        correlationmap = CorrelationToPoint(molecules, elements, &Point);
     99      //OutputCorrelationToSurface(&output, correlationmap);
     100      binmap = BinData( correlationmap, BinWidth, BinStart, BinEnd );
     101    } else if (type == "S") {
     102      ASSERT(Boundary != NULL, "No molecule specified for SurfaceCorrelation.");
     103      const double radius = 4.;
     104      double LCWidth = 20.;
     105      if (BinEnd > 0) {
     106        if (BinEnd > 2.*radius)
     107            LCWidth = BinEnd;
     108        else
     109          LCWidth = 2.*radius;
     110      }
     111
     112      // get the boundary
     113      class Tesselation *TesselStruct = NULL;
     114      const LinkedCell *LCList = NULL;
     115      // find biggest molecule
     116      int counter  = molecules->ListOfMolecules.size();
     117      bool *Actives = new bool[counter];
     118      counter = 0;
     119      for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
     120        Actives[counter++] = (*BigFinder)->ActiveFlag;
     121        (*BigFinder)->ActiveFlag = (*BigFinder == Boundary) ? false : true;
     122      }
     123      LCList = new LinkedCell(Boundary, LCWidth);
     124      FindNonConvexBorder(Boundary, TesselStruct, LCList, radius, NULL);
     125      CorrelationToSurfaceMap *surfacemap = NULL;
     126      if (periodic)
     127        surfacemap = PeriodicCorrelationToSurface( molecules, elements, TesselStruct, LCList, ranges);
     128      else
     129        surfacemap = CorrelationToSurface( molecules, elements, TesselStruct, LCList);
     130      OutputCorrelationToSurface(&output, surfacemap);
     131      // check whether radius was appropriate
     132      {
     133        double start; double end;
     134        GetMinMax( surfacemap, start, end);
     135        if (LCWidth < end)
     136          DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell width is smaller than the found range of values! Bins can only be correct up to: " << radius << "." << endl);
     137      }
     138      binmap = BinData( surfacemap, BinWidth, BinStart, BinEnd );
     139    } else
     140      return Action::failure;
    67141    OutputCorrelation ( &binoutput, binmap );
    68142    output.close();
Note: See TracChangeset for help on using the changeset viewer.