#include "MEDCouplingDefinitionTime.hxx"
#include "MEDCouplingFieldDiscretization.hxx"
#include "MEDCouplingCartesianAMRMesh.hxx"
+#include "MEDCouplingAMRAttribute.hxx"
#include "MEDCouplingMatrix.hxx"
#include "MEDCouplingTypemaps.i"
}
//$$$$$$$$$$$$$$$$$$
+////////////////////
+%typemap(out) MEDCouplingDataForGodFather*
+{
+ $result=convertDataForGodFather($1,$owner);
+}
+//$$$$$$$$$$$$$$$$$$
+
////////////////////
%typemap(out) ParaMEDMEM::MEDCoupling1GTUMesh*
{
%newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::getMesh;
%newobject ParaMEDMEM::MEDCouplingCartesianAMRPatchGen::__getitem__;
%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildUnstructured;
+%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::extractGhostFrom;
%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop;
%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly;
%newobject ParaMEDMEM::MEDCouplingCartesianAMRMeshGen::getImageMesh;
%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::New;
%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::getDataConst;
%newobject ParaMEDMEM::MEDCouplingCartesianAMRMesh::getData;
+%newobject ParaMEDMEM::MEDCouplingAMRAttribute::New;
+%newobject ParaMEDMEM::MEDCouplingAMRAttribute::getFieldOn;
+%newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnRecurseWithoutOverlapWithoutGhost;
+%newobject ParaMEDMEM::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost;
%newobject ParaMEDMEM::DenseMatrix::New;
%newobject ParaMEDMEM::DenseMatrix::deepCpy;
%newobject ParaMEDMEM::DenseMatrix::shallowCpy;
%feature("unref") MEDCouplingCartesianAMRPatchGF "$this->decrRef();"
%feature("unref") MEDCouplingCartesianAMRPatch "$this->decrRef();"
%feature("unref") MEDCouplingDataForGodFather "$this->decrRef();"
+%feature("unref") MEDCouplingAMRAttribute "$this->decrRef();"
%feature("unref") DenseMatrix "$this->decrRef();"
%rename(assign) *::operator=;
MEDCouplingIMesh::SpreadCoarseToFineGhost(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
}
+ static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector<int>& coarseSt, DataArrayDouble *fineDA, PyObject *fineLocInCoarse, const std::vector<int>& facts, int ghostSize) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<int,int> > inp;
+ convertPyToVectorPairInt(fineLocInCoarse,inp);
+ MEDCouplingIMesh::SpreadCoarseToFineGhostZone(coarseDA,coarseSt,fineDA,inp,facts,ghostSize);
+ }
+
std::string __str__() const throw(INTERP_KERNEL::Exception)
{
return self->simpleRepr();
class MEDCouplingDataForGodFather : public RefCountObject
{
public:
- virtual void alloc() throw(INTERP_KERNEL::Exception);
+ virtual void synchronizeFineToCoarse(int ghostLev) throw(INTERP_KERNEL::Exception);
+ virtual void synchronizeCoarseToFine(int ghostLev) throw(INTERP_KERNEL::Exception);
+ virtual void synchronizeCoarseToFineOnlyInGhostZone(int ghostLev) throw(INTERP_KERNEL::Exception);
+ virtual void synchronizeFineEachOtherInGhostZone(int ghostLev) throw(INTERP_KERNEL::Exception);
+ virtual void alloc(int ghostLev) throw(INTERP_KERNEL::Exception);
virtual void dealloc() throw(INTERP_KERNEL::Exception);
};
int getNumberOfCellsRecursiveWithoutOverlap() const throw(INTERP_KERNEL::Exception);
bool isPatchInNeighborhoodOf(int patchId1, int patchId2, int ghostLev) const throw(INTERP_KERNEL::Exception);
//
- int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
+ int getNumberOfPatches() const throw(INTERP_KERNEL::Exception);
+ int getPatchIdFromChildMesh(const MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception);
MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *extractGhostFrom(int ghostSz, const DataArrayDouble *arr) const throw(INTERP_KERNEL::Exception);
+ std::vector<int> getPatchIdsInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
MEDCoupling1SGTUMesh *buildMeshFromPatchEnvelop() const throw(INTERP_KERNEL::Exception);
MEDCoupling1SGTUMesh *buildMeshOfDirectChildrenOnly() const throw(INTERP_KERNEL::Exception);
void removeAllPatches() throw(INTERP_KERNEL::Exception);
DataArrayDouble *createCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
void fillCellFieldOnPatch(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch) const throw(INTERP_KERNEL::Exception);
void fillCellFieldOnPatchGhost(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
+ void fillCellFieldOnPatchOnlyOnGhostZone(int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const throw(INTERP_KERNEL::Exception);
void fillCellFieldComingFromPatch(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis) const throw(INTERP_KERNEL::Exception);
void fillCellFieldComingFromPatchGhost(int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev) const throw(INTERP_KERNEL::Exception);
DataArrayInt *findPatchesInTheNeighborhoodOf(int patchId, int ghostLev) const throw(INTERP_KERNEL::Exception);
self->addPatch(inp,factors);
}
+ PyObject *getPatches() const throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
+ int sz(ps.size());
+ PyObject *ret = PyList_New(sz);
+ for(int i=0;i<sz;i++)
+ {
+ MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
+ if(elt)
+ elt->incrRef();
+ PyList_SetItem(ret,i,convertCartesianAMRPatch(elt, SWIG_POINTER_OWN | 0 ));
+ }
+ return ret;
+ }
+
PyObject *retrieveGridsAt(int absoluteLev) const throw(INTERP_KERNEL::Exception)
{
std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
return ret;
}
+ MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostSz, PyObject *recurseArrs) const
+ {
+ std::vector<const DataArrayDouble *> inp;
+ convertFromPyObjVectorOfObj<const ParaMEDMEM::DataArrayDouble *>(recurseArrs,SWIGTYPE_p_ParaMEDMEM__DataArrayDouble,"DataArrayDouble",inp);
+ return self->buildCellFieldOnRecurseWithoutOverlapWithoutGhost(ghostSz,inp);
+ }
+
MEDCouplingCartesianAMRMeshGen *getFather() const throw(INTERP_KERNEL::Exception)
{
MEDCouplingCartesianAMRMeshGen *ret(const_cast<MEDCouplingCartesianAMRMeshGen *>(self->getFather()));
{
public:
void setData(MEDCouplingDataForGodFather *data) throw(INTERP_KERNEL::Exception);
- void allocData() const throw(INTERP_KERNEL::Exception);
+ void allocData(int ghostLev) const throw(INTERP_KERNEL::Exception);
void deallocData() const throw(INTERP_KERNEL::Exception);
%extend
{
}
}
};
+
+ class MEDCouplingAMRAttribute : public MEDCouplingDataForGodFather, public TimeLabel
+ {
+ public:
+ MEDCouplingFieldDouble *buildCellFieldOnRecurseWithoutOverlapWithoutGhost(int ghostLev, MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldDouble *buildCellFieldOnWithGhost(int ghostLev, MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception);
+ bool changeGodFather(MEDCouplingCartesianAMRMesh *gf) throw(INTERP_KERNEL::Exception);
+ %extend
+ {
+ static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<std::string,int> > fieldNamesCpp0;
+ std::vector< std::pair<std::string, std::vector<std::string> > > fieldNamesCpp1;
+ MEDCouplingAMRAttribute *ret(0);
+ try
+ {
+ convertPyToVectorPairStringInt(fieldNames,fieldNamesCpp0);
+ ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp0);
+ }
+ catch(INTERP_KERNEL::Exception&)
+ {
+ convertPyToVectorPairStringVecString(fieldNames,fieldNamesCpp1);
+ ret=MEDCouplingAMRAttribute::New(gf,fieldNamesCpp1);
+ }
+ return ret;
+ }
+
+ MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, PyObject *fieldNames) throw(INTERP_KERNEL::Exception)
+ {
+ return ParaMEDMEM_MEDCouplingAMRAttribute_New(gf,fieldNames);
+ }
+
+ DataArrayDouble *getFieldOn(MEDCouplingCartesianAMRMeshGen *mesh, const std::string& fieldName) const throw(INTERP_KERNEL::Exception)
+ {
+ const DataArrayDouble *ret(self->getFieldOn(mesh,fieldName));
+ DataArrayDouble *ret2(const_cast<DataArrayDouble *>(ret));
+ if(ret2)
+ ret2->incrRef();
+ return ret2;
+ }
+
+ void spillInfoOnComponents(PyObject *compNames) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::vector<std::string> > compNamesCpp;
+ convertPyToVectorOfVectorOfString(compNames,compNamesCpp);
+ self->spillInfoOnComponents(compNamesCpp);
+ }
+
+ PyObject *retrieveFieldsOn(MEDCouplingCartesianAMRMeshGen *mesh) const throw(INTERP_KERNEL::Exception)
+ {
+ std::vector<DataArrayDouble *> ret(self->retrieveFieldsOn(mesh));
+ int sz((int)ret.size());
+ PyObject *retPy(PyList_New(sz));
+ for(int i=0;i<sz;i++)
+ PyList_SetItem(retPy,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret[i]),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+ return retPy;
+ }
+ }
+ };
class DenseMatrix : public RefCountObject, public TimeLabel
{