Dear All
I’d like to mesh a cube with a sphere on the side.
i use" tetgen".
There is the code FreeFem++
load “msh3”
load “TetGen”
load “medit”
include “MeshSurface.idp”
// Parameters
real hs = 0.1; //mesh size on sphere
int r= 0.5;
int[int] M = [20, 20, 20];
real [int,int] B = [[-1, 1], [-1, 1], [-1, 1]];
int [int,int] L = [[1, 2], [3, 4], [5, 6]];
// Meshes
meshS ThH = SurfaceHex(M, B, L, 1);
meshS ThS = Sphere(0.5, hs, 7, 1);
meshS Th1S= movemesh(ThS, [x+1, y+1, z+1]);
meshS ThHS = Th1S + ThH ;
medit(“Hex-Sphere”, ThHS);
real voltet = (hs^3)/6.;
cout << "voltet = " << voltet << endl;
real[int] domain = [0, 0, 0, 1, voltet, 1, 1, 1, 2, voltet];
mesh3 Th = tetg(ThHS, switch=“pqaAAYYQ”, nbofregions=2, regionlist=domain);
medit(“Cube with ball”, Th);
plot(Th, wait=true,fill=true);
I have this error bellow:
Loading data file(s)
End of mesh
Input seconds: 0.00
medit1()
Building scene(s)
Creating scene 1
Loading default options
Scene seconds: 0.36
Rendering scene(s)
Total running seconds: 10.16
Thank you for using Medit.
voltet = 0.000166667
3D RemplissageSurf3D:: Vertex triangle2 border 3208 6408 240
tetgenio: vertex
tetgenio: facet
tetgen: before tetrahedralize( , &in, &out);
numberof regions 10
numberof hole 0
PLC Error: A segment and a facet intersect at point (0.562503,1,0.762503).
Segment: [2021,2041] #-1 (4)
Facet: [287,282,312] #7
Strange catch exception ???
at exec line 94 , mpirank 0
Thank you in advance to the help