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