* \throw If the coordinates array is not set.
* \throw If the nodal connectivity of cells is not defined.
* \sa MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell
+ * \sa MEDCouplingUMesh::computeCellCenterOfMassWithPrecision
*/
DataArrayDouble *MEDCouplingUMesh::getBarycenterAndOwner() const
{
return ret.retn();
}
+
+/*!
+ * See getBarycenterAndOwner().
+ * \param eps a precision for the detection of degenerated arc of circles.
+ * \return DataArrayDouble * - a new instance of DataArrayDouble, of size \a
+ * this->getNumberOfCells() tuples per \a this->getSpaceDimension()
+ * components. The caller is to delete this array using decrRef() as it is
+ * no more needed.
+ * \throw If the coordinates array is not set.
+ * \throw If the nodal connectivity of cells is not defined.
+ * \sa MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell
+ * \sa MEDCouplingUMesh::getBarycenterAndOwner
+ */
+DataArrayDouble *MEDCouplingUMesh::computeCellCenterOfMassWithPrecision(double eps) const
+{
+ INTERP_KERNEL::QuadraticPlanarPrecision prec(eps);
+ MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret = getBarycenterAndOwner();
+ return ret.retn();
+}
+
+
/*!
* This method computes for each cell in \a this, the location of the iso barycenter of nodes constituting
* the cell. Contrary to badly named MEDCouplingUMesh::getBarycenterAndOwner method that returns the center of inertia of the
//
MEDCOUPLING_EXPORT MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
MEDCOUPLING_EXPORT DataArrayDouble *getBarycenterAndOwner() const;
+ MEDCOUPLING_EXPORT DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps) const;
MEDCOUPLING_EXPORT DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
MEDCOUPLING_EXPORT DataArrayDouble *getPartBarycenterAndOwner(const int *begin, const int *end) const;
MEDCOUPLING_EXPORT DataArrayDouble *computePlaneEquationOf3DFaces() const;
DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
void changeOrientationOfCells() throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps) throw(INTERP_KERNEL::Exception);
int split2DCells(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI, const DataArrayInt *midOpt=0, const DataArrayInt *midOptI=0) throw(INTERP_KERNEL::Exception);
static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);