Version: 6.3.1
Public Member Functions | Data Fields

smeshDC.Mesh_RadialPrism3D Class Reference

Defines a Radial Prism 3D algorithm. More...

Inheritance diagram for smeshDC.Mesh_RadialPrism3D:
Inheritance graph
[legend]

Public Member Functions

def __init__
 Private constructor.
def Get3DHypothesis
 Return 3D hypothesis holding the 1D one.
def OwnHypothesis
 Private method creating a 1D hypothesis and storing it in the LayerDistribution hypothesis.
def NumberOfLayers
 Defines "NumberOfLayers" hypothesis, specifying the number of layers of prisms to build between the inner and outer shells.
def CompareNumberOfLayers
 Checks if the given "NumberOfLayers" hypothesis has the same parameters as the given arguments.
def LocalLength
 Defines "LocalLength" hypothesis, specifying the segment length to build between the inner and the outer shells.
def NumberOfSegments
 Defines "NumberOfSegments" hypothesis, specifying the number of layers of prisms to build between the inner and the outer shells.
def Arithmetic1D
 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.
def StartEndLength
 Defines "StartEndLength" hypothesis, specifying distribution of segments to build between the inner and the outer shells as geometric length increasing.
def AutomaticLength
 Defines "AutomaticLength" hypothesis, specifying the number of segments to build between the inner and outer shells.
def FindHypothesis
 Finds a hypothesis in the study by its type name and parameters.
def FindAlgorithm
 Finds the algorithm in the study by its type name.
def GetSubMesh
 If the algorithm is global, returns 0;
else returns the submesh associated to this algorithm.
def GetAlgorithm
 Returns the wrapped mesher.
def GetCompatibleHypothesis
 Gets the list of hypothesis that can be used with this algorithm.
def GetName
 Gets the name of the algorithm.
def SetName
 Sets the name to the algorithm.
def GetId
 Gets the id of the algorithm.
def Create
 Private method.
def Assign
 Private method.
def CompareHyp
def CompareEqualHyp
def Hypothesis
 Private method.
def MainShapeEntry
 Returns entry of the shape to mesh in the study.
def ViscousLayers
 Defines "ViscousLayers" hypothesis to give parameters of layers of prisms to build near mesh boundary.

Data Fields

 distribHyp
 nbLayers
 mesh
 geom
 subm
 algo

Detailed Description

Defines a Radial Prism 3D algorithm.

Definition at line 5831 of file smeshDC.py.


Constructor & Destructor Documentation

def smeshDC.Mesh_RadialPrism3D.__init__ (   self,
  mesh,
  geom = 0 
)

Private constructor.

Definition at line 5834 of file smeshDC.py.

05835                                     :
05836         Mesh_Algorithm.__init__(self)
05837         self.Create(mesh, geom, "RadialPrism_3D")
05838 
05839         self.distribHyp = self.Hypothesis("LayerDistribution", UseExisting=0)
05840         self.nbLayers = None


Member Function Documentation

def smeshDC.Mesh_RadialPrism3D.Arithmetic1D (   self,
  start,
  end 
)

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.

Parameters:
startthe length of the first segment
endthe length of the last segment

Definition at line 5903 of file smeshDC.py.

05904                                        :
05905         hyp = self.OwnHypothesis("Arithmetic1D", [start, end])
05906         hyp.SetLength(start, 1)
05907         hyp.SetLength(end  , 0)
05908         return hyp

def smeshDC.Mesh_Algorithm.Assign (   self,
  algo,
  mesh,
  geom 
) [inherited]

Private method.

Definition at line 4403 of file smeshDC.py.

04404                                       :
04405         if geom is None:
04406             raise RuntimeError, "Attemp to create " + algo + " algoritm on None shape"
04407         self.mesh = mesh
04408         name = ""
04409         if not geom:
04410             self.geom = mesh.geom
04411         else:
04412             self.geom = geom
04413             AssureGeomPublished( mesh, geom )
04414             try:
04415                 name = GetName(geom)
04416                 pass
04417             except:
04418                 pass
04419             self.subm = mesh.mesh.GetSubMesh(geom, algo.GetName())
04420         self.algo = algo
04421         status = mesh.mesh.AddHypothesis(self.geom, self.algo)
04422         TreatHypoStatus( status, algo.GetName(), name, True )
04423         return

def smeshDC.Mesh_RadialPrism3D.AutomaticLength (   self,
  fineness = 0 
)

Defines "AutomaticLength" hypothesis, specifying the number of segments to build between the inner and outer shells.

