Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APLOT results in the deletion of areas and area components. #3372

Closed
4 tasks done
mikerife opened this issue Aug 26, 2024 · 5 comments · Fixed by #3421
Closed
4 tasks done

APLOT results in the deletion of areas and area components. #3372

mikerife opened this issue Aug 26, 2024 · 5 comments · Fixed by #3421
Labels
bug Issue, problem or error in PyMAPDL

Comments

@mikerife
Copy link

mikerife commented Aug 26, 2024

🤓 Before submitting the issue

🔍 Description of the bug

An area component exists. APLOT command is issued. The area component then no longer exists. The area list changes from 1 and 2 when created to 3 and 4 after plotting. Something is copying areas and accidentally deleting the original areas. PyMAPDL version 0.68.4

🕵️ Steps To Reproduce

from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl(loglevel="WARNING", print_com=True)
mapdl.clear()
mapdl.prep7()
mapdl.rectng(0, 1, 0, 1)
mapdl.cm('area1', 'area')
mapdl.cmsel('u', 'area1')
mapdl.rectng(2, 4, -1, 1)
mapdl.cm('area2', 'area')
mapdl.allsel()
mapdl.cmsel('all')
print(mapdl.cmlist('all'))
print(mapdl.alist())
mapdl.aplot()
mapdl.cmsel('all')
mapdl.allsel()
print(mapdl.alist())
print(mapdl.cmlist('all'))
mapdl.exit()

💻 Which Operating System are you using?

Windows

🐍 Which Python version are you using?

3.10

💾 Which MAPDL version are you using?

2024R1

📝 PyMAPDL Report

Show the Report!

# PASTE HERE THE OUTPUT OF `python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())"` here

📝 Installed packages

Show the installed packages!

# PASTE HERE THE OUTPUT OF `python -m pip freeze` here

📝 Logger output file

Show the logger output file.

# PASTE HERE THE CONTENT OF THE LOGGER OUTPUT FILE.

@mikerife mikerife added the bug Issue, problem or error in PyMAPDL label Aug 26, 2024
@mikerife mikerife changed the title APLOT results in the deletion of area components. APLOT results in the deletion of areas and area components. Aug 26, 2024
@ansys ansys deleted a comment Aug 26, 2024
@pvargasm
Copy link
Collaborator

Hi all!!

I get quite the same issue, but using mapdl.geometry.get_areas() instead of mapdl.aplot(). In my case the component is not deleted, but the defined areas are increasing.

Here is my piece of code:

from ansys.mapdl.core import launch_mapdl

mapdl = launch_mapdl(loglevel="WARNING", print_com=True)

mapdl.prep7()

# Create block
mapdl.block(0, 1, 0, 1, 0, 1)
print(mapdl.alist())

# Associate one block area to a component "test1"
mapdl.asel(type_="R", vmin=2, vmax=2)
mapdl.cm("test1", "AREA")
print(mapdl.alist())

# Get associated area to be plotted
poly_cm = mapdl.geometry.get_areas()
print(mapdl.alist())

# Select all areas to continue
mapdl.allsel()
print(mapdl.alist())

# Get all areas to be plotted
poly_all = mapdl.geometry.get_areas()
print(mapdl.alist())

# Select all areas to continue
mapdl.allsel()
print(mapdl.alist())

mapdl.exit()

@germa89 germa89 pinned this issue Sep 18, 2024
@pvargasm
Copy link
Collaborator

Assumption: if line where component names are stored corresponds to the new components created internally by pymapdl to generate the new meshed areas and get the PolyData, then a filtering could solve the issue... In my simple example I use

            self.selection_sets_comps.append(
                tuple(
                    i
                    for i in self._parent().components.names
                    if i.startswith("_") and i.endswith("_")
                )
            )

And for the two examples above it works fine, but it is important to ensure that the assumption is correct.

@germa89
Copy link
Collaborator

germa89 commented Sep 19, 2024

i'm trying to get into this today...

I see that in @mikerife 's code, the name of the areas are changed??

Before the APLOT:

 ** WARNING: PRE-RELEASE VERSION OF MAPDL 25.1BETA
  ANSYS,INC TESTING IS NOT COMPLETE - CHECK RESULTS CAREFULLY **
 NUMBER LOOP  LINES                     AREA       ELEM SIZE    #NODES  #ELEM    MAT   REAL   TYP  ESYS   SECN
      1  1      1      2      3      4   N/A         0.000           0      0      0      0     0     0      0
      2  1      5      6      7      8   N/A         0.000           0      0      0      0     0     0      0

After

 ** WARNING: PRE-RELEASE VERSION OF MAPDL 25.1BETA
  ANSYS,INC TESTING IS NOT COMPLETE - CHECK RESULTS CAREFULLY **
 NUMBER LOOP  LINES                     AREA       ELEM SIZE    #NODES  #ELEM    MAT   REAL   TYP  ESYS   SECN
      3  1      9     10     11     12   1.000       0.000           1      4     -1     -1    -1     0     -1
      4  1     13     14     15     16   4.000       0.000           9     16     -1     -1    -1     0     -1

this is NOT acceptable.

@germa89
Copy link
Collaborator

germa89 commented Oct 10, 2024

@mikerife can you verify it runs well on your end?

@mikerife
Copy link
Author

@germa89 I can verify that yes it does. Thank you!

@germa89 germa89 unpinned this issue Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue, problem or error in PyMAPDL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@germa89 @mikerife @pvargasm and others