importing txt file to create geometry in comsol 4.0a

Thread index  |  Previous thread  |  Next thread  |  Start a new discussion

RSS FeedRSS feed   |   Email notificationsTurn on email notifications   |   16 Replies   Last post: January 19, 2013 5:54am UTC
Deepak Chowdary

Deepak Chowdary

March 30, 2011 5:44am UTC

importing txt file to create geometry in comsol 4.0a

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Kelly Seymour

Kelly Seymour

June 2, 2011 3:52pm UTC in response to Deepak Chowdary

Re: importing txt file to create geometry in comsol 4.0a

Hello,

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

Thank you!

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Jeff Hiller

Jeff Hiller
COMSOL Employee
USA
Moderator

June 2, 2011 4:00pm UTC in response to Kelly Seymour

Re: importing txt file to create geometry in comsol 4.0a

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/

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Kelly Seymour

Kelly Seymour

June 2, 2011 4:56pm UTC in response to Jeff Hiller

Re: importing txt file to create geometry in comsol 4.0a

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Jeff Hiller

Jeff Hiller
COMSOL Employee
USA
Moderator

June 2, 2011 5:11pm UTC in response to Kelly Seymour

Re: importing txt file to create geometry in comsol 4.0a

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.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Kelly Seymour

Kelly Seymour

June 2, 2011 5:24pm UTC in response to Jeff Hiller

Re: importing txt file to create geometry in comsol 4.0a

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?

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Chunyan Li

Chunyan Li

February 16, 2012 2:59pm UTC in response to Kelly Seymour

Re: importing txt file to create geometry in comsol 4.0a


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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Jeff Hiller

Jeff Hiller
COMSOL Employee
USA
Moderator

February 16, 2012 3:27pm UTC in response to Jeff Hiller

Re: importing txt file to create geometry in comsol 4.0a

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/ .

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Chunyan Li

Chunyan Li

February 17, 2012 8:53am UTC in response to Jeff Hiller

Re: importing txt file to create geometry in comsol 4.0a

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Alexander Warning

Alexander Warning

March 1, 2012 8:39pm UTC in response to Chunyan Li

Re: importing txt file to create geometry in comsol 4.0a

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.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Chunyan Li

Chunyan Li

March 1, 2012 8:50pm UTC in response to Alexander Warning

Re: importing txt file to create geometry in comsol 4.0a

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Ivar Kjelberg

Ivar Kjelberg

March 1, 2012 10:51pm UTC in response to Chunyan Li

Re: importing txt file to create geometry in comsol 4.0a

Hi

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

--
Good luck
Ivar

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Pranay Ghosh

Pranay Ghosh

July 5, 2012 4:08pm UTC in response to Ivar Kjelberg

Re: importing txt file to create geometry in comsol 4.0a

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Chunyan Li

Chunyan Li

July 18, 2012 12:43pm UTC in response to Alexander Warning

Re: importing txt file to create geometry in comsol 4.0a

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Saeid Norouzi Apourvari

Saeid Norouzi Apourvari

October 11, 2012 2:19am UTC in response to Chunyan Li

Re: importing txt file to create geometry in comsol 4.0a

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Chunyan Li

Chunyan Li

October 16, 2012 8:04am UTC in response to Saeid Norouzi Apourvari

Re: importing txt file to create geometry in comsol 4.0a

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 :)

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Saeid Norouzi Apourvari

Saeid Norouzi Apourvari

January 19, 2013 5:54am UTC in response to Chunyan Li

Re: importing txt file to create geometry in comsol 4.0a

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse


Rules and guidelines