00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GROUP_H
00021 #define GROUP_H
00022
00023 #include "config.h"
00024 #include "mesh.h"
00025 #include <list>
00026
00027 namespace nanomagn {
00028
00033 class group: public chord {
00034
00038 group* parent;
00039
00044 std::list<group> subGroups;
00045
00049 int nelem;
00050
00054 dcmplx c;
00055
00059 dcmplx cz;
00060
00064 double r;
00065
00069 std::list<group*> Partners;
00070
00071 #ifdef SFK_CACHING
00072
00075 std::list<taylorbasis> taylS;
00076
00080 std::list<taylorbasis> taylV;
00081 #else
00082
00086 double gcurr;
00087 #endif
00088
00089
00090
00091
00092
00093
00097 moments mpole;
00098
00102 moments smoothField;
00103 public:
00104
00110 group(int nelem, const mesh &Mesh);
00111
00118 group(const mesh &Mesh);
00119
00126 void subdivide(mesh& m, double maxallowedarea);
00127
00133 void makeSubdivided(const group &g1, const group &g2);
00134
00142 inline int size() const {
00143 return subGroups.size();
00144 };
00145
00150 inline bool isBase() const {
00151 return nelem>=0;
00152 };
00153
00157 inline int getNElement() {
00158 return nelem;
00159 };
00160
00167 bool isNear(const group &other, double maxangle) const;
00168
00173 inline bool isBigger(const group& other) {
00174 return r>other.r;
00175 };
00176
00181 inline const moments & getMpole() {return mpole;};
00182
00187 inline const moments & getSmoothField() {return smoothField; };
00188
00195 bool checkGroupCoverage(const mesh& m);
00196
00197
00202 int getGroupsStorageSize();
00203
00204 ~group();
00205
00206 protected:
00212 void cullPartners(mesh &m, double maxangle);
00213
00218 void linkBaseGroups(mesh &m);
00219
00225 void precalcTaylor(const mesh &m, double g);
00226
00235 void updateMoments(const mesh &m, const charges &chrgF, const charges &chrgV, const charges &chrgS);
00236
00242 void updateSmoothField(const mesh &m);
00243
00244
00250 void noteNearPartner(mesh &m, int whose);
00251
00256 void markPartnerDownToBase(bool *marks);
00257
00258 };
00259
00260 };
00261 #endif