1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
21 #ifndef __MEDCALCULATORDBSLICEFIELD_HXX__
22 #define __MEDCALCULATORDBSLICEFIELD_HXX__
24 #include "MedCalculatorDefines.hxx"
25 #include "MEDCouplingRefCountObject.hxx"
27 #include "InterpKernelException.hxx"
33 class MEDCouplingFieldDouble;
34 class MEDCouplingMesh;
36 class MEDCalculatorDBRangeSelection;
38 class MEDCALCULATOR_EXPORT MEDCalculatorDBSliceField : public RefCountObject
41 MEDCalculatorDBSliceField(int iter, int order);
42 MEDCalculatorDBSliceField(MEDCouplingFieldDouble *f);
43 bool isFetched() const { return _field!=0; }
44 void getDtIt(int& it, int& order) const { it=_iteration; order=_order; }
45 void setField(MEDCouplingFieldDouble *f) const;
46 void setName(const char *name);
47 void setDescription(const char *descr);
48 void write(const char *fName, const std::string& n, const std::string& d) const throw(INTERP_KERNEL::Exception);
49 const MEDCouplingMesh *getMesh(TypeOfField type, const std::string& fname, const std::string& mname, const std::string& fieldName) const;
50 MEDCouplingFieldDouble *getField(TypeOfField type, const std::string& fname, const std::string& mname, const std::string& fieldName) const;
51 MEDCouplingFieldDouble *getFieldWithoutQuestion(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const;
52 MEDCouplingFieldDouble *getFieldAttribute() const { return _field; }
53 MEDCouplingFieldDouble *buildCstFromThis(double val, int nbOfComp, const MEDCouplingFieldDouble *m) const;
55 void assign(const MEDCalculatorDBSliceField* other, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
56 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC);
57 MEDCalculatorDBSliceField *add(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc,
58 int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
59 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
60 MEDCalculatorDBSliceField *substract(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc,
61 int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
62 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
63 MEDCalculatorDBSliceField *multiply(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc,
64 int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
65 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
66 MEDCalculatorDBSliceField *divide(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc,
67 int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
68 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
69 MEDCalculatorDBSliceField *dot(const MEDCalculatorDBSliceField* other,
70 int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
71 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
72 MEDCalculatorDBSliceField *crossProduct(const MEDCalculatorDBSliceField* other,
73 int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
74 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const;
75 MEDCalculatorDBSliceField *doublyContractedProduct(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
76 MEDCalculatorDBSliceField *determinant(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
77 MEDCalculatorDBSliceField *eigenValues(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
78 MEDCalculatorDBSliceField *eigenVectors(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
79 MEDCalculatorDBSliceField *inverse(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
80 MEDCalculatorDBSliceField *trace(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
81 MEDCalculatorDBSliceField *deviator(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
82 MEDCalculatorDBSliceField *magnitude(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception);
83 void applyFunc(const char *func, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC);
84 bool isEqual(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc,
85 int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
86 int sizeCOther, const MEDCalculatorDBRangeSelection& otherC, double prec) const;
88 ~MEDCalculatorDBSliceField();
92 mutable MEDCouplingFieldDouble *_field;
93 MEDCouplingFieldDouble *_work;