Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/med.git] / src / MEDMEM / MEDMEM_GaussLocalization.hxx
index 462ac2e73d047482dec1ae3c25e06e431f2df718..b62ece840500f3f5b7a096542cbbe07fa374db08 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  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.
+// 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.
 //
-//  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.
+// 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
+// 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
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef GAUSS_LOCALIZATION_HXX
 #define GAUSS_LOCALIZATION_HXX
 
@@ -53,7 +54,7 @@ namespace MEDMEM {
   template <class INTERLACING_TAG=FullInterlace> class GAUSS_LOCALIZATION;
 
   template <class INTERLACING_TAG> ostream & operator<< (ostream &os,
-                                                        const GAUSS_LOCALIZATION<INTERLACING_TAG> &loc);
+                                                         const GAUSS_LOCALIZATION<INTERLACING_TAG> &loc);
 
   template <class INTERLACING_TAG> class GAUSS_LOCALIZATION : public GAUSS_LOCALIZATION_{
   public:
@@ -71,22 +72,22 @@ namespace MEDMEM {
 
   public:
     friend ostream & operator<< <INTERLACING_TAG>(ostream &os,
-                                                 const GAUSS_LOCALIZATION<INTERLACING_TAG> &loc);
+                                                  const GAUSS_LOCALIZATION<INTERLACING_TAG> &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<double>  & wg) throw (MEDEXCEPTION);
+                       const MED_EN::medGeometryElement typeGeo,
+                       const int  nGauss,
+                       const ArrayNoGauss & cooRef,
+                       const ArrayNoGauss & cooGauss,
+                       const vector<double>  & 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);
+                       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() {};
@@ -108,11 +109,11 @@ namespace MEDMEM {
   {}
 
   template <class INTERLACING_TAG> GAUSS_LOCALIZATION<INTERLACING_TAG>::GAUSS_LOCALIZATION(const string & locName,
-                                                                                          const MED_EN::medGeometryElement typeGeo,
-                                                                                          const int  nGauss,
-                                                                                          const ArrayNoGauss & cooRef,
-                                                                                          const ArrayNoGauss & cooGauss,
-                                                                                          const vector<double>  & wg)  throw (MEDEXCEPTION) :
+                                                                                           const MED_EN::medGeometryElement typeGeo,
+                                                                                           const int  nGauss,
+                                                                                           const ArrayNoGauss & cooRef,
+                                                                                           const ArrayNoGauss & cooGauss,
+                                                                                           const vector<double>  & wg)  throw (MEDEXCEPTION) :
     _locName(locName),_typeGeo(typeGeo),_nGauss(nGauss),_cooRef(cooRef),_cooGauss(cooGauss),_wg(wg),
     _interlacingType(SET_INTERLACING_TYPE<INTERLACING_TAG>::_interlacingType)
   {
@@ -123,15 +124,15 @@ namespace MEDMEM {
 
     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))) ;
+                                     << " 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 )
+                                     << _nGauss*(_typeGeo/100) ));
+    if ((int)_wg.size() != _nGauss )
       throw MEDEXCEPTION( LOCALIZED( STRING(LOC) <<"wg must be of size nGauss "
-                                    << _nGauss ));
+                                     << _nGauss ));
 
   END_OF_MED(LOC);
   }
@@ -156,14 +157,14 @@ namespace MEDMEM {
 
     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))) ;
+                                     << (_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 )
+                                     << _nGauss*(_typeGeo/100) ));
+    if ((int)_wg.size() != _nGauss )
       throw MEDEXCEPTION( LOCALIZED( STRING(LOC) <<"wg must be of size nGauss "
-                                    << _nGauss ));
+                                     << _nGauss ));
   END_OF_MED(LOC);
   }
 
@@ -187,25 +188,25 @@ namespace MEDMEM {
   template <class INTERLACING_TAG> bool
   GAUSS_LOCALIZATION<INTERLACING_TAG>::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
-           );
+            _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 <class INTERLACING_TAG> ostream & operator<<(ostream &os,
-                                                               const  GAUSS_LOCALIZATION<INTERLACING_TAG> &loc) {
+                                                                const  GAUSS_LOCALIZATION<INTERLACING_TAG> &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; i<loc._wg.size();++i)
+    for(unsigned i=0; i<loc._wg.size();++i)
       os << "_wg[" << i << "] = " << loc._wg[i] << endl;
     return os;
   }