- ## Checks if the given "MaxElementVolume" hypothesis has the same parameters as the given arguments
- def CompareMaxElementVolume(self, hyp, args):
- return IsEqual(hyp.GetMaxElementVolume(), args[0])
-
- ## Defines hypothesis having several parameters
- #
- # @ingroup l3_hypos_netgen
- def Parameters(self, which=SOLE):
- if not self.params:
-
- if self.algoType == FULL_NETGEN:
- if which == SIMPLE:
- self.params = self.Hypothesis("NETGEN_SimpleParameters_3D", [],
- "libNETGENEngine.so", UseExisting=0)
- else:
- self.params = self.Hypothesis("NETGEN_Parameters", [],
- "libNETGENEngine.so", UseExisting=0)
-
- if self.algoType == NETGEN:
- self.params = self.Hypothesis("NETGEN_Parameters_3D", [],
- "libNETGENEngine.so", UseExisting=0)
-
- elif self.algoType == GHS3D:
- self.params = self.Hypothesis("GHS3D_Parameters", [],
- "libGHS3DEngine.so", UseExisting=0)
-
- elif self.algoType == GHS3DPRL:
- self.params = self.Hypothesis("GHS3DPRL_Parameters", [],
- "libGHS3DPRLEngine.so", UseExisting=0)
- else:
- print "Algo supports no multi-parameter hypothesis"
-
- return self.params
-
- ## Sets MaxSize
- # Parameter of FULL_NETGEN and NETGEN
- # @ingroup l3_hypos_netgen
- def SetMaxSize(self, theSize):
- self.Parameters().SetMaxSize(theSize)
-
- ## Sets SecondOrder flag
- # Parameter of FULL_NETGEN
- # @ingroup l3_hypos_netgen
- def SetSecondOrder(self, theVal):
- self.Parameters().SetSecondOrder(theVal)
-
- ## Sets Optimize flag
- # Parameter of FULL_NETGEN and NETGEN
- # @ingroup l3_hypos_netgen
- def SetOptimize(self, theVal):
- self.Parameters().SetOptimize(theVal)
-
- ## Sets Fineness
- # @param theFineness is:
- # VeryCoarse, Coarse, Moderate, Fine, VeryFine or Custom
- # Parameter of FULL_NETGEN
- # @ingroup l3_hypos_netgen
- def SetFineness(self, theFineness):
- self.Parameters().SetFineness(theFineness)
-
- ## Sets GrowthRate
- # Parameter of FULL_NETGEN
- # @ingroup l3_hypos_netgen
- def SetGrowthRate(self, theRate):
- self.Parameters().SetGrowthRate(theRate)
-
- ## Sets NbSegPerEdge
- # Parameter of FULL_NETGEN
- # @ingroup l3_hypos_netgen
- def SetNbSegPerEdge(self, theVal):
- self.Parameters().SetNbSegPerEdge(theVal)
-
- ## Sets NbSegPerRadius
- # Parameter of FULL_NETGEN
- # @ingroup l3_hypos_netgen
- def SetNbSegPerRadius(self, theVal):
- self.Parameters().SetNbSegPerRadius(theVal)
-
- ## Sets number of segments overriding value set by SetLocalLength()
- # Only for algoType == NETGEN_FULL
- # @ingroup l3_hypos_netgen
- def SetNumberOfSegments(self, theVal):
- self.Parameters(SIMPLE).SetNumberOfSegments(theVal)
-
- ## Sets number of segments overriding value set by SetNumberOfSegments()
- # Only for algoType == NETGEN_FULL
- # @ingroup l3_hypos_netgen
- def SetLocalLength(self, theVal):
- self.Parameters(SIMPLE).SetLocalLength(theVal)
-
- ## Defines "MaxElementArea" parameter of NETGEN_SimpleParameters_3D hypothesis.
- # Overrides value set by LengthFromEdges()
- # Only for algoType == NETGEN_FULL
- # @ingroup l3_hypos_netgen
- def MaxElementArea(self, area):
- self.Parameters(SIMPLE).SetMaxElementArea(area)
-
- ## Defines "LengthFromEdges" parameter of NETGEN_SimpleParameters_3D hypothesis
- # Overrides value set by MaxElementArea()
- # Only for algoType == NETGEN_FULL
- # @ingroup l3_hypos_netgen
- def LengthFromEdges(self):
- self.Parameters(SIMPLE).LengthFromEdges()
-
- ## Defines "LengthFromFaces" parameter of NETGEN_SimpleParameters_3D hypothesis
- # Overrides value set by MaxElementVolume()
- # Only for algoType == NETGEN_FULL
- # @ingroup l3_hypos_netgen
- def LengthFromFaces(self):
- self.Parameters(SIMPLE).LengthFromFaces()
-
- ## To mesh "holes" in a solid or not. Default is to mesh.
- # @ingroup l3_hypos_ghs3dh
- def SetToMeshHoles(self, toMesh):
- # Parameter of GHS3D
- self.Parameters().SetToMeshHoles(toMesh)
-
- ## Set Optimization level:
- # None_Optimization, Light_Optimization, Standard_Optimization, StandardPlus_Optimization,
- # Strong_Optimization.
- # Default is Standard_Optimization
- # @ingroup l3_hypos_ghs3dh
- def SetOptimizationLevel(self, level):
- # Parameter of GHS3D
- self.Parameters().SetOptimizationLevel(level)
-
- ## Maximal size of memory to be used by the algorithm (in Megabytes).
- # @ingroup l3_hypos_ghs3dh
- def SetMaximumMemory(self, MB):
- # Advanced parameter of GHS3D
- self.Parameters().SetMaximumMemory(MB)
-
- ## Initial size of memory to be used by the algorithm (in Megabytes) in
- # automatic memory adjustment mode.
- # @ingroup l3_hypos_ghs3dh
- def SetInitialMemory(self, MB):
- # Advanced parameter of GHS3D
- self.Parameters().SetInitialMemory(MB)
-
- ## Path to working directory.
- # @ingroup l3_hypos_ghs3dh
- def SetWorkingDirectory(self, path):
- # Advanced parameter of GHS3D
- self.Parameters().SetWorkingDirectory(path)
-
- ## To keep working files or remove them. Log file remains in case of errors anyway.
- # @ingroup l3_hypos_ghs3dh
- def SetKeepFiles(self, toKeep):
- # Advanced parameter of GHS3D and GHS3DPRL
- self.Parameters().SetKeepFiles(toKeep)
-
- ## To set verbose level [0-10]. <ul>
- #<li> 0 - no standard output,
- #<li> 2 - prints the data, quality statistics of the skin and final meshes and
- # indicates when the final mesh is being saved. In addition the software
- # gives indication regarding the CPU time.
- #<li>10 - same as 2 plus the main steps in the computation, quality statistics
- # histogram of the skin mesh, quality statistics histogram together with
- # the characteristics of the final mesh.</ul>
- # @ingroup l3_hypos_ghs3dh
- def SetVerboseLevel(self, level):
- # Advanced parameter of GHS3D
- self.Parameters().SetVerboseLevel(level)
-
- ## To create new nodes.
- # @ingroup l3_hypos_ghs3dh
- def SetToCreateNewNodes(self, toCreate):
- # Advanced parameter of GHS3D
- self.Parameters().SetToCreateNewNodes(toCreate)
-
- ## To use boundary recovery version which tries to create mesh on a very poor
- # quality surface mesh.
- # @ingroup l3_hypos_ghs3dh
- def SetToUseBoundaryRecoveryVersion(self, toUse):
- # Advanced parameter of GHS3D
- self.Parameters().SetToUseBoundaryRecoveryVersion(toUse)
-
- ## Sets command line option as text.
- # @ingroup l3_hypos_ghs3dh
- def SetTextOption(self, option):
- # Advanced parameter of GHS3D
- self.Parameters().SetTextOption(option)
-
- ## Sets MED files name and path.
- def SetMEDName(self, value):
- self.Parameters().SetMEDName(value)
-
- ## Sets the number of partition of the initial mesh
- def SetNbPart(self, value):
- self.Parameters().SetNbPart(value)
-
- ## When big mesh, start tepal in background
- def SetBackground(self, value):
- self.Parameters().SetBackground(value)
-
-# Public class: Mesh_Hexahedron
-# ------------------------------
-
-## Defines a hexahedron 3D algorithm
-#
-# @ingroup l3_algos_basic
-class Mesh_Hexahedron(Mesh_Algorithm):
-
- params = 0
- algoType = 0
-
- ## Private constructor.
- def __init__(self, mesh, algoType=Hexa, geom=0):
- Mesh_Algorithm.__init__(self)
-
- self.algoType = algoType
-
- if algoType == Hexa:
- self.Create(mesh, geom, "Hexa_3D")
- pass
-
- elif algoType == Hexotic:
- CheckPlugin(Hexotic)
- self.Create(mesh, geom, "Hexotic_3D", "libHexoticEngine.so")
- pass
-
- ## Defines "MinMaxQuad" hypothesis to give three hexotic parameters
- # @ingroup l3_hypos_hexotic
- def MinMaxQuad(self, min=3, max=8, quad=True):
- self.params = self.Hypothesis("Hexotic_Parameters", [], "libHexoticEngine.so",
- UseExisting=0)
- self.params.SetHexesMinLevel(min)
- self.params.SetHexesMaxLevel(max)
- self.params.SetHexoticQuadrangles(quad)
- return self.params
-
-# Deprecated, only for compatibility!
-# Public class: Mesh_Netgen
-# ------------------------------
-
-## Defines a NETGEN-based 2D or 3D algorithm
-# that needs no discrete boundary (i.e. independent)
-#
-# This class is deprecated, only for compatibility!
-#
-# More details.
-# @ingroup l3_algos_basic
-class Mesh_Netgen(Mesh_Algorithm):
-
- is3D = 0
-
- ## Private constructor.
- def __init__(self, mesh, is3D, geom=0):
- Mesh_Algorithm.__init__(self)
-
- CheckPlugin(NETGEN)
-
- self.is3D = is3D
- if is3D:
- self.Create(mesh, geom, "NETGEN_2D3D", "libNETGENEngine.so")
- pass
-
- else:
- self.Create(mesh, geom, "NETGEN_2D", "libNETGENEngine.so")
- pass
-
- ## Defines the hypothesis containing parameters of the algorithm
- def Parameters(self):
- if self.is3D:
- hyp = self.Hypothesis("NETGEN_Parameters", [],
- "libNETGENEngine.so", UseExisting=0)
- else:
- hyp = self.Hypothesis("NETGEN_Parameters_2D", [],
- "libNETGENEngine.so", UseExisting=0)
- return hyp
-
-# Public class: Mesh_Projection1D
-# ------------------------------
-
-## Defines a projection 1D algorithm
-# @ingroup l3_algos_proj
-#
-class Mesh_Projection1D(Mesh_Algorithm):
-
- ## Private constructor.
- def __init__(self, mesh, geom=0):
- Mesh_Algorithm.__init__(self)
- self.Create(mesh, geom, "Projection_1D")
-
- ## Defines "Source Edge" hypothesis, specifying a meshed edge, from where
- # a mesh pattern is taken, and, optionally, the association of vertices
- # between the source edge and a target edge (to which a hypothesis is assigned)
- # @param edge from which nodes distribution is taken
- # @param mesh from which nodes distribution is taken (optional)
- # @param srcV a vertex of \a edge to associate with \a tgtV (optional)
- # @param tgtV a vertex of \a the edge to which the algorithm is assigned,
- # to associate with \a srcV (optional)
- # @param UseExisting if ==true - searches for the existing hypothesis created with
- # the same parameters, else (default) - creates a new one
- def SourceEdge(self, edge, mesh=None, srcV=None, tgtV=None, UseExisting=0):
- hyp = self.Hypothesis("ProjectionSource1D", [edge,mesh,srcV,tgtV],
- UseExisting=0)
- #UseExisting=UseExisting, CompareMethod=self.CompareSourceEdge)
- hyp.SetSourceEdge( edge )
- if not mesh is None and isinstance(mesh, Mesh):
- mesh = mesh.GetMesh()
- hyp.SetSourceMesh( mesh )
- hyp.SetVertexAssociation( srcV, tgtV )
- return hyp
-
- ## Checks if the given "SourceEdge" hypothesis has the same parameters as the given arguments
- #def CompareSourceEdge(self, hyp, args):
- # # it does not seem to be useful to reuse the existing "SourceEdge" hypothesis
- # return False
-
-
-# Public class: Mesh_Projection2D
-# ------------------------------
-
-## Defines a projection 2D algorithm
-# @ingroup l3_algos_proj
-#
-class Mesh_Projection2D(Mesh_Algorithm):
-
- ## Private constructor.
- def __init__(self, mesh, geom=0):
- Mesh_Algorithm.__init__(self)
- self.Create(mesh, geom, "Projection_2D")
-
- ## Defines "Source Face" hypothesis, specifying a meshed face, from where
- # a mesh pattern is taken, and, optionally, the association of vertices
- # between the source face and the target face (to which a hypothesis is assigned)
- # @param face from which the mesh pattern is taken
- # @param mesh from which the mesh pattern is taken (optional)
- # @param srcV1 a vertex of \a face to associate with \a tgtV1 (optional)
- # @param tgtV1 a vertex of \a the face to which the algorithm is assigned,
- # to associate with \a srcV1 (optional)
- # @param srcV2 a vertex of \a face to associate with \a tgtV1 (optional)
- # @param tgtV2 a vertex of \a the face to which the algorithm is assigned,
- # to associate with \a srcV2 (optional)
- # @param UseExisting if ==true - forces the search for the existing hypothesis created with
- # the same parameters, else (default) - forces the creation a new one
- #
- # Note: all association vertices must belong to one edge of a face
- def SourceFace(self, face, mesh=None, srcV1=None, tgtV1=None,
- srcV2=None, tgtV2=None, UseExisting=0):
- hyp = self.Hypothesis("ProjectionSource2D", [face,mesh,srcV1,tgtV1,srcV2,tgtV2],
- UseExisting=0)
- #UseExisting=UseExisting, CompareMethod=self.CompareSourceFace)
- hyp.SetSourceFace( face )
- if not mesh is None and isinstance(mesh, Mesh):
- mesh = mesh.GetMesh()
- hyp.SetSourceMesh( mesh )
- hyp.SetVertexAssociation( srcV1, srcV2, tgtV1, tgtV2 )
- return hyp
-
- ## Checks if the given "SourceFace" hypothesis has the same parameters as the given arguments
- #def CompareSourceFace(self, hyp, args):
- # # it does not seem to be useful to reuse the existing "SourceFace" hypothesis
- # return False
-
-# Public class: Mesh_Projection3D
-# ------------------------------
-
-## Defines a projection 3D algorithm
-# @ingroup l3_algos_proj
-#
-class Mesh_Projection3D(Mesh_Algorithm):
-
- ## Private constructor.
- def __init__(self, mesh, geom=0):
- Mesh_Algorithm.__init__(self)
- self.Create(mesh, geom, "Projection_3D")
-
- ## Defines the "Source Shape 3D" hypothesis, specifying a meshed solid, from where
- # the mesh pattern is taken, and, optionally, the association of vertices
- # between the source and the target solid (to which a hipothesis is assigned)
- # @param solid from where the mesh pattern is taken
- # @param mesh from where the mesh pattern is taken (optional)
- # @param srcV1 a vertex of \a solid to associate with \a tgtV1 (optional)
- # @param tgtV1 a vertex of \a the solid where the algorithm is assigned,
- # to associate with \a srcV1 (optional)
- # @param srcV2 a vertex of \a solid to associate with \a tgtV1 (optional)
- # @param tgtV2 a vertex of \a the solid to which the algorithm is assigned,
- # to associate with \a srcV2 (optional)
- # @param UseExisting - if ==true - searches for the existing hypothesis created with
- # the same parameters, else (default) - creates a new one
- #
- # Note: association vertices must belong to one edge of a solid
- def SourceShape3D(self, solid, mesh=0, srcV1=0, tgtV1=0,
- srcV2=0, tgtV2=0, UseExisting=0):
- hyp = self.Hypothesis("ProjectionSource3D",
- [solid,mesh,srcV1,tgtV1,srcV2,tgtV2],
- UseExisting=0)
- #UseExisting=UseExisting, CompareMethod=self.CompareSourceShape3D)
- hyp.SetSource3DShape( solid )
- if not mesh is None and isinstance(mesh, Mesh):
- mesh = mesh.GetMesh()
- hyp.SetSourceMesh( mesh )
- if srcV1 and srcV2 and tgtV1 and tgtV2:
- hyp.SetVertexAssociation( srcV1, srcV2, tgtV1, tgtV2 )
- #elif srcV1 or srcV2 or tgtV1 or tgtV2:
- return hyp
-
- ## Checks if the given "SourceShape3D" hypothesis has the same parameters as given arguments
- #def CompareSourceShape3D(self, hyp, args):
- # # seems to be not really useful to reuse existing "SourceShape3D" hypothesis
- # return False
-
-
-# Public class: Mesh_Prism
-# ------------------------
-
-## Defines a 3D extrusion algorithm
-# @ingroup l3_algos_3dextr
-#
-class Mesh_Prism3D(Mesh_Algorithm):
-
- ## Private constructor.
- def __init__(self, mesh, geom=0):
- Mesh_Algorithm.__init__(self)
- self.Create(mesh, geom, "Prism_3D")
-
-# Public class: Mesh_RadialPrism
-# -------------------------------
-
-## Defines a Radial Prism 3D algorithm
-# @ingroup l3_algos_radialp
-#
-class Mesh_RadialPrism3D(Mesh_Algorithm):
-
- ## Private constructor.
- def __init__(self, mesh, geom=0):
- Mesh_Algorithm.__init__(self)
- self.Create(mesh, geom, "RadialPrism_3D")
-
- self.distribHyp = self.Hypothesis("LayerDistribution", UseExisting=0)
- self.nbLayers = None
-
- ## Return 3D hypothesis holding the 1D one
- def Get3DHypothesis(self):
- return self.distribHyp
-
- ## Private method creating a 1D hypothesis and storing it in the LayerDistribution
- # hypothesis. Returns the created hypothesis
- def OwnHypothesis(self, hypType, args=[], so="libStdMeshersEngine.so"):
- #print "OwnHypothesis",hypType
- if not self.nbLayers is None:
- self.mesh.GetMesh().RemoveHypothesis( self.geom, self.nbLayers )
- self.mesh.GetMesh().AddHypothesis( self.geom, self.distribHyp )
- study = self.mesh.smeshpyD.GetCurrentStudy() # prevents publishing own 1D hypothesis
- self.mesh.smeshpyD.SetCurrentStudy( None )
- hyp = self.mesh.smeshpyD.CreateHypothesis(hypType, so)
- self.mesh.smeshpyD.SetCurrentStudy( study ) # enables publishing
- self.distribHyp.SetLayerDistribution( hyp )
- return hyp
-
- ## Defines "NumberOfLayers" hypothesis, specifying the number of layers of
- # prisms to build between the inner and outer shells
- # @param n number of layers
- # @param UseExisting if ==true - searches for the existing hypothesis created with
- # the same parameters, else (default) - creates a new one
- def NumberOfLayers(self, n, UseExisting=0):
- self.mesh.GetMesh().RemoveHypothesis( self.geom, self.distribHyp )
- self.nbLayers = self.Hypothesis("NumberOfLayers", [n], UseExisting=UseExisting,
- CompareMethod=self.CompareNumberOfLayers)
- self.nbLayers.SetNumberOfLayers( n )
- return self.nbLayers
-
- ## Checks if the given "NumberOfLayers" hypothesis has the same parameters as the given arguments
- def CompareNumberOfLayers(self, hyp, args):
- return IsEqual(hyp.GetNumberOfLayers(), args[0])
-
- ## Defines "LocalLength" hypothesis, specifying the segment length
- # to build between the inner and the outer shells
- # @param l the length of segments
- # @param p the precision of rounding
- def LocalLength(self, l, p=1e-07):
- hyp = self.OwnHypothesis("LocalLength", [l,p])
- hyp.SetLength(l)
- hyp.SetPrecision(p)
- return hyp
-
- ## Defines "NumberOfSegments" hypothesis, specifying the number of layers of
- # prisms to build between the inner and the outer shells.
- # @param n the number of layers
- # @param s the scale factor (optional)
- def NumberOfSegments(self, n, s=[]):
- if s == []:
- hyp = self.OwnHypothesis("NumberOfSegments", [n])
- else:
- hyp = self.OwnHypothesis("NumberOfSegments", [n,s])
- hyp.SetDistrType( 1 )
- hyp.SetScaleFactor(s)
- hyp.SetNumberOfSegments(n)
- return hyp
-
- ## Defines "Arithmetic1D" hypothesis, specifying the distribution of segments
- # to build between the inner and the outer shells with a length that changes in arithmetic progression
- # @param start the length of the first segment
- # @param end the length of the last segment
- def Arithmetic1D(self, start, end ):
- hyp = self.OwnHypothesis("Arithmetic1D", [start, end])
- hyp.SetLength(start, 1)
- hyp.SetLength(end , 0)
- return hyp
-
- ## Defines "StartEndLength" hypothesis, specifying distribution of segments
- # to build between the inner and the outer shells as geometric length increasing
- # @param start for the length of the first segment
- # @param end for the length of the last segment
- def StartEndLength(self, start, end):
- hyp = self.OwnHypothesis("StartEndLength", [start, end])
- hyp.SetLength(start, 1)
- hyp.SetLength(end , 0)
- return hyp
-
- ## Defines "AutomaticLength" hypothesis, specifying the number of segments
- # to build between the inner and outer shells
- # @param fineness defines the quality of the mesh within the range [0-1]
- def AutomaticLength(self, fineness=0):
- hyp = self.OwnHypothesis("AutomaticLength")
- hyp.SetFineness( fineness )
- return hyp
-
-# Public class: Mesh_RadialQuadrangle1D2D
-# -------------------------------
-
-## Defines a Radial Quadrangle 1D2D algorithm
-# @ingroup l2_algos_radialq
-#
-class Mesh_RadialQuadrangle1D2D(Mesh_Algorithm):
-
- ## Private constructor.
- def __init__(self, mesh, geom=0):
- Mesh_Algorithm.__init__(self)
- self.Create(mesh, geom, "RadialQuadrangle_1D2D")
-
- self.distribHyp = None #self.Hypothesis("LayerDistribution2D", UseExisting=0)
- self.nbLayers = None
-
- ## Return 2D hypothesis holding the 1D one
- def Get2DHypothesis(self):
- return self.distribHyp
-
- ## Private method creating a 1D hypothesis and storing it in the LayerDistribution
- # hypothesis. Returns the created hypothesis
- def OwnHypothesis(self, hypType, args=[], so="libStdMeshersEngine.so"):
- #print "OwnHypothesis",hypType
- if self.nbLayers:
- self.mesh.GetMesh().RemoveHypothesis( self.geom, self.nbLayers )
- if self.distribHyp is None:
- self.distribHyp = self.Hypothesis("LayerDistribution2D", UseExisting=0)
- else:
- self.mesh.GetMesh().AddHypothesis( self.geom, self.distribHyp )
- study = self.mesh.smeshpyD.GetCurrentStudy() # prevents publishing own 1D hypothesis
- self.mesh.smeshpyD.SetCurrentStudy( None )
- hyp = self.mesh.smeshpyD.CreateHypothesis(hypType, so)
- self.mesh.smeshpyD.SetCurrentStudy( study ) # enables publishing
- self.distribHyp.SetLayerDistribution( hyp )
- return hyp
-
- ## Defines "NumberOfLayers" hypothesis, specifying the number of layers
- # @param n number of layers
- # @param UseExisting if ==true - searches for the existing hypothesis created with
- # the same parameters, else (default) - creates a new one
- def NumberOfLayers(self, n, UseExisting=0):
- if self.distribHyp:
- self.mesh.GetMesh().RemoveHypothesis( self.geom, self.distribHyp )
- self.nbLayers = self.Hypothesis("NumberOfLayers2D", [n], UseExisting=UseExisting,
- CompareMethod=self.CompareNumberOfLayers)
- self.nbLayers.SetNumberOfLayers( n )
- return self.nbLayers
-
- ## Checks if the given "NumberOfLayers" hypothesis has the same parameters as the given arguments
- def CompareNumberOfLayers(self, hyp, args):
- return IsEqual(hyp.GetNumberOfLayers(), args[0])
-
- ## Defines "LocalLength" hypothesis, specifying the segment length
- # @param l the length of segments
- # @param p the precision of rounding
- def LocalLength(self, l, p=1e-07):
- hyp = self.OwnHypothesis("LocalLength", [l,p])
- hyp.SetLength(l)
- hyp.SetPrecision(p)
- return hyp
-
- ## Defines "NumberOfSegments" hypothesis, specifying the number of layers
- # @param n the number of layers
- # @param s the scale factor (optional)
- def NumberOfSegments(self, n, s=[]):
- if s == []:
- hyp = self.OwnHypothesis("NumberOfSegments", [n])
- else:
- hyp = self.OwnHypothesis("NumberOfSegments", [n,s])
- hyp.SetDistrType( 1 )
- hyp.SetScaleFactor(s)
- hyp.SetNumberOfSegments(n)
- return hyp
-
- ## Defines "Arithmetic1D" hypothesis, specifying the distribution of segments
- # with a length that changes in arithmetic progression
- # @param start the length of the first segment
- # @param end the length of the last segment
- def Arithmetic1D(self, start, end ):
- hyp = self.OwnHypothesis("Arithmetic1D", [start, end])
- hyp.SetLength(start, 1)
- hyp.SetLength(end , 0)
- return hyp
-
- ## Defines "StartEndLength" hypothesis, specifying distribution of segments
- # as geometric length increasing
- # @param start for the length of the first segment
- # @param end for the length of the last segment
- def StartEndLength(self, start, end):
- hyp = self.OwnHypothesis("StartEndLength", [start, end])
- hyp.SetLength(start, 1)
- hyp.SetLength(end , 0)
- return hyp
-
- ## Defines "AutomaticLength" hypothesis, specifying the number of segments
- # @param fineness defines the quality of the mesh within the range [0-1]
- def AutomaticLength(self, fineness=0):
- hyp = self.OwnHypothesis("AutomaticLength")
- hyp.SetFineness( fineness )
- return hyp
-
-
-# Public class: Mesh_UseExistingElements
-# --------------------------------------
-## Defines a Radial Quadrangle 1D2D algorithm
-# @ingroup l3_algos_basic
-#
-class Mesh_UseExistingElements(Mesh_Algorithm):
-
- def __init__(self, dim, mesh, geom=0):
- if dim == 1:
- self.Create(mesh, geom, "Import_1D")
- else:
- self.Create(mesh, geom, "Import_1D2D")