Skip to content

Commit

Permalink
Fix 2D plate example (#2558)
Browse files Browse the repository at this point in the history
* Adding finish command

* Using solution() call.

* making sure it is not excluded.

* reorder the parts

* Revert "Fixing some plot bugs (#2537)"

This reverts commit 00d49f6.

* Reapply "Fixing some plot bugs (#2537)"

This reverts commit fc72567.

* Undoing components selection. It does not make sense.
  • Loading branch information
germa89 authored Dec 15, 2023
1 parent 00d49f6 commit 1913532
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
3 changes: 2 additions & 1 deletion doc/source/examples/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. _ref_examples:


.. toctree::
Expand All @@ -11,6 +10,8 @@
extended_examples/index.rst


.. _ref_examples:

========
Examples
========
Expand Down
6 changes: 4 additions & 2 deletions examples/00-mapdl-examples/2d_plate_with_a_hole.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@
# Solve the Static Problem
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Solve the static analysis
mapdl.run("/SOLU")
mapdl.solution()
mapdl.antype("STATIC")
output = mapdl.solve()
mapdl.finish()
print(output)

###############################################################################
Expand Down Expand Up @@ -313,9 +314,10 @@ def compute_stress_con(ratio):

# Solve the Static Problem
# ~~~~~~~~~~~~~~~~~~~~~~~~
mapdl.run("/SOLU")
mapdl.solution()
mapdl.antype("STATIC")
mapdl.solve()
mapdl.finish()

# Post-Processing
# ~~~~~~~~~~~~~~~
Expand Down
12 changes: 1 addition & 11 deletions src/ansys/mapdl/core/mesh/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def _parse_vtk(
# Store original ANSYS element and node information
try:
grid.point_data["ansys_node_num"] = nnum

except ValueError:
grid.point_data["ansys_node_num"] = (
mesh._mapdl.nlist(kinternal="internal").to_array()[:, 0].astype(np.int32)
Expand All @@ -167,17 +168,6 @@ def _parse_vtk(
grid.cell_data["ansys_etype"] = mesh._ans_etype
grid.cell_data["ansys_elem_type_num"] = mesh.etype

# add components
# Add element components to unstructured grid
for key, item in mesh.element_components.items():
mask = np.in1d(mesh.enum, item, assume_unique=True)
grid.cell_data[key] = mask

# Add node components to unstructured grid
for key, item in mesh.node_components.items():
mask = np.in1d(nnum, item, assume_unique=True)
grid.point_data[key] = mask

# store node angles
if angles is not None:
if angles.shape[1] == 3:
Expand Down

0 comments on commit 1913532

Please sign in to comment.