- Timestamp:
- Oct 5, 2011, 9:18:21 AM (13 years ago)
- 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:
- c88597
- Parents:
- 2e352f
- git-author:
- Frederik Heber <heber@…> (05/10/11 17:30:45)
- git-committer:
- Frederik Heber <heber@…> (10/05/11 09:18:21)
- Location:
- src/Actions/MoleculeAction
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/MoleculeAction/CreateMicelleAction.cpp
r2e352f r37f9d4 37 37 #include <iostream> 38 38 #include <string> 39 #include <vector> 39 40 40 41 #include "Parser/PdbParser.hpp" … … 56 57 #include "Actions/ValueStorage.hpp" 57 58 58 //#define PATH "/home/dueck/workspace/tenside/tmp/"59 #define AtomVector std::vector <atom *>60 #define MoleculeVector std::vector <molecule *>61 #define AtomList list <atom *>62 63 int Delta2(int x1, int x2);64 double Sqlength (Vector x);65 59 66 60 /** =========== define the function ====================== */ 67 61 Action::state_ptr MoleculeCreateMicelleAction::performCall() 68 62 { 63 typedef std::vector <atom *> AtomVector; 64 typedef std::vector <molecule *> MoleculeVector; 65 69 66 getParametersfromValueStorage(); 70 67 … … 77 74 molecule *stick = *(all.begin()); 78 75 79 // 3.Molekuel zentrieren76 // center molecule 80 77 81 78 stick->CenterOrigin(); 82 79 83 // 4.Haupttraegheitsachse bestimmen80 // determine principal axis system and rotate such that greatest extension is along z axis 84 81 Vector den(0.0,0.0,1.0); 85 82 … … 90 87 */ 91 88 string path; 92 /**/93 /*XyzParser *parserx = new XyzParser;94 {95 std::ofstream file;96 path = PATH;97 path += "/tensidrot.xyz";98 file.open(path.c_str());99 FormatParserStorage::getInstance().getXyz().save(&file, World::getInstance().getAllAtoms());100 file.close();101 }*/102 //5.b: Molekuel um 180 Grad drehen103 89 104 90 Line RotationAxis(Vector(0.0,0.0,0.0), Vector(1.0,0.0,0.0)); // pt is the current Vector of point on surface … … 107 93 (*it)->setPosition(RotationAxis.rotateVector((*it)->getPosition(),M_PI)); 108 94 95 /// Align molecule with its PAS multiple times with the some surface 109 96 110 /*{ 111 std::ofstream file; 112 path = PATH; 113 path += "/tensid2rot.xyz"; 114 file.open(path.c_str()); 115 FormatParserStorage::getInstance().getXyz().save(&file, World::getInstance().getAllAtoms()); 116 file.close(); 117 }*/ 118 119 //6.Molekuel mehrfach strukturiert mit der Haupttraegheitsachse senkrecht zu einer parametrisierten Oberflaeche anordnen 120 121 //6.1. Punkte auf der Oberflaeche bestimmen 122 //Algorithmus entnommen aus "http://www.cgafaq.info/wiki/Evenly_distributed_points_on_sphere" 97 // get points on surface 123 98 124 99 int ka =0; … … 128 103 std::vector<Vector> pt = s.getHomogeneousPointsOnSurface(params.N); 129 104 130 // 6.2.a. "stick" 180 Grad an x-y-Ebene spiegeln105 // mirror along x-y plane 131 106 132 107 for (molecule::iterator it2=stick->begin();it2 !=stick->end();++it2) … … 137 112 } 138 113 139 140 //6.2.b. "stick" um Radius und Molekuelausdehnung in z-Richtung verschieben. 114 // shift molecule by its extension along z axis 141 115 142 116 for (molecule::iterator it2=stick->begin();it2 !=stick->end();++it2) … … 147 121 } 148 122 149 150 151 152 /*{ 153 std::ofstream file; 154 path = PATH; 155 path += "/tensid3rot.xyz"; 156 file.open(path.c_str()); 157 FormatParserStorage::getInstance().getXyz().save(&file, World::getInstance().getAllAtoms()); 158 file.close(); 159 }*/ 160 161 //6.3.Erzeugen einer Molekuelliste, die das Molekuel "stick" "N" mal kopiert und um eine Sphaere herum verteilt 123 // copy molecule N times and rotate it to point radially away from surface 162 124 163 125 //double MYEPSILON=1e-10; … … 165 127 for (ka = 0; ka<pt.size()-1; ka++) 166 128 { 167 cout << "Creating " << ka+1 << " copy of tenside molecule 'stick' with " << stick->getAtomCount() << " atoms, ";129 LOG(1, "STATUS: Creating " << ka+1 << " copy of tenside molecule 'stick' with " << stick->getAtomCount() << " atoms, "); 168 130 molecule *Tensid=stick->CopyMolecule(); 169 131 170 cout << "rotating ...";132 LOG(2, "INFO: Rotating ... "); 171 133 Vector ZAxis(Vector(0.0,0.0,1.0)); 172 134 Vector Axis(pt[ka]); … … 180 142 *(*it2)+=params.center; 181 143 } 182 cout << "done." << endl;144 LOG(2, "INFO: \tdone."); 183 145 184 146 Tensid=NULL; 185 147 } 186 148 187 cout << "shifting " << ka+1 << " copy of tenside molecule, "; 149 // shift molecule at given position on surface 150 151 LOG(1, "STATUS: Shifting " << ka+1 << " copy of tenside molecule, "); 188 152 molecule *Tensid=stick; 189 cout << "rotating ...";153 LOG(2, "INFO: Rotating ..."); 190 154 Vector ZAxis(Vector(0.0,0.0,1.0)); 191 155 Vector Axis(pt[pt.size()-1]); … … 199 163 *(*it2)+=params.center; 200 164 } 201 cout << "done." << endl;165 LOG(2, "INFO: \tdone."); 202 166 203 167 Tensid=NULL; 204 168 205 //GraphSubgraphDissection();206 169 return Action::success; 207 170 } -
src/Actions/MoleculeAction/CreateMicelleAction.def
r2e352f r37f9d4 1 1 /* 2 * CreateMicelle Action.def2 * CreateMicelle.def 3 3 * 4 4 * Created on: Sept 29, 2010 … … 7 7 8 8 // all includes and forward declarations necessary for non-integral types below 9 #include <vector> 9 10 #include "LinearAlgebra/Vector.hpp" 10 11 class CreateMicelle; 11 12 12 // i.e. there is an integer with variable name Z that can be found in 13 // ValueStorage by the token "Z" -> first column: int, Z, "Z" 14 // "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value 15 #define paramtypes (int)(Vector)(double) 16 #define paramtokens ("create-micelle")("position")("radius") 17 #define paramdescriptions ("molecule to copy")("position in R^3 space")("radius of sphere") 13 14 // "undefine" if no parameters are required 15 #define paramtypes (int) (Vector) (double) 16 #define paramtokens ("create-micelle") ("position") ("radius") 17 #define paramdescriptions ("number of molecules")("center of micelle in R^3 space")("radius of mcielle") 18 18 #undef paramdefaults 19 #define paramreferences (N) (center)(radius)19 #define paramreferences (N) (center) (radius) 20 20 21 21 #undef statetypes … … 24 24 // some defines for all the names, you may use ACTION, STATE and PARAMS 25 25 #define CATEGORY Molecule 26 #define ACTIONNAME CreateMicelle 26 27 #define MENUNAME "molecule" 27 #define MENUPOSITION 10 28 #define ACTIONNAME CreateMicelle 28 #define MENUPOSITION 2 29 29 #define TOKEN "create-micelle" 30 30 31 31 // finally the information stored in the ActionTrait specialization 32 #define DESCRIPTION "creates a micelle structure out of a single given molecule"32 #define DESCRIPTION "creates a micelle of molecules" 33 33 #undef SHORTFORM
Note:
See TracChangeset
for help on using the changeset viewer.