-
Notifications
You must be signed in to change notification settings - Fork 844
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
PyAMG Error during SU2-PyAMG run #948
Comments
Hi Mirac, The pyamg website is based on an fork of Vic's that's very out of date. The branch feature_adap handles all the pyamg and GMF I/O library installation if you just follow the usual installation instructions (either using preconfigure.py or the meson scripts) in the v7 instructions. Just keep in mind that it's a bit experimental still. The most up-to-date version of pyamg is included, but note that it requires python 3.7 or greater. Brian |
Hi @bmunguia ,
The build didn't show any errors, only few warnings during meson ( When I try to run the mesh_adaption (or even run simply the solver through parallel_computation.py):
It immediately shows an error (without even showing the SU2 splash screen) : Am I missing any dependencies? |
The _amgio extension should be built by default. I haven't had any issues on any of the machines I've built on, so I appreciate the feedback. Just curious, are you running with python >=3.7? The shebang in all the SU2 python scripts
uses whatever python is set to in your environment variables, but pyamg/_amgio will only build/run with python >=3.7. Could you also check if the _amgio extension was installed in your site-packages (probably located in ~/.local/lib/python3.x/site-packages)? If it didn't build/install, you could go into extensions/AMGIO/su2io and run
If it did build/install, try the command
|
Hi @bmunguia ,
Shall I remove python2.7 as well? During compilation the following warning appears:
Moreover later on the script (even if it asks me for permissions, and I provide the password):
|
I just updated the build to use the --user flag so it shouldn't require permissions. Can you pull and try installing again? Just run the same meson command as before with --reconfigure As for the missing header, I think that's an issue with your python setup. Don't remove python2.7 from your system, since a lot of packages still depend on it. How did you install python? If you run |
Thanks for the commit, I've installed it using your hints (I also changed some aliases to always point to python3), and now As far as /home/antares/Downloads/SALOME-9.3.0-UB18.04-SRC/BINARIES-UB18.04/Python/include/python3.6/Python.h
/home/antares/Downloads/SALOME-9.3.0-UB18.04-SRC/BINARIES-UB18.04/gmsh/include/FieldPython.h
/home/antares/Downloads/SALOME-9.3.0-UB18.04-SRC/BINARIES-UB18.04/gmsh/include/simpleFunctionPython.h
/home/antares/Downloads/ThirdParty-v1806/ParaView-v5.5.2/VTK/Utilities/Python/vtkPython.h
/home/antares/OpenFOAM/ThirdParty-v1806/ParaView-v5.5.2/VTK/Utilities/Python/vtkPython.h
/usr/include/python3.6m/Python.h Thanks |
The corners warning is fine. I added the ability to specify corner points for sharp features that the user wants to maintain. For example, in an airfoil test case I want to make sure the sharp trailing edge at node 512 is maintained, so I can manually add
to the end of my mesh. It's not necessary, though, and AMG performs ridge detection to identify any features anyway. I assume since it built and (kinda) ran that you managed to fix your python setup through your aliases? What was the specific error that you got? I probably should have also mentioned that I've changed a lot of options since updating from Vic's old code. Here are the list of required options (values from my test case):
Some optional options:
|
FYI, just so I can keep debugging the RANS adaptation in feature_adap_sst, I've merged it into feature_adap. You should use feature_adap instead from here on out since feature_adap_sst will be pretty volatile. I'll modify my comment above in case anybody references this thread. |
Thanks for the reply, I'll use feature_adap. Also very appreciated the required and optional command list. Let me briefly summarize the case I'm testing:
I would expect then the solver to start, reach iteration number 2999, adapt the flow mesh, then run until 4999, adapt, 6999 adapt, reach 10000 iterations. |
Yeah the config is a bit confusing. The initial CFD run (in adap/ini) uses the value specified in ITER (unless RESTART_SOL= YES, then it runs one iteration just to get force coefficients). After that, it runs a series of adaptations based on the settings in PYADAP_SUBITE, PYADAP_FLOW_ITER, and PYADAP_COMPLEXITY.
This is done PYADAP_SUBITE[0] times. Then it moves on to the next mesh level. I admit that I haven't really debugged the feature-based (e.g. Mach-based) adaptation much. I found a couple bugs in the python scripts and just updated them, so could you pull again and rerun ninja? The AMG output is pretty long, but since it's developed at Inria, I don't have any control over that. I guess as long as none of the lines are error statements (usually complaining about invalid projections or negative eigenvalues of the metric from my experience) it should be fine. The only actual information I get from amg.log is usually in the last line
which just tells you how many points are in the old vs. new mesh, but you could just look at the .su2 files for that. Another important note is that the python version of AMG currently only supports triangle and tetrahedral volume elements. |
Sorry for the delay, I managed to clone the Now during the computation I think it manages to go through the Is this branch providing similar convergence rates as SU2 7.0.3 ? Thank you very much for the support! |
It's basically 7.0.3, but I've modified the gradient correction, viscous flux Jacobian, and pretty much the entire SST solver. Are you using any of those? If you give me more info about your case and the convergence problems, I can look into it |
Hi @antares190,
Glad to see that things seem to be starting to work for you. We (Brian) are trying to improve this capability in the solver and any experiences / suggestions / help will be welcome.
With that said, this seems like an interesting result. Would you mind submitting it (or other pictures that you like better) so the SU2 Foundation can use it to show this capability to others in the future? The link where you can do this is here<http://su2foundation.org/su2-promotional-material/?utm_source=hs_email&utm_medium=email&utm_content=76584389&_hsenc=p2ANqtz-9fEq2awKk2vd155cCcN_N4mWBCZK-rJ-TqNsZhqSJs-VWn-w7q-H6w8sdiA3LyuOTqlK4eqZhFFstKi-LQFyyGqYPdkwYc9JsNdB1yyd7pqMwTFzA&_hsmi=76584389>.
Thanks a lot,
Juan
On Apr 29, 2020, at 1:38 PM, antares190 <notifications@github.com<mailto:notifications@github.com>> wrote:
Thanks Brian,
my bad, I misinterpreted the carpets / logs structure. I successfully ran a test of a very simple case. In the results there are some small artifacts, but the shocks are resolution improved consistently after mesh adaption.
Thanks for the support
[Comparison]<https://user-images.githubusercontent.com/41752169/80644172-84a7a580-8a69-11ea-9f16-58e98c808b73.png>
[ComparisonMesh]<https://user-images.githubusercontent.com/41752169/80644174-85403c00-8a69-11ea-819f-2ac00550a089.png>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#948 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA5FFRCGLBHJCB3FS4JSSV3RPCF5RANCNFSM4MQACOXA>.
|
Thanks for the hint, just uploaded a screenshot of the mesh adaption!
Which in turn creates an invalid Btw the final error in the terminal is but I think the problem arises before reaching
Thanks! |
I just tested the 3D adaptation on an ONERA M6 and it seems to be working fine for me. I just updated AMGIO to include surface/volume element orientation checks, not sure if that'll help with your issue. If the updated code doesn't fix things, can you upload your initial mesh, flow restart, and the flo.meshb and flo.solb files from adap/ini? |
Hi Brian, After your last commit I recompiled everything, moreover now I'm using The tool is working nice, once the smoothing, grad, adaption values are tuned, thank you very much! After a bit of use may I add pair of feature request, that in my opinion would improve the overall (already remarkable) quality of the
Bugs (or at least unexpected behavior):
Clarification
|
Hi everyone,
The response I have obtained is the following:
As expected, a Did I perform the procedure correctly? Or did I miss something? Thank you for the big help |
@chesiv Did you ever get this working? =) I'd be interested to hear your workflow for newbies! |
@chesiv (and also @timjim333) I confirm that the output you described is the expected one. In the *.cfg file I also make sure to add CSV tabular output management, as well as ASCII outputs. The python script to run the case with mesh adaptation is :
To answer @chesiv question, in the |
Thanks for the walkthrough, @antares190 ! Actually, I also seem to be having some issues installing this branch successfully (but I'm not sure if it is also present in v7.0.8). When I try to
@bmunguia I realised that when I try to compile this branch, it seems to pick up the wrong python paths. (Though I'm not 100% sure if this is the cause.) i.e. running: reports:
Where the |
@timjim333 it could be an issue with shared libraries, which ultimately is a path issue, as you suspected. In the latter case, you can check if your python is configured to enable shared libraries. To do it, according to this, in the python shell you can type To recap, a "workflow for newbies" which appears to be working for me is
These passages, at least for me, result in a running SU2 with mesh adaptation, although I have made no tests on running actual simulations. That being said, the involvement of pyenv is due to the fact that the provided python wheel for pyamg is for python 3.7 only. If I understand correctly, the library itself is proprietary, sadly, so I assume @bmunguia has access either to the source files or to someone who can package them. Depending on the actual compatibility of the code, it would be nice if the wheel was updated to the latest python version, or at least the dependency on 3.7.* was removed. @chesiv you can also try checking the logs in the |
Thanks for the tips so far! By any chance do you know which part of the configuration/path search that results in the line that says:
I can't figure out why it picks up my environment 3.7 (which has the mpi4py installed) correctly, but then somehow pulls in 3.6! Thanks very much! |
Hi, @champagneproblems thank. I managed to get my amg to find the I'm getting an issue now where the script seems to crash while
When I check the
I figured that that this might not be an AMG issue but a 7.0.3 build issue, so I tried running
Do you know what |
Ok, I went back to try varying the
in order for the amg mesh adaptation to function. However, for some reason, I can't get it working for my actual mesh of interest. When using the same settings, I get a different ParMETIS error (from the
The only difference that I can think of is that my flow is fully supersonic and my mesh is an unstructured core with a structured collar - might this be causing the issue? Kind regards. |
I made a fully unstructured version of the mesh and it seems I can now pass the
UPDATE: Bizarrely, if I attempt to run the adaptation script again, it now fails earlier with the same UCX Connection reset error:
Is this a bug? UPDATE: This seems to have gone away pulling a different version OpenMPI and recompiling. |
I was running some tests using a simple geometry but for the refinement seems to be chewing up the geometry. Has anyone who has worked on 3D geometries experienced this or figured out a way to avoid this? I was using the following settings:
I noticed a few comments up, there is the |
I experienced the issue you described and tried different strategies to mitigate it. As a way around to this I separated into different zones/groups the parts of the surface mesh I wanted to “freeze”, this approach works as the mesh adaptation always respect/keeps the original mesh edge position. The approach above obviously helps mitigating the issue, surface mesh quality is still highest in the initialization mesh. As this method only mitigates the problem, please share your experience! Any other indication/suggestion is very welcome! |
@antares190 running some more tests, I'm not sure that the adapted grid is still on the surface any more, especially on the trailing edge. Or perhaps it is, but it has lost associativity with its neighbour? This also seems to be the case for the fuselage, where cells seem to be jumping to the opposite side of the aircraft. Did you experience this issue too? Regarding separating zones, do you mean through SU2's multizone? In this case, did you apply the aircraft surface as a separate zone? Or a 'core' region around the aircraft? Thanks for your thoughts! Kind regards, Tim |
Also, @bmunguia - how should I submit a patch to amg.py? I have a fix for it not working with meshes placed in relative paths. Kind regards. |
@TobiKattmann - I was just reading your slides on multizone, when I noticed that you mention python scripts not working for multizone, and I guess that would include the mesh adaptation scripts... is this still the case? Thank you! |
When I was referring to separated zones I mean in the mesh, so I'm not referring to SU2 multizone. This is an example I took online (it is apparently a structured hexa mesh, so not the best example for mesh adaptation, hexa not supported), but I hope it explains the different zones at mesher level. |
Thank you. I see, so you set separate markers, e.g. MARKER_EULER= ( WingTop, WingBottom ), and where the marker boundaries meet, the mesh points on that interface is unchanged; did I understand that correctly? I guess that while this will reduce the artefacts on the LE/TE it still results in a departure from the design shape at the portions away from the boundary edges. As you mentioned before, there might not be a way to solve this without mapping back to an iges or parametric file. I suppose another approach might be to work the other way around? Perhaps one can limit the max allowable adapted size to match the 'worst case' allowable surface mesh? I just realised that may be a contributing factor to why the points jumpy across the fuselage; If I set this limit to less than the average surface mesh cell size, will it attempt to refine everything over the limit instantly? Or will it only use the limit for 'new' cells that are generated during adaptation? Thanks for your thoughts. |
Yes, I set separate markers. I don't think that mesh nodes aren't unchanged, but the edge topology is respected. You are right also when you refer to departure from the design shape (mostly driven by excessively big TRIAS on the surface; I suspect all the surface nodes still lay on the original, initialization surface mesh); there is still departure.
I believe it will affect all the mesh, but yet again, it may be also influenced by the numbers of |
I just tried reducing |
Hi @timjim333, I have to admit I am not fully (i.e. not 😉) aware of the mesh adaption capabilities of/with SU2. And there is quite a bit to read in this issue which i won't really have time to until the weekend but here's already my quicktake: If you think that I understand what you want to do specifically with the posts in this thread then I will read through that and answer again, otherwise I would not mind a specification 👍 |
Hi @timjim333, any luck with the surface mesh deterioration issue? |
Hi @TobiKattmann sorry, I must have missed your message somehow! Thanks for the input, maybe when the mesh adaptation strategy has matured a little more (or is better documented), it can be a bit more easily used. This is also in response to @fredericodpc Right now, I don't know if it is a bug or I'm just unsure of how to correctly use it, but I also have not been able to get the mesh to respect the wing surface. I've also not heard from the branch author either, so I don't know if this is being maintained publically anymore. =( It's a shame because it looked really promising for optimising the cost/accuracy of supersonic solutions! Ideally, I think one should be able to pass in a representation of the actual surface (either through an stl surface or as a very fine mesh), which should be used as a reference surface. As a minimum, we should be able to set a maximum surface mesh turning angle or some other surface-local control. |
Hi @timjim333, thanks for your reply. Well, let's wait to hear from the branch author, there's probably a way to keep/refine the surface mesh, even judging by one picture posted on this issue. Thanks again! |
@fredericodpc if you find a way I'd be interested to hear how you did it! In my testing, it seems to work for 2D but not 3D. |
Hi everyone, |
Hi all, |
Hi all, I'm following the procedure described in comments above, but when I try to run
In fact, I'm having problems installing pyamg. (_amgio seems to be installed correctly). I have also tried Python 3.7 and 3.8 versions without success.
I seem to meet the requirements of the .whl file. Does anyone have any ideas on what the problem might be? |
Can you try python 3.7.7? This is what l have used. |
It is working! Tanks! |
It looks like pointwise Mesh Link frame have a support for both mesh link and database (CAD) and it includes both edge data and corners ("Edge2" for edges and begining and end vertices of each edge data set corresponds to corner data.) Therefore adap_back mesh file can be prepared in GAMMA mesh file format including corners, edges, triangles, tets and vertices. But l am not sure about the correctness of su2 files created at each refinement level since corner and edge data will be lost when they are written in su2 format. It may be a good idea to use the GAMMA mesh file format for pyamg mesh adaptation levels and use su2 mesh file format only when it is needed for SU2 runs. |
Also pyamg.write_mesh correctly write the mesh file but when l convert its solution file to ascii,with libmesh there are excessively large numbers inside the file. It is most likely that there are some errors with it (solve part). |
A small note: All the face elements in the adap_back meshb file should be arranged in a way that their normal vector should point outwards for all surfaces and then adap_back option can work correctly. Also you may deactivate geometry enrichment (corners/edges) if these data are provided within the gamma mesh format. But we run refinement on gamma mesh format rather than su2 mesh file. Generally pointwise writes face elements with mixed normal vectors (inward/outward) for su2 format. May be l don't know pointwise well enough to get normals correctly. |
Hello everyone I am working with SU2 on the feature_adap branch and have come across an issue during the execution of the mesh adaptation script. After following the standard installation procedure and verifying the installation (the exact same steps that @chesiv presented), I encountered a problem when running the mesh_adaptation_amg.py script. The command used was:
The script initiates the mesh adaptation process as expected, with the following output:
However, no adap\ite0 folder gets created.
The critical part of this error seems to be the Error in TokenizeString() message, suggesting an issue with parsing the configuration file. This error typically indicates a syntax problem, such as having multiple options on a single line without proper separation by an equal sign (=). However, upon reviewing adap/ini/config_CFD.cfg, was unable to find any lines that clearly violated this syntax rule. Could this error be indicative of a more subtle issue within the configuration file, or might it be related to specific aspects of the feature_adap branch? Any insights, suggestions, or guidance on how to troubleshoot this error would be greatly appreciated. If anyone has a working adapt_mesh.cfg file for a similar setup or for the feature_adap branch, I would be very interested in seeing it. Understanding the configuration details of a working example could be highly beneficial in resolving my issue. Thank you for your help! |
Hi,
I understand you installed it on the version 7.0.3 (to my knowledge it is the latest supported by the feature_adap branch). |
Hi, Thank you for your quick answer, It indeed seems that I had some parameters that were passed that did not match su2 version 7.0.3 I am experiencing an issue while running the mesh adaptation process in SU2. The process starts but fails during the mesh generation phase, leading to a FileNotFoundError. I am looking for assistance in resolving this error. Mesh adaptation options: ./adap exists. Removing old mesh adaptation in 10s. Generating GMF background surface mesh. Starting mesh adaptation process. Iteration 0 - Mesh size coefficient 100.0 and it0 folder is created, with some log.err and log.out, but they are empty, I would appreciate any guidance or suggestions on how to resolve this issue. Thank you! |
Hello everyone,
We are trying to use SU2-pyamg on the server.
We followed the installation steps on SU2 website and did not face any compilation error.
Steps we followed:
Then we added the following lines to bashrc file:
export PYTHONPATH="/usr/lib64/python2.7/site-packages"
export SU2_RUN="$HOME/su2-installed/bin"
export SU2_HOME="$HOME/SU2"
export PATH=$PATH:$SU2_RUN
export PYTHONPATH=$PYTHONPATH:$SU2_RUN
We downloaded example file from pyamg website:
https://pyamg.saclay.inria.fr/pyamgexamples.html (Adaptive 3D ONERA M6 wing example)
During running, we encountered the following error:
$HOME/su2-installed/bin/mesh_adaptation_amg.py -f adap_ONERAM6.cfg -n 4 > out.txt &
[1] 166739
[user@host pyamg-su-test]$ Traceback (most recent call last):
File "/home/eduline/su2-installed/bin/mesh_adaptation_amg.py", line 111, in
main()
File "/home/eduline/su2-installed/bin/mesh_adaptation_amg.py", line 72, in main
options.save_all )
File "/home/eduline/su2-installed/bin/mesh_adaptation_amg.py", line 101, in mesh_adaptation_amg
SU2.run.amg(config)
File "/home/eduline/su2-installed/bin/SU2/run/amg.py", line 212, in amg
pyamg.su2_to_libmeshb(config_amg['adap_back'], "", "amg_back")
UnboundLocalError: local variable 'pyamg' referenced before assignment
Python version is 2.7.5 and we installed pyamg by running "sudo pip install pyamg".
Any help would be appreciated.
Best regards,
Mirac
The text was updated successfully, but these errors were encountered: