Hello,
I am trying to transfer a geometry I created in Matlab into a FE program. For this application I found the toolbox ISO2MESH. I'm able to export the provided examples and import them into Comsol. Since there were some issues with my application, I tried it with a smaller but similar example (provided by https://de.mathworks.com/help/matlab/ref/tetramesh.html) and encountered difficulties:
d = [-1 1];
[x,y,z] = meshgrid(d,d,d);
x = [x(:);0];
y = [y(:);0];
z = [z(:);0];
DT = delaunayTriangulation(x,y,z);
tetramesh(DT);
camorbit(20,0)
M=meshgrid(x,y,z);
[node,elem,face]=vol2mesh(M,1:size(M,1),1:size(M,2),1:size(M,3),0.1,2,1);
savemphtxt(node,face,elem,'test_mesh_export_comsol.mphtxt');
This code compiles with the warning "You are meshing the surface with sub-pixel size. If this is not your intent, please check if you set "opt.radbound" correctly for the default meshing method. "
I get a result readable by Comsol, but it does not share the dimensions of the original and is too finely meshed (see below).
I change the parameters in the line
[node,elem,face]=vol2mesh(M,1:size(M,1),1:size(M,2),1:size(M,3),2,2,1);
so I don't get a warning anymore, the imported result is very bad (see below).
I would be happy if someone has an idea what I am doing wrong and how I can export the net cleanly.