Ignore:
Timestamp:
Aug 7, 2010, 12:07:04 PM (15 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, Candidate_v1.7.0, 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:
2d292d
Parents:
8d6d31 (diff), d74077 (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:

Merge branch 'AtomicPositionEncapsulation' into stable

Conflicts:

src/Actions/AtomAction/ChangeElementAction.cpp
src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp
src/Makefile.am
src/UIElements/TextUI/TextDialog.cpp
src/analysis_correlation.hpp
src/atom.cpp
src/atom_atominfo.hpp
src/bond.cpp
src/boundary.cpp
src/molecule_geometry.cpp
src/tesselation.cpp
src/tesselationhelpers.cpp
src/triangleintersectionlist.cpp
src/unittests/Makefile.am

  • fixed #includes due to moves to Helpers and LinearAlgebra
  • moved VectorInterface.* and vector_ops.* to LinearAlgebra
  • no more direct access of atom::node, remapped to set/getPosition()
  • no more direct access to atom::type, remapped to set/getType() (also in atom due to derivation and atominfo::AtomicElement is private not protected).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tesselationhelpers.cpp

    r8d6d31 r8f4df1  
    1010#include <fstream>
    1111
     12#include "BoundaryLineSet.hpp"
     13#include "BoundaryPointSet.hpp"
     14#include "BoundaryPolygonSet.hpp"
     15#include "BoundaryTriangleSet.hpp"
     16#include "CandidateForTesselation.hpp"
    1217#include "Helpers/Info.hpp"
    1318#include "linkedcell.hpp"
     
    1823#include "LinearAlgebra/Vector.hpp"
    1924#include "LinearAlgebra/Line.hpp"
    20 #include "vector_ops.hpp"
     25#include "LinearAlgebra/vector_ops.hpp"
    2126#include "Helpers/Verbose.hpp"
    2227#include "LinearAlgebra/Plane.hpp"
     
    144149 * \param *c third point
    145150 */
    146 void GetCenterofCircumcircle(Vector * const Center, const Vector &a, const Vector &b, const Vector &c)
     151void GetCenterofCircumcircle(Vector &Center, const Vector &a, const Vector &b, const Vector &c)
    147152{
    148153        Info FunctionInfo(__func__);
     
    156161  helper[2] = SideC.NormSquared()*(SideA.NormSquared()+SideB.NormSquared() - SideC.NormSquared());
    157162
    158   Center->Zero();
    159   *Center += helper[0] * a;
    160   *Center += helper[1] * b;
    161   *Center += helper[2] * c;
    162   Center->Scale(1./(helper[0]+helper[1]+helper[2]));
    163   Log() << Verbose(1) << "INFO: Center (2nd algo) is at " << *Center << "." << endl;
     163  Center.Zero();
     164  Center += helper[0] * a;
     165  Center += helper[1] * b;
     166  Center += helper[2] * c;
     167  Center.Scale(1./(helper[0]+helper[1]+helper[2]));
     168  Log() << Verbose(1) << "INFO: Center (2nd algo) is at " << Center << "." << endl;
    164169};
    165170
     
    388393 * @return point which is second closest to the provided one
    389394 */
    390 TesselPoint* FindSecondClosestTesselPoint(const Vector* Point, const LinkedCell* const LC)
     395TesselPoint* FindSecondClosestTesselPoint(const Vector& Point, const LinkedCell* const LC)
    391396{
    392397        Info FunctionInfo(__func__);
     
    412417        if (List != NULL) {
    413418          for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    414             helper = (*Point) - (*(*Runner)->node);
     419            helper = (Point) - ((*Runner)->getPosition());
    415420            double currentNorm = helper. Norm();
    416421            if (currentNorm < distance) {
     
    441446 * @return point which is closest to the provided one, NULL if none found
    442447 */
    443 TesselPoint* FindClosestTesselPoint(const Vector* Point, TesselPoint *&SecondPoint, const LinkedCell* const LC)
     448TesselPoint* FindClosestTesselPoint(const Vector& Point, TesselPoint *&SecondPoint, const LinkedCell* const LC)
    444449{
    445450        Info FunctionInfo(__func__);
     
    465470        if (List != NULL) {
    466471          for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    467             helper = (*Point) - (*(*Runner)->node);
     472            helper = (Point) - ((*Runner)->getPosition());
    468473            double currentNorm = helper.NormSquared();
    469474            if (currentNorm < distance) {
     
    503508        Info FunctionInfo(__func__);
    504509  // construct the plane of the two baselines (i.e. take both their directional vectors)
    505   Vector Baseline = (*Base->endpoints[1]->node->node) - (*Base->endpoints[0]->node->node);
    506   Vector OtherBaseline = (*OtherBase->endpoints[1]->node->node) - (*OtherBase->endpoints[0]->node->node);
     510  Vector Baseline = (Base->endpoints[1]->node->getPosition()) - (Base->endpoints[0]->node->getPosition());
     511  Vector OtherBaseline = (OtherBase->endpoints[1]->node->getPosition()) - (OtherBase->endpoints[0]->node->getPosition());
    507512  Vector Normal = Baseline;
    508513  Normal.VectorProduct(OtherBaseline);
     
    511516
    512517  // project one offset point of OtherBase onto this plane (and add plane offset vector)
    513   Vector NewOffset = (*OtherBase->endpoints[0]->node->node) - (*Base->endpoints[0]->node->node);
     518  Vector NewOffset = (OtherBase->endpoints[0]->node->getPosition()) - (Base->endpoints[0]->node->getPosition());
    514519  NewOffset.ProjectOntoPlane(Normal);
    515   NewOffset += (*Base->endpoints[0]->node->node);
     520  NewOffset += (Base->endpoints[0]->node->getPosition());
    516521  Vector NewDirection = NewOffset + OtherBaseline;
    517522
    518523  // calculate the intersection between this projected baseline and Base
    519524  Vector *Intersection = new Vector;
    520   Line line1 = makeLineThrough(*(Base->endpoints[0]->node->node),*(Base->endpoints[1]->node->node));
     525  Line line1 = makeLineThrough((Base->endpoints[0]->node->getPosition()),(Base->endpoints[1]->node->getPosition()));
    521526  Line line2 = makeLineThrough(NewOffset, NewDirection);
    522527  *Intersection = line1.getIntersection(line2);
    523   Normal = (*Intersection) - (*Base->endpoints[0]->node->node);
     528  Normal = (*Intersection) - (Base->endpoints[0]->node->getPosition());
    524529  DoLog(1) && (Log() << Verbose(1) << "Found closest point on " << *Base << " at " << *Intersection << ", factor in line is " << fabs(Normal.ScalarProduct(Baseline)/Baseline.NormSquared()) << "." << endl);
    525530
     
    566571      *vrmlfile << "Sphere {" << endl << "  "; // 2 is sphere type
    567572      for (i=0;i<NDIM;i++)
    568         *vrmlfile << Walker->node->at(i)-center->at(i) << " ";
     573        *vrmlfile << Walker->at(i)-center->at(i) << " ";
    569574      *vrmlfile << "\t0.1\t1. 1. 1." << endl; // radius 0.05 and white as colour
    570575      cloud->GoToNext();
     
    576581      for (i=0;i<3;i++) { // print each node
    577582        for (int j=0;j<NDIM;j++)  // and for each node all NDIM coordinates
    578           *vrmlfile << TriangleRunner->second->endpoints[i]->node->node->at(j)-center->at(j) << " ";
     583          *vrmlfile << TriangleRunner->second->endpoints[i]->node->at(j)-center->at(j) << " ";
    579584        *vrmlfile << "\t";
    580585      }
     
    603608    Vector *center = cloud->GetCenter();
    604609    // make the circumsphere's center absolute again
    605     Vector helper = (1./3.) * ((*Tess->LastTriangle->endpoints[0]->node->node) +
    606                                (*Tess->LastTriangle->endpoints[1]->node->node) +
    607                                (*Tess->LastTriangle->endpoints[2]->node->node));
     610    Vector helper = (1./3.) * ((Tess->LastTriangle->endpoints[0]->node->getPosition()) +
     611                               (Tess->LastTriangle->endpoints[1]->node->getPosition()) +
     612                               (Tess->LastTriangle->endpoints[2]->node->getPosition()));
    608613    helper -= (*center);
    609614    // and add to file plus translucency object
     
    638643      *rasterfile << "2" << endl << "  ";  // 2 is sphere type
    639644      for (int j=0;j<NDIM;j++) { // and for each node all NDIM coordinates
    640         const double tmp = Walker->node->at(j)-center->at(j);
     645        const double tmp = Walker->at(j)-center->at(j);
    641646        *rasterfile << ((fabs(tmp) < MYEPSILON) ? 0 : tmp) << " ";
    642647      }
     
    651656      for (i=0;i<3;i++) {  // print each node
    652657        for (int j=0;j<NDIM;j++) { // and for each node all NDIM coordinates
    653           const double tmp = TriangleRunner->second->endpoints[i]->node->node->at(j)-center->at(j);
     658          const double tmp = TriangleRunner->second->endpoints[i]->node->at(j)-center->at(j);
    654659          *rasterfile << ((fabs(tmp) < MYEPSILON) ? 0 : tmp) << " ";
    655660        }
     
    705710      LookupList[Walker->nr] = Counter++;
    706711      for (int i=0;i<NDIM;i++) {
    707         const double tmp = Walker->node->at(i);
     712        const double tmp = Walker->at(i);
    708713        *tecplot << ((fabs(tmp) < MYEPSILON) ? 0 : tmp) << " ";
    709714      }
     
    754759    TriangleSet *triangles = TesselStruct->GetAllTriangles(PointRunner->second);
    755760    for (TriangleSet::iterator TriangleRunner = triangles->begin(); TriangleRunner != triangles->end(); ++TriangleRunner) {
    756       totalarea += CalculateAreaofGeneralTriangle(*(*TriangleRunner)->endpoints[0]->node->node, *(*TriangleRunner)->endpoints[1]->node->node, *(*TriangleRunner)->endpoints[2]->node->node);
     761      totalarea += CalculateAreaofGeneralTriangle((*TriangleRunner)->endpoints[0]->node->getPosition() , (*TriangleRunner)->endpoints[1]->node->getPosition() , (*TriangleRunner)->endpoints[2]->node->getPosition());
    757762    }
    758763    ConcavityPerLine *= totalarea;
     
    763768      line = (*TriangleRunner)->GetThirdLine(PointRunner->second);
    764769      triangle = line->GetOtherTriangle(*TriangleRunner);
    765       area = CalculateAreaofGeneralTriangle(*triangle->endpoints[0]->node->node, *triangle->endpoints[1]->node->node, *triangle->endpoints[2]->node->node);
    766       area += CalculateAreaofGeneralTriangle(*(*TriangleRunner)->endpoints[0]->node->node, *(*TriangleRunner)->endpoints[1]->node->node, *(*TriangleRunner)->endpoints[2]->node->node);
     770      area = CalculateAreaofGeneralTriangle(triangle->endpoints[0]->node->getPosition() , triangle->endpoints[1]->node->getPosition() , triangle->endpoints[2]->node->getPosition());
     771      area += CalculateAreaofGeneralTriangle((*TriangleRunner)->endpoints[0]->node->getPosition() , (*TriangleRunner)->endpoints[1]->node->getPosition() , (*TriangleRunner)->endpoints[2]->node->getPosition());
    767772      area *= -line->CalculateConvexity();
    768773      if (area > 0)
     
    797802    distance = 0.;
    798803    for (TriangleMap::const_iterator TriangleRunner = Convex->TrianglesOnBoundary.begin(); TriangleRunner != Convex->TrianglesOnBoundary.end(); TriangleRunner++) {
    799       const double CurrentDistance = Convex->GetDistanceSquaredToTriangle(*PointRunner->second->node->node, TriangleRunner->second);
     804      const double CurrentDistance = Convex->GetDistanceSquaredToTriangle(PointRunner->second->node->getPosition() , TriangleRunner->second);
    800805      if (CurrentDistance < distance)
    801806        distance = CurrentDistance;
Note: See TracChangeset for help on using the changeset viewer.