]> SALOME platform Git repositories - modules/med.git/blob - src/MEDCalculator/MEDCalculatorDBSliceField.hxx
Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/med.git] / src / MEDCalculator / MEDCalculatorDBSliceField.hxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef __MEDCALCULATORDBSLICEFIELD_HXX__
21 #define __MEDCALCULATORDBSLICEFIELD_HXX__
22
23 #include "MedCalculatorDefines.hxx"
24 #include "MEDCouplingRefCountObject.hxx"
25
26 #include "InterpKernelException.hxx"
27
28 #include <string>
29
30 namespace ParaMEDMEM
31 {
32   class MEDCouplingFieldDouble;
33   class MEDCouplingMesh;
34   class DataArrayInt;
35   class MEDCalculatorDBRangeSelection;
36   
37   class MEDCALCULATOR_EXPORT MEDCalculatorDBSliceField : public RefCountObject
38   {
39   public:
40     MEDCalculatorDBSliceField(int iter, int order);
41     MEDCalculatorDBSliceField(MEDCouplingFieldDouble *f);
42     bool isFetched() const { return _field!=0; }
43     void getDtIt(int& it, int& order) const { it=_iteration;  order=_order; }
44     void setField(MEDCouplingFieldDouble *f) const;
45     void setName(const char *name);
46     void setDescription(const char *descr);
47     void write(const char *fName, const std::string& n, const std::string& d) const throw(INTERP_KERNEL::Exception);
48     const MEDCouplingMesh *getMesh(TypeOfField type, const std::string& fname, const std::string& mname, const std::string& fieldName) const;
49     MEDCouplingFieldDouble *getField(TypeOfField type, const std::string& fname, const std::string& mname, const std::string& fieldName) const;
50     MEDCouplingFieldDouble *getFieldWithoutQuestion(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const;
51     MEDCouplingFieldDouble *getFieldAttribute() const { return _field; }
52     MEDCouplingFieldDouble *buildCstFromThis(double val, int nbOfComp, const MEDCouplingFieldDouble *m) const;
53     //
54     void assign(const MEDCalculatorDBSliceField* other, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
55                 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC);
56     MEDCalculatorDBSliceField *add(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc,
57                                 int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
58                                 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
59     MEDCalculatorDBSliceField *substract(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc,
60                                       int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
61                                       int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
62     MEDCalculatorDBSliceField *multiply(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc,
63                                      int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
64                                      int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
65     MEDCalculatorDBSliceField *divide(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc,
66                                    int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
67                                    int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
68     MEDCalculatorDBSliceField *dot(const MEDCalculatorDBSliceField* other,
69                                 int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
70                                 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
71     MEDCalculatorDBSliceField *crossProduct(const MEDCalculatorDBSliceField* other,
72                                          int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
73                                          int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
74     MEDCalculatorDBSliceField *doublyContractedProduct(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
75     MEDCalculatorDBSliceField *determinant(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
76     MEDCalculatorDBSliceField *eigenValues(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
77     MEDCalculatorDBSliceField *eigenVectors(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
78     MEDCalculatorDBSliceField *inverse(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
79     MEDCalculatorDBSliceField *trace(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
80     MEDCalculatorDBSliceField *deviator(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
81     MEDCalculatorDBSliceField *magnitude(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
82     void applyFunc(const char *func, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC);
83     bool isEqual(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc,
84                  int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
85                  int sizeCOther, const MEDCalculatorDBRangeSelection& otherC, double prec) const;
86   private:
87     ~MEDCalculatorDBSliceField();
88   private:
89     int _iteration;
90     int _order;
91     mutable MEDCouplingFieldDouble *_field;
92     MEDCouplingFieldDouble *_work;
93   };
94 }
95
96 #endif