Write as Comsol mphtxt file format

1,419 views
Skip to first unread message

Sanket Jain

unread,
Sep 24, 2011, 11:57:39 PM9/24/11
to iso2mes...@googlegroups.com
Do you have a function to write the output of v2m as .mphtxt file format? 

Sanket

Qianqian Fang

unread,
Sep 26, 2011, 12:16:18 PM9/26/11
to iso2mes...@googlegroups.com, Sanket Jain
On 09/24/2011 11:57 PM, Sanket Jain wrote:
> Do you have a function to write the output of v2m as .mphtxt file format?

no, I have no clue what mphtxt file format looks like.

>
> Sanket
> --
> You received this message because you are subscribed to the Google
> Groups "iso2mesh-users" group.
> To post to this group, send email to iso2mes...@googlegroups.com.
> To unsubscribe from this group, send email to
> iso2mesh-user...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/iso2mesh-users?hl=en.

The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

Daniel_Kim

unread,
Sep 27, 2011, 3:08:47 AM9/27/11
to iso2mesh-users
It's a COMSOL format,

I've made this, but it's incomplete

On Sep 27, 1:16 am, Qianqian Fang <fa...@nmr.mgh.harvard.edu> wrote:
> On 09/24/2011 11:57 PM, Sanket Jain wrote:
>
> > Do you have a function to write the output of v2m as .mphtxt file format?
>
> no, I have no clue what mphtxt file format looks like.
>
>
>
> > Sanket
> > --
> > You received this message because you are subscribed to the Google
> > Groups "iso2mesh-users" group.
> > To post to this group, send email to iso2mes...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > iso2mesh-user...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/iso2mesh-users?hl=en.
>
> The information in this e-mail is intended only for the person to whom it is
> addressed. If you believe this e-mail was sent to you in error and the e-mail
> contains patient information, please contact the Partners Compliance HelpLine athttp://www.partners.org/complianceline. If the e-mail was sent to you in error

Sanket

unread,
Sep 28, 2011, 5:06:59 PM9/28/11
to iso2mesh-users
@ Kim: Can you share it with me whenever you are done?

Qianqian Fang

unread,
Sep 28, 2011, 5:24:16 PM9/28/11
to iso2mes...@googlegroups.com, Daniel_Kim
On 09/27/2011 03:08 AM, Daniel_Kim wrote:
> It's a COMSOL format,
>
> I've made this, but it's incomplete

hi Kim

I just want to add that it is always welcome
if anyone want to contribute to iso2mesh.

It would also be great if the contributed unit
contains a small section of help info. Please
open any existing iso2mesh .m to see the general
format.

Qianqian

김동현

unread,
Sep 29, 2011, 4:49:01 AM9/29/11
to iso2mes...@googlegroups.com
Hi all,

I've attached it. As i say, this function is incomplete.

It can load only tetra element and something wrong defining domain

When you fix it, please share it :)

Donghyeon Kim

2011/9/29 Qianqian Fang <fa...@nmr.mgh.harvard.edu>
On 09/27/2011 03:08 AM, Daniel_Kim wrote:
It's a COMSOL format,

I've made this, but it's incomplete

hi Kim

I just want to add that it is always welcome
if anyone want to contribute to iso2mesh.

It would also be great if the contributed unit
contains a small section of help info. Please
open any existing iso2mesh .m to see the general
format.

Qianqian

On Sep 27, 1:16 am, Qianqian Fang<fa...@nmr.mgh.harvard.edu>  wrote:
On 09/24/2011 11:57 PM, Sanket Jain wrote:

Do you have a function to write the output of v2m as .mphtxt file format?
no, I have no clue what mphtxt file format looks like.



Sanket
--
You received this message because you are subscribed to the Google
Groups "iso2mesh-users" group.
To post to this group, send email to iso2mesh-users@googlegroups.com.

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/iso2mesh-users?hl=en.
save_mphtxt.m

Qianqian Fang

unread,
Sep 29, 2011, 10:28:57 AM9/29/11
to iso2mes...@googlegroups.com, 김동현
On 09/29/2011 04:49 AM, 김동현 wrote:
Hi all,

I've attached it. As i say, this function is incomplete.

It can load only tetra element and something wrong defining domain

When you fix it, please share it :)

hi Donghyeon

in order for other people to modify/derive based on
your work, you have to specify a license, preferably
an OSI approved open source licenses, see

http://www.opensource.org/licenses/category

