Dynamic mesh RefinementCoarsening at runtime
Hi everybody,
After a while I am trying to get back to the refinement/coarsening of dynamical mesh and resumed my crusade for refinement/coarsen. So far, I have the refinement bit working well by an scalar. Now, the coarsening is not working. I am using all the proper classes (Modifiers, etc). At the end I could isolate the problem to this for coarsening: undoableMeshCutter::removeSplitFaces, which uses the class removeFaces. This is done inside the errorDrivenRefinement class and evaluateError class. I can not find any example for removeSplitFaces or removeFaces in the tutorials and/or applications I use the cavity example and the error appears when coarsening happens: --> FOAM FATAL ERROR : Face 589contains vertex labels out of range: 4(-1 105 1 1143 -1) Max point index = 1250 From function polyMesh::polyMesh::resetPrimitives ( const label nUsedFaces, const pointField& points, const faceList& faces, const labelList& owner, const labelList& neighbour, const labelList& patchSizes, const labelList& patchStarts ) in file meshes/polyMesh/polyMesh.C at line 464. It looks as -1 is not proper vertex numbering. I am pretty sure it has to do with removeSplitFaces. Do you have any example for coarsening mesh?. I will open a threat on the forum for more help. Other tip, In ErrorDrivenRefinement I found this and commented for not repacking. ( as a test) It turns out to work OK for refinement/coarsening till a given point where the problem of vertex labelling appears as before (This code was sent by you months ago) // Repack list of cells to refine. List<refinecell> refCells = refPattern.refCells(); label newRefCellI = 0; forAll(refCells, refCellI) { label cellI = refCells[refCellI].cellNo(); //Sergio commented // if (!markedCell[cellI] && (newRefCellI != refCellI)) // { refCells[newRefCellI++] = refCells[refCellI]; // } } Anyway, I have the problem of vertex labels equal -1 after nine iterations with refinement/coarsening. Here it is removing faces but then stops with the same error. Then, I saw this in: void Foam::undoableMeshCutter::updateMesh(const mapPolyMesh& morphMap) { // Update mesh cutter for new labels. meshCutter::updateMesh(morphMap); // No need to update cell walker for new labels since does not store any. // Update faceRemover for new labels faceRemover_.updateMesh(morphMap); if (undoable_) { // Update all live split cells for mesh mapper. updateLabels(morphMap.reverseCellMap(), liveSplitCells_); } } faceRemover_.updateMesh(morphMap) is not implemented and the error I sent you before is related to labelling. Do you think this might be the cause. Honestly, I think this is out of my reach to solve as the internal structure of the mesh and its refinement is a kind of misttery for the end-user even when I tried for a long time. :-) I know it is topic of interest for many users I am willing to produce a tutorial and the code so far implemented by me. Thanks. Regards Sergio |
Hi Sergio
I want to implement of a Automatic refinement in my code. I want to have also a 2D AMR. So far I have tried the multidirrefinment and then mapping the data by meshtomeshinterpolation. but there is problem that meshtomeshinterpolation is not working for surface fields . I have tried the updateMesh(Map) instead of meshtomeshinterpolation. but it does not work also :(. now i am checking the errordrivenrefinment. But as I a beginner in openfoam I dont understand how to use it. could you share asimple case runned with errordrivenrefinment? or the steps to use it? I will be grateful to have your help. Best Mahdi |
All times are GMT -4. The time now is 07:27. |