Version: 8.3.0
Home
 All Data Structures Namespaces Files Functions Variables Groups
Adding nodes and elements

Functions

def AddNode
 Add a node to the mesh by coordinates. More...
 
def Add0DElement
 Create a 0D element on a node with given number. More...
 
def Add0DElementsToAllNodes
 Create 0D elements on all nodes of the given elements except those nodes on which a 0D element already exists. More...
 
def AddBall
 Create a ball element on a node with given ID. More...
 
def AddEdge
 Create a linear or quadratic edge (this is determined by the number of given nodes). More...
 
def AddFace
 Create a linear or quadratic face (this is determined by the number of given nodes). More...
 
def AddPolygonalFace
 Add a polygonal face to the mesh by the list of node IDs. More...
 
def AddQuadPolygonalFace
 Add a quadratic polygonal face to the mesh by the list of node IDs. More...
 
def AddVolume
 Create both simple and quadratic volume (this is determined by the number of given nodes). More...
 
def AddPolyhedralVolume
 Create a volume of many faces, giving nodes for each face. More...
 
def AddPolyhedralVolumeByFaces
 Create a volume of many faces, giving the IDs of the existing faces. More...
 
def SetNodeOnVertex
 Binds a node to a vertex. More...
 
def SetNodeOnEdge
 Stores the node position on an edge. More...
 
def SetNodeOnFace
 Stores node position on a face. More...
 
def SetNodeInVolume
 Binds a node to a solid. More...
 
def SetMeshElementOnShape
 Bind an element to a shape. More...
 
def Make2DMeshFrom3D
 Create 2D mesh as skin on boundary faces of a 3D mesh. More...
 
def MakeBoundaryMesh
 Create missing boundary elements. More...
 
def MakeBoundaryElements
 Create missing boundary elements around either the whole mesh or groups of elements. More...
 
def GetLastCreatedNodes
 If during the last operation of MeshEditor some nodes were created, this method return the list of their IDs,
if new nodes were not created - return empty list. More...
 
def GetLastCreatedElems
 If during the last operation of MeshEditor some elements were created this method return the list of their IDs,
if new elements were not created - return empty list. More...
 
def ClearLastCreated
 Forget what nodes and elements were created by the last mesh edition operation. More...
 

Detailed Description

Function Documentation

def AddNode (   self,
  x,
  y,
  z 
)

Add a node to the mesh by coordinates.

Returns
Id of the new node

References smeshBuilder.ParseParameters().

def Add0DElement (   self,
  IDOfNode,
  DuplicateElements = True 
)

Create a 0D element on a node with given number.

Parameters
IDOfNodethe ID of node for creation of the element.
DuplicateElementsto add one more 0D element to a node or not
Returns
the Id of the new 0D element
def Add0DElementsToAllNodes (   self,
  theObject,
  theGroupName = "",
  DuplicateElements = False 
)

Create 0D elements on all nodes of the given elements except those nodes on which a 0D element already exists.

Parameters
theObjectan object on whose nodes 0D elements will be created. It can be mesh, sub-mesh, group, list of element IDs or a holder of nodes IDs created by calling mesh.GetIDSource( nodes, SMESH.NODE )
theGroupNameoptional name of a group to add 0D elements created and/or found on nodes of theObject.
DuplicateElementsto add one more 0D element to a node or not
Returns
an object (a new group or a temporary SMESH_IDSource) holding IDs of new and/or found 0D elements. IDs of 0D elements can be retrieved from the returned object by calling GetIDs()

References Mesh.GetIDSource().

def AddBall (   self,
  IDOfNode,
  diameter 
)

Create a ball element on a node with given ID.

Parameters
IDOfNodethe ID of node for creation of the element.
diameterthe bal diameter.
Returns
the Id of the new ball element
def AddEdge (   self,
  IDsOfNodes 
)

Create a linear or quadratic edge (this is determined by the number of given nodes).

Parameters
IDsOfNodesthe list of node IDs for creation of the element. The order of nodes in this list should correspond to the description of MED.
This description is located by the following link: http://www.code-aster.org/outils/med/html/modele_de_donnees.html#3.
Returns
the Id of the new edge
def AddFace (   self,
  IDsOfNodes 
)

Create a linear or quadratic face (this is determined by the number of given nodes).

Parameters
IDsOfNodesthe list of node IDs for creation of the element. The order of nodes in this list should correspond to the description of MED.
This description is located by the following link: http://www.code-aster.org/outils/med/html/modele_de_donnees.html#3.
Returns
the Id of the new face
def AddPolygonalFace (   self,
  IdsOfNodes 
)

Add a polygonal face to the mesh by the list of node IDs.

Parameters
IdsOfNodesthe list of node IDs for creation of the element.
Returns
the Id of the new face
def AddQuadPolygonalFace (   self,
  IdsOfNodes 
)

Add a quadratic polygonal face to the mesh by the list of node IDs.

Parameters
IdsOfNodesthe list of node IDs for creation of the element; corner nodes follow first.
Returns
the Id of the new face
def AddVolume (   self,
  IDsOfNodes 
)

Create both simple and quadratic volume (this is determined by the number of given nodes).

