source: src/Actions/TesselationAction/NonConvexEnvelopeAction.cpp@ 1024cb

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
Last change on this file since 1024cb was 1024cb, checked in by Frederik Heber <heber@…>, 15 years ago

Merge commit 'jupiter/MoleculeStartEndSwitch' into CommandLineActionMapping

Conflicts:

molecuilder/src/Makefile.am
molecuilder/src/builder.cpp
molecuilder/src/config.cpp
molecuilder/src/helpers.hpp
molecuilder/src/molecule.cpp
molecuilder/src/molecule_dynamics.cpp
molecuilder/src/molecule_fragmentation.cpp
molecuilder/src/molecule_geometry.cpp
molecuilder/src/molecule_graph.cpp
molecuilder/src/moleculelist.cpp
molecuilder/src/unittests/AnalysisCorrelationToPointUnitTest.cpp
molecuilder/src/unittests/listofbondsunittest.cpp

Integration of MoleculeStartEndSwitch had the following consequences:

  • no more AtomCount -> getAtomCount()
  • no more start/end -> begin(), end() and iterator
  • no more decent ordering in atomic ids (hence, Simple_configuration/8 and Domain/5, Domain/6 now check by comparing sorted xyz, not confs)

There is still a huge problem with bonds. One test runs into an endless loop.

Signed-off-by: Frederik Heber <heber@…>

  • Property mode set to 100644
File size: 3.4 KB
Line 
1/*
2 * NonConvexEnvelopeAction.cpp
3 *
4 * Created on: May 10, 2010
5 * Author: heber
6 */
7
8#include "Actions/TesselationAction/NonConvexEnvelopeAction.hpp"
9
10#include <iostream>
11#include <string>
12
13using namespace std;
14
15#include "UIElements/UIFactory.hpp"
16#include "UIElements/Dialog.hpp"
17#include "Actions/MapOfActions.hpp"
18
19#include "atom.hpp"
20#include "boundary.hpp"
21#include "linkedcell.hpp"
22#include "log.hpp"
23#include "molecule.hpp"
24#include "verbose.hpp"
25#include "World.hpp"
26
27/****** TesselationNonConvexEnvelopeAction *****/
28
29// memento to remember the state when undoing
30
31//class TesselationNonConvexEnvelopeState : public ActionState {
32//public:
33// TesselationNonConvexEnvelopeState(molecule* _mol,std::string _lastName) :
34// mol(_mol),
35// lastName(_lastName)
36// {}
37// molecule* mol;
38// std::string lastName;
39//};
40
41const char TesselationNonConvexEnvelopeAction::NAME[] = "nonconvex-envelope";
42
43TesselationNonConvexEnvelopeAction::TesselationNonConvexEnvelopeAction() :
44 Action(NAME)
45{}
46
47TesselationNonConvexEnvelopeAction::~TesselationNonConvexEnvelopeAction()
48{}
49
50Action::state_ptr TesselationNonConvexEnvelopeAction::performCall() {
51 string filename;
52 Dialog *dialog = UIFactory::getInstance().makeDialog();
53 molecule * Boundary = NULL;
54 double SphereRadius = 0;
55 bool Success = false;
56 clock_t start,end;
57
58 dialog->queryDouble(NAME, &SphereRadius, MapOfActions::getInstance().getDescription(NAME));
59 dialog->queryString("output", &filename, MapOfActions::getInstance().getDescription("output"));
60 dialog->queryMolecule("molecule-by-id", &Boundary, MapOfActions::getInstance().getDescription("molecule-by-id"));
61
62 if(dialog->display()) {
63 class Tesselation *T = NULL;
64 const LinkedCell *LCList = NULL;
65 DoLog(0) && (Log() << Verbose(0) << "Evaluating non-convex envelope of molecule." << Boundary->getId() << endl);
66 DoLog(1) && (Log() << Verbose(1) << "Using rolling ball of radius " << SphereRadius << " and storing tecplot data in " << filename << "." << endl);
67 DoLog(1) && (Log() << Verbose(1) << "Specified molecule has " << Boundary->getAtomCount() << " atoms." << endl);
68 start = clock();
69 LCList = new LinkedCell(Boundary, SphereRadius*2.);
70 Success = FindNonConvexBorder(Boundary, T, LCList, SphereRadius, filename.c_str());
71 //FindDistributionOfEllipsoids(T, &LCList, N, number, filename.c_str());
72 end = clock();
73 DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl);
74 delete(LCList);
75 delete(T);
76 delete dialog;
77 if (Success)
78 return Action::success;
79 else
80 return Action::failure;
81 }
82 delete dialog;
83 return Action::failure;
84}
85
86Action::state_ptr TesselationNonConvexEnvelopeAction::performUndo(Action::state_ptr _state) {
87// TesselationNonConvexEnvelopeState *state = assert_cast<TesselationNonConvexEnvelopeState*>(_state.get());
88
89// string newName = state->mol->getName();
90// state->mol->setName(state->lastName);
91
92 return Action::failure;
93}
94
95Action::state_ptr TesselationNonConvexEnvelopeAction::performRedo(Action::state_ptr _state){
96 // Undo and redo have to do the same for this action
97 return performUndo(_state);
98}
99
100bool TesselationNonConvexEnvelopeAction::canUndo() {
101 return false;
102}
103
104bool TesselationNonConvexEnvelopeAction::shouldUndo() {
105 return false;
106}
107
108const string TesselationNonConvexEnvelopeAction::getName() {
109 return NAME;
110}
Note: See TracBrowser for help on using the repository browser.