Specifically, because iso2mesh is licensed under
the GNU General Public License (GPL), to be included
in iso2mesh, the contribution must be licensed under
a compatible license (GPL or a permissive license such
as BSD/MIT/X11/ApacheV2 etc), although it is purely
your choice.

Would you please send another copy of your script
with the license clarified at the header of the script?

Please forgive me for the formalness on the license
matters, but this is necessary for any open-source
software to grow.

Qianqian


Donghyeon Kim

2011/9/29 Qianqian Fang <fa...@nmr.mgh.harvard.edu>
On 09/27/2011 03:08 AM, Daniel_Kim wrote:
It's a COMSOL format,

I've made this, but it's incomplete

hi Kim

I just want to add that it is always welcome
if anyone want to contribute to iso2mesh.

It would also be great if the contributed unit
contains a small section of help info. Please
open any existing iso2mesh .m to see the general
format.

Qianqian

On Sep 27, 1:16 am, Qianqian Fang<fa...@nmr.mgh.harvard.edu>  wrote:
On 09/24/2011 11:57 PM, Sanket Jain wrote:

Do you have a function to write the output of v2m as .mphtxt file format?
no, I have no clue what mphtxt file format looks like.



Sanket
--
You received this message because you are subscribed to the Google
Groups "iso2mesh-users" group.
To post to this group, send email to iso2mes...@googlegroups.com.

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/iso2mesh-users?hl=en.
The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine athttp://www.partners.org/complianceline. If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
--
You received this message because you are subscribed to the Google Groups "iso2mesh-users" group.
To post to this group, send email to iso2mes...@googlegroups.com.
To unsubscribe from this group, send email to iso2mesh-user...@googlegroups.com.

김동현

unread,
Sep 29, 2011, 10:53:25 AM9/29/11
to Qianqian Fang, iso2mes...@googlegroups.com
hi Qianqian

I've attached modified version, It's first time to share my own code to everyone on online

So, I didn't know what prepare before share my code,

I've written "this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)", 

It's ok? i think, because iso2mesh follows GPL license, when i say this function is in iso2mesh toolbox, it will follow GPL license.

김동현

unread,
Sep 29, 2011, 10:56:17 AM9/29/11
to Qianqian Fang, iso2mes...@googlegroups.com
Oh, i missed my code.

this is.
save_mphtxt.m

Qianqian Fang

unread,
Sep 29, 2011, 12:55:22 PM9/29/11
to 김동현, iso2mes...@googlegroups.com
On 09/29/2011 10:53 AM, 占썼동占쏙옙 wrote:
hi Qianqian

I've attached modified version, It's first time to share my own code to everyone on online

So, I didn't know what prepare before share my code,

I've written "this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)", 

It's ok? i think, because iso2mesh follows GPL license, when i say this function is in iso2mesh toolbox, it will follow GPL license.

As recommended by GPL, every unit should carry a
header to show it is GPL licensed. Since I have your
agreement, i will add this info to the code.

Sanket, can you help to test this unit and let me know
if this works for you?

thanks for both of you.

Qianqian







2011/9/29 Qianqian Fang <fa...@nmr.mgh.harvard.edu>

Sanket Jain

unread,
Sep 29, 2011, 12:56:48 PM9/29/11
to iso2mes...@googlegroups.com
Sure. I will do that. 

2011/9/29 Qianqian Fang <fa...@nmr.mgh.harvard.edu>
On 09/29/2011 10:53 AM, 김동현 wrote:
hi Qianqian

I've attached modified version, It's first time to share my own code to everyone on online

So, I didn't know what prepare before share my code,

I've written "this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)", 

It's ok? i think, because iso2mesh follows GPL license, when i say this function is in iso2mesh toolbox, it will follow GPL license.

As recommended by GPL, every unit should carry a
header to show it is GPL licensed. Since I have your
agreement, i will add this info to the code.

Sanket, can you help to test this unit and let me know
if this works for you?

thanks for both of you.

Qianqian








2011/9/29 Qianqian Fang <fa...@nmr.mgh.harvard.edu>

Sanket Jain

unread,
Sep 29, 2011, 5:36:19 PM9/29/11
to iso2mes...@googlegroups.com
When I import the output of the script, I get the following error: 

Exception:
com.femlab.jni.FlNativeException: Incompatible native file version
Messages:
Incompatible native file version

