vol=elemvolume(no,el,'vol');[newno,newel]=meshrefine(no,el,vol);
vol=elemvolume(no,el,'vol');[newno,newel]=meshrefine(no,el,struct('maxvol',min(vol)));
Hi Dr Fang,
I'm attempting to model the light propagation through a block of attenuating medium that I'm exporting from Abaqus. Because of this I'm limited to the number of nodes I can have in my model (both because of computation and teaching Abaqus licence). This is causing my simulation using your MMC equation to have a number of "mesh artifacts" in it that are not desirable.
[node,face,elem]=meshacylinder([0 0 0],[0 0
3],1,0.05,0.001,64);
c0=meshcentroid(node,elem(:,1:4));
rad=sqrt(sum(c0(:,1:2).*c0(:,1:2),2));
[no2,el2]=meshrefine(node,elem(:,1:5),rad.^2/1000);
plotmesh(no2,el2,'y>0')
(This is the light propagation with a homogeneous cylinder. I would not expect the "waviness" in the main light path. This medium is currently defined with relatively low scattering and absorption.)
I have attempted to refine my mesh using the meshrefine function in the iso2mesh library but havent been able to get it running. No matter the parameter I use it fails to refine the mesh and simply gives me a larger mesh size. (see the examples below):
Attempting to define each element volume using the already existing element volume provides mesh with 989 nodes and 599 elements. Down from 64999 nodes and 44807 elements in the original mesh.
vol=elemvolume(no,el,'vol');[newno,newel]=meshrefine(no,el,vol);
I then attempted to define the new element size using the minimum element size of the existing mesh. This gives me the same mesh. Dividing the min element size by 2, also gives me the same mesh
vol=elemvolume(no,el,'vol');[newno,newel]=meshrefine(no,el,struct('maxvol',min(vol)));
This is the mesh the meshrefine function provides me.
This is my original mesh.
In an attempt to get around this problem I have tried to first convert the mesh to a volume using mesh2vol.m and the used vol2mesh to convert it back to a more refined mesh. But I'm unsure as to what to define for [Nx,Ny,Nz] as this mesh wasnt originally an image, or for (xi,yi,zi).
For this problem I would like to avoid any hard coding as for my PhD I need to determine the light propagation properties of many different materials/designs under different loads - hence deformations -- so different shapes.
Would appreciate any help you can provide.
Cheers.
--
You received this message because you are subscribed to the Google Groups "iso2mesh-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iso2mesh-user...@googlegroups.com.
To post to this group, send email to iso2mes...@googlegroups.com.
Visit this group at https://groups.google.com/group/iso2mesh-users.
For more options, visit https://groups.google.com/d/optout.
This mesh has the same number of nodes and elements as I was getting previously. And the mesh has the same pattern at the top edge as previously. If I plot the mesh before running meshrefine I get something similar to the mesh you provide:
I'm wondering if this has to do with this error message I'm receiving. I've had a quick look in this forum for any similar error surrounding readtetgen but have failed to find any.
I was receiving the same error message previously, so I would assume this issue im having is coming from the readtetgen or mwpath function.
Thanks for you help,
Alistair Newcombe
Ok, a small update. There seems to something in meshrefine that is storing my original mesh data. From the script you post previously I changed the second axis end point to [0 0 5] and it still produced the 3 unit high cylinder. Have you experienced this problem before?
then you have to look at the printed messages carefully. this typically happens when the command failed, and
unable to generate new data (but the old data were cached, so it read out the old output from the cached
folder - use mwpath to find out where these files are stored).
if you see an error in your log, please post it here.
Hi Dr Fang,
If I delete all the files within my ....\AppData\Local\Temp\iso2mesh-anew809 folder then I am able to remesh the object. But this doesn't seem like an elegant/longterm fix. If I was to get an error where would this occur?
A similar thing is also occuring when I attempt to add an external source to my the source that is from running the first example within the example is added to my mesh.
Obviously I can run the example to add an external source to a sphere. But adding a small 1x1 source at (0,0,-0.1) fails and gives me these errors:
In other post in the mmc-users google group the issue appears to be with the Matlab version used, I'm using MATLAB R2015B (MATLAB 8.6). So this shouldn't be issue, unless I need to get the most up-to-date version. I have added a screenshot of the script that I'm running to attempt to generate this source, but its a direct copy from the example so this might not be helpful.
Apologies for asking a mmc related question on the iso2mesh group. I just seemed relevant to the issue I was previously having.
An additional question about the sources is there any documentation that defines all the available sources in mmc, and what the source parameters are defined as, specifically what the focus is defined as (angle from normal??). If there Isn't any documentation I'll take a dive into the code and see what I can work out.
Cheers
then you have to look at the printed messages carefully. this typically happens when the command failed, and
unable to generate new data (but the old data were cached, so it read out the old output from the cached
folder - use mwpath to find out where these files are stored).
if you see an error in your log, please post it here.
Hi Dr Fang,
If I delete all the files within my ....\AppData\Local\Temp\iso2mesh-anew809 folder then I am able to remesh the object. But this doesn't seem like an elegant/longterm fix. If I was to get an error where would this occur?
A similar thing is also occuring when I attempt to add an external source to my the source that is from running the first example within the example is added to my mesh.
Obviously I can run the example to add an external source to a sphere. But adding a small 1x1 source at (0,0,-0.1) fails and gives me these errors:
In other post in the mmc-users google group the issue appears to be with the Matlab version used, I'm using MATLAB
[no,fc,el]=meshacylinder([0 0 0],[0 0 3],1,0.1,0.001,128);
fixednodes=[0.0, 0.0, -1.0; 0.0, 0.0, 4.0; ...
-4.0, 0.0, 1.5; 4.0, 0.0, 1.5; ...
0.0, -4.0, 1.5; 0.0, 4.0, 1.5];
source=double([-1 -1;-1 1;1 1;1 -1]);
source(:,3)=-1;
[newnode,newelem]=mmcaddsrc(no,el,[fixednodes; source],'extcmdopt','-Y -a1','extlabel',0);
newelem(newelem(:,end)<0,end)=0;
srcnode=find(newnode(:,3)==-1) % find the nodes on the source plane
eid=ismember(newelem(:,1:4),srcnode); % find the elements that containing souce nodes
srceid=find(sum(eid,2)>=3) % elements on the src aperture;
newelem(srceid,end)=-1;
plotmesh(newnode,[],newelem,'y>0')
Cheers
Hi Qianqian,I'm simply using the basic uniform cylinder to test the MC sim and get it up and working. I want to be able to import any arbitrary deformed object, refine the mesh with iso2mesh and then run that in your MMC model. This is why I have been avoiding "hard-coding" the shape of the mesh.Could I be running into issues due to my Abaqus model using a 10-node tetrahedron, and iso2mesh using a 4-node tetrahedron. But even then I should be able to simple remove the unneeded nodes from my node array. Doing so does not change the result.Thanks for your help.
But at least this is progress!!! Although again meshrefine is not work.
I'm really not understanding why this is not working. What I'm to mesh is trivial compared to some of the examples that you have provided. So this should be an extremely simple thing to mesh. I'm going to spend one or two more days trying to trouble-shoot this problem, and if I cant get it in that time i might have to give up this approach. And simply model the geometry using a number of primitive shapes (so cylinders, rectangles etc), that should approximate the light path.
Thank you very much for all your help Dr Fang.
Alistair Newcombe