DbNodes#

class ansys.mapdl.core.database.nodes.DbNodes(db)#

Abstract mapdl db nodes class.

Examples

Create a nodes instance.

>>> from ansys.mapdl.core import launch_mapdl
>>> mapdl = launch_mapdl()
>>> # create nodes...
>>> nodes = mapdl.db.nodes
>>> print(nodes)
MAPDL Database Nodes
    Number of nodes:          270641
    Number of selected nodes: 270641
    Maximum node number:      270641
>>> mapdl.nsel("NONE")
>>> print(nodes)
MAPDL Database Nodes
    Number of nodes:          270641
    Number of selected nodes: 0
    Maximum node number:      270641

Return the selection status and the coordinates of node 22.

>>> nodes = mapdl.db.nodes
>>> sel, coord = nodes.coord(22)
>>> coord
(1.0, 0.5, 0.0, 0.0, 0.0, 0.0)

Return all the node indices, coordinates, and angles of all the nodes.

>>> nodes = mapdl.db.nodes
>>> ind, coords, angles = nodes.all_asarray()
>>> ind
array([     1,      2,      3, ..., 270639, 270640, 270641], dtype=int32)
>>> coords
array([[0.    , 1.    , 0.    ],
       [0.    , 0.    , 0.    ],
       [0.    , 0.9875, 0.    ],
       ...,
       [0.9875, 0.975 , 0.925 ],
       [0.9875, 0.975 , 0.95  ],
       [0.9875, 0.975 , 0.975 ]])
>>> angles
array([[0., 0., 0.],
       [0., 0., 0.],
       [0., 0., 0.],
       ...,
       [0., 0., 0.],
       [0., 0., 0.],
       [0., 0., 0.]])

Methods

DbNodes.all_asarray()

Return all node indices, coordinates, and angles as arrays.

DbNodes.coord(inod)

Return the location of a node.

DbNodes.first([inod])

Return the number of the first node.

DbNodes.info(inod, ikey)

Return information about a node.

DbNodes.next()

Return the number of the next selected node.

DbNodes.num([selected])

Return the number of nodes, either selected or all.

DbNodes.push(inod, x, y, z[, xang, yang, zang])

Push a single node into the DB.

Attributes

DbNodes.max_num

Return the maximum node number.