Dear Prof. Fang,
I am trying to create a multilapyer cylinder, with a hole of different material. I tried in two different ways, but I always get errors. I report here the two codes with the errors.
First way:
I am not able to correclty create the faces of my domain, cause the function surfboolean give me an error:
[no,fc]=meshcylinders([S.R,S.R,0],[0,0,1], [S.T0,S.T1,S.T2], S.R,0,0,20);
plotmesh(no,fc, 'y>30')
[nhole,fhole]=meshacylinder([S.R, S.R, S.T0],[S.R,S.R, S.T0+S.T1], S.R0, radbound, maxvol,20);
[n,f] = surfboolean(no,fc,'resolve',nhole,fhole);
plotmesh(n,f, 'y>30')
regionseeds=[];
holeseeds=[];
method='tetgen1.5';
[node, elem]=s2m(n, f, 0.7, 10, method, regionseeds, holeseeds);
plotmesh(node, elem, 'x>30')
This way the function surfboolean give me error of
"A self-intersection was detected. Program stopped." And if I use in the function "meshcylinders" a tsize different from 0, it returns a cell structure...
Second way:
I correctly create the surfaces of my domain, but I get error when using s2m:
[ncyl,fcyl]=meshacylinder([S.R, S.R, 0],[S.R,S.R, S.T0+S.T1+S.T2+S.Textra], S.R, radbound, maxvol,20);
[nhole,fhole]=meshacylinder([S.R, S.R, S.T0],[S.R,S.R, S.T0+S.T1], S.R0, radbound, maxvol,20);
[nhole2,fhole2]=meshacylinder([S.R, S.R, S.T0+S.T1],[S.R,S.R, S.T0+S.T1+S.Textra], S.Rextra, radbound, maxvol,20);
[nh,fh] = surfboolean(nhole2,fhole2,'resolve',nhole,fhole);
[no, fc]=surfboolean(ncyl, fcyl, boolopt, nh, fh);
[no,fc]=removeisolatednode(no(:,1:3),fc(:,1:3));
[node2, elem2]=s2m(no, fc, 0.02, maxvol, method, regionseeds, holeseeds, 'cgalmesh');
Can you please help me?
Thank you in advance,
Caterina