From 4636fbbb4043bcc1e204c33d4c6b604f5968e43a Mon Sep 17 00:00:00 2001 From: nadir Date: Fri, 10 Mar 2006 18:48:19 +0000 Subject: [PATCH] Integration of EDF work --- idl/MED.idl | 13 - src/MEDMEM/DataTest/Data/maill.00.med | Bin 0 -> 154336 bytes src/MEDMEM/DataTest/Data/maill.00_nofield.med | Bin 0 -> 118480 bytes src/MEDMEM/DataTest/Data/maill.00_nomesh.med | Bin 0 -> 123984 bytes .../DataTest/Data/maill.00_without_seg2.med | Bin 0 -> 140856 bytes .../DataTest/Data/zzzz121b_without_tr6.med | Bin 0 -> 84656 bytes src/MEDMEM/MEDMEM_DriverTools.cxx | 3 - src/MEDMEM/MEDMEM_Family.cxx | 13 +- src/MEDMEM/MEDMEM_Field.cxx | 15 +- src/MEDMEM/MEDMEM_Field.hxx | 290 +++- src/MEDMEM/MEDMEM_FieldConvert.hxx | 1 + src/MEDMEM/MEDMEM_GaussLocalization.hxx | 180 ++ src/MEDMEM/MEDMEM_Group.cxx | 9 +- src/MEDMEM/MEDMEM_MEDMEMchampLire.cxx | 281 +++ src/MEDMEM/MEDMEM_MEDMEMchampLire.hxx | 27 + src/MEDMEM/MEDMEM_MEDMEMgaussEcr.cxx | 194 +++ src/MEDMEM/MEDMEM_MEDMEMgaussEcr.hxx | 24 + src/MEDMEM/MEDMEM_MEDMEMprofilEcr.cxx | 147 ++ src/MEDMEM/MEDMEM_MEDMEMprofilEcr.hxx | 23 + src/MEDMEM/MEDMEM_MedFieldDriver.hxx | 13 +- src/MEDMEM/MEDMEM_MedFieldDriver21.hxx | 20 +- src/MEDMEM/MEDMEM_MedFieldDriver22.hxx | 1501 ++++++++++++----- src/MEDMEM/MEDMEM_MedMeshDriver.hxx | 10 +- src/MEDMEM/MEDMEM_MedMeshDriver22.cxx | 29 +- src/MEDMEM/MEDMEM_Mesh.cxx | 7 - src/MEDMEM/MEDMEM_SetInterlacingType.hxx | 17 + src/MEDMEM/MEDMEM_SkyLineArray.cxx | 10 + src/MEDMEM/MEDMEM_SkyLineArray.hxx | 21 +- src/MEDMEM/MEDMEM_Support.cxx | 178 +- src/MEDMEM/MEDMEM_Support.hxx | 101 +- src/MEDMEM/MEDMEM_nArray.hxx | 94 +- src/MEDMEM/Makefile.in | 16 +- src/MEDMEM/checkScript | 74 + src/MEDMEM/test_GaussLocalization.cxx | 50 + src/MEDMEM/test_profil_MedFieldDriver.cxx | 234 +++ .../test_profil_gauss_MedFieldDriver.cxx | 443 +++++ src/MEDMEM_I/MEDMEM_Support_i.cxx | 52 - src/MedClient/src/FAMILYClient.cxx | 44 +- src/MedClient/src/MESHClient.cxx | 40 + src/MedClient/src/SUPPORTClient.cxx | 4 - 40 files changed, 3345 insertions(+), 833 deletions(-) create mode 100644 src/MEDMEM/DataTest/Data/maill.00.med create mode 100644 src/MEDMEM/DataTest/Data/maill.00_nofield.med create mode 100644 src/MEDMEM/DataTest/Data/maill.00_nomesh.med create mode 100644 src/MEDMEM/DataTest/Data/maill.00_without_seg2.med create mode 100644 src/MEDMEM/DataTest/Data/zzzz121b_without_tr6.med create mode 100644 src/MEDMEM/MEDMEM_GaussLocalization.hxx create mode 100644 src/MEDMEM/MEDMEM_MEDMEMchampLire.cxx create mode 100644 src/MEDMEM/MEDMEM_MEDMEMchampLire.hxx create mode 100644 src/MEDMEM/MEDMEM_MEDMEMgaussEcr.cxx create mode 100644 src/MEDMEM/MEDMEM_MEDMEMgaussEcr.hxx create mode 100644 src/MEDMEM/MEDMEM_MEDMEMprofilEcr.cxx create mode 100644 src/MEDMEM/MEDMEM_MEDMEMprofilEcr.hxx create mode 100644 src/MEDMEM/MEDMEM_SetInterlacingType.hxx create mode 100755 src/MEDMEM/checkScript create mode 100644 src/MEDMEM/test_GaussLocalization.cxx create mode 100644 src/MEDMEM/test_profil_MedFieldDriver.cxx create mode 100644 src/MEDMEM/test_profil_gauss_MedFieldDriver.cxx diff --git a/idl/MED.idl b/idl/MED.idl index 485fa6381..613e5aabf 100644 --- a/idl/MED.idl +++ b/idl/MED.idl @@ -678,19 +678,6 @@ Internal Corba method. SALOME::SenderInt getSenderForNumberIndex() raises (SALOME::SALOME_Exception); - /*! - Returns the number of Gauss points for this %medGeometryElement. - - \note - - Not defined if %SUPPORT is on MED_NODE. - - Not defined for MED_ALL_ELEMENTS %medGeometryElement type. - */ - long getNumberOfGaussPoint(in medGeometryElement geomElement) - raises (SALOME::SALOME_Exception); - - SALOME_MED::long_array getNumbersOfGaussPoint() - raises (SALOME::SALOME_Exception); - void getBoundaryElements() raises (SALOME::SALOME_Exception); /*! diff --git a/src/MEDMEM/DataTest/Data/maill.00.med b/src/MEDMEM/DataTest/Data/maill.00.med new file mode 100644 index 0000000000000000000000000000000000000000..34effd9249ab6542becf54224c27a1c73c9cb9e0 GIT binary patch literal 154336 zcmeHQ3w#vS)t`V$cyj1Mq`04b$r0(nYEmOLb&HH#1pmPaI@!K#D`8jFu0 zD$!~itlDU6O;Hi7x?_D1t?1VB)%Z@OwIH+&s2K6VH+RoD$VxhY5k2986I8a(l! zJ0~;U?LS5TR0@ZZL~edoK~Y(DW`1U2dR}Icl$l>tHZwh4au*h4<>nPh({s}OL9^3K zii)%|%CDIch)`Kvn3>76AzVq4I;BU!nM@vzj41@-q<(&`)BPW&)lbI#8ms^w4h^br z3Fse>vMsPuYkpLJTzDOLC<%Fp!5k5z2*gQ8>3HbUc*u@~zX2dBh>riF{DO=)=}0LN zeM$!b+FBNQo$;9KJ5AC#uhle>YFksy??I3-Pg9nxU8W zhOu}I>mgE-KLuu24AFe@rxp6$F6|C2c9hxdVabSl!rE|269 z033_QqIQ)>lH`GediY<|Z&tr;p0QQG={^nO6Ti$;bFM}k0-}DC@7G9g;-LpU5>als zmqG-Wtb06B`?2nm+Pr{}3Y?#WG7;r?l#@_ObfCMt!?&eD26klvmcyo<HVG`B7Tf3Fq{ z95#W+fM64zY_K|5`!T=*!!myc9s`5{L*ZE*(T{~OOG5)php6V}6rR8-Jb_bq0;li< zox)mrlLINPxl;q(5*q>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(sO=o$_h#^YHlugfFSWUseK1t=KHHjlz+&j`t2n}buf-%n@OxXH zmyt;kif6%FAho}OG3~uuAn|K%r>XbPa*QPns}`?pYHn#*z0zFLU|!m^xUs2WCGG(h zyR}hyOT)_gmZlX~n1$xq=Ir`aXSX!0YB8@;$CMdU>LKs!6-ydwy{nX>(x_;-tp19n z4G`b5vPoTD*09QKXo2weSJy9DNinLZ70o|b*|fB=#q^cVIXg75)SOya7`Hu?na+dp zfnAxPZ;n)F?51x=+7FHMh!g|_0YN|z5CjB)qZ5Jh+T;hgMKY;pNFOw^#Nw#myM9rPwMwwuLR>;oj^j!$s;o=9{{(@Op!a=Wt zeV6v@_6OSju2L+amE>Q#{oV7>ekaKU`!4N=Z#ZI)fwo`&KgbF82l@W5t;F^RNha8L zX+P|T9D5A3{rdk^Ot3%5?Jr(L3?`Xi-=+P$CEYdp8jiIMV~!WcUw@#~ zj^z6Lsok8fxG&3qt}?y+*#X?*xvw4Z^A)dejxow?TzCs@#u4^~%Tp)gSfefWEY!jb zu3lcXzuZpJ%PaTK4*31mJ}yQNb9v17c3P*cA*u7N!aL8-;xvD9|4qnO?*B^pLcaO^ G%J={7`)kzz literal 0 HcmV?d00001 diff --git a/src/MEDMEM/DataTest/Data/maill.00_nomesh.med b/src/MEDMEM/DataTest/Data/maill.00_nomesh.med new file mode 100644 index 0000000000000000000000000000000000000000..0edf163ff650732e306afe1b9343f8b7ff11e0c2 GIT binary patch literal 123984 zcmeHQ3qTar`k!4;0U;L4#7Da3BOhhRL&*6UiE1Iz2G<-*W# z$Dm+Szu+Okqk=aF2L^|A3^N}IGxZJ|6qXnkFr)~a22XUkinOF2d$+&kSah_MaO&e@ zSCfMTx(|#pLkL5ZHgq(>q|M=yeo6_TjY4J zR3)u24Kyzdpr43-BDDuu{G zheC%`TS0+L5S8vmgLq}8rH?cbYeJ;0ZhfF1Lp}2GA|YJWBP;}lQ%c#~>{Kia3rSGD14w=%Z^$Xw0;jqTYA6|I0G6d!1~EJp3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C%vuS{%vFY>V=_x_4ey1)0Ps|77YS53`_xA|Y?8%$p~c*I4h52yd!K;=#ruj+Mee9R{b z;-j7`4f6?vq>Rjr?2x1 zB|HDtJABlfoD!R0KrkQ}5DW+g1Opcs14j2xEEQ~Akptxx&ky+5^8-fu$bXON1Ltc( zAO58e{`rU^SZ`pekffSj?8pKBINu4{&-^i5_518-3n2D4)gNlZRa7!}G2jK(ot|}Z zjMszMt6M#P($408_`E57CpF#p_0}5TpPr|4InVXhWi;9avoT$n)U{z+sGPm1lnbVa zEutXa))}0zUf`_~M*Y6y0J|Qd-}l$w$>^^`6?s{QYM_5pg%kj`m3b(Y}jr zeE+7vPpIknme{{Ve#CfFD<{5uX29216jVOXvM2@g^%Vs;uH%2g-dwLJuo`Sgphvw7 zUX{nI(AQT5)ox`uD}WyPUm&jv%1qY2Dkw8q`>LSKWbLbhNccbGtAd={+4YJ9^tfJs zz*kVvSN-5~6ny(_%qu8p{64>&c~ubKW+$Mi!O-J67`!rtt#Ww2Qlq*0 zBllMY4Q5r){r0GrL4Sny9uw2)_Ri{6L6z(^2~sJbN4bRVRm$C86-0IKoX%bogx7;d zUv*!$m!*&o=y4qkbnmSlpAX#+;>mDxd(_K7_xQXvCgI+`=qrib-R`gEa`&g@ad*>p ziG3CJ7nuHtboQ^8@Ks=AY$@s~K0Lk>kbhr-NBs=08`h7Hmt<$<@LcC$C4CZ{>|cTzmHUHpEjRZ*317>7-uUL;Z{cgXvH$1eHI{GGYcV`0nFGkD zmuh40c=x6|Tvzjmmz<_vSzqI2*jf8Biifgk?5jq(R~&o&7g1a|udkY~&maEP7xo8M sJi#II&EMDJc{6Hfc%KH7$Ns#r`SbV7e9a%P_u1yp--q)xf7Jc|1MVtGEdT%j literal 0 HcmV?d00001 diff --git a/src/MEDMEM/DataTest/Data/maill.00_without_seg2.med b/src/MEDMEM/DataTest/Data/maill.00_without_seg2.med new file mode 100644 index 0000000000000000000000000000000000000000..0edfd8e2238c96a99fab7ed937e6bbb3c91a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*QTIdczikMV(2xkI ztKXvk2g2-sdk`y81gfpJ+Hk?SJWcP``|*tKVY& z@wak9?Y}e$>aY71psxN-?tju0sJGc^Qolw2As0zMbbq=g4N53Q?CSnEOo#fb5Owui z^q=2X3w8X9vY`GXL|y%zJpSc*P`?LJSHDI7`?L*x;4IYs+h#)j4F!O@`a8M*j!U6l z2~k(SMgMt!Ce;2bv!VWSL|y$I>_4r~Yvw_DcYFc^qbtv%KfS^nPsf!gPefh)9qbP^ zgT32>9eJ*C0nE=$2_V*@J|&?&)P1@@M0O6_oomxa+1PK&cclAuon8La9N3?1s|Wf+ z?WX?n_a}&V{QVZMU3+M5zNwc2LQ=o@@`9fe9j0EV`ssc&mCA>yJi_38T{e=z;o#@+ zg5%l#Z*Z912ci0@|5QH7i=O+N>C6mV;?vXoa6bT7Y>1)qll&b%U%Cs%&Fs06KU0Gd zLv44(qtI?IB42;U-+Pjb@`3jlS+)DUaNGS9wi_|jcK>Yheh%A>7;3x8FW~caRNlnb zidt+3B41vX6MoQX#yhf4x_lYgfsqY0U#<)0msLKZO-FxM!2O;n=ovFu;I)>geQ!+b zvuU&pq;!OI{|cliNp`xxA<3J6e>pEVt9dq%D>u~o`S+rST0f09H6zse`S-1dT0imr F{{vfAkK6zN literal 0 HcmV?d00001 diff --git a/src/MEDMEM/DataTest/Data/zzzz121b_without_tr6.med b/src/MEDMEM/DataTest/Data/zzzz121b_without_tr6.med new file mode 100644 index 0000000000000000000000000000000000000000..810e2f260231f468d29f90b3476d9017e2c8c463 GIT binary patch literal 84656 zcmeHQ2|!fE8-Iu?-is%u)$^e6UQiQL+u2}&MPOGD1k}JZg*3w(^Fl?%BSla|MO{e~ zuf#JvlBZ^(sZp9?TA6ugf6+|QJpMB~Gr*hO$AiFk;AneUw1RR<42EjB8-bf-x6Hha|^H0AmD< z@i1n09v#)Hv8gPu` zYQkf5E>S@Fh(Arr*c=^@rOm=6ZMaJ2dU%+Rf<3fPRBsIWfg#-dTkyl$TN=qal3Gy4 z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jdQW21ECh}%Z&d~DaW7l5pLf^s73oS z<1a1#xkb4BtVB#L+LsysU!@#>ToP{ANT@~o#T-AK&(c$HebIzk)F(3@EM4#m?}eD> zXgPnfxch??uTBL`6nUh#SRup-RM=abY{AiTJuPy?3A7yC=Q9N8#Ce6e{Br(!PraXX zL0XQE`&qAN+3RtO$%K~l{Im8{()G-=8Mhxns73oSc&2)ydMoLCmbD#A#uIAMz6}16 zPgyvWbo|C$SlWS5i}s)K_@npX_5q<5?aPdx`u9`^B^^JPi6yi4V`|aawBykUy&$)iB~ z$L@3EQJb%;%!hskbT!4n>ndMN$+)Tf-@U$q*KMTUXH&nM0pIs6Xa~1P`>is!j`kCR z%}4b5n~t*{Ohp=_T^%uS$TeyDu+zZ`qm*Z*ul+y9i z`;I|c{5%QmKOHaiZ`kiel@wppzF9d>UD5a3U#A@+9WQCW+3#1e?fc2t1-(zo$`!ZY zRDW^geJ~@TY<<33Z}SMH_J62P_yv*JUa$Y5VMZ10`*r>i_?)v4`yd literal 0 HcmV?d00001 diff --git a/src/MEDMEM/MEDMEM_DriverTools.cxx b/src/MEDMEM/MEDMEM_DriverTools.cxx index e3b468a64..2c79b6bd0 100644 --- a/src/MEDMEM/MEDMEM_DriverTools.cxx +++ b/src/MEDMEM/MEDMEM_DriverTools.cxx @@ -748,9 +748,6 @@ _intermediateMED::getGroups(vector & _groupCell, new_group->setEntity(groupe_entity); new_group->setAll(mailleSet.size() == maillage.size()); - vector nbGaussPnt( nb_geometric_types, 1 ); - new_group->setNumberOfGaussPoint( &nbGaussPnt[0] ); - vect_group->push_back(new_group); delete [] tab_types_geometriques; diff --git a/src/MEDMEM/MEDMEM_Family.cxx b/src/MEDMEM/MEDMEM_Family.cxx index 5c55b1167..ec1fd330c 100644 --- a/src/MEDMEM/MEDMEM_Family.cxx +++ b/src/MEDMEM/MEDMEM_Family.cxx @@ -166,7 +166,7 @@ FAMILY::FAMILY(MESH* Mesh, int Identifier, string Name, int NumberOfAttribute, Find = build(MED_FACE,MEDArrayFaceFamily) ; } } - + // on edge ? if (!Find) { if ((_mesh->existConnectivity(MED_NODAL,MED_EDGE))|(_mesh->existConnectivity(MED_DESCENDING,MED_EDGE))) { @@ -180,14 +180,7 @@ FAMILY::FAMILY(MESH* Mesh, int Identifier, string Name, int NumberOfAttribute, _numberOfGeometricType = 0 ; _isOnAllElts = false ; MESSAGE ("FAMILY() : No entity found !") ; - } - // already done by support !!!! -// else { // set gauss point number to be equal one ! -// _numberOfGaussPoint = new int[_numberOfGeometricType] ; -// for (int i=0; i<_numberOfGeometricType; i++) -// _numberOfGaussPoint[i]=1 ; -// } - + } MESSAGE("Well now ??? :::"); @@ -210,7 +203,7 @@ FAMILY::FAMILY(MESH* Mesh, int Identifier, string Name, int NumberOfAttribute, } } else MESSAGE("Is on all entities !"); - + }; diff --git a/src/MEDMEM/MEDMEM_Field.cxx b/src/MEDMEM/MEDMEM_Field.cxx index 7d1dcee16..12390d5e5 100644 --- a/src/MEDMEM/MEDMEM_Field.cxx +++ b/src/MEDMEM/MEDMEM_Field.cxx @@ -126,7 +126,7 @@ FIELD_::FIELD_(const FIELD_ &m) } FIELD_::~FIELD_() -{ +{ MESSAGE("~FIELD_()"); if ( _componentsTypes !=NULL) delete[] _componentsTypes ; @@ -216,14 +216,11 @@ void FIELD_::_checkNormCompatibility(const FIELD* support_volume) const throw MEDEXCEPTION(diagnosis.c_str()); } - const int* nbGauss=getSupport()->getNumberOfGaussPoint(); - for (int i=0; igetNumberOfTypes(); ++i) - if(nbGauss[i]!=1) - { - diagnosis="Cannot compute Lnorm of "+getName()+ - " : Gauss numbers greater than one are not yet implemented!"; - throw MEDEXCEPTION(diagnosis.c_str()); - } + if (getGaussPresence() ) { + diagnosis="Cannot compute Lnorm of "+getName()+ + " : Gauss numbers greater than one are not yet implemented!"; + throw MEDEXCEPTION(diagnosis.c_str()); + } if(support_volume) // if the user has supplied the volume { diff --git a/src/MEDMEM/MEDMEM_Field.hxx b/src/MEDMEM/MEDMEM_Field.hxx index d3c0f1148..758310753 100644 --- a/src/MEDMEM/MEDMEM_Field.hxx +++ b/src/MEDMEM/MEDMEM_Field.hxx @@ -26,6 +26,7 @@ #define FIELD_HXX #include +#include #include #include #include @@ -38,7 +39,9 @@ #include "MEDMEM_nArray.hxx" #include "MEDMEM_GenDriver.hxx" #include "MEDMEM_ArrayInterface.hxx" +#include "MEDMEM_SetInterlacingType.hxx" #include "MEDMEM_FieldForward.hxx" +#include "MEDMEM_GaussLocalization.hxx" /*! @@ -58,15 +61,8 @@ namespace MEDMEM { template < > struct SET_VALUE_TYPE { static const MED_EN::med_type_champ _valueType = MED_EN::MED_INT32; }; - template < typename T > struct SET_INTERLACING_TYPE { - static const MED_EN::medModeSwitch _interlacingType = MED_EN::MED_UNDEFINED_INTERLACE; }; - template < > struct SET_INTERLACING_TYPE{ - static const MED_EN::medModeSwitch _interlacingType = MED_EN::MED_FULL_INTERLACE; }; - template < > struct SET_INTERLACING_TYPE { - static const MED_EN::medModeSwitch _interlacingType = MED_EN::MED_NO_INTERLACE; }; - class FIELD_ // GENERIC POINTER TO a template class FIELD -{ // ùpihjpmoçhmpç_hmù +{ protected: bool _isRead ; @@ -99,6 +95,8 @@ protected: /*! \if developper Number of field's values. + doesn't take care of _numberOfComponents + and number of Gauss points. \endif */ int _numberOfValues ; @@ -196,7 +194,6 @@ public: friend class MED_MED_RDONLY_DRIVER22; friend class MED_MED_WRONLY_DRIVER22; friend class MED_MED_RDWR_DRIVER22; - friend class VTK_MED_DRIVER; /*! @@ -228,7 +225,7 @@ public: virtual int addDriver( GENDRIVER & driver); virtual void read (const GENDRIVER &); virtual void read(int index=0); - virtual void openAppend( void ); + virtual void openAppend( void ); virtual void write(const GENDRIVER &); virtual void write(int index=0, const string & driverName=""); @@ -630,11 +627,16 @@ protected: typedef typename MEDMEM_ArrayInterface::Array ArrayGauss; typedef typename MEDMEM_ArrayInterface::Array ArrayNo; typedef typename MEDMEM_ArrayInterface::Array ArrayFull; - typedef MEDMEM_Array_ Array; + typedef MEDMEM_Array_ Array; + typedef T ElementType; + typedef INTERLACING_TAG InterlacingTag; + typedef map locMap; // array of value of type T Array *_value ; + map _gaussModel; //A changer quand les drivers seront template de l'entrelacement + static T _scalarForPow; static T pow(T x); @@ -731,8 +733,19 @@ public: inline const T* getRow(int i) const throw (MEDEXCEPTION); inline const T* getColumn(int j) const throw (MEDEXCEPTION); inline T getValueIJ(int i,int j) const throw (MEDEXCEPTION); + inline T getValueIJK(int i,int j,int k) const throw (MEDEXCEPTION); + bool getValueOnElement(int eltIdInSup,T* retValues) const throw (MEDEXCEPTION); + const int getNumberOfGeometricTypes() const throw (MEDEXCEPTION); + const GAUSS_LOCALIZATION & getGaussLocalization(MED_EN::medGeometryElement geomElement) const throw (MEDEXCEPTION); + const int * getNumberOfGaussPoints() const throw (MEDEXCEPTION); + const int getNumberOfGaussPoints( MED_EN::medGeometryElement geomElement) const throw (MEDEXCEPTION); + const int getNbGaussI(int i) const throw (MEDEXCEPTION); + const int * getNumberOfElements() const throw (MEDEXCEPTION); + const MED_EN::medGeometryElement * getGeometricTypes() const throw (MEDEXCEPTION); + bool isOnAllElements() const throw (MEDEXCEPTION); + inline void setArray(MEDMEM_Array_ *value) throw (MEDEXCEPTION); inline void setValue( T* value) throw (MEDEXCEPTION); inline void setRow( int i, T* value) throw (MEDEXCEPTION); @@ -873,7 +886,7 @@ template FIELD::FIELD(const { MESSAGE("Constructeur FIELD de recopie"); - // RECOPIE PROFOND Rmq from EF + // RECOPIE PROFONDE <> de l'operateur= Rmq from EF if (m._value != NULL) { if ( m.getGaussPresence() ) @@ -883,6 +896,12 @@ template FIELD::FIELD(const } else _value = (ArrayNoGauss *) NULL; + locMap::const_iterator it; + for ( it = m._gaussModel.begin();it != m._gaussModel.end(); it++ ) + _gaussModel[dynamic_cast * > ((*it).second)->getType()]= + new GAUSS_LOCALIZATION( + *dynamic_cast * > ( (*it).second ) + ); _valueType = m._valueType; _interlacingType = m._interlacingType; @@ -905,9 +924,18 @@ FIELD & FIELD::operator=(const FIELD &m) _value = m._value; //PROBLEME RECOPIE DES POINTEURS PAS COHERENT AVEC LE //CONSTRUCTEUR PAR RECOPIE - //CF :Commentaire dans MEDMEM_Array + //CF :Commentaire dans MEDMEM_Array + locMap::const_iterator it; + for ( it = m._gaussModel.begin();it != m._gaussModel.end(); it++ ) + _gaussModel[dynamic_cast * > ((*it).second)->getType()]= + new GAUSS_LOCALIZATION( + *dynamic_cast * > ( (*it).second ) + ); + _valueType = m._valueType; _interlacingType = m._interlacingType; + + return *this; } /*! @@ -1659,13 +1687,13 @@ double FIELD::normL2(int component, const FIELD * p_field_size=p_field_volume; if(!p_field_volume) // if the user don't supply the volume - p_field_size=_getFieldSize(); // we calculate the volume [PROVISOIRE, en attendant l'implémentation dans mesh] + p_field_size=_getFieldSize(); // we calculate the volume [PROVISOIRE, en attendant l'implémentation dans mesh] // get pointer to the element's volumes. MED_FULL_INTERLACE is the default mode for p_field_size const double* vol=p_field_size->getValue(); // Il n'est vraiment pas optimal de mixer des champs dans des modes d'entrelacement // different juste pour le calcul - + const T * value = NULL; ArrayNo * myArray = NULL; if ( getInterlacingType() == MED_EN::MED_NO_INTERLACE ) @@ -1920,7 +1948,7 @@ FIELD::FIELD(const SUPPORT * Support, provides the meshName related mesh but doesn't not set a mesh in the created support. */ -template +template FIELD::FIELD(driverTypes driverType, const string & fileName, const string & fieldDriverName, @@ -1966,6 +1994,10 @@ template FIELD::~FIELD() BEGIN_OF(" Destructeur FIELD::~FIELD()"); SCRUTE(this); if (_value) delete _value; + locMap::const_iterator it; + for ( it = _gaussModel.begin();it != _gaussModel.end(); it++ ) + delete (*it).second; + END_OF(" Destructeur FIELD::~FIELD()"); } @@ -1998,7 +2030,7 @@ void FIELD::allocValue(const int NumberOfComponents) _numberOfValues = _support->getNumberOfElements(MED_EN::MED_ALL_ELEMENTS); MESSAGE(LOC <<" : "<<_numberOfValues <<" et "<< NumberOfComponents); - //EF : A modifier lors de l'intégration de la classe de localisation des points de gauss + //EF : A modifier lors de l'intégration de la classe de localisation des points de gauss _value = new ArrayNoGauss(_numberOfComponents,_numberOfValues); _isRead = true ; @@ -2039,7 +2071,7 @@ void FIELD::allocValue(const int NumberOfComponents, MESSAGE("FIELD : constructeur : "< bool FIELD::getValueOnElement(int eltIdInSup,T* retValues) const throw (MEDEXCEPTION) { -// retValues = getRow(eltIdInSup); if(eltIdInSup<1) return false; @@ -2356,7 +2387,7 @@ inline MEDMEM_Array_ * FIELD::getArray() const throw (MEDEXC END_OF(LOC); return _value ; } -template inline +template inline typename MEDMEM_ArrayInterface::Array * FIELD::getArrayGauss() const throw (MEDEXCEPTION) { @@ -2373,7 +2404,7 @@ FIELD::getArrayGauss() const throw (MEDEXCEPTION) } -template inline +template inline typename MEDMEM_ArrayInterface::Array * FIELD::getArrayNoGauss() const throw (MEDEXCEPTION) { @@ -2394,25 +2425,28 @@ template inline bool FIELD::getGaussPresence() const throw (MEDEXCEPTION) { const char * LOC = "FIELD::getGaussPresence() const :"; - BEGIN_OF(LOC); + //BEGIN_OF(LOC); if (_value != NULL) return _value->getGaussPresence(); else throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Can't call getGaussPresence on a null _value")); - END_OF(LOC); + //END_OF(LOC); } /*! Return the actual length of the reference to values array returned by getValue. + Take care of number of components and number of Gauss points by geometric type */ template inline int FIELD::getValueLength() const throw (MEDEXCEPTION) { - // be carefull about number of gauss point - return _numberOfComponents*_numberOfValues; + if ( getGaussPresence() ) + return dynamic_cast(_value)->getArraySize() ; + else + return dynamic_cast(_value)->getArraySize() ; } /*! @@ -2433,15 +2467,15 @@ inline const T* FIELD::getValue() const throw (MEDEXCEPTION) of FIELD values array. If a faster accessor is intended you may use getArray() once, then MEDMEM_Array accessors. - Be careful if field support is not on all elements you might - have to use support->getValIndFromGlobalNumber(i). + Be careful if field support is not on all elements getRow + use support->getValIndFromGlobalNumber(i). */ template inline const T* FIELD::getRow(int i) const throw (MEDEXCEPTION) { const char * LOC = "FIELD::getRow(int i) : "; - BEGIN_OF(LOC); + //BEGIN_OF(LOC); int valIndex=-1; if (_support) @@ -2449,11 +2483,12 @@ FIELD::getRow(int i) const throw (MEDEXCEPTION) else throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not define |" )); + //cout << endl << "getRow Valindex : " << valIndex << endl; if ( getGaussPresence() ) - return dynamic_cast(_value)->getRow(valIndex) ; + return static_cast(_value)->getRow(valIndex) ; else - return dynamic_cast(_value)->getRow(valIndex) ; - END_OF(LOC); + return static_cast(_value)->getRow(valIndex) ; + //END_OF(LOC); } /*! @@ -2464,11 +2499,11 @@ template inline const T* FIELD::getColumn(int j) const throw (MEDEXCEPTION) { const char * LOC ="FIELD::getColumn(int j) : "; - BEGIN_OF(LOC); + //BEGIN_OF(LOC); if ( getGaussPresence() ) - return dynamic_cast(_value)->getColumn(j) ; + return static_cast(_value)->getColumn(j) ; else - return dynamic_cast(_value)->getColumn(j) ; + return static_cast(_value)->getColumn(j) ; } /*! @@ -2477,19 +2512,181 @@ FIELD::getColumn(int j) const throw (MEDEXCEPTION) template inline T FIELD::getValueIJ(int i,int j) const throw (MEDEXCEPTION) { const char * LOC = "getValueIJ(..)"; - BEGIN_OF(LOC); + //BEGIN_OF(LOC); int valIndex=-1; if (_support) valIndex = _support->getValIndFromGlobalNumber(i); else - throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not define |" )); + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" )); if ( getGaussPresence() ) - return dynamic_cast(_value)->getIJ(valIndex,j) ; + return static_cast(_value)->getIJ(valIndex,j) ; + else + return static_cast(_value)->getIJ(valIndex,j) ; +} + +/*! + Return the j^{th} component of k^{th} gauss points of i^{th} value. +*/ +template inline T FIELD::getValueIJK(int i,int j,int k) const throw (MEDEXCEPTION) +{ + const char * LOC = "getValueIJK(..)"; + //BEGIN_OF(LOC); + int valIndex=-1; + if (_support) + valIndex = _support->getValIndFromGlobalNumber(i); + else + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" )); + + if ( getGaussPresence() ) + return static_cast(_value)->getIJK(valIndex,j,k) ; + else + return static_cast(_value)->getIJK(valIndex,j,k) ; +} + + +template const int FIELD::getNumberOfGeometricTypes() const throw (MEDEXCEPTION) +{ + const char * LOC = "getNumberOfGeometricTypes(..)"; + BEGIN_OF(LOC); + if (_support) + return _support->getNumberOfTypes(); + else + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" )); + END_OF(LOC); +}; + + +template const GAUSS_LOCALIZATION & +FIELD::getGaussLocalization(MED_EN::medGeometryElement geomElement) const throw (MEDEXCEPTION) +{ + const char * LOC ="getGaussLocalization(MED_EN::medGeometryElement geomElement) : "; + const GAUSS_LOCALIZATION_ * locPtr=0; + + locMap::const_iterator it; + if ( ( it = _gaussModel.find(geomElement)) != _gaussModel.end() ) { + locPtr = (*it).second; + return *static_cast *>(locPtr); + } + else + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Can't find any GaussLocalization on this geometric type" )); + +}; + +/*! + Returns number of Gauss points for this medGeometryElement. + + Note : + if there is no GAUSS_LOCALIZATION having this medGeometryElement but + the medGeometryElement exist in the SUPPORT, getNumberOfGaussPoints + return 1 +*/ +template const int FIELD::getNumberOfGaussPoints(MED_EN::medGeometryElement geomElement) const + throw (MEDEXCEPTION) +{ + const char * LOC ="getNumberOfGaussPoints(MED_EN::medGeometryElement geomElement) : "; + const GAUSS_LOCALIZATION_ * locPtr=0; + + locMap::const_iterator it; + if ( ( it = _gaussModel.find(geomElement)) != _gaussModel.end() ) { + locPtr = (*it).second; + return static_cast *>(locPtr)->getNbGauss(); + } else - return dynamic_cast(_value)->getIJ(valIndex,j) ; + if (_support) + try { + if ( _support->getNumberOfElements(geomElement) ) return 1; + } catch ( MEDEXCEPTION & ex) { + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<< "GeometricType not found !" )) ; + } + else + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" )); + + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Should never execute this!" )); + +} + +/*! + Returns number of Gauss points for each geometric type. + + Note : + if there is no gauss points whatever the geometric type is + it returns an exception. (renvoyer un tableau de 1 ?) +*/ +template const int * FIELD::getNumberOfGaussPoints() const + throw (MEDEXCEPTION) +{ + const char * LOC ="const int * getNumberOfGaussPoints(MED_EN::medGeometryElement geomElement) : "; + + if (_value) + if ( getGaussPresence() ) { + return dynamic_cast(_value)->getNbGaussGeo()+1; + } else + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"value hasn't Gauss points " )); + + else + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Value not defined" )); } +/*! + Returns number of Gauss points for element n°i. + The i index is a global index (take care of previous element + on different geometric type). +*/ +template const int FIELD::getNbGaussI(int i) const throw (MEDEXCEPTION) +{ + const char * LOC = "getNbGaussI(..)"; +// BEGIN_OF(LOC); + + int valIndex=-1; + if (_support) + valIndex = _support->getValIndFromGlobalNumber(i); + else + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" )); + + if (_value) + if ( getGaussPresence() ) + return static_cast(_value)->getNbGauss(valIndex) ; + else + return static_cast(_value)->getNbGauss(valIndex) ; + else + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"_value not defined" )); +// END_OF(LOC); +}; + +template const int * FIELD::getNumberOfElements() const throw (MEDEXCEPTION) +{ + const char * LOC = "getNumberOfElements(..)"; + BEGIN_OF(LOC); + if (_support) + return _support->getNumberOfElements(); + else + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" )); + END_OF(LOC); +}; + +template const MED_EN::medGeometryElement * FIELD::getGeometricTypes() const throw (MEDEXCEPTION) +{ + const char * LOC = "getGeometricTypes(..)"; + BEGIN_OF(LOC); + if (_support) + return _support->getTypes(); + else + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" )); + END_OF(LOC); +}; +template bool FIELD::isOnAllElements() const throw (MEDEXCEPTION) +{ + const char * LOC = "isOnAllElements(..)"; + BEGIN_OF(LOC); + if (_support) + return _support->isOnAllElements(); + else + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not defined" )); + END_OF(LOC); +}; + + /*! Copy new values array in FIELD according to the given mode. @@ -2508,20 +2705,19 @@ template inline void FIELD::s according to specified mode. */ template -inline void FIELD::setRow( int i, T* value) throw (MEDEXCEPTION) +inline void FIELD::setRow( int i, T* value) throw (MEDEXCEPTION) { const char * LOC = "FIELD::setRow(int i, T* value) : "; int valIndex=i; -// JE (NB) NE SUIS PAS SUR DE CA ???? if (_support) valIndex = _support->getValIndFromGlobalNumber(i); else throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not define |" )); if ( getGaussPresence() ) - return dynamic_cast(_value)->setRow(valIndex, value) ; + return static_cast(_value)->setRow(valIndex, value) ; else - return dynamic_cast(_value)->setRow(valIndex, value) ; + return static_cast(_value)->setRow(valIndex, value) ; } /*! @@ -2529,12 +2725,12 @@ inline void FIELD::setRow( int i, T* value) throw (MEDEXCEPTI according to specified mode. */ template -inline void FIELD::setColumn( int i, T* value) throw (MEDEXCEPTION) +inline void FIELD::setColumn( int j, T* value) throw (MEDEXCEPTION) { if ( getGaussPresence() ) - return dynamic_cast(_value)->setColumn(i, value) ; + return static_cast(_value)->setColumn(j, value) ; else - return dynamic_cast(_value)->setColumn(i, value) ; + return static_cast(_value)->setColumn(j, value) ; } /*! @@ -2550,9 +2746,9 @@ template inline void FIELD::s throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Support not define |" )); if ( getGaussPresence() ) - return dynamic_cast(_value)->setIJ(valIndex,j,value) ; + return static_cast(_value)->setIJ(valIndex,j,value) ; else - return dynamic_cast(_value)->setIJ(valIndex,j,value) ; + return static_cast(_value)->setIJ(valIndex,j,value) ; } /* diff --git a/src/MEDMEM/MEDMEM_FieldConvert.hxx b/src/MEDMEM/MEDMEM_FieldConvert.hxx index f0e944366..1474ad15d 100644 --- a/src/MEDMEM/MEDMEM_FieldConvert.hxx +++ b/src/MEDMEM/MEDMEM_FieldConvert.hxx @@ -6,6 +6,7 @@ #include "MEDMEM_ArrayConvert.hxx" namespace MEDMEM { +class FIELD_; template FIELD * FieldConvert(const FIELD & field ) diff --git a/src/MEDMEM/MEDMEM_GaussLocalization.hxx b/src/MEDMEM/MEDMEM_GaussLocalization.hxx new file mode 100644 index 000000000..5f6a3436c --- /dev/null +++ b/src/MEDMEM/MEDMEM_GaussLocalization.hxx @@ -0,0 +1,180 @@ +#ifndef GAUSS_LOCALIZATION_HXX +#define GAUSS_LOCALIZATION_HXX + +#include +#include "MEDMEM_define.hxx" +#include "MEDMEM_Exception.hxx" +#include "MEDMEM_ArrayInterface.hxx" +#include "MEDMEM_nArray.hxx" +#include "MEDMEM_DriversDef.hxx" +#include "MEDMEM_SetInterlacingType.hxx" + +using namespace std; +using namespace MEDMEM; +using namespace MED_EN; + +namespace MEDMEM { + + class GAUSS_LOCALIZATION_ { + public: + virtual MED_EN::medModeSwitch getInterlacingType() const {return MED_EN::MED_UNDEFINED_INTERLACE;} + virtual ~GAUSS_LOCALIZATION_() {}; //Indispensable pour détruire le vrai objet pointé + }; + + template class GAUSS_LOCALIZATION; + + template ostream & operator<< (ostream &os, + const GAUSS_LOCALIZATION &loc); + + template class GAUSS_LOCALIZATION : public GAUSS_LOCALIZATION_{ + public: + typedef typename MEDMEM_ArrayInterface::Array ArrayNoGauss; + + protected: + + string _locName; + MED_EN::medGeometryElement _typeGeo; + int _nGauss; + ArrayNoGauss _cooRef; + ArrayNoGauss _cooGauss; + vector _wg; + MED_EN::medModeSwitch _interlacingType; + + public: + friend ostream & operator<< (ostream &os, + const GAUSS_LOCALIZATION &loc); + + GAUSS_LOCALIZATION() throw (MEDEXCEPTION); + GAUSS_LOCALIZATION(const string & locName, + const MED_EN::medGeometryElement typeGeo, + const int nGauss, + const ArrayNoGauss & cooRef, + const ArrayNoGauss & cooGauss, + const vector & wg) throw (MEDEXCEPTION); + + GAUSS_LOCALIZATION(const string & locName, + const MED_EN::medGeometryElement typeGeo, + const int nGauss, + const double * const cooRef, + const double * const cooGauss, + const double * const wg) throw (MEDEXCEPTION); + + //GAUSS_LOCALIZATION(const GAUSS_LOCALIZATION & loc); constructeur de recopie par défaut correct + virtual ~GAUSS_LOCALIZATION() {}; + GAUSS_LOCALIZATION & operator=(const GAUSS_LOCALIZATION & gaussLoc); + bool operator == (const GAUSS_LOCALIZATION &loc) const; + + string getName() const {return _locName;} + MED_EN::medGeometryElement getType() const {return _typeGeo;} + int getNbGauss() const {return _nGauss;} + ArrayNoGauss getRefCoo () const {return _cooRef;} //Ces tableaux sont petits + ArrayNoGauss getGsCoo () const {return _cooGauss;} //Ces tableaux sont petits + vector getWeight () const {return _wg;} //Ces tableaux sont petits + inline MED_EN::medModeSwitch getInterlacingType() const { return _interlacingType;} + + }; + template GAUSS_LOCALIZATION::GAUSS_LOCALIZATION() throw (MEDEXCEPTION) : _typeGeo(MED_EN::MED_NONE), _nGauss(-1), + _interlacingType(_interlacingType( SET_INTERLACING_TYPE::_interlacingType)) {}; + template GAUSS_LOCALIZATION::GAUSS_LOCALIZATION(const string & locName, + const MED_EN::medGeometryElement typeGeo, + const int nGauss, + const ArrayNoGauss & cooRef, + const ArrayNoGauss & cooGauss, + const vector & wg) throw (MEDEXCEPTION) : + _locName(locName),_typeGeo(typeGeo),_nGauss(nGauss),_cooRef(cooRef),_cooGauss(cooGauss),_wg(wg), + _interlacingType(SET_INTERLACING_TYPE::_interlacingType) + { + const char * LOC = "GAUSS_LOCALIZATION(locName,typeGeo, nGauss, const ArrayNoGauss & cooRef,..) : "; + BEGIN_OF(LOC); + if (_cooRef.getDim() != _cooGauss.getDim() ) + throw MEDEXCEPTION( LOCALIZED( STRING(LOC) <<"cooRef and cooGaus must have the same number of components")) ; + + if (_cooRef.getArraySize() != (_typeGeo%100)*(_typeGeo/100) ) + throw MEDEXCEPTION( LOCALIZED( STRING(LOC) <<"cooRef size is " << _cooRef.getArraySize() + << " and should be (_typeGeo%100)*(_typeGeo/100) " + << (_typeGeo%100)*(_typeGeo/100))) ; + + if (_cooGauss.getArraySize() != _nGauss*(_typeGeo/100) ) + throw MEDEXCEPTION( LOCALIZED( STRING(LOC) <<"cooGauss must be of size nGauss*(_typeGeo/100) " + << _nGauss*(_typeGeo/100) )); + if (_wg.size() != _nGauss ) + throw MEDEXCEPTION( LOCALIZED( STRING(LOC) <<"wg must be of size nGauss " + << _nGauss )); + + END_OF(LOC); + }; + + template GAUSS_LOCALIZATION::GAUSS_LOCALIZATION(const string & locName, + const MED_EN::medGeometryElement typeGeo, + const int nGauss, + const double * const cooRef, + const double * const cooGauss, + const double * const wg) throw (MEDEXCEPTION) : + _locName(locName),_typeGeo(typeGeo),_nGauss(nGauss), + _cooRef(ArrayNoGauss(const_cast(cooRef),typeGeo/100,typeGeo%100)), + _cooGauss(ArrayNoGauss(const_cast(cooGauss),typeGeo/100,_nGauss)), + _wg(vector(wg,wg+nGauss)), + _interlacingType(SET_INTERLACING_TYPE::_interlacingType) + { + const char * LOC = "GAUSS_LOCALIZATION(locName,typeGeo, nGauss, const double * cooRef,..) :"; + BEGIN_OF(LOC); + if (_cooRef.getDim() != _cooGauss.getDim() ) + throw MEDEXCEPTION( LOCALIZED( STRING(LOC) <<"cooRef and cooGaus must have the same number of components")) ; + + if (_cooRef.getArraySize() != (_typeGeo%100)*(_typeGeo/100) ) + throw MEDEXCEPTION( LOCALIZED( STRING(LOC) <<"cooRef must be of size (_typeGeo%100)*(_typeGeo/100) " + << (_typeGeo%100)*(_typeGeo/100))) ; + + if (_cooGauss.getArraySize() != _nGauss*(_typeGeo/100) ) + throw MEDEXCEPTION( LOCALIZED( STRING(LOC) <<"cooGauss must be of size nGauss*(_typeGeo/100) " + << _nGauss*(_typeGeo/100) )); + if (_wg.size() != _nGauss ) + throw MEDEXCEPTION( LOCALIZED( STRING(LOC) <<"wg must be of size nGauss " + << _nGauss )); + END_OF(LOC); + }; + + template GAUSS_LOCALIZATION & + GAUSS_LOCALIZATION::operator=(const GAUSS_LOCALIZATION & gaussLoc) + { + if ( this == &gaussLoc) return *this; + + _locName = gaussLoc._locName; + _typeGeo = gaussLoc._typeGeo; + _nGauss = gaussLoc._nGauss; + _cooRef = ArrayNoGauss(gaussLoc._cooRef); //utilisation de la copie superficielle par défaut n'est pas une bonne idée + _cooGauss = ArrayNoGauss(gaussLoc._cooGauss); //dans l'opérateur = de MEDnArray + _wg = gaussLoc._wg; + + return *this; + } + + template bool + GAUSS_LOCALIZATION::operator == (const GAUSS_LOCALIZATION & gaussLoc) const { + return ( + _locName == gaussLoc._locName && + _typeGeo == gaussLoc._typeGeo && + _nGauss == gaussLoc._nGauss && + _cooRef == gaussLoc._cooRef && //utilisation de la copie superficielle par défaut n'est pas une bonne idée + _cooGauss == gaussLoc._cooGauss && //dans l'opérateur = de MEDnArray + _wg == gaussLoc._wg + ); + } + + + template ostream & MEDMEM::operator<<(ostream &os, + const GAUSS_LOCALIZATION &loc) { + os << "Localization Name : " << loc._locName << endl; + os << "Geometric Type : " << MED_EN::geoNames[loc._typeGeo]<< endl; + os << "Number Of GaussPoints : " << loc._nGauss << endl; + os << "Ref. Element Coords : " << endl << loc._cooRef << endl; + os << "Gauss points Coords : " << endl << loc._cooGauss << endl; + os << "Gauss points weigth : " << endl ; + for(int i=0; igetNumberOfTypes() ; // _geometricType = new medGeometryElement[_numberOfGeometricType]; // //_geometricTypeNumber = new int[_numberOfGeometricType] ; -// _numberOfGaussPoint = new int[_numberOfGeometricType] ; +// _numberOfGaussPoints = new int[_numberOfGeometricType] ; // _numberOfElements = new int[_numberOfGeometricType] ; // medGeometryElement * geometricType = myFamily->getTypes() ; // //int * geometricTypeNumber = myFamily->getGeometricTypeNumber() ; -// int * numberOfGaussPoint = myFamily->getNumberOfGaussPoint() ; +// int * numberOfGaussPoints = myFamily->getNumberOfGaussPoints() ; // for (int i=0 ; i<_numberOfGeometricType; i++) { // _geometricType[i]= geometricType[i] ; // // _geometricTypeNumber[i] = geometricTypeNumber[i] ; -// _numberOfGaussPoint[i] = numberOfGaussPoint[i] ; +// _numberOfGaussPoints[i] = numberOfGaussPoints[i] ; // _numberOfElements[i]=myFamily->getNumberOfElements(geometricType[i]); // } // _isOnAllElts = false ; diff --git a/src/MEDMEM/MEDMEM_MEDMEMchampLire.cxx b/src/MEDMEM/MEDMEM_MEDMEMchampLire.cxx new file mode 100644 index 000000000..84d2ca3f6 --- /dev/null +++ b/src/MEDMEM/MEDMEM_MEDMEMchampLire.cxx @@ -0,0 +1,281 @@ +#include "MEDMEM_MEDMEMchampLire.hxx" +/* + * En attendant une correction de la gestion du mode d'accès au fichier dans MEDfichier + * on intègre la correction ici. + */ + +namespace med_2_2 { + extern "C" { + +# define ICI { \ + fflush(stdout); \ + fprintf(stderr, "%s [%d] : " , __FILE__ , __LINE__ ) ; \ + fflush(stderr) ; \ + } + +# define ISCRUTE(entier) { \ + ICI ; \ + fprintf(stderr,"%s = %d\n",#entier,entier) ; \ + fflush(stderr) ; \ + } + +# define SSCRUTE(chaine) { \ + ICI ; \ + fprintf(stderr,"%s = \"%s\"\n",#chaine,chaine) ; \ + fflush(stderr) ; \ + } +# define MESSAGE(chaine) { \ + ICI ; \ + fprintf(stderr,"%s\n",chaine) ; \ + fflush(stderr) ; \ + } + + extern void _MEDmodeErreurVerrouiller(void); + + /************************************************************************* + * COPYRIGHT (C) 1999 - 2003 EDF R&D + * THIS LIBRARY IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY + * IT UNDER THE TERMS OF THE GNU LESSER GENERAL PUBLIC LICENSE + * AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION; + * EITHER VERSION 2.1 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION. + * + * THIS LIBRARY IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT + * WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU + * LESSER GENERAL PUBLIC LICENSE FOR MORE DETAILS. + * + * YOU SHOULD HAVE RECEIVED A COPY OF THE GNU LESSER GENERAL PUBLIC LICENSE + * ALONG WITH THIS LIBRARY; IF NOT, WRITE TO THE FREE SOFTWARE FOUNDATION, + * INC., 59 TEMPLE PLACE, SUITE 330, BOSTON, MA 02111-1307 USA + * + *************************************************************************/ + +#include +#include + +#include +#include + + /* + * - Nom de la fonction : MEDchampLire + * - Description : Lecture d'un Champ Résultat + * - Parametres : + * - fid (IN) : ID du fichier HDF courant + * - maa (IN) : le nom du maillage sur lequel s'applique le champ + * - cha (IN) : le nom du champ + * - val (OUT) : valeurs du champ à lire + * - interlace(IN) : entrelacement voulu en mémoire {MED_FULL_INTERLACE,MED_NO_INTERLACE} + * - numco (IN) : n° de la composante à lire (MED_ALL si toutes) + * - profil (OUT) : nom du profil utilisé (MED_NOPFL si inutilisé) + * - pflmod (IN) : Indique comment lire les informations en mémoire { MED_COMPACT, MED_GLOBALE }. + * - type_ent (IN) : entité concerné par le champ {MED_NOEUD,MED_ARETE,MED_FACE,MED_MAILLE} + * - type_geo (IN) : type géométrique de l'entité concerné {MED_POINT,MED_SEG2 ......} + * - numdt (IN) : n° du pas de temps (MED_NOPDT si aucun) + * - numo (IN) : n° d'ordre utilisé MED_NONOR si inutile + * - Resultat : 0 en cas de succes, -1 sinon + */ + + /* REM : La taille de val allouée par l'utilisateur doit prendre en compte le nbre de points de gauss et le nbre de composantes*/ + + med_err + MEDMEMchampLire(med_idt fid,char *maa, char *cha, unsigned char *val,med_mode_switch interlace,med_int numco, + char * locname, char *profil, med_mode_profil pflmod, + med_entite_maillage type_ent, med_geometrie_element type_geo, + med_int numdt, med_int numo) + + { + med_err ret=-1; + med_idt gid=0, datagroup1=0, datagroup2=0,datagroup3=0; + med_int ncomp=0, chtype=0, ngauss=0, i=0, pfluse=0; + char nomdatagroup1[2*MED_TAILLE_NOM_ENTITE+2]="",nomdatagroup2[2*MED_MAX_PARA+1]=""; + char tmp1[MED_TAILLE_NOM_ENTITE+1]="", pfltmp[MED_TAILLE_NOM+1]=""; + char chemin[MED_TAILLE_CHA+MED_TAILLE_NOM+1]=""; + med_size psize=0; + med_int *pfltabtmp=0; + med_ssize *pfltab=0; + + /* + * On inhibe le gestionnaire d'erreur HDF 5 + */ + _MEDmodeErreurVerrouiller(); + + /* + * Si le Data Group cha n'existe pas => erreur + */ + strcpy(chemin,MED_CHA); + strcat(chemin,cha); + if ((gid = _MEDdatagroupOuvrir(fid,chemin)) < 0) + goto ERROR; + + /* Lecture du nbre de composantes du champ */ + + if (_MEDattrEntierLire(gid,MED_NOM_NCO,&ncomp) < 0) + goto ERROR; + + /* + * Si le Data Group de niveau 1 [.] n'existe pas => erreur + */ + if (_MEDnomEntite(nomdatagroup1,type_ent) < 0) + goto ERROR; + if ((type_ent != MED_NOEUD)) + { + if (_MEDnomGeometrie(tmp1,type_geo) < 0) + goto ERROR; + strcat(nomdatagroup1,"."); + strcat(nomdatagroup1,tmp1); + } + datagroup1 = 0; + if ( (datagroup1 = _MEDdatagroupOuvrir(gid,nomdatagroup1)) < 0 ) + goto ERROR; + + /* + * Si le Data Group de niveau 2 . n'existe pas => erreur + */ + sprintf(nomdatagroup2,"%*li%*li",MED_MAX_PARA,(long ) numdt,MED_MAX_PARA,(long ) numo); + + datagroup2 = 0; + if ( (datagroup2 = _MEDdatagroupOuvrir(datagroup1,nomdatagroup2)) < 0) + goto ERROR; + + /* + * Ouvre le datagroup de niveau 3 + */ + + if ( ! strcmp(maa,MED_NOREF) ) + if (_MEDattrStringLire(datagroup2,MED_NOM_MAI,MED_TAILLE_NOM,maa) < 0) + goto ERROR; + + datagroup3 = 0; + if ( (datagroup3 = _MEDdatagroupOuvrir(datagroup2,maa)) < 0 ) + goto ERROR; + + /* Gestion des profils*/ + + /* + * Lire le profil + */ + + if (_MEDattrStringLire(datagroup3,MED_NOM_PFL,MED_TAILLE_NOM,pfltmp) < 0) + goto ERROR; + + if ( pfluse = (strcmp(pfltmp,MED_NOPFLi) && strcmp(pfltmp,"")) ) /* le test MED_NOPFLi pour des raisons de compatibilité */ + { + strcpy(profil,pfltmp); + if ( (i = MEDnValProfil(fid,profil)) < 0 ) + goto ERROR; + else + psize = i; + + pfltabtmp = (med_int *) malloc (sizeof(med_int)*psize); + pfltab = (med_ssize *) malloc (sizeof(med_ssize)*psize); + if (MEDprofilLire(fid,pfltabtmp,profil) < 0) + goto ERROR; + for (i=0;i0) if (_MEDdatagroupFermer(datagroup3) < 0) { + MESSAGE("Impossible de fermer le datagroup : "); + ISCRUTE(datagroup3); ret = -1; + } + + if (datagroup2>0) if (_MEDdatagroupFermer(datagroup2) < 0) { + MESSAGE("Impossible de fermer le datagroup : "); + ISCRUTE(datagroup2); ret = -1; + } + + if (datagroup1>0) if (_MEDdatagroupFermer(datagroup1) < 0) { + MESSAGE("Impossible de fermer le datagroup : "); + ISCRUTE(datagroup1); ret = -1; + } + + if (gid>0) if (_MEDdatagroupFermer(gid) < 0) { + MESSAGE("Impossible de fermer le datagroup : "); + ISCRUTE(gid); ret = -1; + } + + return ret; + } + + +#undef MESSAGE +#undef SSCRUTE +#undef ISCRUTE + + } +} + + diff --git a/src/MEDMEM/MEDMEM_MEDMEMchampLire.hxx b/src/MEDMEM/MEDMEM_MEDMEMchampLire.hxx new file mode 100644 index 000000000..6ec287dec --- /dev/null +++ b/src/MEDMEM/MEDMEM_MEDMEMchampLire.hxx @@ -0,0 +1,27 @@ +#ifndef MEDMEM_MEDMEM_CHAMPLIRE_HXX +#define MEDMEM_MEDMEM_CHAMPLIRE_HXX +/* + * En attendant une correction de la gestion du mode d'accès au fichier dans MEDfichier + * on intègre la correction ici. + */ +namespace med_2_2 { + extern "C" { + +# define __UTILITES_H__ +#include +# undef __UTILITES_H__ + +#include +#include + +med_err +MEDMEMchampLire(med_idt fid,char *maa, char *cha, unsigned char *val,med_mode_switch interlace,med_int numco, + char * locname, char *profil, med_mode_profil pflmod, + med_entite_maillage type_ent, med_geometrie_element type_geo, + med_int numdt, med_int numo); + + + } +} + +#endif diff --git a/src/MEDMEM/MEDMEM_MEDMEMgaussEcr.cxx b/src/MEDMEM/MEDMEM_MEDMEMgaussEcr.cxx new file mode 100644 index 000000000..4a868a0f6 --- /dev/null +++ b/src/MEDMEM/MEDMEM_MEDMEMgaussEcr.cxx @@ -0,0 +1,194 @@ +#include "MEDMEM_MEDMEMgaussEcr.hxx" +/* + * En attendant une correction de la gestion du mode d'accès au fichier dans MEDfichier + * on intègre la correction ici. + */ + +namespace med_2_2 { + extern "C" { +# define ICI {\ + fflush(stdout);\ + fprintf(stderr, "%s [%d] : " , __FILE__ , __LINE__ ) ;\ + fflush(stderr) ;\ + } + +# define ISCRUTE(entier) {\ + ICI ;\ + fprintf(stderr,"%s = %d\n",#entier,entier) ;\ + fflush(stderr) ;\ + } + +# define SSCRUTE(chaine) {\ + ICI ;\ + fprintf(stderr,"%s = \"%s\"\n",#chaine,chaine) ;\ + fflush(stderr) ;\ + } +# define MESSAGE(chaine) {\ + ICI ;\ + fprintf(stderr,"%s\n",chaine) ;\ + fflush(stderr) ;\ + } + + extern void _MEDmodeErreurVerrouiller(void); + + /************************************************************************* + * COPYRIGHT (C) 1999 - 2003 EDF R&D + * THIS LIBRARY IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY + * IT UNDER THE TERMS OF THE GNU LESSER GENERAL PUBLIC LICENSE + * AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION; + * EITHER VERSION 2.1 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION. + * + * THIS LIBRARY IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT + * WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU + * LESSER GENERAL PUBLIC LICENSE FOR MORE DETAILS. + * + * YOU SHOULD HAVE RECEIVED A COPY OF THE GNU LESSER GENERAL PUBLIC LICENSE + * ALONG WITH THIS LIBRARY; IF NOT, WRITE TO THE FREE SOFTWARE FOUNDATION, + * INC., 59 TEMPLE PLACE, SUITE 330, BOSTON, MA 02111-1307 USA + * + *************************************************************************/ + + /* + * - Nom de la fonction : MEDgaussEcr + * - Description : Itérateur renvoyant (n°pdt,n°or), le nbre de point de GAUSS pour le type d'élément, + * et le maillage par défaut avec son eventuel lien à un autre fichier. + * - Parametres : + * - fid (IN) : ID du fichier HDF courant + * - type_geo (IN) : Le type géométrique de l'entité concerné {MED_POINT,MED_SEG2 ......} + * - refcoo (IN) : Les coordonnées des noeuds de l'élément de référence (tableau de taille(typegeo%100)*(typegeo/100) ) + * - mode_coo (IN) : Choix du type d'entrelacement utilisé en mémoire pour refcoo et gscoo + * { MED_FULL_INTERLACE(x1,y1,z1,x2,...)) , MED_NO_INTERLACE(x1,x2,y1,y2,z1,z2) } + * - ngauss (IN) : Nombre de points de Gauss pour l'élément de référence considéré + * - gscoo (IN) : Les coordonnées des points de Gauss pour l'élément de référence (tableau de taille ngauss*type_geo/100) + * - wg (IN) : Poids à appliquer aux points d'intégration (tableau de taille ngauss) + * - locname (IN) : Nom à associer à la localisation (MED_TAILLe_NOM) + + REM : + est à passer en paramètre de MEDchampEcrire. + */ + + med_err + MEDMEMgaussEcr(med_idt fid, med_geometrie_element type_geo, med_float *refcoo, med_mode_switch mode_coo, + med_int ngauss, med_float *gscoo, med_float * wg, char * locname ) + { + med_idt gid=0, chid=0; + med_size dimd[1]; + med_err ret = -1; + med_int typegeo = -1; + char chemin[MED_TAILLE_GAUSS+1]=""; + + /* + * On inhibe le gestionnaire d'erreur HDF 5 + */ + _MEDmodeErreurVerrouiller(); + + /* + * Si le groupe "GAUSS" n'existe pas, on le cree + */ + strncpy(chemin,MED_GAUSS,MED_TAILLE_GAUSS-1); + chemin[MED_TAILLE_GAUSS-1] = '\0'; + if ((gid = _MEDdatagroupOuvrir(fid,chemin)) < 0) + if ((gid = _MEDdatagroupCreer(fid,chemin)) < 0) { + MESSAGE("Impossible de creer le groupe MED_GAUSS : "); + SSCRUTE(chemin); goto ERROR; + } + + /* + * Si le groupe n'existe pas, on le cree + * Sinon => erreur + */ + if ((chid = _MEDdatagroupOuvrir(gid,locname)) >= 0) { + if ( MED_MODE_ACCES != MED_LECTURE_ECRITURE ) { + MESSAGE("Le nom de localisation existe déjà : "); + SSCRUTE(locname); goto ERROR; + } + } else + if ((chid = _MEDdatagroupCreer(gid,locname)) < 0) + goto ERROR; + + /* + * On stocke sous forme d'attribut + */ + if (_MEDattrEntierEcrire(chid,MED_NOM_NBR,&ngauss) < 0) { + MESSAGE("Erreur à l'écriture de l'attribut MED_NOM_NBR : "); + ISCRUTE(ngauss);goto ERROR; + }; + + /* + * On stocke sous forme d'attribut + */ + typegeo = (med_int) type_geo; + /* sizeof(enum) tjrs = sizeof(int) en C, or + sur machines 64 bits par défaut med_int==long, + du coup sur machines 64 bits _MEDattrEntierEcrire utilise + le type hdf NATIVE_LONG, ce qui pose un problème qd on passe + un enum. + */ + if (_MEDattrEntierEcrire(chid,MED_NOM_GEO,&typegeo) < 0) { + MESSAGE("Erreur à l'écriture de l'attribut MED_NOM_GEO : "); + ISCRUTE(type_geo);goto ERROR; + }; + + + /* + * On stocke les coordonnées de référence dans un dataset + */ + + dimd[0] = (type_geo%100)*(type_geo/100); + if ( _MEDdatasetNumEcrire(chid,MED_NOM_COO,MED_FLOAT64,mode_coo,(type_geo/100),MED_ALL,MED_NOPF,MED_NO_PFLMOD,0,MED_NOPG,dimd, + (unsigned char*) refcoo) < 0 ) { + MESSAGE("Impossible d'ecrire le dataset : ");SSCRUTE(MED_NOM_COO); + ISCRUTE(dimd); goto ERROR; + } + + /* + * On stocke les points d'intégration dans un dataset + */ + + dimd[0] = ngauss*(type_geo/100); + if ( _MEDdatasetNumEcrire(chid,MED_NOM_GAU,MED_FLOAT64,mode_coo,(type_geo/100),MED_ALL,MED_NOPF,MED_NO_PFLMOD,0,MED_NOPG,dimd, + (unsigned char*) gscoo) < 0 ) { + MESSAGE("Impossible d'ecrire le dataset : ");SSCRUTE(MED_NOM_GAU); + ISCRUTE(dimd); goto ERROR; + } + + /* + * On stocke les poids dans un dataset + */ + + dimd[0] = ngauss; + if ( _MEDdatasetNumEcrire(chid,MED_NOM_VAL,MED_FLOAT64,mode_coo,1,MED_ALL,MED_NOPF,MED_NO_PFLMOD,0,MED_NOPG,dimd, + (unsigned char*) wg) < 0 ) { + MESSAGE("Impossible d'ecrire le dataset : ");SSCRUTE(MED_NOM_VAL); + ISCRUTE(dimd); goto ERROR; + } + + + ret = 0; + + ERROR: + + /* + * On ferme tout + */ + + if (chid>0) if (_MEDdatagroupFermer(chid) < 0) { + MESSAGE("Impossible de fermer le datagroup : "); + ISCRUTE(chid); ret = -1; + } + + if (gid>0) if (_MEDdatagroupFermer(gid) < 0) { + MESSAGE("Impossible de fermer le datagroup : "); + ISCRUTE(gid); ret = -1; + } + + return ret; + } + +#undef MESSAGE +#undef SSCRUTE +#undef ISCRUTE + + } +} diff --git a/src/MEDMEM/MEDMEM_MEDMEMgaussEcr.hxx b/src/MEDMEM/MEDMEM_MEDMEMgaussEcr.hxx new file mode 100644 index 000000000..0f7bf7c43 --- /dev/null +++ b/src/MEDMEM/MEDMEM_MEDMEMgaussEcr.hxx @@ -0,0 +1,24 @@ +#ifndef MEDMEM_MEDMEM_GAUSSECR_HXX +#define MEDMEM_MEDMEM_GAUSSECR_HXX +/* + * En attendant une correction de la gestion du mode d'accès au fichier dans MEDfichier + * on intègre la correction ici. + */ +namespace med_2_2 { + extern "C" { + +# define __UTILITES_H__ +#include +# undef __UTILITES_H__ + +#include +#include + +med_err +MEDMEMgaussEcr(med_idt fid, med_geometrie_element type_geo, med_float *refcoo, med_mode_switch mode_coo, + med_int ngauss, med_float *gscoo, med_float * wg, char * locname ); + + } +} + +#endif diff --git a/src/MEDMEM/MEDMEM_MEDMEMprofilEcr.cxx b/src/MEDMEM/MEDMEM_MEDMEMprofilEcr.cxx new file mode 100644 index 000000000..68ae798b7 --- /dev/null +++ b/src/MEDMEM/MEDMEM_MEDMEMprofilEcr.cxx @@ -0,0 +1,147 @@ +#include "MEDMEM_MEDMEMprofilEcr.hxx" +/* + * En attendant une correction de la gestion du mode d'accès au fichier dans MEDfichier + * on intègre la correction ici. + */ + +namespace med_2_2 { + extern "C" { + +# define ICI { \ + fflush(stdout); \ + fprintf(stderr, "%s [%d] : " , __FILE__ , __LINE__ ) ; \ + fflush(stderr) ; \ + } + +# define ISCRUTE(entier) { \ + ICI ; \ + fprintf(stderr,"%s = %d\n",#entier,entier) ; \ + fflush(stderr) ; \ + } + +# define SSCRUTE(chaine) { \ + ICI ; \ + fprintf(stderr,"%s = \"%s\"\n",#chaine,chaine) ; \ + fflush(stderr) ; \ + } +# define MESSAGE(chaine) { \ + ICI ; \ + fprintf(stderr,"%s\n",chaine) ; \ + fflush(stderr) ; \ + } + + extern void _MEDmodeErreurVerrouiller(void); + + /************************************************************************* + * COPYRIGHT (C) 1999 - 2003 EDF R&D + * THIS LIBRARY IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY + * IT UNDER THE TERMS OF THE GNU LESSER GENERAL PUBLIC LICENSE + * AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION; + * EITHER VERSION 2.1 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION. + * + * THIS LIBRARY IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT + * WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU + * LESSER GENERAL PUBLIC LICENSE FOR MORE DETAILS. + * + * YOU SHOULD HAVE RECEIVED A COPY OF THE GNU LESSER GENERAL PUBLIC LICENSE + * ALONG WITH THIS LIBRARY; IF NOT, WRITE TO THE FREE SOFTWARE FOUNDATION, + * INC., 59 TEMPLE PLACE, SUITE 330, BOSTON, MA 02111-1307 USA + * + *************************************************************************/ + +#include +#include + +#include +#include + + med_err + MEDMEMprofilEcr(med_idt fid,med_int *pflval,med_int n,char *profilname) + { + med_idt gid, chid; + med_size dimd[1]; + med_err ret; + char chemin[MED_TAILLE_PROFILS+1]; + + /* + * On inhibe le gestionnaire d'erreur HDF 5 + */ + _MEDmodeErreurVerrouiller(); + + /* + * Si le groupe "PROFILS" n'existe pas, on le cree + */ + strncpy(chemin,MED_PROFILS,MED_TAILLE_PROFILS-1); + chemin[MED_TAILLE_PROFILS-1] = '\0'; + if ((gid = _MEDdatagroupOuvrir(fid,chemin)) < 0) + if ((gid = _MEDdatagroupCreer(fid,chemin)) < 0) { + MESSAGE("Impossible de creer le groupe MED_PROFILS : "); + SSCRUTE(chemin); goto ERROR; + } + + /* + * Si le groupe "profilname" n'existe pas, on le cree + * Sinon => erreur + */ + if ((chid = _MEDdatagroupOuvrir(gid,profilname)) >= 0) { + if ( MED_MODE_ACCES != MED_LECTURE_ECRITURE ) { + MESSAGE("Le profil existe déjà : "); + SSCRUTE(profilname); goto ERROR; + } + } else + if ((chid = _MEDdatagroupCreer(gid,profilname)) < 0) + goto ERROR; + + /* + * On stocke "n" sous forme d'attribut + */ + if ((ret = _MEDattrEntierEcrire(chid,MED_NOM_NBR,&n)) < 0) { + MESSAGE("Erreur à l'écriture de l'attribut MED_NOM_NBR : "); + ISCRUTE(n); goto ERROR; + }; + + /* + * On stocke le profil dans un dataset + */ + dimd[0] = n; +#if defined(F77INT64) + ret = _MEDdatasetNumEcrire(chid,MED_NOM_PFL,MED_INT64,MED_NO_INTERLACE,MED_DIM1,MED_ALL,MED_NOPF,MED_NO_PFLMOD,0,MED_NOPG,dimd, + (unsigned char*) pflval); +#else + ret = _MEDdatasetNumEcrire(chid,MED_NOM_PFL,MED_INT32,MED_NO_INTERLACE,MED_DIM1,MED_ALL,MED_NOPF,MED_NO_PFLMOD,0,MED_NOPG,dimd, + (unsigned char*) pflval); +#endif + if (ret < 0 ) { + MESSAGE("Impossible d'ecrire le dataset pflval de taille : "); + ISCRUTE(n); goto ERROR; + } + + ret = 0; + ERROR: + /* + * On ferme tout + */ + if (chid>0) if (_MEDdatagroupFermer(chid) < 0) { + MESSAGE("Impossible de fermer le datagroup : "); + ISCRUTE(chid); ret = -1; + } + + if (gid>0) if (_MEDdatagroupFermer(gid) < 0) { + MESSAGE("Impossible de fermer le datagroup : "); + ISCRUTE(gid); ret = -1; + } + + return ret; + } + +#undef MESSAGE +#undef SSCRUTE +#undef ISCRUTE + + } +} + + + + diff --git a/src/MEDMEM/MEDMEM_MEDMEMprofilEcr.hxx b/src/MEDMEM/MEDMEM_MEDMEMprofilEcr.hxx new file mode 100644 index 000000000..83fb853ca --- /dev/null +++ b/src/MEDMEM/MEDMEM_MEDMEMprofilEcr.hxx @@ -0,0 +1,23 @@ +#ifndef MEDMEM_MEDMEM_PROFILECR_HXX +#define MEDMEM_MEDMEM_PROFILECR_HXX +/* + * En attendant une correction de la gestion du mode d'accès au fichier dans MEDfichier + * on intègre la correction ici. + */ +namespace med_2_2 { + extern "C" { + +# define __UTILITES_H__ +#include +# undef __UTILITES_H__ + +#include +#include + + med_err + MEDMEMprofilEcr(med_idt fid,med_int *pflval,med_int n,char *profilname); + + } +} + +#endif diff --git a/src/MEDMEM/MEDMEM_MedFieldDriver.hxx b/src/MEDMEM/MEDMEM_MedFieldDriver.hxx index 3373f9c91..9fafa8a57 100644 --- a/src/MEDMEM/MEDMEM_MedFieldDriver.hxx +++ b/src/MEDMEM/MEDMEM_MedFieldDriver.hxx @@ -45,9 +45,9 @@ template class MED_FIELD_DRIVER : public GENDRIVER { protected: // Developement plus propre : - // - Il faudrait soit utiliser le type FIELD_ et ajouter à cette classe - // les accesseurs de FIELD<> utilisés dans les drivers - // - Ou bien avoir des drivers à deux paramètres template (le top) + // - Il faudrait soit utiliser le type FIELD_ et ajouter à cette classe + // les accesseurs de FIELD<> utilisées dans les drivers + // - Ou bien avoir des drivers à deux paramètres template (le top) // - Remarquez l'affreux cast dans le second constructeur : // _ptrField( (FIELD *) ptrField ) // Cela cast toujours le ptrField en FullInterlace @@ -58,11 +58,6 @@ protected: public : - // all MED cell type ?? Classe de Définition ?? - // static const medGeometryElement all_cell_type[MED_NBR_GEOMETRIE_MAILLE]; - - // static const char * const all_cell_type_tab [MED_NBR_GEOMETRIE_MAILLE]; - /*! Constructor. */ @@ -77,7 +72,7 @@ public : MED_EN::med_mode_acces accessMode) : GENDRIVER(fileName,accessMode), _ptrField((FIELD *) ptrField), - _fieldName(fileName),_fieldNum(MED_INVALID) + _fieldName(""),_fieldNum(MED_INVALID) { } diff --git a/src/MEDMEM/MEDMEM_MedFieldDriver21.hxx b/src/MEDMEM/MEDMEM_MedFieldDriver21.hxx index e3d706437..29cc97b47 100644 --- a/src/MEDMEM/MEDMEM_MedFieldDriver21.hxx +++ b/src/MEDMEM/MEDMEM_MedFieldDriver21.hxx @@ -360,7 +360,7 @@ MED_FIELD_DRIVER21::createFieldSupport(med_2_1::med_idt id, //med_2_1::med_geometrie_element.. MED_EN::medGeometryElement geometricType[MED_NBR_GEOMETRIE_MAILLE]; int numberOfElementsOfType[MED_NBR_GEOMETRIE_MAILLE]; - int numberOfGaussPoint[MED_NBR_GEOMETRIE_MAILLE]; + int numberOfGaussPoints[MED_NBR_GEOMETRIE_MAILLE]; med_2_1::med_int ngauss=0, numdt=-1, numo=-1, nbPdtIt=0; //nmaa=0 char dtunit[MED_TAILLE_PNOM21+1], maa[MED_TAILLE_NOM+1]; @@ -448,7 +448,7 @@ MED_FIELD_DRIVER21::createFieldSupport(med_2_1::med_idt id, //totalNumberOfElements+=numberOfElements; numberOfElementsOfType[numberOfGeometricType] = numberOfElements/ngauss; - numberOfGaussPoint[numberOfGeometricType] = ngauss; + numberOfGaussPoints[numberOfGeometricType] = ngauss; anyGauss = (anyGauss || (ngauss-1) ); geometricType[numberOfGeometricType]= *currentGeometry; numberOfGeometricType++; @@ -468,8 +468,6 @@ MED_FIELD_DRIVER21::createFieldSupport(med_2_1::med_idt id, support.setGeometricType(geometricType); // Utile uniquement si setAll == false support.setNumberOfElements(numberOfElementsOfType); //setNumberOfElements effectue une copie support.setAll(true); - if (anyGauss) - support.setNumberOfGaussPoint(numberOfGaussPoint); return alreadyFoundAnEntity; } else @@ -770,7 +768,7 @@ template void MED_FIELD_RDONLY_DRIVER21::read(void) // MED_FIELD_DRIVER::_ptrField->_orderNumber) ; NumberOfValues[i] = mySupport->getNumberOfElements(Types[i]) - * mySupport->getNumberOfGaussPoint(Types[i]); + * MED_FIELD_DRIVER::_ptrField->getNumberOfGaussPoints(Types[i]); myValues[i] = new T[ NumberOfValues[i]*numberOfComponents ] ; TotalNumberOfValues+=NumberOfValues[i] ; @@ -1013,7 +1011,7 @@ template void MED_FIELD_WRONLY_DRIVER21::write(void) const const SUPPORT * mySupport = MED_FIELD_DRIVER::_ptrField->getSupport() ; if (! mySupport->isOnAllElements()) - throw MEDEXCEPTION( LOCALIZED (STRING(LOC) + throw MEDEXCEPTION( LOCALIZED (STRING(LOC) <<": Field must be on all entity" ) ); @@ -1025,7 +1023,6 @@ template void MED_FIELD_WRONLY_DRIVER21::write(void) const int NumberOfType = mySupport->getNumberOfTypes() ; int Index = 1 ; const MED_EN::medGeometryElement * Types = mySupport->getTypes() ; - const int * NumberOfGaussPoint = mySupport->getNumberOfGaussPoint() ; const T * value = NULL; ArrayFull * myArray = NULL; @@ -1042,7 +1039,8 @@ template void MED_FIELD_WRONLY_DRIVER21::write(void) const for (int i=0;igetNumberOfElements(Types[i]) ; - + int NumberOfGaussPoints = MED_FIELD_DRIVER::_ptrField->getNumberOfGaussPoints(Types[i]) ; + // const T * value = MED_FIELD_DRIVER::_ptrField->getValueI(MED_EN::MED_FULL_INTERLACE,Index) ; value = myArray->getRow(Index) ; @@ -1052,7 +1050,7 @@ template void MED_FIELD_WRONLY_DRIVER21::write(void) const MESSAGE("MED_FIELD_DRIVER::_ptrField->getName() : "<::_ptrField->getName()); MESSAGE("value : "<getEntity() : "<getEntity()); MESSAGE("Types[i] : "<::_ptrField->getIterationNumber() : "<::_ptrField->getIterationNumber()); @@ -1091,7 +1089,7 @@ template void MED_FIELD_WRONLY_DRIVER21::write(void) const (unsigned char*)temp, med_2_1::MED_FULL_INTERLACE, NumberOfElements, - NumberOfGaussPoint[i], + NumberOfGaussPoints, MED_ALL, MED_NOPFL, med_2_1::MED_REMP, // PROFIL NON GERE, mode de remplacement non géré @@ -1112,7 +1110,7 @@ template void MED_FIELD_WRONLY_DRIVER21::write(void) const (unsigned char*)value, med_2_1::MED_FULL_INTERLACE, NumberOfElements, - NumberOfGaussPoint[i], + NumberOfGaussPoints, MED_ALL, MED_NOPFL, med_2_1::MED_REMP, // PROFIL NON GERE, mode de remplacement non géré diff --git a/src/MEDMEM/MEDMEM_MedFieldDriver22.hxx b/src/MEDMEM/MEDMEM_MedFieldDriver22.hxx index 4e1df7f57..aac96c949 100644 --- a/src/MEDMEM/MEDMEM_MedFieldDriver22.hxx +++ b/src/MEDMEM/MEDMEM_MedFieldDriver22.hxx @@ -21,21 +21,27 @@ #define MED_FIELD_DRIVER22_HXX #include +#include -#include "MEDMEM_define.hxx" +#include "MEDMEM_FieldConvert.hxx" +#include "MEDMEM_ArrayInterface.hxx" +#include "MEDMEM_ArrayConvert.hxx" -#include "MEDMEM_DriversDef.hxx" +#include "MEDMEM_define.hxx" #include "MEDMEM_Utilities.hxx" -#include "MEDMEM_MedFieldDriver.hxx" #include "MEDMEM_STRING.hxx" #include "MEDMEM_Exception.hxx" -#include "MEDMEM_Unit.hxx" - -#include "MEDMEM_ArrayInterface.hxx" -#include "MEDMEM_ArrayConvert.hxx" +#include "MEDMEM_DriversDef.hxx" +#include "MEDMEM_MedFieldDriver.hxx" +#include "MEDMEM_Unit.hxx" #include "MEDMEM_Support.hxx" -#include "MEDMEM_Mesh.hxx" +#include "MEDMEM_GaussLocalization.hxx" + +//includes temporaires (attente release med fichier 2.3.1) +#include "MEDMEM_MEDMEMgaussEcr.hxx" +#include "MEDMEM_MEDMEMprofilEcr.hxx" +#include "MEDMEM_MEDMEMchampLire.hxx" namespace MEDMEM { @@ -50,21 +56,32 @@ namespace MEDMEM { template class MED_FIELD_DRIVER22 : public virtual MED_FIELD_DRIVER { protected: - + med_2_2::med_idt _medIdt; - - bool createFieldSupport(med_2_2::med_idt id, - string & fieldName, + + bool createFieldSupportPart1(med_2_2::med_idt id, + const string & fieldName, med_2_2::med_int ndt, med_2_2::med_int od, SUPPORT & support, - string & meshName) const throw (MEDEXCEPTION); + string & meshName, + vector & numberOfElementsOfTypeC, + vector & numberOfGaussPoint, + int & totalNumberOfElWg + ) const throw (MEDEXCEPTION); - void getMeshGeometricType(med_2_2::med_idt id, + void getMeshGeometricTypeFromFile(med_2_2::med_idt id, string & meshName, MED_EN::medEntityMesh entite, vector & geoType, - vector &nbOfElOfType) const; + vector &nbOfElOfType, + vector &nbOfElOfTypeC) const throw(MEDEXCEPTION); + + void getMeshGeometricTypeFromMESH( MESH * meshPtr, + MED_EN::medEntityMesh entity, + vector & geoType, + vector &nbOfElOfType, + vector &nbOfElOfTypeC) const throw(MEDEXCEPTION); public : @@ -78,7 +95,7 @@ public : */ template MED_FIELD_DRIVER22(const string & fileName, - FIELD * ptrField, + FIELD * ptrField, MED_EN::med_mode_acces accessMode) : MED_FIELD_DRIVER(fileName,ptrField,accessMode),_medIdt(MED_INVALID) { @@ -96,7 +113,7 @@ public : /*! Destructor. */ - virtual ~MED_FIELD_DRIVER22() { + virtual ~MED_FIELD_DRIVER22() { } void open() throw (MEDEXCEPTION) @@ -106,7 +123,7 @@ public : // we must set fieldname before open, because we must find field number in file (if it exist !!!) if ( MED_FIELD_DRIVER::_fileName == "" ) - throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) + throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) << "_fileName is |\"\"|, please set a correct fileName before calling open()" ) ); @@ -114,13 +131,13 @@ public : MESSAGE(LOC<<"_fileName.c_str : "<< MED_FIELD_DRIVER::_fileName.c_str()<<",mode : "<< MED_FIELD_DRIVER::_accessMode); MED_FIELD_DRIVER22::_medIdt = med_2_2::MEDouvrir( (const_cast (MED_FIELD_DRIVER::_fileName.c_str())),(med_2_2::med_mode_acces) MED_FIELD_DRIVER::_accessMode); MESSAGE(LOC<<"_medIdt : "<< MED_FIELD_DRIVER22::_medIdt ); - if (MED_FIELD_DRIVER22::_medIdt > 0) + if (MED_FIELD_DRIVER22::_medIdt > 0) MED_FIELD_DRIVER::_status=MED_OPENED; else { MED_FIELD_DRIVER::_status = MED_INVALID; MED_FIELD_DRIVER22::_medIdt = MED_INVALID; - throw MED_EXCEPTION (LOCALIZED( STRING(LOC) - << "Can't open |" << MED_FIELD_DRIVER::_fileName + throw MED_EXCEPTION (LOCALIZED( STRING(LOC) + << "Can't open |" << MED_FIELD_DRIVER::_fileName << "|, _medIdt : " << MED_FIELD_DRIVER22::_medIdt ) ); @@ -128,7 +145,7 @@ public : END_OF(LOC); } - + void close() { BEGIN_OF("MED_FIELD_DRIVER22::close()"); med_2_2::med_int err = 0; @@ -154,14 +171,14 @@ public : template class MED_FIELD_RDONLY_DRIVER22 : public virtual MED_FIELD_DRIVER22, public virtual IMED_FIELD_RDONLY_DRIVER { - + public : - + /*! Constructor. */ MED_FIELD_RDONLY_DRIVER22():MED_FIELD_DRIVER() {}; - + /*! Constructor. */ @@ -171,11 +188,11 @@ public : IMED_FIELD_RDONLY_DRIVER(fileName,ptrField), MED_FIELD_DRIVER22(fileName,ptrField,MED_EN::MED_RDONLY), MED_FIELD_DRIVER(fileName,ptrField,MED_EN::MED_RDONLY) - { + { BEGIN_OF("MED_FIELD_RDONLY_DRIVER22::MED_FIELD_RDONLY_DRIVER22(const string & fileName, const FIELD * ptrField)"); END_OF("MED_FIELD_RDONLY_DRIVER22::MED_FIELD_RDONLY_DRIVER22(const string & fileName, const FIELD * ptrField)"); } - + /*! Copy constructor. */ @@ -184,7 +201,7 @@ public : MED_FIELD_DRIVER22(fieldDriver), MED_FIELD_DRIVER(fieldDriver) {} - + /*! Destructor. */ @@ -215,14 +232,14 @@ private: */ template class MED_FIELD_WRONLY_DRIVER22 : public virtual MED_FIELD_DRIVER22, public virtual IMED_FIELD_WRONLY_DRIVER { - + public : - + /*! Constructor. */ MED_FIELD_WRONLY_DRIVER22():MED_FIELD_DRIVER() {} - + /*! Constructor. */ @@ -245,7 +262,7 @@ public : MED_FIELD_DRIVER22(fieldDriver), MED_FIELD_DRIVER(fieldDriver) {} - + /*! Destructor. */ @@ -275,14 +292,14 @@ private: */ template class MED_FIELD_RDWR_DRIVER22 : public MED_FIELD_RDONLY_DRIVER22, public MED_FIELD_WRONLY_DRIVER22, public IMED_FIELD_RDWR_DRIVER { - + public : - + /*! Constructor. */ MED_FIELD_RDWR_DRIVER22():MED_FIELD_DRIVER22() {} - + /*! Constructor. */ @@ -312,7 +329,7 @@ public : IMED_FIELD_WRONLY_DRIVER(fieldDriver), MED_FIELD_DRIVER(fieldDriver) {}; - + /*! Destructor. */ @@ -339,17 +356,47 @@ private: /*--------------------- DRIVER PART -------------------------------*/ + +/*! + + Cette méthode crée le SUPPORT du champ pour le + =. + + Le SUPPORT crée à pour nom Support et contient + la liste des types géométriques sur le premier type + d'entité trouvé (en MEDMEM on inderdit aux champs de reposer + sur plusieurs types d'entité). + Il contient également le nombre d'entités trouvées pour chaque + type géométrique. + Par défaut l'attribut onAll du SUPPORT est positionné à true car + cette routine ne lit rien de ce qui concerne les entités + du maillage associé. + La méthode renvoie true si elle réussit à créer le SUPPORT + demandé. + Le nom du maillage associé ( en MEDMEM on ne + supporte pas encore les maillages multiples ) est renvoyé dans . + Deux tableaux directements exploitables par MEDMEMnArray sont renvoyés : + - numberOfElementsOfTypeC : nombres d'entités cumulés de chaque type géométrique + avec numberOfElementsOfTypeC[0]=1 et de taille nombre de types+1 + - numberOfGaussPoint : nombre de points de Gauss par type géométrique + avec numberOfGaussPoint[0]=1 et de taille nombre de types+1 +*/ + template bool -MED_FIELD_DRIVER22::createFieldSupport(med_2_2::med_idt id, - string & fieldName, - med_2_2::med_int ndt, - med_2_2::med_int od, - SUPPORT & support, - string & meshName) const throw (MEDEXCEPTION) +MED_FIELD_DRIVER22::createFieldSupportPart1(med_2_2::med_idt id, + const string & fieldName, + med_2_2::med_int ndt, + med_2_2::med_int od, + SUPPORT & support, + string & meshName, + vector & numberOfElementsOfTypeC, + vector & numberOfGaussPoint, + int & totalNumberOfElWg + ) const throw (MEDEXCEPTION) { - //EF : Gérer le meshName pour le driver 2.2 - const char * LOC="MED_FIELD_DRIVER::search_field(...)"; + //EF : Gérer le meshName pour le driver 2.2 + const char * LOC="MED_FIELD_DRIVER::createFieldSupportPart1(...)"; map > CellAndNodeEntities; map >::iterator currentEntity; @@ -357,15 +404,15 @@ MED_FIELD_DRIVER22::createFieldSupport(med_2_2::med_idt id, CellAndNodeEntities[MED_EN::MED_NODE] = MED_EN::meshEntities[MED_EN::MED_NODE]; list< MED_EN::medGeometryElement >::const_iterator currentGeometry; - //med_2_2::med_entite_maillage MED_EN::medEntityMesh entity; - bool alreadyFoundAnEntity=false, alreadyFoundPdtIt = false, anyGauss=false; + bool alreadyFoundAnEntity=false,alreadyFoundPdtIt = false; int numberOfElements = 0; int numberOfGeometricType = 0; - //med_2_2::med_geometrie_element.. MED_EN::medGeometryElement geometricType[MED_NBR_GEOMETRIE_MAILLE]; int numberOfElementsOfType[MED_NBR_GEOMETRIE_MAILLE]; - int numberOfGaussPoint[MED_NBR_GEOMETRIE_MAILLE]; + numberOfElementsOfTypeC.clear();numberOfGaussPoint.clear(); + numberOfElementsOfTypeC.resize(MED_NBR_GEOMETRIE_MAILLE+1); + numberOfGaussPoint.resize(MED_NBR_GEOMETRIE_MAILLE+1); med_2_2::med_int nmaa=0, ngauss=0, numdt=-1, numo=-1, nbPdtIt=0; char dtunit[MED_TAILLE_PNOM22+1]; @@ -373,7 +420,12 @@ MED_FIELD_DRIVER22::createFieldSupport(med_2_2::med_idt id, med_2_2::med_float dt=-1.0; med_2_2::med_booleen local; med_2_2::med_err ret=1; + numberOfElementsOfTypeC[0] = 1; + numberOfGaussPoint[0] = 1; + totalNumberOfElWg = 0; + /* Détermine le type d'entité et la liste des types géométriques associés + au champ */ for (currentEntity = CellAndNodeEntities.begin(); currentEntity != CellAndNodeEntities.end(); currentEntity++) { for (currentGeometry = (*currentEntity).second.begin(); @@ -385,8 +437,7 @@ MED_FIELD_DRIVER22::createFieldSupport(med_2_2::med_idt id, (med_2_2::med_geometrie_element) *currentGeometry )) <= 0 ) continue; - - + /* Verifie que le champ n'est pas défini sur un autre type d'entité */ if ( alreadyFoundAnEntity ) { if (entity != (*currentEntity).first ) throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Field |" << fieldName @@ -396,6 +447,7 @@ MED_FIELD_DRIVER22::createFieldSupport(med_2_2::med_idt id, } else { entity=(*currentEntity).first; alreadyFoundAnEntity = true; }; + /* Cherche le champ pour le , demandé et détermine le nombre de points de Gauss*/ ret = 0; alreadyFoundPdtIt = false; ngauss =0; for ( med_2_2::med_int j=1; j <= nbPdtIt; j++ ) { @@ -403,7 +455,7 @@ MED_FIELD_DRIVER22::createFieldSupport(med_2_2::med_idt id, ret += med_2_2::MEDpasdetempsInfo(id, const_cast ( fieldName.c_str() ), (med_2_2::med_entite_maillage) (*currentEntity).first, (med_2_2::med_geometrie_element) *currentGeometry, - j, &ngauss, &numdt, &numo, dtunit, &dt, + j, &ngauss, &numdt, &numo, dtunit, &dt, maa, &local, &nmaa); if ( ndt == numdt && numo == od ) { @@ -417,12 +469,19 @@ MED_FIELD_DRIVER22::createFieldSupport(med_2_2::med_idt id, << "is defined on multiple meshes, using dafault mesh |" << maa << "|" ); } - if ( !local) - throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Field |" << fieldName << "| with (ndt,or) = (" - << ndt << "," << od << ") for (entityType,geometricType)=(" - << MED_EN::entNames[(*currentEntity).first] << "," - << MED_EN::geoNames[*currentGeometry] << ")" - << "is using a mesh on a different file which is not yet supported" )); + if ( !local) { + MESSAGE(" Field |" << fieldName << "| with (ndt,or) = (" + << ndt << "," << od << ") for (entityType,geometricType)=(" + << MED_EN::entNames[(*currentEntity).first] << "," + << MED_EN::geoNames[*currentGeometry] << ")" + << "is using a mesh on a distant file (ignored)" ); + +// throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Field |" << fieldName << "| with (ndt,or) = (" +// << ndt << "," << od << ") for (entityType,geometricType)=(" +// << MED_EN::entNames[(*currentEntity).first] << "," +// << MED_EN::geoNames[*currentGeometry] << ")" +// << "is using a mesh on a different file which is not yet supported" )); + } if ( ! meshName.empty() ) if ( meshName != maa ) { @@ -460,12 +519,14 @@ MED_FIELD_DRIVER22::createFieldSupport(med_2_2::med_idt id, << MED_EN::entNames[(*currentEntity).first] << "," << MED_EN::geoNames[*currentGeometry] << ")" )); ; - //totalNumberOfElements+=numberOfElements; numberOfElementsOfType[numberOfGeometricType] = numberOfElements/ngauss; - numberOfGaussPoint[numberOfGeometricType] = ngauss; - anyGauss = (anyGauss || (ngauss-1) ); + numberOfElementsOfTypeC[numberOfGeometricType+1]= + numberOfElementsOfTypeC[numberOfGeometricType] + + numberOfElementsOfType[numberOfGeometricType]; + numberOfGaussPoint[numberOfGeometricType+1] = ngauss; geometricType[numberOfGeometricType]= *currentGeometry; numberOfGeometricType++; + totalNumberOfElWg+=numberOfElements; } // End Second For @@ -473,35 +534,50 @@ MED_FIELD_DRIVER22::createFieldSupport(med_2_2::med_idt id, if ( alreadyFoundAnEntity) { support.setName(fieldName+"Support"); - support.setMeshName(string(maa)); // Vérifier que les différents noms de maillages lus soient identiques + support.setMeshName(string(maa)); // Vérifier que les différents noms de maillages lus soient identiques support.setEntity(entity); - // REM : Signification précédente erronée pour un champ qui ne repose pas sur toutes les entités géométriques - // du maillage mais dont le SUPPORT a été crée à partir des informations d'un maillage, comme - // celà fût la plupart du temps. + // REM : Le nombre dans la précédente version du Driver + // était erronée pour un champ qui ne reposait pas sur toutes les entités géométriques + // du maillage mais dont le SUPPORT a été crée à partir des informations du maillage + // ( méthode qui était largement utilisée pour construire un SUPPORT). support.setNumberOfGeometricType(numberOfGeometricType); - support.setGeometricType(geometricType); // Utile uniquement si setAll == false - support.setNumberOfElements(numberOfElementsOfType); //setNumberOfElements effectue une copie + support.setGeometricType(geometricType); // Utile uniquement si setAll == false ? + support.setNumberOfElements(numberOfElementsOfType); //setNumberOfElements effectue une copie + // Par défaut considère que le champ repose sur tous les type géométriques du maillage + // Si ce n'est pas le cas les champs geometricType et numberOfElementsOfType du SUPPORT sont corrects support.setAll(true); - if (anyGauss) - support.setNumberOfGaussPoint(numberOfGaussPoint); + numberOfElementsOfTypeC.resize(numberOfGeometricType+1); + numberOfGaussPoint.resize(numberOfGeometricType+1); return alreadyFoundAnEntity; } else return false; } +/*! + + Renvoie la liste des types géométriques définis dans le maillage + pour le type d'entité . + * < nbOfElOfType > contient le nombre d'entités de chaque type + * < numberOfElementsOfTypeC > contient le nombre d'entités cumulées de chaque type + avec numberOfElementsOfTypeC[0]=0; + +*/ template void -MED_FIELD_DRIVER22::getMeshGeometricType(med_2_2::med_idt id, +MED_FIELD_DRIVER22::getMeshGeometricTypeFromFile(med_2_2::med_idt id, string & meshName, MED_EN::medEntityMesh entity, vector & geoType, - vector &nbOfElOfType) const + vector &nbOfElOfType, + vector &nbOfElOfTypeC + ) const throw(MEDEXCEPTION) { - const char LOC[] = "MED_FIELD_DRIVER::getMeshGeometricType(...)"; + const char LOC[] = "MED_FIELD_DRIVER::getMeshGeometricTypeFromFile(...)"; int numberOfGeometricType=0; MED_EN::medGeometryElement geometricType[MED_NBR_GEOMETRIE_MAILLE]; - int numberOfElementsOfType[MED_NBR_GEOMETRIE_MAILLE]; + int numberOfElementsOfType [MED_NBR_GEOMETRIE_MAILLE]; + int numberOfElementsOfTypeC[MED_NBR_GEOMETRIE_MAILLE+1]; med_2_2::med_int numberOfElements=0; med_2_2::med_table quoi; if (entity == MED_EN::MED_CELL) quoi=med_2_2::MED_CONN; @@ -514,6 +590,7 @@ MED_FIELD_DRIVER22::getMeshGeometricType(med_2_2::med_idt id, list::const_iterator currentGeometry; bool alreadyFoundAnEntity = false; + numberOfElementsOfTypeC[0]=0; for (currentGeometry = (MED_EN::meshEntities[entity]).begin(); currentGeometry != (MED_EN::meshEntities[entity]).end(); currentGeometry++) { @@ -530,16 +607,54 @@ MED_FIELD_DRIVER22::getMeshGeometricType(med_2_2::med_idt id, alreadyFoundAnEntity = true; numberOfElementsOfType[numberOfGeometricType] = numberOfElements; + numberOfElementsOfTypeC[numberOfGeometricType+1] = + numberOfElementsOfTypeC[numberOfGeometricType]+numberOfElements; geometricType[numberOfGeometricType] = *currentGeometry; numberOfGeometricType++; } - + geoType = vector(geometricType,geometricType+numberOfGeometricType); nbOfElOfType = vector (numberOfElementsOfType,numberOfElementsOfType+numberOfGeometricType); + nbOfElOfTypeC = vector (numberOfElementsOfTypeC,numberOfElementsOfTypeC+numberOfGeometricType+1); + +// for (int j =0 ; j<= numberOfGeometricType;++j) +// cout << "nbOfElOfTypeC["< void +MED_FIELD_DRIVER22::getMeshGeometricTypeFromMESH( MESH * meshPtr, + MED_EN::medEntityMesh entity, + vector & geoType, + vector &nbOfElOfType, + vector &nbOfElOfTypeC) const throw(MEDEXCEPTION) +{ + const char LOC[] = "MED_FIELD_DRIVER::getMeshGeometricTypeFromMESH(...) : "; + BEGIN_OF(LOC); + + if (!meshPtr) + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"ptrMesh must be non null" )); ; + + // Il est plus pratique de créer un support "onAll" + // pour calculer les tableaux du nombre d'entités cumulées + + SUPPORT mySupportFromMesh = SUPPORT(meshPtr,"Temporary Support From Associated Mesh", + entity); + geoType = vector(mySupportFromMesh.getTypes(), + mySupportFromMesh.getTypes()+mySupportFromMesh.getNumberOfTypes()); + nbOfElOfType.resize(mySupportFromMesh.getNumberOfTypes()); + nbOfElOfTypeC.resize(mySupportFromMesh.getNumberOfTypes()+1); + nbOfElOfTypeC[0]=0; + + for (int j=1; j<=mySupportFromMesh.getNumberOfTypes(); ++j) { + nbOfElOfType[j-1]=mySupportFromMesh.getNumberOfElements(geoType[j-1]); + nbOfElOfTypeC[j]+=nbOfElOfTypeC[j-1]+nbOfElOfType[j-1]; + } + + END_OF(LOC); +} + /*--------------------- RDONLY PART -------------------------------*/ template GENDRIVER * MED_FIELD_RDONLY_DRIVER22::copy(void) const @@ -554,7 +669,12 @@ template void MED_FIELD_RDONLY_DRIVER22::read(void) BEGIN_OF(LOC); typedef typename MEDMEM_ArrayInterface::Array ArrayNo; + typedef typename MEDMEM_ArrayInterface::Array ArrayNoWg; typedef typename MEDMEM_ArrayInterface::Array ArrayFull; + typedef typename MEDMEM_ArrayInterface::Array ArrayFullWg; + + if (MED_FIELD_DRIVER::_status!=MED_OPENED) + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<": Method open must be called before method read.")) ; if ( ( MED_FIELD_DRIVER::_fieldName.empty() ) && ( MED_FIELD_DRIVER::_ptrField->_name.empty() ) ) @@ -570,65 +690,72 @@ template void MED_FIELD_RDONLY_DRIVER22::read(void) throw MEDEXCEPTION(LOCALIZED(STRING(LOC) <<" size in object driver FIELD is > MED_TAILLE_NOM .")); + const string & fieldName = MED_FIELD_DRIVER::_fieldName; - MESSAGE("###### "<::_fieldName << - " fieldName : "<::_fieldName); + MED_EN::medModeSwitch interlacingType = MED_FIELD_DRIVER::_ptrField->getInterlacingType(); + bool isFullInterlace = ( interlacingType == MED_EN::MED_FULL_INTERLACE ); - - if (MED_FIELD_DRIVER::_status!=MED_OPENED) - throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<": Method open must be called before method read.")) ; + MESSAGE("###### "<::_ptrField->_name); // EF : -// Si un support a été donnée au champ, pour des raisons de compatibilité avec -// les versions précédentes, ce support sera utilisé pour +// Si un support a été donnée au champ, pour des raisons de compatibilité avec +// les versions précédentes, ce support sera utilisé pour // - Obtenir le nom du maillage sur lequel on veut lire le champ // (eventuellement on pourrait l'utiliser pour selectionner un champ qui -// repose sur plusieurs maillages cf HOMARD-ASTER) -// - vérifier le type d'entité (MED_NOEUD xor MED_MAILLE xor MED_FACE xor MED_ARETE ) sur lequel -// il faut lire le champ qui est également retouvé. -// - Si le support défini une liste d'entité ( différente de MED_ALL_ELEMENTS), celle-ci est ignorée -// à la lecture et écrasé par les listes de profils lus s'il en existe - -// Si aucun support n'a été donné au champ : -// - A la lecture : Un support est crée et le type d'entité unique est lu -// (cf decision gt MED qu'un champ repose sur une entité unique ?), -// l'ensemble des types géométriques est lu, -// l'ensemble des profils par type géométrique est lu -// Le nom du maillage associé est lu mais le pointeur SUPPORT-MESH non initialisé - - char * fieldName = new char[MED_TAILLE_NOM+1] ; +// repose sur plusieurs maillages cf HOMARD-ASTER, ce qui n'est pas géré dans MEDMEM) +// - vérifier le type d'entité (MED_NOEUD xor MED_MAILLE xor MED_FACE xor MED_ARETE ) sur lequel +// il faut lire le champ qui est également retouvé. +// - Si le support défini une liste d'entité ( différente de MED_ALL_ELEMENTS), celle-ci est ignorée +// à la lecture et écrasé par soit : +// - onall, après avoir vérifié que la liste des types géométriques utilisés par le champ +// est égale à la liste des type géométriques définis dans le maillage associé +// pour tous le même type d'entité. +// - La sous liste des types géométriques utilisés (onAll quand même, cf commenataire ci-dessous ) +// - les listes de profils lus s'il en existe pour une sous liste de types +// géométriques + +// Si aucun support n'a été donné au champ : +// - A la lecture : Un support est crée et le type d'entité unique est lu +// (cf decision gt MED qu'un champ repose sur une entité unique ?), +// l'ensemble des types géométriques est lu, +// l'ensemble des profils par type géométrique est lu +// Le nom du maillage associé est lu mais le pointeur SUPPORT-MESH non initialisé + + + char * tmpFieldName = new char[MED_TAILLE_NOM+1] ; int err ; int numberOfComponents = 0; char * componentName = (char *) MED_NULL; char * unitName = (char *) MED_NULL; med_2_2::med_type_champ type ; med_2_2::med_idt id = MED_FIELD_DRIVER22::_medIdt; + bool needConversionToDouble = false,needConversionToInt64 = false; - // we search for the field med number of - // Having found variables , + // we search for the "field med number" of + // Having found , variables , // , , and attribute <_fieldNum> are set. if (MED_FIELD_DRIVER::_fieldNum==MED_INVALID) { int numberOfFields = med_2_2::MEDnChamp(id,0) ; - if ( numberOfFields <= 0 ) + if ( numberOfFields <= 0 ) throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<": There is no field found in the file !")); for (int i=1;i<=numberOfFields;i++) { numberOfComponents = med_2_2::MEDnChamp(id,i) ; - if ( numberOfComponents <= 0 ) + if ( numberOfComponents <= 0 ) MESSAGE(LOC<<"Be careful there is no compound for field n°"<::_fileName<<"| !"); componentName = new char[numberOfComponents*MED_TAILLE_PNOM22+1] ; - unitName = new char[numberOfComponents*MED_TAILLE_PNOM22+1] ; - - err = med_2_2::MEDchampInfo(id, i, fieldName, &type, componentName, + unitName = new char[numberOfComponents*MED_TAILLE_PNOM22+1] ; + + err = med_2_2::MEDchampInfo(id, i, tmpFieldName, &type, componentName, unitName, numberOfComponents) ; - - MESSAGE("Field "<::_fieldName.c_str()<<"#"); - if ( !strcmp(fieldName,MED_FIELD_DRIVER::_fieldName.c_str()) ) { - MESSAGE("FOUND FIELD "<< fieldName <<" : "<::_fieldNum = i ; break ; } @@ -637,19 +764,24 @@ template void MED_FIELD_RDONLY_DRIVER22::read(void) delete[] unitName ; } } - - delete[] fieldName ; + delete[] tmpFieldName ; + + // Si aucun champ ne correspond les variables et ont été correctement + // désallouées dans la boucle de recherche if (MED_FIELD_DRIVER::_fieldNum==MED_INVALID) - throw MEDEXCEPTION(LOCALIZED( STRING(LOC) << ": Field "<::_fieldName << " not found in file " << MED_FIELD_DRIVER::_fileName ) ); + throw MEDEXCEPTION(LOCALIZED( STRING(LOC) << ": Field "<< fieldName + << " not found in file " << MED_FIELD_DRIVER::_fileName) ); + MESSAGE ("FieldNum : "<::_fieldNum); if (numberOfComponents < 1) { delete[] componentName; delete[] unitName; - throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" no component found fo field " - << MED_FIELD_DRIVER::_fieldName)) ; + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" no component found for field " + << fieldName)) ; } + // Verifie que l'on essaye pas de lire un champ double dans un FIELD switch ( (med_2_2::med_type_champ) MED_FIELD_DRIVER::_ptrField->_valueType ) { case med_2_2::MED_INT : case med_2_2::MED_INT32 : @@ -660,56 +792,78 @@ template void MED_FIELD_RDONLY_DRIVER22::read(void) <<") differs from FIELD object type (" << MED_FIELD_DRIVER::_ptrField->_valueType << ")" )) ; } +#if defined(IRIX64) || defined(OSF1) ||defined(VPP5000) + if (_ptrField->_valueType==MED_EN::MED_INT32 ) + needConversionToInt64=true; +#endif + break; + case med_2_2::MED_FLOAT64 : + if (type != med_2_2::MED_FLOAT64) + needConversionToDouble=true; break; default: break; } - string meshName=""; + MESH * ptrMesh = 0; bool haveSupport = false; + bool haveMesh = false; if ( MED_FIELD_DRIVER::_ptrField->getSupport() ) { - // Verif sur la taille du meshName - meshName = MED_FIELD_DRIVER::_ptrField->getSupport()->getMesh()->getName() ; + // Verif à faire sur la taille du meshName + ptrMesh = MED_FIELD_DRIVER::_ptrField->getSupport()->getMesh(); + if ( ptrMesh) { + meshName = MED_FIELD_DRIVER::_ptrField->getSupport()->getMesh()->getName() ; + haveMesh = true; + } haveSupport = true; } - // Cherche le type d'entité, le nombre d'entité par type géométrique sur le type d'entité - // (MED_MAILLE ou MED_NOEUD uniquement car MEDMEMOIRE ne gère pas la connectivité descendante). - // et crée le support correspondant. - SUPPORT * mySupport = new SUPPORT(); - bool found = createFieldSupport(id,MED_FIELD_DRIVER::_fieldName, - MED_FIELD_DRIVER::_ptrField->_iterationNumber, - MED_FIELD_DRIVER::_ptrField->_orderNumber, - *mySupport, meshName) ; + // Cherche le type d'entité, le nombre d'entité par type géométrique sur le type d'entité + // (MED_MAILLE ou MED_NOEUD uniquement car MEDMEMOIRE ne gère pas la connectivité descendante). + // et crée le support correspondant. + SUPPORT * mySupport = new SUPPORT(); + vector numberOfElementsOfTypeC; + vector numberOfGaussPoint; + int totalNumberOfElWg=0; + + bool found = createFieldSupportPart1(id,fieldName, + MED_FIELD_DRIVER::_ptrField->_iterationNumber, + MED_FIELD_DRIVER::_ptrField->_orderNumber, + *mySupport, meshName, + numberOfElementsOfTypeC, numberOfGaussPoint,totalNumberOfElWg); + if ( !found ) { delete mySupport; delete[] componentName; delete[] unitName; MED_FIELD_DRIVER::_fieldNum = MED_INVALID ; throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Can't find any entity for field |" - << MED_FIELD_DRIVER::_fieldName + << fieldName << "| with (it,or) = (" << MED_FIELD_DRIVER::_ptrField->_iterationNumber << "," << MED_FIELD_DRIVER::_ptrField->_orderNumber << "), on mesh " << meshName << "|" )); } + + MED_EN::medEntityMesh entityType = mySupport->getEntity(); + //Si un SUPPORT était donné, récupère son nom, sa description et + // le pointeur du maillage associé if (! haveSupport) meshName = mySupport->getMeshName(); else { if ( mySupport->getEntity() != MED_FIELD_DRIVER::_ptrField->getSupport()->getEntity() ) { - MED_EN::medEntityMesh ent = mySupport->getEntity(); delete mySupport; delete[] componentName; delete[] unitName; MED_FIELD_DRIVER::_fieldNum = MED_INVALID ; - throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Given entity |" + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Given entity |" << MED_EN::entNames[MED_FIELD_DRIVER::_ptrField-> getSupport()->getEntity()] << "| for field |" - << MED_FIELD_DRIVER::_fieldName + << fieldName << "| with (it,or) = (" << MED_FIELD_DRIVER::_ptrField->_iterationNumber << "," << MED_FIELD_DRIVER::_ptrField->_orderNumber << "), on mesh " << meshName << "| differs from found entity |" - << MED_EN::entNames[ent] << "|." + << MED_EN::entNames[entityType] << "|." )); } mySupport->setName( MED_FIELD_DRIVER::_ptrField->getSupport()->getName() ); @@ -717,182 +871,370 @@ template void MED_FIELD_RDONLY_DRIVER22::read(void) mySupport->setDescription(MED_FIELD_DRIVER::_ptrField->getSupport()->getDescription()); } - // Test si le Support du Champ repose ou non sur toutes les entités géométriques du maillage. - // Pour tester les profils aussi ? + vector< MED_EN::medGeometryElement > MESHgeoType; + vector< int > MESHnbOfElOfType; + vector< int > MESHnbOfElOfTypeC; + if ( haveMesh ) + getMeshGeometricTypeFromMESH(ptrMesh,entityType,MESHgeoType, + MESHnbOfElOfType,MESHnbOfElOfTypeC); + + int fileHasMesh = ( med_2_2::MEDdimLire(id, const_cast(meshName.c_str())) > 0); vector< MED_EN::medGeometryElement > meshGeoType; vector< int > meshNbOfElOfType; - getMeshGeometricType(id,meshName,mySupport->getEntity(),meshGeoType,meshNbOfElOfType); + vector< int > meshNbOfElOfTypeC; + // Si le maillage n'est pas trouvé les tableaux renvoyés sont vides + if (fileHasMesh) + getMeshGeometricTypeFromFile(id,meshName,entityType,meshGeoType, + meshNbOfElOfType,meshNbOfElOfTypeC); + + + if (fileHasMesh && haveSupport ) + if ( ( meshGeoType != MESHgeoType ) || (meshNbOfElOfTypeC != MESHnbOfElOfTypeC) ) + throw MEDEXCEPTION(LOCALIZED( STRING(LOC) <<": Error while getting mesh information from file for FIELD "<< fieldName + << " on entity " << MED_EN::entNames[entityType] + << " with (it,or) = (" + << MED_FIELD_DRIVER::_ptrField->_iterationNumber << "," + << MED_FIELD_DRIVER::_ptrField->_orderNumber << ")" + << " on mesh " << meshName + << " : geometric types or number of elements by type differs from MESH object !" + ) + ); + + if ( !fileHasMesh && !haveSupport ) + throw MEDEXCEPTION(LOCALIZED( STRING(LOC) <<": Error while getting mesh information for FIELD "<< fieldName + << " on entity " << MED_EN::entNames[entityType] + << " with (it,or) = (" + << MED_FIELD_DRIVER::_ptrField->_iterationNumber << "," + << MED_FIELD_DRIVER::_ptrField->_orderNumber << ")" + << " on mesh " << meshName + << " : SUPPORT must contain a valid MESH reference or file must contain the associated MESH." + ) + ); + + + if (!fileHasMesh && haveSupport) { + meshNbOfElOfTypeC = MESHnbOfElOfTypeC; + meshGeoType = MESHgeoType; + meshNbOfElOfType = MESHnbOfElOfType; + } + + + // Test si le Support du Champ repose ou non sur toutes les entités géométriques + // du maillage associé et positionne ou non l'attribut onAll du SUPPORT. + // Il ne s'agit pas de la gestion des profils vector < MED_EN::medGeometryElement > v1( mySupport->getTypes(), mySupport->getTypes()+mySupport->getNumberOfTypes() ); - vector < int > v2(mySupport->getNumberOfElements(), - mySupport->getNumberOfElements()+mySupport->getNumberOfTypes() ); - if ( ( meshGeoType != v1 ) || meshNbOfElOfType != v2 ) { - mySupport->setAll(false); + vector v2(numberOfElementsOfTypeC.size()); + transform(numberOfElementsOfTypeC.begin(), + numberOfElementsOfTypeC.end(),v2.begin(), bind2nd(plus(),1)); + + if ( ( meshGeoType != v1 ) || meshNbOfElOfTypeC != v2 ) { + // ATTENTION : mySupport->setAll(false); + // Pb : On a envie de positionner onAll à faux si le champ n'est pas défini sur tous les + // types géométriques du maillage associé. + // Mais si onAll est false et si aucun profil n'est détecté par la suite, + // l'attribut SUPPORT->_number est censé être positionné quand même ! Que faire ? + // Si on veut être compatible avec la signification première de onAll, + // il faudrait créer des profils contenant toutes les entités pour chaque type géométrique + // du SUPPORT mais d'une part c'est dommage d'un point de vue de l'emcombrement mémoire + // et d'autre part, à la réécriture du fichier MED on stockera des profils + // alors qu'il n'y en avait pas à l'origine (fichier MED différent après lecture/écriture) ! + // Si on laisse setAll à vrai il faut être sûr que les utilisateurs prennent les + // informations sur les types gémétrique au niveau du support et non pas du maillage. + // Solution : Signification du onAll -> onAllElements des type géométriques définis + // dans le SUPPORT et non du maillage associé (dans la plupart des cas si le fichier ne + // contient pas de profil, le champ est défini sur toutes les entités de tous les types + // géométriques définis dans le maillage). } - //??support->setNumber(MEDSKYLINEARRAY * Number); - //??support->setNumber(const int * index, const int* value, bool shallowCopy=false); // If an error occurs while reading the field, these allocated FIELD member will be deleted - MED_FIELD_DRIVER::_ptrField->_name = MED_FIELD_DRIVER::_fieldName; - MED_FIELD_DRIVER::_ptrField->_numberOfComponents = numberOfComponents ; - MED_FIELD_DRIVER::_ptrField->_componentsTypes = new int[numberOfComponents] ; - MED_FIELD_DRIVER::_ptrField->_componentsNames = new string[numberOfComponents] ; - MED_FIELD_DRIVER::_ptrField->_componentsUnits = new UNIT[numberOfComponents] ; + MED_FIELD_DRIVER::_ptrField->_name = fieldName; + MED_FIELD_DRIVER::_ptrField->_numberOfComponents = numberOfComponents ; + MED_FIELD_DRIVER::_ptrField->_componentsTypes = new int [numberOfComponents] ; + MED_FIELD_DRIVER::_ptrField->_componentsNames = new string[numberOfComponents] ; + MED_FIELD_DRIVER::_ptrField->_componentsUnits = new UNIT [numberOfComponents] ; MED_FIELD_DRIVER::_ptrField->_componentsDescriptions = new string[numberOfComponents] ; - MED_FIELD_DRIVER::_ptrField->_MEDComponentsUnits = new string[numberOfComponents] ; - - for (int i=0; i::_ptrField->_MEDComponentsUnits = new string[numberOfComponents] ; + for (int i=0; i::_ptrField->_componentsTypes[i] = 1 ; MED_FIELD_DRIVER::_ptrField->_componentsNames[i] = string(componentName,i*MED_TAILLE_PNOM22,MED_TAILLE_PNOM22) ; SCRUTE(MED_FIELD_DRIVER::_ptrField->_componentsNames[i]); MED_FIELD_DRIVER::_ptrField->_MEDComponentsUnits[i] = string(unitName,i*MED_TAILLE_PNOM22,MED_TAILLE_PNOM22) ; SCRUTE(MED_FIELD_DRIVER::_ptrField->_MEDComponentsUnits[i]); - } + } delete[] componentName; delete[] unitName; - int NumberOfTypes = mySupport->getNumberOfTypes() ; - const MED_EN::medGeometryElement *Types = mySupport->getTypes() ; - T ** myValues = new T*[NumberOfTypes] ; - int * NumberOfValues = new int[NumberOfTypes] ; - int TotalNumberOfValues = 0 ; //profil a gerer en 2.2 - MESSAGE ("NumberOfTypes :"<< NumberOfTypes); + int NumberOfTypes = mySupport->getNumberOfTypes() ; + const MED_EN::medGeometryElement *types = mySupport->getTypes() ; + T * myValues = new T[totalNumberOfElWg*numberOfComponents]; + const int * nbOfElOfType = mySupport->getNumberOfElements() ; + bool anyProfil = false; + int pflSize=0,index=0; + // Le vecteur de profil est dimensionné par rapport aux nombres de types + // géométriques du champ même si le champ n'a pas de profil MED FICHIER sur + // tous ses types géométriques car dans MEDMEM si onAllElement + // du SUPPORT est false il faut positionner un profil pour tous les types géométriques + // du SUPPORT + int profilSizeC = 0; + vector < int > profilSize (NumberOfTypes,0); + vector < vector > profilList (NumberOfTypes); + vector < string > profilNameList(NumberOfTypes); + char * profilName = new char[MED_TAILLE_NOM+1]; + + MESSAGE ("NumberOfTypes : "<< NumberOfTypes); MED_FIELD_DRIVER::_ptrField->_numberOfValues=0 ; - for (int i=0; igetNumberOfElements(Types[i]) - * mySupport->getNumberOfGaussPoint(Types[i]); - myValues[i] = new T[ NumberOfValues[i]*numberOfComponents ] ; - TotalNumberOfValues+=NumberOfValues[i] ; - char * ProfilName = new char[MED_TAILLE_NOM+1]; - char * LocalGaussName = new char[MED_TAILLE_NOM+1]; - - MESSAGE ("Type["<getEntity()); - MESSAGE ("NumberOfValues :"<< NumberOfValues[i]); - MESSAGE ("NumberOfComponents :"<< numberOfComponents); - MESSAGE ("MESH_NAME :"<< meshName.c_str()); - MESSAGE ("FIELD_NAME :"<< MED_FIELD_DRIVER::_fieldName.c_str()); - MESSAGE ("MED_ENTITE :"<< (med_2_2::med_entite_maillage) mySupport->getEntity()); - MESSAGE("MED_GEOM :"<<(med_2_2::med_geometrie_element)Types[i]); - MESSAGE("Iteration :"<::_ptrField->getIterationNumber()); - MESSAGE("Order :"<::_ptrField->getOrderNumber()); - - MED_FIELD_DRIVER::_ptrField->_numberOfValues+=mySupport->getNumberOfElements(Types[i]); // Ne doit pas prendre en compte les points de Gauss - med_2_2::med_err ret; - -#if defined(IRIX64) || defined(OSF1) || defined(VPP5000) - int lgth2=NumberOfValues[i]*numberOfComponents; - if(_ptrField->getValueType()==MED_EN::MED_INT32) - { - med_2_2::med_int *temp=new med_2_2::med_int[lgth2]; - ret=med_2_2::MEDchampLire(id,const_cast (meshName.c_str()), - const_cast (MED_FIELD_DRIVER::_fieldName.c_str()), - (unsigned char*) temp, - med_2_2::MED_NO_INTERLACE, - MED_ALL, - ProfilName, - (med_2_2::med_entite_maillage) mySupport->getEntity(), - (med_2_2::med_geometrie_element)Types[i], - MED_FIELD_DRIVER::_ptrField->getIterationNumber(), - MED_FIELD_DRIVER::_ptrField->getOrderNumber() - ); - for(int i2=0;i2::_ptrField->getIterationNumber()); + MESSAGE ("Order : "<< MED_FIELD_DRIVER::_ptrField->getOrderNumber()); + MESSAGE ("NumberOfElements : "<< nbOfElOfType[typeNo]); + MESSAGE ("NumberOfComponents : "<< numberOfComponents); + MESSAGE ("NumberOfGaussPts : "<< numberOfGaussPoint[typeNo+1]); + MESSAGE ("NumberOfValuesWg : "<< nbOfElOfType[typeNo]*numberOfGaussPoint[typeNo+1]); + MESSAGE ("NumberOfValuesWgWc : "<< numberOfValuesWc); + MESSAGE ("Index : "<< index); + med_2_2::med_err ret=-1; + + med_2_2::med_int * myValuesTmp=0; + unsigned char* ptrTmp=0; + if (needConversionToDouble || needConversionToInt64 ) { + myValuesTmp = new med_2_2::med_int[numberOfValuesWc]; + ptrTmp = (unsigned char*) myValuesTmp; + } else + ptrTmp = (unsigned char*) &myValues[index]; + + //VERIFIER LE NBRE + ret=med_2_2::MEDMEMchampLire(id,const_cast (meshName.c_str() ), + const_cast (fieldName.c_str()), + (unsigned char*) ptrTmp, + med_2_2::MED_FULL_INTERLACE, + MED_ALL, + gaussModelName, + profilName, + med_2_2::MED_COMPACT, + (med_2_2::med_entite_maillage) entityType, + (med_2_2::med_geometrie_element)types[typeNo], + MED_FIELD_DRIVER::_ptrField->getIterationNumber(), + MED_FIELD_DRIVER::_ptrField->getOrderNumber() + ); + + if (needConversionToDouble || needConversionToInt64 ) { + + if (needConversionToInt64 ) //utiliser un trait + for(int i=0;i (meshName.c_str()), - const_cast (MED_FIELD_DRIVER::_fieldName.c_str()), - (unsigned char*) myValues[i], - med_2_2::MED_NO_INTERLACE, - MED_ALL, - LocalGaussName, - ProfilName, - med_2_2::MED_COMPACT, - (med_2_2::med_entite_maillage) mySupport->getEntity(), - (med_2_2::med_geometrie_element) Types[i], - MED_FIELD_DRIVER::_ptrField->getIterationNumber(), - MED_FIELD_DRIVER::_ptrField->getOrderNumber() - ); - if (ret < 0) - { - // The Field can't be read then we mustdelete all previously allocated members in FIELD - for(int j=0; j<=i;j++) - delete[] myValues[j]; - delete[] myValues; - delete[] NumberOfValues ; - delete[] ProfilName; - delete[] LocalGaussName; - delete[] MED_FIELD_DRIVER::_ptrField->_componentsTypes ; - delete[] MED_FIELD_DRIVER::_ptrField->_componentsNames ; - delete[] MED_FIELD_DRIVER::_ptrField->_componentsUnits ; - delete[] MED_FIELD_DRIVER::_ptrField->_componentsDescriptions ; - delete[] MED_FIELD_DRIVER::_ptrField->_MEDComponentsUnits ; - MED_FIELD_DRIVER::_ptrField->_componentsTypes = NULL ; - MED_FIELD_DRIVER::_ptrField->_componentsNames = NULL ; - MED_FIELD_DRIVER::_ptrField->_componentsUnits = NULL ; - MED_FIELD_DRIVER::_ptrField->_componentsDescriptions = NULL ; - MED_FIELD_DRIVER::_ptrField->_MEDComponentsUnits = NULL ; - MED_FIELD_DRIVER::_fieldNum = MED_INVALID ; // we have not found right field, so reset the field number - throw MEDEXCEPTION( LOCALIZED( STRING(LOC) <<": ERROR when read value")) ; - } + for(int i=0;i::_ptrField->_componentsTypes ; + delete[] MED_FIELD_DRIVER::_ptrField->_componentsNames ; + delete[] MED_FIELD_DRIVER::_ptrField->_componentsUnits ; + delete[] MED_FIELD_DRIVER::_ptrField->_componentsDescriptions ; + delete[] MED_FIELD_DRIVER::_ptrField->_MEDComponentsUnits ; + MED_FIELD_DRIVER::_ptrField->_componentsTypes = NULL ; + MED_FIELD_DRIVER::_ptrField->_componentsNames = NULL ; + MED_FIELD_DRIVER::_ptrField->_componentsUnits = NULL ; + MED_FIELD_DRIVER::_ptrField->_componentsDescriptions = NULL ; + MED_FIELD_DRIVER::_ptrField->_MEDComponentsUnits = NULL ; + MED_FIELD_DRIVER::_fieldNum = MED_INVALID ; // we have not found right field, so reset the field number + throw MEDEXCEPTION( LOCALIZED( STRING(LOC) <<": ERROR while reading values")) ; + } + index += numberOfValuesWc; + // Le support prend en compte le nombre de valeurs lié aux profils + MED_FIELD_DRIVER::_ptrField->_numberOfValues+= + nbOfElOfType[typeNo];// Ne doit pas prendre en compte les points de Gauss + + // second et troisième test lié à un bug medfichier + if ( strcmp(gaussModelName,MED_NOGAUSS) && strcmp(gaussModelName,string(MED_TAILLE_NOM,' ').c_str() ) + && strcmp(gaussModelName,string(16,' ').c_str() ) ) { + + int type_geo = (int) types[typeNo]; + int t1 = (type_geo%100)*(type_geo/100); + int ngauss = numberOfGaussPoint[typeNo+1]; + int t2 = ngauss*(type_geo/100); + med_2_2::med_float * refcoo = new med_2_2::med_float[t1]; + med_2_2::med_float * gscoo = new med_2_2::med_float[t2]; + med_2_2::med_float * wg = new med_2_2::med_float[ngauss]; + + if (MEDgaussLire(id, refcoo, gscoo, wg, (med_2_2::med_mode_switch) interlacingType, + gaussModelName ) < 0) + throw MEDEXCEPTION(LOCALIZED( STRING(LOC) <<": Error while reading Gauss Model |" + << gaussModelName << "| for FIELD "<< fieldName + << " on geometric type " << MED_EN::geoNames[types[typeNo]] + ) + ); + if (isFullInterlace ) { //serait inutile avec un driver template du type d'entrelacement + GAUSS_LOCALIZATION * loc; + loc = new GAUSS_LOCALIZATION(gaussModelName,types[typeNo],ngauss, refcoo,gscoo, wg); + MED_FIELD_DRIVER::_ptrField->_gaussModel[types[typeNo]]=loc; + } else { + GAUSS_LOCALIZATION * loc; + loc = new GAUSS_LOCALIZATION(gaussModelName,types[typeNo],ngauss, refcoo,gscoo, wg); + MED_FIELD_DRIVER::_ptrField->_gaussModel[types[typeNo]]=loc; + } +// cout << *MED_FIELD_DRIVER::_ptrField->_gaussModel[types[typeNo]] << endl; + delete [] refcoo;delete [] gscoo; delete [] wg; } + delete[] gaussModelName ; + + if ( strcmp(profilName,MED_NOPFL) ) { + anyProfil = true; + pflSize = med_2_2::MEDnValProfil(id,profilName); + if ( pflSize <= 0) + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<" Error while reading the profil size of |" + << profilName << "|" )); + + profilSize[typeNo]=pflSize; + profilList[typeNo].resize(pflSize); + ret = med_2_2::MEDprofilLire(id,&profilList[typeNo][0],profilName); // cf item 16 Effective STL + profilNameList[typeNo]=string(profilName); + } + } - // allocate _value - // Créer un driver spécifique pour les modes MED_FULL_INTERLACE et MED_NO_INTERLACE - // serait plus efficicace. - ArrayNo * Values = new ArrayNo(numberOfComponents,TotalNumberOfValues); + delete[] profilName ; - for (int i=0; igetRow(i+1) ; - int Count = 1 ; - for (int j=0; j::_ptrField->_numberOfValues+=NumberOf; // problem with gauss point : _numberOfValues != TotalNumberOfValues !!!!!!! - int offset = NumberOf*i ; - for (int k=0 ; ksetIJ(Count,i+1,myValue[k+offset]); -// SCRUTE(Count); -// SCRUTE(Values->getIJ(Count,i+1)); - Count++; - } + //MESSAGE ("Index : "<< index); + assert(index == totalNumberOfElWg*numberOfComponents); + assert(MED_FIELD_DRIVER::_ptrField->_numberOfValues == mySupport->getNumberOfElements(MED_ALL_ELEMENTS)); + + if (anyProfil) { + + for (int typeNo=0; typeNo < NumberOfTypes; typeNo++) { + + // Trouve l'index du type géométrique dans la liste des types géométriques du maillage + // correspondant au type géométrique du champ traité + vector::iterator meshTypeNoIt = + find(meshGeoType.begin(),meshGeoType.end(),types[typeNo]); //Gérer l'exception + if ( meshTypeNoIt == meshGeoType.end() ) + throw MEDEXCEPTION(LOCALIZED( STRING(LOC) <<": Can't find "<< MED_EN::geoNames[types[typeNo]] + << " on entity " << MED_EN::entNames[entityType] + << " in geometric type list of mesh " << meshName + ) + ); + int meshTypeNo = meshTypeNoIt - meshGeoType.begin(); + + if (! profilList[typeNo].empty() ) { + +// for (int j =0 ; j< meshGeoType.size();++j) +// cout << "--MeshTypeNo : "< meshNbOfElOfTypeC["<(numberOfGaussPoint.size(),1)); + SCRUTE(anyGauss); + MEDMEM_Array_ * Values; + if (anyGauss) { + SCRUTE(mySupport->getNumberOfElements(MED_ALL_ELEMENTS) ); + SCRUTE(NumberOfTypes); + SCRUTE(numberOfElementsOfTypeC[NumberOfTypes]-1); + assert(mySupport->getNumberOfElements(MED_ALL_ELEMENTS) == (numberOfElementsOfTypeC[NumberOfTypes]-1) ); + Values = new ArrayFullWg(myValues, + numberOfComponents, + numberOfElementsOfTypeC[NumberOfTypes]-1, + // Up : Prend en compte les profils et + // Ne prend pas en compte le nbre de composantes et + // le nombre de points de Gauss + NumberOfTypes, + &numberOfElementsOfTypeC[0], + &numberOfGaussPoint[0], + true,true); +// cout << "Valeurs du ArrayFullWg crée : " << endl << +// *(static_cast(Values)) << endl; + } else + Values = new ArrayFull(myValues,numberOfComponents,totalNumberOfElWg, + true,true); if (MED_FIELD_DRIVER::_ptrField->_value != NULL) delete MED_FIELD_DRIVER::_ptrField->_value; - if ( MED_FIELD_DRIVER::_ptrField->getInterlacingType() == MED_EN::MED_FULL_INTERLACE ) + if ( MED_FIELD_DRIVER::_ptrField->getInterlacingType() == MED_EN::MED_NO_INTERLACE ) { - // dynamic_cast inutile - MED_FIELD_DRIVER::_ptrField->_value=dynamic_cast(ArrayConvert(*Values)); + if (Values->getGaussPresence()) + MED_FIELD_DRIVER::_ptrField->_value=ArrayConvert(*static_cast(Values)); + else + MED_FIELD_DRIVER::_ptrField->_value=ArrayConvert(*static_cast(Values)); delete Values; } else MED_FIELD_DRIVER::_ptrField->_value=Values; MED_FIELD_DRIVER::_ptrField->_isRead = true ; - - MED_FIELD_DRIVER::_ptrField->_support=mySupport; //Prévenir l'utilisateur ? - + + MED_FIELD_DRIVER::_ptrField->_support=mySupport; //Prévenir l'utilisateur ? + + END_OF(LOC); } @@ -920,219 +1262,446 @@ template void MED_FIELD_WRONLY_DRIVER22::write(void) const { const char * LOC = "MED_FIELD_WRONLY_DRIVER22::write(void) const " ; BEGIN_OF(LOC); - - typedef typename MEDMEM_ArrayInterface::Array ArrayNo; + typedef typename MEDMEM_ArrayInterface::Array ArrayNo; + typedef typename MEDMEM_ArrayInterface::Array ArrayNoWg; typedef typename MEDMEM_ArrayInterface::Array ArrayFull; + typedef typename MEDMEM_ArrayInterface::Array ArrayFullWg; - if (MED_FIELD_DRIVER::_status==MED_OPENED) - { - int err ; - - int component_count=MED_FIELD_DRIVER::_ptrField->getNumberOfComponents(); - string component_name(component_count*MED_TAILLE_PNOM22,' ') ; - string component_unit(component_count*MED_TAILLE_PNOM22,' ') ; - - const string * listcomponent_name=MED_FIELD_DRIVER::_ptrField->getComponentsNames() ; - const string * listcomponent_unit=MED_FIELD_DRIVER::_ptrField->getMEDComponentsUnits() ; - int length ; - for (int i=0; i < component_count ; i++) { - length = min(MED_TAILLE_PNOM22,(int)listcomponent_name[i].size()); - component_name.replace(i*MED_TAILLE_PNOM22,length, - listcomponent_name[i],0,length); - length = min(MED_TAILLE_PNOM22,(int)listcomponent_unit[i].size()); - component_unit.replace(i*MED_TAILLE_PNOM22,length, - listcomponent_unit[i],0,length); - } + typedef map*> locMapFull; + typedef map*> locMapNo; + typedef map locMap; - MESSAGE("component_name=|"<::_ptrField->getValueType() ; - - MESSAGE("Template Type =|"<::_medIdt,0); - int nbComp ; - for (int i=1; i<=n; i++) { - nbComp = med_2_2::MEDnChamp(MED_FIELD_DRIVER22::_medIdt,i); - compName = new char[MED_TAILLE_PNOM22*nbComp+1]; - compUnit = new char[MED_TAILLE_PNOM22*nbComp+1]; - err = med_2_2::MEDchampInfo(MED_FIELD_DRIVER22::_medIdt,i,champName,&type,compName,compUnit,nbComp); - if (err == 0) - if (strcmp(champName,MED_FIELD_DRIVER::_ptrField->getName().c_str())==0) { // Found ! - Find = true ; - break ; - } - delete[] compName ; - delete[] compUnit ; - } - delete[] champName ; - if (Find) { - // the same ? - if (nbComp != component_count) - throw MEDEXCEPTION( LOCALIZED (STRING(LOC) - <<": Field exist in file, but number of component are different : "<::_medIdt; - } else { - // Verify the field doesn't exist - - string dataGroupName = "/CHA/"; - dataGroupName += MED_FIELD_DRIVER::_ptrField->getName(); - MESSAGE(LOC << "|" << dataGroupName << "|" ); - med_2_2::med_idt gid = H5Gopen(MED_FIELD_DRIVER22::_medIdt, dataGroupName.c_str() ); - - if ( gid < 0 ) { - // create field : - err=med_2_2::MEDchampCr(MED_FIELD_DRIVER22::_medIdt, - const_cast ((MED_FIELD_DRIVER::_ptrField->getName()).c_str()), - (med_2_2::med_type_champ) ValueType, - const_cast ( component_name.c_str() ), - const_cast ( component_unit.c_str() ), - component_count); - if ( err < 0 ) - throw MEDEXCEPTION( LOCALIZED (STRING(LOC) - << ": Error MEDchampCr : "<::_status!=MED_OPENED) + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<": Method open must be called before method read.")) ; + + string fieldName; + if ( ( MED_FIELD_DRIVER::_fieldName.empty() ) && + ( MED_FIELD_DRIVER::_ptrField->_name.empty() ) ) + throw MEDEXCEPTION(LOCALIZED(STRING(LOC) + <<" neither is set in driver nor in object FIELD.")) ; + + // If _fieldName is not set in driver, try to use _ptrfield->_fieldName + if ( ( MED_FIELD_DRIVER::_fieldName.empty() ) && + ( !MED_FIELD_DRIVER::_ptrField->_name.empty() ) ) + fieldName=MED_FIELD_DRIVER::_ptrField->_name; + else + fieldName = MED_FIELD_DRIVER::_fieldName; - const SUPPORT * mySupport = MED_FIELD_DRIVER::_ptrField->getSupport() ; + SCRUTE(fieldName); + if ( fieldName.size() > MED_TAILLE_NOM ) { + fieldName.substr(0,MED_TAILLE_NOM); + MESSAGE( "Be careful size must not be > MED_TAILLE_NOM, using fieldName : |"<< fieldName <<"|." ); + } + + const SUPPORT * mySupport = MED_FIELD_DRIVER::_ptrField->getSupport() ; + if ( ! mySupport ) + throw MEDEXCEPTION(LOCALIZED(STRING(LOC) + <<" There is no SUPPORT associated with FIELD : " + << fieldName << ".")); + + bool onAll = mySupport->isOnAllElements(); + const locMap & gaussModel = MED_FIELD_DRIVER::_ptrField->_gaussModel; + + + string meshName = mySupport->getMeshName(); + SCRUTE(meshName); + if ( meshName.size() > MED_TAILLE_NOM ) { + meshName = meshName.substr(0,MED_TAILLE_NOM); + MESSAGE( "Be careful size must not be > MED_TAILLE_NOM, using meshName : |"<< meshName <<"|." ); + } + MED_EN::medEntityMesh entityType = mySupport->getEntity(); - if (! mySupport->isOnAllElements()) - throw MEDEXCEPTION( LOCALIZED (STRING(LOC) - <<": Field must be on all entity" + // Reconstruit les listes contigues des noms de composantes et des unités + // Les noms sont tronqués à MED_TAILLE_PNOM22 + int err ; + int component_count=MED_FIELD_DRIVER::_ptrField->getNumberOfComponents(); + string component_name(component_count*MED_TAILLE_PNOM22,' ') ; + string component_unit(component_count*MED_TAILLE_PNOM22,' ') ; + + const string * listcomponent_name=MED_FIELD_DRIVER::_ptrField->getComponentsNames() ; + const string * listcomponent_unit=MED_FIELD_DRIVER::_ptrField->getMEDComponentsUnits() ; + int length ; + for (int i=0; i < component_count ; i++) { + length = min(MED_TAILLE_PNOM22,(int)listcomponent_name[i].size()); + component_name.replace(i*MED_TAILLE_PNOM22,length, + listcomponent_name[i],0,length); + length = min(MED_TAILLE_PNOM22,(int)listcomponent_unit[i].size()); + component_unit.replace(i*MED_TAILLE_PNOM22,length, + listcomponent_unit[i],0,length); + } + + MESSAGE("using component_name=|"<::_ptrField->getValueType() ; + + MESSAGE("Template Type =|"< (fieldName.c_str()), + (med_2_2::med_type_champ) ValueType, + const_cast ( component_name.c_str() ), + const_cast ( component_unit.c_str() ), + component_count); + if ( err < 0 ) + throw MEDEXCEPTION( LOCALIZED (STRING(LOC) + << ": Error MEDchampCr : "<getMesh() ; - string MeshName = myMesh->getName() ; - //MED_EN::medModeSwitch Mode = MED_FIELD_DRIVER::_ptrField->_value->getMode() ; - // on boucle sur tout les types pour ecrire les tableaux de valeur - int NumberOfType = mySupport->getNumberOfTypes() ; - int Index = 1 ; - const MED_EN::medGeometryElement * Types = mySupport->getTypes() ; - const int * NumberOfGaussPoint = mySupport->getNumberOfGaussPoint() ; - - const T * value = NULL; - ArrayFull * myArray = NULL; - if ( MED_FIELD_DRIVER::_ptrField->getInterlacingType() == MED_EN::MED_FULL_INTERLACE ) - myArray = MED_FIELD_DRIVER::_ptrField->getArrayNoGauss(); - else - { - // En attendant la convertion de FIELD, on utilise le ArrayConvert - // ( les infos _ptrField-> sont les mêmes ) - myArray = ArrayConvert( *( dynamic_cast< ArrayNo * > - (MED_FIELD_DRIVER::_ptrField->getArrayNoGauss() - )) - ); - } + } + else H5Gclose(gid); + } - for (int i=0;igetNumberOfElements(Types[i]) ; - - //value = MED_FIELD_DRIVER::_ptrField->getRow(Index) ; - value = myArray->getRow(Index) ; - - MESSAGE("MED_FIELD_DRIVER22::_medIdt : "<::_medIdt); - MESSAGE("MeshName.c_str() : "<::_ptrField->getName() : "<::_ptrField->getName()); - MESSAGE("value : "<getEntity() : "<getEntity()); - MESSAGE("Types[i] : "<::_ptrField->getIterationNumber() : "<::_ptrField->getIterationNumber()); - MESSAGE("MED_FIELD_DRIVER::_ptrField->getTime() : "<::_ptrField->getTime()); - MESSAGE("MED_FIELD_DRIVER::_ptrField->getOrderNumber() : "<::_ptrField->getOrderNumber()); - -/* char chanom[MED_TAILLE_NOM+1]; - char chacomp[MED_TAILLE_NOM+1]; - char chaunit[MED_TAILLE_NOM+1]; - med_2_2::med_type_champ chatype; - med_int chancomp=1; - - err=med_2_2::MEDchampInfo(MED_FIELD_DRIVER22::_medIdt,1,chanom,&chatype,chacomp,chaunit,chancomp); - - if (err<0) - { - cout<<"=======================================================================> gros probleme"< nom lu = "< type lu = "< nom composante lu = "< nom unit lu = "< valeur de med_2_2::MED_REEL64 = "< ( MeshName.c_str()) , //( string(mesh_name).resize(MED_TAILLE_NOM).c_str()) -// const_cast ( (_ptrField->getName()).c_str()), -// (unsigned char*)value, -// med_2_2::MED_FULL_INTERLACE, -// NumberOfElements, -// NumberOfGaussPoint[i], -// MED_ALL, -// MED_NOPFL, -// med_2_2::MED_REMP, // PROFIL NON GERE, mode de remplacement non géré -// (med_2_2::med_entite_maillage)mySupport->getEntity(), -// (med_2_2::med_geometrie_element)Types[i], -// _ptrField->getIterationNumber(), -// " ", -// _ptrField->getTime(), -// _ptrField->getOrderNumber() -// ); - - err=med_2_2::MEDchampEcr(MED_FIELD_DRIVER22::_medIdt, - const_cast ( MeshName.c_str()) , //( string(mesh_name).resize(MED_TAILLE_NOM).c_str()) - const_cast ( (MED_FIELD_DRIVER::_ptrField->getName()).c_str()), - (unsigned char*)value, - med_2_2::MED_FULL_INTERLACE, - NumberOfElements*NumberOfGaussPoint[i], - MED_NOGAUSS, MED_ALL, MED_NOPFL, - med_2_2::MED_NO_PFLMOD, // PROFIL NON GERE, mode de remplacement non géré - (med_2_2::med_entite_maillage)mySupport->getEntity(), - (med_2_2::med_geometrie_element)Types[i], - MED_FIELD_DRIVER::_ptrField->getIterationNumber(), - " ", - MED_FIELD_DRIVER::_ptrField->getTime(), - MED_FIELD_DRIVER::_ptrField->getOrderNumber() - ); - if (err < MED_VALID ) - { - if ( MED_FIELD_DRIVER::_ptrField->getInterlacingType() == MED_EN::MED_NO_INTERLACE ) delete myArray; - throw MEDEXCEPTION(LOCALIZED( STRING(LOC) - <<": Error in writing Field "<< MED_FIELD_DRIVER::_ptrField->getName() <<", type "< * myField = 0; + if ( MED_FIELD_DRIVER::_ptrField->getInterlacingType() == MED_EN::MED_FULL_INTERLACE ) + myField = MED_FIELD_DRIVER::_ptrField; + else + myField = FieldConvert( *( dynamic_cast< FIELD * > (MED_FIELD_DRIVER::_ptrField ) + ) + ); + + + // Il est necessaire de calculer le tableau + // du nombre d'entités cumulées de chaque type géométrique du maillage + // pour convertir les profils de la numérotation globale + // à la numérotation locale au type géométrique. + // Pour celà on établit ce tableau à partir de l'objet MESH si la relation SUPPORT-MESH existe. + // Si le maillage existe dans le fichier MED on essaye également de reconstituer ce tableau + // pour vérifier la cohérence des informations. + // Si la relation SUPPRT-MESH n'esiste pas on constitue le tableau uniquement à partir du fichier qui + // doit alors obligatoirement contenir le maillage. + const int * number, *numberIndex = 0; + string profilName; + vector profilNameList; + vector meshGeoType; + vector meshNbOfElOfType; + vector meshNbOfElOfTypeC; + vector fileMeshGeoType; + vector fileMeshNbOfElOfType; + vector fileMeshNbOfElOfTypeC; + med_2_2::med_int fileHasMesh=0; + + if (!onAll) { + + number = mySupport->getNumber(MED_ALL_ELEMENTS); + numberIndex = mySupport->getNumberIndex(); + profilNameList=mySupport->getProfilNames(); + + fileHasMesh = ( med_2_2::MEDdimLire(id, const_cast(meshName.c_str())) > 0); + MESH * meshPtr = mySupport->getMesh(); + + if (fileHasMesh) + getMeshGeometricTypeFromFile(id, meshName, + entityType, + fileMeshGeoType,fileMeshNbOfElOfType,fileMeshNbOfElOfTypeC); + + if (meshPtr) { + + getMeshGeometricTypeFromMESH( meshPtr, entityType,meshGeoType, + meshNbOfElOfType, + meshNbOfElOfTypeC); + + if (fileHasMesh) + if ( ( fileMeshGeoType != meshGeoType ) || (fileMeshNbOfElOfTypeC != meshNbOfElOfTypeC) ) + throw MEDEXCEPTION(LOCALIZED( STRING(LOC) <<": Error while getting mesh information from file for FIELD "<< fieldName + << " on entity " << MED_EN::entNames[entityType] + << " with (it,or) = (" + << MED_FIELD_DRIVER::_ptrField->_iterationNumber << "," + << MED_FIELD_DRIVER::_ptrField->_orderNumber << ")" + << " on mesh " << meshName + << " : geometric types or number of elements by type differs from MESH object !" + ) + ); + + } + + if ( !fileHasMesh && meshPtr==0 ) + throw MEDEXCEPTION(LOCALIZED( STRING(LOC) <<": Error while getting mesh information for FIELD "<< fieldName + << " on entity " << MED_EN::entNames[entityType] + << " with (it,or) = (" + << MED_FIELD_DRIVER::_ptrField->_iterationNumber << "," + << MED_FIELD_DRIVER::_ptrField->_orderNumber << ")" + << " on mesh " << meshName + << " : SUPPORT must contain a valid MESH reference or file must contain the associated MESH." + ) + ); + + + if (fileHasMesh && !meshPtr) { + meshNbOfElOfTypeC = fileMeshNbOfElOfTypeC; + meshGeoType = fileMeshGeoType; + meshNbOfElOfType = fileMeshNbOfElOfType; + } + } + + const MED_EN::medGeometryElement * types = mySupport->getTypes() ; + int numberOfTypes = mySupport->getNumberOfTypes() ; + int numberOfElForMED = -1; + const T * value = NULL; + int index = 1 ; + // on boucle sur tout les types pour ecrire les tableaux de valeur + for (int typeNo=0;typeNogetNumberOfElements(types[typeNo]) ; + //UP : prend en compte les profils, pas les points de Gauss + + //value = MED_FIELD_DRIVER::_ptrField->getRow(index) ; + // rem 1 : le getRow du Array est différent de celui du FIELD si le SUPPORT contient + // des profils (les indices des valeurs ne se suivent pas forcément) + // rem 2 : Afin de respecter la norme MEDFICHIER, les indices contenus dans les + // profils doivent être croissant + if (onAll) { + value = myField->getRow(index); + profilName=MED_NOPFL; + numberOfElForMED = numberOfElements; + } else { + value = myField->getRow(number[index-1]); + profilName = profilNameList[typeNo].substr(0,MED_TAILLE_NOM); + // Rem : Si le SUPPORT n'est pas onAll mais que pour un type géométrique donné le nom + // du profil associé est MED_NOPFL alors le profil n'est pas écrit dans le fichier MED. + // Car en MEDMEMOIRE si le champ repose sur des éléments de deux types géométriques + // différents et est défini sur tous les éléments d'un type géométrique + // mais pas de l'autre, il existe tout de même des profils sur les deux types géométriques. + // Ce n'est pas le cas en MEDFICHIER. + vector profil(&number[index-1],&(number[index-1])+numberOfElements); + + // Trouve l'index du type géométrique dans la liste des types géométriques du maillage + // correspondant au type géométrique du champ en cours de traitement + vector::iterator meshTypeNoIt = + find(meshGeoType.begin(),meshGeoType.end(),types[typeNo]); + if ( meshTypeNoIt == meshGeoType.end() ) + throw MEDEXCEPTION(LOCALIZED( STRING(LOC) <<": Can't find "<< MED_EN::geoNames[types[typeNo]] + << " on entity " << MED_EN::entNames[entityType] + << " in geometric type list of mesh " << meshName + ) + ); + + int meshTypeNo = meshTypeNoIt - meshGeoType.begin(); + + if ( profilName == MED_NOPFL && profil.size() != meshNbOfElOfType[meshTypeNo] ) + throw MEDEXCEPTION(LOCALIZED( STRING(LOC) <<": Error while creating profil for FIELD "<< fieldName + << " on entity " << MED_EN::entNames[entityType] + << " and geometric type " << MED_EN::geoNames[types[typeNo]] << " with (it,or) = (" + << MED_FIELD_DRIVER::_ptrField->_iterationNumber << "," + << MED_FIELD_DRIVER::_ptrField->_orderNumber << "), with profilName " + << profilName << " on mesh " << meshName + << " : There is no profileName but profilsize (" <::_ptrField->_iterationNumber << "," + << MED_FIELD_DRIVER::_ptrField->_orderNumber << "), with profilName " + << profilName << " on mesh " << meshName + << " : profil["<(profilName.c_str())) < 0) + + throw MEDEXCEPTION(LOCALIZED( STRING(LOC) <<": Error while writing "<< numberOfElements + << " values for MED profil "<< profilName + ) + ); + } + + + string locName=MED_NOGAUSS; + if (myField->getGaussPresence()) { +// cout << endl << "Nombre de points de Gauss à l'écriture de " << fieldName +// << " pour le type géométrique : " << MED_EN::geoNames[types[typeNo]] +// << " : " << myField->getNumberOfGaussPoints(types[typeNo]) << endl; +// cout << *mySupport << endl; + + const GAUSS_LOCALIZATION_ * locPtr=0; + locMap::const_iterator it; + if ( ( it = gaussModel.find(types[typeNo])) != gaussModel.end() ) + locPtr = (*it).second; + else + throw MEDEXCEPTION(LOCALIZED( STRING(LOC) <<": Error while creating Gauss Model for FIELD "<< fieldName + << " on entity " << MED_EN::entNames[entityType] + << " and geometric type " << MED_EN::geoNames[types[typeNo]] << " with (it,or) = (" + << MED_FIELD_DRIVER::_ptrField->_iterationNumber << "," + << MED_FIELD_DRIVER::_ptrField->_orderNumber << "), with profilName " + << profilName << " on mesh " << meshName + << " : Can't find a Gauss localisation model for this geometric type" + ) + ); + + int ngauss = -1; + if ( locPtr->getInterlacingType() == MED_EN::MED_FULL_INTERLACE ) { + const GAUSS_LOCALIZATION & loc=*(static_cast * >(locPtr)); + ngauss = loc.getNbGauss(); + locName=loc.getName(); + err=med_2_2::MEDMEMgaussEcr(id, + (med_2_2::med_geometrie_element) loc.getType(), + (med_2_2::med_float *) loc.getRefCoo().getPtr(), + med_2_2::MED_FULL_INTERLACE, + (med_2_2::med_int) ngauss, + (med_2_2::med_float *) loc.getGsCoo().getPtr(), + (med_2_2::med_float *) (&loc.getWeight()[0]), + const_cast (locName.c_str()) + ); + } else { + const GAUSS_LOCALIZATION & loc=*(static_cast * >(locPtr)); + ngauss = loc.getNbGauss(); + locName=loc.getName(); + err=med_2_2::MEDMEMgaussEcr(id, + (med_2_2::med_geometrie_element) loc.getType(), + (med_2_2::med_float *) loc.getRefCoo().getPtr(), + med_2_2::MED_NO_INTERLACE, + (med_2_2::med_int) ngauss, + (med_2_2::med_float *) loc.getGsCoo().getPtr(), + (med_2_2::med_float *) (&loc.getWeight()[0]), + const_cast (locName.c_str()) ); - } - Index += NumberOfElements ; - - } - if ( MED_FIELD_DRIVER::_ptrField->getInterlacingType() == MED_EN::MED_NO_INTERLACE ) delete myArray; + }; + + if ( err != 0 ) + throw MEDEXCEPTION(LOCALIZED( STRING(LOC) <<": Error while writing Gauss Model for FIELD "<< fieldName + << " on entity " << MED_EN::entNames[entityType] + << " and geometric type " << MED_EN::geoNames[types[typeNo]] + ) + ); + + //numberOfElForMED *= mySupport->getNumberOfGaussPoints(types[typeNo]); //Deplacer la méthode dans FIELD + numberOfElForMED *= ngauss; + } + MESSAGE("MED_FIELD_DRIVER22::_medIdt : "<::_ptrField->getName() : "<::_ptrField->getName()); + MESSAGE("MED_FIELD_DRIVER::_fieldName : "<::_fieldName); + MESSAGE("value : "<getNumberOfGaussPoints(types[typeNo])); + MESSAGE("MED_FIELD_DRIVER::_ptrField->getIterationNumber() : "<::_ptrField->getIterationNumber()); + MESSAGE("MED_FIELD_DRIVER::_ptrField->getTime() : "<::_ptrField->getTime()); + MESSAGE("MED_FIELD_DRIVER::_ptrField->getOrderNumber() : "<::_ptrField->getOrderNumber()); + + // Rem 1 : le nombre d'éléments passé à MEDchampEcr ne doit pas tenir compte de la taille + // des profils : c'est la taille du champ sans profil. + err=med_2_2::MEDchampEcr(id, + const_cast ( meshName.c_str()) , + const_cast ( fieldName.c_str()), + (unsigned char*)value, med_2_2::MED_FULL_INTERLACE, + numberOfElForMED, + //UP : prend en compte le nombre de points de Gauss mais + // pas le nombre de composantes + const_cast ( locName.c_str()), + MED_ALL, + const_cast (profilName.c_str()), med_2_2::MED_COMPACT, + (med_2_2::med_entite_maillage)entityType, + (med_2_2::med_geometrie_element)types[typeNo], + MED_FIELD_DRIVER::_ptrField->getIterationNumber(), + " ", // A FAIRE : IMPLEMENTER L'UNITE DU PAS DE TEMPS! + MED_FIELD_DRIVER::_ptrField->getTime(), + MED_FIELD_DRIVER::_ptrField->getOrderNumber() + ); + + if (err < MED_VALID ) { + if ( MED_FIELD_DRIVER::_ptrField->getInterlacingType() == MED_EN::MED_NO_INTERLACE ) delete myField; + throw MEDEXCEPTION(LOCALIZED( STRING(LOC) <<": Error while writing "<< numberOfElements << " values for FIELD "<< fieldName + << " on entity " << MED_EN::entNames[entityType] + << " and geometric type " << MED_EN::geoNames[types[typeNo]] + << " with (it,or) = (" + << MED_FIELD_DRIVER::_ptrField->_iterationNumber << "," + << MED_FIELD_DRIVER::_ptrField->_orderNumber << "), with profilName " + << profilName << " on mesh " << meshName + ) + ); } - + + index += numberOfElements ; //Ne doit pas prendre en compte le nombre de points de GAUSS + //ni les composantes. + + } + if ( MED_FIELD_DRIVER::_ptrField->getInterlacingType() == MED_EN::MED_NO_INTERLACE ) delete myField; + + END_OF(LOC); } @@ -1147,9 +1716,9 @@ template void MED_FIELD_RDWR_DRIVER22::write(void) const throw (MEDEXCEPTION) { BEGIN_OF("MED_FIELD_RDWR_DRIVER22::write(void)"); - MED_FIELD_WRONLY_DRIVER22::write(); + MED_FIELD_WRONLY_DRIVER22::write(); END_OF("MED_FIELD_RDWR_DRIVER22::write(void)"); -} +} template void MED_FIELD_RDWR_DRIVER22::read (void) throw (MEDEXCEPTION) diff --git a/src/MEDMEM/MEDMEM_MedMeshDriver.hxx b/src/MEDMEM/MEDMEM_MedMeshDriver.hxx index e5ae224ad..f4b88f85b 100644 --- a/src/MEDMEM/MEDMEM_MedMeshDriver.hxx +++ b/src/MEDMEM/MEDMEM_MedMeshDriver.hxx @@ -45,9 +45,9 @@ class CONNECTIVITY; class MED_MESH_DRIVER : public GENDRIVER { protected: - - MESH * _ptrMesh; - string _meshName; // const ? + + MESH * _ptrMesh; + mutable string _meshName; int _meshNum; // INUTILE ? @@ -60,8 +60,8 @@ public : /*! Constructor. */ - MED_MESH_DRIVER(const string & fileName, - MESH * ptrMesh, + MED_MESH_DRIVER(const string & fileName, + MESH * ptrMesh, MED_EN::med_mode_acces accessMode) ; /*! Copy constructor. diff --git a/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx b/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx index 307619c71..eb8c8756c 100644 --- a/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx +++ b/src/MEDMEM/MEDMEM_MedMeshDriver22.cxx @@ -138,7 +138,7 @@ MED_MESH_RDONLY_DRIVER22::~MED_MESH_RDONLY_DRIVER22() { //MESSAGE("MED_MESH_RDONLY_DRIVER22::~MED_MESH_RDONLY_DRIVER() has been destroyed"); } - + GENDRIVER * MED_MESH_RDONLY_DRIVER22::copy(void) const { return new MED_MESH_RDONLY_DRIVER22(*this); @@ -151,6 +151,19 @@ void MED_MESH_RDONLY_DRIVER22::read(void) if (_status!=MED_OPENED) throw MEDEXCEPTION(LOCALIZED(STRING(LOC) << "The _idt of file " << _fileName << " is : " << _medIdt << " (the file is not opened)." )) ; + if ( ( _meshName.empty() ) && ( _ptrMesh->_name.empty() ) ) + throw MEDEXCEPTION(LOCALIZED(STRING(LOC) + <<" neither is set in driver nor in object MESH.")) ; + + // If _meshName is not set in driver, try to use _ptrMesh->_name + if ( ( _meshName.empty() ) && ( !_ptrMesh->_name.empty() ) ) + _meshName=_ptrMesh->_name; + + if ( _meshName.size() > MED_TAILLE_NOM ) + throw MEDEXCEPTION(LOCALIZED(STRING(LOC) + <<" size in object driver MESH is > MED_TAILLE_NOM .")); + + _ptrMesh->_name = _meshName; SCRUTE(_ptrMesh->getIsAGrid()); @@ -1787,6 +1800,20 @@ void MED_MESH_WRONLY_DRIVER22::write(void) const if (_status!=MED_OPENED) throw MEDEXCEPTION(LOCALIZED(STRING(LOC) << "File "<<_fileName<<" is not open. Open it before write !")); + string fieldName; + if ( ( _meshName.empty() ) && ( _ptrMesh->_name.empty() ) ) + throw MEDEXCEPTION(LOCALIZED(STRING(LOC) + <<" neither is set in driver nor in object MESH.")) ; + + // If _meshName is not set in driver, try to use _ptrmesh->_meshName + if ( ( _meshName.empty() ) && ( !_ptrMesh->_name.empty() ) ) + _meshName=_ptrMesh->_name; + + if ( _meshName.size() > MED_TAILLE_NOM ) + throw MEDEXCEPTION(LOCALIZED(STRING(LOC) + <<" size in object driver MESH is > MED_TAILLE_NOM .")); + + if (_ptrMesh->getIsAGrid()) { if ( writeGRID() != MED_VALID ) diff --git a/src/MEDMEM/MEDMEM_Mesh.cxx b/src/MEDMEM/MEDMEM_Mesh.cxx index 856bdeb99..f31061002 100644 --- a/src/MEDMEM/MEDMEM_Mesh.cxx +++ b/src/MEDMEM/MEDMEM_Mesh.cxx @@ -1731,7 +1731,6 @@ SUPPORT * MESH::getSkin(const SUPPORT * Support3D) throw (MEDEXCEPTION) int numberOfGeometricType ; medGeometryElement* geometricType ; - int * numberOfGaussPoint ; int * geometricTypeNumber ; int * numberOfEntities ; // MEDSKYLINEARRAY * mySkyLineArray = new MEDSKYLINEARRAY() ; @@ -1743,8 +1742,6 @@ SUPPORT * MESH::getSkin(const SUPPORT * Support3D) throw (MEDEXCEPTION) geometricType = new medGeometryElement[1] ; const medGeometryElement * allType = getTypes(MED_FACE); geometricType[0] = allType[0] ; - numberOfGaussPoint = new int[1] ; - numberOfGaussPoint[0] = 1 ; geometricTypeNumber = new int[1] ; // not use, but initialized to nothing geometricTypeNumber[0] = 0 ; numberOfEntities = new int[1] ; @@ -1765,7 +1762,6 @@ SUPPORT * MESH::getSkin(const SUPPORT * Support3D) throw (MEDEXCEPTION) numberOfGeometricType = theType.size() ; geometricType = new medGeometryElement[numberOfGeometricType] ; //const medGeometryElement * allType = getTypes(MED_FACE); !! UNUSED VARIABLE !! - numberOfGaussPoint = new int[numberOfGeometricType] ; geometricTypeNumber = new int[numberOfGeometricType] ; // not use, but initialized to nothing numberOfEntities = new int[numberOfGeometricType] ; mySkyLineArrayIndex = new int[numberOfGeometricType+1] ; @@ -1774,7 +1770,6 @@ SUPPORT * MESH::getSkin(const SUPPORT * Support3D) throw (MEDEXCEPTION) map::iterator theTypeIt ; for (theTypeIt=theType.begin();theTypeIt!=theType.end();theTypeIt++) { geometricType[index] = (*theTypeIt).first ; - numberOfGaussPoint[index] = 1 ; geometricTypeNumber[index] = 0 ; numberOfEntities[index] = (*theTypeIt).second ; mySkyLineArrayIndex[index+1]=mySkyLineArrayIndex[index]+numberOfEntities[index] ; @@ -1786,7 +1781,6 @@ SUPPORT * MESH::getSkin(const SUPPORT * Support3D) throw (MEDEXCEPTION) mySupport->setNumberOfGeometricType(numberOfGeometricType) ; mySupport->setGeometricType(geometricType) ; - mySupport->setNumberOfGaussPoint(numberOfGaussPoint) ; // mySupport->setGeometricTypeNumber(geometricTypeNumber) ; mySupport->setNumberOfElements(numberOfEntities) ; mySupport->setTotalNumberOfElements(size) ; @@ -1794,7 +1788,6 @@ SUPPORT * MESH::getSkin(const SUPPORT * Support3D) throw (MEDEXCEPTION) delete[] numberOfEntities; delete[] geometricTypeNumber; - delete[] numberOfGaussPoint; delete[] geometricType; delete[] mySkyLineArrayIndex; delete[] myListArray; diff --git a/src/MEDMEM/MEDMEM_SetInterlacingType.hxx b/src/MEDMEM/MEDMEM_SetInterlacingType.hxx new file mode 100644 index 000000000..48ad7bc8a --- /dev/null +++ b/src/MEDMEM/MEDMEM_SetInterlacingType.hxx @@ -0,0 +1,17 @@ +#ifndef MEDMEM_SET_INTERLACING_TYPE +#define MEDMEM_SET_INTERLACING_TYPE + +#include "MEDMEM_Tags.hxx" +using namespace MEDMEM; + +namespace { + + template < typename T > struct SET_INTERLACING_TYPE { + static const MED_EN::medModeSwitch _interlacingType = MED_EN::MED_UNDEFINED_INTERLACE; }; + template < > struct SET_INTERLACING_TYPE{ + static const MED_EN::medModeSwitch _interlacingType = MED_EN::MED_FULL_INTERLACE; }; + template < > struct SET_INTERLACING_TYPE { + static const MED_EN::medModeSwitch _interlacingType = MED_EN::MED_NO_INTERLACE; }; + +} +#endif diff --git a/src/MEDMEM/MEDMEM_SkyLineArray.cxx b/src/MEDMEM/MEDMEM_SkyLineArray.cxx index c4c2942eb..e425e4f8f 100644 --- a/src/MEDMEM/MEDMEM_SkyLineArray.cxx +++ b/src/MEDMEM/MEDMEM_SkyLineArray.cxx @@ -71,6 +71,16 @@ MEDSKYLINEARRAY::MEDSKYLINEARRAY(const int count, const int length, } } +ostream& MEDMEM::operator<<(ostream &os, const MEDSKYLINEARRAY &sky) { + os << "_count : " << sky._count << " ,_length : " << sky._length; + for (int i = 0; i < sky._count ; i++) { + os << endl << "Values of type n°" << i+1 << " (index["< _index ; // array of size _count+1 : _index[0]=1 and - // _index[_count]=length+1 + // _index[_count]=length+1 PointerOf _value ; // array of size _length public : + // Attention, avec ce constructeur, il n'est possible de remplir le MEDSKYLINEARRAY MEDSKYLINEARRAY(); - ~MEDSKYLINEARRAY(); + + // Constructeur par recopie MEDSKYLINEARRAY( const MEDSKYLINEARRAY &myArray ); + + // Avec ce constructeur la mémoire pour le tableau de valeur et le + // tableau d'index est réservée. Il suffit d'effectuer les séquences + // d'appels suivantes pour initialiser le MEDSKYLINEARRAY + // 1) setIndex(index) puis fois setI(i,&listValeurN°I) avec i dans 1..count + // rem : listValeurN°I est dupliquée + // 2) appeler fois setIJ(i,j,valeur) avec i dans 1..count et avec j dans 1..count MEDSKYLINEARRAY( const int count, const int length ); + + // Avec ce constructeur le MEDSKYLINEARRAY est complètement initialisé + // Si shallowCopy=false (par défaut) les tableaux d'index et de valeurs + // sont dupliqués + // Sinon le MEDSKYLINEARRAY prend directement les pointeurs et en devient + // propriétaire MEDSKYLINEARRAY( const int count, const int length, const int* index, const int* value, bool shallowCopy=false ); + ~MEDSKYLINEARRAY(); //void setMEDSKYLINEARRAY( const int count, const int length, int* index , int* value ) ; inline int getNumberOf() const; @@ -59,6 +75,7 @@ public : inline void setIJ(int i, int j, int value) throw (MEDEXCEPTION) ; inline void setIndexValue(int i, int value) throw (MEDEXCEPTION) ; + friend ostream& operator<<(ostream &os, const MEDSKYLINEARRAY &sky); }; // --------------------------------------- diff --git a/src/MEDMEM/MEDMEM_Support.cxx b/src/MEDMEM/MEDMEM_Support.cxx index 6bb604599..167229385 100644 --- a/src/MEDMEM/MEDMEM_Support.cxx +++ b/src/MEDMEM/MEDMEM_Support.cxx @@ -85,9 +85,6 @@ SUPPORT::SUPPORT(const SUPPORT & m) if (m._geometricType) _geometricType.set(_numberOfGeometricType,m._geometricType); - if (m._numberOfGaussPoint) - _numberOfGaussPoint.set(_numberOfGeometricType,m._numberOfGaussPoint); - _isOnAllElts = m._isOnAllElts; if (m._numberOfElements) @@ -121,8 +118,6 @@ SUPPORT & SUPPORT::operator=(const SUPPORT & m) _numberOfGeometricType = m._numberOfGeometricType; if (m._geometricType) _geometricType.set(_numberOfGeometricType,m._geometricType); - if (m._numberOfGaussPoint) - _numberOfGaussPoint.set(_numberOfGeometricType,m._numberOfGaussPoint); _isOnAllElts = m._isOnAllElts; if (m._numberOfElements) _numberOfElements.set(_numberOfGeometricType,m._numberOfElements); @@ -157,30 +152,29 @@ ostream & MEDMEM::operator<<(ostream &os, const SUPPORT &my) { os << "Name : "<< my.getName() << endl ; os << "Description : "<< my.getDescription() << endl ; - os << "Mesh name : "; + os << "Mesh ptr : "; if (my.getMesh() == NULL) - os << "ERROR : Mesh not defined !" << endl ; + os << " Mesh not defined." << endl ; else - os << my._mesh->getName() << endl ; - os << "Entity : "<< my._entity << endl; + os << " Mesh defined." << endl; + os << "MeshName : "; + os << my.getMeshName() << endl ; + os << "Entity : "< types = my._geometricType; - for (int j=0;j "; -// for (int k=0; k types = my._geometricType; + for (int j=0;jgetNumberOfNodes(); + _numberOfElements[0]=_mesh->getNumberOfNodes(); // Vérifier le pointeur ! _totalNumberOfElements=_numberOfElements[0]; - _numberOfGaussPoint.set(1) ; - _numberOfGaussPoint[0]=1; } else { // we duplicate information from _mesh @@ -217,19 +209,16 @@ void SUPPORT::update() SCRUTE(_numberOfGeometricType); _geometricType.set(_numberOfGeometricType,_mesh->getTypesWithPoly(_entity) ); _numberOfElements.set(_numberOfGeometricType); - _numberOfGaussPoint.set(_numberOfGeometricType); _totalNumberOfElements=0; for (int i=0;i<_numberOfGeometricType;i++) { _numberOfElements[i]=_mesh->getNumberOfElementsWithPoly(_entity,_geometricType[i]) ; _totalNumberOfElements+=_numberOfElements[i]; - _numberOfGaussPoint[i]=1 ; } } SCRUTE(_name); SCRUTE(_numberOfGeometricType); - SCRUTE(_numberOfGaussPoint); } END_OF(LOC); }; @@ -242,7 +231,7 @@ int SUPPORT::getValIndFromGlobalNumber(const int number) const throw (MEDEXCEPTI //------------------- { const char * LOC="getValIndFromGlobalNumber(const int number) : "; - BEGIN_OF(LOC); + //BEGIN_OF(LOC); if (_isOnAllElts) return number; @@ -262,15 +251,18 @@ int SUPPORT::getValIndFromGlobalNumber(const int number) const throw (MEDEXCEPTI else iThis++; + //if (!_isOnAllElts) + cout << "----Contenu du skyline : ---------------------" << *_number << endl; + if(!found) throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Can't find the global number |" << number << "| in Support |" << getName() << "|" )); - + // It should never arrive here !! return 0; - END_OF(LOC); + //END_OF(LOC); } /*! @@ -348,7 +340,6 @@ void SUPPORT::setpartial(string Description, int NumberOfGeometricType, _geometricType.set(NumberOfGeometricType); _numberOfElements.set(NumberOfGeometricType); _totalNumberOfElements = TotalNumberOfElements; - _numberOfGaussPoint.set(NumberOfGeometricType); int * index = new int[_numberOfGeometricType+1]; index[0]=1; @@ -361,7 +352,6 @@ void SUPPORT::setpartial(string Description, int NumberOfGeometricType, throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"unhomogeneous geometric types (dimension) !")); _geometricType[i] = GeometricType[i] ; _numberOfElements[i] = NumberOfElements[i] ; - _numberOfGaussPoint[i] = 1 ; index[i+1] = index[i]+NumberOfElements[i] ; } @@ -374,6 +364,89 @@ void SUPPORT::setpartial(string Description, int NumberOfGeometricType, }; +/*! + This function allows the user to set a support not on all entities Entity, + it should be used after an initialisation of : + SUPPORT(MESH* Mesh, string Name="", medEntityMesh Entity=MED_CELL) and + after calling at least setGeometricType and perharps setEntity. + It allocates and initialises all the attributs of the class SUPPORT but + doesn't set a description, a SUPPORT name, a meshName and an associated MESH. + */ + +//------------------- +void SUPPORT::setpartial(MEDSKYLINEARRAY * number, bool shallowCopy) throw (MEDEXCEPTION) +//------------------- +{ + const char * LOC = "SUPPORT::setpartial(MEDSKYLINEARRAY * number) : " ; + BEGIN_OF(LOC) ; + + if ( ! _geometricType ) + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"SUPPORT must contains" + << " a geometric type list" )) ; + + _numberOfGeometricType = number->getNumberOf(); + + _numberOfElements.set(_numberOfGeometricType); + + for (int i=0; i< _numberOfGeometricType; i++) + _numberOfElements[i] = number->getNumberOfI(i+1); + + _totalNumberOfElements = number->getLength(); + + _isOnAllElts = false ; + + if (_number!=NULL) delete _number ; + + if ( shallowCopy ) + _number = number; + else + _number = new MEDSKYLINEARRAY(*number); + + // cout << *_number << endl; + + END_OF(LOC); +}; + +void SUPPORT::setProfilNames(vector profilNames) throw (MEDEXCEPTION){ + + const char * LOC = "SUPPORT::setProfilNames(vector profilNames) : " ; + BEGIN_OF(LOC) ; + + if ( _isOnAllElts ) + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"SUPPORT shouldn't be on all elements" + << " while setting profil name list" )) ; + + if ( ! _geometricType || _numberOfGeometricType==0 ) + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"SUPPORT must contains" + << " a least one geometric type" )) ; + + if ( ! _number ) + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"SUPPORT must contains" + << " a profil number list before setting" + << " the associated profil name list" )) ; + + if ( ( profilNames.size() != _number->getNumberOf() ) && + ( profilNames.size() !=_numberOfGeometricType ) ) { + throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"The profil name list size : "<< profilNames.size() + << " must be equal to the number of geometric type : " + << _numberOfGeometricType << " (_number->getNumberOf() : " + << _number->getNumberOf() << " )" + )) ; + + } + + _profilNames = profilNames; + + END_OF(LOC); + +}; + +vector SUPPORT::getProfilNames() const throw (MEDEXCEPTION) +{ + return _profilNames; +}; + + /*! This method gets the boundary elements of the mesh. The support has to be build using the constructor SUPPORT(MESH *,string, medEntityMesh) or @@ -426,7 +499,6 @@ void SUPPORT::getBoundaryElements() throw (MEDEXCEPTION) int numberOfGeometricType ; medGeometryElement* geometricType ; - int * numberOfGaussPoint ; int * geometricTypeNumber ; int * numberOfElements ; //MEDSKYLINEARRAY * mySkyLineArray = new MEDSKYLINEARRAY() ; @@ -438,8 +510,6 @@ void SUPPORT::getBoundaryElements() throw (MEDEXCEPTION) geometricType = new medGeometryElement[1] ; const medGeometryElement * allType = _mesh->getTypes(_entity); geometricType[0] = allType[0] ; - numberOfGaussPoint = new int[1] ; - numberOfGaussPoint[0] = 1 ; geometricTypeNumber = new int[1] ; // not use, but initialized to nothing geometricTypeNumber[0] = 0 ; numberOfElements = new int[1] ; @@ -460,7 +530,6 @@ void SUPPORT::getBoundaryElements() throw (MEDEXCEPTION) numberOfGeometricType = theType.size() ; geometricType = new medGeometryElement[numberOfGeometricType] ; //const medGeometryElement * allType = _mesh->getTypes(_entity); !! UNUSED VARIABLE !! - numberOfGaussPoint = new int[numberOfGeometricType] ; geometricTypeNumber = new int[numberOfGeometricType] ; // not use, but initialized to nothing numberOfElements = new int[numberOfGeometricType] ; mySkyLineArrayIndex = new int[numberOfGeometricType+1] ; @@ -469,8 +538,7 @@ void SUPPORT::getBoundaryElements() throw (MEDEXCEPTION) map::iterator theTypeIt ; for (theTypeIt=theType.begin();theTypeIt!=theType.end();theTypeIt++) { geometricType[index] = (*theTypeIt).first ; - numberOfGaussPoint[index] = 1 ; - geometricTypeNumber[index] = 0 ; + geometricTypeNumber[index] = 0 ; numberOfElements[index] = (*theTypeIt).second ; mySkyLineArrayIndex[index+1]=mySkyLineArrayIndex[index]+numberOfElements[index] ; index++ ; @@ -481,10 +549,8 @@ void SUPPORT::getBoundaryElements() throw (MEDEXCEPTION) setNumberOfGeometricType(numberOfGeometricType) ; // setGeometricType(geometricType) ; - // setNumberOfGaussPoint(numberOfGaussPoint) ; - for (int i=0;i& listOfNode) throw (MEDEX int numberOfGeometricType=1; medGeometryElement* geometricType=new medGeometryElement[1]; geometricType[0]=MED_NONE; - int *numberOfGaussPoint=new int[1]; - numberOfGaussPoint[0]=1; int *numberOfElements=new int[1]; numberOfElements[0]=size; int *mySkyLineArrayIndex=new int[2]; @@ -972,13 +1033,11 @@ void MEDMEM::SUPPORT::fillFromNodeList(const list& listOfNode) throw (MEDEX MEDSKYLINEARRAY * mySkyLineArray = new MEDSKYLINEARRAY(1,numberOfElements[0],mySkyLineArrayIndex,tab,true); setNumberOfGeometricType(numberOfGeometricType); setGeometricType(geometricType); - setNumberOfGaussPoint(numberOfGaussPoint); setNumberOfElements(numberOfElements); setTotalNumberOfElements(numberOfElements[0]); setNumber(mySkyLineArray); delete[] numberOfElements; - delete[] numberOfGaussPoint; delete[] geometricType; } @@ -1006,7 +1065,6 @@ void MEDMEM::SUPPORT::fillFromElementList(const list& listOfElt) throw (MED myListArray[id++]=(*myElementsListIt) ; int numberOfGeometricType ; medGeometryElement* geometricType ; - int * numberOfGaussPoint ; int * numberOfElements ; int * mySkyLineArrayIndex ; @@ -1016,8 +1074,6 @@ void MEDMEM::SUPPORT::fillFromElementList(const list& listOfElt) throw (MED geometricType = new medGeometryElement[1] ; medGeometryElement * allType = _mesh->getTypesWithPoly(_entity); geometricType[0] = allType[0] ; - numberOfGaussPoint = new int[1] ; - numberOfGaussPoint[0] = 1 ; numberOfElements = new int[1] ; numberOfElements[0] = size ; mySkyLineArrayIndex = new int[2] ; @@ -1036,7 +1092,6 @@ void MEDMEM::SUPPORT::fillFromElementList(const list& listOfElt) throw (MED } numberOfGeometricType = theType.size() ; geometricType = new medGeometryElement[numberOfGeometricType] ; - numberOfGaussPoint = new int[numberOfGeometricType] ; numberOfElements = new int[numberOfGeometricType] ; mySkyLineArrayIndex = new int[numberOfGeometricType+1] ; int index = 0 ; @@ -1044,7 +1099,6 @@ void MEDMEM::SUPPORT::fillFromElementList(const list& listOfElt) throw (MED map::iterator theTypeIt ; for (theTypeIt=theType.begin();theTypeIt!=theType.end();theTypeIt++) { geometricType[index] = (*theTypeIt).first ; - numberOfGaussPoint[index] = 1 ; numberOfElements[index] = (*theTypeIt).second ; mySkyLineArrayIndex[index+1]=mySkyLineArrayIndex[index]+numberOfElements[index] ; index++ ; @@ -1053,13 +1107,11 @@ void MEDMEM::SUPPORT::fillFromElementList(const list& listOfElt) throw (MED MEDSKYLINEARRAY * mySkyLineArray = new MEDSKYLINEARRAY(numberOfGeometricType,size,mySkyLineArrayIndex,myListArray,true) ; setNumberOfGeometricType(numberOfGeometricType) ; setGeometricType(geometricType) ; - setNumberOfGaussPoint(numberOfGaussPoint) ; - setNumberOfElements(numberOfElements) ; + setNumberOfElements(numberOfElements) ; setTotalNumberOfElements(size) ; setNumber(mySkyLineArray) ; delete[] numberOfElements; - delete[] numberOfGaussPoint; delete[] geometricType; } diff --git a/src/MEDMEM/MEDMEM_Support.hxx b/src/MEDMEM/MEDMEM_Support.hxx index 8558a9c63..4e52628b1 100644 --- a/src/MEDMEM/MEDMEM_Support.hxx +++ b/src/MEDMEM/MEDMEM_Support.hxx @@ -106,16 +106,8 @@ protected: /*! \if developper - Array of size _numberOfGeometricType which contains - for each type the number of gauss point - (not yet implemented). - \endif - */ - mutable PointerOf _numberOfGaussPoint ; - - /*! - \if developper - If true, we consider all entities of type _entity. + If true, we consider all entities of type _entity + defined in the associated mesh \endif */ bool _isOnAllElts; @@ -146,7 +138,21 @@ protected: */ mutable MEDSKYLINEARRAY * _number; + /*! + \if developper + Array of size <_numberOfGeometricType> wich contain the profil name of + entities of each geometric type.\n + Defined only if _isOnAllElts is false. + If it exist an entities list on a geometric type in _number but there is no profil name associated + ( MED_NOPFL ) the MED driver will consider and verify this entities list as being all the + entities available on the associated mesh for this geometric type. + \endif + */ + + vector< string > _profilNames; + public: + SUPPORT(); SUPPORT(MESH* Mesh, string Name="", MED_EN::medEntityMesh Entity=MED_EN::MED_CELL); SUPPORT(const SUPPORT & m); @@ -167,7 +173,6 @@ public: inline void setEntity(MED_EN::medEntityMesh Entity); inline void setNumberOfGeometricType(int NumberOfGeometricType); inline void setGeometricType(const MED_EN::medGeometryElement *GeometricType); - inline void setNumberOfGaussPoint(const int *NumberOfGaussPoint); inline void setNumberOfElements(const int *NumberOfElements); inline void setTotalNumberOfElements(int TotalNumberOfElements); inline void setNumber(MEDSKYLINEARRAY * Number); @@ -182,24 +187,29 @@ public: inline bool isOnAllElements() const; inline int getNumberOfTypes() const; inline const MED_EN::medGeometryElement* getTypes() const ; - inline const int * getNumberOfGaussPoint() const throw (MEDEXCEPTION); - inline int getNumberOfGaussPoint(MED_EN::medGeometryElement geomElement) const throw (MEDEXCEPTION); inline int getNumberOfElements(MED_EN::medGeometryElement GeometricType) const throw (MEDEXCEPTION); inline const int * getNumberOfElements() const throw (MEDEXCEPTION); - // rename getnumber -> getGlobalNumberSky() virtual inline MEDSKYLINEARRAY * getnumber() const throw (MEDEXCEPTION); - // rename getNumber -> getGlobalNumberPtr() virtual inline const int * getNumber(MED_EN::medGeometryElement GeometricType) const throw (MEDEXCEPTION); - // rename in getGlobalNumberInd() virtual inline const int * getNumberIndex() const throw (MEDEXCEPTION); virtual int getValIndFromGlobalNumber(const int number) const throw (MEDEXCEPTION); void blending(SUPPORT * mySupport) throw (MEDEXCEPTION) ; + // Les numéros d'entités dans les profils doivent être croissant + // pour respecter la norme MED void setpartial(string Description, int NumberOfGeometricType, int TotalNumberOfEntity, MED_EN::medGeometryElement *GeometricType, int *NumberOfEntity, int *NumberValue); + void setpartial(MEDSKYLINEARRAY * number, bool shallowCopy=false) throw (MEDEXCEPTION); + + // Si les noms de profils ne sont pas positionnés, les profils ne seront + // pas écrits par MEDFICHIER. + void setProfilNames(vector profilNames) throw (MEDEXCEPTION); + //string getProfilName(const MED_EN::medGeometryElement GeometricType) const throw (MEDEXCEPTION); + vector getProfilNames() const throw (MEDEXCEPTION); + void getBoundaryElements() throw (MEDEXCEPTION); void changeElementsNbs(MED_EN::medEntityMesh entity, const int *renumberingFromOldToNew, int limitNbClassicPoly, const int *renumberingFromOldToNewPoly=0); void intersecting(SUPPORT * mySupport) throw (MEDEXCEPTION) ; @@ -226,14 +236,14 @@ protected: This method returns the number of all elements of the type GeometricType. If isOnAllElements is false, it returns the number of elements in the - support else it returns number of elements in the whole mesh. + support else it returns number of elements in the mesh. Example : number of MED_TRIA3 or MED_ALL_ELEMENTS elements in entity of support. Note : If SUPPORT is defined on MED_NODE, use MED_ALL_ELEMENTS as medGeometryElement GeometricType and it will returns the number - of nodes in the support (or in the whole mesh). + of nodes in the support (or in the mesh). */ //----------------------------------------------------------------------------- inline int SUPPORT::getNumberOfElements(MED_EN::medGeometryElement GeometricType) const @@ -306,42 +316,6 @@ inline const int * SUPPORT::getNumberIndex() const return _number->getIndex() ; } -/*! A DOCUMENTER */ -//------------------------------------------------- -inline const int * SUPPORT::getNumberOfGaussPoint() const - throw (MEDEXCEPTION) -//------------------------------------------------- -{ - SCRUTE(_name); - SCRUTE(_numberOfGeometricType); - SCRUTE(_numberOfGaussPoint); - - if (_numberOfGaussPoint!=NULL) - return _numberOfGaussPoint ; - else - throw MEDEXCEPTION("Support::getNumberOfGaussPoint : Not defined !") ; -} - -/*! - Returns number of Gauss points for this medGeometryElement. - - Note : - - Not defined if SUPPORT is on MED_NODE. - - Not defined for MED_ALL_ELEMENTS medGeometryElement type. -*/ -//----------------------------------------------------------------------------- -inline int SUPPORT::getNumberOfGaussPoint(MED_EN::medGeometryElement geomElement) const - throw (MEDEXCEPTION) -//----------------------------------------------------------------------------- -{ - if (_numberOfGaussPoint!=NULL) { - for (int i=0;i<_numberOfGeometricType;i++) - if (_geometricType[i]==geomElement) - return _numberOfGaussPoint[i] ; - throw MEDEXCEPTION("Support::getGlobalNumber : GeometricType not found !") ; - } else - return 1; -} /*! set the attribute _name to Name */ //-------------------------------------- @@ -373,7 +347,13 @@ inline void SUPPORT::setMeshName(const string & meshName) _meshName=meshName; } -/*! set the attribute _isOnAllElts to All */ +/*! set the attribute _isOnAllElts to All + Even if _isonAllElts is true, geometric types definning the FIELD's SUPPORT + must be read from the SUPPORT not from the associated MESH (the geometric + types definning the FIELD's SUPPORT may be a subset of the geometric types + defined in the MESH even if for each SUPPORT geometric type all MESH entities + are used). +*/ //------------------------------------------ inline void SUPPORT::setAll(bool All) //------------------------------------------ @@ -397,7 +377,6 @@ inline void SUPPORT::setNumberOfGeometricType(int NumberOfGeometricType) _geometricType.set(0); _numberOfElements.set(0); - _numberOfGaussPoint.set(0) ; } /*! set the attribute _geometricType to geometricType */ @@ -411,16 +390,6 @@ inline void SUPPORT::setGeometricType(const MED_EN::medGeometryElement *Geometri _geometricType[i] = GeometricType[i]; } -/*! set the attribute _numberOfGaussPoint to NumberOfGaussPoint */ -//----------------------------------------------------------------- -inline void SUPPORT::setNumberOfGaussPoint(const int *NumberOfGaussPoint) -//----------------------------------------------------------------- -{ - if (NULL == _numberOfGaussPoint) - _numberOfGaussPoint.set(_numberOfGeometricType); - for (int i=0;i<_numberOfGeometricType;i++) - _numberOfGaussPoint[i] = NumberOfGaussPoint[i]; -} /*! Set the attribute _numberOfElements to NumberOfElements and diff --git a/src/MEDMEM/MEDMEM_nArray.hxx b/src/MEDMEM/MEDMEM_nArray.hxx index b55af88d2..467e59749 100644 --- a/src/MEDMEM/MEDMEM_nArray.hxx +++ b/src/MEDMEM/MEDMEM_nArray.hxx @@ -42,7 +42,7 @@ public : { CHECKING_POLICY::checkMoreThanZero("MEDMEM_Array",nbelem); CHECKING_POLICY::checkMoreThanZero("MEDMEM_Array",dim); - _array.set(INTERLACING_POLICY::_arraySize); + _array.set(InterlacingPolicy::_arraySize); }; // Le mot clé inline permettra d'instancier le constructeur uniquement @@ -62,7 +62,7 @@ public : _array.set((const ElementType*)values); else // Cas par défaut - _array.set(INTERLACING_POLICY::_arraySize,values); + _array.set(InterlacingPolicy::_arraySize,values); } @@ -76,7 +76,7 @@ public : CHECKING_POLICY::checkMoreThanZero("MEDMEM_Array",nbelem); CHECKING_POLICY::checkMoreThanZero("MEDMEM_Array",dim); CHECKING_POLICY::checkMoreThanZero("MEDMEM_Array",nbtypegeo); - _array.set(INTERLACING_POLICY::_arraySize); + _array.set(InterlacingPolicy::_arraySize); }; @@ -101,7 +101,7 @@ public : _array.set((const ElementType*)values); else - _array.set(INTERLACING_POLICY::_arraySize,values); + _array.set(InterlacingPolicy::_arraySize,values); }; @@ -113,7 +113,7 @@ public : if (shallowCopy) this->_array.set(array._array); // Le propriétaire reste le ARRAY initial else - this->_array.set(INTERLACING_POLICY::_arraySize,array._array); + this->_array.set(InterlacingPolicy::_arraySize,array._array); } @@ -126,7 +126,6 @@ public : InterlacingPolicy::operator=(array); //Appel des classes de base ? this->_array.set(array._array); // Le propriétaire reste le ARRAY initial - // verifier l'appel des opérateurs de la policy return *this; } @@ -154,77 +153,102 @@ public : _array.set((const ElementType*)values); else - _array.set(INTERLACING_POLICY::_arraySize,values); + _array.set(InterlacingPolicy::_arraySize,values); } inline const ElementType * getRow(int i) const { - checkInInclusiveRange("MEDMEM_Array",1,INTERLACING_POLICY::_nbelem,i); + checkInInclusiveRange("MEDMEM_Array",1,InterlacingPolicy::_nbelem,i); // Empêche l'utilisation de getRow en mode MED_NO_INTERLACE // Ne devrait pas dépendre de la politique check checkEquality("MEDMEM_Array (Interlace test)", MED_EN::MED_NO_INTERLACE, - INTERLACING_POLICY::_interlacing ); - return &(_array[ INTERLACING_POLICY::getIndex(i,1) ]); + InterlacingPolicy::_interlacing ); + return &(_array[ InterlacingPolicy::getIndex(i,1) ]); } void setRow(int i,const ElementType * const value) { - checkInInclusiveRange("MEDMEM_Array",1,INTERLACING_POLICY::_nbelem,i); + checkInInclusiveRange("MEDMEM_Array",1,InterlacingPolicy::_nbelem,i); // setRow fonctionne // dans les deux modes d'entrelacement. - for (int j =1; j <= INTERLACING_POLICY::getDim(); j++) - for (int k = 1 ; k <= INTERLACING_POLICY::getNbGauss(i); k++) - _array[INTERLACING_POLICY::getIndex(i,j,k)] = value[INTERLACING_POLICY::getIndex(1,j,k)]; + for (int j =1; j <= InterlacingPolicy::getDim(); j++) + for (int k = 1 ; k <= InterlacingPolicy::getNbGauss(i); k++) + _array[InterlacingPolicy::getIndex(i,j,k)] = value[InterlacingPolicy::getIndex(1,j,k)]; } inline const ElementType * getColumn(int j) const { - checkInInclusiveRange("MEDMEM_Array",1,INTERLACING_POLICY::_dim,j); + checkInInclusiveRange("MEDMEM_Array",1,InterlacingPolicy::_dim,j); checkEquality("MEDMEM_Array (Interlace test)", - MED_EN::MED_FULL_INTERLACE, INTERLACING_POLICY::_interlacing ); - return &(_array[ INTERLACING_POLICY::getIndex(1,j) ]); + MED_EN::MED_FULL_INTERLACE, InterlacingPolicy::_interlacing ); + return &(_array[ InterlacingPolicy::getIndex(1,j) ]); } void setColumn(int j, const ElementType * const value) { - checkInInclusiveRange("MEDMEM_Array",1,INTERLACING_POLICY::_dim,j); + checkInInclusiveRange("MEDMEM_Array",1,InterlacingPolicy::_dim,j); // setColumn fonctionne // dans les deux modes d'entrelacement. - for (int i=1; i <= INTERLACING_POLICY::getNbElem(); i++) - for (int k = 1 ; k <= INTERLACING_POLICY::getNbGauss(i); k++) - _array[INTERLACING_POLICY::getIndex(i,j,k)] = value[INTERLACING_POLICY::getIndex(i,1,k)]; + for (int i=1; i <= InterlacingPolicy::getNbElem(); i++) + for (int k = 1 ; k <= InterlacingPolicy::getNbGauss(i); k++) + _array[InterlacingPolicy::getIndex(i,j,k)] = value[InterlacingPolicy::getIndex(i,1,k)]; } inline const ElementType & getIJ(int i, int j) const { - checkInInclusiveRange("MEDMEM_Array",1,INTERLACING_POLICY::_nbelem,i); - checkInInclusiveRange("MEDMEM_Array",1,INTERLACING_POLICY::_dim,j); - return _array[ INTERLACING_POLICY::getIndex(i,j) ]; + checkInInclusiveRange("MEDMEM_Array",1,InterlacingPolicy::_nbelem,i); + checkInInclusiveRange("MEDMEM_Array",1,InterlacingPolicy::_dim,j); + return _array[ InterlacingPolicy::getIndex(i,j) ]; } inline const ElementType & getIJK(int i, int j, int k ) const { - checkInInclusiveRange("MEDMEM_Array",1,INTERLACING_POLICY::_nbelem,i); - checkInInclusiveRange("MEDMEM_Array",1,INTERLACING_POLICY::_dim,j); - checkInInclusiveRange("MEDMEM_Array",1,INTERLACING_POLICY::getNbGauss(i),k); + checkInInclusiveRange("MEDMEM_Array",1,InterlacingPolicy::_nbelem,i); + checkInInclusiveRange("MEDMEM_Array",1,InterlacingPolicy::_dim,j); + checkInInclusiveRange("MEDMEM_Array",1,InterlacingPolicy::getNbGauss(i),k); - return _array[ INTERLACING_POLICY::getIndex(i,j,k) ]; + return _array[ InterlacingPolicy::getIndex(i,j,k) ]; }; inline void setIJ(int i, int j, const ElementType & value) { //autre signature avec - checkInInclusiveRange("MEDMEM_Array",1,INTERLACING_POLICY::_nbelem,i); - checkInInclusiveRange("MEDMEM_Array",1,INTERLACING_POLICY::_dim,j); + checkInInclusiveRange("MEDMEM_Array",1,InterlacingPolicy::_nbelem,i); + checkInInclusiveRange("MEDMEM_Array",1,InterlacingPolicy::_dim,j); - _array[ INTERLACING_POLICY::getIndex(i,j) ] = value; // retour ElementType & ? + _array[ InterlacingPolicy::getIndex(i,j) ] = value; // retour ElementType & ? }; inline void setIJK(int i, int j, int k, const ElementType & value) { //autre signature avec - checkInInclusiveRange("MEDMEM_Array",1,INTERLACING_POLICY::_nbelem,i); - checkInInclusiveRange("MEDMEM_Array",1,INTERLACING_POLICY::_dim,j); - checkInInclusiveRange("MEDMEM_Array",1,INTERLACING_POLICY::getNbGauss(i),k); + checkInInclusiveRange("MEDMEM_Array",1,InterlacingPolicy::_nbelem,i); + checkInInclusiveRange("MEDMEM_Array",1,InterlacingPolicy::_dim,j); + checkInInclusiveRange("MEDMEM_Array",1,InterlacingPolicy::getNbGauss(i),k); - _array[ INTERLACING_POLICY::getIndex(i,j,k) ] = value; // retour ElementType & ? + _array[ InterlacingPolicy::getIndex(i,j,k) ] = value; // retour ElementType & ? }; + bool operator == (const MEDMEM_Array & array ) const { + + if ( this == &array ) return true; + + int size = array.getArraySize(); + if ( size != getArraySize() ) return false; + + ARRAY_ELEMENT_TYPE * arrayPtr = + const_cast(array).getPtr(); + for (int i=0; i < size; ++i) + if (_array[i] != arrayPtr[i]) return false; + + return true; + } + + friend ostream & operator<<(ostream & os, const MEDMEM_Array & array) { + + for (int i=1;i<=array.getNbElem();++i) { + for (int j=1; j<=array.getDim();++j) + for (int k=1;k<=array.getNbGauss(i);++k) + os << "Value [" << i << "," << j << "," << k << "] = " << array.getIJK(i,j,k) << ", "; + os << endl; + } + return os; + } private: diff --git a/src/MEDMEM/Makefile.in b/src/MEDMEM/Makefile.in index 52aa6dd6b..7a6e4b67b 100644 --- a/src/MEDMEM/Makefile.in +++ b/src/MEDMEM/Makefile.in @@ -91,7 +91,12 @@ MEDMEM_nArray.hxx \ MEDMEM_Tags.hxx \ MEDMEM_FieldConvert.hxx \ MEDMEM_ArrayConvert.hxx \ -MEDMEM_FieldForward.hxx +MEDMEM_FieldForward.hxx \ +MEDMEM_GaussLocalization.hxx \ +MEDMEM_MEDMEMgaussEcr.hxx \ +MEDMEM_MEDMEMprofilEcr.hxx \ +MEDMEM_MEDMEMchampLire.hxx \ +MEDMEM_SetInterlacingType.hxx # Libraries targets @@ -129,7 +134,11 @@ MEDMEM_MedMedDriver21.cxx \ MEDMEM_medimport_src.cxx \ MEDMEM_PolyhedronArray.cxx \ MEDMEM_MedMedDriver22.cxx \ -MEDMEM_MedMeshDriver22.cxx +MEDMEM_MedMeshDriver22.cxx \ +MEDMEM_MEDMEMgaussEcr.cxx \ +MEDMEM_MEDMEMprofilEcr.cxx \ +MEDMEM_MEDMEMchampLire.cxx + # Executables targets BIN = med2_1_To_med2_2 med2vtk duplicateMED med_test duplicateMEDMESH @@ -148,7 +157,8 @@ TEST_PROGS = test_MEDMEM_ModulusArray test_MEDMEM_Array test_MEDMEM_SkyLineArray test_operation_fieldint test_gibi_driver test_porflow_driver \ test_grid test_MEDMEM_PolyhedronArray test_MEDMEM_PolyConnectivity \ test_MEDMEM_PolyDriverMedMeshRead test_MEDMEM_PolyDriverMedMeshWrite \ - test_MEDMEM_poly3D test_MEDMEM_nArray test_MEDMEM_Meshing_poly + test_MEDMEM_poly3D test_MEDMEM_nArray test_MEDMEM_Meshing_poly test_profil_MedFieldDriver \ + test_profil_gauss_MedFieldDriver test_GaussLocalization LDFLAGS+= -L$(top_builddir)/lib/salome LDFLAGSFORBIN+= -L$(top_builddir)/lib/salome diff --git a/src/MEDMEM/checkScript b/src/MEDMEM/checkScript new file mode 100755 index 000000000..944f721bc --- /dev/null +++ b/src/MEDMEM/checkScript @@ -0,0 +1,74 @@ +./test_MEDMEM_nArray > Essai1 +./test_copie_fieldT pointe.med maa1 fieldnodeint > Essai2 +./med_test pointe.med maa1 fieldnodeint > Essai3 +./med_test pointe.med maa1 fieldnodedouble > Essai4 +./test_copie_fieldT pointe.med maa1 fieldnodeint > Essai5 +./test_copie_fieldT pointe.med maa1 fieldnodedouble > Essai6 +./test_MEDMEM_Array > Essai7 +./test_MEDMEM_CellModel > Essai8 +./test_MEDMEM_Meshing Essai9 +h5dump Essai9.med > Essai9.log && rm Essai9.med +./test_MEDMEM_ModulusArray > Essai10 +./test_MEDMEM_SkyLineArray > Essai12 +./test_operation_fielddouble pointe.med maa1 fieldnodedouble > Essai13 +./test_operation_fielddouble pointe.med maa1 fieldcelldouble > Essai14 +./test_operation_fieldint pointe.med maa1 fieldnodeint > Essai15 +./test_operation_fieldint pointe.med maa1 fieldcellint > Essai16 +#./test_porflow_driver Essai17 +./testUArray > Essai18 +./testUCellModel > Essai19 +./testUCoordinate > Essai20 +./testUGeoNameMeshEntities > Essai21 +./testUMedException > Essai22 +./testUModulusArray > Essai23 +./test_affect_medarray > Essai24 +./test_copie_connectivity pointe.med maa1 > Essai25 +./test_copie_coordinate pointe.med maa1 > Essai26 +./test_copie_family pointe.med maa1 > Essai27 +./test_copie_field_ pointe.med maa1 fieldnodedouble > Essai28 +./test_copie_group pointe.med maa1 > Essai29 +./test_copie_medarray pointe.med maa1 > Essai30 +./test_copie_mesh pointe.med maa1 > Essai31 +./test_copie_support pointe.med maa1 > Essai32 +#./test_gibi_driver pointe.med maa1 > Essai33 +./duplicateMED pointe.med Essai34 + +#RESUZERODEPL____________________ 1 1 sur NOEUDS, 3 composantes, 1 points de Gauss, taille de profil 18 +#RESUZEROERRE_ELGA_NORE__________ 1 1 sur TETRA10, 6 composantes, 1 points de Gauss, taille de profil 3 +#RESUZEROSIEF_ELGA_DEPL__________ 1 1 sur TETRA10, 6 composantes, 5 points de Gauss, taille de profil 3 +#RESUZEROSIGM_ELNO_DEPL__________ 1 1 sur TETRA10, 6 composantes, 10 points de Gauss, taille de profil 3 + +rm -f Copy_nomesh_zzzz121b_without_tr6.med Copy_withmesh_zzzz121b_without_tr6.med && ./test_profil_MedFieldDriver zzzz121b_without_tr6.med RESUZERODEPL____________________ 1 1 > Essai35 +rm -f Copy_nomesh_zzzz121b_without_tr6.med Copy_withmesh_zzzz121b_without_tr6.med && ./test_profil_MedFieldDriver zzzz121b_without_tr6.med RESUZEROERRE_ELGA_NORE__________ 1 1 > Essai36 +rm -f Copy_nomesh_zzzz121b_without_tr6.med Copy_withmesh_zzzz121b_without_tr6.med && ./test_profil_gauss_MedFieldDriver zzzz121b_without_tr6.med RESUZEROSIEF_ELGA_DEPL__________ 1 1 > Essai37 +rm -f Copy_nomesh_zzzz121b_without_tr6.med Copy_withmesh_zzzz121b_without_tr6.med && ./test_profil_gauss_MedFieldDriver zzzz121b_without_tr6.med RESUZEROSIGM_ELNO_DEPL__________ 1 1 > Essai38 + +# Le fichier maill.00.med ne peut pas passer en mode 2 +# - En MODE 1 il faut débrayer la génération du fichier Copy_withmesh_maill.00.med et utiliser celui fourni. +# - En MODE 2, le problème est qu'à la lecture du fichier (qui contient SEG2 TRIA3 et QUAD4) le driver mesh crée de nouveaux SEG2 or +# le champ qui a été chargé au préalable a pris le maillage contenu dans le fichier comme référence du coup à la réécriture des numéros +# de profils il décale d'un nombre d'entités cumulées trop important. + +# MODE 1 avec modif du fichier test +#cp maill.00_nofield.med Copy_withmesh_maill.00.med;./test_profil_MedFieldDriver maill.00.med Indicateur_d_erreur_00 2 2 +# MODE 3 en activant uniquement le mode 3 +##rm -f Copy_withmesh_maill.00.med Copy_nomesh_maill.00.med && cp maill.00_nofield.med Copy_withmesh_maill.00.med;cp maill.00_nomesh.med Copy_nomesh_maill.00.med;./test_profil_MedFieldDriver maill.00.med Indicateur_d_erreur_00 2 2 + +#Indicateur_d_erreur_00 1 1 TRIA3, 1 composante, 1 point de Gauss, pas de profil +#Indicateur_d_erreur_00 1 1 QUAD4, 1 composante, 1 point de Gauss, pas de profil + +#Indicateur_d_erreur_00 2 2 TRIA3, 1 composante, 1 point de Gauss, taille de profil 4 +#Indicateur_d_erreur_00 2 2 QAUD4, 1 composante, 1 point de Gauss, taille de profil 2 + +#Indicateur_d_erreur_00 3 3 TRIA3, 1 composante, 3 point de Gauss, pas de profil +#Indicateur_d_erreur_00 3 3 QAUD4, 1 composante, 4 point de Gauss, pas de prrofil + +#Indicateur_d_erreur_00 4 4 TRIA3, 1 composante, 3 point de Gauss, taille de profil 4 +#Indicateur_d_erreur_00 4 4 QAUD4, 1 composante, 4 point de Gauss, taille de profil 2 + +rm Copy*; ./test_profil_MedFieldDriver maill.00_without_seg2.med Indicateur_d_erreur_00 1 1 > Essai39 +rm Copy*; ./test_profil_MedFieldDriver maill.00_without_seg2.med Indicateur_d_erreur_00 2 2 > Essai40 +rm Copy*; ./test_profil_gauss_MedFieldDriver maill.00_without_seg2.med Indicateur_d_erreur_00 3 3 > Essai41 +rm Copy*; ./test_profil_gauss_MedFieldDriver maill.00_without_seg2.med Indicateur_d_erreur_00 4 4 > Essai42 + + diff --git a/src/MEDMEM/test_GaussLocalization.cxx b/src/MEDMEM/test_GaussLocalization.cxx new file mode 100644 index 000000000..b538e7f02 --- /dev/null +++ b/src/MEDMEM/test_GaussLocalization.cxx @@ -0,0 +1,50 @@ +#include +#include + +#define INTERLACING_TAG FullInterlace + +#include "MEDMEM_Exception.hxx" +#include "MEDMEM_define.hxx" +#include "MEDMEM_GaussLocalization.hxx" +#include "MEDMEM_ArrayInterface.hxx" + +using namespace std; +using namespace MEDMEM; +using namespace MED_EN; + +#define _a 0.446948490915965 +#define _b 0.091576213509771 +#define _p1 0.11169079483905 +#define _p2 0.0549758718227661 + +int main (int argc, char ** argv) { + + typedef MEDMEM_ArrayInterface::Array Array; + + + /* Caractéristiques du model n° 1 de localisation des points de gauss pour le champ n°1*/ + MED_EN::medGeometryElement typeGeo = MED_TRIA6; + + int ngauss1_1 = 6; + string gauss1_1("Model n1"); + double refcoo1 [12] = { -1.0,1.0, -1.0,-1.0, 1.0,-1.0, -1.0,0.0, 0.0,-1.0, 0.0,0.0 }; + + double gscoo1_1[12] = { 2*_b-1, 1-4*_b, 2*_b-1, 2*_b-1, 1-4*_b, + 2*_b-1, 1-4*_a, 2*_a-1, 2*_a-1, 1-4*_a, 2*_a-1, 2*_a-1 }; + double wg1_1[6] = { 4*_p2, 4*_p2, 4*_p2, 4*_p1, 4*_p1, 4*_p1 }; + + + assert( ( (typeGeo%100)*(typeGeo/100) ) == 12 ); + + GAUSS_LOCALIZATION myloc1 = GAUSS_LOCALIZATION(gauss1_1,typeGeo,ngauss1_1, + Array(refcoo1,typeGeo/100,(typeGeo%100) ), + Array(gscoo1_1,typeGeo/100,ngauss1_1), + vector (wg1_1,wg1_1+ngauss1_1) + ); + GAUSS_LOCALIZATION myloc1bis = GAUSS_LOCALIZATION(gauss1_1,typeGeo,ngauss1_1, + refcoo1,gscoo1_1, + wg1_1); + + cout << "myloc1 == myloc1bis " << (myloc1 == myloc1bis) << endl; + cout << "myloc1 : " << endl << myloc1 << endl; +} diff --git a/src/MEDMEM/test_profil_MedFieldDriver.cxx b/src/MEDMEM/test_profil_MedFieldDriver.cxx new file mode 100644 index 000000000..54e7e0e07 --- /dev/null +++ b/src/MEDMEM/test_profil_MedFieldDriver.cxx @@ -0,0 +1,234 @@ + +#include +#include + +#include "MEDMEM_Exception.hxx" +#include "MEDMEM_Mesh.hxx" +#include "MEDMEM_MedMeshDriver.hxx" +#include "MEDMEM_Field.hxx" +#include "MEDMEM_MedFieldDriver.hxx" +#include "MEDMEM_Support.hxx" +#include "MEDMEM_define.hxx" + +using namespace std; +using namespace MEDMEM; +using namespace MED_EN; + +void affiche_field_(FIELD_ * myField, const SUPPORT * mySupport) +{ + cout << "Field "<< myField->getName() << " : " <getDescription() << endl ; + int NumberOfComponents = myField->getNumberOfComponents() ; + cout << "- Nombre de composantes : "<< NumberOfComponents << endl ; + for (int i=1; igetComponentName(i)<< endl; + cout << " - description : "<getComponentDescription(i) << endl; + cout << " - units : "<getMEDComponentUnit(i) << endl; + } + cout << "- iteration :" << endl ; + cout << " - numero : " << myField->getIterationNumber()<< endl ; + cout << " - ordre : " << myField->getOrderNumber()<< endl ; + cout << " - temps : " << myField->getTime()<< endl ; + + cout << "- Type : " << myField->getValueType()<< endl; + + cout << "- Adresse support : " << mySupport << endl; +} + +template +void affiche_fieldT(FIELD * myField, + const SUPPORT * mySupport) +{ + const double * value = 0; + const int * number = 0; + + affiche_field_((FIELD_ *) myField, mySupport); + + cout.setf(ios::fixed); + cout << "- Valeurs :"<isOnAllElements(); + int NumberOf = mySupport->getNumberOfElements(MED_ALL_ELEMENTS); + cout << "mySupport->getNumberOfElements(MED_ALL_ELEMENTS)" << NumberOf << endl; + int NumberOfComponents = myField->getNumberOfComponents() ; + cout << "myField->getNumberOfComponents()" << NumberOfComponents << endl; + if (!onAll) number = mySupport->getNumber(MED_ALL_ELEMENTS); + + if ( myField->getInterlacingType() == MED_EN::MED_FULL_INTERLACE ) { + for (int i=1; igetRow(i) ; + else + value = myField->getRow(number[i-1]); + for (int j=0; jgetColumn(j) ; + for (int i=0; i * myField1 = new FIELD(MED_DRIVER,fileName,fieldName, + iterationNumber, orderNumber); + affiche_fieldT(myField1, myField1->getSupport()); + + // Pour éviter de modifier le fichier d'origine, + // on en crée une copie avec uniquement le maillage. + // Rem : Pour le test, le chargement du maillage n'est pas nécessaire + // On pourrait réécrire le Champ dans le fichier d'origine + // sous un autre nom. + // Attention si le driver MED_MESH modifie le nombre d'éléments d'un type géométrique : + // le calcul de renumérotation à l'écriture du champ risque d'être faux ! + meshName = myField1->getSupport()->getMeshName(); + MESH * myMesh = new MESH(MED_DRIVER,fileName,meshName); + MED_MESH_WRONLY_DRIVER myMeshDriver1("Copy_withmesh_"+fileName,myMesh); + int current=myMesh->addDriver(myMeshDriver1); + myMesh->write(current); + delete myMesh; + + // On ajoute un driver en écriture, comme la relation SUPPORT-MESH n'est pas + // initialisée, le driver doit trouver le maillage dans le fichier cible + // pour réaliser la transcription des profils MEDMEMOIRE à MEDFICHIER. + MED_FIELD_WRONLY_DRIVER myFieldDriver2("Copy_withmesh_"+fileName,myField1) ; + current = myField1->addDriver(myFieldDriver2); + myField1->write(current); + delete myField1; + } + + mode2: + ///////////////////////////////////////////////////////////////////////////// + // TEST DEUXIEME MODE : + // Lecture idem 1er mode + // A l'écriture, le fichier cible ne contient pas le maillage mais la + // relation SUPPORT-MESH étant établie le driver utilise les informations + // dans le maillage en mémoire pour transcrire les profils. + // Selon le modèle MED FICHIER, ce mode est interdit : le fichier doit au moins + // contenir un lien sur le maillage (information pas encore exploitée dans MEDMEMOIRE + // : pas de gestion de montage/démontage des fichiers ) + // Attention si le driver MED_MESH modifie le nombre d'éléments d'un type géométrique : + // le calcul de renumérotation à l'écriture du champ risque d'être faux car les + // profils crées à la lecture son basés sur le nombre d'éléments par type géoémtrique + // du maillage contenu dans le fichier à la lecture. + // Une solution consisterait à prendre en compte le montage de fichiers distants + // et de prendre en compte la différence de nombre d'éléments par type géométrique + // entre le maillage MEDMEM et le maillage MEDFICHIER + // (Hum ! : Il serait plus simple que MEDMEMOIRE ne recalcule pas systématiquement + // ce que l'on ne lui demande pas, ce qui permettrait aussi de réécrire à l'identique + // un fichier que l'on vient de lire) + { + FIELD * myField2 = new FIELD(MED_DRIVER,fileName,fieldName, + iterationNumber, orderNumber); + + meshName = myField2->getSupport()->getMeshName(); + MESH * myMesh2 = new MESH(MED_DRIVER,fileName,meshName); + + const SUPPORT * mySupport2=myField2->getSupport(); + mySupport2->setMesh(myMesh2); + + // On ajoute un driver en écriture, comme la relation SUPPORT-MESH est + // initialisée, le driver utilise le maillage en mémoire + // pour réaliser la transcription des profils MEDMEMOIRE à MEDFICHIER. + MED_FIELD_WRONLY_DRIVER myFieldDriver3("Copy_nomesh_"+fileName,myField2) ; + int current = myField2->addDriver(myFieldDriver3); + myField2->write(current); + + //Pour regarder le fichier produit avec MDUMP decommenter ces trois lignes + //car le fichier qui est produit n'est pas à la norme MED + //Il doit contenir soit le maillage associé soit un lien vers le maillage associé. + //MED_MESH_WRONLY_DRIVER myMeshDriver2("Copy_nomesh_"+fileName,myMesh2); + //current=myMesh2->addDriver(myMeshDriver2); + //myMesh2->write(current); + + delete myField2; + delete myMesh2; + + + } + mode3: + // TEST TROISIEME MODE : + // A la lecture, le fichier MED lu ne contient pas le maillage associé au champ demandé + // (mais un lien MEDFICHIER qui n'est pas exploité à ce jour). + // Cependant avant sa lecture le FIELD a été associé à un SUPPORT + // avec le lien au MESH préalablement chargé. + // Le driver du FIELD (automatiquement crée) est capable de lire les profils MEDFICHIER + // et utilise la relation SUPPORT-MESH initialisée pour transcrire les profils + // de la numérotation locale MEDFICHIER à la numérotation globale MEDMEMOIRE). + // REM: Une fois le champ chargé, il possède un nouveau support, le premier peut être libéré. + // En effet le driver du FIELD se fit uniquement au type géométriques définis dans le champ MEDFICHIER + // pour créer son SUPPORT car un SUPPORT crée "onAll" à partir d'un MESH repose sur tous + // les types géométriques du MESH ce qui n'est pas forcément le cas d'un champ MEDFICHIER + // (même sans profil) lu à posteriori. + { + med_2_2::med_err err=-1; + med_2_2::med_idt id = med_2_2::MEDouvrir(const_cast ( ("Copy_nomesh_"+fileName).c_str()), + med_2_2::MED_LECTURE_ECRITURE); + if (id <=0) cout << "Erreur dans MEDouvrir pour le fichier " << "Copy_nomesh_"+fileName < ( ("Copy_withmesh_"+fileName).c_str()), + const_cast (meshName.c_str()) ); + if (err !=0) cout << "Erreur dans MEDlienEcr pour le maillage distant " << meshName + <<" contenu dans le fichier " << "Copy_withmesh_"+fileName < * myField3 = new FIELD(mySupport3,MED_DRIVER,"Copy_nomesh_"+fileName,fieldName, + iterationNumber, orderNumber); + delete mySupport3; // Il est déjà possible de libérer ce SUPPORT + + //TEST à la réecriture : + string cpy("__Copy"); + vector < string > pflNames = myField3->getSupport()->getProfilNames(); + for (int i=0; i< pflNames.size(); ++i) { + pflNames[i].resize(pflNames[i].size()-cpy.size()); + pflNames[i]+=cpy; + } + const_cast(myField3->getSupport())->setProfilNames(pflNames); + MED_FIELD_WRONLY_DRIVER myFieldDriver4("Copy_nomesh_"+fileName,myField3) ; + myFieldDriver4.setFieldName(myField3->getName()+"__Copy"); + int current = myField3->addDriver(myFieldDriver4); + myField3->write(current); + + delete myMesh3; + delete myField3; + + + //ESSAYER AVEC MAILLAGE DS FICHIER ET LIEN SUPORT-MESH PRESENTS SIMULTANEMENT + //EN VERSION COHERENTE ET NON COHERENTE + } +} diff --git a/src/MEDMEM/test_profil_gauss_MedFieldDriver.cxx b/src/MEDMEM/test_profil_gauss_MedFieldDriver.cxx new file mode 100644 index 000000000..c1bd8228a --- /dev/null +++ b/src/MEDMEM/test_profil_gauss_MedFieldDriver.cxx @@ -0,0 +1,443 @@ + +#include +#include + +#include "MEDMEM_Exception.hxx" +#include "MEDMEM_Mesh.hxx" +#include "MEDMEM_MedMeshDriver.hxx" +#include "MEDMEM_Field.hxx" +#include "MEDMEM_MedFieldDriver.hxx" +#include "MEDMEM_Support.hxx" +#include "MEDMEM_define.hxx" +#include "MEDMEM_GaussLocalization.hxx" + +using namespace std; +using namespace MEDMEM; +using namespace MED_EN; + +#define INTERLACING_MODE FullInterlace +int fct2(int i,const int * number) { return i;}; +int fct1(int i,const int * number) { return number[i]; }; + +void affiche_field_(FIELD_ * myField) +{ + cout << "Field "<< myField->getName() << " : " <getDescription() << endl ; + int NumberOfComponents = myField->getNumberOfComponents() ; + cout << "- Nombre de composantes : "<< NumberOfComponents << endl ; + for (int i=1; igetComponentName(i)<< endl; + cout << " - description : "<getComponentDescription(i) << endl; + cout << " - units : "<getMEDComponentUnit(i) << endl; + } + cout << "- iteration :" << endl ; + cout << " - numero : " << myField->getIterationNumber()<< endl ; + cout << " - ordre : " << myField->getOrderNumber()<< endl ; + cout << " - temps : " << myField->getTime()<< endl ; + + cout << "- Type : " << myField->getValueType()<< endl; + //PRESENCE DE POINTS DE GAUSS +} + +// Cas de traitement des valeurs sans spécificité concernant +// les points de Gauss ou les profils +// Pas de spécificité concernant le type géométrique +template +void affiche_fieldT(FIELD * myField) +{ + const double * value = 0; + affiche_field_((FIELD_ *) myField); + + cout.setf(ios::fixed); + + int numberOf = myField->getNumberOfValues(); + int numberOfComponents = myField->getNumberOfComponents() ; + int valueLength = myField->getValueLength(); + int numberOfGeometricType = myField->getNumberOfGeometricTypes(); + const int * nbOfElements = myField->getNumberOfElements(); + const MED_EN::medGeometryElement * typeList = myField->getGeometricTypes(); + // Suivant le traitement, on peut faire sortir si il y a des points de Gauss + // ou des profils + + cout << "myField->getValueLength (MED_ALL_ELEMENTS) : " << valueLength << endl; + cout << "myField->getNumberOfElements (MED_ALL_ELEMENTS) : " << numberOf << endl; + cout << "myField->getNumberOfComponents () : " << numberOfComponents << endl; + cout << "myField->getNumberOfGeometricType () : " << numberOfGeometricType << endl; + for (int i=0; i < numberOfGeometricType; i++) { + cout << "Number Of Elements on type "<< MED_EN::geoNames[typeList[i]] + <<" : "<< nbOfElements[i] << endl; + cout << "Number Of Gauss Points on type "<< MED_EN::geoNames[typeList[i]] + <<" : "<< myField->getNumberOfGaussPoints(typeList[i]) << endl; + cout << "Localization description : " << endl << myField->getGaussLocalization(typeList[i]) << endl; + } + + cout << "- Valeurs :"<getValueLength (MED_ALL_ELEMENTS) : " << valueLength << endl; + cout << "mySupport->getNumberOfElements (MED_ALL_ELEMENTS) : " << numberOf << endl; + cout << "mySupport->getNumberOfComponents () : " << numberOfComponents << endl; + cout << "mySupport->getNumberOfGeometricType () : " << numberOfGeometricType << endl; + assert(numberOf == myField->getNumberOfValues() ); + + // S'il existe des profils, je récupère la liste des numéros d'éléments + // pour tous les types géométriques + for (int i=0; i < numberOfGeometricType; i++) { + cout << "Number Of Elements on type "<< MED_EN::geoNames[typeList[i]] + <<" : "<< nbOfElements[i] << endl; + cout << "Number Of Gauss Points on type "<< MED_EN::geoNames[typeList[i]] + <<" : "<< nbGaussPoints[i] << endl; + cout << "Localization description : " << endl << myField->getGaussLocalization(typeList[i]) << endl; + } + + // On récupère la liste complète + if (!onAll) number = mySupport->getNumber(MED_ALL_ELEMENTS); + + int elNo = -1; + cout << "- Valeurs :" << endl; + for (int i=1; i<=numberOf; i++) { + if (onAll) elNo = i; else elNo = number[i-1]; + //cout << endl << "myField->getRow("<getRow(elNo) << endl; + value = myField->getRow(elNo) ; + //UP: getRow prend un numéro d'élément qui existe, getRow(1) n'existe pas forcément si il y a un profil + //qui ne défini pas cet indice + //cout << endl << " Valeur de getNbGaussI("<getNbGaussI(elNo) << endl; + for (int j=0; jgetNbGaussI(elNo); j++) + //UP : Prend en compte le nombre de points de Gauss de l'élément elNo + cout << "value["<< elNo << "] = " << value[j] << " "; + cout< +void affiche_fieldT(FIELD * myField) +{ + const double * value = 0; + const int * number = 0; + + affiche_field_((FIELD_ *) myField); + const SUPPORT * mySupport=myField->getSupport(); + + cout.setf(ios::fixed); + + + int numberOfComponents = myField->getNumberOfComponents() ; + int valueLength = myField->getValueLength(); + const int * nbGaussPoints = myField->getNumberOfGaussPoints(); + + int numberOf = mySupport->getNumberOfElements(MED_ALL_ELEMENTS); + int numberOfGeometricType = mySupport->getNumberOfTypes(); + const int * nbOfElements = mySupport->getNumberOfElements(); + const MED_EN::medGeometryElement * typeList = mySupport->getTypes(); + bool onAll = mySupport->isOnAllElements(); + + cout << "mySupport->getValueLength (MED_ALL_ELEMENTS) : " << valueLength << endl; + cout << "mySupport->getNumberOfElements (MED_ALL_ELEMENTS) : " << numberOf << endl; + cout << "mySupport->getNumberOfComponents () : " << numberOfComponents << endl; + cout << "mySupport->getNumberOfGeometricType () : " << numberOfGeometricType << endl; + cout << "mySupport->getNumberOfElements(MED_ALL_ELEMENTS) : " << numberOf << endl; + assert(numberOf == myField->getNumberOfValues() ); + + // S'il existe des profils, je récupère la liste des numéros d'éléments + // pour tous les types géométriques + for (int i=0; i < numberOfGeometricType; i++) { + cout << "Number Of Elements on type "<< MED_EN::geoNames[typeList[i]] + <<" : "<< nbOfElements[i] << endl; + cout << "Number Of Gauss Points on type "<< MED_EN::geoNames[typeList[i]] + <<" : "<< nbGaussPoints[i] << endl; + cout << "Localization description : " << endl << myField->getGaussLocalization(typeList[i]) << endl; + } + + + int (* fct)(int,const int *); + + if (!onAll) { + number = mySupport->getNumber(MED_ALL_ELEMENTS); + fct=fct1; + } else + fct=fct2; + + int oneDimlength = valueLength/numberOfComponents; + for (int j=1; j<=numberOfComponents; j++) { + value = myField->getColumn(j) ; + for (int i=0; i +void affiche_fieldT2(FIELD< T, INTERLACING_TAG> * myField) +{}; + + +// Spécialisation du traitement pour le mode FullInterlace +// Spécifité de traitement par rapport aux profils (utilisation du SUPPORT) +// Spécificité concernant le type géométrique +// Spécificité concernant les points de Gauss +template <> +void affiche_fieldT2(FIELD * myField) +{ + const int * number = 0; + + affiche_field_((FIELD_ *) myField); + const SUPPORT * mySupport=myField->getSupport(); + + cout.setf(ios::fixed); + + + int numberOfComponents = myField->getNumberOfComponents() ; + int valueLength = myField->getValueLength(); + const int * nbGaussPoints = myField->getNumberOfGaussPoints(); + + int numberOf = mySupport->getNumberOfElements(MED_ALL_ELEMENTS); + int numberOfGeometricType = mySupport->getNumberOfTypes(); + const int * nbOfElements = mySupport->getNumberOfElements(); + const MED_EN::medGeometryElement * typeList = mySupport->getTypes(); + bool onAll = mySupport->isOnAllElements(); + + cout << "mySupport->getValueLength (MED_ALL_ELEMENTS) : " << valueLength << endl; + cout << "mySupport->getNumberOfElements (MED_ALL_ELEMENTS) : " << numberOf << endl; + cout << "mySupport->getNumberOfComponents () : " << numberOfComponents << endl; + cout << "mySupport->getNumberOfGeometricType () : " << numberOfGeometricType << endl; + cout << "mySupport->getNumberOfElements(MED_ALL_ELEMENTS) : " << numberOf << endl; + assert(numberOf == myField->getNumberOfValues() ); + + // S'il existe des profils, je récupère la liste des numéros d'éléments + // pour tous les types géométriques + for (int i=0; i < numberOfGeometricType; i++) { + cout << "Number Of Elements on type "<< MED_EN::geoNames[typeList[i]] + <<" : "<< nbOfElements[i] << endl; + cout << "Number Of Gauss Points on type "<< MED_EN::geoNames[typeList[i]] + <<" : "<< nbGaussPoints[i] << endl; + } + + + int (* fct)(int,const int *); + + if (!onAll) { + number = mySupport->getNumber(MED_ALL_ELEMENTS); + fct=fct1; + } else + fct=fct2; + + cout << "- Valeurs :"< * myField1 = new FIELD(MED_DRIVER,fileName,fieldName, + iterationNumber, orderNumber); + affiche_fieldT(myField1); + cout << endl; + affiche_fieldT2(myField1); + + // Pour éviter de modifier le fichier d'origine, + // on en crée une copie avec uniquement le maillage. + // Rem : Pour le test, le chargement du maillage n'est pas nécessaire + // On pourrait réécrire le Champ dans le fichier d'origine + // sous un autre nom. + // Attention si le driver MED_MESH modifie le nombre d'éléments d'un type géométrique : + // le calcul de renumérotation à l'écriture du champ risque d'être faux ! + meshName = myField1->getSupport()->getMeshName(); + MESH * myMesh = new MESH(MED_DRIVER,fileName,meshName); + MED_MESH_WRONLY_DRIVER myMeshDriver1("Copy_withmesh_"+fileName,myMesh); + int current=myMesh->addDriver(myMeshDriver1); + myMesh->write(current); + delete myMesh; + + // On ajoute un driver en écriture, comme la relation SUPPORT-MESH n'est pas + // initialisée, le driver doit trouver le maillage dans le fichier cible + // pour réaliser la transcription des profils MEDMEMOIRE à MEDFICHIER. + MED_FIELD_WRONLY_DRIVER myFieldDriver2("Copy_withmesh_"+fileName,myField1) ; + current = myField1->addDriver(myFieldDriver2); + myField1->write(current); + delete myField1; + } + + mode2: + ///////////////////////////////////////////////////////////////////////////// + // TEST DEUXIEME MODE : + // Lecture idem 1er mode + // A l'écriture, le fichier cible ne contient pas le maillage mais la + // relation SUPPORT-MESH est établie, le driver peut donc utiliser les informations + // dans le maillage pour transcrire les profils. + // Selon le modèle MED FICHIER, ce mode est interdit : le fichier doit au moins + // contenir un lien sur le maillage (information pas encore exploitée dans MEDMEMOIRE + // : pas de gestion de montage/démontage des fichiers ) + // Attention si le driver MED_MESH modifie le nombre d'éléments d'un type géométrique : + // le calcul de renumérotation à l'écriture du champ risque d'être faux car les + // profils crées à la lecture sont basés sur le nombre d'éléments par type géoémtrique + // du maillage contenu dans le fichier à la lecture. + // Une solution consisterait à prendre en compte le montage de fichiers distants + // et de prendre en compte la différence de nombre d'éléments par type géométrique + // entre le maillage MEDMEM et le maillage MEDFICHIER + // (Hum ! : Il serait plus simple que MEDMEMOIRE ne recalcule pas systématiquement + // ce que l'on ne lui demande pas, ce qui permettrait aussi de réécrire à l'identique + // un fichier que l'on vient de lire) + { + FIELD * myField2 = new FIELD(MED_DRIVER,fileName,fieldName, + iterationNumber, orderNumber); + + meshName = myField2->getSupport()->getMeshName(); + MESH * myMesh2 = new MESH(MED_DRIVER,fileName,meshName); + + const SUPPORT * mySupport2=myField2->getSupport(); + mySupport2->setMesh(myMesh2); + + // On ajoute un driver en écriture, comme la relation SUPPORT-MESH est + // initialisée, le driver utilise le maillage en mémoire + // pour réaliser la transcription des profils MEDMEMOIRE à MEDFICHIER. + MED_FIELD_WRONLY_DRIVER myFieldDriver3("Copy_nomesh_"+fileName,myField2) ; + int current = myField2->addDriver(myFieldDriver3); + myField2->write(current); + + //Pour regarder le fichier produit avec MDUMP decommenter ces trois lignes + //car le fichier qui est produit n'est pas à la norme MED + //Il doit contenir soit le maillage associé soit un lien vers le maillage associé. + //MED_MESH_WRONLY_DRIVER myMeshDriver2("Copy_nomesh_"+fileName,myMesh2); + //current=myMesh2->addDriver(myMeshDriver2); + //myMesh2->write(current); + + delete myField2; + delete myMesh2; + + + } + mode3: + // TEST TROISIEME MODE : + // A la lecture, le fichier MED lu ne contient pas le maillage associé au champ demandé + // (mais un lien MEDFICHIER qui n'est pas exploité à ce jour). + // Cependant avant sa lecture le FIELD a été associé à un SUPPORT + // avec le lien au MESH préalablement chargé. + // Le driver du FIELD (automatiquement crée) est capable de lire les profils MEDFICHIER + // et utilise la relation SUPPORT-MESH initialisée pour transcrire les profils + // de la numérotation locale MEDFICHIER à la numérotation globale MEDMEMOIRE). + // REM: Une fois le champ chargé, il possède un nouveau support, le premier peut être libéré. + // En effet le driver du FIELD se fit uniquement au type géométriques définis dans le champ MEDFICHIER + // pour créer son SUPPORT car un SUPPORT crée "onAll" à partir d'un MESH repose sur tous + // les types géométriques du MESH ce qui n'est pas forcément le cas d'un champ MEDFICHIER + // (même sans profil) lu à posteriori. + { + med_2_2::med_err err=-1; + med_2_2::med_idt id = med_2_2::MEDouvrir(const_cast ( ("Copy_nomesh_"+fileName).c_str()), + med_2_2::MED_LECTURE_ECRITURE); + if (id <=0) cout << "Erreur dans MEDouvrir pour le fichier " << "Copy_nomesh_"+fileName < ( ("Copy_withmesh_"+fileName).c_str()), + const_cast (meshName.c_str()) ); + if (err !=0) cout << "Erreur dans MEDlienEcr pour le maillage distant " << meshName + <<" contenu dans le fichier " << "Copy_withmesh_"+fileName < * myField3 = new FIELD(mySupport3,MED_DRIVER,"Copy_nomesh_"+fileName,fieldName, iterationNumber, orderNumber); + delete mySupport3; // Il est déjà possible de libérer ce SUPPORT + + //TEST à la réecriture (renommage des profils + // à cause de MEDprofilEcr qui ne prend pas en compte le mode + // MED_LECTURE_AJOUT) ): + string cpy("__Copy"); + vector < string > pflNames = myField3->getSupport()->getProfilNames(); + for (int i=0; i< pflNames.size(); ++i) { + pflNames[i].resize(pflNames[i].size()-cpy.size()); + pflNames[i]+=cpy; + } + const_cast(myField3->getSupport())->setProfilNames(pflNames); + + MED_FIELD_WRONLY_DRIVER myFieldDriver4("Copy_nomesh_"+fileName,myField3) ; + myFieldDriver4.setFieldName(myField3->getName()+"__Copy"); + int current = myField3->addDriver(myFieldDriver4); + myField3->write(current); + + delete myMesh3; + delete myField3; + + + //ESSAYER AVEC MAILLAGE DS FICHIER ET LIEN SUPORT-MESH PRESENTS SIMULTANEMENT + //EN VERSION COHERENTE ET NON COHERENTE + } +} diff --git a/src/MEDMEM_I/MEDMEM_Support_i.cxx b/src/MEDMEM_I/MEDMEM_Support_i.cxx index 121c6b253..949c72db2 100644 --- a/src/MEDMEM_I/MEDMEM_Support_i.cxx +++ b/src/MEDMEM_I/MEDMEM_Support_i.cxx @@ -503,58 +503,6 @@ throw (SALOME::SALOME_Exception) } } - -//============================================================================= -/*! - * CORBA: Array containing indexes for elements included in the support - */ -//============================================================================= - -CORBA::Long SUPPORT_i::getNumberOfGaussPoint(SALOME_MED::medGeometryElement geomElement) -throw (SALOME::SALOME_Exception) -{ - if (_support==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Support", \ - SALOME::INTERNAL_ERROR); - try - { - return _support->getNumberOfGaussPoint(convertIdlEltToMedElt(geomElement)); - } - catch (MEDEXCEPTION &ex) - { - MESSAGE("Unable to access number of Gauss points"); - THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); - } -} -//============================================================================= -/*! - * CORBA: Global Nodes Index (optionnaly designed by the user) - */ -//============================================================================= -SALOME_MED::long_array * SUPPORT_i::getNumbersOfGaussPoint() -throw (SALOME::SALOME_Exception) -{ - if (_support==NULL) - THROW_SALOME_CORBA_EXCEPTION("No associated Support", \ - SALOME::INTERNAL_ERROR); - SALOME_MED::long_array_var myseq= new SALOME_MED::long_array; - try - { - int mySeqLength=_support->getNumberOfTypes(); - myseq->length(mySeqLength); - const medGeometryElement * elemts = _support->getTypes(); - for (int i=0;igetNumberOfGaussPoint(elemts[i]); - } - } - catch (MEDEXCEPTION &ex) - { - MESSAGE("Unable to access number of Gauss points"); - THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR); - } - return myseq._retn(); -} //============================================================================= /*! * CORBA: add the Support in the StudyManager diff --git a/src/MedClient/src/FAMILYClient.cxx b/src/MedClient/src/FAMILYClient.cxx index 99b2a3e85..f2721822a 100644 --- a/src/MedClient/src/FAMILYClient.cxx +++ b/src/MedClient/src/FAMILYClient.cxx @@ -53,33 +53,33 @@ void FAMILYClient::blankCopy(bool blankSupport) if (blankSupport) SUPPORTClient::blankCopy(); -// setIdentifier(IOR_Family->getIdentifier()); + setIdentifier(IOR_Family->getIdentifier()); -// int nAttr, nGr, n; -// int *i; -// std::string *s; + int nAttr, nGr, n; + int *i; + std::string *s; -// nAttr = IOR_Family->getNumberOfAttributes(); -// setNumberOfAttributes(nAttr); + nAttr = IOR_Family->getNumberOfAttributes(); + setNumberOfAttributes(nAttr); -// convertCorbaArray(i, n, IOR_Family->getAttributesIdentifiers()); -// ASSERT(n == nAttr); -// setAttributesIdentifiers(i); + convertCorbaArray(i, n, IOR_Family->getAttributesIdentifiers()); + ASSERT(n == nAttr); + setAttributesIdentifiers(i); -// convertCorbaArray(i, n, IOR_Family->getAttributesValues()); -// ASSERT(n == _numberOfAttribute); -// setAttributesValues(i); + convertCorbaArray(i, n, IOR_Family->getAttributesValues()); + ASSERT(n == _numberOfAttribute); + setAttributesValues(i); -// convertCorbaArray(s, n, IOR_Family->getAttributesDescriptions()); -// ASSERT(n == _numberOfAttribute); -// setAttributesDescriptions(s); + convertCorbaArray(s, n, IOR_Family->getAttributesDescriptions()); + ASSERT(n == _numberOfAttribute); + setAttributesDescriptions(s); -// nGr = IOR_Family->getNumberOfGroups(); -// setNumberOfGroups(nGr); + nGr = IOR_Family->getNumberOfGroups(); + setNumberOfGroups(nGr); -// convertCorbaArray(s, n, IOR_Family->getGroupsNames()); -// ASSERT(n == _numberOfAttribute); -// setGroupsNames(s); + convertCorbaArray(s, n, IOR_Family->getGroupsNames()); + ASSERT(n == _numberOfGroup); + setGroupsNames(s); _complete = false; @@ -99,7 +99,9 @@ void FAMILYClient::fillCopy(bool fillSupport) if (fillSupport) SUPPORTClient::fillCopy(); - + + // Get other FAMILY attributes + _complete = true; } diff --git a/src/MedClient/src/MESHClient.cxx b/src/MedClient/src/MESHClient.cxx index 487f086e2..539f45475 100644 --- a/src/MedClient/src/MESHClient.cxx +++ b/src/MedClient/src/MESHClient.cxx @@ -173,6 +173,46 @@ void MESHClient::fillCopy() _coord->fillCopy(); _connect->fillCopy(); + int size = _familyNode.size(); + + for (int i = 0; i < size; i++) + { + FAMILYClient * _fam = dynamic_cast (_familyNode[i]); + ASSERT(_fam); + + _fam->fillCopy(); + } + + size = _familyCell.size(); + + for (int i = 0; i < size; i++) + { + FAMILYClient * _fam = dynamic_cast (_familyCell[i]); + ASSERT(_fam); + + _fam->fillCopy(); + } + + size = _familyFace.size(); + + for (int i = 0; i < size; i++) + { + FAMILYClient * _fam = dynamic_cast (_familyFace[i]); + ASSERT(_fam); + + _fam->fillCopy(); + } + + size = _familyEdge.size(); + + for (int i = 0; i < size; i++) + { + FAMILYClient * _fam = dynamic_cast (_familyEdge[i]); + ASSERT(_fam); + + _fam->fillCopy(); + } + _complete = true; END_OF("MESHClient::fillCopy()"); diff --git a/src/MedClient/src/SUPPORTClient.cxx b/src/MedClient/src/SUPPORTClient.cxx index 4a2ef7620..b5e621291 100644 --- a/src/MedClient/src/SUPPORTClient.cxx +++ b/src/MedClient/src/SUPPORTClient.cxx @@ -87,10 +87,6 @@ void SUPPORTClient::blankCopy() SCRUTE(_totalNumberOfElements); _complete_support = false; - //Gauss points settings - _numberOfGaussPoint = new int[_numberOfGeometricType]; - for (int i=0;i<_numberOfGeometricType;i++) - _numberOfGaussPoint[i] = 1 ; } catch( const CORBA::Exception &ex ) { -- 2.39.2