Parameters:
finenessdefines the quality of the mesh within the range [0-1]

Definition at line 5922 of file smeshDC.py.

05923                                          :
05924         hyp = self.OwnHypothesis("AutomaticLength")
05925         hyp.SetFineness( fineness )
05926         return hyp
05927 
05928 # Public class: Mesh_RadialQuadrangle1D2D
05929 # -------------------------------

def smeshDC.Mesh_Algorithm.CompareEqualHyp (   self,
  hyp,
  args 
) [inherited]

Definition at line 4428 of file smeshDC.py.

04429                                          :
04430         return True

def smeshDC.Mesh_Algorithm.CompareHyp (   self,
  hyp,
  args 
) [inherited]

Definition at line 4424 of file smeshDC.py.

04425                                     :
04426         print "CompareHyp is not implemented for ", self.__class__.__name__, ":", hyp.GetName()
04427         return False

def smeshDC.Mesh_RadialPrism3D.CompareNumberOfLayers (   self,
  hyp,
  args 
)

Checks if the given "NumberOfLayers" hypothesis has the same parameters as the given arguments.

Definition at line 5872 of file smeshDC.py.

05873                                               :
05874         return IsEqual(hyp.GetNumberOfLayers(), args[0])

def smeshDC.Mesh_Algorithm.Create (   self,
  mesh,
  geom,
  hypo,
  so = "libStdMeshersEngine.so" 
) [inherited]

Private method.

Definition at line 4392 of file smeshDC.py.

04393                                                                    :
04394         if geom is None:
04395             raise RuntimeError, "Attemp to create " + hypo + " algoritm on None shape"
04396         algo = self.FindAlgorithm(hypo, mesh.smeshpyD)
04397         if algo is None:
04398             algo = mesh.smeshpyD.CreateHypothesis(hypo, so)
04399             pass
04400         self.Assign(algo, mesh, geom)
04401         return self.algo

def smeshDC.Mesh_Algorithm.FindAlgorithm (   self,
  algoname,
  smeshpyD 
) [inherited]

Finds the algorithm in the study by its type name.

Finds only the algorithms, which have been created in smeshpyD engine.

Returns:
SMESH.SMESH_Algo

Definition at line 4327 of file smeshDC.py.

04328                                                 :
04329         study = smeshpyD.GetCurrentStudy()
04330         #to do: find component by smeshpyD object, not by its data type
04331         scomp = study.FindComponent(smeshpyD.ComponentDataType())
04332         if scomp is not None:
04333             res,hypRoot = scomp.FindSubObject(SMESH.Tag_AlgorithmsRoot)
04334             # Check if the root label of the algorithms exists
04335             if res and hypRoot is not None:
04336                 iter = study.NewChildIterator(hypRoot)
04337                 # Check all published algorithms
04338                 while iter.More():
04339                     algo_so_i = iter.Value()
04340                     attr = algo_so_i.FindAttribute("AttributeIOR")[1]
04341                     if attr is not None:
04342                         anIOR = attr.Value()
04343                         algo_o_i = salome.orb.string_to_object(anIOR)
04344                         if algo_o_i is not None:
04345                             # Check if this is an algorithm
04346                             algo_i = algo_o_i._narrow(SMESH.SMESH_Algo)
04347                             if algo_i is not None:
04348                                 # Checks if the algorithm belongs to the current engine
04349                                 if smeshpyD.GetObjectId(algo_i) > 0:
04350                                     # Check if this is the required algorithm
04351                                     if algo_i.GetName() == algoname:
04352                                         # found!!!
04353                                         return algo_i
04354                                     pass
04355                                 pass
04356                             pass
04357                         pass
04358                     iter.Next()
04359                     pass
04360                 pass
04361             pass
04362         return None

def smeshDC.Mesh_Algorithm.FindHypothesis (   self,
  hypname,
  args,
  CompareMethod,
  smeshpyD 
) [inherited]

Finds a hypothesis in the study by its type name and parameters.

Finds only the hypotheses created in smeshpyD engine.

Returns:
SMESH.SMESH_Hypothesis

Definition at line 4285 of file smeshDC.py.

