Changeset ff4611 for molecuilder/src/boundary.cpp
- Timestamp:
- Dec 19, 2009, 7:32:24 PM (16 years ago)
- Children:
- eda56a
- Parents:
- f78203
- File:
-
- 1 edited
-
molecuilder/src/boundary.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/boundary.cpp
rf78203 rff4611 654 654 * \param *out output stream for debugging 655 655 * \param *mol molecule with atoms and bonds 656 * \param * &TesselStruct Tesselation with boundary triangles656 * \param *TesselStruct Tesselation with boundary triangles 657 657 * \param *filename prefix of filename 658 658 * \param *extraSuffix intermediate suffix 659 659 */ 660 void StoreTrianglesinFile(const molecule * const mol, const Tesselation * &TesselStruct, const char *filename, const char *extraSuffix)660 void StoreTrianglesinFile(const molecule * const mol, const Tesselation * const TesselStruct, const char *filename, const char *extraSuffix) 661 661 { 662 662 Info FunctionInfo(__func__); … … 789 789 * \param configuration contains box dimensions 790 790 * \param distance[NDIM] distance between filling molecules in each direction 791 * \param epsilon distance to surface which is not filled 791 792 * \param RandAtomDisplacement maximum distance for random displacement per atom 792 793 * \param RandMolDisplacement maximum distance for random displacement per filler molecule … … 794 795 * \return *mol pointer to new molecule with filled atoms 795 796 */ 796 molecule * FillBoxWithMolecule(MoleculeListClass *List, molecule *filler, config &configuration, double distance[NDIM], double RandomAtomDisplacement, double RandomMolDisplacement,bool DoRandomRotation)797 molecule * FillBoxWithMolecule(MoleculeListClass *List, molecule *filler, config &configuration, const double distance[NDIM], const double epsilon, const double RandomAtomDisplacement, const double RandomMolDisplacement, const bool DoRandomRotation) 797 798 { 798 799 Info FunctionInfo(__func__); … … 817 818 for (MoleculeList::iterator ListRunner = List->ListOfMolecules.begin(); ListRunner != List->ListOfMolecules.end(); ListRunner++) { 818 819 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 } 820 LCList[i] = new LinkedCell((*ListRunner), 10.); // get linked cell list 821 Log() << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl; 822 TesselStruct[i] = NULL; 823 FindNonConvexBorder((*ListRunner), TesselStruct[i], (const LinkedCell *&)LCList[i], 5., NULL); 824 824 i++; 825 825 } … … 835 835 FillerDistance.Init(distance[0], distance[1], distance[2]); 836 836 FillerDistance.InverseMatrixMultiplication(M); 837 Log() << Verbose(1) << "INFO: Grid steps are "; 838 for(int i=0;i<NDIM;i++) { 837 for(int i=0;i<NDIM;i++) 839 838 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 } 839 Log() << Verbose(1) << "INFO: Grid steps are " << N[0] << ", " << N[1] << ", " << N[2] << "." << endl; 846 840 847 841 // go over [0,1]^3 filler grid … … 862 856 FillIt = false; 863 857 } else { 864 FillIt = FillIt && (!TesselStruct[i]->IsInnerPoint(CurrentPosition, LCList[i])); 858 const bool FillResult = (!TesselStruct[i]->IsInnerPoint(CurrentPosition, LCList[i], epsilon)); 859 FillIt = FillIt && FillResult; 860 if (FillResult) { 861 Log() << Verbose(1) << "INFO: Position at " << CurrentPosition << " is outer point." << endl; 862 } else { 863 Log() << Verbose(1) << "INFO: Position at " << CurrentPosition << " is inner point." << endl; 864 } 865 865 i++; 866 866 } 867 867 } 868 868 869 if ( FillIt) {869 if (!FillIt) { 870 870 // fill in Filler 871 871 Log() << Verbose(2) << "Space at " << CurrentPosition << " is unoccupied by any molecule, filling in." << endl; … … 931 931 } 932 932 Free(&M); 933 934 // output to file 935 TesselStruct[0]->LastTriangle = NULL; 936 StoreTrianglesinFile(Filling, TesselStruct[0], "Tesselated", ".dat"); 937 933 938 for (size_t i=0;i<List->ListOfMolecules.size();i++) { 934 939 delete(LCList[i]);
Note:
See TracChangeset
for help on using the changeset viewer.
