Personal tools
You are here: Home Forum Use med file / MED library : names of entities

med file / MED library : names of entities

Up to Use

med file / MED library : names of entities

Posted by Philippe Leveque at October 17. 2012

Hello, 

I'd like to read/write meshes in Med file format using MEDMEM or MEDCoupling libraries provided by Salome :

med file -> MED mesh data structure -> med file

without losing the information on the names of the mesh entities (indeed, in Med File format, one can store both the number and the name of each entity).

Is there a way to do that ? (the GMESH and MEDCouplingMesh classes don't seem to provide such a feature)

PhL 

 

Re: med file / MED library : names of entities

Posted by Anthony GEAY at October 17. 2012

Hi,

 

Yes indeed in MEDCoupling/MEDLoader actually there is no way to manipulate names on entity. But numbers on entity are managed by MEDLoader.

Maybe it is possible for you, to store the information of names using families and groups concept.

Furthermore, concerning your question about MEDMEM_Swig on windows (Sorry I've completely forgotten)

The environement is not set properly in windows package. You need

in PYTHONPATH=%MED_ROOT_DIR%/bin/salome ; %MED_ROOT_DIR%/lib/python2.6/site-packages/salome

in  PATH = %MED_ROOT_DIR%/lib/salome

For your information, I encourage you to use MEDCoupling/MEDLoader instead of MEDMEM because MEDMEM is planned to be removed for Salome7.

Best regards,

Anthony

 

Re: med file / MED library : names of entities

Posted by Philippe Leveque at October 18. 2012

Thank you Anthony for the warning about MEDMEM : I need to switch from MEDMEM to MED Coupling/Loader.

But one thing remains not so clear for me : when the user of Salome/SMESH builds a mesh, he can see the numbers of his mesh entities (nodes, cells) on the screen ; but when Salome exports the mesh as a med file, are these numbers stored in the med file ? And if so, can I retrieve these numbers with MED Loader and store them in some MED Coupling data structure ?

At last, just a naive question : the only way to read/write med files from Python is MEDMEM/MED Loader ? (I mean med file team doesn't provide a Python API ?)

Thanks,

PhL

 

Previously Anthony GEAY wrote:

Hi,

 

Yes indeed in MEDCoupling/MEDLoader actually there is no way to manipulate names on entity. But numbers on entity are managed by MEDLoader.

Maybe it is possible for you, to store the information of names using families and groups concept.

Furthermore, concerning your question about MEDMEM_Swig on windows (Sorry I've completely forgotten)

The environement is not set properly in windows package. You need

in PYTHONPATH=%MED_ROOT_DIR%/bin/salome ; %MED_ROOT_DIR%/lib/python2.6/site-packages/salome

in  PATH = %MED_ROOT_DIR%/lib/salome

For your information, I encourage you to use MEDCoupling/MEDLoader instead of MEDMEM because MEDMEM is planned to be removed for Salome7.

Best regards,

Anthony

 

 

Re: med file / MED library : names of entities

Posted by Anthony GEAY at October 26. 2012

Hi Philippe,

Sorry for the delay again. Yes the numbers are in the exported med file of SMESH.

Yes it is possible to handle it under MEDLoader.

########

from MEDLoader import *

m=MEDFileMesh.New("myFileComingFromSMESH.med")

ids0=m.getNumberFieldAtLevel(0) # ids of cells at max level 3D typically

idsM1=m.getNumberFieldAtLevel(-1) # ids of cells at max level-1 2D typically

# ...

To finish the answer to your last question, no there is no lower python API available than those in MEDLoader/MEDMEM.

But the advanced API of MEDLoader allows you to cover a large range of MED file API normally.

Regards,

Re: med file / MED library : names of entities

Posted by Philippe Leveque at October 26. 2012

Thanks Anthony. That's quite clear now.

PhL

 

Previously Anthony GEAY wrote:

Hi Philippe,

Sorry for the delay again. Yes the numbers are in the exported med file of SMESH.

Yes it is possible to handle it under MEDLoader.

########

from MEDLoader import *

m=MEDFileMesh.New("myFileComingFromSMESH.med")

ids0=m.getNumberFieldAtLevel(0) # ids of cells at max level 3D typically

idsM1=m.getNumberFieldAtLevel(-1) # ids of cells at max level-1 2D typically

# ...

To finish the answer to your last question, no there is no lower python API available than those in MEDLoader/MEDMEM.

But the advanced API of MEDLoader allows you to cover a large range of MED file API normally.

Regards,

 

Re: med file / MED library : names of entities

Posted by Shan at August 07. 2013

Hello!..

 

I have to write an FORTRAN interface that can read the .med file and use the data and write the .med file. I tried t unederstand what is MED and its details from MED 3.) Documentations form http://www.code-aster.org/outils/med/html/index.html .

If my understanding is correct then, using MED libraries i can do the following talks above. I am developing  Fortran in Visual Studio 2008.

 I have following questions:

1. Where can i find the plugin for MED. if not how to integrate MED with my Fortran codes , such that i can make use of the MED libraries?

i would be glad if told step by step.

 

Regards,

shan

Re: med file / MED library : names of entities

Posted by Saint Michael at August 08. 2013

how to integrate MED with my Fortran codes

Hello Shan

MED has a Fortran API, so you can use it as any other Fortran library.

St.Michael

Re: med file / MED library : names of entities

Posted by Shan at August 19. 2013

Hi St.Michael!i am trying to build med3.06 with make command in cygwin. ./configure is successful. i couldnt understand y it fails in make. can u please help?.. 

Making all in include

make[1]: Entering directory `/cygdrive/c/Users/Harikris/Desktop/MEMS_Narayana/MasterThesis/med-3.0.6_SRC/include'

make  all-recursive

make[2]: Entering directory `/cygdrive/c/Users/Harikris/Desktop/MEMS_Narayana/MasterThesis/med-3.0.6_SRC/include'

Making all in 2.3.6

make[3]: Entering directory `/cygdrive/c/Users/Harikris/Desktop/MEMS_Narayana/MasterThesis/med-3.0.6_SRC/include/2.3.6'

/usr/bin/cp -f ./../med_config.h  med_config.h

make  all-am

make[4]: Entering directory `/cygdrive/c/Users/Harikris/Desktop/MEMS_Narayana/MasterThesis/med-3.0.6_SRC/include/2.3.6'

make[4]: Nothing to be done for `all-am'.

make[4]: Leaving directory `/cygdrive/c/Users/Harikris/Desktop/MEMS_Narayana/MasterThesis/med-3.0.6_SRC/include/2.3.6'

make[3]: Leaving directory `/cygdrive/c/Users/Harikris/Desktop/MEMS_Narayana/MasterThesis/med-3.0.6_SRC/include/2.3.6'

Making all in .

make[3]: Entering directory `/cygdrive/c/Users/Harikris/Desktop/MEMS_Narayana/MasterThesis/med-3.0.6_SRC/include'

make[3]: Leaving directory `/cygdrive/c/Users/Harikris/Desktop/MEMS_Narayana/MasterThesis/med-3.0.6_SRC/include'

make[2]: Leaving directory `/cygdrive/c/Users/Harikris/Desktop/MEMS_Narayana/MasterThesis/med-3.0.6_SRC/include'

make[1]: Leaving directory `/cygdrive/c/Users/Harikris/Desktop/MEMS_Narayana/MasterThesis/med-3.0.6_SRC/include'

Making all in src

make[1]: Entering directory `/cygdrive/c/Users/Harikris/Desktop/MEMS_Narayana/MasterThesis/med-3.0.6_SRC/src'

Making all in 2.3.6

make[2]: Entering directory `/cygdrive/c/Users/Harikris/Desktop/MEMS_Narayana/MasterThesis/med-3.0.6_SRC/src/2.3.6'

.deps/MEDaffiche.Plo:1: *** multiple target patterns.  Stop.

make[2]: Leaving directory `/cygdrive/c/Users/Harikris/Desktop/MEMS_Narayana/MasterThesis/med-3.0.6_SRC/src/2.3.6'

Makefile:552: recipe for target `all-recursive' failed

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/cygdrive/c/Users/Harikris/Desktop/MEMS_Narayana/MasterThesis/med-3.0.6_SRC/src'

Makefile:373: recipe for target `all-recursive' failed

make: *** [all-recursive] Error 1

 
Attachments

Re: med file / MED library : names of entities

Posted by Vadim SANDLER at August 19. 2013

Hello Shan,

Med library seems to not support compilation with cygwin (as SALOME platform).

The problems you have are likely caused by incorrect file paths in the Makefiles - ":" appears in the filenames while it should not, otherwise GNU make thinks it is a separator of targets.

I would recommend you to build Med library on Windows using CMake - version 3.0.6 includes CMake-based build procedure. However, as cygwin is not used by this build procedure, you'll need external Fortran compiler to be properly installed (for instance, Intel Visual Fortran Compiler); otherwsise Fortan libraries won't be built.

Regards,
Vadim.

Re: med file / MED library : names of entities

Posted by Shan at August 19. 2013

Hi Vadim.

Thanks for the reply.

1. Intel visual fortran compiler is installed with proper license is installed my system. so is it that even after successful configuration, "Make" and "make install" will not properly work for med3.0.6 in cygwin?.. 

2. My other concern s i try to build the same with CMAKE Gui .I select Visual Studio 09 2008 type. The configured is done but while configuring log shows that many files not found even thought it s found, I doubt how can it complete the configuration with important files not found or i would like to know if it s fine to ignore these messages and proceed.The log s not that complicated and its straight forward. I also get the same output with using cmake command in windows cmd prompt.

Any help help would really be appreciated !

 

The CXX compiler identification is MSVC 15.0.30729.1

The C compiler identification is MSVC 15.0.30729.1

Check for working CXX compiler using: Visual Studio 9 2008

Check for working CXX compiler using: Visual Studio 9 2008 -- works

Detecting CXX compiler ABI info

Detecting CXX compiler ABI info - done

Check for working C compiler using: Visual Studio 9 2008

Check for working C compiler using: Visual Studio 9 2008 -- works

Detecting C compiler ABI info

Detecting C compiler ABI info - done

Check for working Fortran compiler using: Visual Studio 9 2008

Check for working Fortran compiler using: Visual Studio 9 2008 -- works

Detecting Fortran compiler ABI info

Detecting Fortran compiler ABI info - done

Determine Intel Fortran Compiler Implicit Link Path

Determine Intel Fortran Compiler Implicit Link Path -- done

Checking whether ifort supports Fortran 90

Checking whether ifort supports Fortran 90 -- yes

Check for MPI ...

Check MPI in C:\OpenMPI_v1.6.2-win32

MPI include mpi.h found in C:/OpenMPI_v1.6.2-win32/include

MPI libs:

Looking for MPI_Publish_name

Looking for MPI_Publish_name - not found

Check for hdf5 ...

Narayana narayana narayana narayana narayana HDF5_ROOT. ROOOTT

Narayana narayana narayana narayana narayana HDF5HOME. ROOOTT C:/HDF5/1.8.10

H5public.h found in C:/HDF5/1.8.10/include

INSIDEEEEEEEEEEE. C:/HDF5/1.8.10/bin C:/HDF5/1.8.10/lib

INSIDEEEEEEEEEEE 2222222222222222222. HDF5_LIB C:/HDF5/1.8.10/lib/hdf5dll.lib

INSIDEEEEEEEEEEE HDF5_LIBS

hdf5 lib found: C:/HDF5/1.8.10/lib/hdf5dll.lib

Detecting Fortran/C Interface

Detecting Fortran/C Interface - Found GLOBAL and MODULE mangling

Looking for H5public.h

Looking for H5public.h - not found

Looking for dlfcn.h

Looking for dlfcn.h - not found

Looking for inttypes.h

Looking for inttypes.h - not found

Looking for malloc.h

Looking for malloc.h - found

Looking for memory.h

Looking for memory.h - found

Looking for pwd.h

Looking for pwd.h - not found

Looking for stdbool.h

Looking for stdbool.h - not found

Looking for stdint.h

Looking for stdint.h - not found

Looking for stdlib.h

Looking for stdlib.h - found

Looking for strings.h

Looking for strings.h - not found

Looking for string.h

Looking for string.h - found

Looking for sys/stat.h

Looking for sys/stat.h - found

Looking for sys/timeb.h

Looking for sys/timeb.h - found

Looking for sys/time.h

Looking for sys/time.h - not found

Looking for sys/types.h

Looking for sys/types.h - found

Looking for unistd.h

Looking for unistd.h - not found

Looking for stdio.h

Looking for stdio.h - found

Looking for cuserid

Looking for cuserid - not found

Looking for ftime

Looking for ftime - found

Looking for geteuid

Looking for geteuid - not found

Looking for getpwuid

Looking for getpwuid - not found

Looking for gettimeofday

Looking for gettimeofday - not found

Looking for stddef.h

Looking for stddef.h - found

Check size of int

Check size of int - done

Check size of long

Check size of long - done

Testing default INTEGER*4 - found

 

Configuring done

 

Re: med file / MED library : names of entities

Posted by Shan at August 19. 2013

Sorry the crazzy line in between comes coz i have added them to alanye the call flow!..  couldnt edit my comment

Re: med file / MED library : names of entities

Posted by Shan at August 22. 2013

Can someone please help the above problem?..

Powered by Ploneboard
Document Actions