-
Notifications
You must be signed in to change notification settings - Fork 0
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 triangular mesh from EIRENE #30
Conversation
4cd41ad
to
37a4595
Compare
This feature is ready for merge. I have included all tests I can think of. It is not possible to estimate before hand the number of common faces that EIRENE grid and B2.5 grid will have as they have different structure near the bottom edge in PFR region. It is possible to estimate the extra nodes added by EIRENE though, so I have added that as a test. The edge order of the triangular cells can be tested as well. Please let me know if there are any extra tests we can add at this stage. I think, we'll have to let people use this feature to find any bugs and tests that can find such bugs. |
EIRENE grid can be loaded into edge_profiles.grid_ggd[1] now by providing the set of three fort files (fort.33, fort.34, fort.35) as keyword argument fort to solps2imas function. First the code reads for.33 to add any additional nodes to the space. The additional nodes all belong to grid extension outside the SOLPS grid. Then it reads fort.34 to add the triangular grid cells to the space and the extra edges involved with them. Then using fort.35, it conencts the triangular cells to their neighbours and uses ix, iy index to create subset with index -205 which stores EIRENE cells that overlap with B2.5 grid. Overlapping nodes and edges are also stored by taking intersections in grid_subset indices -201 and -202 respectively. Minor additional changes: * Moved convention of edge ordering from susbet_id.jl to solps2imas.jl * Added tol argument to search_points function to allow matching of nodes that are close to a given tolerance value. Default is 0, so by default it looks for exact numerical match. This is useful since EIRENE fort files keep node coordinates with 6 digits of precision only as compared to SOLPS output files (13 digits)
Correct chosen_tri_edge_order has been identified from the sample EIRENE files. Added some verififcation tests for the EIRENE triangular mesh reading. Still need to check some mismatch in common faces between EIRENE and SOLPS in the PFR edge region. Also now only as many ndoes and edges are being initialized as required in the space. This gets rid of the extra initialization we have been doing so far.
5827a88
to
71bab42
Compare
When EIRENE grid is added, the b2.5 grid is moved to negative grid_subset_index. For example, all cells of b2.5 grid are now present in grid_susbset with index -5. Thus, any quantities that are defined on cells of b2.5 should refer ot -5 instead of 5. This is implemented by providing an additional argument to the val_obj function which is adictionary of grid_subset_index changes. If EIRENE grid is added, we populate this dictionary to show that 1 => -1, 2 => -2 and 5 => -5. This way, the ggd values are correctly set. Now the comment and hotfix in https://github.com/ProjectTorreyPines/SynthDiag.jl/blob/806f1beffa8e72948b36c821ca2d628c8cb3174f/src/interferometer.jl#L68 can be removed if we'll rely on this extended grid and not the one that is generated in SD4SOLPS.
71bab42
to
35917eb
Compare
Handle gsi change when extended grid displaced B2.5 grid Merging as ProjectTorreyPines/SOLPS2imas.jl#30 as been merged.
Adding option to specify cell subset index Merging as ProjectTorreyPines/SOLPS2imas.jl#30 as been merged.
This PR will close #22
Basic framework is ready. We can read EIRENE files and them them to grid_ggd space and create following additional subsets:
5: all cells
-5: all standard B2 cells
-105: all Eirene triangular cells
-205: Eirene triangular cells that overlap with B2 cells
And same for nodes and edges with last index digita 1 and 2 instead of 5 as above.
Remaining to do: