View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000795 | OpenFOAM | Bug | public | 2013-03-20 17:41 | 2018-07-10 11:23 |
Reporter | monto | Assigned To | |||
Priority | high | Severity | crash | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Linux x86_64 | OS | OpenSUSE | OS Version | 12.2 |
Summary | 0000795: pointField are not remapped if topological changes occur | ||||
Description | This issue is similar to the one reported as #638. If a mesh undergoes a topological change, pointFields are not remapped when calling polyMesh.updateMesh(mapPolyMesh). The suggested fix outlined in #638 has apparently not ported to version 2.2.x. | ||||
Steps To Reproduce | The following piece of code causes an error when the topological change is triggered: myTopoChangerFvMesh.update() { /* ... */ movePoints(motionSolver_->newPoints()); autoPtr<mapPolyMesh> topoChangeMap = topoChanger_.changeMesh(true); bool hasChanged = topoChangeMap_.valid(); if (hasChanged) { if (topoChangeMap->hasMotionPoints()) { pointField newPoints = topoChangeMap_().preMotionPoints(); movePoints(newPoints); motionSolver_->updateMesh(topoChangeMap_()); // clear reference to old points resetMotion(); } } return; /* ... */ } In this particular case, the pointDisplacement field of the motionSolver is not remapped, causing a segmentation fault | ||||
Additional Information | A workaround is to move the following instruction meshObject::clear<polyMesh, GeometricMeshObject>(*this); from polyMesh::clearGeom() and polyMesh::clearAddressing() to polyMesh::clearOut() in file polyMeshClear.C (attached). | ||||
Tags | motionSolver, pointField, polyMeshClear, topoChangerFvMesh | ||||
|
polyMeshClear.C (4,092 bytes)
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. \*---------------------------------------------------------------------------*/ #include "polyMesh.H" #include "primitiveMesh.H" #include "globalMeshData.H" #include "MeshObject.H" #include "indexedOctree.H" #include "treeDataCell.H" //monto #include "pointMesh.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::polyMesh::removeBoundary() { if (debug) { Info<< "void polyMesh::removeBoundary(): " << "Removing boundary patches." << endl; } // Remove the point zones boundary_.clear(); boundary_.setSize(0); clearOut(); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::polyMesh::clearGeom() { if (debug) { Info<< "void polyMesh::clearGeom() : " << "clearing geometric data" << endl; } //monto //meshObject::clear<polyMesh, GeometricMeshObject>(*this); primitiveMesh::clearGeom(); boundary_.clearGeom(); // Reset valid directions (could change with rotation) geometricD_ = Vector<label>::zero; solutionD_ = Vector<label>::zero; // Remove the stored tet base points tetBasePtIsPtr_.clear(); // Remove the cell tree cellTreePtr_.clear(); } void Foam::polyMesh::clearAdditionalGeom() { if (debug) { Info<< "void polyMesh::clearAdditionalGeom() : " << "clearing additional geometric data" << endl; } // Remove the stored tet base points tetBasePtIsPtr_.clear(); // Remove the cell tree cellTreePtr_.clear(); } void Foam::polyMesh::clearAddressing() { if (debug) { Info<< "void polyMesh::clearAddressing() : " << "clearing topology" << endl; } //monto //meshObject::clear<polyMesh, TopologicalMeshObject>(*this); primitiveMesh::clearAddressing(); // parallelData depends on the processorPatch ordering so force // recalculation globalMeshDataPtr_.clear(); // Reset valid directions geometricD_ = Vector<label>::zero; solutionD_ = Vector<label>::zero; // Update zones pointZones_.clearAddressing(); faceZones_.clearAddressing(); cellZones_.clearAddressing(); // Remove the stored tet base points tetBasePtIsPtr_.clear(); // Remove the cell tree cellTreePtr_.clear(); } void Foam::polyMesh::clearPrimitives() { resetMotion(); points_.setSize(0); faces_.setSize(0); owner_.setSize(0); neighbour_.setSize(0); clearedPrimitives_ = true; } void Foam::polyMesh::clearOut() { clearGeom(); clearAddressing(); //monto meshObject::clear<polyMesh, GeometricMeshObject>(*this); } void Foam::polyMesh::clearCellTree() { if (debug) { Info<< "void polyMesh::clearCellTree() : " << "clearing cell tree" << endl; } cellTreePtr_.clear(); } // ************************************************************************* // |
|
We do not have a case which reproduces this problem, could you supply a simple test case we could use for diagnosis? |
|
I reported 638 and will update the case and library files to work with 2.2.x. Once its done I will upload to this issue. I wonder if this is related to 786? |
2013-03-21 17:43
|
|
2013-03-21 17:43
|
|
2013-03-21 17:43
|
|
|
> I wonder if this is related to 786 No the issues are independent. We are working on #786 now and will come back to this one when that issue is resolved. |
|
I have a simple test case, but the code snippet I reported is part of a class that cannot be made publicly available. However, I can send you the source code privately if you indicate me how to do. |
|
Depending on the arrangements you have made to keep your classes private there may be an issue with you distibuting your GPL code to me with a redistribution restriction. Please check the GPL on this. Do you have any exapmle code which reproduces the problem which may be made public under the terms of the GPL? |
|
There is no legal restriction related to our classes: they are fully GPL-compliant. However, they are still under development and in some other parts (not related to this bug report) there is dirty or non-functional code. We are working to provide a minimal and clean working example to test the bug we have reported, and we will post it as soon as it is ready. |
|
This is fixed in the next major release. |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-03-20 17:41 | monto | New Issue | |
2013-03-20 17:41 | monto | File Added: polyMeshClear.C | |
2013-03-20 17:43 | monto | Tag Attached: motionSolver | |
2013-03-20 17:43 | monto | Tag Attached: pointField | |
2013-03-20 17:43 | monto | Tag Attached: polyMeshClear | |
2013-03-20 17:43 | monto | Tag Attached: topoChangerFvMesh | |
2013-03-20 17:43 | monto | Tag Attached: topological change | |
2013-03-21 09:53 | henry | Note Added: 0002030 | |
2013-03-21 17:29 |
|
Note Added: 0002033 | |
2013-03-21 17:43 |
|
File Added: sprayDyMFoam.tar.gz | |
2013-03-21 17:43 |
|
File Added: aachenBombMoveRefine.tar.gz | |
2013-03-21 17:43 |
|
File Added: dynamicMotionSolverRefineFvMesh.tar.gz | |
2013-03-22 12:16 | henry | Note Added: 0002048 | |
2013-03-22 12:56 | monto | Note Added: 0002049 | |
2013-03-22 13:21 | henry | Note Added: 0002050 | |
2013-04-04 17:33 | monto | Note Added: 0002087 | |
2013-12-17 10:17 |
|
Status | new => resolved |
2013-12-17 10:17 |
|
Resolution | open => fixed |
2013-12-17 10:17 |
|
Assigned To | => user4 |
2013-12-17 10:18 |
|
Note Added: 0002690 | |
2013-12-17 10:18 |
|
Status | resolved => closed |
2013-12-17 10:18 |
|
Fixed in Version | => Other |
2018-07-10 11:23 | administrator | Tag Detached: topological change |