throw INTERP_KERNEL::Exception("checkDeepEquivalOnSameNodesWith : Types are not equal !");
if(_coords!=otherC->_coords)
throw INTERP_KERNEL::Exception("checkDeepEquivalOnSameNodesWith : meshes do not share the same coordinates ! Use tryToShareSameCoordinates or call checkDeepEquivalWith !");
- std::vector<MEDCouplingUMesh *> ms(2);
- ms[0]=const_cast<MEDCouplingUMesh *>(this);
- ms[1]=const_cast<MEDCouplingUMesh *>(otherC);
+ std::vector<const MEDCouplingUMesh *> ms(2);
+ ms[0]=this;
+ ms[1]=otherC;
MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=MergeUMeshesOnSameCoords(ms);
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=m->zipConnectivityTraducer(cellCompPol);
int maxId=*std::max_element(da->getConstPointer(),da->getConstPointer()+getNumberOfCells());
*/
MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception)
{
- std::vector<MEDCouplingUMesh *> tmp(2);
- tmp[0]=const_cast<MEDCouplingUMesh *>(mesh1); tmp[1]=const_cast<MEDCouplingUMesh *>(mesh2);
+ std::vector<const MEDCouplingUMesh *> tmp(2);
+ tmp[0]=mesh1; tmp[1]=mesh2;
return MergeUMeshesOnSameCoords(tmp);
}
* Idem MergeUMeshes except that 'meshes' are expected to lyie on the same coords and 'meshes' have the same meshdim.
* 'meshes' must be a non empty vector.
*/
-MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesOnSameCoords(const std::vector<MEDCouplingUMesh *>& meshes)
+MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesOnSameCoords(const std::vector<const MEDCouplingUMesh *>& meshes)
{
if(meshes.empty())
throw INTERP_KERNEL::Exception("meshes input parameter is expected to be non empty.");
DataArrayDouble *coords=meshes.front()->getCoords();
int meshDim=meshes.front()->getMeshDimension();
- std::vector<MEDCouplingUMesh *>::const_iterator iter=meshes.begin();
+ std::vector<const MEDCouplingUMesh *>::const_iterator iter=meshes.begin();
int meshLgth=0;
int meshIndexLgth=0;
for(;iter!=meshes.end();iter++)
if(coords!=(*iter)->getCoords())
throw INTERP_KERNEL::Exception("meshes does not share the same coords ! Try using tryToShareSameCoords method !");
if(meshDim!=(*iter)->getMeshDimension())
- throw INTERP_KERNEL::Exception("Mesh dimensions mismatches, fuseUMeshesOnSameCoords impossible !");
+ throw INTERP_KERNEL::Exception("Mesh dimensions mismatches, FuseUMeshesOnSameCoords impossible !");
meshLgth+=(*iter)->getMeshLength();
meshIndexLgth+=(*iter)->getNumberOfCells();
}
* @return The mesh lying on the same coordinates than those in meshes. All cells in 'meshes' are in returned mesh with
* @exception if meshes is a empty vector or meshes are not lying on same coordinates or meshes not have the same dimension.
*/
-MEDCouplingUMesh *MEDCouplingUMesh::FuseUMeshesOnSameCoords(const std::vector<MEDCouplingUMesh *>& meshes, int compType, std::vector<DataArrayInt *>& corr)
+MEDCouplingUMesh *MEDCouplingUMesh::FuseUMeshesOnSameCoords(const std::vector<const MEDCouplingUMesh *>& meshes, int compType, std::vector<DataArrayInt *>& corr)
{
//All checks are delegated to MergeUMeshesOnSameCoords
MEDCouplingUMesh *ret=MergeUMeshesOnSameCoords(meshes);
MEDCOUPLING_EXPORT static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT static MEDCouplingUMesh *MergeUMeshes(std::vector<const MEDCouplingUMesh *>& a) throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
- MEDCOUPLING_EXPORT static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const std::vector<MEDCouplingUMesh *>& meshes);
- MEDCOUPLING_EXPORT static MEDCouplingUMesh *FuseUMeshesOnSameCoords(const std::vector<MEDCouplingUMesh *>& meshes, int compType, std::vector<DataArrayInt *>& corr);
+ MEDCOUPLING_EXPORT static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const std::vector<const MEDCouplingUMesh *>& meshes);
+ MEDCOUPLING_EXPORT static MEDCouplingUMesh *FuseUMeshesOnSameCoords(const std::vector<const MEDCouplingUMesh *>& meshes, int compType, std::vector<DataArrayInt *>& corr);
MEDCOUPLING_EXPORT static bool IsPolygonWellOriented(const double *vec, const int *begin, const int *end, const double *coords);
MEDCOUPLING_EXPORT static bool IsPolyhedronWellOriented(const int *begin, const int *end, const double *coords);
MEDCOUPLING_EXPORT static void TryToCorrectPolyhedronOrientation(int *begin, int *end, const double *coords) throw(INTERP_KERNEL::Exception);
m1->tryToShareSameCoords(*m2,1e-12);
MEDCouplingUMesh *m3=build2DTargetMesh_1();
m3->tryToShareSameCoords(*m2,1e-12);
- std::vector<MEDCouplingUMesh *> meshes;
+ std::vector<const MEDCouplingUMesh *> meshes;
meshes.push_back(m1); meshes.push_back(m2); meshes.push_back(m3);
MEDCouplingUMesh *m4=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
m4->checkCoherency();
MEDCouplingUMesh *m1=build3DSurfTargetMesh_1();
std::vector<MEDCouplingUMesh *> v=m1->splitByType();
CPPUNIT_ASSERT_EQUAL(3,(int)v.size());
- MEDCouplingUMesh *m2=MEDCouplingUMesh::MergeUMeshesOnSameCoords(v);
+ std::vector<const MEDCouplingUMesh *> v2(v.begin(),v.end());
+ MEDCouplingUMesh *m2=MEDCouplingUMesh::MergeUMeshesOnSameCoords(v2);
m2->setName(m1->getName());
CPPUNIT_ASSERT(m1->isEqual(m2,1.e-12));
for(std::vector<MEDCouplingUMesh *>::const_iterator iter=v.begin();iter!=v.end();iter++)
void MEDCouplingBasicsTest::testFuseUMeshesOnSameCoords()
{
- std::vector<MEDCouplingUMesh *> meshes;
+ std::vector<const MEDCouplingUMesh *> meshes;
MEDCouplingUMesh *m2=build2DTargetMesh_1();
int cells1[3]={2,3,4};
MEDCouplingPointSet *m3_1=m2->buildPartOfMySelf(cells1,cells1+3,true);
MEDCouplingUMesh *m3=(MEDCouplingUMesh *)m1->buildPartOfMySelf(part1,part1+5,true);
const int part2[4]={5,6,4,7};
MEDCouplingUMesh *m4=(MEDCouplingUMesh *)m1->buildPartOfMySelf(part2,part2+4,true);
- std::vector<MEDCouplingUMesh *> meshes;
+ std::vector<const MEDCouplingUMesh *> meshes;
meshes.push_back(m1);
meshes.push_back(m3);
meshes.push_back(m3);
static PyObject *MergeUMeshesOnSameCoords(PyObject *ms) throw(INTERP_KERNEL::Exception)
{
- std::vector<ParaMEDMEM::MEDCouplingUMesh *> meshes;
- if(PyList_Check(ms))
- {
- int sz=PyList_Size(ms);
- meshes.resize(sz);
- for(int i=0;i<sz;i++)
- {
- PyObject *o=PyList_GetItem(ms,i);
- void *arg;
- SWIG_ConvertPtr(o,&arg,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh, 0 | 0 );
- meshes[i]=reinterpret_cast<ParaMEDMEM::MEDCouplingUMesh *>(arg);
- }
- }
- else
- {
- PyErr_SetString(PyExc_TypeError,"MergeUMeshesOnSameCoords : not a list as first parameter");
- PyErr_Print();
- return 0;
- }
+ std::vector<const ParaMEDMEM::MEDCouplingUMesh *> meshes;
+ convertPyObjToVecUMeshesCst(ms,meshes);
MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
return convertMesh(ret, SWIG_POINTER_OWN | 0 );
}
static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception)
{
int sz;
- std::vector<MEDCouplingUMesh *> meshes;
- convertPyObjToVecUMeshes(ms,meshes);
+ std::vector<const MEDCouplingUMesh *> meshes;
+ convertPyObjToVecUMeshesCst(ms,meshes);
std::vector<DataArrayInt *> corr;
MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
sz=corr.size();
}
}
-void convertPyObjToVecUMeshes(PyObject *ms, std::vector<ParaMEDMEM::MEDCouplingUMesh *>& v) throw(INTERP_KERNEL::Exception)
-{
- if(PyList_Check(ms))
- {
- int size=PyList_Size(ms);
- v.resize(size);
- for(int i=0;i<size;i++)
- {
- PyObject *obj=PyList_GetItem(ms,i);
- void *argp;
- int status=SWIG_ConvertPtr(obj,&argp,SWIGTYPE_p_ParaMEDMEM__MEDCouplingUMesh,0|0);
- if(!SWIG_IsOK(status))
- {
- const char msg[]="list must contain only MEDCouplingUMesh";
- PyErr_SetString(PyExc_TypeError,msg);
- throw INTERP_KERNEL::Exception(msg);
- }
- ParaMEDMEM::MEDCouplingUMesh *arg=reinterpret_cast< ParaMEDMEM::MEDCouplingUMesh * >(argp);
- v[i]=arg;
- }
- }
- else
- {
- const char msg[]="convertPyObjToVecUMeshes : not a list";
- PyErr_SetString(PyExc_TypeError,msg);
- throw INTERP_KERNEL::Exception(msg);
- }
-}
-
void convertPyObjToVecUMeshesCst(PyObject *ms, std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& v) throw(INTERP_KERNEL::Exception)
{
if(PyList_Check(ms))
}
}
-void MEDFileUMesh::setGroupsFromScratch(int meshDimRelToMax, const std::vector<MEDCouplingUMesh *>& ms) throw(INTERP_KERNEL::Exception)
+void MEDFileUMesh::setGroupsFromScratch(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms) throw(INTERP_KERNEL::Exception)
{
if(ms.empty())
throw INTERP_KERNEL::Exception("MEDFileUMesh::setGroupsFromScratch : expecting a non empty vector !");
}
-DataArrayDouble *MEDFileUMesh::checkMultiMesh(const std::vector<MEDCouplingUMesh *>& ms) const throw(INTERP_KERNEL::Exception)
+DataArrayDouble *MEDFileUMesh::checkMultiMesh(const std::vector<const MEDCouplingUMesh *>& ms) const throw(INTERP_KERNEL::Exception)
{
return 0;
}
void setFamilyField(DataArrayInt *arr, const std::vector< std::vector< int > > &userfids, const std::vector<std::string>& grpNames) throw(INTERP_KERNEL::Exception);
void addNodeGroup(const std::string& name, const std::vector<int>& ids) throw(INTERP_KERNEL::Exception);
void setMeshAtRank(int meshDimRelToMax, MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception);
- void setGroupsFromScratch(int meshDimRelToMax, const std::vector<MEDCouplingUMesh *>& ms) throw(INTERP_KERNEL::Exception);
+ void setGroupsFromScratch(int meshDimRelToMax, const std::vector<const MEDCouplingUMesh *>& ms) throw(INTERP_KERNEL::Exception);
void setGroupsOnSetMesh(int meshDimRelToMax, const std::vector<MEDCouplingUMesh *>& ms) throw(INTERP_KERNEL::Exception);
void optimizeFamilies() throw(INTERP_KERNEL::Exception);
private:
const MEDFileUMeshSplitL1 *getMeshAtLevSafe(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
MEDFileUMeshSplitL1 *getMeshAtLevSafe(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
void checkMeshDimCoherency(int meshDim, int meshDimRelToMax) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *checkMultiMesh(const std::vector<MEDCouplingUMesh *>& ms) const throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *checkMultiMesh(const std::vector<const MEDCouplingUMesh *>& ms) const throw(INTERP_KERNEL::Exception);
private:
std::map<std::string, std::vector<std::string> > _groups;
std::map<std::string,int> _families;
if(v.empty())
return;
int sz=v.size();
- std::vector<MEDCouplingUMesh *> ms(sz);
+ std::vector<const MEDCouplingUMesh *> ms(sz);
for(int i=0;i<sz;i++)
{
MEDCouplingUMesh *tmp=MEDCouplingUMesh::New("",v[i]->getDim());
else
_m=_m_by_types;
for(int i=0;i<sz;i++)
- ms[i]->decrRef();
+ (const_cast<MEDCouplingUMesh *>(ms[i]))->decrRef();//const cast under control to avoid a copy of array
}
MEDFileUMeshSplitL1::MEDFileUMeshSplitL1(MEDCouplingUMesh *m)
/*!
* This method ignores _m and _m_by_types.
*/
-void MEDFileUMeshSplitL1::setGroupsFromScratch(const std::vector<MEDCouplingUMesh *>& ms, std::map<std::string,int>& familyIds,
+void MEDFileUMeshSplitL1::setGroupsFromScratch(const std::vector<const MEDCouplingUMesh *>& ms, std::map<std::string,int>& familyIds,
std::map<std::string, std::vector<std::string> >& groups) throw(INTERP_KERNEL::Exception)
{
int sz=ms.size();
MEDCouplingUMesh *getWholeMesh(bool renum) const;
const DataArrayInt *getFamilyField() const;
void eraseFamilyField();
- void setGroupsFromScratch(const std::vector<MEDCouplingUMesh *>& ms, std::map<std::string,int>& familyIds,
+ void setGroupsFromScratch(const std::vector<const MEDCouplingUMesh *>& ms, std::map<std::string,int>& familyIds,
std::map<std::string, std::vector<std::string> >& groups) throw(INTERP_KERNEL::Exception);
void write(med_idt fid, const char *mName, int mdim) const;
static std::vector<int> getNewFamiliesNumber(int nb, const std::map<std::string,int>& families);
void prepareCellFieldDoubleForWriting(const ParaMEDMEM::MEDCouplingFieldDouble *f, const int *cellIds, std::list<MEDLoader::MEDFieldDoublePerCellType>& split);
void fillGaussDataOnField(const char *fileName, const std::list<MEDLoader::MEDFieldDoublePerCellType>& data, MEDCouplingFieldDouble *f);
void writeUMeshesDirectly(const char *fileName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& mesh, const std::vector<const DataArrayInt *>& families, bool forceFromScratch, bool &isRenumbering);
- void writeUMeshesPartitionDirectly(const char *fileName, const char *meshName, const std::vector<ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool forceFromScratch);
+ void writeUMeshesPartitionDirectly(const char *fileName, const char *meshName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool forceFromScratch);
void writeFieldAndMeshDirectly(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool forceFromScratch);
void writeFieldTryingToFitExistingMesh(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f);
}
* In this method meshes are assumed to shared the same coords.
* This method makes the assumption that 'meshes' is not empty, no check on that is done (responsability of the caller)
*/
-void MEDLoaderNS::writeUMeshesPartitionDirectly(const char *fileName, const char *meshName, const std::vector<ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool forceFromScratch)
+void MEDLoaderNS::writeUMeshesPartitionDirectly(const char *fileName, const char *meshName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool forceFromScratch)
{
std::string meshNameCpp(meshName);
char *maa=MEDLoaderBase::buildEmptyString(MED_TAILLE_NOM);
MEDLoaderNS::writeUMeshesDirectly(fileName,meshV,famV,false,isRenumbering);
}
-void MEDLoader::WriteUMeshesPartition(const char *fileName, const char *meshNameC, const std::vector<ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
+void MEDLoader::WriteUMeshesPartition(const char *fileName, const char *meshNameC, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
{
std::string meshName(meshNameC);
if(meshName.empty())
if(meshes.empty())
throw INTERP_KERNEL::Exception("List of meshes must be not empty !");
DataArrayDouble *coords=meshes.front()->getCoords();
- for(std::vector<ParaMEDMEM::MEDCouplingUMesh *>::const_iterator iter=meshes.begin();iter!=meshes.end();iter++)
+ for(std::vector<const ParaMEDMEM::MEDCouplingUMesh *>::const_iterator iter=meshes.begin();iter!=meshes.end();iter++)
if(coords!=(*iter)->getCoords())
throw INTERP_KERNEL::Exception("Meshes does not not share the same coordinates : try method MEDCouplingPointSet::tryToShareSameCoords !");
std::set<std::string> tmp;
- for(std::vector<ParaMEDMEM::MEDCouplingUMesh *>::const_iterator iter=meshes.begin();iter!=meshes.end();iter++)
+ for(std::vector<const ParaMEDMEM::MEDCouplingUMesh *>::const_iterator iter=meshes.begin();iter!=meshes.end();iter++)
{
if(tmp.find((*iter)->getName())==tmp.end())
tmp.insert((*iter)->getName());
}
}
-void MEDLoader::WriteUMeshesPartitionDep(const char *fileName, const char *meshNameC, const std::vector<ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
+void MEDLoader::WriteUMeshesPartitionDep(const char *fileName, const char *meshNameC, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
{
std::string meshName(meshNameC);
if(meshName.empty())
if(meshes.empty())
throw INTERP_KERNEL::Exception("List of meshes must be not empty !");
DataArrayDouble *coords=meshes.front()->getCoords();
- for(std::vector<ParaMEDMEM::MEDCouplingUMesh *>::const_iterator iter=meshes.begin();iter!=meshes.end();iter++)
+ for(std::vector<const ParaMEDMEM::MEDCouplingUMesh *>::const_iterator iter=meshes.begin();iter!=meshes.end();iter++)
if(coords!=(*iter)->getCoords())
throw INTERP_KERNEL::Exception("Meshes does not not share the same coordinates : try method MEDCouplingPointSet::tryToShareSameCoords !");
std::set<std::string> tmp;
- for(std::vector<ParaMEDMEM::MEDCouplingUMesh *>::const_iterator iter=meshes.begin();iter!=meshes.end();iter++)
+ for(std::vector<const ParaMEDMEM::MEDCouplingUMesh *>::const_iterator iter=meshes.begin();iter!=meshes.end();iter++)
{
if(tmp.find((*iter)->getName())==tmp.end())
tmp.insert((*iter)->getName());
static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
static void WriteUMesh(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
static void WriteUMeshDep(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- static void WriteUMeshesPartition(const char *fileName, const char *meshName, const std::vector<ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
- static void WriteUMeshesPartitionDep(const char *fileName, const char *meshName, const std::vector<ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
+ static void WriteUMeshesPartition(const char *fileName, const char *meshName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
+ static void WriteUMeshesPartitionDep(const char *fileName, const char *meshName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
static void WriteUMeshes(const char *fileName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
static void WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
static void WriteFieldDep(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception);
}
static void WriteUMeshesPartition(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
{
- std::vector<ParaMEDMEM::MEDCouplingUMesh *> v=convertFieldDoubleVecFromPy(li);
+ std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v=convertUMeshVecFromPy(li);
MEDLoader::WriteUMeshesPartition(fileName,meshName,v,writeFromScratch);
}
static void WriteUMeshesPartitionDep(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
{
- std::vector<ParaMEDMEM::MEDCouplingUMesh *> v=convertFieldDoubleVecFromPy(li);
+ std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v=convertUMeshVecFromPy(li);
MEDLoader::WriteUMeshesPartitionDep(fileName,meshName,v,writeFromScratch);
}
static void WriteUMeshes(const char *fileName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception)
{
- std::vector<ParaMEDMEM::MEDCouplingUMesh *> v=convertFieldDoubleVecFromPy(li);
- std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v2(v.begin(),v.end());
- MEDLoader::WriteUMeshes(fileName,v2,writeFromScratch);
+ std::vector<const ParaMEDMEM::MEDCouplingUMesh *> v=convertUMeshVecFromPy(li);
+ MEDLoader::WriteUMeshes(fileName,v,writeFromScratch);
}
static PyObject *GetTypesOfField(const char *fileName, const char *fieldName, const char *meshName) throw(INTERP_KERNEL::Exception)
{
return ret;
}
-static std::vector<ParaMEDMEM::MEDCouplingUMesh *> convertFieldDoubleVecFromPy(PyObject *pyLi)
+static std::vector<const ParaMEDMEM::MEDCouplingUMesh *> convertUMeshVecFromPy(PyObject *pyLi)
{
- std::vector<ParaMEDMEM::MEDCouplingUMesh *> ret;
+ std::vector<const ParaMEDMEM::MEDCouplingUMesh *> ret;
if(PyList_Check(pyLi))
{
int size=PyList_Size(pyLi);
mesh4->insertNextCell(INTERP_KERNEL::NORM_TETRA4,4,conn);
mesh4->finishInsertingCells();
mesh4->setCoords(mesh1->getCoords());
- std::vector<MEDCouplingUMesh *> meshes;
+ std::vector<const MEDCouplingUMesh *> meshes;
meshes.push_back(mesh1);
meshes.push_back(mesh2);
meshes.push_back(mesh3);