Parameters
IDsOfNodesthe list of node IDs for creation of the element. The order of nodes in this list should correspond to the description of MED.
This description is located by the following link: http://www.code-aster.org/outils/med/html/modele_de_donnees.html#3.
Returns
the Id of the new volumic element
def AddPolyhedralVolume (   self,
  IdsOfNodes,
  Quantities 
)

Create a volume of many faces, giving nodes for each face.

Parameters
IdsOfNodesthe list of node IDs for volume creation face by face.
Quantitiesthe list of integer values, Quantities[i] gives the quantity of nodes in face number i.
Returns
the Id of the new volumic element
def AddPolyhedralVolumeByFaces (   self,
  IdsOfFaces 
)

Create a volume of many faces, giving the IDs of the existing faces.

Parameters
IdsOfFacesthe list of face IDs for volume creation.

Note: The created volume will refer only to the nodes of the given faces, not to the faces themselves.

Returns
the Id of the new volumic element
def SetNodeOnVertex (   self,
  NodeID,
  Vertex 
)

Binds a node to a vertex.

Parameters
NodeIDa node ID
Vertexa vertex or vertex ID
Returns
True if succeed else raises an exception

References Mesh.geom.

def SetNodeOnEdge (   self,
  NodeID,
  Edge,
  paramOnEdge 
)

Stores the node position on an edge.

Parameters
NodeIDa node ID
Edgean edge or edge ID
paramOnEdgea parameter on the edge where the node is located
Returns
True if succeed else raises an exception

References Mesh.geom.

def SetNodeOnFace (   self,
  NodeID,
  Face,
  u,
  v 
)

Stores node position on a face.

Parameters
NodeIDa node ID
Facea face or face ID
uU parameter on the face where the node is located
vV parameter on the face where the node is located
Returns
True if succeed else raises an exception

References Mesh.geom.

def SetNodeInVolume (   self,
  NodeID,
  Solid 
)

Binds a node to a solid.

Parameters
NodeIDa node ID
Solida solid or solid ID
Returns
True if succeed else raises an exception

References Mesh.geom.

def SetMeshElementOnShape (   self,
  ElementID,
  Shape 
)

Bind an element to a shape.

Parameters
ElementIDan element ID
Shapea shape or shape ID
Returns
True if succeed else raises an exception

References Mesh.geom.

def Make2DMeshFrom3D (   self)

Create 2D mesh as skin on boundary faces of a 3D mesh.

Returns
TRUE if operation has been completed successfully, FALSE otherwise

References Mesh.MakeBoundaryMesh().

def MakeBoundaryMesh (   self,
  elements,
  dimension = SMESH.BND_2DFROM3D,
  groupName = "",
  meshName = "",
  toCopyElements = False,
  toCopyExistingBondary = False 
)

Create missing boundary elements.

Parameters
elements- elements whose boundary is to be checked: mesh, group, sub-mesh or list of elements if elements is mesh, it must be the mesh whose MakeBoundaryMesh() is called
dimension- defines type of boundary elements to create, either of { SMESH.BND_2DFROM3D, SMESH.BND_1DFROM3D, SMESH.BND_1DFROM2D } SMESH.BND_1DFROM3D create mesh edges on all borders of free facets of 3D cells
groupName- a name of group to store created boundary elements in, "" means not to create the group
meshName- a name of new mesh to store created boundary elements in, "" means not to create the new mesh
toCopyElements- if true, the checked elements will be copied into the new mesh else only boundary elements will be copied into the new mesh
toCopyExistingBondary- if true, not only new but also pre-existing boundary elements will be copied into the new mesh
Returns
tuple (mesh, group) where boundary elements were added to

References Mesh.GetElementType(), and Mesh.MakeBoundaryElements().

def MakeBoundaryElements (   self,
  dimension = SMESH.BND_2DFROM3D,
  groupName = "",
  meshName = "",
  toCopyAll = False,
  groups = [] 
)

Create missing boundary elements around either the whole mesh or groups of elements.

Parameters
dimension- defines type of boundary elements to create, either of { SMESH.BND_2DFROM3D, SMESH.BND_1DFROM3D, SMESH.BND_1DFROM2D }
groupName- a name of group to store all boundary elements in, "" means not to create the group
meshName- a name of a new mesh, which is a copy of the initial mesh + created boundary elements; "" means not to create the new mesh
toCopyAll- if true, the whole initial mesh will be copied into the new mesh else only boundary elements will be copied into the new mesh
groups- groups of elements to make boundary around
Return values
tuple(long, mesh, groups ) long - number of added boundary elements mesh - the mesh where elements were added to group - the group of boundary elements or None
def GetLastCreatedNodes (   self)

If during the last operation of MeshEditor some nodes were created, this method return the list of their IDs,
if new nodes were not created - return empty list.

Returns
the list of integer values (can be empty)
def GetLastCreatedElems (   self)

If during the last operation of MeshEditor some elements were created this method return the list of their IDs,
if new elements were not created - return empty list.

Returns
the list of integer values (can be empty)
def ClearLastCreated (   self)

Forget what nodes and elements were created by the last mesh edition operation.