Manual decomposition using setFields
Hey there,
I found a couple of old threads about the manual option in decomposeParDict, and how to conveniently prepare the file for it with the setFields utility: https://www.cfd-online.com/Forums/op...r-utility.html https://www.cfd-online.com/Forums/op...computing.html It was possible to piece the answer together from these threads, but it took me a couple of hours, so I wanted to share my solution here. There might be more elegant ways and I'm open to suggestions, but it works and it's fast enough. First, I'll explain the problem, then I'll describe my solution. The problem: The manual option in the decomposeParDict file offers a lot of versatility, but is difficult to use, because you have to provide a file with a labelList the size of your mesh cell count. Each entry signifies the processor that cell is on. The exact file formatting is not completely trivial to find in the docs, but that's doable. However, actually creating that file manually doesn't really make sense, especially for larger meshes. While the setFields utility provides a very convenient way of writing that list, its input- and output formatting is slightly different to the one for the needed file. My solution: Make sure your mesh is created and your system/decomposeParDict looks something like this: Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
decomposePar -cellDist Now we need to write our desired decomposition into the system/setFieldsDict. Just as an example, it can be sth like this: Code:
/*--------------------------------*- C++ -*----------------------------------*\ Now go back to your terminal and execute Code:
setFields ; touch prepDecomp.py Code:
#read file Code:
python prepDecomp.py Next, we set the keyword method in system/decomposeParDict to manual, and we're good to go. Your workflow for designing your preferred decomposition may be this:
I needed this, because I used a codedFixedValue BC that accessed a patch on another processor core. This way, I could just place them on the same core, at least as a stopgap solution. Hope this might help someone. Lennart Edit: I didn't try this method with binary format, so if you run into problems, make sure the writeFormat keyword in system/controlDict is set to ascii for the whole process. That way you can at least see what's happening. |
Works perfectly, thank you! :)
|
Works Perfectly.
Thanks for sharing. Works perfectly. :)
|
Perfect!
Works great!
Thanks for the help! |
It works great. Many thanks !
|
Thanks for taking the time to share a solution!!
|
I didn't really follow the steps, i just used funkySetFields, but I couldn't find in any tutorial an example of the file to put in the constant folder, very helpful, thank you!
Just changing a few lines I got a nice script to decompose a multiregion case in a proper way :D |
Quote:
Since you have figure out a proper way of manual decompose of a multiRegion, would you mind sharing the details, particular to the multiRegion ? Thank you Dasith |
I have adapted the line numbers to OpenFOAM v2212:
Code:
#read file Code:
/*--------------------------------*- C++ -*----------------------------------*\ |
All times are GMT -4. The time now is 22:41. |