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.

Defining Geometric Parameters from Imported Grid Data

Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Hello everyone,

I would like to be able to take a grid data file that I have and create a block with width(x) and depth(y) from the x and y values of the data file.

The format of the data file is as such:

%Grid
X values
Y values
%Data
{Data Matrix}

I would also like to add that the X and Y values go from negative to positive and I would like to define the block dimensions in terms of their total ranges.

Any help would be great, thank you!

8 Replies Last Post 25 juil. 2016, 14:35 UTC−4
Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 18 juil. 2016, 12:57 UTC−4
Anyone that might be able to point me in the right direction? Thanks!
Anyone that might be able to point me in the right direction? Thanks!

Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 19 juil. 2016, 02:08 UTC−4
It's not quite clear what kind of geometry that you are describing. Is it a jagged block? Can you attach or point to an image of a similar geometry?

You can create a COMSOL geometry from interpolation functions and parametric surfaces. I suggest that you consult the documentation on these two topics.
It's not quite clear what kind of geometry that you are describing. Is it a jagged block? Can you attach or point to an image of a similar geometry? You can create a COMSOL geometry from interpolation functions and parametric surfaces. I suggest that you consult the documentation on these two topics.

Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 19 juil. 2016, 12:22 UTC−4
Right so I am trying to define the length and width of a regular block that will have a fixed depth of 2mm. I would like to use data that I have to define the length and width of the block but I'm not sure how to do this. Thanks for the reply.
Right so I am trying to define the length and width of a regular block that will have a fixed depth of 2mm. I would like to use data that I have to define the length and width of the block but I'm not sure how to do this. Thanks for the reply.

Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 19 juil. 2016, 12:30 UTC−4

Right so I am trying to define the length and width of a regular block that will have a fixed depth of 2mm. I would like to use data that I have to define the length and width of the block but I'm not sure how to do this. Thanks for the reply.


The data file that I would like to use is of the following form: (I would like the range from x_1 to x_n to define the width of this block and the range from y_1 to y_n to define the length.)

%Grid
x1 x2 x3 x4 x5 x6 .......
y1 y2 y3 y4 y5 y6......
%Data
[Data Matrix]
[QUOTE] Right so I am trying to define the length and width of a regular block that will have a fixed depth of 2mm. I would like to use data that I have to define the length and width of the block but I'm not sure how to do this. Thanks for the reply. [/QUOTE] The data file that I would like to use is of the following form: (I would like the range from x_1 to x_n to define the width of this block and the range from y_1 to y_n to define the length.) %Grid x1 x2 x3 x4 x5 x6 ....... y1 y2 y3 y4 y5 y6...... %Data [Data Matrix]

Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 19 juil. 2016, 14:18 UTC−4
If I understand correctly you want to do a parametric sweep over geometry variants defined by n x-dimensions and n y-dimensions. If this is correct you don't need a grid file and it doesn't work this way. You can define two parameters, say 'width' and 'height' (don't use x and y!). Set up a parametric sweep and simply put the x and y value lists into the fields for the parameter list. If it is long you can import it from a file.

Cheers
Edgar

--
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
If I understand correctly you want to do a parametric sweep over geometry variants defined by n x-dimensions and n y-dimensions. If this is correct you don't need a grid file and it doesn't work this way. You can define two parameters, say 'width' and 'height' (don't use x and y!). Set up a parametric sweep and simply put the x and y value lists into the fields for the parameter list. If it is long you can import it from a file. Cheers Edgar -- Edgar J. Kaiser emPhys Physical Technology http://www.emphys.com

Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 20 juil. 2016, 14:32 UTC−4

If I understand correctly you want to do a parametric sweep over geometry variants defined by n x-dimensions and n y-dimensions. If this is correct you don't need a grid file and it doesn't work this way. You can define two parameters, say 'width' and 'height' (don't use x and y!). Set up a parametric sweep and simply put the x and y value lists into the fields for the parameter list. If it is long you can import it from a file.

Cheers
Edgar

--
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com


Okay, yes this is definitely what I want, the only thing is that I am already importing the data in form of a grid .txt file for another purpose and was hoping I could pull the x and y coordinates out of it at the same time. It sounds like I might need to import two files. Thank you for the help!
[QUOTE] If I understand correctly you want to do a parametric sweep over geometry variants defined by n x-dimensions and n y-dimensions. If this is correct you don't need a grid file and it doesn't work this way. You can define two parameters, say 'width' and 'height' (don't use x and y!). Set up a parametric sweep and simply put the x and y value lists into the fields for the parameter list. If it is long you can import it from a file. Cheers Edgar -- Edgar J. Kaiser emPhys Physical Technology http://www.emphys.com [/QUOTE] Okay, yes this is definitely what I want, the only thing is that I am already importing the data in form of a grid .txt file for another purpose and was hoping I could pull the x and y coordinates out of it at the same time. It sounds like I might need to import two files. Thank you for the help!

Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 20 juil. 2016, 14:36 UTC−4
Also, could you please elaborate or point me in the direction of what the file should look like in order to import the x and y values? Thank you.
Also, could you please elaborate or point me in the direction of what the file should look like in order to import the x and y values? Thank you.

Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 25 juil. 2016, 14:35 UTC−4

Also, could you please elaborate or point me in the direction of what the file should look like in order to import the x and y values? Thank you.

If anyone could tell me how to get the data into the correct format, it would be greatly appreciated. I've tried over twenty different ways to import these coordinates and then use them in a parametric surface in order to create my 3D rectangle with fixed Z. I tried to follow the example in the thread below, however I kept getting an error message that there weren't columns where expected. At one point it told me that it expected 6 columns... I have no idea why. Thanks.

www.comsol.com/community/forums/general/thread/12982/
[QUOTE] Also, could you please elaborate or point me in the direction of what the file should look like in order to import the x and y values? Thank you. [/QUOTE] If anyone could tell me how to get the data into the correct format, it would be greatly appreciated. I've tried over twenty different ways to import these coordinates and then use them in a parametric surface in order to create my 3D rectangle with fixed Z. I tried to follow the example in the thread below, however I kept getting an error message that there weren't columns where expected. At one point it told me that it expected 6 columns... I have no idea why. Thanks. https://www.comsol.com/community/forums/general/thread/12982/

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.