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