Salome HOME
Merge branch 'OCCT780'
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPluginBuilder.py
1 # Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
2 #
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.
7 #
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.
12 #
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
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 ##
21 # @package NETGENPluginBuilder
22 # Python API for the NETGEN meshing plug-in module.
23
24 from salome.smesh.smesh_algorithm import Mesh_Algorithm
25 from salome.smesh.smeshBuilder import AssureGeomPublished, ParseParameters, IsEqual
26
27 # import NETGENPlugin module if possible
28 noNETGENPlugin = 0
29 try:
30     import NETGENPlugin
31 except ImportError:
32     noNETGENPlugin = 1
33     pass
34
35 LIBRARY = "libNETGENEngine.so"
36
37 NETGEN_VERSION_MAJOR = NETGENPlugin.NETGEN_VERSION_MAJOR
38
39 #----------------------------
40 # Mesh algo type identifiers
41 #----------------------------
42
43 ## Algorithm type: Netgen tetrahedron 3D algorithm, see NETGEN_3D_Algorithm
44 NETGEN_3D     = "NETGEN_3D"
45 NETGEN_3D_Remote     = "NETGEN_3D_Remote"
46 ## Algorithm type: Netgen tetrahedron 1D-2D-3D algorithm, see NETGEN_1D2D3D_Algorithm
47 NETGEN_1D2D3D = "NETGEN_2D3D"
48 ## Algorithm type: Netgen triangle 1D-2D algorithm, see NETGEN_1D2D_Algorithm
49 NETGEN_1D2D   = "NETGEN_2D"
50 ## Algorithm type: Netgen triangle 2D algorithm, see NETGEN_2D_Only_Algorithm
51 NETGEN_2D     = "NETGEN_2D_ONLY"
52 NETGEN_2D_Remote = "NETGEN_2D_Remote"
53 ## Algorithm type: Synonim of NETGEN_1D2D3D, see NETGEN_1D2D3D_Algorithm
54 NETGEN_FULL   = NETGEN_1D2D3D
55 ## Algorithm type: Synonim of NETGEN_3D, see NETGEN_3D_Algorithm
56 NETGEN        = NETGEN_3D
57 ## Algorithm type: Synonim of NETGEN_1D2D3D, see NETGEN_1D2D3D_Algorithm
58 FULL_NETGEN   = NETGEN_FULL
59
60 #----------------------------
61 # Hypothesis type enumeration
62 #----------------------------
63
64 ## Hypothesis type enumeration: complex hypothesis
65 #  (full set of parameters can be specified),
66 #  see NETGEN_Algorithm.Parameters()
67 SOLE   = 0
68 ## Hypothesis type enumeration: simple hypothesis
69 #  (only major parameters are specified),
70 #  see NETGEN_Algorithm.Parameters()
71 SIMPLE = 1
72
73 #----------------------
74 # Fineness enumeration
75 #----------------------
76
77 ## Fineness enumeration: very coarse quality of mesh,
78 #  see NETGEN_Algorithm.SetFineness()
79 VeryCoarse = 0
80 ## Fineness enumeration: coarse quality of mesh,
81 #  see NETGEN_Algorithm.SetFineness()
82 Coarse     = 1
83 ## Fineness enumeration: moderate quality of mesh,
84 #  see NETGEN_Algorithm.SetFineness()
85 Moderate   = 2
86 ## Fineness enumeration: fine quality of mesh,
87 #  see NETGEN_Algorithm.SetFineness()
88 Fine       = 3
89 ## Fineness enumeration: very fine quality of mesh,
90 #  see NETGEN_Algorithm.SetFineness()
91 VeryFine   = 4
92 ## Fineness enumeration: custom quality of mesh specified by other parameters),
93 #  see NETGEN_Algorithm.SetFineness()
94 Custom     = 5
95
96 #----------------------
97 # Algorithms
98 #----------------------
99
100 ## Base of all NETGEN algorithms.
101 #
102 #  This class provides common methods for all algorithms implemented by NETGEN plugin.
103 #  @note This class must not be instantiated directly.
104 class NETGEN_Algorithm(Mesh_Algorithm):
105
106     ## Private constructor
107     #  @param mesh parent mesh object algorithm is assigned to
108     #  @param geom geometry (shape/sub-shape) algorithm is assigned to;
109     #              if it is @c 0 (default), the algorithm is assigned to the main shape
110     def __init__(self, mesh, geom=0):
111         Mesh_Algorithm.__init__(self)
112         if noNETGENPlugin: print("Warning: NETGENPlugin module unavailable")
113         if not mesh.GetMesh().HasShapeToMesh() and \
114            self.meshMethod == "Triangle": # create a 2D remesher
115             self.Create(mesh, geom, "NETGEN_Remesher_2D", LIBRARY)
116         else:
117             self.Create(mesh, geom, self.algoType, LIBRARY)
118         self.params = None
119         pass
120
121     ## Sets @c MaxSize parameter
122     #  @param theSize new value of the @c MaxSize parameter
123     def SetMaxSize(self, theSize):
124         if self.Parameters(): self.params.SetMaxSize(theSize)
125         pass
126
127     ## Sets @c MinSize parameter
128     #  @param theSize new value of the @c MinSize parameter
129     def SetMinSize(self, theSize):
130         if self.Parameters(): self.params.SetMinSize(theSize)
131         pass
132
133     ## Sets @c Optimize flag
134     #  @param theVal new value of the @c Optimize parameter
135     def SetOptimize(self, theVal):
136         if self.Parameters(): self.params.SetOptimize(theVal)
137         pass
138
139     ## Sets @c Fineness parameter
140     #  @param theFineness new value of the @c Fineness parameter; it can be:
141     #  @ref VeryCoarse, @ref Coarse, @ref Moderate, @ref Fine, @ref VeryFine or @ref Custom
142     def SetFineness(self, theFineness):
143         if self.Parameters(): self.params.SetFineness(theFineness)
144         pass
145
146     ## Sets @c GrowthRate parameter
147     #  @param theRate new value of the @c GrowthRate parameter
148     def SetGrowthRate(self, theRate):
149         if self.Parameters(): self.params.SetGrowthRate(theRate)
150         pass
151
152     ## Sets @c NbThreads parameter
153     #  @param theRate new value of the @c NbThreads parameter
154     def SetNbThreads(self, theNumber):
155         if self.Parameters(): self.params.SetNbThreads(theNumber)
156         pass
157
158     ## Creates meshing hypothesis according to the chosen algorithm type
159     #  and initializes it with default parameters
160     #  @param which hypothesis type; can be either @ref SOLE (default) or @ref SIMPLE
161     #  @return hypothesis object
162     def Parameters(self, which=SOLE):
163         if self.algoType == NETGEN_1D2D:
164             if which == SIMPLE:
165                 hypType = "NETGEN_SimpleParameters_2D"
166             else:
167                 hypType = "NETGEN_Parameters_2D"
168         elif self.algoType == NETGEN_1D2D3D:
169             if which == SIMPLE:
170                 hypType = "NETGEN_SimpleParameters_3D"
171             else:
172                 hypType = "NETGEN_Parameters"
173         elif self.algoType in [NETGEN_2D, NETGEN_2D_Remote]:
174             hypType = "NETGEN_Parameters_2D_ONLY"
175         else:
176             hypType = "NETGEN_Parameters_3D"
177
178         if self.algo.GetName() == "NETGEN_Remesher_2D":
179             hypType = "NETGEN_RemesherParameters_2D"
180
181         if self.params and self.params.GetName() != hypType:
182             self.mesh.RemoveHypothesis( self.params, self.geom )
183             self.params = None
184         if not self.params:
185             self.params = self.Hypothesis(hypType, [], LIBRARY, UseExisting=0)
186
187         return self.params
188
189     ## Defines a file specifying size of elements at points and lines
190     #  @param file name of the file
191     def SetMeshSizeFile(self, file):
192         self.Parameters().SetMeshSizeFile(file)
193         pass
194
195     ## Set size of elements on a shape
196     #  @param shape - geometry
197     #  @param size - element size
198     def SetLocalSizeOnShape(self, shape, size ):
199         self.Parameters().SetLocalSizeOnShape(shape, size)
200         pass
201
202
203     pass # end of NETGEN_Algorithm class
204
205
206 ## Tetrahedron 1D-2D-3D algorithm.
207 #
208 #  It can be created by calling smeshBuilder.Mesh.Tetrahedron( smeshBuilder.NETGEN_1D2D3D, geom=0 ).
209 #  This algorithm generates all 1D (edges), 2D (faces) and 3D (volumes) elements
210 #  for given geometrical shape.
211 class NETGEN_1D2D3D_Algorithm(NETGEN_Algorithm):
212
213     ## name of the dynamic method in smeshBuilder.Mesh class
214     #  @internal
215     meshMethod = "Tetrahedron"
216     ## type of algorithm used with helper function in smeshBuilder.Mesh class
217     #  @internal
218     algoType   = NETGEN_1D2D3D
219     ## doc string of the method
220     #  @internal
221     docHelper  = "Creates tetrahedron 3D algorithm for solids"
222
223     ## Private constructor.
224     #  @param mesh parent mesh object algorithm is assigned to
225     #  @param geom geometry (shape/sub-shape) algorithm is assigned to;
226     #              if it is @c 0 (default), the algorithm is assigned to the main shape
227     def __init__(self, mesh, geom=0):
228         NETGEN_Algorithm.__init__(self, mesh, geom)
229         pass
230
231     ## Sets @c SecondOrder flag
232     #  @param theVal new value of the @c SecondOrder parameter
233     def SetSecondOrder(self, theVal):
234         if self.Parameters(): self.params.SetSecondOrder(theVal)
235         pass
236
237     ## Sets @c NbSegPerEdge parameter
238     #  @param theVal new value of the @c NbSegPerEdge parameter
239     def SetNbSegPerEdge(self, theVal):
240         if self.Parameters(): self.params.SetNbSegPerEdge(theVal)
241         pass
242
243     ## Sets @c NbSegPerRadius parameter
244     #  @param theVal new value of the @c NbSegPerRadius parameter
245     def SetNbSegPerRadius(self, theVal):
246         if self.Parameters(): self.params.SetNbSegPerRadius(theVal)
247         pass
248
249     ## Sets @c ChordalError parameter
250     #  @param theVal new value of the @c ChordalError parameter
251     def SetChordalError(self, theVal):
252         if self.Parameters():
253             self.params.SetChordalError(theVal)
254             self.params.SetChordalErrorEnabled( theVal > 0 )
255         pass
256
257     ## Sets @c RidgeAngle parameter
258     #  @param theVal new value of the @c RidgeAngle parameter
259     def SetRidgeAngle(self, theVal):
260         if self.Parameters():
261             self.params.SetRidgeAngle(theVal)
262         pass
263
264     ## Sets @c QuadAllowed flag
265     #  @param toAllow new value of the @c QuadAllowed parameter (@c True by default)
266     def SetQuadAllowed(self, toAllow=True):
267         if self.Parameters(): self.params.SetQuadAllowed(toAllow)
268         pass
269     ## Sets @c UseSurfaceCurvature flag
270     #  @param toUse new value of the @c UseSurfaceCurvature parameter (@c True by default)
271     def SetUseSurfaceCurvature(self, toUse=True):
272         if self.Parameters(): self.params.SetUseSurfaceCurvature(toUse)
273         pass
274     ## Sets @c FuseEdges flag
275     #  @param toFuse new value of the @c FuseEdges parameter (@c False by default)
276     def SetFuseEdges(self, toFuse=False):
277         if self.Parameters(): self.params.SetFuseEdges(toFuse)
278         pass
279
280     ## Sets number of segments overriding the value set by SetLocalLength()
281     #  @param theVal new value of number of segments parameter
282     def SetNumberOfSegments(self, theVal):
283         self.Parameters(SIMPLE).SetNumberOfSegments(theVal)
284         pass
285
286     ## Sets number of segments overriding the value set by SetNumberOfSegments()
287     #  @param theVal new value of local length parameter
288     def SetLocalLength(self, theVal):
289         self.Parameters(SIMPLE).SetLocalLength(theVal)
290         pass
291
292     ## Defines @c MaxElementArea parameter of @c NETGEN_SimpleParameters_3D hypothesis.
293     #  Overrides value set by LengthFromEdges()
294     #  @param area new value of @c MaxElementArea parameter
295     def MaxElementArea(self, area):
296         self.Parameters(SIMPLE).SetMaxElementArea(area)
297         pass
298
299     ## Defines @c LengthFromEdges parameter of @c NETGEN_SimpleParameters_3D hypothesis.
300     #  Overrides value set by MaxElementArea()
301     def LengthFromEdges(self):
302         self.Parameters(SIMPLE).LengthFromEdges()
303         pass
304
305     ## Defines @c LengthFromFaces parameter of @c NETGEN_SimpleParameters_3D hypothesis.
306     #  Overrides value set by MaxElementVolume()
307     def LengthFromFaces(self):
308         self.Parameters(SIMPLE).LengthFromFaces()
309         pass
310
311     ## Defines @c MaxElementVolume parameter of @c NETGEN_SimpleParameters_3D hypothesis.
312     #  Overrides value set by LengthFromFaces()
313     #  @param vol new value of @c MaxElementVolume parameter
314     def MaxElementVolume(self, vol):
315         self.Parameters(SIMPLE).SetMaxElementVolume(vol)
316         pass
317
318     pass # end of NETGEN_1D2D3D_Algorithm class
319
320
321 ## Triangle NETGEN 1D-2D algorithm.
322 #
323 #  It can be created by calling smeshBuilder.Mesh.Triangle( smeshBuilder.NETGEN_1D2D, geom=0 )
324 #
325 #  This algorithm generates 1D (edges) and 2D (faces) elements
326 #  for given geometrical shape.
327 class NETGEN_1D2D_Algorithm(NETGEN_1D2D3D_Algorithm):
328
329     ## name of the dynamic method in smeshBuilder.Mesh class
330     #  @internal
331     meshMethod = "Triangle"
332     ## type of algorithm used with helper function in smeshBuilder.Mesh class
333     #  @internal
334     algoType   = NETGEN_1D2D
335     ## doc string of the method
336     #  @internal
337     docHelper  = "Creates triangle 2D algorithm for faces"
338
339
340     ## Private constructor.
341     #  @param mesh parent mesh object algorithm is assigned to
342     #  @param geom geometry (shape/sub-shape) algorithm is assigned to;
343     #              if it is @c 0 (default), the algorithm is assigned to the main shape
344     def __init__(self, mesh, geom=0):
345         NETGEN_1D2D3D_Algorithm.__init__(self, mesh, geom)
346         pass
347
348     pass # end of NETGEN_1D2D_Algorithm class
349
350
351 ## Triangle NETGEN 2D algorithm
352 #
353 #  It can be created by calling smeshBuilder.Mesh.Triangle( smeshBuilder.NETGEN_2D, geom=0 )
354 #
355 #  This algorithm generates only 2D (faces) elements for given geometrical shape
356 #  and, in contrast to NETGEN_1D2D_Algorithm class, should be used in conjunction
357 #  with other 1D meshing algorithm.
358 class NETGEN_2D_Only_Algorithm(NETGEN_Algorithm):
359
360     ## name of the dynamic method in smeshBuilder.Mesh class
361     #  @internal
362     meshMethod = "Triangle"
363     ## type of algorithm used with helper function in smeshBuilder.Mesh class
364     #  @internal
365     algoType = NETGEN_2D
366     ## flag pointing whether this algorithm should be used by default in dynamic method
367     #  of smeshBuilder.Mesh class
368     isDefault  = True
369     ## doc string of the method
370     #  @internal
371     docHelper  = "Creates triangle 2D algorithm for faces"
372
373     isDefault = True
374
375     ## Private constructor.
376     #  @param mesh parent mesh object algorithm is assigned to
377     #  @param geom geometry (shape/sub-shape) algorithm is assigned to;
378     #              if it is @c 0 (default), the algorithm is assigned to the main shape
379     def __init__(self, mesh, geom=0):
380         NETGEN_Algorithm.__init__(self, mesh, geom)
381         pass
382
383     ## Defines @c MaxElementArea parameter of hypothesis basing on the definition of the
384     #  maximum area of each triangle
385     #  @param area maximum area value of each triangle
386     #  @param UseExisting if \c True - searches for an existing hypothesis created with the
387     #                     same parameters, else (default) - creates a new one
388     #  @return hypothesis object
389     def MaxElementArea(self, area, UseExisting=0):
390         compFun = lambda hyp, args: IsEqual(hyp.GetMaxElementArea(), args[0])
391         hyp = self.Hypothesis("MaxElementArea", [area], UseExisting=UseExisting,
392                               CompareMethod=compFun)
393         hyp.SetMaxElementArea(area)
394         return hyp
395
396     ## Defines @c LengthFromEdges hypothesis to build triangles
397     #  based on the length of the edges taken from the wire
398     #  @return hypothesis object
399     def LengthFromEdges(self):
400         hyp = self.Hypothesis("LengthFromEdges", UseExisting=1, CompareMethod=self.CompareEqualHyp)
401         return hyp
402
403     ## Sets @c UseSurfaceCurvature flag
404     #  @param toUse new value of the @c UseSurfaceCurvature parameter (@c True by default)
405     def SetUseSurfaceCurvature(self, toUse=True):
406         if self.Parameters(): self.params.SetUseSurfaceCurvature(toUse)
407         pass
408
409     ## Sets @c QuadAllowed flag.
410     #  @param toAllow new value of the @c QuadAllowed parameter (@c True by default)
411     #  @return hypothesis object
412     def SetQuadAllowed(self, toAllow=True):
413         if not self.params:
414             # use simple hyps
415             hasSimpleHyps = False
416             simpleHyps = ["QuadranglePreference","LengthFromEdges","MaxElementArea"]
417             for hyp in self.mesh.GetHypothesisList( self.geom ):
418                 if hyp.GetName() in simpleHyps:
419                     hasSimpleHyps = True
420                     if hyp.GetName() == "QuadranglePreference":
421                         if not toAllow: # remove QuadranglePreference
422                             self.mesh.RemoveHypothesis( self.geom, hyp )
423                         else:
424                             return hyp
425                         return None
426                     pass
427                 pass
428             if hasSimpleHyps:
429                 if toAllow: # add QuadranglePreference
430                     return self.Hypothesis("QuadranglePreference", UseExisting=1, CompareMethod=self.CompareEqualHyp)
431                 return None
432             pass
433         self.Parameters().SetQuadAllowed( toAllow )
434         return self.params
435
436     pass # end of NETGEN_2D_Only_Algorithm class
437
438
439 ## Tetrahedron 3D algorithm
440 #
441 #  It can be created by calling smeshBuilder.Mesh.Tetrahedron() or smeshBuilder.Mesh.Tetrahedron( smeshBuilder.NETGEN, geom=0 )
442 #
443 #  This algorithm generates only 3D (volumes) elements for given geometrical shape
444 #  and, in contrast to NETGEN_1D2D3D_Algorithm class, should be used in conjunction
445 #  with other 1D and 2D meshing algorithms.
446 class NETGEN_3D_Algorithm(NETGEN_Algorithm):
447
448     ## name of the dynamic method in smeshBuilder.Mesh class
449     #  @internal
450     meshMethod = "Tetrahedron"
451     ## type of algorithm used with helper function in smeshBuilder.Mesh class
452     #  @internal
453     algoType   = NETGEN
454     ## flag pointing either this algorithm should be used by default in dynamic method
455     #  of smeshBuilder.Mesh class
456     #  @internal
457     isDefault  = True
458     ## doc string of the method
459     #  @internal
460     docHelper  = "Creates tetrahedron 3D algorithm for solids"
461
462     ## Private constructor.
463     #  @param mesh parent mesh object algorithm is assigned to
464     #  @param geom geometry (shape/sub-shape) algorithm is assigned to;
465     #              if it is @c 0 (default), the algorithm is assigned to the main shape
466     def __init__(self, mesh, geom=0):
467         NETGEN_Algorithm.__init__(self, mesh, geom)
468         pass
469
470     ## Defines @c MaxElementVolume hypothesis to specify the maximum volume value of each tetrahedron
471     #  @param vol maximum volume value of each tetrahedron
472     #  @param UseExisting if \c True - searches for the existing hypothesis created with
473     #                   the same parameters, else (default) - creates a new one
474     #  @return hypothesis object
475     def MaxElementVolume(self, vol, UseExisting=0):
476         compFun = lambda hyp, args: IsEqual(hyp.GetMaxElementVolume(), args[0])
477         hyp = self.Hypothesis("MaxElementVolume", [vol], UseExisting=UseExisting,
478                               CompareMethod=compFun)
479         hyp.SetMaxElementVolume(vol)
480         return hyp
481
482     pass # end of NETGEN_3D_Algorithm class
483
484 ## Tetrahedron 3D algorithm
485 #
486 #  It can be created by calling smeshBuilder.Mesh.Tetrahedron() or smeshBuilder.Mesh.Tetrahedron( smeshBuilder.NETGEN, geom=0 )
487 #
488 #  This algorithm generates only 3D (volumes) elements for given geometrical shape
489 #  and, in contrast to NETGEN_1D2D3D_Algorithm class, should be used in conjunction
490 #  with other 1D and 2D meshing algorithms.
491 class NETGEN_3D_Remote_Algorithm(NETGEN_3D_Algorithm):
492
493     ## type of algorithm used with helper function in smeshBuilder.Mesh class
494     #  @internal
495     algoType   = NETGEN_3D_Remote
496     ## flag pointing either this algorithm should be used by default in dynamic method
497     #  of smeshBuilder.Mesh class
498     #  @internal
499     isDefault  = False
500     ## doc string of the method
501     #  @internal
502     docHelper  = "Remotely Creates tetrahedron 3D algorithm for solids"
503
504     ## Private constructor.
505     #  @param mesh parent mesh object algorithm is assigned to
506     #  @param geom geometry (shape/sub-shape) algorithm is assigned to;
507     #              if it is @c 0 (default), the algorithm is assigned to the main shape
508     def __init__(self, mesh, geom=0):
509         NETGEN_3D_Algorithm.__init__(self, mesh, geom)
510         pass
511
512     pass # end of NETGEN_3D_Remote_Algorithm class
513
514 ## Tetrahedron 2D algorithm
515 #
516 #  It can be created by calling smeshBuilder.Mesh.Triangle() or smeshBuilder.Mesh.Triangle( smeshBuilder.NETGEN, geom=0 )
517 #
518 class NETGEN_2D_Remote_Algorithm(NETGEN_2D_Only_Algorithm):
519
520     ## type of algorithm used with helper function in smeshBuilder.Mesh class
521     #  @internal
522     algoType   = NETGEN_2D_Remote
523     ## flag pointing either this algorithm should be used by default in dynamic method
524     #  of smeshBuilder.Mesh class
525     #  @internal
526     isDefault  = False
527     ## doc string of the method
528     #  @internal
529     docHelper  = "Remotely Creates triangles in face of solids"
530
531     ## Private constructor.
532     #  @param mesh parent mesh object algorithm is assigned to
533     #  @param geom geometry (shape/sub-shape) algorithm is assigned to;
534     #              if it is @c 0 (default), the algorithm is assigned to the main shape
535     def __init__(self, mesh, geom=0):
536         self.algoType = NETGEN_2D_Remote
537         NETGEN_2D_Only_Algorithm.__init__(self, mesh, geom)
538         pass
539
540     pass # end of NETGEN_2D_Remote_Algorithm class
541
542
543 ## Triangle (helper) 1D-2D algorithm
544 #
545 #  This is the helper class that is used just to allow creating of create NETGEN_1D2D algorithm
546 #  by calling smeshBuilder.Mesh.Triangle( smeshBuilder.NETGEN, geom=0 ); this is required for backward compatibility
547 #  with old Python scripts.
548 #
549 #  @note This class (and corresponding smeshBuilder.Mesh function) is obsolete;
550 #  use smeshBuilder.Mesh.Triangle( smeshBuilder.NETGEN_1D2D, geom=0 ) instead.
551 class NETGEN_1D2D_Algorithm_2(NETGEN_1D2D_Algorithm):
552
553     ## name of the dynamic method in smeshBuilder.Mesh class
554     #  @internal
555     algoType = NETGEN
556
557     ## Private constructor.
558     #  @param mesh parent mesh object algorithm is assigned to
559     #  @param geom geometry (shape/sub-shape) algorithm is assigned to;
560     #              if it is @c 0 (default), the algorithm is assigned to the main shape
561     def __init__(self, mesh, geom=0):
562         self.algoType = NETGEN_1D2D
563         NETGEN_1D2D_Algorithm.__init__(self,mesh, geom)
564         pass
565
566     pass # end of NETGEN_1D2D_Algorithm_2 class
567
568
569 ## Tetrahedron (helper) 1D-2D-3D algorithm.
570 #
571 #  This is the helper class that is used just to allow creating of create NETGEN_1D2D3D
572 #  by calling smeshBuilder.Mesh.Netgen(); this is required for backward compatibility with old Python scripts.
573 #
574 #  @note This class (and corresponding smeshBuilder.Mesh function) is obsolete;
575 #  use smeshBuilder.Mesh.Tetrahedron( smeshBuilder.NETGEN_1D2D3D, geom=0 ) instead.
576 class NETGEN_1D2D3D_Algorithm_2(NETGEN_1D2D3D_Algorithm):
577
578     ## name of the dynamic method in smeshBuilder.Mesh class
579     #  @internal
580     meshMethod = "Netgen"
581     ## doc string of the method
582     #  @internal
583     docHelper  = "Deprecated, used only for compatibility! See Tetrahedron() method."
584
585     ## Private constructor.
586     #  @param mesh parent mesh object algorithm is assigned to
587     #  @param geom geometry (shape/sub-shape) algorithm is assigned to;
588     #              if it is @c 0 (default), the algorithm is assigned to the main shape
589     def __init__(self, mesh, geom=0):
590         NETGEN_1D2D3D_Algorithm.__init__(self,mesh, geom)
591         pass
592
593     pass # end of NETGEN_1D2D3D_Algorithm_2 class