-
Notifications
You must be signed in to change notification settings - Fork 38
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
HexMesh extension [Points_list or Corner_list Class Request ] #45
Comments
The A shortcut could be written as a property in I would surely like to try your mesher. Does it support grading, surfaces and such stuff? I am a bit worried about speed, though, python is not very famous for being fast. :) |
Thank you for the reply Mesher - works with all but two of the examples however searchable surfaces - I'm finding tricky and I need to do some work on collapsed edges (I can't find any in your examples) Speed is not fast - around 80 sec per 100k cells on my desktop which is fast enough for my current needs I have a few more days to sort the searchable surfaces - if I get this working I will load it to the clone on GitHub Many thanks for your work on classy blocks It has been a real help for my research project Regards |
OK, I'm looking forward to seeing your work! |
I just sent you a link to the cb-extension that creates a mesh - It works with all the example files the folder ext_examples contains all of the examples with their generated meshes in .vtk format (so you can view in paraview) The code is nowhere near as elegant as your original and is far from being in a publishable state |
Wow, I tried that out, checked the code and must say I'm impressed! One more thing - I thought (because is so incredibly slow) about porting this whole thing to OpenFOAM's C++ framework, now it seems we're doing vice versa, recreating OpenFOAM with python. What are your thoughts about that? What is the goal of your quite monumental task you have completed? |
Glad to hear you got it working It's my first Python program (the last code I wrote was in FORTRAN 77 in 1995) so the style is not very Python I think the first thing to decide is and then there will be a few additions none of these are a big deal - they just drive some change back into classy_blocks so it depends on whether you think the effort is worth it on your side In terms of porting Openfoam to Python - I am afraid I am not an OpenFOAM user (and never have been) I am currently doing a PhD relating to the application of machine learning to electric motor simulation I think a more interesting task would be to graft a simple GUI front end onto classy-blocks Regards |
I have created a new branch Now I get why OF environment is not for you and I support your work with python, it's perfectly legit. In any case, I believe there's still much to be optimized if speed becomes an issue for more folks. I've been thinking about GUI lately and I guess this is a logical next step for classy... Just haven't decided yet whether to use paraview, FreeCAD or something else? |
Don't worry about that right now. Just add the code, however duplicated it may be, then we'll refactor it to something decent-ish. |
Ok - what a week I've had to get this in any sort of shape to contribute Contributing sets a pretty high bar for code checking and typing
the black checks and isort checks all run ok
I have not written any tests (writing tests is all new to me and something I need to learn but not now) This initial release is a lot faster on the big models than the example code I sent last week - your cyclone example I think the one thing you will like is that I have added the block ID to the mesh vtk files Finally - can you point me toward some understandable documentation on searchable surfaces
Regards
|
To me it looks like you're slightly overdoing it, on a work-in-progress branch not every commit has to pass all tests. You should make a pull request and I give it a blessing. I've never contributed so far so I can't really give you exact instructions. I guess it should be something like this: https://opensource.com/article/19/7/create-pull-request-github About searchable surfaces. There's no documentation that I'm aware of and projection to multiple surfaces is still a work in progress even in both OF branches. As to my understanding, it's just moving to the closest point on the surface, something like this:
Thank you for your excellent contribution, it expands the usability quite a lot! |
Oh yeah, that's satisfying! |
I definitely didn't realize how much code you've written for this to work. Amazing and insane at the same time! Will scroll through it for a while to see what all this means. And how to make it manageable. I'm not saying it's badly written, definitely not, just need to wrap my head around all the stuff. Will report back soon. |
It was put together quickly not elegantly you could easily get rid of the HexVertex HexVertex_List and HexCell and HexCell_List classes by collapsing the functionality back into the Vertex Vertex_List and Cell Cell_List classes If there was a cleaner way to read the stl files we could simplify HexReader HexTools is simply a list of functions I grabbed from stack overflow - I am sure there is some duplication with your functions Hexmesh is about as clean as I could make it to get decent speed - we should collapse the vtk file writer into one file In hexdeltas there is the opportunity to use your interpolation class function - (I was unable to work out how to code these - so reverted to using numpy functions) The real opportunity is in hex projections - simply put its a mess and needs to be re written Carrying the projections library in block mesh as values not strings would help but when I get back to it I need to rethink the structure of this and finally I am sure there may be an OOP way to structure this all more elegantly Regards |
I'll scroll a bit more, many objects can either be inherited, merged or referenced, or a completely new structure has to be defined. Too early to say at this point. |
Well to be honest, I am rather at a loss here. To properly integrate all your code would be quite a massive task and many additional dependencies would be required. It would make sense to somehow de-duplicate the code so a totally separate package also isn't a good option. |
Description
I cant find where a corner projection is stored in a class list
face projections are stored in face_list
edge projections are stored in edge_list
why are corner projections not stored in a corner_list ?
can you create this list please
PS
i have just written an extension to classy blocks in python that creates the hexmesh
(removing the need for blockmesh) -
I know its not what this project was intended for -
but would you be interested in adding this extension to your project ?
Regards
Malcolm
The text was updated successfully, but these errors were encountered: