[Gmsh] Could not read MED families

Luca Dall'Olio luca.dallolio at alneos.fr
Mon May 21 17:21:35 CEST 2012


Hi Christophe,

Thank you for your prompt answer!
I just downloaded the Automated Nightly Build Linux from the site (
http://www.geuz.org/gmsh/bin/Linux/gmsh-nightly-Linux.tgz)  and I still
reproduce the problem,

attached you can find a screen capture showing the gmsh nightly build
version and the error message in the console when opening the med file,

Thank you,

Luca

2012/5/21 Christophe Geuzaine <cgeuzaine at ulg.ac.be>

>
> Hi Luca - Can you try again with the latest SVN?
> Thanks,
> Christophe
>
> On 21 May 2012, at 16:31, Luca Dall'Olio wrote:
>
> > Dear Gmsh Team.
> >
> > Here is as an attached file a small med 3.0.4 file that cannot be opened
> in Gmsh 2.5.1-svn. FYI, it can be opened in Salome.
> > The file was created from an initial med file that Gmsh can read by
> applying some algebraic operations on the fields it contains using
> MEDLoader (a package in charge of loading from a file or write to a file in
> MED format a med data structure).
> >
> >
> >
> > dimrestriction =0
> > mesh=MEDLoader.ReadUMeshFromFile(medfilename,meshname,dimrestriction)
> > p1 =
> MEDLoader.ReadField(ON_NODES,medfilename,meshname,dimrestriction,fieldname,iteration1,order1)
> >
> >
> > p2 =
> MEDLoader.ReadField(ON_NODES,medfilename,meshname,dimrestriction,fieldname,iteration2,order2)
> > p1.setMesh(mesh)
> > p2.setMesh(mesh)
> > result=p2-p1
> > result.setName(fieldnameresu)
> >
> >
> > MEDLoader.WriteField(outfile,result,True)
> >
> > The error raised by Gmsh is "Could not read MED families", that can be
> found twice in Gmsh's sources :
> >
> >
> >
> > Geo/GModelIO_MED.cpp:359:      Msg::Error("Could not read MED families");
> > Geo/GModelIO_MED.cpp:387:    Msg::Error("Could not read MED families");
> >
> >
> >
> > #if (MED_MAJOR_NUM == 3)
> >     if(MEDmeshEntityFamilyNumberRd(fid, meshName, MED_NO_DT, MED_NO_IT,
> MED_CELL,
> >                                    type, &fam[0]) < 0){
> > #else
> >
> >
> >     if(MEDfamLire(fid, meshName, &fam[0], numEle, MED_MAILLE, type) < 0){
> > #endif
> >       Msg::Error("Could not read MED families");
> >       return 0;
> >     }
> >
> >
> >
> > And then :
> >
> >   // read family info
> >   med_int numFamilies = MEDnFam(fid, meshName);
> >   if(numFamilies < 0){
> >     Msg::Error("Could not read MED families");
> >
> >
> >     return 0;
> >   }
> >
> > Thank you very much in advance for any help/advice,
> >
> > Best Regards,
> >
> > Luca
> >
> > <out.med>_______________________________________________
> > gmsh mailing list
> > gmsh at geuz.org
> > http://www.geuz.org/mailman/listinfo/gmsh
>
> --
> Prof. Christophe Geuzaine
> University of Liege, Electrical Engineering and Computer Science
> http://www.montefiore.ulg.ac.be/~geuzaine
>
>
>
>


-- 

ALNEOS

Luca DALL'OLIO, Project Manager

196, rue Houdan      92330 SCEAUX - France
Tél.  : +33 (0)1 83 64 39 53
GSM   : +33 (0) 6 01 76 50 97
Fax.  : +33 (0)1 41 13 85 07
Email : luca.dallolio at alneos.fr
URL : www.alneos.fr

"This e-mail is confidential and may contain legally privileged information.

If you are not the intended recipient, you should not copy,
distribute, disclose or use the information it contains.
Please e-mail the sender immediately and delete this message from your system.
E-mails are susceptible to corruption, interception and unauthorised
amendment; we do not accept liability for any such changes, or for
their consequences.

You should be aware, that the company  may monitor your emails and
their content."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20120521/051346f8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture.png
Type: image/png
Size: 533347 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20120521/051346f8/attachment.png>