00001 // This is a -*- C++ -*- file 00002 //------------------------------------------------------------------------------------// 00003 // // 00004 // Copyright (c) 2001 // 00005 // INRIA // 00006 // 54600 VILLERS LES NANCY // 00007 // France // 00008 // // 00009 //------------------------------------------------------------------------------------// 00010 // // 00011 // * NOTICE OF PROPRIETARY INFORMATION * // 00012 // // 00013 // The information contained in this file is considered proprietary and the exclusive // 00014 // property of INRIA. This information may not be disclosed, duplicated // 00015 // or used, in whole or in part, for any purpose whatsoever without express written // 00016 // authorization from INRIA // 00017 // // 00018 #ifndef _OC_PARTITIONBASE_T_H_ 00019 #define _OC_PARTITIONBASE_T_H_ 00020 00021 #include <fstream> 00022 #include <vector> 00023 00024 #include "commonDef.h" 00025 #include "fragmentClass.h" 00026 #include "subDomain.h" 00027 00028 template < class TYPEOFATOMS > 00029 class PartitionBase{ 00030 00031 public: 00032 PartitionBase() ; 00033 PartitionBase(const int size, const double R1, const double R2) ; 00034 // 00035 ~PartitionBase() ; 00036 bool attachAtoms(TYPEOFATOMS *atoms ) ; 00037 bool build_fragmentStructure( ) ; 00038 bool attachAtoms(setOfFragments *fragments ) ; 00039 // 00040 void readFromFile(std::ifstream & data) ; 00041 // 00042 void writeInFile( std::ofstream & out ) ; 00043 void writeInVTKFormat(std::ofstream &out) ; 00044 00045 void newWriteInFile( std::ofstream & out ) ; 00046 void newWriteInFileOld( std::ofstream & out ) ; 00047 void resetData(); 00048 void setPartitionType(const std::string & type) 00049 { _partitionType = type ;} 00050 std::string getPartitionType() 00051 { return _partitionType ;} 00052 int numberOfPartition() const 00053 { return _numberOfPartition ;} 00054 // 00055 bool setAtomsInOverlapAndCut() ; 00056 // 00057 void setLoad() ; 00058 void fixAtomsInZone(); 00059 void buildAtomsInZone(); 00060 // 00061 bool fragmentsToAtoms() ; 00062 // 00063 void getAtomsIndexInPartition(const int& part, std::vector<int>& index); 00064 00065 protected: 00066 // 00067 void newReadFromFile( std::ifstream & data ) ; 00068 void oldReadFromFile( std::ifstream & data ) ; 00069 // void setArray() ; 00070 // 00071 std::string _partitionType ; 00072 int _numberOfPartition ; 00073 int *_charge ; 00074 TYPEOFATOMS *_setOfAtoms ; 00075 setOfFragments *_setOfFragments ; 00076 subDomain *_subDomains ; 00077 std::vector<AtomIn> *_atomsInZone ; 00078 double _Rbuffer1 ; 00079 double _Rbuffer2 ; 00080 bool _useFrag ; 00081 std::vector<int> _nextATofFrag ; 00082 std::vector<int> _firstATofFrag ; 00083 }; 00084 #endif