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.

Troubles with reading COMSOL text data files and files with interpolation functions

Please login with a confirmed email address before reporting spam

Hello everyone!

I have some troubles with creating my own reader for COMSOL text data files and files with interpolation functions. I have read "The COMSOL File Formats" section of COMSOLMultiphysicsReferenceGuide.pdf (for v4.3.a) but it didn't help.

Problem 1) In data files, for "Mesh" Serializable, there is a section where number of parameter values per element (NER), number of parameter sets (NR) and matrix of parameter values (PAR) are defined. Here are some questions:

a) In some files matrix has, as specified in ReferenceGuide, NER x NE values. But, in some cases I found (3 * NER) lines every with NR values. Is this correct?
b) Are these values per element or per node values?
c) Are these values scalar or vector values (perhaps what I found under a) is model with vector (3tuple) values)?

Problem 2) I need to display some values defined in separate file as interpolation functions (as I understood from ReferenceGuide) defined on cloud of points. These points from cloud approximately match with (not always strict) subset of mesh points from data file. Is there a way to connect points from data file with points from cloud in constant time (i.e. without using k-d tree and similar techniques)? I believe there is a way to connect them becase they approximately match, but I don't know how points from cloud are created. Do You have any idea?

Thank You for Your help!

Best regards,
Nenad.

2 Replies Last Post 2013年2月25日 GMT-5 06:00
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 2013年2月22日 GMT-5 13:38
Hi

I do not have any direct answer to your questions, but for the meshing to DOF you find more here:

www.comsol.eu/support/knowledgebase/875/

But that is not the full story, as the plotter do further refinements (which sometimes makes strange overshoots at sharp borders, and depending on how you export your data you might have this interpolation on top of the discretization of the mesh elements.

I have given up trying to export and particularly exchange with other programs, because of lack of clear undestanding. But I have noticed that so long I remain within the GUI COMSOL is coherent and to date, since v4 has arrived, I have managed to not use matlab, but OK I do see many reasons why scripting is handy ;)

Sorry cannot tell more, probably the best is to get info from COMSOL support, I cannot remember having seen many answers on the Forum concerning this subject, however, quite some questions about similar subjects, have you tried a search ?

--
Good luck
Ivar
Hi I do not have any direct answer to your questions, but for the meshing to DOF you find more here: http://www.comsol.eu/support/knowledgebase/875/ But that is not the full story, as the plotter do further refinements (which sometimes makes strange overshoots at sharp borders, and depending on how you export your data you might have this interpolation on top of the discretization of the mesh elements. I have given up trying to export and particularly exchange with other programs, because of lack of clear undestanding. But I have noticed that so long I remain within the GUI COMSOL is coherent and to date, since v4 has arrived, I have managed to not use matlab, but OK I do see many reasons why scripting is handy ;) Sorry cannot tell more, probably the best is to get info from COMSOL support, I cannot remember having seen many answers on the Forum concerning this subject, however, quite some questions about similar subjects, have you tried a search ? -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年2月25日 GMT-5 06:00
Hi Ivar,

Thank You very much for Your answer.

About plotter's refinements, yes, I noticed this too. I'm starting to believe point cloud on which interpolation function is defined is created not from workflow state from which data points are exported. It's probably created from some other workflow state, derived from original, so I'm not capable to connect them easily.

About my first question on parameters section, You can find example (I created by manually changing example from ReferenceGuide) of what I was talking about at the end of message.

Best regards,
Nenad.


# Major & minor version
0 1
1 # number of tags
# Tags
5 mesh1
1 # number of types
# Types
3 obj

# --------- Object 0 ----------

0 0 1
4 Mesh # class
2 # version
2 # sdim
6 # number of mesh points
0 # lowest mesh point index
# Mesh point coordinates on unit square
0 0
1 0
0.5 0.5
0.5 0.0
0.25 0.25
0.75 0.25
1 # number of element types
4 tri2 # type name
6 # number of nodes per element
1 # number of elements
# Elements, 4 triangular elements
0 1 2 3 4 5
6 # number of parameter values per element
1 # number of parameters
1 2 3 1.1 2.2 3 1.2 2.2 3 1.4 2.4 3 1.5 2.5 3 1.6 2.6 3
4 # number of domains
# Domains
1
1
2
2
0 # number of up/down pairs
Hi Ivar, Thank You very much for Your answer. About plotter's refinements, yes, I noticed this too. I'm starting to believe point cloud on which interpolation function is defined is created not from workflow state from which data points are exported. It's probably created from some other workflow state, derived from original, so I'm not capable to connect them easily. About my first question on parameters section, You can find example (I created by manually changing example from ReferenceGuide) of what I was talking about at the end of message. Best regards, Nenad. # Major & minor version 0 1 1 # number of tags # Tags 5 mesh1 1 # number of types # Types 3 obj # --------- Object 0 ---------- 0 0 1 4 Mesh # class 2 # version 2 # sdim 6 # number of mesh points 0 # lowest mesh point index # Mesh point coordinates on unit square 0 0 1 0 0.5 0.5 0.5 0.0 0.25 0.25 0.75 0.25 1 # number of element types 4 tri2 # type name 6 # number of nodes per element 1 # number of elements # Elements, 4 triangular elements 0 1 2 3 4 5 6 # number of parameter values per element 1 # number of parameters 1 2 3 1.1 2.2 3 1.2 2.2 3 1.4 2.4 3 1.5 2.5 3 1.6 2.6 3 4 # number of domains # Domains 1 1 2 2 0 # number of up/down pairs

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.