lsdyna-mesh-reader 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/PKG-INFO +1 -1
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/deck.cpp +12 -9
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/_deck.pyi +5 -1
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/_version.py +3 -3
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/deck.py +7 -1
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/.gitattributes +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/CMakeLists.txt +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/LICENSE +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/README.md +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/docs/source/_templates/autosummary/base.rst +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/docs/source/_templates/autosummary/class.rst +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/docs/source/_templates/autosummary/module.rst +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/docs/source/_templates/custom-class-template.rst +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/docs/source/_templates/custom-module-template.rst +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/docs/source/api.rst +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/docs/source/conf.py +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/docs/source/index.md +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/pyproject.toml +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/array_support.h +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/__init__.py +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/examples/EXP_SC_JOINT_SCREW.key +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/examples/__init__.py +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/examples/bird.k +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/examples/birdball.k +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/examples/bracket.k +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/examples/ex_13_thick_shell_elform_2.k +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/examples/wheel.k +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/py.typed +0 -0
- {lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/tools/extract-deps.py +0 -0
|
@@ -534,7 +534,13 @@ struct ElementSolidSection : public ElementSection {
|
|
|
534
534
|
}
|
|
535
535
|
|
|
536
536
|
// convert cells, offset, and celltypes to vtk style arrays
|
|
537
|
-
nb::tuple ToVTK() {
|
|
537
|
+
nb::tuple ToVTK(const bool vtk_97_wedges) {
|
|
538
|
+
// Select the LS-DYNA-to-VTK node mapping once, before assembling cells.
|
|
539
|
+
// https://docs.vtk.org/en/latest/release_details/9.7/fix-wedge-point-ordering.html
|
|
540
|
+
static constexpr int legacy_wedge_nodes[6] = {0, 1, 4, 3, 2, 5};
|
|
541
|
+
static constexpr int vtk_97_wedge_nodes[6] = {0, 4, 1, 3, 5, 2};
|
|
542
|
+
const int *wedge_nodes =
|
|
543
|
+
vtk_97_wedges ? vtk_97_wedge_nodes : legacy_wedge_nodes;
|
|
538
544
|
NDArray<uint8_t, 1> celltypes_arr = MakeNDArray<uint8_t, 1>({(int)n_elem});
|
|
539
545
|
NDArray<int64_t, 1> offsets_arr =
|
|
540
546
|
MakeNDArray<int64_t, 1>({(int)(n_elem + 1)});
|
|
@@ -566,13 +572,9 @@ struct ElementSolidSection : public ElementSection {
|
|
|
566
572
|
el_sz = 4;
|
|
567
573
|
} else if (node_ids_data[offset + 5] == node_ids_data[offset + 6]) {
|
|
568
574
|
celltypes[i] = VTK_WEDGE;
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
cells[c++] = node_ids_data[offset + 4];
|
|
573
|
-
cells[c++] = node_ids_data[offset + 3];
|
|
574
|
-
cells[c++] = node_ids_data[offset + 2];
|
|
575
|
-
cells[c++] = node_ids_data[offset + 5];
|
|
575
|
+
for (int j = 0; j < 6; ++j) {
|
|
576
|
+
cells[c++] = node_ids_data[offset + wedge_nodes[j]];
|
|
577
|
+
}
|
|
576
578
|
el_sz = 6;
|
|
577
579
|
} else {
|
|
578
580
|
celltypes[i] = VTK_HEXAHEDRON;
|
|
@@ -985,7 +987,8 @@ NB_MODULE(_deck, m) {
|
|
|
985
987
|
.def(nb::init())
|
|
986
988
|
.def("__repr__", &ElementSolidSection::ToString)
|
|
987
989
|
.def("__len__", &ElementSolidSection::Length)
|
|
988
|
-
.def("to_vtk", &ElementSolidSection::ToVTK
|
|
990
|
+
.def("to_vtk", &ElementSolidSection::ToVTK,
|
|
991
|
+
nb::arg("vtk_97_wedges") = false)
|
|
989
992
|
.def_ro("eid", &ElementSolidSection::eid, nb::rv_policy::automatic)
|
|
990
993
|
.def_ro("pid", &ElementSolidSection::pid, nb::rv_policy::automatic)
|
|
991
994
|
.def_ro("node_ids", &ElementSolidSection::node_ids,
|
|
@@ -38,7 +38,11 @@ class ElementSection:
|
|
|
38
38
|
def to_vtk(self) -> Tuple[LongArray1D, LongArray1D, Uint8Array1D]: ...
|
|
39
39
|
|
|
40
40
|
class ElementShellSection(ElementSection): ...
|
|
41
|
-
|
|
41
|
+
|
|
42
|
+
class ElementSolidSection(ElementSection):
|
|
43
|
+
def to_vtk(
|
|
44
|
+
self, vtk_97_wedges: bool = False
|
|
45
|
+
) -> Tuple[LongArray1D, LongArray1D, Uint8Array1D]: ...
|
|
42
46
|
|
|
43
47
|
class _Deck:
|
|
44
48
|
def __init__(self, fname: str) -> None: ...
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.2.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 2,
|
|
21
|
+
__version__ = version = '0.2.1'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 2, 1)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g9f6cabd'
|
|
@@ -262,8 +262,14 @@ class Deck:
|
|
|
262
262
|
celltypes: List[NDArray[np.uint8]] = []
|
|
263
263
|
cells: List[NDArray[np.integer]] = []
|
|
264
264
|
part_ids = []
|
|
265
|
+
vtk_97_wedges = pv.vtk_version_info >= (9, 7)
|
|
265
266
|
for section in element_sections:
|
|
266
|
-
|
|
267
|
+
if isinstance(section, ElementSolidSection):
|
|
268
|
+
section_cells, section_offset, section_celltypes = section.to_vtk(
|
|
269
|
+
vtk_97_wedges=vtk_97_wedges
|
|
270
|
+
)
|
|
271
|
+
else:
|
|
272
|
+
section_cells, section_offset, section_celltypes = section.to_vtk()
|
|
267
273
|
if offsets:
|
|
268
274
|
# we need to shift by the last value of the last offset
|
|
269
275
|
offsets.append(section_offset[1:] + offsets[-1][-1])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/docs/source/_templates/autosummary/base.rst
RENAMED
|
File without changes
|
{lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/docs/source/_templates/autosummary/class.rst
RENAMED
|
File without changes
|
{lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/docs/source/_templates/autosummary/module.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/examples/__init__.py
RENAMED
|
File without changes
|
{lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/examples/bird.k
RENAMED
|
File without changes
|
{lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/examples/birdball.k
RENAMED
|
File without changes
|
{lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/examples/bracket.k
RENAMED
|
File without changes
|
|
File without changes
|
{lsdyna_mesh_reader-0.2.0 → lsdyna_mesh_reader-0.2.1}/src/lsdyna_mesh_reader/examples/wheel.k
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|