// $Id: hex.h,v 1.1.1.1 2000/11/02 08:47:16 fritzi Exp $ // This file is part of the DEAL Library // DEAL is Copyright(1995) by // Roland Becker, Guido Kanschat, Franz-Theo Suttmeier #ifndef __hex_h #define __hex_h #ifndef __cell_h #include #endif #ifndef __quadface_h #include #endif #ifndef __pool_h #include #endif #ifndef __dvector_h #include #endif #ifndef __polygon_h #include #endif #define NPT 8 #define NNB 6 #define NCH 8 #define NPTFACE1 4 #define NPTFACE2 5 /* CLASS Hex */ class Hex : public Cell { public: ////////// static const int prim_face_vertex[NNB][NPTFACE1]; ////////// static const int sec_face_vertex[NNB][NPTFACE2]; ////////// static int one_irregular_thresh; ////////// void* operator new(size_t sz); ////////// void operator delete(void*p); ////////// virtual Vertex* vertex(int i) const; ////////// virtual Cell* child(int i) const; ////////// virtual Cell* neighbour(int i) const; ////////// virtual int neighbour_number(int i) const; ////////// //virtual int refine() const { return refine_count_field; } //virtual void refine(int i) { refine_count_field = i; } virtual int nneighbours() const { return NNB; } ////////// virtual int nchildren() const { return NCH; } public: ////////// Hex (Polygon, int mat, Cell* papa); ////////// virtual ~Hex(); ////////// virtual Hex* newHex (Polygon, int mat=0, Cell* papa = NULL) const = 0; ////////// void neighbour(int i,Cell* pp); ////////// void neighbour_number(int i,int n); ////////// int sleep() const { return ((children[0]) ? 1 : 0); } ////////// int refine_type() const { return refine_type_field & 0x7F; } ////////// int one_irregular(); ////////// int seam_prepare(); ////////// int seam_irregular(); ////////// void coarse(); ////////// void distort(dVector& F) const; ////////// void boundary(); ////////// void child(int i,Cell* cp); ////////// void refine_type(int i) { refine_type_field |= i & 0x7F; } ////////// QuadFace* _face(int i) const; ////////// virtual Face* face(int i, FaceQual q = face_normal) const; ////////// virtual void notify(Face& f, int n); ////////// virtual int identify_neighbour(Cell*); ////////// virtual int identify_neighbour(Face&) const; ////////// virtual void build_fields(Vertex**, Cell**, int*); ////////// const char* name() const { return "Hex"; } virtual bool similar(); virtual void red(); ////////// virtual void delete_children(); ////////// void ucd_print(FILE* fp) const; void tec_print(FILE* fp) const; private: static Pool pool; signed char refine_count_field; unsigned char refine_type_field; signed char nn[NNB]; Vertex* vertices[NPT]; Cell* neighbours[NNB]; Cell* children[NCH]; }; inline void* Hex::operator new(size_t sz) { return pool.alloc(sz); } inline void Hex::operator delete(void*p) { pool.free(p,sizeof(Hex)); } #undef NPT #undef NNB #undef NCH #undef NPTFACE1 #undef NPTFACE2 #endif