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

Adding string array and 3d array support #1729

Merged
merged 5 commits into from
Dec 23, 2022
Merged

Conversation

germa89
Copy link
Collaborator

@germa89 germa89 commented Dec 21, 2022

String arrays

Now you can retrieve them if you know the name.

String arrays cannot be listed in MAPDL hence the user needs to track when an string array is created, because they won't appear in mapdl.parameters.

If they have more than one dimension, they are appended linearly. Hence an string array more than 2D is not recommended because the order might not be maintaned.

3D arrays

You can retrieve them using mapdl.parameters['arrayname'].
You can set them using normal MAPDL commands:

mapdl.dim("myarr", "array", 2, 2, 2)
mapdl.run("myarr(1,1,1)= 100")
mapdl.run("myarr(1,1,2)= 200")
mapdl.run("myarr(1,2,2)= 300")
mapdl.run("myarr(2,1,2)= 400")

Eventually, one day, I will figure out how a way to write them. But I believe the mapping between numpy arrays and MADPL arrays is not going to be trivial.

@germa89 germa89 added the Enhancement Improve any current implemented feature label Dec 21, 2022
@germa89 germa89 self-assigned this Dec 21, 2022
@github-actions github-actions bot added the New Feature Request or proposal for a new feature label Dec 21, 2022
@codecov
Copy link

codecov bot commented Dec 22, 2022

Codecov Report

Merging #1729 (646139c) into main (5e57a31) will increase coverage by 0.11%.
The diff coverage is 92.30%.

@@            Coverage Diff             @@
##             main    #1729      +/-   ##
==========================================
+ Coverage   85.26%   85.38%   +0.11%     
==========================================
  Files          45       45              
  Lines        7506     7567      +61     
==========================================
+ Hits         6400     6461      +61     
  Misses       1106     1106              

@germa89 germa89 merged commit b16cc20 into main Dec 23, 2022
@germa89 germa89 deleted the feat/string-array-getter branch December 23, 2022 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improve any current implemented feature New Feature Request or proposal for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant