- ## Sets MaxSize
- # Parameter of FULL_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
- # @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, Medium_Optimization, Strong_Optimization.
- # Default is Medium_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:
- import HexoticPlugin
- 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)
-
- if noNETGENPlugin:
- print "Warning: NETGENPlugin module has not been imported."
-
- 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
- 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 = 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 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
- hyp = self.mesh.smeshpyD.CreateHypothesis(hypType, so)
- self.mesh.smeshpyD.SetCurrentStudy( study ) # enables publishing
- self.distribHyp.SetLayerDistribution( hyp )
- return hyp
-
- ## Defines "NumberOfLayers2D" 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 NumberOfLayers2D(self, n, UseExisting=0):
- 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
-
-
-# Private class: Mesh_UseExisting
-# -------------------------------
-class Mesh_UseExisting(Mesh_Algorithm):
-
- def __init__(self, dim, mesh, geom=0):
- if dim == 1:
- self.Create(mesh, geom, "UseExisting_1D")
- else:
- self.Create(mesh, geom, "UseExisting_2D")
-
-
-import salome_notebook
-notebook = salome_notebook.notebook
-
-##Return values of the notebook variables
-def ParseParameters(last, nbParams,nbParam, value):
- result = None
- strResult = ""
- counter = 0
- listSize = len(last)
- for n in range(0,nbParams):
- if n+1 != nbParam:
- if counter < listSize:
- strResult = strResult + last[counter]
- else:
- strResult = strResult + ""
- else:
- if isinstance(value, str):
- if notebook.isVariable(value):
- result = notebook.get(value)
- strResult=strResult+value
- else:
- raise RuntimeError, "Variable with name '" + value + "' doesn't exist!!!"
- else:
- strResult=strResult+str(value)
- result = value
- if nbParams - 1 != counter:
- strResult=strResult+var_separator #":"
- counter = counter+1
- return result, strResult
-
-#Wrapper class for StdMeshers_LocalLength hypothesis
-class LocalLength(StdMeshers._objref_StdMeshers_LocalLength):
-
- ## Set Length parameter value
- # @param length numerical value or name of variable from notebook
- def SetLength(self, length):
- length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_LocalLength.GetLastParameters(self),2,1,length)
- StdMeshers._objref_StdMeshers_LocalLength.SetParameters(self,parameters)
- StdMeshers._objref_StdMeshers_LocalLength.SetLength(self,length)
-
- ## Set Precision parameter value
- # @param precision numerical value or name of variable from notebook
- def SetPrecision(self, precision):
- precision,parameters = ParseParameters(StdMeshers._objref_StdMeshers_LocalLength.GetLastParameters(self),2,2,precision)
- StdMeshers._objref_StdMeshers_LocalLength.SetParameters(self,parameters)
- StdMeshers._objref_StdMeshers_LocalLength.SetPrecision(self, precision)
-
-#Registering the new proxy for LocalLength
-omniORB.registerObjref(StdMeshers._objref_StdMeshers_LocalLength._NP_RepositoryId, LocalLength)
-
-
-#Wrapper class for StdMeshers_LayerDistribution hypothesis
-class LayerDistribution(StdMeshers._objref_StdMeshers_LayerDistribution):
-
- def SetLayerDistribution(self, hypo):
- StdMeshers._objref_StdMeshers_LayerDistribution.SetParameters(self,hypo.GetParameters())
- hypo.ClearParameters();
- StdMeshers._objref_StdMeshers_LayerDistribution.SetLayerDistribution(self,hypo)
-
-#Registering the new proxy for LayerDistribution
-omniORB.registerObjref(StdMeshers._objref_StdMeshers_LayerDistribution._NP_RepositoryId, LayerDistribution)
-
-#Wrapper class for StdMeshers_SegmentLengthAroundVertex hypothesis
-class SegmentLengthAroundVertex(StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex):
-
- ## Set Length parameter value
- # @param length numerical value or name of variable from notebook
- def SetLength(self, length):
- length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex.GetLastParameters(self),1,1,length)
- StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex.SetParameters(self,parameters)
- StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex.SetLength(self,length)
-
-#Registering the new proxy for SegmentLengthAroundVertex
-omniORB.registerObjref(StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex._NP_RepositoryId, SegmentLengthAroundVertex)
-
-
-#Wrapper class for StdMeshers_Arithmetic1D hypothesis
-class Arithmetic1D(StdMeshers._objref_StdMeshers_Arithmetic1D):
-
- ## Set Length parameter value
- # @param length numerical value or name of variable from notebook
- # @param isStart true is length is Start Length, otherwise false
- def SetLength(self, length, isStart):
- nb = 2
- if isStart:
- nb = 1
- length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_Arithmetic1D.GetLastParameters(self),2,nb,length)
- StdMeshers._objref_StdMeshers_Arithmetic1D.SetParameters(self,parameters)
- StdMeshers._objref_StdMeshers_Arithmetic1D.SetLength(self,length,isStart)
-
-#Registering the new proxy for Arithmetic1D
-omniORB.registerObjref(StdMeshers._objref_StdMeshers_Arithmetic1D._NP_RepositoryId, Arithmetic1D)
-
-#Wrapper class for StdMeshers_Deflection1D hypothesis
-class Deflection1D(StdMeshers._objref_StdMeshers_Deflection1D):
-
- ## Set Deflection parameter value
- # @param deflection numerical value or name of variable from notebook
- def SetDeflection(self, deflection):
- deflection,parameters = ParseParameters(StdMeshers._objref_StdMeshers_Deflection1D.GetLastParameters(self),1,1,deflection)
- StdMeshers._objref_StdMeshers_Deflection1D.SetParameters(self,parameters)
- StdMeshers._objref_StdMeshers_Deflection1D.SetDeflection(self,deflection)
-
-#Registering the new proxy for Deflection1D
-omniORB.registerObjref(StdMeshers._objref_StdMeshers_Deflection1D._NP_RepositoryId, Deflection1D)
-
-#Wrapper class for StdMeshers_StartEndLength hypothesis
-class StartEndLength(StdMeshers._objref_StdMeshers_StartEndLength):
-
- ## Set Length parameter value
- # @param length numerical value or name of variable from notebook
- # @param isStart true is length is Start Length, otherwise false
- def SetLength(self, length, isStart):
- nb = 2
- if isStart:
- nb = 1
- length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_StartEndLength.GetLastParameters(self),2,nb,length)
- StdMeshers._objref_StdMeshers_StartEndLength.SetParameters(self,parameters)
- StdMeshers._objref_StdMeshers_StartEndLength.SetLength(self,length,isStart)
-
-#Registering the new proxy for StartEndLength
-omniORB.registerObjref(StdMeshers._objref_StdMeshers_StartEndLength._NP_RepositoryId, StartEndLength)
-
-#Wrapper class for StdMeshers_MaxElementArea hypothesis
-class MaxElementArea(StdMeshers._objref_StdMeshers_MaxElementArea):
-
- ## Set Max Element Area parameter value
- # @param area numerical value or name of variable from notebook
- def SetMaxElementArea(self, area):
- area ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_MaxElementArea.GetLastParameters(self),1,1,area)
- StdMeshers._objref_StdMeshers_MaxElementArea.SetParameters(self,parameters)
- StdMeshers._objref_StdMeshers_MaxElementArea.SetMaxElementArea(self,area)
-
-#Registering the new proxy for MaxElementArea
-omniORB.registerObjref(StdMeshers._objref_StdMeshers_MaxElementArea._NP_RepositoryId, MaxElementArea)
-
-
-#Wrapper class for StdMeshers_MaxElementVolume hypothesis
-class MaxElementVolume(StdMeshers._objref_StdMeshers_MaxElementVolume):
-
- ## Set Max Element Volume parameter value
- # @param area numerical value or name of variable from notebook
- def SetMaxElementVolume(self, volume):
- volume ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_MaxElementVolume.GetLastParameters(self),1,1,volume)
- StdMeshers._objref_StdMeshers_MaxElementVolume.SetParameters(self,parameters)
- StdMeshers._objref_StdMeshers_MaxElementVolume.SetMaxElementVolume(self,volume)
-
-#Registering the new proxy for MaxElementVolume
-omniORB.registerObjref(StdMeshers._objref_StdMeshers_MaxElementVolume._NP_RepositoryId, MaxElementVolume)
-
-
-#Wrapper class for StdMeshers_NumberOfLayers hypothesis
-class NumberOfLayers(StdMeshers._objref_StdMeshers_NumberOfLayers):
-
- ## Set Number Of Layers parameter value
- # @param nbLayers numerical value or name of variable from notebook
- def SetNumberOfLayers(self, nbLayers):
- nbLayers ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_NumberOfLayers.GetLastParameters(self),1,1,nbLayers)
- StdMeshers._objref_StdMeshers_NumberOfLayers.SetParameters(self,parameters)
- StdMeshers._objref_StdMeshers_NumberOfLayers.SetNumberOfLayers(self,nbLayers)
-
-#Registering the new proxy for NumberOfLayers
-omniORB.registerObjref(StdMeshers._objref_StdMeshers_NumberOfLayers._NP_RepositoryId, NumberOfLayers)
-
-#Wrapper class for StdMeshers_NumberOfSegments hypothesis
-class NumberOfSegments(StdMeshers._objref_StdMeshers_NumberOfSegments):
-
- ## Set Number Of Segments parameter value
- # @param nbSeg numerical value or name of variable from notebook
- def SetNumberOfSegments(self, nbSeg):
- lastParameters = StdMeshers._objref_StdMeshers_NumberOfSegments.GetLastParameters(self)
- nbSeg , parameters = ParseParameters(lastParameters,1,1,nbSeg)
- StdMeshers._objref_StdMeshers_NumberOfSegments.SetParameters(self,parameters)
- StdMeshers._objref_StdMeshers_NumberOfSegments.SetNumberOfSegments(self,nbSeg)
-
- ## Set Scale Factor parameter value
- # @param factor numerical value or name of variable from notebook
- def SetScaleFactor(self, factor):
- factor, parameters = ParseParameters(StdMeshers._objref_StdMeshers_NumberOfSegments.GetLastParameters(self),2,2,factor)
- StdMeshers._objref_StdMeshers_NumberOfSegments.SetParameters(self,parameters)
- StdMeshers._objref_StdMeshers_NumberOfSegments.SetScaleFactor(self,factor)
-
-#Registering the new proxy for NumberOfSegments
-omniORB.registerObjref(StdMeshers._objref_StdMeshers_NumberOfSegments._NP_RepositoryId, NumberOfSegments)
-
-
-#Wrapper class for NETGENPlugin_Hypothesis hypothesis
-class NETGENPlugin_Hypothesis(NETGENPlugin._objref_NETGENPlugin_Hypothesis):
-
- ## Set Max Size parameter value
- # @param maxsize numerical value or name of variable from notebook
- def SetMaxSize(self, maxsize):
- lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
- maxsize, parameters = ParseParameters(lastParameters,4,1,maxsize)
- NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
- NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetMaxSize(self,maxsize)
-
- ## Set Growth Rate parameter value
- # @param value numerical value or name of variable from notebook
- def SetGrowthRate(self, value):
- lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
- value, parameters = ParseParameters(lastParameters,4,2,value)
- NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
- NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetGrowthRate(self,value)
-
- ## Set Number of Segments per Edge parameter value
- # @param value numerical value or name of variable from notebook
- def SetNbSegPerEdge(self, value):
- lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
- value, parameters = ParseParameters(lastParameters,4,3,value)
- NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
- NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetNbSegPerEdge(self,value)
-
- ## Set Number of Segments per Radius parameter value
- # @param value numerical value or name of variable from notebook
- def SetNbSegPerRadius(self, value):
- lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
- value, parameters = ParseParameters(lastParameters,4,4,value)
- NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
- NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetNbSegPerRadius(self,value)
-
-#Registering the new proxy for NETGENPlugin_Hypothesis
-omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_Hypothesis._NP_RepositoryId, NETGENPlugin_Hypothesis)
-
-
-#Wrapper class for NETGENPlugin_Hypothesis_2D hypothesis
-class NETGENPlugin_Hypothesis_2D(NETGENPlugin_Hypothesis,NETGENPlugin._objref_NETGENPlugin_Hypothesis_2D):
- pass
-
-#Registering the new proxy for NETGENPlugin_Hypothesis_2D
-omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_Hypothesis_2D._NP_RepositoryId, NETGENPlugin_Hypothesis_2D)
-
-#Wrapper class for NETGENPlugin_SimpleHypothesis_2D hypothesis
-class NETGEN_SimpleParameters_2D(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D):
-
- ## Set Number of Segments parameter value
- # @param nbSeg numerical value or name of variable from notebook
- def SetNumberOfSegments(self, nbSeg):
- lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
- nbSeg, parameters = ParseParameters(lastParameters,2,1,nbSeg)
- NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
- NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetNumberOfSegments(self, nbSeg)
-
- ## Set Local Length parameter value
- # @param length numerical value or name of variable from notebook
- def SetLocalLength(self, length):
- lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
- length, parameters = ParseParameters(lastParameters,2,1,length)
- NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
- NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetLocalLength(self, length)
-
- ## Set Max Element Area parameter value
- # @param area numerical value or name of variable from notebook
- def SetMaxElementArea(self, area):
- lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
- area, parameters = ParseParameters(lastParameters,2,2,area)
- NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
- NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetMaxElementArea(self, area)
-
- def LengthFromEdges(self):
- lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
- value = 0;
- value, parameters = ParseParameters(lastParameters,2,2,value)
- NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
- NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.LengthFromEdges(self)
-
-#Registering the new proxy for NETGEN_SimpleParameters_2D
-omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D._NP_RepositoryId, NETGEN_SimpleParameters_2D)
-
-
-#Wrapper class for NETGENPlugin_SimpleHypothesis_3D hypothesis
-class NETGEN_SimpleParameters_3D(NETGEN_SimpleParameters_2D,NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D):
- ## Set Max Element Volume parameter value
- # @param volume numerical value or name of variable from notebook
- def SetMaxElementVolume(self, volume):
- lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.GetLastParameters(self)
- volume, parameters = ParseParameters(lastParameters,3,3,volume)
- NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetParameters(self,parameters)
- NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetMaxElementVolume(self, volume)
-
- def LengthFromFaces(self):
- lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.GetLastParameters(self)
- value = 0;
- value, parameters = ParseParameters(lastParameters,3,3,value)
- NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetParameters(self,parameters)
- NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.LengthFromFaces(self)
-
-#Registering the new proxy for NETGEN_SimpleParameters_3D
-omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D._NP_RepositoryId, NETGEN_SimpleParameters_3D)
-
-class Pattern(SMESH._objref_SMESH_Pattern):