Back to index

salome-med  6.5.0
MEDCouplingGaussLocalization.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  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 (int)_weight.size(); }
00040     int getDimension() const;
00041     int getNumberOfPtsInRefCell() const;
00042     std::string getStringRepr() const;
00043     void checkCoherency() const throw(INTERP_KERNEL::Exception);
00044     bool isEqual(const MEDCouplingGaussLocalization& other, double eps) const;
00045     void pushTinySerializationIntInfo(std::vector<int>& tinyInfo) const;
00046     void pushTinySerializationDblInfo(std::vector<double>& tinyInfo) const;
00047     const double *fillWithValues(const double *vals);
00048     //
00049     const std::vector<double>& getRefCoords() const { return _ref_coord; }
00050     double getRefCoord(int ptIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
00051     const std::vector<double>& getGaussCoords() const { return _gauss_coord; }
00052     double getGaussCoord(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
00053     const std::vector<double>& getWeights() const { return _weight; }
00054     double getWeight(int gaussPtIdInCell, double newVal) const throw(INTERP_KERNEL::Exception);
00055     void setRefCoord(int ptIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
00056     void setGaussCoord(int gaussPtIdInCell, int comp, double newVal) throw(INTERP_KERNEL::Exception);
00057     void setWeight(int gaussPtIdInCell, double newVal) throw(INTERP_KERNEL::Exception);
00058     //
00059     static MEDCouplingGaussLocalization BuildNewInstanceFromTinyInfo(int dim, const std::vector<int>& tinyData);
00060     static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
00061   private:
00062     int checkCoherencyOfRequest(int gaussPtIdInCell, int comp) const throw(INTERP_KERNEL::Exception);
00063   private:
00064     INTERP_KERNEL::NormalizedCellType _type;
00065     std::vector<double> _ref_coord;
00066     std::vector<double> _gauss_coord;
00067     std::vector<double> _weight;
00068   };
00069 }
00070 
00071 #endif