Error that I receive when I am trying to mesh

379 views
Skip to first unread message

Hasan CELIK

unread,
Feb 19, 2016, 10:43:23 AM2/19/16
to iso2mesh-users
Hello everyone,

I am a very beginner user of iso2mesh. Actually, I am working on a porous media problem but I am having many problems while meshing the domain so  I have started with very simple geometry to get familiar with meshing procedure. This is how I do this:

1-) I create my stack tiff file using imageJ and following that I read this file using similar way to demo_cgalmesher, by considering only "[node,elem,face]=v2m(brain,[],2,100,'cgalmesh')" line.

2-) I use savemphtxt m file to save the mesh as comsol input file and when I import this file into Comsol, I get error: Detail: Two elements connect to the same side of the shared element face.

3-) I checked iso2mesh-users forum so I understand that I need to use meshcheckrepair m file to fix shared element faces. When I type the command meshcheckrepair(node,elem,'meshfix'), I got fgets error like the follows:


/Documents/MATLAB/iso2mesh/bin/meshfix.mexmaci64" "/private/tmp/iso2mesh/pre_sclean.off"  -q -a 0.01 : Killed
Error using fgets
Invalid file identifier. Use fopen to generate a valid file identifier.

Error in fgetl (line 33)
[tline,lt] = fgets(fid);

Error in readoff (line 23)
line=fgetl(fid);

Error in meshcheckrepair (line 77)
    [node,elem]=readoff(mwpath('pre_sclean_fixed.off'));



I have checked that I am able to use other commands that needs bin folder. I also am able to use other meshcheckrepair options, such as "dup".

Where is my mistake? Am I doing something wrong or skipping any step? Can you help me please?

Qianqian Fang

unread,
Feb 19, 2016, 6:34:08 PM2/19/16
to iso2mes...@googlegroups.com
On 02/19/2016 08:09 AM, Hasan CELIK wrote:
Hello everyone,

I am a very beginner user of iso2mesh. Actually, I am working on a porous media problem but I am having many problems while meshing the domain so  I have started with very simple geometry to get familiar with meshing procedure. This is how I do this:

1-) I create my stack tiff file using imageJ and following that I read this file using similar way to demo_cgalmesher, by considering only "[node,elem,face]=v2m(brain,[],2,100,'cgalmesh')" line.

did you plot the mesh and see if the mesh is what you want?


2-) I use savemphtxt m file to save the mesh as comsol input file and when I import this file into Comsol, I get error: Detail: Two elements connect to the same side of the shared element face.

if the plotted mesh looks fine, but comsol complains, I am sure
it was due to the conversion.

please be aware that the output from v2m with cgalmesh
option includes labels for all 3 outputs: the node output has 4
columns with the last column a label (it is not a coordinate);
similar for elem and face.

When you call savemphtxt, please make sure you include
or remove the label column based on the requirements.


3-) I checked iso2mesh-users forum so I understand that I need to use meshcheckrepair m file to fix shared element faces. When I type the command meshcheckrepair(node,elem,'meshfix'), I got fgets error like the follows:

no, as I said, it is unlikely the mesh's problem. it is due to
your export procedures, possibly due to the improper use of
the extra label columns.

in addition, meshcheckrepair only works on surface meshes,
and it won't work for volumetric mesh.

hope this helps

Qianqian

/Documents/MATLAB/iso2mesh/bin/meshfix.mexmaci64" "/private/tmp/iso2mesh/pre_sclean.off"  -q -a 0.01 : Killed
Error using fgets
Invalid file identifier. Use fopen to generate a valid file identifier.

Error in fgetl (line 33)
[tline,lt] = fgets(fid);

Error in readoff (line 23)
line=fgetl(fid);

Error in meshcheckrepair (line 77)
    [node,elem]=readoff(mwpath('pre_sclean_fixed.off'));



I have checked that I am able to use other commands that needs bin folder. I also am able to use other meshcheckrepair options, such as "dup".

Where is my mistake? Am I doing something wrong or skipping any step? Can you help me please?
--
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.

Hasan CELIK

unread,
Feb 19, 2016, 10:33:02 PM2/19/16
to iso2mesh-users
Dear Dr. Fanq,

Thank you very much for your quick response. I think I have solved this problem but now I am having very similar problem with this user. (https://groups.google.com/forum/#!searchin/iso2mesh-users/comsol$20boundary/iso2mesh-users/WIVkBpGAwro/6OJ_ZA-TmNIJ)

I save my mesh as mphtxt file and I import it to Comsol but Comsol recognize every node as boundary. I tried the solution explained in that page but it did not work for me. How can I define my own boundaries in iso2mesh?
Reply all
Reply to author
Forward
0 new messages