#include "MEDCouplingGaussLocalization.hxx"
#include "InterpKernelGaussCoords.hxx"
+#include "MEDCoupling1GTUMesh.hxx"
#include "MEDCouplingUMesh.hxx"
#include "CellModel.hxx"
return ret;
}
+/*!
+ * This method returns an unstructured mesh that represents the reference cell.
+ */
+MCAuto<MEDCouplingUMesh> MEDCouplingGaussLocalization::buildRefCell() const
+{
+ MCAuto<DataArrayDouble> coo(DataArrayDouble::New());
+ const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(getType()));
+ if(getDimension()!=cm.getDimension())
+ throw INTERP_KERNEL::Exception("BuildRefCell : dimension mistmatch !");
+ coo->alloc(cm.getNumberOfNodes(),getDimension());
+ std::copy(_ref_coord.begin(),_ref_coord.end(),coo->getPointer());
+ MCAuto<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New("",getType()));
+ ret->setCoords(coo);
+ MCAuto<DataArrayInt> conn(DataArrayInt::New());
+ conn->alloc(cm.getNumberOfNodes(),1);
+ conn->iota();
+ ret->setNodalConnectivity(conn);
+ return MCAuto<MEDCouplingUMesh>(ret->buildUnstructured());
+}
+
/*!
* This method sets the comp_th component of ptIdInCell_th point coordinate of reference element of type this->_type.
* @throw if not 0<=ptIdInCell<nbOfNodePerCell or if not 0<=comp<dim
MEDCOUPLING_EXPORT const double *fillWithValues(const double *vals);
//
MEDCOUPLING_EXPORT MCAuto<DataArrayDouble> localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const;
+ MEDCOUPLING_EXPORT MCAuto<MEDCouplingUMesh> buildRefCell() const;
//
MEDCOUPLING_EXPORT const std::vector<double>& getRefCoords() const { return _ref_coord; }
MEDCOUPLING_EXPORT double getRefCoord(int ptIdInCell, int comp) const;
%newobject MEDCoupling::PartDefinition::tryToSimplify;
%newobject MEDCoupling::DataArrayPartDefinition::New;
%newobject MEDCoupling::SlicePartDefinition::New;
+%newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell;
+%newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell;
%feature("unref") MEDCouplingPointSet "$this->decrRef();"
%feature("unref") MEDCouplingMesh "$this->decrRef();"
void setWeights(const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
//
static bool AreAlmostEqual(const std::vector<double>& v1, const std::vector<double>& v2, double eps);
+ //
+ %extend
+ {
+ DataArrayDouble *localizePtsInRefCooForEachCell(const DataArrayDouble *ptsInRefCoo, const MEDCouplingUMesh *mesh) const throw(INTERP_KERNEL::Exception)
+ {
+ MCAuto<DataArrayDouble> ret(self->localizePtsInRefCooForEachCell(ptsInRefCoo,mesh));
+ return ret.retn();
+ }
+
+ MEDCouplingUMesh *buildRefCell() const throw(INTERP_KERNEL::Exception)
+ {
+ MCAuto<MEDCouplingUMesh> ret(self->buildRefCell());
+ return ret.retn();
+ }
+ }
};
class MEDCouplingSkyLineArray