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.

How can I import 2-dimensional array value to one variable using text file?

kunok Kyung Hee University/Nuclear Materials

Please login with a confirmed email address before reporting spam

Hi, all

I saw COMSOL 3.5a Phase field tutorial movie and in their movie, they import initial random state from the file to one variable. (This variable should depends on the position (x,y)).

How can I do this? Is there any format for this txt file?

Now I am suing COMSOL 4.2a.

In enclosed image,

First column is x coordinate
Second column is y coordinate
Third column is u_init values.

I want to put u_init, which is function of x,y values from that txt file.

Thank you very much
Kunok


2 Replies Last Post Apr 5, 2012, 3:54 p.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 5, 2012, 3:23 p.m. EDT
You need to use Interpolation Function and choose source of data as file.
You need to use Interpolation Function and choose source of data as file.

kunok Kyung Hee University/Nuclear Materials

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 5, 2012, 3:54 p.m. EDT
Thanks!
Thanks!

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.