Version: 6.3.1

src/INTERP_KERNEL/CellModel.hxx

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
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
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS