CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Bugs (
-   -   DecomposePar and mergePatchPairs (

hannes June 25, 2007 09:22

Description: During the decom
During the decomposition of a blockMesh-generated Mesh with merged patch pairs, the decomposePar utility crashes and prints an error message "malloc(): memory corruption". This issue was previously reported here:

The fault seems to happen in the source file "domainDecomposition.C" (part of decomposePar) between line 125 and line 157 and is raised by multiple calls of the function "mark" (If calls of "mark" are commented out, no error is raised and the execution goes beyond this part of the program)

The error is linked to the point- and faceZones, which are created by blockMesh. If all pointZones, faceZones and cellZones are removed from the case, the error does not occur.


Source file:

an example mesh can be downloaded from here: (15MB)

x86_64, i386, AIX

OpenFOAM 1.4


mattijs June 25, 2007 13:14

Your mesh is probably not corr
Your mesh is probably not correct to start with. If I run checkMesh on it I get:

--> FOAM FATAL ERROR : Error in face ordering: mixed used and unused faces at the end of face list.
Number of used faces: 1640 and face 1640 is owned by cell 411#0 Foam::error::printStack(Foam:
#1 Foam::error::abort()
#2 Foam::polyMesh::initMesh()
#3 Foam::polyMesh::polyMesh(Foam::IOobject const&)
#4 main at ~/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude/createPolyMesh.H:13
#5 __libc_start_main
#6 __gxx_personality_v0

You could try if creating a mesh without merged patch pairs solves your problem.

hannes June 25, 2007 18:24

Hmm, this is strange. When I r
Hmm, this is strange. When I ran checkMesh, I did not get any errors, no matter if I include or exclude the zone definitions (see attached log).

Unfortunately, doing without the merged patch pairs would complicate my block topology considerably.

CheckMesh log:
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4 |
| \ / A nd | Web: |
| \/ M anipulation | |

Exec : checkMesh .. testcase
Date : Jun 26 2007
Time : 00:06:41
Host :
PID : 13512
Root : ..
Case : testcase
Nprocs : 1
Create time

Create polyMesh for time = constant

Time = constant
Boundary definition OK.

Number of points: 929151
edges: 2746366
faces: 2705815
internal faces: 2626625
cells: 888600
boundary patches: 8
point zones: 0
face zones: 0
cell zones: 0

Checking topology and geometry ...
Point usage check OK.

Upper triangular ordering OK.

Topological cell zip-up check OK.

Face vertices OK.

Face-face connectivity OK.

Basic topo ok ...

Checking patch topology for multiply connected surfaces ...

Patch Faces Points Surface
axial_outlet 6300 6451 ok (not multiply connected)
coflow_inlet 300 366 ok (not multiply connected)
inlet 990 1072 ok (not multiply connected)
sides 32150 32923 ok (not multiply connected)
tangential_outlet 6900 7076 ok (not multiply connected)
wall_low_ax 340 378 ok (not multiply connected)
wall_low_tan 500 567 ok (not multiply connected)
walls 31710 32422 ok (not multiply connected)

Patch topo ok ...
Topology check done.

Domain bounding box: min = (-0.12 0 -0.141421) max = (0.25 0.2 0) meters.

Checking geometry...
Boundary openness in x-direction = -1.29495e-19
Boundary openness in y-direction = 7.61212e-17
Boundary openness in z-direction = -2.28648e-15
Boundary closed (OK).
Max cell openness = 3.40893e-20 Max aspect ratio = 3.32661. All cells OK.

Minumum face area = 8.1905e-09. Maximum face area = 0.0001049. Face area magnitudes OK.

Min volume = 4.60379e-12. Max volume = 2.66382e-07. Total volume = 0.00488561. Cell volumes OK.

Mesh non-orthogonality Max: 58.0258 average: 9.48651
Non-orthogonality check OK.

Face pyramids OK.

Max skewness = 81.9324 percent. Face skewness OK.

Minumum edge length = 4.19013e-05. Maximum edge length = 0.012.

All angles in faces are convex or less than 10 degrees concave.

Face flatness (1 = flat, 0 = butterfly) : average = 1 min = 0.999995
All faces are flat in that the ratio between projected and actual area is > 0.8

Geometry check done.

Number of cells by type:
hexahedra: 887820
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 780
Number of regions: 1 (OK).
Mesh OK.

Time = 5000
No mesh.


mattijs June 26, 2007 10:36

Got it. Your pack did not incl
Got it. Your pack did not include a boundary file so I ended up using some arbitrary boundary file.

The error comes from the retired faces and points in the zones not being decomposed correctly. Try replacing decomposePar/domainDecomposition.C with attached one. domainDecomposition.C

hannes June 26, 2007 12:01

Oh yes, my fault. I forgot to
Oh yes, my fault. I forgot to include that file.

Thank you very much for the patch.

Regards, Hannes

All times are GMT -4. The time now is 20:31.