Salome HOME
LOT7: fix compilation at med_int==int64
[modules/med.git] / src / MEDCalculator / MEDCalculatorDBSliceField.hxx
1 // Copyright (C) 2007-2019  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, or (at your option) any later version.
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 // Author : Anthony Geay (CEA/DEN)
20
21 #ifndef __MEDCALCULATORDBSLICEFIELD_HXX__
22 #define __MEDCALCULATORDBSLICEFIELD_HXX__
23
24 #include "MedCalculatorDefines.hxx"
25 #include "MCType.hxx"
26 #include "MEDCouplingRefCountObject.hxx"
27
28 #include "InterpKernelException.hxx"
29
30 #include <string>
31
32 namespace MEDCoupling
33 {
34   class MEDCouplingFieldDouble;
35   class MEDCouplingMesh;
36   class DataArrayInt;
37   class MEDCalculatorDBRangeSelection;
38   
39   class MEDCALCULATOR_EXPORT MEDCalculatorDBSliceField : public RefCountObject
40   {
41   public:
42     MEDCalculatorDBSliceField(int iter, int order);
43     MEDCalculatorDBSliceField(MEDCouplingFieldDouble *f);
44     std::size_t getHeapMemorySizeWithoutChildren() const;
45     std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
46     bool isFetched() const { return _field!=0; }
47     void getDtIt(int& it, int& order) const { it=_iteration;  order=_order; }
48     void setField(MEDCouplingFieldDouble *f) const;
49     void setName(const char *name);
50     void setDescription(const char *descr);
51     void write(const char *fName, const std::string& n, const std::string& d) const throw(INTERP_KERNEL::Exception);
52     const MEDCouplingMesh *getMesh(TypeOfField type, const std::string& fname, const std::string& mname, const std::string& fieldName) const;
53     MEDCouplingFieldDouble *getField(TypeOfField type, const std::string& fname, const std::string& mname, const std::string& fieldName) const;
54     MEDCouplingFieldDouble *getFieldWithoutQuestion(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const;
55     MEDCouplingFieldDouble *getFieldAttribute() const { return _field; }
56     MEDCouplingFieldDouble *buildCstFromThis(double val, int nbOfComp, const MEDCouplingFieldDouble *m) const;
57     //
58     void assign(const MEDCalculatorDBSliceField* other, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
59                 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC);
60     MEDCalculatorDBSliceField *add(const MEDCalculatorDBSliceField* other, const DataArrayIdType *cc, const DataArrayIdType *nc,
61                                 int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
62                                 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
63     MEDCalculatorDBSliceField *substract(const MEDCalculatorDBSliceField* other, const DataArrayIdType *cc, const DataArrayIdType *nc,
64                                       int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
65                                       int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
66     MEDCalculatorDBSliceField *multiply(const MEDCalculatorDBSliceField* other, const DataArrayIdType *cc, const DataArrayIdType *nc,
67                                      int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
68                                      int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
69     MEDCalculatorDBSliceField *divide(const MEDCalculatorDBSliceField* other, const DataArrayIdType *cc, const DataArrayIdType *nc,
70                                    int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
71                                    int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
72     MEDCalculatorDBSliceField *dot(const MEDCalculatorDBSliceField* other,
73                                 int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
74                                 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
75     MEDCalculatorDBSliceField *crossProduct(const MEDCalculatorDBSliceField* other,
76                                          int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
77                                          int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
78     MEDCalculatorDBSliceField *doublyContractedProduct(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
79     MEDCalculatorDBSliceField *determinant(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
80     MEDCalculatorDBSliceField *eigenValues(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
81     MEDCalculatorDBSliceField *eigenVectors(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
82     MEDCalculatorDBSliceField *inverse(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
83     MEDCalculatorDBSliceField *trace(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
84     MEDCalculatorDBSliceField *deviator(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
85     MEDCalculatorDBSliceField *magnitude(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
86     void applyFunc(const char *func, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC);
87     bool isEqual(const MEDCalculatorDBSliceField* other, const DataArrayIdType *cc, const DataArrayIdType *nc,
88                  int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
89                  int sizeCOther, const MEDCalculatorDBRangeSelection& otherC, double prec) const;
90   private:
91     ~MEDCalculatorDBSliceField();
92   private:
93     int _iteration;
94     int _order;
95     mutable MEDCouplingFieldDouble *_field;
96     MEDCouplingFieldDouble *_work;
97   };
98 }
99
100 #endif