Stack trace:
at meshimpl.cpp, row 5078, ()
at com.femlab.jni.FlLoad.doLoad(Native Method)
at com.femlab.jni.FlLoad.load(Unknown Source)
at com.femlab.mesh.MeshLoad.load(Unknown Source)
at com.femlab.mesh.MeshImportRunnable.run(Unknown Source)
at com.femlab.server.FlRunner.run(Unknown Source)
at com.femlab.util.i.run(Unknown Source)
at com.femlab.util.aa.run(Unknown Source)

I am in the process of moving away from using mphtxt converter. Instead I am using native Comsol 4.1 functions with other 3.5 matlab functions to read my mesh into Comsol 4.X version. It works for smaller meshes. I have to try for larger meshes but I believe the same methods should work for them as well. 

Sanket

2011/9/29 Sanket Jain <jains...@gmail.com>
Message has been deleted

Daniel_Kim

unread,
Sep 30, 2011, 1:30:44 AM9/30/11
to iso2mesh-users
Hi Sanket, i've tested your data,

It occurs same error in my comsol 4.1

But it's ok to use in comsol 4.2

No error and problem to load.

And you said "comsol 4.1 functions..." it means you use Matlab
LiveLink for Comsol?

On Sep 30, 6:36 am, Sanket Jain <jainsank...@gmail.com> wrote:
> Attached is the data is used with the script.
>
> 2011/9/29 Sanket Jain <jainsank...@gmail.com>
>
>
>
>
>
>
>
> > When I import the output of the script, I get the following error:
>
> > *Exception:*
> > * com.femlab.jni.FlNativeException: Incompatible native file version*
> > *Messages:*
> > * Incompatible native file version*
> > *
> > *
> > *Stack trace:*
> > * at meshimpl.cpp, row 5078, ()*
> > * at com.femlab.jni.FlLoad.doLoad(Native Method)*
> > * at com.femlab.jni.FlLoad.load(Unknown Source)*
> > * at com.femlab.mesh.MeshLoad.load(Unknown Source)*
> > * at com.femlab.mesh.MeshImportRunnable.run(Unknown Source)*
> > * at com.femlab.server.FlRunner.run(Unknown Source)*
> > * at com.femlab.util.i.run(Unknown Source)*
> > * at com.femlab.util.aa.run(Unknown Source)*
>
> > I am in the process of moving away from using mphtxt converter. Instead I
> > am using native Comsol 4.1 functions with other 3.5 matlab functions to read
> > my mesh into Comsol 4.X version. It works for smaller meshes. I have to try
> > for larger meshes but I believe the same methods should work for them as
> > well.
>
> > Sanket
>
> > 2011/9/29 Sanket Jain <jainsank...@gmail.com>
> test.rar
> 1055KViewDownload

Sanket Jain

unread,
Sep 30, 2011, 1:35:07 AM9/30/11
to iso2mes...@googlegroups.com
Yes. I mean Matlab LiveLink. I would love to use this function instead of LiveLink. Do you know what could be problem in 4.1?

Sanket

Daniel_Kim

unread,
Sep 30, 2011, 2:09:31 AM9/30/11
to iso2mesh-users
This code is based on .mphtxt structure.

And maybe comsol 4.1 don't have a compatibility to other
version's .mphtxt format

below site, show how comsol .mphtxt is formatted

http://www.comsol.com/community/forums/general/thread/3479/

So, if you want to load .mphtxt file to comsol 4.1, make a mesh and
extract .mphtxt from comsol 4.1

and check what is different, i know it's annoying.

But comsol doesn't provide the exact format information of .mphtxt, so
we should check it manually.

That's why my code is uncomplete.

Donghyeon
Message has been deleted
Message has been deleted

Sanket Jain

unread,
Oct 1, 2011, 12:15:06 PM10/1/11
to iso2mes...@googlegroups.com, Qianqian Fang

I tried looking at the mphtxt from 4.1 and compared with your format in script as well the O/P file from your script. But unfortunately, I can't find anything wrong/missing. I don't have access to 4.2 version. 

@ Dr. Fang: I have Matlab function which reads node, face and elem matrices and writes mphbin/mphtxt file. Note, this function requires Matlab 
LiveLink with Comsol. LiveLink is an addon with Comsol Software. Feel free to modify the code

Sanket

2011/9/30 Daniel_Kim <comb...@gmail.com>
mesh2comsol.m
Reply all
Reply to author
Forward
0 new messages