return *this;
}
+/*!
+ * Directly called by MEDCouplingFieldDouble::operator^.
+ *
+ * \sa MEDCouplingFieldDouble::operator^
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::PowFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception)
+{
+ if(!f1)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::PowFields : input field is NULL !");
+ if(!f1->areCompatibleForMul(f2))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply PowFields on them !");
+ MEDCouplingTimeDiscretization *td=f1->_time_discr->pow(f2->_time_discr);
+ td->copyTinyAttrFrom(*f1->_time_discr);
+ MEDCouplingFieldDouble *ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone());
+ ret->setMesh(f1->getMesh());
+ return ret;
+}
+
+/*!
+ * Directly call MEDCouplingFieldDouble::PowFields static method.
+ *
+ * \sa MEDCouplingFieldDouble::PowFields
+ */
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::operator^(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception)
+{
+ return PowFields(this,&other);
+}
+
+const MEDCouplingFieldDouble &MEDCouplingFieldDouble::operator^=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
+{
+ if(!areCompatibleForDiv(&other))
+ throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply /= on them !");
+ _time_discr->powEqual(other._time_discr);
+ return *this;
+}
+
/*!
* This method writes the field series 'fs' in the VTK file 'fileName'.
* If 'fs' is empty no file is written. If fields lies on more than one mesh an exception will be thrown and no file will be written too.
MEDCouplingFieldDouble *operator/(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return DivideFields(this,&other); }
const MEDCouplingFieldDouble &operator/=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception);
static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldDouble *operator^(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
+ const MEDCouplingFieldDouble &operator^=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception);
+ static MEDCouplingFieldDouble *PowFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
static void WriteVTK(const char *fileName, const std::vector<const MEDCouplingFieldDouble *>& fs) throw(INTERP_KERNEL::Exception);
public:
const MEDCouplingTimeDiscretization *getTimeDiscretizationUnderGround() const { return _time_discr; }
getArray()->divideEqual(other->getArray());
}
+MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::pow(const MEDCouplingTimeDiscretization *other) const
+{
+ const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
+ if(!otherC)
+ throw INTERP_KERNEL::Exception("pow on mismatched time discretization !");
+ MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Pow(getArray(),other->getArray());
+ MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel;
+ ret->setArray(arr,0);
+ return ret;
+}
+
+void MEDCouplingNoTimeLabel::powEqual(const MEDCouplingTimeDiscretization *other)
+{
+ const MEDCouplingNoTimeLabel *otherC=dynamic_cast<const MEDCouplingNoTimeLabel *>(other);
+ if(!otherC)
+ throw INTERP_KERNEL::Exception("NoTimeLabel::powEqual on mismatched time discretization !");
+ if(!getArray())
+ throw INTERP_KERNEL::Exception("MEDCouplingNoTimeLabel::powEqual : Data Array is NULL !");
+ getArray()->powEqual(other->getArray());
+}
+
MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::performCpy(bool deepCpy) const
{
return new MEDCouplingNoTimeLabel(*this,deepCpy);
getArray()->divideEqual(other->getArray());
}
+MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::pow(const MEDCouplingTimeDiscretization *other) const
+{
+ const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
+ if(!otherC)
+ throw INTERP_KERNEL::Exception("WithTimeStep::pow on mismatched time discretization !");
+ MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Pow(getArray(),other->getArray());
+ MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep;
+ ret->setArray(arr,0);
+ int tmp1,tmp2;
+ double tmp3=getStartTime(tmp1,tmp2);
+ ret->setStartTime(tmp3,tmp1,tmp2);
+ return ret;
+}
+
+void MEDCouplingWithTimeStep::powEqual(const MEDCouplingTimeDiscretization *other)
+{
+ const MEDCouplingWithTimeStep *otherC=dynamic_cast<const MEDCouplingWithTimeStep *>(other);
+ if(!otherC)
+ throw INTERP_KERNEL::Exception("WithTimeStep::powEqual on mismatched time discretization !");
+ if(!getArray())
+ throw INTERP_KERNEL::Exception("MEDCouplingWithTimeLabel::powEqual : Data Array is NULL !");
+ getArray()->powEqual(other->getArray());
+}
+
MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::performCpy(bool deepCpy) const
{
return new MEDCouplingWithTimeStep(*this,deepCpy);
getArray()->divideEqual(other->getArray());
}
+MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::pow(const MEDCouplingTimeDiscretization *other) const
+{
+ const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
+ if(!otherC)
+ throw INTERP_KERNEL::Exception("pow on mismatched time discretization !");
+ MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr=DataArrayDouble::Pow(getArray(),other->getArray());
+ MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval;
+ ret->setArray(arr,0);
+ int tmp1,tmp2;
+ double tmp3=getStartTime(tmp1,tmp2);
+ ret->setStartTime(tmp3,tmp1,tmp2);
+ tmp3=getEndTime(tmp1,tmp2);
+ ret->setEndTime(tmp3,tmp1,tmp2);
+ return ret;
+}
+
+void MEDCouplingConstOnTimeInterval::powEqual(const MEDCouplingTimeDiscretization *other)
+{
+ const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast<const MEDCouplingConstOnTimeInterval *>(other);
+ if(!otherC)
+ throw INTERP_KERNEL::Exception("ConstOnTimeInterval::powEqual on mismatched time discretization !");
+ if(!getArray())
+ throw INTERP_KERNEL::Exception("MEDCouplingConstOnTimeInterval::powEqual : Data Array is NULL !");
+ getArray()->powEqual(other->getArray());
+}
+
MEDCouplingTwoTimeSteps::MEDCouplingTwoTimeSteps(const MEDCouplingTwoTimeSteps& other, bool deepCpy):MEDCouplingTimeDiscretization(other,deepCpy),
_start_time(other._start_time),_end_time(other._end_time),
_start_iteration(other._start_iteration),_end_iteration(other._end_iteration),
getArray()->divideEqual(other->getArray());
getEndArray()->divideEqual(other->getEndArray());
}
+
+MEDCouplingTimeDiscretization *MEDCouplingLinearTime::pow(const MEDCouplingTimeDiscretization *other) const
+{
+ const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
+ if(!otherC)
+ throw INTERP_KERNEL::Exception("LinearTime::pow on mismatched time discretization !");
+ MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr1=DataArrayDouble::Pow(getArray(),other->getArray());
+ MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> arr2=DataArrayDouble::Pow(getEndArray(),other->getEndArray());
+ MEDCouplingLinearTime *ret=new MEDCouplingLinearTime;
+ ret->setArray(arr1,0);
+ ret->setEndArray(arr2,0);
+ return ret;
+}
+
+void MEDCouplingLinearTime::powEqual(const MEDCouplingTimeDiscretization *other)
+{
+ const MEDCouplingLinearTime *otherC=dynamic_cast<const MEDCouplingLinearTime *>(other);
+ if(!otherC)
+ throw INTERP_KERNEL::Exception("LinearTime::addEqual on mismatched time discretization !");
+ if(!getArray())
+ throw INTERP_KERNEL::Exception("MEDCouplingLinearTime::powEqual : Data Array is NULL !");
+ if(!getEndArray())
+ throw INTERP_KERNEL::Exception("MEDCouplingLinearTime::powEqual : Data Array (end) is NULL !");
+ getArray()->powEqual(other->getArray());
+ getEndArray()->powEqual(other->getEndArray());
+}
virtual void multiplyEqual(const MEDCouplingTimeDiscretization *other) = 0;
virtual MEDCouplingTimeDiscretization *divide(const MEDCouplingTimeDiscretization *other) const = 0;
virtual void divideEqual(const MEDCouplingTimeDiscretization *other) = 0;
+ virtual MEDCouplingTimeDiscretization *pow(const MEDCouplingTimeDiscretization *other) const = 0;
+ virtual void powEqual(const MEDCouplingTimeDiscretization *other) = 0;
virtual void getTinySerializationIntInformation(std::vector<int>& tinyInfo) const;
virtual void getTinySerializationDbleInformation(std::vector<double>& tinyInfo) const;
virtual void getTinySerializationStrInformation(std::vector<std::string>& tinyInfo) const;
void multiplyEqual(const MEDCouplingTimeDiscretization *other);
MEDCouplingTimeDiscretization *divide(const MEDCouplingTimeDiscretization *other) const;
void divideEqual(const MEDCouplingTimeDiscretization *other);
+ MEDCouplingTimeDiscretization *pow(const MEDCouplingTimeDiscretization *other) const;
+ void powEqual(const MEDCouplingTimeDiscretization *other);
bool isEqualIfNotWhy(const MEDCouplingTimeDiscretization *other, double prec, std::string& reason) const;
bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretization *other, double prec) const;
bool areCompatible(const MEDCouplingTimeDiscretization *other) const;
void multiplyEqual(const MEDCouplingTimeDiscretization *other);
MEDCouplingTimeDiscretization *divide(const MEDCouplingTimeDiscretization *other) const;
void divideEqual(const MEDCouplingTimeDiscretization *other);
+ MEDCouplingTimeDiscretization *pow(const MEDCouplingTimeDiscretization *other) const;
+ void powEqual(const MEDCouplingTimeDiscretization *other);
bool isEqualIfNotWhy(const MEDCouplingTimeDiscretization *other, double prec, std::string& reason) const;
bool isEqualWithoutConsideringStr(const MEDCouplingTimeDiscretization *other, double prec) const;
bool areCompatible(const MEDCouplingTimeDiscretization *other) const;
void multiplyEqual(const MEDCouplingTimeDiscretization *other);
MEDCouplingTimeDiscretization *divide(const MEDCouplingTimeDiscretization *other) const;
void divideEqual(const MEDCouplingTimeDiscretization *other);
+ MEDCouplingTimeDiscretization *pow(const MEDCouplingTimeDiscretization *other) const;
+ void powEqual(const MEDCouplingTimeDiscretization *other);
void setStartTime(double time, int iteration, int order) throw(INTERP_KERNEL::Exception) { _start_time=time; _start_iteration=iteration; _start_order=order; }
void setEndTime(double time, int iteration, int order) throw(INTERP_KERNEL::Exception) { _end_time=time; _end_iteration=iteration; _end_order=order; }
double getStartTime(int& iteration, int& order) const throw(INTERP_KERNEL::Exception) { iteration=_start_iteration; order=_start_order; return _start_time; }
void multiplyEqual(const MEDCouplingTimeDiscretization *other);
MEDCouplingTimeDiscretization *divide(const MEDCouplingTimeDiscretization *other) const;
void divideEqual(const MEDCouplingTimeDiscretization *other);
+ MEDCouplingTimeDiscretization *pow(const MEDCouplingTimeDiscretization *other) const;
+ void powEqual(const MEDCouplingTimeDiscretization *other);
public:
static const TypeOfTimeDiscretization DISCRETIZATION=LINEAR_TIME;
static const char REPR[];