04286                                                                      :
04287         study = smeshpyD.GetCurrentStudy()
04288         #to do: find component by smeshpyD object, not by its data type
04289         scomp = study.FindComponent(smeshpyD.ComponentDataType())
04290         if scomp is not None:
04291             res,hypRoot = scomp.FindSubObject(SMESH.Tag_HypothesisRoot)
04292             # Check if the root label of the hypotheses exists
04293             if res and hypRoot is not None:
04294                 iter = study.NewChildIterator(hypRoot)
04295                 # Check all published hypotheses
04296                 while iter.More():
04297                     hypo_so_i = iter.Value()
04298                     attr = hypo_so_i.FindAttribute("AttributeIOR")[1]
04299                     if attr is not None:
04300                         anIOR = attr.Value()
04301                         hypo_o_i = salome.orb.string_to_object(anIOR)
04302                         if hypo_o_i is not None:
04303                             # Check if this is a hypothesis
04304                             hypo_i = hypo_o_i._narrow(SMESH.SMESH_Hypothesis)
04305                             if hypo_i is not None:
04306                                 # Check if the hypothesis belongs to current engine
04307                                 if smeshpyD.GetObjectId(hypo_i) > 0:
04308                                     # Check if this is the required hypothesis
04309                                     if hypo_i.GetName() == hypname:
04310                                         # Check arguments
04311                                         if CompareMethod(hypo_i, args):
04312                                             # found!!!
04313                                             return hypo_i
04314                                         pass
04315                                     pass
04316                                 pass
04317                             pass
04318                         pass
04319                     iter.Next()
04320                     pass
04321                 pass
04322             pass
04323         return None

def smeshDC.Mesh_RadialPrism3D.Get3DHypothesis (   self)

Return 3D hypothesis holding the 1D one.

Definition at line 5842 of file smeshDC.py.

05843                              :
05844         return self.distribHyp

def smeshDC.Mesh_Algorithm.GetAlgorithm (   self) [inherited]

Returns the wrapped mesher.

Definition at line 4369 of file smeshDC.py.

04370                           :
04371         return self.algo

def smeshDC.Mesh_Algorithm.GetCompatibleHypothesis (   self) [inherited]

Gets the list of hypothesis that can be used with this algorithm.

Definition at line 4373 of file smeshDC.py.

04374                                      :
04375         mylist = []
04376         if self.algo:
04377             mylist = self.algo.GetCompatibleHypothesis()
04378         return mylist

def smeshDC.Mesh_Algorithm.GetId (   self) [inherited]

Gets the id of the algorithm.

Definition at line 4388 of file smeshDC.py.

04389                    :
04390         return self.algo.GetId()

def smeshDC.Mesh_Algorithm.GetName (   self) [inherited]

Gets the name of the algorithm.

Definition at line 4380 of file smeshDC.py.

04381                      :
04382         GetName(self.algo)

def smeshDC.Mesh_Algorithm.GetSubMesh (   self) [inherited]

If the algorithm is global, returns 0;
else returns the submesh associated to this algorithm.

Definition at line 4365 of file smeshDC.py.

04366                         :
04367         return self.subm

def smeshDC.Mesh_Algorithm.Hypothesis (   self,
  hyp,
  args = [],
  so = "libStdMeshersEngine.so",
  UseExisting = 0,
  CompareMethod = "" 
) [inherited]

Private method.

Definition at line 4432 of file smeshDC.py.

04434                                                     :
04435         hypo = None
04436         if UseExisting:
04437             if CompareMethod == "": CompareMethod = self.CompareHyp
04438             hypo = self.FindHypothesis(hyp, args, CompareMethod, self.mesh.smeshpyD)
04439             pass
04440         if hypo is None:
04441             hypo = self.mesh.smeshpyD.CreateHypothesis(hyp, so)
04442             a = ""
04443             s = "="
04444             i = 0
04445             n = len(args)
04446             while i<n:
04447                 a = a + s + str(args[i])
04448                 s = ","
04449                 i = i + 1
04450                 pass
04451             self.mesh.smeshpyD.SetName(hypo, hyp + a)
04452             pass
04453         geomName=""
04454         if self.geom:
04455             geomName = GetName(self.geom)
04456         status = self.mesh.mesh.AddHypothesis(self.geom, hypo)
04457         TreatHypoStatus( status, GetName(hypo), geomName, 0 )
04458         return hypo

def smeshDC.Mesh_RadialPrism3D.LocalLength (   self,
  l,
  p = 1e-07 
)

Defines "LocalLength" hypothesis, specifying the segment length to build between the inner and the outer shells.

Parameters:
lthe length of segments
pthe precision of rounding

Definition at line 5879 of file smeshDC.py.

05880                                      :
05881         hyp = self.OwnHypothesis("LocalLength", [l,p])
05882         hyp.SetLength(l)
05883         hyp.SetPrecision(p)
05884         return hyp

