View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001282 | OpenFOAM | Bug | public | 2014-05-07 09:15 | 2014-06-13 09:00 |
Reporter | Assigned To | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | Linux | OS | SUSE Linux Enterprise Server | OS Version | 11.2 |
Summary | 0001282: splitMeshRegions fails if there are several faceZones between regions | ||||
Description | Assume I have a mesh with two cellRegions, the boundary between which consists of several faceZones. In such a case, a call to splitMeshRegions -cellZonesOnly -useFaceZones fails with an error message similar to --> FOAM FATAL ERROR: 1 not found in table. Valid entries: 1(0) From function HashTable<T, Key, Hash>::operator[](const Key&) in file /nfs/inn/disks/dts_tcad_disk2/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/HashTableI.H at line 117. FOAM exiting | ||||
Steps To Reproduce | 1. Unpack the attached case. It has a simple 4-cell mesh, the two bottom cells are assigned to one cellZone, the two others to another cellZone. The two faces that separate the cellZones are individually assigned to two faceZones. 2. Run splitMeshRegions -cellZonesOnly -useFaceZones 3. See the error message. The expected result is two meshes created in a new time directory, and the boundary between those meshes should consist of two patches. | ||||
Additional Information | The problem arises from lines 499-501 of splitMeshRegions.C. There the information about a new patch separating two regions is added to a hash table, the pair of regions ("the edge") being the key of that hash table. However, if there is already such an element in the hash table, that is, if previously another patch separating the same two regions was found, then this data is overwritten. Instead of this, in such a case, the new patch should be added to already existing patches. The diff to fix the bug is below: diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C index 7c6d3a4..aac9c5a 100755 --- a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C +++ b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C @@ -495,11 +495,15 @@ void getInterfaceSizes ); } interfaceSizes[nInterfaces] = infoIter(); - - Map<label> zoneAndInterface; - zoneAndInterface.insert(zoneID, nInterfaces); - regionsToInterface.insert(e, zoneAndInterface); - + + + if (regionsToInterface.found(e)) { + regionsToInterface[e].insert(zoneID, nInterfaces); + } else { + Map<label> zoneAndInterface; + zoneAndInterface.insert(zoneID, nInterfaces); + regionsToInterface.insert(e, zoneAndInterface); + } nInterfaces++; } } | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2014-05-07 09:15 |
|
New Issue | |
2014-05-07 09:15 |
|
File Added: SplitMeshRegions_example.zip | |
2014-06-13 08:59 |
|
Note Added: 0003132 | |
2014-06-13 08:59 |
|
Status | new => resolved |
2014-06-13 08:59 |
|
Fixed in Version | => 2.3.x |
2014-06-13 08:59 |
|
Resolution | open => fixed |
2014-06-13 08:59 |
|
Assigned To | => user4 |