X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling_Swig%2FMEDCouplingCommon.i;h=bfbf966dbebe43072a7e2fcc993c0a0214af01e8;hb=d227aedfd9dc5bf718f5969278f00c544d5e2218;hp=36d090f7002e870a3b0508b83f19eb3586fb79e4;hpb=07c8e8ff8efab9224c53b20bf63872110dea6ab6;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling_Swig/MEDCouplingCommon.i b/src/MEDCoupling_Swig/MEDCouplingCommon.i index 36d090f70..bfbf966db 100644 --- a/src/MEDCoupling_Swig/MEDCouplingCommon.i +++ b/src/MEDCoupling_Swig/MEDCouplingCommon.i @@ -360,6 +360,7 @@ using namespace INTERP_KERNEL; %newobject ParaMEDMEM::MEDCouplingAMRAttribute::deepCpy; %newobject ParaMEDMEM::MEDCouplingAMRAttribute::deepCpyWithoutGodFather; %newobject ParaMEDMEM::MEDCouplingAMRAttribute::getFieldOn; +%newobject ParaMEDMEM::MEDCouplingAMRAttribute::projectTo; %newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost; %newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost; %newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost; @@ -2951,6 +2952,13 @@ namespace ParaMEDMEM return MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(st,fieldOfDbl,inp); } + static void AssignPartOfFieldOfDoubleUsing(const std::vector& st, DataArrayDouble *fieldOfDbl, PyObject *partCompactFormat, const DataArrayDouble *other) throw(INTERP_KERNEL::Exception) + { + std::vector< std::pair > inp; + convertPyToVectorPairInt(partCompactFormat,inp); + MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing(st,fieldOfDbl,inp,other); + } + static int DeduceNumberOfGivenRangeInCompactFrmt(PyObject *part) throw(INTERP_KERNEL::Exception) { std::vector< std::pair > inp; @@ -3012,6 +3020,14 @@ namespace ParaMEDMEM return retPy; } + static bool AreRangesIntersect(PyObject *r1, PyObject *r2) + { + std::vector< std::pair > r1Cpp,r2Cpp; + convertPyToVectorPairInt(r1,r1Cpp); + convertPyToVectorPairInt(r2,r2Cpp); + return MEDCouplingStructuredMesh::AreRangesIntersect(r1Cpp,r2Cpp); + } + static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception) { int szArr,sw,iTypppArr; @@ -4923,7 +4939,6 @@ namespace ParaMEDMEM class MEDCouplingCartesianAMRMeshGen : public RefCountObject, public TimeLabel { public: - virtual MEDCouplingCartesianAMRMeshGen *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception); int getAbsoluteLevel() const throw(INTERP_KERNEL::Exception); int getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception); std::vector getPositionRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const throw(INTERP_KERNEL::Exception); @@ -4982,6 +4997,12 @@ namespace ParaMEDMEM return ret; } + // agy : don't know why typemap fails here ??? let it in the extend section + PyObject *deepCpy(MEDCouplingCartesianAMRMeshGen *father) const throw(INTERP_KERNEL::Exception) + { + return convertCartesianAMRMesh(self->deepCpy(father), SWIG_POINTER_OWN | 0 ); + } + MEDCouplingCartesianAMRPatch *getPatchAtPosition(const std::vector& pos) const throw(INTERP_KERNEL::Exception) { const MEDCouplingCartesianAMRPatch *ret(self->getPatchAtPosition(pos)); @@ -5000,6 +5021,16 @@ namespace ParaMEDMEM return ret2; } + virtual PyObject *positionRelativeToGodFather() const throw(INTERP_KERNEL::Exception) + { + std::vector out1; + std::vector< std::pair > out0(self->positionRelativeToGodFather(out1)); + PyObject *ret(PyTuple_New(2)); + PyTuple_SetItem(ret,0,convertFromVectorPairInt(out0)); + PyTuple_SetItem(ret,1,convertIntArrToPyList2(out1)); + return ret; + } + virtual PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception) { std::vector ps(self->retrieveGridsAt(absoluteLev)); @@ -5169,6 +5200,7 @@ namespace ParaMEDMEM MEDCouplingFieldDouble *buildCellFieldOnWithGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception); MEDCouplingFieldDouble *buildCellFieldOnWithoutGhost(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception); bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception); + MEDCouplingAMRAttribute *projectTo(MEDCouplingCartesianAMRMesh *targetGF) const throw(INTERP_KERNEL::Exception); %extend { static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames, int ghostLev) throw(INTERP_KERNEL::Exception)