Skip to content

Is it possible to automatically read Ansys Mechanical available inputs #2397

Answered by germa89
ValentynBarannik asked this question in Q&A
Discussion options

You must be logged in to vote

Hello!

For changing things such as boundary conditions given a ds.dat file, you have two approaches if you want to use PyMAPDL:

  • Run the ds.dat file using mapdl.input. Then you will have all the model in memory. Then you can change things, like boundary conditions using MAPDL commands such as mapdl.d, mapdl.f, etc. You should have also the components, so it should be easy to reuse them to apply/modify loads.
  • Replace in the ds.dat file the hardcoded values. You can open ds.dat file within python (open("ds.dat", "r") as ...), replace/modify the lines you want, and then submit the job to MAPDL using mapdl.input_strings.

I'm afraid there is not a more dynamic approach with setters, getters, …

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@ValentynBarannik
Comment options

@germa89
Comment options

@ValentynBarannik
Comment options

@germa89
Comment options

Answer selected by germa89
Comment options

You must be logged in to vote
2 replies
@germa89
Comment options

@germa89
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants