Open Ali-Shaha opened 1 year ago
Greetings,
I think splitCellNum[index] == 8 condition here:
needs to be changed to "splitCellNum[index] == nSubCellsPerCell" defined as:
similar to:
in order to make the clone function work when re-decomposing a reconstructed refinementHistory with decomposerPar.
Thank you, Ali
Hi Ali,
Have you solved this problem? Can you provide the complete modified code for this function?
Regards, Sean
Hello Sean,
Unfortunately, I do not have the original code at the moment. But to make the original clone function from here working only the following lines needed to be modified: `
// Compacted splitCells
DynamicList<splitCell8> newSplitCells(splitCells_.size());
const polyMesh& mesh = dynamic_cast<const polyMesh&>(db());
label nSubCellsPerCell = 1 << mesh.nGeometricD();
// Loop over all entries. Note: could recurse like countProc so only
// visit used entries but is probably not worth it.
forAll(splitCells_, index)
{
if (splitCellProc[index] == procI && splitCellNum[index] == nSubCellsPerCell)
{
// Entry moves in its whole to procI
oldToNewSplit[index] = newSplitCells.size();
newSplitCells.append(splitCells_[index]);
}
}
`
Best, Ali
Hi Ali,
Thank you for sharing, I will give it a try.
Regards, Sean
Hi Ali,
I made the changes as you suggested, but it didn't seem to work. After reconstruct the data and re-decomposing it, the mesh still becomes fixed.
Hi Sean,
Yes, that is right. There is (/was at least up to OF11) issue with the OF decomposer that didn't write/distribute the correct refinementHistory dictionary after decomposing an adaptively refined mesh. It seems that they refactored the code again after that at least in the current ofdev version.
The problem could be for two reasons:
To fix it then:
domainDecomposition
class that uses blastFoam's dynamicMesh library instead of polytopoChange.distributeCells()
function. see Foam::labelList Foam::domainDecomposition::distributeCells()domainDecomposition
class instead of default.This at least was working a year ago there is a chance that new versions need some different modifications.
Best, Ali
Hi Ali,
Thank you for your detailed suggestions. I saw the contact info in the article you recommended and I thought it would be best to contact you by email? I added 1D/2D/3D AMR with reference to blastFoam's AMR library and updated it to OpenFOAM-dev. Based on your latest suggestion, I realized that I need to modify the src/parallel library, a task that does not seem to be easy. I would like to know if it is possible to contact you by e-mail to continue improving my code.
Best regards, Sean
Greetings,
I think splitCellNum[index] == 8 condition here:
https://github.com/synthetik-technologies/blastfoam/blob/4e6ee07a0c1fc4629ee7206804f4f1fe802ec64c/src/dynamicMesh/fvMeshRefiner/fvMeshHexRefiner/hexRef/hexRefRefinementHistory.C#L950
needs to be changed to "splitCellNum[index] == nSubCellsPerCell" defined as: https://github.com/synthetik-technologies/blastfoam/blob/4e6ee07a0c1fc4629ee7206804f4f1fe802ec64c/src/dynamicMesh/fvMeshRefiner/fvMeshHexRefiner/hexRef/hexRefRefinementHistory.C#L1224
similar to:
https://github.com/synthetik-technologies/blastfoam/blob/4e6ee07a0c1fc4629ee7206804f4f1fe802ec64c/src/dynamicMesh/fvMeshRefiner/fvMeshHexRefiner/hexRef/hexRefRefinementHistory.C#L1238
in order to make the clone function work when re-decomposing a reconstructed refinementHistory with decomposerPar.
Thank you, Ali