Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

importing txt file to create geometry in comsol 4.0a

Please login with a confirmed email address before reporting spam

hi

can i create a geometry by importing coordinate data existing in a text file in comsol4.0a?
suppose i am having (x,y) data in a text file and i want to use this data for creating geometry in comsol4.0a.

thanks in advance

regards
deepak

16 Replies Last Post 2013年1月19日 GMT-5 00:54
COMSOL Moderator

Hello Deepak Chowdary

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月2日 GMT-4 11:52
Hello,

Just wondering, were you able to find a way to work out this issue? I am wondering the same thing myself.

Thank you!
Hello, Just wondering, were you able to find a way to work out this issue? I am wondering the same thing myself. Thank you!

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月2日 GMT-4 12:00
I suppose that your data represents an elevation at various points in the xy plane, i.e. h(x,y). If so, this is something that is feasible using the parametric surface capabilities introduced at version 4.2. See section entitled "Parametric Surfaces" on this page: www.comsol.com/products/4.2/
I suppose that your data represents an elevation at various points in the xy plane, i.e. h(x,y). If so, this is something that is feasible using the parametric surface capabilities introduced at version 4.2. See section entitled "Parametric Surfaces" on this page: http://www.comsol.com/products/4.2/

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月2日 GMT-4 12:56
Thank you very much, that sounds like what I am looking for. I hope to begin with V4.2 within the next few days (whenever it reaches me.)

Will 4.2 also have the ability to read images? I have an image with only black and white areas and would like to define different material properties based on the color either through the coordinates, element, or node number or somehow directly through the image itself. Do you know of a way to do this with either 4.1 or 4.2?

I really appreciate the help!

Kelly
Thank you very much, that sounds like what I am looking for. I hope to begin with V4.2 within the next few days (whenever it reaches me.) Will 4.2 also have the ability to read images? I have an image with only black and white areas and would like to define different material properties based on the color either through the coordinates, element, or node number or somehow directly through the image itself. Do you know of a way to do this with either 4.1 or 4.2? I really appreciate the help! Kelly

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月2日 GMT-4 13:11
No, 4.2 does not have this sort of image reading capability, although you would probably be able to implement what you want in Matlab and connect it to your COMSOL Model that way.
No, 4.2 does not have this sort of image reading capability, although you would probably be able to implement what you want in Matlab and connect it to your COMSOL Model that way.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月2日 GMT-4 13:24
I am mostly using Livelink right now, with Comsol 4.1 and Matlab R2010a and am stuck trying to finding a way to read in my image or impose it on top of a basic square geometry in the code. I can't seem to find a way to write in a numbering system for the nodes or elements from the image into the code.

I was thinking it could go into the geometry section of the code, possibly listing all of the information on the pixels that are black, or in the material properties, something like:

%model.material('mat1').selection.set(1);

where inside the selection set could instead be a list of numbers. Do either of these sound possible?
I am mostly using Livelink right now, with Comsol 4.1 and Matlab R2010a and am stuck trying to finding a way to read in my image or impose it on top of a basic square geometry in the code. I can't seem to find a way to write in a numbering system for the nodes or elements from the image into the code. I was thinking it could go into the geometry section of the code, possibly listing all of the information on the pixels that are black, or in the material properties, something like: %model.material('mat1').selection.set(1); where inside the selection set could instead be a list of numbers. Do either of these sound possible?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年2月16日 GMT-5 09:59

Hello Kelly,

i am trying to import images into comsol. Have you solved the problem already? If yes, could you please share how you managed it with Matlab livelink?

thanks!

Chunyan
Hello Kelly, i am trying to import images into comsol. Have you solved the problem already? If yes, could you please share how you managed it with Matlab livelink? thanks! Chunyan

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年2月16日 GMT-5 10:27
Version 4.2a now includes the capability you were looking for: picture import, see section entitled "Image Import" at this link: www.comsol.com/products/4.2a/ .
Version 4.2a now includes the capability you were looking for: picture import, see section entitled "Image Import" at this link: http://www.comsol.com/products/4.2a/ .

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年2月17日 GMT-5 03:53
hey Jean,

thanks for the information.

But how is that implemented in COMSOL? I am using COMSOL4.2a now. The choices for importing include mphtxt, mphbin, dxf, asc and another one. It seems that direct importing a jpg or bmp is still not possible.

