1 # Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
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
20 from smesh import Mesh_Algorithm, AssureGeomPublished, IsEqual, ParseParameters
21 from smesh import GetName, TreatHypoStatus
22 from smeshDC import Mesh
27 REGULAR = "Regular_1D"
29 COMPOSITE = "CompositeSegment_1D"
30 MEFISTO = "MEFISTO_2D"
32 QUADRANGLE = "Quadrangle_2D"
33 RADIAL_QUAD = "RadialQuadrangle_1D2D"
36 # import items of enum QuadType
37 for e in StdMeshers.QuadType._items: exec('%s = StdMeshers.%s'%(e,e))
40 # Public class: Mesh_Segment
41 # --------------------------
43 ## Class to define a REGULAR 1D algorithm for discretization. It is created by
44 # calling Mesh.Segment(geom=0)
46 # @ingroup l3_algos_basic
47 class StdMeshersDC_Segment(Mesh_Algorithm):
49 ## Name of method of class Mesh creating an instance of this class
50 meshMethod = "Segment"
51 ## Name of algorithm type
55 ## Private constructor.
56 def __init__(self, mesh, geom=0):
57 Mesh_Algorithm.__init__(self)
58 self.Create(mesh, geom, self.algoType)
60 ## Defines "LocalLength" hypothesis to cut an edge in several segments with the same length
61 # @param l for the length of segments that cut an edge
62 # @param UseExisting if ==true - searches for an existing hypothesis created with
63 # the same parameters, else (default) - creates a new one
64 # @param p precision, used for calculation of the number of segments.
65 # The precision should be a positive, meaningful value within the range [0,1].
66 # In general, the number of segments is calculated with the formula:
67 # nb = ceil((edge_length / l) - p)
68 # Function ceil rounds its argument to the higher integer.
69 # So, p=0 means rounding of (edge_length / l) to the higher integer,
70 # p=0.5 means rounding of (edge_length / l) to the nearest integer,
71 # p=1 means rounding of (edge_length / l) to the lower integer.
72 # Default value is 1e-07.
73 # @return an instance of StdMeshers_LocalLength hypothesis
74 # @ingroup l3_hypos_1dhyps
75 def LocalLength(self, l, UseExisting=0, p=1e-07):
76 comFun=lambda hyp, args: IsEqual(hyp.GetLength(), args[0]) and IsEqual(hyp.GetPrecision(), args[1])
77 hyp = self.Hypothesis("LocalLength", [l,p], UseExisting=UseExisting, CompareMethod=comFun)
82 ## Defines "MaxSize" hypothesis to cut an edge into segments not longer than given value
83 # @param length is optional maximal allowed length of segment, if it is omitted
84 # the preestimated length is used that depends on geometry size
85 # @param UseExisting if ==true - searches for an existing hypothesis created with
86 # the same parameters, else (default) - creates a new one
87 # @return an instance of StdMeshers_MaxLength hypothesis
88 # @ingroup l3_hypos_1dhyps
89 def MaxSize(self, length=0.0, UseExisting=0):
90 hyp = self.Hypothesis("MaxLength", [length], UseExisting=UseExisting)
95 # set preestimated length
96 gen = self.mesh.smeshpyD
97 initHyp = gen.GetHypothesisParameterValues("MaxLength", "libStdMeshersEngine.so",
98 self.mesh.GetMesh(), self.mesh.GetShape(),
100 preHyp = initHyp._narrow(StdMeshers.StdMeshers_MaxLength)
102 hyp.SetPreestimatedLength( preHyp.GetPreestimatedLength() )
105 hyp.SetUsePreestimatedLength( length == 0.0 )
108 ## Defines "NumberOfSegments" hypothesis to cut an edge in a fixed number of segments
109 # @param n for the number of segments that cut an edge
110 # @param s for the scale factor (optional)
111 # @param reversedEdges is a list of edges to mesh using reversed orientation.
112 # A list item can also be a tuple (edge 1st_vertex_of_edge)
113 # @param UseExisting if ==true - searches for an existing hypothesis created with
114 # the same parameters, else (default) - create a new one
115 # @return an instance of StdMeshers_NumberOfSegments hypothesis
116 # @ingroup l3_hypos_1dhyps
117 def NumberOfSegments(self, n, s=[], reversedEdges=[], UseExisting=0):
118 if not isinstance(reversedEdges,list): #old version script, before adding reversedEdges
119 reversedEdges, UseExisting = [], reversedEdges
120 entry = self.MainShapeEntry()
121 reversedEdgeInd = self.ReversedEdgeIndices(reversedEdges)
123 hyp = self.Hypothesis("NumberOfSegments", [n, reversedEdgeInd, entry],
124 UseExisting=UseExisting,
125 CompareMethod=self._compareNumberOfSegments)
127 hyp = self.Hypothesis("NumberOfSegments", [n,s, reversedEdgeInd, entry],
128 UseExisting=UseExisting,
129 CompareMethod=self._compareNumberOfSegments)
130 hyp.SetDistrType( 1 )
131 hyp.SetScaleFactor(s)
132 hyp.SetNumberOfSegments(n)
133 hyp.SetReversedEdges( reversedEdgeInd )
134 hyp.SetObjectEntry( entry )
138 ## Checks if the given "NumberOfSegments" hypothesis has the same parameters as the given arguments
139 def _compareNumberOfSegments(self, hyp, args):
140 if hyp.GetNumberOfSegments() == args[0]:
142 if hyp.GetReversedEdges() == args[1]:
143 if not args[1] or hyp.GetObjectEntry() == args[2]:
146 if hyp.GetReversedEdges() == args[2]:
147 if not args[2] or hyp.GetObjectEntry() == args[3]:
148 if hyp.GetDistrType() == 1:
149 if IsEqual(hyp.GetScaleFactor(), args[1]):
153 ## Defines "Arithmetic1D" hypothesis to cut an edge in several segments with increasing arithmetic length
154 # @param start defines the length of the first segment
155 # @param end defines the length of the last segment
156 # @param reversedEdges is a list of edges to mesh using reversed orientation.
157 # A list item can also be a tuple (edge 1st_vertex_of_edge)
158 # @param UseExisting if ==true - searches for an existing hypothesis created with
159 # the same parameters, else (default) - creates a new one
160 # @return an instance of StdMeshers_Arithmetic1D hypothesis
161 # @ingroup l3_hypos_1dhyps
162 def Arithmetic1D(self, start, end, reversedEdges=[], UseExisting=0):
163 if not isinstance(reversedEdges,list): #old version script, before adding reversedEdges
164 reversedEdges, UseExisting = [], reversedEdges
165 reversedEdgeInd = self.ReversedEdgeIndices(reversedEdges)
166 entry = self.MainShapeEntry()
167 compFun = lambda hyp, args: ( IsEqual(hyp.GetLength(1), args[0]) and \
168 IsEqual(hyp.GetLength(0), args[1]) and \
169 hyp.GetReversedEdges() == args[2] and \
170 (not args[2] or hyp.GetObjectEntry() == args[3]))
171 hyp = self.Hypothesis("Arithmetic1D", [start, end, reversedEdgeInd, entry],
172 UseExisting=UseExisting, CompareMethod=compFun)
173 hyp.SetStartLength(start)
174 hyp.SetEndLength(end)
175 hyp.SetReversedEdges( reversedEdgeInd )
176 hyp.SetObjectEntry( entry )
179 ## Defines "FixedPoints1D" hypothesis to cut an edge using parameter
180 # on curve from 0 to 1 (additionally it is neecessary to check
181 # orientation of edges and create list of reversed edges if it is
182 # needed) and sets numbers of segments between given points (default
183 # values are equals 1
184 # @param points defines the list of parameters on curve
185 # @param nbSegs defines the list of numbers of segments
186 # @param reversedEdges is a list of edges to mesh using reversed orientation.
187 # A list item can also be a tuple (edge 1st_vertex_of_edge)
188 # @param UseExisting if ==true - searches for an existing hypothesis created with
189 # the same parameters, else (default) - creates a new one
190 # @return an instance of StdMeshers_Arithmetic1D hypothesis
191 # @ingroup l3_hypos_1dhyps
192 def FixedPoints1D(self, points, nbSegs=[1], reversedEdges=[], UseExisting=0):
193 if not isinstance(reversedEdges,list): #old version script, before adding reversedEdges
194 reversedEdges, UseExisting = [], reversedEdges
195 reversedEdgeInd = self.ReversedEdgeIndices(reversedEdges)
196 entry = self.MainShapeEntry()
197 compFun = lambda hyp, args: ( hyp.GetPoints() == args[0] and \
198 hyp.GetNbSegments() == args[1] and \
199 hyp.GetReversedEdges() == args[2] and \
200 (not args[2] or hyp.GetObjectEntry() == args[3]))
201 hyp = self.Hypothesis("FixedPoints1D", [points, nbSegs, reversedEdgeInd, entry],
202 UseExisting=UseExisting, CompareMethod=compFun)
203 hyp.SetPoints(points)
204 hyp.SetNbSegments(nbSegs)
205 hyp.SetReversedEdges(reversedEdgeInd)
206 hyp.SetObjectEntry(entry)
209 ## Defines "StartEndLength" hypothesis to cut an edge in several segments with increasing geometric length
210 # @param start defines the length of the first segment
211 # @param end defines the length of the last segment
212 # @param reversedEdges is a list of edges to mesh using reversed orientation.
213 # A list item can also be a tuple (edge 1st_vertex_of_edge)
214 # @param UseExisting if ==true - searches for an existing hypothesis created with
215 # the same parameters, else (default) - creates a new one
216 # @return an instance of StdMeshers_StartEndLength hypothesis
217 # @ingroup l3_hypos_1dhyps
218 def StartEndLength(self, start, end, reversedEdges=[], UseExisting=0):
219 if not isinstance(reversedEdges,list): #old version script, before adding reversedEdges
220 reversedEdges, UseExisting = [], reversedEdges
221 reversedEdgeInd = self.ReversedEdgeIndices(reversedEdges)
222 entry = self.MainShapeEntry()
223 compFun = lambda hyp, args: ( IsEqual(hyp.GetLength(1), args[0]) and \
224 IsEqual(hyp.GetLength(0), args[1]) and \
225 hyp.GetReversedEdges() == args[2] and \
226 (not args[2] or hyp.GetObjectEntry() == args[3]))
227 hyp = self.Hypothesis("StartEndLength", [start, end, reversedEdgeInd, entry],
228 UseExisting=UseExisting, CompareMethod=compFun)
229 hyp.SetStartLength(start)
230 hyp.SetEndLength(end)
231 hyp.SetReversedEdges( reversedEdgeInd )
232 hyp.SetObjectEntry( entry )
235 ## Defines "Deflection1D" hypothesis
236 # @param d for the deflection
237 # @param UseExisting if ==true - searches for an existing hypothesis created with
238 # the same parameters, else (default) - create a new one
239 # @ingroup l3_hypos_1dhyps
240 def Deflection1D(self, d, UseExisting=0):
241 compFun = lambda hyp, args: IsEqual(hyp.GetDeflection(), args[0])
242 hyp = self.Hypothesis("Deflection1D", [d], UseExisting=UseExisting, CompareMethod=compFun)
246 ## Defines "Propagation" hypothesis that propagates all other hypotheses on all other edges that are at
247 # the opposite side in case of quadrangular faces
248 # @ingroup l3_hypos_additi
249 def Propagation(self):
250 return self.Hypothesis("Propagation", UseExisting=1, CompareMethod=self.CompareEqualHyp)
252 ## Defines "AutomaticLength" hypothesis
253 # @param fineness for the fineness [0-1]
254 # @param UseExisting if ==true - searches for an existing hypothesis created with the
255 # same parameters, else (default) - create a new one
256 # @ingroup l3_hypos_1dhyps
257 def AutomaticLength(self, fineness=0, UseExisting=0):
258 compFun = lambda hyp, args: IsEqual(hyp.GetFineness(), args[0])
259 hyp = self.Hypothesis("AutomaticLength",[fineness],UseExisting=UseExisting,
260 CompareMethod=compFun)
261 hyp.SetFineness( fineness )
264 ## Defines "SegmentLengthAroundVertex" hypothesis
265 # @param length for the segment length
266 # @param vertex for the length localization: the vertex index [0,1] | vertex object.
267 # Any other integer value means that the hypothesis will be set on the
268 # whole 1D shape, where Mesh_Segment algorithm is assigned.
269 # @param UseExisting if ==true - searches for an existing hypothesis created with
270 # the same parameters, else (default) - creates a new one
271 # @ingroup l3_algos_segmarv
272 def LengthNearVertex(self, length, vertex=0, UseExisting=0):
274 store_geom = self.geom
275 if type(vertex) is types.IntType:
276 if vertex == 0 or vertex == 1:
278 vertex = self.mesh.geompyD.ExtractShapes(self.geom, geompyDC.ShapeType["VERTEX"],True)[vertex]
286 if self.geom is None:
287 raise RuntimeError, "Attemp to create SegmentAroundVertex_0D algoritm on None shape"
288 AssureGeomPublished( self.mesh, self.geom )
289 name = GetName(self.geom)
291 algo = self.FindAlgorithm("SegmentAroundVertex_0D", self.mesh.smeshpyD)
293 algo = self.mesh.smeshpyD.CreateHypothesis("SegmentAroundVertex_0D", "libStdMeshersEngine.so")
295 status = self.mesh.mesh.AddHypothesis(self.geom, algo)
296 TreatHypoStatus(status, "SegmentAroundVertex_0D", name, True)
298 comFun = lambda hyp, args: IsEqual(hyp.GetLength(), args[0])
299 hyp = self.Hypothesis("SegmentLengthAroundVertex", [length], UseExisting=UseExisting,
300 CompareMethod=comFun)
301 self.geom = store_geom
302 hyp.SetLength( length )
305 ## Defines "QuadraticMesh" hypothesis, forcing construction of quadratic edges.
306 # If the 2D mesher sees that all boundary edges are quadratic,
307 # it generates quadratic faces, else it generates linear faces using
308 # medium nodes as if they are vertices.
309 # The 3D mesher generates quadratic volumes only if all boundary faces
310 # are quadratic, else it fails.
312 # @ingroup l3_hypos_additi
313 def QuadraticMesh(self):
314 hyp = self.Hypothesis("QuadraticMesh", UseExisting=1, CompareMethod=self.CompareEqualHyp)
317 # Public class: Mesh_CompositeSegment
318 # --------------------------
320 ## A regular 1D algorithm for discretization of a set of adjacent edges as one.
321 # It is created by calling Mesh.Segment(COMPOSITE,geom=0)
323 # @ingroup l3_algos_basic
324 class StdMeshersDC_CompositeSegment(StdMeshersDC_Segment):
326 ## Name of method of class Mesh creating an instance of this class
327 meshMethod = "Segment"
328 ## Name of algorithm type
332 ## Private constructor.
333 def __init__(self, mesh, geom=0):
334 self.Create(mesh, geom, self.algoType)
337 # Public class: Mesh_Segment_Python
338 # ---------------------------------
340 ## Defines a segment 1D algorithm for discretization with python function
341 # It is created by calling Mesh.Segment(PYTHON,geom=0)
343 # @ingroup l3_algos_basic
344 class StdMeshersDC_Segment_Python(Mesh_Algorithm):
346 ## Name of method of class Mesh creating an instance of this class
347 meshMethod = "Segment"
348 ## Name of algorithm type
351 ## Private constructor.
352 def __init__(self, mesh, geom=0):
353 import Python1dPlugin
354 self.Create(mesh, geom, self.algoType, "libPython1dEngine.so")
356 ## Defines "PythonSplit1D" hypothesis
357 # @param n for the number of segments that cut an edge
358 # @param func for the python function that calculates the length of all segments
359 # @param UseExisting if ==true - searches for the existing hypothesis created with
360 # the same parameters, else (default) - creates a new one
361 # @ingroup l3_hypos_1dhyps
362 def PythonSplit1D(self, n, func, UseExisting=0):
363 compFun = lambda hyp, args: False
364 hyp = self.Hypothesis("PythonSplit1D", [n], "libPython1dEngine.so",
365 UseExisting=UseExisting, CompareMethod=compFun)
366 hyp.SetNumberOfSegments(n)
367 hyp.SetPythonLog10RatioFunction(func)
370 # Public class: Mesh_Triangle_MEFISTO
371 # -----------------------------------
373 ## Triangle MEFISTO 2D algorithm
374 # It is created by calling Mesh.Triangle(MEFISTO,geom=0)
376 # @ingroup l3_algos_basic
377 class StdMeshersDC_Triangle_MEFISTO(Mesh_Algorithm):
379 ## Name of method of class Mesh creating an instance of this class
380 meshMethod = "Triangle"
381 ## Name of algorithm type
385 ## Private constructor.
386 def __init__(self, mesh, geom=0):
387 Mesh_Algorithm.__init__(self)
388 self.Create(mesh, geom, self.algoType)
390 ## Defines "MaxElementArea" hypothesis basing on the definition of the maximum area of each triangle
391 # @param area for the maximum area of each triangle
392 # @param UseExisting if ==true - searches for an existing hypothesis created with the
393 # same parameters, else (default) - creates a new one
395 # @ingroup l3_hypos_2dhyps
396 def MaxElementArea(self, area, UseExisting=0):
397 comparator = lambda hyp, args: IsEqual(hyp.GetMaxElementArea(), args[0])
398 hyp = self.Hypothesis("MaxElementArea", [area], UseExisting=UseExisting,
399 CompareMethod=comparator)
400 hyp.SetMaxElementArea(area)
403 ## Defines "LengthFromEdges" hypothesis to build triangles
404 # based on the length of the edges taken from the wire
406 # @ingroup l3_hypos_2dhyps
407 def LengthFromEdges(self):
408 hyp = self.Hypothesis("LengthFromEdges", UseExisting=1, CompareMethod=self.CompareEqualHyp)
411 # Public class: Mesh_Quadrangle
412 # -----------------------------
414 ## Defines a quadrangle 2D algorithm
415 # It is created by calling Mesh.Quadrangle(geom=0)
417 # @ingroup l3_algos_basic
418 class StdMeshersDC_Quadrangle(Mesh_Algorithm):
420 ## Name of method of class Mesh creating an instance of this class
421 meshMethod = "Quadrangle"
422 ## Name of algorithm type
423 algoType = QUADRANGLE
428 ## Private constructor.
429 def __init__(self, mesh, geom=0):
430 Mesh_Algorithm.__init__(self)
431 self.Create(mesh, geom, self.algoType)
434 ## Defines "QuadrangleParameters" hypothesis
435 # @param quadType defines the algorithm of transition between differently descretized
436 # sides of a geometrical face:
437 # - QUAD_STANDARD - both triangles and quadrangles are possible in the transition
438 # area along the finer meshed sides.
439 # - QUAD_TRIANGLE_PREF - only triangles are built in the transition area along the
440 # finer meshed sides.
441 # - QUAD_QUADRANGLE_PREF - only quadrangles are built in the transition area along
442 # the finer meshed sides, iff the total quantity of segments on
443 # all four sides of the face is even (divisible by 2).
444 # - QUAD_QUADRANGLE_PREF_REVERSED - same as QUAD_QUADRANGLE_PREF but the transition
445 # area is located along the coarser meshed sides.
446 # - QUAD_REDUCED - only quadrangles are built and the transition between the sides
447 # is made gradually, layer by layer. This type has a limitation on
448 # the number of segments: one pair of opposite sides must have the
449 # same number of segments, the other pair must have an even difference
450 # between the numbers of segments on the sides.
451 # @param triangleVertex: vertex of a trilateral geometrical face, around which triangles
452 # will be created while other elements will be quadrangles.
453 # Vertex can be either a GEOM_Object or a vertex ID within the
455 # @param UseExisting: if ==true - searches for the existing hypothesis created with
456 # the same parameters, else (default) - creates a new one
457 # @ingroup l3_hypos_quad
458 def QuadrangleParameters(self, quadType=StdMeshers.QUAD_STANDARD, triangleVertex=0, UseExisting=0):
460 vertexID = triangleVertex
461 if isinstance( triangleVertex, GEOM._objref_GEOM_Object ):
462 vertexID = self.mesh.geompyD.GetSubShapeID( self.mesh.geom, triangleVertex )
464 compFun = lambda hyp,args: \
465 hyp.GetQuadType() == args[0] and \
466 ( hyp.GetTriaVertex()==args[1] or ( hyp.GetTriaVertex()<1 and args[1]<1))
467 self.params = self.Hypothesis("QuadrangleParams", [quadType,vertexID],
468 UseExisting = UseExisting, CompareMethod=compFun)
470 if self.params.GetQuadType() != quadType:
471 self.params.SetQuadType(quadType)
473 self.params.SetTriaVertex( vertexID )
476 ## Defines "QuadrangleParams" hypothesis with a type of quadrangulation that only
477 # quadrangles are built in the transition area along the finer meshed sides,
478 # iff the total quantity of segments on all four sides of the face is even.
479 # @param reversed if True, transition area is located along the coarser meshed sides.
480 # @param UseExisting: if ==true - searches for the existing hypothesis created with
481 # the same parameters, else (default) - creates a new one
482 # @ingroup l3_hypos_quad
483 def QuadranglePreference(self, reversed=False, UseExisting=0):
485 return self.QuadrangleParameters(QUAD_QUADRANGLE_PREF_REVERSED,UseExisting=UseExisting)
486 return self.QuadrangleParameters(QUAD_QUADRANGLE_PREF,UseExisting=UseExisting)
488 ## Defines "QuadrangleParams" hypothesis with a type of quadrangulation that only
489 # triangles are built in the transition area along the finer meshed sides.
490 # @param UseExisting: if ==true - searches for the existing hypothesis created with
491 # the same parameters, else (default) - creates a new one
492 # @ingroup l3_hypos_quad
493 def TrianglePreference(self, UseExisting=0):
494 return self.QuadrangleParameters(QUAD_TRIANGLE_PREF,UseExisting=UseExisting)
496 ## Defines "QuadrangleParams" hypothesis with a type of quadrangulation that only
497 # quadrangles are built and the transition between the sides is made gradually,
498 # layer by layer. This type has a limitation on the number of segments: one pair
499 # of opposite sides must have the same number of segments, the other pair must
500 # have an even difference between the numbers of segments on the sides.
501 # @param UseExisting: if ==true - searches for the existing hypothesis created with
502 # the same parameters, else (default) - creates a new one
503 # @ingroup l3_hypos_quad
504 def Reduced(self, UseExisting=0):
505 return self.QuadrangleParameters(QUAD_REDUCED,UseExisting=UseExisting)
507 ## Defines "QuadrangleParams" hypothesis with QUAD_STANDARD type of quadrangulation
508 # @param vertex: vertex of a trilateral geometrical face, around which triangles
509 # will be created while other elements will be quadrangles.
510 # Vertex can be either a GEOM_Object or a vertex ID within the
512 # @param UseExisting: if ==true - searches for the existing hypothesis created with
513 # the same parameters, else (default) - creates a new one
514 # @ingroup l3_hypos_quad
515 def TriangleVertex(self, vertex, UseExisting=0):
516 return self.QuadrangleParameters(QUAD_STANDARD,vertex,UseExisting)
519 # Public class: Mesh_Hexahedron
520 # ------------------------------
522 ## Defines a hexahedron 3D algorithm
523 # It is created by calling Mesh.Hexahedron(geom=0)
525 # @ingroup l3_algos_basic
526 class StdMeshersDC_Hexahedron(Mesh_Algorithm):
528 ## Name of method of class Mesh creating an instance of this class
529 meshMethod = "Hexahedron"
530 ## Name of algorithm type
534 ## Private constructor.
535 def __init__(self, mesh, geom=0):
536 Mesh_Algorithm.__init__(self)
537 self.Create(mesh, geom, Hexa)
540 # Public class: Mesh_Projection1D
541 # -------------------------------
543 ## Defines a projection 1D algorithm
544 # It is created by calling Mesh.Projection1D(geom=0)
545 # @ingroup l3_algos_proj
547 class StdMeshersDC_Projection1D(Mesh_Algorithm):
549 ## Name of method of class Mesh creating an instance of this class
550 meshMethod = "Projection1D"
551 ## Name of algorithm type
552 algoType = "Projection_1D"
555 ## Private constructor.
556 def __init__(self, mesh, geom=0):
557 Mesh_Algorithm.__init__(self)
558 self.Create(mesh, geom, self.algoType)
560 ## Defines "Source Edge" hypothesis, specifying a meshed edge, from where
561 # a mesh pattern is taken, and, optionally, the association of vertices
562 # between the source edge and a target edge (to which a hypothesis is assigned)
563 # @param edge from which nodes distribution is taken
564 # @param mesh from which nodes distribution is taken (optional)
565 # @param srcV a vertex of \a edge to associate with \a tgtV (optional)
566 # @param tgtV a vertex of \a the edge to which the algorithm is assigned,
567 # to associate with \a srcV (optional)
568 # @param UseExisting if ==true - searches for the existing hypothesis created with
569 # the same parameters, else (default) - creates a new one
570 def SourceEdge(self, edge, mesh=None, srcV=None, tgtV=None, UseExisting=0):
571 AssureGeomPublished( self.mesh, edge )
572 AssureGeomPublished( self.mesh, srcV )
573 AssureGeomPublished( self.mesh, tgtV )
574 hyp = self.Hypothesis("ProjectionSource1D", [edge,mesh,srcV,tgtV],
576 # it does not seem to be useful to reuse the existing "SourceEdge" hypothesis
577 #UseExisting=UseExisting, CompareMethod=self.CompareSourceEdge)
578 hyp.SetSourceEdge( edge )
579 if not mesh is None and isinstance(mesh, Mesh):
580 mesh = mesh.GetMesh()
581 hyp.SetSourceMesh( mesh )
582 hyp.SetVertexAssociation( srcV, tgtV )
586 # Public class: Mesh_Projection2D
587 # ------------------------------
589 ## Defines a projection 2D algorithm
590 # It is created by calling Mesh.Projection2D(geom=0)
591 # @ingroup l3_algos_proj
593 class StdMeshersDC_Projection2D(Mesh_Algorithm):
595 ## Name of method of class Mesh creating an instance of this class
596 meshMethod = "Projection2D"
597 ## Name of algorithm type
598 algoType = "Projection_2D"
601 ## Private constructor.
602 def __init__(self, mesh, geom=0):
603 Mesh_Algorithm.__init__(self)
604 self.Create(mesh, geom, self.algoType)
606 ## Defines "Source Face" hypothesis, specifying a meshed face, from where
607 # a mesh pattern is taken, and, optionally, the association of vertices
608 # between the source face and the target face (to which a hypothesis is assigned)
609 # @param face from which the mesh pattern is taken
610 # @param mesh from which the mesh pattern is taken (optional)
611 # @param srcV1 a vertex of \a face to associate with \a tgtV1 (optional)
612 # @param tgtV1 a vertex of \a the face to which the algorithm is assigned,
613 # to associate with \a srcV1 (optional)
614 # @param srcV2 a vertex of \a face to associate with \a tgtV1 (optional)
615 # @param tgtV2 a vertex of \a the face to which the algorithm is assigned,
616 # to associate with \a srcV2 (optional)
617 # @param UseExisting if ==true - forces the search for the existing hypothesis created with
618 # the same parameters, else (default) - forces the creation a new one
620 # Note: all association vertices must belong to one edge of a face
621 def SourceFace(self, face, mesh=None, srcV1=None, tgtV1=None,
622 srcV2=None, tgtV2=None, UseExisting=0):
623 from smeshDC import Mesh
624 if isinstance(mesh, Mesh):
625 mesh = mesh.GetMesh()
626 for geom in [ face, srcV1, tgtV1, srcV2, tgtV2 ]:
627 AssureGeomPublished( self.mesh, geom )
628 hyp = self.Hypothesis("ProjectionSource2D", [face,mesh,srcV1,tgtV1,srcV2,tgtV2],
630 # it does not seem to be useful to reuse the existing "SourceFace" hypothesis
631 #UseExisting=UseExisting, CompareMethod=self.CompareSourceFace)
632 hyp.SetSourceFace( face )
633 hyp.SetSourceMesh( mesh )
634 hyp.SetVertexAssociation( srcV1, srcV2, tgtV1, tgtV2 )
637 # Public class: Mesh_Projection1D2D
638 # ---------------------------------
640 ## Defines a projection 1D-2D algorithm
641 # It is created by calling Mesh.Projection1D2D(geom=0)
643 # @ingroup l3_algos_proj
645 class StdMeshersDC_Projection1D2D(StdMeshersDC_Projection2D):
647 ## Name of method of class Mesh creating an instance of this class
648 meshMethod = "Projection1D2D"
649 ## Name of algorithm type
650 algoType = "Projection_1D2D"
652 ## Private constructor.
653 def __init__(self, mesh, geom=0):
654 StdMeshersDC_Projection2D.__init__(self, mesh, geom)
656 # Public class: Mesh_Projection3D
657 # ------------------------------
659 ## Defines a projection 3D algorithm
660 # It is created by calling Mesh.Projection3D(COMPOSITE)
662 # @ingroup l3_algos_proj
664 class StdMeshersDC_Projection3D(Mesh_Algorithm):
666 ## Name of method of class Mesh creating an instance of this class
667 meshMethod = "Projection3D"
668 ## Name of algorithm type
669 algoType = "Projection_3D"
671 ## Private constructor.
672 def __init__(self, mesh, geom=0):
673 Mesh_Algorithm.__init__(self)
674 self.Create(mesh, geom, self.algoType)
676 ## Defines the "Source Shape 3D" hypothesis, specifying a meshed solid, from where
677 # the mesh pattern is taken, and, optionally, the association of vertices
678 # between the source and the target solid (to which a hipothesis is assigned)
679 # @param solid from where the mesh pattern is taken
680 # @param mesh from where the mesh pattern is taken (optional)
681 # @param srcV1 a vertex of \a solid to associate with \a tgtV1 (optional)
682 # @param tgtV1 a vertex of \a the solid where the algorithm is assigned,
683 # to associate with \a srcV1 (optional)
684 # @param srcV2 a vertex of \a solid to associate with \a tgtV1 (optional)
685 # @param tgtV2 a vertex of \a the solid to which the algorithm is assigned,
686 # to associate with \a srcV2 (optional)
687 # @param UseExisting - if ==true - searches for the existing hypothesis created with
688 # the same parameters, else (default) - creates a new one
690 # Note: association vertices must belong to one edge of a solid
691 def SourceShape3D(self, solid, mesh=0, srcV1=0, tgtV1=0,
692 srcV2=0, tgtV2=0, UseExisting=0):
693 for geom in [ solid, srcV1, tgtV1, srcV2, tgtV2 ]:
694 AssureGeomPublished( self.mesh, geom )
695 hyp = self.Hypothesis("ProjectionSource3D",
696 [solid,mesh,srcV1,tgtV1,srcV2,tgtV2],
698 # seems to be not really useful to reuse existing "SourceShape3D" hypothesis
699 #UseExisting=UseExisting, CompareMethod=self.CompareSourceShape3D)
700 hyp.SetSource3DShape( solid )
701 if isinstance(mesh, Mesh):
702 mesh = mesh.GetMesh()
704 hyp.SetSourceMesh( mesh )
705 if srcV1 and srcV2 and tgtV1 and tgtV2:
706 hyp.SetVertexAssociation( srcV1, srcV2, tgtV1, tgtV2 )
707 #elif srcV1 or srcV2 or tgtV1 or tgtV2:
710 # Public class: Mesh_Prism
711 # ------------------------
713 ## Defines a Prism 3D algorithm, which is either "Extrusion 3D" or "Radial Prism"
714 # depending on geometry
715 # It is created by calling Mesh.Prism(geom=0)
717 # @ingroup l3_algos_3dextr
719 class StdMeshersDC_Prism3D(Mesh_Algorithm):
721 ## Name of method of class Mesh creating an instance of this class
723 ## Name of algorithm type
724 algoType = "Prism_3D"
726 ## Private constructor.
727 def __init__(self, mesh, geom=0):
728 Mesh_Algorithm.__init__(self)
733 from geompy import SubShapeAll, ShapeType
734 nbSolids = len( SubShapeAll( shape, ShapeType["SOLID"] ))
735 nbShells = len( SubShapeAll( shape, ShapeType["SHELL"] ))
736 if nbSolids == 0 or nbSolids == nbShells:
737 self.Create(mesh, geom, "Prism_3D")
739 self.algoType = "RadialPrism_3D"
740 self.Create(mesh, geom, "RadialPrism_3D")
741 self.distribHyp = self.Hypothesis("LayerDistribution", UseExisting=0)
744 ## Return 3D hypothesis holding the 1D one
745 def Get3DHypothesis(self):
746 if self.algoType != "RadialPrism_3D":
747 print "Prism_3D algorith doesn't support any hyposesis"
749 return self.distribHyp
751 ## Private method creating a 1D hypothesis and storing it in the LayerDistribution
752 # hypothesis. Returns the created hypothesis
753 def OwnHypothesis(self, hypType, args=[], so="libStdMeshersEngine.so"):
754 if self.algoType != "RadialPrism_3D":
755 print "Prism_3D algorith doesn't support any hyposesis"
757 if not self.nbLayers is None:
758 self.mesh.GetMesh().RemoveHypothesis( self.geom, self.nbLayers )
759 self.mesh.GetMesh().AddHypothesis( self.geom, self.distribHyp )
760 study = self.mesh.smeshpyD.GetCurrentStudy() # prevents publishing own 1D hypothesis
761 self.mesh.smeshpyD.SetCurrentStudy( None )
762 hyp = self.mesh.smeshpyD.CreateHypothesis(hypType, so)
763 self.mesh.smeshpyD.SetCurrentStudy( study ) # enables publishing
764 self.distribHyp.SetLayerDistribution( hyp )
767 ## Defines "NumberOfLayers" hypothesis, specifying the number of layers of
768 # prisms to build between the inner and outer shells
769 # @param n number of layers
770 # @param UseExisting if ==true - searches for the existing hypothesis created with
771 # the same parameters, else (default) - creates a new one
772 def NumberOfLayers(self, n, UseExisting=0):
773 if self.algoType != "RadialPrism_3D":
774 print "Prism_3D algorith doesn't support any hyposesis"
776 self.mesh.RemoveHypothesis( self.distribHyp, self.geom )
777 compFun = lambda hyp, args: IsEqual(hyp.GetNumberOfLayers(), args[0])
778 self.nbLayers = self.Hypothesis("NumberOfLayers", [n], UseExisting=UseExisting,
779 CompareMethod=compFun)
780 self.nbLayers.SetNumberOfLayers( n )
783 ## Defines "LocalLength" hypothesis, specifying the segment length
784 # to build between the inner and the outer shells
785 # @param l the length of segments
786 # @param p the precision of rounding
787 def LocalLength(self, l, p=1e-07):
788 if self.algoType != "RadialPrism_3D":
789 print "Prism_3D algorith doesn't support any hyposesis"
791 hyp = self.OwnHypothesis("LocalLength", [l,p])
796 ## Defines "NumberOfSegments" hypothesis, specifying the number of layers of
797 # prisms to build between the inner and the outer shells.
798 # @param n the number of layers
799 # @param s the scale factor (optional)
800 def NumberOfSegments(self, n, s=[]):
801 if self.algoType != "RadialPrism_3D":
802 print "Prism_3D algorith doesn't support any hyposesis"
805 hyp = self.OwnHypothesis("NumberOfSegments", [n])
807 hyp = self.OwnHypothesis("NumberOfSegments", [n,s])
808 hyp.SetDistrType( 1 )
809 hyp.SetScaleFactor(s)
810 hyp.SetNumberOfSegments(n)
813 ## Defines "Arithmetic1D" hypothesis, specifying the distribution of segments
814 # to build between the inner and the outer shells with a length that changes in arithmetic progression
815 # @param start the length of the first segment
816 # @param end the length of the last segment
817 def Arithmetic1D(self, start, end ):
818 if self.algoType != "RadialPrism_3D":
819 print "Prism_3D algorith doesn't support any hyposesis"
821 hyp = self.OwnHypothesis("Arithmetic1D", [start, end])
822 hyp.SetLength(start, 1)
823 hyp.SetLength(end , 0)
826 ## Defines "StartEndLength" hypothesis, specifying distribution of segments
827 # to build between the inner and the outer shells as geometric length increasing
828 # @param start for the length of the first segment
829 # @param end for the length of the last segment
830 def StartEndLength(self, start, end):
831 if self.algoType != "RadialPrism_3D":
832 print "Prism_3D algorith doesn't support any hyposesis"
834 hyp = self.OwnHypothesis("StartEndLength", [start, end])
835 hyp.SetLength(start, 1)
836 hyp.SetLength(end , 0)
839 ## Defines "AutomaticLength" hypothesis, specifying the number of segments
840 # to build between the inner and outer shells
841 # @param fineness defines the quality of the mesh within the range [0-1]
842 def AutomaticLength(self, fineness=0):
843 if self.algoType != "RadialPrism_3D":
844 print "Prism_3D algorith doesn't support any hyposesis"
846 hyp = self.OwnHypothesis("AutomaticLength")
847 hyp.SetFineness( fineness )
851 # Public class: Mesh_RadialQuadrangle1D2D
852 # -------------------------------
854 ## Defines a Radial Quadrangle 1D2D algorithm
855 # It is created by calling Mesh.Quadrangle(RADIAL_QUAD,geom=0)
857 # @ingroup l2_algos_radialq
858 class StdMeshersDC_RadialQuadrangle1D2D(Mesh_Algorithm):
860 ## Name of method of class Mesh creating an instance of this class
861 meshMethod = "Quadrangle"
862 ## Name of algorithm type
863 algoType = RADIAL_QUAD
865 ## Private constructor.
866 def __init__(self, mesh, geom=0):
867 Mesh_Algorithm.__init__(self)
868 self.Create(mesh, geom, self.algoType)
870 self.distribHyp = None #self.Hypothesis("LayerDistribution2D", UseExisting=0)
873 ## Return 2D hypothesis holding the 1D one
874 def Get2DHypothesis(self):
875 if not self.distribHyp:
876 self.distribHyp = self.Hypothesis("LayerDistribution2D", UseExisting=0)
877 return self.distribHyp
879 ## Private method creating a 1D hypothesis and storing it in the LayerDistribution
880 # hypothesis. Returns the created hypothesis
881 def OwnHypothesis(self, hypType, args=[], so="libStdMeshersEngine.so"):
883 self.mesh.GetMesh().RemoveHypothesis( self.geom, self.nbLayers )
884 if self.distribHyp is None:
885 self.distribHyp = self.Hypothesis("LayerDistribution2D", UseExisting=0)
887 self.mesh.GetMesh().AddHypothesis( self.geom, self.distribHyp )
888 study = self.mesh.smeshpyD.GetCurrentStudy() # prevents publishing own 1D hypothesis
889 self.mesh.smeshpyD.SetCurrentStudy( None )
890 hyp = self.mesh.smeshpyD.CreateHypothesis(hypType, so)
891 self.mesh.smeshpyD.SetCurrentStudy( study ) # enables publishing
892 self.distribHyp.SetLayerDistribution( hyp )
895 ## Defines "NumberOfLayers" hypothesis, specifying the number of layers
896 # @param n number of layers
897 # @param UseExisting if ==true - searches for the existing hypothesis created with
898 # the same parameters, else (default) - creates a new one
899 def NumberOfLayers(self, n, UseExisting=0):
901 self.mesh.GetMesh().RemoveHypothesis( self.geom, self.distribHyp )
902 compFun = lambda hyp, args: IsEqual(hyp.GetNumberOfLayers(), args[0])
903 self.nbLayers = self.Hypothesis("NumberOfLayers2D", [n], UseExisting=UseExisting,
904 CompareMethod=compFun)
905 self.nbLayers.SetNumberOfLayers( n )
908 ## Defines "LocalLength" hypothesis, specifying the segment length
909 # @param l the length of segments
910 # @param p the precision of rounding
911 def LocalLength(self, l, p=1e-07):
912 hyp = self.OwnHypothesis("LocalLength", [l,p])
917 ## Defines "NumberOfSegments" hypothesis, specifying the number of layers
918 # @param n the number of layers
919 # @param s the scale factor (optional)
920 def NumberOfSegments(self, n, s=[]):
922 hyp = self.OwnHypothesis("NumberOfSegments", [n])
924 hyp = self.OwnHypothesis("NumberOfSegments", [n,s])
925 hyp.SetDistrType( 1 )
926 hyp.SetScaleFactor(s)
927 hyp.SetNumberOfSegments(n)
930 ## Defines "Arithmetic1D" hypothesis, specifying the distribution of segments
931 # with a length that changes in arithmetic progression
932 # @param start the length of the first segment
933 # @param end the length of the last segment
934 def Arithmetic1D(self, start, end ):
935 hyp = self.OwnHypothesis("Arithmetic1D", [start, end])
936 hyp.SetLength(start, 1)
937 hyp.SetLength(end , 0)
940 ## Defines "StartEndLength" hypothesis, specifying distribution of segments
941 # as geometric length increasing
942 # @param start for the length of the first segment
943 # @param end for the length of the last segment
944 def StartEndLength(self, start, end):
945 hyp = self.OwnHypothesis("StartEndLength", [start, end])
946 hyp.SetLength(start, 1)
947 hyp.SetLength(end , 0)
950 ## Defines "AutomaticLength" hypothesis, specifying the number of segments
951 # @param fineness defines the quality of the mesh within the range [0-1]
952 def AutomaticLength(self, fineness=0):
953 hyp = self.OwnHypothesis("AutomaticLength")
954 hyp.SetFineness( fineness )
958 # Public class: Mesh_UseExistingElements
959 # --------------------------------------
960 ## Defines a Radial Quadrangle 1D2D algorithm
961 # It is created by calling Mesh.UseExisting1DElements(geom=0)
963 # @ingroup l3_algos_basic
964 class StdMeshersDC_UseExistingElements_1D(Mesh_Algorithm):
966 ## Name of method of class Mesh creating an instance of this class
967 meshMethod = "UseExisting1DElements"
968 ## Name of algorithm type
969 algoType = "Import_1D"
972 def __init__(self, mesh, geom=0):
973 Mesh_Algorithm.__init__(self)
974 self.Create(mesh, geom, self.algoType)
977 ## Defines "Source edges" hypothesis, specifying groups of edges to import
978 # @param groups list of groups of edges
979 # @param toCopyMesh if True, the whole mesh \a groups belong to is imported
980 # @param toCopyGroups if True, all groups of the mesh \a groups belong to are imported
981 # @param UseExisting if ==true - searches for the existing hypothesis created with
982 # the same parameters, else (default) - creates a new one
983 def SourceEdges(self, groups, toCopyMesh=False, toCopyGroups=False, UseExisting=False):
985 AssureGeomPublished( self.mesh, group )
986 compFun = lambda hyp, args: ( hyp.GetSourceEdges() == args[0] and \
987 hyp.GetCopySourceMesh() == args[1], args[2] )
988 hyp = self.Hypothesis("ImportSource1D", [groups, toCopyMesh, toCopyGroups],
989 UseExisting=UseExisting, CompareMethod=compFun)
990 hyp.SetSourceEdges(groups)
991 hyp.SetCopySourceMesh(toCopyMesh, toCopyGroups)
994 # Public class: Mesh_UseExistingElements
995 # --------------------------------------
996 ## Defines a Radial Quadrangle 1D2D algorithm
997 # It is created by calling Mesh.UseExisting2DElements(geom=0)
999 # @ingroup l3_algos_basic
1000 class StdMeshersDC_UseExistingElements_1D2D(Mesh_Algorithm):
1002 ## Name of method of class Mesh creating an instance of this class
1003 meshMethod = "UseExisting2DElements"
1004 ## Name of algorithm type
1005 algoType = "Import_1D2D"
1008 def __init__(self, mesh, geom=0):
1009 Mesh_Algorithm.__init__(self)
1010 self.Create(mesh, geom, self.algoType)
1013 ## Defines "Source faces" hypothesis, specifying groups of faces to import
1014 # @param groups list of groups of faces
1015 # @param toCopyMesh if True, the whole mesh \a groups belong to is imported
1016 # @param toCopyGroups if True, all groups of the mesh \a groups belong to are imported
1017 # @param UseExisting if ==true - searches for the existing hypothesis created with
1018 # the same parameters, else (default) - creates a new one
1019 def SourceFaces(self, groups, toCopyMesh=False, toCopyGroups=False, UseExisting=False):
1020 for group in groups:
1021 AssureGeomPublished( self.mesh, group )
1022 compFun = lambda hyp, args: ( hyp.GetSourceFaces() == args[0] and \
1023 hyp.GetCopySourceMesh() == args[1], args[2] )
1024 hyp = self.Hypothesis("ImportSource2D", [groups, toCopyMesh, toCopyGroups],
1025 UseExisting=UseExisting, CompareMethod=compFun)
1026 hyp.SetSourceFaces(groups)
1027 hyp.SetCopySourceMesh(toCopyMesh, toCopyGroups)
1031 # Public class: Mesh_Cartesian_3D
1032 # --------------------------------------
1033 ## Defines a Body Fitting 3D algorithm
1034 # It is created by calling Mesh.BodyFitted(geom=0)
1036 # @ingroup l3_algos_basic
1037 class StdMeshersDC_Cartesian_3D(Mesh_Algorithm):
1039 ## Name of method of class Mesh creating an instance of this class
1040 meshMethod = "BodyFitted"
1041 ## Name of algorithm type
1042 algoType = "Cartesian_3D"
1045 def __init__(self, mesh, geom=0):
1046 self.Create(mesh, geom, self.algoType)
1050 ## Defines "Body Fitting parameters" hypothesis
1051 # @param xGridDef is definition of the grid along the X asix.
1052 # It can be in either of two following forms:
1053 # - Explicit coordinates of nodes, e.g. [-1.5, 0.0, 3.1] or range( -100,200,10)
1054 # - Functions f(t) defining grid spacing at each point on grid axis. If there are
1055 # several functions, they must be accompanied by relative coordinates of
1056 # points dividing the whole shape into ranges where the functions apply; points
1057 # coodrinates should vary within (0.0, 1.0) range. Parameter \a t of the spacing
1058 # function f(t) varies from 0.0 to 1.0 witin a shape range.
1060 # - "10.5" - defines a grid with a constant spacing
1061 # - [["1", "1+10*t", "11"] [0.1, 0.6]] - defines different spacing in 3 ranges.
1062 # @param yGridDef defines the grid along the Y asix the same way as \a xGridDef does
1063 # @param zGridDef defines the grid along the Z asix the same way as \a xGridDef does
1064 # @param sizeThreshold (> 1.0) defines a minimal size of a polyhedron so that
1065 # a polyhedron of size less than hexSize/sizeThreshold is not created
1066 # @param UseExisting if ==true - searches for the existing hypothesis created with
1067 # the same parameters, else (default) - creates a new one
1068 def SetGrid(self, xGridDef, yGridDef, zGridDef, sizeThreshold=4.0, UseExisting=False):
1070 compFun = lambda hyp, args: False
1071 self.hyp = self.Hypothesis("CartesianParameters3D",
1072 [xGridDef, yGridDef, zGridDef, sizeThreshold],
1073 UseExisting=UseExisting, CompareMethod=compFun)
1074 if not self.mesh.IsUsedHypothesis( self.hyp, self.geom ):
1075 self.mesh.AddHypothesis( self.hyp, self.geom )
1077 for axis, gridDef in enumerate( [xGridDef, yGridDef, zGridDef]):
1078 if not gridDef: raise ValueError, "Empty grid definition"
1079 if isinstance( gridDef, str ):
1080 self.hyp.SetGridSpacing( [gridDef], [], axis )
1081 elif isinstance( gridDef[0], str ):
1082 self.hyp.SetGridSpacing( gridDef, [], axis )
1083 elif isinstance( gridDef[0], int ) or \
1084 isinstance( gridDef[0], float ):
1085 self.hyp.SetGrid(gridDef, axis )
1087 self.hyp.SetGridSpacing( gridDef[0], gridDef[1], axis )
1088 self.hyp.SetSizeThreshold( sizeThreshold )
1091 # Public class: Mesh_UseExisting_1D
1092 # ---------------------------------
1093 ## Defines a stub 1D algorithm, which enables "manual" creation of nodes and
1094 # segments usable by 2D algoritms
1095 # It is created by calling Mesh.UseExistingSegments(geom=0)
1097 # @ingroup l3_algos_basic
1099 class StdMeshersDC_UseExisting_1D(Mesh_Algorithm):
1101 ## Name of method of class Mesh creating an instance of this class
1102 meshMethod = "UseExistingSegments"
1103 ## Name of algorithm type
1104 algoType = "UseExisting_1D"
1106 def __init__(self, mesh, geom=0):
1107 self.Create(mesh, geom, self.algoType)
1110 # Public class: Mesh_UseExisting
1111 # -------------------------------
1112 ## Defines a stub 2D algorithm, which enables "manual" creation of nodes and
1113 # faces usable by 3D algoritms
1114 # It is created by calling Mesh.UseExistingFaces(geom=0)
1116 # @ingroup l3_algos_basic
1118 class StdMeshersDC_UseExisting_2D(Mesh_Algorithm):
1120 ## Name of method of class Mesh creating an instance of this class
1121 meshMethod = "UseExistingFaces"
1122 ## Name of algorithm type
1123 algoType = "UseExisting_2D"
1125 def __init__(self, mesh, geom=0):
1126 self.Create(mesh, geom, self.algoType)