1 // Copyright (C) 2007-2016 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, or (at your option) any later version.
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 // Author : Anthony Geay (EDF R&D)
21 #include "CellModel.hxx"
23 #include "InterpKernelException.hxx"
24 #include "DiameterCalculator.hxx"
25 #include "OrientationInverter.hxx"
32 namespace INTERP_KERNEL
34 const char *CellModel::CELL_TYPES_REPR[]={"NORM_POINT1", "NORM_SEG2", "NORM_SEG3", "NORM_TRI3", "NORM_QUAD4",// 0->4
35 "NORM_POLYGON", "NORM_TRI6", "NORM_TRI7" , "NORM_QUAD8", "NORM_QUAD9",//5->9
36 "NORM_SEG4", "", "", "", "NORM_TETRA4",//10->14
37 "NORM_PYRA5", "NORM_PENTA6", "", "NORM_HEXA8", "",//15->19
38 "NORM_TETRA10", "", "NORM_HEXGP12", "NORM_PYRA13", "",//20->24
39 "NORM_PENTA15", "", "NORM_HEXA27", "NORM_PENTA18", "",//25->29
40 "NORM_HEXA20", "NORM_POLYHED", "NORM_QPOLYG", "NORM_POLYL", "",//30->34
41 "", "", "", "", "",//35->39
44 std::map<NormalizedCellType,CellModel> CellModel::_map_of_unique_instance;
46 const CellModel& CellModel::GetCellModel(NormalizedCellType type)
48 if(_map_of_unique_instance.empty())
49 buildUniqueInstance();
50 const std::map<NormalizedCellType,CellModel>::iterator iter=_map_of_unique_instance.find(type);
51 if(iter==_map_of_unique_instance.end())
53 std::ostringstream stream; stream << "no cellmodel for normalized type " << type;
54 throw Exception(stream.str().c_str());
56 return (*iter).second;
59 const char *CellModel::getRepr() const
61 return CELL_TYPES_REPR[(int)_type];
65 * This method is compatible with all types including dynamic one.
67 bool CellModel::isCompatibleWith(NormalizedCellType type) const
71 const CellModel& other=GetCellModel(type);
72 if(_dim!=other.getDimension())
74 bool b1=isQuadratic();
75 bool b2=other.isQuadratic();
76 if((b1 && !b2) || (!b1 && b2))
83 void CellModel::buildUniqueInstance()
85 _map_of_unique_instance.insert(std::make_pair(NORM_POINT1,CellModel(NORM_POINT1)));
86 _map_of_unique_instance.insert(std::make_pair(NORM_SEG2,CellModel(NORM_SEG2)));
87 _map_of_unique_instance.insert(std::make_pair(NORM_SEG3,CellModel(NORM_SEG3)));
88 _map_of_unique_instance.insert(std::make_pair(NORM_SEG4,CellModel(NORM_SEG4)));
89 _map_of_unique_instance.insert(std::make_pair(NORM_TRI3,CellModel(NORM_TRI3)));
90 _map_of_unique_instance.insert(std::make_pair(NORM_QUAD4,CellModel(NORM_QUAD4)));
91 _map_of_unique_instance.insert(std::make_pair(NORM_TRI6,CellModel(NORM_TRI6)));
92 _map_of_unique_instance.insert(std::make_pair(NORM_TRI7,CellModel(NORM_TRI7)));
93 _map_of_unique_instance.insert(std::make_pair(NORM_QUAD8,CellModel(NORM_QUAD8)));
94 _map_of_unique_instance.insert(std::make_pair(NORM_QUAD9,CellModel(NORM_QUAD9)));
95 _map_of_unique_instance.insert(std::make_pair(NORM_TETRA4,CellModel(NORM_TETRA4)));
96 _map_of_unique_instance.insert(std::make_pair(NORM_HEXA8,CellModel(NORM_HEXA8)));
97 _map_of_unique_instance.insert(std::make_pair(NORM_PYRA5,CellModel(NORM_PYRA5)));
98 _map_of_unique_instance.insert(std::make_pair(NORM_PENTA6,CellModel(NORM_PENTA6)));
99 _map_of_unique_instance.insert(std::make_pair(NORM_TETRA10,CellModel(NORM_TETRA10)));
100 _map_of_unique_instance.insert(std::make_pair(NORM_HEXGP12,CellModel(NORM_HEXGP12)));
101 _map_of_unique_instance.insert(std::make_pair(NORM_PYRA13,CellModel(NORM_PYRA13)));
102 _map_of_unique_instance.insert(std::make_pair(NORM_PENTA15,CellModel(NORM_PENTA15)));
103 _map_of_unique_instance.insert(std::make_pair(NORM_PENTA18,CellModel(NORM_PENTA18)));
104 _map_of_unique_instance.insert(std::make_pair(NORM_HEXA20,CellModel(NORM_HEXA20)));
105 _map_of_unique_instance.insert(std::make_pair(NORM_HEXA27,CellModel(NORM_HEXA27)));
106 _map_of_unique_instance.insert(std::make_pair(NORM_POLYGON,CellModel(NORM_POLYGON)));
107 _map_of_unique_instance.insert(std::make_pair(NORM_POLYHED,CellModel(NORM_POLYHED)));
108 _map_of_unique_instance.insert(std::make_pair(NORM_QPOLYG,CellModel(NORM_QPOLYG)));
109 _map_of_unique_instance.insert(std::make_pair(NORM_POLYL,CellModel(NORM_POLYL)));
110 _map_of_unique_instance.insert(std::make_pair(NORM_ERROR,CellModel(NORM_ERROR)));
113 CellModel::CellModel(NormalizedCellType type):_type(type)
118 _extruded_type=NORM_ERROR;
119 _reverse_extruded_type=NORM_ERROR;
120 _linear_type=NORM_ERROR;
121 _quadratic_type=NORM_ERROR;
122 _quadratic_type2=NORM_ERROR;
123 _nb_of_little_sons=std::numeric_limits<unsigned>::max();
128 _nb_of_pts=1; _nb_of_sons=0; _dim=0; _extruded_type=NORM_SEG2; _is_simplex=true;
133 _nb_of_pts=2; _nb_of_sons=2; _dim=1; _extruded_type=NORM_QUAD4; _quadratic_type=NORM_SEG3; _quadratic_type2=NORM_SEG3; _is_simplex=true; _is_extruded=true; _reverse_extruded_type=NORM_POINT1;
134 _sons_type[0]=NORM_POINT1; _sons_type[1]=NORM_POINT1;
135 _sons_con[0][0]=0; _nb_of_sons_con[0]=1;
136 _sons_con[1][0]=1; _nb_of_sons_con[1]=1;
141 _nb_of_pts=3; _nb_of_sons=3; _dim=1; _extruded_type=NORM_QUAD8; _linear_type=NORM_SEG2; _quadratic=true; _is_simplex=false;
142 _sons_type[0]=NORM_POINT1; _sons_type[1]=NORM_POINT1; _sons_type[2]=NORM_POINT1;
143 _sons_con[0][0]=0; _nb_of_sons_con[0]=1;
144 _sons_con[1][0]=1; _nb_of_sons_con[1]=1;
145 _sons_con[2][0]=2; _nb_of_sons_con[2]=1;
150 _nb_of_pts=4; _nb_of_sons=4; _dim=1; _linear_type=NORM_SEG2; _quadratic=true; _is_simplex=false; // no _extruded_type because no cubic 2D cell
151 _sons_type[0]=NORM_POINT1; _sons_type[1]=NORM_POINT1; _sons_type[2]=NORM_POINT1; _sons_type[3]=NORM_POINT1;
152 _sons_con[0][0]=0; _nb_of_sons_con[0]=1;
153 _sons_con[1][0]=1; _nb_of_sons_con[1]=1;
154 _sons_con[2][0]=2; _nb_of_sons_con[2]=1;
155 _sons_con[3][0]=3; _nb_of_sons_con[3]=1;
160 _nb_of_pts=4; _nb_of_sons=4; _dim=3; _quadratic_type=NORM_TETRA10; _is_simplex=true;
161 _sons_type[0]=NORM_TRI3; _sons_type[1]=NORM_TRI3; _sons_type[2]=NORM_TRI3; _sons_type[3]=NORM_TRI3;
162 _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=2; _nb_of_sons_con[0]=3;
163 _sons_con[1][0]=0; _sons_con[1][1]=3; _sons_con[1][2]=1; _nb_of_sons_con[1]=3;
164 _sons_con[2][0]=1; _sons_con[2][1]=3; _sons_con[2][2]=2; _nb_of_sons_con[2]=3;
165 _sons_con[3][0]=2; _sons_con[3][1]=3; _sons_con[3][2]=0; _nb_of_sons_con[3]=3;
166 _little_sons_con[0][0]=0; _little_sons_con[0][1]=1; _nb_of_little_sons=6;
167 _little_sons_con[1][0]=1; _little_sons_con[1][1]=2;
168 _little_sons_con[2][0]=2; _little_sons_con[2][1]=0;
169 _little_sons_con[3][0]=0; _little_sons_con[3][1]=3;
170 _little_sons_con[4][0]=1; _little_sons_con[4][1]=3;
171 _little_sons_con[5][0]=2; _little_sons_con[5][1]=3;
176 _nb_of_pts=8; _nb_of_sons=6; _dim=3; _quadratic_type=NORM_HEXA20; _quadratic_type2=NORM_HEXA27; _is_simplex=false; _is_extruded=true; _reverse_extruded_type=NORM_QUAD4;
177 _sons_type[0]=NORM_QUAD4; _sons_type[1]=NORM_QUAD4; _sons_type[2]=NORM_QUAD4; _sons_type[3]=NORM_QUAD4; _sons_type[4]=NORM_QUAD4; _sons_type[5]=NORM_QUAD4;
178 _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=2; _sons_con[0][3]=3; _nb_of_sons_con[0]=4;
179 _sons_con[1][0]=4; _sons_con[1][1]=7; _sons_con[1][2]=6; _sons_con[1][3]=5; _nb_of_sons_con[1]=4;
180 _sons_con[2][0]=0; _sons_con[2][1]=4; _sons_con[2][2]=5; _sons_con[2][3]=1; _nb_of_sons_con[2]=4;
181 _sons_con[3][0]=1; _sons_con[3][1]=5; _sons_con[3][2]=6; _sons_con[3][3]=2; _nb_of_sons_con[3]=4;
182 _sons_con[4][0]=2; _sons_con[4][1]=6; _sons_con[4][2]=7; _sons_con[4][3]=3; _nb_of_sons_con[4]=4;
183 _sons_con[5][0]=3; _sons_con[5][1]=7; _sons_con[5][2]=4; _sons_con[5][3]=0; _nb_of_sons_con[5]=4;
184 _little_sons_con[0][0]=0; _little_sons_con[0][1]=1; _nb_of_little_sons=12;
185 _little_sons_con[1][0]=1; _little_sons_con[1][1]=2;
186 _little_sons_con[2][0]=2; _little_sons_con[2][1]=3;
187 _little_sons_con[3][0]=3; _little_sons_con[3][1]=0;
188 _little_sons_con[4][0]=4; _little_sons_con[4][1]=5;
189 _little_sons_con[5][0]=5; _little_sons_con[5][1]=6;
190 _little_sons_con[6][0]=6; _little_sons_con[6][1]=7;
191 _little_sons_con[7][0]=7; _little_sons_con[7][1]=4;
192 _little_sons_con[8][0]=0; _little_sons_con[8][1]=4;
193 _little_sons_con[9][0]=1; _little_sons_con[9][1]=5;
194 _little_sons_con[10][0]=2; _little_sons_con[10][1]=6;
195 _little_sons_con[11][0]=3; _little_sons_con[11][1]=7;
200 _nb_of_pts=4; _nb_of_sons=4; _dim=2; _quadratic_type=NORM_QUAD8; _quadratic_type2=NORM_QUAD9; _is_simplex=false; _is_extruded=true;
201 _sons_type[0]=NORM_SEG2; _sons_type[1]=NORM_SEG2; _sons_type[2]=NORM_SEG2; _sons_type[3]=NORM_SEG2;
202 _sons_con[0][0]=0; _sons_con[0][1]=1; _nb_of_sons_con[0]=2;
203 _sons_con[1][0]=1; _sons_con[1][1]=2; _nb_of_sons_con[1]=2;
204 _sons_con[2][0]=2; _sons_con[2][1]=3; _nb_of_sons_con[2]=2;
205 _sons_con[3][0]=3; _sons_con[3][1]=0; _nb_of_sons_con[3]=2; _extruded_type=NORM_HEXA8;
210 _nb_of_pts=3; _nb_of_sons=3; _dim=2; _quadratic_type=NORM_TRI6; _quadratic_type2=NORM_TRI7; _is_simplex=true;
211 _sons_type[0]=NORM_SEG2; _sons_type[1]=NORM_SEG2; _sons_type[2]=NORM_SEG2;
212 _sons_con[0][0]=0; _sons_con[0][1]=1; _nb_of_sons_con[0]=2;
213 _sons_con[1][0]=1; _sons_con[1][1]=2; _nb_of_sons_con[1]=2;
214 _sons_con[2][0]=2; _sons_con[2][1]=0; _nb_of_sons_con[2]=2; _extruded_type=NORM_PENTA6;
219 _nb_of_pts=6; _nb_of_sons=3; _dim=2; _linear_type=NORM_TRI3; _is_simplex=false;
220 _sons_type[0]=NORM_SEG3; _sons_type[1]=NORM_SEG3; _sons_type[2]=NORM_SEG3;
221 _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=3; _nb_of_sons_con[0]=3;
222 _sons_con[1][0]=1; _sons_con[1][1]=2; _sons_con[1][2]=4; _nb_of_sons_con[1]=3;
223 _sons_con[2][0]=2; _sons_con[2][1]=0; _sons_con[2][2]=5; _nb_of_sons_con[2]=3; _quadratic=true; _extruded_type=NORM_PENTA15;
228 _nb_of_pts=7; _nb_of_sons=3; _dim=2; _linear_type=NORM_TRI3; _is_simplex=false;
229 _sons_type[0]=NORM_SEG3; _sons_type[1]=NORM_SEG3; _sons_type[2]=NORM_SEG3;
230 _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=3; _nb_of_sons_con[0]=3;
231 _sons_con[1][0]=1; _sons_con[1][1]=2; _sons_con[1][2]=4; _nb_of_sons_con[1]=3;
232 _sons_con[2][0]=2; _sons_con[2][1]=0; _sons_con[2][2]=5; _nb_of_sons_con[2]=3; _quadratic=true; //no extruded type because no penta20
237 _nb_of_pts=8; _nb_of_sons=4; _dim=2; _linear_type=NORM_QUAD4; _is_simplex=false;
238 _sons_type[0]=NORM_SEG3; _sons_type[1]=NORM_SEG3; _sons_type[2]=NORM_SEG3; _sons_type[3]=NORM_SEG3;
239 _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=4; _nb_of_sons_con[0]=3;
240 _sons_con[1][0]=1; _sons_con[1][1]=2; _sons_con[1][2]=5; _nb_of_sons_con[1]=3;
241 _sons_con[2][0]=2; _sons_con[2][1]=3; _sons_con[2][2]=6; _nb_of_sons_con[2]=3;
242 _sons_con[3][0]=3; _sons_con[3][1]=0; _sons_con[3][2]=7; _nb_of_sons_con[3]=3; _quadratic=true; _extruded_type=NORM_HEXA20;
247 _nb_of_pts=9; _nb_of_sons=4; _dim=2; _linear_type=NORM_QUAD4; _is_simplex=false;
248 _sons_type[0]=NORM_SEG3; _sons_type[1]=NORM_SEG3; _sons_type[2]=NORM_SEG3; _sons_type[3]=NORM_SEG3;
249 _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=4; _nb_of_sons_con[0]=3;
250 _sons_con[1][0]=1; _sons_con[1][1]=2; _sons_con[1][2]=5; _nb_of_sons_con[1]=3;
251 _sons_con[2][0]=2; _sons_con[2][1]=3; _sons_con[2][2]=6; _nb_of_sons_con[2]=3;
252 _sons_con[3][0]=3; _sons_con[3][1]=0; _sons_con[3][2]=7; _nb_of_sons_con[3]=3; _quadratic=true; _extruded_type=NORM_HEXA27;
257 _nb_of_pts=5; _nb_of_sons=5; _dim=3; _quadratic_type=NORM_PYRA13; _is_simplex=false;
258 _sons_type[0]=NORM_QUAD4; _sons_type[1]=NORM_TRI3; _sons_type[2]=NORM_TRI3; _sons_type[3]=NORM_TRI3; _sons_type[4]=NORM_TRI3;
259 _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=2; _sons_con[0][3]=3; _nb_of_sons_con[0]=4;
260 _sons_con[1][0]=0; _sons_con[1][1]=4; _sons_con[1][2]=1; _nb_of_sons_con[1]=3;
261 _sons_con[2][0]=1; _sons_con[2][1]=4; _sons_con[2][2]=2; _nb_of_sons_con[2]=3;
262 _sons_con[3][0]=2; _sons_con[3][1]=4; _sons_con[3][2]=3; _nb_of_sons_con[3]=3;
263 _sons_con[4][0]=3; _sons_con[4][1]=4; _sons_con[4][2]=0; _nb_of_sons_con[4]=3;
264 _little_sons_con[0][0]=0; _little_sons_con[0][1]=1; _nb_of_little_sons=8;
265 _little_sons_con[1][0]=1; _little_sons_con[1][1]=2;
266 _little_sons_con[2][0]=2; _little_sons_con[2][1]=3;
267 _little_sons_con[3][0]=3; _little_sons_con[3][1]=0;
268 _little_sons_con[4][0]=0; _little_sons_con[4][1]=4;
269 _little_sons_con[5][0]=1; _little_sons_con[5][1]=4;
270 _little_sons_con[6][0]=2; _little_sons_con[6][1]=4;
271 _little_sons_con[7][0]=3; _little_sons_con[7][1]=4;
276 _nb_of_pts=6; _nb_of_sons=5; _dim=3; _quadratic_type=NORM_PENTA15; _is_simplex=false; _is_extruded=true; _reverse_extruded_type=NORM_TRI3;
277 _sons_type[0]=NORM_TRI3; _sons_type[1]=NORM_TRI3; _sons_type[2]=NORM_QUAD4; _sons_type[3]=NORM_QUAD4; _sons_type[4]=NORM_QUAD4;
278 _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=2; _nb_of_sons_con[0]=3;
279 _sons_con[1][0]=3; _sons_con[1][1]=5; _sons_con[1][2]=4; _nb_of_sons_con[1]=3;
280 _sons_con[2][0]=0; _sons_con[2][1]=3; _sons_con[2][2]=4; _sons_con[2][3]=1; _nb_of_sons_con[2]=4;
281 _sons_con[3][0]=1; _sons_con[3][1]=4; _sons_con[3][2]=5; _sons_con[3][3]=2; _nb_of_sons_con[3]=4;
282 _sons_con[4][0]=2; _sons_con[4][1]=5; _sons_con[4][2]=3; _sons_con[4][3]=0; _nb_of_sons_con[4]=4;
283 _little_sons_con[0][0]=0; _little_sons_con[0][1]=1; _nb_of_little_sons=9;
284 _little_sons_con[1][0]=1; _little_sons_con[1][1]=2;
285 _little_sons_con[2][0]=2; _little_sons_con[2][1]=0;
286 _little_sons_con[3][0]=3; _little_sons_con[3][1]=4;
287 _little_sons_con[4][0]=4; _little_sons_con[4][1]=5;
288 _little_sons_con[5][0]=5; _little_sons_con[5][1]=3;
289 _little_sons_con[6][0]=0; _little_sons_con[6][1]=3;
290 _little_sons_con[7][0]=1; _little_sons_con[7][1]=4;
291 _little_sons_con[8][0]=2; _little_sons_con[8][1]=5;
296 _nb_of_pts=10; _nb_of_sons=4; _dim=3; _linear_type=NORM_TETRA4; _is_simplex=false;
297 _sons_type[0]=NORM_TRI6; _sons_type[1]=NORM_TRI6; _sons_type[2]=NORM_TRI6; _sons_type[3]=NORM_TRI6;
298 _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=2; _sons_con[0][3]=4; _sons_con[0][4]=5; _sons_con[0][5]=6; _nb_of_sons_con[0]=6;
299 _sons_con[1][0]=0; _sons_con[1][1]=3; _sons_con[1][2]=1; _sons_con[1][3]=7; _sons_con[1][4]=8; _sons_con[1][5]=4; _nb_of_sons_con[1]=6;
300 _sons_con[2][0]=1; _sons_con[2][1]=3; _sons_con[2][2]=2; _sons_con[2][3]=8; _sons_con[2][4]=9; _sons_con[2][5]=5; _nb_of_sons_con[2]=6;
301 _sons_con[3][0]=2; _sons_con[3][1]=3; _sons_con[3][2]=0; _sons_con[3][3]=9; _sons_con[3][4]=7; _sons_con[3][5]=6; _nb_of_sons_con[3]=6; _quadratic=true;
302 _little_sons_con[0][0]=0; _little_sons_con[0][1]=1; _little_sons_con[0][2]=4; _nb_of_little_sons=6;
303 _little_sons_con[1][0]=1; _little_sons_con[1][1]=2; _little_sons_con[1][2]=5;
304 _little_sons_con[2][0]=2; _little_sons_con[2][1]=0; _little_sons_con[2][2]=6;
305 _little_sons_con[3][0]=0; _little_sons_con[3][1]=3; _little_sons_con[3][2]=7;
306 _little_sons_con[4][0]=1; _little_sons_con[4][1]=3; _little_sons_con[4][2]=8;
307 _little_sons_con[5][0]=2; _little_sons_con[5][1]=3; _little_sons_con[5][2]=9;
312 _nb_of_pts=12; _nb_of_sons=8; _dim=3; _is_simplex=false; _is_extruded=true;
313 _sons_type[0]=NORM_POLYGON; _sons_type[1]=NORM_POLYGON; _sons_type[2]=NORM_QUAD4; _sons_type[3]=NORM_QUAD4; _sons_type[4]=NORM_QUAD4; _sons_type[5]=NORM_QUAD4;
314 _sons_type[6]=NORM_QUAD4; _sons_type[7]=NORM_QUAD4;
315 _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=2; _sons_con[0][3]=3; _sons_con[0][4]=4; _sons_con[0][5]=5; _nb_of_sons_con[0]=6;
316 _sons_con[1][0]=6; _sons_con[1][1]=11; _sons_con[1][2]=10; _sons_con[1][3]=9; _sons_con[1][4]=8; _sons_con[1][5]=7; _nb_of_sons_con[1]=6;
317 _sons_con[2][0]=0; _sons_con[2][1]=6; _sons_con[2][2]=7; _sons_con[2][3]=1; _nb_of_sons_con[2]=4;
318 _sons_con[3][0]=1; _sons_con[3][1]=7; _sons_con[3][2]=8; _sons_con[3][3]=2; _nb_of_sons_con[3]=4;
319 _sons_con[4][0]=2; _sons_con[4][1]=8; _sons_con[4][2]=9; _sons_con[4][3]=3; _nb_of_sons_con[4]=4;
320 _sons_con[5][0]=3; _sons_con[5][1]=9; _sons_con[5][2]=10; _sons_con[5][3]=4; _nb_of_sons_con[5]=4;
321 _sons_con[6][0]=4; _sons_con[6][1]=10; _sons_con[6][2]=11; _sons_con[6][3]=5; _nb_of_sons_con[6]=4;
322 _sons_con[7][0]=5; _sons_con[7][1]=11; _sons_con[7][2]=6; _sons_con[7][3]=0; _nb_of_sons_con[7]=4;
327 _nb_of_pts=13; _nb_of_sons=5; _dim=3; _linear_type=NORM_PYRA5; _is_simplex=false;
328 _sons_type[0]=NORM_QUAD8; _sons_type[1]=NORM_TRI6; _sons_type[2]=NORM_TRI6; _sons_type[3]=NORM_TRI6; _sons_type[4]=NORM_TRI6;
329 _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=2; _sons_con[0][3]=3; _sons_con[0][4]=5; _sons_con[0][5]=6; _sons_con[0][6]=7; _sons_con[0][7]=8; _nb_of_sons_con[0]=8;
330 _sons_con[1][0]=0; _sons_con[1][1]=4; _sons_con[1][2]=1; _sons_con[1][3]=9; _sons_con[1][4]=10; _sons_con[1][5]=5; _nb_of_sons_con[1]=6;
331 _sons_con[2][0]=1; _sons_con[2][1]=4; _sons_con[2][2]=2; _sons_con[2][3]=10; _sons_con[2][4]=11; _sons_con[2][5]=6; _nb_of_sons_con[2]=6;
332 _sons_con[3][0]=2; _sons_con[3][1]=4; _sons_con[3][2]=3; _sons_con[3][3]=11; _sons_con[3][4]=12; _sons_con[3][5]=7; _nb_of_sons_con[3]=6;
333 _sons_con[4][0]=3; _sons_con[4][1]=4; _sons_con[4][2]=0; _sons_con[4][3]=12; _sons_con[4][4]=9; _sons_con[4][5]=8; _nb_of_sons_con[4]=6; _quadratic=true;
334 _little_sons_con[0][0]=0; _little_sons_con[0][1]=1; _little_sons_con[0][2]=5; _nb_of_little_sons=8;
335 _little_sons_con[1][0]=1; _little_sons_con[1][1]=2; _little_sons_con[1][2]=6;
336 _little_sons_con[2][0]=2; _little_sons_con[2][1]=3; _little_sons_con[2][2]=7;
337 _little_sons_con[3][0]=3; _little_sons_con[3][1]=0; _little_sons_con[3][2]=8;
338 _little_sons_con[4][0]=0; _little_sons_con[4][1]=4; _little_sons_con[4][2]=9;
339 _little_sons_con[5][0]=1; _little_sons_con[5][1]=4; _little_sons_con[5][2]=10;
340 _little_sons_con[6][0]=2; _little_sons_con[6][1]=4; _little_sons_con[6][2]=11;
341 _little_sons_con[7][0]=3; _little_sons_con[7][1]=4; _little_sons_con[7][2]=12;
346 _nb_of_pts=15; _nb_of_sons=5; _dim=3; _linear_type=NORM_PENTA6; _is_simplex=false;
347 _sons_type[0]=NORM_TRI6; _sons_type[1]=NORM_TRI6; _sons_type[2]=NORM_QUAD8; _sons_type[3]=NORM_QUAD8; _sons_type[4]=NORM_QUAD8;
348 _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=2; _sons_con[0][3]=6; _sons_con[0][4]=7; _sons_con[0][5]=8; _nb_of_sons_con[0]=6;
349 _sons_con[1][0]=3; _sons_con[1][1]=5; _sons_con[1][2]=4; _sons_con[1][3]=11; _sons_con[1][4]=10; _sons_con[1][5]=9; _nb_of_sons_con[1]=6;
350 _sons_con[2][0]=0; _sons_con[2][1]=3; _sons_con[2][2]=4; _sons_con[2][3]=1; _sons_con[2][4]=12; _sons_con[2][5]=9; _sons_con[2][6]=13; _sons_con[2][7]=6; _nb_of_sons_con[2]=8;
351 _sons_con[3][0]=1; _sons_con[3][1]=4; _sons_con[3][2]=5; _sons_con[3][3]=2; _sons_con[3][4]=13; _sons_con[3][5]=10; _sons_con[3][6]=14; _sons_con[3][7]=7; _nb_of_sons_con[3]=8;
352 _sons_con[4][0]=2; _sons_con[4][1]=4; _sons_con[4][2]=5; _sons_con[4][3]=0; _sons_con[4][4]=14; _sons_con[4][5]=11; _sons_con[4][6]=12; _sons_con[4][7]=8; _nb_of_sons_con[4]=8; _quadratic=true;
353 _little_sons_con[0][0]=0; _little_sons_con[0][1]=1; _little_sons_con[0][2]=6; _nb_of_little_sons=9;
354 _little_sons_con[1][0]=1; _little_sons_con[1][1]=2; _little_sons_con[1][2]=7;
355 _little_sons_con[2][0]=2; _little_sons_con[2][1]=0; _little_sons_con[2][2]=8;
356 _little_sons_con[3][0]=3; _little_sons_con[3][1]=4; _little_sons_con[3][2]=9;
357 _little_sons_con[4][0]=4; _little_sons_con[4][1]=5; _little_sons_con[4][2]=10;
358 _little_sons_con[5][0]=5; _little_sons_con[5][1]=3; _little_sons_con[5][2]=11;
359 _little_sons_con[6][0]=0; _little_sons_con[6][1]=3; _little_sons_con[6][2]=12;
360 _little_sons_con[7][0]=1; _little_sons_con[7][1]=4; _little_sons_con[7][2]=13;
361 _little_sons_con[8][0]=2; _little_sons_con[8][1]=5; _little_sons_con[8][2]=14;
366 _nb_of_pts=18; _nb_of_sons=5; _dim=3; _linear_type=NORM_PENTA6; _is_simplex=false;
367 _sons_type[0]=NORM_TRI6; _sons_type[1]=NORM_TRI6; _sons_type[2]=NORM_QUAD9; _sons_type[3]=NORM_QUAD9; _sons_type[4]=NORM_QUAD9;
368 _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=2; _sons_con[0][3]=6; _sons_con[0][4]=7; _sons_con[0][5]=8; _nb_of_sons_con[0]=6;
369 _sons_con[1][0]=3; _sons_con[1][1]=5; _sons_con[1][2]=4; _sons_con[1][3]=11; _sons_con[1][4]=10; _sons_con[1][5]=9; _nb_of_sons_con[1]=6;
370 _sons_con[2][0]=0; _sons_con[2][1]=3; _sons_con[2][2]=4; _sons_con[2][3]=1; _sons_con[2][4]=12; _sons_con[2][5]=9; _sons_con[2][6]=13; _sons_con[2][7]=6; _sons_con[2][8]=15; _nb_of_sons_con[2]=9;
371 _sons_con[3][0]=1; _sons_con[3][1]=4; _sons_con[3][2]=5; _sons_con[3][3]=2; _sons_con[3][4]=13; _sons_con[3][5]=10; _sons_con[3][6]=14; _sons_con[3][7]=7; _sons_con[3][8]=16; _nb_of_sons_con[3]=9;
372 _sons_con[4][0]=2; _sons_con[4][1]=4; _sons_con[4][2]=5; _sons_con[4][3]=0; _sons_con[4][4]=14; _sons_con[4][5]=11; _sons_con[4][6]=12; _sons_con[4][7]=8; _sons_con[4][8]=17; _nb_of_sons_con[4]=9; _quadratic=true;
373 _little_sons_con[0][0]=0; _little_sons_con[0][1]=1; _little_sons_con[0][2]=6; _nb_of_little_sons=9;
374 _little_sons_con[1][0]=1; _little_sons_con[1][1]=2; _little_sons_con[1][2]=7;
375 _little_sons_con[2][0]=2; _little_sons_con[2][1]=0; _little_sons_con[2][2]=8;
376 _little_sons_con[3][0]=3; _little_sons_con[3][1]=4; _little_sons_con[3][2]=9;
377 _little_sons_con[4][0]=4; _little_sons_con[4][1]=5; _little_sons_con[4][2]=10;
378 _little_sons_con[5][0]=5; _little_sons_con[5][1]=3; _little_sons_con[5][2]=11;
379 _little_sons_con[6][0]=0; _little_sons_con[6][1]=3; _little_sons_con[6][2]=12;
380 _little_sons_con[7][0]=1; _little_sons_con[7][1]=4; _little_sons_con[7][2]=13;
381 _little_sons_con[8][0]=2; _little_sons_con[8][1]=5; _little_sons_con[8][2]=14;
386 _nb_of_pts=20; _nb_of_sons=6; _dim=3; _linear_type=NORM_HEXA8; _is_simplex=false;
387 _sons_type[0]=NORM_QUAD8; _sons_type[1]=NORM_QUAD8; _sons_type[2]=NORM_QUAD8; _sons_type[3]=NORM_QUAD8; _sons_type[4]=NORM_QUAD8; _sons_type[5]=NORM_QUAD8;
388 _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=2; _sons_con[0][3]=3; _sons_con[0][4]=8; _sons_con[0][5]=9; _sons_con[0][6]=10; _sons_con[0][7]=11; _nb_of_sons_con[0]=8;
389 _sons_con[1][0]=4; _sons_con[1][1]=7; _sons_con[1][2]=6; _sons_con[1][3]=5; _sons_con[1][4]=15; _sons_con[1][5]=14; _sons_con[1][6]=13; _sons_con[1][7]=12; _nb_of_sons_con[1]=8;
390 _sons_con[2][0]=0; _sons_con[2][1]=4; _sons_con[2][2]=5; _sons_con[2][3]=1; _sons_con[2][4]=16; _sons_con[2][5]=12; _sons_con[2][6]=17; _sons_con[2][7]=8; _nb_of_sons_con[2]=8;
391 _sons_con[3][0]=1; _sons_con[3][1]=5; _sons_con[3][2]=6; _sons_con[3][3]=2; _sons_con[3][4]=17; _sons_con[3][5]=13; _sons_con[3][6]=18; _sons_con[3][7]=9;_nb_of_sons_con[3]=8;
392 _sons_con[4][0]=2; _sons_con[4][1]=6; _sons_con[4][2]=7; _sons_con[4][3]=3; _sons_con[4][4]=18; _sons_con[4][5]=14; _sons_con[4][6]=19; _sons_con[4][7]=10; _nb_of_sons_con[4]=8;
393 _sons_con[5][0]=3; _sons_con[5][1]=7; _sons_con[5][2]=4; _sons_con[5][3]=0; _sons_con[5][4]=19; _sons_con[5][5]=15; _sons_con[5][6]=16; _sons_con[5][7]=11; _nb_of_sons_con[5]=8; _quadratic=true;
394 _little_sons_con[0][0]=0; _little_sons_con[0][1]=1; _little_sons_con[0][2]=8; _nb_of_little_sons=12;
395 _little_sons_con[1][0]=1; _little_sons_con[1][1]=2; _little_sons_con[1][2]=9;
396 _little_sons_con[2][0]=2; _little_sons_con[2][1]=3; _little_sons_con[2][2]=10;
397 _little_sons_con[3][0]=3; _little_sons_con[3][1]=0; _little_sons_con[3][2]=11;
398 _little_sons_con[4][0]=4; _little_sons_con[4][1]=5; _little_sons_con[4][2]=12;
399 _little_sons_con[5][0]=5; _little_sons_con[5][1]=6; _little_sons_con[5][2]=13;
400 _little_sons_con[6][0]=6; _little_sons_con[6][1]=7; _little_sons_con[6][2]=14;
401 _little_sons_con[7][0]=7; _little_sons_con[7][1]=4; _little_sons_con[7][2]=15;
402 _little_sons_con[8][0]=0; _little_sons_con[8][1]=4; _little_sons_con[8][2]=16;
403 _little_sons_con[9][0]=1; _little_sons_con[9][1]=5; _little_sons_con[9][2]=17;
404 _little_sons_con[10][0]=2; _little_sons_con[10][1]=6; _little_sons_con[10][2]=18;
405 _little_sons_con[11][0]=3; _little_sons_con[11][1]=7; _little_sons_con[11][2]=19;
410 _nb_of_pts=27; _nb_of_sons=6; _dim=3; _linear_type=NORM_HEXA8; _is_simplex=false;
411 _sons_type[0]=NORM_QUAD9; _sons_type[1]=NORM_QUAD9; _sons_type[2]=NORM_QUAD9; _sons_type[3]=NORM_QUAD9; _sons_type[4]=NORM_QUAD9; _sons_type[5]=NORM_QUAD9;
412 _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=2; _sons_con[0][3]=3; _sons_con[0][4]=8; _sons_con[0][5]=9; _sons_con[0][6]=10; _sons_con[0][7]=11; _sons_con[0][8]=20; _nb_of_sons_con[0]=9;
413 _sons_con[1][0]=4; _sons_con[1][1]=7; _sons_con[1][2]=6; _sons_con[1][3]=5; _sons_con[1][4]=15; _sons_con[1][5]=14; _sons_con[1][6]=13; _sons_con[1][7]=12; _sons_con[1][8]=25; _nb_of_sons_con[1]=9;
414 _sons_con[2][0]=0; _sons_con[2][1]=4; _sons_con[2][2]=5; _sons_con[2][3]=1; _sons_con[2][4]=16; _sons_con[2][5]=12; _sons_con[2][6]=17; _sons_con[2][7]=8; _sons_con[2][8]=21; _nb_of_sons_con[2]=9;
415 _sons_con[3][0]=1; _sons_con[3][1]=5; _sons_con[3][2]=6; _sons_con[3][3]=2; _sons_con[3][4]=17; _sons_con[3][5]=13; _sons_con[3][6]=18; _sons_con[3][7]=9; _sons_con[3][8]=22; _nb_of_sons_con[3]=9;
416 _sons_con[4][0]=2; _sons_con[4][1]=6; _sons_con[4][2]=7; _sons_con[4][3]=3; _sons_con[4][4]=18; _sons_con[4][5]=14; _sons_con[4][6]=19; _sons_con[4][7]=10; _sons_con[4][8]=23; _nb_of_sons_con[4]=9;
417 _sons_con[5][0]=3; _sons_con[5][1]=7; _sons_con[5][2]=4; _sons_con[5][3]=0; _sons_con[5][4]=19; _sons_con[5][5]=15; _sons_con[5][6]=16; _sons_con[5][7]=11; _sons_con[5][8]=24; _nb_of_sons_con[5]=9;
423 _nb_of_pts=0; _nb_of_sons=0; _dim=2; _dyn=true; _extruded_type=NORM_POLYHED; _is_simplex=false; _quadratic_type=NORM_QPOLYG;
428 _nb_of_pts=0; _nb_of_sons=0; _dim=3; _dyn=true; _is_simplex=false;
433 _nb_of_pts=0; _nb_of_sons=0; _dim=2; _dyn=true; _is_simplex=false; _quadratic=true; _linear_type=NORM_POLYGON;
438 _nb_of_pts=0; _nb_of_sons=0; _dim=1; _dyn=true; _extruded_type=NORM_POLYGON; _is_simplex=false;
443 _nb_of_pts=std::numeric_limits<unsigned>::max(); _nb_of_sons=std::numeric_limits<unsigned>::max(); _dim=std::numeric_limits<unsigned>::max();
450 * Equivalent to getNumberOfSons except that this method deals with dynamic type.
452 unsigned CellModel::getNumberOfSons2(const int *conn, int lgth) const
455 return getNumberOfSons();
458 if(_type==NORM_POLYGON)
464 return lgth;//NORM_POLYL
466 return std::count(conn,conn+lgth,-1)+1;
469 unsigned CellModel::getNumberOfEdgesIn3D(const int *conn, int lgth) const
472 return _nb_of_little_sons;
474 return (lgth-std::count(conn,conn+lgth,-1))/2;
478 * \sa fillMicroEdgeNodalConnectivity
480 unsigned CellModel::getNumberOfMicroEdges() const
482 unsigned mul(isQuadratic()?2:1);
485 switch(getDimension())
488 return mul*getNumberOfSons();
490 return mul*_nb_of_little_sons;
492 throw INTERP_KERNEL::Exception("CellModel::getNumberOfMacroEdges : only 2D and 3D cells support this !");
496 throw INTERP_KERNEL::Exception("CellModel::getNumberOfMacroEdges : not supported by dynamic type !");
499 NormalizedCellType CellModel::getCorrespondingPolyType() const
501 switch(getDimension())
509 throw INTERP_KERNEL::Exception("CellModel::getPolyType : no poly type for quadratic 1D !");
522 throw INTERP_KERNEL::Exception("CellModel::getPolyType : no poly type for quadratic 3D !");
525 throw INTERP_KERNEL::Exception("CellModel::getPolyType : only dimension 0, 1, 2, 3 are supported !");
530 * Equivalent to getSonType except that this method deals with dynamic type.
532 NormalizedCellType CellModel::getSonType2(unsigned sonId) const
535 return getSonType(sonId);
538 if(_type==NORM_POLYGON)
544 return NORM_ERROR;//NORM_POLYL
550 * \b WARNING this method do not manage correctly types that return true at the call of isDynamic. Use fillSonCellNodalConnectivity2 instead.
552 unsigned CellModel::fillSonCellNodalConnectivity(int sonId, const int *nodalConn, int *sonNodalConn) const
554 unsigned nbOfTurnLoop=_nb_of_sons_con[sonId];
555 const unsigned *sonConn=_sons_con[sonId];
556 for(unsigned i=0;i<nbOfTurnLoop;i++)
557 sonNodalConn[i]=nodalConn[sonConn[i]];
561 unsigned CellModel::fillSonCellNodalConnectivity2(int sonId, const int *nodalConn, int lgth, int *sonNodalConn, NormalizedCellType& typeOfSon) const
563 typeOfSon=getSonType2(sonId);
565 return fillSonCellNodalConnectivity(sonId,nodalConn,sonNodalConn);
570 if(_type==NORM_POLYGON)
572 sonNodalConn[0]=nodalConn[sonId];
573 sonNodalConn[1]=nodalConn[(sonId+1)%lgth];
578 sonNodalConn[0]=nodalConn[sonId];
579 sonNodalConn[1]=nodalConn[(sonId+1)%(lgth/2)];
580 sonNodalConn[2]=nodalConn[sonId+(lgth/2)];
586 const int *where=nodalConn;
587 for(int i=0;i<sonId;i++)
589 where=std::find(where,nodalConn+lgth,-1);
592 const int *where2=std::find(where,nodalConn+lgth,-1);
593 std::copy(where,where2,sonNodalConn);
597 throw INTERP_KERNEL::Exception("CellModel::fillSonCellNodalConnectivity2 : no sons on NORM_POLYL !");
602 * Equivalent to CellModel::fillSonCellNodalConnectivity2 except for HEXA8 where the order of sub faces is not has MED file numbering for transformation HEXA8->HEXA27
604 unsigned CellModel::fillSonCellNodalConnectivity4(int sonId, const int *nodalConn, int lgth, int *sonNodalConn, NormalizedCellType& typeOfSon) const
606 if(_type==NORM_HEXA8)
608 static const int permutation[6]={0,2,3,4,5,1};
609 return fillSonCellNodalConnectivity2(permutation[sonId],nodalConn,lgth,sonNodalConn,typeOfSon);
612 return fillSonCellNodalConnectivity2(sonId,nodalConn,lgth,sonNodalConn,typeOfSon);
615 unsigned CellModel::fillSonEdgesNodalConnectivity3D(int sonId, const int *nodalConn, int lgth, int *sonNodalConn, NormalizedCellType& typeOfSon) const
622 sonNodalConn[0]=nodalConn[_little_sons_con[sonId][0]];
623 sonNodalConn[1]=nodalConn[_little_sons_con[sonId][1]];
629 sonNodalConn[0]=nodalConn[_little_sons_con[sonId][0]];
630 sonNodalConn[1]=nodalConn[_little_sons_con[sonId][1]];
631 sonNodalConn[2]=nodalConn[_little_sons_con[sonId][2]];
636 throw INTERP_KERNEL::Exception("CellModel::fillSonEdgesNodalConnectivity3D : not implemented yet for NORM_POLYHED !");
640 * \sa getNumberOfMicroEdges
642 unsigned CellModel::fillMicroEdgeNodalConnectivity(int sonId, const int *nodalConn, int *sonNodalConn, NormalizedCellType& typeOfSon) const
646 int edgeId(sonId/2),subEdgeId(sonId%2);
648 const unsigned *sonConn(0);
649 switch(getDimension())
653 sonConn=_sons_con[edgeId];
658 sonConn=_little_sons_con[edgeId];
662 throw INTERP_KERNEL::Exception("CellModel::fillMicroEdgeNodalConnectivity : only 2D and 3D cells support this !");
664 const unsigned tmp[3]={sonConn[0],sonConn[2],sonConn[1]};
665 sonNodalConn[0]=nodalConn[tmp[subEdgeId]];
666 sonNodalConn[1]=nodalConn[tmp[subEdgeId+1]];
671 switch(getDimension())
674 return fillSonCellNodalConnectivity2(sonId,nodalConn,0,sonNodalConn,typeOfSon);
676 return fillSonEdgesNodalConnectivity3D(sonId,nodalConn,0,sonNodalConn,typeOfSon);
678 throw INTERP_KERNEL::Exception("CellModel::fillMicroEdgeNodalConnectivity : only 2D and 3D cells support this #2 !");
683 void CellModel::changeOrientationOf2D(int *nodalConn, unsigned int sz) const
689 std::vector<int> tmp(sz-1);
690 std::copy(nodalConn+1,nodalConn+sz,tmp.rbegin());
691 std::copy(tmp.begin(),tmp.end(),nodalConn+1);
695 unsigned int sz2(sz/2);
696 std::vector<int> tmp0(sz2-1),tmp1(sz2);
697 std::copy(nodalConn+1,nodalConn+sz2,tmp0.rbegin());
698 std::copy(nodalConn+sz2,nodalConn+sz,tmp1.rbegin());
699 std::copy(tmp0.begin(),tmp0.end(),nodalConn+1);
700 std::copy(tmp1.begin(),tmp1.end(),nodalConn+sz2);
704 void CellModel::changeOrientationOf1D(int *nodalConn, unsigned int sz) const
710 std::swap(nodalConn[0],nodalConn[1]);
715 std::swap(nodalConn[0],nodalConn[1]);
716 std::swap(nodalConn[2],nodalConn[3]);
719 throw Exception("CellModel::changeOrientationOf1D : unrecognized 1D cell type !");
723 std::vector<int> tmp(sz-1);
724 std::copy(nodalConn+1,nodalConn+sz,tmp.rbegin());
725 std::copy(tmp.begin(),tmp.end(),nodalConn+1);
729 //================================================================================
731 * \brief Return number of nodes in sonId-th son of a Dynamic() cell
733 //================================================================================
735 unsigned CellModel::getNumberOfNodesConstituentTheSon2(unsigned sonId, const int *nodalConn, int lgth) const
738 return getNumberOfNodesConstituentTheSon(sonId);
742 if(_type==NORM_POLYGON)
749 const int *where=nodalConn;
750 for(unsigned int i=0;i<sonId;i++)
752 where=std::find(where,nodalConn+lgth,-1);
755 const int *where2=std::find(where,nodalConn+lgth,-1);
759 throw INTERP_KERNEL::Exception("CellModel::getNumberOfNodesConstituentTheSon2 : no sons on NORM_POLYL !");
763 * This method retrieves if cell1 represented by 'conn1' and cell2 represented by 'conn2'
764 * are equivalent by a permutation or not. This method expects to work on 1D or 2D (only mesh dimension where it is possible to have a spaceDim) strictly higher than meshDim.
765 * If not an exception will be thrown.
766 * @return True if two cells have same orientation, false if not.
768 bool CellModel::getOrientationStatus(unsigned lgth, const int *conn1, const int *conn2) const
770 if(_dim!=1 && _dim!=2)
771 throw INTERP_KERNEL::Exception("CellModel::getOrientationStatus : invalid dimension ! Must be 1 or 2 !");
774 std::vector<int> tmp(2*lgth);
775 std::vector<int>::iterator it=std::copy(conn1,conn1+lgth,tmp.begin());
776 std::copy(conn1,conn1+lgth,it);
777 it=std::search(tmp.begin(),tmp.end(),conn2,conn2+lgth);
782 std::vector<int>::reverse_iterator it2=std::search(tmp.rbegin(),tmp.rend(),conn2,conn2+lgth);
785 throw INTERP_KERNEL::Exception("CellModel::getOrientationStatus : Request of orientation status of non equal connectively cells !");
791 std::vector<int> tmp(lgth);
792 std::vector<int>::iterator it=std::copy(conn1,conn1+lgth/2,tmp.begin());
793 std::copy(conn1,conn1+lgth/2,it);
794 it=std::search(tmp.begin(),tmp.end(),conn2,conn2+lgth/2);
795 int d=std::distance(tmp.begin(),it);
798 it=std::copy(conn1+lgth/2,conn1+lgth,tmp.begin());
799 std::copy(conn1+lgth/2,conn1+lgth,it);
800 it=std::search(tmp.begin(),tmp.end(),conn2,conn2+lgth);
803 int d2=std::distance(tmp.begin(),it);
809 std::vector<int> tmp(2*p);
810 std::vector<int>::iterator it=std::copy(conn1,conn1+p,tmp.begin());
811 std::copy(conn1,conn1+p,it);
812 it=std::search(tmp.begin(),tmp.end(),conn2,conn2+p);
813 int d=std::distance(tmp.begin(),it);
817 it=std::copy(conn1+p,conn1+lgth,tmp.begin());
818 std::copy(conn1+p,conn1+lgth,it);
819 it=std::search(tmp.begin(),tmp.end(),conn2+p,conn2+lgth);
822 int d2=std::distance(tmp.begin(),it);
828 DiameterCalculator *CellModel::buildInstanceOfDiameterCalulator(int spaceDim) const
837 return new DiameterCalulatorTRI3S2;
839 return new DiameterCalulatorTRI3S3;
841 throw Exception("CellModel::buildInstanceOfDiameterCalulator : For TRI3 only space dimension 2 and 3 implemented !");
850 return new DiameterCalulatorQUAD4S2;
852 return new DiameterCalulatorQUAD4S3;
854 throw Exception("CellModel::buildInstanceOfDiameterCalulator : For QUAD4 only space dimension 2 and 3 implemented !");
863 return new DiameterCalulatorTRI6S2;
865 return new DiameterCalulatorTRI6S3;
867 throw Exception("CellModel::buildInstanceOfDiameterCalulator : For TRI6 only space dimension 2 and 3 implemented !");
876 return new DiameterCalulatorTRI7S2;
878 return new DiameterCalulatorTRI7S3;
880 throw Exception("CellModel::buildInstanceOfDiameterCalulator : For TRI7 only space dimension 2 and 3 implemented !");
889 return new DiameterCalulatorQUAD8S2;
891 return new DiameterCalulatorQUAD8S3;
893 throw Exception("CellModel::buildInstanceOfDiameterCalulator : For QUAD8 only space dimension 2 and 3 implemented !");
902 return new DiameterCalulatorQUAD9S2;
904 return new DiameterCalulatorQUAD9S3;
906 throw Exception("CellModel::buildInstanceOfDiameterCalulator : For QUAD9 only space dimension 2 and 3 implemented !");
913 return new DiameterCalulatorTETRA4;
915 throw Exception("CellModel::buildInstanceOfDiameterCalulator : For TETRA4 space dimension 3 expected !");
920 return new DiameterCalulatorTETRA10;
922 throw Exception("CellModel::buildInstanceOfDiameterCalulator : For TETRA10 space dimension 3 expected !");
927 return new DiameterCalulatorHEXA8;
929 throw Exception("CellModel::buildInstanceOfDiameterCalulator : For HEXA8 space dimension 3 expected !");
934 return new DiameterCalulatorHEXA20;
936 throw Exception("CellModel::buildInstanceOfDiameterCalulator : For HEXA20 space dimension 3 expected !");
941 return new DiameterCalulatorHEXA27;
943 throw Exception("CellModel::buildInstanceOfDiameterCalulator : For HEXA27 space dimension 3 expected !");
948 return new DiameterCalulatorPENTA6;
950 throw Exception("CellModel::buildInstanceOfDiameterCalulator : For PENTA6 space dimension 3 expected !");
955 return new DiameterCalulatorPENTA15;
957 throw Exception("CellModel::buildInstanceOfDiameterCalulator : For PENTA15 space dimension 3 expected !");
962 return new DiameterCalulatorPYRA5;
964 throw Exception("CellModel::buildInstanceOfDiameterCalulator : For PYRA5 space dimension 3 expected !");
969 return new DiameterCalulatorPYRA13;
971 throw Exception("CellModel::buildInstanceOfDiameterCalulator : For PYRA13 space dimension 3 expected !");
974 throw Exception("CellModel::buildInstanceOfDiameterCalulator : implemented only for TRI3, QUAD4, TETRA4, HEXA8, PENTA6, PYRA5 !");
978 OrientationInverter *CellModel::buildOrientationInverter() const
983 return new OrientationInverterSEG2;
985 return new OrientationInverterSEG3;
988 return new OrientationInverter2DLinear(getNumberOfNodes());
991 return new OrientationInverter2DQuadratic(getNumberOfNodes());
993 return new OrientationInverterPolygon;
995 return new OrientationInverterQPolygon;
997 return new OrientationInverterTetra4;
999 return new OrientationInverterPyra5;
1001 return new OrientationInverterTetra10;
1003 return new OrientationInverterPyra13;
1006 return new OrientationInverter3DExtrusionLinear(getNumberOfNodes());
1009 return new OrientationInverter3DExtrusionQuadratic(getNumberOfNodes());
1012 std::ostringstream oss; oss << "CellModel::buildOrientationInverter : not managed geometric type " << getRepr() << " yet !";
1013 throw INTERP_KERNEL::Exception(oss.str());