{
}
+std::size_t MEDCouplingFieldDiscretization::getHeapMemorySize() const
+{
+ return 0;
+}
+
/*!
* Computes normL1 of DataArrayDouble instance arr.
* @param res output parameter expected to be of size arr->getNumberOfComponents();
MEDCouplingFieldDouble *MEDCouplingFieldDiscretizationP0::getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const
{
+ if(!mesh)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationP0::getMeasureField : mesh instance specified is NULL !");
return mesh->getMeasureField(isAbs);
}
oss << ") detected outside mesh : unable to apply P0::getValueOnMulti ! ";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- ret->incrRef();
- return ret;
+ return ret.retn();
}
/*!
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret=DataArrayInt::New();
ret->alloc((int)std::distance(startCellIds,endCellIds),1);
std::copy(startCellIds,endCellIds,ret->getPointer());
- ret->incrRef(); return ret;
+ return ret.retn();
}
/*!
MEDCouplingFieldDouble *MEDCouplingFieldDiscretizationP1::getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const
{
+ if(!mesh)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationP1::getMeasureField : mesh instance specified is NULL !");
return mesh->getMeasureFieldOnNode(isAbs);
}
oss << ") detected outside mesh : unable to apply P1::getValueOnMulti ! ";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- ret->incrRef();
- return ret;
+ return ret.retn();
}
MEDCouplingFieldDiscretizationPerCell::MEDCouplingFieldDiscretizationPerCell():_discr_per_cell(0)
updateTimeWith(*_discr_per_cell);
}
+std::size_t MEDCouplingFieldDiscretizationPerCell::getHeapMemorySize() const
+{
+ std::size_t ret=0;
+ if(_discr_per_cell)
+ ret+=_discr_per_cell->getHeapMemorySize();
+ return ret;
+}
+
void MEDCouplingFieldDiscretizationPerCell::checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArrayDouble *da) const throw(INTERP_KERNEL::Exception)
{
if(!_discr_per_cell)
return oss.str();
}
+std::size_t MEDCouplingFieldDiscretizationGauss::getHeapMemorySize() const
+{
+ std::size_t ret=_loc.capacity()*sizeof(MEDCouplingGaussLocalization);
+ for(std::vector<MEDCouplingGaussLocalization>::const_iterator it=_loc.begin();it!=_loc.end();it++)
+ ret+=(*it).getHeapMemorySize();
+ return MEDCouplingFieldDiscretizationPerCell::getHeapMemorySize()+ret;
+}
+
const char *MEDCouplingFieldDiscretizationGauss::getRepr() const
{
return REPR;
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
- ret->incrRef();
- return ret;
+ return ret.retn();
}
void MEDCouplingFieldDiscretizationGauss::renumberArraysForCell(const MEDCouplingMesh *mesh, const std::vector<DataArrayDouble *>& arrays,
MEDCouplingFieldDouble *MEDCouplingFieldDiscretizationGauss::getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const
{
+ if(!mesh)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getMeasureField : mesh instance specified is NULL !");
throw INTERP_KERNEL::Exception("Not implemented yet !");
}
valsToFill[i]=_loc[*w].getNumberOfGaussPt();
else
throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::buildNbOfGaussPointPerCellField : orphan cell detected !");
- ret->incrRef();
- return ret;
+ return ret.retn();
}
/*!
MEDCouplingFieldDouble *MEDCouplingFieldDiscretizationGaussNE::getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const
{
+ if(!mesh)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGaussNE::getMeasureField : mesh instance specified is NULL !");
throw INTERP_KERNEL::Exception("Not implemented yet !");
}
MEDCouplingFieldDouble *MEDCouplingFieldDiscretizationKriging::getMeasureField(const MEDCouplingMesh *mesh, bool isAbs) const
{
+ if(!mesh)
+ throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationKriging::getMeasureField : mesh instance specified is NULL !");
throw INTERP_KERNEL::Exception("getMeasureField on FieldDiscretizationKriging : not implemented yet !");
}
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret=DataArrayDouble::New();
ret->alloc(nbOfTargetPoints,nbOfCompo);
INTERP_KERNEL::matrixProduct(KnewiK->getConstPointer(),1,nbOfPts+delta,matrix3->getConstPointer(),nbOfPts+delta,nbOfTargetPoints*nbOfCompo,ret->getPointer());
- ret->incrRef();
- return ret;
+ return ret.retn();
}
/*!
double *work=std::copy(arr->begin(),arr->end(),arr2->getPointer());
std::fill(work,work+isDrift,0.);
INTERP_KERNEL::matrixProduct(matrixInv->getConstPointer(),nbOfPts+isDrift,nbOfPts+isDrift,arr2->getConstPointer(),nbOfPts+isDrift,1,KnewiK->getPointer());
- KnewiK->incrRef();
- return KnewiK;
+ return KnewiK.retn();
}
/*!
destWork+=spaceDimension;
}
//
- ret->incrRef();
- return ret;
+ return ret.retn();
}