Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __MEDCALCULATORDBFIELD_HXX__
00021 #define __MEDCALCULATORDBFIELD_HXX__
00022
00023 #include "MEDCalculatorDBSliceField.hxx"
00024 #include "MEDCalculatorDBRangeSelection.hxx"
00025
00026 #include "MEDCouplingRefCountObject.hxx"
00027 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
00028
00029 #include "InterpKernelException.hxx"
00030
00031 #include <string>
00032 #include <vector>
00033
00034 namespace ParaMEDMEM
00035 {
00036 class MEDCalculatorBrowserField;
00037 class MEDCalculatorDBFieldReal;
00038 class MEDCalculatorDBFieldCst;
00039
00040
00041 class MEDCalculatorDBField : public RefCountObject
00042 {
00043 public:
00044 static MEDCalculatorDBFieldReal *New(const MEDCalculatorBrowserField& ls);
00045 static MEDCalculatorDBFieldCst *New(double val);
00046 virtual MEDCalculatorDBField *operator+(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception) = 0;
00047 MEDCalculatorDBField *operator+(double val) const throw(INTERP_KERNEL::Exception);
00048 virtual MEDCalculatorDBField *operator-(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception) = 0;
00049 MEDCalculatorDBField *operator-(double val) const throw(INTERP_KERNEL::Exception);
00050 virtual MEDCalculatorDBField *operator*(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception) = 0;
00051 MEDCalculatorDBField *operator*(double val) const throw(INTERP_KERNEL::Exception);
00052 virtual MEDCalculatorDBField *operator/(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception) = 0;
00053 MEDCalculatorDBField *operator/(double val) const throw(INTERP_KERNEL::Exception);
00054 virtual bool isEqual(const MEDCalculatorDBField& other, double precM, double precF) const = 0;
00055 };
00056
00057 class MEDCalculatorDBFieldReal : public MEDCalculatorDBField
00058 {
00059 public:
00060 MEDCalculatorDBFieldReal(const MEDCalculatorBrowserField& ls);
00061 ~MEDCalculatorDBFieldReal();
00062 void setName(const char *name);
00063 void setDescription(const char *descr);
00064 void write(const char *fName, bool writeFromScratch) const throw(INTERP_KERNEL::Exception);
00065 void display() const throw(INTERP_KERNEL::Exception);
00066 std::string simpleRepr() const;
00067 MEDCalculatorDBFieldReal *operator()(const MEDCalculatorDBRangeSelection& t, const MEDCalculatorDBRangeSelection& p, const MEDCalculatorDBRangeSelection& c) throw(INTERP_KERNEL::Exception);
00068 const MEDCalculatorDBFieldReal& operator=(const MEDCalculatorDBFieldReal& other) throw(INTERP_KERNEL::Exception);
00069 const MEDCalculatorDBFieldReal& operator=(double val) throw(INTERP_KERNEL::Exception);
00070 MEDCalculatorDBField *operator+(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception);
00071 MEDCalculatorDBField *add(const MEDCalculatorDBFieldReal& other) const throw(INTERP_KERNEL::Exception);
00072 MEDCalculatorDBField *operator-(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception);
00073 MEDCalculatorDBField *substract(const MEDCalculatorDBFieldReal& other) const throw(INTERP_KERNEL::Exception);
00074 MEDCalculatorDBField *operator*(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception);
00075 MEDCalculatorDBField *multiply(const MEDCalculatorDBFieldReal& other) const throw(INTERP_KERNEL::Exception);
00076 MEDCalculatorDBField *operator/(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception);
00077 MEDCalculatorDBField *divide(const MEDCalculatorDBFieldReal& other) const throw(INTERP_KERNEL::Exception);
00078 MEDCalculatorDBField *operator^(const MEDCalculatorDBFieldReal& other) const throw(INTERP_KERNEL::Exception);
00079 MEDCalculatorDBField *dot(const MEDCalculatorDBFieldReal& other) const throw(INTERP_KERNEL::Exception);
00080 MEDCalculatorDBField *crossProduct(const MEDCalculatorDBFieldReal& other) const throw(INTERP_KERNEL::Exception);
00081 MEDCalculatorDBField *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
00082 MEDCalculatorDBField *determinant() const throw(INTERP_KERNEL::Exception);
00083 MEDCalculatorDBField *eigenValues() const throw(INTERP_KERNEL::Exception);
00084 MEDCalculatorDBField *eigenVectors() const throw(INTERP_KERNEL::Exception);
00085 MEDCalculatorDBField *inverse() const throw(INTERP_KERNEL::Exception);
00086 MEDCalculatorDBField *trace() const throw(INTERP_KERNEL::Exception);
00087 MEDCalculatorDBField *deviator() const throw(INTERP_KERNEL::Exception);
00088 MEDCalculatorDBField *magnitude() const throw(INTERP_KERNEL::Exception);
00089 void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
00090 bool isEqual(const MEDCalculatorDBField& other, double precM, double precF) const;
00091 bool isEqualSameType(const MEDCalculatorDBFieldReal& other, double precM, double precF) const;
00092 MEDCalculatorDBFieldReal *buildCstFieldFromThis(double val) const;
00093 void checkCoherency(const MEDCalculatorDBFieldReal& other) const throw(INTERP_KERNEL::Exception);
00094 void fetchData() const throw(INTERP_KERNEL::Exception);
00095 TypeOfField getType() const { return _type; }
00096 int getNumberOfSteps() const;
00097 int getNumberOfFetchedSteps() const;
00098 int getNumberOfComponents() const;
00099 std::vector<MEDCouplingFieldDouble *> getFields() const throw(INTERP_KERNEL::Exception);
00100 std::string getInfoOnComponent(int i) const throw(INTERP_KERNEL::Exception);
00101 void setInfoOnComponent(int i, const char *info) throw(INTERP_KERNEL::Exception);
00102 private:
00103 MEDCalculatorDBFieldReal(TypeOfField type);
00104 private:
00105 std::string _name;
00106 std::string _description;
00107
00108 std::string _file_name;
00109 std::string _mesh_name;
00110 std::string _field_name;
00111 TypeOfField _type;
00112 MEDCalculatorDBRangeSelection _t;
00113 MEDCalculatorDBRangeSelection _p;
00114 std::vector<std::string> _c_labels;
00115 MEDCalculatorDBRangeSelection _c;
00116 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCalculatorDBSliceField> > _time_steps;
00117 };
00118
00119 class MEDCalculatorDBFieldCst : public MEDCalculatorDBField
00120 {
00121 public:
00122 MEDCalculatorDBFieldCst(double val);
00123 MEDCalculatorDBField *operator+(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception);
00124 MEDCalculatorDBField *operator-(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception);
00125 MEDCalculatorDBField *operator*(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception);
00126 MEDCalculatorDBField *operator/(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception);
00127 bool isEqual(const MEDCalculatorDBField& other, double precM, double precF) const;
00128 MEDCalculatorDBFieldReal *convertIntoReal(const MEDCalculatorDBFieldReal& ref) const;
00129 double getValue() const { return _val; }
00130 private:
00131 double _val;
00132 };
00133 }
00134
00135 #endif