Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CELLMODEL_INTERP_KERNEL_HXX__
00021 #define __CELLMODEL_INTERP_KERNEL_HXX__
00022
00023 #include "INTERPKERNELDefines.hxx"
00024
00025 #include "NormalizedUnstructuredMesh.hxx"
00026
00027 #include <map>
00028
00029 namespace INTERP_KERNEL
00030 {
00034 class CellModel
00035 {
00036 public:
00037 static const unsigned MAX_NB_OF_SONS=8;
00038 static const unsigned MAX_NB_OF_NODES_PER_ELEM=30;
00039 private:
00040 CellModel(NormalizedCellType type);
00041 static void buildUniqueInstance();
00042 public:
00043 INTERPKERNEL_EXPORT static const CellModel& GetCellModel(NormalizedCellType type);
00044 INTERPKERNEL_EXPORT const char *getRepr() const;
00045 INTERPKERNEL_EXPORT bool isDynamic() const { return _dyn; }
00046 INTERPKERNEL_EXPORT bool isQuadratic() const { return _quadratic; }
00047 INTERPKERNEL_EXPORT unsigned getDimension() const { return _dim; }
00048 INTERPKERNEL_EXPORT bool isCompatibleWith(NormalizedCellType type) const;
00049 INTERPKERNEL_EXPORT bool isSimplex() const { return _is_simplex; }
00051 INTERPKERNEL_EXPORT const unsigned *getNodesConstituentTheSon(unsigned sonId) const { return _sons_con[sonId]; }
00052 INTERPKERNEL_EXPORT unsigned getNumberOfNodes() const { return _nb_of_pts; }
00053 INTERPKERNEL_EXPORT unsigned getNumberOfSons() const { return _nb_of_sons; }
00054 INTERPKERNEL_EXPORT unsigned getNumberOfSons2(const int *conn, int lgth) const;
00055 INTERPKERNEL_EXPORT unsigned getNumberOfNodesConstituentTheSon(unsigned sonId) const { return _nb_of_sons_con[sonId]; }
00056 INTERPKERNEL_EXPORT unsigned getNumberOfNodesConstituentTheSon2(unsigned sonId, const int *nodalConn, int lgth) const;
00057 INTERPKERNEL_EXPORT NormalizedCellType getExtrudedType() const { return _extruded_type; }
00058 INTERPKERNEL_EXPORT NormalizedCellType getLinearType() const { return _linear_type; }
00059 INTERPKERNEL_EXPORT NormalizedCellType getQuadraticType() const { return _quadratic_type; }
00060 INTERPKERNEL_EXPORT NormalizedCellType getSonType(unsigned sonId) const { return _sons_type[sonId]; }
00061 INTERPKERNEL_EXPORT NormalizedCellType getSonType2(unsigned sonId) const;
00062 INTERPKERNEL_EXPORT unsigned fillSonCellNodalConnectivity(int sonId, const int *nodalConn, int *sonNodalConn) const;
00063 INTERPKERNEL_EXPORT unsigned fillSonCellNodalConnectivity2(int sonId, const int *nodalConn, int lgth, int *sonNodalConn, NormalizedCellType& typeOfSon) const;
00064 private:
00065 bool _dyn;
00066 bool _quadratic;
00067 bool _is_simplex;
00068 unsigned _dim;
00069 unsigned _nb_of_pts;
00070 unsigned _nb_of_sons;
00071 NormalizedCellType _type;
00072 NormalizedCellType _extruded_type;
00073 NormalizedCellType _linear_type;
00074 NormalizedCellType _quadratic_type;
00075 unsigned _sons_con[MAX_NB_OF_SONS][MAX_NB_OF_NODES_PER_ELEM];
00076 unsigned _nb_of_sons_con[MAX_NB_OF_SONS];
00077 NormalizedCellType _sons_type[MAX_NB_OF_SONS];
00078 static std::map<NormalizedCellType,CellModel> _map_of_unique_instance;
00079 static const char *CELL_TYPES_REPR[];
00080 };
00081 }
00082
00083 #endif