1 // Copyright (C) 2007-2019 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, or (at your option) any later version.
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)
23 class MEDCouplingTimeDiscretization : public TimeLabel, public BigMemoryObject
26 static MEDCouplingTimeDiscretization *New(TypeOfTimeDiscretization type) throw(INTERP_KERNEL::Exception);
27 void setTimeUnit(const char *unit);
28 const char *getTimeUnit() const;
29 virtual void copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other) throw(INTERP_KERNEL::Exception);
30 virtual void copyTinyStringsFrom(const MEDCouplingTimeDiscretization& other) throw(INTERP_KERNEL::Exception);
31 virtual void checkConsistencyLight() const throw(INTERP_KERNEL::Exception);
32 virtual bool areCompatible(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
33 virtual bool areStrictlyCompatible(const MEDCouplingTimeDiscretization *other, std::string& reason) const throw(INTERP_KERNEL::Exception);
34 virtual bool areStrictlyCompatibleForMul(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
35 virtual bool areStrictlyCompatibleForDiv(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
36 virtual bool areCompatibleForMeld(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
37 virtual bool isEqualIfNotWhy(const MEDCouplingTimeDiscretization *other, double prec, std::string& reason) const throw(INTERP_KERNEL::Exception);
38 virtual bool isEqual(const MEDCouplingTimeDiscretization *other, double prec) const throw(INTERP_KERNEL::Exception);
39 virtual bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretization *other, double prec) const throw(INTERP_KERNEL::Exception);
40 virtual MEDCouplingTimeDiscretization *buildNewTimeReprFromThis(TypeOfTimeDiscretization type, bool deepCopy) const throw(INTERP_KERNEL::Exception);
41 virtual std::string getStringRepr() const throw(INTERP_KERNEL::Exception);
42 virtual TypeOfTimeDiscretization getEnum() const throw(INTERP_KERNEL::Exception);
43 virtual void synchronizeTimeWith(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
44 virtual MEDCouplingTimeDiscretization *aggregate(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
45 virtual MEDCouplingTimeDiscretization *aggregate(const std::vector<const MEDCouplingTimeDiscretization *>& other) const throw(INTERP_KERNEL::Exception);
46 virtual MEDCouplingTimeDiscretization *meld(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
47 virtual MEDCouplingTimeDiscretization *dot(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
48 virtual MEDCouplingTimeDiscretization *crossProduct(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
49 virtual MEDCouplingTimeDiscretization *max(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
50 virtual MEDCouplingTimeDiscretization *min(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
51 virtual MEDCouplingTimeDiscretization *add(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
52 virtual void addEqual(const MEDCouplingTimeDiscretization *other) throw(INTERP_KERNEL::Exception);
53 virtual MEDCouplingTimeDiscretization *substract(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
54 virtual void substractEqual(const MEDCouplingTimeDiscretization *other) throw(INTERP_KERNEL::Exception);
55 virtual MEDCouplingTimeDiscretization *multiply(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
56 virtual void multiplyEqual(const MEDCouplingTimeDiscretization *other) throw(INTERP_KERNEL::Exception);
57 virtual MEDCouplingTimeDiscretization *divide(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
58 virtual void divideEqual(const MEDCouplingTimeDiscretization *other) throw(INTERP_KERNEL::Exception);
59 virtual MEDCouplingTimeDiscretization *pow(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
60 virtual void powEqual(const MEDCouplingTimeDiscretization *other) throw(INTERP_KERNEL::Exception);
61 virtual MEDCouplingTimeDiscretization *performCopyOrIncrRef(bool deepCopy) const throw(INTERP_KERNEL::Exception);
62 void setTimeTolerance(double val);
63 double getTimeTolerance() const;
64 virtual void checkNoTimePresence() const throw(INTERP_KERNEL::Exception);
65 virtual void checkTimePresence(double time) const throw(INTERP_KERNEL::Exception);
66 virtual void setArray(DataArrayDouble *array, TimeLabel *owner) throw(INTERP_KERNEL::Exception);
67 virtual void setEndArray(DataArrayDouble *array, TimeLabel *owner) throw(INTERP_KERNEL::Exception);
68 virtual void setArrays(const std::vector<DataArrayDouble *>& arrays, TimeLabel *owner) throw(INTERP_KERNEL::Exception);
69 DataArrayDouble *getArray() throw(INTERP_KERNEL::Exception);
70 const DataArrayDouble *getArray() const throw(INTERP_KERNEL::Exception);
71 virtual const DataArrayDouble *getEndArray() const throw(INTERP_KERNEL::Exception);
72 virtual DataArrayDouble *getEndArray() throw(INTERP_KERNEL::Exception);
73 virtual std::vector< const DataArrayDouble *> getArraysForTime(double time) const throw(INTERP_KERNEL::Exception);
74 virtual void getValueForTime(double time, const std::vector<double>& vals, double *res) const throw(INTERP_KERNEL::Exception);
75 virtual void getArrays(std::vector<DataArrayDouble *>& arrays) const throw(INTERP_KERNEL::Exception);
76 virtual bool isBefore(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
77 virtual bool isStrictlyBefore(const MEDCouplingTimeDiscretization *other) const throw(INTERP_KERNEL::Exception);
78 double getTime(int& iteration, int& order) const throw(INTERP_KERNEL::Exception);
79 virtual double getStartTime(int& iteration, int& order) const throw(INTERP_KERNEL::Exception);
80 virtual double getEndTime(int& iteration, int& order) const throw(INTERP_KERNEL::Exception);
81 void setTime(double time, int iteration, int order) throw(INTERP_KERNEL::Exception);
82 void setIteration(int it) throw(INTERP_KERNEL::Exception);
83 void setOrder(int order) throw(INTERP_KERNEL::Exception);
84 void setTimeValue(double val) throw(INTERP_KERNEL::Exception);
85 virtual void setStartIteration(int it) throw(INTERP_KERNEL::Exception);
86 virtual void setEndIteration(int it) throw(INTERP_KERNEL::Exception);
87 virtual void setStartOrder(int order) throw(INTERP_KERNEL::Exception);
88 virtual void setEndOrder(int order) throw(INTERP_KERNEL::Exception);
89 virtual void setStartTimeValue(double time) throw(INTERP_KERNEL::Exception);
90 virtual void setEndTimeValue(double time) throw(INTERP_KERNEL::Exception);
91 virtual void setStartTime(double time, int iteration, int order) throw(INTERP_KERNEL::Exception);
92 virtual void setEndTime(double time, int iteration, int order) throw(INTERP_KERNEL::Exception);
93 virtual void getValueOnTime(int eltId, double time, double *value) const throw(INTERP_KERNEL::Exception);
94 virtual void getValueOnDiscTime(int eltId, int iteration, int order, double *value) const throw(INTERP_KERNEL::Exception);
96 virtual MEDCouplingTimeDiscretization *doublyContractedProduct() const throw(INTERP_KERNEL::Exception);
97 virtual MEDCouplingTimeDiscretization *determinant() const throw(INTERP_KERNEL::Exception);
98 virtual MEDCouplingTimeDiscretization *eigenValues() const throw(INTERP_KERNEL::Exception);
99 virtual MEDCouplingTimeDiscretization *eigenVectors() const throw(INTERP_KERNEL::Exception);
100 virtual MEDCouplingTimeDiscretization *inverse() const throw(INTERP_KERNEL::Exception);
101 virtual MEDCouplingTimeDiscretization *trace() const throw(INTERP_KERNEL::Exception);
102 virtual MEDCouplingTimeDiscretization *deviator() const throw(INTERP_KERNEL::Exception);
103 virtual MEDCouplingTimeDiscretization *magnitude() const throw(INTERP_KERNEL::Exception);
104 virtual MEDCouplingTimeDiscretization *negate() const throw(INTERP_KERNEL::Exception);
105 virtual MEDCouplingTimeDiscretization *maxPerTuple() const throw(INTERP_KERNEL::Exception);
106 virtual MEDCouplingTimeDiscretization *keepSelectedComponents(const std::vector<int>& compoIds) const throw(INTERP_KERNEL::Exception);
107 virtual void setSelectedComponents(const MEDCouplingTimeDiscretization *other, const std::vector<int>& compoIds) throw(INTERP_KERNEL::Exception);
108 virtual void changeNbOfComponents(int newNbOfComp, double dftValue) throw(INTERP_KERNEL::Exception);
109 virtual void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception);
110 virtual void setUniformValue(int nbOfTuple, int nbOfCompo, double value) throw(INTERP_KERNEL::Exception);
111 virtual void setOrCreateUniformValueOnAllComponents(int nbOfTuple, double value) throw(INTERP_KERNEL::Exception);
112 virtual void applyLin(double a, double b, int compoId) throw(INTERP_KERNEL::Exception);
113 virtual void applyFunc(int nbOfComp, FunctionToEvaluate func) throw(INTERP_KERNEL::Exception);
114 virtual void applyFunc(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
115 virtual void applyFuncCompo(int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
116 virtual void applyFuncNamedCompo(int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
117 virtual void applyFunc(const char *func) throw(INTERP_KERNEL::Exception);
118 virtual void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception);
119 virtual void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception);
120 virtual void fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, FunctionToEvaluate func) throw(INTERP_KERNEL::Exception);
121 virtual void fillFromAnalytic(const DataArrayDouble *loc, int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
122 virtual void fillFromAnalyticCompo(const DataArrayDouble *loc, int nbOfComp, const char *func) throw(INTERP_KERNEL::Exception);
123 virtual void fillFromAnalyticNamedCompo(const DataArrayDouble *loc, int nbOfComp, const std::vector<std::string>& varsOrder, const char *func) throw(INTERP_KERNEL::Exception);
125 virtual ~MEDCouplingTimeDiscretization();
128 class MEDCouplingNoTimeLabel : public MEDCouplingTimeDiscretization
131 MEDCouplingNoTimeLabel();
132 MEDCouplingNoTimeLabel(const MEDCouplingTimeDiscretization& other, bool deepCopy);
134 static const TypeOfTimeDiscretization DISCRETIZATION=NO_TIME;
135 static const char REPR[];
138 class MEDCouplingWithTimeStep : public MEDCouplingTimeDiscretization
141 MEDCouplingWithTimeStep();
143 static const TypeOfTimeDiscretization DISCRETIZATION=ONE_TIME;
144 static const char REPR[];
147 class MEDCouplingConstOnTimeInterval : public MEDCouplingTimeDiscretization
150 MEDCouplingConstOnTimeInterval();
151 MEDCouplingConstOnTimeInterval(const MEDCouplingConstOnTimeInterval& other, bool deepCopy);
153 static const TypeOfTimeDiscretization DISCRETIZATION=CONST_ON_TIME_INTERVAL;
154 static const char REPR[];
157 class MEDCouplingTwoTimeSteps : public MEDCouplingTimeDiscretization
161 class MEDCouplingLinearTime : public MEDCouplingTwoTimeSteps
164 MEDCouplingLinearTime();
166 static const TypeOfTimeDiscretization DISCRETIZATION=LINEAR_TIME;
167 static const char REPR[];