Version: 6.3.1

src/MEDCoupling/MEDCouplingGaussLocalization.hxx

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #ifndef __PARAMEDMEM_MEDCOUPLINGGAUSSLOCALIZATION_HXX__
00021 #define __PARAMEDMEM_MEDCOUPLINGGAUSSLOCALIZATION_HXX__
00022 
00023 #include "MEDCoupling.hxx"
00024 #include "NormalizedUnstructuredMesh.hxx"
00025 #include "InterpKernelException.hxx"
00026 
00027 #include <vector>
00028 
00029 namespace ParaMEDMEM
00030 {
00031   class MEDCouplingMesh;
00032 
00033   class MEDCOUPLING_EXPORT MEDCouplingGaussLocalization
00034   {
00035   public:
00036     MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
00037                                  const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
00038     INTERP_KERNEL::NormalizedCellType getType() const { return _type; }
00039     int getNumberOfGaussPt() const { return _weight.size(); }
00040     int getDimension() const;
00041     int getNumberOfPtsInRefCell() const;
00042     void checkCoherency() const throw(INTERP_KERNEL::Exception);
00043     bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const;
00044     void pushTinySerializationIntInfo(std::vector<int>& tinyInfo) const;
00045     void pushTinySerializationDblInfo(std::vector<double>& tinyInfo) const;
00046     const double *fillWithValues(const double *vals);
00047     //
00048     const std::vector<double>& getRefCoords() const { return _ref_coord; }
00049     double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
00050     const std::vector<double>& getGaussCoords() const { return _gauss_coord; }
00051     double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
00052     const std::vector<double>& getWeights() const { return _weight; }
00053     double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
00054     void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
00055     void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
00056     void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
00057     //
00058     static MEDCouplingGaussLocalization BuildNewInstanceFromTinyInfo(int dim, const std::vector<int>& tinyData);
00059     static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
00060   private:
00061     int checkCoherencyOfRequest(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
00062   private:
00063     INTERP_KERNEL::NormalizedCellType _type;
00064     std::vector<double> _ref_coord;
00065     std::vector<double> _gauss_coord;
00066     std::vector<double> _weight;
00067   };
00068 }
00069 
00070 #endif
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS