Changeset 37f9d4 for src


Ignore:
Timestamp:
Oct 5, 2011, 9:18:21 AM (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:
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)
Message:

Changed some non-standard stuff with CreateMicelleAction.

  • renamed files CreateMicelle -> CreateMicelleAction.
  • rewrote german comments in english.
  • removed #define, replaced by typedefs.
  • removed commented-out code pieces.
  • TESTFIX: regression test 93 failed due to ATOMDATA line being different for tensid.data and water.data. I use the one from tensid.data and re-created the water.data with this line.

Changed due to rebase onto v1.1.3:

  • renaming done before already.
Location:
src/Actions/MoleculeAction
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/MoleculeAction/CreateMicelleAction.cpp

    r2e352f r37f9d4  
    3737#include <iostream>
    3838#include <string>
     39#include <vector>
    3940
    4041#include "Parser/PdbParser.hpp"
     
    5657#include "Actions/ValueStorage.hpp"
    5758
    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);
    6559
    6660/** =========== define the function ====================== */
    6761Action::state_ptr MoleculeCreateMicelleAction::performCall()
    6862{
     63  typedef std::vector <atom *> AtomVector;
     64  typedef std::vector <molecule *> MoleculeVector;
     65
    6966  getParametersfromValueStorage();
    7067       
     
    7774  molecule *stick = *(all.begin());
    7875
    79   //3.Molekuel zentrieren
     76  // center molecule
    8077
    8178  stick->CenterOrigin();
    8279
    83   //4.Haupttraegheitsachse bestimmen
     80  // determine principal axis system and rotate such that greatest extension is along z axis
    8481  Vector den(0.0,0.0,1.0);
    8582
     
    9087  */
    9188  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 drehen
    10389
    10490  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
     
    10793    (*it)->setPosition(RotationAxis.rotateVector((*it)->getPosition(),M_PI));
    10894
     95  /// Align molecule with its PAS multiple times with the some surface
    10996
    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
    12398
    12499  int ka =0;
     
    128103  std::vector<Vector> pt = s.getHomogeneousPointsOnSurface(params.N);
    129104
    130   //6.2.a. "stick" 180 Grad an x-y-Ebene spiegeln
     105  // mirror along x-y plane
    131106
    132107  for (molecule::iterator it2=stick->begin();it2 !=stick->end();++it2)
     
    137112  }
    138113
    139 
    140   //6.2.b. "stick" um Radius und Molekuelausdehnung in z-Richtung verschieben.
     114  // shift molecule by its extension along z axis
    141115
    142116  for (molecule::iterator it2=stick->begin();it2 !=stick->end();++it2)
     
    147121  }
    148122
    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
    162124
    163125  //double MYEPSILON=1e-10;
     
    165127  for (ka = 0; ka<pt.size()-1; ka++)
    166128  {
    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, ");
    168130          molecule *Tensid=stick->CopyMolecule();
    169131
    170           cout << "rotating ...";
     132          LOG(2, "INFO: Rotating ... ");
    171133    Vector ZAxis(Vector(0.0,0.0,1.0));
    172134    Vector Axis(pt[ka]);
     
    180142      *(*it2)+=params.center;
    181143    }
    182     cout << "done." << endl;
     144    LOG(2, "INFO: \tdone.");
    183145
    184146    Tensid=NULL;
    185147  }
    186148
    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, ");
    188152  molecule *Tensid=stick;
    189   cout << "rotating ...";
     153  LOG(2, "INFO: Rotating ...");
    190154  Vector ZAxis(Vector(0.0,0.0,1.0));
    191155  Vector Axis(pt[pt.size()-1]);
     
    199163    *(*it2)+=params.center;
    200164  }
    201   cout << "done." << endl;
     165  LOG(2, "INFO: \tdone.");
    202166
    203167  Tensid=NULL;
    204168
    205   //GraphSubgraphDissection();
    206169  return Action::success;
    207170}
  • src/Actions/MoleculeAction/CreateMicelleAction.def

    r2e352f r37f9d4  
    11/*
    2  * CreateMicelleAction.def
     2 * CreateMicelle.def
    33 *
    44 *  Created on: Sept 29, 2010
     
    77
    88// all includes and forward declarations necessary for non-integral types below
     9#include <vector>
    910#include "LinearAlgebra/Vector.hpp"
    1011class CreateMicelle;
    1112
    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")
    1818#undef paramdefaults
    19 #define paramreferences (N)(center)(radius)
     19#define paramreferences (N) (center) (radius)
    2020
    2121#undef statetypes
     
    2424// some defines for all the names, you may use ACTION, STATE and PARAMS
    2525#define CATEGORY Molecule
     26#define ACTIONNAME CreateMicelle
    2627#define MENUNAME "molecule"
    27 #define MENUPOSITION 10
    28 #define ACTIONNAME CreateMicelle
     28#define MENUPOSITION 2
    2929#define TOKEN "create-micelle"
    3030
    3131// 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"
    3333#undef SHORTFORM
Note: See TracChangeset for help on using the changeset viewer.