Back to index

salome-med  6.5.0
MEDCalculatorDBSliceField.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 __MEDCALCULATORDBSLICEFIELD_HXX__
00021 #define __MEDCALCULATORDBSLICEFIELD_HXX__
00022 
00023 #include "MedCalculatorDefines.hxx"
00024 #include "MEDCouplingRefCountObject.hxx"
00025 
00026 #include "InterpKernelException.hxx"
00027 
00028 #include <string>
00029 
00030 namespace ParaMEDMEM
00031 {
00032   class MEDCouplingFieldDouble;
00033   class MEDCouplingMesh;
00034   class DataArrayInt;
00035   class MEDCalculatorDBRangeSelection;
00036   
00037   class MEDCALCULATOR_EXPORT MEDCalculatorDBSliceField : public RefCountObject
00038   {
00039   public:
00040     MEDCalculatorDBSliceField(int iter, int order);
00041     MEDCalculatorDBSliceField(MEDCouplingFieldDouble *f);
00042     bool isFetched() const { return _field!=0; }
00043     void getDtIt(int& it, int& order) const { it=_iteration;  order=_order; }
00044     void setField(MEDCouplingFieldDouble *f) const;
00045     void setName(const char *name);
00046     void setDescription(const char *descr);
00047     void write(const char *fName, const std::string& n, const std::string& d) const throw(INTERP_KERNEL::Exception);
00048     const MEDCouplingMesh *getMesh(TypeOfField type, const std::string& fname, const std::string& mname, const std::string& fieldName) const;
00049     MEDCouplingFieldDouble *getField(TypeOfField type, const std::string& fname, const std::string& mname, const std::string& fieldName) const;
00050     MEDCouplingFieldDouble *getFieldWithoutQuestion(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const;
00051     MEDCouplingFieldDouble *getFieldAttribute() const { return _field; }
00052     MEDCouplingFieldDouble *buildCstFromThis(double val, int nbOfComp, const MEDCouplingFieldDouble *m) const;
00053     //
00054     void assign(const MEDCalculatorDBSliceField* other, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
00055                 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC);
00056     MEDCalculatorDBSliceField *add(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc,
00057                                 int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
00058                                 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
00059     MEDCalculatorDBSliceField *substract(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc,
00060                                       int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
00061                                       int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
00062     MEDCalculatorDBSliceField *multiply(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc,
00063                                      int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
00064                                      int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
00065     MEDCalculatorDBSliceField *divide(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc,
00066                                    int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
00067                                    int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
00068     MEDCalculatorDBSliceField *dot(const MEDCalculatorDBSliceField* other,
00069                                 int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
00070                                 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
00071     MEDCalculatorDBSliceField *crossProduct(const MEDCalculatorDBSliceField* other,
00072                                          int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
00073                                          int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
00074     MEDCalculatorDBSliceField *doublyContractedProduct(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
00075     MEDCalculatorDBSliceField *determinant(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
00076     MEDCalculatorDBSliceField *eigenValues(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
00077     MEDCalculatorDBSliceField *eigenVectors(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
00078     MEDCalculatorDBSliceField *inverse(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
00079     MEDCalculatorDBSliceField *trace(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
00080     MEDCalculatorDBSliceField *deviator(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
00081     MEDCalculatorDBSliceField *magnitude(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
00082     void applyFunc(const char *func, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC);
00083     bool isEqual(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc,
00084                  int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
00085                  int sizeCOther, const MEDCalculatorDBRangeSelection& otherC, double prec) const;
00086   private:
00087     ~MEDCalculatorDBSliceField();
00088   private:
00089     int _iteration;
00090     int _order;
00091     mutable MEDCouplingFieldDouble *_field;
00092     MEDCouplingFieldDouble *_work;
00093   };
00094 }
00095 
00096 #endif