@COMMENCE@
-SUBDIRS = idl src doc
+ifeq (@WITHIHM@,no)
+ SUBDIRS = idl src
+endif
+ifeq (@WITHIHM@,yes)
+ SUBDIRS = idl src doc
+endif
RESOURCES_FILES = \
MEDCatalog.xml \
pointe.med \
test19.med \
zzzz121b.med \
+Mistrat.med \
+TimeStamps.med \
Darcy3_3D_H_10x10x10.sauve \
dx200_dy1_avec_2couches.sauve \
elle_2D_QT_10x10.sauve \
BIN_SCRIPT= \
VERSION
+LDFLAGS= -L$(top_builddir)/lib/salome
+LDFLAGSFORBIN= -L$(top_builddir)/lib/salome
# copy header files in common directory
ifeq ($(HAVE_SSTREAM),yes)
install-include: $(include_list)
$(INSTALL) -d $(includedir)
- @for f in X $(include_list); do \
- if test $$f != X; then \
- ($(INSTALL_DATA) -p $$f $(includedir)/. || exit 1); \
- fi; \
+# @for f in X $(include_list); do \
+# if test $$f != X; then \
+# (cp -p $$f $(includedir) || exit 1); \
+# fi; \
done
# install script in $(bindir) :
install-bin: $(BIN_SCRIPT)
$(INSTALL) -d $(bindir)
- if test $(BIN_SCRIPT)X != X; then \
- $(INSTALL_PROGRAM) $^ $(bindir); \
- fi
+ for f in X $(BIN_SCRIPT); do \
+ if test $$f != X; then \
+ (cp -p ./bin/salome/$$f $(bindir) || exit 1); \
+ fi; \
+ done
uninstall: uninstall-idl
inc_builddir=$(top_builddir)/include/salome
@SET_MAKE@
-SHELL=/bin/sh
+SHELL=@SHELL@
# header missing
LIBS=@LIBS@
LIBSFORBIN=@LIBS@
-LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib/salome -Xlinker -rpath-link -Xlinker -L$(top_builddir)/lib/salome
-LDFLAGSFORBIN=@LDFLAGS@ -L$(top_builddir)/lib/salome -Xlinker -rpath-link -Xlinker -L$(top_builddir)/lib/salome
+LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib/salome
+LDFLAGSFORBIN=@LDFLAGS@ -L$(top_builddir)/lib/salome
# add libstdc++ to link c++ library with libtool !
-LDFLAGS+= -lstdc++
-LDFLAGSFORBIN+= -lstdc++
+LDFLAGS+= @STDLIB@
+LDFLAGSFORBIN+= @STDLIB@
CP=@CP@
ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<).0 \
$(patsubst %.la, %.so, $@).0 || true
- if ! test -z $(LIB_SWIG) ; then \
+ if test "X$(LIB_SWIG)" != X; then \
ln -sf $(patsubst %.la,%.so, $(CURDIR)/.libs/$<) $(top_builddir)/lib/salome/_$(LIB_SWIG) || true;\
fi;
($(LT_INSTALL_LIB) $$f $(libdir)/. || exit 1); \
fi; \
done
- @if ! test -z $(LIB_SWIG) ; then \
+ @if test "X$(LIB_SWIG)" != X ; then \
(cd $(libdir); ln -sf $(patsubst %.so, %cmodule.so, $(LIB_SWIG)) _$(LIB_SWIG) || true); \
fi;
@for f in X $(BIN); do \
find_in()
{
- local i
- local f=$2
+ i=0
+ f=$2
# if the first argument is not a directory, returns
# Common part of the configure.in file
#
chmod u+w configure.in.base
-if ! \cp -f configure.in.base configure.in_tmp1
+if \cp -f configure.in.base configure.in_tmp1
then
echo
+else
+ echo
echo "error : can't create files in" ${CONF_DIR}
echo "aborting ..."
chmod u-w configure.in.base
fi
else
echo -n "Updating 'configure.in' file ... "
- if ! \cp configure.in configure.in_old >& /dev/null
+ if \cp configure.in configure.in_old >& /dev/null
then
echo
+ else
+ echo
echo
echo "Can't backup previous configure.in"
echo -n "Continue (you will not be able to revert) - (Y/N) ? "
echo
echo
+dnl Modification B. Secher portage sur osf CCRT
+AC_CHECK_PROG(SHELL,sh,,)
+AC_SUBST(SHELL)
+
if test -z "$AR"; then
AC_CHECK_PROGS(AR,ar xar,:,$PATH)
fi
dnl full-path to the binary instead.
case "$INSTALL" in
*install-sh*)
- INSTALL='\${KERNEL_ROOT_DIR}'/salome_adm/unix/config_files/install-sh
+ INSTALL="\${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/install-sh -c"
;;
esac
dnl inutil car libtool
dnl AC_PROG_CC
AC_PROG_CXX
+AC_CXX_WARNINGS
+AC_CXX_TEMPLATE_OPTIONS
AC_DEPEND_FLAG
# AC_CC_WARNINGS([ansi])
cc_ok=yes
dnl add library libm :
AC_CHECK_LIB(m,ceil)
+dnl Library librt : for alpha/osf
+AC_CHECK_LIB(rt,nanosleep)
+
+dnl
+dnl Check if we use std iostream by default or if we must add
+dnl a compiler directive for that
+dnl
+
+AC_CXX_USE_STD_IOSTREAM
+
dnl
dnl Well we use sstream which is not in gcc pre-2.95.3
dnl We must test if it exists. If not, add it in include !
AC_CXX_HAVE_SSTREAM
+dnl
+dnl ---------------------------------------------
+dnl testing linker
+dnl ---------------------------------------------
+dnl
+
+AC_LINKER_OPTIONS
+
dnl
dnl ---------------------------------------------
dnl testing MPICH
dnl ---------------------------------------------
dnl
+CHECK_MPI
CHECK_MPICH
+dnl
+dnl ---------------------------------------------
+dnl testing WITHIHM
+dnl ---------------------------------------------
+dnl
+
+CHECK_WITHIHM
+
echo
echo ---------------------------------------------
echo testing LEX \& YACC
# if test ! -d $rep ; then
# eval mkdir $rep
# fi
- $INSTALL -d $rep
+# $INSTALL -d $rep
+ mkdir -p $rep
done
echo
case "$local_bin" in
*.in | *~) ;;
./bin/CVS | ./bin/salome) ;;
- *) /usr/bin/install -C $i .; echo $local_bin ;;
+ *) ln -fs $i .; echo $local_bin ;;
esac
done
cd $ROOT_BUILDDIR
if ( ! _fromMesh ) throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"fromMesh is a NULL pointer !")) ;
_fromWrapper = new Meta_Wrapper<DIMENSION>(_fromMesh->getNumberOfNodes(),
- const_cast<double *> (_fromMesh->getCoordinates(MED_FULL_INTERLACE)),
- const_cast<CONNECTIVITY *> (_fromMesh->getConnectivityptr()),
- const_cast<FIELD<double> *>(_fromField)
+ const_cast<double *> (_fromMesh->getCoordinates(MED_EN::MED_FULL_INTERLACE)),
+ const_cast<MEDMEM::CONNECTIVITY *> (_fromMesh->getConnectivityptr()),
+ const_cast<MEDMEM::FIELD<double> *>(_fromField)
);
_toWrapper = new Meta_Wrapper<DIMENSION>(_toMesh->getNumberOfNodes(),
- const_cast<double *> (_toMesh->getCoordinates(MED_FULL_INTERLACE))
+ const_cast<double *> (_toMesh->getCoordinates(MED_EN::MED_FULL_INTERLACE))
);
_toField->setOrderNumber ( _fromField->getOrderNumber() );
_toField->setValueType ( MED_EN::MED_REEL64 );
- SUPPORT * mySupport(new SUPPORT(_toMesh,"support",MED_NODE));
+ SUPPORT * mySupport(new SUPPORT(_toMesh,"support",MED_EN::MED_NODE));
_toField->setSupport(mySupport);
_toField->allocValue(_toField->getNumberOfComponents(),_toField->getNumberOfValues());
- _toField->setValue(MED_FULL_INTERLACE,resultat.Get_Valeurs());
+ _toField->setValue( MED_EN::MED_FULL_INTERLACE,resultat.Get_Valeurs());
_toWrapper->Construit_Wrapper_Champ(_toField);
_fromMesh = _fromField->getSupport()->getMesh();
_fromWrapper = new Meta_Wrapper<DIMENSION>(_fromMesh->getNumberOfNodes(),
- const_cast<double *> (_fromMesh->getCoordinates(MED_FULL_INTERLACE)),
- const_cast<CONNECTIVITY *> (_fromMesh->getConnectivityptr()),
- const_cast<FIELD<double> *>(_fromField)
+ const_cast<double *> (_fromMesh->getCoordinates(MED_EN::MED_FULL_INTERLACE)),
+ const_cast<MEDMEM::CONNECTIVITY *> (_fromMesh->getConnectivityptr()),
+ const_cast<MEDMEM::FIELD<double> *>(_fromField)
);
_mapping = new Meta_Mapping<DIMENSION> (_fromWrapper);
flagNewMapping=0;
- _fromField = const_cast<FIELD<double> *>(&nextFromField);
- _fromWrapper->Change_Champ(const_cast<FIELD<double> *>(_fromField));
+ _fromField = const_cast<MEDMEM::FIELD<double> *>(&nextFromField);
+ _fromWrapper->Change_Champ(const_cast<MEDMEM::FIELD<double> *>(_fromField));
}
return interpolate(_iType,_isConvexFromMesh);
protected :
Wrapper_Med_Connectivity * connectivite_med;
public :
- Meta_Nuage_Maille(CONNECTIVITY * connmed);
+ Meta_Nuage_Maille(MEDMEM::CONNECTIVITY * connmed);
Meta_Nuage_Maille():connectivite_med(NULL) {}
~Meta_Nuage_Maille() {if (connectivite_med) delete connectivite_med;}
};
Meta_Wrapper():noeuds(NULL),mailles(NULL),maillage(NULL),champ(NULL){}
~Meta_Wrapper();
inline void Construit_Wrapper_Nuage_Noeud ( int nn, double * nodes );
- inline void Construit_Wrapper_Nuage_Maille ( CONNECTIVITY * connmed );
+ inline void Construit_Wrapper_Nuage_Maille ( MEDMEM::CONNECTIVITY * connmed );
inline void Construit_Wrapper_Maillage ( void );
- inline void Construit_Wrapper_Champ ( const FIELD<double> * medfield );
- Meta_Wrapper(int nn,double *nodes,CONNECTIVITY *connmed, int flag_maillage=1);
+ inline void Construit_Wrapper_Champ ( const MEDMEM::FIELD<double> * medfield );
+ Meta_Wrapper(int nn,double *nodes,MEDMEM::CONNECTIVITY *connmed, int flag_maillage=1);
Meta_Wrapper(int nn,double *nodes);
// defaultly, the connectivity (neighbouhood and so like) is built,
// Set flag_mesh to 0 if you don't want these informations to be built
- Meta_Wrapper(int nn,double *nodes,CONNECTIVITY *connmed, const FIELD<double> * c,int flag_mesh=1);
+ Meta_Wrapper(int nn,double *nodes,MEDMEM::CONNECTIVITY *connmed, const MEDMEM::FIELD<double> * c,int flag_mesh=1);
// fonctions d'acces sures
inline Wrapper_Nuage_Noeud<DIMENSION> * Get_Nuage_Noeuds ( void );
inline Meta_Nuage_Maille * Get_Nuage_Mailles ( void );
inline Meta_Maillage * Get_Maillage ( void );
inline Wrapper_MED_Field * Get_Champ ( void );
- inline void Change_Champ ( const FIELD<double> * medfield );
+ inline void Change_Champ ( const MEDMEM::FIELD<double> * medfield );
};
/*********************************************************/
mailles=nm;
- fonctions[MED_TRIA3 ]=new Calcul_Interpolation_Tria3 <Wrapper_MED_Field,Valeur<double>,Wrapper_Nuage_Noeud<DIMENSION>,Wrapper_Noeud<DIMENSION>,Meta_Nuage_Maille>(nn,nm,c);
- fonctions[MED_QUAD4 ]=new Calcul_Interpolation_Quad4 <Wrapper_MED_Field,Valeur<double>,Wrapper_Nuage_Noeud<DIMENSION>,Wrapper_Noeud<DIMENSION>,Meta_Nuage_Maille>(nn,nm,c);
- fonctions[MED_TETRA4 ]=new Calcul_Interpolation_Tetra4 <Wrapper_MED_Field,Valeur<double>,Wrapper_Nuage_Noeud<DIMENSION>,Wrapper_Noeud<DIMENSION>,Meta_Nuage_Maille>(nn,nm,c);
- fonctions[MED_HEXA8 ]=new Calcul_Interpolation_Hexa8 <Wrapper_MED_Field,Valeur<double>,Wrapper_Nuage_Noeud<DIMENSION>,Wrapper_Noeud<DIMENSION>,Meta_Nuage_Maille>(nn,nm,c);
- fonctions[MED_PENTA6 ]=new Calcul_Interpolation_Penta6 <Wrapper_MED_Field,Valeur<double>,Wrapper_Nuage_Noeud<DIMENSION>,Wrapper_Noeud<DIMENSION>,Meta_Nuage_Maille>(nn,nm,c);
- fonctions[MED_PYRA5 ]=new Calcul_Interpolation_Pyra5 <Wrapper_MED_Field,Valeur<double>,Wrapper_Nuage_Noeud<DIMENSION>,Wrapper_Noeud<DIMENSION>,Meta_Nuage_Maille>(nn,nm,c);
- fonctions[MED_TRIA6 ]=fonctions[MED_TRIA3 ];
- fonctions[MED_QUAD8 ]=fonctions[MED_QUAD4 ];
- fonctions[MED_TETRA10]=fonctions[MED_TETRA4 ];
- fonctions[MED_HEXA20 ]=fonctions[MED_HEXA8 ];
- fonctions[MED_PENTA15]=fonctions[MED_PENTA6 ];
- fonctions[MED_PYRA13 ]=fonctions[MED_PYRA5 ];
+ fonctions[ MED_EN::MED_TRIA3 ]=new Calcul_Interpolation_Tria3 <Wrapper_MED_Field,Valeur<double>,Wrapper_Nuage_Noeud<DIMENSION>,Wrapper_Noeud<DIMENSION>,Meta_Nuage_Maille>(nn,nm,c);
+ fonctions[ MED_EN::MED_QUAD4 ]=new Calcul_Interpolation_Quad4 <Wrapper_MED_Field,Valeur<double>,Wrapper_Nuage_Noeud<DIMENSION>,Wrapper_Noeud<DIMENSION>,Meta_Nuage_Maille>(nn,nm,c);
+ fonctions[ MED_EN::MED_TETRA4 ]=new Calcul_Interpolation_Tetra4 <Wrapper_MED_Field,Valeur<double>,Wrapper_Nuage_Noeud<DIMENSION>,Wrapper_Noeud<DIMENSION>,Meta_Nuage_Maille>(nn,nm,c);
+ fonctions[ MED_EN::MED_HEXA8 ]=new Calcul_Interpolation_Hexa8 <Wrapper_MED_Field,Valeur<double>,Wrapper_Nuage_Noeud<DIMENSION>,Wrapper_Noeud<DIMENSION>,Meta_Nuage_Maille>(nn,nm,c);
+ fonctions[ MED_EN::MED_PENTA6 ]=new Calcul_Interpolation_Penta6 <Wrapper_MED_Field,Valeur<double>,Wrapper_Nuage_Noeud<DIMENSION>,Wrapper_Noeud<DIMENSION>,Meta_Nuage_Maille>(nn,nm,c);
+ fonctions[ MED_EN::MED_PYRA5 ]=new Calcul_Interpolation_Pyra5 <Wrapper_MED_Field,Valeur<double>,Wrapper_Nuage_Noeud<DIMENSION>,Wrapper_Noeud<DIMENSION>,Meta_Nuage_Maille>(nn,nm,c);
+ fonctions[ MED_EN::MED_TRIA6 ]=fonctions[ MED_EN::MED_TRIA3 ];
+ fonctions[ MED_EN::MED_QUAD8 ]=fonctions[ MED_EN::MED_QUAD4 ];
+ fonctions[ MED_EN::MED_TETRA10]=fonctions[ MED_EN::MED_TETRA4 ];
+ fonctions[ MED_EN::MED_HEXA20 ]=fonctions[ MED_EN::MED_HEXA8 ];
+ fonctions[ MED_EN::MED_PENTA15]=fonctions[ MED_EN::MED_PENTA6 ];
+ fonctions[ MED_EN::MED_PYRA13 ]=fonctions[ MED_EN::MED_PYRA5 ];
}
Valeur<double> operator() (Wrapper_Noeud<DIMENSION> & node, int num_maille){return Calcul_Hybride<Wrapper_MED_Field,Valeur<double>,Wrapper_Nuage_Noeud<DIMENSION>,Wrapper_Noeud<DIMENSION>,Meta_Nuage_Maille>::operator()(node,num_maille);}
Valeur<double> operator() (double * node, int num_maille)
/* */
/*********************************************************/
-inline Meta_Nuage_Maille::Meta_Nuage_Maille(CONNECTIVITY * conmed):Wrapper_Nuage_Maille<Wrapper_Med_Connectivity>(connectivite_med=new Wrapper_Med_Connectivity(conmed))
+inline Meta_Nuage_Maille::Meta_Nuage_Maille(MEDMEM::CONNECTIVITY * conmed):Wrapper_Nuage_Maille<Wrapper_Med_Connectivity>(connectivite_med=new Wrapper_Med_Connectivity(conmed))
{
}
exit(-1);
}
}
-template <int DIMENSION> inline void Meta_Wrapper<DIMENSION>::Construit_Wrapper_Nuage_Maille ( CONNECTIVITY * connmed )
+template <int DIMENSION> inline void Meta_Wrapper<DIMENSION>::Construit_Wrapper_Nuage_Maille ( MEDMEM::CONNECTIVITY * connmed )
{
if (connmed) mailles=new Meta_Nuage_Maille(connmed);
else
}
maillage=new Meta_Maillage(mailles,noeuds->SIZE());
}
-template <int DIMENSION> inline void Meta_Wrapper<DIMENSION>::Construit_Wrapper_Champ ( const FIELD<double> * medfield )
+template <int DIMENSION> inline void Meta_Wrapper<DIMENSION>::Construit_Wrapper_Champ ( const MEDMEM::FIELD<double> * medfield )
{
if (medfield) champ=new Wrapper_MED_Field(medfield);
else
exit(-1);
}
}
-template <int DIMENSION> inline void Meta_Wrapper<DIMENSION>::Change_Champ ( const FIELD<double> * medfield )
+template <int DIMENSION> inline void Meta_Wrapper<DIMENSION>::Change_Champ ( const MEDMEM::FIELD<double> * medfield )
{
if (medfield)
{
exit(-1);
}
}
-template <int DIMENSION> Meta_Wrapper<DIMENSION>::Meta_Wrapper(int nn,double *nodes,CONNECTIVITY *connmed, int flag_maillage)
+template <int DIMENSION> Meta_Wrapper<DIMENSION>::Meta_Wrapper(int nn,double *nodes,MEDMEM::CONNECTIVITY *connmed, int flag_maillage)
{
init();
Construit_Wrapper_Nuage_Noeud(nn,nodes);
Construit_Wrapper_Nuage_Maille(connmed);
if (flag_maillage) Construit_Wrapper_Maillage();
}
-template <int DIMENSION> Meta_Wrapper<DIMENSION>::Meta_Wrapper(int nn,double *nodes,CONNECTIVITY *connmed, const FIELD<double> * c,int flag_maillage)
+template <int DIMENSION> Meta_Wrapper<DIMENSION>::Meta_Wrapper(int nn,double *nodes,MEDMEM::CONNECTIVITY *connmed, const MEDMEM::FIELD<double> * c,int flag_maillage)
{
init();
Construit_Wrapper_Nuage_Noeud(nn,nodes);
_TEMPLATE_ Calcul_Hybride<_PARAM_>::Calcul_Hybride(NUAGENOEUD * nn,NUAGEMAILLE * nm,CHAMP * c):mailles(nm)
{
- fonctions[MED_TRIA3 ]=new Calcul_Interpolation_Tria3 <_PARAM_>(nn,nm,c);
- fonctions[MED_TRIA6 ]=new Calcul_Interpolation_Tria6 <_PARAM_>(nn,nm,c);
- fonctions[MED_QUAD4 ]=new Calcul_Interpolation_Quad4 <_PARAM_>(nn,nm,c);
- fonctions[MED_QUAD8 ]=new Calcul_Interpolation_Quad8 <_PARAM_>(nn,nm,c);
- fonctions[MED_TETRA4 ]=new Calcul_Interpolation_Tetra4 <_PARAM_>(nn,nm,c);
- fonctions[MED_TETRA10]=new Calcul_Interpolation_Tetra10<_PARAM_>(nn,nm,c);
- fonctions[MED_HEXA8 ]=new Calcul_Interpolation_Hexa8 <_PARAM_>(nn,nm,c);
- fonctions[MED_HEXA20 ]=new Calcul_Interpolation_Hexa20 <_PARAM_>(nn,nm,c);
- fonctions[MED_PENTA6 ]=new Calcul_Interpolation_Penta6 <_PARAM_>(nn,nm,c);
- fonctions[MED_PENTA15]=new Calcul_Interpolation_Penta15<_PARAM_>(nn,nm,c);
- fonctions[MED_PYRA5 ]=new Calcul_Interpolation_Pyra5 <_PARAM_>(nn,nm,c);
- fonctions[MED_PYRA13 ]=new Calcul_Interpolation_Pyra13 <_PARAM_>(nn,nm,c);
+ fonctions[ MED_EN::MED_TRIA3 ]=new Calcul_Interpolation_Tria3 <_PARAM_>(nn,nm,c);
+ fonctions[ MED_EN::MED_TRIA6 ]=new Calcul_Interpolation_Tria6 <_PARAM_>(nn,nm,c);
+ fonctions[ MED_EN::MED_QUAD4 ]=new Calcul_Interpolation_Quad4 <_PARAM_>(nn,nm,c);
+ fonctions[ MED_EN::MED_QUAD8 ]=new Calcul_Interpolation_Quad8 <_PARAM_>(nn,nm,c);
+ fonctions[ MED_EN::MED_TETRA4 ]=new Calcul_Interpolation_Tetra4 <_PARAM_>(nn,nm,c);
+ fonctions[ MED_EN::MED_TETRA10]=new Calcul_Interpolation_Tetra10<_PARAM_>(nn,nm,c);
+ fonctions[ MED_EN::MED_HEXA8 ]=new Calcul_Interpolation_Hexa8 <_PARAM_>(nn,nm,c);
+ fonctions[ MED_EN::MED_HEXA20 ]=new Calcul_Interpolation_Hexa20 <_PARAM_>(nn,nm,c);
+ fonctions[ MED_EN::MED_PENTA6 ]=new Calcul_Interpolation_Penta6 <_PARAM_>(nn,nm,c);
+ fonctions[ MED_EN::MED_PENTA15]=new Calcul_Interpolation_Penta15<_PARAM_>(nn,nm,c);
+ fonctions[ MED_EN::MED_PYRA5 ]=new Calcul_Interpolation_Pyra5 <_PARAM_>(nn,nm,c);
+ fonctions[ MED_EN::MED_PYRA13 ]=new Calcul_Interpolation_Pyra13 <_PARAM_>(nn,nm,c);
}
_TEMPLATE_ VALEURCHAMP Calcul_Hybride<_PARAM_>::operator() (const NOEUD & n, int num_maille)
cout<<" ### Mu1 = "<<mu1<<endl;
cout<<" ### Mu2 = "<<mu2<<endl;
cout<<" ### Mu3 = "<<mu3<<endl;
- //*/
+ */
VALEURCHAMP retour(v0.SIZE()); //
retour=(mu0*v0+mu1*v1+mu2*v2+mu3*v3)/delta;
cout<<" ### Lambda2 = "<<lambda2<<endl;
cout<<" ### Lambda3 = "<<lambda3<<endl;
cout<<" ### Controle = "<<(lambda0+lambda1+lambda2+lambda3)<<endl;
- //*/
+ */
VALEURCHAMP retour(v0.SIZE()); //
{
int i,j;
int nbr_faces=coord_baryc[num_maille].size();
- vector<double> coord_baryc_M(nbr_faces,0);
+ vector<double> coord_baryc_M(nbr_faces);
for (i=0;i<nbr_faces;i++)
- {
+ {//CCRT Porting : constructor of vector<T>(int,const T&) not supported on CCRT
+ coord_baryc_M[i]=0.;
for (j=0;j<3;j++) coord_baryc_M[i]+=coord_baryc[num_maille][i][j]*M[j];
coord_baryc_M[i]+=coord_baryc[num_maille][i][3];
}
/*********************************************************/
#define NBR_MODELES_MAILLES_DEFINIS 15
-static int Equivalence_Local_MED[NBR_MODELES_MAILLES_DEFINIS] = { MED_POINT1 ,
- MED_SEG2 , MED_SEG3,
- MED_TRIA3 , MED_TRIA6 , MED_QUAD4 , MED_QUAD8 ,
- MED_TETRA4 , MED_TETRA10 , MED_HEXA8 , MED_HEXA20 , MED_PYRA5 , MED_PYRA13 , MED_PENTA6 , MED_PENTA15 };
+static int Equivalence_Local_MED[NBR_MODELES_MAILLES_DEFINIS] = { MED_EN::MED_POINT1 ,
+ MED_EN::MED_SEG2 , MED_EN::MED_SEG3,
+ MED_EN::MED_TRIA3 , MED_EN::MED_TRIA6 , MED_EN::MED_QUAD4 , MED_EN::MED_QUAD8 ,
+ MED_EN::MED_TETRA4 , MED_EN::MED_TETRA10 , MED_EN::MED_HEXA8 , MED_EN::MED_HEXA20 , MED_EN::MED_PYRA5 , MED_EN::MED_PYRA13 , MED_EN::MED_PENTA6 , MED_EN::MED_PENTA15 };
/*********************************************************/
/* */
public :
~Wrapper_Med_Connectivity() {if (mailles) delete [] mailles;}
Wrapper_Med_Connectivity():mailles(NULL) {}
- Wrapper_Med_Connectivity(CONNECTIVITY * maillesmed)
+ Wrapper_Med_Connectivity(MEDMEM::CONNECTIVITY * maillesmed)
{
- const med_int * tab_sommets_mailles=maillesmed->getConnectivity(MED_NODAL,MED_CELL,MED_ALL_ELEMENTS);
- const med_int * med_connectivite=maillesmed->getConnectivityIndex(MED_FULL_INTERLACE,MED_CELL);
- const med_int * med_index=maillesmed->getValueIndex(MED_FULL_INTERLACE);
- nbr_mailles=maillesmed->getNumberOf(MED_CELL,MED_ALL_ELEMENTS);
+ const int * tab_sommets_mailles=maillesmed->getConnectivity(MED_EN::MED_NODAL, MED_EN::MED_CELL, MED_EN::MED_ALL_ELEMENTS);
+ const int * med_connectivite=maillesmed->getConnectivityIndex(MED_EN::MED_FULL_INTERLACE,MED_EN::MED_CELL);
+ const int * med_index=maillesmed->getValueIndex(MED_EN::MED_FULL_INTERLACE);
+ nbr_mailles=maillesmed->getNumberOf(MED_EN::MED_CELL,MED_EN::MED_ALL_ELEMENTS);
int size=med_index[nbr_mailles]-med_index[0];
types.resize(nbr_mailles);
premier_pointeur.resize(nbr_mailles);
}
for (i=0;i<nbr_mailles;i++)
{
- types[i]=maillesmed->getElementType(MED_CELL,i+1); // A VERIFIER : le +1
+ types[i]=maillesmed->getElementType(MED_EN::MED_CELL,i+1); // A VERIFIER : le +1
premier_pointeur[i]=&mailles[med_index[i]-1]; // A VERIFIER : la formule
}
}
Wrapper_MED_Field(int nv, int nc, double * v):nbr_valeurs(nv),nbr_composantes(nc),valeurs(v)
{
}
- Wrapper_MED_Field(const FIELD<double> * medfield)
+ Wrapper_MED_Field(const MEDMEM::FIELD<double> * medfield)
{
nbr_valeurs=medfield->getNumberOfValues();
nbr_composantes=medfield->getNumberOfComponents();
- valeurs=const_cast<double *>(medfield->getValue(MED_FULL_INTERLACE));
+ valeurs=const_cast<double *>(medfield->getValue(MED_EN::MED_FULL_INTERLACE));
}
~Wrapper_MED_Field(){}
inline Valeur<double> operator[](int i)
CPPFLAGS+=-U_DEBUG_ $(MED2_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome -I../
-CXXFLAGS+=-U_DEBUG_ -ftemplate-depth-42 -I${KERNEL_ROOT_DIR}/include/salome
+CXXFLAGS+=-U_DEBUG_ @CXXTMPDPTHFLAGS@ -I${KERNEL_ROOT_DIR}/include/salome
#LDFLAGS+=$(MED2_LIBS) $(HDF5_LIBS) -lSalomeLoggerServer -L${KERNEL_ROOT_DIR}/lib/salome
-LDFLAGS+=$(MED2_LIBS) $(HDF5_LIBS) -lSALOMELocalTrace -L${KERNEL_ROOT_DIR}/lib/salome
+LDFLAGS+=-lm $(MED2_LIBS) $(HDF5_LIBS) -lSALOMELocalTrace -L${KERNEL_ROOT_DIR}/lib/salome -lMEDWrapper_V2_1
#LDFLAGSFORBIN+=$(MED2_LIBS) $(HDF5_LIBS) -L../.libs -lmedmem -lSalomeLoggerServer -L${KERNEL_ROOT_DIR}/lib/salome
-LDFLAGSFORBIN+=$(MED2_LIBS) $(HDF5_LIBS) -L../.libs -lmedmem -lSALOMELocalTrace -L${KERNEL_ROOT_DIR}/lib/salome
+LDFLAGSFORBIN+=-lm $(MED2_LIBS) $(HDF5_LIBS) -L../.libs -lmedmem -lSALOMELocalTrace -L${KERNEL_ROOT_DIR}/lib/salome -lMEDWrapper_V2_1 -lMEDWrapperBase
LIBSFORBIN=
#include "stdio.h"
+using namespace MEDMEM;
+using namespace MED_EN;
+
main () {
const char * fromFileName = "ResultatSyrthes.med";
#include "stdio.h"
using namespace MEDMEM;
+using namespace MED_EN;
main () {
#include "MEDMEM_InterpolationHighLevelObjects.hxx"
+using namespace MEDMEM;
+using namespace MED_EN;
+
int main (void)
{
int i;
#include "MEDMEM_InterpolationHighLevelObjects.hxx"
+using namespace MEDMEM;
+using namespace MED_EN;
+
int main (void)
{
int i,j;
#include <med.h>
#include <string.h>
-#define MED_NOPG 1 /* -> pas de point de Gauss */
-#define MED_NOPFL "" /* -> pas de profils utilisateur */
-#define MED_NOPFLi " " /* Variable Interne */
-#define MED_NOPF 0 /* -> pas de profils pour _MEDdataseNnumEcrire */
-#define MED_NOPDT -1 /* rem: pas de pas de temps negatifs */
-#define MED_NONOR -1 /* rem: pas de n°ordre negatif */
-#define MED_DIM1 1 /* PAS */
-
-#define MED_ALL 0
/*****************************************************************************************************/
med_idt tofid;
char frommaa[MED_TAILLE_NOM+1] = "fromMesh";
char tomaa[MED_TAILLE_NOM+1] = "toMesh";
+ char frommaadesc[MED_TAILLE_DESC+1] = "Initial Mesh description";
+ char tomaadesc[MED_TAILLE_DESC+1] = "Target Mesh description";
+ med_maillage type = MED_NON_STRUCTURE;
const med_int mdim = 3;
med_int fromnnoe;
med_int tonnoe;
/*****************************************************************************************************/
- fromfid = MEDouvrir("fromMesh.med",MED_REMP);
+ fromfid = MEDouvrir("fromMesh.med",MED_LECTURE_AJOUT);
if (fromfid < 0)
ret = -1;
else
printf("MEDouvrir : %d\n",ret);
/*****************************************************************************************************/
- tofid = MEDouvrir("toMesh.med",MED_REMP);
+ tofid = MEDouvrir("toMesh.med",MED_LECTURE_AJOUT);
if (tofid < 0)
ret = -1;
else
printf("MEDouvrir : %d\n",ret);
/*****************************************************************************************************/
if (ret == 0)
- ret = MEDmaaCr(fromfid,frommaa,mdim);
+ ret = MEDmaaCr(fromfid,frommaa,mdim,type,frommaadesc);
printf("MEDmaaCr : %d\n",ret);
/*****************************************************************************************************/
if (ret == 0)
- ret = MEDmaaCr(tofid,tomaa,mdim);
+ ret = MEDmaaCr(tofid,tomaa,mdim,type,tomaadesc);
printf("MEDmaaCr : %d\n",ret);
/*****************************************************************************************************/
ret = MEDnoeudsEcr(fromfid,frommaa,mdim,fromcoo,MED_FULL_INTERLACE,MED_CART,
// nomcoo,unicoo,nomnoe,MED_FAUX,fromnumnoe,MED_VRAI,
nomcoo,unicoo,nomnoe,MED_FAUX,fromnumnoe,MED_FAUX,
- fromnufano,fromnnoe,MED_ECRI);
+ fromnufano,fromnnoe);
printf("MEDnoeudsEcr : %d\n",ret);
/*****************************************************************************************************/
ret = MEDnoeudsEcr(tofid,tomaa,mdim,tocoo,MED_FULL_INTERLACE,MED_CART,
//nomcoo,unicoo,nomnoe,MED_FAUX,tonumnoe,MED_VRAI,
nomcoo,unicoo,nomnoe,MED_FAUX,tonumnoe,MED_FAUX,
- tonufano,tonnoe,MED_ECRI);
+ tonufano,tonnoe);
printf("MEDnoeudsEcr : %d\n",ret);
if (ret == 0)
ret = MEDelementsEcr(fromfid,frommaa,mdim,fromhexa8,MED_FULL_INTERLACE,
fromnomhexa8,MED_FAUX,fromnumhexa8,MED_VRAI,fromnufahexa8,fromnhexa8,
- MED_MAILLE,MED_HEXA8,MED_NOD,MED_ECRI);
+ MED_MAILLE,MED_HEXA8,MED_NOD);
printf("MEDelementsEcr : %d \n",ret);
/*****************************************************************************************************/
if (ret == 0)
ret = MEDelementsEcr(tofid,tomaa,mdim,tohexa8,MED_FULL_INTERLACE,
tonomhexa8,MED_FAUX,tonumhexa8,MED_VRAI,tonufahexa8,tonhexa8,
- MED_MAILLE,MED_HEXA8,MED_NOD,MED_ECRI);
+ MED_MAILLE,MED_HEXA8,MED_NOD);
printf("MEDelementsEcr : %d \n",ret);
/*****************************************************************************************************/
if (ret == 0)
{
- ret = MEDchampCr(fromfid,champnode,MED_REEL64,champnode_comp,champnode_unit,1);
+ ret = MEDchampCr(fromfid,champnode,MED_FLOAT64,champnode_comp,champnode_unit,1);
printf("MEDchampCr : %d \n",ret);
if (ret == 0)
{
ret = MEDchampEcr(fromfid, frommaa, champnode, (unsigned char *)fieldnodedouble,
MED_FULL_INTERLACE, fromnnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
+ MED_NOGAUSS, MED_ALL, MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD,
0, MED_NOPDT," ", 0. , MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fromfid,champcell,MED_REEL64,champcell_comp,champcell_unit,3);
+ ret = MEDchampCr(fromfid,champcell,MED_FLOAT64,champcell_comp,champcell_unit,3);
printf("MEDchampCr : %d \n",ret);
if (ret == 0)
{
ret = MEDchampEcr(fromfid, frommaa, champcell, (unsigned char *)fieldcelldoublevector,
MED_FULL_INTERLACE, fromnhexa8,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE,
+ MED_NOGAUSS, MED_ALL, MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE,
MED_HEXA8, MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fromfid,champcellscalar,MED_REEL64,champcellscalar_comp,champcellscalar_unit,1);
+ ret = MEDchampCr(fromfid,champcellscalar,MED_FLOAT64,champcellscalar_comp,champcellscalar_unit,1);
printf("MEDchampCr : %d \n",ret);
if (ret == 0)
{
ret = MEDchampEcr(fromfid, frommaa, champcellscalar, (unsigned char *)fieldcelldouble,
MED_FULL_INTERLACE, fromnhexa8,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE,
+ MED_NOGAUSS, MED_ALL, MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE,
MED_HEXA8, MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fromfid,champnodevector,MED_REEL64,champnodevector_comp,champnodevector_unit,3);
+ ret = MEDchampCr(fromfid,champnodevector,MED_FLOAT64,champnodevector_comp,champnodevector_unit,3);
printf("MEDchampCr : %d \n",ret);
if (ret == 0)
{
ret = MEDchampEcr(fromfid, frommaa, champnodevector, (unsigned char *)fieldnodedoublevector,
MED_FULL_INTERLACE, fromnnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
+ MED_NOGAUSS, MED_ALL, MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD,
0, MED_NOPDT," ", 0. , MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
return 0;
}
-
#include "stdio.h"
+using namespace MEDMEM;
+using namespace MED_EN;
+
main () {
const char * fromFileName = "fromMesh.med";
#include "stdio.h"
-
+using namespace MEDMEM;
+using namespace MED_EN;
// pour gestion timings
#include "time.h"
#include "stdio.h"
+using namespace MEDMEM;
+using namespace MED_EN;
+
main () {
const char * fromFileName = "ResultatSyrthes.med";
#include "stdio.h"
+using namespace MEDMEM;
+using namespace MED_EN;
+
main () {
const char * fromFileName = "ResultatSyrthes.med";
BIN =
BIN_SRC =
+LDFLAGS= -L$(top_builddir)/lib/salome
+LDFLAGSFORBIN= -L$(top_builddir)/lib/salome
+
# additionnal information to compil and link file
CPPFLAGS += $(OCC_INCLUDES) $(MED2_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
// Module : MED
// $Header$
-using namespace std;
#include "Med_Gen_i.hxx"
#include "MEDMEM_Mesh_i.hxx"
#include <HDFascii.hxx>
#include "SALOMEDS_Tool.hxx"
+using namespace std;
using namespace MEDMEM;
// Initialisation des variables statiques
myMeshDriver.setMeshName(meshName);
myMeshDriver.open();
}
- catch (const exception & ex)
+ catch (const std::exception & ex)
{
MESSAGE("Exception Interceptee : ");
SCRUTE(ex.what());
MESSAGE("apres read");
myMeshDriver.close();
}
- catch (const exception & ex)
+ catch (const std::exception & ex)
{
MESSAGE("Exception Interceptee : ");
SCRUTE(ex.what());
}
else
- MESSAGE("MED dejà dans l étude");
+ MESSAGE("MED dejà dans l étude");
MESSAGE("Lecture du fichier ")
SCRUTE(fileName);
*/
myField = mymed->getField(fieldName,iter,ordre);
}
- catch (const exception & ex)
+ catch (const std::exception & ex)
{
MESSAGE("Exception Interceptee : ");
SCRUTE(ex.what());
SCRUTE(myMesh->getName());
fieldSupport->update();
}
- catch (const exception & ex)
+ catch (const std::exception & ex)
{
MESSAGE("Exception Interceptee : ");
SCRUTE(ex.what());
med_type_champ type = myField->getValueType() ;
switch (type)
{
- case MED_FR::MED_INT32:
+ case MED_EN::MED_INT32:
{
try
{
return myFieldIOR;
}
catch (const SALOMEDS::StudyBuilder::LockProtection & lp) {}
- catch (const exception & ex)
+ catch (const std::exception & ex)
{
MESSAGE("Exception Interceptee : ");
SCRUTE(ex.what());
};
break;
}
- case MED_FR::MED_REEL64:
+ case MED_EN::MED_REEL64:
{
try
{
return myFieldIOR;
}
catch (const SALOMEDS::StudyBuilder::LockProtection & lp) {}
- catch (const exception & ex)
+ catch (const std::exception & ex)
{
MESSAGE("Exception Interceptee : ");
SCRUTE(ex.what());
if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.ToCString(), aSeq.in(), true);
// Return the created byte stream
return aStreamFile._retn();
-
- END_OF(LOC);
}
//=============================================================================
SALOMEDS::ListOfFileNames_var aSeq =
SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.ToCString(), isMultiFile);
return true;
-
- END_OF(LOC);
}
CORBA::Boolean Med_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
SCRUTE(IORString);
- if (string(IORString).size()==0) return "_MED";
+ if (string(IORString).size()==0) return CORBA::string_dup("_MED");
// Well, we know where put object (_saveFilename) and we know object (IORString)
// cast object :
CORBA::Object_var myIOR = _orb->string_to_object(IORString);
}
//THROW_SALOME_CORBA_EXCEPTION("Unable to save IOR",SALOME::BAD_PARAM);
- return "_MED";
-
- END_OF(LOC) ;
+ return CORBA::string_dup("_MED");
}
//=============================================================================
myMeshDriver.setMeshName(aMeshName);
myMeshDriver.open();
}
- catch (const exception & ex)
+ catch (const std::exception & ex)
{
MESSAGE("Exception Interceptee : ");
SCRUTE(ex.what());
MESSAGE("apres read");
myMeshDriver.close();
}
- catch (const exception & ex)
+ catch (const std::exception & ex)
{
MESSAGE("Exception Interceptee : ");
SCRUTE(ex.what());
}
return CORBA::string_dup("");
-
- END_OF(LOC) ;
}
//=============================================================================
strcpy(aFullName+strlen(aTmpDir), aSeq[0]);
long driverId = aMesh->addDriver(SALOME_MED::MED_DRIVER,aFullName , aMesh->getName());
aMesh->write(driverId,"");
- delete(aFullName);
- aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aSeq.in(), false);
- SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aSeq.in(), true);
+ // aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.c_str(), aSeq.in(), false);
+ char* aFullName1 = new char[strlen(aTmpDir)+1];
+ strcpy(aFullName1, aTmpDir);
+ aStreamFile = SALOMEDS_Tool::PutFilesToStream(aFullName1, aSeq.in(), false);
+ // SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq.in(), true);
+ SALOMEDS_Tool::RemoveTemporaryFiles(aFullName1, aSeq.in(), true);
// Assign an ID = 1 the the type SALOME_MED::MESH
theObjectID = 1;
SALOMEDS::Study_var aStudy = theObject->GetStudy();
CORBA::String_var aTmpDir = CORBA::string_dup(SALOMEDS_Tool::GetTmpDir().c_str());
- SALOMEDS::ListOfFileNames_var aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir, false);
+ char* aFullName2 = new char[strlen(aTmpDir)+1];
+ strcpy(aFullName2,aTmpDir);
+ // SALOMEDS::ListOfFileNames_var aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir, false);
+ SALOMEDS::ListOfFileNames_var aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aFullName2, false);
CORBA::String_var aMeshName = CORBA::string_dup(aSeq[0]);
char* aFullName = new char[strlen(aTmpDir)+strlen(aMeshName)+1];
strcpy(aFullName, aTmpDir);
strcpy(aFullName+strlen(aTmpDir), aMeshName);
MESH * myMesh= new MESH() ;
- myMesh->setName((char*)aMeshName);
+ // myMesh->setName(aMeshName.c_str());
+ char* aFullMeshName = new char[strlen(aMeshName)+1];
+ strcpy(aFullMeshName,aMeshName);
+ myMesh->setName(aFullMeshName);
MED_MESH_RDONLY_DRIVER myMeshDriver(aFullName, myMesh);
try {
- myMeshDriver.setMeshName((char*)aMeshName);
+ myMeshDriver.setMeshName(aFullMeshName);
myMeshDriver.open();
- } catch (const exception & ex) {
+ } catch (const std::exception & ex) {
MESSAGE("Exception Interceptee : ");
SCRUTE(ex.what());
- delete(aFullName);
return aResultSO._retn();
};
try {
myMeshDriver.read();
("apres read");
myMeshDriver.close();
- } catch (const exception & ex) {
+ } catch (const std::exception & ex) {
MESSAGE("Exception Interceptee : ");
SCRUTE(ex.what());
- delete(aFullName);
return aResultSO._retn();
};
// set new mesh name, becouse now there are no possibility to operate meshes with the same names
CORBA::String_var anIORString = _orb->object_to_string(mesh);
aResultSO = aStudy->FindObjectIOR(anIORString);
- SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aSeq.in(), true);
- delete(aFullName);
+ char * aFullName1 = new char[strlen(aTmpDir)+1];
+ strcpy(aFullName1,aTmpDir);
+ // SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq.in(), true);
+ SALOMEDS_Tool::RemoveTemporaryFiles(aFullName1, aSeq.in(), true);
return aResultSO._retn();
}
SALOMEDS::SObject_ptr theObject);
private :
- static map <string, string>_MedCorbaObj;
- static string _myFileName;
- static string _saveFileName;
+ static std::map <std::string, std::string>_MedCorbaObj;
+ static std::string _myFileName;
+ static std::string _saveFileName;
private:
bool _duringLoad;
int _myStudyID;
- string _myStudyName;
+ std::string _myStudyName;
int myCounter;
SALOME_NamingService *_NS;
#include "MEDMEM_PointerOf.hxx"
#include "utilities.h"
-using namespace MED_EN;
-
/*!
A template class to generate an array of any particular type (int, long,
float, double) for our purpose in the MED++ library.\n\n
private :
/*! leading dimension of value (example : space dimension for coordinates) */
- med_int _ldValues;
+ int _ldValues;
/*! length of values (example : number of nodes for coordinates) */
- med_int _lengthValues;
+ int _lengthValues;
/*! data access mode. possible values are :\n
- MED_FULL_INTERLACE (default mode) \n
- MED_NO_INTERLACE */
- medModeSwitch _mode;
+ MED_EN::medModeSwitch _mode;
/*! Pointer to representation in mode MED_FULL_INTERLACE */
PointerOf <T> _valuesFull;
/*! Pointer to representation in mode MED_NO_INTERLACE */
inline MEDARRAY();
inline ~MEDARRAY();
- MEDARRAY (const med_int ld_values, const med_int length_values,
- const medModeSwitch mode=MED_FULL_INTERLACE);
- MEDARRAY (T* values, const med_int ld_values,
- const med_int length_values, const medModeSwitch mode=MED_FULL_INTERLACE,bool shallowCopy=false, bool ownershipOfValues=false);
+ MEDARRAY (const int ld_values, const int length_values,
+ const MED_EN::medModeSwitch mode=MED_EN::MED_FULL_INTERLACE);
+ MEDARRAY (T* values, const int ld_values,
+ const int length_values, const MED_EN::medModeSwitch mode=MED_EN::MED_FULL_INTERLACE,bool shallowCopy=false, bool ownershipOfValues=false);
MEDARRAY (MEDARRAY const &m);
MEDARRAY (MEDARRAY const &m, bool copyOther);
MEDARRAY & operator = (const MEDARRAY & m);
MEDARRAY & shallowCopy(const MEDARRAY & m);
- inline med_int getLeadingValue() const;
- inline med_int getLengthValue() const;
+ inline int getLeadingValue() const;
+ inline int getLengthValue() const;
- const T * get (const medModeSwitch mode) ;
- const T * getRow (const med_int i) ;
- const T * getColumn (const med_int j) ;
- const T getIJ (const med_int i, const med_int j) const;
-// T * const get (const medModeSwitch mode) const;
-// T * const getRow (const med_int i) const;
-// T * const getColumn (const med_int j) const;
-// T const getIJ (const med_int i, const med_int j) const;
+ const T * get (const MED_EN::medModeSwitch mode) ;
+ const T * getRow (const int i) ;
+ const T * getColumn (const int j) ;
+ const T getIJ (const int i, const int j) const;
+// T * const get (const MED_EN::medModeSwitch mode) const;
+// T * const getRow (const int i) const;
+// T * const getColumn (const int j) const;
+// T const getIJ (const int i, const int j) const;
- inline medModeSwitch getMode() const;
+ inline MED_EN::medModeSwitch getMode() const;
- void set (const medModeSwitch mode,const T* value);
- void setI (const med_int i, const T* value);
- void setJ (const med_int j, const T* value);
- void setIJ (const med_int i, const med_int j, const T value);
+ void set (const MED_EN::medModeSwitch mode,const T* value);
+ void setI (const int i, const T* value);
+ void setJ (const int j, const T* value);
+ void setIJ (const int i, const int j, const T value);
void calculateOther();
bool isOtherCalculated() const {return (const T*)_valuesOther != NULL;}
void clearOtherMode();
};
-}
//-------------------------------------------------//
// //
The desallocation of T array is not your responsability. \n\n
Throws MEDEXCEPTION if T array length is < 1*/
-template <class T> MEDARRAY<T>::MEDARRAY(const med_int ld_values,
- const med_int length_values,
- const medModeSwitch mode):
+template <class T> MEDARRAY<T>::MEDARRAY(const int ld_values,
+ const int length_values,
+ const MED_EN::medModeSwitch mode):
_ldValues(ld_values),
_lengthValues(length_values),
_valuesFull(), _valuesNo(),
_valuesDefault(),_valuesOther()
{
- BEGIN_OF("constructor MEDARRAY<T>::MEDARRAY(const med_int, const med_int, const medModeSwitch)");
+ BEGIN_OF("constructor MEDARRAY<T>::MEDARRAY(const int, const int, const medModeSwitch)");
// if ld_values < 1 or length_values < 1
// throws an exception
if ((ld_values<1)|(length_values<1))
{
- throw MEDEXCEPTION(LOCALIZED("MEDARRAY<T>::MEDARRAY(const med_int, const med_int, const medModeSwitch) : dimension < 1 !"));
+ throw MEDEXCEPTION(LOCALIZED("MEDARRAY<T>::MEDARRAY(const int, const int, const medModeSwitch) : dimension < 1 !"));
}
- if ( _mode == MED_FULL_INTERLACE)
+ if ( _mode == MED_EN::MED_FULL_INTERLACE)
{
_valuesFull.set(length_values*ld_values);
_valuesDefault.set((T*) _valuesFull);
}
else
{
- ASSERT (_mode == MED_NO_INTERLACE);
+ ASSERT (_mode == MED_EN::MED_NO_INTERLACE);
_valuesNo.set(length_values*ld_values);
_valuesDefault.set((T*)_valuesNo);
}
SCRUTE((T*)_valuesNo);
SCRUTE((T*)_valuesFull);
- END_OF("constructor MEDARRAY<T>::MEDARRAY(const med_int, const med_int, const medModeSwitch ()");
+ END_OF("constructor MEDARRAY<T>::MEDARRAY(const int, const int, const medModeSwitch ()");
}
// ------------------
Throws MEDEXCEPTION if the lenght of T is < 1*/
template <class T> MEDARRAY<T>::MEDARRAY( T*values,
- const med_int ld_values,
- const med_int length_values,
- const medModeSwitch mode,
+ const int ld_values,
+ const int length_values,
+ const MED_EN::medModeSwitch mode,
bool shallowCopy,
bool ownershipOfValues):
_ldValues(ld_values),
_valuesFull(),_valuesNo(),
_valuesDefault(),_valuesOther()
{
- BEGIN_OF("constructor MEDARRAY<T>::MEDARRAY(T* values, const med_int, const med_int, const medModeSwitch)");
+ BEGIN_OF("constructor MEDARRAY<T>::MEDARRAY(T* values, const int, const int, const medModeSwitch)");
// if ld_values < 1 or length_values < 1, we could not allocate
// throws an exception
if ( (ld_values<1) | (length_values<1) )
{
- throw MEDEXCEPTION(LOCALIZED("MEDARRAY<T>::MEDARRAY(T* values, const med_int, const medModeSwitch) : dimension < 1 !"));
+ throw MEDEXCEPTION(LOCALIZED("MEDARRAY<T>::MEDARRAY(T* values, const int, const medModeSwitch) : dimension < 1 !"));
}
- if ( _mode == MED_FULL_INTERLACE)
+ if ( _mode == MED_EN::MED_FULL_INTERLACE)
{
if(shallowCopy)
{
}
else
{
- ASSERT (_mode == MED_NO_INTERLACE);
+ ASSERT (_mode == MED_EN::MED_NO_INTERLACE);
if(shallowCopy)
{
if(ownershipOfValues)
SCRUTE((T*)_valuesNo);
SCRUTE((T*)_valuesFull);
- END_OF("constructor MEDARRAY<T>::MEDARRAY(T* values, const med_int, const med_int, const medModeSwitch)");
+ END_OF("constructor MEDARRAY<T>::MEDARRAY(T* values, const int, const int, const medModeSwitch)");
}
// ------------------
// throw MEDEXCEPTION("MEDARRAY MEDARRAY const &m,bool copyOther : No Other values defined and bool = true !");
// }
- if ( _mode == MED_FULL_INTERLACE)
+ if ( _mode == MED_EN::MED_FULL_INTERLACE)
{
_valuesFull.set(p._ldValues*p._lengthValues,(const T*)p._valuesFull);
_valuesDefault.set((T*)_valuesFull);
}
else
{
- ASSERT (_mode == MED_NO_INTERLACE);
+ ASSERT (_mode == MED_EN::MED_NO_INTERLACE);
_valuesNo.set(p._ldValues*p._lengthValues,(const T*)p._valuesNo);
_valuesDefault.set((T*)_valuesNo);
if (copyOther)
if ((const T*) m._valuesNo !=NULL)
_valuesNo.set(_ldValues*_lengthValues,(const T*) m._valuesNo);
- if (_mode == MED_FULL_INTERLACE) {
+ if (_mode == MED_EN::MED_FULL_INTERLACE) {
//PN : pour enlever les warning compilateur
//_valuesDefault.set((const T*) _valuesFull);
//_valuesOther.set((const T*) _valuesNo);
_valuesDefault.set((T*) _valuesFull);
_valuesOther.set((T*) _valuesNo);
} else {
- ASSERT (_mode == MED_NO_INTERLACE);
+ ASSERT (_mode == MED_EN::MED_NO_INTERLACE);
//PN : pour enlever les warning compilateur
//_valuesDefault.set((const T*) _valuesNo);
//_valuesOther.set((const T*) _valuesFull);
_valuesFull.setShallowAndOwnership((const T*) m._valuesFull);
if ((const T*) m._valuesNo !=NULL)
_valuesNo.setShallowAndOwnership((const T*) m._valuesNo);
- if (_mode == MED_FULL_INTERLACE) {
+ if (_mode == MED_EN::MED_FULL_INTERLACE) {
_valuesDefault.set((T*) _valuesFull);
_valuesOther.set((T*) _valuesNo);
} else {
// ------------------
/*! returns _ldValues. (for example, space dimension for coordinates array)*/
-template <class T> inline med_int MEDARRAY<T>::getLeadingValue() const
+template <class T> inline int MEDARRAY<T>::getLeadingValue() const
{
return _ldValues;
};
// ------------------
/*! returns _ldValues. (for example, number of nodes for coordinates array)*/
-template <class T> inline med_int MEDARRAY<T>::getLengthValue() const
+template <class T> inline int MEDARRAY<T>::getLengthValue() const
{
return _lengthValues;
};
mode value : if mode is the same as _mode, _valuesDefault is returned.
else, if _valuesOther is calculated (if necessary) and then returned.
The pointer can be used to set values */
-template <class T> const T* MEDARRAY<T>::get(const medModeSwitch mode)
+template <class T> const T* MEDARRAY<T>::get(const MED_EN::medModeSwitch mode)
{
BEGIN_OF("MEDARRAY<T>::get(const medModeSwitch mode)");
if ((T*)_valuesDefault == NULL)
//return (const T*)_valuesDefault;
return (T*) _valuesOther;
}
- END_OF("MEDARRAY<T>::get(const medModeSwitch mode)");
}
// ------------------
Be aware : if _mode is MED_NO_INTERLACE, the entire
array will be recalculate in MED_FULL_INTERLACE representation.\n*/
-template <class T> const T* MEDARRAY<T>::getRow(const med_int i)
+template <class T> const T* MEDARRAY<T>::getRow(const int i)
{
- BEGIN_OF("MEDARRAY<T>::getRow(const med_int i)");
+ BEGIN_OF("MEDARRAY<T>::getRow(const int i)");
if ((T*)_valuesDefault == NULL)
{
//const T* ptr = (const T*)_valuesFull + (i-1)*_ldValues;
const T* ptr = (T*) _valuesFull + (i-1)*_ldValues;
- END_OF("MEDARRAY<T>::getRow(const med_int i )");
+ END_OF("MEDARRAY<T>::getRow(const int i )");
return ptr;
}
// ------------------
Be aware : if _mode is MED_FULL_INTERLACE, the entire
array will be recalculate in MED_NO_INTERLACE representation.\n*/
-template <class T> const T* MEDARRAY<T>::getColumn(const med_int j)
+template <class T> const T* MEDARRAY<T>::getColumn(const int j)
{
- BEGIN_OF("MEDARRAY<T>::getColumn(const med_int j)");
+ BEGIN_OF("MEDARRAY<T>::getColumn(const int j)");
if ((T*)_valuesDefault == NULL)
{
throw MEDEXCEPTION("MEDARRAY::getColumn(j) : No values defined !");
/*! returns Jth value of Ith element .\n
don't forget first element is element 1 (and not element 0). */
-template <class T> const T MEDARRAY<T>::getIJ(const med_int i,const med_int j) const
+template <class T> const T MEDARRAY<T>::getIJ(const int i,const int j) const
{
if (i<1)
throw MEDEXCEPTION("MEDARRAY::getIJ(i,j) : No value in array !");
}
- if (_mode == MED_FULL_INTERLACE)
+ if (_mode == MED_EN::MED_FULL_INTERLACE)
{
return _valuesDefault[(i-1)*_ldValues+j-1];
}
/*! returns the default mode (_mode)\n
(internal use : needed by write method) */
-template <class T> inline medModeSwitch MEDARRAY<T>::getMode() const
+template <class T> inline MED_EN::medModeSwitch MEDARRAY<T>::getMode() const
{
BEGIN_OF("MEDARRAY<T>::getMode()");
END_OF("MEDARRAY<T>::getMode()");
// set with duplication because we don't know were value come and
// MEDARRAY must have properties on it !!!!
-template <class T> void MEDARRAY<T>::set(const medModeSwitch mode, const T* value)
+template <class T> void MEDARRAY<T>::set(const MED_EN::medModeSwitch mode, const T* value)
{
BEGIN_OF("MEDARRAY<T>::set(mode,value)");
_mode = mode;
- if ( _mode == MED_FULL_INTERLACE)
+ if ( _mode == MED_EN::MED_FULL_INTERLACE)
{
_valuesFull.set(_ldValues*_lengthValues,value);
_valuesDefault.set((T*)_valuesFull);
}
else
{
- ASSERT (_mode == MED_NO_INTERLACE);
+ ASSERT (_mode == MED_EN::MED_NO_INTERLACE);
_valuesNo.set(_ldValues*_lengthValues,value);
_valuesDefault.set((T*)_valuesNo);
_valuesFull.set(0);
{
if(isOtherCalculated())
{
- if ( _mode == MED_FULL_INTERLACE)
+ if ( _mode == MED_EN::MED_FULL_INTERLACE)
_valuesNo.set(0);
else
_valuesFull.set(0);
/*! Sets ith element to T* values\n
if they both exist, both _valuesFull and _valuesNo arrays will be updated.\n
Throws exception if i < 1 or i > _lengthValues */
-template <class T> void MEDARRAY<T>::setI(const med_int i, const T* value)
+template <class T> void MEDARRAY<T>::setI(const int i, const T* value)
{
BEGIN_OF("MEDARRAY<T>::setI(i,value)");
/*! Sets ith element to T* values\n
if they both exist, both _valuesFull and _valuesNo arrays will be updated.\n
Throws exception if i < 1 or i > _lengthValues */
-template <class T> void MEDARRAY<T>::setJ(const med_int j, const T* value)
+template <class T> void MEDARRAY<T>::setJ(const int j, const T* value)
{
BEGIN_OF("MEDARRAY::setJ(j,value)");
if (( T*)_valuesDefault == NULL)
Maintains coherency.\n
Throws exception if we don't have
1<=i<=_lengthValues and 1<=j<=_ldValues */
-template <class T> void MEDARRAY<T>::setIJ(const med_int i, const med_int j, const T value)
+template <class T> void MEDARRAY<T>::setIJ(const int i, const int j, const T value)
{
// 1<=i<=_lengthValues and 1<=j<=_ldValues
{
_valuesOther.set(_ldValues*_lengthValues);
}
- if (_mode == MED_NO_INTERLACE)
+ if (_mode == MED_EN::MED_NO_INTERLACE)
{
_valuesFull.set((T*)_valuesOther);
}
else
{
- ASSERT( _mode==MED_FULL_INTERLACE);
+ ASSERT( _mode==MED_EN::MED_FULL_INTERLACE);
_valuesNo.set((T*)_valuesOther);
}
{
for (int j=0; j<_ldValues; j++)
{
- if (_mode == MED_NO_INTERLACE)
+ if (_mode == MED_EN::MED_NO_INTERLACE)
{
_valuesFull[i*_ldValues+j] = _valuesNo[j*_lengthValues+i];
}
END_OF("MEDARRAY<T>::calculateOther()");
}
+} //End of namespace MEDMEM
+
# endif /* # ifndef __MEDARRAY_H__ */
-using namespace std;
/*
File MEDMEM_CellModel.cxx
$Header$
*/
-#include "utilities.h"
#include "MEDMEM_CellModel.hxx"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
CELLMODEL::CELLMODEL(medGeometryElement t)
{
#include "MEDMEM_define.hxx"
using namespace std ;
-using namespace MED_EN;
/*!
This class is an internal class and should not be used by the end-user.
/*! explicit name (as MED_POINT1) */
string _name;
/*! type of cell (cf define.h) */
- medGeometryElement _type;
+ MED_EN::medGeometryElement _type;
/*! Cell dimension (not space dimension) */
int _dimension;
/*! number of nodes forming this type of a cell */
this dimension\n
- third vector : list of local nodes */
int*** _constituents ;
- medGeometryElement** _constituentsType ;
+ MED_EN::medGeometryElement** _constituentsType ;
public :
/*! Constructor. */
inline CELLMODEL();
/*! Constructor. */
- CELLMODEL(medGeometryElement t);
+ CELLMODEL(MED_EN::medGeometryElement t);
/*! Copy constructor. */
inline CELLMODEL(const CELLMODEL &m);
/*! Destructor. */
/*! returns the geometric type of the cell. \n
see med.h (in med/include) */
- inline medGeometryElement getType() const;
+ inline MED_EN::medGeometryElement getType() const;
/*! returns all constituents which dimension is _dimension-dim.*/
int** getConstituents(int dim) const;
/*! returns types of each constituents which dimension
is _dimension-dim.*/
- medGeometryElement* getConstituentsType(int dim) const;
+ MED_EN::medGeometryElement* getConstituentsType(int dim) const;
/*! returns type of num-th constituent which dimension
is _dimension-dim.*/
- medGeometryElement getConstituentType(int dim,int num) const;
+ MED_EN::medGeometryElement getConstituentType(int dim,int num) const;
/*! returns number of constituents type
(which dimension is _dimension-1).*/
/*! returns all types of constituents which dimension
is (_dimension-1).*/
- set<medGeometryElement> getAllConstituentsType() const;
+ set<MED_EN::medGeometryElement> getAllConstituentsType() const;
/*! returns number of constituents foreach type (which dimension
is _dimension-1).*/
- map<medGeometryElement,int> getNumberOfConstituentsForeachType() const;
+ map<MED_EN::medGeometryElement,int> getNumberOfConstituentsForeachType() const;
-};
};
// ------------------------------------------
// Methodes Inline
// ------------------------------------------
-using namespace MEDMEM;
inline CELLMODEL::CELLMODEL():
- _type(MED_NONE),
+ _type(MED_EN::MED_NONE),
_dimension(0),
_numberOfNodes(0),
_numberOfVertexes(0),
_numberOfConstituents((int*)NULL),
_numberOfNodeOfEachConstituent((int**)NULL),
_constituents((int***)NULL),
- _constituentsType((medGeometryElement**)NULL)
+ _constituentsType((MED_EN::medGeometryElement**)NULL)
{
}
inline CELLMODEL::CELLMODEL(const CELLMODEL &m)
{
return _dimension;
}
-inline medGeometryElement CELLMODEL::getType() const
+inline MED_EN::medGeometryElement CELLMODEL::getType() const
{
return _type;
}
{
return _constituents[dim-1][num-1][nodesNumber-1] ;
}
-inline medGeometryElement* CELLMODEL::getConstituentsType(int dim) const
+inline MED_EN::medGeometryElement* CELLMODEL::getConstituentsType(int dim) const
{
return _constituentsType[dim-1];
}
-inline medGeometryElement CELLMODEL::getConstituentType(int dim,int num) const
+inline MED_EN::medGeometryElement CELLMODEL::getConstituentType(int dim,int num) const
{
return _constituentsType[dim-1][num-1];
}
+}//End of namespace MEDMEM
+
#endif /* CELLMODEL_HXX */
-using namespace std;
#include "MEDMEM_Connectivity.hxx"
#include "MEDMEM_Family.hxx"
#include "MEDMEM_Group.hxx"
#include "MEDMEM_STRING.hxx"
#include <iomanip>
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
/*!
Default Constructor. \n
Default for Entity is MED_CELL and type of Connectivity is MED_NODAL */
if (m._count != NULL)
{
- _count = new med_int[_numberOfTypes+1];
- memcpy(_count,m._count,(_numberOfTypes+1)*sizeof(med_int));
+ _count = new int[_numberOfTypes+1];
+ memcpy(_count,m._count,(_numberOfTypes+1)*sizeof(int));
}
else
- _count = (med_int *) NULL;
+ _count = (int *) NULL;
if (m._nodal != NULL)
_nodal = new MEDSKYLINEARRAY(* m._nodal);
}
//------------------------------------------------------------------------------------------------------------------//
-const med_int * CONNECTIVITY::getConnectivity(medConnectivity ConnectivityType, medEntityMesh Entity, medGeometryElement Type)
+const int * CONNECTIVITY::getConnectivity(medConnectivity ConnectivityType, medEntityMesh Entity, medGeometryElement Type)
//------------------------------------------------------------------------------------------------------------------//
{
const char * LOC = "CONNECTIVITY::getConnectivity";
if (Type==MED_ALL_ELEMENTS)
return Connectivity->getValue();
else {
- for (med_int i=0; i<_numberOfTypes; i++)
+ for (int i=0; i<_numberOfTypes; i++)
if (_geometricTypes[i]==Type)
//return Connectivity->getI(i+1);
return Connectivity->getI(_count[i]);
- In C mode : Connectivity[ConnectivityIndex[i]-1+j-1]
- In fortran mode : Connectivity[ConnectivityIndex[i]+j] */
//-----------------------------------------------------------------------------------------------//
-const med_int * CONNECTIVITY::getConnectivityIndex(medConnectivity ConnectivityType, medEntityMesh Entity)
+const int * CONNECTIVITY::getConnectivityIndex(medConnectivity ConnectivityType, medEntityMesh Entity)
//----0000000--------------------------------------------------------------------------------------------//
{
const char * LOC = "CONNECTIVITY::getConnectivityIndex";
if ((Type==MED_ALL_ELEMENTS) || (Type==MED_NONE))
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" : medGeometryElement must be different of MED_ALL_ELEMENTS and MED_NONE !"));
- for (med_int i=0; i<_numberOfTypes; i++)
+ for (int i=0; i<_numberOfTypes; i++)
if (_geometricTypes[i]==Type)
return _type[i];
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" : medGeometryElement not found !"));
/*! Returns the number of elements of type %medGeometryElement.
Note : not implemented for MED_ALL_ELEMENTS nor for MED_NONE */
//------------------------------------------------------------------------//
-med_int CONNECTIVITY::getNumberOfNodesInType(medGeometryElement Type) const
+int CONNECTIVITY::getNumberOfNodesInType(medGeometryElement Type) const
//------------------------------------------------------------------------//
{
const char * LOC = "CONNECTIVITY::getNumberOfNodesInType";
if ((Type==MED_ALL_ELEMENTS) || (Type==MED_NONE))
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" : medGeometryElement must be different of MED_ALL_ELEMENTS and MED_NONE!"));
- for (med_int i=0; i<_numberOfTypes; i++)
+ for (int i=0; i<_numberOfTypes; i++)
if (_geometricTypes[i]==Type)
return _type[i].getNumberOfNodes();
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" : medGeometryElement not found !"));
/*! Returns the number of geometric sub cells of %medGeometryElement type.
not implemented for MED_ALL_ELEMENTS nor for MED_NONE */
//------------------------------------------------------------------------//
-med_int CONNECTIVITY::getNumberOfSubCellInType(medGeometryElement Type) const
+int CONNECTIVITY::getNumberOfSubCellInType(medGeometryElement Type) const
//------------------------------------------------------------------------//
{
if ((Type==MED_ALL_ELEMENTS) || (Type==MED_NONE))
throw MEDEXCEPTION("CONNECTIVITY::getNumberOfSubCell : medGeometryElement must be different of MED_ALL_ELEMENTS and MED_NONE!");
- for (med_int i=0; i<_numberOfTypes; i++)
+ for (int i=0; i<_numberOfTypes; i++)
if (_geometricTypes[i]==Type)
return _type[i].getNumberOfConstituents(1);
throw MEDEXCEPTION("CONNECTIVITY::getNumberOfSubCell : medGeometryElement not found !");
- Not implemented for MED_ALL_ENTITIES (A VERIFIER)
- Not implemented for MED_NONE */
//-----------------------------------------------------------------------------------//
-med_int CONNECTIVITY::getNumberOf(medEntityMesh Entity, medGeometryElement Type) const
+int CONNECTIVITY::getNumberOf(medEntityMesh Entity, medGeometryElement Type) const
//-----------------------------------------------------------------------------------//
{
const char * LOC = "CONNECTIVITY::getNumberOf";
//throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" : medGeometryElement must be different of MED_NONE"));
if (Type==MED_ALL_ELEMENTS)
return _count[_numberOfTypes]-1;
- for (med_int i=0; i<_numberOfTypes; i++)
+ for (int i=0; i<_numberOfTypes; i++)
if (_geometricTypes[i]==Type)
return (_count[i+1] - _count[i]);
//throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" : medGeometryElement not found !"));
/*! A DOCUMENTER */
//--------------------------------------------------------------//
-const med_int* CONNECTIVITY::getValue(medConnectivity TypeConnectivity,
+const int* CONNECTIVITY::getValue(medConnectivity TypeConnectivity,
medGeometryElement Type)
//--------------------------------------------------------------//
{
calculateNodalConnectivity();
if (Type==MED_ALL_ELEMENTS)
return _nodal->getValue();
- for (med_int i=0; i<_numberOfTypes; i++)
+ for (int i=0; i<_numberOfTypes; i++)
if (_geometricTypes[i]==Type)
return _nodal->getI(_count[i]);
}
calculateDescendingConnectivity();
if (Type==MED_ALL_ELEMENTS)
return _descending->getValue();
- for (med_int i=0; i<_numberOfTypes; i++)
+ for (int i=0; i<_numberOfTypes; i++)
if (_geometricTypes[i]==Type)
return _descending->getI(Type);
}
/*! A DOCUMENTER */
//---------------------------------------------------------------------//
-const med_int* CONNECTIVITY:: getValueIndex(medConnectivity TypeConnectivity)
+const int* CONNECTIVITY:: getValueIndex(medConnectivity TypeConnectivity)
//---------------------------------------------------------------------//
{
if (TypeConnectivity == MED_NODAL)
/*! Not yet implemented */
//----------------------------------------------//
-const med_int* CONNECTIVITY:: getNeighbourhood() const
+const int* CONNECTIVITY:: getNeighbourhood() const
//----------------------------------------------//
{
throw MEDEXCEPTION("CONNECTIVITY::getNeighbourhood : Not implemented");
/*! Returns an array which contains, for each node, all cells
arround it. */
//-------------------------------------------------//
-const med_int* CONNECTIVITY::getReverseNodalConnectivity()
+const int* CONNECTIVITY::getReverseNodalConnectivity()
//-------------------------------------------------//
{
calculateReverseNodalConnectivity();
/*! Give index array to use with getReverseConnectivity(MED_NODAL).
It is unusefull with MED_DESCENDING mode, because we have allways two cells. */
//-------------------------------------------------------//
-const med_int* CONNECTIVITY::getReverseNodalConnectivityIndex()
+const int* CONNECTIVITY::getReverseNodalConnectivityIndex()
//-------------------------------------------------------//
{
calculateReverseNodalConnectivity();
the 2 cells of each side. First is cell which face normal is outgoing.
arround it. */
//------------------------------------------------------//
-const med_int* CONNECTIVITY::getReverseDescendingConnectivity()
+const int* CONNECTIVITY::getReverseDescendingConnectivity()
//------------------------------------------------------//
{
// it is in _constituent connectivity only if we are in MED_CELL
/*! calculate the reverse descending Connectivity
and returns the index ( A DOCUMENTER MIEUX)*/
//-----------------------------------------------------------//
-const med_int* CONNECTIVITY::getReverseDescendingConnectivityIndex()
+const int* CONNECTIVITY::getReverseDescendingConnectivityIndex()
//-----------------------------------------------------------//
{
// it is in _constituent connectivity only if we are in MED_CELL
if(_reverseNodalConnectivity==NULL)
{
- med_int node_number = 0;
- vector <vector <med_int> > reverse_connectivity;
+ int node_number = 0;
+ vector <vector <int> > reverse_connectivity;
reverse_connectivity.resize(_numberOfNodes+1);
// Treat all cells types
- for (med_int j = 0; j < _numberOfTypes; j++)
+ for (int j = 0; j < _numberOfTypes; j++)
{
// node number of the cell type
node_number = _type[j].getNumberOfNodes();
// treat all cells of a particular type
- for (med_int k = _count[j]; k < _count[j+1]; k++)
+ for (int k = _count[j]; k < _count[j+1]; k++)
// treat all nodes of the cell type
- for (med_int local_node_number = 1;
+ for (int local_node_number = 1;
local_node_number < node_number+1;
local_node_number++)
{
- med_int global_node = _nodal->getIJ(k,local_node_number);
+ int global_node = _nodal->getIJ(k,local_node_number);
reverse_connectivity[global_node].push_back(k);
}
}
// Full reverse_nodal_connectivity and reverse_nodal_connectivity_index
//calculate size of reverse_nodal_connectivity array
- med_int size_reverse_nodal_connectivity = 0;
- for (med_int i = 1; i < _numberOfNodes+1; i++)
+ int size_reverse_nodal_connectivity = 0;
+ for (int i = 1; i < _numberOfNodes+1; i++)
size_reverse_nodal_connectivity += reverse_connectivity[i].size();
//MEDSKYLINEARRAY * ReverseConnectivity = new MEDSKYLINEARRAY(_numberOfNodes,size_reverse_nodal_connectivity);
- med_int * reverse_nodal_connectivity_index = new med_int[_numberOfNodes+1];
- med_int * reverse_nodal_connectivity = new med_int[size_reverse_nodal_connectivity];
- //const med_int * reverse_nodal_connectivity = ReverseConnectivity->getValue();
- //const med_int * reverse_nodal_connectivity_index = ReverseConnectivity->getIndex();
+ int * reverse_nodal_connectivity_index = new int[_numberOfNodes+1];
+ int * reverse_nodal_connectivity = new int[size_reverse_nodal_connectivity];
+ //const int * reverse_nodal_connectivity = ReverseConnectivity->getValue();
+ //const int * reverse_nodal_connectivity_index = ReverseConnectivity->getIndex();
reverse_nodal_connectivity_index[0] = 1;
- for (med_int i = 1; i < _numberOfNodes+1; i++)
+ for (int i = 1; i < _numberOfNodes+1; i++)
{
- med_int size = reverse_connectivity[i].size();
+ int size = reverse_connectivity[i].size();
reverse_nodal_connectivity_index[i] =
reverse_nodal_connectivity_index[i-1] + size;
- for (med_int j = 0; j < size; j++)
+ for (int j = 0; j < size; j++)
reverse_nodal_connectivity[reverse_nodal_connectivity_index[i-1]-1+j]= reverse_connectivity[i][j];
}
_constituent->_numberOfTypes = 2;
_constituent->_geometricTypes = new medGeometryElement[_constituent->_numberOfTypes];
_constituent->_type = new CELLMODEL[_constituent->_numberOfTypes];
- _constituent->_count = new med_int[_constituent->_numberOfTypes+1];
+ _constituent->_count = new int[_constituent->_numberOfTypes+1];
_constituent->_count[0]=1;
- int* tmp_NumberOfConstituentsForeachType = new med_int[_constituent->_numberOfTypes+1];
+ int* tmp_NumberOfConstituentsForeachType = new int[_constituent->_numberOfTypes+1];
tmp_NumberOfConstituentsForeachType[0]=0; // to count constituent of each type
for (int i=0; i<_constituent->_numberOfTypes;i++) {
_constituent->_geometricTypes[i]=ConstituentsTypes[i];
{
os << endl << co._type[i].getName() << " : " << endl;
int numberofelements = co._count[i+1]-co._count[i];
- const med_int * connectivity = co.getConnectivity(co._typeConnectivity, co._entity, co._geometricTypes[i]);
+ const int * connectivity = co.getConnectivity(co._typeConnectivity, co._entity, co._geometricTypes[i]);
int numberofnodespercell = co._geometricTypes[i]%100;
for (int j=0;j<numberofelements;j++)
{
else if (co._typeConnectivity == MED_DESCENDING)
{
int numberofelements = co.getNumberOf( co._entity , MED_ALL_ELEMENTS);
- const med_int *connectivity = co.getConnectivity( co._typeConnectivity, co._entity, MED_ALL_ELEMENTS);
+ const int *connectivity = co.getConnectivity( co._typeConnectivity, co._entity, MED_ALL_ELEMENTS);
const int *connectivity_index = co.getConnectivityIndex( co._typeConnectivity, co._entity );
for ( int j=0; j!=numberofelements; j++ )
#include "MEDMEM_Exception.hxx"
#include "MEDMEM_define.hxx"
-using namespace MED_EN;
-
namespace MEDMEM {
class MEDSKYLINEARRAY;
class CELLMODEL;
protected:
/*! contains MED_CELL MED_FACE or MED_EDGE */
- medEntityMesh _entity;
+ MED_EN::medEntityMesh _entity;
/*! contains MED_NODAL or MED_DESCEND */
- medConnectivity _typeConnectivity;
+ MED_EN::medConnectivity _typeConnectivity;
/*! count of differents cells types
used by the mesh */
- med_int _numberOfTypes;
+ int _numberOfTypes;
/*! array of all med_geometric_type used by MESH. */
- medGeometryElement* _geometricTypes;
+ MED_EN::medGeometryElement* _geometricTypes;
/*! map indexed by med_geometric_type
which contains the different
'CellModel' used by MESH. */
CELLMODEL * _type;
/*! contains the dimension of the entity */
- med_int _entityDimension;
+ int _entityDimension;
/*! needed by calculateReverseNodalConnectivity */
- med_int _numberOfNodes;
+ int _numberOfNodes;
/*! array of size _numberOfTypes+1 which
gives for each cell type the first
( 0 <= i < _numberOfTypes ).
Note that _count[_numberOfTypes] returns
total cells count + 1 */
- med_int * _count;
+ int * _count;
/*! pointer to an array which stores the nodal connectivity */
MEDSKYLINEARRAY* _nodal;
evaluates from _descending */
// void calculateReverseDescendingConnectivity(CONNECTIVITY *myConnectivity);
- const med_int* getReverseNodalConnectivity ();
- const med_int* getReverseNodalConnectivityIndex ();
- const med_int* getReverseDescendingConnectivity ();
- const med_int* getReverseDescendingConnectivityIndex ();
+ const int* getReverseNodalConnectivity ();
+ const int* getReverseNodalConnectivityIndex ();
+ const int* getReverseDescendingConnectivity ();
+ const int* getReverseDescendingConnectivityIndex ();
/*! private method :\n
does nothing if already exists, else
// in order to fill CONNECTIVITY of MESH
friend class GRID;
- CONNECTIVITY (medEntityMesh Entity=MED_CELL);
- CONNECTIVITY (int numberOfTypes, medEntityMesh Entity=MED_CELL);
+ CONNECTIVITY (MED_EN::medEntityMesh Entity=MED_EN::MED_CELL);
+ CONNECTIVITY (int numberOfTypes, MED_EN::medEntityMesh Entity=MED_EN::MED_CELL);
CONNECTIVITY (const CONNECTIVITY & m);
virtual ~CONNECTIVITY ();
void setConstituent (CONNECTIVITY * Constituent)
throw (MEDEXCEPTION);
- void setGeometricTypes (const medGeometryElement * Types,
- const medEntityMesh Entity)
+ void setGeometricTypes (const MED_EN::medGeometryElement * Types,
+ const MED_EN::medEntityMesh Entity)
throw (MEDEXCEPTION);
- void setCount (const int * Count, const medEntityMesh Entity)
+ void setCount (const int * Count, const MED_EN::medEntityMesh Entity)
throw (MEDEXCEPTION);
void setNodal (const int * Connectivity,
- const medEntityMesh Entity,
- const medGeometryElement Type)
+ const MED_EN::medEntityMesh Entity,
+ const MED_EN::medGeometryElement Type)
throw (MEDEXCEPTION);
- inline void setNumberOfNodes(med_int NumberOfNodes);
+ inline void setNumberOfNodes(int NumberOfNodes);
- inline med_int getEntityDimension() const;
+ inline int getEntityDimension() const;
- inline void setEntityDimension(med_int EntityDimension);
+ inline void setEntityDimension(int EntityDimension);
- inline bool existConnectivity (medConnectivity connectivityType, medEntityMesh Entity) const;
+ inline bool existConnectivity (MED_EN::medConnectivity connectivityType, MED_EN::medEntityMesh Entity) const;
- virtual void calculateConnectivity (medConnectivity connectivityType, medEntityMesh Entity);
+ virtual void calculateConnectivity (MED_EN::medConnectivity connectivityType, MED_EN::medEntityMesh Entity);
virtual void updateFamily (vector<FAMILY*> myFamilies);
virtual void updateGroup (vector<GROUP*> myFamilies);
- inline medEntityMesh getEntity () const;
- inline med_int getNumberOfTypes (medEntityMesh Entity) const;
- inline const medGeometryElement * getGeometricTypes (medEntityMesh Entity) const
+ inline MED_EN::medEntityMesh getEntity () const;
+ inline int getNumberOfTypes (MED_EN::medEntityMesh Entity) const;
+ inline const MED_EN::medGeometryElement * getGeometricTypes (MED_EN::medEntityMesh Entity) const
throw (MEDEXCEPTION);
- medGeometryElement getElementType (medEntityMesh Entity,
+ MED_EN::medGeometryElement getElementType (MED_EN::medEntityMesh Entity,
int Number) const;
- virtual inline const int * getGlobalNumberingIndex (medEntityMesh Entity) const
+ virtual inline const int * getGlobalNumberingIndex (MED_EN::medEntityMesh Entity) const
throw (MEDEXCEPTION);
- virtual const med_int * getConnectivity (medConnectivity ConnectivityType,
- medEntityMesh Entity,
- medGeometryElement Type);
- virtual const med_int * getConnectivityIndex (medConnectivity ConnectivityType,
- medEntityMesh Entity);
+ virtual const int * getConnectivity (MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity,
+ MED_EN::medGeometryElement Type);
+ virtual const int * getConnectivityIndex (MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity);
- const CELLMODEL & getType (medGeometryElement Type) const;
- const CELLMODEL * getCellsTypes (medEntityMesh Entity) const
+ const CELLMODEL & getType (MED_EN::medGeometryElement Type) const;
+ const CELLMODEL * getCellsTypes (MED_EN::medEntityMesh Entity) const
throw (MEDEXCEPTION);
- med_int getNumberOfNodesInType (medGeometryElement Type) const;
- med_int getNumberOfSubCellInType (medGeometryElement Type) const;
- virtual med_int getNumberOf (medEntityMesh Entity,
- medGeometryElement Type) const;
- virtual const med_int* getValue (medConnectivity TypeConnectivity,
- medGeometryElement Type);
- virtual const med_int* getValueIndex (medConnectivity TypeConnectivity);
-
- virtual inline const med_int* getReverseConnectivity (medConnectivity ConnectivityType,
- medEntityMesh Entity=MED_CELL)
+ int getNumberOfNodesInType (MED_EN::medGeometryElement Type) const;
+ int getNumberOfSubCellInType (MED_EN::medGeometryElement Type) const;
+ virtual int getNumberOf (MED_EN::medEntityMesh Entity,
+ MED_EN::medGeometryElement Type) const;
+ virtual const int* getValue (MED_EN::medConnectivity TypeConnectivity,
+ MED_EN::medGeometryElement Type);
+ virtual const int* getValueIndex (MED_EN::medConnectivity TypeConnectivity);
+
+ virtual inline const int* getReverseConnectivity (MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity=MED_EN::MED_CELL)
throw (MEDEXCEPTION);
- virtual inline const med_int* getReverseConnectivityIndex (medConnectivity ConnectivityType,
- medEntityMesh Entity=MED_CELL)
+ virtual inline const int* getReverseConnectivityIndex (MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity=MED_EN::MED_CELL)
throw (MEDEXCEPTION);
- const med_int* getNeighbourhood() const;
+ const int* getNeighbourhood() const;
-};
};
/*----------------------*/
/* Methodes Inline */
/*----------------------*/
-using namespace MEDMEM;
/*! Returns the medEntityMesh */
//--------------------------------------------------//
-inline medEntityMesh CONNECTIVITY::getEntity() const
+inline MED_EN::medEntityMesh CONNECTIVITY::getEntity() const
//--------------------------------------------------//
{
return _entity;
existing in the specified entity. \n
Note : Not implemented for MED_ALL_ENTITIES. */
//-----------------------------------------------------------------------//
-inline med_int CONNECTIVITY::getNumberOfTypes(medEntityMesh Entity) const
+inline int CONNECTIVITY::getNumberOfTypes(MED_EN::medEntityMesh Entity) const
//-----------------------------------------------------------------------//
{
MESSAGE("CONNECTIVITY::getNumberOfTypes : Entity = "<<Entity<<", _entity = "<<_entity);
if (_entity==Entity)
- return _numberOfTypes;
+ return _numberOfTypes;
else if (_constituent!=NULL)
- return _constituent->getNumberOfTypes(Entity);
+ return _constituent->getNumberOfTypes(Entity);
// else if (_constituent == NULL)
// {
// MESSAGE("CONNECTIVITY::getNumberOfTypes : _constituent == NULL");
// return _constituent->getNumberOfTypes(Entity);
// }
else
- return 0; // because it is the right information (no exception needed)!
+ return 0; // because it is the right information (no exception needed)!
}
/*! Returns an array of all %medGeometryElement types existing in the mesh
Note : Not implemented for MED_ALL_ENTITIES.
Throws an exception if Entity is unknown */
//------------------------------------------------------------------------------------------//
-inline const medGeometryElement* CONNECTIVITY::getGeometricTypes(medEntityMesh Entity) const
+inline const MED_EN::medGeometryElement* CONNECTIVITY::getGeometricTypes(MED_EN::medEntityMesh Entity) const
throw (MEDEXCEPTION)
//------------------------------------------------------------------------------------------//
{
*/
//----------------------------------------------------------------------------------//
-inline const int * CONNECTIVITY::getGlobalNumberingIndex(medEntityMesh Entity) const
+inline const int * CONNECTIVITY::getGlobalNumberingIndex(MED_EN::medEntityMesh Entity) const
throw (MEDEXCEPTION)
//----------------------------------------------------------------------------------//
{
/*! Returns true if a connectivity exists on elements of type "Entity" */
//-----------------------------------------------------------------------------//
-inline bool CONNECTIVITY::existConnectivity( medConnectivity ConnectivityType,
- medEntityMesh Entity) const
+inline bool CONNECTIVITY::existConnectivity( MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity) const
//-----------------------------------------------------------------------------//
{
if (_entity==Entity) {
MESSAGE("existConnectivity : _entity==Entity="<<Entity);
- if ((ConnectivityType==MED_NODAL)&(_nodal!=(MEDSKYLINEARRAY*)NULL))
+ if ((ConnectivityType==MED_EN::MED_NODAL)&(_nodal!=(MEDSKYLINEARRAY*)NULL))
return true;
- if ((ConnectivityType==MED_DESCENDING)&(_descending!=(MEDSKYLINEARRAY*)NULL))
+ if ((ConnectivityType==MED_EN::MED_DESCENDING)&(_descending!=(MEDSKYLINEARRAY*)NULL))
return true;
} else if (_constituent!=NULL)
return _constituent->existConnectivity(ConnectivityType,Entity);
Throw an execption if the given entity is not defined or if the array is not defined.
*/
//-----------------------------------------------------------------------------//
-inline const CELLMODEL * CONNECTIVITY::getCellsTypes(medEntityMesh Entity) const
+inline const CELLMODEL * CONNECTIVITY::getCellsTypes(MED_EN::medEntityMesh Entity) const
throw (MEDEXCEPTION)
//-----------------------------------------------------------------------------//
{
/*! A DOCUMENTER */
//------------------------------------------------------------------------------------------//
-inline const med_int* CONNECTIVITY::getReverseConnectivity( medConnectivity ConnectivityType,
- medEntityMesh Entity)
+inline const int* CONNECTIVITY::getReverseConnectivity( MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity)
throw (MEDEXCEPTION)
//------------------------------------------------------------------------------------------//
{
if(_entity==Entity)
- if (ConnectivityType==MED_NODAL)
+ if (ConnectivityType==MED_EN::MED_NODAL)
return getReverseNodalConnectivity();
- else if (ConnectivityType==MED_DESCENDING)
+ else if (ConnectivityType==MED_EN::MED_DESCENDING)
return getReverseDescendingConnectivity();
else
throw MEDEXCEPTION("MESH::getReverseConnectivity : connectivity mode not supported !");
/*! A DOCUMENTER */
//-----------------------------------------------------------------------------------------------//
-inline const med_int* CONNECTIVITY::getReverseConnectivityIndex(medConnectivity ConnectivityType,
- medEntityMesh Entity)
+inline const int* CONNECTIVITY::getReverseConnectivityIndex(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity)
throw (MEDEXCEPTION)
//-----------------------------------------------------------------------------------------------//
{
if(_entity==Entity)
- if (ConnectivityType==MED_NODAL)
+ if (ConnectivityType==MED_EN::MED_NODAL)
return getReverseNodalConnectivityIndex();
- else if (ConnectivityType==MED_DESCENDING)
+ else if (ConnectivityType==MED_EN::MED_DESCENDING)
return getReverseDescendingConnectivityIndex();
else
throw MEDEXCEPTION("MESH::getReverseConnectivityIndex : connectivity mode not supported !");
}
-inline void CONNECTIVITY::setNumberOfNodes(med_int NumberOfNodes)
+inline void CONNECTIVITY::setNumberOfNodes(int NumberOfNodes)
{
_numberOfNodes=NumberOfNodes;
}
-inline void CONNECTIVITY::setEntityDimension(med_int EntityDimension)
+inline void CONNECTIVITY::setEntityDimension(int EntityDimension)
{
_entityDimension=EntityDimension;
}
-med_int CONNECTIVITY::getEntityDimension() const
+int CONNECTIVITY::getEntityDimension() const
{
return _entityDimension;
}
+}//End namespace MEDMEM
+
#endif /* CONNECTIVITY_HXX */
-using namespace std;
#include "MEDMEM_Coordinate.hxx"
#include "MEDMEM_Exception.hxx"
#include "MEDMEM_STRING.hxx"
#include "utilities.h"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
/*! Default Constructor : should not be used */
//----------------------------------------------------------//
BEGIN_OF("Constructor COORDINATE");
}
+/*! This constructor is specialy designed for use in class GRID.\n
+ * The purpose is to create a COORDINATE without allocating memory for nodes (in the MEDARRAY).
+ * The allocation (call to setCoordinates) is performed afterward by GRID, if necessary.
+ * We set _coordinateName & _coordinateUnit in the constructor, because calls to setCoordinateName
+ * and setCoordinateUnit are not possible before allocation of MEDARRAY.
+ */
+//------------------------------------------------------------------------------//
+COORDINATE::COORDINATE(int SpaceDimension,const string * CoordinateName, const string * CoordinateUnit):
+ _coordinateSystem(""), _coordinate(MEDARRAY<double>()), _coordinateName(SpaceDimension),
+ _coordinateUnit(SpaceDimension), _nodeNumber()
+{
+ for (int i=0; i<SpaceDimension; ++i)
+ {
+ _coordinateName[i]=CoordinateName[i];
+ _coordinateUnit[i]=CoordinateUnit[i];
+ }
+}
+
+
/*! This constructor will COPY all data (it is a deep copy) included in m.\n
But only the default storage mode of coordinates array
will be copied (not both storage representation modes even if they both
setCoordinatesUnits((const string*)m._coordinateUnit) ;
if ( (const int * const) m._nodeNumber != NULL)
- _nodeNumber.set(numberOfNodes,(const med_int*)m._nodeNumber);
+ _nodeNumber.set(numberOfNodes,(const int*)m._nodeNumber);
// PG : it's default no ?
// else
// {
COORDINATE();
- COORDINATE(int SpaceDimension, int NumberOfNodes, medModeSwitch Mode);
+ COORDINATE(int SpaceDimension, int NumberOfNodes, MED_EN::medModeSwitch Mode);
+ COORDINATE(int SpaceDimension,const string * CoordinateName, const string * CoordinateUnit);
COORDINATE(const COORDINATE & m);
virtual ~COORDINATE();
void setCoordinates(MEDARRAY<double> *Coordinate,bool shallowCopy=false);
- void setCoordinates(const medModeSwitch Mode, const double *Coordinate);
+ void setCoordinates(const MED_EN::medModeSwitch Mode, const double *Coordinate);
void setCoordinatesNames(const string * CoordinateName);
void setCoordinateName(const string CoordinateName, const int i);
void setCoordinatesUnits(const string * CoordinateUnit);
//const int* getNodesNumbers() ;
string getCoordinatesSystem() const;
- virtual const double * getCoordinates(medModeSwitch Mode);
+ virtual const double * getCoordinates(MED_EN::medModeSwitch Mode);
virtual double getCoordinate(int Number,int Axis);
virtual const double * getCoordinateAxis(int Axis);
#define DRIVERFACTORY_HXX
#include "MEDMEM_GenDriver.hxx"
+#include "MEDMEM_VtkFieldDriver.hxx"
+#include "MEDMEM_MedFieldDriver.hxx"
#include <string>
namespace MEDMEM {
GENDRIVER *buildDriverForField(driverTypes driverType, const std::string & fileName, FIELD<T> *field);
GENDRIVER *buildDriverForMed(driverTypes driverType, const std::string & fileName, MED *med);
}
-
-}
-
-#include "MEDMEM_VtkFieldDriver.hxx"
-#include "MEDMEM_MedFieldDriver.hxx"
-
-using namespace MEDMEM;
template<class T>
GENDRIVER *DRIVERFACTORY::buildDriverForField(driverTypes driverType, const std::string & fileName, FIELD<T> *field)
return ret;
}
+}
+
#endif
-using namespace std;
#include "MEDMEM_DriverTools.hxx"
#include "MEDMEM_STRING.hxx"
#include "MEDMEM_Exception.hxx"
#include "MEDMEM_Group.hxx"
#include <iomanip>
#include <algorithm>
-using namespace MEDMEM;
+using namespace std;
+using namespace MEDMEM;
+using namespace MED_EN;
// Cet opérateur permet d'ordonner les mailles dans un set suivant l'ordre requis par MED
bool _maille::operator < (const _maille& ma) const
for( std::vector<int>::const_iterator i=gr.groupes.begin(); i!=gr.groupes.end(); ++i)
os << *i << " ";
os << std::endl << " -> liste des mailles : " << std::endl;
- for( _groupe::mailleIter i=gr.mailles.begin(); i!=gr.mailles.end(); i++)
+ std::set< std::set< _maille, std::less< _maille >,
+ std::allocator< _maille > >::iterator,
+ _mailleIteratorCompare,
+ std::allocator< std::set< _maille, std::less< _maille >,
+ std::allocator< _maille > >::iterator > >::const_iterator i ;
+ for( i=gr.mailles.begin(); i!=gr.mailles.end(); i++)
os << " " << *(*i) << std::endl;
return os;
}
{
for ( unsigned n=0; n != j->sommets.size(); ++n)
connectivity[nbSommetsParMaille*l+n] = j->sommets[n]->second.number;
- maillage.erase(j); ; // dangereux, mais optimise la mémoire consommée!
+ //CCRT maillage.erase(j); ; // dangereux, mais optimise la mémoire consommée!
}
Connectivity->setNodal (connectivity, entity, vtype[k]);
continue;
int nb_geometric_types=1;
- _groupe::mailleIter j=groupes[i].mailles.begin();
+ std::set< std::set< _maille, std::less< _maille >,
+ std::allocator< _maille > >::iterator,
+ _mailleIteratorCompare,
+ std::allocator< std::set< _maille, std::less<_maille >,
+ std::allocator< _maille > >::iterator > >::iterator j ;
+ j=groupes[i].mailles.begin();
// initialise groupe_entity a l'entite de la premiere maille du groupe
medEntityMesh groupe_entity = (**j).getEntity(dimension_maillage);
medGeometryElement geometrictype=(**j).geometricType;
-using namespace std;
#include "MEDMEM_DriversDef.hxx"
-namespace MED_FR
-{
+using namespace std;
+
+namespace MED_EN {
// Returns the (string) name of the geometry of
// an element given by a med_geometrie_element value
// MESSAGE(" end of destructor GEO_NAME::~GEO_NAME() "<< size() );
}
-string & GEO_NAME::operator[]( const med_geometrie_element &c ) const
+string & GEO_NAME::operator[]( const MED_EN::medGeometryElement &c ) const
{
map<int,string> &table = (map<int,string>&)*this ;
assert( table.find( (int)c ) != table.end() ) ;
ENT_NAME::ENT_NAME() : map<int,string>()
{
map<int,string> &table = (map<int,string>&)*this ;
- table[(int)MED_MAILLE ] = "MED_MAILLE";
+ table[(int)MED_CELL ] = "MED_MAILLE";
table[(int)MED_FACE ] = "MED_FACE";
- table[(int)MED_ARETE ] = "MED_ARETE";
- table[(int)MED_NOEUD ] = "MED_NOEUD";
+ table[(int)MED_EDGE ] = "MED_ARETE";
+ table[(int)MED_NODE ] = "MED_NOEUD";
}
ENT_NAME::~ENT_NAME()
// MESSAGE(" end of destructor ENT_NAME::~ENT_NAME() "<< size() );
}
-string & ENT_NAME::operator[]( const med_entite_maillage &c ) const
+string & ENT_NAME::operator[]( const MED_EN::medEntityMesh &c ) const
{
map<int,string> &table = (map<int,string>&)*this ;
assert( table.find( (int)c ) != table.end() ) ;
return table[ (int)c ] ;
}
-MESH_ENTITIES::MESH_ENTITIES () : map<int, const list<med_geometrie_element> >()
+MESH_ENTITIES::MESH_ENTITIES () : map<int, const list<MED_EN::medGeometryElement> >()
{
// Override the const declaration in order to used the find method below
// map<int, const list<med_geometrie_element> > &table = (map<int, const list<med_geometrie_element> >&)*this ; unused local variable
// Initialize the value associated with the ROUGE_ key ( use the private operator = )
{
- const med_geometrie_element T[] = {
+ const MED_EN::medGeometryElement T[] = {
MED_POINT1,
MED_SEG2,
MED_SEG3,
MED_PENTA15,
MED_HEXA20};
- static const list<med_geometrie_element> geomList(T,T+sizeof(T)/sizeof(med_geometrie_element));
- (*this)[MED_MAILLE] = geomList;
+ static const list<MED_EN::medGeometryElement> geomList(T,T+sizeof(T)/sizeof(MED_EN::medGeometryElement));
+ (*this)[MED_CELL] = geomList;
}
{
- const med_geometrie_element T[] = {
+ const MED_EN::medGeometryElement T[] = {
MED_TRIA3,
MED_QUAD4,
MED_TRIA6,
MED_QUAD8};
- static const list<med_geometrie_element> geomList(T,T+sizeof(T)/sizeof(med_geometrie_element));
+ static const list<MED_EN::medGeometryElement> geomList(T,T+sizeof(T)/sizeof(MED_EN::medGeometryElement));
(*this)[MED_FACE] = geomList;
}
{
- const med_geometrie_element T[] = {
+ const MED_EN::medGeometryElement T[] = {
MED_SEG2,
MED_SEG3 };
- static const list<med_geometrie_element> geomList(T,T+sizeof(T)/sizeof(med_geometrie_element));
- (*this)[MED_ARETE] = geomList;
+ static const list<MED_EN::medGeometryElement> geomList(T,T+sizeof(T)/sizeof(MED_EN::medGeometryElement));
+ (*this)[MED_EDGE] = geomList;
}
{
// const med_geometrie_element T[] = { MED_NONE };
- const med_geometrie_element T[] = { (med_geometrie_element)0 };
- static const list<med_geometrie_element> geomList(T,T+sizeof(T)/sizeof(med_geometrie_element));
- (*this)[MED_NOEUD] = geomList;
+ const MED_EN::medGeometryElement T[] = { (MED_EN::medGeometryElement)0 };
+ static const list<MED_EN::medGeometryElement> geomList(T,T+sizeof(T)/sizeof(MED_EN::medGeometryElement));
+ (*this)[MED_NODE] = geomList;
}
}
// MESSAGE(" end of destructor MESH_ENTITIES::~MESH_ENTITIES() "<< size() );
}
-const list<med_geometrie_element> & MESH_ENTITIES::operator[]( const med_entite_maillage &c ) const
+const list<MED_EN::medGeometryElement> & MESH_ENTITIES::operator[]( const MED_EN::medEntityMesh &c ) const
{
- map<int,const list<med_geometrie_element> > &table = (map<int,const list<med_geometrie_element> >&)*this ;
+ map<int,const list<MED_EN::medGeometryElement> > &table = (map<int,const list<MED_EN::medGeometryElement> >&)*this ;
// Verify the object already exists in the map
assert( table.find( (int)c ) != table.end() ) ;
return table[ (int)c ] ;
}
// This operator is used to initialize class objects of type const list<med_geometrie_element>
-list<med_geometrie_element> & MESH_ENTITIES::operator[]( const med_entite_maillage &c )
+list<MED_EN::medGeometryElement> & MESH_ENTITIES::operator[]( const MED_EN::medEntityMesh &c )
{
- return (list<med_geometrie_element> &) this->map<int,const list<med_geometrie_element> >::operator[]( (int)c) ;
+ return (list<MED_EN::medGeometryElement> &) this->map<int,const list<MED_EN::medGeometryElement> >::operator[]( (int)c) ;
}
-} // End Of NameSpace MED_FR
+} // End Of NampeSpace MED_EN
+
#include "MEDMEM_define.hxx"
#include "utilities.h"
-namespace MED_FR {
+namespace MED_EN {
/*! This Class inherits from map. \n
It is a constant map association int (which is a med_geometrie_element) and string. \n
Operator [] returns the (string) name of the geometry of an element
GEO_NAME();
~GEO_NAME();
- string & operator[]( const MED_FR::med_geometrie_element &c ) const;
+ string & operator[]( const MED_EN::medGeometryElement &c ) const;
} ;
static const GEO_NAME geoNames ;
ENT_NAME ();
~ENT_NAME();
- string & operator[]( const MED_FR::med_entite_maillage &c ) const;
+ string & operator[]( const MED_EN::medEntityMesh &c ) const;
} ;
static const ENT_NAME entNames ;
//--------------------------------------------------------------------------------
-class MESH_ENTITIES : public map<int, const list<MED_FR::med_geometrie_element> >
+class MESH_ENTITIES : public map<int, const list<MED_EN::medGeometryElement> >
//--------------------------------------------------------------------------------
{
MESH_ENTITIES ();
~MESH_ENTITIES();
- const list<MED_FR::med_geometrie_element> & operator[]( const MED_FR::med_entite_maillage &c ) const;
+ const list<MED_EN::medGeometryElement> & operator[]( const MED_EN::medEntityMesh &c ) const;
private:
/*! This operator is used to initialize class objects of
type const list<med_geometrie_element> */
- list<MED_FR::med_geometrie_element> & operator[]( const MED_FR::med_entite_maillage &c );
+ list<MED_EN::medGeometryElement> & operator[]( const MED_EN::medEntityMesh &c );
} ;
static const MESH_ENTITIES meshEntities ;
-} // End Of NameSpace MED_FR
+} // End Of NameSpace MED_EN
#endif
-using namespace std;
/*
File MedException.cxx
$Header$
*/
-using namespace std;
-
#include "utilities.h"
#include "MEDMEM_Exception.hxx"
+
+using namespace std;
using namespace MEDMEM;
extern "C"
#include <string.h>
}
-
/*!
\internal
Function used to duplicate char *
*/
namespace MEDMEM {
//--------------------------------------//
- class MEDEXCEPTION : public exception
+ class MEDEXCEPTION : public std::exception
//--------------------------------------//
{
private :
-using namespace std;
/*
File MEDMEM_Family.cxx
$Header$
#include "MEDMEM_Mesh.hxx"
#include "MEDMEM_Family.hxx"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
FAMILY::FAMILY():_identifier(0), _numberOfAttribute(0),
_attributeIdentifier((int*)NULL),_attributeValue((int*)NULL), _attributeDescription((string*)NULL),
friend ostream & operator<<(ostream &os, const FAMILY &my) ;
- bool build(medEntityMesh Entity,int **FamilyNumber);
+ bool build(MED_EN::medEntityMesh Entity,int **FamilyNumber);
inline void setIdentifier (int Identifier);
inline void setNumberOfAttributes (int NumberOfAttribute);
inline string getAttributeDescription(int i) const;
inline string getGroupName(int i) const;
};
-};
-using namespace MEDMEM;
// inline methods :
/*! Sets the attribute _identifier to Identifier. */
//----------------------------------------------
{
return _groupName[i-1] ;
}
+
+}//End namespace MEDMEM
#endif /* FAMILY_HXX */
-using namespace std;
#include "MEDMEM_Field.hxx"
#include "MEDMEM_Mesh.hxx"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
// ---------------------------------
// FIELD_ : Constructors
#include "MEDMEM_GenDriver.hxx"
#include "MEDMEM_DriverFactory.hxx"
-using namespace MED_EN;
-
/*!
This class contains all the informations related with a template class FIELD :
// template < > struct SET_VALUE_TYPE<double> { static const med_type_champ _valueType = MED_EN::MED_REEL64; }
// template < > struct SET_VALUE_TYPE<int> { static const med_type_champ _valueType = MED_EN::MED_INT32; }
// static const med_type_champ _valueType = SET_VALUE_TYPE <T>::_valueType;
- med_type_champ _valueType ;
+ MED_EN::med_type_champ _valueType ;
vector<GENDRIVER *> _drivers; // Storage of the drivers currently in use
static void _checkFieldCompatibility(const FIELD_& m, const FIELD_& n ) throw (MEDEXCEPTION);
inline void setOrderNumber(int OrderNumber);
inline int getOrderNumber() const;
- inline void setValueType (const med_type_champ ValueType) ;
- inline med_type_champ getValueType () const;
+ inline void setValueType (const MED_EN::med_type_champ ValueType) ;
+ inline MED_EN::med_type_champ getValueType () const;
};
-};
// ---------------------------------
// Implemented Methods : constructor
// ---------------------------------
-using namespace MEDMEM;
// -----------------
// Methodes Inline
/*!
Set FIELD number of components.
*/
-inline void FIELD_::setNumberOfComponents(int NumberOfComponents)
+inline void FIELD_::setNumberOfComponents(const int NumberOfComponents)
{
_numberOfComponents=NumberOfComponents;
}
It must be the same than in the associated SUPPORT object.
*/
-inline void FIELD_::setNumberOfValues(int NumberOfValues)
+inline void FIELD_::setNumberOfValues(const int NumberOfValues)
{
_numberOfValues=NumberOfValues;
}
/*!
Get the FIELD med value type (MED_INT32 or MED_REEL64).
*/
-inline med_type_champ FIELD_::getValueType () const
+inline MED_EN::med_type_champ FIELD_::getValueType () const
{
return _valueType ;
}
/*!
Set the FIELD med value type (MED_INT32 or MED_REEL64).
*/
-inline void FIELD_::setValueType (const med_type_champ ValueType)
+inline void FIELD_::setValueType (const MED_EN::med_type_champ ValueType)
{
_valueType = ValueType ;
}
+}//End namespace MEDMEM
+
/////////////////////////
// END OF CLASS FIELD_ //
/////////////////////////
MEDARRAY<T> *_value ;
private:
- void _operation(const FIELD& m,const FIELD& n, const medModeSwitch mode, char* Op);
+ void _operation(const FIELD& m,const FIELD& n, const MED_EN::medModeSwitch mode, char* Op);
void _operationInitialize(const FIELD& m,const FIELD& n, char* Op);
- void _add_in_place(const FIELD& m,const FIELD& n, const medModeSwitch mode);
- void _sub_in_place(const FIELD& m,const FIELD& n, const medModeSwitch mode);
- void _mul_in_place(const FIELD& m,const FIELD& n, const medModeSwitch mode);
- void _div_in_place(const FIELD& m,const FIELD& n, const medModeSwitch mode);
+ void _add_in_place(const FIELD& m,const FIELD& n, const MED_EN::medModeSwitch mode);
+ void _sub_in_place(const FIELD& m,const FIELD& n, const MED_EN::medModeSwitch mode);
+ void _mul_in_place(const FIELD& m,const FIELD& n, const MED_EN::medModeSwitch mode);
+ void _div_in_place(const FIELD& m,const FIELD& n, const MED_EN::medModeSwitch mode) throw (MEDEXCEPTION);
//setValueType() ;
FIELD & operator=(const FIELD &m); // A FAIRE
public:
FIELD();
FIELD(const FIELD &m);
- FIELD(const SUPPORT * Support, const int NumberOfComponents, const medModeSwitch Mode=MED_FULL_INTERLACE) throw (MEDEXCEPTION) ; // Ajout NB Constructeur FIELD avec allocation de memoire de tous ses attribut
+ FIELD(const SUPPORT * Support, const int NumberOfComponents, const MED_EN::medModeSwitch Mode=MED_EN::MED_FULL_INTERLACE) throw (MEDEXCEPTION) ; // Ajout NB Constructeur FIELD avec allocation de memoire de tous ses attribut
FIELD(const SUPPORT * Support, driverTypes driverType,
const string & fileName="", const string & fieldName="",
const int iterationNumber = -1, const int orderNumber = -1)
inline void setValue(MEDARRAY<T> *Value);
inline MEDARRAY<T>* getvalue() const;
- inline int getValueLength(medModeSwitch Mode) const;
- inline const T* getValue(medModeSwitch Mode) const;
- inline const T* getValueI(medModeSwitch Mode,int i) const;
+ inline int getValueLength(MED_EN::medModeSwitch Mode) const;
+ inline const T* getValue(MED_EN::medModeSwitch Mode) const;
+ inline const T* getValueI(MED_EN::medModeSwitch Mode,int i) const;
inline T getValueIJ(int i,int j) const;
- inline void setValue(medModeSwitch mode, T* value);
- inline void setValueI(medModeSwitch mode, int i, T* value);
+ inline void setValue(MED_EN::medModeSwitch mode, T* value);
+ inline void setValueI(MED_EN::medModeSwitch mode, int i, T* value);
inline void setValueIJ(int i, int j, T value);
/*!
*/
void getBarycenter() const throw (MEDEXCEPTION) ;
};
-};
// --------------------
// Implemented Methods
// --------------------
-using namespace MEDMEM;
/*!
Constructor with no parameter, most of the attribut members are set to NULL.
attribut is allocated but not set.
*/
template <class T> FIELD<T>::FIELD(const SUPPORT * Support,
- const int NumberOfComponents, const medModeSwitch Mode) throw (MEDEXCEPTION) :
+ const int NumberOfComponents, const MED_EN::medModeSwitch Mode) throw (MEDEXCEPTION) :
FIELD_(Support, NumberOfComponents)
{
BEGIN_OF("FIELD<T>::FIELD(const SUPPORT * Support, const int NumberOfComponents, const medModeSwitch Mode)");
FIELD_::_checkFieldCompatibility(*this, m); // may throw exception
// Select mode : avoid if possible any calculation of other mode for fields m or *this
- medModeSwitch mode;
+ MED_EN::medModeSwitch mode;
if(this->getvalue()->getMode()==m.getvalue()->getMode() || this->getvalue()->isOtherCalculated())
mode=m.getvalue()->getMode();
else
FIELD_::_checkFieldCompatibility(*this, m); // may throw exception
// We choose to keep *this mode, even if it may cost a re-calculation for m
- medModeSwitch mode=this->getvalue()->getMode();
+ MED_EN::medModeSwitch mode=this->getvalue()->getMode();
const T* value1=m.getValue(mode); // get pointers to the values we are adding
// get a non const pointer to the inside array of values and perform operation
FIELD_::_checkFieldCompatibility(m, n); // may throw exception
// Select mode : avoid if possible any calculation of other mode for fields m or *this
- medModeSwitch mode;
+ MED_EN::medModeSwitch mode;
if(m.getvalue()->getMode()==n.getvalue()->getMode() || n.getvalue()->isOtherCalculated())
mode=m.getvalue()->getMode();
else
BEGIN_OF("FIELD<T>::operator-(const FIELD & m)");
FIELD_::_checkFieldCompatibility(*this, m); // may throw exception
- // Select mode : avoid if possible any calculation of other mode for fields m or *this
- medModeSwitch mode;
+ MED_EN::medModeSwitch mode;
if(this->getvalue()->getMode()==m.getvalue()->getMode() || this->getvalue()->isOtherCalculated())
mode=m.getvalue()->getMode();
else
{
BEGIN_OF("FIELD<T>::operator-()");
- medModeSwitch mode=this->getvalue()->getMode();
+ MED_EN::medModeSwitch mode=this->getvalue()->getMode();
// Creation of the result - memory is allocated by FIELD constructor
FIELD<T> result(this->getSupport(),this->getNumberOfComponents(),mode);
// Atribute's initialization
FIELD_::_checkFieldCompatibility(*this, m); // may throw exception
// We choose to keep *this mode, even if it may cost a re-calculation for m
- medModeSwitch mode=this->getvalue()->getMode();
+ MED_EN::medModeSwitch mode=this->getvalue()->getMode();
const T* value1=m.getValue(mode); // get pointers to the values we are adding
// get a non const pointer to the inside array of values and perform operation
FIELD_::_checkFieldCompatibility(m, n); // may throw exception
// Select mode : avoid if possible any calculation of other mode for fields m or *this
- medModeSwitch mode;
+ MED_EN::medModeSwitch mode;
if(m.getvalue()->getMode()==n.getvalue()->getMode() || n.getvalue()->isOtherCalculated())
mode=m.getvalue()->getMode();
else
FIELD_::_checkFieldCompatibility(*this, m); // may throw exception
// Select mode : avoid if possible any calculation of other mode for fields m or *this
- medModeSwitch mode;
+ MED_EN::medModeSwitch mode;
if(this->getvalue()->getMode()==m.getvalue()->getMode() || this->getvalue()->isOtherCalculated())
mode=m.getvalue()->getMode();
else
FIELD_::_checkFieldCompatibility(*this, m); // may throw exception
// We choose to keep *this mode, even if it may cost a re-calculation for m
- medModeSwitch mode=this->getvalue()->getMode();
+ MED_EN::medModeSwitch mode=this->getvalue()->getMode();
const T* value1=m.getValue(mode); // get pointers to the values we are adding
// get a non const pointer to the inside array of values and perform operation
FIELD_::_checkFieldCompatibility(m, n); // may throw exception
// Select mode : avoid if possible any calculation of other mode for fields m or *this
- medModeSwitch mode;
+ MED_EN::medModeSwitch mode;
if(m.getvalue()->getMode()==n.getvalue()->getMode() || n.getvalue()->isOtherCalculated())
mode=m.getvalue()->getMode();
else
FIELD_::_checkFieldCompatibility(*this, m); // may throw exception
// Select mode : avoid if possible any calculation of other mode for fields m or *this
- medModeSwitch mode;
+ MED_EN::medModeSwitch mode;
if(this->getvalue()->getMode()==m.getvalue()->getMode() || this->getvalue()->isOtherCalculated())
mode=m.getvalue()->getMode();
else
FIELD_::_checkFieldCompatibility(*this, m); // may throw exception
// We choose to keep *this mode, even if it may cost a re-calculation for m
- medModeSwitch mode=this->getvalue()->getMode();
+ MED_EN::medModeSwitch mode=this->getvalue()->getMode();
const T* value1=m.getValue(mode); // get pointers to the values we are adding
// get a non const pointer to the inside array of values and perform operation
FIELD_::_checkFieldCompatibility(m, n); // may throw exception
// Select mode : avoid if possible any calculation of other mode for fields m or *this
- medModeSwitch mode;
+ MED_EN::medModeSwitch mode;
if(m.getvalue()->getMode()==n.getvalue()->getMode() || n.getvalue()->isOtherCalculated())
mode=m.getvalue()->getMode();
else
\endif
*/
template <class T>
-void FIELD<T>::_add_in_place(const FIELD& m,const FIELD& n, const medModeSwitch mode)
+void FIELD<T>::_add_in_place(const FIELD& m,const FIELD& n, const MED_EN::medModeSwitch mode)
{
// get pointers to the values we are adding
const T* value1=m.getValue(mode);
\endif
*/
template <class T>
-void FIELD<T>::_sub_in_place(const FIELD& m,const FIELD& n, const medModeSwitch mode)
+void FIELD<T>::_sub_in_place(const FIELD& m,const FIELD& n, const MED_EN::medModeSwitch mode)
{
// get pointers to the values we are adding
const T* value1=m.getValue(mode);
\endif
*/
template <class T>
-void FIELD<T>::_mul_in_place(const FIELD& m,const FIELD& n, const medModeSwitch mode)
+void FIELD<T>::_mul_in_place(const FIELD& m,const FIELD& n, const MED_EN::medModeSwitch mode)
{
// get pointers to the values we are adding
const T* value1=m.getValue(mode);
\endif
*/
template <class T>
-void FIELD<T>::_div_in_place(const FIELD& m,const FIELD& n, const medModeSwitch mode)
+void FIELD<T>::_div_in_place(const FIELD& m,const FIELD& n, const MED_EN::medModeSwitch mode) throw (MEDEXCEPTION)
{
// get pointers to the values we are adding
const T* value1=m.getValue(mode);
const int size=getNumberOfValues()*getNumberOfComponents();
SCRUTE(size);
const T* endV1=value1+size;
- for(;value1!=endV1; value1++,value2++,value++)
+ for(;value1!=endV1; value1++,value2++,value++){
+ if ( *value2 == 0 ) {
+ string diagnosis;
+ diagnosis="FIELD<T>::_div_in_place(...) : Divide by zero !";
+ throw MEDEXCEPTION(diagnosis.c_str());
+ }
*value=(*value1)/(*value2);
+ }
}
/*! Return Max Norm
template <class T> template <T T_function(T)>
void FIELD<T>::applyFunc()
{
- medModeSwitch mode=getvalue()->getMode();
+ MED_EN::medModeSwitch mode=getvalue()->getMode();
// get a non const pointer to the inside array of values and perform operation
T * value=const_cast<T *> (getValue(mode));
*/
template <class T> void FIELD<T>::applyLin(T a, T b)
{
- medModeSwitch mode=getvalue()->getMode();
+ MED_EN::medModeSwitch mode=getvalue()->getMode();
// get a non const pointer to the inside array of values and perform operation in place
T * value=const_cast<T *> (getValue(mode));
{
FIELD_::_checkFieldCompatibility( m, n); // may throw exception
// we need a MED_FULL_INTERLACE representation of m & n to compute the scalar product
- const medModeSwitch mode=MED_FULL_INTERLACE;
+ const MED_EN::medModeSwitch mode=MED_EN::MED_FULL_INTERLACE;
const int numberOfElements=m.getNumberOfValues(); // strictly positive
const int NumberOfComponents=m.getNumberOfComponents(); // strictly positive
/*!
Return the actual length of the reference to values array returned by getValue.
*/
-template <class T> inline int FIELD<T>::getValueLength(medModeSwitch Mode) const{
+template <class T> inline int FIELD<T>::getValueLength(MED_EN::medModeSwitch Mode) const{
return _numberOfComponents*_numberOfValues;
}
/*!
Return a reference to values array to read them.
*/
-template <class T> inline const T* FIELD<T>::getValue(medModeSwitch Mode) const
+template <class T> inline const T* FIELD<T>::getValue(MED_EN::medModeSwitch Mode) const
{
return _value->get(Mode) ;
}
Return a reference to i^{th} row or column - component - (depend on Mode value)
of FIELD values array.
*/
-template <class T> inline const T* FIELD<T>::getValueI(medModeSwitch Mode,int i) const
+template <class T> inline const T* FIELD<T>::getValueI(MED_EN::medModeSwitch Mode,int i) const
{
- if ( Mode == MED_FULL_INTERLACE )
+ if ( Mode == MED_EN::MED_FULL_INTERLACE )
{
return _value->getRow(i) ;
}
- ASSERT ( Mode == MED_NO_INTERLACE);
+ ASSERT ( Mode == MED_EN::MED_NO_INTERLACE);
return _value->getColumn(i);
}
Array must have right size. If not results are unpredicable.
*/
-template <class T> inline void FIELD<T>::setValue(medModeSwitch mode, T* value)
+template <class T> inline void FIELD<T>::setValue(MED_EN::medModeSwitch mode, T* value)
{
_value->set(mode,value);
}
/*!
Update values array in FIELD with the given ones according to specified mode.
*/
-template <class T> inline void FIELD<T>::setValueI(medModeSwitch mode, int i, T* value)
+template <class T> inline void FIELD<T>::setValueI(MED_EN::medModeSwitch mode, int i, T* value)
{
// PROVISOIRE :
- if (MED_FULL_INTERLACE == mode)
+ if (MED_EN::MED_FULL_INTERLACE == mode)
_value->setI(i,value);
- else if (MED_NO_INTERLACE == mode)
+ else if (MED_EN::MED_NO_INTERLACE == mode)
_value->setJ(i,value);
else
throw MEDEXCEPTION(LOCALIZED("FIELD<T>::setValueI : bad medModeSwitch")) ;
END_OF(LOC);
}
+}//End namespace MEDMEM
+
#endif /* FIELD_HXX */
-using namespace std;
#include "MEDMEM_GenDriver.hxx"
#include "MEDMEM_STRING.hxx"
#include "MEDMEM_Exception.hxx"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
GENDRIVER::GENDRIVER(): _id(MED_INVALID),
_fileName(""),
_status = genDriver._status;
_id = genDriver._id;
return *this;
-
- END_OF(LOC);
}
void GENDRIVER::writeFrom ( void ) {};
BEGIN_OF(LOC);
return _id ;
-
- END_OF(LOC);
};
string GENDRIVER::getFileName() const {
BEGIN_OF(LOC);
return _fileName;
-
- END_OF(LOC);
}
BEGIN_OF(LOC);
return _accessMode;
-
- END_OF(LOC);
}
ostream & MEDMEM::operator<<(ostream &os,const GENDRIVER & drv)
/* Generic Read/Write Driver Class for Meshes & Fields */
-
-using namespace MED_EN;
using namespace std;
/*!
// the MedMedDriver index of the driver vector in the MED object where it has been created
/*File related part*/
string _fileName; // The name of the file currently in use.
- med_mode_acces _accessMode; // The file access mode set by the adequate construtor.
+ MED_EN::med_mode_acces _accessMode; // The file access mode set by the adequate construtor.
int _status; // The file status {MED_INVALID, MED_OPENED, MED_CLOSED }
driverTypes _driverType; // A FAIRE LE POSITIONNER DS TOUTES LES SS CLASSES !!
/*!
Constructor.
*/
- GENDRIVER(const string & fileName,med_mode_acces accessMode);
+ GENDRIVER(const string & fileName,MED_EN::med_mode_acces accessMode);
/*!
Copy constructor.
*/
int getId ( void ) const ;
string getFileName () const;
void setFileName ( const string & fileName);
- med_mode_acces getAccessMode() const;
+ MED_EN::med_mode_acces getAccessMode() const;
};
};
-using namespace std;
-
#include <algorithm>
#include "MEDMEM_GibiMeshDriver.hxx"
#include "MEDMEM_DriverTools.hxx"
/////
+using namespace std;
using namespace MED_EN;
using namespace MEDMEM;
/////
while ( getline(_gibi, buf_ligne) ) // boucle externe de recherche de "ENREGISTREMENT DE TYPE"
{
string::size_type pos = buf_ligne.find(enregistrement_type);
- if ( pos==string::npos )
+ if ( pos==string::npos ){
continue; // "ENREGISTREMENT DE TYPE" non trouvé -> on lit la ligne suivante
-
+ }
// lecture du numéro d'enregistrement
int numero_enregistrement;
istringstream buf(buf_ligne.c_str()+strlen(enregistrement_type)+1);
{
// pour chacun des sous-maillages j, on recupere les iterateurs *k sur les maille
// contenues et on les insere dans le groupe i
- std::set< std::set<_maille>::iterator >::const_iterator k=medi.groupes[*j-1].mailles.begin();
+ std::set< std::set<_maille, std::less<_maille>,
+ std::allocator<_maille> >::iterator,
+ _mailleIteratorCompare,
+ std::allocator< std::set<_maille, std::less<_maille>,
+ std::allocator<_maille> >::iterator> >::iterator k=medi.groupes[*j-1].mailles.begin();
for( ; k!=medi.groupes[*j-1].mailles.end(); ++k)
i->mailles.insert(*k);
}
// tableau de correspondance des types géométriques de CASTEM -> MED
static const size_t nb_geometrie_gibi=47;
- static const medGeometryElement geomGIBItoMED[nb_geometrie_gibi];
+ static const MED_EN::medGeometryElement geomGIBItoMED[nb_geometrie_gibi];
/////
public :
*/
GIBI_MESH_DRIVER(const string & fileName,
MESH * ptrMesh,
- med_mode_acces accessMode) ;
+ MED_EN::med_mode_acces accessMode) ;
/*!
Copy constructor.
*/
-using namespace std;
// File : MEDMEM_Grid.hxx
// Created : Wed Dec 18 08:35:26 2002
// Descr : class containing structured mesh data
#include "MEDMEM_Grid.hxx"
#include "MEDMEM_CellModel.hxx"
#include "MEDMEM_SkyLineArray.hxx"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
//=======================================================================
//function : GRID
init();
MESSAGE("A GRID CREATED");
}
+//
+//=======================================================================
+////function : GRID
+////purpose : array constructor
+////=======================================================================
+GRID::GRID(const std::vector<std::vector<double> >& xyz_array,const std::vector<std::string>& coord_name,
+ const std::vector<std::string>& coord_unit, const med_grid_type type) : _gridType(type)
+{
+ _spaceDimension = xyz_array.size();
+
+ // compute & set _numberOfNodes
+ int NumberOfNodes=1 ;
+ for(int i=0;i!=xyz_array.size();++i)
+ NumberOfNodes*=xyz_array[i].size();
+ _numberOfNodes = NumberOfNodes ;
+
+ // create a non allocated COORDINATE
+ _coordinate = new COORDINATE(_spaceDimension, &coord_name[0], &coord_unit[0]);
+ string coordinateSystem = "UNDEFINED";
+ if( _gridType == MED_CARTESIAN)
+ coordinateSystem = "CARTESIAN";
+ else if ( _gridType == MED_POLAR)
+ coordinateSystem = "CYLINDRICAL";
+ _coordinate->setCoordinatesSystem(coordinateSystem);
+
+ // set the GRID part
+ if (_spaceDimension>=1)
+ {
+ _iArrayLength=xyz_array[0].size();
+ _iArray=new double[_iArrayLength];
+ std::copy(xyz_array[0].begin(),xyz_array[0].end(),_iArray);
+ }
+ if (_spaceDimension>=2)
+ {
+ _jArrayLength=xyz_array[1].size();
+ _jArray=new double[_jArrayLength];
+ std::copy(xyz_array[1].begin(),xyz_array[1].end(),_jArray);
+ }
+ if (_spaceDimension>=3)
+ {
+ _kArrayLength=xyz_array[2].size();
+ _kArray=new double[_kArrayLength];
+ std::copy(xyz_array[2].begin(),xyz_array[2].end(),_kArray);
+ }
+
+ _is_coordinates_filled = false;
+ _is_connectivity_filled = false;
+ _isAGrid = true;
+}
//=======================================================================
//function : GRID
END_OF(LOC);
};
+/*!
+ return the GRID Geometric type, without computing all connectivity
+*/
+const medGeometryElement * GRID::getTypes(medEntityMesh entity) const
+{
+ static const medGeometryElement _gridGeometry[4]={MED_HEXA8,MED_QUAD4,MED_SEG2,MED_POINT1};
+ int i=0;
+ if(entity==MED_CELL)
+ {
+ i=3-_spaceDimension;
+ }
+ else if(entity==MED_FACE && _spaceDimension>2 )
+ i=1;
+ else if(entity==MED_EDGE && _spaceDimension>1 )
+ i=2;
+ else if(entity==MED_NODE && _spaceDimension>0)
+ i=3;
+ else
+ throw MEDEXCEPTION(LOCALIZED("CONNECTIVITY::getGeometricTypes : Entity not defined !"));
+ return &_gridGeometry[i];
+}
+
//=======================================================================
//function : fillMeshAfterRead
//purpose :
void GRID::fillCoordinates() const
{
if (_is_coordinates_filled)
- {
- MESSAGE("GRID::fillCoordinates(): Already filled");
return;
- }
const char * LOC ="GRID::fillCoordinates()";
BEGIN_OF(LOC);
- double* myCoord =
- const_cast <double *> ( _coordinate->getCoordinates(MED_FULL_INTERLACE) );
+ // if coordonate has not been allocated, perform shalow copy, transfer ownership of matrix
+ if(_coordinate->getSpaceDimension()*_coordinate->getNumberOfNodes() == 0)
+ _coordinate->setCoordinates(new MEDARRAY<double>(_spaceDimension,_numberOfNodes,MED_FULL_INTERLACE),true);
+
+ double* myCoord = const_cast <double *> ( _coordinate->getCoordinates(MED_FULL_INTERLACE) );
bool hasJ = _jArrayLength, hasK = _kArrayLength;
int J = hasJ ? _jArrayLength : 1;
if (hasK)
{
- * myCoord = _jArray[ k ];
+ * myCoord = _kArray[ k ];
++ myCoord;
}
}
//purpose :
//=======================================================================
-CONNECTIVITY * GRID::makeConnectivity (const medEntityMesh Entity,
- const medGeometryElement Geometry,
- const int NbEntities,
- const int NbNodes,
- int * NodeNumbers)
+CONNECTIVITY * GRID::makeConnectivity (medEntityMesh Entity,
+ medGeometryElement Geometry,
+ int NbEntities,
+ int NbNodes,
+ int nbMeshNodes,
+ const int * NodeNumbers)
const
{
CONNECTIVITY * Connectivity = new CONNECTIVITY(Entity) ;
- Connectivity->_numberOfNodes = NbNodes ;
+ Connectivity->_numberOfNodes = nbMeshNodes ;
Connectivity->_entityDimension = Geometry/100 ;
int numberOfGeometricType = 1;
BEGIN_OF(LOC);
int nbCells, nbFaces, nbEdges;
- int nbCNodes, nbFNodes, nbENodes;
+ int nbCNodes, nbFNodes, nbENodes, nbMeshNodes;
int indexC, indexF, indexE;
int * nodeCNumbers, * nodeFNumbers, * nodeENumbers;
// about descending connectivity
// nb of cells and of their connectivity nodes
nbCells = iLenMin1 * jLenMin1 * kLenMin1;
+ nbMeshNodes = _iArrayLength * (_jArrayLength ? _jArrayLength : 1) * (_kArrayLength ? _kArrayLength : 1);
nbCNodes = nbCells * 2 * (hasEdges ? 2 : 1) * (hasFaces ? 2 : 1);
nodeCNumbers = new int [ nbCNodes ];
else aCellGeometry = MED_SEG2;
// nodal
- CellCNCT = makeConnectivity (MED_CELL, aCellGeometry, nbCells, nbCNodes, nodeCNumbers);
+ CellCNCT = makeConnectivity (MED_CELL, aCellGeometry, nbCells, nbCNodes, nbMeshNodes, nodeCNumbers);
delete [] nodeCNumbers;
// make connectivity for FACE and/or EDGE
if (hasFaces) {
- FaceCNCT = makeConnectivity (MED_FACE, MED_QUAD4, nbFaces, nbFNodes, nodeFNumbers);
+ FaceCNCT = makeConnectivity (MED_FACE, MED_QUAD4, nbFaces, nbFNodes, nbMeshNodes, nodeFNumbers);
delete [] nodeFNumbers;
CellCNCT->_constituent = FaceCNCT;
}
if (hasEdges) {
- EdgeCNCT = makeConnectivity (MED_EDGE, MED_SEG2, nbEdges, nbENodes, nodeENumbers);
+ EdgeCNCT = makeConnectivity (MED_EDGE, MED_SEG2, nbEdges, nbENodes, nbMeshNodes, nodeENumbers);
delete [] nodeENumbers;
//-----------------------//
// 1. grid type: MED_CARTESIAN, MED_POLAR, MED_BODY_FITTED
- med_grid_type _gridType;
+ MED_EN::med_grid_type _gridType;
// 2. node coordinates
// For MED_BODY_FITTED MESH::_coordinate is used
// Protected Methods
//-----------------------//
- CONNECTIVITY * makeConnectivity (const medEntityMesh Entity,
- const medGeometryElement Geometry,
- const int NbEntities, const int NbNodes,
- int * NodeNumbers) const ;
+ CONNECTIVITY * makeConnectivity (const MED_EN::medEntityMesh Entity, const MED_EN::medGeometryElement Geometry,
+ const int NbEntities, int NbNodes, int nbMeshNodes,
+ const int * NodeNumbers) const ;
// creates nodal connectivity
//-----------------------//
GRID();
- GRID(const med_grid_type type);
+ GRID(const MED_EN::med_grid_type type);
GRID(const GRID &m);
GRID( driverTypes driverType, const string & fileName="",const string & meshName="");
+ GRID(const std::vector<std::vector<double> >& xyz_array,const std::vector<std::string>& coord_name,
+ const std::vector<std::string>& coord_unit, const MED_EN::med_grid_type type=MED_EN::MED_CARTESIAN);
GRID & operator=(const GRID &m);
virtual ~GRID();
virtual void init();
// Access to fields
- inline med_grid_type getGridType() const;
+ inline MED_EN::med_grid_type getGridType() const;
// return MED_CARTESIAN, MED_POLAR or MED_BODY_FITTED
int getArrayLength( const int Axis ) const throw (MEDEXCEPTION);
inline const COORDINATE * getCoordinateptr() const;
- inline const double * getCoordinates(medModeSwitch Mode) const;
+ inline const double * getCoordinates(MED_EN::medModeSwitch Mode) const;
inline const double getCoordinate(int Number,int Axis) const;
- inline int getNumberOfTypes(medEntityMesh Entity) const;
+ inline int getNumberOfTypes(MED_EN::medEntityMesh Entity) const;
- inline const medGeometryElement * getTypes(medEntityMesh Entity) const;
+ inline const MED_EN::medGeometryElement * getTypes(MED_EN::medEntityMesh Entity) const;
- inline const CELLMODEL * getCellsTypes(medEntityMesh Entity) const;
+ inline const CELLMODEL * getCellsTypes(MED_EN::medEntityMesh Entity) const;
- const int * getGlobalNumberingIndex(medEntityMesh Entity) const;
+ const int * getGlobalNumberingIndex(MED_EN::medEntityMesh Entity) const;
- inline int getNumberOfElements(medEntityMesh Entity,
- medGeometryElement Type) const;
+ inline int getNumberOfElements(MED_EN::medEntityMesh Entity,
+ MED_EN::medGeometryElement Type) const;
- inline bool existConnectivity(medConnectivity ConnectivityType,
- medEntityMesh Entity) const;
+ inline bool existConnectivity(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity) const;
- inline medGeometryElement getElementType(medEntityMesh Entity,
+ inline MED_EN::medGeometryElement getElementType(MED_EN::medEntityMesh Entity,
int Number) const;
- inline void calculateConnectivity(medModeSwitch Mode,
- medConnectivity ConnectivityType,
- medEntityMesh Entity) const ;
+ inline void calculateConnectivity(MED_EN::medModeSwitch Mode,
+ MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity) const ;
inline const CONNECTIVITY* getConnectivityptr() const;
- inline const int * getConnectivity(medModeSwitch Mode,
- medConnectivity ConnectivityType,
- medEntityMesh Entity,
- medGeometryElement Type) const;
+ inline const int * getConnectivity(MED_EN::medModeSwitch Mode,
+ MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity,
+ MED_EN::medGeometryElement Type) const;
- inline const int * getConnectivityIndex(medConnectivity ConnectivityType,
- medEntityMesh Entity) const;
+ inline const int * getConnectivityIndex(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity) const;
- inline const int * getReverseConnectivity(medConnectivity ConnectivityType,
- medEntityMesh Entity=MED_CELL) const;
+ inline const int * getReverseConnectivity(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity=MED_EN::MED_CELL) const;
- inline const int * getReverseConnectivityIndex(medConnectivity ConnectivityType,
- medEntityMesh Entity=MED_CELL) const;
+ inline const int * getReverseConnectivityIndex(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity=MED_EN::MED_CELL) const;
// Setting fields
- inline void setGridType(med_grid_type gridType);
+ inline void setGridType(MED_EN::med_grid_type gridType);
friend class MED_MESH_RDONLY_DRIVER;
friend class MED_MESH_WRONLY_DRIVER;
};
-};
-using namespace MEDMEM;
//----------------------------------//
// Inline Methods Implementation
//----------------------------------//
-inline med_grid_type GRID::getGridType() const
+inline MED_EN::med_grid_type GRID::getGridType() const
{
return _gridType;
}
//purpose : set the _gridType field od the class GRID
//=======================================================================
-inline void GRID::setGridType(med_grid_type gridType)
+inline void GRID::setGridType(MED_EN::med_grid_type gridType)
{
_gridType = gridType;
}
- MED_NO_INTERLACE : X1 X2 Y1 Y2 Z1 Z2
- MED_FULL_INTERLACE : X1 Y1 Z1 X2 Y2 Z2
*/
-inline const double * GRID::getCoordinates(medModeSwitch Mode) const
+inline const double * GRID::getCoordinates(MED_EN::medModeSwitch Mode) const
{
fillCoordinates();
return _coordinate->getCoordinates(Mode);
medEntityMesh entity : MED_CELL, MED_FACE, MED_EDGE, MED_NODE,
MED_ALL_ENTITIES
- If entity is not defined, return 0.
-
- If there is no connectivity, return an exception.
*/
-inline int GRID::getNumberOfTypes(medEntityMesh entity) const
+inline int GRID::getNumberOfTypes(MED_EN::medEntityMesh entity) const
{
MESSAGE("GRID::getNumberOfTypes(medEntityMesh entity) : "<<entity);
- if (entity == MED_NODE)
- return 1;
-
- fillConnectivity();
-
- if (_connectivity != NULL)
- return _connectivity->getNumberOfTypes(entity);
- throw MEDEXCEPTION(LOCALIZED("GRID::getNumberOfTypes( medEntityMesh ) : Connectivity not defined !"));
-}
-
-/*!
- Get the list of geometric types used by a given entity.
- medEntityMesh entity : MED_CELL, MED_FACE, MED_EDGE, MED_ALL_ENTITIES
-
- REM : Don't use MED_NODE
-
- If entity is not defined, return an exception.
-*/
-inline const medGeometryElement * GRID::getTypes(medEntityMesh entity) const
-{
- if (entity == MED_NODE)
- throw MEDEXCEPTION(LOCALIZED("GRID::getTypes( medEntityMesh ) : No medGeometryElement with MED_NODE entity !"));
- // return un tableau de taille 1 contenant MED_NONE, comme les supports pour etre coherent avec getNumberOfTypes ???? PG
-
- fillConnectivity();
-
- if (_connectivity != NULL)
- return _connectivity->getGeometricTypes(entity);
- throw MEDEXCEPTION(LOCALIZED("GRID::getTypes( medEntityMesh ) : Connectivity not defined !"));
+ return 1; // a grid has one type
}
/*!
REMARK : Don't use MED_NODE as medEntityMesh
*/
-inline const CELLMODEL * GRID::getCellsTypes(medEntityMesh Entity) const
+inline const CELLMODEL * GRID::getCellsTypes(MED_EN::medEntityMesh Entity) const
{
fillConnectivity();
- GlobalNumberingIndex[1]=6 (the second type)
- GlobalNumberingIndex[2]=10
*/
-inline const int * GRID::getGlobalNumberingIndex(medEntityMesh entity) const
+inline const int * GRID::getGlobalNumberingIndex(MED_EN::medEntityMesh entity) const
{
fillConnectivity();
/*!
Return the number of element of given geometric type of given entity. Return 0 if query is not defined.
-
- Example :
- - getNumberOfElements(MED_NODE,MED_NONE) : number of node
- - getNumberOfElements(MED_NODE,MED_TRIA3) : return 0 (not defined)
- - getNumberOfElements(MED_FACE,MED_TRIA3) : return number of triangles
- elements defined in face entity (0 if not defined)
- - getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS) : return total number
- of elements defined in cell entity
*/
-inline int GRID::getNumberOfElements(medEntityMesh entity, medGeometryElement Type) const
+inline int GRID::getNumberOfElements(MED_EN::medEntityMesh entity, MED_EN::medGeometryElement Type) const
{
- // const char * LOC = "MESH::getNumberOfElements(medEntityMesh,medGeometryElement) : ";
- if (entity==MED_NODE)
- if ((Type==MED_NONE)|(Type==MED_ALL_ELEMENTS))
- return _numberOfNodes;
- else
- return 0;
- //throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"wrong medGeometryElement with MED_NODE"));
- else
- {
- fillConnectivity();
-
- if (_connectivity != (CONNECTIVITY*)NULL)
- return _connectivity->getNumberOf(entity,Type);
- else
- return 0;
- //throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"connectivity not defined !"));
- }
+ int numberOfElements=0;
+
+ // Cas où le nombre d'éléments n'est pas nul
+ if (entity==MED_EN::MED_FACE && (Type==MED_EN::MED_QUAD4 || Type==MED_EN::MED_ALL_ELEMENTS) && _spaceDimension>2)
+ numberOfElements=(_iArrayLength-1)*(_jArrayLength-1);
+
+ else if (entity==MED_EN::MED_EDGE && (Type==MED_EN::MED_SEG2 || Type==MED_EN::MED_ALL_ELEMENTS) && _spaceDimension>1)
+ numberOfElements=_iArrayLength-1;
+
+ else if (entity==MED_EN::MED_NODE && (Type==MED_EN::MED_NONE || Type==MED_EN::MED_ALL_ELEMENTS) && _spaceDimension>0)
+ numberOfElements=_numberOfNodes;
+
+ else if (entity==MED_EN::MED_CELL && _spaceDimension==3 && (Type==MED_EN::MED_HEXA8 || Type==MED_EN::MED_ALL_ELEMENTS) )
+ numberOfElements=(_iArrayLength-1)*(_jArrayLength-1)*(_kArrayLength-1);
+
+ else if (entity==MED_EN::MED_CELL && _spaceDimension==2 && (Type==MED_EN::MED_QUAD4 || Type==MED_EN::MED_ALL_ELEMENTS))
+ numberOfElements=(_iArrayLength-1)*(_jArrayLength-1);
+
+ else if (entity==MED_EN::MED_CELL && _spaceDimension==1 && (Type==MED_EN::MED_SEG2 || Type==MED_EN::MED_ALL_ELEMENTS) )
+ numberOfElements=_iArrayLength-1;
+
+ MESSAGE("GRID::getNumberOfElements - entity=" << entity << " Type=" << Type);
+ MESSAGE("_spaceDimension=" << _spaceDimension << " numberOfElements=" << numberOfElements);
+
+ return numberOfElements;
}
+
/*!
Return true if the wanted connectivity exist, else return false
(to use before a getSomething method).
*/
-inline bool GRID::existConnectivity(medConnectivity connectivityType, medEntityMesh entity) const
+inline bool GRID::existConnectivity(MED_EN::medConnectivity connectivityType, MED_EN::medEntityMesh entity) const
{
fillConnectivity();
Throw an exception if Entity is not defined or Number are wrong (too big).
*/
-inline medGeometryElement GRID::getElementType(medEntityMesh Entity,int Number) const
+inline MED_EN::medGeometryElement GRID::getElementType(MED_EN::medEntityMesh Entity,int Number) const
{
fillConnectivity();
done. Do nothing if connectivity already exist.
*/
-inline void GRID::calculateConnectivity(medModeSwitch Mode,medConnectivity ConnectivityType,medEntityMesh entity) const
+inline void GRID::calculateConnectivity(MED_EN::medModeSwitch Mode,MED_EN::medConnectivity ConnectivityType,MED_EN::medEntityMesh entity) const
{
fillConnectivity();
- if (Mode==MED_FULL_INTERLACE)
+ if (Mode==MED_EN::MED_FULL_INTERLACE)
_connectivity->calculateConnectivity(ConnectivityType,entity);
else
throw MEDEXCEPTION(LOCALIZED("GRID::calculateConnectivity : only for MED_FULL_INTERLACE mode"));
and Type=MED_ALL_ELEMENTS.
You must also get the corresponding index array.
*/
-inline const int * GRID::getConnectivity(medModeSwitch Mode,medConnectivity ConnectivityType,medEntityMesh entity, medGeometryElement Type) const
+inline const int * GRID::getConnectivity(MED_EN::medModeSwitch Mode,MED_EN::medConnectivity ConnectivityType,MED_EN::medEntityMesh entity, MED_EN::medGeometryElement Type) const
{
fillConnectivity();
- if (Mode==MED_FULL_INTERLACE)
+ if (Mode==MED_EN::MED_FULL_INTERLACE)
return _connectivity->getConnectivity(ConnectivityType,entity,Type);
throw MEDEXCEPTION(LOCALIZED("GRID::getConnectivity : only for MED_FULL_INTERLACE mode"));
}
in Connectivity array (Connectivity[ConnectivityIndex[i-1]-1] is the
first value)
*/
-inline const int * GRID::getConnectivityIndex(medConnectivity ConnectivityType,medEntityMesh entity) const
+inline const int * GRID::getConnectivityIndex(MED_EN::medConnectivity ConnectivityType,MED_EN::medEntityMesh entity) const
{
fillConnectivity();
You must get ReverseConnectivityIndex array to use it.
*/
-inline const int * GRID::getReverseConnectivity(medConnectivity ConnectivityType,medEntityMesh Entity/*=MED_CELL*/) const
+inline const int * GRID::getReverseConnectivity(MED_EN::medConnectivity ConnectivityType,MED_EN::medEntityMesh Entity/*=MED_CELL*/) const
{
fillConnectivity();
ReverseConnectivity[ReverseConnectivityIndex[i-1]-1]
is the first value)
*/
-inline const int * GRID::getReverseConnectivityIndex(medConnectivity ConnectivityType,medEntityMesh Entity/*=MED_CELL*/) const
+inline const int * GRID::getReverseConnectivityIndex(MED_EN::medConnectivity ConnectivityType,MED_EN::medEntityMesh Entity/*=MED_CELL*/) const
{
fillConnectivity();
return _connectivity->getReverseConnectivityIndex(ConnectivityType,Entity);
}
+}
+
#endif
-using namespace std;
/*
File Group.cxx
$Header$
#include "MEDMEM_Group.hxx"
#include "MEDMEM_Family.hxx"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
GROUP::GROUP():_numberOfFamilies(0),_family()
{
SCRUTE(numberOfFamilies);
- if ((numberOfFamilies==1) || (isOnAllElts))
+ if ((numberOfFamilies==1) && (isOnAllElts))
{
_numberOfFamilies = numberOfFamilies;
_isOnAllElts = isOnAllElts ;
update();
return;
}
- else if ((!(numberOfFamilies==1))&(isOnAllElts))
+ else if ((!(numberOfFamilies==1)) && (isOnAllElts))
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) << "building of a GROUP object from several FAMILY, and one of them is on all entities" )) ;
_numberOfGeometricType = myFamily->getNumberOfTypes() ;
inline FAMILY * getFamily(int i) const ;
};
-};
// inline method :
-using namespace MEDMEM;
/*! set the attribut _numberOfFamilies to numberOfFamilies */
//----------------------------------------------------------
{
return _family[i-1];
};
-
+}//End namespace MEDMEM
#endif /* GROUP_HXX */
-using namespace std;
# include <string>
# include "MEDMEM_Med.hxx"
# include "MEDMEM_Exception.hxx"
# include "utilities.h"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
/*!
Constructor.
if ( (*currentField).first != NULL) MESSAGE(" " << ((*currentField).first)->getName().c_str());
}
- map<MESH_NAME_, map<MED_FR::med_entite_maillage,SUPPORT *> >::iterator itSupportOnMesh ;
+ map<MESH_NAME_, map<MED_EN::medEntityMesh,SUPPORT *> >::iterator itSupportOnMesh ;
index = 0;
for ( itSupportOnMesh=_support.begin();itSupportOnMesh != _support.end(); itSupportOnMesh++ ) {
- map<MED_FR::med_entite_maillage,SUPPORT *>::iterator itSupport ;
+ map<MED_EN::medEntityMesh,SUPPORT *>::iterator itSupport ;
for ( itSupport=(*itSupportOnMesh).second.begin();itSupport!=(*itSupportOnMesh).second.end();itSupport++)
index++;
}
}
}
}
- // map<MESH_NAME_, map<MED_FR::med_entite_maillage,SUPPORT *> >::iterator itSupportOnMesh ;
+ // map<MESH_NAME_, map<MED_EN::medEntityMesh,SUPPORT *> >::iterator itSupportOnMesh ;
for ( itSupportOnMesh=_support.begin();itSupportOnMesh != _support.end(); itSupportOnMesh++ ) {
- map<MED_FR::med_entite_maillage,SUPPORT *>::iterator itSupport ;
+ map<MED_EN::medEntityMesh,SUPPORT *>::iterator itSupport ;
for ( itSupport=(*itSupportOnMesh).second.begin();itSupport!=(*itSupportOnMesh).second.end();itSupport++)
delete (*itSupport).second ;
}
<< _drivers.size()
)
);
- END_OF(LOC);
}
/*!
BEGIN_OF(LOC);
return _meshes.size();
-
- END_OF(LOC);
};
/*!
BEGIN_OF(LOC);
return _fields.size(); // we get number of field with different name
-
- END_OF(LOC);
};
/*!
// };
/*!
- Return a map<MED_FR::med_entite_maillage,SUPPORT*> which contain
+ Return a map<MED_EN::medEntityMesh,SUPPORT*> which contain
foreach entity, a reference to the SUPPORT on all elements.
*/
-const map<MED_FR::med_entite_maillage,SUPPORT*> & MED::getSupports(const string & meshName) const
+const map<MED_EN::medEntityMesh,SUPPORT*> & MED::getSupports(const string & meshName) const
throw (MED_EXCEPTION)
{
const char * LOC = "MED::getSupports ( const string ) const : ";
BEGIN_OF(LOC);
- map<MESH_NAME_, map<MED_FR::med_entite_maillage,SUPPORT *> >::const_iterator itSupportOnMesh = _support.find(meshName) ;
+ map<MESH_NAME_, map<MED_EN::medEntityMesh,SUPPORT *> >::const_iterator itSupportOnMesh = _support.find(meshName) ;
if ( itSupportOnMesh == _support.end() )
throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
Return a reference to the SUPPORT object on all elements of entity
for the MESH named meshName.
*/
-SUPPORT * MED::getSupport (const string & meshName,MED_FR::med_entite_maillage entity) const
+SUPPORT * MED::getSupport (const string & meshName,MED_EN::medEntityMesh entity) const
throw (MED_EXCEPTION)
{
- const char * LOC = "MED::getSupport ( const string, MED_FR::med_entite_maillage ) const : ";
+ const char * LOC = "MED::getSupport ( const string, MED_EN::medEntityMesh ) const : ";
BEGIN_OF(LOC);
int index = 0;
- for (map<MESH_NAME_, map<MED_FR::med_entite_maillage,SUPPORT *> >::const_iterator const_itSupportOnMesh=_support.begin(); const_itSupportOnMesh != _support.end();
+ for (map<MESH_NAME_, map<MED_EN::medEntityMesh,SUPPORT *> >::const_iterator const_itSupportOnMesh=_support.begin(); const_itSupportOnMesh != _support.end();
const_itSupportOnMesh++ )
{
- map<MED_FR::med_entite_maillage,SUPPORT *>::const_iterator const_itSupport ;
+ map<MED_EN::medEntityMesh,SUPPORT *>::const_iterator const_itSupport ;
for (const_itSupport=(*const_itSupportOnMesh).second.begin();
const_itSupport!=(*const_itSupportOnMesh).second.end();const_itSupport++) index++;
}
MESSAGE(LOC << "In this MED object there is(are) " << index << " support(s):");
- for (map<MESH_NAME_, map<MED_FR::med_entite_maillage,SUPPORT *> >::const_iterator const_itSupportOnMesh=_support.begin();const_itSupportOnMesh != _support.end(); const_itSupportOnMesh++ )
+ for (map<MESH_NAME_, map<MED_EN::medEntityMesh,SUPPORT *> >::const_iterator const_itSupportOnMesh=_support.begin();const_itSupportOnMesh != _support.end(); const_itSupportOnMesh++ )
{
- map<MED_FR::med_entite_maillage,SUPPORT *>::const_iterator const_itSupport ;
+ map<MED_EN::medEntityMesh,SUPPORT *>::const_iterator const_itSupport ;
for (const_itSupport=(*const_itSupportOnMesh).second.begin();
const_itSupport!=(*const_itSupportOnMesh).second.end();const_itSupport++)
{
}
- map<MESH_NAME_, map<MED_FR::med_entite_maillage,SUPPORT *> >::const_iterator const_itSupportOnMesh = _support.find(meshName) ;
+ map<MESH_NAME_, map<MED_EN::medEntityMesh,SUPPORT *> >::const_iterator const_itSupportOnMesh = _support.find(meshName) ;
if ( const_itSupportOnMesh == _support.end() )
throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
)
);
-// map<MED_FR::med_entite_maillage,SUPPORT *> & SupportOnMesh = (map<MED_FR::med_entite_maillage,SUPPORT *>&) ((*itSupportOnMesh).second) ;
-// map<MED_FR::med_entite_maillage,SUPPORT *>::const_iterator itSupport = SupportOnMesh.find(entity) ;
+// map<MED_EN::medEntityMesh,SUPPORT *> & SupportOnMesh = (map<MED_EN::medEntityMesh,SUPPORT *>&) ((*itSupportOnMesh).second) ;
+// map<MED_EN::medEntityMesh,SUPPORT *>::const_iterator itSupport = SupportOnMesh.find(entity) ;
// if (itSupport == SupportOnMesh.end() )
// throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
// );
- map<MED_FR::med_entite_maillage,SUPPORT *> SupportOnMesh = ((*const_itSupportOnMesh).second);
+ map<MED_EN::medEntityMesh,SUPPORT *> SupportOnMesh = ((*const_itSupportOnMesh).second);
- map<MED_FR::med_entite_maillage,SUPPORT *>::const_iterator itSupport = SupportOnMesh.find(entity) ;
+ map<MED_EN::medEntityMesh,SUPPORT *>::const_iterator itSupport = SupportOnMesh.find(entity) ;
if (itSupport == SupportOnMesh.end() )
throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
const char * LOC = "MED::updateSupport () : ";
BEGIN_OF(LOC);
- map<MESH_NAME_, map<MED_FR::med_entite_maillage,SUPPORT *> >::iterator itSupportOnMesh ;
+ map<MESH_NAME_, map<MED_EN::medEntityMesh,SUPPORT *> >::iterator itSupportOnMesh ;
for ( itSupportOnMesh=_support.begin();itSupportOnMesh != _support.end(); itSupportOnMesh++ ) {
- map<MED_FR::med_entite_maillage,SUPPORT *>::iterator itSupport ;
+ map<MED_EN::medEntityMesh,SUPPORT *>::iterator itSupport ;
for ( itSupport=(*itSupportOnMesh).second.begin();itSupport!=(*itSupportOnMesh).second.end();itSupport++)
try {
(*itSupport).second->update() ;
_meshes [meshName] = ptrMesh; // if it already exists it is replaced
// int numberOfTypes = ptrSupport->getNumberOfTypes(); !! UNUSED VARIABLE !!
- _support [meshName][ (MED_FR::med_entite_maillage) ptrSupport->getEntity()] = ptrSupport;// if it already exists it is replaced
+ _support [meshName][ptrSupport->getEntity()] = ptrSupport;// if it already exists it is replaced
END_OF(LOC);
# include "MEDMEM_Exception.hxx"
# include "MEDMEM_GenDriver.hxx"
-using namespace MED_EN;
-
namespace MEDMEM {
class MESH;
// in order to get the MESH* from _meshes
// POURQUOI MED_FR::med_entite_maillage ? devrait être MED_EN !
- map < MESH_NAME_, map <MED_FR::med_entite_maillage,SUPPORT * > > _support ;
+ map < MESH_NAME_, map < MED_EN::medEntityMesh, SUPPORT * > > _support ;
// For each MESH, we list support for each entity on all elements.
vector<GENDRIVER *> _drivers; // Storage of the MED_MED drivers currently in use
FIELD_ * getField ( const string & fieldName,
const int dt, const int it) const throw (MEDEXCEPTION) ;
- const map<MED_FR::med_entite_maillage,SUPPORT *> & getSupports(const string & meshName) const throw (MEDEXCEPTION) ;
+ const map<MED_EN::medEntityMesh,SUPPORT *> & getSupports(const string & meshName) const throw (MEDEXCEPTION) ;
- SUPPORT * getSupport (const string & meshName,MED_FR::med_entite_maillage entity) const throw (MEDEXCEPTION) ;
+ SUPPORT * getSupport (const string & meshName,MED_EN::medEntityMesh entity) const throw (MEDEXCEPTION) ;
void updateSupport () ;
//#include "MEDMEM_Field.hxx"
#include "MEDMEM_Mesh.hxx"
-//using namespace MED_FR ;
-
namespace MEDMEM {
template <class T> class FIELD;
protected:
FIELD<T> * _ptrField;
- MED_FR::med_idt _medIdt;
+ med_2_1::med_idt _medIdt;
string _fieldName;
int _fieldNum;
Constructor.
*/
MED_FIELD_DRIVER(const string & fileName, FIELD<T> * ptrField,
- med_mode_acces accessMode)
+ MED_EN::med_mode_acces accessMode)
: GENDRIVER(fileName,accessMode),
_ptrField((FIELD<T> *) ptrField),_medIdt(MED_INVALID),
_fieldName(fileName),_fieldNum(MED_INVALID)
);
MESSAGE(LOC<<"_fileName.c_str : "<< _fileName.c_str()<<",mode : "<< _accessMode);
- _medIdt = MED_FR::MEDouvrir( (const_cast <char *> (_fileName.c_str())),(MED_FR::med_mode_acces) _accessMode);
+ _medIdt = med_2_1::MEDouvrir( (const_cast <char *> (_fileName.c_str())),(med_2_1::med_mode_acces) _accessMode);
MESSAGE(LOC<<"_medIdt : "<< _medIdt );
if (_medIdt > 0)
_status=MED_OPENED;
void close() {
BEGIN_OF("MED_FIELD_DRIVER::close()");
- MED_FR::med_int err = 0;
+ med_2_1::med_int err = 0;
if (_status == MED_OPENED) {
- err=MED_FR::MEDfermer(_medIdt);
+ err=med_2_1::MEDfermer(_medIdt);
//H5close(); // If we call H5close() all the files are closed.
_status = MED_CLOSED;
_medIdt = MED_INVALID;
Constructor.
*/
MED_FIELD_RDWR_DRIVER(const string & fileName, FIELD<T> * ptrField):
- MED_FIELD_DRIVER<T>(fileName,ptrField,MED_RDWR)
+ MED_FIELD_DRIVER<T>(fileName,ptrField,MED_EN::MED_RDWR)
{
BEGIN_OF("MED_FIELD_RDWR_DRIVER::MED_FIELD_RDWR_DRIVER(const string & fileName, const FIELD<T> * ptrField)");
//_accessMode = MED_RDWR ;
GENDRIVER * copy( void ) const ;
};
-}
/*-------------------------*/
/* template implementation */
/*-------------------------*/
-
-using namespace MEDMEM;
/*--------------------- DRIVER PART -------------------------------*/
template <class T> void MED_FIELD_DRIVER<T>::setFieldName(const string & fieldName)
// int numberOfComponents = 0;
// char * componentName = (char *) MED_NULL;
// char * unitName = (char *) MED_NULL;
-// MED_FR::med_type_champ type ;
-// numberOfFields = MED_FR::MEDnChamp(_medIdt,0) ;
+// med_2_1::med_type_champ type ;
+// numberOfFields = med_2_1::MEDnChamp(_medIdt,0) ;
// if ( numberOfFields <= 0 )
// throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<": No Field found !"));
// for (int i=1;i<=numberOfFields;i++) {
-// numberOfComponents = MED_FR::MEDnChamp(_medIdt,i) ;
+// numberOfComponents = med_2_1::MEDnChamp(_medIdt,i) ;
// if ( numberOfComponents <= 0 )
// throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
// << "Be careful there is no compound for field n°"
// componentName = new char[numberOfComponents*MED_TAILLE_PNOM+1] ;
// unitName = new char[numberOfComponents*MED_TAILLE_PNOM+1] ;
-// err = MED_FR::MEDchampInfo(_medIdt, i, fieldName, &type, componentName,
+// err = med_2_1::MEDchampInfo(_medIdt, i, fieldName, &type, componentName,
// unitName, numberOfComponents) ;
// delete[] componentName ;
int numberOfComponents = 0;
char * componentName = (char *) MED_NULL;
char * unitName = (char *) MED_NULL;
- MED_FR::med_type_champ type ;
+ med_2_1::med_type_champ type ;
// we search the field number !!!!
if (MED_FIELD_DRIVER<T>::_fieldNum==MED_INVALID) {
int numberOfFields = 0; //MED_INVALID
- numberOfFields = MED_FR::MEDnChamp(MED_FIELD_DRIVER<T>::_medIdt,0) ;
+ numberOfFields = med_2_1::MEDnChamp(MED_FIELD_DRIVER<T>::_medIdt,0) ;
if ( numberOfFields <= 0 )
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<": No Field found !"));
for (int i=1;i<=numberOfFields;i++) {
- numberOfComponents = MED_FR::MEDnChamp(MED_FIELD_DRIVER<T>::_medIdt,i) ;
+ numberOfComponents = med_2_1::MEDnChamp(MED_FIELD_DRIVER<T>::_medIdt,i) ;
if ( numberOfComponents <= 0 )
// throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
// << "Be careful there is no compound for field n°"
componentName = new char[numberOfComponents*MED_TAILLE_PNOM+1] ;
unitName = new char[numberOfComponents*MED_TAILLE_PNOM+1] ;
- err = MED_FR::MEDchampInfo(MED_FIELD_DRIVER<T>::_medIdt, i, fieldName, &type, componentName,
+ err = med_2_1::MEDchampInfo(MED_FIELD_DRIVER<T>::_medIdt, i, fieldName, &type, componentName,
unitName, numberOfComponents) ;
MESSAGE("Champ "<<i<<" : #" << fieldName <<"# et recherche #"<<MED_FIELD_DRIVER<T>::_fieldName.c_str()<<"#");
MESSAGE ("FieldNum : "<<MED_FIELD_DRIVER<T>::_fieldNum);
// int err ;
- // int NumberOfComponents = MED_FR::MEDnChamp(MED_FIELD_DRIVER<T>::_medIdt,MED_FIELD_DRIVER<T>::_fieldNum) ;
+ // int NumberOfComponents = med_2_1::MEDnChamp(MED_FIELD_DRIVER<T>::_medIdt,MED_FIELD_DRIVER<T>::_fieldNum) ;
if (numberOfComponents < 1)
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"no component")) ; // use iostring !
// test type to check if it is rigth !!!???
// read values for each geometric type in _support
int NumberOfTypes = MED_FIELD_DRIVER<T>::_ptrField->_support->getNumberOfTypes() ;
- const medGeometryElement *Types = MED_FIELD_DRIVER<T>::_ptrField->_support->getTypes() ;
+ const MED_EN::medGeometryElement *Types = MED_FIELD_DRIVER<T>::_ptrField->_support->getTypes() ;
T ** myValues = new T*[NumberOfTypes] ;
int * NumberOfValues = new int[NumberOfTypes] ;
int TotalNumberOfValues = 0 ;
NumberOfValues[i] =
MEDnVal(MED_FIELD_DRIVER<T>::_medIdt,
const_cast <char*> (MED_FIELD_DRIVER<T>::_fieldName.c_str()),
- (MED_FR::med_entite_maillage)MED_FIELD_DRIVER<T>::_ptrField->_support->getEntity(),
- (MED_FR::med_geometrie_element)Types[i],
+ (med_2_1::med_entite_maillage)MED_FIELD_DRIVER<T>::_ptrField->_support->getEntity(),
+ (med_2_1::med_geometrie_element)Types[i],
MED_FIELD_DRIVER<T>::_ptrField->_iterationNumber,
MED_FIELD_DRIVER<T>::_ptrField->_orderNumber) ; // no time step ! prend en compte le nbre de pt de gauss
// test if NumberOfValues is the same in _support !!! TODO that !!
MESSAGE ("NumberOfComponents :"<< numberOfComponents);
MESSAGE ("MESH_NAME :"<< MeshName.c_str());
MESSAGE ("FIELD_NAME :"<< MED_FIELD_DRIVER<T>::_fieldName.c_str());
- MESSAGE ("MED_ENTITE :"<< (MED_FR::med_entite_maillage) MED_FIELD_DRIVER<T>::_ptrField->_support->getEntity());
- MESSAGE("MED_GEOM :"<<(MED_FR::med_geometrie_element)Types[i]);
+ MESSAGE ("MED_ENTITE :"<< (med_2_1::med_entite_maillage) MED_FIELD_DRIVER<T>::_ptrField->_support->getEntity());
+ MESSAGE("MED_GEOM :"<<(med_2_1::med_geometrie_element)Types[i]);
MESSAGE("Iteration :"<<MED_FIELD_DRIVER<T>::_ptrField->getIterationNumber());
MESSAGE("Order :"<<MED_FIELD_DRIVER<T>::_ptrField->getOrderNumber());
MED_FIELD_DRIVER<T>::_ptrField->_numberOfValues+=NumberOfValues[i]; // problem with gauss point : _numberOfValues != TotalNumberOfValues !!!!!!!
- if ( MED_FR::MEDchampLire(MED_FIELD_DRIVER<T>::_medIdt,const_cast <char*> (MeshName.c_str()),
+ med_2_1::med_err ret;
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ int lgth2=NumberOfValues[i]*numberOfComponents;
+ if(_ptrField->getValueType()==MED_EN::MED_INT32)
+ {
+ med_2_1::med_int *temp=new med_2_1::med_int[lgth2];
+ ret=med_2_1::MEDchampLire(MED_FIELD_DRIVER<T>::_medIdt,const_cast <char*> (MeshName.c_str()),
+ const_cast <char*> (MED_FIELD_DRIVER<T>::_fieldName.c_str()),
+ (unsigned char*) temp,
+ med_2_1::MED_NO_INTERLACE,
+ MED_ALL,
+ ProfilName,
+ (med_2_1::med_entite_maillage) MED_FIELD_DRIVER<T>::_ptrField->_support->getEntity(),(med_2_1::med_geometrie_element)Types[i],
+ MED_FIELD_DRIVER<T>::_ptrField->getIterationNumber(),
+ MED_FIELD_DRIVER<T>::_ptrField->getOrderNumber()
+ );
+ for(int i2=0;i2<lgth2;i2++)
+ myValues[i][i2]=(int)(temp[i2]);
+ delete [] temp;
+ }
+ else
+#endif
+ ret=med_2_1::MEDchampLire(MED_FIELD_DRIVER<T>::_medIdt,const_cast <char*> (MeshName.c_str()),
const_cast <char*> (MED_FIELD_DRIVER<T>::_fieldName.c_str()),
(unsigned char*) myValues[i],
- MED_FR::MED_NO_INTERLACE,
+ med_2_1::MED_NO_INTERLACE,
MED_ALL,
ProfilName,
- (MED_FR::med_entite_maillage) MED_FIELD_DRIVER<T>::_ptrField->_support->getEntity(),(MED_FR::med_geometrie_element)Types[i],
+ (med_2_1::med_entite_maillage) MED_FIELD_DRIVER<T>::_ptrField->_support->getEntity(),(med_2_1::med_geometrie_element)Types[i],
MED_FIELD_DRIVER<T>::_ptrField->getIterationNumber(),
MED_FIELD_DRIVER<T>::_ptrField->getOrderNumber()
- ) < 0) {
+ );
+ if (ret < 0) {
// we must do some delete !!!
for(int j=0; j<=i;j++)
delete[] myValues[j];
// le champ existe deja ???
char * champName = new char[MED_TAILLE_NOM+1] ;
- MED_FR::med_type_champ type ;
+ med_2_1::med_type_champ type ;
char * compName ;
char * compUnit ;
bool Find = false ;
- int n = MED_FR::MEDnChamp(MED_FIELD_DRIVER<T>::_medIdt,0);
+ int n = med_2_1::MEDnChamp(MED_FIELD_DRIVER<T>::_medIdt,0);
int nbComp ;
for (int i=1; i<=n; i++) {
- nbComp = MED_FR::MEDnChamp(MED_FIELD_DRIVER<T>::_medIdt,i);
+ nbComp = med_2_1::MEDnChamp(MED_FIELD_DRIVER<T>::_medIdt,i);
compName = new char[MED_TAILLE_PNOM*nbComp+1];
compUnit = new char[MED_TAILLE_PNOM*nbComp+1];
- err = MED_FR::MEDchampInfo(MED_FIELD_DRIVER<T>::_medIdt,i,champName,&type,compName,compUnit,nbComp);
+ err = med_2_1::MEDchampInfo(MED_FIELD_DRIVER<T>::_medIdt,i,champName,&type,compName,compUnit,nbComp);
if (err == 0)
if (strcmp(champName,MED_FIELD_DRIVER<T>::_ptrField->getName().c_str())==0) { // Found !
Find = true ;
string dataGroupName = "/CHA/";
dataGroupName += MED_FIELD_DRIVER<T>::_ptrField->getName();
MESSAGE(LOC << "|" << dataGroupName << "|" );
- med_idt gid = H5Gopen(MED_FIELD_DRIVER<T>::_medIdt, dataGroupName.c_str() );
+ MED_EN::med_idt gid = H5Gopen(MED_FIELD_DRIVER<T>::_medIdt, dataGroupName.c_str() );
if ( gid < 0 ) {
// create field :
- err=MED_FR::MEDchampCr(MED_FIELD_DRIVER<T>::_medIdt,
+ err=med_2_1::MEDchampCr(MED_FIELD_DRIVER<T>::_medIdt,
const_cast <char*> ((MED_FIELD_DRIVER<T>::_ptrField->getName()).c_str()),
- (MED_FR::med_type_champ) ValueType,
+ (med_2_1::med_type_champ) ValueType,
const_cast <char*> ( component_name.c_str() ),
const_cast <char*> ( component_unit.c_str() ),
component_count);
// on boucle sur tout les types pour ecrire les tableaux de valeur
int NumberOfType = mySupport->getNumberOfTypes() ;
int Index = 1 ;
- const medGeometryElement * Types = mySupport->getTypes() ;
+ const MED_EN::medGeometryElement * Types = mySupport->getTypes() ;
const int * NumberOfGaussPoint = mySupport->getNumberOfGaussPoint() ;
for (int i=0;i<NumberOfType;i++) {
int NumberOfElements = mySupport->getNumberOfElements(Types[i]) ;
/* char chanom[MED_TAILLE_NOM+1];
char chacomp[MED_TAILLE_NOM+1];
char chaunit[MED_TAILLE_NOM+1];
- MED_FR::med_type_champ chatype;
+ med_2_1::med_type_champ chatype;
med_int chancomp=1;
- err=MED_FR::MEDchampInfo(MED_FIELD_DRIVER<T>::_medIdt,1,chanom,&chatype,chacomp,chaunit,chancomp);
+ err=med_2_1::MEDchampInfo(MED_FIELD_DRIVER<T>::_medIdt,1,chanom,&chatype,chacomp,chaunit,chancomp);
if (err<0)
{
cout<<"==================> type lu = "<<chatype<<endl;
cout<<"==================> nom composante lu = "<<chacomp<<endl;
cout<<"==================> nom unit lu = "<<chaunit<<endl;
- cout<<"==================> valeur de MED_FR::MED_REEL64 = "<<MED_FR::MED_REEL64<<endl;
+ cout<<"==================> valeur de med_2_1::MED_REEL64 = "<<med_2_1::MED_REEL64<<endl;
*/
-
- err=MED_FR::MEDchampEcr(MED_FIELD_DRIVER<T>::_medIdt,
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ if(_ptrField->getValueType()==MED_EN::MED_INT32)
+ {
+ int lgth2=_ptrField->getNumberOfValues();
+ med_2_1::med_int *temp=new med_2_1::med_int[lgth2];
+ for(int i2=0;i2<lgth2;i2++)
+ temp[i2]=(int)(value[i2]);
+ err=med_2_1::MEDchampEcr(MED_FIELD_DRIVER<T>::_medIdt,
+ const_cast <char*> ( MeshName.c_str()) , //( string(mesh_name).resize(MED_TAILLE_NOM).c_str())
+ const_cast <char*> ( (MED_FIELD_DRIVER<T>::_ptrField->getName()).c_str()),
+ (unsigned char*)temp,
+ med_2_1::MED_FULL_INTERLACE,
+ NumberOfElements,
+ NumberOfGaussPoint[i],
+ MED_ALL,
+ MED_NOPFL,
+ med_2_1::MED_REMP, // PROFIL NON GERE, mode de remplacement non géré
+ (med_2_1::med_entite_maillage)mySupport->getEntity(),
+ (med_2_1::med_geometrie_element)Types[i],
+ MED_FIELD_DRIVER<T>::_ptrField->getIterationNumber(),
+ " ",
+ MED_FIELD_DRIVER<T>::_ptrField->getTime(),
+ MED_FIELD_DRIVER<T>::_ptrField->getOrderNumber()
+ );
+ delete [] temp;
+ }
+ else
+#endif
+ err=med_2_1::MEDchampEcr(MED_FIELD_DRIVER<T>::_medIdt,
const_cast <char*> ( MeshName.c_str()) , //( string(mesh_name).resize(MED_TAILLE_NOM).c_str())
const_cast <char*> ( (MED_FIELD_DRIVER<T>::_ptrField->getName()).c_str()),
(unsigned char*)value,
- MED_FR::MED_FULL_INTERLACE,
+ med_2_1::MED_FULL_INTERLACE,
NumberOfElements,
NumberOfGaussPoint[i],
MED_ALL,
MED_NOPFL,
- MED_FR::MED_REMP, // PROFIL NON GERE, mode de remplacement non géré
- (MED_FR::med_entite_maillage)mySupport->getEntity(),
- (MED_FR::med_geometrie_element)Types[i],
+ med_2_1::MED_REMP, // PROFIL NON GERE, mode de remplacement non géré
+ (med_2_1::med_entite_maillage)mySupport->getEntity(),
+ (med_2_1::med_geometrie_element)Types[i],
MED_FIELD_DRIVER<T>::_ptrField->getIterationNumber(),
" ",
MED_FIELD_DRIVER<T>::_ptrField->getTime(),
MED_FIELD_RDONLY_DRIVER<T>::read();
END_OF("MED_FIELD_RDWR_DRIVER::read(void)");
}
+}//End namespace MEDMEM
/*-----------------------------------------------------------------*/
#endif /* MED_FIELD_DRIVER_HXX */
-using namespace std;
# include <string>
# include "MEDMEM_MedMedDriver.hxx"
# include "MEDMEM_define.hxx"
-using namespace MED_FR;
+using namespace std;
+using namespace MED_EN;
using namespace MEDMEM;
MED_MED_DRIVER::MED_MED_DRIVER(): GENDRIVER(),
MED_MED_DRIVER::MED_MED_DRIVER(const string & fileName, MED * const ptrMed):
GENDRIVER(fileName,MED_EN::MED_RDWR), _ptrMed(ptrMed), _medIdt(MED_INVALID)
{
- _ptrMed->addDriver(*this); // The specific MED driver id is set within the addDriver method.
+ //_ptrMed->addDriver(*this); // The specific MED driver id is set within the addDriver method.
}
MED_MED_DRIVER::MED_MED_DRIVER(const string & fileName,
);
MESSAGE(LOC<<"_fileName.c_str : "<< _fileName.c_str()<<",mode : "<< _accessMode);
- _medIdt = MEDouvrir( (const_cast <char *> (_fileName.c_str())), (MED_FR::med_mode_acces) _accessMode);
+ _medIdt = MEDouvrir( (const_cast <char *> (_fileName.c_str())), (med_2_1::med_mode_acces) _accessMode);
MESSAGE(LOC<<" _medIdt = "<<_medIdt);
if (_medIdt > 0)
void MED_MED_DRIVER::close()
{
- MED_FR::med_int err = 0;
+ med_2_1::med_int err = 0;
const char * LOC = "MED_MED_DRIVER::close() : ";
// );
if ( _medIdt != MED_INVALID )
- err=MEDfermer(_medIdt);
+ err=med_2_1::MEDfermer(_medIdt);
// if (err != MED_VALID)
// throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) << "the file |"
{
int numberOfMeshes;
char meshName[MED_TAILLE_NOM+1]="";
- int meshDim;
+ med_2_1::med_int meshDim;
MESH * ptrMesh;
// MED_MESH_RDWR_DRIVER * ptrDriver; !! UNUSED VARIABLE !!
- numberOfMeshes = MEDnMaa(_medIdt) ;
+ numberOfMeshes = med_2_1::MEDnMaa(_medIdt) ;
if ( numberOfMeshes <= 0 )
MESSAGE(LOC << "Be careful there is no mesh in file |"<<_fileName<<"| !");
// find out if the mesh is a Grid
- int isAGrid = false;
- MED_FR::med_grid_type type;
+ med_2_1::med_int isAGrid = false;
+ med_2_1::med_grid_type type;
err = MEDgridInfo (_medIdt, i, &isAGrid, &type);
if (err != MED_VALID)
throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) << "error in MEDgridInfo()") );
- err = MEDmaaInfo(_medIdt, i ,meshName, &meshDim) ;
+ err = med_2_1::MEDmaaInfo(_medIdt, i ,meshName, &meshDim) ;
if (err != MED_VALID)
throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) << ": can't get information about the mesh n°"
<< i <<" of the file |" << _fileName << "| !"
int index = 0;
for (currentEntity=meshEntities.begin();currentEntity != meshEntities.end(); currentEntity++) {
string supportName="SupportOnAll_" ;
- supportName+=entNames[(MED_FR::med_entite_maillage)(*currentEntity).first] ;
- //(_ptrMed->_support)[meshName][(MED_FR::med_entite_maillage)(*currentEntity).first]=new SUPPORT(ptrMesh,supportName,(MED_EN::medEntityMesh) (*currentEntity).first) ;
+ supportName+=entNames[(*currentEntity).first] ;
+ //(_ptrMed->_support)[meshName][(MED_EN::medEntityMesh)(*currentEntity).first]=new SUPPORT(ptrMesh,supportName,(MED_EN::medEntityMesh) (*currentEntity).first) ;
SUPPORT* mySupport = new SUPPORT() ;
mySupport->setName(supportName);
mySupport->setMesh(ptrMesh);
mySupport->setEntity((MED_EN::medEntityMesh) (*currentEntity).first);
mySupport->setAll(true);
- (_ptrMed->_support)[meshName][(MED_FR::med_entite_maillage)(*currentEntity).first] = mySupport ;
+ (_ptrMed->_support)[meshName][(MED_EN::medEntityMesh)(*currentEntity).first] = mySupport ;
MESSAGE(LOC<< "The support " << supportName.c_str() << " on entity " << (*currentEntity).first << " is built");
index++;
}
MESSAGE(LOC <<"The mesh " <<ptrMesh->getName() << " has " << index << " support(s)");
}
- map<MESH_NAME_, map<MED_FR::med_entite_maillage,SUPPORT *> >::const_iterator const_itSupportOnMesh ;
+ map<MESH_NAME_, map<MED_EN::medEntityMesh,SUPPORT *> >::const_iterator const_itSupportOnMesh ;
int index = 0;
for (const_itSupportOnMesh=_ptrMed->_support.begin(); const_itSupportOnMesh != _ptrMed->_support.end();
const_itSupportOnMesh++ )
{
- map<MED_FR::med_entite_maillage,SUPPORT *>::const_iterator const_itSupport ;
+ map<MED_EN::medEntityMesh,SUPPORT *>::const_iterator const_itSupport ;
for (const_itSupport=(*const_itSupportOnMesh).second.begin();
const_itSupport!=(*const_itSupportOnMesh).second.end();const_itSupport++) index++;
}
for (const_itSupportOnMesh=_ptrMed->_support.begin(); const_itSupportOnMesh != _ptrMed->_support.end();
const_itSupportOnMesh++ )
{
- map<MED_FR::med_entite_maillage,SUPPORT *>::const_iterator const_itSupport ;
+ map<MED_EN::medEntityMesh,SUPPORT *>::const_iterator const_itSupport ;
for (const_itSupport=(*const_itSupportOnMesh).second.begin();
const_itSupport!=(*const_itSupportOnMesh).second.end();const_itSupport++)
{
char * unitName = (char *) MED_NULL;
// char meshName[MED_TAILLE_NOM+1] = "";
char meshName[MED_TAILLE_NOM+1] ;
- MED_FR::med_type_champ type;
+ med_2_1::med_type_champ type;
MESH * ptrMesh = (MESH *) MED_NULL;
FIELD_ * ptrField = (FIELD_ *) MED_NULL;
//MED_FIELD_RDWR_DRIVER * ptrDriver = (MED_FIELD_RDWR_DRIVER * ) MED_NULL;
GENDRIVER * ptrDriver = (GENDRIVER * ) MED_NULL;
SUPPORT * ptrSupport = (SUPPORT * ) MED_NULL;
MESH_ENTITIES::const_iterator currentEntity;
- list<MED_FR::med_geometrie_element>::const_iterator currentGeometry;
- int NbOfGaussPts = 0;
+ list<MED_EN::medGeometryElement>::const_iterator currentGeometry;
+ med_2_1::med_int NbOfGaussPts = 0;
int numberOfTimeSteps = -1;
- int timeStepNumber = -1;
+ med_2_1::med_int timeStepNumber = -1;
// char timeStepUnit[MED_TAILLE_PNOM]= "";
char timeStepUnit[MED_TAILLE_PNOM+1] ;
double timeStep = 0.0;
- int orderNumber = -1; //???init?????
+ med_2_1::med_int orderNumber = -1; //???init?????
map<MESH_NAME_,MESH*> & _meshes = _ptrMed->_meshes;
map<FIELD_NAME_,MAP_DT_IT_> & _fields = _ptrMed->_fields;
map<FIELD_ *, MESH_NAME_> & _meshName = _ptrMed->_meshName;
- map<MESH_NAME_, map<MED_FR::med_entite_maillage,SUPPORT *> > & _support = _ptrMed->_support;
+ map<MESH_NAME_, map<MED_EN::medEntityMesh,SUPPORT *> > & _support = _ptrMed->_support;
- numberOfFields = MEDnChamp(_medIdt,0) ;
+ numberOfFields = med_2_1::MEDnChamp(_medIdt,0) ;
if ( numberOfFields <= 0 )
MESSAGE(LOC << "Be careful there is no field in file |"<<_fileName<<"| !");
for (i=1;i<=numberOfFields;i++) {
- numberOfComponents = MEDnChamp(_medIdt,i) ;
+ numberOfComponents = med_2_1::MEDnChamp(_medIdt,i) ;
if ( numberOfComponents <= 0 )
if (err != MED_VALID)
throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) << "Be careful there is no compound for field n°"
for (currentGeometry = (*currentEntity).second.begin();currentGeometry != (*currentEntity).second.end(); currentGeometry++) {
MESSAGE("Field information with Entity,Geom = "<<(*currentEntity).first<<","<<(*currentGeometry));
numberOfTimeSteps = MEDnPasdetemps(_medIdt, fieldName,
- (MED_FR::med_entite_maillage)(*currentEntity).first,
- (MED_FR::med_geometrie_element) (*currentGeometry) );
+ (med_2_1::med_entite_maillage)(*currentEntity).first,
+ (med_2_1::med_geometrie_element) (*currentGeometry) );
MESSAGE("Field information 2 : NumberOfTimeStep :"<<numberOfTimeSteps);
if ( numberOfTimeSteps > MED_VALID )
break ; // There are value for some med_geometrie_element of this med_entite_maillage.
MESSAGE("Field information 4 : time step j = "<<j);
err = MEDpasdetempsInfo( _medIdt, fieldName,
- (MED_FR::med_entite_maillage) (*currentEntity).first,
- (*currentGeometry),j,
+ (med_2_1::med_entite_maillage) (*currentEntity).first,
+ (med_2_1::med_geometrie_element) (*currentGeometry),j,
meshName, &NbOfGaussPts,
&timeStepNumber, timeStepUnit, &timeStep,
&orderNumber);
<< meshName <<"| in the file |"
<< _fileName <<"|, but |" << meshName <<"| is referenced by field |"
<< fieldName <<"|, entity : |"
- << entNames [ (MED_FR::med_entite_maillage) (*currentEntity).first] <<"|, geometric element of type |"
- << geoNames [ (MED_FR::med_geometrie_element) (*currentGeometry)] <<"|"
+ << entNames [(*currentEntity).first] <<"|, geometric element of type |"
+ << geoNames [(*currentGeometry)] <<"|"
);
} // POURQUOI SI JE NE MET PAS DE BLOCK J'AI UN PARSE ERROR : PG : c'est la macro MESSAGE qui fait ca !
else
ptrMesh = _meshes[meshName];
- ptrSupport = _support[meshName][(MED_FR::med_entite_maillage) (*currentEntity).first];
+ ptrSupport = _support[meshName][(med_2_1::med_entite_maillage) (*currentEntity).first];
if (NbOfGaussPts != 1)
throw MEDEXCEPTION(LOCALIZED( STRING(LOC) <<"Number of Gauss Point must be equal to 1 for instance")) ;
ptrDriver = (GENDRIVER*)NULL ;
switch ( type) {
- case MED_FR::MED_INT64 :
- if ( sizeof(MED_FR::med_int) != 8 )
+ case med_2_1::MED_INT64 :
+ if ( sizeof(med_2_1::med_int) != 8 )
throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) <<
" The Field type of |"
<< fieldName <<"|, entity : |"
- << entNames [(MED_FR::med_entite_maillage) (*currentEntity).first] <<"|, geometric element of type |"
- << geoNames [(MED_FR::med_geometrie_element) (*currentGeometry) ] <<
+ << entNames [(*currentEntity).first] <<"|, geometric element of type |"
+ << geoNames [(*currentGeometry) ] <<
"| is MED_INT64 but size of med_int is not equal to 8 bytes !"
)
);
break;
- case MED_FR::MED_INT32 : {
+ case med_2_1::MED_INT32 : {
// throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) <<
// "NOT IMPLEMENTED : BUG IN STL !")
// ) ;
- // ptrField = new FIELD<MED_FR::med_int> ( ptrSupport,numberOfComponents ); // Les valeurs du champ ne doivent pas être lue pour l'instant
+ // ptrField = new FIELD<med_2_1::med_int> ( ptrSupport,numberOfComponents ); // Les valeurs du champ ne doivent pas être lue pour l'instant
- ptrField = new FIELD<MED_FR::med_int> ( ); // Les valeurs du champ ne doivent pas être lue pour l'instant
- ((FIELD<MED_FR::med_int>*) ptrField)->setSupport(ptrSupport);
- ((FIELD<MED_FR::med_int>*) ptrField)->setNumberOfComponents(numberOfComponents);
- ((FIELD<MED_FR::med_int>*) ptrField)->setName(fieldName) ; //provisoire, pour debug
+ ptrField = new FIELD<int> ( ); // Les valeurs du champ ne doivent pas être lue pour l'instant
+ ((FIELD<int>*) ptrField)->setSupport(ptrSupport);
+ ((FIELD<int>*) ptrField)->setNumberOfComponents(numberOfComponents);
+ ((FIELD<int>*) ptrField)->setName(fieldName) ; //provisoire, pour debug
MESSAGE("#### SET NAME in FIELD : "<<fieldName);
MED_EN::med_mode_acces myMode = getAccessMode();
switch (myMode) {
case MED_EN::MED_LECT:
- ptrDriver = new MED_FIELD_RDONLY_DRIVER<MED_FR::med_int>(_fileName, (FIELD<MED_FR::med_int> *)ptrField);
+ ptrDriver = new MED_FIELD_RDONLY_DRIVER<int>(_fileName, (FIELD<int> *)ptrField);
break ;
case MED_EN::MED_REMP:
- ptrDriver = new MED_FIELD_RDWR_DRIVER<MED_FR::med_int>(_fileName, (FIELD<MED_FR::med_int> *)ptrField);
+ ptrDriver = new MED_FIELD_RDWR_DRIVER<int>(_fileName, (FIELD<int> *)ptrField);
break ;
case MED_EN::MED_ECRI: // should never append !!
- ptrDriver = new MED_FIELD_RDONLY_DRIVER<MED_FR::med_int>(_fileName, (FIELD<MED_FR::med_int> *)ptrField);
+ ptrDriver = new MED_FIELD_RDONLY_DRIVER<int>(_fileName, (FIELD<int> *)ptrField);
break;
default:
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) << "Bad file mode access !"));
}
break;
}
- case MED_FR::MED_REEL64 : {
- // ptrField = new FIELD<MED_FR::med_float> ( ptrSupport,numberOfComponents ); // Les valeurs du champ ne doivent pas être lue pour l'instant
- ptrField = new FIELD<MED_FR::med_float> ( ); // Les valeurs du champ ne doivent pas être lue pour l'instant
- ((FIELD<MED_FR::med_float>*) ptrField)->setSupport(ptrSupport);
- ((FIELD<MED_FR::med_float>*) ptrField)->setNumberOfComponents(numberOfComponents);
- ((FIELD<MED_FR::med_float>*) ptrField)->setName(fieldName) ; //provisoire, pour debug
+ case med_2_1::MED_REEL64 : {
+ // ptrField = new FIELD<med_2_1::med_float> ( ptrSupport,numberOfComponents ); // Les valeurs du champ ne doivent pas être lue pour l'instant
+ ptrField = new FIELD<med_2_1::med_float> ( ); // Les valeurs du champ ne doivent pas être lue pour l'instant
+ ((FIELD<med_2_1::med_float>*) ptrField)->setSupport(ptrSupport);
+ ((FIELD<med_2_1::med_float>*) ptrField)->setNumberOfComponents(numberOfComponents);
+ ((FIELD<med_2_1::med_float>*) ptrField)->setName(fieldName) ; //provisoire, pour debug
MESSAGE("#### SET NAME in FIELD : "<<fieldName);
MED_EN::med_mode_acces myMode = getAccessMode();
switch (myMode) {
case MED_EN::MED_LECT:
- ptrDriver = new MED_FIELD_RDONLY_DRIVER<MED_FR::med_float>(_fileName, (FIELD<MED_FR::med_float> *)ptrField);
+ ptrDriver = new MED_FIELD_RDONLY_DRIVER<med_2_1::med_float>(_fileName, (FIELD<med_2_1::med_float> *)ptrField);
break ;
case MED_EN::MED_REMP:
- ptrDriver = new MED_FIELD_RDWR_DRIVER<MED_FR::med_float>(_fileName, (FIELD<MED_FR::med_float> *)ptrField);
+ ptrDriver = new MED_FIELD_RDWR_DRIVER<med_2_1::med_float>(_fileName, (FIELD<med_2_1::med_float> *)ptrField);
break ;
case MED_EN::MED_ECRI: // should never append !!
- ptrDriver = new MED_FIELD_RDONLY_DRIVER<MED_FR::med_float>(_fileName, (FIELD<MED_FR::med_float> *)ptrField);
+ ptrDriver = new MED_FIELD_RDONLY_DRIVER<med_2_1::med_float>(_fileName, (FIELD<med_2_1::med_float> *)ptrField);
break;
default:
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) << "Bad file mode access !"));
throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) <<
" The Field type of |"
<< fieldName <<"|, entity : |"
- << entNames [(MED_FR::med_entite_maillage) (*currentEntity).first]
+ << entNames [(*currentEntity).first]
<<"|, geometric element of type |"
- << geoNames [(MED_FR::med_geometrie_element) (*currentGeometry)]
+ << geoNames [(*currentGeometry)]
<<"| is neither MED_INT, MED_INT32, MED_INT64 nor MED_REEL64 !"
)
);
protected:
MED * const _ptrMed; // Store 'MED_DRIVER (0..n)----(1) MED' associations
- med_idt _medIdt; // The _medIdt used to write/read Meshes to ::_filename
+ MED_EN::med_idt _medIdt; // The _medIdt used to write/read Meshes to ::_filename
//private:
// MED_MED_DRIVER();
-using namespace std;
#include "MEDMEM_MedMeshDriver.hxx"
#include "MEDMEM_DriversDef.hxx"
#include "MEDMEM_CellModel.hxx"
#include "MEDMEM_Grid.hxx"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
+
extern "C" {
extern med_idt _MEDdatagroupOuvrir(med_idt pid, char *nom);
extern med_err _MEDdatagroupFermer(med_idt id);
const char * LOC = "MED_MESH_DRIVER::open()" ;
BEGIN_OF(LOC);
MESSAGE(LOC<<" : _fileName.c_str : "<< _fileName.c_str()<<",mode : "<< _accessMode);
- _medIdt = MED_FR::MEDouvrir( (const_cast <char *> (_fileName.c_str())),(MED_FR::med_mode_acces) _accessMode);
+ _medIdt = med_2_1::MEDouvrir( (const_cast <char *> (_fileName.c_str())),(med_2_1::med_mode_acces) _accessMode);
MESSAGE(LOC<<" _medIdt : "<< _medIdt );
if (_medIdt > 0)
_status = MED_OPENED;
BEGIN_OF(LOC);
int err = 0;
if ( _status == MED_OPENED) {
- err=MED_FR::MEDfermer(_medIdt);
+ err=med_2_1::MEDfermer(_medIdt);
// san -- MED5873 : Calling H5close() here leads to failure of SALOMEDS::StudyManager_i::_SaveAs()
// method during study saving process. MEDfermer() seems sufficient for closing a file.
//H5close(); // If we call H5close() all the files are closed.
string MED_MESH_DRIVER::getMeshName() const { return _meshName; };
//A FAIRE UTILISER LES MAPS...
-const MED_FR::med_geometrie_element MED_MESH_DRIVER::all_cell_type[MED_NBR_GEOMETRIE_MAILLE]=
- { MED_FR::MED_POINT1,MED_FR::MED_SEG2,MED_FR::MED_SEG3,MED_FR::MED_TRIA3,MED_FR::MED_QUAD4,MED_FR::MED_TRIA6,MED_FR::MED_QUAD8,
- MED_FR::MED_TETRA4,MED_FR::MED_PYRA5,MED_FR::MED_PENTA6,MED_FR::MED_HEXA8,MED_FR::MED_TETRA10,MED_FR::MED_PYRA13,
- MED_FR::MED_PENTA15, MED_FR::MED_HEXA20};
+const med_2_1::med_geometrie_element MED_MESH_DRIVER::all_cell_type[MED_NBR_GEOMETRIE_MAILLE]=
+ { med_2_1::MED_POINT1,med_2_1::MED_SEG2,med_2_1::MED_SEG3,med_2_1::MED_TRIA3,med_2_1::MED_QUAD4,med_2_1::MED_TRIA6,med_2_1::MED_QUAD8,
+ med_2_1::MED_TETRA4,med_2_1::MED_PYRA5,med_2_1::MED_PENTA6,med_2_1::MED_HEXA8,med_2_1::MED_TETRA10,med_2_1::MED_PYRA13,
+ med_2_1::MED_PENTA15, med_2_1::MED_HEXA20};
const char * const MED_MESH_DRIVER::all_cell_type_tab [MED_NBR_GEOMETRIE_MAILLE]=
{ "MED_POINT1","MED_SEG2","MED_SEG3","MED_TRIA3","MED_QUAD4","MED_TRIA6","MED_QUAD8",
// int nbFam = MEDnFam(_medIdt,
// const_cast <char *> (_meshName.c_str()),
// 0,
-// MED_FR::MED_FAMILLE);
+// med_2_1::MED_FAMILLE);
// if (nbFam > 0)
{
// getFAMILY();
int err, i;
// Read the dimension of the space for the mesh <_meshName>
- int SpaceDimension = MED_FR::MEDdimLire(_medIdt,const_cast <char *> (_meshName.c_str())) ;
+ int SpaceDimension = med_2_1::MEDdimLire(_medIdt,const_cast <char *> (_meshName.c_str())) ;
if ( SpaceDimension <= MED_VALID )
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"The space dimension |" << SpaceDimension <<
"| seems to be incorrect " << "for the mesh : |" <<
int idim;
for (idim = 0; idim < _ptrMesh->_spaceDimension; ++idim)
{
- int lenght = MED_FR::MEDnGrid(_medIdt,
+ int lenght = med_2_1::MEDnGrid(_medIdt,
const_cast <char *> (_ptrMesh->_name.c_str()),
- (MED_FR::med_grid)
+ (med_2_1::med_grid)
idim
);
if ( lenght <= MED_VALID )
ArrayLen [idim][0] = lenght;
}
- MED_FR::med_repere rep ;
+ med_2_1::med_repere rep ;
string tmp_nom_coord (MED_TAILLE_PNOM*(_ptrMesh->_spaceDimension)+1,' ');
string tmp_unit_coord(MED_TAILLE_PNOM*(_ptrMesh->_spaceDimension)+1,' ');
char * tmp_nom = (const_cast <char *> ( tmp_nom_coord.c_str()) ) ;
if (ptrGrid->getGridType() == MED_EN::MED_BODY_FITTED)
{
// Read nb of nodes
- int NumberOfNodes = MED_FR::MEDnGrid(_medIdt,
+ int NumberOfNodes = med_2_1::MEDnGrid(_medIdt,
const_cast <char *> (_meshName.c_str()),
- MED_FR::MED_GRID_NOEUD);
+ med_2_1::MED_GRID_NOEUD);
if ( NumberOfNodes <= MED_VALID )
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"The number of nodes |" << NumberOfNodes <<
"| seems to be incorrect "
_ptrMesh->_numberOfNodes = NumberOfNodes ;
// this array is useless because families numbers are read in getFAMILY
- int * MEDArrayNodeFamily = new int[ NumberOfNodes ];
+ //CCRT as it is useless replace int by med_int
+ med_2_1::med_int * MEDArrayNodeFamily = new med_2_1::med_int[ NumberOfNodes ];
// create coordinates
_ptrMesh->_coordinate = new COORDINATE(SpaceDimension,NumberOfNodes,
MED_EN::MED_FULL_INTERLACE);
// double * coo = const_cast <double *>
// (_ptrMesh->_coordinate->getCoordinates(MED_EN::MED_FULL_INTERLACE));
-// err = MED_FR::MEDbodyFittedLire (_medIdt,
+// err = med_2_1::MEDbodyFittedLire (_medIdt,
// const_cast <char *> (_ptrMesh->_name.c_str()),
// _ptrMesh->_spaceDimension,
// coo,
-// MED_FR::MED_FULL_INTERLACE,
+// med_2_1::MED_FULL_INTERLACE,
// & rep,
// tmp_nom,
// tmp_unit,
// MEDArrayNodeFamily,
// NumberOfNodes);
- err = MED_FR::MEDbodyFittedLire (_medIdt,
+ err = med_2_1::MEDbodyFittedLire (_medIdt,
const_cast <char *> (_ptrMesh->_name.c_str()),
_ptrMesh->_spaceDimension,
const_cast <double *> ( _ptrMesh->_coordinate->_coordinate.get(MED_EN::MED_FULL_INTERLACE) ),
- MED_FR::MED_FULL_INTERLACE,
+ med_2_1::MED_FULL_INTERLACE,
& rep,
tmp_nom,
tmp_unit,
int nbNodesDim = * ArrayLen [idim];
nbNodes *= nbNodesDim;
Array [idim] = new double [ nbNodesDim ];
- err = MED_FR::MEDgridLire (_medIdt,
+ err = med_2_1::MEDgridLire (_medIdt,
const_cast <char *> (_ptrMesh->_name.c_str()),
_ptrMesh->_spaceDimension,
Array [idim],
idim,
- MED_FR::MED_FULL_INTERLACE,
+ med_2_1::MED_FULL_INTERLACE,
& rep,
tmp_nom,
tmp_unit);
_ptrMesh->_coordinate = new COORDINATE(SpaceDimension,nbNodes,
MED_EN::MED_FULL_INTERLACE);
// Read node families
-// int nbFamNodes = MED_FR::MEDnGrid(_medIdt,
+// int nbFamNodes = med_2_1::MEDnGrid(_medIdt,
// const_cast <char *> (_ptrMesh->_name.c_str()),
-// MED_FR::MED_FAM_NOEUD);
+// med_2_1::MED_FAM_NOEUD);
// if (nbFamNodes > 0)
// {
// // int * fam = new int[ nbFamNodes ];
// // this array is useless because families numbers are read in getFAMILY
// int * MEDArrayNodeFamily = new int[ nbFamNodes ];
-// err = MED_FR::MEDfamGridLire (_medIdt,
+// err = med_2_1::MEDfamGridLire (_medIdt,
// const_cast <char *> (_ptrMesh->_name.c_str()),
// MEDArrayNodeFamily,
// nbFamNodes,
-// MED_FR::MED_NOEUD);
+// med_2_1::MED_NOEUD);
// if (err != MED_VALID)
// throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"Can't read grid nodes families for "
string coordinateSystem = "UNDEFINED";
- if( rep == MED_FR::MED_CART) coordinateSystem = "CARTESIAN";
- else if ( rep == MED_FR::MED_CYL) coordinateSystem = "CYLINDRICAL";
- else if ( rep == MED_FR::MED_SPHER) coordinateSystem = "SPHERICAL";
+ if( rep == med_2_1::MED_CART) coordinateSystem = "CARTESIAN";
+ else if ( rep == med_2_1::MED_CYL) coordinateSystem = "CYLINDRICAL";
+ else if ( rep == med_2_1::MED_SPHER) coordinateSystem = "SPHERICAL";
_ptrMesh->_coordinate->setCoordinatesSystem(coordinateSystem);
// Read the dimension of the space for the mesh <_meshName>
// to be able to create a COORDINATE object
- int SpaceDimension = MED_FR::MEDdimLire(_medIdt,const_cast <char *> (_meshName.c_str())) ;
+ int SpaceDimension = med_2_1::MEDdimLire(_medIdt,const_cast <char *> (_meshName.c_str())) ;
if ( SpaceDimension <= MED_VALID )
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"The space dimension |" << SpaceDimension << "| seems to be incorrect "
<< "for the mesh : |" << _meshName << "|")) ;
// to be able to create a COORDINATE object
int NumberOfNodes=MEDnEntMaa(_medIdt,
const_cast <char *> (_meshName.c_str()),
- MED_FR::MED_COOR,
- MED_FR::MED_NOEUD,
- (MED_FR::med_geometrie_element) MED_NONE,
- (MED_FR::med_connectivite) MED_NONE);
+ med_2_1::MED_COOR,
+ med_2_1::MED_NOEUD,
+ (med_2_1::med_geometrie_element) MED_NONE,
+ (med_2_1::med_connectivite) MED_NONE);
if ( NumberOfNodes <= MED_VALID )
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"The number of nodes |" << NumberOfNodes << "| seems to be incorrect "
<< "for the mesh : |" << _meshName << "|" )) ;
// create a COORDINATE object
_ptrMesh->_coordinate = new COORDINATE(SpaceDimension, NumberOfNodes, MED_EN::MED_FULL_INTERLACE);
- MED_FR::med_repere rep ; // ATTENTION ---> DOIT ETRE INTEGRE DS MESH EF: FAIT NON?
+ med_2_1::med_repere rep ; // ATTENTION ---> DOIT ETRE INTEGRE DS MESH EF: FAIT NON?
string tmp_nom_coord (MED_TAILLE_PNOM*(_ptrMesh->_spaceDimension)+1,'\0');
string tmp_unit_coord(MED_TAILLE_PNOM*(_ptrMesh->_spaceDimension)+1,'\0');
char * tmp_nom = (const_cast <char *> ( tmp_nom_coord.c_str()) ) ;
_ptrMesh->_spaceDimension,
//const_cast <double *> ( _ptrMesh->_coordinate->_coordinate->get(MED_EN::MED_FULL_INTERLACE) ),
const_cast <double *> ( _ptrMesh->_coordinate->_coordinate.get(MED_EN::MED_FULL_INTERLACE) ),
- MED_FR::MED_FULL_INTERLACE,
+ med_2_1::MED_FULL_INTERLACE,
MED_ALL, // we read all the coordinates
NULL, // we don't use a profile
0, // so the profile's size is 0
// Pourquoi le stocker sous forme de chaîne ?
switch (rep)
{
- case MED_FR::MED_CART :
+ case med_2_1::MED_CART :
{
_ptrMesh->_coordinate->_coordinateSystem = "CARTESIAN";
break ;
}
- case MED_FR::MED_CYL :
+ case med_2_1::MED_CYL :
{
_ptrMesh->_coordinate->_coordinateSystem = "CYLINDRICAL";
break ;
}
- case MED_FR::MED_SPHER :
+ case med_2_1::MED_SPHER :
{
_ptrMesh->_coordinate->_coordinateSystem = "SPHERICAL";
break ;
char * tmp_node_name = new char[NumberOfNodes*MED_TAILLE_PNOM+1];
tmp_node_name[NumberOfNodes]='\0' ;
err=MEDnomLire(_medIdt,const_cast <char*> (_ptrMesh->_name.c_str()),
- tmp_node_name,NumberOfNodes*MED_TAILLE_PNOM,MED_FR::MED_NOEUD,
- (MED_FR::med_geometrie_element) MED_NONE);
+ tmp_node_name,NumberOfNodes*MED_TAILLE_PNOM,med_2_1::MED_NOEUD,
+ (med_2_1::med_geometrie_element) MED_NONE);
if (err == MED_VALID)
MESSAGE(LOC<<"MED_MESH_RDONLY_DRIVER::getNoeuds() : WARNING : Nodes have names but we do not read them !");
delete[] tmp_node_name ;
// ??? Read the unused optional node Numbers ???
- int * tmp_node_number = new int[NumberOfNodes] ;
+ med_2_1::med_int * tmp_node_number = new med_2_1::med_int[NumberOfNodes] ;
err=MEDnumLire(_medIdt,const_cast <char*> (_ptrMesh->_name.c_str()),
- tmp_node_number,NumberOfNodes,MED_FR::MED_NOEUD,(MED_FR::med_geometrie_element)0);
+ tmp_node_number,NumberOfNodes,med_2_1::MED_NOEUD,(med_2_1::med_geometrie_element)0);
if (err == MED_VALID) {
// INFOS(LOC<<"WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING");
// INFOS(LOC<<"MED_MESH_RDONLY_DRIVER::getNoeuds() : WARNING : Nodes have numbers but we do not take care of them !");
// INFOS(LOC<<"WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING");
MESSAGE(LOC<<"MED_MESH_RDONLY_DRIVER::getNoeuds() : Nodes have numbers, we DO TAKE care of them !");
_ptrMesh->_coordinate->_nodeNumber.set(NumberOfNodes) ;
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ for(med_2_1::med_int i2=0;i2<NumberOfNodes;i2++)
+ _ptrMesh->_coordinate->_nodeNumber[i2]=(int)(tmp_node_number[i2]);
+#else
memcpy((int*)_ptrMesh->_coordinate->_nodeNumber,tmp_node_number,sizeof(int)*NumberOfNodes) ;
+#endif
//////////////////////////////////////////////////////////////////////////////////////
/// Modification pour prise en compte de la numérotation optionnelle des noeuds ///
if (_status==MED_OPENED)
{
// Get the type of entity to work on (previously set in the Connectivity Object)
- MED_FR::med_entite_maillage Entity = (MED_FR::med_entite_maillage) Connectivity->getEntity();
+ med_2_1::med_entite_maillage Entity = (med_2_1::med_entite_maillage) Connectivity->getEntity();
// Get the number of cells of each type & store it in <tmp_cells_count>.
int * tmp_cells_count = new int[MED_NBR_GEOMETRIE_MAILLE] ;
{ // EF :ON SCANNE DES GEOMETRIES INUTILES, UTILISER LES MAPS
tmp_cells_count[i]=MEDnEntMaa(_medIdt,(const_cast <char *> (_ptrMesh->_name.c_str())),
- MED_FR::MED_CONN,(MED_FR::med_entite_maillage) Entity,
- all_cell_type[i],MED_FR::MED_NOD);
+ med_2_1::MED_CONN,(med_2_1::med_entite_maillage) Entity,
+ all_cell_type[i],med_2_1::MED_NOD);
// Get the greatest dimension of the cells : Connectivity->_entityDimension
// We suppose there is no cells used as faces in MED 2.2.x , this is forbidden !!!
// if MED version < 2.2.x, we read only entity with dimention = Connectivity->_entityDimension. Lesser dimension are face or edge !
char version_med[10] ;
- if ( MEDfichEntete(_medIdt,MED_FR::MED_VERSION,version_med) != 0 )
+ if ( MEDfichEntete(_medIdt,med_2_1::MED_VERSION,version_med) != 0 )
{
// error : we suppose we have not a good med file !
delete[] tmp_cells_count ;
tmpFaceCount[0] = 0 ;
int numberOfFacesTypes = 0;
-// if ((version_med != "2.2")&(Entity==MED_FR::MED_MAILLE))
+// if ((version_med != "2.2")&(Entity==med_2_1::MED_MAILLE))
// {
// Connectivity->_numberOfTypes=0;
// }
// }
- if (Entity==MED_FR::MED_MAILLE)
+ if (Entity==med_2_1::MED_MAILLE)
{
Connectivity->_numberOfTypes=0;
for ( i=0;i<Connectivity->_numberOfTypes;i++)
{
int multi = 0 ;
- MED_FR::med_geometrie_element med_type = (MED_FR::med_geometrie_element) Connectivity->_type[i].getType() ;
+ med_2_1::med_geometrie_element med_type = (med_2_1::med_geometrie_element) Connectivity->_type[i].getType() ;
//if ( Connectivity->_type[i].getDimension() < Connectivity->_entityDimension)
if (Connectivity->_entity == MED_CELL)
if ( Connectivity->_type[i].getDimension() < _ptrMesh->_spaceDimension)
NodalIndex[j]=NodalIndex[j-1]+NumberOfNodeByCell ;
int tmp_numberOfCells = Connectivity->_count[i+1]-Connectivity->_count[i] ;
- int * tmp_ConnectivityArray = new int[(NumberOfNodeByCell+multi)*tmp_numberOfCells];
+ med_2_1::med_int * tmp_ConnectivityArray = new med_2_1::med_int[(NumberOfNodeByCell+multi)*tmp_numberOfCells];
//int err=MEDconnLire(_medIdt,const_cast <char *> (_ptrMesh->_name.c_str()),
// Connectivity->_entityDimension,tmp_ConnectivityArray,
- //MED_FR::MED_FULL_INTERLACE,NULL,0,Entity,med_type,MED_FR::MED_NOD);
+ //med_2_1::MED_FULL_INTERLACE,NULL,0,Entity,med_type,med_2_1::MED_NOD);
int err=MEDconnLire(_medIdt,const_cast <char *> (_ptrMesh->_name.c_str()),
_ptrMesh->_spaceDimension,tmp_ConnectivityArray,
- MED_FR::MED_FULL_INTERLACE,NULL,0,Entity,med_type,
- MED_FR::MED_NOD);
+ med_2_1::MED_FULL_INTERLACE,NULL,0,Entity,med_type,
+ med_2_1::MED_NOD);
if ( err != MED_VALID)
{
// version originale sans prise en compte des numéros optionnels
//
for ( j=0; j<tmp_numberOfCells; j++) for (int k=0; k<NumberOfNodeByCell; k++)
- ConnectivityArray[j*NumberOfNodeByCell+k]=tmp_ConnectivityArray[j*(NumberOfNodeByCell+multi)+k] ;
+ ConnectivityArray[j*NumberOfNodeByCell+k]=(int)(tmp_ConnectivityArray[j*(NumberOfNodeByCell+multi)+k]) ;
//////////////////////////////////////////////////////////////////////////////
// Modification pour prise en compte de la numérotation optionnelle des noeuds ///
// Fill the MEDSKYLINEARRAY by reading the MED file.
for ( i=0; i<constituent->_numberOfTypes; i++) {
- MED_FR::med_geometrie_element med_type = (MED_FR::med_geometrie_element) constituent->_type[i].getType() ;
+ med_2_1::med_geometrie_element med_type = (med_2_1::med_geometrie_element) constituent->_type[i].getType() ;
int NumberOfNodeByFace = constituent->_type[i].getNumberOfNodes() ;
int tmp_numberOfFaces = constituent->_count[i+1]-constituent->_count[i] ;
// Il faut ajouter 1 pour le zero a la lecture !!!
// ATTENTION UNIQUEMENT POUR MED < 2.2.x
- int * tmp_constituentArray = NULL;
+ med_2_1::med_int * tmp_constituentArray = NULL;
if (version_med != "2.2")
- tmp_constituentArray = new int[(NumberOfNodeByFace+1)*tmp_numberOfFaces] ;
+ tmp_constituentArray = new med_2_1::med_int[(NumberOfNodeByFace+1)*tmp_numberOfFaces] ;
else {
- tmp_constituentArray = new int[NumberOfNodeByFace*tmp_numberOfFaces] ;
+ tmp_constituentArray = new med_2_1::med_int[NumberOfNodeByFace*tmp_numberOfFaces] ;
MESSAGE(LOC<<": WE ARE USING MED2.2 so there is no +1 for calculating the size of tmp_constituentArray !") ;
}
int err=MEDconnLire(_medIdt,const_cast <char *> (_ptrMesh->_name.c_str()),
Connectivity->_entityDimension,tmp_constituentArray,
- MED_FR::MED_FULL_INTERLACE,NULL,0,MED_FR::MED_MAILLE,med_type,MED_FR::MED_NOD);
+ med_2_1::MED_FULL_INTERLACE,NULL,0,med_2_1::MED_MAILLE,med_type,med_2_1::MED_NOD);
if ( err != MED_VALID) {
MESSAGE(LOC<<": MEDconnLire returns "<<err) ;
//
for (int j=0; j<tmp_numberOfFaces; j++)
for (int k=0; k<NumberOfNodeByFace; k++)
- constituentArray[j*NumberOfNodeByFace+k]=tmp_constituentArray[j*(NumberOfNodeByFace+1)+k] ;
+ constituentArray[j*NumberOfNodeByFace+k]=(int)(tmp_constituentArray[j*(NumberOfNodeByFace+1)+k]) ;
//////////////////////////////////////////////////////////////////////////////////////
/// Modification pour prise en compte de la numérotation optionnelle des noeuds ///
// Fill the MEDSKYLINEARRAY by reading the MED file.
for ( i=0; i<constituent->_numberOfTypes; i++) {
- MED_FR::med_geometrie_element med_type = (MED_FR::med_geometrie_element) constituent->_type[i].getType() ;
+ med_2_1::med_geometrie_element med_type = (med_2_1::med_geometrie_element) constituent->_type[i].getType() ;
int NumberOfNodeByEdge = constituent->_type[i].getNumberOfNodes() ;
// Il faut ajouter 1 pour le zero a la lecture !!!
// ATTENTION UNIQUEMENT POUR MED < 2.2.x
- int * tmp_constituentArray = NULL;
+ med_2_1::med_int * tmp_constituentArray = NULL;
if (version_med != "2.2")
- tmp_constituentArray = new int[(NumberOfNodeByEdge+1)*tmp_numberOfEdges] ;
+ tmp_constituentArray = new med_2_1::med_int[(NumberOfNodeByEdge+1)*tmp_numberOfEdges] ;
else {
- tmp_constituentArray = new int[NumberOfNodeByEdge*tmp_numberOfEdges] ;
+ tmp_constituentArray = new med_2_1::med_int[NumberOfNodeByEdge*tmp_numberOfEdges] ;
MESSAGE(LOC<<": WE ARE USING MED2.2 so there is no +1 for calculating the size of tmp_constituentArray !") ;
}
int err=MEDconnLire(_medIdt,const_cast <char *> (_ptrMesh->_name.c_str()),
_ptrMesh->_spaceDimension,tmp_constituentArray,
- MED_FR::MED_FULL_INTERLACE,NULL,0,MED_FR::MED_MAILLE,med_type,MED_FR::MED_NOD);
+ med_2_1::MED_FULL_INTERLACE,NULL,0,med_2_1::MED_MAILLE,med_type,med_2_1::MED_NOD);
if ( err != MED_VALID) {
MESSAGE(LOC<<": MEDconnLire returns "<<err) ;
delete constituent ;
//
for (int j=0; j<tmp_numberOfEdges; j++)
for (int k=0; k<NumberOfNodeByEdge; k++)
- constituentArray[j*NumberOfNodeByEdge+k]=tmp_constituentArray[j*(NumberOfNodeByEdge+1)+k] ;
+ constituentArray[j*NumberOfNodeByEdge+k]=(int)(tmp_constituentArray[j*(NumberOfNodeByEdge+1)+k]) ;
//////////////////////////////////////////////////////////////////////////////////////
/// Modification pour prise en compte de la numérotation optionnelle des noeuds ///
for (int i=0;i<_ptrMesh->getNumberOfTypes(MED_CELL);i++)
MEDArrayCellFamily[i] = new int[_ptrMesh->getNumberOfElements(MED_CELL,myTypes[i])] ;
- err = getCellsFamiliesNumber(MEDArrayCellFamily,_ptrMesh->_connectivity) ;
+ err = getCellsFamiliesNumber(MEDArrayCellFamily,_ptrMesh->_connectivity,MED_CELL) ;
MESSAGE(LOC << "error returned from getCellsFamiliesNumber for Cells " << err);
for (int i=0;i<_ptrMesh->getNumberOfTypes(MED_FACE);i++)
MEDArrayFaceFamily[i] = new int[_ptrMesh->getNumberOfElements(MED_FACE,myTypes[i])] ;
- err = getCellsFamiliesNumber(MEDArrayFaceFamily,_ptrMesh->_connectivity->_constituent) ;
+ err = getCellsFamiliesNumber(MEDArrayFaceFamily,_ptrMesh->_connectivity->_constituent,MED_FACE) ;
MESSAGE(LOC << "error returned from getCellsFamiliesNumber for Faces " << err);
myTypes = _ptrMesh->getTypes(MED_EDGE);
for (int i=0;i<_ptrMesh->getNumberOfTypes(MED_EDGE);i++)
MEDArrayEdgeFamily[i] = new int[_ptrMesh->getNumberOfElements(MED_EDGE,myTypes[i])] ;
- err = getCellsFamiliesNumber(MEDArrayEdgeFamily,_ptrMesh->_connectivity->_constituent) ;
+ err = getCellsFamiliesNumber(MEDArrayEdgeFamily,_ptrMesh->_connectivity->_constituent,MED_EDGE) ;
MESSAGE(LOC << "error returned from getCellsFamiliesNumber for Edges in 2D " << err);
myTypes = _ptrMesh->getTypes(MED_EDGE);
for (int i=0;i<_ptrMesh->getNumberOfTypes(MED_EDGE);i++)
MEDArrayEdgeFamily[i] = new int[_ptrMesh->getNumberOfElements(MED_EDGE,myTypes[i])] ;
- err = getCellsFamiliesNumber(MEDArrayEdgeFamily,_ptrMesh->_connectivity->_constituent->_constituent) ; // we are in 3D !
+ err = getCellsFamiliesNumber(MEDArrayEdgeFamily,_ptrMesh->_connectivity->_constituent->_constituent,MED_EDGE) ; // we are in 3D !
MESSAGE(LOC << "error returned from getCellsFamiliesNumber for Edges in 3D " << err);
// node
int NumberOfNodes = _ptrMesh->getNumberOfNodes() ;
MEDArrayNodeFamily = new int[ NumberOfNodes ];
- err = MED_FR::MEDfamGridLire (_medIdt,
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ med_2_1::med_int* MEDArrayNodeFamily2 = new med_2_1::med_int[ NumberOfNodes ];
+ err = med_2_1::MEDfamGridLire (_medIdt,
+ const_cast <char *> (_ptrMesh->_name.c_str()),
+ MEDArrayNodeFamily2,
+ NumberOfNodes,
+ med_2_1::MED_NOEUD);
+ for(int i=0;i<NumberOfNodes;i++)
+ MEDArrayNodeFamily[i]=(int) MEDArrayNodeFamily2[i];
+ delete [] MEDArrayNodeFamily2;
+#else
+ err = med_2_1::MEDfamGridLire (_medIdt,
const_cast <char *> (_ptrMesh->_name.c_str()),
MEDArrayNodeFamily,
NumberOfNodes,
- MED_FR::MED_NOEUD);
-
+ med_2_1::MED_NOEUD);
+#endif
// what about cell face and edge ?
}
// Creation of the families
- int NumberOfFamilies = MEDnFam(_medIdt,const_cast <char *> (_meshName.c_str()),0,MED_FR::MED_FAMILLE) ;
+ int NumberOfFamilies = MEDnFam(_medIdt,const_cast <char *> (_meshName.c_str()),0,med_2_1::MED_FAMILLE) ;
if ( NumberOfFamilies < 1 ) // at least family 0 must exist
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"There is no FAMILY, FAMILY 0 must exists" ));
for (int i=0;i<NumberOfFamilies;i++) {
- int NumberOfAttributes = MEDnFam(_medIdt,const_cast <char *> (_meshName.c_str()),i+1,MED_FR::MED_ATTR) ;
+ med_2_1::med_int NumberOfAttributes = MEDnFam(_medIdt,const_cast <char *> (_meshName.c_str()),i+1,med_2_1::MED_ATTR) ;
if (NumberOfAttributes < 0)
throw MEDEXCEPTION("MED_MESH_RDONLY_DRIVER::getFAMILY() : NumberOfAttributes" );
- int NumberOfGroups = MEDnFam(_medIdt,const_cast <char *> (_meshName.c_str()),i+1,MED_FR::MED_GROUPE) ;
+ med_2_1::med_int NumberOfGroups = MEDnFam(_medIdt,const_cast <char *> (_meshName.c_str()),i+1,med_2_1::MED_GROUPE) ;
if (NumberOfGroups < 0)
throw MEDEXCEPTION("MED_MESH_RDONLY_DRIVER::getFAMILY() : NumberOfGroups" );
- int FamilyIdentifier ;
+ med_2_1::med_int FamilyIdentifier ;
string FamilyName(MED_TAILLE_NOM,'\0');
int * AttributesIdentifier = new int[NumberOfAttributes] ;
int * AttributesValues = new int[NumberOfAttributes] ;
string AttributesDescription(MED_TAILLE_DESC*NumberOfAttributes,' ') ;
string GroupsNames(MED_TAILLE_LNOM*NumberOfGroups+1,'\0') ;
- err = MED_FR::MEDfamInfo(_medIdt,const_cast <char *> (_meshName.c_str()),
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ med_2_1::med_int tmp_NumberOfAttributes=NumberOfAttributes;
+ med_2_1::med_int * AttributesIdentifier2 = new med_2_1::med_int[NumberOfAttributes] ;
+ med_2_1::med_int * AttributesValues2 = new med_2_1::med_int[NumberOfAttributes] ;
+ err = med_2_1::MEDfamInfo(_medIdt,const_cast <char *> (_meshName.c_str()),
+ i+1,const_cast <char *> (FamilyName.c_str()),
+ &FamilyIdentifier,AttributesIdentifier2,AttributesValues2,
+ const_cast <char *> (AttributesDescription.c_str()),
+ &NumberOfAttributes,
+ const_cast <char *> (GroupsNames.c_str()),&NumberOfGroups
+ );
+ for(med_2_1::med_int i2=0;i2<tmp_NumberOfAttributes;i2++)
+ {
+ AttributesIdentifier[i2]=(int)(AttributesIdentifier2[i2]);
+ AttributesValues[i2]=(int)(AttributesValues2[i2]);
+ }
+ delete [] AttributesIdentifier2;
+ delete [] AttributesValues2;
+#else
+ err = med_2_1::MEDfamInfo(_medIdt,const_cast <char *> (_meshName.c_str()),
i+1,const_cast <char *> (FamilyName.c_str()),
&FamilyIdentifier,AttributesIdentifier,AttributesValues,
const_cast <char *> (AttributesDescription.c_str()),
&NumberOfAttributes,
const_cast <char *> (GroupsNames.c_str()),&NumberOfGroups
);
-
+#endif
SCRUTE(GroupsNames);
SCRUTE(FamilyName);
if (err != MED_VALID)
throw MEDEXCEPTION("MED_MESH_RDONLY_DRIVER::getFAMILY() : ERROR when get FAMILY informations" );
if (FamilyIdentifier != 0 ) {
- FAMILY * Family = new FAMILY(_ptrMesh,FamilyIdentifier,FamilyName,
- NumberOfAttributes,AttributesIdentifier,
+ FAMILY * Family = new FAMILY(_ptrMesh,(int)FamilyIdentifier,FamilyName,
+ (int)NumberOfAttributes,AttributesIdentifier,
AttributesValues,AttributesDescription,
- NumberOfGroups,GroupsNames,
+ (int)NumberOfGroups,GroupsNames,
MEDArrayNodeFamily,
MEDArrayCellFamily,
MEDArrayFaceFamily,
BEGIN_OF(LOC);
if (_status==MED_OPENED) {
int err = 0 ;
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ int lgth=_ptrMesh->getNumberOfNodes();
+ med_2_1::med_int *temp=new med_2_1::med_int[lgth];
+ err = MEDfamLire(_medIdt,(const_cast <char *> (_ptrMesh->_name.c_str())),
+ temp,
+ _ptrMesh->getNumberOfNodes(),
+ med_2_1::MED_NOEUD,(med_2_1::med_geometrie_element) MED_NONE);
+ for(int i2=0;i2<lgth;i2++)
+ MEDArrayNodeFamily[i2]=(int)(temp[i2]);
+ delete [] temp;
+#else
err = MEDfamLire(_medIdt,(const_cast <char *> (_ptrMesh->_name.c_str())),
MEDArrayNodeFamily,
_ptrMesh->getNumberOfNodes(),
- MED_FR::MED_NOEUD,(MED_FR::med_geometrie_element) MED_NONE);
+ med_2_1::MED_NOEUD,(med_2_1::med_geometrie_element) MED_NONE);
+#endif
if ( err != MED_VALID) {
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) << "There is no family for the |"<< _ptrMesh->getNumberOfNodes()
<< "| nodes in mesh |"
return MED_ERROR;
}
-int MED_MESH_RDONLY_DRIVER::getCellsFamiliesNumber(int **MEDArrayFamily,CONNECTIVITY *Connectivity)
+int MED_MESH_RDONLY_DRIVER::getCellsFamiliesNumber(int **MEDArrayFamily,CONNECTIVITY *Connectivity, MED_EN::medEntityMesh entity)
{
const char * LOC = "MED_MESH_RDONLY_DRIVER::getCellsFamiliesNumber " ;
BEGIN_OF(LOC);
int i, err = 0 ;
for (i=0;i<Connectivity->_numberOfTypes;i++) {
int NumberOfCell = Connectivity->_count[i+1]-Connectivity->_count[i] ;
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ const medGeometryElement * myTypes = _ptrMesh->getTypes(entity);
+ int lgthI=_ptrMesh->getNumberOfElements(entity,myTypes[i]);
+ med_2_1::med_int *temp=new med_2_1::med_int[lgthI];
+ err=MEDfamLire(_medIdt,const_cast <char *> (_ptrMesh->_name.c_str()),
+ temp,NumberOfCell,
+ (med_2_1::med_entite_maillage) Connectivity->_entity,
+ (med_2_1::med_geometrie_element) Connectivity->_geometricTypes[i]);
+ for(int i2=0;i2<lgthI;i2++)
+ MEDArrayFamily[i][i2]=(int)(temp[i2]);
+ delete [] temp;
+#else
err=MEDfamLire(_medIdt,const_cast <char *> (_ptrMesh->_name.c_str()),
MEDArrayFamily[i],NumberOfCell,
- (MED_FR::med_entite_maillage) Connectivity->_entity,
- (MED_FR::med_geometrie_element) Connectivity->_geometricTypes[i]);
+ (med_2_1::med_entite_maillage) Connectivity->_entity,
+ (med_2_1::med_geometrie_element) Connectivity->_geometricTypes[i]);
+#endif
// provisoire : si les faces ou les aretes sont des mailles !!!
if (err != MED_VALID) {
MESSAGE(LOC<<"search face/edge family on cell !!!");
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ int lgthI=_ptrMesh->getNumberOfElements(entity,myTypes[i]);
+ med_2_1::med_int *temp=new med_2_1::med_int[lgthI];
+ err=MEDfamLire(_medIdt,const_cast <char *> (_ptrMesh->_name.c_str()),
+ temp,NumberOfCell,
+ med_2_1::MED_MAILLE,
+ (med_2_1::med_geometrie_element) Connectivity->_geometricTypes[i]);
+ for(int i2=0;i2<lgthI;i2++)
+ MEDArrayFamily[i][i2]=(int)(temp[i2]);
+ delete [] temp;
+#else
err=MEDfamLire(_medIdt,const_cast <char *> (_ptrMesh->_name.c_str()),
MEDArrayFamily[i],NumberOfCell,
- MED_FR::MED_MAILLE,
- (MED_FR::med_geometrie_element) Connectivity->_geometricTypes[i]);
+ med_2_1::MED_MAILLE,
+ (med_2_1::med_geometrie_element) Connectivity->_geometricTypes[i]);
+#endif
}
if (err != MED_VALID)
if ( err < MED_VALID ) {
SCRUTE(err);
- err = MED_FR::MEDfamCr( _medIdt,
+ err = med_2_1::MEDfamCr( _medIdt,
const_cast <char *> ( _meshName.c_str() ),
"FAMILLE_0", 0,
- (int*)NULL, (int*)NULL, (char*)NULL, 0,
+ (med_2_1::med_int*)NULL, (med_2_1::med_int*)NULL, (char*)NULL, 0,
(char*)NULL, 0);
if ( err != MED_VALID)
}
GRID * ptrGrid = (GRID*) _ptrMesh;
- MED_FR::med_err err = MED_ERROR;
- MED_FR::med_repere rep;
+ med_2_1::med_err err = MED_ERROR;
+ med_2_1::med_repere rep;
string tmp_name(_ptrMesh->_spaceDimension*MED_TAILLE_PNOM,' ');
string tmp_unit(_ptrMesh->_spaceDimension*MED_TAILLE_PNOM,' ');
// If it doesn't exists create it
// If it already exists verify if its dimension is the same as <_ptrMesh->_spaceDimension>
// rem : <_meshName> is the driver meshName not <ptrMesh->_meshName>
- int dim = MED_FR::MEDdimLire(_medIdt, const_cast <char *> (_meshName.c_str()) );
+ int dim = med_2_1::MEDdimLire(_medIdt, const_cast <char *> (_meshName.c_str()) );
if (dim < MED_VALID)
{
- err = MEDgridCr(_medIdt,
+ err = med_2_1::MEDgridCr(_medIdt,
const_cast <char *> (_meshName.c_str()),
_ptrMesh->_spaceDimension,
- (MED_FR::med_grid_type) ptrGrid->getGridType());
+ (med_2_1::med_grid_type) ptrGrid->getGridType());
if (err != MED_VALID)
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) << "Unable to create Grid"));
else
// Pourquoi le stocker sous forme de chaîne ?
const string & coordinateSystem = _ptrMesh->_coordinate->_coordinateSystem;
if (coordinateSystem == "CARTESIAN")
- rep = MED_FR::MED_CART;
+ rep = med_2_1::MED_CART;
else if ( coordinateSystem == "CYLINDRICAL")
- rep = MED_FR::MED_CYL;
+ rep = med_2_1::MED_CYL;
else if ( coordinateSystem == "SPHERICAL" )
- rep = MED_FR::MED_SPHER;
+ rep = med_2_1::MED_SPHER;
else
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"Grid |" << _meshName.c_str() <<
"| doesn't have a valid coordinate system : |"
<< _ptrMesh->_coordinate->_coordinateSystem
<< "|" )) ;
- int ArrayLen[] = { ptrGrid->_iArrayLength,
- ptrGrid->_jArrayLength,
- ptrGrid->_kArrayLength };
+ med_2_1::med_int ArrayLen[] = { (med_2_1::med_int) ptrGrid->_iArrayLength,
+ (med_2_1::med_int) ptrGrid->_jArrayLength,
+ (med_2_1::med_int) ptrGrid->_kArrayLength };
// Write node coordinates for MED_BODY_FITTED grid
if (ptrGrid->getGridType() == MED_EN::MED_BODY_FITTED)
(_ptrMesh->_coordinate->getCoordinates(MED_EN::MED_FULL_INTERLACE));
// Write unused families
- int * MEDArrayNodeFamily = new int[_ptrMesh->_numberOfNodes] ;
+ //CCRT unused => med_2_1::med_int
+ med_2_1::med_int * MEDArrayNodeFamily = new med_2_1::med_int[_ptrMesh->_numberOfNodes] ;
err = MEDbodyFittedEcr (_medIdt,
const_cast <char *> (_ptrMesh->_name.c_str()),
_ptrMesh->_spaceDimension,
coo,
ArrayLen,
- MED_FR::MED_FULL_INTERLACE,
+ med_2_1::MED_FULL_INTERLACE,
rep,
const_cast <char *> (tmp_name.c_str()),
const_cast <char *> (tmp_unit.c_str()),
MEDArrayNodeFamily,
_ptrMesh->_numberOfNodes,
- MED_FR::MED_REMP);
+ med_2_1::MED_REMP);
delete[] MEDArrayNodeFamily;
if (err != MED_VALID)
int idim;
for (idim = 0; idim < _ptrMesh->_spaceDimension; ++idim)
{
- err = MEDgridEcr (_medIdt,
+ err = med_2_1::MEDgridEcr (_medIdt,
const_cast <char *> (_ptrMesh->_name.c_str()),
_ptrMesh->_spaceDimension,
Array [idim],
ArrayLen [idim],
idim,
- MED_FR::MED_FULL_INTERLACE,
+ med_2_1::MED_FULL_INTERLACE,
rep,
const_cast <char *> (tmp_name.c_str()),
const_cast <char *> (tmp_unit.c_str()),
- MED_FR::MED_REMP);
+ med_2_1::MED_REMP);
if (err != MED_VALID)
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"Can't read grid coordinates for "
<< idim << "-th dimention"));
// const_cast <char *> (_ptrMesh->_name.c_str()),
// _ptrMesh->_MEDArrayNodeFamily,
// _ptrMesh->_numberOfNodes,
-// MED_FR::MED_REMP,
-// MED_FR::MED_NOEUD);
+// med_2_1::MED_REMP,
+// med_2_1::MED_NOEUD);
if (err != MED_VALID)
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"error in MEDfamGridEcr()"));
const char * LOC = "int MED_MESH_WRONLY_DRIVER::writeCoordinates() const : ";
BEGIN_OF(LOC);
- MED_FR::med_err err = MED_ERROR;
- MED_FR::med_repere rep;
+ med_2_1::med_err err = MED_ERROR;
+ med_2_1::med_repere rep;
string tmp_name(_ptrMesh->_spaceDimension*MED_TAILLE_PNOM,' ');
string tmp_unit(_ptrMesh->_spaceDimension*MED_TAILLE_PNOM,' ');
// If it doesn't exists create it
// If it already exists verify if its dimension is the same as <_ptrMesh->_spaceDimension>
// rem : <_meshName> is the driver meshName not <ptrMesh->_meshName>
- int dim = MED_FR::MEDdimLire(_medIdt, const_cast <char *> (_meshName.c_str()) );
+ int dim = med_2_1::MEDdimLire(_medIdt, const_cast <char *> (_meshName.c_str()) );
if (dim < MED_VALID)
- if (MED_FR::MEDmaaCr(_medIdt,const_cast <char *> (_meshName.c_str()),_ptrMesh->_spaceDimension) != 0 )
+ if (med_2_1::MEDmaaCr(_medIdt,const_cast <char *> (_meshName.c_str()),_ptrMesh->_spaceDimension) != 0 )
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) << "Unable to create Mesh : |" << _meshName << "|"));
else
{
// Pourquoi le stocker sous forme de chaîne ?
const string & coordinateSystem = _ptrMesh->_coordinate->_coordinateSystem;
if (coordinateSystem == "CARTESIAN")
- rep = MED_FR::MED_CART;
+ rep = med_2_1::MED_CART;
else if ( coordinateSystem == "CYLINDRICAL")
- rep = MED_FR::MED_CYL;
+ rep = med_2_1::MED_CYL;
else if ( coordinateSystem == "SPHERICAL" )
- rep = MED_FR::MED_SPHER;
+ rep = med_2_1::MED_SPHER;
else
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"Mesh |" << _meshName.c_str() << "| doesn't have a valid coordinate system : |"
<< _ptrMesh->_coordinate->_coordinateSystem
_ptrMesh->_spaceDimension,
//const_cast <double *> ( _ptrMesh->_coordinate->_coordinate->get(MED_EN::MED_FULL_INTERLACE) ),
const_cast <double *> ( _ptrMesh->_coordinate->_coordinate.get(MED_EN::MED_FULL_INTERLACE) ),
- MED_FR::MED_FULL_INTERLACE,
+ med_2_1::MED_FULL_INTERLACE,
_ptrMesh->_numberOfNodes, // _ptrMesh->_coordinate->_numberOfNodes
- MED_FR::MED_REMP,
+ med_2_1::MED_REMP,
rep,
const_cast <char *> (tmp_name.c_str()),
const_cast <char *> (tmp_unit.c_str())
if (_ptrMesh->_arePresentOptionnalNodesNumbers==1) {
-
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ int lgth=_ptrMesh->_coordinate->getNumberOfNodes();
+ med_2_1::med_int *temp=new med_2_1::med_int[lgth];
+ for(int i2=0;i2<lgth;i2++)
+ temp[i2]=(med_2_1::med_int)(_ptrMesh->_coordinate->getNodesNumbers()[i2]);
+ err = MEDnumEcr(_medIdt,const_cast <char *> (_meshName.c_str()),
+ temp,
+ _ptrMesh->_numberOfNodes, med_2_1::MED_REMP,
+ med_2_1::MED_NOEUD, med_2_1::med_geometrie_element(0) );
+ delete [] temp;
+#else
err = MEDnumEcr(_medIdt,const_cast <char *> (_meshName.c_str()),
- const_cast <med_int *> (_ptrMesh->_coordinate->getNodesNumbers() ),
- _ptrMesh->_numberOfNodes, MED_FR::MED_REMP,
- MED_FR::MED_NOEUD, MED_FR::med_geometrie_element(0) );
-
+ const_cast <int *> (_ptrMesh->_coordinate->getNodesNumbers() ),
+ _ptrMesh->_numberOfNodes, med_2_1::MED_REMP,
+ med_2_1::MED_NOEUD, med_2_1::med_geometrie_element(0) );
+#endif
if (err<0)
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"Can't write optionnal numbers of mesh |" << _meshName.c_str()
const char * LOC="int MED_MESH_WRONLY_DRIVER::writeConnectivities() const : ";
BEGIN_OF(LOC);
- MED_FR::med_err err;
+ med_2_1::med_err err;
// REM SI LA METHODE EST APPELEE DIRECTEMENT ET QUE LE MAILLAGE N'EST PAS CREE IL Y A PB !
// PG : IMPOSSIBLE : LA METHODE EST PRIVEE !
// }
//////////////////////////////////////////////////////////////////////////////////////
-
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ int lgth=numberOfElements*(numberOfNodes+multi);
+ med_2_1::med_int *temp=new med_2_1::med_int[lgth];
+ for(int i2=0;i2<lgth;i2++)
+ temp[i2]=(med_2_1::med_int)(connectivityArray[i2]);
+ err = MEDconnEcr( _medIdt, const_cast <char *> ( _meshName.c_str()), _ptrMesh->_spaceDimension,
+ temp, med_2_1::MED_FULL_INTERLACE , numberOfElements,
+ med_2_1::MED_REMP,
+ (med_2_1::med_entite_maillage ) entity,
+ (med_2_1::med_geometrie_element) types[i], med_2_1::MED_NOD );
+ delete [] temp;
+#else
err = MEDconnEcr( _medIdt, const_cast <char *> ( _meshName.c_str()), _ptrMesh->_spaceDimension,
- connectivityArray, MED_FR::MED_FULL_INTERLACE , numberOfElements,
- MED_FR::MED_REMP,
- (MED_FR::med_entite_maillage ) entity,
- (MED_FR::med_geometrie_element) types[i], MED_FR::MED_NOD );
+ connectivityArray, med_2_1::MED_FULL_INTERLACE , numberOfElements,
+ med_2_1::MED_REMP,
+ (med_2_1::med_entite_maillage ) entity,
+ (med_2_1::med_geometrie_element) types[i], med_2_1::MED_NOD );
+#endif
delete[] connectivityArray ;
-
if (err<0) // ETENDRE LES EXPLICATIONS
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"Can't write connectivities of mesh |" << _meshName.c_str() << "| in file |" << _fileName
<< "| with dimension |" << _ptrMesh->_spaceDimension <<"| and"
const int * connectivity = _ptrMesh->getConnectivity(MED_EN::MED_FULL_INTERLACE, MED_DESCENDING, entity, types[i]);
// Pour l'instant la class utilise le multi.....
- err = MED_FR::MEDconnEcr( _medIdt,
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ int lgth=_ptrMesh->getConnectivityLength(MED_EN::MED_FULL_INTERLACE, MED_DESCENDING, entity, types[i]);
+ med_2_1::med_int *temp=new med_2_1::med_int[lgth];
+ for(int i2=0;i2<lgth;i2++)
+ temp[i2]=(med_2_1::med_int)(connectivity[i2]);
+ err = med_2_1::MEDconnEcr( _medIdt,
+ const_cast <char *> ( _meshName.c_str()),
+ _ptrMesh->_spaceDimension,
+ temp,
+ med_2_1::MED_FULL_INTERLACE,
+ numberOfElements,
+ med_2_1::MED_REMP,
+ (med_2_1::med_entite_maillage ) entity,
+ (med_2_1::med_geometrie_element) types[i],
+ med_2_1::MED_DESC );
+ delete [] temp;
+#else
+ err = med_2_1::MEDconnEcr( _medIdt,
const_cast <char *> ( _meshName.c_str()),
_ptrMesh->_spaceDimension,
const_cast <int *> (connectivity),
- MED_FR::MED_FULL_INTERLACE,
+ med_2_1::MED_FULL_INTERLACE,
numberOfElements,
- MED_FR::MED_REMP,
- (MED_FR::med_entite_maillage ) entity,
- (MED_FR::med_geometrie_element) types[i],
- MED_FR::MED_DESC );
+ med_2_1::MED_REMP,
+ (med_2_1::med_entite_maillage ) entity,
+ (med_2_1::med_geometrie_element) types[i],
+ med_2_1::MED_DESC );
+#endif
if (err<0) // ETENDRE LES EXPLICATIONS
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<"Can't write connectivities of mesh |" << _meshName.c_str() << "| in file |" << _fileName
const char * LOC="int MED_MESH_WRONLY_DRIVER::writeFamilyNumbers() const : ";
BEGIN_OF(LOC);
- MED_FR::med_err err;
+ med_2_1::med_err err;
// SOLUTION TEMPORAIRE CAR _ptrMesh->_MEDArrayNodeFamily DOIT ETRE ENLEVER DE LA CLASSE MESH
for(int j=0; j<NumberOfNodes; j++) {
SCRUTE(MEDArrayNodeFamily[j]);
}
- if ( !_ptrMesh->getIsAGrid() )
+ if ( !_ptrMesh->getIsAGrid() ){
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ int lgth=NumberOfNodes;
+ med_2_1::med_int *temp=new med_2_1::med_int[lgth];
+ for(int i2=0;i2<lgth;i2++)
+ temp[i2]=(med_2_1::med_int)(MEDArrayNodeFamily[i2]);
err = MEDfamEcr(_medIdt, const_cast <char *> ( _meshName.c_str() ),
- MEDArrayNodeFamily, NumberOfNodes,MED_FR::MED_REMP ,
- MED_FR::MED_NOEUD,
- (MED_FR::med_geometrie_element) MED_NONE);
- else
+ temp, NumberOfNodes,med_2_1::MED_REMP ,
+ med_2_1::MED_NOEUD,
+ (med_2_1::med_geometrie_element) MED_NONE);
+ delete [] temp;
+#else
+ err = MEDfamEcr(_medIdt, const_cast <char *> ( _meshName.c_str() ),
+ MEDArrayNodeFamily, NumberOfNodes,med_2_1::MED_REMP ,
+ med_2_1::MED_NOEUD,
+ (med_2_1::med_geometrie_element) MED_NONE);
+#endif
+ }
+ else{
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ int lgth=NumberOfNodes;
+ med_2_1::med_int *temp=new med_2_1::med_int[lgth];
+ for(int i2=0;i2<lgth;i2++)
+ temp[i2]=(med_2_1::med_int)(MEDArrayNodeFamily[i2]);
+ err = MEDfamEcr(_medIdt, const_cast <char *> ( _meshName.c_str() ),
+ temp, NumberOfNodes,med_2_1::MED_REMP ,
+ med_2_1::MED_NOEUD,
+ (med_2_1::med_geometrie_element) MED_NONE);
+ delete [] temp;
+#else
err = MEDfamGridEcr(_medIdt,
const_cast <char *> (_ptrMesh->_name.c_str()),
MEDArrayNodeFamily,
NumberOfNodes,
- MED_FR::MED_REMP,
- MED_FR::MED_NOEUD);
+ med_2_1::MED_REMP,
+ med_2_1::MED_NOEUD);
+#endif
+ }
if ( err != MED_VALID)
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) << "Can't write node family for the |"<< NumberOfNodes
}
const int * typeCount = _ptrMesh->getGlobalNumberingIndex(entity) ;
-
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ int lgth=NumberOfElements;
+ med_2_1::med_int *temp=new med_2_1::med_int[lgth];
+ for(int i2=0;i2<lgth;i2++)
+ temp[i2]=(med_2_1::med_int) (MEDArrayFamily[i2]);
+#endif
for (int i=0; i<numberOfTypes; i++) {
-
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ err = MEDfamEcr(_medIdt, const_cast <char *> ( _meshName.c_str() ),
+ temp+typeCount[i]-1,typeCount[i+1]-typeCount[i],
+ med_2_1::MED_REMP ,
+ (med_2_1::med_entite_maillage) entity,
+ (med_2_1::med_geometrie_element) types[i]
+);
+#else
err = MEDfamEcr(_medIdt, const_cast <char *> ( _meshName.c_str() ),
MEDArrayFamily+typeCount[i]-1,typeCount[i+1]-typeCount[i],
- MED_FR::MED_REMP ,
- (MED_FR::med_entite_maillage) entity,
- (MED_FR::med_geometrie_element) types[i]
+ med_2_1::MED_REMP ,
+ (med_2_1::med_entite_maillage) entity,
+ (med_2_1::med_geometrie_element) types[i]
);
+#endif
MESSAGE("OK "<<i);
if ( err != MED_VALID)
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) << "Can't write family for the |"<< _ptrMesh->getNumberOfElements(entity, types[i])
- << "| cells of geometric type |" << MED_FR::geoNames[ (MED_FR::med_geometrie_element) types[i]] <<"|in mesh |"
+ << "| cells of geometric type |" << geoNames[ types[i]] <<"|in mesh |"
<< _ptrMesh->_name.c_str() << "|" ));
}
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ delete [] temp;
+#endif
delete[] MEDArrayFamily ;
//if (true == ToDestroy) {
// int NumberOfFamilies = myFamilies->size();
}
const int * typeCount = _ptrMesh->getGlobalNumberingIndex(entity) ;
-
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ int lgth=numberOfElements;
+ med_2_1::med_int *temp=new med_2_1::med_int[lgth];
+ for(int i2=0;i2<lgth;i2++)
+ temp[i2]=(med_2_1::med_int) (familyArray[i2]);
+#endif
for (int i=0; i<numberOfTypes; i++) {
int typeNumberOfElements = typeCount[i+1] - typeCount[i] ;
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ err = MEDfamEcr(_medIdt, const_cast <char *> ( _meshName.c_str() ),
+ temp+typeCount[i]-1, typeNumberOfElements,
+ med_2_1::MED_REMP ,
+ (med_2_1::med_entite_maillage) entity,
+ (med_2_1::med_geometrie_element) types[i]);
+#else
err = MEDfamEcr(_medIdt, const_cast <char *> ( _meshName.c_str() ),
familyArray+typeCount[i]-1, typeNumberOfElements,
- MED_FR::MED_REMP ,
- (MED_FR::med_entite_maillage) entity,
- (MED_FR::med_geometrie_element) types[i]);
-
+ med_2_1::MED_REMP ,
+ (med_2_1::med_entite_maillage) entity,
+ (med_2_1::med_geometrie_element) types[i]);
+#endif
if ( err != MED_VALID)
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) << "Can't write family for the |"<< _ptrMesh->getNumberOfElements(entity, types[i])
- << "| faces of geometric type |" << MED_FR::geoNames[ (MED_FR::med_geometrie_element) types[i]] <<"|in mesh |"
+ << "| faces of geometric type |" << geoNames[types[i]] <<"|in mesh |"
<< _ptrMesh->_name.c_str() << "|" ));
}
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ delete [] temp;
+#endif
delete[] familyArray ;
//if (true == ToDestroy) {
// int NumberOfFamilies = myFamilies->size();
}
const int * typeCount = _ptrMesh->getGlobalNumberingIndex(entity) ;
-
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ int lgth=numberOfElements;
+ med_2_1::med_int *temp=new med_2_1::med_int[lgth];
+ for(int i2=0;i2<lgth;i2++)
+ temp[i2]=(med_2_1::med_int) (familyArray[i2]);
+#endif
for (int i=0; i<numberOfTypes; i++) {
int typeNumberOfElements = typeCount[i+1] - typeCount[i] ;
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ err = MEDfamEcr(_medIdt, const_cast <char *> ( _meshName.c_str() ),
+ temp+typeCount[i]-1, typeNumberOfElements,
+ med_2_1::MED_REMP ,
+ (med_2_1::med_entite_maillage) entity,
+ (med_2_1::med_geometrie_element) types[i]);
+#else
err = MEDfamEcr(_medIdt, const_cast <char *> ( _meshName.c_str() ),
familyArray+typeCount[i]-1, typeNumberOfElements,
- MED_FR::MED_REMP ,
- (MED_FR::med_entite_maillage) entity,
- (MED_FR::med_geometrie_element) types[i]);
-
+ med_2_1::MED_REMP ,
+ (med_2_1::med_entite_maillage) entity,
+ (med_2_1::med_geometrie_element) types[i]);
+#endif
if ( err != MED_VALID)
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) << "Can't write family for the |"<< _ptrMesh->getNumberOfElements(entity, types[i])
- << "| edges of geometric type |" << MED_FR::geoNames[ (MED_FR::med_geometrie_element) types[i]] <<"|in mesh |"
+ << "| edges of geometric type |" << geoNames[types[i]] <<"|in mesh |"
<< _ptrMesh->_name.c_str() << "|" ));
}
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ delete [] temp;
+#endif
delete[] familyArray ;
//if (true == ToDestroy) {
// int NumberOfFamilies = myFamilies->size();
const char * LOC="int MED_MESH_WRONLY_DRIVER::writeFamilies(vector<FAMILY*> families) const : ";
BEGIN_OF(LOC);
- MED_FR::med_err err;
+ med_2_1::med_err err;
MESSAGE(LOC<<" families.size() :"<<families.size());
MESSAGE(LOC<<"attributesDescriptions.c_str() : "<<attributesDescriptions.c_str());
MESSAGE(LOC<<"numberOfGroups : "<<numberOfGroups);
MESSAGE(LOC<<"groupsNames.c_str() : "<<groupsNames.c_str());
-
- err = MED_FR::MEDfamCr( _medIdt,
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
+ int lgth=families[i]->getNumberOfAttributes();
+ med_2_1::med_int * AttributesIdentifier2 = new med_2_1::med_int[lgth] ;
+ med_2_1::med_int * AttributesValues2 = new med_2_1::med_int[lgth] ;
+ for(med_2_1::med_int i2=0;i2<lgth;i2++)
+ {
+ AttributesIdentifier2[i2]=(med_2_1::med_int)(families[i]->getAttributesIdentifiers()[i2]);
+ AttributesValues2[i2]=(med_2_1::med_int)(families[i]->getAttributesValues()[i2]);
+ }
+ err = med_2_1::MEDfamCr( _medIdt,
+ const_cast <char *> ( _meshName.c_str() ),
+ const_cast <char *> ( families[i]->getName().c_str() ),
+ families[i]->getIdentifier(),
+ AttributesIdentifier2,
+ AttributesValues2,
+ const_cast <char *> (attributesDescriptions.c_str()),
+ numberOfAttributes,
+ const_cast <char *> (groupsNames.c_str()),
+ numberOfGroups);
+ delete [] AttributesIdentifier2;
+ delete [] AttributesValues2;
+#else
+ err = med_2_1::MEDfamCr( _medIdt,
const_cast <char *> ( _meshName.c_str() ),
const_cast <char *> ( families[i]->getName().c_str() ),
families[i]->getIdentifier(),
numberOfAttributes,
const_cast <char *> (groupsNames.c_str()),
numberOfGroups);
+#endif
SCRUTE(err);
if ( err != MED_VALID)
throw MEDEXCEPTION(LOCALIZED(STRING(LOC) << "Can't create family |" << families[i]->getName()
protected:
MESH * _ptrMesh;
- MED_FR::med_idt _medIdt;
+ med_2_1::med_idt _medIdt;
string _meshName; // const ?
int _meshNum; // INUTILE ?
public :
// all MED cell type
- static const MED_FR::med_geometrie_element all_cell_type[MED_NBR_GEOMETRIE_MAILLE];
+ static const med_2_1::med_geometrie_element all_cell_type[MED_NBR_GEOMETRIE_MAILLE];
static const char * const all_cell_type_tab [MED_NBR_GEOMETRIE_MAILLE];
*/
MED_MESH_DRIVER(const string & fileName,
MESH * ptrMesh,
- med_mode_acces accessMode) ;
+ MED_EN::med_mode_acces accessMode) ;
/*!
Copy constructor.
*/
int getNodalConnectivity(CONNECTIVITY * Connectivity) ;
int getDescendingConnectivity(CONNECTIVITY * Connectivity) ;
int getNodesFamiliesNumber(int * MEDArrayNodeFamily) ;
- int getCellsFamiliesNumber(int** Arrays, CONNECTIVITY* Connectivity) ;
+ int getCellsFamiliesNumber(int** Arrays, CONNECTIVITY* Connectivity, MED_EN::medEntityMesh entity) ;
void updateFamily() ;
void buildAllGroups(vector<GROUP*> & Groups, vector<FAMILY*> & Families) ;
void getGRID ();
private:
int writeCoordinates () const;
- int writeConnectivities (medEntityMesh entity) const;
+ int writeConnectivities (MED_EN::medEntityMesh entity) const;
int writeFamilyNumbers () const;
int writeFamilies (vector<FAMILY*> & families) const;
int writeGRID() const;
-using namespace std;
/*
File Mesh.cxx
$Header$
#include "MEDMEM_DriverFactory.hxx"
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
+
//#include "MEDMEM_Grid.hxx" this inclision should have never be here !!!
//update Families with content list
BEGIN_OF(LOC);
- string _name = "NOT DEFINED"; // A POSITIONNER EN FCT DES IOS ?
+ _name = "NOT DEFINED"; // A POSITIONNER EN FCT DES IOS ?
_coordinate = (COORDINATE *) NULL;
_connectivity = (CONNECTIVITY *) NULL;
if (k==3) entity = MED_FACE;
if (k==4) entity = MED_EDGE;
int numberoffamilies = myMesh.getNumberOfFamilies(entity);
- using namespace MED_FR;
- os << "NumberOfFamilies on "<< entNames[(MED_FR::med_entite_maillage) entity] <<" : "<<numberoffamilies<<endl;
+ os << "NumberOfFamilies on "<< entNames[entity] <<" : "<<numberoffamilies<<endl;
using namespace MED_EN;
for (int i=1; i<numberoffamilies+1;i++)
{
if (k==3) entity = MED_FACE;
if (k==4) entity = MED_EDGE;
int numberofgroups = myMesh.getNumberOfGroups(entity);
- using namespace MED_FR;
- os << "NumberOfGroups on "<< entNames[(MED_FR::med_entite_maillage) entity] <<" : "<<numberofgroups<<endl;
+ os << "NumberOfGroups on "<< entNames[entity] <<" : "<<numberofgroups<<endl;
using namespace MED_EN;
for (int i=1; i<numberofgroups+1;i++)
{
}
int index;
- FIELD<double>* Volume = new FIELD<double>::FIELD(Support,1);
+ FIELD<double>* Volume = new FIELD<double>(Support,1);
// double *volume = new double [length_values];
Volume->setName("VOLUME");
Volume->setDescription("cells volume");
int index;
FIELD<double>* Area;
- Area = new FIELD<double>::FIELD(Support,1);
+ Area = new FIELD<double>(Support,1);
Area->setName("AREA");
Area->setDescription("cells or faces area");
int index;
FIELD<double>* Length;
- Length = new FIELD<double>::FIELD(Support,1);
+ Length = new FIELD<double>(Support,1);
// double *length = new double [length_values];
Length->setValueType(MED_REEL64);
int index;
- FIELD<double>* Normal = new FIELD<double>::FIELD(Support,dim_space);
+ FIELD<double>* Normal = new FIELD<double>(Support,dim_space);
Normal->setName("NORMAL");
Normal->setDescription("cells or faces normal");
for (int k=1;k<=dim_space;k++) {
int index;
FIELD<double>* Barycenter;
- Barycenter = new FIELD<double>::FIELD(Support,dim_space);
+ Barycenter = new FIELD<double>(Support,dim_space);
Barycenter->setName("BARYCENTER");
Barycenter->setDescription("cells or faces barycenter");
bool MESH::isEmpty() const
{
- bool notempty = _name != "" || _coordinate != NULL || _connectivity != NULL ||
+ bool notempty = _name != "NOT DEFINED" || _coordinate != NULL || _connectivity != NULL ||
_spaceDimension !=MED_INVALID || _meshDimension !=MED_INVALID ||
_numberOfNodes !=MED_INVALID || _groupNode.size() != 0 ||
_familyNode.size() != 0 || _groupCell.size() != 0 ||
for (unsigned g=0; g!=myGroups.size(); ++g)
{
// scan cells that belongs to the group
- const med_int* groupCells=myGroups[g]->getnumber()->getValue();
+ const int* groupCells=myGroups[g]->getnumber()->getValue();
int nbCells=myGroups[g]->getnumber()->getLength();
for(int c=0; c!=nbCells; ++c)
tab_cell[groupCells[c]-1].groups.push_back(g);
#include "MEDMEM_Connectivity.hxx"
#include "MEDMEM_GenDriver.hxx"
-using namespace MED_EN;
-
/*! This class contains all the informations related with a MESH :
- COORDINATES
- CONNECTIVITIES
inline int getNumberOfNodes() const;
virtual inline const COORDINATE * getCoordinateptr() const;
inline string getCoordinatesSystem() const;
- virtual inline const double * getCoordinates(medModeSwitch Mode) const;
+ virtual inline const double * getCoordinates(MED_EN::medModeSwitch Mode) const;
virtual inline const double getCoordinate(int Number,int Axis) const;
inline const string * getCoordinatesNames() const;
inline const string * getCoordinatesUnits() const;
//inline int * getNodesNumbers();
- virtual inline int getNumberOfTypes(medEntityMesh Entity) const;
- virtual inline const medGeometryElement * getTypes(medEntityMesh Entity) const;
- virtual inline const CELLMODEL * getCellsTypes(medEntityMesh Entity) const;
- virtual const int * getGlobalNumberingIndex(medEntityMesh Entity) const;
- virtual inline int getNumberOfElements(medEntityMesh Entity,
- medGeometryElement Type) const;
- virtual inline bool existConnectivity(medConnectivity ConnectivityType,
- medEntityMesh Entity) const;
+ virtual inline int getNumberOfTypes(MED_EN::medEntityMesh Entity) const;
+ virtual inline const MED_EN::medGeometryElement * getTypes(MED_EN::medEntityMesh Entity) const;
+ virtual inline const CELLMODEL * getCellsTypes(MED_EN::medEntityMesh Entity) const;
+ virtual const int * getGlobalNumberingIndex(MED_EN::medEntityMesh Entity) const;
+ virtual inline int getNumberOfElements(MED_EN::medEntityMesh Entity,
+ MED_EN::medGeometryElement Type) const;
+ virtual inline bool existConnectivity(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity) const;
- virtual inline medGeometryElement getElementType(medEntityMesh Entity,
+ virtual inline MED_EN::medGeometryElement getElementType(MED_EN::medEntityMesh Entity,
int Number) const;
- virtual inline void calculateConnectivity(medModeSwitch Mode,
- medConnectivity ConnectivityType,
- medEntityMesh Entity) const ;
- virtual inline int getConnectivityLength(medModeSwitch Mode,
- medConnectivity ConnectivityType,
- medEntityMesh Entity,
- medGeometryElement Type) const;
- virtual inline const int * getConnectivity(medModeSwitch Mode,
- medConnectivity ConnectivityType,
- medEntityMesh Entity,
- medGeometryElement Type) const;
- virtual inline const int * getConnectivityIndex(medConnectivity ConnectivityType,
- medEntityMesh Entity) const;
- virtual int getElementNumber(medConnectivity ConnectivityType,
- medEntityMesh Entity,
- medGeometryElement Type,
+ virtual inline void calculateConnectivity(MED_EN::medModeSwitch Mode,
+ MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity) const ;
+ virtual inline int getConnectivityLength(MED_EN::medModeSwitch Mode,
+ MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity,
+ MED_EN::medGeometryElement Type) const;
+ virtual inline const int * getConnectivity(MED_EN::medModeSwitch Mode,
+ MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity,
+ MED_EN::medGeometryElement Type) const;
+ virtual inline const int * getConnectivityIndex(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity) const;
+ virtual int getElementNumber(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity,
+ MED_EN::medGeometryElement Type,
int * connectivity) const;
- virtual inline int getReverseConnectivityLength(medConnectivity ConnectivityType,
- medEntityMesh Entity=MED_CELL) const;
- virtual inline const int * getReverseConnectivity(medConnectivity ConnectivityType,
- medEntityMesh Entity=MED_CELL) const;
- virtual inline int getReverseConnectivityIndexLength(medConnectivity ConnectivityType,
- medEntityMesh Entity=MED_CELL) const;
- virtual inline const int * getReverseConnectivityIndex(medConnectivity ConnectivityType,
- medEntityMesh Entity=MED_CELL) const;
-
- virtual int getNumberOfFamilies(medEntityMesh Entity) const;
- virtual inline const vector<FAMILY*> getFamilies(medEntityMesh Entity) const;
- virtual inline const FAMILY* getFamily(medEntityMesh Entity,int i) const;
- virtual int getNumberOfGroups(medEntityMesh Entity) const;
- virtual inline const vector<GROUP*> getGroups(medEntityMesh Entity) const;
- virtual inline const GROUP* getGroup(medEntityMesh Entity,int i) const;
+ virtual inline int getReverseConnectivityLength(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity=MED_EN::MED_CELL) const;
+ virtual inline const int * getReverseConnectivity(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity=MED_EN::MED_CELL) const;
+ virtual inline int getReverseConnectivityIndexLength(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity=MED_EN::MED_CELL) const;
+ virtual inline const int * getReverseConnectivityIndex(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity=MED_EN::MED_CELL) const;
+
+ virtual int getNumberOfFamilies(MED_EN::medEntityMesh Entity) const;
+ virtual inline const vector<FAMILY*> getFamilies(MED_EN::medEntityMesh Entity) const;
+ virtual inline const FAMILY* getFamily(MED_EN::medEntityMesh Entity,int i) const;
+ virtual int getNumberOfGroups(MED_EN::medEntityMesh Entity) const;
+ virtual inline const vector<GROUP*> getGroups(MED_EN::medEntityMesh Entity) const;
+ virtual inline const GROUP* getGroup(MED_EN::medEntityMesh Entity,int i) const;
virtual inline const CONNECTIVITY* getConnectivityptr() const;
- virtual SUPPORT * getBoundaryElements(medEntityMesh Entity)
+ virtual SUPPORT * getBoundaryElements(MED_EN::medEntityMesh Entity)
throw (MEDEXCEPTION);
// problème avec le maillage dans le support :
// le pointeur n'est pas const, mais sa valeur oui. A voir !!! PG
*/
void createFamilies();
};
-};
-using namespace MEDMEM;
// ---------------------------------------
// Methodes Inline
// ---------------------------------------
- MED_NO_INTERLACE : X1 X2 Y1 Y2 Z1 Z2
- MED_FULL_INTERLACE : X1 Y1 Z1 X2 Y2 Z2
*/
-inline const double * MESH::getCoordinates(medModeSwitch Mode) const
+inline const double * MESH::getCoordinates(MED_EN::medModeSwitch Mode) const
{
// checkGridFillCoords();
return _coordinate->getCoordinates(Mode);
If there is no connectivity, return an exception.
*/
-inline int MESH::getNumberOfTypes(medEntityMesh entity) const
+inline int MESH::getNumberOfTypes(MED_EN::medEntityMesh entity) const
{
MESSAGE("MESH::getNumberOfTypes(medEntityMesh entity) : "<<entity);
- if (entity == MED_NODE)
+ if (entity == MED_EN::MED_NODE)
return 1;
// checkGridFillConnectivity();
if (_connectivity != NULL)
If entity is not defined, return an exception.
*/
-inline const medGeometryElement * MESH::getTypes(medEntityMesh entity) const
+inline const MED_EN::medGeometryElement * MESH::getTypes(MED_EN::medEntityMesh entity) const
{
- if (entity == MED_NODE)
+ if (entity == MED_EN::MED_NODE)
throw MEDEXCEPTION(LOCALIZED("MESH::getTypes( medEntityMesh ) : No medGeometryElement with MED_NODE entity !"));
// return un tableau de taille 1 contenant MED_NONE, comme les supports pour etre coherent avec getNumberOfTypes ???? PG
REMARK : Don't use MED_NODE as medEntityMesh
*/
-inline const CELLMODEL * MESH::getCellsTypes(medEntityMesh Entity) const
+inline const CELLMODEL * MESH::getCellsTypes(MED_EN::medEntityMesh Entity) const
{
// checkGridFillConnectivity();
if (_connectivity != NULL)
- GlobalNumberingIndex[1]=6 (the second type)
- GlobalNumberingIndex[2]=10
*/
-inline const int * MESH::getGlobalNumberingIndex(medEntityMesh entity) const
+inline const int * MESH::getGlobalNumberingIndex(MED_EN::medEntityMesh entity) const
{
// checkGridFillConnectivity();
if (_connectivity != NULL)
- getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS) : return total number
of elements defined in cell entity
*/
-inline int MESH::getNumberOfElements(medEntityMesh entity, medGeometryElement Type) const
+inline int MESH::getNumberOfElements(MED_EN::medEntityMesh entity, MED_EN::medGeometryElement Type) const
{
// const char * LOC = "MESH::getNumberOfElements(medEntityMesh,medGeometryElement) : ";
- if (entity==MED_NODE)
- if ((Type==MED_NONE)|(Type==MED_ALL_ELEMENTS))
+ if (entity==MED_EN::MED_NODE)
+ if ((Type==MED_EN::MED_NONE)|(Type==MED_EN::MED_ALL_ELEMENTS))
return _numberOfNodes;
else
return 0;
Return true if the wanted connectivity exist, else return false
(to use before a getSomething method).
*/
-inline bool MESH::existConnectivity(medConnectivity connectivityType, medEntityMesh entity) const
+inline bool MESH::existConnectivity(MED_EN::medConnectivity connectivityType, MED_EN::medEntityMesh entity) const
{
// checkGridFillConnectivity();
if (_connectivity==(CONNECTIVITY*)NULL)
Throw an exception if Entity is not defined or Number are wrong (too big).
*/
-inline medGeometryElement MESH::getElementType(medEntityMesh Entity,int Number) const
+inline MED_EN::medGeometryElement MESH::getElementType(MED_EN::medEntityMesh Entity,int Number) const
{
// checkGridFillConnectivity();
if (_connectivity==(CONNECTIVITY*)NULL)
done. Do nothing if connectivity already exist.
*/
-inline void MESH::calculateConnectivity(medModeSwitch Mode,medConnectivity ConnectivityType,medEntityMesh entity) const
+inline void MESH::calculateConnectivity(MED_EN::medModeSwitch Mode,MED_EN::medConnectivity ConnectivityType,MED_EN::medEntityMesh entity) const
{
// checkGridFillConnectivity();
- if (Mode==MED_FULL_INTERLACE)
+ if (Mode==MED_EN::MED_FULL_INTERLACE)
_connectivity->calculateConnectivity(ConnectivityType,entity);
else
throw MEDEXCEPTION(LOCALIZED("MESH::calculateConnectivity : only for MED_FULL_INTERLACE mode"));
Return the corresponding length of the array returned by MESH::getConnectivity with exactly the same arguments.
Used particulary for wrapping CORBA and python.
*/
-inline int MESH::getConnectivityLength(medModeSwitch Mode,medConnectivity ConnectivityType,medEntityMesh entity, medGeometryElement Type) const
+inline int MESH::getConnectivityLength(MED_EN::medModeSwitch Mode,MED_EN::medConnectivity ConnectivityType,MED_EN::medEntityMesh entity, MED_EN::medGeometryElement Type) const
{
int nbOfElm = getNumberOfElements(entity,Type);
int size;
- if (Type == MED_ALL_ELEMENTS)
+ if (Type == MED_EN::MED_ALL_ELEMENTS)
{
size = getConnectivityIndex(ConnectivityType,entity)[nbOfElm]-1;
}
and Type=MED_ALL_ELEMENTS.
You must also get the corresponding index array.
*/
-inline const int * MESH::getConnectivity(medModeSwitch Mode,medConnectivity ConnectivityType,medEntityMesh entity, medGeometryElement Type) const
+inline const int * MESH::getConnectivity(MED_EN::medModeSwitch Mode,MED_EN::medConnectivity ConnectivityType,MED_EN::medEntityMesh entity, MED_EN::medGeometryElement Type) const
{
// checkGridFillConnectivity();
- if (Mode==MED_FULL_INTERLACE)
+ if (Mode==MED_EN::MED_FULL_INTERLACE)
return _connectivity->getConnectivity(ConnectivityType,entity,Type);
throw MEDEXCEPTION(LOCALIZED("MESH::getConnectivity : only for MED_FULL_INTERLACE mode"));
}
in Connectivity array (Connectivity[ConnectivityIndex[i-1]-1] is the
first value)
*/
-inline const int * MESH::getConnectivityIndex(medConnectivity ConnectivityType,medEntityMesh entity) const
+inline const int * MESH::getConnectivityIndex(MED_EN::medConnectivity ConnectivityType,MED_EN::medEntityMesh entity) const
{
// checkGridFillConnectivity();
return _connectivity->getConnectivityIndex(ConnectivityType, entity);
Used particulary for wrapping CORBA and python.
*/
-inline int MESH::getReverseConnectivityLength(medConnectivity ConnectivityType,
- medEntityMesh Entity) const
+inline int MESH::getReverseConnectivityLength(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity) const
{
int spaceDim = getSpaceDimension();
int nb;
- if (ConnectivityType == MED_NODAL)
+ if (ConnectivityType == MED_EN::MED_NODAL)
{
nb = getNumberOfNodes();
}
else
{
if (spaceDim == 2)
- nb = getNumberOfElements(MED_EDGE,
- MED_ALL_ELEMENTS);
+ nb = getNumberOfElements(MED_EN::MED_EDGE,
+ MED_EN::MED_ALL_ELEMENTS);
else if (spaceDim == 3)
- nb = getNumberOfElements(MED_FACE,
- MED_ALL_ELEMENTS);
+ nb = getNumberOfElements(MED_EN::MED_FACE,
+ MED_EN::MED_ALL_ELEMENTS);
}
return getReverseConnectivityIndex(ConnectivityType)[nb]-1;
}
You must get ReverseConnectivityIndex array to use it.
*/
-inline const int * MESH::getReverseConnectivity(medConnectivity ConnectivityType,medEntityMesh Entity/*=MED_CELL*/) const
+inline const int * MESH::getReverseConnectivity(MED_EN::medConnectivity ConnectivityType,MED_EN::medEntityMesh Entity/*=MED_CELL*/) const
{
// checkGridFillConnectivity();
if (NULL==_connectivity)
Return the corresponding length of the array returned by MESH::getReverseConnectivityIndex with exactly the same arguments.
Used particulary for wrapping CORBA and python.
*/
-inline int MESH::getReverseConnectivityIndexLength(medConnectivity ConnectivityType,
- medEntityMesh Entity) const
+inline int MESH::getReverseConnectivityIndexLength(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity) const
{
int spaceDim = getSpaceDimension();
- if (ConnectivityType == MED_NODAL)
+ if (ConnectivityType == MED_EN::MED_NODAL)
{
return getNumberOfNodes()+1;
}
else
{
if (spaceDim == 2)
- return getNumberOfElements(MED_EDGE,MED_ALL_ELEMENTS)+1;
+ return getNumberOfElements(MED_EN::MED_EDGE,MED_EN::MED_ALL_ELEMENTS)+1;
else if (spaceDim == 3)
- return getNumberOfElements(MED_FACE,MED_ALL_ELEMENTS)+1;
+ return getNumberOfElements(MED_EN::MED_FACE,MED_EN::MED_ALL_ELEMENTS)+1;
else
throw MEDEXCEPTION("Invalid dimension");
}
ReverseConnectivity[ReverseConnectivityIndex[i-1]-1]
is the first value)
*/
-inline const int * MESH::getReverseConnectivityIndex(medConnectivity ConnectivityType,medEntityMesh Entity/*=MED_CELL*/) const
+inline const int * MESH::getReverseConnectivityIndex(MED_EN::medConnectivity ConnectivityType,MED_EN::medEntityMesh Entity/*=MED_CELL*/) const
{
// checkGridFillConnectivity();
if (NULL==_connectivity)
}
-inline int MESH::getNumberOfFamilies (medEntityMesh entity) const
+inline int MESH::getNumberOfFamilies (MED_EN::medEntityMesh entity) const
{
switch (entity) {
- case MED_NODE :
+ case MED_EN::MED_NODE :
return _familyNode.size();
- case MED_CELL :
+ case MED_EN::MED_CELL :
return _familyCell.size();
- case MED_FACE :
+ case MED_EN::MED_FACE :
return _familyFace.size();
- case MED_EDGE :
+ case MED_EN::MED_EDGE :
return _familyEdge.size();
default :
throw MEDEXCEPTION("MESH::getNumberOfFamilies : Unknown entity");
}
}
-inline int MESH::getNumberOfGroups (medEntityMesh entity) const
+inline int MESH::getNumberOfGroups (MED_EN::medEntityMesh entity) const
{
switch (entity) {
- case MED_NODE :
+ case MED_EN::MED_NODE :
return _groupNode.size();
- case MED_CELL :
+ case MED_EN::MED_CELL :
return _groupCell.size();
- case MED_FACE :
+ case MED_EN::MED_FACE :
return _groupFace.size();
- case MED_EDGE :
+ case MED_EN::MED_EDGE :
return _groupEdge.size();
default :
throw MEDEXCEPTION("MESH::getNumberOfGroups : Unknown entity");
}
}
-const vector<MEDMEM::FAMILY*> MESH::getFamilies(medEntityMesh entity) const
+const vector<MEDMEM::FAMILY*> MESH::getFamilies(MED_EN::medEntityMesh entity) const
{
switch (entity) {
- case MED_NODE :
+ case MED_EN::MED_NODE :
return _familyNode;
- case MED_CELL :
+ case MED_EN::MED_CELL :
return _familyCell;
- case MED_FACE :
+ case MED_EN::MED_FACE :
return _familyFace;
- case MED_EDGE :
+ case MED_EN::MED_EDGE :
return _familyEdge;
default :
throw MEDEXCEPTION("MESH::getFamilies : Unknown entity");
}
}
-const vector<GROUP*> MESH::getGroups(medEntityMesh entity) const
+const vector<GROUP*> MESH::getGroups(MED_EN::medEntityMesh entity) const
{
switch (entity) {
- case MED_NODE :
+ case MED_EN::MED_NODE :
return _groupNode;
- case MED_CELL :
+ case MED_EN::MED_CELL :
return _groupCell;
- case MED_FACE :
+ case MED_EN::MED_FACE :
return _groupFace;
- case MED_EDGE :
+ case MED_EN::MED_EDGE :
return _groupEdge;
default :
throw MEDEXCEPTION("MESH::getGroups : Unknown entity");
}
}
-const MEDMEM::FAMILY* MESH::getFamily(medEntityMesh entity, int i) const
+const MEDMEM::FAMILY* MESH::getFamily(MED_EN::medEntityMesh entity, int i) const
{
if (i<=0)
throw MEDEXCEPTION("MESH::getFamily(i) : argument i must be > 0");
vector<FAMILY*> Family;
switch (entity) {
- case MED_NODE : {
+ case MED_EN::MED_NODE : {
Family = _familyNode;
break;
}
- case MED_CELL : {
+ case MED_EN::MED_CELL : {
Family = _familyCell;
break;
}
- case MED_FACE : {
+ case MED_EN::MED_FACE : {
Family = _familyFace;
break;
}
- case MED_EDGE : {
+ case MED_EN::MED_EDGE : {
Family = _familyEdge;
break;
}
return Family[i-1];
}
-const GROUP* MESH::getGroup(medEntityMesh entity, int i) const
+const GROUP* MESH::getGroup(MED_EN::medEntityMesh entity, int i) const
{
const char * LOC = "MESH::getGroup(medEntityMesh entity, int i) : ";
if (i<=0)
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"argument i must be > 0"));
vector<GROUP*> Group;
switch (entity) {
- case MED_NODE : {
+ case MED_EN::MED_NODE : {
Group = _groupNode;
break;
}
- case MED_CELL : {
+ case MED_EN::MED_CELL : {
Group = _groupCell;
break;
}
- case MED_FACE : {
+ case MED_EN::MED_FACE : {
Group = _groupFace;
break;
}
- case MED_EDGE : {
+ case MED_EN::MED_EDGE : {
Group = _groupEdge;
break;
}
return _isAGrid;
}
+}
+
#endif /* MESH_HXX */
-using namespace std;
/*
File MEDMEM_Meshing.cxx
$Header$
#include "MEDMEM_Meshing.hxx"
#include "MEDMEM_Group.hxx"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
/*! Create an empty MESH. */
MESHING::MESHING(): MESH()
we set 12 triangles and 23 quadrangles.
*/
void MESHING::setNumberOfElements(const int * NumberOfElements,
- medEntityMesh Entity)
+ const medEntityMesh Entity)
throw (MEDEXCEPTION)
{
const char * LOC = "MESHING::setNumberOfElements(const int *, medEntityMesh) : " ;
#include "MEDMEM_Mesh.hxx"
-using namespace MED_EN;
-
/*!
This class MESHING is a special class to set a MESH object.
*/
const int NumberOfNodes,
const double * Coordinates,
const string System,
- const medModeSwitch Mode) ;
+ const MED_EN::medModeSwitch Mode) ;
void setCoordinatesSystem(const string System)
throw (MEDEXCEPTION) ;
void setCoordinatesNames (const string * names) ;
void setCoordinateUnit (const string unit, const int i) ;
void setNumberOfTypes (const int NumberOfTypes,
- const medEntityMesh Entity)
+ const MED_EN::medEntityMesh Entity)
throw (MEDEXCEPTION) ;
- void setTypes (const medGeometryElement * Types,
- const medEntityMesh Entity)
+ void setTypes (const MED_EN::medGeometryElement * Types,
+ const MED_EN::medEntityMesh Entity)
throw (MEDEXCEPTION) ;
void setNumberOfElements (const int * NumberOfElements,
- const medEntityMesh Entity)
+ const MED_EN::medEntityMesh Entity)
throw (MEDEXCEPTION) ;
void setConnectivity (const int * Connectivity,
- const medEntityMesh Entity,
- const medGeometryElement Type)
+ const MED_EN::medEntityMesh Entity,
+ const MED_EN::medGeometryElement Type)
throw (MEDEXCEPTION) ;
void setConnectivities (const int * ConnectivityIndex,
const int * ConnectivityValue,
- const medConnectivity ConnectivityType,
- const medEntityMesh Entity)
+ const MED_EN::medConnectivity ConnectivityType,
+ const MED_EN::medEntityMesh Entity)
throw (MEDEXCEPTION) ;
// void setGroup (const string name,
int compare(const MEDMODULUSARRAY &modulusArray) const;
};
-};
-using namespace MEDMEM;
MEDMODULUSARRAY::MEDMODULUSARRAY(int length, const int * array) :
_length(length), _array(array)
}
return ret ;
}
+}
# endif /* # ifndef __MEDMODULUSARRAY_H__ */
void setShallowAndOwnership( const T *pointer );
PointerOf<T>& operator=( const PointerOf<T> &pointer ) ;
} ;
-} ;
// ------------------------------------------------------------ //
// //
// //
// ------------------------------------------------------------ //
-using namespace MEDMEM;
-
/*! Creates a null T* pointer and sets the boolean (for desallocation) to false. */
template <typename T> PointerOf<T>::PointerOf() : _pointer(0), _done(false)
{
_done=true;
}
+}//End namespace MEDMEM
+
# endif /* # if ! defined( __PointerOf_HXX__ ) */
-using namespace std;
-
#include "MEDMEM_PorflowMeshDriver.hxx"
#include "MEDMEM_DriversDef.hxx"
#include "MEDMEM_DriverTools.hxx"
#include <sstream>
#include <iomanip>
+using namespace std;
using namespace MED_EN;
using namespace MEDMEM;
#include "MEDMEM_Exception.hxx"
#include "utilities.h"
-using namespace MEDMEM;
-
/*!
Driver PORFLOW for MESH.
// tableau de correspondance des types géométriques de PORFLOW -> MED
static const size_t nb_geometrie_porflow = 6;
- static const medGeometryElement geomPORFLOWtoMED[nb_geometrie_porflow];
+ static const MED_EN::medGeometryElement geomPORFLOWtoMED[nb_geometrie_porflow];
// indirection table from PORFLOW order to MED one for nodes numerotation in all PORFLOW geometries
static const size_t nb_nodes_max = 8; // maximal number of nodes for a porflow geometrie
static const size_t nb_nodes2_max = 4; // maximal number of nodes for a 2D porflow geometrie
static const size_t nb_faces_max = 6; // maximal number of faces for a porflow geometrie
static const int numPORFLOWtoMED[nb_geometrie_porflow] [nb_nodes_max];
static const int connectivityPORFLOW[nb_geometrie_porflow][nb_faces_max][nb_nodes2_max];
- inline static int geomMEDtoPorflow(medGeometryElement medGeo);
+ inline static int geomMEDtoPorflow(MED_EN::medGeometryElement medGeo);
public :
*/
PORFLOW_MESH_DRIVER(const string & fileName,
MESH * ptrMesh,
- med_mode_acces accessMode) ;
+ MED_EN::med_mode_acces accessMode) ;
/*!
Copy constructor.
*/
public :
- STRING::STRING() :string(), _s()
+ STRING() :string(), _s()
{
}
- STRING::~STRING()
+ ~STRING()
{
_s.freeze(false);
}
- STRING::operator const char * () const
+ operator const char * () const
{
return const_cast <const char *> (this->c_str()) ;
}
- template <class T> STRING::STRING( const T &valeur ) : string(), _s()
+ template <class T> STRING( const T &valeur ) : string(), _s()
{
_s.freeze(false);
this->string::operator =( _s.str()); // freeze is true by now
}
- template <class T> STRING & STRING::operator<<( const T &valeur )
+ template <class T> STRING & operator<<( const T &valeur )
{
if ( _s.pcount() )
-using namespace std;
#include "MEDMEM_SkyLineArray.hxx"
#include "utilities.h"
+
+using namespace std;
using namespace MEDMEM;
MEDSKYLINEARRAY::MEDSKYLINEARRAY(): _count(0), _length(0),
- _index((med_int*)NULL),_value((med_int*)NULL)
+ _index((int*)NULL),_value((int*)NULL)
{
MESSAGE("Constructeur MEDSKYLINEARRAY sans parametre");
}
_index(_count+1),_value(_length)
{
BEGIN_OF("MEDSKYLINEARRAY(const MEDSKYLINEARRAY &)");
- memcpy(_index,myArray._index,sizeof(med_int)*(_count+1));
- memcpy(_value,myArray._value,sizeof(med_int)*_length);
+ memcpy(_index,myArray._index,sizeof(int)*(_count+1));
+ memcpy(_value,myArray._value,sizeof(int)*_length);
END_OF("MEDSKYLINEARRAY(const MEDSKYLINEARRAY &)");
}
//if (_value != NULL) delete [] _value;
}
-MEDSKYLINEARRAY::MEDSKYLINEARRAY(const med_int count, const med_int length):
+MEDSKYLINEARRAY::MEDSKYLINEARRAY(const int count, const int length):
_count(count), _length(length),
_index(_count+1),_value(_length)
{
MESSAGE("Constructeur MEDSKYLINEARRAY(count="<<count<<", length="<<length<<") avec parametres");
}
-MEDSKYLINEARRAY::MEDSKYLINEARRAY(const med_int count, const med_int length,
- const med_int* index, const med_int* value,bool shallowCopy):
+MEDSKYLINEARRAY::MEDSKYLINEARRAY(const int count, const int length,
+ const int* index, const int* value,bool shallowCopy):
_count(count), _length(length)
{
- MESSAGE("Constructeur MEDSKYLINEARRAY(count="<<count<<", length="<<length<<") avec parametres");
+// MESSAGE("Constructeur MEDSKYLINEARRAY(count="<<count<<", length="<<length<<") avec parametres");
if(shallowCopy)
{
_index.setShallowAndOwnership(index);
}
}
-// void MEDSKYLINEARRAY::setMEDSKYLINEARRAY( const med_int count , const med_int length, med_int* index , med_int* value )
+// void MEDSKYLINEARRAY::setMEDSKYLINEARRAY( const int count , const int length, int* index , int* value )
// {
// MESSAGE("void MEDSKYLINEARRAY::setMEDSKYLINEARRAY(count, length, index, value)");
// _count = count ;
#include "MEDMEM_PointerOf.hxx"
#include "MEDMEM_define.hxx"
-using MED_EN::med_int;
-
namespace MEDMEM {
class MEDSKYLINEARRAY
{
private :
- med_int _count ;
- med_int _length ;
- PointerOf <med_int> _index ; // array of size _count+1 : _index[0]=1 and
+ int _count ;
+ int _length ;
+ PointerOf <int> _index ; // array of size _count+1 : _index[0]=1 and
// _index[_count]=length+1
- PointerOf <med_int> _value ; // array of size _length
+ PointerOf <int> _value ; // array of size _length
public :
MEDSKYLINEARRAY();
~MEDSKYLINEARRAY();
MEDSKYLINEARRAY( const MEDSKYLINEARRAY &myArray );
- MEDSKYLINEARRAY( const med_int count, const med_int length );
- MEDSKYLINEARRAY( const med_int count, const med_int length,
- const med_int* index, const med_int* value, bool shallowCopy=false );
-
- //void setMEDSKYLINEARRAY( const med_int count, const med_int length, med_int* index , med_int* value ) ;
-
- inline med_int getNumberOf() const;
- inline med_int getLength() const;
- inline const med_int* getIndex() const;
- inline const med_int* getValue() const;
- inline med_int getNumberOfI(int i) const throw (MEDEXCEPTION) ;
- inline const med_int* getI(int i) const throw (MEDEXCEPTION) ;
- inline med_int getIJ(int i, int j) const throw (MEDEXCEPTION) ;
- inline med_int getIndexValue(int i) const throw (MEDEXCEPTION) ;
-
- inline void setIndex(const med_int* index) ;
- inline void setI(const med_int i, const med_int* values) throw (MEDEXCEPTION) ;
- inline void setIJ(med_int i, med_int j, med_int value) throw (MEDEXCEPTION) ;
- inline void setIndexValue(med_int i, med_int value) throw (MEDEXCEPTION) ;
+ MEDSKYLINEARRAY( const int count, const int length );
+ MEDSKYLINEARRAY( const int count, const int length,
+ const int* index, const int* value, bool shallowCopy=false );
+
+ //void setMEDSKYLINEARRAY( const int count, const int length, int* index , int* value ) ;
+
+ inline int getNumberOf() const;
+ inline int getLength() const;
+ inline const int* getIndex() const;
+ inline const int* getValue() const;
+ inline int getNumberOfI(int i) const throw (MEDEXCEPTION) ;
+ inline const int* getI(int i) const throw (MEDEXCEPTION) ;
+ inline int getIJ(int i, int j) const throw (MEDEXCEPTION) ;
+ inline int getIndexValue(int i) const throw (MEDEXCEPTION) ;
+
+ inline void setIndex(const int* index) ;
+ inline void setI(const int i, const int* values) throw (MEDEXCEPTION) ;
+ inline void setIJ(int i, int j, int value) throw (MEDEXCEPTION) ;
+ inline void setIndexValue(int i, int value) throw (MEDEXCEPTION) ;
};
-}
-using namespace MEDMEM;
+
// ---------------------------------------
// Methodes Inline
// ---------------------------------------
-inline med_int MEDSKYLINEARRAY::getNumberOf() const
+inline int MEDSKYLINEARRAY::getNumberOf() const
{
return _count ;
};
-inline med_int MEDSKYLINEARRAY::getLength() const
+inline int MEDSKYLINEARRAY::getLength() const
{
return _length ;
};
-inline const med_int* MEDSKYLINEARRAY::getIndex() const
+inline const int* MEDSKYLINEARRAY::getIndex() const
{
- return (const med_int*)_index ;
+ return (const int*)_index ;
} ;
-inline const med_int* MEDSKYLINEARRAY::getValue() const
+inline const int* MEDSKYLINEARRAY::getValue() const
{
- return (const med_int*)_value ;
+ return (const int*)_value ;
} ;
-inline med_int MEDSKYLINEARRAY::getNumberOfI(int i) const throw (MEDEXCEPTION)
+inline int MEDSKYLINEARRAY::getNumberOfI(int i) const throw (MEDEXCEPTION)
{
if (i<1)
throw MEDEXCEPTION("MEDSKYLINEARRAY::getNumberOfI : argument must be >= 1");
throw MEDEXCEPTION("MEDSKYLINEARRAY::getNumberOfI : argument is out of range");
return _index[i]-_index[i-1] ;
} ;
-inline const med_int* MEDSKYLINEARRAY::getI(int i) const throw (MEDEXCEPTION)
+inline const int* MEDSKYLINEARRAY::getI(int i) const throw (MEDEXCEPTION)
{
if (i<1)
throw MEDEXCEPTION("MEDSKYLINEARRAY::getI : argument must be >= 1");
throw MEDEXCEPTION("MEDSKYLINEARRAY::getI : argument is out of range");
return _value+_index[i-1]-1 ;
}
-inline med_int MEDSKYLINEARRAY::getIJ(int i, int j) const throw (MEDEXCEPTION)
+inline int MEDSKYLINEARRAY::getIJ(int i, int j) const throw (MEDEXCEPTION)
{
if (i<1)
throw MEDEXCEPTION("MEDSKYLINEARRAY::getIJ : first argument must be >= 1");
return _value[_index[i-1]+j-2] ;
}
-inline med_int MEDSKYLINEARRAY::getIndexValue(int i) const throw (MEDEXCEPTION)
+inline int MEDSKYLINEARRAY::getIndexValue(int i) const throw (MEDEXCEPTION)
{
if (i<1)
throw MEDEXCEPTION("MEDSKYLINEARRAY::getIndexValue : argument must be >= 1");
return _value[i-1] ;
}
-inline void MEDSKYLINEARRAY::setIndex(const med_int* index)
+inline void MEDSKYLINEARRAY::setIndex(const int* index)
{
- memcpy((med_int*)_index,index,(_count+1)*sizeof(med_int));
+ memcpy((int*)_index,index,(_count+1)*sizeof(int));
}
-inline void MEDSKYLINEARRAY::setIJ(med_int i, med_int j, med_int value) throw (MEDEXCEPTION)
+inline void MEDSKYLINEARRAY::setIJ(int i, int j, int value) throw (MEDEXCEPTION)
{
if (i<1)
throw MEDEXCEPTION("MEDSKYLINEARRAY::setIJ : first argument must be >= 1");
}
-inline void MEDSKYLINEARRAY::setI(const med_int i, const med_int * values) throw (MEDEXCEPTION)
+inline void MEDSKYLINEARRAY::setI(const int i, const int * values) throw (MEDEXCEPTION)
{
if (i<1)
throw MEDEXCEPTION("MEDSKYLINEARRAY::setI : index must be >= 1");
if (i>_count)
throw MEDEXCEPTION("MEDSKYLINEARRAY::setI : index is out of range") ;
- memcpy(_value+_index[i-1]-1,values,(_index[i]-_index[i-1])*sizeof(med_int)) ;
+ memcpy(_value+_index[i-1]-1,values,(_index[i]-_index[i-1])*sizeof(int)) ;
}
-inline void MEDSKYLINEARRAY::setIndexValue(med_int i, med_int value) throw (MEDEXCEPTION)
+inline void MEDSKYLINEARRAY::setIndexValue(int i, int value) throw (MEDEXCEPTION)
{
if (i<1)
throw MEDEXCEPTION("MEDSKYLINEARRAY::setIndexValue : argument must be >= 1");
throw MEDEXCEPTION("MEDSKYLINEARRAY::setIndexValue : argument is out of range") ;
_value[i-1]=value ;
}
+}
# endif
-using namespace std;
/*
File Support.cxx
$Header$
//#include "MEDMEM_Group.hxx"
#include "MEDMEM_Mesh.hxx"
+using namespace std;
using namespace MED_EN;
using namespace MEDMEM;
medGeometryElement * myType = new medGeometryElement[MED_NBR_GEOMETRIE_MAILLE];
int * whereIsType = new int[MED_NBR_GEOMETRIE_MAILLE];
//MESH_ENTITIES myMeshEntities() ;
- list<MED_FR::med_geometrie_element>::const_iterator listIt ;
+ list<MED_EN::medGeometryElement>::const_iterator listIt ;
int it=0 ;
- for(listIt=(MED_FR::meshEntities[(MED_FR::med_entite_maillage)_entity]).begin();listIt!=(MED_FR::meshEntities[(MED_FR::med_entite_maillage)_entity]).end();listIt++) {
+ for(listIt=(meshEntities[_entity]).begin();listIt!=(meshEntities[_entity]).end();listIt++) {
tmp_NumberOfElementsInType[it]=0;
whereIsType[it]=0 ;
try {
medGeometryElement * myType = new medGeometryElement[MED_NBR_GEOMETRIE_MAILLE];
int * whereIsType = new int[MED_NBR_GEOMETRIE_MAILLE];
//MESH_ENTITIES myMeshEntities() ;
- list<MED_FR::med_geometrie_element>::const_iterator listIt ;
+ list<MED_EN::medGeometryElement>::const_iterator listIt ;
int it=0 ;
- for(listIt=(MED_FR::meshEntities[(MED_FR::med_entite_maillage)_entity]).begin();listIt!=(MED_FR::meshEntities[(MED_FR::med_entite_maillage)_entity]).end();listIt++) {
+ for(listIt=(meshEntities[_entity]).begin();listIt!=(meshEntities[_entity]).end();listIt++) {
tmp_NumberOfElementsInType[it]=0;
whereIsType[it]=0 ;
myType[it]= MED_NONE;
#include "MEDMEM_define.hxx"
#include "MEDMEM_SkyLineArray.hxx"
-using namespace MED_EN;
-using namespace MEDMEM;
-
-
/*!
This class describe a support of elements on an entity of the mesh.
(only one for each support).
\endif
*/
- medEntityMesh _entity ;
+ MED_EN::medEntityMesh _entity ;
/*!
\if developper
Array of all geometric type defined in the support.
\endif
*/
- medGeometryElement * _geometricType;
+ MED_EN::medGeometryElement * _geometricType;
/*!
\if developper
public:
SUPPORT();
- SUPPORT(MESH* Mesh, string Name="", medEntityMesh Entity=MED_CELL);
+ SUPPORT(MESH* Mesh, string Name="", MED_EN::medEntityMesh Entity=MED_EN::MED_CELL);
SUPPORT(const SUPPORT & m);
virtual ~SUPPORT();
friend ostream & operator<<(ostream &os,const SUPPORT &my);
inline void setDescription(string Description);
inline void setMesh(MESH *Mesh);
inline void setAll(bool All);
- inline void setEntity(medEntityMesh Entity);
+ inline void setEntity(MED_EN::medEntityMesh Entity);
inline void setNumberOfGeometricType(int NumberOfGeometricType);
- inline void setGeometricType(const medGeometryElement *GeometricType);
+ inline void setGeometricType(const MED_EN::medGeometryElement *GeometricType);
inline void setNumberOfGaussPoint(const int *NumberOfGaussPoint);
// inline void setGeometricTypeNumber(int *GeometricTypeNumber);
inline void setNumberOfElements(const int *NumberOfElements);
inline string getName() const;
inline string getDescription() const;
virtual inline MESH * getMesh() const;
- inline medEntityMesh getEntity() const;
+ inline MED_EN::medEntityMesh getEntity() const;
inline bool isOnAllElements() const;
inline int getNumberOfTypes() const;
- inline const medGeometryElement* getTypes() const ;
+ inline const MED_EN::medGeometryElement* getTypes() const ;
inline const int * getNumberOfGaussPoint() const throw (MEDEXCEPTION);
- inline int getNumberOfGaussPoint(medGeometryElement geomElement) const throw (MEDEXCEPTION);
+ inline int getNumberOfGaussPoint(MED_EN::medGeometryElement geomElement) const throw (MEDEXCEPTION);
//inline int * getGeometricTypeNumber() const;
//inline int getTotalNumberOfElement() const;
- inline int getNumberOfElements(medGeometryElement GeometricType) const throw (MEDEXCEPTION);
+ inline int getNumberOfElements(MED_EN::medGeometryElement GeometricType) const throw (MEDEXCEPTION);
virtual inline MEDSKYLINEARRAY * getnumber() const throw (MEDEXCEPTION);
- virtual inline const int * getNumber(medGeometryElement GeometricType) const throw (MEDEXCEPTION);
+ virtual inline const int * getNumber(MED_EN::medGeometryElement GeometricType) const throw (MEDEXCEPTION);
virtual inline const int * getNumberIndex() const throw (MEDEXCEPTION);
void blending(SUPPORT * mySupport) throw (MEDEXCEPTION) ;
void setpartial(string Description, int NumberOfGeometricType,
- int TotalNumberOfEntity, medGeometryElement *GeometricType,
+ int TotalNumberOfEntity, MED_EN::medGeometryElement *GeometricType,
int *NumberOfEntity, int *NumberValue);
void getBoundaryElements() throw (MEDEXCEPTION);
void intersecting(SUPPORT * mySupport) throw (MEDEXCEPTION) ;
};
-};
+
// _____________________
// Methodes Inline
// _____________________
-using namespace MEDMEM;
/*!
This method returns the number of all elements of the type GeometricType.
of nodes in the support (or in the whole mesh).
*/
//-----------------------------------------------------------------------------
-inline int SUPPORT::getNumberOfElements(medGeometryElement GeometricType) const
+inline int SUPPORT::getNumberOfElements(MED_EN::medGeometryElement GeometricType) const
throw (MEDEXCEPTION)
//-----------------------------------------------------------------------------
{
- if (GeometricType==MED_ALL_ELEMENTS)
+ if (GeometricType==MED_EN::MED_ALL_ELEMENTS)
return _totalNumberOfElements;
for (int i=0;i<_numberOfGeometricType;i++)
if (_geometricType[i]==GeometricType)
medGeometryElement type.
*/
//---------------------------------------------------------------------
-inline const int * SUPPORT::getNumber(medGeometryElement GeometricType) const
+inline const int * SUPPORT::getNumber(MED_EN::medGeometryElement GeometricType) const
throw (MEDEXCEPTION)
//---------------------------------------------------------------------
{
const char * LOC = "Support::getNumber : " ;
if (_isOnAllElts)
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Not defined, support is on all entity !")) ;
- if (GeometricType==MED_ALL_ELEMENTS)
+ if (GeometricType==MED_EN::MED_ALL_ELEMENTS)
return _number->getValue() ;
for (int i=0;i<_numberOfGeometricType;i++)
if (_geometricType[i]==GeometricType)
- Not defined for MED_ALL_ELEMENTS medGeometryElement type.
*/
//-----------------------------------------------------------------------------
-inline int SUPPORT::getNumberOfGaussPoint(medGeometryElement geomElement) const
+inline int SUPPORT::getNumberOfGaussPoint(MED_EN::medGeometryElement geomElement) const
throw (MEDEXCEPTION)
//-----------------------------------------------------------------------------
{
/*! set the attribute _entity to Entity */
//------------------------------------------
-inline void SUPPORT::setEntity(medEntityMesh Entity)
+inline void SUPPORT::setEntity(MED_EN::medEntityMesh Entity)
{
_entity=Entity;
// if ( Entity == MED_NODE) {
/*! set the attribute _geometricType to geometricType */
//---------------------------------------------------------------------
-inline void SUPPORT::setGeometricType(const medGeometryElement *GeometricType)
+inline void SUPPORT::setGeometricType(const MED_EN::medGeometryElement *GeometricType)
//---------------------------------------------------------------------
{
if (NULL == _geometricType)
- _geometricType=new medGeometryElement[_numberOfGeometricType];
+ _geometricType=new MED_EN::medGeometryElement[_numberOfGeometricType];
for (int i=0;i<_numberOfGeometricType;i++)
_geometricType[i] = GeometricType[i];
// _geometricType=GeometricType;
(for example : MED_FACE or MED_NODE)
*/
//---------------------------------------------
-inline medEntityMesh SUPPORT::getEntity() const
+inline MED_EN::medEntityMesh SUPPORT::getEntity() const
//---------------------------------------------
{
return _entity;
types used by the support.
*/
//---------------------------------------------------
-inline const medGeometryElement * SUPPORT::getTypes() const
+inline const MED_EN::medGeometryElement * SUPPORT::getTypes() const
//---------------------------------------------------
{
// if ((_isOnAllElts)&(_entity != MED_NODE))
// return _geometricTypeNumber;
// }
+}//End namespace MEDMEM
+
#endif /* SUPPORT_HXX */
-using namespace std;
-
#include "MEDMEM_TypeMeshDriver.hxx"
#include "MEDMEM_DriversDef.hxx"
#include "MEDMEM_Connectivity.hxx"
#include "MEDMEM_Mesh.hxx"
#include "MEDMEM_CellModel.hxx"
+
+using namespace std;
using namespace MEDMEM;
// Every memory allocation made in the MedDriver members function are desallocated in the Mesh destructor
#include "MEDMEM_Exception.hxx"
#include "utilities.h"
-using namespace MEDMEM;
-
/*!
Driver TYPE for MESH.
-using namespace std;
/*
File MEDMEM_Unit.cxx
$Header$
*/
#include "MEDMEM_Unit.hxx"
+
+using namespace std;
using namespace MEDMEM;
UNIT::UNIT():_name(""),_description(""),_masse(0),_length(0),_time(0),_temperature(0),_matterQuantity(0),_currentStrength(0),_lightIntensity(0) {
#include "utilities.h"
#include "MEDMEM_Exception.hxx"
#include "MEDMEM_define.hxx"
-//using namespace MED_EN;
namespace MEDMEM {
class UNIT {
inline int getLightIntensity() const ;
} ;
-} ;
// inline method :
-using namespace MEDMEM;
inline void UNIT::setName(string Name) {
_name = Name ;
};
inline int UNIT::getMatterQuantity() const { return _matterQuantity ; } ;
inline int UNIT::getCurrentStrength() const { return _currentStrength ; } ;
inline int UNIT::getLightIntensity() const { return _lightIntensity ; } ;
+}//End namespace MEDMEM
#endif /* UNIT_HXX */
#include "MEDMEM_Mesh.hxx"
#include "MEDMEM_CellModel.hxx"
-using namespace MEDMEM ;
-
/*!
Constructor.
*/
VTK_FIELD_DRIVER(const string & fileName, FIELD<T> * ptrField)
- : GENDRIVER(fileName,MED_WRONLY),
+ : GENDRIVER(fileName,MED_EN::MED_WRONLY),
_ptrField((FIELD<T> *) ptrField),
_fieldName(fileName),_fieldNum(MED_INVALID)
{
GENDRIVER * copy ( void ) const ;
};
-};
/*-------------------------*/
/* template implementation */
/*--------------------- DRIVER PART -------------------------------*/
-using namespace MEDMEM;
template <class T> void VTK_FIELD_DRIVER<T>::setFieldName(const string & fieldName)
{
_fieldName = fieldName;
int SpaceDimension = meshField->getSpaceDimension() ;
int NumberOfNodes = meshField->getNumberOfNodes() ;
(*_vtkFile) << "POINTS " << NumberOfNodes << " float" << endl ;
- const double *coordinate = meshField->getCoordinates(MED_FULL_INTERLACE) ;
+ const double *coordinate = meshField->getCoordinates(MED_EN::MED_FULL_INTERLACE) ;
for (int i=0;i<NumberOfNodes;i++) {
for (int j=0;j<SpaceDimension;j++)
(*_vtkFile) << coordinate[i*SpaceDimension+j] << " " ;
// we put connectivity
// how many cells and how many value in connectivity :
- int cells_types_count = meshField->getNumberOfTypes(MED_CELL) ;
+ int cells_types_count = meshField->getNumberOfTypes(MED_EN::MED_CELL) ;
// int * cells_count = meshField->get_cells_count() ;
// int cells_sum = cells_count[cells_types_count] ;
- int cells_sum = meshField->getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS) ;
- const CELLMODEL * cells_type = meshField->getCellsTypes(MED_CELL) ;
+ int cells_sum = meshField->getNumberOfElements(MED_EN::MED_CELL,MED_EN::MED_ALL_ELEMENTS) ;
+ const CELLMODEL * cells_type = meshField->getCellsTypes(MED_EN::MED_CELL) ;
// int connectivity_sum = 0 ;
//const int * connectivity = meshField->getConnectivity(MED_FULL_INTERLACE,MED_NODAL,MED_CELL,MED_ALL_ELEMENTS) ; !! UNUSED VARIABLE !!
- const int * connectivityIndex = meshField->getConnectivityIndex(MED_NODAL,MED_CELL) ;
+ const int * connectivityIndex = meshField->getConnectivityIndex(MED_EN::MED_NODAL,MED_EN::MED_CELL) ;
int connectivity_sum = connectivityIndex[cells_sum]-1 ;
int *filter = (int*) NULL ; // index in vtk connectivity
switch (cells_type[i].getType())
{
- case MED_POINT1 : {
+ case MED_EN::MED_POINT1 : {
filter = new int[1] ;
filter[0] = 0 ;
break ;
}
- case MED_SEG2 : {
+ case MED_EN::MED_SEG2 : {
filter = new int[2] ;
filter[0] = 0 ;
filter[1] = 1 ;
break ;
}
- case MED_SEG3 : {
+ case MED_EN::MED_SEG3 : {
break ;
}
- case MED_TRIA3 : {
+ case MED_EN::MED_TRIA3 : {
filter = new int[3] ;
filter[0] = 0 ;
filter[1] = 1 ;
filter[2] = 2 ;
break ;
}
- case MED_QUAD4 : {
+ case MED_EN::MED_QUAD4 : {
filter = new int[4] ;
filter[0] = 0 ;
filter[1] = 1 ;
filter[3] = 3 ;
break ;
}
- case MED_TRIA6 : {
+ case MED_EN::MED_TRIA6 : {
break ;
}
- case MED_QUAD8 : {
+ case MED_EN::MED_QUAD8 : {
break ;
}
- case MED_TETRA4 : {
+ case MED_EN::MED_TETRA4 : {
filter = new int[4] ;
filter[0] = 0 ;
filter[1] = 1 ;
filter[3] = 2 ; // 4th element in med are 3rd in vtk (array begin at 0 !)
break ;
}
- case MED_PYRA5 : {
+ case MED_EN::MED_PYRA5 : {
filter = new int[5] ;
filter[0] = 0 ;
filter[1] = 3 ; // 2nd element in med are 4th in vtk (array begin at 0 !)
filter[4] = 4 ;
break ;
}
- case MED_PENTA6 : {
+ case MED_EN::MED_PENTA6 : {
filter = new int[6] ;
filter[0] = 0 ;
filter[1] = 1 ;
filter[5] = 5 ;
break ;
}
- case MED_HEXA8 : {
+ case MED_EN::MED_HEXA8 : {
filter = new int[8] ;
filter[0] = 0 ;
filter[1] = 3 ;
filter[7] = 5 ;
break ;
}
- case MED_TETRA10 : {
+ case MED_EN::MED_TETRA10 : {
break ;
}
- case MED_PYRA13 : {
+ case MED_EN::MED_PYRA13 : {
break ;
}
- case MED_PENTA15 : {
+ case MED_EN::MED_PENTA15 : {
break ;
}
- case MED_HEXA20 : {
+ case MED_EN::MED_HEXA20 : {
break ;
}
default : {
if (filter==NULL)
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<": MED element type not supported yet : " << cells_type[i].getName() ) ) ;
int nodes_cell = cells_type[i].getNumberOfNodes();
- int numberOfCell = meshField->getNumberOfElements(MED_CELL,cells_type[i].getType()) ;
- const int * connectivityArray = meshField->getConnectivity(MED_FULL_INTERLACE,MED_NODAL,MED_CELL,cells_type[i].getType());
+ int numberOfCell = meshField->getNumberOfElements(MED_EN::MED_CELL,cells_type[i].getType()) ;
+ const int * connectivityArray = meshField->getConnectivity(MED_EN::MED_FULL_INTERLACE,MED_EN::MED_NODAL,MED_EN::MED_CELL,cells_type[i].getType());
for (int j=0;j<numberOfCell;j++) {
(*_vtkFile) << nodes_cell << " " ;
for (int k=0;k<nodes_cell;k++)
int vtkType = 0 ;
switch (cells_type[i].getType())
{
- case MED_POINT1 : {
+ case MED_EN::MED_POINT1 : {
vtkType = 1 ;
break ;
}
- case MED_SEG2 : {
+ case MED_EN::MED_SEG2 : {
vtkType = 3 ;
break ;
}
- case MED_SEG3 : {
+ case MED_EN::MED_SEG3 : {
vtkType = 0 ;
break ;
}
- case MED_TRIA3 : {
+ case MED_EN::MED_TRIA3 : {
vtkType = 5 ;
break ;
}
- case MED_QUAD4 : {
+ case MED_EN::MED_QUAD4 : {
vtkType = 9 ;
break ;
}
- case MED_TRIA6 : {
+ case MED_EN::MED_TRIA6 : {
vtkType = 0 ;
break ;
}
- case MED_QUAD8 : {
+ case MED_EN::MED_QUAD8 : {
vtkType = 0 ;
break ;
}
- case MED_TETRA4 : {
+ case MED_EN::MED_TETRA4 : {
vtkType = 10 ;
break ;
}
- case MED_PYRA5 : {
+ case MED_EN::MED_PYRA5 : {
vtkType = 14 ;
break ;
}
- case MED_PENTA6 : {
+ case MED_EN::MED_PENTA6 : {
vtkType = 13 ;
break ;
}
- case MED_HEXA8 : {
+ case MED_EN::MED_HEXA8 : {
vtkType = 12 ;
break ;
}
- case MED_TETRA10 : {
+ case MED_EN::MED_TETRA10 : {
vtkType = 0 ;
break ;
}
- case MED_PYRA13 : {
+ case MED_EN::MED_PYRA13 : {
vtkType = 0 ;
break ;
}
- case MED_PENTA15 : {
+ case MED_EN::MED_PENTA15 : {
vtkType = 0 ;
break ;
}
- case MED_HEXA20 : {
+ case MED_EN::MED_HEXA20 : {
vtkType = 0 ;
break ;
}
}
if (vtkType == 0)
throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<": MED element type not supported yet : " << cells_type[i].getType() ) ) ;
- int numberOfCell = meshField->getNumberOfElements(MED_CELL,cells_type[i].getType()) ;
+ int numberOfCell = meshField->getNumberOfElements(MED_EN::MED_CELL,cells_type[i].getType()) ;
for (int j=0;j<numberOfCell;j++)
(*_vtkFile) << vtkType << endl ;
}
ostringstream name ;
string nameField = _ptrField->getName();
- medEntityMesh entitySupport = supportField->getEntity();
+ MED_EN::medEntityMesh entitySupport = supportField->getEntity();
name << nameField << "_" << dt << "_" << it ;
if (!(supportField->isOnAllElements()))
throw MED_EXCEPTION(LOCALIZED(STRING(LOC) << "Could not write field "<<_ptrField->getName()<<" which is not on all entities of the mesh !" << entitySupport));
- if (entitySupport == MED_NODE)
+ if (entitySupport == MED_EN::MED_NODE)
(*_vtkFile) << "POINT_DATA " << meshField->getNumberOfNodes() << endl ;
- else if (entitySupport == MED_CELL)
- (*_vtkFile) << "CELL_DATA " << meshField->getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS) << endl ;
+ else if (entitySupport == MED_EN::MED_CELL)
+ (*_vtkFile) << "CELL_DATA " << meshField->getNumberOfElements(MED_EN::MED_CELL,MED_EN::MED_ALL_ELEMENTS) << endl ;
else
throw MED_EXCEPTION(LOCALIZED(STRING(LOC) << "Could not write field "<<_ptrField->getName()<<" which is not on all nodes or cells but it's on !" << entitySupport));
- int NomberOfValue = supportField->getNumberOfElements(MED_ALL_ELEMENTS) ;
+ int NomberOfValue = supportField->getNumberOfElements(MED_EN::MED_ALL_ELEMENTS) ;
int NomberOfComponents = _ptrField->getNumberOfComponents() ;
- med_type_champ fieldType = _ptrField->getValueType() ;
+ MED_EN::med_type_champ fieldType = _ptrField->getValueType() ;
SCRUTE(name.str());
SCRUTE(fieldType);
switch (fieldType)
{
- case MED_INT32 :
+ case MED_EN::MED_INT32 :
{
break ;
}
- case MED_REEL64 :
+ case MED_EN::MED_REEL64 :
{
break ;
}
else
throw MED_EXCEPTION(LOCALIZED(STRING(LOC) << "Could not write field "<<_ptrField->getName()<<" there are more than 4 components !"));
- const T * value = _ptrField->getValue(MED_NO_INTERLACE) ;
+ const T * value = _ptrField->getValue(MED_EN::MED_NO_INTERLACE) ;
for (int i=0; i<NomberOfValue; i++)
{
ostringstream name ;
string nameField = _ptrField->getName();
- medEntityMesh entitySupport = supportField->getEntity();
+ MED_EN::medEntityMesh entitySupport = supportField->getEntity();
name << nameField << "_" << dt << "_" << it ;
if (!(supportField->isOnAllElements()))
throw MED_EXCEPTION(LOCALIZED(STRING(LOC) << "Could not write field "<<_ptrField->getName()<<" which is not on all entities of the mesh !" << entitySupport));
- if (entitySupport == MED_NODE)
+ if (entitySupport == MED_EN::MED_NODE)
(*_vtkFile) << "POINT_DATA " << meshField->getNumberOfNodes() << endl ;
- else if (entitySupport == MED_CELL)
- (*_vtkFile) << "CELL_DATA " << meshField->getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS) << endl ;
+ else if (entitySupport == MED_EN::MED_CELL)
+ (*_vtkFile) << "CELL_DATA " << meshField->getNumberOfElements(MED_EN::MED_CELL,MED_EN::MED_ALL_ELEMENTS) << endl ;
else
throw MED_EXCEPTION(LOCALIZED(STRING(LOC) << "Could not write field "<<_ptrField->getName()<<" which is not on all nodes or cells but it's on !" << entitySupport));
- int NomberOfValue = supportField->getNumberOfElements(MED_ALL_ELEMENTS) ;
+ int NomberOfValue = supportField->getNumberOfElements(MED_EN::MED_ALL_ELEMENTS) ;
int NomberOfComponents = _ptrField->getNumberOfComponents() ;
- med_type_champ fieldType = _ptrField->getValueType() ;
+ MED_EN::med_type_champ fieldType = _ptrField->getValueType() ;
SCRUTE(name.str());
SCRUTE(fieldType);
switch (fieldType)
{
- case MED_INT32 :
+ case MED_EN::MED_INT32 :
{
break ;
}
- case MED_REEL64 :
+ case MED_EN::MED_REEL64 :
{
break ;
}
else
throw MED_EXCEPTION(LOCALIZED(STRING(LOC) << "Could not write field "<<_ptrField->getName()<<" there are more than 4 components !"));
- const T * value = _ptrField->getValue(MED_NO_INTERLACE) ;
+ const T * value = _ptrField->getValue(MED_EN::MED_NO_INTERLACE) ;
for (int i=0; i<NomberOfValue; i++)
{
}
END_OF(LOC);
}
+}//End namespace MEDMEM
#endif /* VTK_FIELD_DRIVER_HXX */
-using namespace std;
#include "MEDMEM_VtkMedDriver.hxx"
#include <sstream>
#include "MEDMEM_Support.hxx"
#include "MEDMEM_Mesh.hxx"
#include "MEDMEM_CellModel.hxx"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
VTK_MED_DRIVER::VTK_MED_DRIVER(): GENDRIVER(),
_ptrMed((MED * const)MED_NULL)
-using namespace std;
#include "MEDMEM_VtkMeshDriver.hxx"
#include "MEDMEM_DriversDef.hxx"
#include "MEDMEM_Grid.hxx"
#include <sstream>
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
VTK_MESH_DRIVER::VTK_MESH_DRIVER(): GENDRIVER(),
_ptrMesh((MESH * const)MED_NULL)
// UTILE AUX DEUX NAMESPACES
#include <hdf5.h>
-namespace MED_FR {
- extern "C" {
-# include <med.h>
-# include <med_proto.h>
- }
-}
+# include <med.hxx>
+# include <med_proto.hxx>
+// namespace MED_FR {
+// extern "C" {
+// # include <med.h>
+// # include <med_proto.h>
+// }
+// }
namespace MED_EN {
extern "C" {
//#define MED_ALL 0 !!!!! NB: WARNING MED_ALL deja utilise dans l'enum medGeometryElement !!!!!!!!
#define MED_ALL 0
-#if defined(SUN4SOL2) || defined(PCLINUX) || defined(OSF1) || defined(IRIX64_32) || defined(RS6000)
+#if defined(SUN4SOL2) || defined(PCLINUX) || defined(OSF1_32) || defined(IRIX64_32) || defined(RS6000)
/* interface C/FORTRAN */
/* this true only with g77 and gcc : we must change it to use directly NOMF_... and INT32 or INT64 - it will be more simple to understand and to use ! */
#define NOMF_POST_UNDERSCORE
typedef double med_float;
#endif
-#if defined(IRIX64)
+#if defined(IRIX64) || defined(OSF1) || defined(VPP5000)
#define NOMF_POST_UNDERSCORE
/* correspondance des types avec HDF 5 */
BIN_SERVER_IDL =
BIN_CLIENT_IDL =
-TEST_PROGS = test_MEDMEM_ModulusArray test_MEDMEM_Array test_MEDMEM_SkyLineArray test_MEDMEM_CellModel testUPointerOf testUCoordinate testUUnit testUGeoNameMeshEntities testUMedException testUModulusArray testUSkyLineArray testUArray testUCellModel readEntete readCoordinate test_copie_field_ test_copie_fieldT test_copie_coordinate test_copie_medarray test_copie_connectivity test_copie_support test_copie_family test_copie_group test_copie_mesh test_affect_medarray test_MEDMEM_Meshing test_operation_fielddouble test_operation_fieldint test_gibi_driver test_porflow_driver
+TEST_PROGS = test_MEDMEM_ModulusArray test_MEDMEM_Array test_MEDMEM_SkyLineArray test_MEDMEM_CellModel testUPointerOf testUCoordinate testUUnit testUGeoNameMeshEntities testUMedException testUModulusArray testUSkyLineArray testUArray testUCellModel readEntete readCoordinate test_copie_field_ test_copie_fieldT test_copie_coordinate test_copie_medarray test_copie_connectivity test_copie_support test_copie_family test_copie_group test_copie_mesh test_affect_medarray test_MEDMEM_Meshing test_operation_fielddouble test_operation_fieldint test_gibi_driver test_porflow_driver test_grid
# testUCellModel -> a revoir car l'API a changee (plus de vector)
+LDFLAGS+= -L$(top_builddir)/lib/salome
+LDFLAGSFORBIN+= -L$(top_builddir)/lib/salome
+
CPPFLAGS+=$(MED2_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS+=-ftemplate-depth-42 -I${KERNEL_ROOT_DIR}/include/salome
+CXXFLAGS+=@CXXTMPDPTHFLAGS@ -I${KERNEL_ROOT_DIR}/include/salome
#LDFLAGS+=$(MED2_LIBS) $(HDF5_LIBS) -lSalomeLoggerServer -L${KERNEL_ROOT_DIR}/lib/salome
# change motivated by the bug KERNEL4778.
-LDFLAGS+=$(MED2_LIBS) $(HDF5_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace
+LDFLAGS+=$(MED2_LIBS) $(HDF5_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace -lMEDWrapper_V2_1 $(STDLIB)
#LDFLAGSFORBIN+=$(MED2_LIBS) $(HDF5_LIBS) -lSalomeLoggerServer -L${KERNEL_ROOT_DIR}/lib/salome
# change motivated by the bug KERNEL4778.
-LDFLAGSFORBIN+=$(MED2_LIBS) $(HDF5_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace
+LDFLAGSFORBIN+=-lm $(MED2_LIBS) $(HDF5_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace -lMEDWrapper_V2_1 -lMEDWrapperBase
LIBSFORBIN=
-LDFLAGS=
-
LIBS=
# build create_mesh :
/*----------------------------------------------------------------------------
-MED MEDMEM : MED files in memory
+ MED MEDMEM : MED files in memory
- Copyright (C) 2003 CEA/DEN, EDF R&D
+ Copyright (C) 2003 CEA/DEN, EDF R&D
File : create_grid.c
-Module : MED
+ Module : MED
----------------------------------------------------------------------------*/
/******************************************************************************
int main (int argc, char **argv)
{
-/* Ecriture d'un premier maillage non structure (test14 + test8)
- ************************************************************* */
+ /* Ecriture d'un premier maillage non structure (test14 + test8)
+ ************************************************************** */
med_err ret;
med_idt fid;
med_int mdim = 2;
/* nom du maillage de longueur maxi MED_TAILLE_NOM */
char maa[MED_TAILLE_NOM+1] = "maa1";
+ /* description du maillage de longueur maxi MED_TAIIL_DESC */
+ char maadesc[MED_TAILLE_DESC+1] = "Example de maillage structure 2D";
/* le nombre de noeuds */
med_int nnoe = 4;
/* table des coordonnees
med_int nbr[2] = {2, 2};
/* tables des noms et des unites des coordonnees
profil : (dimension*MED_TAILLE_PNOM+1) */
- char nomcoo[2*MED_TAILLE_PNOM+1] = "x y ";
- char unicoo[2*MED_TAILLE_PNOM+1] = "cm cm ";
+ char nomcoo[2*MED_TAILLE_PNOM+1] = "x y ";
+ char unicoo[2*MED_TAILLE_PNOM+1] = "cm cm ";
+
+ char nomcooi[MED_TAILLE_PNOM+1] = "x ";
+ char unicooi[MED_TAILLE_PNOM+1] = "cm ";
/* tables des noms, numeros, numeros de familles des noeuds
autant d'elements que de noeuds - les noms ont pout longueur
MED_TAILLE_PNOM */
- char nomnoe[4*MED_TAILLE_PNOM+1] = "nom1 nom2 nom3 nom4 ";
+ char nomnoe[4*MED_TAILLE_PNOM+1] = "nom1 nom2 nom3 nom4 ";
med_int numnoe[4] = {1,2,3,4};
med_int nufano[4] = {0,1,2,2};
char nomfam[MED_TAILLE_NOM+1];
med_int attval;
med_int ngro;
char gro[MED_TAILLE_LNOM+1];
- int i;
+ int i, ip1;
int nfame = 1;
int nfamn = 2;
- med_int fam[16];
+ med_int famNodeStd[4];
+ med_int famElmtStd[1];
+ med_int famFaceStd[4];
+ med_int famNodeCart[16];
+ med_int famElmtCart[9];
+ med_int famFaceCart[24];
/*
les elements:
*/
med_int quad4[4] = {
1, 2, 4, 3
};
- char nomquad4[MED_TAILLE_PNOM*1+1] = "quad1 ";
+ char nomquad4[MED_TAILLE_PNOM*1+1] = "quad1 ";
med_int numquad4[1] = {1};
med_int nufaquad4[1] = {-1};
- fid = MEDouvrir("test19.med",MED_REMP);
+ fid = MEDouvrir("test19.med",MED_LECTURE_ECRITURE);
if (fid < 0)
ret = -1;
else
ret = 0;
- printf("%d\n",ret);
+ printf("MEDouvrir : %d\n",ret);
/* creation du maillage maa de dimension 2 */
if (ret == 0)
- ret = MEDmaaCr(fid,maa,mdim);
- printf("%d\n",ret);
+ ret = MEDmaaCr(fid,maa,mdim,MED_NON_STRUCTURE,maadesc);
+ printf("MEDmaaCr : %d\n",ret);
/* ecriture des noeuds d'un maillage MED :
- des coo en mode MED_FULL_INTERLACE : (X1,Y1,X2,Y2,X3,Y3,...)
- dans un repere cartesien
+ dans un repere cartesien
- des noms (optionnel dans un fichier MED)
- des numeros (optionnel dans un fichier MED)
- des numeros de familles des noeuds */
if (ret == 0)
ret = MEDnoeudsEcr(fid,maa,mdim,coo,MED_FULL_INTERLACE,MED_CART,
nomcoo,unicoo,nomnoe,MED_VRAI,numnoe,MED_VRAI,
- nufano,nnoe,MED_ECRI);
- printf("%d\n",ret);
+ nufano,nnoe);
+ printf("MEDnoeudsEcr : %d\n",ret);
/* ecriture des mailles MED_QUAD4 :
- connectivite
if (ret == 0)
ret = MEDelementsEcr(fid,maa,mdim,quad4,MED_FULL_INTERLACE,
nomquad4,MED_FAUX,numquad4,MED_VRAI,nufaquad4,nquad4,
- MED_MAILLE,MED_QUAD4,MED_NOD,MED_ECRI);
- printf("%d \n",ret);
+ MED_MAILLE,MED_QUAD4,MED_NOD);
+ printf("MEDelementsEcr : %d\n",ret);
/* ecriture des familles */
/* Conventions :
- toujours creer une famille de numero 0 ne comportant aucun attribut
- ni groupe (famille de reference pour les noeuds ou les elements
- qui ne sont rattaches a aucun groupe ni attribut)
+ ni groupe (famille de reference pour les noeuds ou les elements
+ qui ne sont rattaches a aucun groupe ni attribut)
- les numeros de familles de noeuds sont > 0
- les numeros de familles des elements sont < 0
- rien d'imposer sur les noms de familles
- */
+ */
/* la famille 0 */
if (ret == 0)
ret = MEDfamCr(fid,maa,nomfam,numfam,&attide,&attval,attdes,0,
gro,0);
}
- printf("%d \n",ret);
+ printf("MEDfamCr : %d \n",ret);
/* on cree pour correspondre aux cas tests precedents, 3 familles
d'elements (-1,-2,-3) et deux familles de noeuds (1,2) */
}
}
- if (ret == 0)
+ if (ret == 0)
{
nfamn = 2;
for (i=0;i<nfamn;i++)
/* fermeture du fichier */
ret = MEDfermer(fid);
- printf("%d\n",ret);
+ printf("MEDfermer : %d\n",ret);
-/* Ecriture d'un deuxieme maillage structure : body fitted
- ******************************************************* */
+ /* Ecriture d'un deuxieme maillage structure : grille standard
+ ************************************************************* */
- fid = MEDouvrir("test19.med",MED_ECRI);
+ fid = MEDouvrir("test19.med", MED_LECTURE_ECRITURE);
if (fid < 0)
ret = -1;
else
ret = 0;
- printf("%d\n",ret);
+ printf("MEDouvrir : %d\n",ret);
+
+ strcpy(maa, "Grille Standard");
+ strcpy(maadesc, "Example de maillage structure grille standard 2D");
+ /* creation du maillage grille standard maa de dimension 2 */
+ if (ret == 0)
+ ret = MEDmaaCr(fid, maa, mdim, MED_STRUCTURE, maadesc);
+ printf("MEDmaaCr : %d\n",ret);
- strcpy(maa, "bodyfitted");
- /* creation du maillage body fitted maa de dimension 2 */
if (ret == 0)
- ret = MEDgridCr(fid, maa, mdim, MED_BODY_FITTED);
- printf("%d\n",ret);
+ ret = MEDnatureGrilleEcr(fid, maa, MED_GRILLE_STANDARD);
+ printf("MEDnatureGrilleEcr : %d\n",ret);
/* ecriture des noeuds d'un maillage MED :
- des coo en mode MED_FULL_INTERLACE : (X1,Y1,X2,Y2,X3,Y3,...)
- dans un repere cartesien
+ dans un repere cartesien
- des noms (optionnel dans un fichier MED)
- des numeros (optionnel dans un fichier MED)
- des numeros de familles des noeuds */
+/* if (ret == 0) */
+/* ret = MEDstructureCoordEcr(fid,maa,mdim,nbr); */
+/* printf("MEDstructureCoordEcr : %d\n",ret); */
+
if (ret == 0)
- ret = MEDbodyFittedEcr(fid,maa,mdim,coo,nbr,MED_FULL_INTERLACE,MED_CART,
- nomcoo,unicoo,nufano,nnoe,MED_ECRI);
- printf("%d\n",ret);
+ ret = MEDcoordEcr(fid,maa,mdim,coo,MED_FULL_INTERLACE,nnoe,MED_CART,
+ nomcoo,unicoo);
+ printf("MEDcoordEcr : %d\n",ret);
+
+ if (ret == 0)
+ ret = MEDstructureCoordEcr(fid,maa,mdim,nbr);
+ printf("MEDstructureCoordEcr : %d\n",ret);
+
+ /* Ecriture des familles de la grille standard */
+
+ /* les noeuds */
+
+ if (ret == 0) {
+ famNodeStd[ 0]=1; famNodeStd[ 1]=1;
+ famNodeStd[ 2]=2; famNodeStd[ 3]=2;
+
+ ret = MEDfamEcr(fid, maa, famNodeStd, 4, MED_NOEUD, 0);
+ };
+ printf("MEDfamEcr for Nodes : %d\n",ret);
+
+ /* les elements */
+
+ if (ret == 0) {
+ famElmtStd[ 0]=0;
+
+ ret = MEDfamEcr(fid, maa, famElmtStd, 1, MED_MAILLE, MED_QUAD4);
+ };
+ printf("MEDfamEcr for Elements : %d\n",ret);
+
+ /* les faces/edges */
+
+ if (ret == 0) {
+ for (i=0; i<4; i++) famFaceStd[i]=0;
+
+ ret = MEDfamEcr(fid, maa, famFaceStd, 4, MED_ARETE, MED_SEG2);
+ };
+ printf("MEDfamEcr for Elements : %d\n",ret);
/* la famille 0 */
if (ret == 0)
ret = MEDfamCr(fid,maa,nomfam,numfam,&attide,&attval,attdes,0,
gro,0);
}
- printf("%d \n",ret);
-
-
+ printf("MEDfamCr : %d\n",ret);
- if (ret == 0)
+ if (ret == 0)
{
nfamn = 2;
for (i=0;i<nfamn;i++)
}
}
-
-
-
/* fermeture du fichier */
ret = MEDfermer(fid);
- printf("%d\n",ret);
+ printf("MEDfermer : %d\n",ret);
-/* Ecriture d'un troisieme maillage structure : grille cartesienne
- *************************************************************** */
+ /* Ecriture d'un troisieme maillage structure : grille cartesienne
+ *************************************************************** */
- fid = MEDouvrir("test19.med", MED_ECRI);
+ fid = MEDouvrir("test19.med", MED_LECTURE_ECRITURE);
if (fid < 0)
ret = -1;
else
ret = 0;
- printf("%d\n",ret);
+ printf("MEDouvrir : %d\n",ret);
- strcpy(maa, "CartGrid");
+ strcpy(maa, "Grille Cartesienne");
+ strcpy(maadesc, "Example de maillage structure grille cartesienne 2D");
/* creation d'une grille cartesienne maa de dimension 2 */
if (ret == 0)
- ret = MEDgridCr(fid, maa, mdim, MED_CARTESIAN);
- printf("%d\n",ret);
-
- /* Ecriture des indices de la grille cartesienne :
- - des coo en mode MED_FULL_INTERLACE : (X1,Y1,X2,Y2,X3,Y3,...) */
- for (i=0; i<mdim; i++) {
- coo[0] = 1.1+i;
- coo[1] = 1.2+i;
- coo[2] = 1.3+i;
- coo[3] = 1.4+i;
- if (ret == 0) {
- ret = MEDgridEcr(fid, maa, mdim, coo, nnoe, i, MED_FULL_INTERLACE, MED_CART, nomcoo, unicoo, MED_ECRI);
- };
- };
- printf("%d\n",ret);
+ ret = MEDmaaCr(fid, maa, mdim, MED_STRUCTURE, maadesc);
+ printf("MEDmaaCr : %d\n",ret);
- /* Ecriture des familles de la grille cartesienne */
+ if (ret == 0)
+ ret = MEDnatureGrilleEcr(fid, maa, MED_GRILLE_CARTESIENNE);
+ printf("MEDnatureGrilleEcr : %d\n",ret);
+
+ /* Ecriture des indices de la grille cartesienne :
+ - des coo en mode MED_FULL_INTERLACE : (X1,Y1,X2,Y2,X3,Y3,...) */
+ for (i=0; i<mdim; i++) {
+ ip1 = i + 1;
+ coo[0] = 1.1+i;
+ coo[1] = 1.2+i;
+ coo[2] = 1.3+i;
+ coo[3] = 1.4+i;
if (ret == 0) {
- fam[ 0]=3; fam[ 1]=3; fam[ 2]=2; fam[ 3]=1;
- fam[ 4]=7; fam[ 5]=8; fam[ 6]=2; fam[ 7]=4;
- fam[ 8]=2; fam[ 9]=9; fam[10]=0; fam[11]=2;
- fam[12]=5; fam[13]=5; fam[14]=6; fam[15]=7;
- ret = MEDfamGridEcr(fid, maa, fam, 16, MED_ECRI,MED_NOEUD);
+ ret = MEDindicesCoordEcr(fid, maa, mdim, coo, nnoe, ip1,
+ nomcooi, unicooi);
};
+ };
+ printf("MEDindicesCoordEcr : %d\n",ret);
+
+ /* Ecriture des familles de la grille cartesienne */
+
+ /* les noeuds */
+
+ if (ret == 0) {
+ famNodeCart[ 0]=3; famNodeCart[ 1]=3; famNodeCart[ 2]=2; famNodeCart[ 3]=1;
+ famNodeCart[ 4]=7; famNodeCart[ 5]=8; famNodeCart[ 6]=2; famNodeCart[ 7]=4;
+ famNodeCart[ 8]=2; famNodeCart[ 9]=9; famNodeCart[10]=0; famNodeCart[11]=2;
+ famNodeCart[12]=5; famNodeCart[13]=5; famNodeCart[14]=6; famNodeCart[15]=7;
+
+ ret = MEDfamEcr(fid, maa, famNodeCart, 16, MED_NOEUD, 0);
+ };
+ printf("MEDfamEcr for Nodes : %d\n",ret);
+
+ /* les elements */
+
+ if (ret == 0) {
+ for(i=0; i<9; i++) famElmtCart[i]=0;
+
+ ret = MEDfamEcr(fid, maa, famElmtCart, 9, MED_MAILLE, MED_QUAD4);
+ };
+ printf("MEDfamEcr for Elements : %d\n",ret);
+
+ /* les faces/edges */
+ if (ret == 0) {
+ for(i=0; i<24; i++) famFaceCart[i]=0;
+
+ ret = MEDfamEcr(fid, maa, famFaceCart, 24, MED_ARETE, MED_SEG2);
+ };
+ printf("MEDfamEcr for Elements : %d\n",ret);
/* la famille 0 */
if (ret == 0)
ret = MEDfamCr(fid,maa,nomfam,numfam,&attide,&attval,attdes,0,
gro,0);
}
- printf("%d \n",ret);
-
+ printf("MEDfamCr : %d \n",ret);
- if (ret == 0)
+ if (ret == 0)
{
nfamn = 9;
for (i=0;i<nfamn;i++)
}
}
-
/* fermeture du fichier */
ret = MEDfermer(fid);
- printf("%d\n",ret);
+ printf("MEDfermer : %d\n",ret);
return 0;
}
#include <med.h>
#include <string.h>
-#define MED_NOPG 1 /* -> pas de point de Gauss */
-#define MED_NOPFL "" /* -> pas de profils utilisateur */
-#define MED_NOPFLi " " /* Variable Interne */
-#define MED_NOPF 0 /* -> pas de profils pour _MEDdataseNnumEcrire */
-#define MED_NOPDT -1 /* rem: pas de pas de temps negatifs */
-#define MED_NONOR -1 /* rem: pas de n°ordre negatif */
-#define MED_DIM1 1 /* PAS */
-
-#define MED_ALL 0
-
int main (int argc, char **argv)
{
med_err ret;
med_idt fid;
char maa[MED_TAILLE_NOM+1] = "maa1";
+ char maadesc[MED_TAILLE_DESC+1] = "Example de maillage non structure 3D";
med_int mdim = 3;
med_int nnoe = 19;
med_float coo[57] = {
1.0, -1.0, 4.0,
0.0, 0.0, 5.0
};
- char nomcoo[3*MED_TAILLE_PNOM+1] = "x y z ";
- char unicoo[3*MED_TAILLE_PNOM+1] = "cm cm cm ";
+ char nomcoo[3*MED_TAILLE_PNOM+1] = "x y z ";
+ char unicoo[3*MED_TAILLE_PNOM+1] = "cm cm cm ";
/* char nomnoe[19*MED_TAILLE_PNOM+1] = "nom1 nom2 nom3 nom4";*/
char *nomnoe ;
med_int numnoe[19] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
7,8,9,10,2,
15,18,17,16,19
};
- char nompyra5[MED_TAILLE_PNOM*2+1] = "pyra1 pyra2 ";
+ char nompyra5[MED_TAILLE_PNOM*2+1] = "pyra1 pyra2 ";
med_int numpyra5[2] = {13,16};
med_int nufapyra5[2] = {0,-3};
11,12,13,14,7,8,9,10,
15,16,17,18,11,12,13,14
};
- char nomhexa8[MED_TAILLE_PNOM*2+1] = "hexa1 hexa2 ";
+ char nomhexa8[MED_TAILLE_PNOM*2+1] = "hexa1 hexa2 ";
med_int numhexa8[2] = {14,15};
med_int nufahexa8[2] = {0,0};
Some fields : 2 on nodes : one int and one double , one on cells : double
*/
char champ1[MED_TAILLE_NOM+1]="fieldnodeint" ;
- char champ1_comp[MED_TAILLE_PNOM+1]="comp1 " ;
- char champ1_unit[MED_TAILLE_PNOM+1]="M " ;
+ char champ1_comp[MED_TAILLE_PNOM+1]="comp1 " ;
+ char champ1_unit[MED_TAILLE_PNOM+1]="M " ;
med_int fieldnodeint[19] = {1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7};
char champ2[MED_TAILLE_NOM+1]="fieldnodedouble" ;
- char champ2_comp[MED_TAILLE_PNOM+1]="comp1 " ;
- char champ2_unit[MED_TAILLE_PNOM+1]="J " ;
+ char champ2_comp[MED_TAILLE_PNOM+1]="comp1 " ;
+ char champ2_unit[MED_TAILLE_PNOM+1]="J " ;
med_float fieldnodedouble1[19] = {1.,1.,1.,2.,2.,2.,3.,3.,3.,4.,4.,4.,5.,5.,5.,6.,6.,6.,7.};
med_float fieldnodedouble2[19] = {1.,2.,2.,2.,3.,3.,3.,4.,4.,4.,5.,5.,5.,6.,6.,6.,7.,7.,7.};
char champ3[MED_TAILLE_NOM+1]="fieldcelldoublevector" ;
- char champ3_comp[MED_TAILLE_PNOM*3+1]="comp1 comp2 comp3 " ;
- char champ3_unit[MED_TAILLE_PNOM*3+1]="m/s m/s m/s " ;
+ char champ3_comp[MED_TAILLE_PNOM*3+1]="comp1 comp2 comp3 " ;
+ char champ3_unit[MED_TAILLE_PNOM*3+1]="m/s m/s m/s " ;
med_float fieldcelldouble1[12*3] = {1.,1.,1.,2.,2.,2.,3.,3.,3.,4.,4.,4.,0.,0.,0.,1.,1.,1.,0.,0.,0.,1.,1.,1.,1.,1.,1.,0.,0.,0.,1.,1.,1.,0.,0.,0.};
med_float fieldcelldouble2[2*3] = {5.,5.,0.,1.,0.,1.};
med_float fieldcelldouble3[2*3] = {6.,6.,1.,0.,1.,0.};
char champ4[MED_TAILLE_NOM+1]="fieldcelldoublescalar" ;
- char champ4_comp[MED_TAILLE_PNOM+1]="comp1 " ;
- char champ4_unit[MED_TAILLE_PNOM+1]="m/s " ;
+ char champ4_comp[MED_TAILLE_PNOM+1]="comp1 " ;
+ char champ4_unit[MED_TAILLE_PNOM+1]="m/s " ;
med_float fieldcelldouble4[12] = {1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.};
med_float fieldcelldouble5[2] = {2.,2.};
med_float fieldcelldouble6[2] = {3.,3.};
/***************************************************************************/
- fid = MEDouvrir("pointe.med",MED_REMP);
+ fid = MEDouvrir("pointe.med",MED_LECTURE_ECRITURE);
if (fid < 0)
ret = -1;
else
/***************************************************************************/
if (ret == 0)
- ret = MEDmaaCr(fid,maa,mdim);
+ ret = MEDmaaCr(fid,maa,mdim,MED_NON_STRUCTURE,maadesc);
printf("MEDmaaCr : %d\n",ret);
if (ret == 0)
ret = MEDunvCr(fid,maa);
if (ret == 0)
ret = MEDnoeudsEcr(fid,maa,mdim,coo,MED_FULL_INTERLACE,MED_CART,
nomcoo,unicoo,nomnoe,MED_FAUX,numnoe,MED_VRAI,
- nufano,nnoe,MED_ECRI);
+ nufano,nnoe);
printf("MEDnoeudsEcr : %d\n",ret);
if (ret == 0)
ret = MEDelementsEcr(fid,maa,mdim,tet4,MED_FULL_INTERLACE,
nomtet4,MED_FAUX,numtet4,MED_VRAI,nufatet4,ntet4,
- MED_MAILLE,MED_TETRA4,MED_NOD,MED_ECRI);
+ MED_MAILLE,MED_TETRA4,MED_NOD);
printf("MEDelementsEcr : %d \n",ret);
/* ecriture des mailles MED_PYRA5 :
if (ret == 0)
ret = MEDelementsEcr(fid,maa,mdim,pyra5,MED_FULL_INTERLACE,
nompyra5,MED_VRAI,numpyra5,MED_VRAI,nufapyra5,npyra5,
- MED_MAILLE,MED_PYRA5,MED_NOD,MED_ECRI);
+ MED_MAILLE,MED_PYRA5,MED_NOD);
printf("MEDelementsEcr : %d \n",ret);
/* ecriture des mailles MED_HEXA8 :
if (ret == 0)
ret = MEDelementsEcr(fid,maa,mdim,hexa8,MED_FULL_INTERLACE,
nomhexa8,MED_FAUX,numhexa8,MED_VRAI,nufahexa8,nhexa8,
- MED_MAILLE,MED_HEXA8,MED_NOD,MED_ECRI);
+ MED_MAILLE,MED_HEXA8,MED_NOD);
printf("MEDelementsEcr : %d \n",ret);
/***************************************************************************/
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ1, (unsigned char *)fieldnodeint,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, MED_NOPDT," ", 0., MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fid,champ2,MED_REEL64,champ2_comp,champ2_unit,1);
+ ret = MEDchampCr(fid,champ2,MED_FLOAT64,champ2_comp,champ2_unit,1);
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble1,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, 1,"S ", 1.1 , MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ 1,"S ", 1.1 , MED_NONOR);
printf("MEDchampEcr1 : %d \n",ret);
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble2,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, 2,"S ", 1.2 , MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ 2,"S ", 1.2 , MED_NONOR);
printf("MEDchampEcr2 : %d \n",ret);
}
}
/* printf("MEDchampCr : %d \n",ret); */
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble1,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, MED_NOPDT," ", 0. , MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ MED_NOPDT," ", 0. , MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
}
if (ret == 0)
{
- ret = MEDchampCr(fid,champ3,MED_REEL64,champ3_comp,champ3_unit,3);
+ ret = MEDchampCr(fid,champ3,MED_FLOAT64,champ3_comp,champ3_unit,3);
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ3, (unsigned char *)fieldcelldouble1,
- MED_NO_INTERLACE, ntet4,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE,
- MED_TETRA4, MED_NOPDT," ", 0., MED_NONOR);
+ MED_NO_INTERLACE, ntet4, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE, MED_TETRA4,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
ret = MEDchampEcr(fid, maa, champ3, (unsigned char *)fieldcelldouble3,
- MED_NO_INTERLACE, nhexa8,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE,
- MED_HEXA8, MED_NOPDT," ", 0., MED_NONOR);
+ MED_NO_INTERLACE, nhexa8, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE, MED_HEXA8,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
ret = MEDchampEcr(fid, maa, champ3, (unsigned char *)fieldcelldouble2,
- MED_NO_INTERLACE, npyra5,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE,
- MED_PYRA5, MED_NOPDT," ", 0., MED_NONOR);
+ MED_NO_INTERLACE, npyra5, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE, MED_PYRA5,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
}
if (ret == 0)
{
- ret = MEDchampCr(fid,champ4,MED_REEL64,champ4_comp,champ4_unit,1);
+ ret = MEDchampCr(fid,champ4,MED_FLOAT64,champ4_comp,champ4_unit,1);
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ4, (unsigned char *)fieldcelldouble4,
- MED_NO_INTERLACE, ntet4,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE,
- MED_TETRA4, MED_NOPDT," ", 0., MED_NONOR);
+ MED_NO_INTERLACE, ntet4, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE, MED_TETRA4,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
ret = MEDchampEcr(fid, maa, champ4, (unsigned char *)fieldcelldouble6,
- MED_NO_INTERLACE, nhexa8,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE,
- MED_HEXA8, MED_NOPDT," ", 0., MED_NONOR);
+ MED_NO_INTERLACE, nhexa8, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE, MED_HEXA8,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
ret = MEDchampEcr(fid, maa, champ4, (unsigned char *)fieldcelldouble5,
- MED_NO_INTERLACE, npyra5,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE,
- MED_PYRA5, MED_NOPDT," ", 0., MED_NONOR);
+ MED_NO_INTERLACE, npyra5, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE, MED_PYRA5,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
}
med_err ret;
med_idt fid;
char maa[MED_TAILLE_NOM+1] = "carre_en_quad4";
+ char maadesc[MED_TAILLE_DESC+1] = "Example de maillage non structure 2D";
med_int mdim = 2;
med_int nnoe = 9;
/*
0.5, 1.0,
1.0, 1.0
};
- char nomcoo[2*MED_TAILLE_PNOM+1] = "x y ";
- char unicoo[2*MED_TAILLE_PNOM+1] = "cm cm ";
+ char nomcoo[2*MED_TAILLE_PNOM+1] = "x y ";
+ char unicoo[2*MED_TAILLE_PNOM+1] = "cm cm ";
/* char nomnoe[19*MED_TAILLE_PNOM+1] = "nom1 nom2 nom3 nom4";*/
char *nomnoe ;
med_int numnoe[9] = {1,2,3,4,5,6,7,8,9};
7, 8, 5, 4,
8, 9, 6, 5
};
- char nomquad4[MED_TAILLE_PNOM*4+1] = "quad1 quad2 quad3 quad4 ";
+ char nomquad4[MED_TAILLE_PNOM*4+1] = "quad1 quad2 quad3 quad4 ";
med_int numquad4[4] = {1,2,3,4};
med_int nufaquad4[4] = {-1,-1,0,0};
Some fields : 2 on nodes : one int and one double , one on cells : double
*/
char champ1[MED_TAILLE_NOM+1]="fieldnodeint" ;
- char champ1_comp[MED_TAILLE_PNOM+1]="comp1 " ;
- char champ1_unit[MED_TAILLE_PNOM+1]="M " ;
+ char champ1_comp[MED_TAILLE_PNOM+1]="comp1 " ;
+ char champ1_unit[MED_TAILLE_PNOM+1]="M " ;
med_int fieldnodeint[9] = {1,1,3,2,2,3,4,4,5};
char champ2[MED_TAILLE_NOM+1]="fieldnodedouble" ;
- char champ2_comp[MED_TAILLE_PNOM+1]="comp1 " ;
- char champ2_unit[MED_TAILLE_PNOM+1]="J " ;
+ char champ2_comp[MED_TAILLE_PNOM+1]="comp1 " ;
+ char champ2_unit[MED_TAILLE_PNOM+1]="J " ;
med_float fieldnodedouble1[9] = {1.,3.,4.,1.,3.,4.,3.,2.,5.};
med_float fieldnodedouble2[9] = {1.,2.,2.,3.,3.,3.,4.,4.,5.};
char champ3[MED_TAILLE_NOM+1]="fieldcelldouble" ;
- char champ3_comp[MED_TAILLE_PNOM*2+1]="comp1 comp2 " ;
- char champ3_unit[MED_TAILLE_PNOM*2+1]="M/S m/s " ;
+ char champ3_comp[MED_TAILLE_PNOM*2+1]="comp1 comp2 " ;
+ char champ3_unit[MED_TAILLE_PNOM*2+1]="M/S m/s " ;
med_float fieldcelldouble[4*2] = {0.,1.,1.,1.,1.,2.,2.,3.};
/***************************************************************************/
- fid = MEDouvrir("carre_en_quad4.med",MED_REMP);
+ fid = MEDouvrir("carre_en_quad4.med",MED_LECTURE_ECRITURE);
if (fid < 0)
ret = -1;
else
ret = 0;
- printf("%d\n",ret);
+ printf("MEDouvrir : %d\n",ret);
/***************************************************************************/
if (ret == 0)
- ret = MEDmaaCr(fid,maa,mdim);
- printf("%d\n",ret);
+ ret = MEDmaaCr(fid,maa,mdim,MED_NON_STRUCTURE,maadesc);
+ printf("MEDmaaCr : %d\n",ret);
if (ret == 0)
ret = MEDunvCr(fid,maa);
- printf("%d\n",ret);
+ printf("MEDunvCr : %d\n",ret);
/***************************************************************************/
if (ret == 0)
ret = MEDnoeudsEcr(fid,maa,mdim,coo,MED_FULL_INTERLACE,MED_CART,
nomcoo,unicoo,nomnoe,MED_FAUX,numnoe,MED_VRAI,
- nufano,nnoe,MED_ECRI);
- printf("%d\n",ret);
+ nufano,nnoe);
+ printf("MEDnoeudsEcr : %d\n",ret);
/* ecriture des mailles MED_QUAD4 :
- connectivite
if (ret == 0)
ret = MEDelementsEcr(fid,maa,mdim,quad4,MED_FULL_INTERLACE,
nomquad4,MED_FAUX,numquad4,MED_VRAI,nufaquad4,nquad4,
- MED_MAILLE,MED_QUAD4,MED_NOD,MED_ECRI);
- printf("%d \n",ret);
+ MED_MAILLE,MED_QUAD4,MED_NOD);
+ printf("MEDelementsEcr : %d \n",ret);
/***************************************************************************/
/* ecriture des familles */
ret = MEDfamCr(fid,maa,nomfam,numfam,&attide,&attval,attdes,0,
gro,0);
}
- printf("%d \n",ret);
+ printf("MEDfamCr : %d \n",ret);
/* on cree :
- 1 familles d'elements de dimension (d)
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ1, (unsigned char *)fieldnodeint,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, MED_NOPDT," ", 0., MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fid,champ2,MED_REEL64,champ2_comp,champ2_unit,1);
+ ret = MEDchampCr(fid,champ2,MED_FLOAT64,champ2_comp,champ2_unit,1);
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble1,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, 1,"S ", 1.1 , MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ 1,"S ", 1.1 , MED_NONOR);
printf("MEDchampEcr1 : %d \n",ret);
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble2,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, 2,"S ", 1.2 , MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ 2,"S ", 1.2 , MED_NONOR);
printf("MEDchampEcr2 : %d \n",ret);
}
}
if (ret == 0)
{
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble1,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, MED_NOPDT," ", 0. , MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ MED_NOPDT," ", 0. , MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fid,champ3,MED_REEL64,champ3_comp,champ3_unit,2);
+ ret = MEDchampCr(fid,champ3,MED_FLOAT64,champ3_comp,champ3_unit,2);
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ3, (unsigned char *)fieldcelldouble,
- MED_NO_INTERLACE, nquad4,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE,
- MED_QUAD4, MED_NOPDT," ", 0., MED_NONOR);
+ MED_NO_INTERLACE, nquad4, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE, MED_QUAD4,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
}
/***************************************************************************/
ret = MEDfermer(fid);
- printf("%d\n",ret);
+ printf("MEDfermer : %d\n",ret);
return 0;
}
-
/*
creation d'une geometrie 2d : un cube [0,1]^2
- maillé uniformement en quadrangle reguliers;
+ maillé uniformement en quadrangle reguliers;
avec en plus une partie des aretes (une partie
des arretes de la frontiere) du maillage.
ATTENTION : 3 noeuds dans chaque direction
med_err ret;
med_idt fid;
char maa[MED_TAILLE_NOM+1] = "carre_en_quad4_seg2";
+ char maadesc[MED_TAILLE_DESC+1] = "Example de maillage non structure 2D";
med_int mdim = 2;
med_int nnoe = 9;
/*
0.5, 1.0,
1.0, 1.0
};
- char nomcoo[2*MED_TAILLE_PNOM+1] = "x y ";
- char unicoo[2*MED_TAILLE_PNOM+1] = "cm cm ";
+ char nomcoo[2*MED_TAILLE_PNOM+1] = "x y ";
+ char unicoo[2*MED_TAILLE_PNOM+1] = "cm cm ";
/* char nomnoe[19*MED_TAILLE_PNOM+1] = "nom1 nom2 nom3 nom4";*/
char *nomnoe ;
med_int numnoe[9] = {1,2,3,4,5,6,7,8,9};
7, 8, 5, 4,
8, 9, 6, 5
};
- char nomquad4[MED_TAILLE_PNOM*4+1] = "quad1 quad2 quad3 quad4 ";
+ char nomquad4[MED_TAILLE_PNOM*4+1] = "quad1 quad2 quad3 quad4 ";
med_int numquad4[4] = {1,2,3,4};
med_int nufaquad4[4] = {-10,-10,0,0};
2, 5, 0,
5, 8, 0
};
- char nomseg2[MED_TAILLE_PNOM*6+1] = "seg1 seg2 seg3 seg4 seg5 seg6 ";
+ char nomseg2[MED_TAILLE_PNOM*6+1] = "seg1 seg2 seg3 seg4 seg5 seg6 ";
med_int numseg2[6] = {1,2,3,4,5,6};
med_int nufaseg2[6] = {-1,-2,-1,-1,-2,-2};
Some fields : 2 on nodes : one int and one double , one on cells : double
*/
char champ1[MED_TAILLE_NOM+1]="fieldnodeint" ;
- char champ1_comp[MED_TAILLE_PNOM+1]="comp1 " ;
- char champ1_unit[MED_TAILLE_PNOM+1]="M " ;
+ char champ1_comp[MED_TAILLE_PNOM+1]="comp1 " ;
+ char champ1_unit[MED_TAILLE_PNOM+1]="M " ;
med_int fieldnodeint[9] = {1,1,3,2,2,3,4,4,5};
char champ2[MED_TAILLE_NOM+1]="fieldnodedouble" ;
- char champ2_comp[MED_TAILLE_PNOM+1]="comp1 " ;
- char champ2_unit[MED_TAILLE_PNOM+1]="J " ;
+ char champ2_comp[MED_TAILLE_PNOM+1]="comp1 " ;
+ char champ2_unit[MED_TAILLE_PNOM+1]="J " ;
med_float fieldnodedouble1[9] = {1.,3.,4.,1.,3.,4.,3.,2.,5.};
med_float fieldnodedouble2[9] = {1.,2.,2.,3.,3.,3.,4.,4.,5.};
char champ3[MED_TAILLE_NOM+1]="fieldcelldouble" ;
- char champ3_comp[MED_TAILLE_PNOM*2+1]="comp1 comp2 " ;
- char champ3_unit[MED_TAILLE_PNOM*2+1]="M/S m/s " ;
+ char champ3_comp[MED_TAILLE_PNOM*2+1]="comp1 comp2 " ;
+ char champ3_unit[MED_TAILLE_PNOM*2+1]="M/S m/s " ;
med_float fieldcelldouble[4*2] = {0.,1.,1.,1.,1.,2.,2.,3.};
/***************************************************************************/
- fid = MEDouvrir("carre_en_quad4_seg2.med",MED_REMP);
+ fid = MEDouvrir("carre_en_quad4_seg2.med",MED_LECTURE_ECRITURE);
if (fid < 0)
ret = -1;
else
ret = 0;
- printf("%d\n",ret);
+ printf("MEDouvrir : %d\n",ret);
/***************************************************************************/
if (ret == 0)
- ret = MEDmaaCr(fid,maa,mdim);
- printf("%d\n",ret);
+ ret = MEDmaaCr(fid,maa,mdim,MED_NON_STRUCTURE,maadesc);
+ printf("MEDmaaCr : %d\n",ret);
if (ret == 0)
ret = MEDunvCr(fid,maa);
- printf("%d\n",ret);
+ printf("MEDunvCr : %d\n",ret);
/***************************************************************************/
if (ret == 0)
ret = MEDnoeudsEcr(fid,maa,mdim,coo,MED_FULL_INTERLACE,MED_CART,
nomcoo,unicoo,nomnoe,MED_FAUX,numnoe,MED_VRAI,
- nufano,nnoe,MED_ECRI);
- printf("%d\n",ret);
+ nufano,nnoe);
+ printf("MEDnoeudsEcr : %d\n",ret);
/* ecriture des mailles MED_QUAD4 :
- connectivite
if (ret == 0)
ret = MEDelementsEcr(fid,maa,mdim,quad4,MED_FULL_INTERLACE,
nomquad4,MED_FAUX,numquad4,MED_VRAI,nufaquad4,nquad4,
- MED_MAILLE,MED_QUAD4,MED_NOD,MED_ECRI);
- printf("%d \n",ret);
+ MED_MAILLE,MED_QUAD4,MED_NOD);
+ printf("MEDelementsEcr : %d \n",ret);
/* ecriture des mailles MED_SEG2 :
- connectivite
if (ret == 0)
ret = MEDelementsEcr(fid,maa,mdim,seg2,MED_FULL_INTERLACE,
nomseg2,MED_FAUX,numseg2,MED_VRAI,nufaseg2,nseg2,
- MED_MAILLE,MED_SEG2,MED_NOD,MED_ECRI);
+ MED_MAILLE,MED_SEG2,MED_NOD);
printf("%d \n",ret);
/***************************************************************************/
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ1, (unsigned char *)fieldnodeint,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, MED_NOPDT," ", 0., MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fid,champ2,MED_REEL64,champ2_comp,champ2_unit,1);
+ ret = MEDchampCr(fid,champ2,MED_FLOAT64,champ2_comp,champ2_unit,1);
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble1,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, 1,"S ", 1.1 , MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ 1,"S ", 1.1 , MED_NONOR);
printf("MEDchampEcr1 : %d \n",ret);
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble2,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, 2,"S ", 1.2 , MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ 2,"S ", 1.2 , MED_NONOR);
printf("MEDchampEcr2 : %d \n",ret);
}
}
if (ret == 0)
{
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble1,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, MED_NOPDT," ", 0. , MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ MED_NOPDT," ", 0. , MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fid,champ3,MED_REEL64,champ3_comp,champ3_unit,2);
+ ret = MEDchampCr(fid,champ3,MED_FLOAT64,champ3_comp,champ3_unit,2);
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ3, (unsigned char *)fieldcelldouble,
- MED_NO_INTERLACE, nquad4,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE,
- MED_QUAD4, MED_NOPDT," ", 0., MED_NONOR);
+ MED_NO_INTERLACE, nquad4, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE, MED_QUAD4,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
}
return 0;
}
-
med_err ret;
med_idt fid;
char maa[MED_TAILLE_NOM+1] = "carre_en_quad4_seg2_wrong";
+ char maadesc[MED_TAILLE_DESC+1] = "Example de maillage non structure 2D";
med_int mdim = 2;
med_int nnoe = 9;
/*
0.5, 1.0,
1.0, 1.0
};
- char nomcoo[2*MED_TAILLE_PNOM+1] = "x y ";
- char unicoo[2*MED_TAILLE_PNOM+1] = "cm cm ";
+ char nomcoo[2*MED_TAILLE_PNOM+1] = "x y ";
+ char unicoo[2*MED_TAILLE_PNOM+1] = "cm cm ";
/* char nomnoe[19*MED_TAILLE_PNOM+1] = "nom1 nom2 nom3 nom4";*/
char *nomnoe ;
med_int numnoe[9] = {1,2,3,4,5,6,7,8,9};
7, 8, 5, 4,
8, 9, 6, 5
};
- char nomquad4[MED_TAILLE_PNOM*4+1] = "quad1 quad2 quad3 quad4 ";
+ char nomquad4[MED_TAILLE_PNOM*4+1] = "quad1 quad2 quad3 quad4 ";
med_int numquad4[4] = {1,2,3,4};
med_int nufaquad4[4] = {-10,-10,0,0};
2, 5,
5, 8
};
- char nomseg2[MED_TAILLE_PNOM*6+1] = "seg1 seg2 seg3 seg4 seg5 seg6 ";
+ char nomseg2[MED_TAILLE_PNOM*6+1] = "seg1 seg2 seg3 seg4 seg5 seg6 ";
med_int numseg2[6] = {1,2,3,4,5,6};
med_int nufaseg2[6] = {-1,-2,-1,-1,-2,-2};
Some fields : 2 on nodes : one int and one double , one on cells : double
*/
char champ1[MED_TAILLE_NOM+1]="fieldnodeint" ;
- char champ1_comp[MED_TAILLE_PNOM+1]="comp1 " ;
- char champ1_unit[MED_TAILLE_PNOM+1]="M " ;
+ char champ1_comp[MED_TAILLE_PNOM+1]="comp1 " ;
+ char champ1_unit[MED_TAILLE_PNOM+1]="M " ;
med_int fieldnodeint[9] = {1,1,3,2,2,3,4,4,5};
char champ2[MED_TAILLE_NOM+1]="fieldnodedouble" ;
- char champ2_comp[MED_TAILLE_PNOM+1]="comp1 " ;
- char champ2_unit[MED_TAILLE_PNOM+1]="J " ;
+ char champ2_comp[MED_TAILLE_PNOM+1]="comp1 " ;
+ char champ2_unit[MED_TAILLE_PNOM+1]="J " ;
med_float fieldnodedouble1[9] = {1.,3.,4.,1.,3.,4.,3.,2.,5.};
med_float fieldnodedouble2[9] = {1.,2.,2.,3.,3.,3.,4.,4.,5.};
char champ3[MED_TAILLE_NOM+1]="fieldcelldouble" ;
- char champ3_comp[MED_TAILLE_PNOM*2+1]="comp1 comp2 " ;
- char champ3_unit[MED_TAILLE_PNOM*2+1]="M/S m/s " ;
+ char champ3_comp[MED_TAILLE_PNOM*2+1]="comp1 comp2 " ;
+ char champ3_unit[MED_TAILLE_PNOM*2+1]="M/S m/s " ;
med_float fieldcelldouble[4*2] = {0.,1.,1.,1.,1.,2.,2.,3.};
/***************************************************************************/
- fid = MEDouvrir("carre_en_quad4_seg2_wrong.med",MED_REMP);
+ fid = MEDouvrir("carre_en_quad4_seg2_wrong.med",MED_LECTURE_ECRITURE);
if (fid < 0)
ret = -1;
else
ret = 0;
- printf("%d\n",ret);
+ printf("MEDouvrir : %d\n",ret);
/***************************************************************************/
if (ret == 0)
- ret = MEDmaaCr(fid,maa,mdim);
- printf("%d\n",ret);
+ ret = MEDmaaCr(fid,maa,mdim,MED_NON_STRUCTURE,maadesc);
+ printf("MEDmaaCr : %d\n",ret);
if (ret == 0)
ret = MEDunvCr(fid,maa);
- printf("%d\n",ret);
+ printf("MEDunvCr : %d\n",ret);
/***************************************************************************/
if (ret == 0)
ret = MEDnoeudsEcr(fid,maa,mdim,coo,MED_FULL_INTERLACE,MED_CART,
nomcoo,unicoo,nomnoe,MED_FAUX,numnoe,MED_VRAI,
- nufano,nnoe,MED_ECRI);
- printf("%d\n",ret);
+ nufano,nnoe);
+ printf("MEDnoeudsEcr : %d\n",ret);
/* ecriture des mailles MED_QUAD4 :
- connectivite
if (ret == 0)
ret = MEDelementsEcr(fid,maa,mdim,quad4,MED_FULL_INTERLACE,
nomquad4,MED_FAUX,numquad4,MED_VRAI,nufaquad4,nquad4,
- MED_MAILLE,MED_QUAD4,MED_NOD,MED_ECRI);
- printf("%d \n",ret);
+ MED_MAILLE,MED_QUAD4,MED_NOD);
+ printf("MEDelementsEcr : %d \n",ret);
/* ecriture des mailles MED_SEG2 :
- connectivite
if (ret == 0)
ret = MEDelementsEcr(fid,maa,mdim,seg2,MED_FULL_INTERLACE,
nomseg2,MED_FAUX,numseg2,MED_VRAI,nufaseg2,nseg2,
- MED_ARETE,MED_SEG2,MED_NOD,MED_ECRI);
- printf("%d \n",ret);
+ MED_ARETE,MED_SEG2,MED_NOD);
+ printf("MEDelementsEcr : %d \n",ret);
/***************************************************************************/
/* ecriture des familles */
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ1, (unsigned char *)fieldnodeint,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, MED_NOPDT," ", 0., MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fid,champ2,MED_REEL64,champ2_comp,champ2_unit,1);
+ ret = MEDchampCr(fid,champ2,MED_FLOAT64,champ2_comp,champ2_unit,1);
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble1,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, 1,"S ", 1.1 , MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ 1,"S ", 1.1 , MED_NONOR);
printf("MEDchampEcr1 : %d \n",ret);
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble2,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, 2,"S ", 1.2 , MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ 2,"S ", 1.2 , MED_NONOR);
printf("MEDchampEcr2 : %d \n",ret);
}
}
if (ret == 0)
{
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble1,
- MED_NO_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, MED_NOPDT," ", 0. , MED_NONOR);
+ MED_NO_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ MED_NOPDT," ", 0. , MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fid,champ3,MED_REEL64,champ3_comp,champ3_unit,2);
+ ret = MEDchampCr(fid,champ3,MED_FLOAT64,champ3_comp,champ3_unit,2);
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ3, (unsigned char *)fieldcelldouble,
- MED_NO_INTERLACE, nquad4,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE,
- MED_QUAD4, MED_NOPDT," ", 0., MED_NONOR);
+ MED_NO_INTERLACE, nquad4, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE, MED_QUAD4,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
}
return 0;
}
-
med_err ret;
med_idt fid;
char maa[MED_TAILLE_NOM+1] = "CUBE_EN_HEXA8";
+ char maadesc[MED_TAILLE_DESC+1] = "Example de maillage non structure 3D";
med_int mdim = 3;
med_int nnoe = 27;
/*
0.5, 1.0, 1.0,
1.0, 1.0, 1.0
};
- char nomcoo[3*MED_TAILLE_PNOM+1] = "x y z ";
- char unicoo[3*MED_TAILLE_PNOM+1] = "cm cm cm ";
+ char nomcoo[3*MED_TAILLE_PNOM+1] = "x y z ";
+ char unicoo[3*MED_TAILLE_PNOM+1] = "cm cm cm ";
/* char nomnoe[19*MED_TAILLE_PNOM+1] = "nom1 nom2 nom3 nom4";*/
char *nomnoe ;
med_int numnoe[27] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27};
16, 25, 26, 17, 13, 22, 23, 14,
17, 26, 27, 18, 14, 23, 24, 15
};
- char nomhexa8[MED_TAILLE_PNOM*8+1] = "hexa1 hexa2 hexa3 hexa4 hexa5 hexa6 hexa7 hexa8 ";
+ char nomhexa8[MED_TAILLE_PNOM*8+1] = "hexa1 hexa2 hexa3 hexa4 hexa5 hexa6 hexa7 hexa8 ";
med_int numhexa8[8] = {1,2,3,4,5,6,7,8};
med_int nufahexa8[8] = {-1,-1,-1,-1,-2,-2,-2,-2};
*/
char champ1[MED_TAILLE_NOM+1]="fieldnodeint" ;
- char champ1_comp[MED_TAILLE_PNOM+1]="comp1 " ;
- char champ1_unit[MED_TAILLE_PNOM+1]="M " ;
+ char champ1_comp[MED_TAILLE_PNOM+1]="comp1 " ;
+ char champ1_unit[MED_TAILLE_PNOM+1]="M " ;
med_int fieldnodeint[27] = {1,1,3,2,2,3,4,4,5,1,1,3,2,2,3,4,4,5,1,1,3,2,2,3,4,4,5};
char champ2[MED_TAILLE_NOM+1]="fieldnodedouble" ;
- char champ2_comp[MED_TAILLE_PNOM+1]="comp1 " ;
- char champ2_unit[MED_TAILLE_PNOM+1]="J " ;
+ char champ2_comp[MED_TAILLE_PNOM+1]="comp1 " ;
+ char champ2_unit[MED_TAILLE_PNOM+1]="J " ;
med_float fieldnodedouble1[27] = {1.,3.,4.,1.,3.,4.,3.,2.,5.,1.,3.,4.,1.,3.,4.,3.,2.,5.,1.,3.,4.,1.,3.,4.,3.,2.,5.};
med_float fieldnodedouble2[27] = {1.,2.,2.,3.,3.,3.,4.,4.,5.,1.,2.,2.,3.,3.,3.,4.,4.,5.,1.,2.,2.,3.,3.,3.,4.,4.,5.};
char champ3[MED_TAILLE_NOM+1]="fieldcelldouble" ;
- char champ3_comp[MED_TAILLE_PNOM*3+1]="comp1 comp2 comp3 " ;
- char champ3_unit[MED_TAILLE_PNOM*3+1]="M/S m/s m/s " ;
+ char champ3_comp[MED_TAILLE_PNOM*3+1]="comp1 comp2 comp3 " ;
+ char champ3_unit[MED_TAILLE_PNOM*3+1]="M/S m/s m/s " ;
med_float fieldcelldouble[8*3] = {0.,1.,1.,1.,1.,2.,2.,3.,0.,1.,1.,1.,1.,2.,2.,3.,0.,1.,1.,1.,1.,2.,2.,3.};
/***************************************************************************/
- fid = MEDouvrir("cube_hexa8.med",MED_REMP);
+ fid = MEDouvrir("cube_hexa8.med",MED_LECTURE_ECRITURE);
if (fid < 0)
ret = -1;
else
ret = 0;
- printf("%d\n",ret);
+ printf("MEDouvrir : %d\n",ret);
/***************************************************************************/
if (ret == 0)
- ret = MEDmaaCr(fid,maa,mdim);
- printf("%d\n",ret);
+ ret = MEDmaaCr(fid,maa,mdim,MED_NON_STRUCTURE,maadesc);
+ printf("MEDmaaCr : %d\n",ret);
if (ret == 0)
ret = MEDunvCr(fid,maa);
- printf("%d\n",ret);
+ printf("MEDunvCr : %d\n",ret);
/***************************************************************************/
if (ret == 0)
ret = MEDnoeudsEcr(fid,maa,mdim,coo,MED_FULL_INTERLACE,MED_CART,
nomcoo,unicoo,nomnoe,MED_FAUX,numnoe,MED_VRAI,
- nufano,nnoe,MED_ECRI);
- printf("%d\n",ret);
+ nufano,nnoe);
+ printf("MEDnoeudsEcr : %d\n",ret);
/* ecriture des mailles MED_HEXA8 :
- connectivite
if (ret == 0)
ret = MEDelementsEcr(fid,maa,mdim,hexa8,MED_FULL_INTERLACE,
nomhexa8,MED_FAUX,numhexa8,MED_VRAI,nufahexa8,nhexa8,
- MED_MAILLE,MED_HEXA8,MED_NOD,MED_ECRI);
- printf("%d \n",ret);
+ MED_MAILLE,MED_HEXA8,MED_NOD);
+ printf("MEDelementsEcr : %d \n",ret);
/***************************************************************************/
/* ecriture des familles */
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ1, (unsigned char *)fieldnodeint,
- MED_FULL_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, MED_NOPDT," ", 0., MED_NONOR);
+ MED_FULL_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fid,champ2,MED_REEL64,champ2_comp,champ2_unit,1);
+ ret = MEDchampCr(fid,champ2,MED_FLOAT64,champ2_comp,champ2_unit,1);
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble1,
- MED_FULL_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, 1,"S ", 1.1 , MED_NONOR);
+ MED_FULL_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ 1,"S ", 1.1 , MED_NONOR);
printf("MEDchampEcr1 : %d \n",ret);
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble2,
- MED_FULL_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, 2,"S ", 1.2 , MED_NONOR);
+ MED_FULL_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ 2,"S ", 1.2 , MED_NONOR);
printf("MEDchampEcr2 : %d \n",ret);
}
}
if (ret == 0)
{
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble1,
- MED_FULL_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, MED_NOPDT," ", 0. , MED_NONOR);
+ MED_FULL_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ MED_NOPDT," ", 0. , MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fid,champ3,MED_REEL64,champ3_comp,champ3_unit,3);
+ ret = MEDchampCr(fid,champ3,MED_FLOAT64,champ3_comp,champ3_unit,3);
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ3, (unsigned char *)fieldcelldouble,
- MED_FULL_INTERLACE, nhexa8,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE,
- MED_HEXA8, MED_NOPDT," ", 0., MED_NONOR);
+ MED_FULL_INTERLACE, nhexa8, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE, MED_HEXA8,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
}
return 0;
}
-
/*
creation d'une geometrie 3d : un cube [0,1]^3
- maillé uniformement en hexahedres reguliers;
+ maillé uniformement en hexahedres reguliers;
avec en plus une partie des faces (une partie
des faces de la frontiere) du maillage.
ATTENTION : 3 noeuds dans chaque direction
med_err ret;
med_idt fid;
char maa[MED_TAILLE_NOM+1] = "CUBE_EN_HEXA8_QUAD4";
+ char maadesc[MED_TAILLE_DESC+1] = "Example de maillage non structure 3D";
med_int mdim = 3;
med_int nnoe = 27;
/*
0.5, 1.0, 1.0,
1.0, 1.0, 1.0
};
- char nomcoo[3*MED_TAILLE_PNOM+1] = "x y z ";
- char unicoo[3*MED_TAILLE_PNOM+1] = "cm cm cm ";
+ char nomcoo[3*MED_TAILLE_PNOM+1] = "x y z ";
+ char unicoo[3*MED_TAILLE_PNOM+1] = "cm cm cm ";
/* char nomnoe[19*MED_TAILLE_PNOM+1] = "nom1 nom2 nom3 nom4";*/
char *nomnoe ;
med_int numnoe[27] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27};
16, 25, 26, 17, 13, 22, 23, 14,
17, 26, 27, 18, 14, 23, 24, 15
};
- char nomhexa8[MED_TAILLE_PNOM*8+1] = "hexa1 hexa2 hexa3 hexa4 hexa5 hexa6 hexa7 hexa8 ";
+ char nomhexa8[MED_TAILLE_PNOM*8+1] = "hexa1 hexa2 hexa3 hexa4 hexa5 hexa6 hexa7 hexa8 ";
med_int numhexa8[8] = {1,2,3,4,5,6,7,8};
med_int nufahexa8[8] = {-1,-1,-1,-1,-2,-2,-2,-2};
7, 8, 5, 4, 0
};
- char nomquad4[MED_TAILLE_PNOM*8+1] = "quad1 quad2 quad3 quad4 quad5 quad6 quad7 quad8 ";
+ char nomquad4[MED_TAILLE_PNOM*8+1] = "quad1 quad2 quad3 quad4 quad5 quad6 quad7 quad8 ";
med_int numquad4[8] = {1,2,3,4,5,6,7,8};
med_int nufaquad4[8] = {-3,-3,-3,-3,-4, -4, -4 , -4};
*/
char champ1[MED_TAILLE_NOM+1]="fieldnodeint" ;
- char champ1_comp[MED_TAILLE_PNOM+1]="comp1 " ;
- char champ1_unit[MED_TAILLE_PNOM+1]="M " ;
+ char champ1_comp[MED_TAILLE_PNOM+1]="comp1 " ;
+ char champ1_unit[MED_TAILLE_PNOM+1]="M " ;
med_int fieldnodeint[27] = {1,1,3,2,2,3,4,4,5,1,1,3,2,2,3,4,4,5,1,1,3,2,2,3,4,4,5};
char champ2[MED_TAILLE_NOM+1]="fieldnodedouble" ;
- char champ2_comp[MED_TAILLE_PNOM+1]="comp1 " ;
- char champ2_unit[MED_TAILLE_PNOM+1]="J " ;
+ char champ2_comp[MED_TAILLE_PNOM+1]="comp1 " ;
+ char champ2_unit[MED_TAILLE_PNOM+1]="J " ;
med_float fieldnodedouble1[27] = {1.,3.,4.,1.,3.,4.,3.,2.,5.,1.,3.,4.,1.,3.,4.,3.,2.,5.,1.,3.,4.,1.,3.,4.,3.,2.,5.};
med_float fieldnodedouble2[27] = {1.,2.,2.,3.,3.,3.,4.,4.,5.,1.,2.,2.,3.,3.,3.,4.,4.,5.,1.,2.,2.,3.,3.,3.,4.,4.,5.};
char champ3[MED_TAILLE_NOM+1]="fieldcelldouble" ;
- char champ3_comp[MED_TAILLE_PNOM*3+1]="comp1 comp2 comp3 " ;
- char champ3_unit[MED_TAILLE_PNOM*3+1]="M/S m/s m/s " ;
+ char champ3_comp[MED_TAILLE_PNOM*3+1]="comp1 comp2 comp3 " ;
+ char champ3_unit[MED_TAILLE_PNOM*3+1]="M/S m/s m/s " ;
med_float fieldcelldouble[8*3] = {0.,1.,1.,1.,1.,2.,2.,3.,0.,1.,1.,1.,1.,2.,2.,3.,0.,1.,1.,1.,1.,2.,2.,3.};
/***************************************************************************/
- fid = MEDouvrir("cube_hexa8_quad4.med",MED_REMP);
+ fid = MEDouvrir("cube_hexa8_quad4.med",MED_LECTURE_ECRITURE);
if (fid < 0)
ret = -1;
else
ret = 0;
- printf("%d\n",ret);
+ printf("MEDouvrir : %d\n",ret);
/***************************************************************************/
if (ret == 0)
- ret = MEDmaaCr(fid,maa,mdim);
- printf("%d\n",ret);
+ ret = MEDmaaCr(fid,maa,mdim,MED_NON_STRUCTURE,maadesc);
+ printf("MEDmaaCr : %d\n",ret);
if (ret == 0)
ret = MEDunvCr(fid,maa);
- printf("%d\n",ret);
+ printf("MEDunvCr : %d\n",ret);
/***************************************************************************/
if (ret == 0)
ret = MEDnoeudsEcr(fid,maa,mdim,coo,MED_FULL_INTERLACE,MED_CART,
nomcoo,unicoo,nomnoe,MED_FAUX,numnoe,MED_VRAI,
- nufano,nnoe,MED_ECRI);
- printf("%d\n",ret);
+ nufano,nnoe);
+ printf("MEDnoeudsEcr : %d\n",ret);
/* ecriture des mailles MED_HEXA8 :
- connectivite
if (ret == 0)
ret = MEDelementsEcr(fid,maa,mdim,hexa8,MED_FULL_INTERLACE,
nomhexa8,MED_FAUX,numhexa8,MED_VRAI,nufahexa8,nhexa8,
- MED_MAILLE,MED_HEXA8,MED_NOD,MED_ECRI);
- printf("%d \n",ret);
+ MED_MAILLE,MED_HEXA8,MED_NOD);
+ printf("MEDelementsEcr : %d \n",ret);
/* ecriture des mailles MED_QUAD4 :
- connectivite
if (ret == 0)
ret = MEDelementsEcr(fid,maa,mdim,quad4,MED_FULL_INTERLACE,
nomquad4,MED_FAUX,numquad4,MED_VRAI,nufaquad4,nquad4,
- MED_MAILLE,MED_QUAD4,MED_NOD,MED_ECRI);
+ MED_MAILLE,MED_QUAD4,MED_NOD);
printf("%d \n",ret);
/***************************************************************************/
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ1, (unsigned char *)fieldnodeint,
- MED_FULL_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, MED_NOPDT," ", 0., MED_NONOR);
+ MED_FULL_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fid,champ2,MED_REEL64,champ2_comp,champ2_unit,1);
+ ret = MEDchampCr(fid,champ2,MED_FLOAT64,champ2_comp,champ2_unit,1);
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble1,
- MED_FULL_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, 1,"S ", 1.1 , MED_NONOR);
+ MED_FULL_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ 1,"S ", 1.1 , MED_NONOR);
printf("MEDchampEcr1 : %d \n",ret);
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble2,
- MED_FULL_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, 2,"S ", 1.2 , MED_NONOR);
+ MED_FULL_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ 2,"S ", 1.2 , MED_NONOR);
printf("MEDchampEcr2 : %d \n",ret);
}
}
if (ret == 0)
{
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble1,
- MED_FULL_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, MED_NOPDT," ", 0. , MED_NONOR);
+ MED_FULL_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ MED_NOPDT," ", 0. , MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fid,champ3,MED_REEL64,champ3_comp,champ3_unit,3);
+ ret = MEDchampCr(fid,champ3,MED_FLOAT64,champ3_comp,champ3_unit,3);
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ3, (unsigned char *)fieldcelldouble,
- MED_FULL_INTERLACE, nhexa8,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE,
- MED_HEXA8, MED_NOPDT," ", 0., MED_NONOR);
+ MED_FULL_INTERLACE, nhexa8, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE, MED_HEXA8,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
}
return 0;
}
-
med_err ret;
med_idt fid;
char maa[MED_TAILLE_NOM+1] = "CUBE_EN_HEXA8_QUAD4_WRONG";
+ char maadesc[MED_TAILLE_DESC+1] = "Example de maillage non structure 3D";
med_int mdim = 3;
med_int nnoe = 27;
/*
0.5, 1.0, 1.0,
1.0, 1.0, 1.0
};
- char nomcoo[3*MED_TAILLE_PNOM+1] = "x y z ";
- char unicoo[3*MED_TAILLE_PNOM+1] = "cm cm cm ";
+ char nomcoo[3*MED_TAILLE_PNOM+1] = "x y z ";
+ char unicoo[3*MED_TAILLE_PNOM+1] = "cm cm cm ";
/* char nomnoe[19*MED_TAILLE_PNOM+1] = "nom1 nom2 nom3 nom4";*/
char *nomnoe ;
med_int numnoe[27] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27};
16, 25, 26, 17, 13, 22, 23, 14,
17, 26, 27, 18, 14, 23, 24, 15
};
- char nomhexa8[MED_TAILLE_PNOM*8+1] = "hexa1 hexa2 hexa3 hexa4 hexa5 hexa6 hexa7 hexa8 ";
+ char nomhexa8[MED_TAILLE_PNOM*8+1] = "hexa1 hexa2 hexa3 hexa4 hexa5 hexa6 hexa7 hexa8 ";
med_int numhexa8[8] = {1,2,3,4,5,6,7,8};
med_int nufahexa8[8] = {-1,-1,-1,-1,-2,-2,-2,-2};
7, 8, 5, 4
};
- char nomquad4[MED_TAILLE_PNOM*8+1] = "quad1 quad2 quad3 quad4 quad5 quad6 quad7 quad8 ";
+ char nomquad4[MED_TAILLE_PNOM*8+1] = "quad1 quad2 quad3 quad4 quad5 quad6 quad7 quad8 ";
med_int numquad4[8] = {1,2,3,4,5,6,7,8};
med_int nufaquad4[8] = {-3,-3,-3,-3,-4, -4, -4 , -4};
*/
char champ1[MED_TAILLE_NOM+1]="fieldnodeint" ;
- char champ1_comp[MED_TAILLE_PNOM+1]="comp1 " ;
- char champ1_unit[MED_TAILLE_PNOM+1]="M " ;
+ char champ1_comp[MED_TAILLE_PNOM+1]="comp1 " ;
+ char champ1_unit[MED_TAILLE_PNOM+1]="M " ;
med_int fieldnodeint[27] = {1,1,3,2,2,3,4,4,5,1,1,3,2,2,3,4,4,5,1,1,3,2,2,3,4,4,5};
char champ2[MED_TAILLE_NOM+1]="fieldnodedouble" ;
- char champ2_comp[MED_TAILLE_PNOM+1]="comp1 " ;
- char champ2_unit[MED_TAILLE_PNOM+1]="J " ;
+ char champ2_comp[MED_TAILLE_PNOM+1]="comp1 " ;
+ char champ2_unit[MED_TAILLE_PNOM+1]="J " ;
med_float fieldnodedouble1[27] = {1.,3.,4.,1.,3.,4.,3.,2.,5.,1.,3.,4.,1.,3.,4.,3.,2.,5.,1.,3.,4.,1.,3.,4.,3.,2.,5.};
med_float fieldnodedouble2[27] = {1.,2.,2.,3.,3.,3.,4.,4.,5.,1.,2.,2.,3.,3.,3.,4.,4.,5.,1.,2.,2.,3.,3.,3.,4.,4.,5.};
char champ3[MED_TAILLE_NOM+1]="fieldcelldouble" ;
- char champ3_comp[MED_TAILLE_PNOM*3+1]="comp1 comp2 comp3 " ;
- char champ3_unit[MED_TAILLE_PNOM*3+1]="M/S m/s m/s " ;
+ char champ3_comp[MED_TAILLE_PNOM*3+1]="comp1 comp2 comp3 " ;
+ char champ3_unit[MED_TAILLE_PNOM*3+1]="M/S m/s m/s " ;
med_float fieldcelldouble[8*3] = {0.,1.,1.,1.,1.,2.,2.,3.,0.,1.,1.,1.,1.,2.,2.,3.,0.,1.,1.,1.,1.,2.,2.,3.};
/***************************************************************************/
- fid = MEDouvrir("cube_hexa8_quad4_wrong.med",MED_REMP);
+ fid = MEDouvrir("cube_hexa8_quad4_wrong.med",MED_LECTURE_ECRITURE);
if (fid < 0)
ret = -1;
else
ret = 0;
- printf("%d\n",ret);
+ printf("MEDouvrir : %d\n",ret);
/***************************************************************************/
if (ret == 0)
- ret = MEDmaaCr(fid,maa,mdim);
- printf("%d\n",ret);
+ ret = MEDmaaCr(fid,maa,mdim,MED_NON_STRUCTURE,maadesc);
+ printf("MEDmaaCr : %d\n",ret);
if (ret == 0)
ret = MEDunvCr(fid,maa);
- printf("%d\n",ret);
+ printf("MEDunvCr : %d\n",ret);
/***************************************************************************/
if (ret == 0)
ret = MEDnoeudsEcr(fid,maa,mdim,coo,MED_FULL_INTERLACE,MED_CART,
nomcoo,unicoo,nomnoe,MED_FAUX,numnoe,MED_VRAI,
- nufano,nnoe,MED_ECRI);
- printf("%d\n",ret);
+ nufano,nnoe);
+ printf("MEDnoeudsEcr : %d\n",ret);
/* ecriture des mailles MED_HEXA8 :
- connectivite
if (ret == 0)
ret = MEDelementsEcr(fid,maa,mdim,hexa8,MED_FULL_INTERLACE,
nomhexa8,MED_FAUX,numhexa8,MED_VRAI,nufahexa8,nhexa8,
- MED_MAILLE,MED_HEXA8,MED_NOD,MED_ECRI);
- printf("%d \n",ret);
+ MED_MAILLE,MED_HEXA8,MED_NOD);
+ printf("MEDelementsEcr : %d \n",ret);
/* ecriture des mailles MED_QUAD4 :
- connectivite
if (ret == 0)
ret = MEDelementsEcr(fid,maa,mdim,quad4,MED_FULL_INTERLACE,
nomquad4,MED_FAUX,numquad4,MED_VRAI,nufaquad4,nquad4,
- MED_FACE,MED_QUAD4,MED_NOD,MED_ECRI);
- printf("%d \n",ret);
+ MED_FACE,MED_QUAD4,MED_NOD);
+ printf("MEDelementsEcr : %d \n",ret);
/***************************************************************************/
/* ecriture des familles */
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ1, (unsigned char *)fieldnodeint,
- MED_FULL_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, MED_NOPDT," ", 0., MED_NONOR);
+ MED_FULL_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fid,champ2,MED_REEL64,champ2_comp,champ2_unit,1);
+ ret = MEDchampCr(fid,champ2,MED_FLOAT64,champ2_comp,champ2_unit,1);
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble1,
- MED_FULL_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, 1,"S ", 1.1 , MED_NONOR);
+ MED_FULL_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ 1,"S ", 1.1 , MED_NONOR);
printf("MEDchampEcr1 : %d \n",ret);
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble2,
- MED_FULL_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, 2,"S ", 1.2 , MED_NONOR);
+ MED_FULL_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ 2,"S ", 1.2 , MED_NONOR);
printf("MEDchampEcr2 : %d \n",ret);
}
}
if (ret == 0)
{
ret = MEDchampEcr(fid, maa, champ2, (unsigned char *)fieldnodedouble1,
- MED_FULL_INTERLACE, nnoe,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_NOEUD,
- 0, MED_NOPDT," ", 0. , MED_NONOR);
+ MED_FULL_INTERLACE, nnoe, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_NOEUD, 0,
+ MED_NOPDT," ", 0. , MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
if (ret == 0)
{
- ret = MEDchampCr(fid,champ3,MED_REEL64,champ3_comp,champ3_unit,3);
+ ret = MEDchampCr(fid,champ3,MED_FLOAT64,champ3_comp,champ3_unit,3);
printf("MEDchampCr : %d \n",ret);
if (ret == 0) {
ret = MEDchampEcr(fid, maa, champ3, (unsigned char *)fieldcelldouble,
- MED_FULL_INTERLACE, nhexa8,
- MED_NOPG, MED_ALL, MED_NOPFL, MED_ECRI, MED_MAILLE,
- MED_HEXA8, MED_NOPDT," ", 0., MED_NONOR);
+ MED_FULL_INTERLACE, nhexa8, MED_NOGAUSS, MED_ALL,
+ MED_NOPFL, MED_NO_PFLMOD, MED_MAILLE, MED_HEXA8,
+ MED_NOPDT," ", 0., MED_NONOR);
printf("MEDchampEcr : %d \n",ret);
}
}
return 0;
}
-
-using namespace std;
#include<string>
#include "MEDMEM_Exception.hxx"
#include "MEDMEM_Med.hxx"
+using namespace std;
using namespace MEDMEM;
void usage(char * name)
{
-using namespace std;
#include<string>
#include<deque>
#include "MEDMEM_MedMedDriver.hxx"
#include "MEDMEM_MedMeshDriver.hxx"
+using namespace std;
using namespace MEDMEM;
int main (int argc, char ** argv) {
-using namespace std;
#include<string>
#include<deque>
#include "MEDMEM_Field.hxx"
#include "MEDMEM_VtkMedDriver.hxx"
+using namespace std;
using namespace MEDMEM;
void usage(char * name)
{
-using namespace std;
#include<string>
#include <math.h>
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
double dmax(double x, double y) { return (x>y)?x:y;}
-using namespace std;
#include "utilities.h"
#include "MEDMEM_Array.hxx"
+using namespace std;
using namespace MEDMEM;
int main (int argc, char ** argv) {
int SpaceDimension = 3 ;
int NumberOfNodes = 4 ;
- MEDARRAY<int> * myArray = new MEDARRAY<int>(SpaceDimension,NumberOfNodes,MED_FULL_INTERLACE) ;
+ MEDARRAY<int> * myArray = new MEDARRAY<int>(SpaceDimension,NumberOfNodes,MED_EN::MED_FULL_INTERLACE) ;
//const int * value = myArray->get(MED_FULL_INTERLACE) ;
for (int i=1; i<=NumberOfNodes; i++)
MESSAGE("Show all 0 :");
numberof = myArray->getLeadingValue() ;
int length = myArray->getLengthValue() ;
- const int * NoInterlaceArray = myArray->get(MED_NO_INTERLACE) ;
+ const int * NoInterlaceArray = myArray->get(MED_EN::MED_NO_INTERLACE) ;
for (int i=0; i<length ; i++) {
cout << " - " ;
for (int j=0;j<numberof;j++)
-using namespace std;
#include "utilities.h"
#include "MEDMEM_CellModel.hxx"
#include "MEDMEM_DriversDef.hxx"
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
+
int main (int argc, char ** argv) {
- list<MED_FR::med_geometrie_element> geomList = MED_FR::meshEntities[MED_FR::MED_MAILLE] ;
- list<MED_FR::med_geometrie_element>::iterator itGeomList ;
+ list<medGeometryElement> geomList = meshEntities[MED_CELL] ;
+ list<medGeometryElement>::iterator itGeomList ;
for(itGeomList=geomList.begin();itGeomList!=geomList.end();itGeomList++) {
CELLMODEL myCellModel((MED_EN::medGeometryElement)(*itGeomList)) ;
using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
int main (int argc, char ** argv) {
-using namespace std;
#include "utilities.h"
#include "MEDMEM_ModulusArray.hxx"
+
+using namespace std;
using namespace MEDMEM;
int main (int argc, char ** argv) {
-using namespace std;
#include "utilities.h"
#include "MEDMEM_SkyLineArray.hxx"
+
+using namespace std;
using namespace MEDMEM;
int main (int argc, char ** argv) {
-using namespace std;
/* Programme de test du constructeur de copies de la classe MEDARRAY de MEDMEM
jroy - 16/12/2002 */
#include "MEDMEM_Support.hxx"
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
-using namespace MEDMEM;
+using namespace std;
+using namespace MEDMEM;
+using namespace MED_EN;
void affiche_medarray(MEDARRAY<double> & myMedArray)
{
-using namespace std;
/* Programme de test du constructeur de copies de la classe CONNECTIVITY de MEDMEM
jroy - 19/12/2002 */
#include "MEDMEM_Support.hxx"
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
void affiche_connectivity(const CONNECTIVITY * myConnectivity, MESH * myMesh)
{
-using namespace std;
/* Programme de test du constructeur de copies de la classe COORDINATE de MEDMEM
jroy - 17/12/2002 */
#include "MEDMEM_Support.hxx"
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
-using namespace MEDMEM;
+using namespace std;
+using namespace MEDMEM;
+using namespace MED_EN;
void affiche_tableau(const double * myArray, int nb_lignes, int nb_colonnes)
{
-using namespace std;
#include<string>
#include <math.h>
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
void affiche_support(const SUPPORT * mySupport)
{
-using namespace std;
/* Programme de test du constructeur de copies de la classe FIELD_ de MEDMEM
jroy - 12/12/2002 */
#include "MEDMEM_Support.hxx"
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
void affiche_field_(FIELD_ * myField, const SUPPORT * mySupport)
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
using namespace MEDMEM;
+using namespace MED_EN;
void affiche_field(FIELD_ * myField, const SUPPORT * mySupport)
// SUPPORT * mySupport = new SUPPORT(myMesh,"On_all_node",MED_NODE);
- SUPPORT * mySupport = new SUPPORT(myMesh,"On_all_cell",MED_CELL);
+ SUPPORT * mySupport = new SUPPORT(myMesh,"On_all_cell",MED_EN::MED_CELL);
FIELD<double> * myField = new FIELD<double>() ;
- myField->setValueType(MED_REEL64);
+ myField->setValueType(MED_EN::MED_REEL64);
myField->setName(fieldname);
myField->setSupport(mySupport);
myFieldDriver.read() ;
} catch (...) {
delete mySupport ;
- mySupport = new SUPPORT(myMesh,"On_all_node",MED_NODE);
+ mySupport = new SUPPORT(myMesh,"On_all_node",MED_EN::MED_NODE);
myField->setSupport(mySupport);
try {
myFieldDriver.read() ;
-using namespace std;
#include<string>
#include <math.h>
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
void affiche_support(const SUPPORT * mySupport)
{
-using namespace std;
/* Programme de test du constructeur de copies de la classe MEDARRAY de MEDMEM
jroy - 16/12/2002 */
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
void affiche_medarray(MEDARRAY<double> & myMedArray)
{
-using namespace std;
#include<string>
#include <math.h>
#include "MEDMEM_Support.hxx"
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
+
+using namespace std;
using namespace MEDMEM;
-using namespace std;
#include<string>
#include <math.h>
#include "MEDMEM_Support.hxx"
#include "MEDMEM_Field.hxx"
#include "MEDMEM_define.hxx"
-using namespace MEDMEM;
+using namespace std;
+using namespace MEDMEM;
+using namespace MED_EN;
void affiche_support(const SUPPORT * mySupport)
{
-using namespace std;
-
#include "MEDMEM_GibiMeshDriver.hxx"
#include "MEDMEM_Mesh.hxx"
+
+using namespace std;
using namespace MEDMEM;
int main (int argc, char ** argv)
{
--- /dev/null
+#include "MEDMEM_Grid.hxx"
+
+using namespace MEDMEM;
+using namespace MED_EN;
+
+static void usage(const char * test)
+{
+ cerr << "Usage : " << test
+ << " SpaceDimension nbMaille" << endl << endl
+ << "-> Crée une grille cartesienne en dimension SpaceDimension avec nbMaille suivant chaque direction" << endl;
+ exit(-1);
+}
+
+int main (int argc, char ** argv) {
+
+ /* process the arguments */
+ if (argc != 3)
+ usage(argv[0]);
+
+ const int SpaceDimension=atoi(argv[1]);
+ const int nbMaille=atoi(argv[2]);
+ if(SpaceDimension>3 || SpaceDimension<1 || nbMaille<1)
+ usage(argv[0]);
+
+ // Creation des tableaux necessaires à la construction de GRID
+ std::vector<int> nMaille(SpaceDimension,nbMaille);
+ std::vector<double> Origine(SpaceDimension,0.0);
+ std::vector<double> pas(SpaceDimension,10.0);
+ std::vector<std::vector<double> > XYZ_Array(SpaceDimension);
+ for(int i=0;i!=SpaceDimension;++i)
+ {
+ XYZ_Array[i].resize(nMaille[i]+1); // nbre de noeuds = nbre de mailles +1
+ XYZ_Array[i][0]=Origine[i];
+ for(int j=1;j!=XYZ_Array[i].size();++j)
+ XYZ_Array[i][j]=XYZ_Array[i][j-1] + pas[j-1];
+ }
+
+ std::vector<std::string> coord_name(SpaceDimension,"X");
+ if(SpaceDimension>=2)
+ coord_name[1]="Y";
+ if(SpaceDimension>=3)
+ coord_name[2]="Z";
+ std::vector<std::string> coord_unit(SpaceDimension,"cm");
+
+ // creation du pointeur MESH à partir d'un GRID, test affichage
+ std::auto_ptr<MEDMEM::MESH> Mesh (new MEDMEM::GRID( XYZ_Array, coord_name, coord_unit, MED_CARTESIAN) );
+ const MEDMEM::CONNECTIVITY* conn = Mesh->getConnectivityptr();
+ std::cout << "Affichage du maillage : " << endl << *Mesh << endl;
+}
using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
+
void affiche_field_(FIELD_ * myField, const SUPPORT * mySupport)
{
cout << "Field "<< myField->getName() << " : " <<myField->getDescription() << endl ;
#include "MEDMEM_define.hxx"
using namespace MEDMEM;
+using namespace MED_EN;
+
int myfunction1(int x)
{
return 2*x;
-using namespace std;
-
#include "MEDMEM_PorflowMeshDriver.hxx"
#include "MEDMEM_Mesh.hxx"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
+
int main (int argc, char ** argv)
{
/* process the arguments */
// File : readCoordinate.cxx
// Module : MED
-using namespace std;
#include<string>
#include "MEDMEM_Exception.hxx"
#include "MEDMEM_define.hxx"
#include "MEDMEM_Mesh.hxx"
#include "MEDMEM_MedMeshDriver.hxx"
+
+using namespace std;
using namespace MEDMEM;
void usage(char * name)
string fileName = argv[1];
string meshName = argv[2];
- medModeSwitch Mode = MED_FULL_INTERLACE;
+ MED_EN::medModeSwitch Mode = MED_EN::MED_FULL_INTERLACE;
if (argc==4)
{
string comp=argv[3];
- if ( comp == "MED_NO_INTERLACE" ) Mode = MED_NO_INTERLACE;
+ if ( comp == "MED_NO_INTERLACE" ) Mode = MED_EN::MED_NO_INTERLACE;
else if ( comp != "MED_FULL_INTERLACE") usage(argv[0]);
}
// File : readEntete.cxx
// Module : MED
-using namespace std;
#include<string>
#include "MEDMEM_Exception.hxx"
#include "MEDMEM_define.hxx"
#include "MEDMEM_Mesh.hxx"
#include "MEDMEM_MedMeshDriver.hxx"
#include "MEDMEM_DriversDef.hxx"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
void usage(char * name)
{
cout << "- Nombre de noeuds : " << NumberOfNodes << " " << endl;
int NumberOfTypes = myMesh->getNumberOfTypes(MED_CELL);
- const medGeometryElement * Types = myMesh->getTypes(MED_CELL);
-
+ const medGeometryElement * Types;
+
cout << "- Nombre de Type de mailles : " << NumberOfTypes << endl;
if (NumberOfTypes > 0)
{
+ Types = myMesh->getTypes(MED_CELL);
+
cout << " Types : ";
for (int itype=0; itype<NumberOfTypes; itype++) cout << Types[itype] << " ";
cout << endl;
- }
- const list<MED_FR::med_geometrie_element> currentEntity = MED_FR::meshEntities[(MED_FR::med_entite_maillage)MED_CELL];
- list<MED_FR::med_geometrie_element>::const_iterator currentGeometry;
- for (currentGeometry = currentEntity.begin();
- currentGeometry != currentEntity.end();
- currentGeometry++)
- {
- cout << "- Nombre de mailles de type ";
- cout << MED_FR::geoNames[(MED_FR::med_geometrie_element)(*currentGeometry)] << " : ";
- cout << myMesh->getNumberOfElements(MED_CELL,(MED_EN::medGeometryElement)(*currentGeometry));
- cout << " " << endl;
- }
+ const list<medGeometryElement> currentEntity = meshEntities[MED_CELL];
+ list<medGeometryElement>::const_iterator currentGeometry;
+
+ for (currentGeometry = currentEntity.begin();
+ currentGeometry != currentEntity.end();
+ currentGeometry++)
+ {
+ cout << "- Nombre de mailles de type ";
+ cout << geoNames[(*currentGeometry)] << " : ";
+ cout << myMesh->getNumberOfElements(MED_CELL,(MED_EN::medGeometryElement)(*currentGeometry));
+ cout << " " << endl;
+ }
+ }
NumberOfTypes = myMesh->getNumberOfTypes(MED_FACE);
- Types = myMesh->getTypes(MED_FACE);
cout << "- Nombre de Type de faces : " << NumberOfTypes << endl;
if (NumberOfTypes > 0)
{
+ Types = myMesh->getTypes(MED_FACE);
+
cout << " Types : ";
for (int itype=0; itype<NumberOfTypes; itype++) cout << Types[itype] << " ";
cout << endl;
- }
- const list<MED_FR::med_geometrie_element> currentEntity2 = MED_FR::meshEntities[(MED_FR::med_entite_maillage)MED_FACE];
- for (currentGeometry = currentEntity2.begin();
- currentGeometry != currentEntity2.end();
- currentGeometry++)
- {
- cout << "- Nombre de faces de type ";
- cout << MED_FR::geoNames[(MED_FR::med_geometrie_element)(*currentGeometry)] << " : ";
- cout << myMesh->getNumberOfElements(MED_FACE,(MED_EN::medGeometryElement)(*currentGeometry));
- cout << " " << endl;
- }
+ const list<medGeometryElement> currentEntity2 = meshEntities[MED_FACE];
+ list<medGeometryElement>::const_iterator currentGeometry;
+
+ for (currentGeometry = currentEntity2.begin();
+ currentGeometry != currentEntity2.end();
+ currentGeometry++)
+ {
+ cout << "- Nombre de faces de type ";
+ cout << geoNames[(*currentGeometry)] << " : ";
+ cout << myMesh->getNumberOfElements(MED_FACE,(*currentGeometry));
+ cout << " " << endl;
+ }
+ }
NumberOfTypes = myMesh->getNumberOfTypes(MED_EDGE);
- Types = myMesh->getTypes(MED_EDGE);
cout << "- Nombre de Type de aretes : " << NumberOfTypes << endl;
if (NumberOfTypes > 0)
{
+ Types = myMesh->getTypes(MED_EDGE);
+
cout << " Types : ";
for (int itype=0; itype<NumberOfTypes; itype++) cout << Types[itype] << " ";
cout << endl;
- }
- const list<MED_FR::med_geometrie_element> currentEntity3 = MED_FR::meshEntities[(MED_FR::med_entite_maillage)MED_EDGE];
- for (currentGeometry = currentEntity3.begin();
- currentGeometry != currentEntity3.end();
- currentGeometry++)
- {
- cout << "- Nombre d'aretes de type ";
- cout << MED_FR::geoNames[(MED_FR::med_geometrie_element)(*currentGeometry)] << " : ";
- cout << myMesh->getNumberOfElements(MED_EDGE,(MED_EN::medGeometryElement)(*currentGeometry));
- cout << " " << endl;
- }
+ const list<medGeometryElement> currentEntity3 = meshEntities[MED_EDGE];
+ list<medGeometryElement>::const_iterator currentGeometry;
+
+ for (currentGeometry = currentEntity3.begin();
+ currentGeometry != currentEntity3.end();
+ currentGeometry++)
+ {
+ cout << "- Nombre d'aretes de type ";
+ cout << geoNames[(*currentGeometry)] << " : ";
+ cout << myMesh->getNumberOfElements(MED_EDGE,(*currentGeometry));
+ cout << " " << endl;
+ }
+ }
delete myMesh;
}
// File : testUArray.cxx
// Module : MED
-using namespace std;
#include <cstdlib> // pour l'acces à EXIT_SUCCESS et EXIT_FAILURE
#include "utilities.h"
#include "MEDMEM_Array.hxx"
+
+using namespace std;
using namespace MEDMEM;
void imprime(string titre,const int * myValues,const int * myOthers, int lignes, int colonnes)
- MEDARRAY<int> * myArrayfull= new MEDARRAY<int>(SpaceDimension,NumberOfNodes,MED_FULL_INTERLACE);
+ MEDARRAY<int> * myArrayfull= new MEDARRAY<int>(SpaceDimension,NumberOfNodes,MED_EN::MED_FULL_INTERLACE);
ASSERT(myArrayfull != NULL);
- const int * myValues = myArrayfull->get(MED_FULL_INTERLACE);
+ const int * myValues = myArrayfull->get(MED_EN::MED_FULL_INTERLACE);
ASSERT(myValues!= NULL);
for (int i=0; i<NumberOfNodes; i++)
}
}
- const int * myOthers = myArrayfull->get(MED_NO_INTERLACE) ;
+ const int * myOthers = myArrayfull->get(MED_EN::MED_NO_INTERLACE) ;
ASSERT(myOthers != NULL);
imprime("Initialisation full interlace (xi=yi=zi=i+1)",myValues,myOthers,NumberOfNodes,SpaceDimension);
- MEDARRAY<int> * myArrayno= new MEDARRAY<int>(SpaceDimension,NumberOfNodes,MED_NO_INTERLACE);
+ MEDARRAY<int> * myArrayno= new MEDARRAY<int>(SpaceDimension,NumberOfNodes,MED_EN::MED_NO_INTERLACE);
ASSERT(myArrayno != NULL);
- const int * myValuesno = myArrayno->get(MED_NO_INTERLACE);
+ const int * myValuesno = myArrayno->get(MED_EN::MED_NO_INTERLACE);
ASSERT(myValuesno!= NULL);
for (int k=0; k<SpaceDimension; k++)
}
}
- const int * myOthersno = myArrayno->get(MED_FULL_INTERLACE) ;
+ const int * myOthersno = myArrayno->get(MED_EN::MED_FULL_INTERLACE) ;
ASSERT(myOthersno != NULL);
imprime("Initialisation no interlace (xi=yi=zi=i+1)",myOthersno,myValuesno,NumberOfNodes,SpaceDimension);
}
try
{
- myArrayfull->set(MED_FULL_INTERLACE,mynewvalues);
- myValues = myArrayfull->get(MED_FULL_INTERLACE);
- myOthers = myArrayfull->get(MED_NO_INTERLACE);
+ myArrayfull->set(MED_EN::MED_FULL_INTERLACE,mynewvalues);
+ myValues = myArrayfull->get(MED_EN::MED_FULL_INTERLACE);
+ myOthers = myArrayfull->get(MED_EN::MED_NO_INTERLACE);
}
catch ( const std::exception &e )
{
try
{
- myArrayno->set(MED_FULL_INTERLACE,mynewvalues);
- myValuesno = myArrayfull->get(MED_FULL_INTERLACE);
+ myArrayno->set(MED_EN::MED_FULL_INTERLACE,mynewvalues);
+ myValuesno = myArrayfull->get(MED_EN::MED_FULL_INTERLACE);
myOthersno = NULL;
}
catch ( const std::exception &e )
/* ---------------------------------------------------------- */
MEDARRAY<int> * myArrayShare = new MEDARRAY<int>( *myArrayfull);
- const int * sharevalues = myArrayShare->get(MED_FULL_INTERLACE);
- const int * shareno = myArrayShare->get(MED_NO_INTERLACE);
+ const int * sharevalues = myArrayShare->get(MED_EN::MED_FULL_INTERLACE );
+ const int * shareno = myArrayShare->get(MED_EN::MED_NO_INTERLACE);
imprime("test contructeur par recopie non profonde",sharevalues,shareno,NumberOfNodes,SpaceDimension);
myArrayfull->setIJ(1,2,1992);
imprime("tableau cible apres destruction tableau source",myValues,myOthers,NumberOfNodes,SpaceDimension);
MEDARRAY<int> * myArrayShare2 = new MEDARRAY<int>( *myArrayfull,true);
- sharevalues = myArrayShare2->get(MED_FULL_INTERLACE);
- shareno = myArrayShare2->get(MED_NO_INTERLACE);
+ sharevalues = myArrayShare2->get(MED_EN::MED_FULL_INTERLACE );
+ shareno = myArrayShare2->get(MED_EN::MED_NO_INTERLACE );
imprime("test contructeur par recopie profonde",sharevalues,shareno,NumberOfNodes,SpaceDimension);
myArrayfull->setIJ(1,2,18);
myArrayShare2->setIJ(1,2,19);
imprime("change valeur tableau cible, impression tableau source",myValues,myOthers,NumberOfNodes,SpaceDimension);
- myArrayno->set(MED_NO_INTERLACE,mynewvalues);
+ myArrayno->set(MED_EN::MED_NO_INTERLACE,mynewvalues);
myArrayno->setIJ(2,1,1);
- myValuesno = myArrayno->get(MED_NO_INTERLACE);
- myOthersno = myArrayno->get(MED_FULL_INTERLACE);
+ myValuesno = myArrayno->get(MED_EN::MED_NO_INTERLACE);
+ myOthersno = myArrayno->get(MED_EN::MED_FULL_INTERLACE);
imprime("Initialisation no interlace (0...11)",myOthersno,myValuesno,NumberOfNodes,SpaceDimension);
MEDARRAY<int> * myArrayShare3 = new MEDARRAY<int>( *myArrayno);
- sharevalues = myArrayShare3->get(MED_FULL_INTERLACE);
- shareno = myArrayShare3->get(MED_NO_INTERLACE);
+ sharevalues = myArrayShare3->get(MED_EN::MED_FULL_INTERLACE);
+ shareno = myArrayShare3->get(MED_EN::MED_NO_INTERLACE);
imprime("test contructeur par recopie non profonde",sharevalues,shareno,NumberOfNodes,SpaceDimension);
myArrayno->setIJ(1,2,1992);
// File : testUCellModel.cxx
// Module : MED
-using namespace std;
#include <set>
#include <cstdlib>
#include "utilities.h"
#include "MEDMEM_CellModel.hxx"
#include "MEDMEM_define.hxx"
#include "MEDMEM_DriversDef.hxx"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
void usage(char * name)
{
for (int i=0; i<MED_NBR_GEOMETRIE_MAILLE ; i++)
{
cout << endl;
- cout << MED_FR::geoNames[(MED_FR::med_geometrie_element)tous[i].getType()] << endl;
+ cout << geoNames[tous[i].getType()] << endl;
cout << "__________________" << endl;
try
return EXIT_FAILURE ;
}
}
-
+*/
/*
set <medGeometryElement>::iterator iter_s;
for (iter_s=setGeomElt.begin() ;iter_s!=setGeomElt.end();iter_s++)
{
- cout << MED_FR::geoNames[(MED_FR::med_geometrie_element)(*iter_s)] << endl;
+ cout << geoNames[(*iter_s)] << endl;
}
cout << "Impression des coordonnées du 1er Element de ce type" << endl;
for (iter_s=tous[i].getAllConstituentsType().begin() ;
iter_s!=tous[i].getAllConstituentsType().end();iter_s++)
{
- cout << MED_FR::geoNames[(MED_FR::med_geometrie_element)(*iter_s)] << endl;
+ cout << geoNames[*iter_s] << endl;
}
}
catch ( const std::exception &e )
// File : testUCoordinate.cxx
// Module : MED
-using namespace std;
#include <cstdlib>
#include <cmath>
#include "utilities.h"
#include "MEDMEM_Array.hxx"
#include "MEDMEM_Coordinate.hxx"
#include <string>
+
+using namespace std;
using namespace MEDMEM;
void usage(char * name)
// File : testUGeoNameMeshEntities.cxx
// Module : MED
-using namespace std;
#include "MEDMEM_DriversDef.hxx"
+using namespace std;
void usage(char * name)
{
cout << " " << name << endl;
cout << "GEO_NAME Test" << endl ;
cout << "-------------" << endl << endl;
- MED_FR::GEO_NAME::const_iterator currentGeom;
- for (currentGeom = MED_FR::geoNames.begin();
- currentGeom != MED_FR::geoNames.end();
+ MED_EN::GEO_NAME::const_iterator currentGeom;
+ for (currentGeom = MED_EN::geoNames.begin();
+ currentGeom != MED_EN::geoNames.end();
currentGeom++)
{
cout << (*currentGeom).second << endl;
};
- MED_FR::MESH_ENTITIES::const_iterator currentEntity;
- list<MED_FR::med_geometrie_element>::const_iterator currentGeometry;
+ MED_EN::MESH_ENTITIES::const_iterator currentEntity;
+ list<MED_EN::medGeometryElement>::const_iterator currentGeometry;
cout << endl;
cout << "MESH_ENTITIES Test" << endl ;
cout << "------------------" << endl << endl;
- for (currentEntity = MED_FR::meshEntities.begin();
- currentEntity != MED_FR::meshEntities.end();
+ for (currentEntity = MED_EN::meshEntities.begin();
+ currentEntity != MED_EN::meshEntities.end();
currentEntity++)
{
- cout << (*((MED_FR::entNames).find((*currentEntity).first))).second <<endl;
+ cout << (*((MED_EN::entNames).find((*currentEntity).first))).second <<endl;
for (currentGeometry = (*currentEntity).second.begin();
currentGeometry != (*currentEntity).second.end();
currentGeometry++)
{
- cout << MED_FR::geoNames[(MED_FR::med_geometrie_element)(*currentGeometry)] << endl;
+ cout << MED_EN::geoNames[(MED_EN::medGeometryElement)(*currentGeometry)] << endl;
}
cout << endl;
}
// File : testUMedException.cxx
// Module : MED
-using namespace std;
#include <cstdlib>
#include "MEDMEM_STRING.hxx"
#include "MEDMEM_Exception.hxx"
+
+using namespace std;
using namespace MEDMEM;
int main (int argc, char ** argv)
// File : testUModulusArray.cxx
// Module : MED
-using namespace std;
#include <cstdlib>
#include <exception>
#include "utilities.h"
#include "MEDMEM_ModulusArray.hxx"
+using namespace std;
using namespace MEDMEM;
int main (int argc, char ** argv)
// File : testUPointerOf.cxx
// Module : MED
-using namespace std;
#include "utilities.h"
#include "MEDMEM_PointerOf.hxx"
#include "MEDMEM_Exception.hxx"
+
+using namespace std;
using namespace MEDMEM;
// File : testUSkyLineArray.cxx
// Module : MED
-using namespace std;
#include <cstdlib>
#include "utilities.h"
#include "MEDMEM_SkyLineArray.hxx"
+
+using namespace std;
using namespace MEDMEM;
int main (int argc, char ** argv)
// File : testUUnit.cxx
// Module : MED
-using namespace std;
#include <cstdlib>
#include <exception>
#include "MEDMEM_Unit.hxx"
+using namespace std;
using namespace MEDMEM;
int main (int argc, char ** argv)
public:
FIELDDOUBLE_i();
~FIELDDOUBLE_i();
- FIELDDOUBLE_i(::FIELD<double> * const f, bool ownCppPtr=false);
+ FIELDDOUBLE_i(MEDMEM::FIELD<double> * const f, bool ownCppPtr=false);
FIELDDOUBLE_i(FIELDDOUBLE_i & f);
SALOME_MED::double_array * getValue (SALOME_MED::medModeSwitch mode )
public:
~FIELDINT_i();
- FIELDINT_i(::FIELD<int> * const f, bool ownCppPtr=false);
+ FIELDINT_i(MEDMEM::FIELD<int> * const f, bool ownCppPtr=false);
FIELDINT_i(FIELDINT_i & f);
SALOME_MED::long_array * getValue (SALOME_MED::medModeSwitch mode )
throw (SALOME::SALOME_Exception);
//=============================================================================
#include "MEDMEM_Field_i.hxx"
+using namespace MEDMEM;
+using namespace MED_EN;
+
map < int, ::FIELD_ * > FIELD_i::fieldMap ;
int FIELD_i::fieldIndex = 0;
//=============================================================================
//=============================================================================
//FIELD_i::FIELD_i():_fieldTptr(FIELD_i::constructConstField())
-FIELD_i::FIELD_i():_fieldTptr(constructConstField())
+FIELD_i::FIELD_i():_fieldTptr(constructConstField()),_corbaIndex(FIELD_i::fieldIndex++)
{
BEGIN_OF("Default Constructor Field_i");
END_OF(" Default Constructor Field_i");
const int _corbaIndex;
string _FieldId;
FIELD_i();
- FIELD_i(::FIELD_ * const field, bool ownCppPtr);
+ FIELD_i(MEDMEM::FIELD_ * const field, bool ownCppPtr);
FIELD_i(FIELD_i & f);
public :
throw (SALOME::SALOME_Exception);
void release();
// Cuisine Interne
- ::FIELD_ * constructConstField() const;
+ MEDMEM::FIELD_ * constructConstField() const;
};
}
-using namespace std;
//=============================================================================
// File : MEDMEM_Med_i.cxx
// Project : SALOME
#include "MEDMEM_DriversDef.hxx"
#include "utilities.h"
#include "Utils_CorbaException.hxx"
+
+using namespace std;
using namespace MEDMEM;
//=============================================================================
vector<GROUP*> groupVector;
vector<GROUP*>::iterator groupVectorIt;
- MED_FR::MESH_ENTITIES::const_iterator currentEntity;
+ MED_EN::MESH_ENTITIES::const_iterator currentEntity;
for (int i=0; i<numberOfMeshes; i++)
{
::MESH * ptrMesh = _med->getMesh(meshesNames[i]);
- for (currentEntity = MED_FR::meshEntities.begin();
- currentEntity != MED_FR::meshEntities.end();
+ for (currentEntity = MED_EN::meshEntities.begin();
+ currentEntity != MED_EN::meshEntities.end();
currentEntity++)
{
// MESSAGE(LOC << ": for entity " << (*currentEntity).first);
for (int i=0; i<numberOfMeshes; i++)
{
- map<MED_FR::med_entite_maillage,::SUPPORT*> mySupports = _med->getSupports(meshesNames[i]);
- map<MED_FR::med_entite_maillage,::SUPPORT*>::const_iterator itSupport;
- map<MED_FR::med_entite_maillage, SALOME_MED::SUPPORT_ptr> & mySupportsIOR
+ map<MED_EN::medEntityMesh,::SUPPORT*> mySupports = _med->getSupports(meshesNames[i]);
+ map<MED_EN::medEntityMesh,::SUPPORT*>::const_iterator itSupport;
+ map<MED_EN::medEntityMesh, SALOME_MED::SUPPORT_ptr> & mySupportsIOR
= _supports[meshesNames[i]];
for ( itSupport = mySupports.begin(); itSupport != mySupports.end(); itSupport++ )
{
::FIELD_ * myField = _med->getField(fieldsNames[i], myIteration[j].dt, myIteration[j].it);
string meshName = myField->getSupport()->getMesh()->getName();
medEntityMesh myEntity = myField->getSupport()->getEntity();
- map<string, map<MED_FR::med_entite_maillage, SALOME_MED::SUPPORT_ptr> >::const_iterator
+ map<string, map<MED_EN::medEntityMesh, SALOME_MED::SUPPORT_ptr> >::const_iterator
itSupportOnMesh = _supports.find(meshName);
if ( itSupportOnMesh == _supports.end() )
throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
<< "There is no support on mesh named |"
<< meshName << "|" ));
- const map<MED_FR::med_entite_maillage, SALOME_MED::SUPPORT_ptr> & SupportOnMesh
+ const map<MED_EN::medEntityMesh, SALOME_MED::SUPPORT_ptr> & SupportOnMesh
= (*itSupportOnMesh).second;
- map<MED_FR::med_entite_maillage,SALOME_MED::SUPPORT_ptr>::const_iterator itSupport
- = SupportOnMesh.find((MED_FR::med_entite_maillage)myEntity);
+ map<MED_EN::medEntityMesh,SALOME_MED::SUPPORT_ptr>::const_iterator itSupport
+ = SupportOnMesh.find(myEntity);
if (itSupport == SupportOnMesh.end())
throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
<< "There is no support on entity "
SALOME_MED::FIELD_ptr myFieldIOR;
switch (type)
{
- case MED_FR::MED_INT32 :
+ case MED_EN::MED_INT32 :
{
((FIELD<int>*)myField)->read();
FIELDINT_i * myFieldIntI = new FIELDINT_i((FIELD<int>*)myField);
break;
}
- case MED_FR::MED_REEL64:
+ case MED_EN::MED_REEL64:
{
((FIELD<double>*)myField)->read();
FIELDDOUBLE_i * myFieldDoubleI = new FIELDDOUBLE_i((FIELD<double>*)myField);
SCRUTE(numberOfMeshes);
- MED_FR::MESH_ENTITIES::const_iterator currentEntity;
+ MED_EN::MESH_ENTITIES::const_iterator currentEntity;
for (int i=0; i<numberOfMeshes; i++)
{
::MESH * ptrMesh = _med->getMesh(meshesNames[i]);
SCRUTE(ptrMesh);
- for (currentEntity = MED_FR::meshEntities.begin();
- currentEntity != MED_FR::meshEntities.end();
+ for (currentEntity = MED_EN::meshEntities.begin();
+ currentEntity != MED_EN::meshEntities.end();
currentEntity++)
{
MESSAGE(LOC << ": for entity " << (*currentEntity).first);
for (int i=0; i<numberOfMeshes; i++)
{
- map<MED_FR::med_entite_maillage,::SUPPORT*> mySupports = _med->getSupports(meshesNames[i]);
- map<MED_FR::med_entite_maillage,::SUPPORT*>::const_iterator itSupport;
- map<MED_FR::med_entite_maillage,SALOME_MED::SUPPORT_ptr> &
+ map<MED_EN::medEntityMesh,::SUPPORT*> mySupports = _med->getSupports(meshesNames[i]);
+ map<MED_EN::medEntityMesh,::SUPPORT*>::const_iterator itSupport;
+ map<MED_EN::medEntityMesh,SALOME_MED::SUPPORT_ptr> &
mySupportsIOR = _supports[meshesNames[i]];
for (itSupport=mySupports.begin(); itSupport!=mySupports.end(); itSupport++ )
{
string meshName = myField->getSupport()->getMesh()->getName();
medEntityMesh myEntity = myField->getSupport()->getEntity();
- map<string, map<MED_FR::med_entite_maillage,SALOME_MED::SUPPORT_ptr> >::const_iterator
+ map<string, map<MED_EN::medEntityMesh,SALOME_MED::SUPPORT_ptr> >::const_iterator
itSupportOnMesh = _supports.find(meshName);
if (itSupportOnMesh == _supports.end() )
throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
<< "There is no support on mesh named |"
<< meshName << "|"));
- const map<MED_FR::med_entite_maillage,SALOME_MED::SUPPORT_ptr> & SupportOnMesh
+ const map<MED_EN::medEntityMesh,SALOME_MED::SUPPORT_ptr> & SupportOnMesh
= (*itSupportOnMesh).second;
- map<MED_FR::med_entite_maillage,SALOME_MED::SUPPORT_ptr>::const_iterator itSupport
- = SupportOnMesh.find((MED_FR::med_entite_maillage)myEntity);
+ map<MED_EN::medEntityMesh,SALOME_MED::SUPPORT_ptr>::const_iterator itSupport
+ = SupportOnMesh.find(myEntity);
if (itSupport == SupportOnMesh.end() )
throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
<< "There is no support on entity "
switch (type)
{
- case MED_FR::MED_INT32:
+ case MED_EN::MED_INT32:
{
((FIELD<int>*)myField)->read();
FIELDINT_i * myFieldIntI = new FIELDINT_i((FIELD<int>*)myField);
break;
}
- case MED_FR::MED_REEL64:
+ case MED_EN::MED_REEL64:
{
((FIELD<double>*)myField)->read();
FIELDDOUBLE_i * myFieldDoubleI = new FIELDDOUBLE_i((FIELD<double>*)myField);
map<string,SALOME_MED::MESH_ptr> _meshes; // We can't have two MESHes with the same name.
- map<string,map<MED_FR::med_entite_maillage,SALOME_MED::SUPPORT_ptr> > _supports;
+ map<string,map<MED_EN::medEntityMesh,SALOME_MED::SUPPORT_ptr> > _supports;
map<string,MAP_IOR_DT_IT_> _fields; // We can't have two FIELDs with the same name.
public SALOMEMultiComm
{
public :
- static map < int,::MEDMEM::MESH *> meshMap;
+ static std::map < int,::MEDMEM::MESH *> meshMap;
private :
static int meshIndex;
// C++ object containing values
::MEDMEM::MESH * const _mesh;
const int _corbaIndex;
- string _meshId;
+ std::string _meshId;
public:
throw (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
void addInStudy (SALOMEDS::Study_ptr myStudy,
SALOME_MED::MESH_ptr myIor,
- const string & fileName)
+ const std::string & fileName)
throw (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
CORBA::Long addDriver (SALOME_MED::medDriverTypes driverType,
const char* fileName, const char* meshName)
* Default constructor
*/
//=============================================================================
-SUPPORT_i::SUPPORT_i() :_support((::SUPPORT *)NULL)
+SUPPORT_i::SUPPORT_i() :_support((::SUPPORT *)NULL),_corbaIndex(SUPPORT_i::supportIndex++)
{
BEGIN_OF("Default Constructor SUPPORT_i");
END_OF("Default Constructor SUPPORT_i");
namespace MEDMEM {
class SUPPORT;
-class SALOME_MED::MESH;
class SUPPORT_i: public POA_SALOME_MED::SUPPORT,
public PortableServer::RefCountServantBase,
BIN_SERVER_IDL =
BIN_CLIENT_IDL =
+LDFLAGS= -L$(top_builddir)/lib/salome
+LDFLAGSFORBIN= -L$(top_builddir)/lib/salome
CPPFLAGS+= $(MED2_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CXXFLAGS+= -I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS+=$(MED2_LIBS) $(HDF5_LIBS) -lmedmem -lOpUtil -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace -lSalomeCommunication
+LDFLAGS+=$(MED2_LIBS) $(HDF5_LIBS) -lmedmem -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace -lSalomeCommunication
#LDFLAGS+=-lmedmem -L. -lSalomeContainer -lSalomeNS -lRegistry -lOpUtil -lSalomeNotification
# does we put only -lSalomeContainer and compiler retrieves -lSalomeNS -lRegistry -lOpUtil ????
-using namespace std;
#include "MEDMEM_SWIG_FieldDouble.hxx"
+
+using namespace std;
using namespace MEDMEM;
+using namespace MED_EN;
//=============================================================================
/*!
#include "MEDMEM_Field.hxx"
-class FIELDDOUBLE : public FIELD<double>
+class FIELDDOUBLE : public MEDMEM::FIELD<double>
{
public:
FIELDDOUBLE();
- FIELDDOUBLE(const SUPPORT * Support, const int NumberOfComponents);
- FIELDDOUBLE(const SUPPORT * Support, driverTypes driverType,
+ FIELDDOUBLE(const MEDMEM::SUPPORT * Support, const int NumberOfComponents);
+ FIELDDOUBLE(const MEDMEM::SUPPORT * Support, MEDMEM::driverTypes driverType,
const string & fileName="", const string & fieldName="",
const int iterationNumber=-1, const int orderNumber=-1);
FIELDDOUBLE(const FIELDDOUBLE & m);
- FIELDDOUBLE(const FIELD<double> & m);
+ FIELDDOUBLE(const MEDMEM::FIELD<double> & m);
~FIELDDOUBLE();
};
-using namespace std;
#include "MEDMEM_SWIG_FieldInt.hxx"
+using namespace std;
+using namespace MED_EN;
+using namespace MEDMEM;
+
//=============================================================================
/*!
* Default constructor
#include "MEDMEM_Field.hxx"
-class FIELDINT : public FIELD<int>
+class FIELDINT : public MEDMEM::FIELD<int>
{
public:
FIELDINT();
- FIELDINT(const SUPPORT * Support, const int NumberOfComponents);
- FIELDINT(const SUPPORT * Support, driverTypes driverType,
+ FIELDINT(const MEDMEM::SUPPORT * Support, const int NumberOfComponents);
+ FIELDINT(const MEDMEM::SUPPORT * Support, MEDMEM::driverTypes driverType,
const string & fileName="", const string & fieldName="",
const int iterationNumber=-1, const int orderNumber=-1);
FIELDINT(const FIELDINT & m);
- FIELDINT(const FIELD<int> & m);
+ FIELDINT(const MEDMEM::FIELD<int> & m);
~FIELDINT();
};
-using namespace std;
#include "MEDMEM_SWIG_MedFieldDoubleDriver.hxx"
+using namespace std;
+using namespace MEDMEM;
+using namespace MED_EN;
+
//=============================================================================
/*!
* Default constructor
#include "MEDMEM_MedFieldDriver.hxx"
#include "MEDMEM_SWIG_FieldDouble.hxx"
-class MED_FIELDDOUBLE_DRIVER : public MED_FIELD_DRIVER<double>
+class MED_FIELDDOUBLE_DRIVER : public MEDMEM::MED_FIELD_DRIVER<double>
{
public:
MED_FIELDDOUBLE_DRIVER();
MED_FIELDDOUBLE_DRIVER(const string & fileName, FIELDDOUBLE * ptrField,
- med_mode_acces accessMode);
+ MED_EN::med_mode_acces accessMode);
~MED_FIELDDOUBLE_DRIVER();
};
-class MED_FIELDDOUBLE_RDONLY_DRIVER : public MED_FIELD_RDONLY_DRIVER<double>
+class MED_FIELDDOUBLE_RDONLY_DRIVER : public MEDMEM::MED_FIELD_RDONLY_DRIVER<double>
{
public:
MED_FIELDDOUBLE_RDONLY_DRIVER();
~MED_FIELDDOUBLE_RDONLY_DRIVER();
};
-class MED_FIELDDOUBLE_WRONLY_DRIVER : public MED_FIELD_WRONLY_DRIVER<double>
+class MED_FIELDDOUBLE_WRONLY_DRIVER : public MEDMEM::MED_FIELD_WRONLY_DRIVER<double>
{
public:
MED_FIELDDOUBLE_WRONLY_DRIVER();
~MED_FIELDDOUBLE_WRONLY_DRIVER();
};
-class MED_FIELDDOUBLE_RDWR_DRIVER : public MED_FIELD_RDWR_DRIVER<double>
+class MED_FIELDDOUBLE_RDWR_DRIVER : public MEDMEM::MED_FIELD_RDWR_DRIVER<double>
{
public:
MED_FIELDDOUBLE_RDWR_DRIVER();
-using namespace std;
#include "MEDMEM_SWIG_MedFieldIntDriver.hxx"
+using namespace std;
+using namespace MEDMEM;
+using namespace MED_EN;
+
//=============================================================================
/*!
* Default constructor
#include "MEDMEM_MedFieldDriver.hxx"
#include "MEDMEM_SWIG_FieldInt.hxx"
-class MED_FIELDINT_DRIVER : public MED_FIELD_DRIVER<int>
+class MED_FIELDINT_DRIVER : public MEDMEM::MED_FIELD_DRIVER<int>
{
public:
MED_FIELDINT_DRIVER();
MED_FIELDINT_DRIVER(const string & fileName, FIELDINT * ptrField,
- med_mode_acces accessMode);
+ MED_EN::med_mode_acces accessMode);
~MED_FIELDINT_DRIVER();
};
-class MED_FIELDINT_RDONLY_DRIVER : public MED_FIELD_RDONLY_DRIVER<int>
+class MED_FIELDINT_RDONLY_DRIVER : public MEDMEM::MED_FIELD_RDONLY_DRIVER<int>
{
public:
MED_FIELDINT_RDONLY_DRIVER();
~MED_FIELDINT_RDONLY_DRIVER();
};
-class MED_FIELDINT_WRONLY_DRIVER : public MED_FIELD_WRONLY_DRIVER<int>
+class MED_FIELDINT_WRONLY_DRIVER : public MEDMEM::MED_FIELD_WRONLY_DRIVER<int>
{
public:
MED_FIELDINT_WRONLY_DRIVER();
~MED_FIELDINT_WRONLY_DRIVER();
};
-class MED_FIELDINT_RDWR_DRIVER : public MED_FIELD_RDWR_DRIVER<int>
+class MED_FIELDINT_RDWR_DRIVER : public MEDMEM::MED_FIELD_RDWR_DRIVER<int>
{
public:
MED_FIELDINT_RDWR_DRIVER();
#############################################################################
+LDFLAGS= -L$(top_builddir)/lib/salome
+LDFLAGSFORBIN= -L$(top_builddir)/lib/salome
+
CPPFLAGS+= $(PYTHON_INCLUDES) $(MED2_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS+=-ftemplate-depth-42 -I${KERNEL_ROOT_DIR}/include/salome
+CXXFLAGS+= @CXXTMPDPTHFLAGS@ -I${KERNEL_ROOT_DIR}/include/salome
LIBS= $(PYTHON_LIBS)
#LDFLAGS+= -lmedmem $(MED2_LIBS) $(HDF5_LIBS) -lSalomeLoggerServer -L${KERNEL_ROOT_DIR}/lib/salome
# change motivated by the bug KERNEL4778.
-LDFLAGS+= -lmedmem $(MED2_LIBS) $(HDF5_LIBS) -lSALOMELocalTrace -L${KERNEL_ROOT_DIR}/lib/salome
+LDFLAGS+= -lmedmem $(MED2_LIBS) $(HDF5_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace
#############################################################################
#include "MEDMEM_SWIG_MedFieldDoubleDriver.hxx"
#include "MEDMEM_SWIG_MedFieldIntDriver.hxx"
#include "MEDMEM_Meshing.hxx"
+
+ using namespace MEDMEM;
+ using namespace MED_EN;
%}
%include "typemaps.i"
SUPPORT * getSupport(char * meshName, medEntityMesh entity)
{
- return self->getSupport(string(meshName),
- (MED_FR::med_entite_maillage) entity);
+ return self->getSupport(string(meshName),entity);
}
}
};
files.append("pointe.med")
meshNameFiles.append("maa1")
+files.append("Mistrat.med")
+meshNameFiles.append("Mistrat_Hexa")
+
+## files.append("TimeStamps.med")
+## meshNameFiles.append("dom")
+
#
# Castem or Gibi file list
#
valueI = fieldintmul.getValueI(MED_FULL_INTERLACE,k+1)
print " *",valueI[:nbOfComp]
print ""
- fieldintdiv = fieldint / fieldint2
- print "Test of the division of two integer fields with creation a new one"
- print ""
- name = fieldintdiv.getName()
- desc = fieldintdiv.getDescription()
- nbOfComp = fieldintdiv.getNumberOfComponents()
- print " Field",name," : ",desc
- print " Number Of Components:",nbOfComp
- iterationNb = fieldintdiv.getIterationNumber()
- orderNb = fieldintdiv.getOrderNumber()
- time = fieldintdiv.getTime()
- print " Iteration Number",iterationNb
- print " Order Number",orderNb
- print " Time",time
- for k in range(nbOfComp):
- kp1 = k+1
- compName = fieldintdiv.getComponentName(kp1)
- compDesc = fieldintdiv.getComponentDescription(kp1)
- compUnit = fieldintdiv.getMEDComponentUnit(kp1)
- print " * Component:",kp1
- print " Name:",compName
- print " Description:",compDesc
- print " Unit:",compUnit
-
- support = fieldintdiv.getSupport()
- nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
- print " Values:",nbOf
- for k in range(nbOf):
- valueI = fieldintdiv.getValueI(MED_FULL_INTERLACE,k+1)
- print " *",valueI[:nbOfComp]
- print ""
- print "TESTS OPERATIONS SUR FIELDINT : "
+ try:
+ fieldintdiv = fieldint / fieldint2
+ print "Test of the division of two integer fields with creation a new one"
+ print ""
+ name = fieldintdiv.getName()
+ desc = fieldintdiv.getDescription()
+ nbOfComp = fieldintdiv.getNumberOfComponents()
+ print " Field",name," : ",desc
+ print " Number Of Components:",nbOfComp
+ iterationNb = fieldintdiv.getIterationNumber()
+ orderNb = fieldintdiv.getOrderNumber()
+ time = fieldintdiv.getTime()
+ print " Iteration Number",iterationNb
+ print " Order Number",orderNb
+ print " Time",time
+ for k in range(nbOfComp):
+ kp1 = k+1
+ compName = fieldintdiv.getComponentName(kp1)
+ compDesc = fieldintdiv.getComponentDescription(kp1)
+ compUnit = fieldintdiv.getMEDComponentUnit(kp1)
+ print " * Component:",kp1
+ print " Name:",compName
+ print " Description:",compDesc
+ print " Unit:",compUnit
+
+ support = fieldintdiv.getSupport()
+ nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
+ print " Values:",nbOf
+ for k in range(nbOf):
+ valueI = fieldintdiv.getValueI(MED_FULL_INTERLACE,k+1)
+ print " *",valueI[:nbOfComp]
+ print ""
+ print "TESTS OPERATIONS SUR FIELDINT : "
+ except:
+ print "testMedMemGeneral fieldintdiv = fieldint / fieldint2 catch/except error"
fieldintadd = fieldint+fieldint2
fieldintsub = fieldint-fieldint2
fieldintmul = fieldint*fieldint2
- fieldintdiv = fieldint/fieldint2
+ try:
+ fieldintdiv = fieldint/fieldint2
+ except:
+ fieldintdiv = None
+ print "testMedMemGeneral fieldintdiv = fieldint/fieldint2 catch/except error"
fieldintasso = fieldint+fieldint*fieldint
fieldintSP=createFieldIntScalarProduct(fieldint, fieldint2)
print " + : ",fieldintadd.getValue(MED_FULL_INTERLACE)
print " - : ",fieldintsub.getValue(MED_FULL_INTERLACE)
print " * : ",fieldintmul.getValue(MED_FULL_INTERLACE)
- print " / : ",fieldintdiv.getValue(MED_FULL_INTERLACE)
+ if fieldintdiv == None :
+ print "testMedMemGeneral / : None"
+ else:
+ print " / : ",fieldintdiv.getValue(MED_FULL_INTERLACE)
fieldint+=fieldint2;
print " += : ",fieldint.getValue(MED_FULL_INTERLACE)
fieldint-=fieldint2;
print " -= : ",fieldint.getValue(MED_FULL_INTERLACE)
fieldint*=fieldint2;
print " *= : ",fieldint.getValue(MED_FULL_INTERLACE)
- fieldint/=fieldint2;
- print " /= : ",fieldint.getValue(MED_FULL_INTERLACE)
+ try:
+ fieldint/=fieldint2;
+ print " /= : ",fieldint.getValue(MED_FULL_INTERLACE)
+ except :
+ fieldint = None
+ print " /= : Catch/Except : None"
print "f1+f2*f2: ",fieldintasso.getValue(MED_FULL_INTERLACE)
- fieldint.applyLin(4,1);
- print " 4f1+1 : ",fieldint.getValue(MED_FULL_INTERLACE)
+ if fieldint != None :
+ fieldint.applyLin(4,1);
+ print " 4f1+1 : ",fieldint.getValue(MED_FULL_INTERLACE)
print " f1.f2 : ",fieldintSP.getValue(MED_FULL_INTERLACE)
fieldint2.applyPyFunc(add_one)
print " CB:f2+1: ",fieldint2.getValue(MED_FULL_INTERLACE)
valueI = fielddoublemul.getValueI(MED_FULL_INTERLACE,k+1)
print " *",valueI[:nbOfComp]
print ""
- fielddoublediv = fielddouble / fielddouble2
- print "Test of the division of two double fields with creation a new one"
- print ""
- name = fielddoublediv.getName()
- desc = fielddoublediv.getDescription()
- nbOfComp = fielddoublediv.getNumberOfComponents()
- print " Field",name," : ",desc
- print " Number Of Components:",nbOfComp
- iterationNb = fielddoublediv.getIterationNumber()
- orderNb = fielddoublediv.getOrderNumber()
- time = fielddoublediv.getTime()
- print " Iteration Number",iterationNb
- print " Order Number",orderNb
- print " Time",time
- for k in range(nbOfComp):
- kp1 = k+1
- compName = fielddoublediv.getComponentName(kp1)
- compDesc = fielddoublediv.getComponentDescription(kp1)
- compUnit = fielddoublediv.getMEDComponentUnit(kp1)
- print " * Component:",kp1
- print " Name:",compName
- print " Description:",compDesc
- print " Unit:",compUnit
-
- support = fielddoublediv.getSupport()
- nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
- print " Values:",nbOf
- for k in range(nbOf):
- valueI = fielddoublediv.getValueI(MED_FULL_INTERLACE,k+1)
- print " *",valueI[:nbOfComp]
+ try:
+ fielddoublediv = fielddouble / fielddouble2
+ print "Test of the division of two double fields with creation a new one"
+ print ""
+ name = fielddoublediv.getName()
+ desc = fielddoublediv.getDescription()
+ nbOfComp = fielddoublediv.getNumberOfComponents()
+ print " Field",name," : ",desc
+ print " Number Of Components:",nbOfComp
+ iterationNb = fielddoublediv.getIterationNumber()
+ orderNb = fielddoublediv.getOrderNumber()
+ time = fielddoublediv.getTime()
+ print " Iteration Number",iterationNb
+ print " Order Number",orderNb
+ print " Time",time
+ for k in range(nbOfComp):
+ kp1 = k+1
+ compName = fielddoublediv.getComponentName(kp1)
+ compDesc = fielddoublediv.getComponentDescription(kp1)
+ compUnit = fielddoublediv.getMEDComponentUnit(kp1)
+ print " * Component:",kp1
+ print " Name:",compName
+ print " Description:",compDesc
+ print " Unit:",compUnit
+
+ support = fielddoublediv.getSupport()
+ nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
+ print " Values:",nbOf
+ for k in range(nbOf):
+ valueI = fielddoublediv.getValueI(MED_FULL_INTERLACE,k+1)
+ print " *",valueI[:nbOfComp]
+ except:
+ print "testMedMemGeneral fielddoublediv = fielddouble / fielddouble2 catch/except error"
+
print ""
print "TESTS OPERATIONS SUR FIELDDOUBLE : "
fielddoublesub = fielddouble-fielddouble2
fielddoublemul = fielddouble*fielddouble2
- fielddoublediv = fielddouble/fielddouble2
+ try:
+ fielddoublediv = fielddouble/fielddouble2
+ except:
+ print "testMedMemGeneral /= : catch/except error"
+ fielddoublediv = None
fielddoubleasso = fielddouble+fielddouble2*fielddouble2
fielddoubleSP=createFieldDoubleScalarProduct(fielddouble, fielddouble2)
print " f1 : ",fielddouble.getValue(MED_FULL_INTERLACE)
print " + : ",fielddoubleadd.getValue(MED_FULL_INTERLACE)
print " - : ",fielddoublesub.getValue(MED_FULL_INTERLACE)
print " * : ",fielddoublemul.getValue(MED_FULL_INTERLACE)
- print " / : ",fielddoublediv.getValue(MED_FULL_INTERLACE)
-
+ if fielddoublediv != None:
+ print " / : ",fielddoublediv.getValue(MED_FULL_INTERLACE)
+ pass
fielddouble+=fielddouble2;
print " += : ",fielddouble.getValue(MED_FULL_INTERLACE)
fielddouble-=fielddouble2;
print " -= : ",fielddouble.getValue(MED_FULL_INTERLACE)
fielddouble*=fielddouble2;
print " *= : ",fielddouble.getValue(MED_FULL_INTERLACE)
- fielddouble/=fielddouble2;
- print " /= : ",fielddouble.getValue(MED_FULL_INTERLACE)
+ try:
+ fielddouble/=fielddouble2;
+ print " /= : ",fielddouble.getValue(MED_FULL_INTERLACE)
+ except:
+ print "testMedMemGeneral /= : "
print "f1+f2*f2: ",fielddoubleasso.getValue(MED_FULL_INTERLACE)
fielddouble.applyLin(4,1);
print " 4f1+1 : ",fielddouble.getValue(MED_FULL_INTERLACE)
@COMMENCE@
+ifeq (@WITHIHM@,yes)
SUBDIRS = MEDMEM MEDMEM_SWIG MEDMEM_I MED MEDGUI MedCorba_Swig MED_SWIG MedClient INTERPOLATION
+endif
+
+ifeq (@WITHIHM@,no)
+SUBDIRS = MEDMEM MEDMEM_SWIG MEDMEM_I MED MedCorba_Swig MED_SWIG MedClient INTERPOLATION
+
+endif
+
+LDFLAGS= -L$(top_builddir)/lib/salome
+LDFLAGSFORBIN= -L$(top_builddir)/lib/salome
@MODULE@
long iT, nT;
//convertCorbaArray<SALOME_MED::medGeometryElement>
// (Types, nT, IOR_Mesh->getTypes(Entity));
- convertCorbaArray<SALOME_MED::medGeometryElement>
+ convertCorbaArray<MED_EN::medGeometryElement,SALOME_MED::medGeometryElement_array *, long>
(Types, nT, &all->meshTypes);
ASSERT(nT == (int) getNumberOfTypes(Entity));
/*!
*/
//=============================================================================
-med_int CONNECTIVITYClient::getNumberOf(medEntityMesh Entity,
+int CONNECTIVITYClient::getNumberOf(medEntityMesh Entity,
medGeometryElement Type) const
{
BEGIN_OF("void CONNECTIVITYClient::getNumberOf()");
- med_int n = 0;
+ int n = 0;
SCRUTE(Type);
SCRUTE(Entity);
if (Type==MED_ALL_ELEMENTS)
n = _totalNumberOfElements_client;
- for (med_int i=0; i<_numberOfTypes; i++) {
+ for (int i=0; i<_numberOfTypes; i++) {
SCRUTE(_geometricTypes[i]);
if (_geometricTypes[i] == Type) {
n = _numberOfElements_client[i];
/*!
*/
//=============================================================================
-const med_int * CONNECTIVITYClient::getConnectivity
+const int * CONNECTIVITYClient::getConnectivity
(medConnectivity ConnectivityType,
medEntityMesh Entity,
medGeometryElement Type)
if (!_complete)
fillCopy();
- const med_int * c = CONNECTIVITY::getConnectivity
+ const int * c = CONNECTIVITY::getConnectivity
(ConnectivityType, Entity, Type);
END_OF("void CONNECTIVITYClient::getConnectivity()");
/*!
*/
//=============================================================================
-const med_int * CONNECTIVITYClient::getConnectivityIndex
+const int * CONNECTIVITYClient::getConnectivityIndex
(medConnectivity ConnectivityType,
medEntityMesh Entity)
{
if (!_complete)
fillCopy();
- const med_int *c = CONNECTIVITY::getConnectivityIndex
+ const int *c = CONNECTIVITY::getConnectivityIndex
(ConnectivityType, Entity);
END_OF("void CONNECTIVITYClient::getConnectivityIndex()");
/*!
*/
//=============================================================================
-const med_int * CONNECTIVITYClient::getReverseConnectivity
+const int * CONNECTIVITYClient::getReverseConnectivity
(medConnectivity ConnectivityType,
medEntityMesh Entity) throw (MEDEXCEPTION)
{
if (!_complete)
fillCopy();
- const med_int *c = CONNECTIVITY::getReverseConnectivity
+ const int *c = CONNECTIVITY::getReverseConnectivity
(ConnectivityType, Entity);
END_OF("void CONNECTIVITYClient::getReverseConnectivity()");
/*!
*/
//=============================================================================
-const med_int * CONNECTIVITYClient::getReverseConnectivityIndex
+const int * CONNECTIVITYClient::getReverseConnectivityIndex
(medConnectivity ConnectivityType,
medEntityMesh Entity) throw (MEDEXCEPTION)
{
if (!_complete)
fillCopy();
- const med_int *c = CONNECTIVITY::getReverseConnectivityIndex
+ const int *c = CONNECTIVITY::getReverseConnectivityIndex
(ConnectivityType, Entity);
END_OF("void CONNECTIVITYClient::getReverseConnectivityIndex()");
/*!
*/
//=============================================================================
-const med_int* CONNECTIVITYClient::getValue(medConnectivity TypeConnectivity,
+const int* CONNECTIVITYClient::getValue(medConnectivity TypeConnectivity,
medGeometryElement Type)
{
BEGIN_OF("void CONNECTIVITYClient::getValue()");
if (!_complete)
fillCopy();
- const med_int * c = CONNECTIVITY::getValue(TypeConnectivity, Type);
+ const int * c = CONNECTIVITY::getValue(TypeConnectivity, Type);
END_OF("void CONNECTIVITYClient::()");
/*!
*/
//=============================================================================
-const med_int* CONNECTIVITYClient::getValueIndex(medConnectivity TypeConnectivity)
+const int* CONNECTIVITYClient::getValueIndex(medConnectivity TypeConnectivity)
{
BEGIN_OF("void CONNECTIVITYClient::getValueIndex()");
if (!_complete)
fillCopy();
- const med_int * c = CONNECTIVITY::getValueIndex(TypeConnectivity);
+ const int * c = CONNECTIVITY::getValueIndex(TypeConnectivity);
END_OF("void CONNECTIVITYClient::getValueIndex()");
/*!
*/
//=============================================================================
-const med_int* CONNECTIVITYClient::getNeighbourhood() const
+const int* CONNECTIVITYClient::getNeighbourhood() const
{
BEGIN_OF("void CONNECTIVITYClient::getNeighbourhood()");
if (!_complete)
(const_cast<CONNECTIVITYClient *>(this))->fillCopy();
- const med_int * c = CONNECTIVITY::getNeighbourhood();
+ const int * c = CONNECTIVITY::getNeighbourhood();
END_OF("void CONNECTIVITYClient::getNeighbourhood()");
void fillCopy();
void blankCopy();
- med_int getNumberOf(medEntityMesh Entity, medGeometryElement Type) const;
+ int getNumberOf(medEntityMesh Entity, medGeometryElement Type) const;
- const med_int * getConnectivity (medConnectivity ConnectivityType,
+ const int * getConnectivity (medConnectivity ConnectivityType,
medEntityMesh Entity,
medGeometryElement Type);
- const med_int * getConnectivityIndex (medConnectivity ConnectivityType,
+ const int * getConnectivityIndex (medConnectivity ConnectivityType,
medEntityMesh Entity);
void calculateConnectivity (medConnectivity connectivityType,
bool existConnectivity(medConnectivity ConnectivityType,
medEntityMesh Entity) const;
- const med_int* getReverseConnectivity (medConnectivity ConnectivityType,
+ const int* getReverseConnectivity (medConnectivity ConnectivityType,
medEntityMesh Entity=MED_CELL)
throw (MEDEXCEPTION);
- const med_int* getReverseConnectivityIndex (medConnectivity ConnectivityType,
+ const int* getReverseConnectivityIndex (medConnectivity ConnectivityType,
medEntityMesh Entity=MED_CELL)
throw (MEDEXCEPTION);
- const med_int* getValue (medConnectivity TypeConnectivity,
+ const int* getValue (medConnectivity TypeConnectivity,
medGeometryElement Type);
- const med_int* getValueIndex (medConnectivity TypeConnectivity);
- const med_int* getNeighbourhood() const;
+ const int* getValueIndex (medConnectivity TypeConnectivity);
+ const int* getNeighbourhood() const;
};
};
#include "ReceiverFactory.hxx"
using namespace MEDMEM;
+using namespace MED_EN;
+
//=============================================================================
/*!
* Constructeur
Parameters in : m (Mesh Corba IOR)
mode (FULL_ or NO_ interlace)
*/
- COORDINATEClient(const SALOME_MED::MESH_ptr m, medModeSwitch Mode);
+ COORDINATEClient(const SALOME_MED::MESH_ptr m, MED_EN::medModeSwitch Mode);
/*!
virtual ~COORDINATEClient() {};
- virtual const double * getCoordinates(medModeSwitch Mode);
+ virtual const double * getCoordinates(MED_EN::medModeSwitch Mode);
virtual double getCoordinate(int Number,int Axis);
virtual const double * getCoordinateAxis(int Axis);
virtual const int* getNodesNumbers() const;
-//#include "ReceiverFactory.hxx"
-
-//using namespace MEDMEM;
-
template<class T1,class T2>
-FIELDClient<T1,T2>::FIELDClient(typename T2::_ptr_type ptrCorba,SUPPORT * S):_fieldPtr(T2::_duplicate(ptrCorba)),_ownSupport(false)
+FIELDClient<T1,T2>::FIELDClient(typename T2::_ptr_type ptrCorba,MEDMEM::SUPPORT * S):_fieldPtr(T2::_duplicate(ptrCorba)),_ownSupport(false)
{
if (!S)
{
_ownSupport=true;
- S=new SUPPORTClient(_fieldPtr->getSupport());
+ S=new MEDMEM::SUPPORTClient(_fieldPtr->getSupport());
}
- FIELD<T1>::setSupport(S);
+ MEDMEM::FIELD<T1>::setSupport(S);
setName(_fieldPtr->getName());
- FIELD<T1>::setDescription(_fieldPtr->getDescription());
+ MEDMEM::FIELD<T1>::setDescription(_fieldPtr->getDescription());
int nc = _fieldPtr->getNumberOfComponents();
- FIELD<T1>::setNumberOfComponents(nc);
+ MEDMEM::FIELD<T1>::setNumberOfComponents(nc);
- FIELD<T1>::setNumberOfValues( S->getNumberOfElements(MED_ALL_ELEMENTS));
+ MEDMEM::FIELD<T1>::setNumberOfValues( S->getNumberOfElements(MED_EN::MED_ALL_ELEMENTS));
string * _s = new string[nc];
s = _fieldPtr->getComponentsNames();
for (int i=0; i<nc; i++)
_s[i] = s[i];
- FIELD<T1>::setComponentsNames(_s);
+ MEDMEM::FIELD<T1>::setComponentsNames(_s);
s = _fieldPtr->getComponentsDescriptions();
for (int i=0; i<nc; i++)
_s[i] = s[i];
- FIELD<T1>::setComponentsDescriptions(_s);
+ MEDMEM::FIELD<T1>::setComponentsDescriptions(_s);
s = _fieldPtr->getComponentsUnits();
for (int i=0; i<nc; i++)
_s[i] = s[i];
- FIELD<T1>::setMEDComponentsUnits(_s);
+ MEDMEM::FIELD<T1>::setMEDComponentsUnits(_s);
delete [] _s;
//setValueType(typeChamps); WARNING TO DO.....
//setValueType(_fieldPtr->getValueType());
long n;
- T1 *v = (T1 *)ReceiverFactory::getValue(_fieldPtr->getSenderForValue(MED_FULL_INTERLACE),n);
- MEDARRAY<T1> * M = new MEDARRAY<T1>(v, FIELD<T1>::getNumberOfComponents(),FIELD<T1>::getNumberOfValues(),MED_FULL_INTERLACE,true,true);
+ T1 *v = (T1 *)ReceiverFactory::getValue(_fieldPtr->getSenderForValue(MED_EN::MED_FULL_INTERLACE),n);
+ MEDMEM::MEDARRAY<T1> * M = new MEDMEM::MEDARRAY<T1>(v, MEDMEM::FIELD<T1>::getNumberOfComponents(),MEDMEM::FIELD<T1>::getNumberOfValues(),MED_EN::MED_FULL_INTERLACE,true,true);
setValue(M);
}
_fieldPtr->release();
CORBA::release(_fieldPtr);
if(_ownSupport)
- delete FIELD<T1>::_support;
+ delete MEDMEM::FIELD<T1>::_support;
}
//exemple _FIELDClient<double,FIELDDOUBLE_ptr>
//_FIELDClient<int,FIELDINT_ptr>
template<class T1,class T2>
-class FIELDClient : public FIELD<T1>
+class FIELDClient : public MEDMEM::FIELD<T1>
{
private:
typename T2::_ptr_type _fieldPtr;
bool _ownSupport;
public:
- FIELDClient(typename T2::_ptr_type ptrCorba,SUPPORT * S = NULL);
+ FIELDClient(typename T2::_ptr_type ptrCorba,MEDMEM::SUPPORT * S = NULL);
~FIELDClient();
private:
void fillCopy();
*/
//=============================================================================
FIELDDOUBLEClient::FIELDDOUBLEClient(SALOME_MED::FIELDDOUBLE_ptr ptrCorba,
- SUPPORT * S) :
+ MEDMEM::SUPPORT * S) :
FIELDClient<double,SALOME_MED::FIELDDOUBLE>(ptrCorba,S)
{
BEGIN_OF("Constructor with arguments (for Python API) FIELDDOUBLEClient");
*/
//=============================================================================
FIELDINTClient::FIELDINTClient(SALOME_MED::FIELDINT_ptr ptrCorba,
- SUPPORT * S) :
+ MEDMEM::SUPPORT * S) :
FIELDClient<int,SALOME_MED::FIELDINT>(ptrCorba,S)
{
BEGIN_OF("Constructor with arguments (for Python API) FIELDINTClient");
#include "CONNECTIVITYClient.hxx"
#include "FAMILYClient.hxx"
#include "GROUPClient.hxx"
+
+using namespace MEDMEM;
+using namespace MED_EN;
+
//=============================================================================
/*!
* Constructeur
BIN_SERVER_IDL =
BIN_CLIENT_IDL =
+LDFLAGS= -L$(top_builddir)/lib/salome
+LDFLAGSFORBIN= -L$(top_builddir)/lib/salome
CPPFLAGS+= $(MED2_INCLUDES) $(HDF5_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CXXFLAGS+=-I${KERNEL_ROOT_DIR}/include/salome
#include "ReceiverFactory.hxx"
using namespace MEDMEM;
+using namespace MED_EN;
//=============================================================================
/*!
MEDSKYLINEARRAY * getnumber()
const throw (MEDEXCEPTION);
- const int * getNumber(medGeometryElement GeometricType)
+ const int * getNumber(MED_EN::medGeometryElement GeometricType)
const throw (MEDEXCEPTION);
const int * getNumberIndex()
const throw (MEDEXCEPTION);
#include CORBA_CLIENT_HEADER(MED)
/* #define FIELDDOUBLEClient FIELDClient<double,SALOME_MED::FIELDDOUBLE_ptr> */
/* #define FIELDINTClient FIELDClient<int,SALOME_MED::FIELDINT_ptr> */
+
+ using namespace MEDMEM;
+ using namespace MED_EN;
%}
%include "libMedCorba_Swig.i"
from omniORB import CORBA
from LifeCycleCORBA import *
-from libSALOME_Swig import *
+#CCRTfrom libSALOME_Swig import *
orb = CORBA.ORB_init([''], CORBA.ORB_ID)
lcc = LifeCycleCORBA(orb)
#include <typeinfo>
#include <iostream>
+using namespace MEDMEM;
+using namespace MED_EN;
+
Compo2::Compo2() : _F(NULL)
{
}
class Compo2
{
- FIELD<double> * _F;
+ MEDMEM::FIELD<double> * _F;
public:
Compo2();
~Compo2();
- std::string Calcul(const MESH &M);
- const FAMILY * Calcul2(const MESH &M);
- void Calcul3(const FIELD<double> &S);
+ std::string Calcul(const MEDMEM::MESH &M);
+ const MEDMEM::FAMILY * Calcul2(const MEDMEM::MESH &M);
+ void Calcul3(const MEDMEM::FIELD<double> &S);
};
#endif
LIB_SRC = Compo2.cxx
LIB_CLIENT_IDL= SALOME_Component.idl SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Exception.idl SALOME_Comm.idl MED.idl
+LDFLAGS= -L$(top_builddir)/lib/salome
+LDFLAGSFORBIN= -L$(top_builddir)/lib/salome
+
CPPFLAGS += ${MED2_INCLUDES} ${HDF5_INCLUDES} ${PYTHON_INCLUDES} -I${KERNEL_ROOT_DIR}/include/salome
LIBS = -L${KERNEL_ROOT_DIR}/lib/salome -lMEDClientcmodule -lMEDMEM_Swigcmodule -lmedmem -lMEDMEMImpl ${MED2_LIBS} ${HDF5_LIBS}
%{
#include "Compo2.hxx"
+
+ using namespace MEDMEM;
+ using namespace MED_EN;
%}
%include "std_string.i"
#############################################################################
+LDFLAGS= -L$(top_builddir)/lib/salome
+LDFLAGSFORBIN= -L$(top_builddir)/lib/salome
+
CPPFLAGS+= $(PYTHON_INCLUDES) $(MED2_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CXXFLAGS+=-ftemplate-depth-42 -I${KERNEL_ROOT_DIR}/include/salome
LIBS= $(PYTHON_LIBS)
#include "MEDMEM_Support_i.hxx"
#include "MEDMEM_SWIG_FieldDouble.hxx"
#include "MEDMEM_SWIG_FieldInt.hxx"
+
+ using namespace MEDMEM;
+ using namespace MED_EN;
%}
/*