Open iceblink-ansys opened 1 year ago
Just noticed that there is also a: /EFACET,4 in the APDL script. And according to the manual "/EFACET may affect results averaging."
Is there a way to do the same in PyAnsys?
Hi @iceblink-ansys
This is quite interesting topic, I'm going to ping @mikerife and @pmaroneh. Also @pvargasm which did an interesting job about averaging element/nodal.
So it seems that these are the relevant commands: /GRAPHICS,POWER AVRES,1, /POST1 /EFACET,4 PRNSOL,S,COMP
Hi @iceblink-ansys See the PyMAPDL documentation - there is an implementation of the /efacet apdl command: https://mapdl.docs.pyansys.com/release/0.63/mapdl_commands/post1/_autosummary/ansys.mapdl.core.Mapdl.efacet.html?highlight=efacet#ansys.mapdl.core.Mapdl.efacet
MAPDL in batch uses Full Graphics by default, so be sure to be consistent there (MAPDL interactive uses Power graphics by default). That can affect averaging as well. I suggest using Full graphics in each method and compare the results.
Mike
We need to gather all of this somewhere... Maybe the FAQ section
MAPDL in batch uses Full Graphics by default, so be sure to be consistent there (MAPDL interactive uses Power graphics by default). That can affect averaging as well. I suggest using Full graphics in each method and compare the results.
@mikerife do you mean that the graphics configuration can affect listing output (i.e. PRNSOL
) as well??
Hi @germa89 yes. The get and vget (and some other apdl commands) always execute with full graphics even if power graphics is activated. Mike
Hi @iceblink-ansys See the PyMAPDL documentation - there is an implementation of the /efacet apdl command: https://mapdl.docs.pyansys.com/release/0.63/mapdl_commands/post1/_autosummary/ansys.mapdl.core.Mapdl.efacet.html?highlight=efacet#ansys.mapdl.core.Mapdl.efacet
MAPDL in batch uses Full Graphics by default, so be sure to be consistent there (MAPDL interactive uses Power graphics by default). That can affect averaging as well. I suggest using Full graphics in each method and compare the results.
Mike
How does one set these options for ansys-mapdl-reader though? Or is that not possible and should I just fully switch to ansys-mapdl-core instead? That would be a shame, the reader is really easy to use.
On a sidenote: why is reading of result files not implemented as an iterator object? Loading the entire result file into memory is a bit excessive. And where is the proper place to ask questions such as this?
Hi @iceblink-ansys I just realized that I messed up my previous answer as I had PyMAPDL in mind. Let me revisit this. Mike
Hi @iceblink-ansys
Regarding your questions...
How does one set these options for
ansys-mapdl-reader
though? Or is that not possible and should I just fully switch toansys-mapdl-core
instead? That would be a shame, the reader is really easy to use.
Well... I agree reader
is very easy to use, unfortunately the decision is to deprecate reader
in favor of DPF-Core/Post. The reader is reading the binary directly so I presume the graphics configuration should not affect much. I do believe it will affect in the CDB
files because I think the respective graphics commands are written in it. Probably @pmaroneh and @mikerife can add more on this.
On a sidenote: why is reading of result files not implemented as an iterator object? Loading the entire result file into memory is a bit excessive. And where is the proper place to ask questions such as this?
It is an interesting concept. Well.... one of the reasons to use DPF is that it implements lazy evaluation, so the RST file is not loaded fully until needed. That is why also we are working on replace reader
by DPF
. See https://github.com/pyansys/pymapdl/pull/1300
Hi @iceblink-ansys I just realized that I messed up my previous answer as I had PyMAPDL in mind. Let me revisit this. Mike
Don't worry at all. Think about it and let me know your conclusions, I will do the corresponding changes asap. :)
Well... I agree
reader
is very easy to use, unfortunately the decision is to deprecatereader
in favor of DPF-Core/Post. The reader is reading the binary directly so I presume the graphics configuration should not affect much. I do believe it will affect in theCDB
files because I think the respective graphics commands are written in it. Probably @pmaroneh and @mikerife can add more on this.On a sidenote: why is reading of result files not implemented as an iterator object? Loading the entire result file into memory is a bit excessive. And where is the proper place to ask questions such as this?
It is an interesting concept. Well.... one of the reasons to use DPF is that it implements lazy evaluation, so the RST file is not loaded fully until needed. That is why also we are working on replace
reader
byDPF
. See pyansys/pymapdl#1300
Thanks for that, I guess I need to have a look at DPF-Core. (I was under the impression that one always needs a GUI for the DPF modules, and I only have a CLI). I was now looking into PyMapdl but that seems to be an almost one-on-one passthrough of APDL commands. Maybe good enough for now, but (like all new Ansys users) I'm trying to avoid the archaic (yet powerful) APDL as much as possible.
Update: seems like DPF-Core is not able to do anything with result files older than v2021, so unfortunately this is not (yet) an option for me. It's okay for me to tinker around with the latest and greatest PyAnsys, but our result files will be old for quite a while...
Update: seems like PDF-Core is not able to do anything with result files older van v2021, so unfortunately this is not (yet) an option for me. It's okay for me to tinker around with the latest and greatest PyAnsys, but our result files will be old for quite a while...
Interesting...
@PProfizi @cbellot000 can you confirm this??
On a sidenote: why is reading of result files not implemented as an iterator object? Loading the entire result file into memory is a bit excessive. And where is the proper place to ask questions such as this?
Excellent question. It absolutely should be an iterator, but the decision to go down the path of loading the entire file to memory was made as a memory/CPU tradeoff.
How does one set these options for ansys-mapdl-reader though? Or is that not possible and should I just fully switch to ansys-mapdl-core instead? That would be a shame, the reader is really easy to use.
I'm afraid that the best way to do this would now (as mentioned by @germa89), would be to use PyDPF-Core. This reader will always have a relatively limited functionality since it's a rewrite (based on public FORTRAN headers) of how MAPDL reads rst files, rather than directly using the same libraries (as used with DPF).
Regardless, I appreciate the feedback and @PProfizi, I though we supported earlier than v2021 result files. I think you just need the latest install and you should be able to read older files. @iceblink-ansys, post any traceback you get from attempting to read those files in PyDPF-Core Issues.
Hi @akaszynski, @iceblink-ansys, concerning DPF, it is shipped within the ANSYS Workbench unified install since 2021.1, yet it should be able to read results as old as version "10.0".
Thanks for looking into it. Maybe it's simply a matter of removing the hardcoded version check then :)
See https://github.com/pyansys/pydpf-core/issues/748#issue-1525594177
🔍 Before submitting the issue
🐞 Description of the bug
For some reason the results from PyMAPDL-reader are not the same as from mapdl in batch mode, though the stress order of magnitude is somewhat similar.
PyMAPDL-Reader Software and Environment Report
Date: Tue Dec 20 16:54:15 2022 CET
Python 3.7.13 (default, Apr 28 2022, 08:00:21) [GCC 8.2.0]
ansys.mapdl.reader : 0.52.4 tqdm : 4.64.1 matplotlib : 3.5.3 ansys.mapdl.core : 0.63.4 scipy : 1.7.3
example output:
PyMAPDL:
mapdl:
📝 Steps to reproduce
I am extracting stress using PyMAPDL Reader (v2022, python 3.7, virtual environment). Reading a result file (generated by v18) into a Result Class, and then using "nodal_stress" method on the result class.
Then I compare the output with older output that was generated using an APDL script, using mapdl v18 in batch mode. Using the same result file. Using "PRNSOL,S,COMP".
Using only corner nodes on outside surfaces of solid-element components
💻 Which operating system are you using?
Linux
🐍 Which Python version are you using?
3.7
📦 Installed packages