![]() |
00001 // Copyright (C) 2003 Johan Hoffman and Anders Logg. 00002 // Licensed under the GNU GPL Version 2. 00003 00004 #ifndef __PARTITION_H 00005 #define __PARTITION_H 00006 00007 #include <functional> 00008 #include <dolfin/constants.h> 00009 #include <dolfin/NewArray.h> 00010 00011 namespace dolfin { 00012 00013 class Adaptivity; 00014 class Regulator; 00015 00019 00020 class Partition { 00021 public: 00022 00024 Partition(unsigned int N); 00025 00027 ~Partition(); 00028 00030 int size() const; 00031 00033 int index(unsigned int pos) const; 00034 00036 void update(int offset, int& end, real& K, Adaptivity& adaptivity); 00037 00038 private: 00039 00040 // Debug partitioning 00041 void debug(unsigned int offset, unsigned int end, Adaptivity& adaptivity) const; 00042 00043 // Compute largest time step 00044 real maximum(int offset, Adaptivity& adaptivity) const; 00045 00046 // Compute smallest time step 00047 real minimum(int offset, Adaptivity& adaptivity, int end) const; 00048 00049 // Comparison operator for the partition 00050 struct Less : public std::unary_function<unsigned int, bool> 00051 { 00052 Less(real& K, Adaptivity& adaptivity); 00053 bool operator()(unsigned int index) const; 00054 00055 real K; 00056 Adaptivity& adaptivity; 00057 }; 00058 00059 // List of component indices 00060 NewArray<unsigned int> indices; 00061 00062 // Threshold for partition 00063 real threshold; 00064 00065 }; 00066 00067 } 00068 00069 #endif
Documentation automatically generated with Doxygen on 10 Sep 2004.