def smeshDC.Mesh_Algorithm.MainShapeEntry (   self) [inherited]

Returns entry of the shape to mesh in the study.

Definition at line 4460 of file smeshDC.py.

04461                             :
04462         entry = ""
04463         if not self.mesh or not self.mesh.GetMesh(): return entry
04464         if not self.mesh.GetMesh().HasShapeToMesh(): return entry
04465         study = self.mesh.smeshpyD.GetCurrentStudy()
04466         ior  = salome.orb.object_to_string( self.mesh.GetShape() )
04467         sobj = study.FindObjectIOR(ior)
04468         if sobj: entry = sobj.GetID()
04469         if not entry: return ""
04470         return entry

def smeshDC.Mesh_RadialPrism3D.NumberOfLayers (   self,
  n,
  UseExisting = 0 
)

Defines "NumberOfLayers" hypothesis, specifying the number of layers of prisms to build between the inner and outer shells.

Parameters:
nnumber of layers
UseExistingif ==true - searches for the existing hypothesis created with the same parameters, else (default) - creates a new one

Definition at line 5864 of file smeshDC.py.

05865                                               :
05866         self.mesh.GetMesh().RemoveHypothesis( self.geom, self.distribHyp )
05867         self.nbLayers = self.Hypothesis("NumberOfLayers", [n], UseExisting=UseExisting,
05868                                         CompareMethod=self.CompareNumberOfLayers)
05869         self.nbLayers.SetNumberOfLayers( n )
05870         return self.nbLayers

def smeshDC.Mesh_RadialPrism3D.NumberOfSegments (   self,
  n,
  s = [] 
)

Defines "NumberOfSegments" hypothesis, specifying the number of layers of prisms to build between the inner and the outer shells.

Parameters:
nthe number of layers
sthe scale factor (optional)

Definition at line 5889 of file smeshDC.py.

05890                                        :
05891         if s == []:
05892             hyp = self.OwnHypothesis("NumberOfSegments", [n])
05893         else:
05894             hyp = self.OwnHypothesis("NumberOfSegments", [n,s])
05895             hyp.SetDistrType( 1 )
05896             hyp.SetScaleFactor(s)
05897         hyp.SetNumberOfSegments(n)
05898         return hyp

def smeshDC.Mesh_RadialPrism3D.OwnHypothesis (   self,
  hypType,
  args = [],
  so = "libStdMeshersEngine.so" 
)

Private method creating a 1D hypothesis and storing it in the LayerDistribution hypothesis.

Returns the created hypothesis

Definition at line 5847 of file smeshDC.py.

05848                                                                           :
05849         #print "OwnHypothesis",hypType
05850         if not self.nbLayers is None:
05851             self.mesh.GetMesh().RemoveHypothesis( self.geom, self.nbLayers )
05852             self.mesh.GetMesh().AddHypothesis( self.geom, self.distribHyp )
05853         study = self.mesh.smeshpyD.GetCurrentStudy() # prevents publishing own 1D hypothesis
05854         self.mesh.smeshpyD.SetCurrentStudy( None )
05855         hyp = self.mesh.smeshpyD.CreateHypothesis(hypType, so)
05856         self.mesh.smeshpyD.SetCurrentStudy( study ) # enables publishing
05857         self.distribHyp.SetLayerDistribution( hyp )
05858         return hyp

def smeshDC.Mesh_Algorithm.SetName (   self,
  name 
) [inherited]

Sets the name to the algorithm.

Definition at line 4384 of file smeshDC.py.

04385                            :
04386         self.mesh.smeshpyD.SetName(self.algo, name)

def smeshDC.Mesh_RadialPrism3D.StartEndLength (   self,
  start,
  end 
)

Defines "StartEndLength" hypothesis, specifying distribution of segments to build between the inner and the outer shells as geometric length increasing.

Parameters:
startfor the length of the first segment
endfor the length of the last segment

Definition at line 5913 of file smeshDC.py.

05914                                         :
05915         hyp = self.OwnHypothesis("StartEndLength", [start, end])
05916         hyp.SetLength(start, 1)
05917         hyp.SetLength(end  , 0)
05918         return hyp


Field Documentation

Definition at line 4276 of file smeshDC.py.

Definition at line 5834 of file smeshDC.py.

Reimplemented in smeshDC.Mesh_Segment.

Definition at line 4276 of file smeshDC.py.

Definition at line 4276 of file smeshDC.py.

Definition at line 5834 of file smeshDC.py.

Definition at line 4276 of file smeshDC.py.

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS