#include "MEDLoader.hxx"
#include "MEDCouplingFieldDouble.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
MEDCalculatorDBSliceField::MEDCalculatorDBSliceField(int iter, int order):_iteration(iter),_order(order),_field(0),_work(0)
{
MEDCouplingFieldDouble *myF=const_cast<MEDCouplingFieldDouble *>(_field);
myF->setName(n.c_str());
myF->setDescription(d.c_str());
- MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fName,_field);
+ WriteFieldUsingAlreadyWrittenMesh(fName,_field);
myF->setName(kn.c_str());
myF->setDescription(kd.c_str());
}
MEDCouplingFieldDouble *MEDCalculatorDBSliceField::getField(TypeOfField type, const std::string& fname, const std::string& mname, const std::string& fieldName) const
{
if(!_field)
- _field=MEDLoader::ReadField(type,fname.c_str(),mname.c_str(),0,fieldName.c_str(),_iteration,_order);
+ _field=ReadField(type,fname.c_str(),mname.c_str(),0,fieldName.c_str(),_iteration,_order);
return _field;
}
{
std::vector<int> tIds=thisC.getIds(sizeCThis);
std::vector<int> oIds=otherC.getIds(sizeCOther);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=other->_field->keepSelectedComponents(oIds);
+ MCAuto<MEDCouplingFieldDouble> f1=other->_field->keepSelectedComponents(oIds);
_field->setSelectedComponents(f1,tIds);
}
throw INTERP_KERNEL::Exception("Slice::add : not implemented yet node/cell permutation !");
std::vector<int> tIds=thisC.getIds(sizeCThis);
std::vector<int> oIds=otherC.getIds(sizeCOther);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
f2->setMesh(f1->getMesh());
MEDCouplingFieldDouble *f3=(*f1)+(*f2);
return new MEDCalculatorDBSliceField(f3);
throw INTERP_KERNEL::Exception("Slice::substract : not implemented yet node/cell permutation !");
std::vector<int> tIds=thisC.getIds(sizeCThis);
std::vector<int> oIds=otherC.getIds(sizeCOther);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
f2->setMesh(f1->getMesh());
MEDCouplingFieldDouble *f3=(*f1)-(*f2);
return new MEDCalculatorDBSliceField(f3);
throw INTERP_KERNEL::Exception("Slice::multiply : not implemented yet node/cell permutation !");
std::vector<int> tIds=thisC.getIds(sizeCThis);
std::vector<int> oIds=otherC.getIds(sizeCOther);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
f2->setMesh(f1->getMesh());
MEDCouplingFieldDouble *f3=(*f1)*(*f2);
return new MEDCalculatorDBSliceField(f3);
throw INTERP_KERNEL::Exception("Slice::divide : not implemented yet node/cell permutation !");
std::vector<int> tIds=thisC.getIds(sizeCThis);
std::vector<int> oIds=otherC.getIds(sizeCOther);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
f2->setMesh(f1->getMesh());
MEDCouplingFieldDouble *f3=(*f1)/(*f2);
return new MEDCalculatorDBSliceField(f3);
{
std::vector<int> tIds=thisC.getIds(sizeCThis);
std::vector<int> oIds=otherC.getIds(sizeCOther);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
f2->setMesh(f1->getMesh());
MEDCouplingFieldDouble *f3=f1->dot(*f2);
return new MEDCalculatorDBSliceField(f3);
{
std::vector<int> tIds=thisC.getIds(sizeCThis);
std::vector<int> oIds=otherC.getIds(sizeCOther);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
f2->setMesh(f1->getMesh());
MEDCouplingFieldDouble *f3=f1->crossProduct(*f2);
return new MEDCalculatorDBSliceField(f3);
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::doublyContractedProduct(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
std::vector<int> tIds=thisC.getIds(sizeCThis);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->doublyContractedProduct();
return new MEDCalculatorDBSliceField(f2);
}
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::determinant(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
std::vector<int> tIds=thisC.getIds(sizeCThis);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->determinant();
return new MEDCalculatorDBSliceField(f2);
}
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::eigenValues(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
std::vector<int> tIds=thisC.getIds(sizeCThis);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->eigenValues();
return new MEDCalculatorDBSliceField(f2);
}
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::eigenVectors(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
std::vector<int> tIds=thisC.getIds(sizeCThis);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->eigenVectors();
return new MEDCalculatorDBSliceField(f2);
}
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::inverse(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
std::vector<int> tIds=thisC.getIds(sizeCThis);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->inverse();
return new MEDCalculatorDBSliceField(f2);
}
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::trace(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
std::vector<int> tIds=thisC.getIds(sizeCThis);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->trace();
return new MEDCalculatorDBSliceField(f2);
}
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::deviator(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
std::vector<int> tIds=thisC.getIds(sizeCThis);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->deviator();
return new MEDCalculatorDBSliceField(f2);
}
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::magnitude(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
std::vector<int> tIds=thisC.getIds(sizeCThis);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->magnitude();
return new MEDCalculatorDBSliceField(f2);
}
void MEDCalculatorDBSliceField::applyFunc(const char *func, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC)
{
std::vector<int> tIds=thisC.getIds(sizeCThis);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
f1->applyFunc(func);
_field->setSelectedComponents(f1,tIds);
}
throw INTERP_KERNEL::Exception("Slice::isEqual : not implemented yet node/cell permutation !");
std::vector<int> tIds=thisC.getIds(sizeCThis);
std::vector<int> oIds=otherC.getIds(sizeCOther);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
+ MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
+ MCAuto<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
f2->setMesh(f1->getMesh());
return f1->isEqualWithoutConsideringStr(f2,0,prec);
}