May 12, 2020, 05:14
|
gmsh crashing during BooleanDifference with many volumes
|
#1
|
|
Member
Adam
Join Date: Nov 2018
Posts: 36
Rep Power: 9
|
Hello,
I am having an issue with gmsh crashing when I try to do many boolean operations. I want to generate a porous volume, where the medium is the empty space around overlapping spheres. My code, below, is meant to subtract the spheres from the starting box. It works fine for N up to 385, but if I used N = 386 or greater, gmsh crashes (on both of my computers).
Did I do something wrong? Or is this a limitation with gmsh/OpenCASCADE? At this point, I'm not even meshing, just defining the surfaces so I don't think it's a memory issue.
Code:
SetFactory("OpenCASCADE");
// x,y,z positions for the spheres (not shown for brevity)
N = 500; // number of spheres
R = 0.1; // cylinder radius
X = 1; // size of domain in x-direction
Y = 1; // size of domain in y-direction
Z = 10; // size of domain in z-direction
LC = R; // mesh critical length
// define entire domain
Box(1) = {0,0,0,X,Y,Z};
// define empty list for volume index numbers
VolIndex[] = {};
// for loop that places N spheres
For t In {1:N}
NV = newv; //new volume index
Sphere(NV) = {x[t-1], y[t-1], z[t-1], R}; // Defines the Sphere
VolIndex[] += NV; //adds this volume index to the list
EndFor
// Boolean subtraction of the total domain, minus the spheres
// both the original domain, and the original spheres are deleted
BooleanDifference{ Volume{1}; Delete; }{ Volume{VolIndex[]}; Delete; }
|
|
|