Changes in / [0af58f:551a58]


Ignore:
Files:
18 added
49 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r0af58f r551a58  
    2525
    2626# ctags files
    27 tags
     27*tags*
    2828
    2929# exclude automake generated stuff
  • molecuilder/src/Makefile.am

    r0af58f r551a58  
    11ATOMSOURCE = atom.cpp atom_atominfo.cpp atom_bondedparticle.cpp atom_bondedparticleinfo.cpp atom_graphnode.cpp atom_graphnodeinfo.cpp atom_particleinfo.cpp atom_trajectoryparticle.cpp atom_trajectoryparticleinfo.cpp
    22ATOMHEADER = atom.hpp atom_atominfo.hpp atom_bondedparticle.hpp atom_bondedparticleinfo.hpp atom_graphnode.hpp atom_graphnodeinfo.hpp atom_particleinfo.hpp atom_trajectoryparticle.hpp atom_trajectoryparticleinfo.hpp
     3
     4LINALGSOURCE = gslmatrix.cpp gslvector.cpp linearsystemofequations.cpp
     5LINALGHEADER = gslmatrix.hpp gslvector.hpp linearsystemofequations.hpp
    36
    47ANALYSISSOURCE = analysis_bonds.cpp analysis_correlation.cpp
     
    1114INCLUDES = -I$(top_srcdir)/src/unittests
    1215
    13 noinst_LIBRARIES = libmolecuilder.a
     16noinst_LIBRARIES = libmolecuilder.a libgslwrapper.a
    1417bin_PROGRAMS = molecuilder joiner analyzer
    1518molecuilderdir = ${bindir}
    1619libmolecuilder_a_SOURCES = ${SOURCE} ${HEADER}
     20libgslwrapper_a_SOURCES = ${LINALGSOURCE} ${LINALGHEADER}
    1721molecuilder_DATA = elements.db valence.db orbitals.db Hbonddistance.db Hbondangle.db
    1822molecuilder_LDFLAGS = $(BOOST_LIB)
    1923molecuilder_SOURCES = builder.cpp
    20 molecuilder_LDADD = libmolecuilder.a
     24molecuilder_LDADD = libmolecuilder.a libgslwrapper.a
    2125joiner_SOURCES = joiner.cpp datacreator.cpp parser.cpp datacreator.hpp helpers.hpp parser.hpp periodentafel.hpp
    2226joiner_LDADD = libmolecuilder.a
     
    2832FORCE:
    2933$(srcdir)/.git-version: FORCE
    30         @if (test -d $(top_srcdir)/../.git && cd $(srcdir) && git describe --tags HEAD) > .git-version-t 2>/dev/null \
     34        @if (test -d $(top_srcdir)/../.git && cd $(srcdir) && git describe HEAD) > .git-version-t 2>/dev/null \
    3135          && ! diff .git-version-t $(srcdir)/.git-version >/dev/null 2>&1; then \
    3236          mv -f .git-version-t $(srcdir)/.git-version; \
  • molecuilder/src/analysis_correlation.cpp

    r0af58f r551a58  
    1010#include "analysis_correlation.hpp"
    1111#include "element.hpp"
     12#include "info.hpp"
    1213#include "log.hpp"
    1314#include "molecule.hpp"
     
    2829PairCorrelationMap *PairCorrelation(MoleculeListClass * const &molecules, const element * const type1, const element * const type2 )
    2930{
     31  Info FunctionInfo(__func__);
    3032  PairCorrelationMap *outmap = NULL;
    3133  double distance = 0.;
     
    7779PairCorrelationMap *PeriodicPairCorrelation(MoleculeListClass * const &molecules, const element * const type1, const element * const type2, const int ranges[NDIM] )
    7880{
     81  Info FunctionInfo(__func__);
    7982  PairCorrelationMap *outmap = NULL;
    8083  double distance = 0.;
     
    154157CorrelationToPointMap *CorrelationToPoint(MoleculeListClass * const &molecules, const element * const type, const Vector *point )
    155158{
     159  Info FunctionInfo(__func__);
    156160  CorrelationToPointMap *outmap = NULL;
    157161  double distance = 0.;
     
    190194CorrelationToPointMap *PeriodicCorrelationToPoint(MoleculeListClass * const &molecules, const element * const type, const Vector *point, const int ranges[NDIM] )
    191195{
     196  Info FunctionInfo(__func__);
    192197  CorrelationToPointMap *outmap = NULL;
    193198  double distance = 0.;
     
    243248CorrelationToSurfaceMap *CorrelationToSurface(MoleculeListClass * const &molecules, const element * const type, const Tesselation * const Surface, const LinkedCell *LC )
    244249{
     250  Info FunctionInfo(__func__);
    245251  CorrelationToSurfaceMap *outmap = NULL;
    246252  double distance = 0;
     
    261267        Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
    262268        if ((type == NULL) || (Walker->type == type)) {
    263           triangle = Surface->FindClosestTriangleToPoint(Walker->node, LC );
     269          triangle = Surface->FindClosestTriangleToVector(Walker->node, LC );
    264270          if (triangle != NULL) {
    265271            distance = DistanceToTrianglePlane(Walker->node, triangle);
     
    288294CorrelationToSurfaceMap *PeriodicCorrelationToSurface(MoleculeListClass * const &molecules, const element * const type, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] )
    289295{
     296  Info FunctionInfo(__func__);
    290297  CorrelationToSurfaceMap *outmap = NULL;
    291298  double distance = 0;
     
    320327                checkX.AddVector(&periodicX);
    321328                checkX.MatrixMultiplication(FullMatrix);
    322                 triangle = Surface->FindClosestTriangleToPoint(&checkX, LC );
     329                triangle = Surface->FindClosestTriangleToVector(&checkX, LC );
    323330                if (triangle != NULL) {
    324331                  distance = DistanceToTrianglePlane(&checkX, triangle);
     
    342349double GetBin ( const double value, const double BinWidth, const double BinStart )
    343350{
     351  Info FunctionInfo(__func__);
    344352  double bin =(double) (floor((value - BinStart)/BinWidth));
    345353  return (bin*BinWidth+BinStart);
     
    353361void OutputCorrelation( ofstream * const file, const BinPairMap * const map )
    354362{
     363  Info FunctionInfo(__func__);
    355364  *file << "# BinStart\tCount" << endl;
    356365  for (BinPairMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
     
    365374void OutputPairCorrelation( ofstream * const file, const PairCorrelationMap * const map )
    366375{
     376  Info FunctionInfo(__func__);
    367377  *file << "# BinStart\tAtom1\tAtom2" << endl;
    368378  for (PairCorrelationMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
     
    377387void OutputCorrelationToPoint( ofstream * const file, const CorrelationToPointMap * const map )
    378388{
     389  Info FunctionInfo(__func__);
    379390  *file << "# BinStart\tAtom::x[i]-point.x[i]" << endl;
    380391  for (CorrelationToPointMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
     
    392403void OutputCorrelationToSurface( ofstream * const file, const CorrelationToSurfaceMap * const map )
    393404{
     405  Info FunctionInfo(__func__);
    394406  *file << "# BinStart\tTriangle" << endl;
    395407  for (CorrelationToSurfaceMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
  • molecuilder/src/analyzer.cpp

    r0af58f r551a58  
    77
    88//============================ INCLUDES ===========================
     9
     10#include <cstring>
    911
    1012#include "datacreator.hpp"
  • molecuilder/src/bondgraph.cpp

    r0af58f r551a58  
    3535/** Parses the bond lengths in a given file and puts them int a matrix form.
    3636 * Allocates \a MatrixContainer for BondGraph::BondLengthMatrix, using MatrixContainer::ParseMatrix(),
    37  * but only if parsing is successfull. Otherwise variable is left as NULL.
     37 * but only if parsing is successful. Otherwise variable is left as NULL.
    3838 * \param *out output stream for debugging
    3939 * \param filename file with bond lengths to parse
  • molecuilder/src/boundary.cpp

    r0af58f r551a58  
    654654 * \param *out output stream for debugging
    655655 * \param *mol molecule with atoms and bonds
    656  * \param *&TesselStruct Tesselation with boundary triangles
     656 * \param *TesselStruct Tesselation with boundary triangles
    657657 * \param *filename prefix of filename
    658658 * \param *extraSuffix intermediate suffix
    659659 */
    660 void StoreTrianglesinFile(const molecule * const mol, const Tesselation *&TesselStruct, const char *filename, const char *extraSuffix)
     660void StoreTrianglesinFile(const molecule * const mol, const Tesselation * const TesselStruct, const char *filename, const char *extraSuffix)
    661661{
    662662        Info FunctionInfo(__func__);
     
    789789 * \param configuration contains box dimensions
    790790 * \param distance[NDIM] distance between filling molecules in each direction
     791 * \param boundary length of boundary zone between molecule and filling mollecules
     792 * \param epsilon distance to surface which is not filled
    791793 * \param RandAtomDisplacement maximum distance for random displacement per atom
    792794 * \param RandMolDisplacement maximum distance for random displacement per filler molecule
     
    794796 * \return *mol pointer to new molecule with filled atoms
    795797 */
    796 molecule * FillBoxWithMolecule(MoleculeListClass *List, molecule *filler, config &configuration, double distance[NDIM], double RandomAtomDisplacement, double RandomMolDisplacement, bool DoRandomRotation)
     798molecule * FillBoxWithMolecule(MoleculeListClass *List, molecule *filler, config &configuration, const double distance[NDIM], const double boundary, const double RandomAtomDisplacement, const double RandomMolDisplacement, const bool DoRandomRotation)
    797799{
    798800        Info FunctionInfo(__func__);
     
    817819  for (MoleculeList::iterator ListRunner = List->ListOfMolecules.begin(); ListRunner != List->ListOfMolecules.end(); ListRunner++) {
    818820    Log() << Verbose(1) << "Pre-creating linked cell lists for molecule " << *ListRunner << "." << endl;
    819     LCList[i] = new LinkedCell((*ListRunner), 5.); // get linked cell list
    820     if (TesselStruct[i] == NULL) {
    821       Log() << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl;
    822       FindNonConvexBorder((*ListRunner), TesselStruct[i], (const LinkedCell *&)LCList[i], 5., NULL);
    823     }
     821    LCList[i] = new LinkedCell((*ListRunner), 10.); // get linked cell list
     822    Log() << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl;
     823    TesselStruct[i] = NULL;
     824    FindNonConvexBorder((*ListRunner), TesselStruct[i], (const LinkedCell *&)LCList[i], 5., NULL);
    824825    i++;
    825826  }
     
    835836  FillerDistance.Init(distance[0], distance[1], distance[2]);
    836837  FillerDistance.InverseMatrixMultiplication(M);
    837   Log() << Verbose(1) << "INFO: Grid steps are ";
    838   for(int i=0;i<NDIM;i++) {
     838  for(int i=0;i<NDIM;i++)
    839839    N[i] = (int) ceil(1./FillerDistance.x[i]);
    840     Log() << Verbose(1) << N[i];
    841     if (i != NDIM-1)
    842       Log() << Verbose(1)<< ", ";
    843     else
    844       Log() << Verbose(1) << "." << endl;
    845   }
     840  Log() << Verbose(1) << "INFO: Grid steps are " << N[0] << ", " << N[1] << ", " << N[2] << "." << endl;
    846841
    847842  // go over [0,1]^3 filler grid
     
    859854          // get linked cell list
    860855          if (TesselStruct[i] == NULL) {
    861             eLog() << Verbose(1) << "TesselStruct of " << (*ListRunner) << " is NULL. Didn't we pre-create it?" << endl;
     856            eLog() << Verbose(0) << "TesselStruct of " << (*ListRunner) << " is NULL. Didn't we pre-create it?" << endl;
    862857            FillIt = false;
    863858          } else {
    864             FillIt = FillIt && (!TesselStruct[i]->IsInnerPoint(CurrentPosition, LCList[i]));
     859            const double distance = (TesselStruct[i]->GetDistanceSquaredToSurface(CurrentPosition, LCList[i]));
     860            FillIt = FillIt && (distance > boundary*boundary);
     861            if (FillIt) {
     862              Log() << Verbose(1) << "INFO: Position at " << CurrentPosition << " is outer point." << endl;
     863            } else {
     864              Log() << Verbose(1) << "INFO: Position at " << CurrentPosition << " is inner point or within boundary." << endl;
     865              break;
     866            }
    865867            i++;
    866868          }
     
    931933      }
    932934  Free(&M);
     935
     936  // output to file
     937  TesselStruct[0]->LastTriangle = NULL;
     938  StoreTrianglesinFile(Filling, TesselStruct[0], "Tesselated", ".dat");
     939
    933940  for (size_t i=0;i<List->ListOfMolecules.size();i++) {
    934941        delete(LCList[i]);
     
    10411048//  TesselStruct->RemoveDegeneratedTriangles();
    10421049
     1050  // check envelope for consistency
     1051  status = CheckListOfBaselines(TesselStruct);
     1052
     1053  // store before correction
     1054  StoreTrianglesinFile(mol, (const Tesselation *&)TesselStruct, filename, "");
     1055
    10431056  // correct degenerated polygons
    10441057  TesselStruct->CorrectAllDegeneratedPolygons();
  • molecuilder/src/boundary.hpp

    r0af58f r551a58  
    3636#define DEBUG 1
    3737#define DoSingleStepOutput 0
    38 #define SingleStepWidth 1
     38#define SingleStepWidth 10
    3939
    4040#define DistancePair pair < double, atom* >
     
    4949
    5050double ConvexizeNonconvexEnvelope(class Tesselation *&TesselStruct, const molecule * const mol, const char * const filename);
    51 molecule * FillBoxWithMolecule(MoleculeListClass *List, molecule *filler, config &configuration, double distance[NDIM], double RandAtomDisplacement, double RandMolDisplacement, bool DoRandomRotation);
     51molecule * FillBoxWithMolecule(MoleculeListClass *List, molecule *filler, config &configuration, const double distance[NDIM], const double boundary, const double RandomAtomDisplacement, const double RandomMolDisplacement, const bool DoRandomRotation);
    5252void FindConvexBorder(const molecule* const mol, Tesselation *&TesselStruct, const LinkedCell *LCList, const char *filename);
    5353Vector* FindEmbeddingHole(MoleculeListClass *mols, molecule *srcmol);
     
    5858void PrepareClustersinWater(config *configuration, molecule *mol, double ClusterVolume, double celldensity);
    5959bool RemoveAllBoundaryPoints(class Tesselation *&TesselStruct, const molecule * const mol, const char * const filename);
    60 void StoreTrianglesinFile(const molecule * const mol, const Tesselation *&TesselStruct, const char *filename, const char *extraSuffix);
     60void StoreTrianglesinFile(const molecule * const mol, const Tesselation * const TesselStruct, const char *filename, const char *extraSuffix);
    6161double VolumeOfConvexEnvelope(class Tesselation *TesselStruct, class config *configuration);
    6262
  • molecuilder/src/builder.cpp

    r0af58f r551a58  
    4949
    5050using namespace std;
     51
     52#include <cstring>
    5153
    5254#include "analysis_correlation.hpp"
     
    14101412            Log() << Verbose(0) << "\t-B xx xy xz yy yz zz\tBound atoms by domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl;
    14111413            Log() << Verbose(0) << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl;
    1412             Log() << Verbose(0) << "\t-C\tPair Correlation analysis." << endl;
     1414            Log() << Verbose(0) << "\t-C <Z> <output> <bin output>\tPair Correlation analysis." << endl;
    14131415            Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl;
    14141416            Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl;
    14151417            Log() << Verbose(0) << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl;
    14161418            Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl;
    1417             Log() << Verbose(0) << "\t-f/F <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl;
     1419            Log() << Verbose(0) << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl;
     1420            Log() << Verbose(0) << "\t-F <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl;
    14181421            Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl;
    14191422            Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl;
     1423            Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl;
    14201424            Log() << Verbose(0) << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl;
    14211425            Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl;
     
    15751579                else {
    15761580                  Log() << Verbose(2) << "File found and parsed." << endl;
    1577                   // @TODO rather do the dissection afterwards
    1578 //                  mol->SetNameFromFilename(argv[argptr]);
    1579 //                  molecules->ListOfMolecules.remove(mol);
    1580 //                  molecules->DissectMoleculeIntoConnectedSubgraphs(mol,&configuration);
    1581 //                  delete(mol);
    1582 //                  if (molecules->ListOfMolecules.size() != 0) {
    1583 //                    for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++)
    1584 //                      if ((*ListRunner)->ActiveFlag) {
    1585 //                        mol = *ListRunner;
    1586 //                        break;
    1587 //                      }
    1588 //                  }
    15891581                  configPresent = present;
    15901582                }
     
    16651657              //argptr+=1;
    16661658              break;
     1659            case 'I':
     1660              Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl;
     1661              // @TODO rather do the dissection afterwards
     1662              molecules->DissectMoleculeIntoConnectedSubgraphs(mol,&configuration);
     1663              mol = NULL;
     1664              if (molecules->ListOfMolecules.size() != 0) {
     1665                for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++)
     1666                  if ((*ListRunner)->ActiveFlag) {
     1667                    mol = *ListRunner;
     1668                    break;
     1669                  }
     1670              }
     1671              if (mol == NULL) {
     1672                mol = *(molecules->ListOfMolecules.begin());
     1673                mol->ActiveFlag = true;
     1674              }
     1675              break;
    16671676            case 'C':
    16681677              if (ExitFlag == 0) ExitFlag = 1;
     
    16721681                performCriticalExit();
    16731682              } else {
    1674                 SaveFlag = false;
    16751683                ofstream output(argv[argptr+1]);
    16761684                ofstream binoutput(argv[argptr+2]);
     
    16921700                counter = 0;
    16931701                for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
    1694                   Actives[counter] = (*BigFinder)->ActiveFlag;
     1702                  Actives[counter++] = (*BigFinder)->ActiveFlag;
    16951703                  (*BigFinder)->ActiveFlag = (*BigFinder == Boundary) ? false : true;
    16961704                }
     
    17051713                binoutput.close();
    17061714                for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++)
    1707                   (*BigFinder)->ActiveFlag = Actives[counter];
     1715                  (*BigFinder)->ActiveFlag = Actives[counter++];
    17081716                Free(&Actives);
    17091717                delete(LCList);
     
    17281736            case 'F':
    17291737              if (ExitFlag == 0) ExitFlag = 1;
    1730               if (argptr+5 >=argc) {
     1738              if (argptr+6 >=argc) {
    17311739                ExitFlag = 255;
    1732                 eLog() << Verbose(0) << "Not enough or invalid arguments given for filling box with water: -F <dist_x> <dist_y> <dist_z> <randatom> <randmol> <DoRotate>" << endl;
     1740                eLog() << Verbose(0) << "Not enough or invalid arguments given for filling box with water: -F <dist_x> <dist_y> <dist_z> <boundary> <randatom> <randmol> <DoRotate>" << endl;
    17331741                performCriticalExit();
    17341742              } else {
     
    17381746                molecule *filler = new molecule(periode);;
    17391747                molecule *Filling = NULL;
    1740                 atom *second = NULL, *third = NULL;
     1748//                atom *second = NULL, *third = NULL;
    17411749                first = new atom();
    1742                 first->type = periode->FindElement(1);
    1743                 first->x.Init(0.441, -0.143, 0.);
     1750                first->type = periode->FindElement(5);
     1751                first->x.Zero();
    17441752                filler->AddAtom(first);
    1745                 second = new atom();
    1746                 second->type = periode->FindElement(1);
    1747                 second->x.Init(-0.464, 1.137, 0.0);
    1748                 filler->AddAtom(second);
    1749                 third = new atom();
    1750                 third->type = periode->FindElement(8);
    1751                 third->x.Init(-0.464, 0.177, 0.);
    1752                 filler->AddAtom(third);
    1753                 filler->AddBond(first, third, 1);
    1754                 filler->AddBond(second, third, 1);
     1753//                first = new atom();
     1754//                first->type = periode->FindElement(1);
     1755//                first->x.Init(0.441, -0.143, 0.);
     1756//                filler->AddAtom(first);
     1757//                second = new atom();
     1758//                second->type = periode->FindElement(1);
     1759//                second->x.Init(-0.464, 1.137, 0.0);
     1760//                filler->AddAtom(second);
     1761//                third = new atom();
     1762//                third->type = periode->FindElement(8);
     1763//                third->x.Init(-0.464, 0.177, 0.);
     1764//                filler->AddAtom(third);
     1765//                filler->AddBond(first, third, 1);
     1766//                filler->AddBond(second, third, 1);
    17551767                // call routine
    17561768                double distance[NDIM];
    17571769                for (int i=0;i<NDIM;i++)
    17581770                  distance[i] = atof(argv[argptr+i]);
    1759                 Filling = FillBoxWithMolecule(molecules, filler, configuration, distance, atof(argv[argptr+3]), atof(argv[argptr+4]), atoi(argv[argptr+5]));
     1771                Filling = FillBoxWithMolecule(molecules, filler, configuration, distance, atof(argv[argptr+3]), atof(argv[argptr+4]), atof(argv[argptr+5]), atoi(argv[argptr+6]));
    17601772                if (Filling != NULL) {
     1773                  Filling->ActiveFlag = false;
    17611774                  molecules->insert(Filling);
    17621775                }
     
    21072120                if (volume != -1)
    21082121                  ExitFlag = 255;
    2109                   eLog() << Verbose(0) << "Not enough arguments given for suspension: -u <density>" << endl;
     2122                  eLog() << Verbose(0) << "Not enough or invalid arguments given for suspension: -u <density>" << endl;
    21102123                  performCriticalExit();
    21112124              } else {
  • molecuilder/src/config.cpp

    r0af58f r551a58  
    66
    77#include <stdio.h>
     8#include <cstring>
    89
    910#include "atom.hpp"
     
    2728    char number1[8];
    2829    char number2[8];
    29     char *dummy1, *dummy2;
     30    const char *dummy1, *dummy2;
    3031    //Log() << Verbose(0) << s1 << "  " << s2 << endl;
    3132    dummy1 = strchr(s1, '_')+sizeof(char)*5;  // go just after "Ion_Type"
     
    10741075  // don't do this here ...
    10751076  //MolList->DissectMoleculeIntoConnectedSubgraphs(mol,this);
    1076 
    1077   delete(mol);
     1077  //delete(mol);
     1078
    10781079  delete(FileBuffer);
    10791080};
     
    21232124              }
    21242125              line++;
    2125             } while (dummy1 != NULL && (dummy1[0] == '#') || (dummy1[0] == '\n'));
     2126            } while ((dummy1 != NULL) && ((dummy1[0] == '#') || (dummy1[0] == '\n')));
    21262127            dummy = dummy1;
    21272128          } else { // simple int, strings or doubles start in the same line
  • molecuilder/src/helpers.hpp

    r0af58f r551a58  
    7474  x = y;
    7575  y = tmp;
     76};
     77
     78/** returns greater of the two values.
     79 * \param x first value
     80 * \param y second value
     81 * \return greater of the two (by operator>())
     82 */
     83template <typename T> T Max(T x, T y)
     84{
     85  if (x > y)
     86    return x;
     87  else return y;
     88};
     89
     90/** returns smaller of the two values.
     91 * \param x first value
     92 * \param y second value
     93 * \return smaller of the two (by operator<())
     94 */
     95template <typename T> T Min(T x, T y)
     96{
     97  if (x < y)
     98    return x;
     99  else return y;
    76100};
    77101
  • molecuilder/src/joiner.cpp

    r0af58f r551a58  
    77
    88//============================ INCLUDES ===========================
     9
     10#include <cstring>
    911
    1012#include "datacreator.hpp"
  • molecuilder/src/memoryallocator.hpp

    r0af58f r551a58  
    1616#endif
    1717
     18#include <cstdlib>
    1819#include <iostream>
    1920#include <iomanip>
  • molecuilder/src/memoryusageobserver.cpp

    r0af58f r551a58  
    44 * This class represents a Singleton for observing memory usage.
    55 */
     6
     7#include <cstdlib>
    68
    79#include "log.hpp"
  • molecuilder/src/molecule.cpp

    r0af58f r551a58  
    44 *
    55 */
     6
     7#include <cstring>
    68
    79#include "atom.hpp"
     
    587589  else
    588590    molname = filename; // contains no slashes
    589   char *endname = strchr(molname, '.');
     591  const char *endname = strchr(molname, '.');
    590592  if ((endname == NULL) || (endname < molname))
    591593    length = strlen(molname);
  • molecuilder/src/molecule.hpp

    r0af58f r551a58  
    110110  TesselPoint *GetPoint() const ;
    111111  TesselPoint *GetTerminalPoint() const ;
     112  int GetMaxId() const;
    112113  void GoToNext() const ;
    113114  void GoToPrevious() const ;
  • molecuilder/src/molecule_dynamics.cpp

    r0af58f r551a58  
    370370
    371371  // argument minimise the constrained potential in this injective PermutationMap
    372   Log() << Verbose(1) << "Argument minimising the PermutationMap, at current potential " << OldPotential << " ... " << endl;
     372  Log() << Verbose(1) << "Argument minimising the PermutationMap." << endl;
    373373  OldPotential = 1e+10;
    374374  round = 0;
    375375  do {
    376     Log() << Verbose(2) << "Starting round " << ++round << " ... " << endl;
     376    Log() << Verbose(2) << "Starting round " << ++round << ", at current potential " << OldPotential << " ... " << endl;
    377377    OlderPotential = OldPotential;
    378378    do {
  • molecuilder/src/molecule_fragmentation.cpp

    r0af58f r551a58  
    55 *      Author: heber
    66 */
     7
     8#include <cstring>
    79
    810#include "atom.hpp"
  • molecuilder/src/molecule_geometry.cpp

    r0af58f r551a58  
    101101{
    102102  int Num = 0;
    103   atom *ptr = start->next;  // start at first in list
     103  atom *ptr = start;  // start at first in list
    104104
    105105  Center.Zero();
    106106
    107   if (ptr != end) {   //list not empty?
     107  if (ptr->next != end) {   //list not empty?
    108108    while (ptr->next != end) {  // continue with second if present
    109109      ptr = ptr->next;
  • molecuilder/src/molecule_graph.cpp

    r0af58f r551a58  
    11171117  bool status = true;
    11181118  if (ReferenceStack->IsEmpty()) {
    1119     eLog() << Verbose(0) << "ReferenceStack is empty!" << endl;
    1120     performCriticalExit();
     1119    Log() << Verbose(1) << "ReferenceStack is empty!" << endl;
    11211120    return false;
    11221121  }
  • molecuilder/src/molecule_pointcloud.cpp

    r0af58f r551a58  
    5050};
    5151
     52/** Return the greatest index of all atoms in the list.
     53 * \return greatest index
     54 */
     55int molecule::GetMaxId() const
     56{
     57  return last_atom;
     58};
     59
    5260/** Go to next atom.
    5361 * Stops at last one.
  • molecuilder/src/moleculelist.cpp

    r0af58f r551a58  
    44 *
    55 */
     6
     7#include <cstring>
    68
    79#include "atom.hpp"
     
    402404  input.open(line.c_str());
    403405  if (input == NULL) {
    404     eLog() << Verbose(0) << endl << "Unable to open " << line << ", is the directory correct?" << endl;
    405     performCriticalExit();
     406    Log() << Verbose(1) << endl << "Unable to open " << line << ", is the directory correct?" << endl;
    406407    return false;
    407408  }
  • molecuilder/src/parser.cpp

    r0af58f r551a58  
    66
    77// ======================================= INCLUDES ==========================================
     8
     9#include <cstring>
    810
    911#include "helpers.hpp"
     
    158160  //Log() << Verbose(0) << "Opening " << name << " ... "  << input << endl;
    159161  if (input == NULL) {
    160     eLog() << Verbose(0) << endl << "Unable to open " << name << ", is the directory correct?" << endl;
    161     performCriticalExit();
     162    eLog() << Verbose(1) << endl << "Unable to open " << name << ", is the directory correct?" << endl;
     163    //performCriticalExit();
    162164    return false;
    163165  }
  • molecuilder/src/periodentafel.cpp

    r0af58f r551a58  
    99#include <iomanip>
    1010#include <fstream>
     11#include <cstring>
    1112
    1213#include "element.hpp"
  • molecuilder/src/tesselation.cpp

    r0af58f r551a58  
    3535 * \param *Walker TesselPoint this boundary point represents
    3636 */
    37 BoundaryPointSet::BoundaryPointSet(TesselPoint * Walker) :
     37BoundaryPointSet::BoundaryPointSet(TesselPoint * const Walker) :
    3838  LinesCount(0),
    3939  node(Walker),
     
    6161 * \param *line line to add
    6262 */
    63 void BoundaryPointSet::AddLine(class BoundaryLineSet *line)
     63void BoundaryPointSet::AddLine(BoundaryLineSet * const line)
    6464{
    6565        Info FunctionInfo(__func__);
     
    105105 * \param number number of the list
    106106 */
    107 BoundaryLineSet::BoundaryLineSet(class BoundaryPointSet *Point[2], const int number)
     107BoundaryLineSet::BoundaryLineSet(BoundaryPointSet * const Point[2], const int number)
    108108{
    109109        Info FunctionInfo(__func__);
     
    115115  Point[0]->AddLine(this); //Taken out, to check whether we can avoid unwanted double adding.
    116116  Point[1]->AddLine(this); //
     117  // set skipped to false
     118  skipped = false;
     119  // clear triangles list
     120  Log() << Verbose(0) << "New Line with endpoints " << *this << "." << endl;
     121};
     122
     123/** Constructor of BoundaryLineSet with two endpoints.
     124 * Adds line automatically to each endpoints' LineMap
     125 * \param *Point1 first boundary point
     126 * \param *Point2 second boundary point
     127 * \param number number of the list
     128 */
     129BoundaryLineSet::BoundaryLineSet(BoundaryPointSet * const Point1, BoundaryPointSet * const Point2, const int number)
     130{
     131  Info FunctionInfo(__func__);
     132  // set number
     133  Nr = number;
     134  // set endpoints in ascending order
     135  SetEndpointsOrdered(endpoints, Point1, Point2);
     136  // add this line to the hash maps of both endpoints
     137  Point1->AddLine(this); //Taken out, to check whether we can avoid unwanted double adding.
     138  Point2->AddLine(this); //
    117139  // set skipped to false
    118140  skipped = false;
     
    171193 * \param *triangle to add
    172194 */
    173 void BoundaryLineSet::AddTriangle(class BoundaryTriangleSet *triangle)
     195void BoundaryLineSet::AddTriangle(BoundaryTriangleSet * const triangle)
    174196{
    175197        Info FunctionInfo(__func__);
     
    182204 * \return true - common endpoint present, false - not connected
    183205 */
    184 bool BoundaryLineSet::IsConnectedTo(class BoundaryLineSet *line)
     206bool BoundaryLineSet::IsConnectedTo(const BoundaryLineSet * const line) const
    185207{
    186208        Info FunctionInfo(__func__);
     
    197219 * \return true - triangles are convex, false - concave or less than two triangles connected
    198220 */
    199 bool BoundaryLineSet::CheckConvexityCriterion()
     221bool BoundaryLineSet::CheckConvexityCriterion() const
    200222{
    201223        Info FunctionInfo(__func__);
     
    221243  int i=0;
    222244  class BoundaryPointSet *node = NULL;
    223   for(TriangleMap::iterator runner = triangles.begin(); runner != triangles.end(); runner++) {
     245  for(TriangleMap::const_iterator runner = triangles.begin(); runner != triangles.end(); runner++) {
    224246    //Log() << Verbose(0) << "INFO: NormalVector of " << *(runner->second) << " is " << runner->second->NormalVector << "." << endl;
    225247    NormalCheck.AddVector(&runner->second->NormalVector);
     
    264286 * \return true - point is of the line, false - is not
    265287 */
    266 bool BoundaryLineSet::ContainsBoundaryPoint(class BoundaryPointSet *point)
     288bool BoundaryLineSet::ContainsBoundaryPoint(const BoundaryPointSet * const point) const
    267289{
    268290        Info FunctionInfo(__func__);
     
    277299 * \return NULL - if endpoint not contained in BoundaryLineSet, or pointer to BoundaryPointSet otherwise
    278300 */
    279 class BoundaryPointSet *BoundaryLineSet::GetOtherEndpoint(class BoundaryPointSet *point)
     301class BoundaryPointSet *BoundaryLineSet::GetOtherEndpoint(const BoundaryPointSet * const point) const
    280302{
    281303        Info FunctionInfo(__func__);
     
    317339 * \param number number of triangle
    318340 */
    319 BoundaryTriangleSet::BoundaryTriangleSet(class BoundaryLineSet *line[3], int number) :
     341BoundaryTriangleSet::BoundaryTriangleSet(class BoundaryLineSet * const line[3], const int number) :
    320342  Nr(number)
    321343{
     
    376398 * \param &OtherVector direction vector to make normal vector unique.
    377399 */
    378 void BoundaryTriangleSet::GetNormalVector(Vector &OtherVector)
     400void BoundaryTriangleSet::GetNormalVector(const Vector &OtherVector)
    379401{
    380402        Info FunctionInfo(__func__);
     
    388410};
    389411
    390 /** Finds the point on the triangle \a *BTS the line defined by \a *MolCenter and \a *x crosses through.
     412/** Finds the point on the triangle \a *BTS through which the line defined by \a *MolCenter and \a *x crosses.
    391413 * We call Vector::GetIntersectionWithPlane() to receive the intersection point with the plane
    392  * This we test if it's really on the plane and whether it's inside the triangle on the plane or not.
     414 * Thus we test if it's really on the plane and whether it's inside the triangle on the plane or not.
    393415 * The latter is done as follows: We calculate the cross point of one of the triangle's baseline with the line
    394416 * given by the intersection and the third basepoint. Then, we check whether it's on the baseline (i.e. between
     
    400422 * \return true - \a *Intersection contains intersection on plane defined by triangle, false - zero vector if outside of triangle.
    401423 */
    402 bool BoundaryTriangleSet::GetIntersectionInsideTriangle(Vector *MolCenter, Vector *x, Vector *Intersection)
    403 {
    404         Info FunctionInfo(__func__);
     424bool BoundaryTriangleSet::GetIntersectionInsideTriangle(const Vector * const MolCenter, const Vector * const x, Vector * const Intersection) const
     425{
     426  Info FunctionInfo(__func__);
    405427  Vector CrossPoint;
    406428  Vector helper;
     
    411433  }
    412434
     435  Log() << Verbose(1) << "INFO: Triangle is " << *this << "." << endl;
     436  Log() << Verbose(1) << "INFO: Line is from " << *MolCenter << " to " << *x << "." << endl;
     437  Log() << Verbose(1) << "INFO: Intersection is " << *Intersection << "." << endl;
     438
     439  if (Intersection->DistanceSquared(endpoints[0]->node->node) < MYEPSILON) {
     440    Log() << Verbose(1) << "Intersection coindices with first endpoint." << endl;
     441    return true;
     442  }   else if (Intersection->DistanceSquared(endpoints[1]->node->node) < MYEPSILON) {
     443    Log() << Verbose(1) << "Intersection coindices with second endpoint." << endl;
     444    return true;
     445  }   else if (Intersection->DistanceSquared(endpoints[2]->node->node) < MYEPSILON) {
     446    Log() << Verbose(1) << "Intersection coindices with third endpoint." << endl;
     447    return true;
     448  }
    413449  // Calculate cross point between one baseline and the line from the third endpoint to intersection
    414450  int i=0;
     
    417453      helper.CopyVector(endpoints[(i+1)%3]->node->node);
    418454      helper.SubtractVector(endpoints[i%3]->node->node);
     455      CrossPoint.SubtractVector(endpoints[i%3]->node->node);  // cross point was returned as absolute vector
     456      const double s = CrossPoint.ScalarProduct(&helper)/helper.NormSquared();
     457      Log() << Verbose(1) << "INFO: Factor s is " << s << "." << endl;
     458      if ((s < -MYEPSILON) || ((s-1.) > MYEPSILON)) {
     459        Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << "outside of triangle." << endl;
     460        i=4;
     461        break;
     462      }
     463      i++;
    419464    } else
    420       i++;
    421     if (i>2)
    422465      break;
    423   } while (CrossPoint.NormSquared() < MYEPSILON);
     466  } while (i<3);
    424467  if (i==3) {
    425     eLog() << Verbose(0) << "Could not find any cross points, something's utterly wrong here!" << endl;
    426   }
    427   CrossPoint.SubtractVector(endpoints[i%3]->node->node);  // cross point was returned as absolute vector
    428 
    429   // check whether intersection is inside or not by comparing length of intersection and length of cross point
    430   if ((CrossPoint.NormSquared() - helper.NormSquared()) < MYEPSILON) { // inside
     468    Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " inside of triangle." << endl;
    431469    return true;
    432   } else { // outside!
    433     Intersection->Zero();
     470  } else {
     471    Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " outside of triangle." << endl;
    434472    return false;
    435473  }
     474};
     475
     476/** Finds the point on the triangle \a *BTS through which the line defined by \a *MolCenter and \a *x crosses.
     477 * We call Vector::GetIntersectionWithPlane() to receive the intersection point with the plane
     478 * Thus we test if it's really on the plane and whether it's inside the triangle on the plane or not.
     479 * The latter is done as follows: We calculate the cross point of one of the triangle's baseline with the line
     480 * given by the intersection and the third basepoint. Then, we check whether it's on the baseline (i.e. between
     481 * the first two basepoints) or not.
     482 * \param *x point
     483 * \param *ClosestPoint desired closest point inside triangle to \a *x, is absolute vector
     484 * \return Distance squared between \a *x and closest point inside triangle
     485 */
     486double BoundaryTriangleSet::GetClosestPointInsideTriangle(const Vector * const x, Vector * const ClosestPoint) const
     487{
     488  Info FunctionInfo(__func__);
     489  Vector Direction;
     490
     491  // 1. get intersection with plane
     492  Log() << Verbose(1) << "INFO: Looking for closest point of triangle " << *this << " to " << *x << "." << endl;
     493  GetCenter(&Direction);
     494  if (!ClosestPoint->GetIntersectionWithPlane(&NormalVector, endpoints[0]->node->node, x, &Direction)) {
     495    ClosestPoint->CopyVector(x);
     496  }
     497
     498  // 2. Calculate in plane part of line (x, intersection)
     499  Vector InPlane;
     500  InPlane.CopyVector(x);
     501  InPlane.SubtractVector(ClosestPoint);  // points from plane intersection to straight-down point
     502  InPlane.ProjectOntoPlane(&NormalVector);
     503  InPlane.AddVector(ClosestPoint);
     504
     505  Log() << Verbose(2) << "INFO: Triangle is " << *this << "." << endl;
     506  Log() << Verbose(2) << "INFO: Line is from " << Direction << " to " << *x << "." << endl;
     507  Log() << Verbose(2) << "INFO: In-plane part is " << InPlane << "." << endl;
     508
     509  // Calculate cross point between one baseline and the desired point such that distance is shortest
     510  double ShortestDistance = -1.;
     511  bool InsideFlag = false;
     512  Vector CrossDirection[3];
     513  Vector CrossPoint[3];
     514  Vector helper;
     515  for (int i=0;i<3;i++) {
     516    // treat direction of line as normal of a (cut)plane and the desired point x as the plane offset, the intersect line with point
     517    Direction.CopyVector(endpoints[(i+1)%3]->node->node);
     518    Direction.SubtractVector(endpoints[i%3]->node->node);
     519    // calculate intersection, line can never be parallel to Direction (is the same vector as PlaneNormal);
     520    CrossPoint[i].GetIntersectionWithPlane(&Direction, &InPlane, endpoints[i%3]->node->node, endpoints[(i+1)%3]->node->node);
     521    CrossDirection[i].CopyVector(&CrossPoint[i]);
     522    CrossDirection[i].SubtractVector(&InPlane);
     523    CrossPoint[i].SubtractVector(endpoints[i%3]->node->node);  // cross point was returned as absolute vector
     524    const double s = CrossPoint[i].ScalarProduct(&Direction)/Direction.NormSquared();
     525    Log() << Verbose(2) << "INFO: Factor s is " << s << "." << endl;
     526    if ((s >= -MYEPSILON) && ((s-1.) <= MYEPSILON)) {
     527      CrossPoint[i].AddVector(endpoints[i%3]->node->node);  // make cross point absolute again
     528      Log() << Verbose(2) << "INFO: Crosspoint is " << CrossPoint[i] << ", intersecting BoundaryLine between " << *endpoints[i%3]->node->node << " and " << *endpoints[(i+1)%3]->node->node << "." << endl;
     529      const double distance = CrossPoint[i].DistanceSquared(x);
     530      if ((ShortestDistance < 0.) || (ShortestDistance > distance)) {
     531        ShortestDistance = distance;
     532        ClosestPoint->CopyVector(&CrossPoint[i]);
     533      }
     534    } else
     535      CrossPoint[i].Zero();
     536  }
     537  InsideFlag = true;
     538  for (int i=0;i<3;i++) {
     539    const double sign = CrossDirection[i].ScalarProduct(&CrossDirection[(i+1)%3]);
     540    const double othersign = CrossDirection[i].ScalarProduct(&CrossDirection[(i+2)%3]);;
     541    if ((sign > -MYEPSILON) && (othersign > -MYEPSILON))  // have different sign
     542      InsideFlag = false;
     543  }
     544  if (InsideFlag) {
     545    ClosestPoint->CopyVector(&InPlane);
     546    ShortestDistance = InPlane.DistanceSquared(x);
     547  } else {  // also check endnodes
     548    for (int i=0;i<3;i++) {
     549      const double distance = x->DistanceSquared(endpoints[i]->node->node);
     550      if ((ShortestDistance < 0.) || (ShortestDistance > distance)) {
     551        ShortestDistance = distance;
     552        ClosestPoint->CopyVector(endpoints[i]->node->node);
     553      }
     554    }
     555  }
     556  Log() << Verbose(1) << "INFO: Closest Point is " << *ClosestPoint << " with shortest squared distance is " << ShortestDistance << "." << endl;
     557  return ShortestDistance;
    436558};
    437559
     
    440562 * \return true - line is of the triangle, false - is not
    441563 */
    442 bool BoundaryTriangleSet::ContainsBoundaryLine(class BoundaryLineSet *line)
     564bool BoundaryTriangleSet::ContainsBoundaryLine(const BoundaryLineSet * const line) const
    443565{
    444566        Info FunctionInfo(__func__);
     
    453575 * \return true - point is of the triangle, false - is not
    454576 */
    455 bool BoundaryTriangleSet::ContainsBoundaryPoint(class BoundaryPointSet *point)
     577bool BoundaryTriangleSet::ContainsBoundaryPoint(const BoundaryPointSet * const point) const
    456578{
    457579        Info FunctionInfo(__func__);
     
    466588 * \return true - point is of the triangle, false - is not
    467589 */
    468 bool BoundaryTriangleSet::ContainsBoundaryPoint(class TesselPoint *point)
     590bool BoundaryTriangleSet::ContainsBoundaryPoint(const TesselPoint * const point) const
    469591{
    470592        Info FunctionInfo(__func__);
     
    479601 * \return true - is the very triangle, false - is not
    480602 */
    481 bool BoundaryTriangleSet::IsPresentTupel(class BoundaryPointSet *Points[3])
    482 {
    483         Info FunctionInfo(__func__);
     603bool BoundaryTriangleSet::IsPresentTupel(const BoundaryPointSet * const Points[3]) const
     604{
     605        Info FunctionInfo(__func__);
     606        Log() << Verbose(1) << "INFO: Checking " << Points[0] << ","  << Points[1] << "," << Points[2] << " against " << endpoints[0] << "," << endpoints[1] << "," << endpoints[2] << "." << endl;
    484607  return (((endpoints[0] == Points[0])
    485608            || (endpoints[0] == Points[1])
     
    501624 * \return true - is the very triangle, false - is not
    502625 */
    503 bool BoundaryTriangleSet::IsPresentTupel(class BoundaryTriangleSet *T)
     626bool BoundaryTriangleSet::IsPresentTupel(const BoundaryTriangleSet * const T) const
    504627{
    505628        Info FunctionInfo(__func__);
     
    523646 * \return pointer third endpoint or NULL if line does not belong to triangle.
    524647 */
    525 class BoundaryPointSet *BoundaryTriangleSet::GetThirdEndpoint(class BoundaryLineSet *line)
     648class BoundaryPointSet *BoundaryTriangleSet::GetThirdEndpoint(const BoundaryLineSet * const line) const
    526649{
    527650        Info FunctionInfo(__func__);
     
    540663 * \param *center central point on return.
    541664 */
    542 void BoundaryTriangleSet::GetCenter(Vector *center)
     665void BoundaryTriangleSet::GetCenter(Vector * const center) const
    543666{
    544667        Info FunctionInfo(__func__);
     
    547670    center->AddVector(endpoints[i]->node->node);
    548671  center->Scale(1./3.);
     672  Log() << Verbose(1) << "INFO: Center is at " << *center << "." << endl;
    549673}
    550674
     
    14221546  TesselPoint *Walker = NULL;
    14231547  Vector *Center = cloud->GetCenter();
    1424   list<BoundaryTriangleSet*> *triangles = NULL;
     1548  TriangleList *triangles = NULL;
    14251549  bool AddFlag = false;
    14261550  LinkedCell *BoundaryPoints = NULL;
     
    14371561    Log() << Verbose(0) << "Current point is " << *Walker << "." << endl;
    14381562    // get the next triangle
    1439     triangles = FindClosestTrianglesToPoint(Walker->node, BoundaryPoints);
     1563    triangles = FindClosestTrianglesToVector(Walker->node, BoundaryPoints);
    14401564    BTS = triangles->front();
    14411565    if ((triangles == NULL) || (BTS->ContainsBoundaryPoint(Walker))) {
     
    15871711  bool insertNewLine = true;
    15881712
    1589   if (a->lines.find(b->node->nr) != a->lines.end()) {
    1590     LineMap::iterator FindLine = a->lines.find(b->node->nr);
     1713  LineMap::iterator FindLine = a->lines.find(b->node->nr);
     1714  if (FindLine != a->lines.end()) {
     1715    Log() << Verbose(1) << "INFO: There is at least one line between " << *a << " and " << *b << ": " << *(FindLine->second) << "." << endl;
     1716
    15911717    pair<LineMap::iterator,LineMap::iterator> FindPair;
    15921718    FindPair = a->lines.equal_range(b->node->nr);
    1593     Log() << Verbose(1) << "INFO: There is at least one line between " << *a << " and " << *b << ": " << *(FindLine->second) << "." << endl;
    15941719
    15951720    for (FindLine = FindPair.first; FindLine != FindPair.second; FindLine++) {
     
    19152040  double maxCoordinate[NDIM];
    19162041  BoundaryLineSet BaseLine;
    1917   Vector Oben;
    19182042  Vector helper;
    19192043  Vector Chord;
    19202044  Vector SearchDirection;
    1921 
    1922   Oben.Zero();
     2045  Vector CircleCenter;  // center of the circle, i.e. of the band of sphere's centers
     2046  Vector CirclePlaneNormal; // normal vector defining the plane this circle lives in
     2047  Vector SphereCenter;
     2048  Vector NormalVector;
     2049
     2050  NormalVector.Zero();
    19232051
    19242052  for (i = 0; i < 3; i++) {
     
    19552083  BTS = NULL;
    19562084  for (int k=0;k<NDIM;k++) {
    1957     Oben.Zero();
    1958     Oben.x[k] = 1.;
     2085    NormalVector.Zero();
     2086    NormalVector.x[k] = 1.;
    19592087    BaseLine.endpoints[0] = new BoundaryPointSet(MaxPoint[k]);
    19602088    Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine.endpoints[0]->node << "." << endl;
     
    19632091    ShortestAngle = 999999.; // This will contain the angle, which will be always positive (when looking for second point), when looking for third point this will be the quadrant.
    19642092
    1965     FindSecondPointForTesselation(BaseLine.endpoints[0]->node, Oben, Temporary, &ShortestAngle, RADIUS, LC); // we give same point as next candidate as its bonds are looked into in find_second_...
     2093    FindSecondPointForTesselation(BaseLine.endpoints[0]->node, NormalVector, Temporary, &ShortestAngle, RADIUS, LC); // we give same point as next candidate as its bonds are looked into in find_second_...
    19662094    if (Temporary == NULL)  // have we found a second point?
    19672095      continue;
    19682096    BaseLine.endpoints[1] = new BoundaryPointSet(Temporary);
    19692097
    1970     helper.CopyVector(BaseLine.endpoints[0]->node->node);
    1971     helper.SubtractVector(BaseLine.endpoints[1]->node->node);
    1972     helper.Normalize();
    1973     Oben.ProjectOntoPlane(&helper);
    1974     Oben.Normalize();
    1975     helper.VectorProduct(&Oben);
     2098    // construct center of circle
     2099    CircleCenter.CopyVector(BaseLine.endpoints[0]->node->node);
     2100    CircleCenter.AddVector(BaseLine.endpoints[1]->node->node);
     2101    CircleCenter.Scale(0.5);
     2102
     2103    // construct normal vector of circle
     2104    CirclePlaneNormal.CopyVector(BaseLine.endpoints[0]->node->node);
     2105    CirclePlaneNormal.SubtractVector(BaseLine.endpoints[1]->node->node);
     2106
     2107    double radius = CirclePlaneNormal.NormSquared();
     2108    double CircleRadius = sqrt(RADIUS*RADIUS - radius/4.);
     2109
     2110    NormalVector.ProjectOntoPlane(&CirclePlaneNormal);
     2111    NormalVector.Normalize();
    19762112    ShortestAngle = 2.*M_PI; // This will indicate the quadrant.
    19772113
    1978     Chord.CopyVector(BaseLine.endpoints[0]->node->node); // bring into calling function
    1979     Chord.SubtractVector(BaseLine.endpoints[1]->node->node);
    1980     double radius = Chord.ScalarProduct(&Chord);
    1981     double CircleRadius = sqrt(RADIUS*RADIUS - radius/4.);
    1982     helper.CopyVector(&Oben);
    1983     helper.Scale(CircleRadius);
    1984     // Now, oben and helper are two orthonormalized vectors in the plane defined by Chord (not normalized)
     2114    SphereCenter.CopyVector(&NormalVector);
     2115    SphereCenter.Scale(CircleRadius);
     2116    SphereCenter.AddVector(&CircleCenter);
     2117    // Now, NormalVector and SphereCenter are two orthonormalized vectors in the plane defined by CirclePlaneNormal (not normalized)
    19852118
    19862119    // look in one direction of baseline for initial candidate
    1987     SearchDirection.MakeNormalVector(&Chord, &Oben);  // whether we look "left" first or "right" first is not important ...
     2120    SearchDirection.MakeNormalVector(&CirclePlaneNormal, &NormalVector);  // whether we look "left" first or "right" first is not important ...
    19882121
    19892122    // adding point 1 and point 2 and add the line between them
     
    19932126    //Log() << Verbose(1) << "INFO: OldSphereCenter is at " << helper << ".\n";
    19942127    CandidateForTesselation OptCandidates(&BaseLine);
    1995     FindThirdPointForTesselation(Oben, SearchDirection, helper, OptCandidates, NULL, RADIUS, LC);
     2128    FindThirdPointForTesselation(NormalVector, SearchDirection, SphereCenter, OptCandidates, NULL, RADIUS, LC);
    19962129    Log() << Verbose(0) << "List of third Points is:" << endl;
    19972130    for (TesselPointList::iterator it = OptCandidates.pointlist.begin(); it != OptCandidates.pointlist.end(); it++) {
     
    21672300  Vector CircleCenter;
    21682301  Vector CirclePlaneNormal;
    2169   Vector OldSphereCenter;
     2302  Vector RelativeSphereCenter;
    21702303  Vector SearchDirection;
    21712304  Vector helper;
     
    21742307  double radius, CircleRadius;
    21752308
    2176   Log() << Verbose(0) << "Current baseline is " << *CandidateLine.BaseLine << " of triangle " << T << "." << endl;
    21772309  for (int i=0;i<3;i++)
    2178     if ((T.endpoints[i]->node != CandidateLine.BaseLine->endpoints[0]->node) && (T.endpoints[i]->node != CandidateLine.BaseLine->endpoints[1]->node))
     2310    if ((T.endpoints[i]->node != CandidateLine.BaseLine->endpoints[0]->node) && (T.endpoints[i]->node != CandidateLine.BaseLine->endpoints[1]->node)) {
    21792311      ThirdNode = T.endpoints[i]->node;
     2312      break;
     2313    }
     2314  Log() << Verbose(0) << "Current baseline is " << *CandidateLine.BaseLine << " with ThirdNode " << *ThirdNode << " of triangle " << T << "." << endl;
    21802315
    21812316  // construct center of circle
     
    21912326  radius = CirclePlaneNormal.ScalarProduct(&CirclePlaneNormal);
    21922327  if (radius/4. < RADIUS*RADIUS) {
     2328    // construct relative sphere center with now known CircleCenter
     2329    RelativeSphereCenter.CopyVector(&T.SphereCenter);
     2330    RelativeSphereCenter.SubtractVector(&CircleCenter);
     2331
    21932332    CircleRadius = RADIUS*RADIUS - radius/4.;
    21942333    CirclePlaneNormal.Normalize();
    21952334    Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl;
    21962335
    2197     // construct old center
    2198     GetCenterofCircumcircle(&OldSphereCenter, *T.endpoints[0]->node->node, *T.endpoints[1]->node->node, *T.endpoints[2]->node->node);
    2199     helper.CopyVector(&T.NormalVector);  // normal vector ensures that this is correct center of the two possible ones
    2200     radius = CandidateLine.BaseLine->endpoints[0]->node->node->DistanceSquared(&OldSphereCenter);
    2201     helper.Scale(sqrt(RADIUS*RADIUS - radius));
    2202     OldSphereCenter.AddVector(&helper);
    2203     OldSphereCenter.SubtractVector(&CircleCenter);
    2204     Log() << Verbose(1) << "INFO: OldSphereCenter is at " << OldSphereCenter << "." << endl;
    2205 
    2206     // construct SearchDirection
    2207     SearchDirection.MakeNormalVector(&T.NormalVector, &CirclePlaneNormal);
    2208     helper.CopyVector(CandidateLine.BaseLine->endpoints[0]->node->node);
     2336    Log() << Verbose(1) << "INFO: OldSphereCenter is at " << T.SphereCenter << "." << endl;
     2337
     2338    // construct SearchDirection and an "outward pointer"
     2339    SearchDirection.MakeNormalVector(&RelativeSphereCenter, &CirclePlaneNormal);
     2340    helper.CopyVector(&CircleCenter);
    22092341    helper.SubtractVector(ThirdNode->node);
    22102342    if (helper.ScalarProduct(&SearchDirection) < -HULLEPSILON)// ohoh, SearchDirection points inwards!
    22112343      SearchDirection.Scale(-1.);
    2212     SearchDirection.ProjectOntoPlane(&OldSphereCenter);
    2213     SearchDirection.Normalize();
    22142344    Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl;
    2215     if (fabs(OldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) {
     2345    if (fabs(RelativeSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) {
    22162346      // rotated the wrong way!
    22172347      eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl;
     
    22192349
    22202350    // add third point
    2221     FindThirdPointForTesselation(T.NormalVector, SearchDirection, OldSphereCenter, CandidateLine, ThirdNode, RADIUS, LC);
     2351    FindThirdPointForTesselation(T.NormalVector, SearchDirection, T.SphereCenter, CandidateLine, ThirdNode, RADIUS, LC);
    22222352
    22232353  } else {
     
    23322462
    23332463  // fill the set of neighbours
    2334   Center.CopyVector(CandidateLine.BaseLine->endpoints[1]->node->node);
    2335   Center.SubtractVector(TurningPoint->node);
    2336   set<TesselPoint*> SetOfNeighbours;
     2464  TesselPointSet SetOfNeighbours;
    23372465  SetOfNeighbours.insert(CandidateLine.BaseLine->endpoints[1]->node);
    23382466  for (TesselPointList::iterator Runner = CandidateLine.pointlist.begin(); Runner != CandidateLine.pointlist.end(); Runner++)
    23392467    SetOfNeighbours.insert(*Runner);
    2340   TesselPointList *connectedClosestPoints = GetCircleOfSetOfPoints(&SetOfNeighbours, TurningPoint, &Center);
     2468  TesselPointList *connectedClosestPoints = GetCircleOfSetOfPoints(&SetOfNeighbours, TurningPoint, CandidateLine.BaseLine->endpoints[1]->node->node);
    23412469
    23422470  // go through all angle-sorted candidates (in degenerate n-nodes case we may have to add multiple triangles)
     2471  Log() << Verbose(0) << "List of Candidates for Turning Point: " << *TurningPoint << "." << endl;
     2472  for (TesselPointList::iterator TesselRunner = connectedClosestPoints->begin(); TesselRunner != connectedClosestPoints->end(); ++TesselRunner)
     2473    Log() << Verbose(0) << **TesselRunner << endl;
    23432474  TesselPointList::iterator Runner = connectedClosestPoints->begin();
    23442475  TesselPointList::iterator Sprinter = Runner;
     
    23502481    AddTesselationPoint((*Sprinter), 2);
    23512482
    2352     Center.CopyVector(&CandidateLine.OptCenter);
    23532483    // add the lines
    23542484    AddTesselationLine(TPS[0], TPS[1], 0);
     
    23592489    BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount);
    23602490    AddTesselationTriangle();
    2361     Center.Scale(-1.);
     2491    BTS->GetCenter(&Center);
     2492    Center.SubtractVector(&CandidateLine.OptCenter);
     2493    BTS->SphereCenter.CopyVector(&CandidateLine.OptCenter);
    23622494    BTS->GetNormalVector(Center);
    23632495
     
    23652497    Runner = Sprinter;
    23662498    Sprinter++;
     2499    Log() << Verbose(0) << "Current Runner is " << **Runner << "." << endl;
     2500    if (Sprinter != connectedClosestPoints->end())
     2501      Log() << Verbose(0) << " There are still more triangles to add." << endl;
    23672502  }
    23682503  delete(connectedClosestPoints);
     
    27662901  Vector NewNormalVector;   // normal vector of the Candidate's triangle
    27672902  Vector helper, OptCandidateCenter, OtherOptCandidateCenter;
     2903  Vector RelativeOldSphereCenter;
     2904  Vector NewPlaneCenter;
    27682905  double CircleRadius; // radius of this circle
    27692906  double radius;
     2907  double otherradius;
    27702908  double alpha, Otheralpha; // angles (i.e. parameter for the circle).
    27712909  int N[NDIM], Nlower[NDIM], Nupper[NDIM];
     
    27832921  CirclePlaneNormal.SubtractVector(CandidateLine.BaseLine->endpoints[1]->node->node);
    27842922
     2923  RelativeOldSphereCenter.CopyVector(&OldSphereCenter);
     2924  RelativeOldSphereCenter.SubtractVector(&CircleCenter);
     2925
    27852926  // calculate squared radius TesselPoint *ThirdNode,f circle
    2786   radius = CirclePlaneNormal.ScalarProduct(&CirclePlaneNormal);
    2787   if (radius/4. < RADIUS*RADIUS) {
    2788     CircleRadius = RADIUS*RADIUS - radius/4.;
     2927  radius = CirclePlaneNormal.NormSquared()/4.;
     2928  if (radius < RADIUS*RADIUS) {
     2929    CircleRadius = RADIUS*RADIUS - radius;
    27892930    CirclePlaneNormal.Normalize();
    2790     //Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl;
     2931    Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl;
    27912932
    27922933    // test whether old center is on the band's plane
    2793     if (fabs(OldSphereCenter.ScalarProduct(&CirclePlaneNormal)) > HULLEPSILON) {
    2794       eLog() << Verbose(1) << "Something's very wrong here: OldSphereCenter is not on the band's plane as desired by " << fabs(OldSphereCenter.ScalarProduct(&CirclePlaneNormal)) << "!" << endl;
    2795       OldSphereCenter.ProjectOntoPlane(&CirclePlaneNormal);
    2796     }
    2797     radius = OldSphereCenter.ScalarProduct(&OldSphereCenter);
     2934    if (fabs(RelativeOldSphereCenter.ScalarProduct(&CirclePlaneNormal)) > HULLEPSILON) {
     2935      eLog() << Verbose(1) << "Something's very wrong here: RelativeOldSphereCenter is not on the band's plane as desired by " << fabs(RelativeOldSphereCenter.ScalarProduct(&CirclePlaneNormal)) << "!" << endl;
     2936      RelativeOldSphereCenter.ProjectOntoPlane(&CirclePlaneNormal);
     2937    }
     2938    radius = RelativeOldSphereCenter.NormSquared();
    27982939    if (fabs(radius - CircleRadius) < HULLEPSILON) {
    2799       //Log() << Verbose(1) << "INFO: OldSphereCenter is at " << OldSphereCenter << "." << endl;
     2940      Log() << Verbose(1) << "INFO: RelativeOldSphereCenter is at " << RelativeOldSphereCenter << "." << endl;
    28002941
    28012942      // check SearchDirection
    2802       //Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl;
    2803       if (fabs(OldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) {  // rotated the wrong way!
     2943      Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl;
     2944      if (fabs(RelativeOldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) {  // rotated the wrong way!
    28042945        eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are not orthogonal!" << endl;
    28052946      }
     
    28322973
    28332974                // check for three unique points
    2834                 Log() << Verbose(2) << "INFO: Current Candidate is " << *Candidate << " at " << *(Candidate->node) << "." << endl;
     2975                Log() << Verbose(2) << "INFO: Current Candidate is " << *Candidate << " for BaseLine " << *CandidateLine.BaseLine << " with OldSphereCenter " << OldSphereCenter << "." << endl;
    28352976                if ((Candidate != CandidateLine.BaseLine->endpoints[0]->node) && (Candidate != CandidateLine.BaseLine->endpoints[1]->node) ){
    28362977
    2837                   // construct both new centers
    2838                   GetCenterofCircumcircle(&NewSphereCenter, *CandidateLine.BaseLine->endpoints[0]->node->node, *CandidateLine.BaseLine->endpoints[1]->node->node, *Candidate->node);
    2839                   OtherNewSphereCenter.CopyVector(&NewSphereCenter);
    2840 
    2841                   if ((NewNormalVector.MakeNormalVector(CandidateLine.BaseLine->endpoints[0]->node->node, CandidateLine.BaseLine->endpoints[1]->node->node, Candidate->node))
    2842                   && (fabs(NewNormalVector.ScalarProduct(&NewNormalVector)) > HULLEPSILON)
     2978                  // find center on the plane
     2979                  GetCenterofCircumcircle(&NewPlaneCenter, *CandidateLine.BaseLine->endpoints[0]->node->node, *CandidateLine.BaseLine->endpoints[1]->node->node, *Candidate->node);
     2980                  Log() << Verbose(1) << "INFO: NewPlaneCenter is " << NewPlaneCenter << "." << endl;
     2981
     2982                  if (NewNormalVector.MakeNormalVector(CandidateLine.BaseLine->endpoints[0]->node->node, CandidateLine.BaseLine->endpoints[1]->node->node, Candidate->node)
     2983                  && (fabs(NewNormalVector.NormSquared()) > HULLEPSILON)
    28432984                  ) {
    2844                     helper.CopyVector(&NewNormalVector);
    28452985                    Log() << Verbose(1) << "INFO: NewNormalVector is " << NewNormalVector << "." << endl;
    2846                     radius = CandidateLine.BaseLine->endpoints[0]->node->node->DistanceSquared(&NewSphereCenter);
     2986                    radius = CandidateLine.BaseLine->endpoints[0]->node->node->DistanceSquared(&NewPlaneCenter);
     2987                    Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl;
     2988                    Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl;
     2989                    Log() << Verbose(1) << "INFO: Radius of CircumCenterCircle is " << radius << "." << endl;
    28472990                    if (radius < RADIUS*RADIUS) {
     2991                      otherradius = CandidateLine.BaseLine->endpoints[1]->node->node->DistanceSquared(&NewPlaneCenter);
     2992                      if (fabs(radius - otherradius) > HULLEPSILON) {
     2993                        eLog() << Verbose(1) << "Distance to center of circumcircle is not the same from each corner of the triangle: " << fabs(radius-otherradius) << endl;
     2994                      }
     2995                      // construct both new centers
     2996                      NewSphereCenter.CopyVector(&NewPlaneCenter);
     2997                      OtherNewSphereCenter.CopyVector(&NewPlaneCenter);
     2998                      helper.CopyVector(&NewNormalVector);
    28482999                      helper.Scale(sqrt(RADIUS*RADIUS - radius));
    2849                       Log() << Verbose(2) << "INFO: Distance of NewCircleCenter to NewSphereCenter is " << helper.Norm() << " with sphere radius " << RADIUS << "." << endl;
     3000                      Log() << Verbose(2) << "INFO: Distance of NewPlaneCenter " << NewPlaneCenter << " to either NewSphereCenter is " << helper.Norm() << " of vector " << helper << " with sphere radius " << RADIUS << "." << endl;
    28503001                      NewSphereCenter.AddVector(&helper);
    2851                       NewSphereCenter.SubtractVector(&CircleCenter);
    28523002                      Log() << Verbose(2) << "INFO: NewSphereCenter is at " << NewSphereCenter << "." << endl;
    2853 
    28543003                      // OtherNewSphereCenter is created by the same vector just in the other direction
    28553004                      helper.Scale(-1.);
    28563005                      OtherNewSphereCenter.AddVector(&helper);
    2857                       OtherNewSphereCenter.SubtractVector(&CircleCenter);
    28583006                      Log() << Verbose(2) << "INFO: OtherNewSphereCenter is at " << OtherNewSphereCenter << "." << endl;
    28593007
     
    28613009                      Otheralpha = GetPathLengthonCircumCircle(CircleCenter, CirclePlaneNormal, CircleRadius, OtherNewSphereCenter, OldSphereCenter, NormalVector, SearchDirection);
    28623010                      alpha = min(alpha, Otheralpha);
     3011
    28633012                      // if there is a better candidate, drop the current list and add the new candidate
    28643013                      // otherwise ignore the new candidate and keep the list
     
    28923041                        }
    28933042                      }
    2894 
    28953043                    } else {
    28963044                      Log() << Verbose(1) << "REJECT: NewSphereCenter " << NewSphereCenter << " for " << *Candidate << " is too far away: " << radius << "." << endl;
     
    29363084  const BoundaryLineSet * lines[2] = { line1, line2 };
    29373085  class BoundaryPointSet *node = NULL;
    2938   map<int, class BoundaryPointSet *> OrderMap;
    2939   pair<map<int, class BoundaryPointSet *>::iterator, bool> OrderTest;
     3086  PointMap OrderMap;
     3087  PointTestPair OrderTest;
    29403088  for (int i = 0; i < 2; i++)
    29413089    // for both lines
     
    29573105};
    29583106
     3107/** Finds the boundary points that are closest to a given Vector \a *x.
     3108 * \param *out output stream for debugging
     3109 * \param *x Vector to look from
     3110 * \return map of BoundaryPointSet of closest points sorted by squared distance or NULL.
     3111 */
     3112DistanceToPointMap * Tesselation::FindClosestBoundaryPointsToVector(const Vector *x, const LinkedCell* LC) const
     3113{
     3114  Info FunctionInfo(__func__);
     3115  PointMap::const_iterator FindPoint;
     3116  int N[NDIM], Nlower[NDIM], Nupper[NDIM];
     3117
     3118  if (LinesOnBoundary.empty()) {
     3119    eLog() << Verbose(1) << "There is no tesselation structure to compare the point with, please create one first." << endl;
     3120    return NULL;
     3121  }
     3122
     3123  // gather all points close to the desired one
     3124  LC->SetIndexToVector(x); // ignore status as we calculate bounds below sensibly
     3125  for(int i=0;i<NDIM;i++) // store indices of this cell
     3126    N[i] = LC->n[i];
     3127  Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;
     3128
     3129  DistanceToPointMap * points = new DistanceToPointMap;
     3130  LC->GetNeighbourBounds(Nlower, Nupper);
     3131  //Log() << Verbose(1) << endl;
     3132  for (LC->n[0] = Nlower[0]; LC->n[0] <= Nupper[0]; LC->n[0]++)
     3133    for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
     3134      for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
     3135        const LinkedNodes *List = LC->GetCurrentCell();
     3136        //Log() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl;
     3137        if (List != NULL) {
     3138          for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     3139            FindPoint = PointsOnBoundary.find((*Runner)->nr);
     3140            if (FindPoint != PointsOnBoundary.end()) {
     3141              points->insert(DistanceToPointPair (FindPoint->second->node->node->DistanceSquared(x), FindPoint->second) );
     3142              Log() << Verbose(1) << "INFO: Putting " << *FindPoint->second << " into the list." << endl;
     3143            }
     3144          }
     3145        } else {
     3146          eLog() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl;
     3147        }
     3148      }
     3149
     3150  // check whether we found some points
     3151  if (points->empty()) {
     3152    eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl;
     3153    delete(points);
     3154    return NULL;
     3155  }
     3156  return points;
     3157};
     3158
     3159/** Finds the boundary line that is closest to a given Vector \a *x.
     3160 * \param *out output stream for debugging
     3161 * \param *x Vector to look from
     3162 * \return closest BoundaryLineSet or NULL in degenerate case.
     3163 */
     3164BoundaryLineSet * Tesselation::FindClosestBoundaryLineToVector(const Vector *x, const LinkedCell* LC) const
     3165{
     3166  Info FunctionInfo(__func__);
     3167
     3168  // get closest points
     3169  DistanceToPointMap * points = FindClosestBoundaryPointsToVector(x,LC);
     3170  if (points == NULL) {
     3171    eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl;
     3172    return NULL;
     3173  }
     3174
     3175  // for each point, check its lines, remember closest
     3176  Log() << Verbose(1) << "Finding closest BoundaryLine to " << *x << " ... " << endl;
     3177  BoundaryLineSet *ClosestLine = NULL;
     3178  double MinDistance = -1.;
     3179  Vector helper;
     3180  Vector Center;
     3181  Vector BaseLine;
     3182  for (DistanceToPointMap::iterator Runner = points->begin(); Runner != points->end(); Runner++) {
     3183    for (LineMap::iterator LineRunner = Runner->second->lines.begin(); LineRunner != Runner->second->lines.end(); LineRunner++) {
     3184      // calculate closest point on line to desired point
     3185      helper.CopyVector((LineRunner->second)->endpoints[0]->node->node);
     3186      helper.AddVector((LineRunner->second)->endpoints[1]->node->node);
     3187      helper.Scale(0.5);
     3188      Center.CopyVector(x);
     3189      Center.SubtractVector(&helper);
     3190      BaseLine.CopyVector((LineRunner->second)->endpoints[0]->node->node);
     3191      BaseLine.SubtractVector((LineRunner->second)->endpoints[1]->node->node);
     3192      Center.ProjectOntoPlane(&BaseLine);
     3193      const double distance = Center.NormSquared();
     3194      if ((ClosestLine == NULL) || (distance < MinDistance)) {
     3195        // additionally calculate intersection on line (whether it's on the line section or not)
     3196        helper.CopyVector(x);
     3197        helper.SubtractVector((LineRunner->second)->endpoints[0]->node->node);
     3198        helper.SubtractVector(&Center);
     3199        const double lengthA = helper.ScalarProduct(&BaseLine);
     3200        helper.CopyVector(x);
     3201        helper.SubtractVector((LineRunner->second)->endpoints[1]->node->node);
     3202        helper.SubtractVector(&Center);
     3203        const double lengthB = helper.ScalarProduct(&BaseLine);
     3204        if (lengthB*lengthA < 0) {  // if have different sign
     3205          ClosestLine = LineRunner->second;
     3206          MinDistance = distance;
     3207          Log() << Verbose(1) << "ACCEPT: New closest line is " << *ClosestLine << " with projected distance " << MinDistance << "." << endl;
     3208        } else {
     3209          Log() << Verbose(1) << "REJECT: Intersection is outside of the line section: " << lengthA << " and " << lengthB << "." << endl;
     3210        }
     3211      } else {
     3212        Log() << Verbose(1) << "REJECT: Point is too further away than present line: " << distance << " >> " << MinDistance << "." << endl;
     3213      }
     3214    }
     3215  }
     3216  delete(points);
     3217  // check whether closest line is "too close" :), then it's inside
     3218  if (ClosestLine == NULL) {
     3219    Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl;
     3220    return NULL;
     3221  }
     3222  return ClosestLine;
     3223};
     3224
     3225
    29593226/** Finds the triangle that is closest to a given Vector \a *x.
    29603227 * \param *out output stream for debugging
    29613228 * \param *x Vector to look from
    2962  * \return list of BoundaryTriangleSet of nearest triangles or NULL in degenerate case.
    2963  */
    2964 list<BoundaryTriangleSet*> * Tesselation::FindClosestTrianglesToPoint(const Vector *x, const LinkedCell* LC) const
    2965 {
    2966         Info FunctionInfo(__func__);
    2967   TesselPoint *trianglePoints[3];
    2968   TesselPoint *SecondPoint = NULL;
    2969   list<BoundaryTriangleSet*> *triangles = NULL;
    2970 
    2971   if (LinesOnBoundary.empty()) {
    2972     eLog() << Verbose(1) << "Error: There is no tesselation structure to compare the point with, please create one first.";
     3229 * \return BoundaryTriangleSet of nearest triangle or NULL.
     3230 */
     3231TriangleList * Tesselation::FindClosestTrianglesToVector(const Vector *x, const LinkedCell* LC) const
     3232{
     3233        Info FunctionInfo(__func__);
     3234
     3235        // get closest points
     3236        DistanceToPointMap * points = FindClosestBoundaryPointsToVector(x,LC);
     3237  if (points == NULL) {
     3238    eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl;
    29733239    return NULL;
    29743240  }
    2975   Log() << Verbose(1) << "Finding closest Tesselpoint to " << *x << " ... " << endl;
    2976   trianglePoints[0] = FindClosestPoint(x, SecondPoint, LC);
    2977  
    2978   // check whether closest point is "too close" :), then it's inside
    2979   if (trianglePoints[0] == NULL) {
     3241
     3242  // for each point, check its lines, remember closest
     3243  Log() << Verbose(1) << "Finding closest BoundaryTriangle to " << *x << " ... " << endl;
     3244  LineSet ClosestLines;
     3245  double MinDistance = 1e+16;
     3246  Vector BaseLineIntersection;
     3247  Vector Center;
     3248  Vector BaseLine;
     3249  Vector BaseLineCenter;
     3250  for (DistanceToPointMap::iterator Runner = points->begin(); Runner != points->end(); Runner++) {
     3251    for (LineMap::iterator LineRunner = Runner->second->lines.begin(); LineRunner != Runner->second->lines.end(); LineRunner++) {
     3252
     3253      BaseLine.CopyVector((LineRunner->second)->endpoints[0]->node->node);
     3254      BaseLine.SubtractVector((LineRunner->second)->endpoints[1]->node->node);
     3255      const double lengthBase = BaseLine.NormSquared();
     3256
     3257      BaseLineIntersection.CopyVector(x);
     3258      BaseLineIntersection.SubtractVector((LineRunner->second)->endpoints[0]->node->node);
     3259      const double lengthEndA = BaseLineIntersection.NormSquared();
     3260
     3261      BaseLineIntersection.CopyVector(x);
     3262      BaseLineIntersection.SubtractVector((LineRunner->second)->endpoints[1]->node->node);
     3263      const double lengthEndB = BaseLineIntersection.NormSquared();
     3264
     3265      if ((lengthEndA > lengthBase) || (lengthEndB > lengthBase) || ((lengthEndA < MYEPSILON) || (lengthEndB < MYEPSILON))) {  // intersection would be outside, take closer endpoint
     3266        const double lengthEnd = Min(lengthEndA, lengthEndB);
     3267        if (lengthEnd - MinDistance < -MYEPSILON) { // new best line
     3268          ClosestLines.clear();
     3269          ClosestLines.insert(LineRunner->second);
     3270          MinDistance = lengthEnd;
     3271          Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[0]->node << " is closer with " << lengthEnd << "." << endl;
     3272        } else if  (fabs(lengthEnd - MinDistance) < MYEPSILON) { // additional best candidate
     3273          ClosestLines.insert(LineRunner->second);
     3274          Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[1]->node << " is equally good with " << lengthEnd << "." << endl;
     3275        } else { // line is worse
     3276          Log() << Verbose(1) << "REJECT: Line " << *LineRunner->second << " to either endpoints is further away than present closest line candidate: " << lengthEndA << ", " << lengthEndB << ", and distance is longer than baseline:" << lengthBase << "." << endl;
     3277        }
     3278      } else { // intersection is closer, calculate
     3279        // calculate closest point on line to desired point
     3280        BaseLineIntersection.CopyVector(x);
     3281        BaseLineIntersection.SubtractVector((LineRunner->second)->endpoints[1]->node->node);
     3282        Center.CopyVector(&BaseLineIntersection);
     3283        Center.ProjectOntoPlane(&BaseLine);
     3284        BaseLineIntersection.SubtractVector(&Center);
     3285        const double distance = BaseLineIntersection.NormSquared();
     3286        if (Center.NormSquared() > BaseLine.NormSquared()) {
     3287          eLog() << Verbose(0) << "Algorithmic error: In second case we have intersection outside of baseline!" << endl;
     3288        }
     3289        if ((ClosestLines.empty()) || (distance < MinDistance)) {
     3290          ClosestLines.insert(LineRunner->second);
     3291          MinDistance = distance;
     3292          Log() << Verbose(1) << "ACCEPT: Intersection in between endpoints, new closest line " << *LineRunner->second << " is " << *ClosestLines.begin() << " with projected distance " << MinDistance << "." << endl;
     3293        } else {
     3294          Log() << Verbose(2) << "REJECT: Point is further away from line " << *LineRunner->second << " than present closest line: " << distance << " >> " << MinDistance << "." << endl;
     3295        }
     3296      }
     3297    }
     3298  }
     3299  delete(points);
     3300
     3301  // check whether closest line is "too close" :), then it's inside
     3302  if (ClosestLines.empty()) {
    29803303    Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl;
    29813304    return NULL;
    29823305  }
    2983   if (trianglePoints[0]->node->DistanceSquared(x) < MYEPSILON) {
    2984     Log() << Verbose(1) << "Point is right on a tesselation point, no nearest triangle." << endl;
    2985     PointMap::const_iterator PointRunner = PointsOnBoundary.find(trianglePoints[0]->nr);
    2986     triangles = new list<BoundaryTriangleSet*>;
    2987     if (PointRunner != PointsOnBoundary.end()) {
    2988       for(LineMap::iterator LineRunner = PointRunner->second->lines.begin(); LineRunner != PointRunner->second->lines.end(); LineRunner++)
    2989         for(TriangleMap::iterator TriangleRunner = LineRunner->second->triangles.begin(); TriangleRunner != LineRunner->second->triangles.end(); TriangleRunner++)
    2990           triangles->push_back(TriangleRunner->second);
    2991       triangles->sort();
    2992       triangles->unique();
    2993     } else {
    2994       PointRunner = PointsOnBoundary.find(SecondPoint->nr);
    2995       trianglePoints[0] = SecondPoint;
    2996       if (PointRunner != PointsOnBoundary.end()) {
    2997         for(LineMap::iterator LineRunner = PointRunner->second->lines.begin(); LineRunner != PointRunner->second->lines.end(); LineRunner++)
    2998           for(TriangleMap::iterator TriangleRunner = LineRunner->second->triangles.begin(); TriangleRunner != LineRunner->second->triangles.end(); TriangleRunner++)
    2999             triangles->push_back(TriangleRunner->second);
    3000         triangles->sort();
    3001         triangles->unique();
    3002       } else {
    3003         eLog() << Verbose(1) << "I cannot find a boundary point to the tessel point " << *trianglePoints[0] << "." << endl;
    3004         return NULL;
    3005       }
    3006     }
    3007   } else {
    3008     set<TesselPoint*> *connectedPoints = GetAllConnectedPoints(trianglePoints[0]);
    3009     TesselPointList *connectedClosestPoints = GetCircleOfSetOfPoints(connectedPoints, trianglePoints[0], x);
    3010     delete(connectedPoints);
    3011     if (connectedClosestPoints != NULL) {
    3012       trianglePoints[1] = connectedClosestPoints->front();
    3013       trianglePoints[2] = connectedClosestPoints->back();
    3014       for (int i=0;i<3;i++) {
    3015         if (trianglePoints[i] == NULL) {
    3016           eLog() << Verbose(1) << "IsInnerPoint encounters serious error, point " << i << " not found." << endl;
    3017         }
    3018         //Log() << Verbose(1) << "List of triangle points:" << endl;
    3019         //Log() << Verbose(2) << *trianglePoints[i] << endl;
    3020       }
    3021 
    3022       triangles = FindTriangles(trianglePoints);
    3023       Log() << Verbose(1) << "List of possible triangles:" << endl;
    3024       for(list<BoundaryTriangleSet*>::iterator Runner = triangles->begin(); Runner != triangles->end(); Runner++)
    3025         Log() << Verbose(2) << **Runner << endl;
    3026 
    3027       delete(connectedClosestPoints);
    3028     } else {
    3029       triangles = NULL;
    3030       eLog() << Verbose(2) << "There is no circle of connected points!" << endl;
    3031     }
    3032   }
    3033  
    3034   if ((triangles == NULL) || (triangles->empty())) {
    3035     eLog() << Verbose(1) << "There is no nearest triangle. Please check the tesselation structure.";
    3036     delete(triangles);
    3037     return NULL;
    3038   } else
    3039     return triangles;
     3306  TriangleList * candidates = new TriangleList;
     3307  for (LineSet::iterator LineRunner = ClosestLines.begin(); LineRunner != ClosestLines.end(); LineRunner++)
     3308    for (TriangleMap::iterator Runner = (*LineRunner)->triangles.begin(); Runner != (*LineRunner)->triangles.end(); Runner++) {
     3309    candidates->push_back(Runner->second);
     3310  }
     3311  return candidates;
    30403312};
    30413313
     
    30463318 * \return list of BoundaryTriangleSet of nearest triangles or NULL.
    30473319 */
    3048 class BoundaryTriangleSet * Tesselation::FindClosestTriangleToPoint(const Vector *x, const LinkedCell* LC) const
     3320class BoundaryTriangleSet * Tesselation::FindClosestTriangleToVector(const Vector *x, const LinkedCell* LC) const
    30493321{
    30503322        Info FunctionInfo(__func__);
    30513323  class BoundaryTriangleSet *result = NULL;
    3052   list<BoundaryTriangleSet*> *triangles = FindClosestTrianglesToPoint(x, LC);
     3324  TriangleList *triangles = FindClosestTrianglesToVector(x, LC);
     3325  TriangleList candidates;
    30533326  Vector Center;
    3054 
    3055   if (triangles == NULL)
     3327  Vector helper;
     3328
     3329  if ((triangles == NULL) || (triangles->empty()))
    30563330    return NULL;
    30573331
    3058   if (triangles->size() == 1) { // there is no degenerate case
    3059     result = triangles->front();
    3060     Log() << Verbose(1) << "Normal Vector of this triangle is " << result->NormalVector << "." << endl;
    3061   } else {
    3062     result = triangles->front();
    3063     result->GetCenter(&Center);
    3064     Center.SubtractVector(x);
    3065     Log() << Verbose(1) << "Normal Vector of this front side is " << result->NormalVector << "." << endl;
    3066     if (Center.ScalarProduct(&result->NormalVector) < 0) {
    3067       result = triangles->back();
    3068       Log() << Verbose(1) << "Normal Vector of this back side is " << result->NormalVector << "." << endl;
    3069       if (Center.ScalarProduct(&result->NormalVector) < 0) {
    3070         eLog() << Verbose(1) << "Front and back side yield NormalVector in wrong direction!" << endl;
    3071       }
     3332  // go through all and pick the one with the best alignment to x
     3333  double MinAlignment = 2.*M_PI;
     3334  for (TriangleList::iterator Runner = triangles->begin(); Runner != triangles->end(); Runner++) {
     3335    (*Runner)->GetCenter(&Center);
     3336    helper.CopyVector(x);
     3337    helper.SubtractVector(&Center);
     3338    const double Alignment = helper.Angle(&(*Runner)->NormalVector);
     3339    if (Alignment < MinAlignment) {
     3340      result = *Runner;
     3341      MinAlignment = Alignment;
     3342      Log() << Verbose(1) << "ACCEPT: Triangle " << *result << " is better aligned with " << MinAlignment << "." << endl;
     3343    } else {
     3344      Log() << Verbose(1) << "REJECT: Triangle " << *result << " is worse aligned with " << MinAlignment << "." << endl;
    30723345    }
    30733346  }
    30743347  delete(triangles);
     3348
    30753349  return result;
    30763350};
    30773351
    3078 /** Checks whether the provided Vector is within the tesselation structure.
     3352/** Checks whether the provided Vector is within the Tesselation structure.
     3353 * Basically calls Tesselation::GetDistanceToSurface() and checks the sign of the return value.
     3354 * @param point of which to check the position
     3355 * @param *LC LinkedCell structure
     3356 *
     3357 * @return true if the point is inside the Tesselation structure, false otherwise
     3358 */
     3359bool Tesselation::IsInnerPoint(const Vector &Point, const LinkedCell* const LC) const
     3360{
     3361  return (GetDistanceSquaredToSurface(Point, LC) < MYEPSILON);
     3362}
     3363
     3364/** Returns the distance to the surface given by the tesselation.
     3365 * Calls FindClosestTriangleToVector() and checks whether the resulting triangle's BoundaryTriangleSet#NormalVector points
     3366 * towards or away from the given \a &Point. Additionally, we check whether it's normal to the normal vector, i.e. on the
     3367 * closest triangle's plane. Then, we have to check whether \a Point is inside the triangle or not to determine whether it's
     3368 * an inside or outside point. This is done by calling BoundaryTriangleSet::GetIntersectionInsideTriangle().
     3369 * In the end we additionally find the point on the triangle who was smallest distance to \a Point:
     3370 *  -# Separate distance from point to center in vector in NormalDirection and on the triangle plane.
     3371 *  -# Check whether vector on triangle plane points inside the triangle or crosses triangle bounds.
     3372 *  -# If inside, take it to calculate closest distance
     3373 *  -# If not, take intersection with BoundaryLine as distance
     3374 *
     3375 * @note distance is squared despite it still contains a sign to determine in-/outside!
    30793376 *
    30803377 * @param point of which to check the position
    30813378 * @param *LC LinkedCell structure
    30823379 *
    3083  * @return true if the point is inside the tesselation structure, false otherwise
    3084  */
    3085 bool Tesselation::IsInnerPoint(const Vector &Point, const LinkedCell* const LC) const
    3086 {
    3087         Info FunctionInfo(__func__);
    3088   class BoundaryTriangleSet *result = FindClosestTriangleToPoint(&Point, LC);
     3380 * @return >0 if outside, ==0 if on surface, <0 if inside (Note that distance can be at most LinkedCell::RADIUS.)
     3381 */
     3382double Tesselation::GetDistanceSquaredToSurface(const Vector &Point, const LinkedCell* const LC) const
     3383{
     3384  Info FunctionInfo(__func__);
     3385  class BoundaryTriangleSet *result = FindClosestTriangleToVector(&Point, LC);
    30893386  Vector Center;
     3387  Vector helper;
     3388  Vector DistanceToCenter;
     3389  Vector Intersection;
     3390  double distance = 0.;
    30903391
    30913392  if (result == NULL) {// is boundary point or only point in point cloud?
    30923393    Log() << Verbose(1) << Point << " is the only point in vicinity." << endl;
    3093     return false;
     3394    return LC->RADIUS;
     3395  } else {
     3396    Log() << Verbose(1) << "INFO: Closest triangle found is " << *result << " with normal vector " << result->NormalVector << "." << endl;
    30943397  }
    30953398
    30963399  result->GetCenter(&Center);
    30973400  Log() << Verbose(2) << "INFO: Central point of the triangle is " << Center << "." << endl;
    3098   Center.SubtractVector(&Point);
    3099   Log() << Verbose(2) << "INFO: Vector from center to point to test is " << Center << "." << endl;
    3100   if (Center.ScalarProduct(&result->NormalVector) > -MYEPSILON) {
    3101     Log() << Verbose(1) << Point << " is an inner point." << endl;
    3102     return true;
     3401  DistanceToCenter.CopyVector(&Center);
     3402  DistanceToCenter.SubtractVector(&Point);
     3403  Log() << Verbose(2) << "INFO: Vector from point to test to center is " << DistanceToCenter << "." << endl;
     3404
     3405  // check whether we are on boundary
     3406  if (fabs(DistanceToCenter.ScalarProduct(&result->NormalVector)) < MYEPSILON) {
     3407    // calculate whether inside of triangle
     3408    DistanceToCenter.CopyVector(&Point);
     3409    Center.CopyVector(&Point);
     3410    Center.SubtractVector(&result->NormalVector); // points towards MolCenter
     3411    DistanceToCenter.AddVector(&result->NormalVector); // points outside
     3412    Log() << Verbose(1) << "INFO: Calling Intersection with " << Center << " and " << DistanceToCenter << "." << endl;
     3413    if (result->GetIntersectionInsideTriangle(&Center, &DistanceToCenter, &Intersection)) {
     3414      Log() << Verbose(1) << Point << " is inner point: sufficiently close to boundary, " << Intersection << "." << endl;
     3415      return 0.;
     3416    } else {
     3417      Log() << Verbose(1) << Point << " is NOT an inner point: on triangle plane but outside of triangle bounds." << endl;
     3418      return false;
     3419    }
    31033420  } else {
    3104     Log() << Verbose(1) << Point << " is NOT an inner point." << endl;
    3105     return false;
    3106   }
    3107 }
    3108 
    3109 /** Checks whether the provided TesselPoint is within the tesselation structure.
    3110  *
    3111  * @param *Point of which to check the position
    3112  * @param *LC Linked Cell structure
    3113  *
    3114  * @return true if the point is inside the tesselation structure, false otherwise
    3115  */
    3116 bool Tesselation::IsInnerPoint(const TesselPoint * const Point, const LinkedCell* const LC) const
    3117 {
    3118         Info FunctionInfo(__func__);
    3119   return IsInnerPoint(*(Point->node), LC);
    3120 }
     3421    // calculate smallest distance
     3422    distance = result->GetClosestPointInsideTriangle(&Point, &Intersection);
     3423    Log() << Verbose(1) << "Closest point on triangle is " << Intersection << "." << endl;
     3424    distance = Min(distance, (LC->RADIUS*LC->RADIUS));
     3425
     3426    // then check direction to boundary
     3427    if (DistanceToCenter.ScalarProduct(&result->NormalVector) > MYEPSILON) {
     3428      Log() << Verbose(1) << Point << " is an inner point, " << distance << " below surface." << endl;
     3429      return -distance;
     3430    } else {
     3431      Log() << Verbose(1) << Point << " is NOT an inner point, " << distance << " above surface." << endl;
     3432      return +distance;
     3433    }
     3434  }
     3435};
    31213436
    31223437/** Gets all points connected to the provided point by triangulation lines.
     
    31263441 * @return set of the all points linked to the provided one
    31273442 */
    3128 set<TesselPoint*> * Tesselation::GetAllConnectedPoints(const TesselPoint* const Point) const
    3129 {
    3130         Info FunctionInfo(__func__);
    3131   set<TesselPoint*> *connectedPoints = new set<TesselPoint*>;
     3443TesselPointSet * Tesselation::GetAllConnectedPoints(const TesselPoint* const Point) const
     3444{
     3445        Info FunctionInfo(__func__);
     3446        TesselPointSet *connectedPoints = new TesselPointSet;
    31323447  class BoundaryPointSet *ReferencePoint = NULL;
    31333448  TesselPoint* current;
     
    31703485  }
    31713486
    3172   if (connectedPoints->size() == 0) { // if have not found any points
     3487  if (connectedPoints->empty()) { // if have not found any points
    31733488    eLog() << Verbose(1) << "We have not found any connected points to " << *Point<< "." << endl;
    31743489    return NULL;
     
    31913506 * @return list of the all points linked to the provided one
    31923507 */
    3193 list<TesselPoint*> * Tesselation::GetCircleOfSetOfPoints(set<TesselPoint*> *SetOfNeighbours, const TesselPoint* const Point, const Vector * const Reference) const
     3508TesselPointList * Tesselation::GetCircleOfConnectedTriangles(TesselPointSet *SetOfNeighbours, const TesselPoint* const Point, const Vector * const Reference) const
    31943509{
    31953510        Info FunctionInfo(__func__);
    31963511  map<double, TesselPoint*> anglesOfPoints;
    3197   list<TesselPoint*> *connectedCircle = new list<TesselPoint*>;
    3198   Vector center;
     3512  TesselPointList *connectedCircle = new TesselPointList;
    31993513  Vector PlaneNormal;
    32003514  Vector AngleZero;
    32013515  Vector OrthogonalVector;
    32023516  Vector helper;
     3517  const TesselPoint * const TrianglePoints[3] = {Point, NULL, NULL};
     3518  TriangleList *triangles = NULL;
    32033519
    32043520  if (SetOfNeighbours == NULL) {
     
    32093525
    32103526  // calculate central point
    3211   for (set<TesselPoint*>::const_iterator TesselRunner = SetOfNeighbours->begin(); TesselRunner != SetOfNeighbours->end(); TesselRunner++)
    3212     center.AddVector((*TesselRunner)->node);
    3213   //Log() << Verbose(0) << "Summed vectors " << center << "; number of points " << connectedPoints.size()
    3214   //  << "; scale factor " << 1.0/connectedPoints.size();
    3215   center.Scale(1.0/SetOfNeighbours->size());
    3216   Log() << Verbose(1) << "INFO: Calculated center of all circle points is " << center << "." << endl;
    3217 
    3218   // projection plane of the circle is at the closes Point and normal is pointing away from center of all circle points
    3219   PlaneNormal.CopyVector(Point->node);
    3220   PlaneNormal.SubtractVector(&center);
     3527  triangles = FindTriangles(TrianglePoints);
     3528  if ((triangles != NULL) && (!triangles->empty())) {
     3529    for (TriangleList::iterator Runner = triangles->begin(); Runner != triangles->end(); Runner++)
     3530      PlaneNormal.AddVector(&(*Runner)->NormalVector);
     3531  } else {
     3532    eLog() << Verbose(0) << "Could not find any triangles for point " << *Point << "." << endl;
     3533    performCriticalExit();
     3534  }
     3535  PlaneNormal.Scale(1.0/triangles->size());
     3536  Log() << Verbose(1) << "INFO: Calculated PlaneNormal of all circle points is " << PlaneNormal << "." << endl;
    32213537  PlaneNormal.Normalize();
    3222   Log() << Verbose(1) << "INFO: Calculated plane normal of circle is " << PlaneNormal << "." << endl;
    32233538
    32243539  // construct one orthogonal vector
     
    32463561
    32473562  // go through all connected points and calculate angle
    3248   for (set<TesselPoint*>::iterator listRunner = SetOfNeighbours->begin(); listRunner != SetOfNeighbours->end(); listRunner++) {
     3563  for (TesselPointSet::iterator listRunner = SetOfNeighbours->begin(); listRunner != SetOfNeighbours->end(); listRunner++) {
    32493564    helper.CopyVector((*listRunner)->node);
    32503565    helper.SubtractVector(Point->node);
     
    32623577}
    32633578
     3579/** Gets all points connected to the provided point by triangulation lines, ordered such that we have the circle round the point.
     3580 * Maps them down onto the plane designated by the axis \a *Point and \a *Reference. The center of all points
     3581 * connected in the tesselation to \a *Point is mapped to spherical coordinates with the zero angle being given
     3582 * by the mapped down \a *Reference. Hence, the biggest and the smallest angles are those of the two shanks of the
     3583 * triangle we are looking for.
     3584 *
     3585 * @param *SetOfNeighbours all points for which the angle should be calculated
     3586 * @param *Point of which get all connected points
     3587 * @param *Reference Reference vector for zero angle or NULL for no preference
     3588 * @return list of the all points linked to the provided one
     3589 */
     3590TesselPointList * Tesselation::GetCircleOfSetOfPoints(TesselPointSet *SetOfNeighbours, const TesselPoint* const Point, const Vector * const Reference) const
     3591{
     3592  Info FunctionInfo(__func__);
     3593  map<double, TesselPoint*> anglesOfPoints;
     3594  TesselPointList *connectedCircle = new TesselPointList;
     3595  Vector center;
     3596  Vector PlaneNormal;
     3597  Vector AngleZero;
     3598  Vector OrthogonalVector;
     3599  Vector helper;
     3600
     3601  if (SetOfNeighbours == NULL) {
     3602    eLog() << Verbose(2) << "Could not find any connected points!" << endl;
     3603    delete(connectedCircle);
     3604    return NULL;
     3605  }
     3606
     3607  // check whether there's something to do
     3608  if (SetOfNeighbours->size() < 3) {
     3609    for (TesselPointSet::iterator TesselRunner = SetOfNeighbours->begin(); TesselRunner != SetOfNeighbours->end(); TesselRunner++)
     3610      connectedCircle->push_back(*TesselRunner);
     3611    return connectedCircle;
     3612  }
     3613
     3614  Log() << Verbose(1) << "INFO: Point is " << *Point << " and Reference is " << *Reference << "." << endl;
     3615  // calculate central point
     3616
     3617  TesselPointSet::const_iterator TesselA = SetOfNeighbours->begin();
     3618  TesselPointSet::const_iterator TesselB = SetOfNeighbours->begin();
     3619  TesselPointSet::const_iterator TesselC = SetOfNeighbours->begin();
     3620  TesselB++;
     3621  TesselC++;
     3622  TesselC++;
     3623  int counter = 0;
     3624  while (TesselC != SetOfNeighbours->end()) {
     3625    helper.MakeNormalVector((*TesselA)->node, (*TesselB)->node, (*TesselC)->node);
     3626    Log() << Verbose(0) << "Making normal vector out of " << *(*TesselA) << ", " << *(*TesselB) << " and " << *(*TesselC) << ":" << helper << endl;
     3627    counter++;
     3628    TesselA++;
     3629    TesselB++;
     3630    TesselC++;
     3631    PlaneNormal.AddVector(&helper);
     3632  }
     3633  //Log() << Verbose(0) << "Summed vectors " << center << "; number of points " << connectedPoints.size()
     3634  //  << "; scale factor " << counter;
     3635  PlaneNormal.Scale(1.0/(double)counter);
     3636//  Log() << Verbose(1) << "INFO: Calculated center of all circle points is " << center << "." << endl;
     3637//
     3638//  // projection plane of the circle is at the closes Point and normal is pointing away from center of all circle points
     3639//  PlaneNormal.CopyVector(Point->node);
     3640//  PlaneNormal.SubtractVector(&center);
     3641//  PlaneNormal.Normalize();
     3642  Log() << Verbose(1) << "INFO: Calculated plane normal of circle is " << PlaneNormal << "." << endl;
     3643
     3644  // construct one orthogonal vector
     3645  if (Reference != NULL) {
     3646    AngleZero.CopyVector(Reference);
     3647    AngleZero.SubtractVector(Point->node);
     3648    AngleZero.ProjectOntoPlane(&PlaneNormal);
     3649  }
     3650  if ((Reference == NULL) || (AngleZero.NormSquared() < MYEPSILON )) {
     3651    Log() << Verbose(1) << "Using alternatively " << *(*SetOfNeighbours->begin())->node << " as angle 0 referencer." << endl;
     3652    AngleZero.CopyVector((*SetOfNeighbours->begin())->node);
     3653    AngleZero.SubtractVector(Point->node);
     3654    AngleZero.ProjectOntoPlane(&PlaneNormal);
     3655    if (AngleZero.NormSquared() < MYEPSILON) {
     3656      eLog() << Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl;
     3657      performCriticalExit();
     3658    }
     3659  }
     3660  Log() << Verbose(1) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl;
     3661  if (AngleZero.NormSquared() > MYEPSILON)
     3662    OrthogonalVector.MakeNormalVector(&PlaneNormal, &AngleZero);
     3663  else
     3664    OrthogonalVector.MakeNormalVector(&PlaneNormal);
     3665  Log() << Verbose(1) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl;
     3666
     3667  // go through all connected points and calculate angle
     3668  pair <map<double, TesselPoint*>::iterator, bool > InserterTest;
     3669  for (TesselPointSet::iterator listRunner = SetOfNeighbours->begin(); listRunner != SetOfNeighbours->end(); listRunner++) {
     3670    helper.CopyVector((*listRunner)->node);
     3671    helper.SubtractVector(Point->node);
     3672    helper.ProjectOntoPlane(&PlaneNormal);
     3673    double angle = GetAngle(helper, AngleZero, OrthogonalVector);
     3674    if (angle > M_PI) // the correction is of no use here (and not desired)
     3675      angle = 2.*M_PI - angle;
     3676    Log() << Verbose(0) << "INFO: Calculated angle between " << helper << " and " << AngleZero << " is " << angle << " for point " << **listRunner << "." << endl;
     3677    InserterTest = anglesOfPoints.insert(pair<double, TesselPoint*>(angle, (*listRunner)));
     3678    if (!InserterTest.second) {
     3679      eLog() << Verbose(0) << "GetCircleOfSetOfPoints() got two atoms with same angle: " << *((InserterTest.first)->second) << " and " << (*listRunner) << endl;
     3680      performCriticalExit();
     3681    }
     3682  }
     3683
     3684  for(map<double, TesselPoint*>::iterator AngleRunner = anglesOfPoints.begin(); AngleRunner != anglesOfPoints.end(); AngleRunner++) {
     3685    connectedCircle->push_back(AngleRunner->second);
     3686  }
     3687
     3688  return connectedCircle;
     3689}
     3690
    32643691/** Gets all points connected to the provided point by triangulation lines, ordered such that we walk along a closed path.
    32653692 *
     
    32683695 * @return list of the all points linked to the provided one
    32693696 */
    3270 list<list<TesselPoint*> *> * Tesselation::GetPathsOfConnectedPoints(const TesselPoint* const Point) const
     3697list< TesselPointList *> * Tesselation::GetPathsOfConnectedPoints(const TesselPoint* const Point) const
    32713698{
    32723699        Info FunctionInfo(__func__);
    32733700  map<double, TesselPoint*> anglesOfPoints;
    3274   list<list<TesselPoint*> *> *ListOfPaths = new list<list<TesselPoint*> *>;
    3275   list<TesselPoint*> *connectedPath = NULL;
     3701  list< TesselPointList *> *ListOfPaths = new list< TesselPointList *>;
     3702  TesselPointList *connectedPath = NULL;
    32763703  Vector center;
    32773704  Vector PlaneNormal;
     
    33103737      } else if (!LineRunner->second) {
    33113738        LineRunner->second = true;
    3312         connectedPath = new list<TesselPoint*>;
     3739        connectedPath = new TesselPointList;
    33133740        triangle = NULL;
    33143741        CurrentLine = runner->second;
     
    33843811 * @return list of the closed paths
    33853812 */
    3386 list<list<TesselPoint*> *> * Tesselation::GetClosedPathsOfConnectedPoints(const TesselPoint* const Point) const
    3387 {
    3388         Info FunctionInfo(__func__);
    3389   list<list<TesselPoint*> *> *ListofPaths = GetPathsOfConnectedPoints(Point);
    3390   list<list<TesselPoint*> *> *ListofClosedPaths = new list<list<TesselPoint*> *>;
    3391   list<TesselPoint*> *connectedPath = NULL;
    3392   list<TesselPoint*> *newPath = NULL;
     3813list<TesselPointList *> * Tesselation::GetClosedPathsOfConnectedPoints(const TesselPoint* const Point) const
     3814{
     3815        Info FunctionInfo(__func__);
     3816  list<TesselPointList *> *ListofPaths = GetPathsOfConnectedPoints(Point);
     3817  list<TesselPointList *> *ListofClosedPaths = new list<TesselPointList *>;
     3818  TesselPointList *connectedPath = NULL;
     3819  TesselPointList *newPath = NULL;
    33933820  int count = 0;
    33943821
    33953822
    3396   list<TesselPoint*>::iterator CircleRunner;
    3397   list<TesselPoint*>::iterator CircleStart;
    3398 
    3399   for(list<list<TesselPoint*> *>::iterator ListRunner = ListofPaths->begin(); ListRunner != ListofPaths->end(); ListRunner++) {
     3823  TesselPointList::iterator CircleRunner;
     3824  TesselPointList::iterator CircleStart;
     3825
     3826  for(list<TesselPointList *>::iterator ListRunner = ListofPaths->begin(); ListRunner != ListofPaths->end(); ListRunner++) {
    34003827    connectedPath = *ListRunner;
    34013828
     
    34063833
    34073834    // go through list, look for reappearance of starting Point and create list
    3408     list<TesselPoint*>::iterator Marker = CircleStart;
     3835    TesselPointList::iterator Marker = CircleStart;
    34093836    for (CircleRunner = CircleStart; CircleRunner != connectedPath->end(); CircleRunner++) {
    34103837      if ((*CircleRunner == *CircleStart) && (CircleRunner != CircleStart)) { // is not the very first point
    34113838        // we have a closed circle from Marker to new Marker
    34123839        Log() << Verbose(1) << count+1 << ". closed path consists of: ";
    3413         newPath = new list<TesselPoint*>;
    3414         list<TesselPoint*>::iterator CircleSprinter = Marker;
     3840        newPath = new TesselPointList;
     3841        TesselPointList::iterator CircleSprinter = Marker;
    34153842        for (; CircleSprinter != CircleRunner; CircleSprinter++) {
    34163843          newPath->push_back(*CircleSprinter);
     
    34463873 * \return pointer to allocated list of triangles
    34473874 */
    3448 set<BoundaryTriangleSet*> *Tesselation::GetAllTriangles(const BoundaryPointSet * const Point) const
    3449 {
    3450         Info FunctionInfo(__func__);
    3451   set<BoundaryTriangleSet*> *connectedTriangles = new set<BoundaryTriangleSet*>;
     3875TriangleSet *Tesselation::GetAllTriangles(const BoundaryPointSet * const Point) const
     3876{
     3877        Info FunctionInfo(__func__);
     3878        TriangleSet *connectedTriangles = new TriangleSet;
    34523879
    34533880  if (Point == NULL) {
     
    34983925  }
    34993926
    3500   list<list<TesselPoint*> *> *ListOfClosedPaths = GetClosedPathsOfConnectedPoints(point->node);
    3501   list<TesselPoint*> *connectedPath = NULL;
     3927  list<TesselPointList *> *ListOfClosedPaths = GetClosedPathsOfConnectedPoints(point->node);
     3928  TesselPointList *connectedPath = NULL;
    35023929
    35033930  // gather all triangles
    35043931  for (LineMap::iterator LineRunner = point->lines.begin(); LineRunner != point->lines.end(); LineRunner++)
    35053932    count+=LineRunner->second->triangles.size();
    3506   map<class BoundaryTriangleSet *, int> Candidates;
     3933  TriangleMap Candidates;
    35073934  for (LineMap::iterator LineRunner = point->lines.begin(); LineRunner != point->lines.end(); LineRunner++) {
    35083935    line = LineRunner->second;
    35093936    for (TriangleMap::iterator TriangleRunner = line->triangles.begin(); TriangleRunner != line->triangles.end(); TriangleRunner++) {
    35103937      triangle = TriangleRunner->second;
    3511       Candidates.insert( pair<class BoundaryTriangleSet *, int> (triangle, triangle->Nr) );
     3938      Candidates.insert( TrianglePair (triangle->Nr, triangle) );
    35123939    }
    35133940  }
     
    35163943  count=0;
    35173944  NormalVector.Zero();
    3518   for (map<class BoundaryTriangleSet *, int>::iterator Runner = Candidates.begin(); Runner != Candidates.end(); Runner++) {
    3519     Log() << Verbose(1) << "INFO: Removing triangle " << *(Runner->first) << "." << endl;
    3520     NormalVector.SubtractVector(&Runner->first->NormalVector); // has to point inward
    3521     RemoveTesselationTriangle(Runner->first);
     3945  for (TriangleMap::iterator Runner = Candidates.begin(); Runner != Candidates.end(); Runner++) {
     3946    Log() << Verbose(1) << "INFO: Removing triangle " << *(Runner->second) << "." << endl;
     3947    NormalVector.SubtractVector(&Runner->second->NormalVector); // has to point inward
     3948    RemoveTesselationTriangle(Runner->second);
    35223949    count++;
    35233950  }
    35243951  Log() << Verbose(1) << count << " triangles were removed." << endl;
    35253952
    3526   list<list<TesselPoint*> *>::iterator ListAdvance = ListOfClosedPaths->begin();
    3527   list<list<TesselPoint*> *>::iterator ListRunner = ListAdvance;
    3528   map<class BoundaryTriangleSet *, int>::iterator NumberRunner = Candidates.begin();
    3529   list<TesselPoint*>::iterator StartNode, MiddleNode, EndNode;
     3953  list<TesselPointList *>::iterator ListAdvance = ListOfClosedPaths->begin();
     3954  list<TesselPointList *>::iterator ListRunner = ListAdvance;
     3955  TriangleMap::iterator NumberRunner = Candidates.begin();
     3956  TesselPointList::iterator StartNode, MiddleNode, EndNode;
    35303957  double angle;
    35313958  double smallestangle;
     
    35413968
    35423969      // re-create all triangles by going through connected points list
    3543       list<class BoundaryLineSet *> NewLines;
     3970      LineList NewLines;
    35443971      for (;!connectedPath->empty();) {
    35453972        // search middle node with widest angle to next neighbours
     
    36474074      // maximize the inner lines (we preferentially created lines with a huge angle, which is for the tesselation not wanted though useful for the closing)
    36484075      if (NewLines.size() > 1) {
    3649         list<class BoundaryLineSet *>::iterator Candidate;
     4076        LineList::iterator Candidate;
    36504077        class BoundaryLineSet *OtherBase = NULL;
    36514078        double tmp, maxgain;
    36524079        do {
    36534080          maxgain = 0;
    3654           for(list<class BoundaryLineSet *>::iterator Runner = NewLines.begin(); Runner != NewLines.end(); Runner++) {
     4081          for(LineList::iterator Runner = NewLines.begin(); Runner != NewLines.end(); Runner++) {
    36554082            tmp = PickFarthestofTwoBaselines(*Runner);
    36564083            if (maxgain < tmp) {
     
    36944121 * Finds triangles belonging to the three provided points.
    36954122 *
    3696  * @param *Points[3] list, is expected to contain three points
     4123 * @param *Points[3] list, is expected to contain three points (NULL means wildcard)
    36974124 *
    36984125 * @return triangles which belong to the provided points, will be empty if there are none,
    36994126 *         will usually be one, in case of degeneration, there will be two
    37004127 */
    3701 list<BoundaryTriangleSet*> *Tesselation::FindTriangles(const TesselPoint* const Points[3]) const
    3702 {
    3703         Info FunctionInfo(__func__);
    3704   list<BoundaryTriangleSet*> *result = new list<BoundaryTriangleSet*>;
     4128TriangleList *Tesselation::FindTriangles(const TesselPoint* const Points[3]) const
     4129{
     4130        Info FunctionInfo(__func__);
     4131        TriangleList *result = new TriangleList;
    37054132  LineMap::const_iterator FindLine;
    37064133  TriangleMap::const_iterator FindTriangle;
    37074134  class BoundaryPointSet *TrianglePoints[3];
     4135  size_t NoOfWildcards = 0;
    37084136
    37094137  for (int i = 0; i < 3; i++) {
    3710     PointMap::const_iterator FindPoint = PointsOnBoundary.find(Points[i]->nr);
    3711     if (FindPoint != PointsOnBoundary.end()) {
    3712       TrianglePoints[i] = FindPoint->second;
     4138    if (Points[i] == NULL) {
     4139      NoOfWildcards++;
     4140      TrianglePoints[i] = NULL;
    37134141    } else {
    3714       TrianglePoints[i] = NULL;
    3715     }
    3716   }
    3717 
    3718   // checks lines between the points in the Points for their adjacent triangles
    3719   for (int i = 0; i < 3; i++) {
    3720     if (TrianglePoints[i] != NULL) {
    3721       for (int j = i+1; j < 3; j++) {
    3722         if (TrianglePoints[j] != NULL) {
    3723           for (FindLine = TrianglePoints[i]->lines.find(TrianglePoints[j]->node->nr); // is a multimap!
    3724               (FindLine != TrianglePoints[i]->lines.end()) && (FindLine->first == TrianglePoints[j]->node->nr);
    3725               FindLine++) {
    3726             for (FindTriangle = FindLine->second->triangles.begin();
    3727                 FindTriangle != FindLine->second->triangles.end();
    3728                 FindTriangle++) {
    3729               if (FindTriangle->second->IsPresentTupel(TrianglePoints)) {
    3730                 result->push_back(FindTriangle->second);
     4142      PointMap::const_iterator FindPoint = PointsOnBoundary.find(Points[i]->nr);
     4143      if (FindPoint != PointsOnBoundary.end()) {
     4144        TrianglePoints[i] = FindPoint->second;
     4145      } else {
     4146        TrianglePoints[i] = NULL;
     4147      }
     4148    }
     4149  }
     4150
     4151  switch (NoOfWildcards) {
     4152    case 0: // checks lines between the points in the Points for their adjacent triangles
     4153      for (int i = 0; i < 3; i++) {
     4154        if (TrianglePoints[i] != NULL) {
     4155          for (int j = i+1; j < 3; j++) {
     4156            if (TrianglePoints[j] != NULL) {
     4157              for (FindLine = TrianglePoints[i]->lines.find(TrianglePoints[j]->node->nr); // is a multimap!
     4158                  (FindLine != TrianglePoints[i]->lines.end()) && (FindLine->first == TrianglePoints[j]->node->nr);
     4159                  FindLine++) {
     4160                for (FindTriangle = FindLine->second->triangles.begin();
     4161                    FindTriangle != FindLine->second->triangles.end();
     4162                    FindTriangle++) {
     4163                  if (FindTriangle->second->IsPresentTupel(TrianglePoints)) {
     4164                    result->push_back(FindTriangle->second);
     4165                  }
     4166                }
    37314167              }
     4168              // Is it sufficient to consider one of the triangle lines for this.
     4169              return result;
    37324170            }
    37334171          }
    3734           // Is it sufficient to consider one of the triangle lines for this.
    3735           return result;
    37364172        }
    37374173      }
    3738     }
     4174      break;
     4175    case 1: // copy all triangles of the respective line
     4176    {
     4177      int i=0;
     4178      for (; i < 3; i++)
     4179        if (TrianglePoints[i] == NULL)
     4180          break;
     4181      for (FindLine = TrianglePoints[(i+1)%3]->lines.find(TrianglePoints[(i+2)%3]->node->nr); // is a multimap!
     4182          (FindLine != TrianglePoints[(i+1)%3]->lines.end()) && (FindLine->first == TrianglePoints[(i+2)%3]->node->nr);
     4183          FindLine++) {
     4184        for (FindTriangle = FindLine->second->triangles.begin();
     4185            FindTriangle != FindLine->second->triangles.end();
     4186            FindTriangle++) {
     4187          if (FindTriangle->second->IsPresentTupel(TrianglePoints)) {
     4188            result->push_back(FindTriangle->second);
     4189          }
     4190        }
     4191      }
     4192      break;
     4193    }
     4194    case 2: // copy all triangles of the respective point
     4195    {
     4196      int i=0;
     4197      for (; i < 3; i++)
     4198        if (TrianglePoints[i] != NULL)
     4199          break;
     4200      for (LineMap::const_iterator line = TrianglePoints[i]->lines.begin(); line != TrianglePoints[i]->lines.end(); line++)
     4201        for (TriangleMap::const_iterator triangle = line->second->triangles.begin(); triangle != line->second->triangles.end(); triangle++)
     4202          result->push_back(triangle->second);
     4203      result->sort();
     4204      result->unique();
     4205      break;
     4206    }
     4207    case 3: // copy all triangles
     4208    {
     4209      for (TriangleMap::const_iterator triangle = TrianglesOnBoundary.begin(); triangle != TrianglesOnBoundary.end(); triangle++)
     4210        result->push_back(triangle->second);
     4211      break;
     4212    }
     4213    default:
     4214      eLog() << Verbose(0) << "Number of wildcards is greater than 3, cannot happen!" << endl;
     4215      performCriticalExit();
     4216      break;
    37394217  }
    37404218
     
    37794257 *         in the list, once as key and once as value
    37804258 */
    3781 map<int, int> * Tesselation::FindAllDegeneratedLines()
     4259IndexToIndex * Tesselation::FindAllDegeneratedLines()
    37824260{
    37834261        Info FunctionInfo(__func__);
    37844262        UniqueLines AllLines;
    3785   map<int, int> * DegeneratedLines = new map<int, int>;
     4263  IndexToIndex * DegeneratedLines = new IndexToIndex;
    37864264
    37874265  // sanity check
     
    38044282
    38054283  Log() << Verbose(0) << "FindAllDegeneratedLines() found " << DegeneratedLines->size() << " lines." << endl;
    3806   map<int,int>::iterator it;
     4284  IndexToIndex::iterator it;
    38074285  for (it = DegeneratedLines->begin(); it != DegeneratedLines->end(); it++) {
    38084286    const LineMap::const_iterator Line1 = LinesOnBoundary.find((*it).first);
     
    38234301 *         in the list, once as key and once as value
    38244302 */
    3825 map<int, int> * Tesselation::FindAllDegeneratedTriangles()
    3826 {
    3827         Info FunctionInfo(__func__);
    3828   map<int, int> * DegeneratedLines = FindAllDegeneratedLines();
    3829   map<int, int> * DegeneratedTriangles = new map<int, int>;
     4303IndexToIndex * Tesselation::FindAllDegeneratedTriangles()
     4304{
     4305        Info FunctionInfo(__func__);
     4306  IndexToIndex * DegeneratedLines = FindAllDegeneratedLines();
     4307  IndexToIndex * DegeneratedTriangles = new IndexToIndex;
    38304308
    38314309  TriangleMap::iterator TriangleRunner1, TriangleRunner2;
     
    38334311  class BoundaryLineSet *line1 = NULL, *line2 = NULL;
    38344312
    3835   for (map<int, int>::iterator LineRunner = DegeneratedLines->begin(); LineRunner != DegeneratedLines->end(); ++LineRunner) {
     4313  for (IndexToIndex::iterator LineRunner = DegeneratedLines->begin(); LineRunner != DegeneratedLines->end(); ++LineRunner) {
    38364314    // run over both lines' triangles
    38374315    Liner = LinesOnBoundary.find(LineRunner->first);
     
    38544332
    38554333  Log() << Verbose(0) << "FindAllDegeneratedTriangles() found " << DegeneratedTriangles->size() << " triangles:" << endl;
    3856   map<int,int>::iterator it;
     4334  IndexToIndex::iterator it;
    38574335  for (it = DegeneratedTriangles->begin(); it != DegeneratedTriangles->end(); it++)
    38584336      Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl;
     
    38684346{
    38694347        Info FunctionInfo(__func__);
    3870   map<int, int> * DegeneratedTriangles = FindAllDegeneratedTriangles();
     4348  IndexToIndex * DegeneratedTriangles = FindAllDegeneratedTriangles();
    38714349  TriangleMap::iterator finder;
    38724350  BoundaryTriangleSet *triangle = NULL, *partnerTriangle = NULL;
    38734351  int count  = 0;
    38744352
    3875   for (map<int, int>::iterator TriangleKeyRunner = DegeneratedTriangles->begin();
     4353  for (IndexToIndex::iterator TriangleKeyRunner = DegeneratedTriangles->begin();
    38764354    TriangleKeyRunner != DegeneratedTriangles->end(); ++TriangleKeyRunner
    38774355  ) {
     
    39614439  // find nearest boundary point
    39624440  class TesselPoint *BackupPoint = NULL;
    3963   class TesselPoint *NearestPoint = FindClosestPoint(point->node, BackupPoint, LC);
     4441  class TesselPoint *NearestPoint = FindClosestTesselPoint(point->node, BackupPoint, LC);
    39644442  class BoundaryPointSet *NearestBoundaryPoint = NULL;
    39654443  PointMap::iterator PointRunner;
     
    41284606
    41294607  /// 2. Go through all BoundaryPointSet's, check their triangles' NormalVector
     4608  IndexToIndex *DegeneratedTriangles = FindAllDegeneratedTriangles();
    41304609  set < BoundaryPointSet *> EndpointCandidateList;
    41314610  pair < set < BoundaryPointSet *>::iterator, bool > InsertionTester;
     
    41384617    for (LineMap::const_iterator LineRunner = (Runner->second)->lines.begin(); LineRunner != (Runner->second)->lines.end(); LineRunner++)
    41394618      for (TriangleMap::const_iterator TriangleRunner = (LineRunner->second)->triangles.begin(); TriangleRunner != (LineRunner->second)->triangles.end(); TriangleRunner++) {
    4140         TriangleInsertionTester = TriangleVectors.insert( pair< int, Vector *> ((TriangleRunner->second)->Nr, &((TriangleRunner->second)->NormalVector)) );
    4141         if (TriangleInsertionTester.second)
    4142           Log() << Verbose(1) << " Adding triangle " << *(TriangleRunner->second) << " to triangles to check-list." << endl;
     4619        if (DegeneratedTriangles->find(TriangleRunner->second->Nr) == DegeneratedTriangles->end()) {
     4620          TriangleInsertionTester = TriangleVectors.insert( pair< int, Vector *> ((TriangleRunner->second)->Nr, &((TriangleRunner->second)->NormalVector)) );
     4621          if (TriangleInsertionTester.second)
     4622            Log() << Verbose(1) << " Adding triangle " << *(TriangleRunner->second) << " to triangles to check-list." << endl;
     4623        } else {
     4624          Log() << Verbose(1) << " NOT adding triangle " << *(TriangleRunner->second) << " as it's a simply degenerated one." << endl;
     4625        }
    41434626      }
    41444627    // check whether there are two that are parallel
     
    42134696    /// 4a. Gather all triangles of this polygon
    42144697    TriangleSet *T = (*PolygonRunner)->GetAllContainedTrianglesFromEndpoints();
     4698
     4699    // check whether number is bigger than 2, otherwise it's just a simply degenerated one and nothing to do.
     4700    if (T->size() == 2) {
     4701      Log() << Verbose(1) << " Skipping degenerated polygon, is just a (already simply degenerated) triangle." << endl;
     4702      delete(T);
     4703      continue;
     4704    }
     4705
     4706    // check whether number is even
     4707    // If this case occurs, we have to think about it!
     4708    // The Problem is probably due to two degenerated polygons being connected by a bridging, non-degenerated polygon, as somehow one node has
     4709    // connections to either polygon ...
     4710    if (T->size() % 2 != 0) {
     4711      eLog() << Verbose(0) << " degenerated polygon contains an odd number of triangles, probably contains bridging non-degenerated ones, too!" << endl;
     4712      performCriticalExit();
     4713    }
    42154714
    42164715    TriangleSet::iterator TriangleWalker = T->begin();  // is the inner iterator
     
    42594758  }
    42604759
    4261   map<int, int> * SimplyDegeneratedTriangles = FindAllDegeneratedTriangles();
     4760  IndexToIndex * SimplyDegeneratedTriangles = FindAllDegeneratedTriangles();
    42624761  Log() << Verbose(0) << "Final list of simply degenerated triangles found, containing " << SimplyDegeneratedTriangles->size() << " triangles:" << endl;
    4263   map<int,int>::iterator it;
     4762  IndexToIndex::iterator it;
    42644763  for (it = SimplyDegeneratedTriangles->begin(); it != SimplyDegeneratedTriangles->end(); it++)
    42654764      Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl;
  • molecuilder/src/tesselation.hpp

    r0af58f r551a58  
    5252// ======================================================= some template functions =========================================
    5353
     54#define IndexToIndex map <int, int>
     55
    5456#define PointMap map < int, class BoundaryPointSet * >
    5557#define PointSet set < class BoundaryPointSet * >
     
    7678#define PolygonSet set < class BoundaryPolygonSet * >
    7779#define PolygonList list < class BoundaryPolygonSet * >
     80
     81#define DistanceToPointMap multimap <double, class BoundaryPointSet * >
     82#define DistanceToPointPair pair <double, class BoundaryPointSet * >
    7883
    7984#define DistanceMultiMap multimap <double, pair < PointMap::iterator, PointMap::iterator> >
     
    101106  public:
    102107    BoundaryPointSet();
    103     BoundaryPointSet(TesselPoint * Walker);
     108    BoundaryPointSet(TesselPoint * const Walker);
    104109    ~BoundaryPointSet();
    105110
    106     void AddLine(class BoundaryLineSet *line);
     111    void AddLine(BoundaryLineSet * const line);
    107112
    108113    LineMap lines;
     
    120125  public:
    121126    BoundaryLineSet();
    122     BoundaryLineSet(class BoundaryPointSet *Point[2], const int number);
     127    BoundaryLineSet(BoundaryPointSet * const Point[2], const int number);
     128    BoundaryLineSet(BoundaryPointSet * const Point1, BoundaryPointSet * const Point2, const int number);
    123129    ~BoundaryLineSet();
    124130
    125     void AddTriangle(class BoundaryTriangleSet *triangle);
    126     bool IsConnectedTo(class BoundaryLineSet *line);
    127     bool ContainsBoundaryPoint(class BoundaryPointSet *point);
    128     bool CheckConvexityCriterion();
    129     class BoundaryPointSet *GetOtherEndpoint(class BoundaryPointSet *);
     131    void AddTriangle(BoundaryTriangleSet * const triangle);
     132    bool IsConnectedTo(const BoundaryLineSet * const line) const;
     133    bool ContainsBoundaryPoint(const BoundaryPointSet * const point) const;
     134    bool CheckConvexityCriterion() const;
     135    class BoundaryPointSet *GetOtherEndpoint(const BoundaryPointSet * const point) const;
    130136
    131137    class BoundaryPointSet *endpoints[2];
     
    142148  public:
    143149    BoundaryTriangleSet();
    144     BoundaryTriangleSet(class BoundaryLineSet *line[3], int number);
     150    BoundaryTriangleSet(class BoundaryLineSet * const line[3], const int number);
    145151    ~BoundaryTriangleSet();
    146152
    147     void GetNormalVector(Vector &NormalVector);
    148     void GetCenter(Vector *center);
    149     bool GetIntersectionInsideTriangle(Vector *MolCenter, Vector *x, Vector *Intersection);
    150     bool ContainsBoundaryLine(class BoundaryLineSet *line);
    151     bool ContainsBoundaryPoint(class BoundaryPointSet *point);
    152     bool ContainsBoundaryPoint(class TesselPoint *point);
    153     class BoundaryPointSet *GetThirdEndpoint(class BoundaryLineSet *line);
    154     bool IsPresentTupel(class BoundaryPointSet *Points[3]);
    155     bool IsPresentTupel(class BoundaryTriangleSet *T);
     153    void GetNormalVector(const Vector &NormalVector);
     154    void GetCenter(Vector * const center) const;
     155    bool GetIntersectionInsideTriangle(const Vector * const MolCenter, const Vector * const x, Vector * const Intersection) const;
     156    double GetClosestPointInsideTriangle(const Vector * const x, Vector * const ClosestPoint) const;
     157    bool ContainsBoundaryLine(const BoundaryLineSet * const line) const;
     158    bool ContainsBoundaryPoint(const BoundaryPointSet * const point) const;
     159    bool ContainsBoundaryPoint(const TesselPoint * const point) const;
     160    class BoundaryPointSet *GetThirdEndpoint(const BoundaryLineSet * const line) const;
     161    bool IsPresentTupel(const BoundaryPointSet * const Points[3]) const;
     162    bool IsPresentTupel(const BoundaryTriangleSet * const T) const;
    156163
    157164    class BoundaryPointSet *endpoints[3];
    158165    class BoundaryLineSet *lines[3];
    159166    Vector NormalVector;
     167    Vector SphereCenter;
    160168    int Nr;
    161169};
     
    225233  virtual TesselPoint *GetPoint() const { return NULL; };
    226234  virtual TesselPoint *GetTerminalPoint() const { return NULL; };
     235  virtual int GetMaxId() const { return 0; };
    227236  virtual void GoToNext() const {};
    228237  virtual void GoToPrevious() const {};
     
    300309    list<list<TesselPoint*> *> * GetClosedPathsOfConnectedPoints(const TesselPoint* const Point) const;
    301310    list<TesselPoint*> * GetCircleOfSetOfPoints(set<TesselPoint*> *SetOfNeighbours, const TesselPoint* const Point, const Vector * const Reference = NULL) const;
     311    list<TesselPoint*> * GetCircleOfConnectedTriangles(set<TesselPoint*> *SetOfNeighbours, const TesselPoint* const Point, const Vector * const Reference) const;
    302312    class BoundaryPointSet *GetCommonEndpoint(const BoundaryLineSet * line1, const BoundaryLineSet * line2) const;
    303313    list<BoundaryTriangleSet*> *FindTriangles(const TesselPoint* const Points[3]) const;
     
    305315    class BoundaryTriangleSet * FindClosestTriangleToPoint(const Vector *x, const LinkedCell* LC) const;
    306316    bool IsInnerPoint(const Vector &Point, const LinkedCell* const LC) const;
    307     bool IsInnerPoint(const TesselPoint * const Point, const LinkedCell* const LC) const;
     317    double GetDistanceSquaredToSurface(const Vector &Point, const LinkedCell* const LC) const;
    308318    bool AddBoundaryPoint(TesselPoint * Walker, const int n);
     319    DistanceToPointMap * FindClosestBoundaryPointsToVector(const Vector *x, const LinkedCell* LC) const;
     320    BoundaryLineSet * FindClosestBoundaryLineToVector(const Vector *x, const LinkedCell* LC) const;
     321    TriangleList * FindClosestTrianglesToVector(const Vector *x, const LinkedCell* LC) const;
     322    BoundaryTriangleSet* FindClosestTriangleToVector(const Vector *x, const LinkedCell* LC) const;
    309323
    310324    // print for debugging
  • molecuilder/src/tesselationhelpers.cpp

    r0af58f r551a58  
    143143  if (fabs(HalfplaneIndicator) < MYEPSILON)
    144144    {
    145       if ((TempNormal.ScalarProduct(AlternativeDirection) <0 and AlternativeIndicator >0) or (TempNormal.ScalarProduct(AlternativeDirection) >0 and AlternativeIndicator <0))
     145      if ((TempNormal.ScalarProduct(AlternativeDirection) <0 && AlternativeIndicator >0) || (TempNormal.ScalarProduct(AlternativeDirection) >0 && AlternativeIndicator <0))
    146146        {
    147147          TempNormal.Scale(-1);
     
    150150  else
    151151    {
    152       if (TempNormal.ScalarProduct(Direction)<0 && HalfplaneIndicator >0 || TempNormal.ScalarProduct(Direction)>0 && HalfplaneIndicator<0)
     152      if (((TempNormal.ScalarProduct(Direction)<0) && (HalfplaneIndicator >0)) || ((TempNormal.ScalarProduct(Direction)>0) && (HalfplaneIndicator<0)))
    153153        {
    154154          TempNormal.Scale(-1);
     
    226226  Vector helper;
    227227  double radius, alpha;
    228 
    229   helper.CopyVector(&NewSphereCenter);
     228  Vector RelativeOldSphereCenter;
     229  Vector RelativeNewSphereCenter;
     230
     231  RelativeOldSphereCenter.CopyVector(&OldSphereCenter);
     232  RelativeOldSphereCenter.SubtractVector(&CircleCenter);
     233  RelativeNewSphereCenter.CopyVector(&NewSphereCenter);
     234  RelativeNewSphereCenter.SubtractVector(&CircleCenter);
     235  helper.CopyVector(&RelativeNewSphereCenter);
    230236  // test whether new center is on the parameter circle's plane
    231237  if (fabs(helper.ScalarProduct(&CirclePlaneNormal)) > HULLEPSILON) {
     
    233239    helper.ProjectOntoPlane(&CirclePlaneNormal);
    234240  }
    235   radius = helper.ScalarProduct(&helper);
     241  radius = helper.NormSquared();
    236242  // test whether the new center vector has length of CircleRadius
    237243  if (fabs(radius - CircleRadius) > HULLEPSILON)
    238244    eLog() << Verbose(1) << "The projected center of the new sphere has radius " << radius << " instead of " << CircleRadius << "." << endl;
    239   alpha = helper.Angle(&OldSphereCenter);
     245  alpha = helper.Angle(&RelativeOldSphereCenter);
    240246  // make the angle unique by checking the halfplanes/search direction
    241247  if (helper.ScalarProduct(&SearchDirection) < -HULLEPSILON)  // acos is not unique on [0, 2.*M_PI), hence extra check to decide between two half intervals
    242248    alpha = 2.*M_PI - alpha;
    243   //Log() << Verbose(1) << "INFO: RelativeNewSphereCenter is " << helper << ", RelativeOldSphereCenter is " << OldSphereCenter << " and resulting angle is " << alpha << "." << endl;
    244   radius = helper.Distance(&OldSphereCenter);
     249  Log() << Verbose(1) << "INFO: RelativeNewSphereCenter is " << helper << ", RelativeOldSphereCenter is " << RelativeOldSphereCenter << " and resulting angle is " << alpha << "." << endl;
     250  radius = helper.Distance(&RelativeOldSphereCenter);
    245251  helper.ProjectOntoPlane(&NormalVector);
    246252  // check whether new center is somewhat away or at least right over the current baseline to prevent intersecting triangles
    247253  if ((radius > HULLEPSILON) || (helper.Norm() < HULLEPSILON)) {
    248     //Log() << Verbose(1) << "INFO: Distance between old and new center is " << radius << " and between new center and baseline center is " << helper.Norm() << "." << endl;
     254    Log() << Verbose(1) << "INFO: Distance between old and new center is " << radius << " and between new center and baseline center is " << helper.Norm() << "." << endl;
    249255    return alpha;
    250256  } else {
    251     //Log() << Verbose(1) << "INFO: NewSphereCenter " << helper << " is too close to OldSphereCenter" << OldSphereCenter << "." << endl;
     257    Log() << Verbose(1) << "INFO: NewSphereCenter " << RelativeNewSphereCenter << " is too close to RelativeOldSphereCenter" << RelativeOldSphereCenter << "." << endl;
    252258    return 2.*M_PI;
    253259  }
     
    552558 * @return point which is second closest to the provided one
    553559 */
    554 TesselPoint* FindSecondClosestPoint(const Vector* Point, const LinkedCell* const LC)
     560TesselPoint* FindSecondClosestTesselPoint(const Vector* Point, const LinkedCell* const LC)
    555561{
    556562        Info FunctionInfo(__func__);
     
    607613 * @return point which is closest to the provided one, NULL if none found
    608614 */
    609 TesselPoint* FindClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, const LinkedCell* const LC)
     615TesselPoint* FindClosestTesselPoint(const Vector* Point, TesselPoint *&SecondPoint, const LinkedCell* const LC)
    610616{
    611617        Info FunctionInfo(__func__);
     
    633639            helper.CopyVector(Point);
    634640            helper.SubtractVector((*Runner)->node);
    635             double currentNorm = helper. Norm();
     641            double currentNorm = helper.NormSquared();
    636642            if (currentNorm < distance) {
    637643              secondDistance = distance;
     
    860866    }
    861867    *tecplot << "\", N=" << TesselStruct->PointsOnBoundary.size() << ", E=" << TesselStruct->TrianglesOnBoundary.size() << ", DATAPACKING=POINT, ZONETYPE=FETRIANGLE" << endl;
    862     int i=0;
    863     for (cloud->GoToFirst(); !cloud->IsEnd(); cloud->GoToNext(), i++);
     868    int i=cloud->GetMaxId();
    864869    int *LookupList = new int[i];
    865870    for (cloud->GoToFirst(), i=0; !cloud->IsEnd(); cloud->GoToNext(), i++)
  • molecuilder/src/tesselationhelpers.hpp

    r0af58f r551a58  
    5959bool CheckLineCriteriaForDegeneratedTriangle(const BoundaryPointSet * const nodes[3]);
    6060bool SortCandidates(const CandidateForTesselation* candidate1, const CandidateForTesselation *candidate2);
    61 TesselPoint* FindClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, const LinkedCell* const LC);
    62 TesselPoint* FindSecondClosestPoint(const Vector*, const LinkedCell* const LC);
     61TesselPoint* FindClosestTesselPoint(const Vector* Point, TesselPoint *&SecondPoint, const LinkedCell* const LC);
     62TesselPoint* FindSecondClosestTesselPoint(const Vector*, const LinkedCell* const LC);
    6363Vector * GetClosestPointBetweenLine(const BoundaryLineSet * const Base, const BoundaryLineSet * const OtherBase);
    6464
  • molecuilder/src/unittests/AnalysisCorrelationToPointUnitTest.cpp

    r0af58f r551a58  
    1111#include <cppunit/extensions/TestFactoryRegistry.h>
    1212#include <cppunit/ui/text/TestRunner.h>
     13
     14#include <cstring>
    1315
    1416#include "analysis_correlation.hpp"
  • molecuilder/src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp

    r0af58f r551a58  
    1111#include <cppunit/extensions/TestFactoryRegistry.h>
    1212#include <cppunit/ui/text/TestRunner.h>
     13
     14#include <cstring>
    1315
    1416#include "analysis_correlation.hpp"
  • molecuilder/src/unittests/AnalysisPairCorrelationUnitTest.cpp

    r0af58f r551a58  
    1111#include <cppunit/extensions/TestFactoryRegistry.h>
    1212#include <cppunit/ui/text/TestRunner.h>
     13
     14#include <cstring>
    1315
    1416#include "analysis_correlation.hpp"
  • molecuilder/src/unittests/Makefile.am

    r0af58f r551a58  
    44AM_CXXFLAGS = $(CPPUNIT_CFLAGS)
    55
    6 TESTS = ActOnAllUnitTest AnalysisBondsUnitTests AnalysisCorrelationToPointUnitTest AnalysisCorrelationToSurfaceUnitTest AnalysisPairCorrelationUnitTest BondGraphUnitTest InfoUnitTest ListOfBondsUnitTest LogUnitTest MemoryUsageObserverUnitTest MemoryAllocatorUnitTest StackClassUnitTest VectorUnitTest
     6TESTS = \
     7  ActOnAllUnitTest \
     8  AnalysisBondsUnitTests \
     9  AnalysisCorrelationToPointUnitTest \
     10  AnalysisCorrelationToSurfaceUnitTest \
     11  AnalysisPairCorrelationUnitTest \
     12  BondGraphUnitTest \
     13  GSLMatrixSymmetricUnitTest \
     14  GSLMatrixUnitTest \
     15  GSLVectorUnitTest \
     16  InfoUnitTest \
     17  LinearSystemOfEquationsUnitTest \
     18  ListOfBondsUnitTest \
     19  LogUnitTest \
     20  MemoryUsageObserverUnitTest \
     21  MemoryAllocatorUnitTest \
     22  StackClassUnitTest \
     23  TesselationUnitTest \
     24  Tesselation_BoundaryTriangleUnitTest \
     25  Tesselation_InOutsideUnitTest \
     26  VectorUnitTest
     27 
    728check_PROGRAMS = $(TESTS)
    829noinst_PROGRAMS = $(TESTS)
    930
    1031ActOnAllUnitTest_SOURCES = ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp
    11 ActOnAllUnitTest_LDADD = ../libmolecuilder.a
     32ActOnAllUnitTest_LDADD = ../libmolecuilder.a ../libgslwrapper.a
    1233
    1334AnalysisBondsUnitTests_SOURCES = analysisbondsunittest.cpp analysisbondsunittest.hpp
    14 AnalysisBondsUnitTests_LDADD = ../libmolecuilder.a
     35AnalysisBondsUnitTests_LDADD = ../libmolecuilder.a ../libgslwrapper.a
    1536
    1637AnalysisCorrelationToPointUnitTest_SOURCES = analysis_correlation.hpp AnalysisCorrelationToPointUnitTest.cpp AnalysisCorrelationToPointUnitTest.hpp
    17 AnalysisCorrelationToPointUnitTest_LDADD = ../libmolecuilder.a
     38AnalysisCorrelationToPointUnitTest_LDADD = ../libmolecuilder.a ../libgslwrapper.a
    1839
    1940AnalysisCorrelationToSurfaceUnitTest_SOURCES = analysis_correlation.hpp AnalysisCorrelationToSurfaceUnitTest.cpp AnalysisCorrelationToSurfaceUnitTest.hpp
    20 AnalysisCorrelationToSurfaceUnitTest_LDADD = ../libmolecuilder.a
     41AnalysisCorrelationToSurfaceUnitTest_LDADD = ../libmolecuilder.a ../libgslwrapper.a
    2142
    2243AnalysisPairCorrelationUnitTest_SOURCES = analysis_correlation.hpp AnalysisPairCorrelationUnitTest.cpp AnalysisPairCorrelationUnitTest.hpp
    23 AnalysisPairCorrelationUnitTest_LDADD = ../libmolecuilder.a
     44AnalysisPairCorrelationUnitTest_LDADD = ../libmolecuilder.a ../libgslwrapper.a
    2445
    2546BondGraphUnitTest_SOURCES = bondgraphunittest.cpp bondgraphunittest.hpp
    26 BondGraphUnitTest_LDADD = ../libmolecuilder.a
     47BondGraphUnitTest_LDADD = ../libmolecuilder.a ../libgslwrapper.a
     48
     49GSLMatrixSymmetricUnitTest_SOURCES = gslmatrixsymmetricunittest.cpp gslmatrixsymmetricunittest.hpp
     50GSLMatrixSymmetricUnitTest_LDADD = ../libgslwrapper.a
     51
     52GSLMatrixUnitTest_SOURCES = gslmatrixunittest.cpp gslmatrixunittest.hpp
     53GSLMatrixUnitTest_LDADD = ../libgslwrapper.a
     54
     55GSLVectorUnitTest_SOURCES = gslvectorunittest.cpp gslvectorunittest.hpp
     56GSLVectorUnitTest_LDADD = ../libgslwrapper.a
    2757
    2858InfoUnitTest_SOURCES = infounittest.cpp infounittest.hpp
    29 InfoUnitTest_LDADD = ../libmolecuilder.a
     59InfoUnitTest_LDADD = ../libmolecuilder.a ../libgslwrapper.a
     60
     61LinearSystemOfEquationsUnitTest_SOURCES = linearsystemofequationsunittest.cpp linearsystemofequationsunittest.hpp
     62LinearSystemOfEquationsUnitTest_LDADD = ../libgslwrapper.a ../libmolecuilder.a
    3063
    3164ListOfBondsUnitTest_SOURCES = listofbondsunittest.cpp listofbondsunittest.hpp
    32 ListOfBondsUnitTest_LDADD = ../libmolecuilder.a
     65ListOfBondsUnitTest_LDADD = ../libmolecuilder.a ../libgslwrapper.a
    3366
    3467LogUnitTest_SOURCES = logunittest.cpp logunittest.hpp
    35 LogUnitTest_LDADD = ../libmolecuilder.a
     68LogUnitTest_LDADD = ../libmolecuilder.a ../libgslwrapper.a
    3669
    3770MemoryAllocatorUnitTest_SOURCES = memoryallocatorunittest.cpp memoryallocatorunittest.hpp
    38 MemoryAllocatorUnitTest_LDADD = ../libmolecuilder.a
     71MemoryAllocatorUnitTest_LDADD = ../libmolecuilder.a ../libgslwrapper.a
    3972
    4073MemoryUsageObserverUnitTest_SOURCES = memoryusageobserverunittest.cpp memoryusageobserverunittest.hpp
    41 MemoryUsageObserverUnitTest_LDADD = ../libmolecuilder.a
     74MemoryUsageObserverUnitTest_LDADD = ../libmolecuilder.a ../libgslwrapper.a
    4275
    4376StackClassUnitTest_SOURCES = stackclassunittest.cpp stackclassunittest.hpp
    44 StackClassUnitTest_LDADD = ../libmolecuilder.a
     77StackClassUnitTest_LDADD = ../libmolecuilder.a ../libgslwrapper.a
     78
     79TesselationUnitTest_SOURCES = tesselationunittest.cpp tesselationunittest.hpp
     80TesselationUnitTest_LDADD = ../libmolecuilder.a ../libgslwrapper.a
     81
     82Tesselation_BoundaryTriangleUnitTest_SOURCES = tesselation_boundarytriangleunittest.cpp tesselation_boundarytriangleunittest.hpp
     83Tesselation_BoundaryTriangleUnitTest_LDADD = ../libmolecuilder.a ../libgslwrapper.a
     84
     85Tesselation_InOutsideUnitTest_SOURCES = tesselation_insideoutsideunittest.cpp tesselation_insideoutsideunittest.hpp
     86Tesselation_InOutsideUnitTest_LDADD = ../libmolecuilder.a ../libgslwrapper.a
    4587
    4688VectorUnitTest_SOURCES = vectorunittest.cpp vectorunittest.hpp
    47 VectorUnitTest_LDADD = ../libmolecuilder.a
     89VectorUnitTest_LDADD = ../libmolecuilder.a ../libgslwrapper.a
    4890
    4991
  • molecuilder/src/unittests/analysisbondsunittest.cpp

    r0af58f r551a58  
    1414#include <iostream>
    1515#include <stdio.h>
     16#include <cstring>
    1617
    1718#include "analysis_bonds.hpp"
  • molecuilder/src/unittests/bondgraphunittest.cpp

    r0af58f r551a58  
    1414#include <iostream>
    1515#include <stdio.h>
     16#include <cstring>
    1617
    1718#include "atom.hpp"
  • molecuilder/src/unittests/listofbondsunittest.cpp

    r0af58f r551a58  
    1111#include <cppunit/extensions/TestFactoryRegistry.h>
    1212#include <cppunit/ui/text/TestRunner.h>
     13
     14#include <cstring>
    1315
    1416#include "listofbondsunittest.hpp"
  • molecuilder/src/unittests/tesselationunittest.cpp

    r0af58f r551a58  
    1212#include <cppunit/extensions/TestFactoryRegistry.h>
    1313#include <cppunit/ui/text/TestRunner.h>
     14
     15#include <cstring>
    1416
    1517#include "defs.hpp"
     
    3032  class TesselPoint *Walker;
    3133  Walker = new TesselPoint;
    32   Walker->node = new Vector(1., 0., 0.);
    33   Walker->Name = new char[3];
     34  Walker->node = new Vector(1., 0., -1.);
     35  Walker->Name = Malloc<char>(3, "TesselationTest::setUp");
    3436  strcpy(Walker->Name, "1");
    3537  Walker->nr = 1;
    3638  Corners.push_back(Walker);
    3739  Walker = new TesselPoint;
    38   Walker->node = new Vector(-1., 1., 0.);
    39   Walker->Name = new char[3];
     40  Walker->node = new Vector(-1., 1., -1.);
     41  Walker->Name = Malloc<char>(3, "TesselationTest::setUp");
    4042  strcpy(Walker->Name, "2");
    4143  Walker->nr = 2;
    4244  Corners.push_back(Walker);
    4345  Walker = new TesselPoint;
    44   Walker->node = new Vector(-1., -1., 0.);
    45   Walker->Name = new char[3];
     46  Walker->node = new Vector(-1., -1., -1.);
     47  Walker->Name = Malloc<char>(3, "TesselationTest::setUp");
    4648  strcpy(Walker->Name, "3");
    4749  Walker->nr = 3;
     
    4951  Walker = new TesselPoint;
    5052  Walker->node = new Vector(-1., 0., 1.);
    51   Walker->Name = new char[3];
     53  Walker->Name = Malloc<char>(3, "TesselationTest::setUp");
    5254  strcpy(Walker->Name, "4");
    5355  Walker->nr = 4;
     
    5961  // create tesselation
    6062  TesselStruct = new Tesselation;
    61   TesselStruct->PointsOnBoundary.clear();
    62   TesselStruct->LinesOnBoundary.clear();
    63   TesselStruct->TrianglesOnBoundary.clear();
     63  CPPUNIT_ASSERT_EQUAL( true, TesselStruct->PointsOnBoundary.empty() );
     64  CPPUNIT_ASSERT_EQUAL( true, TesselStruct->LinesOnBoundary.empty() );
     65  CPPUNIT_ASSERT_EQUAL( true, TesselStruct->TrianglesOnBoundary.empty() );
    6466  TesselStruct->FindStartingTriangle(SPHERERADIUS, LinkedList);
    65   bool flag = false;
    6667
    67   LineMap::iterator baseline = TesselStruct->LinesOnBoundary.begin();
    68   while (baseline != TesselStruct->LinesOnBoundary.end()) {
    69     if (baseline->second->triangles.size() == 1) {
    70       flag = TesselStruct->FindNextSuitableTriangle(*(baseline->second), *(((baseline->second->triangles.begin()))->second), SPHERERADIUS, LinkedList); //the line is there, so there is a triangle, but only one.
     68  CandidateForTesselation *baseline = NULL;
     69  BoundaryTriangleSet *T = NULL;
     70  bool OneLoopWithoutSuccessFlag = true;
     71  bool TesselationFailFlag = false;
     72  while ((!TesselStruct->OpenLines.empty()) && (OneLoopWithoutSuccessFlag)) {
     73    // 2a. fill all new OpenLines
     74    for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) {
     75      baseline = Runner->second;
     76      if (baseline->pointlist.empty()) {
     77        T = (((baseline->BaseLine->triangles.begin()))->second);
     78        TesselationFailFlag = TesselStruct->FindNextSuitableTriangle(*baseline, *T, SPHERERADIUS, LinkedList); //the line is there, so there is a triangle, but only one.
     79      }
    7180    }
    72     baseline++;
    73     if ((baseline == TesselStruct->LinesOnBoundary.end()) && (flag)) {
    74       baseline = TesselStruct->LinesOnBoundary.begin();   // restart if we reach end due to newly inserted lines
    75       flag = false;
     81
     82    // 2b. search for smallest ShortestAngle among all candidates
     83    double ShortestAngle = 4.*M_PI;
     84    for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) {
     85      if (Runner->second->ShortestAngle < ShortestAngle) {
     86        baseline = Runner->second;
     87        ShortestAngle = baseline->ShortestAngle;
     88      }
     89    }
     90    if ((ShortestAngle == 4.*M_PI) || (baseline->pointlist.empty()))
     91      OneLoopWithoutSuccessFlag = false;
     92    else {
     93      TesselStruct->AddCandidateTriangle(*baseline);
    7694    }
    7795  }
     
    84102  delete(TesselStruct);
    85103  for (LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++) {
    86     delete[]((*Runner)->Name);
    87104    delete((*Runner)->node);
    88105    delete(*Runner);
    89106  }
    90107  Corners.clear();
    91 };
    92 
    93 /** UnitTest for Tesselation::IsInnerPoint()
    94  */
    95 void TesselationTest::IsInnerPointTest()
    96 {
    97   // true inside points
    98   CPPUNIT_ASSERT_EQUAL( true, TesselStruct->IsInnerPoint(Vector(0.,0.,0.), LinkedList) );
    99   CPPUNIT_ASSERT_EQUAL( true, TesselStruct->IsInnerPoint(Vector(0.5,0.,0.), LinkedList) );
    100   CPPUNIT_ASSERT_EQUAL( true, TesselStruct->IsInnerPoint(Vector(0.,0.5,0.), LinkedList) );
    101   CPPUNIT_ASSERT_EQUAL( true, TesselStruct->IsInnerPoint(Vector(0.,0.,0.5), LinkedList) );
    102 
    103   // corners
    104   for (LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++)
    105     CPPUNIT_ASSERT_EQUAL( true, TesselStruct->IsInnerPoint((*Runner), LinkedList) );
    106 
    107   // true outside points
    108   CPPUNIT_ASSERT_EQUAL( false, TesselStruct->IsInnerPoint(Vector(0.,5.,0.), LinkedList) );
    109   CPPUNIT_ASSERT_EQUAL( false, TesselStruct->IsInnerPoint(Vector(0.,0.,5.), LinkedList) );
    110   CPPUNIT_ASSERT_EQUAL( false, TesselStruct->IsInnerPoint(Vector(1.,1.,1.), LinkedList) );
    111 
    112   // tricky point, there are three equally close triangles
    113   CPPUNIT_ASSERT_EQUAL( false, TesselStruct->IsInnerPoint(Vector(5.,0.,0.), LinkedList) );
    114 
     108  MemoryUsageObserver::purgeInstance();
     109  logger::purgeInstance();
     110  errorLogger::purgeInstance();
    115111};
    116112
  • molecuilder/src/unittests/tesselationunittest.hpp

    r0af58f r551a58  
    2121{
    2222    CPPUNIT_TEST_SUITE( TesselationTest) ;
    23     CPPUNIT_TEST ( IsInnerPointTest );
    2423    CPPUNIT_TEST ( GetAllTrianglesTest );
    2524    CPPUNIT_TEST ( ContainmentTest );
     
    2928      void setUp();
    3029      void tearDown();
    31       void IsInnerPointTest();
    3230      void GetAllTrianglesTest();
    3331      void ContainmentTest();
  • molecuilder/src/vector.cpp

    r0af58f r551a58  
    88#include "defs.hpp"
    99#include "helpers.hpp"
    10 #include "memoryallocator.hpp"
     10#include "info.hpp"
     11#include "gslmatrix.hpp"
    1112#include "leastsquaremin.hpp"
    1213#include "log.hpp"
     14#include "memoryallocator.hpp"
    1315#include "vector.hpp"
    1416#include "verbose.hpp"
     17
     18#include <gsl/gsl_linalg.h>
     19#include <gsl/gsl_matrix.h>
     20#include <gsl/gsl_permutation.h>
     21#include <gsl/gsl_vector.h>
    1522
    1623/************************************ Functions for class vector ************************************/
     
    215222 * \param *Origin first vector of line
    216223 * \param *LineVector second vector of line
    217  * \return true -  \a this contains intersection point on return, false - line is parallel to plane
     224 * \return true -  \a this contains intersection point on return, false - line is parallel to plane (even if in-plane)
    218225 */
    219226bool Vector::GetIntersectionWithPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset, const Vector * const Origin, const Vector * const LineVector)
    220227{
     228  Info FunctionInfo(__func__);
    221229  double factor;
    222230  Vector Direction, helper;
     
    226234  Direction.SubtractVector(Origin);
    227235  Direction.Normalize();
    228   //Log() << Verbose(4) << "INFO: Direction is " << Direction << "." << endl;
     236  Log() << Verbose(1) << "INFO: Direction is " << Direction << "." << endl;
     237  //Log() << Verbose(1) << "INFO: PlaneNormal is " << *PlaneNormal << " and PlaneOffset is " << *PlaneOffset << "." << endl;
    229238  factor = Direction.ScalarProduct(PlaneNormal);
    230   if (factor < MYEPSILON) { // Uniqueness: line parallel to plane?
    231     eLog() << Verbose(2) << "Line is parallel to plane, no intersection." << endl;
     239  if (fabs(factor) < MYEPSILON) { // Uniqueness: line parallel to plane?
     240    Log() << Verbose(1) << "BAD: Line is parallel to plane, no intersection." << endl;
    232241    return false;
    233242  }
     
    235244  helper.SubtractVector(Origin);
    236245  factor = helper.ScalarProduct(PlaneNormal)/factor;
    237   if (factor < MYEPSILON) { // Origin is in-plane
    238     //Log() << Verbose(2) << "Origin of line is in-plane, simple." << endl;
     246  if (fabs(factor) < MYEPSILON) { // Origin is in-plane
     247    Log() << Verbose(1) << "GOOD: Origin of line is in-plane." << endl;
    239248    CopyVector(Origin);
    240249    return true;
     
    243252  Direction.Scale(factor);
    244253  CopyVector(Origin);
    245   //Log() << Verbose(4) << "INFO: Scaled direction is " << Direction << "." << endl;
     254  Log() << Verbose(1) << "INFO: Scaled direction is " << Direction << "." << endl;
    246255  AddVector(&Direction);
    247256
     
    250259  helper.SubtractVector(PlaneOffset);
    251260  if (helper.ScalarProduct(PlaneNormal) < MYEPSILON) {
    252     //Log() << Verbose(2) << "INFO: Intersection at " << *this << " is good." << endl;
     261    Log() << Verbose(1) << "GOOD: Intersection is " << *this << "." << endl;
    253262    return true;
    254263  } else {
     
    286295
    287296/** Calculates the intersection of the two lines that are both on the same plane.
    288  * We construct auxiliary plane with its vector normal to one line direction and the PlaneNormal, then a vector
    289  * from the first line's offset onto the plane. Finally, scale by factor is 1/cos(angle(line1,line2..)) = 1/SP(...), and
    290  * project onto the first line's direction and add its offset.
     297 * This is taken from Weisstein, Eric W. "Line-Line Intersection." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/Line-LineIntersection.html
    291298 * \param *out output stream for debugging
    292299 * \param *Line1a first vector of first line
     
    299306bool Vector::GetIntersectionOfTwoLinesOnPlane(const Vector * const Line1a, const Vector * const Line1b, const Vector * const Line2a, const Vector * const Line2b, const Vector *PlaneNormal)
    300307{
    301   bool result = true;
    302   Vector Direction, OtherDirection;
    303   Vector AuxiliaryNormal;
    304   Vector Distance;
    305   const Vector *Normal = NULL;
    306   Vector *ConstructedNormal = NULL;
    307   bool FreeNormal = false;
    308 
    309   // construct both direction vectors
    310   Zero();
    311   Direction.CopyVector(Line1b);
    312   Direction.SubtractVector(Line1a);
    313   if (Direction.IsZero())
     308  Info FunctionInfo(__func__);
     309
     310  GSLMatrix *M = new GSLMatrix(4,4);
     311
     312  M->SetAll(1.);
     313  for (int i=0;i<3;i++) {
     314    M->Set(0, i, Line1a->x[i]);
     315    M->Set(1, i, Line1b->x[i]);
     316    M->Set(2, i, Line2a->x[i]);
     317    M->Set(3, i, Line2b->x[i]);
     318  }
     319 
     320  //Log() << Verbose(1) << "Coefficent matrix is:" << endl;
     321  //for (int i=0;i<4;i++) {
     322  //  for (int j=0;j<4;j++)
     323  //    cout << "\t" << M->Get(i,j);
     324  //  cout << endl;
     325  //}
     326  if (fabs(M->Determinant()) > MYEPSILON) {
     327    Log() << Verbose(1) << "Determinant of coefficient matrix is NOT zero." << endl;
    314328    return false;
    315   OtherDirection.CopyVector(Line2b);
    316   OtherDirection.SubtractVector(Line2a);
    317   if (OtherDirection.IsZero())
     329  }
     330  Log() << Verbose(1) << "INFO: Line1a = " << *Line1a << ", Line1b = " << *Line1b << ", Line2a = " << *Line2a << ", Line2b = " << *Line2b << "." << endl;
     331
     332
     333  // constuct a,b,c
     334  Vector a;
     335  Vector b;
     336  Vector c;
     337  Vector d;
     338  a.CopyVector(Line1b);
     339  a.SubtractVector(Line1a);
     340  b.CopyVector(Line2b);
     341  b.SubtractVector(Line2a);
     342  c.CopyVector(Line2a);
     343  c.SubtractVector(Line1a);
     344  d.CopyVector(Line2b);
     345  d.SubtractVector(Line1b);
     346  Log() << Verbose(1) << "INFO: a = " << a << ", b = " << b << ", c = " << c << "." << endl;
     347  if ((a.NormSquared() < MYEPSILON) || (b.NormSquared() < MYEPSILON)) {
     348   Zero();
     349   Log() << Verbose(1) << "At least one of the lines is ill-defined, i.e. offset equals second vector." << endl;
     350   return false;
     351  }
     352
     353  // check for parallelity
     354  Vector parallel;
     355  double factor = 0.;
     356  if (fabs(a.ScalarProduct(&b)*a.ScalarProduct(&b)/a.NormSquared()/b.NormSquared() - 1.) < MYEPSILON) {
     357    parallel.CopyVector(Line1a);
     358    parallel.SubtractVector(Line2a);
     359    factor = parallel.ScalarProduct(&a)/a.Norm();
     360    if ((factor >= -MYEPSILON) && (factor - 1. < MYEPSILON)) {
     361      CopyVector(Line2a);
     362      Log() << Verbose(1) << "Lines conincide." << endl;
     363      return true;
     364    } else {
     365      parallel.CopyVector(Line1a);
     366      parallel.SubtractVector(Line2b);
     367      factor = parallel.ScalarProduct(&a)/a.Norm();
     368      if ((factor >= -MYEPSILON) && (factor - 1. < MYEPSILON)) {
     369        CopyVector(Line2b);
     370        Log() << Verbose(1) << "Lines conincide." << endl;
     371        return true;
     372      }
     373    }
     374    Log() << Verbose(1) << "Lines are parallel." << endl;
     375    Zero();
    318376    return false;
    319 
    320   Direction.Normalize();
    321   OtherDirection.Normalize();
    322 
    323   //Log() << Verbose(4) << "INFO: Normalized Direction " << Direction << " and OtherDirection " << OtherDirection << "." << endl;
    324 
    325   if (fabs(OtherDirection.ScalarProduct(&Direction) - 1.) < MYEPSILON) { // lines are parallel
    326     if ((Line1a == Line2a) || (Line1a == Line2b))
    327       CopyVector(Line1a);
    328     else if ((Line1b == Line2b) || (Line1b == Line2b))
    329         CopyVector(Line1b);
    330     else
    331       return false;
    332     Log() << Verbose(4) << "INFO: Intersection is " << *this << "." << endl;
    333     return true;
    334   } else {
    335     // check whether we have a plane normal vector
    336     if (PlaneNormal == NULL) {
    337       ConstructedNormal = new Vector;
    338       ConstructedNormal->MakeNormalVector(&Direction, &OtherDirection);
    339       Normal = ConstructedNormal;
    340       FreeNormal = true;
    341     } else
    342       Normal = PlaneNormal;
    343 
    344     AuxiliaryNormal.MakeNormalVector(&OtherDirection, Normal);
    345     //Log() << Verbose(4) << "INFO: PlaneNormal is " << *Normal << " and AuxiliaryNormal " << AuxiliaryNormal << "." << endl;
    346 
    347     Distance.CopyVector(Line2a);
    348     Distance.SubtractVector(Line1a);
    349     //Log() << Verbose(4) << "INFO: Distance is " << Distance << "." << endl;
    350     if (Distance.IsZero()) {
    351       // offsets are equal, match found
    352       CopyVector(Line1a);
    353       result = true;
    354     } else {
    355       CopyVector(Distance.Projection(&AuxiliaryNormal));
    356       //Log() << Verbose(4) << "INFO: Projected Distance is " << *this << "." << endl;
    357       double factor = Direction.ScalarProduct(&AuxiliaryNormal);
    358       //Log() << Verbose(4) << "INFO: Scaling factor is " << factor << "." << endl;
    359       Scale(1./(factor*factor));
    360       //Log() << Verbose(4) << "INFO: Scaled Distance is " << *this << "." << endl;
    361       CopyVector(Projection(&Direction));
    362       //Log() << Verbose(4) << "INFO: Distance, projected into Direction, is " << *this << "." << endl;
    363       if (this->IsZero())
    364         result = false;
    365       else
    366         result = true;
    367       AddVector(Line1a);
    368     }
    369 
    370     if (FreeNormal)
    371       delete(ConstructedNormal);
    372   }
    373   if (result)
    374     Log() << Verbose(4) << "INFO: Intersection is " << *this << "." << endl;
    375 
    376   return result;
     377  }
     378
     379  // obtain s
     380  double s;
     381  Vector temp1, temp2;
     382  temp1.CopyVector(&c);
     383  temp1.VectorProduct(&b);
     384  temp2.CopyVector(&a);
     385  temp2.VectorProduct(&b);
     386  Log() << Verbose(1) << "INFO: temp1 = " << temp1 << ", temp2 = " << temp2 << "." << endl;
     387  if (fabs(temp2.NormSquared()) > MYEPSILON)
     388    s = temp1.ScalarProduct(&temp2)/temp2.NormSquared();
     389  else
     390    s = 0.;
     391  Log() << Verbose(1) << "Factor s is " << temp1.ScalarProduct(&temp2) << "/" << temp2.NormSquared() << " = " << s << "." << endl;
     392
     393  // construct intersection
     394  CopyVector(&a);
     395  Scale(s);
     396  AddVector(Line1a);
     397  Log() << Verbose(1) << "Intersection is at " << *this << "." << endl;
     398
     399  return true;
    377400};
    378401
     
    480503  else
    481504    return false;
     505};
     506
     507/** Checks whether vector is normal to \a *normal.
     508 * @return true - vector is normalized, false - vector is not
     509 */
     510bool Vector::IsEqualTo(const Vector * const a) const
     511{
     512  bool status = true;
     513  for (int i=0;i<NDIM;i++) {
     514    if (fabs(x[i] - a->x[i]) > MYEPSILON)
     515      status = false;
     516  }
     517  return status;
    482518};
    483519
  • molecuilder/src/vector.hpp

    r0af58f r551a58  
    4242  bool IsOne() const;
    4343  bool IsNormalTo(const Vector * const normal) const;
     44  bool IsEqualTo(const Vector * const a) const;
    4445
    4546  void AddVector(const Vector * const y);
  • molecuilder/tests/regression/Tesselation/1/post/NonConvexEnvelope.dat

    r0af58f r551a58  
    11TITLE = "3D CONVEX SHELL"
    22VARIABLES = "X" "Y" "Z" "U"
    3 ZONE T="0- H08_ H09_ H11", N=8, E=12, DATAPACKING=POINT, ZONETYPE=FETRIANGLE
     3ZONE T="test", N=8, E=12, DATAPACKING=POINT, ZONETYPE=FETRIANGLE
    449.78209 2.64589 2.64589 0
    559.78209 2.64589 4.42589 0
     
    13131 3 4
    14141 4 7
     154 6 7
    15163 4 5
    16 1 7 8
    17 1 2 8
    18 4 6 7
     174 5 6
    19182 3 5
    20 4 5 6
    21 6 7 8
    22 1 2 3
    23192 5 8
    24205 6 8
     216 7 8
     222 7 8
     231 2 7
     241 2 3
  • molecuilder/tests/regression/Tesselation/1/post/NonConvexEnvelope.r3d

    r0af58f r551a58  
    3434  1.37419 -0.89433 -0.89        0.12489 1.24767 -0.89   -1.12431 -0.89433 -0.89         1. 0. 0.
    35351
    36   2.26414 0.364321 -4.44089e-16         0.12489 1.24767 -0.89   0.12489 1.24767 0.89    1. 0. 0.
    37 1
    38   1.37419 -0.89433 -0.89        -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
    39 1
    40   1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   -1.12431 -0.89433 0.89  1. 0. 0.
    41 1
    4236  0.12489 1.24767 -0.89         -2.01426 0.364321 -4.44089e-16  -1.12431 -0.89433 -0.89         1. 0. 0.
    43371
    44   1.37419 -0.89433 0.89         2.26414 0.364321 -4.44089e-16   0.12489 1.24767 0.89    1. 0. 0.
     38  2.26414 0.364321 -4.44089e-16         0.12489 1.24767 -0.89   0.12489 1.24767 0.89    1. 0. 0.
    45391
    4640  0.12489 1.24767 -0.89         0.12489 1.24767 0.89    -2.01426 0.364321 -4.44089e-16  1. 0. 0.
    47411
    48   -2.01426 0.364321 -4.44089e-16        -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
    49 1
    50   1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   2.26414 0.364321 -4.44089e-16   1. 0. 0.
     42  1.37419 -0.89433 0.89         2.26414 0.364321 -4.44089e-16   0.12489 1.24767 0.89    1. 0. 0.
    51431
    5244  1.37419 -0.89433 0.89         0.12489 1.24767 0.89    -1.12431 -0.89433 0.89  1. 0. 0.
    53451
    5446  0.12489 1.24767 0.89  -2.01426 0.364321 -4.44089e-16  -1.12431 -0.89433 0.89  1. 0. 0.
     471
     48  -2.01426 0.364321 -4.44089e-16        -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
     491
     50  1.37419 -0.89433 0.89         -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
     511
     52  1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   -1.12431 -0.89433 -0.89         1. 0. 0.
     531
     54  1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   2.26414 0.364321 -4.44089e-16   1. 0. 0.
    55559
    5656#  terminating special property
     
    5959  25.0    0.6     -1.0 -1.0 -1.0     0.2        0 0 0 0
    60602
    61   -1.00456 0.23922 0.593333     5       1 0 0
     61  1.67084 -0.47478 -8.88178e-16 5       1 0 0
    62629
    6363  terminating special property
  • molecuilder/tests/regression/Tesselation/2/post/ConvexEnvelope.dat

    r0af58f r551a58  
    11TITLE = "3D CONVEX SHELL"
    22VARIABLES = "X" "Y" "Z" "U"
    3 ZONE T="0- H08_ H09_ H11", N=8, E=12, DATAPACKING=POINT, ZONETYPE=FETRIANGLE
     3ZONE T="test", N=8, E=12, DATAPACKING=POINT, ZONETYPE=FETRIANGLE
    449.78209 2.64589 2.64589 0
    559.78209 2.64589 4.42589 0
     
    13131 3 4
    14141 4 7
     154 6 7
    15163 4 5
    16 1 7 8
    17 1 2 8
    18 4 6 7
     174 5 6
    19182 3 5
    20 4 5 6
    21 6 7 8
    22 1 2 3
    23192 5 8
    24205 6 8
     216 7 8
     222 7 8
     231 2 7
     241 2 3
  • molecuilder/tests/regression/Tesselation/2/post/ConvexEnvelope.r3d

    r0af58f r551a58  
    3434  1.37419 -0.89433 -0.89        0.12489 1.24767 -0.89   -1.12431 -0.89433 -0.89         1. 0. 0.
    35351
    36   2.26414 0.364321 -4.44089e-16         0.12489 1.24767 -0.89   0.12489 1.24767 0.89    1. 0. 0.
    37 1
    38   1.37419 -0.89433 -0.89        -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
    39 1
    40   1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   -1.12431 -0.89433 0.89  1. 0. 0.
    41 1
    4236  0.12489 1.24767 -0.89         -2.01426 0.364321 -4.44089e-16  -1.12431 -0.89433 -0.89         1. 0. 0.
    43371
    44   1.37419 -0.89433 0.89         2.26414 0.364321 -4.44089e-16   0.12489 1.24767 0.89    1. 0. 0.
     38  2.26414 0.364321 -4.44089e-16         0.12489 1.24767 -0.89   0.12489 1.24767 0.89    1. 0. 0.
    45391
    4640  0.12489 1.24767 -0.89         0.12489 1.24767 0.89    -2.01426 0.364321 -4.44089e-16  1. 0. 0.
    47411
    48   -2.01426 0.364321 -4.44089e-16        -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
    49 1
    50   1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   2.26414 0.364321 -4.44089e-16   1. 0. 0.
     42  1.37419 -0.89433 0.89         2.26414 0.364321 -4.44089e-16   0.12489 1.24767 0.89    1. 0. 0.
    51431
    5244  1.37419 -0.89433 0.89         0.12489 1.24767 0.89    -1.12431 -0.89433 0.89  1. 0. 0.
    53451
    5446  0.12489 1.24767 0.89  -2.01426 0.364321 -4.44089e-16  -1.12431 -0.89433 0.89  1. 0. 0.
     471
     48  -2.01426 0.364321 -4.44089e-16        -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
     491
     50  1.37419 -0.89433 0.89         -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
     511
     52  1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   -1.12431 -0.89433 -0.89         1. 0. 0.
     531
     54  1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   2.26414 0.364321 -4.44089e-16   1. 0. 0.
    55559
    5656#  terminating special property
     
    5959  25.0    0.6     -1.0 -1.0 -1.0     0.2        0 0 0 0
    60602
    61   -1.00456 0.23922 0.593333     5       1 0 0
     61  1.67084 -0.47478 -8.88178e-16 5       1 0 0
    62629
    6363  terminating special property
  • molecuilder/tests/regression/Tesselation/2/post/NonConvexEnvelope.dat

    r0af58f r551a58  
    11TITLE = "3D CONVEX SHELL"
    22VARIABLES = "X" "Y" "Z" "U"
    3 ZONE T="0- H08_ H09_ H11", N=8, E=12, DATAPACKING=POINT, ZONETYPE=FETRIANGLE
     3ZONE T="test", N=8, E=12, DATAPACKING=POINT, ZONETYPE=FETRIANGLE
    449.78209 2.64589 2.64589 0
    559.78209 2.64589 4.42589 0
     
    13131 3 4
    14141 4 7
     154 6 7
    15163 4 5
    16 1 7 8
    17 1 2 8
    18 4 6 7
     174 5 6
    19182 3 5
    20 4 5 6
    21 6 7 8
    22 1 2 3
    23192 5 8
    24205 6 8
     216 7 8
     222 7 8
     231 2 7
     241 2 3
  • molecuilder/tests/regression/Tesselation/2/post/NonConvexEnvelope.r3d

    r0af58f r551a58  
    3434  1.37419 -0.89433 -0.89        0.12489 1.24767 -0.89   -1.12431 -0.89433 -0.89         1. 0. 0.
    35351
    36   2.26414 0.364321 -4.44089e-16         0.12489 1.24767 -0.89   0.12489 1.24767 0.89    1. 0. 0.
    37 1
    38   1.37419 -0.89433 -0.89        -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
    39 1
    40   1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   -1.12431 -0.89433 0.89  1. 0. 0.
    41 1
    4236  0.12489 1.24767 -0.89         -2.01426 0.364321 -4.44089e-16  -1.12431 -0.89433 -0.89         1. 0. 0.
    43371
    44   1.37419 -0.89433 0.89         2.26414 0.364321 -4.44089e-16   0.12489 1.24767 0.89    1. 0. 0.
     38  2.26414 0.364321 -4.44089e-16         0.12489 1.24767 -0.89   0.12489 1.24767 0.89    1. 0. 0.
    45391
    4640  0.12489 1.24767 -0.89         0.12489 1.24767 0.89    -2.01426 0.364321 -4.44089e-16  1. 0. 0.
    47411
    48   -2.01426 0.364321 -4.44089e-16        -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
    49 1
    50   1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   2.26414 0.364321 -4.44089e-16   1. 0. 0.
     42  1.37419 -0.89433 0.89         2.26414 0.364321 -4.44089e-16   0.12489 1.24767 0.89    1. 0. 0.
    51431
    5244  1.37419 -0.89433 0.89         0.12489 1.24767 0.89    -1.12431 -0.89433 0.89  1. 0. 0.
    53451
    5446  0.12489 1.24767 0.89  -2.01426 0.364321 -4.44089e-16  -1.12431 -0.89433 0.89  1. 0. 0.
     471
     48  -2.01426 0.364321 -4.44089e-16        -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
     491
     50  1.37419 -0.89433 0.89         -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
     511
     52  1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   -1.12431 -0.89433 -0.89         1. 0. 0.
     531
     54  1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   2.26414 0.364321 -4.44089e-16   1. 0. 0.
    55559
    5656#  terminating special property
     
    5959  25.0    0.6     -1.0 -1.0 -1.0     0.2        0 0 0 0
    60602
    61   -1.00456 0.23922 0.593333     5       1 0 0
     61  1.67084 -0.47478 -8.88178e-16 5       1 0 0
    62629
    6363  terminating special property
  • molecuilder/tests/regression/Tesselation/3/post/NonConvexEnvelope.dat

    r0af58f r551a58  
    11TITLE = "3D CONVEX SHELL"
    22VARIABLES = "X" "Y" "Z" "U"
    3 ZONE T="0- H49_ H50_ H51", N=44, E=86, DATAPACKING=POINT, ZONETYPE=FETRIANGLE
     3ZONE T="test", N=44, E=86, DATAPACKING=POINT, ZONETYPE=FETRIANGLE
    446.9077 1.1106 0.1214 1
    550.3612 -3.628 1.323 1
     
    28282.8131 1.4776 2.5103 0
    29293.9137 2.2936 1.3739 0
    30 2.159 2.5738 1.2698 2
     302.159 2.5738 1.2698 5
    31313.6606 -0.4593 2.1396 2
    32323.2007 -1.4419 0.7311 4
    33 -3.3002 2.3589 0.0094 5
     33-3.3002 2.3589 0.0094 8
    3434-4.377 1.6962 -1.2433 3
    35355.2593 1.4547 -1.7445 0
     
    40405.2727 1.6068 1.2828 2
    4141-6.2394 4.6427 0.0632 0
    42 -4.4738 4.5591 -0.1458 1
     42-4.4738 4.5591 -0.1458 3
    4343-5.5506 3.8964 -1.3985 0
    4444-6.7081 0.9923 0.6224 2
     
    49491 32 44
    50501 32 35
    51 32 33 44
    52511 34 35
    535223 32 35
    54 23 32 33
     5317 23 35
     548 17 35
     558 10 17
     563 8 10
     573 8 35
     583 4 35
     594 29 35
     6029 34 35
     612 3 4
     622 4 29
     632 15 29
     6415 28 29
     6528 29 34
     662 7 15
     677 14 15
     6814 15 28
     6914 25 28
     7025 28 37
     7128 34 37
     721 34 37
     731 37 44
     7425 26 37
     7525 26 27
     7626 27 33
    557726 33 44
    56 1 34 37
    57 29 34 35
    58 17 23 35
    59 18 23 33
    60 26 27 33
    617826 37 44
    62 1 37 44
    63 28 34 37
    64 28 29 34
    65 4 29 35
    66 17 18 23
    67 8 17 35
    68 18 27 33
    69 25 26 27
    70 25 26 37
    71 25 28 37
    72 15 28 29
    73 2 4 29
    74 3 4 35
    75 9 17 18
    76 8 10 17
    77 3 8 35
    78 16 18 27
    797914 25 27
    80 14 25 28
    81 14 15 28
    82 2 15 29
    83 2 3 4
    84 9 10 17
    85 9 18 31
    86 3 8 10
    87 16 18 30
    88 16 27 30
    898014 27 30
    90 7 14 15
    91 2 7 15
    92 2 3 5
    93 9 10 12
    94 9 19 31
    95 18 30 31
    96 3 10 12
    97816 14 30
     826 24 30
     8324 30 36
     8430 36 39
     8527 30 39
     866 7 24
    98876 7 14
    99 2 5 7
    100 3 5 12
    101 9 12 13
    102 9 13 19
    103 13 19 31
    104 30 31 39
    105 6 24 30
    106 6 7 24
    107 5 7 11
    108 5 12 22
    109 12 13 21
    110 13 21 31
    111 27 30 39
    112 31 39 40
    113 24 30 36
    114887 11 24
    115 5 11 22
    116 12 21 22
    117 21 31 43
    118 31 40 43
    119 40 42 43
    120 41 42 43
    121 21 41 43
    122 20 21 41
     8911 20 24
    1239020 24 41
    1249124 36 41
    1259236 41 42
     9311 20 22
     945 11 22
     955 7 11
     962 5 7
     9727 30 39
     9816 27 30
     9916 18 30
     10016 18 27
     10118 27 33
     10218 23 33
     10336 38 39
    12610436 38 42
     10518 30 31
     10630 31 39
     10731 39 40
     1089 18 31
     1099 17 18
     11017 18 23
     1119 19 31
     1129 13 19
     11313 19 31
     11413 21 31
     11521 31 43
     11631 40 43
     1179 12 13
     1189 10 12
     1199 10 17
     12012 13 21
     12112 21 22
     1225 12 22
     1233 5 12
     1242 3 5
     1253 10 12
     12620 21 22
     12720 21 41
     12821 41 43
     12941 42 43
     13023 32 33
     13132 33 44
     13240 42 43
    12713338 40 42
    12813438 39 40
    129 36 38 39
    130 30 36 39
    131 27 30 39
    132 11 20 24
    133 11 20 22
    134 20 21 22
  • molecuilder/tests/regression/Tesselation/3/post/NonConvexEnvelope.r3d

    r0af58f r551a58  
    160160  7.33693 1.04442 0.0886712     5.68853 1.38852 -1.77723        5.55043 -0.952879 -0.490929     1. 0. 0.
    1611611
     162  7.33693 1.04442 0.0886712     6.17523 -0.969279 1.17127       5.55043 -0.952879 -0.490929     1. 0. 0.
     1631
     164  3.62023 1.25552 -2.86813      5.68853 1.38852 -1.77723        5.55043 -0.952879 -0.490929     1. 0. 0.
     1651
     166  1.76663 -0.360379 -2.99373    3.62023 1.25552 -2.86813        5.55043 -0.952879 -0.490929     1. 0. 0.
     1671
     168  2.19193 -1.51408 -0.867629    1.76663 -0.360379 -2.99373      5.55043 -0.952879 -0.490929     1. 0. 0.
     1691
     170  2.19193 -1.51408 -0.867629    0.450934 -2.72908 -2.23353      1.76663 -0.360379 -2.99373      1. 0. 0.
     1711
     172  0.917634 -3.66448 -0.484829   2.19193 -1.51408 -0.867629      0.450934 -2.72908 -2.23353      1. 0. 0.
     1731
     174  0.917634 -3.66448 -0.484829   2.19193 -1.51408 -0.867629      5.55043 -0.952879 -0.490929     1. 0. 0.
     1751
     176  0.917634 -3.66448 -0.484829   1.92773 -2.57738 0.498071       5.55043 -0.952879 -0.490929     1. 0. 0.
     1771
     178  1.92773 -2.57738 0.498071     3.62993 -1.50808 0.698371       5.55043 -0.952879 -0.490929     1. 0. 0.
     1791
     180  3.62993 -1.50808 0.698371     6.17523 -0.969279 1.17127       5.55043 -0.952879 -0.490929     1. 0. 0.
     1811
     182  0.790434 -3.69418 1.29027     0.917634 -3.66448 -0.484829     1.92773 -2.57738 0.498071       1. 0. 0.
     1831
     184  0.790434 -3.69418 1.29027     1.92773 -2.57738 0.498071       3.62993 -1.50808 0.698371       1. 0. 0.
     1851
     186  0.790434 -3.69418 1.29027     2.06173 -1.39848 1.79787        3.62993 -1.50808 0.698371       1. 0. 0.
     1871
     188  2.06173 -1.39848 1.79787      4.08983 -0.525479 2.10687       3.62993 -1.50808 0.698371       1. 0. 0.
     1891
     190  4.08983 -0.525479 2.10687     3.62993 -1.50808 0.698371       6.17523 -0.969279 1.17127       1. 0. 0.
     1911
     192  0.790434 -3.69418 1.29027     -0.287266 -1.67078 2.48017      2.06173 -1.39848 1.79787        1. 0. 0.
     1931
     194  -0.287266 -1.67078 2.48017    1.46453 0.112321 2.50927        2.06173 -1.39848 1.79787        1. 0. 0.
     1951
     196  1.46453 0.112321 2.50927      2.06173 -1.39848 1.79787        4.08983 -0.525479 2.10687       1. 0. 0.
     1971
     198  1.46453 0.112321 2.50927      3.24233 1.41142 2.47757         4.08983 -0.525479 2.10687       1. 0. 0.
     1991
     200  3.24233 1.41142 2.47757       4.08983 -0.525479 2.10687       5.70193 1.54062 1.25007         1. 0. 0.
     2011
     202  4.08983 -0.525479 2.10687     6.17523 -0.969279 1.17127       5.70193 1.54062 1.25007         1. 0. 0.
     2031
     204  7.33693 1.04442 0.0886712     6.17523 -0.969279 1.17127       5.70193 1.54062 1.25007         1. 0. 0.
     2051
     206  7.33693 1.04442 0.0886712     5.70193 1.54062 1.25007         7.56833 1.97852 -0.00632877     1. 0. 0.
     2071
     208  3.24233 1.41142 2.47757       4.34293 2.22742 1.34117         5.70193 1.54062 1.25007         1. 0. 0.
     2091
     210  3.24233 1.41142 2.47757       4.34293 2.22742 1.34117         2.58823 2.50762 1.23707         1. 0. 0.
     2111
     212  4.34293 2.22742 1.34117       2.58823 2.50762 1.23707         5.11553 2.70122 -0.710229       1. 0. 0.
     2131
     214  4.34293 2.22742 1.34117       5.11553 2.70122 -0.710229       7.56833 1.97852 -0.00632877     1. 0. 0.
     2151
     216  4.34293 2.22742 1.34117       5.70193 1.54062 1.25007         7.56833 1.97852 -0.00632877     1. 0. 0.
     2171
     218  1.46453 0.112321 2.50927      3.24233 1.41142 2.47757         2.58823 2.50762 1.23707         1. 0. 0.
     2191
     220  1.46453 0.112321 2.50927      2.58823 2.50762 1.23707         -2.87097 2.29272 -0.0233288     1. 0. 0.
     2211
     222  -0.759066 -0.265179 1.48487   1.46453 0.112321 2.50927        -2.87097 2.29272 -0.0233288     1. 0. 0.
     2231
     224  -0.759066 -0.265179 1.48487   -3.66127 0.565021 1.57007       -2.87097 2.29272 -0.0233288     1. 0. 0.
     2251
     226  -3.66127 0.565021 1.57007     -2.87097 2.29272 -0.0233288     -4.83487 2.76522 1.41487        1. 0. 0.
     2271
     228  -2.87097 2.29272 -0.0233288   -4.83487 2.76522 1.41487        -4.04457 4.49292 -0.178529      1. 0. 0.
     2291
     230  2.58823 2.50762 1.23707       -2.87097 2.29272 -0.0233288     -4.04457 4.49292 -0.178529      1. 0. 0.
     2311
     232  -0.759066 -0.265179 1.48487   -0.287266 -1.67078 2.48017      -3.66127 0.565021 1.57007       1. 0. 0.
     2331
     234  -0.759066 -0.265179 1.48487   -0.287266 -1.67078 2.48017      1.46453 0.112321 2.50927        1. 0. 0.
     2351
     236  -0.287266 -1.67078 2.48017    -2.45927 -1.63678 1.72157       -3.66127 0.565021 1.57007       1. 0. 0.
     2371
     238  -2.45927 -1.63678 1.72157     -4.75167 -1.93408 0.935971      -3.66127 0.565021 1.57007       1. 0. 0.
     2391
     240  -4.75167 -1.93408 0.935971    -3.66127 0.565021 1.57007       -6.27887 0.926121 0.589671      1. 0. 0.
     2411
     242  -3.66127 0.565021 1.57007     -4.83487 2.76522 1.41487        -6.27887 0.926121 0.589671      1. 0. 0.
     2431
     244  -4.83487 2.76522 1.41487      -6.27887 0.926121 0.589671      -7.11497 2.49352 0.479071       1. 0. 0.
     2451
     246  -2.45927 -1.63678 1.72157     -4.75167 -1.93408 0.935971      -3.90927 -3.49908 0.839771      1. 0. 0.
     2471
     248  -1.52417 -3.64138 0.503471    -2.45927 -1.63678 1.72157       -3.90927 -3.49908 0.839771      1. 0. 0.
     2491
     250  -1.52417 -3.64138 0.503471    -0.287266 -1.67078 2.48017      -2.45927 -1.63678 1.72157       1. 0. 0.
     2511
     252  0.790434 -3.69418 1.29027     -1.52417 -3.64138 0.503471      -0.287266 -1.67078 2.48017      1. 0. 0.
     2531
     254  2.58823 2.50762 1.23707       -2.87097 2.29272 -0.0233288     -4.04457 4.49292 -0.178529      1. 0. 0.
     2551
     256  1.15633 1.11082 0.326671      2.58823 2.50762 1.23707         -2.87097 2.29272 -0.0233288     1. 0. 0.
     2571
     258  1.15633 1.11082 0.326671      1.03283 1.01972 -2.14533        -2.87097 2.29272 -0.0233288     1. 0. 0.
     2591
     260  1.15633 1.11082 0.326671      1.03283 1.01972 -2.14533        2.58823 2.50762 1.23707         1. 0. 0.
     2611
     262  1.03283 1.01972 -2.14533      2.58823 2.50762 1.23707         5.11553 2.70122 -0.710229       1. 0. 0.
     2631
     264  1.03283 1.01972 -2.14533      3.62023 1.25552 -2.86813        5.11553 2.70122 -0.710229       1. 0. 0.
     2651
     266  -4.83487 2.76522 1.41487      -5.81017 4.57652 0.0304712      -4.04457 4.49292 -0.178529      1. 0. 0.
     2671
     268  -4.83487 2.76522 1.41487      -5.81017 4.57652 0.0304712      -7.11497 2.49352 0.479071       1. 0. 0.
     2691
     270  1.03283 1.01972 -2.14533      -2.87097 2.29272 -0.0233288     -3.94777 1.63002 -1.27603       1. 0. 0.
     2711
     272  -2.87097 2.29272 -0.0233288   -3.94777 1.63002 -1.27603       -4.04457 4.49292 -0.178529      1. 0. 0.
     2731
     274  -3.94777 1.63002 -1.27603     -4.04457 4.49292 -0.178529      -5.12137 3.83022 -1.43123       1. 0. 0.
     2751
     276  -0.573766 -1.42458 -2.91753   1.03283 1.01972 -2.14533        -3.94777 1.63002 -1.27603       1. 0. 0.
     2771
     278  -0.573766 -1.42458 -2.91753   1.76663 -0.360379 -2.99373      1.03283 1.01972 -2.14533        1. 0. 0.
     2791
     280  1.76663 -0.360379 -2.99373    1.03283 1.01972 -2.14533        3.62023 1.25552 -2.86813        1. 0. 0.
     2811
     282  -0.573766 -1.42458 -2.91753   -2.77417 -0.570279 -1.12083     -3.94777 1.63002 -1.27603       1. 0. 0.
     2831
     284  -0.573766 -1.42458 -2.91753   -2.49667 -2.18078 -1.79993      -2.77417 -0.570279 -1.12083     1. 0. 0.
     2851
     286  -2.49667 -2.18078 -1.79993    -2.77417 -0.570279 -1.12083     -3.94777 1.63002 -1.27603       1. 0. 0.
     2871
     288  -2.49667 -2.18078 -1.79993    -4.17327 -2.53828 -0.635229     -3.94777 1.63002 -1.27603       1. 0. 0.
     2891
     290  -4.17327 -2.53828 -0.635229   -3.94777 1.63002 -1.27603       -6.42617 1.74722 -0.982629      1. 0. 0.
     2911
     292  -3.94777 1.63002 -1.27603     -5.12137 3.83022 -1.43123       -6.42617 1.74722 -0.982629      1. 0. 0.
     2931
     294  -0.573766 -1.42458 -2.91753   -1.62867 -3.74268 -1.79493      -2.49667 -2.18078 -1.79993      1. 0. 0.
     2951
     296  -0.573766 -1.42458 -2.91753   0.450934 -2.72908 -2.23353      -1.62867 -3.74268 -1.79493      1. 0. 0.
     2971
     298  -0.573766 -1.42458 -2.91753   0.450934 -2.72908 -2.23353      1.76663 -0.360379 -2.99373      1. 0. 0.
     2991
     300  -1.62867 -3.74268 -1.79493    -2.49667 -2.18078 -1.79993      -4.17327 -2.53828 -0.635229     1. 0. 0.
     3011
     302  -1.62867 -3.74268 -1.79493    -4.17327 -2.53828 -0.635229     -3.90927 -3.49908 0.839771      1. 0. 0.
     3031
     304  -1.52417 -3.64138 0.503471    -1.62867 -3.74268 -1.79493      -3.90927 -3.49908 0.839771      1. 0. 0.
     3051
     306  0.917634 -3.66448 -0.484829   -1.52417 -3.64138 0.503471      -1.62867 -3.74268 -1.79493      1. 0. 0.
     3071
     308  0.790434 -3.69418 1.29027     0.917634 -3.66448 -0.484829     -1.52417 -3.64138 0.503471      1. 0. 0.
     3091
     310  0.917634 -3.66448 -0.484829   0.450934 -2.72908 -2.23353      -1.62867 -3.74268 -1.79493      1. 0. 0.
     3111
     312  -4.75167 -1.93408 0.935971    -4.17327 -2.53828 -0.635229     -3.90927 -3.49908 0.839771      1. 0. 0.
     3131
     314  -4.75167 -1.93408 0.935971    -4.17327 -2.53828 -0.635229     -6.27887 0.926121 0.589671      1. 0. 0.
     3151
     316  -4.17327 -2.53828 -0.635229   -6.27887 0.926121 0.589671      -6.42617 1.74722 -0.982629      1. 0. 0.
     3171
     318  -6.27887 0.926121 0.589671    -7.11497 2.49352 0.479071       -6.42617 1.74722 -0.982629      1. 0. 0.
     3191
     320  3.62023 1.25552 -2.86813      5.68853 1.38852 -1.77723        5.11553 2.70122 -0.710229       1. 0. 0.
     3211
    162322  5.68853 1.38852 -1.77723      5.11553 2.70122 -0.710229       7.56833 1.97852 -0.00632877     1. 0. 0.
    1633231
    164   7.33693 1.04442 0.0886712     6.17523 -0.969279 1.17127       5.55043 -0.952879 -0.490929     1. 0. 0.
    165 1
    166   3.62023 1.25552 -2.86813      5.68853 1.38852 -1.77723        5.55043 -0.952879 -0.490929     1. 0. 0.
    167 1
    168   3.62023 1.25552 -2.86813      5.68853 1.38852 -1.77723        5.11553 2.70122 -0.710229       1. 0. 0.
    169 1
    170   4.34293 2.22742 1.34117       5.11553 2.70122 -0.710229       7.56833 1.97852 -0.00632877     1. 0. 0.
    171 1
    172   7.33693 1.04442 0.0886712     6.17523 -0.969279 1.17127       5.70193 1.54062 1.25007         1. 0. 0.
    173 1
    174   3.62993 -1.50808 0.698371     6.17523 -0.969279 1.17127       5.55043 -0.952879 -0.490929     1. 0. 0.
    175 1
    176   1.76663 -0.360379 -2.99373    3.62023 1.25552 -2.86813        5.55043 -0.952879 -0.490929     1. 0. 0.
    177 1
    178   1.03283 1.01972 -2.14533      3.62023 1.25552 -2.86813        5.11553 2.70122 -0.710229       1. 0. 0.
    179 1
    180   4.34293 2.22742 1.34117       2.58823 2.50762 1.23707         5.11553 2.70122 -0.710229       1. 0. 0.
    181 1
    182   4.34293 2.22742 1.34117       5.70193 1.54062 1.25007         7.56833 1.97852 -0.00632877     1. 0. 0.
    183 1
    184   7.33693 1.04442 0.0886712     5.70193 1.54062 1.25007         7.56833 1.97852 -0.00632877     1. 0. 0.
    185 1
    186   4.08983 -0.525479 2.10687     6.17523 -0.969279 1.17127       5.70193 1.54062 1.25007         1. 0. 0.
    187 1
    188   4.08983 -0.525479 2.10687     3.62993 -1.50808 0.698371       6.17523 -0.969279 1.17127       1. 0. 0.
    189 1
    190   1.92773 -2.57738 0.498071     3.62993 -1.50808 0.698371       5.55043 -0.952879 -0.490929     1. 0. 0.
    191 1
    192   1.76663 -0.360379 -2.99373    1.03283 1.01972 -2.14533        3.62023 1.25552 -2.86813        1. 0. 0.
    193 1
    194   2.19193 -1.51408 -0.867629    1.76663 -0.360379 -2.99373      5.55043 -0.952879 -0.490929     1. 0. 0.
    195 1
    196   1.03283 1.01972 -2.14533      2.58823 2.50762 1.23707         5.11553 2.70122 -0.710229       1. 0. 0.
    197 1
    198   3.24233 1.41142 2.47757       4.34293 2.22742 1.34117         2.58823 2.50762 1.23707         1. 0. 0.
    199 1
    200   3.24233 1.41142 2.47757       4.34293 2.22742 1.34117         5.70193 1.54062 1.25007         1. 0. 0.
    201 1
    202   3.24233 1.41142 2.47757       4.08983 -0.525479 2.10687       5.70193 1.54062 1.25007         1. 0. 0.
    203 1
    204   2.06173 -1.39848 1.79787      4.08983 -0.525479 2.10687       3.62993 -1.50808 0.698371       1. 0. 0.
    205 1
    206   0.790434 -3.69418 1.29027     1.92773 -2.57738 0.498071       3.62993 -1.50808 0.698371       1. 0. 0.
    207 1
    208   0.917634 -3.66448 -0.484829   1.92773 -2.57738 0.498071       5.55043 -0.952879 -0.490929     1. 0. 0.
    209 1
    210   -0.573766 -1.42458 -2.91753   1.76663 -0.360379 -2.99373      1.03283 1.01972 -2.14533        1. 0. 0.
    211 1
    212   2.19193 -1.51408 -0.867629    0.450934 -2.72908 -2.23353      1.76663 -0.360379 -2.99373      1. 0. 0.
    213 1
    214   0.917634 -3.66448 -0.484829   2.19193 -1.51408 -0.867629      5.55043 -0.952879 -0.490929     1. 0. 0.
    215 1
    216   1.15633 1.11082 0.326671      1.03283 1.01972 -2.14533        2.58823 2.50762 1.23707         1. 0. 0.
    217 1
    218   1.46453 0.112321 2.50927      3.24233 1.41142 2.47757         2.58823 2.50762 1.23707         1. 0. 0.
    219 1
    220   1.46453 0.112321 2.50927      3.24233 1.41142 2.47757         4.08983 -0.525479 2.10687       1. 0. 0.
    221 1
    222   1.46453 0.112321 2.50927      2.06173 -1.39848 1.79787        4.08983 -0.525479 2.10687       1. 0. 0.
    223 1
    224   0.790434 -3.69418 1.29027     2.06173 -1.39848 1.79787        3.62993 -1.50808 0.698371       1. 0. 0.
    225 1
    226   0.790434 -3.69418 1.29027     0.917634 -3.66448 -0.484829     1.92773 -2.57738 0.498071       1. 0. 0.
    227 1
    228   -0.573766 -1.42458 -2.91753   0.450934 -2.72908 -2.23353      1.76663 -0.360379 -2.99373      1. 0. 0.
    229 1
    230   -0.573766 -1.42458 -2.91753   1.03283 1.01972 -2.14533        -3.94777 1.63002 -1.27603       1. 0. 0.
    231 1
    232   0.917634 -3.66448 -0.484829   2.19193 -1.51408 -0.867629      0.450934 -2.72908 -2.23353      1. 0. 0.
    233 1
    234   1.15633 1.11082 0.326671      1.03283 1.01972 -2.14533        -2.87097 2.29272 -0.0233288     1. 0. 0.
    235 1
    236   1.15633 1.11082 0.326671      2.58823 2.50762 1.23707         -2.87097 2.29272 -0.0233288     1. 0. 0.
    237 1
    238   1.46453 0.112321 2.50927      2.58823 2.50762 1.23707         -2.87097 2.29272 -0.0233288     1. 0. 0.
    239 1
    240   -0.287266 -1.67078 2.48017    1.46453 0.112321 2.50927        2.06173 -1.39848 1.79787        1. 0. 0.
    241 1
    242   0.790434 -3.69418 1.29027     -0.287266 -1.67078 2.48017      2.06173 -1.39848 1.79787        1. 0. 0.
    243 1
    244   0.790434 -3.69418 1.29027     0.917634 -3.66448 -0.484829     -1.52417 -3.64138 0.503471      1. 0. 0.
    245 1
    246   -0.573766 -1.42458 -2.91753   0.450934 -2.72908 -2.23353      -1.62867 -3.74268 -1.79493      1. 0. 0.
    247 1
    248   -0.573766 -1.42458 -2.91753   -2.77417 -0.570279 -1.12083     -3.94777 1.63002 -1.27603       1. 0. 0.
    249 1
    250   1.03283 1.01972 -2.14533      -2.87097 2.29272 -0.0233288     -3.94777 1.63002 -1.27603       1. 0. 0.
    251 1
    252   0.917634 -3.66448 -0.484829   0.450934 -2.72908 -2.23353      -1.62867 -3.74268 -1.79493      1. 0. 0.
    253 1
    254   -0.759066 -0.265179 1.48487   1.46453 0.112321 2.50927        -2.87097 2.29272 -0.0233288     1. 0. 0.
    255 1
    256   -0.759066 -0.265179 1.48487   -0.287266 -1.67078 2.48017      1.46453 0.112321 2.50927        1. 0. 0.
    257 1
    258   0.790434 -3.69418 1.29027     -1.52417 -3.64138 0.503471      -0.287266 -1.67078 2.48017      1. 0. 0.
    259 1
    260   0.917634 -3.66448 -0.484829   -1.52417 -3.64138 0.503471      -1.62867 -3.74268 -1.79493      1. 0. 0.
    261 1
    262   -0.573766 -1.42458 -2.91753   -1.62867 -3.74268 -1.79493      -2.49667 -2.18078 -1.79993      1. 0. 0.
    263 1
    264   -0.573766 -1.42458 -2.91753   -2.49667 -2.18078 -1.79993      -2.77417 -0.570279 -1.12083     1. 0. 0.
    265 1
    266   -2.49667 -2.18078 -1.79993    -2.77417 -0.570279 -1.12083     -3.94777 1.63002 -1.27603       1. 0. 0.
    267 1
    268   -2.87097 2.29272 -0.0233288   -3.94777 1.63002 -1.27603       -4.04457 4.49292 -0.178529      1. 0. 0.
    269 1
    270   -0.759066 -0.265179 1.48487   -3.66127 0.565021 1.57007       -2.87097 2.29272 -0.0233288     1. 0. 0.
    271 1
    272   -0.759066 -0.265179 1.48487   -0.287266 -1.67078 2.48017      -3.66127 0.565021 1.57007       1. 0. 0.
    273 1
    274   -1.52417 -3.64138 0.503471    -0.287266 -1.67078 2.48017      -2.45927 -1.63678 1.72157       1. 0. 0.
    275 1
    276   -1.52417 -3.64138 0.503471    -1.62867 -3.74268 -1.79493      -3.90927 -3.49908 0.839771      1. 0. 0.
    277 1
    278   -1.62867 -3.74268 -1.79493    -2.49667 -2.18078 -1.79993      -4.17327 -2.53828 -0.635229     1. 0. 0.
    279 1
    280   -2.49667 -2.18078 -1.79993    -4.17327 -2.53828 -0.635229     -3.94777 1.63002 -1.27603       1. 0. 0.
    281 1
    282   2.58823 2.50762 1.23707       -2.87097 2.29272 -0.0233288     -4.04457 4.49292 -0.178529      1. 0. 0.
    283 1
    284   -3.94777 1.63002 -1.27603     -4.04457 4.49292 -0.178529      -5.12137 3.83022 -1.43123       1. 0. 0.
    285 1
    286   -3.66127 0.565021 1.57007     -2.87097 2.29272 -0.0233288     -4.83487 2.76522 1.41487        1. 0. 0.
    287 1
    288   -0.287266 -1.67078 2.48017    -2.45927 -1.63678 1.72157       -3.66127 0.565021 1.57007       1. 0. 0.
    289 1
    290   -1.52417 -3.64138 0.503471    -2.45927 -1.63678 1.72157       -3.90927 -3.49908 0.839771      1. 0. 0.
    291 1
    292   -1.62867 -3.74268 -1.79493    -4.17327 -2.53828 -0.635229     -3.90927 -3.49908 0.839771      1. 0. 0.
    293 1
    294   -4.17327 -2.53828 -0.635229   -3.94777 1.63002 -1.27603       -6.42617 1.74722 -0.982629      1. 0. 0.
    295 1
    296   -3.94777 1.63002 -1.27603     -5.12137 3.83022 -1.43123       -6.42617 1.74722 -0.982629      1. 0. 0.
    297 1
    298324  -5.12137 3.83022 -1.43123     -7.11497 2.49352 0.479071       -6.42617 1.74722 -0.982629      1. 0. 0.
    2993251
    300   -6.27887 0.926121 0.589671    -7.11497 2.49352 0.479071       -6.42617 1.74722 -0.982629      1. 0. 0.
    301 1
    302   -4.17327 -2.53828 -0.635229   -6.27887 0.926121 0.589671      -6.42617 1.74722 -0.982629      1. 0. 0.
    303 1
    304   -4.75167 -1.93408 0.935971    -4.17327 -2.53828 -0.635229     -6.27887 0.926121 0.589671      1. 0. 0.
    305 1
    306   -4.75167 -1.93408 0.935971    -3.66127 0.565021 1.57007       -6.27887 0.926121 0.589671      1. 0. 0.
    307 1
    308   -3.66127 0.565021 1.57007     -4.83487 2.76522 1.41487        -6.27887 0.926121 0.589671      1. 0. 0.
    309 1
    310   -4.83487 2.76522 1.41487      -6.27887 0.926121 0.589671      -7.11497 2.49352 0.479071       1. 0. 0.
    311 1
    312   -4.83487 2.76522 1.41487      -5.81017 4.57652 0.0304712      -7.11497 2.49352 0.479071       1. 0. 0.
    313 1
    314326  -5.81017 4.57652 0.0304712    -5.12137 3.83022 -1.43123       -7.11497 2.49352 0.479071       1. 0. 0.
    3153271
    316328  -5.81017 4.57652 0.0304712    -4.04457 4.49292 -0.178529      -5.12137 3.83022 -1.43123       1. 0. 0.
    317 1
    318   -4.83487 2.76522 1.41487      -5.81017 4.57652 0.0304712      -4.04457 4.49292 -0.178529      1. 0. 0.
    319 1
    320   -2.87097 2.29272 -0.0233288   -4.83487 2.76522 1.41487        -4.04457 4.49292 -0.178529      1. 0. 0.
    321 1
    322   2.58823 2.50762 1.23707       -2.87097 2.29272 -0.0233288     -4.04457 4.49292 -0.178529      1. 0. 0.
    323 1
    324   -2.45927 -1.63678 1.72157     -4.75167 -1.93408 0.935971      -3.66127 0.565021 1.57007       1. 0. 0.
    325 1
    326   -2.45927 -1.63678 1.72157     -4.75167 -1.93408 0.935971      -3.90927 -3.49908 0.839771      1. 0. 0.
    327 1
    328   -4.75167 -1.93408 0.935971    -4.17327 -2.53828 -0.635229     -3.90927 -3.49908 0.839771      1. 0. 0.
    3293299
    330330#  terminating special property
     
    333333  25.0    0.6     -1.0 -1.0 -1.0     0.2        0 0 0 0
    3343342
    335   -4.27807 -2.65715 0.380171    5       1 0 0
     335  -4.99203 4.29989 -0.526429    5       1 0 0
    3363369
    337337  terminating special property
  • molecuilder/tests/testsuite.at

    r0af58f r551a58  
    1212AT_CHECK([pwd],[ignore],[ignore])
    1313AT_CHECK([../../molecuilder -v], 0, [stdout], [ignore])
    14 AT_CHECK([fgrep molecuilder stdout], 0, [ignore], [ignore])
     14AT_CHECK([fgrep olecuilder stdout], 0, [ignore], [ignore])
    1515AT_CHECK([../../molecuilder -h], 0, [stdout], [ignore])
    1616AT_CHECK([fgrep "Give this help screen" stdout], 0, [ignore], [ignore])
    17 AT_CHECK([../../molecuilder -e], 0, [ignore], [stderr])
     17AT_CHECK([../../molecuilder -e], 255, [ignore], [stderr])
    1818AT_CHECK([fgrep "Not enough or invalid arguments" stderr], 0, [ignore], [ignore])
    1919AT_CHECK([../../molecuilder test.conf], 0, [stdout], [stderr])
     
    7878AT_SETUP([Simple configuration - invalid commands on present configs])
    7979AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/7/pre/test.conf .], 0)
    80 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -t -s -b -E -c -b -a -U -T -u], 255, [ignore], [stderr])
    81 AT_CHECK([fgrep -c "Not enough or invalid" stderr], 0, [9
    82 ], [ignore])
     80AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -t], 255, [ignore], [stderr])
     81AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
     82AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -s -b -E -c -b -a -U -T -u], 255, [ignore], [stderr])
     83AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
     84AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -b -E -c -b -a -U -T -u], 255, [ignore], [stderr])
     85AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
     86AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -E -c -b -a -U -T -u], 255, [ignore], [stderr])
     87AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
     88AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -c -b -a -U -T -u], 255, [ignore], [stderr])
     89AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
     90AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -b -a -U -T -u], 255, [ignore], [stderr])
     91AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
     92AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -a -U -T -u], 255, [ignore], [stderr])
     93AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
     94AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -U -T -u], 255, [ignore], [stderr])
     95AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
     96AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -T -u], 255, [ignore], [stderr])
     97AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
     98AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -u], 255, [ignore], [stderr])
     99AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
    83100AT_CLEANUP
    84101
     
    88105AT_SETUP([Graph - DFS analysis])
    89106AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Graph/1/pre/test.conf .], 0)
    90 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -D 2.], 0, [stdout], [stderr])
     107AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -vvv -D 2.], 0, [stdout], [stderr])
    91108AT_CHECK([fgrep -c "No rings were detected in the molecular structure." stdout], 0, [1
    92109], [ignore])
     
    134151AT_CHECK([file=ConvexEnvelope.dat; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/2/post/$file], 0, [ignore], [ignore])
    135152AT_CHECK([file=ConvexEnvelope.r3d; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/2/post/$file], 0, [ignore], [ignore])
    136 AT_CHECK([fgrep "RESULT: The summed volume is 16.401577 angstrom^3" stdout], 0, [ignore], [ignore])
     153AT_CHECK([fgrep "tesselated volume area is 16.4016 angstrom^3" stdout], 0, [ignore], [ignore])
    137154AT_CHECK([diff ConvexEnvelope.dat NonConvexEnvelope.dat], 0, [ignore], [ignore])
    138155AT_CLEANUP
     
    152169#AT_CHECK([file=ConvexEnvelope.dat; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/4/post/$file], 0, [ignore], [ignore])
    153170#AT_CHECK([file=ConvexEnvelope.r3d; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/4/post/$file], 0, [ignore], [ignore])
    154 #AT_CHECK([fgrep "RESULT: The summed volume is 16.401577 angstrom^3" stdout], 0, [ignore], [ignore])
     171#AT_CHECK([fgrep "tesselated volume area is 16.4016 angstrom^3" stdout], 0, [ignore], [ignore])
    155172#AT_CLEANUP
    156173
  • pcp/src/Makefile.am

    r0af58f r551a58  
    77FORCE:
    88$(srcdir)/.git-version: FORCE
    9         @if (test -d $(top_srcdir)/../.git && cd $(srcdir) && git describe --tags HEAD) > .git-version-t 2>/dev/null \
     9        @if (test -d $(top_srcdir)/../.git && cd $(srcdir) && git describe HEAD) > .git-version-t 2>/dev/null \
    1010          && ! diff .git-version-t $(srcdir)/.git-version >/dev/null 2>&1; then \
    1111          mv -f .git-version-t $(srcdir)/.git-version; \
  • util/src/Makefile.am

    r0af58f r551a58  
    6767        LinearlyInterpolateBetweenPCPConfigs.py \
    6868        OutputRaster3DHeader.py \
    69         LinearlyInterpolateBetweenPCPConfigs.py \
    7069        PairCorrelationTIP3toResiduum.py \
    7170        PairCorrelationToCluster.py \
     
    7574        ReMapDBondFileFromXYZ.py \
    7675        ReMapDBondFile.py \
    77         RemoveConvexPart.py \
    78         RemoveRandomAtoms.py \
    7976        RemoveConvexPart.py \
    8077        RemoveRandomAtoms.py \
     
    8784FORCE:
    8885$(srcdir)/.git-version: FORCE
    89         @if (test -d $(top_srcdir)/../.git && cd $(srcdir) && git describe --tags HEAD) > .git-version-t 2>/dev/null \
     86        @if (test -d $(top_srcdir)/../.git && cd $(srcdir) && git describe HEAD) > .git-version-t 2>/dev/null \
    9087          && ! diff .git-version-t $(srcdir)/.git-version >/dev/null 2>&1; then \
    9188          mv -f .git-version-t $(srcdir)/.git-version; \
Note: See TracChangeset for help on using the changeset viewer.