return ret;
}
+MEDCouplingFieldDouble *MEDCouplingFieldDouble::negate() const throw(INTERP_KERNEL::Exception)
+{
+ if(!((const MEDCouplingFieldDiscretization *)_type))
+ throw INTERP_KERNEL::Exception("No spatial discretization underlying this field to perform negate !");
+ MEDCouplingTimeDiscretization *td=_time_discr->negate();
+ td->copyTinyAttrFrom(*_time_discr);
+ MEDCouplingFieldDouble *ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
+ ret->setMesh(getMesh());
+ return ret;
+}
+
MEDCouplingFieldDouble *MEDCouplingFieldDouble::AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception)
{
if(!f1)
MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return MaxFields(this,&other); }
static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return MinFields(this,&other); }
+ MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *operator+(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return AddFields(this,&other); }
const MEDCouplingFieldDouble &operator+=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception);
static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
return ret;
}
+MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::negate() const throw(INTERP_KERNEL::Exception)
+{
+ std::vector<DataArrayDouble *> arrays;
+ getArrays(arrays);
+ std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > arrays2(arrays.size());
+ for(int j=0;j<(int)arrays.size();j++)
+ {
+ if(arrays[j])
+ arrays2[j]=arrays[j]->negate();
+ else
+ arrays2[j]=0;
+ }
+ std::vector<DataArrayDouble *> arrays3(arrays.size());
+ for(int j=0;j<(int)arrays.size();j++)
+ arrays3[j]=arrays2[j];
+ MEDCouplingTimeDiscretization *ret=MEDCouplingTimeDiscretization::New(getEnum());
+ ret->setTimeUnit(getTimeUnit());
+ ret->setArrays(arrays3,0);
+ return ret;
+}
+
MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::maxPerTuple() const throw(INTERP_KERNEL::Exception)
{
std::vector<DataArrayDouble *> arrays;
virtual MEDCouplingTimeDiscretization *trace() const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingTimeDiscretization *deviator() const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingTimeDiscretization *magnitude() const throw(INTERP_KERNEL::Exception);
+ virtual MEDCouplingTimeDiscretization *negate() const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingTimeDiscretization *maxPerTuple() const throw(INTERP_KERNEL::Exception);
virtual MEDCouplingTimeDiscretization *keepSelectedComponents(const std::vector<int>& compoIds) const throw(INTERP_KERNEL::Exception);
virtual void setSelectedComponents(const MEDCouplingTimeDiscretization *other, const std::vector<int>& compoIds) throw(INTERP_KERNEL::Exception);
%newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields;
%newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields;
%newobject ParaMEDMEM::MEDCouplingFieldDouble::min;
+%newobject ParaMEDMEM::MEDCouplingFieldDouble::negate;
%newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange;
%newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart;
%newobject ParaMEDMEM::MEDCouplingFieldDouble::__getitem__;
+%newobject ParaMEDMEM::MEDCouplingFieldDouble::__neg__;
%newobject ParaMEDMEM::MEDCouplingFieldDouble::__add__;
%newobject ParaMEDMEM::MEDCouplingFieldDouble::__sub__;
%newobject ParaMEDMEM::MEDCouplingFieldDouble::__mul__;
static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldDouble *negate() const throw(INTERP_KERNEL::Exception);
%extend {
MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
{
}
}
+ MEDCouplingFieldDouble *__neg__() const throw(INTERP_KERNEL::Exception)
+ {
+ return self->negate();
+ }
+
PyObject *___iadd___(PyObject *trueSelf, const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception)
{
*self+=other;