Conversation
…d a feature to capture the location of multicuts. EB/AMReX_EB2_3D_C.cpp will be the main file to edit since the function 'build_faces' is here.
…h dx, dy, and dz: This is given so that one can consider refining grid to avoid multicuts
…ns: Please find 'EY' tags for any changes
|
Suggestions based on our chat today:
|
…lt and you may choose 'true' in your input file if you want to see the multicut locations. -> eb2.plt_multiple_cuts = 'true' 2) If (plt_multiple_cuts), we delay aborting the code until finishing up the loop, including the build_cells part. 3) I just made the int total_multicuts to get the final number of multicuts -- to make sure in case it is not the same number as nmulticuts.
|
sorry I accidentally clicked closing the pull request... 🤦🏻♀️ |
|
…multicuts. We can now print out the index of multicut boxes but this current output seems to be no good use. Need to adjust more.
…ticuts.0 that includes physical location of the multicut cells: The coordinates indicate the cell center.
|
…H. Next step would be to create a multifab to store locations of the multicut in build_faces function and bring it out to AMReX_EB2_Leve.H. Also, try to output one plot file.
2) This is used as an input for build_faces. 3) Simply set value - multicut_arr(i,j,k) = 10.0 - whenever we detect multicut. 4) In AMReX_EB2_Level.H (line 494 - ), we first check if multicut_arr stored the multicut locations (value 10.0). - this will be removed once we get right plot file. 5) The hope is that we get "volume" of multicut location when we read the plt file. 6) We probably do not need anything in this line, except the line 508 (WriteSingleLevelPlotfile). - The question is: Is this enought to see the multicuts?
Src/EB/AMReX_EB2_Level.H
Outdated
| nmulticuts += nmc; | ||
| } | ||
| // EY: Here -> make plot file | ||
| if (plt_multiple_cuts) |
There was a problem hiding this comment.
Move after the ParallelAllReduce for nmulticuts, then add nmulticuts > 0 && !cover_multiple_cuts to the conditional
Src/EB/AMReX_EB2_3D_C.cpp
Outdated
| if (plt_multiple_cuts){ | ||
| multicut_arr(i,j,k) = 10.0; | ||
| // Not GPU friendly | ||
| amrex::PrintToFile("loc_multicuts") << "fz: (x,y,z) = (" << problo[0]+(i)*dx[0] << ","<< problo[1]+(j)*dx[1] << "," << problo[2]+(k)*dx[2] << ") \n"; |
There was a problem hiding this comment.
surround the PrintToFile bit with an #ifndef AMREX_USE_GPU so this can still compile on GPU.
…or stl on Kestrel.
… xbx, ybx, and zbx: next step will be plotting face-center multifabs since they are multicut faces we are plotting now.
…locations in using PrintToFile in AMReX_EB2_3D_C.cpp file. Also, most importantly, I fixed a stupid if-condition mistake in AMReX_EB2_Level.H: line 502. We should not abort the code when no multicuts present but plt_multiple_cuts = true
We now create separate plot files containing multi-cut locations from xbx, ybx, and zbx: next step will be plotting face-center multifabs since they are multicut faces we are plotting now.
…ile with data multicuts. See AMReX_EB2_3D_C.cpp
|
All the failings come from the same place. |
|
This is the error I was looking for before! A couple options:
A next step is to see how this works for multilevel cases |
…rintToFile, it seems like we don't need this condition for GPU
Src/EB/AMReX_EB2_Level.H
Outdated
|
|
||
| multicut_fcx.define(m_grids, m_dmap, 1, ng, mf_info); | ||
| multicut_fcy.define(m_grids, m_dmap, 1, ng, mf_info); | ||
| multicut_fcz.define(m_grids, m_dmap, 1, ng, mf_info); |
There was a problem hiding this comment.
These should be defined similar to m_areafrac below, so that they have face data rather than cell-centered data
…bring it back if we find out a better solution to deal with GPU runs.
… also implemented
… also implemented
2) added if-conditions for plotting only when we have multicuts for each direction 3) face-centered multicut
baperry2
left a comment
There was a problem hiding this comment.
You should also add Documentation of the new input parameter here: https://github.com/AMReX-Codes/amrex/blob/87de52ef071811629120df6247c53e0e6840c4ec/Docs/sphinx_documentation/source/RuntimeParameters.rst?plain=1#L780
Merge branch 'eyoo/multicuts' of github.com:ejyoo921/amrex into eyoo/multicuts
Src/EB/AMReX_EB2_2D_C.cpp
Outdated
| if (fy(i ,j+1,0) == Type::irregular) { ++ncuts; } | ||
| if (ncuts > 2) { | ||
| Gpu::Atomic::Add(dp,1); | ||
| if (plt_multiple_cuts){ |
There was a problem hiding this comment.
bring this outside of the if (ncuts > 2) scope. That way ncuts = 2 will show regular cut cells, ncuts > 2 multicuts, and ncuts = 0 cells that are either completely covered or completely fluid.
…(or very tiny) is covered, and some cell values > 2 means multicuts




Summary
Additional background
Checklist
The proposed changes: