Ignore:
Timestamp:
Jun 13, 2012, 5:39:01 PM (13 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:
2382d7
Parents:
e45c1d
git-author:
Frederik Heber <heber@…> (05/10/12 08:38:35)
git-committer:
Frederik Heber <heber@…> (06/13/12 17:39:01)
Message:

Rewrote SurfaceCorrelationAction such that selected atoms are used in replacement of parameter surfacemol.

  • We must not request atoms or molecules inside action parameters. These must be obtained via prior selections.
Location:
src/Actions/AnalysisAction
Files:
2 edited

Legend:

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

    re45c1d r7951b9  
    5555  output.open(params.outputname.get().string().c_str());
    5656  binoutput.open(params.binoutputname.get().string().c_str());
    57   molecule *surfacemol = const_cast<molecule *>(params.Boundary.get());
    58   ASSERT(surfacemol != NULL, "No molecule specified for SurfaceCorrelation.");
     57
     58  // check for selected molecules and create surfaces from them
     59  std::vector<atom *> atoms(World::getInstance().getSelectedAtoms());
     60  LinkedCell_deprecated * LCList = NULL;
     61  Tesselation * TesselStruct = NULL;
    5962  const double radius = 4.;
    6063  double LCWidth = 20.;
     
    6568      LCWidth = 2.*radius;
    6669  }
     70  if ( atoms.size() == 0) {
     71    ELOG(1, "You have not select any atoms.");
     72    return Action::failure;
     73  }
     74  // create adaptor for the selected atoms
     75  PointCloudAdaptor< std::vector<atom *> > cloud(&atoms, std::string("Selected atoms"));
    6776
    68   // get the boundary
    69   class Tesselation *TesselStruct = NULL;
    70   const LinkedCell_deprecated *LCList = NULL;
    71   // find biggest molecule
     77  // create tesselation
     78  LCList = new LinkedCell_deprecated(cloud, 2.*radius);
     79  TesselStruct = new Tesselation;
     80  (*TesselStruct)(cloud, radius);
     81
     82  // correlate
    7283  std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules();
    7384  std::cout << "There are " << molecules.size() << " selected molecules." << std::endl;
    74   PointCloudAdaptor<molecule> cloud(surfacemol, surfacemol->name);
    75   LCList = new LinkedCell_deprecated(cloud, LCWidth);
    76   FindNonConvexBorder(surfacemol, TesselStruct, LCList, radius, NULL);
    7785  CorrelationToSurfaceMap *surfacemap = NULL;
    7886  if (params.periodic.get())
  • src/Actions/AnalysisAction/SurfaceCorrelationAction.def

    re45c1d r7951b9  
    1515// ValueStorage by the token "Z" -> first column: int, Z, "Z"
    1616// "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value
    17 #define paramtypes (std::vector<const element *>)(const molecule *)(double)(double)(double)(boost::filesystem::path)(boost::filesystem::path)(bool)
    18 #define paramreferences (elements)(Boundary)(BinStart)(BinWidth)(BinEnd)(outputname)(binoutputname)(periodic)
    19 #define paramtokens ("elements")("molecule-by-id")("bin-start")("bin-width")("bin-end")("output-file")("bin-output-file")("periodic")
    20 #define paramdescriptions ("set of elements")("index of a molecule")("start of the first bin")("width of the bins")("start of the last bin")("name of the output file")("name of the bin output file")("system is constraint to periodic boundary conditions")
    21 #define paramdefaults (NODEFAULT)(NODEFAULT)(NODEFAULT)("0.5")(NODEFAULT)(NODEFAULT)(NODEFAULT)("0")
     17#define paramtypes (std::vector<const element *>)(double)(double)(double)(boost::filesystem::path)(boost::filesystem::path)(bool)
     18#define paramreferences (elements)(BinStart)(BinWidth)(BinEnd)(outputname)(binoutputname)(periodic)
     19#define paramtokens ("elements")("bin-start")("bin-width")("bin-end")("output-file")("bin-output-file")("periodic")
     20#define paramdescriptions ("set of elements")("start of the first bin")("width of the bins")("start of the last bin")("name of the output file")("name of the bin output file")("system is constraint to periodic boundary conditions")
     21#define paramdefaults (NODEFAULT)(NODEFAULT)("0.5")(NODEFAULT)(NODEFAULT)(NODEFAULT)("0")
    2222
    2323// some defines for all the names, you may use ACTION, STATE and PARAMS
Note: See TracChangeset for help on using the changeset viewer.