visualdynamics.core.geometry¶
geometry
¶
Test and model geometry: nodes, coordinate systems, elements and element groups.
Node coordinates are stored in the global cartesian frame, in meters once
their unit is known. A geometry read from a file that does not declare
units (an sdynpy .npz, an exodus file, a UNV file without dataset 164)
keeps the file's coordinates as they are, and length_unit is None
until define_units() is called. Element types are identified by the
FE descriptor codes of UFF dataset 2412.
Classes:
| Name | Description |
|---|---|
View |
The direction a geometry is viewed from in 3-D: where the eye is, |
Geometry |
Nodes, coordinate systems, elements and element groups. |
Functions:
| Name | Description |
|---|---|
element_family |
Which family a 2412 element code belongs to. |
placed |
A point given in a coordinate system, converted to global cartesian. |
written_in |
The inverse of |
to_global |
Node coordinates given in each node's own placement system, |
to_local |
The inverse of |
reconcile_type |
The descriptor that matches the number of nodes an element has, |
face_corners |
How many corners a face element is drawn with: three for a |
solid_faces |
The faces of a solid cell with this many nodes, each face as |
deck_to_si |
A finite element deck's element group properties converted to SI |
implausible_materials |
A sentence for each material whose modulus or density, in SI, is |
Classes¶
View
¶
The direction a geometry is viewed from in 3-D: where the eye is, seen from the model's center, and which way is up on screen.
A view is only a direction. Every view is fitted to what it shows,
so there is no distance or zoom to store. Set on a geometry, it is
the view the app opens the geometry and everything drawn on it in,
the view Reset View returns to, and the view of the report's scenes
and exported figures. A model built with Y up then opens upright
without its nodes being rotated. Raises ValueError for a zero or
non-finite direction, or an up along the line of sight.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
eye
|
sequence of 3 floats
|
The direction from the model toward the eye, in the global frame; any length. |
(1, 1, 1)
|
up
|
sequence of 3 floats
|
Which way is up on screen. Only its part across the line of sight
counts, so it need not be exactly perpendicular to |
(0, 0, 1)
|
Examples:
A model built with Y up, seen from the front, above and to the right:
Methods:
| Name | Description |
|---|---|
basis |
|
Source code in src/visualdynamics/core/geometry.py
Methods:¶
basis
¶
(right, up) on screen, as unit vectors in the global frame.
Right is the line of sight crossed with up, and up is up made
perpendicular to the line of sight.
Source code in src/visualdynamics/core/geometry.py
Geometry
¶
Geometry(node_id: Ids, node_xyz: ArrayLike, node_def_cs: ArrayLike | None = None, node_disp_cs: ArrayLike | None = None, node_color: ArrayLike | None = None, cs_id: Ids | None = None, cs_name: Sequence[str] | None = None, cs_type: ArrayLike | None = None, cs_matrix: ArrayLike | None = None, elem_id: Ids | None = None, elem_type: ArrayLike | None = None, elem_color: ArrayLike | None = None, elem_conn: Sequence[ArrayLike] | None = None, elem_group: Ids | None = None, group_id: Ids | None = None, group_name: Sequence[str] | None = None, length_unit: str | None = None, group_properties: Mapping[int, Any] | None = None, from_deck: bool = False, mass_unit: str | None = None)
Nodes, coordinate systems, elements and element groups.
The parameters are array-likes with the names of the attributes
below; elem_conn holds one integer array of node ids per element.
Coordinates are in the global cartesian frame, in meters once
length_unit is declared. Without coordinate systems the geometry
gets one, the global cartesian system with id 1. An element whose
descriptor does not match its node count is corrected
(reconcile_type), and an element group holding more than one
element family is split (split_groups_by_family). Raises
ValueError when the result is not consistent (validate).
The arrays below hold the data; nodes, coordinate_systems,
elements and groups are views of them, which is how the project
tree lists a geometry and usually the easiest way for a script to
use one. A view is not a copy, so writing through a row writes into
the geometry.
There are no separate tracelines. A line drawn through nodes is an
element group of two-node line elements with no properties:
add_beams creates one, and drawn_lines returns them for the file
formats that store tracelines separately. The same element group
becomes part of the structure once it is given a section.
Attributes:
node_id: Every node's id. Unique, because elements and placement
refer to nodes by id.
node_xyz: (nodes, 3) coordinates, in meters once
length_unit is declared and the file's numbers before
that.
node_def_cs: The coordinate system each node is placed in.
node_disp_cs: The coordinate system each node is measured in,
which is the system a shape's values at that node are in.
node_color: Palette index per node.
cs_id: Coordinate system ids. Unique, for the same reason as
node ids.
cs_name: A name per system, often empty.
cs_type: 0 cartesian, 1 cylindrical, 2 spherical (CS_TYPES).
cs_matrix: (systems, 4, 3): three direction rows, then the
origin, so cs_matrix[i, 3] is the origin of system i.
elem_id: Element ids. They are only labels; nothing refers to
them.
elem_type: UFF dataset 2412 descriptor code per element
(ELEMENT_TYPES names them and says how each is drawn).
elem_color: Palette index per element.
elem_conn: One array of node ids per element.
elem_group: The id of the element group each element belongs to.
group_id: The declared element groups. Unique, since elements
refer to them by id.
group_name: A name per element group, such as 'wing' or
'arm front left'. This is where a mesh records that a
region is a different part from its neighbor, and
fem.Model.from_geometry reads a member's section from it.
group_properties: {element group id: fem.GroupProperties}, the
material and thickness or section of each element group that
has them.
length_unit: The unit of the coordinates, or None while it has
not been declared, in which case they are the file's own
numbers and nothing has been scaled.
mass_properties: The reference point, mass and inertia for the
rigid-body shapes (core.rigid.MassProperties), or None.
view: The direction the geometry opens in 3-D (View), or None
for DEFAULT_VIEW.
solids: The solid shapes of the parts before they are meshed
(core.solids).
mates: Where element groups' surfaces are joined, by rigid links
or springs made when a model is built (core.mates).
Methods:
| Name | Description |
|---|---|
validate |
Check that the geometry is consistent, and raise ValueError |
node_index |
Positions of the given node ids in the node arrays. |
contains_nodes |
Boolean array: which of |
missing_dofs |
The DOF strings whose node this geometry does not define. |
suggest_mass_properties |
Mass properties with the centroid of the nodes as the reference |
define_units |
Declare the length unit of the coordinates, converting them to SI. |
undefine_units |
Remove the length unit and restore the original coordinates; returns self. |
dof_direction |
A DOF's direction in global coordinates, from the coordinate |
add_node |
Add a node at |
add_nodes |
Add nodes at |
add_coordinate_system |
Add a coordinate system and return its id. |
place_coordinate_system |
Rotate a coordinate system, move it, or both, as the 3-D |
add_beams |
Add a chain of two-node line elements through the given nodes, |
mixed_groups |
|
split_groups_by_family |
Split every element group that holds more than one element family. |
attach_drawn_lines |
Add drawn lines read from a format that stores them separately |
is_drawn_line |
Whether an element group is a drawn line. |
drawn_lines |
The drawn lines, in the form used by file formats that store |
group_of |
The name of the element group an element belongs to, or '' when |
elements_in |
The ids of the elements in an element group, given by id or name. |
nodes_in |
The ids of the nodes used by the elements of these element |
add_group |
Declare an element group and return its id. |
add_element |
Add an element and return its row index. |
add_elements |
Add many elements at once, numbered from one more than the |
renumber_node |
Give a node a new id, and update the elements that use it. |
renumber_group |
Give an element group a new id, and update its elements. |
renumber_coordinate_system |
Give a coordinate system a new id, and update the nodes that use it. |
delete_nodes |
Remove nodes, and the elements that use them. |
coincident_nodes |
|
duplicate_elements |
|
merge_duplicate_elements |
Remove duplicate solid elements ( |
node_spacing |
The mesh's finest spacing: the shortest nonzero distance between |
coincident_spots |
The places where a merge would make one node. |
merge_folds |
Why this merge would be refused, or None. |
merge_collapses |
The ids of the line elements this merge would remove. |
merge_coincident_nodes |
Merge nodes that are at one point into one node. |
align_reach |
The default reach of Align Meshes: half the mesh size of the |
align_moves |
The moves Align Meshes would make, each |
align_folds |
Why these moves would be refused, or None. |
align_meshes |
Move the nodes of the coarser piece onto the nodes of the finer |
delete_coordinate_systems |
Remove coordinate systems, and move the nodes that used them to |
delete_groups |
Remove element groups with their elements, their properties, and |
merge_refusal |
Why these element groups cannot be merged, or None when they can. |
merge_groups |
Merge several element groups into the first one (Merge Element |
delete_elements |
Remove elements by id. Ids that are not present are ignored. |
save |
Write the geometry to a file of its own. |
load |
Read a geometry written by |
plot |
Draw the geometry's nodes and elements. |
plot_dofs |
Draw this geometry with a labeled arrow at every DOF where |
plot_channels |
Draw this geometry with a labeled arrow at each channel's DOF |
Attributes:
| Name | Type | Description |
|---|---|---|
opening_view |
View
|
The view the geometry opens in 3-D: its own |
num_nodes |
int
|
How many nodes the geometry defines. |
nodes |
EntityView
|
Every node: |
coordinate_systems |
EntityView
|
Every coordinate system: |
elements |
EntityView
|
Every element: |
groups |
EntityView
|
Every element group: |
extent |
tuple[ndarray, ndarray]
|
|
units_defined |
bool
|
Whether the length unit of the coordinates has been declared. |
Source code in src/visualdynamics/core/geometry.py
675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 | |
Attributes¶
opening_view
property
¶
opening_view: View
The view the geometry opens in 3-D: its own view, or
DEFAULT_VIEW (from +X+Y+Z, Z up) when it has none.
nodes
property
¶
nodes: EntityView
Every node: ids, xyz, colors, placement_systems and
displacement_systems (an EntityView).
coordinate_systems
property
¶
coordinate_systems: EntityView
Every coordinate system: ids, names, types and matrices
(an EntityView).
elements
property
¶
elements: EntityView
Every element: ids, types, colors, groups and nodes
(an EntityView).
groups
property
¶
groups: EntityView
Every element group: ids and names (an EntityView).
An element group does not store its elements. Which elements are
in one is read from elem_group (elements_in), so moving an
element to another element group is an edit to the element.
extent
property
¶
(min_xyz, max_xyz) of the nodes, in meters once units are defined.
units_defined
property
¶
Whether the length unit of the coordinates has been declared.
False until define_units is called.
Methods:¶
validate
¶
Check that the geometry is consistent, and raise ValueError naming the first problem found.
Node, coordinate system and element group ids must be unique,
every element's nodes must exist, every element must name an
element group the geometry has, every element type must be in
ELEMENT_TYPES, and each element group must hold one element
family.
Source code in src/visualdynamics/core/geometry.py
node_index
¶
Positions of the given node ids in the node arrays.
Every id must be one the geometry has (contains_nodes asks
without raising).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_ids
|
int or sequence of int
|
The identifiers, one or many. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Each identifier's row in the node arrays. |
Raises:
| Type | Description |
|---|---|
KeyError
|
Naming the ids the geometry does not have. |
Source code in src/visualdynamics/core/geometry.py
contains_nodes
¶
Boolean array: which of node_ids this geometry defines.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_ids
|
int or sequence of int
|
The identifiers, one or many. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
A boolean per identifier: whether the geometry has it. |
Source code in src/visualdynamics/core/geometry.py
missing_dofs
¶
The DOF strings whose node this geometry does not define.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dofs
|
sequence of str
|
The degrees of freedom to check, such as '101Z+'. |
required |
Returns:
| Type | Description |
|---|---|
list of str
|
The DOFs whose node the geometry does not have, including any DOF that names no node. A data object with such DOFs is not compatible with this geometry. |
Source code in src/visualdynamics/core/geometry.py
suggest_mass_properties
¶
suggest_mass_properties() -> MassProperties
Mass properties with the centroid of the nodes as the reference point and no mass, which give unit rigid-body shapes about the middle of the model.
The rigid-body panel opens with these values, and
generate_rigid_body_modes uses them when nothing has been set.
They are the settings the virtual point transformation needs most
often. Raises ValueError when the geometry has no nodes.
Returns:
| Type | Description |
|---|---|
MassProperties
|
The centroid, unscaled. |
Source code in src/visualdynamics/core/geometry.py
define_units
¶
define_units(length_unit: str, mass_unit: str | None = None) -> Geometry
Declare the length unit of the coordinates, converting them to SI.
The node coordinates, the coordinate system origins and the solids' lengths are converted. Declaring again reinterprets the original values instead of scaling twice, so a wrong unit can be corrected.
A geometry read from a finite element deck (from_deck) also
holds the deck's property values, in the consistent system its
length unit, a mass unit and seconds make: a thickness is a
length, a modulus a force per area, a density a mass per volume,
a point mass a mass, a spring a force per length (or, about an
axis, a force times a length). Those are converted with the
coordinates (deck_to_si). The mass unit is mass_unit, or the
one a deck in that length is written with when it is omitted
(DECK_MASS_UNITS: tonnes with millimeters, lbf·s²/in with
inches). A material whose converted modulus or density is not a
structural material's is warned about, since that is what a
wrong mass unit looks like.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
length_unit
|
str
|
The unit the coordinates are in, such as 'm' or 'in'. |
required |
mass_unit
|
str
|
The mass unit of a deck's properties, such as 'tonne'. |
None
|
Returns:
| Type | Description |
|---|---|
Geometry
|
Self, converted to SI in place. |
Source code in src/visualdynamics/core/geometry.py
999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 | |
undefine_units
¶
undefine_units() -> Geometry
Remove the length unit and restore the original coordinates; returns self.
Source code in src/visualdynamics/core/geometry.py
dof_direction
¶
A DOF's direction in global coordinates, from the coordinate system its node is measured in.
'101X+' at a node whose node_disp_cs is rotated is not global
X. The report's table of control channels uses this to show which
global axis each channel is nearest and how far it is from it. A
rotational DOF points along its axis, as the DOF arrows draw it.
A node whose system is not in the geometry is taken to be in the
global system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dof
|
str
|
The DOF, such as '101X+' or '1313RZ-'. |
required |
Returns:
| Type | Description |
|---|---|
ndarray or None
|
A unit vector, or None when the DOF names no node this geometry has, has no axis (a node number alone), or is at a node measured in a cylindrical or spherical system, whose local axes depend on the node's position and are not computed here. |
Source code in src/visualdynamics/core/geometry.py
add_node
¶
add_node(xyz: ArrayLike, node_id: int | None = None, color: int = 1, def_cs: int | None = None, disp_cs: int | None = None) -> int
Add a node at xyz and return its id.
Raises ValueError if a node with node_id already exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
array_like
|
The node's coordinates in the global cartesian frame, in meters once units are defined. They are stored as given. |
required |
node_id
|
int
|
Its identifier. One more than the highest node id when omitted. |
None
|
color
|
int
|
Its display color index. |
1
|
def_cs
|
int
|
The coordinate system the node is placed in, which a writer
uses to give its position. |
None
|
disp_cs
|
int
|
The coordinate system displacements at the node are measured in. The first coordinate system when omitted. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
The node's identifier. |
Source code in src/visualdynamics/core/geometry.py
add_nodes
¶
Add nodes at xyz, numbered from one more than the highest id.
This is add_node for many nodes at once, with the defaults of
add_node. Each array is copied once instead of once per node,
so adding the thousands of nodes of a meshed plane is fast.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz
|
array_like
|
(n, 3) coordinates in the global cartesian frame, in meters once units are defined. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The new nodes' identifiers, in order. |
Source code in src/visualdynamics/core/geometry.py
add_coordinate_system
¶
add_coordinate_system(origin: ArrayLike = (0.0, 0.0, 0.0), rotation: ArrayLike | None = None, cs_id: int | None = None, name: str = '', cs_type: int = 0) -> int
Add a coordinate system and return its id.
Raises ValueError if a system with cs_id already exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
origin
|
array_like
|
The system's origin, in meters once units are defined. |
(0, 0, 0)
|
rotation
|
array_like
|
A 3x3 matrix whose rows are the system's axes. Identity when omitted. |
None
|
cs_id
|
int
|
Its identifier. One more than the highest id when omitted. |
None
|
name
|
str
|
What to call it. |
''
|
cs_type
|
int
|
0 cartesian, 1 cylindrical, 2 spherical. |
0
|
Returns:
| Type | Description |
|---|---|
int
|
The coordinate system's identifier. |
Source code in src/visualdynamics/core/geometry.py
place_coordinate_system
¶
place_coordinate_system(cs_id: int, *, origin: ArrayLike | None = None, angles: ArrayLike | None = None, rotation: ArrayLike | None = None) -> None
Rotate a coordinate system, move it, or both, as the 3-D view's rings and arrows do.
Raises KeyError for an unknown cs_id, and ValueError when both
angles and rotation are given.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cs_id
|
int
|
Which coordinate system. |
required |
origin
|
array_like
|
The new origin, in the geometry's stored length unit (meters once its units are declared). Unchanged when omitted. |
None
|
angles
|
array_like
|
The rotation as angles in degrees about the fixed global X,
then Y, then Z axes ( |
None
|
rotation
|
array_like
|
The rotation as a 3x3 matrix whose rows are the system's
axes, instead of |
None
|
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/visualdynamics/core/geometry.py
add_beams
¶
Add a chain of two-node line elements through the given nodes, in order, and return the element group's id.
This is how a drawn line (a traceline in some file formats) is
stored, and it becomes a run of beams once the element group is
given a section. Raises ValueError for fewer than two nodes, an
unknown node, or an elem_type that is not a two-node line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_ids
|
sequence of int
|
The nodes the line runs through, in order; two at least. |
required |
group
|
int
|
The element group the segments are added to. A new, unnamed element group when omitted; a drawn line is its own element group, named for the line. |
None
|
color
|
int
|
The display color index of every segment. |
1
|
elem_type
|
int
|
The two-node line code ( |
21
|
Returns:
| Type | Description |
|---|---|
int
|
The element group the segments are in. |
Source code in src/visualdynamics/core/geometry.py
mixed_groups
¶
{element group id: families} for every element group that
holds more than one element family.
It is empty for any geometry that passes validate.
Returns:
| Type | Description |
|---|---|
dict of int to list of str
|
|
Source code in src/visualdynamics/core/geometry.py
split_groups_by_family
¶
Split every element group that holds more than one element family.
The group keeps its first family, and each other family is moved into a new element group named with the old name and the family, such as 'wing quads', with the old group's properties. A file without element groups (UNV dataset 2412, the sdynpy layout) puts every element in one group, so this is applied when such a file is read.
Returns:
| Type | Description |
|---|---|
dict of int to list of int
|
|
Source code in src/visualdynamics/core/geometry.py
attach_drawn_lines
¶
Add drawn lines read from a format that stores them separately from elements, each as its own element group of two-node line elements with no properties.
This is the reading side of drawn_lines.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lines
|
sequence of (name, color, chains)
|
One entry per line: its name, its color index, and its runs, each a sequence of node ids in drawing order (a UNV line that lifts the pen has several). |
required |
Returns:
| Type | Description |
|---|---|
list of int
|
The element groups made, one per line. |
Source code in src/visualdynamics/core/geometry.py
is_drawn_line
¶
Whether an element group is a drawn line.
It is when every element in it is a two-node line element and the element group has no properties. The app and every file writer use this one test. An empty element group is not a drawn line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
group
|
int
|
The element group's identifier. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
|
Source code in src/visualdynamics/core/geometry.py
drawn_lines
¶
The drawn lines, in the form used by file formats that store tracelines separately from elements.
One dict {'group', 'name', 'color', 'chains'} per drawn-line
element group (is_drawn_line), in element group order. The
chains are the group's segments taken in element order, each a
list of node ids, with a new chain wherever a segment does not
start where the last one ended. An element group read from one
polyline gives that polyline back, and one read from a UNV line
that lifts the pen gives its runs back under the one element
group. The color is that of the group's first element.
Returns:
| Type | Description |
|---|---|
list of dict
|
|
Source code in src/visualdynamics/core/geometry.py
group_of
¶
The name of the element group an element belongs to, or '' when that group is not declared.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
elem_id
|
int
|
Which element. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The name of the element group it belongs to. |
Source code in src/visualdynamics/core/geometry.py
elements_in
¶
The ids of the elements in an element group, given by id or name.
A name that no element group has gives an empty list; with two groups of one name, the first is used.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
group
|
int or str
|
An element group, by identifier or by name. |
required |
Returns:
| Type | Description |
|---|---|
list of int
|
The identifiers of the elements it holds. |
Source code in src/visualdynamics/core/geometry.py
nodes_in
¶
The ids of the nodes used by the elements of these element groups, in ascending order. These are the nodes a merge limited to those groups may change.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
groups
|
sequence of int
|
Element groups, by identifier. |
required |
Returns:
| Type | Description |
|---|---|
list of int
|
The node identifiers. |
Raises:
| Type | Description |
|---|---|
ValueError
|
When a group is not in the geometry. |
Source code in src/visualdynamics/core/geometry.py
add_group
¶
Declare an element group and return its id.
An empty element group is allowed: exodus files contain empty
ones, and an element group has to exist before an element can be
put in it. Raises ValueError if group_id is already used.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
What to call the element group. |
''
|
group_id
|
int
|
Its identifier. One more than the highest id when omitted. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
The element group's identifier. |
Source code in src/visualdynamics/core/geometry.py
add_element
¶
add_element(node_ids: Ids, elem_type: int | None = None, color: int = 1, group: int | None = None) -> int
Add an element and return its row index.
The element id is one more than the highest element id. Without
elem_type, the type is chosen from the node count: 2 nodes a
beam (21), 3 a triangle (41), 4 a quadrilateral (44); any other
count needs elem_type. Raises ValueError for an unknown node or
type, or for a group that holds a different element family.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_ids
|
int or sequence of int
|
The nodes the element connects, in order. |
required |
elem_type
|
int
|
The element type code. Inferred from the node count when omitted. |
None
|
color
|
int
|
Its display color index. |
1
|
group
|
int
|
The element group it belongs to, which is declared if it does not exist yet. When omitted, the first element group that holds this element's family (or is empty), otherwise a new one. An element group holds one family, so a beam added to a mesh of plates goes in an element group of its own. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
The element's row index in the element arrays (not its id). |
Source code in src/visualdynamics/core/geometry.py
1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 | |
add_elements
¶
Add many elements at once, numbered from one more than the highest element id, with color 1.
The nodes and types are checked once for all of them, and an
element group may hold only one element family, as in
add_element. If any check fails, ValueError is raised and
nothing is added.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connectivity
|
sequence of sequence of int
|
Each element's nodes, in order. |
required |
elem_types
|
sequence of int
|
Each element's type code. |
required |
groups
|
sequence of int
|
The element group each belongs to; an element group that does not exist yet is declared, with no name. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/visualdynamics/core/geometry.py
1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 | |
renumber_node
¶
Give a node a new id, and update the elements that use it.
Elements refer to nodes by id, so the connectivity is updated too; otherwise every element at the node would lose it. Raises ValueError if another node already has the id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row
|
int
|
Which node, by row. |
required |
node_id
|
int
|
Its new identifier. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/visualdynamics/core/geometry.py
renumber_group
¶
Give an element group a new id, and update its elements.
An element refers to its element group by id, so the elements are updated too; otherwise they would refer to an element group that no longer exists. Raises ValueError if another element group already has the id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row
|
int
|
Which element group, by row. |
required |
group_id
|
int
|
Its new identifier. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/visualdynamics/core/geometry.py
renumber_coordinate_system
¶
Give a coordinate system a new id, and update the nodes that use it.
Both the placement and the displacement systems of the nodes are updated. Raises ValueError if another system already has the id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row
|
int
|
Which system, by row. |
required |
cs_id
|
int
|
Its new identifier. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/visualdynamics/core/geometry.py
delete_nodes
¶
Remove nodes, and the elements that use them.
An element that uses a deleted node is deleted too. Ids that are not present are ignored.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_ids
|
int or sequence of int
|
The identifiers, one or many. |
required |
Returns:
| Type | Description |
|---|---|
dict of str to int
|
'nodes' and 'elements', the number of each removed. |
Source code in src/visualdynamics/core/geometry.py
coincident_nodes
¶
{node: the node it coincides with} for every node within
tolerance of another.
Each node is mapped to the lowest id in its group, which is the node a merge keeps. Groups are chained: if a is within tolerance of b and b of c, all three are one point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tolerance
|
float
|
How close two nodes must be to be one point, in the stored length unit: meters once units are defined. |
required |
nodes
|
sequence of int
|
Only these nodes are considered, by id; a node outside them is not merged and nothing is merged into it, however close. Every node when omitted. |
None
|
Returns:
| Type | Description |
|---|---|
dict of int to int
|
Only the nodes that would be removed, each mapped to the node it becomes. |
Source code in src/visualdynamics/core/geometry.py
duplicate_elements
¶
{element id: the element it duplicates} for every solid
element of the same type and on the same nodes as an earlier
element, such as two bricks filling one cell.
The earlier element (in element order) is the one that stays. Only solids are checked: two beams on one line can be two members, and a plate on another plate's nodes is how a doubler or a layer is modeled, but two solids are never meant to fill one cell. Two element groups that overlap and share their nodes in the overlap (the bars of an X cross-section) put two elements in every cell there, which doubles the stiffness and mass of the region.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
groups
|
sequence of int
|
Only the elements of these element groups, by id; every element when omitted. |
None
|
Returns:
| Type | Description |
|---|---|
dict of int to int
|
Each element that fills a cell another element already fills, mapped to that element. |
Source code in src/visualdynamics/core/geometry.py
merge_duplicate_elements
¶
Remove duplicate solid elements (duplicate_elements).
The later element of each pair is removed, and the earlier one stays in its element group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
groups
|
sequence of int
|
Only the elements of these element groups, by id; every element when omitted. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
How many elements were removed. |
Source code in src/visualdynamics/core/geometry.py
node_spacing
¶
The mesh's finest spacing: the shortest nonzero distance between two nodes of one element, such as a brick's shortest edge or half an edge of a quad8.
Merge Coincident Nodes sets its default tolerance to a quarter of this value. Nodes of parts meshed separately are usually much closer than that where the parts meet, and no two nodes of one element are.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
groups
|
sequence of int
|
Only these element groups' elements, by id; every element when omitted. |
None
|
Returns:
| Type | Description |
|---|---|
float or None
|
The spacing, in the stored length unit; None when no element has two nodes at different positions. |
Source code in src/visualdynamics/core/geometry.py
coincident_spots
¶
coincident_spots(tolerance: float, groups: Ids | None = None, exclude: Ids | None = None) -> list[list[int]]
The places where a merge would make one node.
Each place is a list of the node ids that coincide there, in ascending order, so the first is the node that stays. Merge Coincident Nodes marks these places in the view before anything is merged, so some of them can be left out.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tolerance
|
float
|
How close two nodes must be to be one, in the stored length unit: meters once units are defined. |
required |
groups
|
sequence of int
|
Only the nodes used by these element groups' elements, by id; every node when omitted. |
None
|
exclude
|
sequence of int
|
Nodes left out, by id: they are not merged and nothing is merged into them. |
None
|
Returns:
| Type | Description |
|---|---|
list of list of int
|
One list per place, sorted by the node each keeps. |
Source code in src/visualdynamics/core/geometry.py
merge_folds
¶
Why this merge would be refused, or None.
Returns the message merge_coincident_nodes raises when the
tolerance would fold an element onto itself, so a panel can show
it before the merge is applied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tolerance
|
float
|
As |
required |
groups
|
sequence of int
|
As |
None
|
exclude
|
sequence of int
|
As |
None
|
Returns:
| Type | Description |
|---|---|
str or None
|
|
Source code in src/visualdynamics/core/geometry.py
merge_collapses
¶
merge_collapses(tolerance: float, groups: Ids | None = None, exclude: Ids | None = None) -> list[int]
The ids of the line elements this merge would remove.
These are the line elements (a rigid link, a spring, a beam) whose nodes would all become one node, so they no longer join anything. Merging a joint built with rigid links removes the links.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tolerance
|
float
|
As |
required |
groups
|
sequence of int
|
As |
None
|
exclude
|
sequence of int
|
As |
None
|
Returns:
| Type | Description |
|---|---|
list of int
|
|
Source code in src/visualdynamics/core/geometry.py
merge_coincident_nodes
¶
merge_coincident_nodes(tolerance: float, groups: Ids | None = None, exclude: Ids | None = None) -> dict[str, int]
Merge nodes that are at one point into one node.
Nodes within tolerance of each other (coincident_nodes)
become the one with the lowest id: every element that uses one of
them is changed to use that node, and the others are removed.
Plates are only connected where they share nodes, so this is what
connects a model built from separate planes at its edges.
The merge is refused with ValueError, naming the element, when
the tolerance would fold an element onto itself (two of its own
nodes within the tolerance), since that means the tolerance is
larger than the mesh. A line element whose nodes would all become
one, such as a rigid link across the gap the merge closes, is
removed instead (merge_collapses). Solid elements the merge
leaves on exactly the same nodes fill one cell twice, and the
duplicates are removed (merge_duplicate_elements).
With groups, only those element groups are merged: the nodes
their elements use are the candidates, so two groups picked
together are joined to each other and to nothing else, and only
their duplicate elements are removed. A merge over the whole
geometry joins every part to every part it touches, which is
usually more than intended; the app offers the merge on element
groups only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tolerance
|
float
|
How close two nodes must be to be one, in the stored length unit: meters once units are defined. |
required |
groups
|
sequence of int
|
The element groups whose nodes are merged, by id. Every node of the geometry when omitted. |
None
|
exclude
|
sequence of int
|
Nodes left out of the merge, by id: they are not merged and
nothing is merged into them. In the app, these are the
places that were unpicked ( |
None
|
Returns:
| Type | Description |
|---|---|
dict of str to int
|
'merged', the number of nodes removed; 'into', the number of nodes they became; 'duplicates', the number of elements removed for filling a cell another already filled; and 'links', the number of line elements removed because their nodes became one. |
Source code in src/visualdynamics/core/geometry.py
2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 | |
align_reach
¶
The default reach of Align Meshes: half the mesh size of the coarsest piece.
A piece is a set of elements connected by shared nodes. With this reach no node moves more than half an element of its own mesh. Parts with a gap between them need a larger reach, by the size of the gap.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
groups
|
sequence of int
|
The element groups, by id; every element when omitted. |
None
|
Returns:
| Type | Description |
|---|---|
float or None
|
In the stored length unit; None when no element has a nonzero size. |
Source code in src/visualdynamics/core/geometry.py
align_moves
¶
The moves Align Meshes would make, each [node, onto]: a node
of a coarser piece and the node of a finer piece it would move
onto, so the two are at one point and can be merged with Merge
Coincident Nodes.
A piece is a set of elements connected by shared nodes. Two
pieces meshed at different sizes cannot be matched node for node,
since their node counts differ, but each node of the coarser
piece can be moved onto the nearest node of the finer one. No
node moves more than reach. The rules:
- Only nodes on the outside of the pieces move or are moved onto.
- A node moves once, and onto a node no other node moves onto.
- A node already at another node's position is a place to merge, not a move.
- The nearest pairs are taken first. As a result, a washer's lower face moves onto the frame under it, and its upper face, whose nearest frame nodes are already taken, stays.
- Of two pieces with the same mesh size, the later piece moves.
- A move that would turn an element inside out is left out.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reach
|
float
|
How far a node may move, in the stored length unit. |
required |
groups
|
sequence of int
|
The element groups whose pieces are aligned, by id; every element when omitted. |
None
|
exclude
|
sequence of int
|
Nodes left out, by id: they are not moved and nothing is moved onto them. In the app, these are the moves that were unpicked. |
None
|
Returns:
| Type | Description |
|---|---|
list of [int, int]
|
Sorted by the node moved. |
Source code in src/visualdynamics/core/geometry.py
2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 | |
align_folds
¶
Why these moves would be refused, or None.
Returns the message align_meshes raises when a move would turn
an element inside out (a solid's corner volume or a plate's
normal changing sign), so a panel can show it before the moves
are applied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
moves
|
sequence of [int, int]
|
As |
required |
Returns:
| Type | Description |
|---|---|
str or None
|
|
Source code in src/visualdynamics/core/geometry.py
align_meshes
¶
align_meshes(reach: float, groups: Ids | None = None, exclude: Ids | None = None) -> dict[str, float]
Move the nodes of the coarser piece onto the nodes of the finer
piece where they meet (align_moves), so Merge Coincident Nodes
can join them.
This is for parts meshed separately at sizes that do not match:
it makes their nodes coincide at their mating faces or where they
overlap. Nothing is merged and no node is removed. A move that
would turn an element inside out is left out by align_moves;
the call raises ValueError, naming the element, only when the
nodes left out with exclude make one of the other moves do so
(align_folds).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reach
|
float
|
How far a node may move, in the stored length unit: meters once units are defined. |
required |
groups
|
sequence of int
|
The element groups whose pieces are aligned, by id; every element of the geometry when omitted. |
None
|
exclude
|
sequence of int
|
Nodes left out, by id: neither moved nor moved onto. |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
'moved', how many nodes moved; 'farthest', the longest move, in the stored length unit. |
Source code in src/visualdynamics/core/geometry.py
delete_coordinate_systems
¶
Remove coordinate systems, and move the nodes that used them to the first remaining system.
Ids that are not present are ignored. Removing every coordinate system is refused with ValueError, since every node needs one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cs_ids
|
int or sequence of int
|
The identifiers, one or many. |
required |
Returns:
| Type | Description |
|---|---|
dict of str to int
|
'coordinate_systems', the number removed, and 'nodes_reassigned', the number of node placement and displacement references moved to the remaining system. |
Source code in src/visualdynamics/core/geometry.py
delete_groups
¶
Remove element groups with their elements, their properties, and the nodes no element outside them uses.
A node that an element of another element group also uses stays,
so a neighboring part is not cut along the nodes the two share.
Ids that are not present are ignored. To combine element groups
instead, use merge_groups.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
group_ids
|
int or sequence of int
|
The identifiers, one or many. |
required |
keep
|
sequence of int
|
Nodes that stay whatever uses them ( |
()
|
Returns:
| Type | Description |
|---|---|
dict of str to int
|
'groups', 'elements' and 'nodes', the number of each removed. |
Source code in src/visualdynamics/core/geometry.py
merge_refusal
¶
Why these element groups cannot be merged, or None when they can.
There must be at least two, all in the geometry, holding the same element types and with the same properties. A merged element group has one material and one thickness or section, so merging groups that differ would change the model without saying so.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
group_ids
|
sequence of int
|
The element groups, by identifier. |
required |
Returns:
| Type | Description |
|---|---|
str or None
|
|
Source code in src/visualdynamics/core/geometry.py
merge_groups
¶
Merge several element groups into the first one (Merge Element Groups).
The elements of the others are moved into the first group, and
the others are removed with their properties. Raises ValueError
with the reason from merge_refusal when the groups cannot be
merged.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
group_ids
|
sequence of int
|
The element groups; the first keeps its id, name and properties. |
required |
Returns:
| Type | Description |
|---|---|
dict of str to int
|
'into', the id of the element group kept; 'groups', how many were merged into it; 'elements', how many elements moved. |
Source code in src/visualdynamics/core/geometry.py
delete_elements
¶
Remove elements by id. Ids that are not present are ignored.
With nodes, the nodes used only by these elements are removed
too, which is what deleting an element group (delete_groups)
and deleting elements in the app do. A node another element uses
stays, and so does a node in keep: the project keeps the nodes
its data is measured or solved at (Project.delete_elements), so
redrawing a test geometry's panels leaves its measurement points.
nodes is off by default because the merge removes the links it
collapses and then remaps their nodes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
elem_ids
|
int or sequence of int
|
The identifiers, one or many. |
required |
nodes
|
bool
|
Also remove the nodes only these elements used. |
False
|
keep
|
sequence of int
|
Nodes never removed that way. |
()
|
Returns:
| Type | Description |
|---|---|
dict of str to int
|
'elements', the number removed, and with |
Source code in src/visualdynamics/core/geometry.py
save
¶
Write the geometry to a file of its own.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or PathLike
|
Where to write it. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/visualdynamics/core/geometry.py
load
classmethod
¶
load(path: str | PathLike) -> Geometry
Read a geometry written by save.
Raises TypeError when the file holds something other than a geometry.
Source code in src/visualdynamics/core/geometry.py
plot
¶
plot(unit_system: UnitSystem | None = None, **kwargs: Any) -> Any
Draw the geometry's nodes and elements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unit_system
|
UnitSystem
|
Units to draw in. |
None
|
**kwargs
|
Any
|
Passed through to the scene. |
{}
|
Returns:
| Type | Description |
|---|---|
object
|
The plot widget or plotter. |
Source code in src/visualdynamics/core/geometry.py
plot_dofs
¶
plot_dofs(source: Any, quantity: str, unit_system: UnitSystem | None = None, **kwargs: Any) -> Any
Draw this geometry with a labeled arrow at every DOF where
source has quantity, as the app's DOF arrows do.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
DataArray
|
The object whose degrees of freedom are drawn. |
required |
quantity
|
str
|
Which quantity's DOFs to show, such as 'acceleration'. |
required |
unit_system
|
UnitSystem
|
Units to draw in. |
None
|
**kwargs
|
Any
|
Passed through to the scene. |
{}
|
Returns:
| Type | Description |
|---|---|
object
|
The plotter the scene is in. |
Source code in src/visualdynamics/core/geometry.py
plot_channels
¶
plot_channels(table: Any, role: str = 'all', unit_system: UnitSystem | None = None, **kwargs: Any) -> Any
Draw this geometry with a labeled arrow at each channel's DOF in a channel table, as the app does when the two are selected together.
A channel with no node or direction yet, or at a node this geometry does not have, has no arrow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
ChannelTable
|
The channels to draw. |
required |
role
|
str
|
'reference', 'response' or 'monitor' to draw only the channels in that role, 'control' for the channels with Control checked, or 'all' for every channel. |
'all'
|
unit_system
|
UnitSystem
|
Units to draw in. |
None
|
**kwargs
|
Any
|
Passed through to the scene. |
{}
|
Returns:
| Type | Description |
|---|---|
object
|
The plotter the scene is in. |
Source code in src/visualdynamics/core/geometry.py
Functions:¶
element_family
¶
Which family a 2412 element code belongs to.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code
|
int
|
The element type code. |
required |
Returns:
| Type | Description |
|---|---|
str
|
One of |
Source code in src/visualdynamics/core/geometry.py
placed
¶
A point given in a coordinate system, converted to global cartesian.
kind is the system's CS_TYPES code and matrix its (4, 3)
rows: three directions, then the origin. A cylindrical system gives
(r, theta, z) and a spherical one (r, theta from +z, phi), with the
angles in degrees in both, which is the convention of the universal
file, Nastran's CORD2C and CORD2S, and sdynpy.
Source code in src/visualdynamics/core/geometry.py
written_in
¶
The inverse of placed: a global cartesian point in the
coordinates of a system, so a file can be written with its nodes in
the systems they were read in.
Source code in src/visualdynamics/core/geometry.py
to_global
¶
to_global(node_xyz: ArrayLike, node_def_cs: ArrayLike, cs_id: Ids, cs_type: ArrayLike, cs_matrix: ArrayLike) -> ndarray
Node coordinates given in each node's own placement system,
converted to global cartesian, which is what Geometry stores.
A file gives each node's position in the coordinate system the node
is placed in, its def_cs. Reading those numbers as global would put
the node in the wrong place. A node whose system is not among the
given systems, or is the global system, keeps its coordinates as
written.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_xyz
|
array - like
|
|
required |
node_def_cs
|
array - like
|
The frame each node is placed in. |
required |
cs_id
|
array - like
|
The frames themselves, as |
required |
cs_type
|
array - like
|
The frames themselves, as |
required |
cs_matrix
|
array - like
|
The frames themselves, as |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
|
Source code in src/visualdynamics/core/geometry.py
to_local
¶
to_local(node_xyz: ArrayLike, node_def_cs: ArrayLike, cs_id: Ids, cs_type: ArrayLike, cs_matrix: ArrayLike) -> ndarray
The inverse of to_global, for a writer that gives each node in
the coordinate system it is placed in.
Source code in src/visualdynamics/core/geometry.py
reconcile_type
¶
The descriptor that matches the number of nodes an element has, when the file's descriptor and node count disagree.
A file gives both, and they can contradict each other. The node count is taken as correct, and a descriptor with the wrong count is replaced by the one in the same family with that many nodes: 41 (a plane-stress triangle) with four nodes becomes 44, the plane-stress quadrilateral. Dataset 2412 numbers each family within one decade, triangles before quadrilaterals, which is how the replacement is found. When no descriptor in the family fits, the original is kept, since an element that cannot be identified is better kept as written than renamed to a guess.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code
|
int
|
The descriptor the file gave. |
required |
node_count
|
int
|
How many nodes the file actually listed for it. |
required |
Returns:
| Type | Description |
|---|---|
int
|
The descriptor to use. |
Source code in src/visualdynamics/core/geometry.py
face_corners
¶
How many corners a face element is drawn with: three for a triangle and four for a quadrilateral, whatever family its descriptor names and however many nodes it has.
It is read from the name in ELEMENT_TYPES and not from the node
count, because a nine-node cubic triangle and a nine-node
quadrilateral have the same count.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code
|
int
|
The element's descriptor. |
required |
Returns:
| Type | Description |
|---|---|
int
|
3 or 4. |
Source code in src/visualdynamics/core/geometry.py
solid_faces
¶
The faces of a solid cell with this many nodes, each face as positions in the cell's node list.
A higher-order cell is drawn by its corner nodes, which come first in its node list. An unknown node count gives an empty tuple.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_count
|
int
|
How many nodes the cell names. |
required |
Returns:
| Type | Description |
|---|---|
tuple of tuple of int
|
|
Source code in src/visualdynamics/core/geometry.py
deck_to_si
¶
deck_to_si(properties: Mapping[int, Any], length_unit: str, mass_unit: str, inverse: bool = False) -> dict[int, Any]
A finite element deck's element group properties converted to SI
from the consistent system length_unit, mass_unit and seconds
make (or back, with inverse).
Force is mass times length per second squared, so a modulus scales by mass/length, a density by mass/length³, a thickness by length, a point mass by mass, a spring along an axis (force per length) by mass and a spring about one (force times length per radian) by mass·length². A beam section scales by its powers of length. Names and directions are kept.
Source code in src/visualdynamics/core/geometry.py
implausible_materials
¶
A sentence for each material whose modulus or density, in SI, is
outside what a structural material has (PLAUSIBLE_MODULUS,
PLAUSIBLE_DENSITY).