1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef __CELLMODEL_INTERP_KERNEL_HXX__
20 #define __CELLMODEL_INTERP_KERNEL_HXX__
22 #include "INTERPKERNELDefines.hxx"
24 #include "NormalizedUnstructuredMesh.hxx"
28 namespace INTERP_KERNEL
31 * This class descibes all static elements (different from polygons and polyhedron) 3D, 2D and 1D.
33 class INTERPKERNEL_EXPORT CellModel
36 static const unsigned MAX_NB_OF_SONS=6;
37 static const unsigned MAX_NB_OF_NODES_PER_ELEM=30;
39 CellModel(NormalizedCellType type);
40 static void buildUniqueInstance();
42 static const CellModel& getCellModel(NormalizedCellType type);
43 bool isDynamic() const { return _dyn; }
44 bool isQuadratic() const { return _quadratic; }
45 unsigned getDimension() const { return _dim; }
46 //! sonId is in C format.
47 const unsigned *getNodesConstituentTheSon(unsigned sonId) const { return _sons_con[sonId]; }
48 unsigned getNumberOfNodes() const { return _nb_of_pts; }
49 unsigned getNumberOfSons() const { return _nb_of_sons; }
50 unsigned getNumberOfNodesConstituentTheSon(unsigned sonId) const { return _nb_of_sons_con[sonId]; }
51 NormalizedCellType getSonType(unsigned sonId) const { return _sons_type[sonId]; }
52 void fillSonCellNodalConnectivity(int sonId, const int *nodalConn, int *sonNodalConn) const;
59 unsigned _sons_con[MAX_NB_OF_SONS][MAX_NB_OF_NODES_PER_ELEM];
60 unsigned _nb_of_sons_con[MAX_NB_OF_SONS];
61 NormalizedCellType _sons_type[MAX_NB_OF_SONS];
62 static std::map<NormalizedCellType,CellModel> _map_of_unique_instance;