Chunyan
hey Jean, thanks for the information. But how is that implemented in COMSOL? I am using COMSOL4.2a now. The choices for importing include mphtxt, mphbin, dxf, asc and another one. It seems that direct importing a jpg or bmp is still not possible. Chunyan

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年3月1日 GMT-5 15:39
From the promotional video I see we can import 2D images into COMSOL 4.2a, is it possible to import stacks of 2D images as well? I have several CT scans, it would be good to do simulations on.
From the promotional video I see we can import 2D images into COMSOL 4.2a, is it possible to import stacks of 2D images as well? I have several CT scans, it would be good to do simulations on.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年3月1日 GMT-5 15:50
still don't know how to import 2D image directly into COMSOL yet.

But if you have access to Mimics, you can find it from this webpage, www.materialise.com/mimics, you could have stacks of CT scans processed in Mimics and then import into COMSOL. I've tried to use Mimics to compose biofilm structure from OCT images. It was possible to import the generated structure into COMSOL. But I had problem afterwards for other settings.

Wish you good luck!

Chunyan
still don't know how to import 2D image directly into COMSOL yet. But if you have access to Mimics, you can find it from this webpage, http://www.materialise.com/mimics, you could have stacks of CT scans processed in Mimics and then import into COMSOL. I've tried to use Mimics to compose biofilm structure from OCT images. It was possible to import the generated structure into COMSOL. But I had problem afterwards for other settings. Wish you good luck! Chunyan

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年3月1日 GMT-5 17:51
Hi

normally you need the latest version for that, see the release notes and the doc of v4.2a

--
Good luck
Ivar
Hi normally you need the latest version for that, see the release notes and the doc of v4.2a -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年7月5日 GMT-4 12:08
Hi,

I was able to construct 2D geometry from an MRI images, works quite good. Have you found a solution to using stacks of MRI images ?.

Pranay
Hi, I was able to construct 2D geometry from an MRI images, works quite good. Have you found a solution to using stacks of MRI images ?. Pranay

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年7月18日 GMT-4 08:43
hello Alexander,

have you found a way to import an image stack into comsol for further simulation? i have several image stacks and am wondering how to compose 3D geometry and import into comsol for simulation. if there is a way to directly import image stack, the simulation would become much easier.

Regards!

Chunyan
hello Alexander, have you found a way to import an image stack into comsol for further simulation? i have several image stacks and am wondering how to compose 3D geometry and import into comsol for simulation. if there is a way to directly import image stack, the simulation would become much easier. Regards! Chunyan

Saeid Norouzi Apourvari

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年10月10日 GMT-4 22:19
Dear Chunyan and Alexander,

Did you find any way to import stacks of 2D images acquired from CT. I have a 3D CT-image of a rock which has been segmented to pore (phase 0) and solid(phase 1) and I need to import it to COMSOL for flow simulation. Would you please let me know if you find a way?

Regards,
saeid
Dear Chunyan and Alexander, Did you find any way to import stacks of 2D images acquired from CT. I have a 3D CT-image of a rock which has been segmented to pore (phase 0) and solid(phase 1) and I need to import it to COMSOL for flow simulation. Would you please let me know if you find a way? Regards, saeid

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年10月16日 GMT-4 04:04
hey Saeid,

you may try a software called Mimics to creat geometry, even mesh, from image stack and then import the mesh into COMSOL for simulation. but if there are too many voids in your geometry, you may get problem in COMSOL.

Chunyan :)
hey Saeid, you may try a software called Mimics to creat geometry, even mesh, from image stack and then import the mesh into COMSOL for simulation. but if there are too many voids in your geometry, you may get problem in COMSOL. Chunyan :)

Saeid Norouzi Apourvari

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年1月19日 GMT-5 00:54
Hello there,

I managed to create a mesh for a 3D segmented image using iso2mesh toolbox. However when I import it to COMSOL I can not select any boundary to assign conditions on. Have you guys found any way to import 3D structure as a geometry into COMSOL 4.2, or later versions? (my structure is a segmented image in .mat format).

Regards,
saeid
Hello there, I managed to create a mesh for a 3D segmented image using iso2mesh toolbox. However when I import it to COMSOL I can not select any boundary to assign conditions on. Have you guys found any way to import 3D structure as a geometry into COMSOL 4.2, or later versions? (my structure is a segmented image in .mat format). Regards, saeid

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.