Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
07.08.2014, 07:53 GMT-4
I am not quite sure what you mean, but you can open Comsol more than once and copy-paste between windows.
I am not quite sure what you mean, but you can open Comsol more than once and copy-paste between windows.
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
07.08.2014, 08:09 GMT-4
Thanks Lasse,
but that's pretty similar to copy and paste from a generated Comsolo Report.
When developing a model sometimes I write 20-30 functions, that I would like to re-use in another model. Today, for example, I build an EM model in 3D and I would like to import functions for dielectric mixtures coming from a different 2D model... I had to do it by hand (with copy & paste).
Roberto
Thanks Lasse,
but that's pretty similar to copy and paste from a generated Comsolo Report.
When developing a model sometimes I write 20-30 functions, that I would like to re-use in another model. Today, for example, I build an EM model in 3D and I would like to import functions for dielectric mixtures coming from a different 2D model... I had to do it by hand (with copy & paste).
Roberto
Please login with a confirmed email address before reporting spam
Posted:
10 years ago
15.10.2014, 11:01 GMT-4
I am looking for the solution too. It seems, that there is no other solution for now, but copy-paste in text format, and manualy adjusting all parameters such as "May produce complex output for real arguments".
Sometimes one can use a workaround:
1) create a user defined material;
2) drag and drope all your functions into the material;
3) save the material in a user difined materil library;
4) in a new (target) file import your new material definded at previous steps, it will be imported with all the functions;
5) drag and drope the functions to the Global definitions node.
The above mentioned scenario works only with Analytic, Interpolation, and Piecewise functions.
The user defined material library is stored in the mph-file. "The file path on Windows might be similar to C:\Users\Your_Name\.comsol\v44\materials" You can take this file with you, to your new COMSOL vertion or to another computer, and import it.
In new vertion 5.0 I still cannot find any sign that one can export functions. However in v5.0 you can refer to the functions stored in your material during solution or postprocessing. Say, in Global probe you can add mat4.def.Cp(T) in an Expression field, or select the corresponding line in the "Replace Expression" drope down menu.
Maxim
I am looking for the solution too. It seems, that there is no other solution for now, but copy-paste in text format, and manualy adjusting all parameters such as "May produce complex output for real arguments".
Sometimes one can use a workaround:
1) create a user defined material;
2) drag and drope all your functions into the material;
3) save the material in a user difined materil library;
4) in a new (target) file import your new material definded at previous steps, it will be imported with all the functions;
5) drag and drope the functions to the Global definitions node.
The above mentioned scenario works only with Analytic, Interpolation, and Piecewise functions.
The user defined material library is stored in the mph-file. "The file path on Windows might be similar to C:\Users\Your_Name\.comsol\v44\materials" You can take this file with you, to your new COMSOL vertion or to another computer, and import it.
In new vertion 5.0 I still cannot find any sign that one can export functions. However in v5.0 you can refer to the functions stored in your material during solution or postprocessing. Say, in Global probe you can add mat4.def.Cp(T) in an Expression field, or select the corresponding line in the "Replace Expression" drope down menu.
Maxim
Please login with a confirmed email address before reporting spam
Posted:
10 years ago
15.01.2015, 12:09 GMT-5
Sometimes one can use a workaround:
1) create a user defined material;
2) drag and drope all your functions into the material;
Pretty cool. This works great. How in the _world_ did you think of it :)
[QUOTE]
Sometimes one can use a workaround:
1) create a user defined material;
2) drag and drope all your functions into the material;
[/QUOTE]
Pretty cool. This works great. How in the _world_ did you think of it :)
Gerardo E. Villarreal-Garcia
Please login with a confirmed email address before reporting spam
Posted:
9 years ago
09.11.2015, 13:09 GMT-5
Thanks for the "trick". It's been very useful.
Kind regards
--
Gerardo E. Villarreal-Garcia
Centre for Quantum Photonics
H.H. Wills Physics Laboratory
University of Bristol
Tyndall Avenue
Bristol
BS8 1TL, UK
Email: g.villarreal@bristol.ac.uk
Thanks for the "trick". It's been very useful.
Kind regards
--
Gerardo E. Villarreal-Garcia
Centre for Quantum Photonics
H.H. Wills Physics Laboratory
University of Bristol
Tyndall Avenue
Bristol
BS8 1TL, UK
Email: g.villarreal@bristol.ac.uk
Please login with a confirmed email address before reporting spam
Posted:
8 years ago
19.07.2016, 16:25 GMT-4
It's worth adding to this thread the general trick of File -> SaveAs -> File type JAVA model.
If you save your functions to a material library, open that mph file, then save as JAVA,
you'll get a relatively small file with all your functions in it. Yes, there's some cruft you'll
need to delete to use it in another application, but it's better than typing in all those equations from scratch, or cut/pasting them individually.
Also, since you can also import the JAVA file, you can use your favorite editor to
mess with the functions and not have to deal with COMSOL's "assistance" during
their reformulation.
It's worth adding to this thread the general trick of File -> SaveAs -> File type JAVA model.
If you save your functions to a material library, open that mph file, then save as JAVA,
you'll get a relatively small file with all your functions in it. Yes, there's some cruft you'll
need to delete to use it in another application, but it's better than typing in all those equations from scratch, or cut/pasting them individually.
Also, since you can also import the JAVA file, you can use your favorite editor to
mess with the functions and not have to deal with COMSOL's "assistance" during
their reformulation.