From 9fbee34b56b506b8924d97ae27f0ad5900f10fd5 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 19 Dec 2019 16:20:46 +0300 Subject: [PATCH] LOT7: fix compilation at med_int==int64 --- CMakeLists.txt | 4 + src/MEDCalculator/MEDCalculatorDBField.cxx | 88 +++++++++---------- .../MEDCalculatorDBRangeSelection.cxx | 4 +- .../MEDCalculatorDBRangeSelection.hxx | 2 +- .../MEDCalculatorDBSliceField.cxx | 62 ++++++------- .../MEDCalculatorDBSliceField.hxx | 10 +-- src/MEDCalculator/Swig/CMakeLists.txt | 3 + .../Test/MEDCalculatorBasicsTest.cxx | 4 +- .../Client/DataArrayDoubleClient.cxx | 2 +- .../Client/DataArrayIntClient.cxx | 2 +- .../Client/MEDCouplingFieldDoubleClient.cxx | 10 +-- .../Client/MEDCouplingFieldOverTimeClient.cxx | 8 +- .../Client/MEDCouplingFieldTemplateClient.cxx | 10 +-- .../Client/MEDCouplingMeshClient.cxx | 6 +- .../Client/MEDCouplingMultiFieldsClient.cxx | 8 +- .../DataArrayDoubleServant.cxx | 2 +- src/MEDCouplingCorba/DataArrayIntServant.cxx | 2 +- .../MEDCouplingFieldDoubleServant.cxx | 10 +-- .../MEDCouplingFieldTemplateServant.cxx | 10 +-- .../MEDCouplingMeshServant.cxx | 6 +- .../MEDCouplingMultiFieldsServant.cxx | 12 +-- .../MEDCouplingMeshFieldFactoryComponent.cxx | 26 +++--- src/MEDCouplingCorba_Swig/CMakeLists.txt | 3 + .../Client/CMakeLists.txt | 3 + 24 files changed, 155 insertions(+), 142 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1219b43ee..b22ba9a3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,10 @@ ELSE(EXISTS ${MEDCOUPLING_ROOT_DIR}) MESSAGE(FATAL_ERROR "We absolutely need the MEDCoupling tool, please define MEDCOUPLING_ROOT_DIR !") ENDIF(EXISTS ${MEDCOUPLING_ROOT_DIR}) +IF(MEDCOUPLING_USE_64BIT_IDS) + ADD_DEFINITIONS("-DMEDCOUPLING_USE_64BIT_IDS") +ENDIF(MEDCOUPLING_USE_64BIT_IDS) + # # Set list of prerequisites # ========================= diff --git a/src/MEDCalculator/MEDCalculatorDBField.cxx b/src/MEDCalculator/MEDCalculatorDBField.cxx index 16fe0685b..3f718dbbb 100644 --- a/src/MEDCalculator/MEDCalculatorDBField.cxx +++ b/src/MEDCalculator/MEDCalculatorDBField.cxx @@ -118,7 +118,7 @@ void MEDCalculatorDBFieldReal::setDescription(const char *descr) void MEDCalculatorDBFieldReal::write(const char *fName, bool writeFromScratch) const throw(INTERP_KERNEL::Exception) { fetchData(); - std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids=_t.getIds(_time_steps.size()); int step=ids[0]; const MEDCouplingFieldDouble *field=_time_steps[step]->getField(_type,_file_name,_mesh_name,_field_name); const MEDCouplingUMesh *mesh=static_cast(field->getMesh()); @@ -139,17 +139,17 @@ void MEDCalculatorDBFieldReal::write(const char *fName, bool writeFromScratch) c } } WriteUMesh(fName,mesh,writeFromScratch); - for(std::vector::const_iterator iter=ids.begin();iter!=ids.end();iter++) + for(std::vector::const_iterator iter=ids.begin();iter!=ids.end();iter++) _time_steps[*iter]->write(fName,_name,_description); } void MEDCalculatorDBFieldReal::display() const throw(INTERP_KERNEL::Exception) { fetchData(); - std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids=_t.getIds(_time_steps.size()); std::vector< MCAuto > fs2(ids.size()); int ii=0; - for(std::vector::const_iterator iter=ids.begin();iter!=ids.end();iter++) + for(std::vector::const_iterator iter=ids.begin();iter!=ids.end();iter++) fs2[ii++]=_time_steps[*iter]->getFieldWithoutQuestion(_c_labels.size(),_c); std::vector fs(fs2.size()); std::copy(fs2.begin(),fs2.end(),fs.begin()); @@ -193,8 +193,8 @@ std::string MEDCalculatorDBFieldReal::simpleRepr() const oss << "Number of time steps of multitime field : " << getNumberOfSteps() << ".\n"; oss << "Number of components of multitime field : " << getNumberOfComponents() << ".\n"; oss << "Components names attached are : "; - std::vector ids=_c.getIds(_c_labels.size()); - for(std::vector::const_iterator iter=ids.begin();iter!=ids.end();iter++) + std::vector ids=_c.getIds(_c_labels.size()); + for(std::vector::const_iterator iter=ids.begin();iter!=ids.end();iter++) oss << "\"" << _c_labels[*iter] << "\" "; oss << ".\nNumber of fetched field in multime field : " << getNumberOfFetchedSteps() << "/" << getNumberOfSteps() << ".\n"; return oss.str(); @@ -215,8 +215,8 @@ MEDCalculatorDBFieldReal::MEDCalculatorDBFieldReal(const MEDCalculatorBrowserFie const MEDCalculatorDBFieldReal& MEDCalculatorDBFieldReal::operator=(const MEDCalculatorDBFieldReal& other) throw(INTERP_KERNEL::Exception) { checkConsistencyLight(other); - std::vector ids=_t.getIds(_time_steps.size()); - std::vector ids2=other._t.getIds(other._time_steps.size()); + std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids2=other._t.getIds(other._time_steps.size()); unsigned int sz=ids.size(); if(sz!=ids2.size()) throw INTERP_KERNEL::Exception("FieldReal::operator= : Timesteps lengths mismatch !"); @@ -259,9 +259,9 @@ MEDCalculatorDBField *MEDCalculatorDBFieldReal::add(const MEDCalculatorDBFieldRe MCAuto ret=new MEDCalculatorDBFieldReal(_type); fetchData(); other.fetchData(); - DataArrayInt *cellCor,*nodeCor; - std::vector ids=_t.getIds(_time_steps.size()); - std::vector ids2=other._t.getIds(other._time_steps.size()); + DataArrayIdType *cellCor,*nodeCor; + std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids2=other._t.getIds(other._time_steps.size()); if(ids.size()!=ids2.size()) throw INTERP_KERNEL::Exception("FieldReal::add : Timesteps lengths mismatch !"); int step=ids[0]; @@ -309,9 +309,9 @@ bool MEDCalculatorDBFieldReal::isEqualSameType(const MEDCalculatorDBFieldReal& o return false; fetchData(); other.fetchData(); - DataArrayInt *cellCor,*nodeCor; - std::vector ids=_t.getIds(_time_steps.size()); - std::vector ids2=other._t.getIds(other._time_steps.size()); + DataArrayIdType *cellCor,*nodeCor; + std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids2=other._t.getIds(other._time_steps.size()); if(ids.size()!=ids2.size()) return false; int step=ids[0]; @@ -356,9 +356,9 @@ MEDCalculatorDBField *MEDCalculatorDBFieldReal::substract(const MEDCalculatorDBF MCAuto ret=new MEDCalculatorDBFieldReal(_type); fetchData(); other.fetchData(); - DataArrayInt *cellCor,*nodeCor; - std::vector ids=_t.getIds(_time_steps.size()); - std::vector ids2=other._t.getIds(other._time_steps.size()); + DataArrayIdType *cellCor,*nodeCor; + std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids2=other._t.getIds(other._time_steps.size()); if(ids.size()!=ids2.size()) throw INTERP_KERNEL::Exception("FieldReal::substract : Timesteps lengths mismatch !"); int step=ids[0]; @@ -406,9 +406,9 @@ MEDCalculatorDBField *MEDCalculatorDBFieldReal::multiply(const MEDCalculatorDBFi MCAuto ret=new MEDCalculatorDBFieldReal(_type); fetchData(); other.fetchData(); - DataArrayInt *cellCor,*nodeCor; - std::vector ids=_t.getIds(_time_steps.size()); - std::vector ids2=other._t.getIds(other._time_steps.size()); + DataArrayIdType *cellCor,*nodeCor; + std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids2=other._t.getIds(other._time_steps.size()); if(ids.size()!=ids2.size()) throw INTERP_KERNEL::Exception("FieldReal::multiply : Timesteps lengths mismatch !"); int step=ids[0]; @@ -456,9 +456,9 @@ MEDCalculatorDBField *MEDCalculatorDBFieldReal::divide(const MEDCalculatorDBFiel MCAuto ret=new MEDCalculatorDBFieldReal(_type); fetchData(); other.fetchData(); - DataArrayInt *cellCor,*nodeCor; - std::vector ids=_t.getIds(_time_steps.size()); - std::vector ids2=other._t.getIds(other._time_steps.size()); + DataArrayIdType *cellCor,*nodeCor; + std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids2=other._t.getIds(other._time_steps.size()); if(ids.size()!=ids2.size()) throw INTERP_KERNEL::Exception("FieldReal::divide : Timesteps lengths mismatch !"); int step=ids[0]; @@ -491,8 +491,8 @@ MEDCalculatorDBField *MEDCalculatorDBFieldReal::dot(const MEDCalculatorDBFieldRe MCAuto ret=new MEDCalculatorDBFieldReal(_type); fetchData(); other.fetchData(); - std::vector ids=_t.getIds(_time_steps.size()); - std::vector ids2=other._t.getIds(other._time_steps.size()); + std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids2=other._t.getIds(other._time_steps.size()); unsigned int sz=ids.size(); if(sz!=ids2.size()) throw INTERP_KERNEL::Exception("FieldReal::dot : Timesteps lengths mismatch !"); @@ -511,8 +511,8 @@ MEDCalculatorDBField *MEDCalculatorDBFieldReal::crossProduct(const MEDCalculator MCAuto ret=new MEDCalculatorDBFieldReal(_type); fetchData(); other.fetchData(); - std::vector ids=_t.getIds(_time_steps.size()); - std::vector ids2=other._t.getIds(other._time_steps.size()); + std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids2=other._t.getIds(other._time_steps.size()); unsigned int sz=ids.size(); if(sz!=ids2.size()) throw INTERP_KERNEL::Exception("FieldReal::crossProduct : Timesteps lengths mismatch !"); @@ -529,7 +529,7 @@ MEDCalculatorDBField *MEDCalculatorDBFieldReal::doublyContractedProduct() const { MCAuto ret=new MEDCalculatorDBFieldReal(_type); fetchData(); - std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids=_t.getIds(_time_steps.size()); unsigned int sz=ids.size(); ret->_time_steps.resize(sz); for(unsigned int i=0;i ret=new MEDCalculatorDBFieldReal(_type); fetchData(); - std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids=_t.getIds(_time_steps.size()); unsigned int sz=ids.size(); ret->_time_steps.resize(sz); for(unsigned int i=0;i ret=new MEDCalculatorDBFieldReal(_type); fetchData(); - std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids=_t.getIds(_time_steps.size()); unsigned int sz=ids.size(); ret->_time_steps.resize(sz); for(unsigned int i=0;i ret=new MEDCalculatorDBFieldReal(_type); fetchData(); - std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids=_t.getIds(_time_steps.size()); unsigned int sz=ids.size(); ret->_time_steps.resize(sz); for(unsigned int i=0;i ret=new MEDCalculatorDBFieldReal(_type); fetchData(); - std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids=_t.getIds(_time_steps.size()); unsigned int sz=ids.size(); ret->_time_steps.resize(sz); for(unsigned int i=0;i ret=new MEDCalculatorDBFieldReal(_type); fetchData(); - std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids=_t.getIds(_time_steps.size()); unsigned int sz=ids.size(); ret->_time_steps.resize(sz); for(unsigned int i=0;i ret=new MEDCalculatorDBFieldReal(_type); fetchData(); - std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids=_t.getIds(_time_steps.size()); unsigned int sz=ids.size(); ret->_time_steps.resize(sz); for(unsigned int i=0;i ret=new MEDCalculatorDBFieldReal(_type); fetchData(); - std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids=_t.getIds(_time_steps.size()); unsigned int sz=ids.size(); ret->_time_steps.resize(sz); for(unsigned int i=0;i ids=_t.getIds(_time_steps.size()); - for(std::vector::const_iterator it=ids.begin();it!=ids.end();it++) + std::vector ids=_t.getIds(_time_steps.size()); + for(std::vector::const_iterator it=ids.begin();it!=ids.end();it++) _time_steps[*it]->applyFunc(func,_c_labels.size(),_c); } @@ -682,7 +682,7 @@ MEDCalculatorDBFieldReal *MEDCalculatorDBFieldReal::buildCstFieldFromThis(double MCAuto ret=new MEDCalculatorDBFieldReal(_type); ret->_p=_p; ret->_c_labels.resize(_c.getSize(_c_labels.size())); - std::vector stps=_t.getIds(_time_steps.size()); + std::vector stps=_t.getIds(_time_steps.size()); int stepSize=stps.size(); ret->_time_steps.resize(stepSize); if(stepSize==0) @@ -709,9 +709,9 @@ void MEDCalculatorDBFieldReal::checkConsistencyLight(const MEDCalculatorDBFieldR void MEDCalculatorDBFieldReal::fetchData() const throw(INTERP_KERNEL::Exception) { std::vector > idstoFetch; - std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids=_t.getIds(_time_steps.size()); int sz=ids.size(); - std::vector idsInGlobalToFetch; + std::vector idsInGlobalToFetch; for(int i=0;i elt=_time_steps[ids[i]]; @@ -741,8 +741,8 @@ int MEDCalculatorDBFieldReal::getNumberOfSteps() const int MEDCalculatorDBFieldReal::getNumberOfFetchedSteps() const { int ret=0; - std::vector ids=_t.getIds(_time_steps.size()); - for(std::vector::const_iterator it=ids.begin();it!=ids.end();it++) + std::vector ids=_t.getIds(_time_steps.size()); + for(std::vector::const_iterator it=ids.begin();it!=ids.end();it++) if(_time_steps[*it]->isFetched()) ret++; return ret; @@ -759,10 +759,10 @@ int MEDCalculatorDBFieldReal::getNumberOfComponents() const std::vector MEDCalculatorDBFieldReal::getFields() const throw(INTERP_KERNEL::Exception) { fetchData(); - std::vector ids=_t.getIds(_time_steps.size()); + std::vector ids=_t.getIds(_time_steps.size()); std::vector ret(ids.size()); int i=0; - for(std::vector::const_iterator it=ids.begin();it!=ids.end();it++,i++) + for(std::vector::const_iterator it=ids.begin();it!=ids.end();it++,i++) ret[i]=_time_steps[*it]->getFieldWithoutQuestion(_c_labels.size(),_c); return ret; } diff --git a/src/MEDCalculator/MEDCalculatorDBRangeSelection.cxx b/src/MEDCalculator/MEDCalculatorDBRangeSelection.cxx index ea5d3d4e0..b9659adac 100644 --- a/src/MEDCalculator/MEDCalculatorDBRangeSelection.cxx +++ b/src/MEDCalculator/MEDCalculatorDBRangeSelection.cxx @@ -58,7 +58,7 @@ void MEDCalculatorDBRangeSelection::setPyEnd(int val) _end=TraducePyVal(val); } -std::vector MEDCalculatorDBRangeSelection::getIds(int lgth) const throw(INTERP_KERNEL::Exception) +std::vector MEDCalculatorDBRangeSelection::getIds(int lgth) const throw(INTERP_KERNEL::Exception) { if(_start>=lgth || _start<0) { @@ -75,7 +75,7 @@ std::vector MEDCalculatorDBRangeSelection::getIds(int lgth) const throw(INT throw INTERP_KERNEL::Exception("RangeSelection::getIds : end specficied is higher than length !"); if(_start>trueEnd) throw INTERP_KERNEL::Exception("RangeSelection::getIds : begin of range after end !"); - std::vector ret(trueEnd-_start); + std::vector ret(trueEnd-_start); int j=0; for(int i=_start;i getIds(int lgth) const throw(INTERP_KERNEL::Exception); + std::vector getIds(int lgth) const throw(INTERP_KERNEL::Exception); int getSize(int lgth) const throw(INTERP_KERNEL::Exception); bool isAll() const; void setAll(); diff --git a/src/MEDCalculator/MEDCalculatorDBSliceField.cxx b/src/MEDCalculator/MEDCalculatorDBSliceField.cxx index 4a7ced0e7..460f23096 100644 --- a/src/MEDCalculator/MEDCalculatorDBSliceField.cxx +++ b/src/MEDCalculator/MEDCalculatorDBSliceField.cxx @@ -108,7 +108,7 @@ MEDCouplingFieldDouble *MEDCalculatorDBSliceField::getField(TypeOfField type, co */ MEDCouplingFieldDouble *MEDCalculatorDBSliceField::getFieldWithoutQuestion(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const { - std::vector tIds=thisC.getIds(sizeCThis); + std::vector tIds=thisC.getIds(sizeCThis); return _field->keepSelectedComponents(tIds); } @@ -124,20 +124,20 @@ MEDCouplingFieldDouble *MEDCalculatorDBSliceField::buildCstFromThis(double val, void MEDCalculatorDBSliceField::assign(const MEDCalculatorDBSliceField* other, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC, int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) { - std::vector tIds=thisC.getIds(sizeCThis); - std::vector oIds=otherC.getIds(sizeCOther); + std::vector tIds=thisC.getIds(sizeCThis); + std::vector oIds=otherC.getIds(sizeCOther); MCAuto f1=other->_field->keepSelectedComponents(oIds); _field->setSelectedComponents(f1,tIds); } -MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::add(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc, +MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::add(const MEDCalculatorDBSliceField* other, const DataArrayIdType *cc, const DataArrayIdType *nc, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC, int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const { if(cc!=0 || nc!=0) throw INTERP_KERNEL::Exception("Slice::add : not implemented yet node/cell permutation !"); - std::vector tIds=thisC.getIds(sizeCThis); - std::vector oIds=otherC.getIds(sizeCOther); + std::vector tIds=thisC.getIds(sizeCThis); + std::vector oIds=otherC.getIds(sizeCOther); MCAuto f1=_field->keepSelectedComponents(tIds); MCAuto f2=other->_field->keepSelectedComponents(oIds); f2->setMesh(f1->getMesh()); @@ -145,14 +145,14 @@ MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::add(const MEDCalculatorDBS return new MEDCalculatorDBSliceField(f3); } -MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::substract(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc, +MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::substract(const MEDCalculatorDBSliceField* other, const DataArrayIdType *cc, const DataArrayIdType *nc, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC, int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const { if(cc!=0 || nc!=0) throw INTERP_KERNEL::Exception("Slice::substract : not implemented yet node/cell permutation !"); - std::vector tIds=thisC.getIds(sizeCThis); - std::vector oIds=otherC.getIds(sizeCOther); + std::vector tIds=thisC.getIds(sizeCThis); + std::vector oIds=otherC.getIds(sizeCOther); MCAuto f1=_field->keepSelectedComponents(tIds); MCAuto f2=other->_field->keepSelectedComponents(oIds); f2->setMesh(f1->getMesh()); @@ -160,14 +160,14 @@ MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::substract(const MEDCalcula return new MEDCalculatorDBSliceField(f3); } -MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::multiply(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc, +MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::multiply(const MEDCalculatorDBSliceField* other, const DataArrayIdType *cc, const DataArrayIdType *nc, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC, int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const { if(cc!=0 || nc!=0) throw INTERP_KERNEL::Exception("Slice::multiply : not implemented yet node/cell permutation !"); - std::vector tIds=thisC.getIds(sizeCThis); - std::vector oIds=otherC.getIds(sizeCOther); + std::vector tIds=thisC.getIds(sizeCThis); + std::vector oIds=otherC.getIds(sizeCOther); MCAuto f1=_field->keepSelectedComponents(tIds); MCAuto f2=other->_field->keepSelectedComponents(oIds); f2->setMesh(f1->getMesh()); @@ -175,14 +175,14 @@ MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::multiply(const MEDCalculat return new MEDCalculatorDBSliceField(f3); } -MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::divide(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc, +MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::divide(const MEDCalculatorDBSliceField* other, const DataArrayIdType *cc, const DataArrayIdType *nc, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC, int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const { if(cc!=0 || nc!=0) throw INTERP_KERNEL::Exception("Slice::divide : not implemented yet node/cell permutation !"); - std::vector tIds=thisC.getIds(sizeCThis); - std::vector oIds=otherC.getIds(sizeCOther); + std::vector tIds=thisC.getIds(sizeCThis); + std::vector oIds=otherC.getIds(sizeCOther); MCAuto f1=_field->keepSelectedComponents(tIds); MCAuto f2=other->_field->keepSelectedComponents(oIds); f2->setMesh(f1->getMesh()); @@ -193,8 +193,8 @@ MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::divide(const MEDCalculator MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::dot(const MEDCalculatorDBSliceField* other, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC, int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const { - std::vector tIds=thisC.getIds(sizeCThis); - std::vector oIds=otherC.getIds(sizeCOther); + std::vector tIds=thisC.getIds(sizeCThis); + std::vector oIds=otherC.getIds(sizeCOther); MCAuto f1=_field->keepSelectedComponents(tIds); MCAuto f2=other->_field->keepSelectedComponents(oIds); f2->setMesh(f1->getMesh()); @@ -205,8 +205,8 @@ MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::dot(const MEDCalculatorDBS MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::crossProduct(const MEDCalculatorDBSliceField* other, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC, int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const { - std::vector tIds=thisC.getIds(sizeCThis); - std::vector oIds=otherC.getIds(sizeCOther); + std::vector tIds=thisC.getIds(sizeCThis); + std::vector oIds=otherC.getIds(sizeCOther); MCAuto f1=_field->keepSelectedComponents(tIds); MCAuto f2=other->_field->keepSelectedComponents(oIds); f2->setMesh(f1->getMesh()); @@ -216,7 +216,7 @@ MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::crossProduct(const MEDCalc MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::doublyContractedProduct(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception) { - std::vector tIds=thisC.getIds(sizeCThis); + std::vector tIds=thisC.getIds(sizeCThis); MCAuto f1=_field->keepSelectedComponents(tIds); MEDCouplingFieldDouble *f2=f1->doublyContractedProduct(); return new MEDCalculatorDBSliceField(f2); @@ -224,7 +224,7 @@ MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::doublyContractedProduct(in MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::determinant(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception) { - std::vector tIds=thisC.getIds(sizeCThis); + std::vector tIds=thisC.getIds(sizeCThis); MCAuto f1=_field->keepSelectedComponents(tIds); MEDCouplingFieldDouble *f2=f1->determinant(); return new MEDCalculatorDBSliceField(f2); @@ -232,7 +232,7 @@ MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::determinant(int sizeCThis, MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::eigenValues(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception) { - std::vector tIds=thisC.getIds(sizeCThis); + std::vector tIds=thisC.getIds(sizeCThis); MCAuto f1=_field->keepSelectedComponents(tIds); MEDCouplingFieldDouble *f2=f1->eigenValues(); return new MEDCalculatorDBSliceField(f2); @@ -240,7 +240,7 @@ MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::eigenValues(int sizeCThis, MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::eigenVectors(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception) { - std::vector tIds=thisC.getIds(sizeCThis); + std::vector tIds=thisC.getIds(sizeCThis); MCAuto f1=_field->keepSelectedComponents(tIds); MEDCouplingFieldDouble *f2=f1->eigenVectors(); return new MEDCalculatorDBSliceField(f2); @@ -248,7 +248,7 @@ MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::eigenVectors(int sizeCThis MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::inverse(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception) { - std::vector tIds=thisC.getIds(sizeCThis); + std::vector tIds=thisC.getIds(sizeCThis); MCAuto f1=_field->keepSelectedComponents(tIds); MEDCouplingFieldDouble *f2=f1->inverse(); return new MEDCalculatorDBSliceField(f2); @@ -256,7 +256,7 @@ MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::inverse(int sizeCThis, con MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::trace(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception) { - std::vector tIds=thisC.getIds(sizeCThis); + std::vector tIds=thisC.getIds(sizeCThis); MCAuto f1=_field->keepSelectedComponents(tIds); MEDCouplingFieldDouble *f2=f1->trace(); return new MEDCalculatorDBSliceField(f2); @@ -264,7 +264,7 @@ MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::trace(int sizeCThis, const MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::deviator(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception) { - std::vector tIds=thisC.getIds(sizeCThis); + std::vector tIds=thisC.getIds(sizeCThis); MCAuto f1=_field->keepSelectedComponents(tIds); MEDCouplingFieldDouble *f2=f1->deviator(); return new MEDCalculatorDBSliceField(f2); @@ -272,7 +272,7 @@ MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::deviator(int sizeCThis, co MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::magnitude(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception) { - std::vector tIds=thisC.getIds(sizeCThis); + std::vector tIds=thisC.getIds(sizeCThis); MCAuto f1=_field->keepSelectedComponents(tIds); MEDCouplingFieldDouble *f2=f1->magnitude(); return new MEDCalculatorDBSliceField(f2); @@ -280,20 +280,20 @@ MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::magnitude(int sizeCThis, c void MEDCalculatorDBSliceField::applyFunc(const char *func, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) { - std::vector tIds=thisC.getIds(sizeCThis); + std::vector tIds=thisC.getIds(sizeCThis); MCAuto f1=_field->keepSelectedComponents(tIds); f1->applyFunc(func); _field->setSelectedComponents(f1,tIds); } -bool MEDCalculatorDBSliceField::isEqual(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc, +bool MEDCalculatorDBSliceField::isEqual(const MEDCalculatorDBSliceField* other, const DataArrayIdType *cc, const DataArrayIdType *nc, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC, int sizeCOther, const MEDCalculatorDBRangeSelection& otherC, double prec) const { if(cc!=0 || nc!=0) throw INTERP_KERNEL::Exception("Slice::isEqual : not implemented yet node/cell permutation !"); - std::vector tIds=thisC.getIds(sizeCThis); - std::vector oIds=otherC.getIds(sizeCOther); + std::vector tIds=thisC.getIds(sizeCThis); + std::vector oIds=otherC.getIds(sizeCOther); MCAuto f1=_field->keepSelectedComponents(tIds); MCAuto f2=other->_field->keepSelectedComponents(oIds); f2->setMesh(f1->getMesh()); diff --git a/src/MEDCalculator/MEDCalculatorDBSliceField.hxx b/src/MEDCalculator/MEDCalculatorDBSliceField.hxx index 28ae97fdc..4c4095357 100644 --- a/src/MEDCalculator/MEDCalculatorDBSliceField.hxx +++ b/src/MEDCalculator/MEDCalculatorDBSliceField.hxx @@ -57,16 +57,16 @@ namespace MEDCoupling // void assign(const MEDCalculatorDBSliceField* other, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC, int sizeCOther, const MEDCalculatorDBRangeSelection& otherC); - MEDCalculatorDBSliceField *add(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc, + MEDCalculatorDBSliceField *add(const MEDCalculatorDBSliceField* other, const DataArrayIdType *cc, const DataArrayIdType *nc, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC, int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const; - MEDCalculatorDBSliceField *substract(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc, + MEDCalculatorDBSliceField *substract(const MEDCalculatorDBSliceField* other, const DataArrayIdType *cc, const DataArrayIdType *nc, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC, int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const; - MEDCalculatorDBSliceField *multiply(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc, + MEDCalculatorDBSliceField *multiply(const MEDCalculatorDBSliceField* other, const DataArrayIdType *cc, const DataArrayIdType *nc, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC, int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const; - MEDCalculatorDBSliceField *divide(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc, + MEDCalculatorDBSliceField *divide(const MEDCalculatorDBSliceField* other, const DataArrayIdType *cc, const DataArrayIdType *nc, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC, int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const; MEDCalculatorDBSliceField *dot(const MEDCalculatorDBSliceField* other, @@ -84,7 +84,7 @@ namespace MEDCoupling MEDCalculatorDBSliceField *deviator(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception); MEDCalculatorDBSliceField *magnitude(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception); void applyFunc(const char *func, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC); - bool isEqual(const MEDCalculatorDBSliceField* other, const DataArrayInt *cc, const DataArrayInt *nc, + bool isEqual(const MEDCalculatorDBSliceField* other, const DataArrayIdType *cc, const DataArrayIdType *nc, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC, int sizeCOther, const MEDCalculatorDBRangeSelection& otherC, double prec) const; private: diff --git a/src/MEDCalculator/Swig/CMakeLists.txt b/src/MEDCalculator/Swig/CMakeLists.txt index 70bda1ab3..28406e855 100644 --- a/src/MEDCalculator/Swig/CMakeLists.txt +++ b/src/MEDCalculator/Swig/CMakeLists.txt @@ -45,6 +45,9 @@ INSTALL(TARGETS medcalculatorspython DESTINATION ${SALOME_INSTALL_LIBS}) SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES SWIG_FLAGS "-py3") SET(SWIG_MODULE_MEDCalculator_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}") +IF(MEDCOUPLING_USE_64BIT_IDS) + STRING(APPEND SWIG_MODULE_MEDCalculator_EXTRA_FLAGS ";-DMEDCOUPLING_USE_64BIT_IDS") +ENDIF(MEDCOUPLING_USE_64BIT_IDS) IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") SWIG_ADD_MODULE(MEDCalculator python MEDCalculator.i) ELSE() diff --git a/src/MEDCalculator/Test/MEDCalculatorBasicsTest.cxx b/src/MEDCalculator/Test/MEDCalculatorBasicsTest.cxx index b4796a6e1..bb14c4237 100644 --- a/src/MEDCalculator/Test/MEDCalculatorBasicsTest.cxx +++ b/src/MEDCalculator/Test/MEDCalculatorBasicsTest.cxx @@ -45,7 +45,7 @@ void MEDCoupling::MEDCalculatorBasicsTest::testLightStruct1() void MEDCoupling::MEDCalculatorBasicsTest::testRangeSelection1() { MEDCalculatorDBRangeSelection sel1(":"); - std::vector v=sel1.getIds(6); + std::vector v=sel1.getIds(6); CPPUNIT_ASSERT_EQUAL(6,(int)v.size()); const int expected1[6]={0,1,2,3,4,5}; CPPUNIT_ASSERT(std::equal(expected1,expected1+6,v.begin())); @@ -111,7 +111,7 @@ void MEDCoupling::MEDCalculatorBasicsTest::testDBField1() void MEDCoupling::MEDCalculatorBasicsTest::generateAFile1(const char *fName) { double targetCoords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 }; - int targetConn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + mcIdType targetConn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; MEDCouplingUMesh *m=MEDCouplingUMesh::New(); m->setName("AMesh"); m->setMeshDimension(2); diff --git a/src/MEDCouplingCorba/Client/DataArrayDoubleClient.cxx b/src/MEDCouplingCorba/Client/DataArrayDoubleClient.cxx index 4a48e9ed2..7023bc86c 100644 --- a/src/MEDCouplingCorba/Client/DataArrayDoubleClient.cxx +++ b/src/MEDCouplingCorba/Client/DataArrayDoubleClient.cxx @@ -35,7 +35,7 @@ DataArrayDouble *DataArrayDoubleClient::New(SALOME_MED::DataArrayDoubleCorbaInte dadPtr->getTinyInfo(tinyL,tinyS); DataArrayDouble *ret=DataArrayDouble::New(); int tinyLgth=tinyL->length(); - std::vector v1(tinyLgth); + std::vector v1(tinyLgth); for(int j=0;jgetTinyInfo(tinyL,tinyS); DataArrayInt *ret=DataArrayInt::New(); int tinyLgth=tinyL->length(); - std::vector v1(tinyLgth); + std::vector v1(tinyLgth); for(int j=0;jgetTinyInfo(tinyL,tinyD,tinyS); int tinyLgth=tinyL->length(); - std::vector tinyLV(tinyLgth); + std::vector tinyLV(tinyLgth); for(int i=0;isetMesh(mesh); mesh->decrRef(); - DataArrayInt *array0; + DataArrayIdType *array0; std::vector arrays; ret->resizeForUnserialization(tinyLV,array0,arrays); SALOME_TYPES::ListOfLong *bigArr0; @@ -72,9 +72,9 @@ MEDCouplingFieldDouble *MEDCouplingFieldDoubleClient::New(SALOME_MED::MEDCouplin fieldPtr->getSerialisationData(bigArr0,bigArr); if(bigArr0->length()!=0) { - int *pt=array0->getPointer(); - int lgth=array0->getNbOfElems(); - for(int i=0;igetPointer(); + mcIdType lgth=array0->getNbOfElems(); + for(mcIdType i=0;igetMainTinyInfo(tinyL,tinyD,nbOfArrays,nbOfFields); int tinyLgth=tinyL->length(); - std::vector mainI(tinyLgth); + std::vector mainI(tinyLgth); for(int i=0;igetTinyInfo(i,tinyL,tinyD,tinyS); int tinyLgth=tinyL->length(); - std::vector tinyLV(tinyLgth); + std::vector tinyLV(tinyLgth); for(int j=0;jresizeForUnserialization(tinyLV,array0); if(array0) { _field_ptr->getSerialisationData(i,tinyL); tinyLgth=tinyL->length(); - int *ptr=array0->getPointer(); + mcIdType *ptr=array0->getPointer(); for(int j=0;jgetTinyInfo(tinyL,tinyD,tinyS); int tinyLgth=tinyL->length(); - std::vector tinyLV(tinyLgth); + std::vector tinyLV(tinyLgth); for(int i=0;isetMesh(mesh); mesh->decrRef(); - DataArrayInt *array0; + DataArrayIdType *array0; ret->resizeForUnserialization(tinyLV,array0); SALOME_TYPES::ListOfLong *bigArr0; //3rd CORBA invocation to get big content fieldPtr->getSerialisationData(bigArr0); if(bigArr0->length()!=0) { - int *pt=array0->getPointer(); - int lgth=array0->getNbOfElems(); - for(int i=0;igetPointer(); + mcIdType lgth=array0->getNbOfElems(); + for(mcIdType i=0;igetTinyInfo(tinyD,tinyI,tinyS); int tinyLgth=tinyI->length(); - std::vector tinyV(tinyLgth); + std::vector tinyV(tinyLgth); for(int i=0;ilength(); @@ -116,7 +116,7 @@ void MEDCouplingMeshClient::fillMeshFromCorbaData(MEDCouplingMesh *meshCpp, SALO delete tinyS; delete tinyI; delete tinyD; - DataArrayInt* a1=DataArrayInt::New(); + DataArrayIdType* a1=DataArrayIdType::New(); DataArrayDouble* a2=DataArrayDouble::New(); //thanks to the entry point tinyV get from the 1st CORBA invocation, //resizing a1,a2 and sts. @@ -127,7 +127,7 @@ void MEDCouplingMeshClient::fillMeshFromCorbaData(MEDCouplingMesh *meshCpp, SALO SALOME_TYPES::ListOfDouble *a2Corba; meshPtr->getSerialisationData(a1Corba,a2Corba); int myLgth=a1Corba->length(); - int *ptToFill=a1->getPointer(); + mcIdType *ptToFill=a1->getPointer(); for(int i=0;igetMainTinyInfo(tinyL,tinyD,nbOfArrays,nbOfFields); int tinyLgth=tinyL->length(); - std::vector mainI(tinyLgth); + std::vector mainI(tinyLgth); for(int i=0;igetTinyInfo(i,tinyL,tinyD,tinyS); int tinyLgth2=tinyL->length(); - std::vector tinyLV(tinyLgth2); + std::vector tinyLV(tinyLgth2); for(int j=0;jresizeForUnserialization(tinyLV,array0); if(array0) { fieldPtr->getSerialisationData(i,tinyL); tinyLgth2=tinyL->length(); - int *ptr=array0->getPointer(); + mcIdType *ptr=array0->getPointer(); for(int j=0;j tinyInfo; + std::vector tinyInfo; getPointer()->getTinySerializationIntInformation(tinyInfo); la->length(tinyInfo.size()); for(int i=0;i<(int)tinyInfo.size();i++) diff --git a/src/MEDCouplingCorba/DataArrayIntServant.cxx b/src/MEDCouplingCorba/DataArrayIntServant.cxx index 560779be6..174b52819 100644 --- a/src/MEDCouplingCorba/DataArrayIntServant.cxx +++ b/src/MEDCouplingCorba/DataArrayIntServant.cxx @@ -30,7 +30,7 @@ DataArrayIntServant::DataArrayIntServant(const DataArrayInt *cppPointer):DataArr void DataArrayIntServant::getTinyInfo(SALOME_TYPES::ListOfLong_out la, SALOME_TYPES::ListOfString_out sa) { la=new SALOME_TYPES::ListOfLong; - std::vector tinyInfo; + std::vector tinyInfo; getPointer()->getTinySerializationIntInformation(tinyInfo); la->length(tinyInfo.size()); for(int i=0;i<(int)tinyInfo.size();i++) diff --git a/src/MEDCouplingCorba/MEDCouplingFieldDoubleServant.cxx b/src/MEDCouplingCorba/MEDCouplingFieldDoubleServant.cxx index 3feb67cc7..bb529fed3 100644 --- a/src/MEDCouplingCorba/MEDCouplingFieldDoubleServant.cxx +++ b/src/MEDCouplingCorba/MEDCouplingFieldDoubleServant.cxx @@ -51,7 +51,7 @@ SALOME_TYPES::ListOfString *MEDCouplingFieldDoubleServant::getInfoOnComponents() void MEDCouplingFieldDoubleServant::getTinyInfo(SALOME_TYPES::ListOfLong_out la, SALOME_TYPES::ListOfDouble_out da, SALOME_TYPES::ListOfString_out sa) { la=new SALOME_TYPES::ListOfLong; - std::vector tinyInfo; + std::vector tinyInfo; getPointer()->getTinySerializationIntInformation(tinyInfo); la->length(tinyInfo.size()); for(int i=0;i<(int)tinyInfo.size();i++) @@ -75,16 +75,16 @@ void MEDCouplingFieldDoubleServant::getTinyInfo(SALOME_TYPES::ListOfLong_out la, void MEDCouplingFieldDoubleServant::getSerialisationData(SALOME_TYPES::ListOfLong_out la, SALOME_TYPES::ListOfDouble2_out da2) { std::vector arrays; - DataArrayInt *dataInt; + DataArrayIdType *dataInt; getPointer()->serialize(dataInt,arrays); // la=new SALOME_TYPES::ListOfLong; if(dataInt) { - int lgth=dataInt->getNbOfElems(); - const int *ptr=dataInt->getConstPointer(); + mcIdType lgth=dataInt->getNbOfElems(); + const mcIdType *ptr=dataInt->getConstPointer(); la->length(lgth); - for(int i=0;i tinyInfo; + std::vector tinyInfo; getPointer()->getTinySerializationIntInformation(tinyInfo); la->length(tinyInfo.size()); for(int i=0;i<(int)tinyInfo.size();i++) @@ -55,16 +55,16 @@ void MEDCouplingFieldTemplateServant::getTinyInfo(SALOME_TYPES::ListOfLong_out l void MEDCouplingFieldTemplateServant::getSerialisationData(SALOME_TYPES::ListOfLong_out la) { - DataArrayInt *dataInt; + DataArrayIdType *dataInt; getPointer()->serialize(dataInt); // la=new SALOME_TYPES::ListOfLong; if(dataInt) { - int lgth=dataInt->getNbOfElems(); - const int *ptr=dataInt->getConstPointer(); + mcIdType lgth=dataInt->getNbOfElems(); + const mcIdType *ptr=dataInt->getConstPointer(); la->length(lgth); - for(int i=0;i tinyInfoD; - std::vector tinyInfoI; + std::vector tinyInfoI; std::vector tinyInfoS; getPointer()->getTinySerializationInformation(tinyInfoD,tinyInfoI,tinyInfoS); da->length(tinyInfoD.size()); @@ -58,14 +58,14 @@ void MEDCouplingMeshServant::getTinyInfo(SALOME_TYPES::ListOfDouble_out da, SALO void MEDCouplingMeshServant::getSerialisationData(SALOME_TYPES::ListOfLong_out la, SALOME_TYPES::ListOfDouble_out da) { - DataArrayInt *array1; + DataArrayIdType *array1; DataArrayDouble *array2; getPointer()->serialize(array1,array2); la=new SALOME_TYPES::ListOfLong; if(array1) { int lgth=array1->getNbOfElems(); - const int *data=array1->getConstPointer(); + const mcIdType *data=array1->getConstPointer(); la->length(lgth); for(int i=0;i tinyInfo; + std::vector tinyInfo; std::vector tinyInfo2; int nbOfDiffMeshes, nbOfDiffArr; nbOfFields=getPointer()->getNumberOfFields(); @@ -103,7 +103,7 @@ void MEDCouplingMultiFieldsServant::getTinyInfo(CORBA::Long id, SALOME_TYPES::Li const MEDCouplingFieldDouble *f=getPointer()->getFieldWithId(id); MEDCouplingFieldTemplate *f2=MEDCouplingFieldTemplate::New(*f); la=new SALOME_TYPES::ListOfLong; - std::vector tinyInfo; + std::vector tinyInfo; f2->getTinySerializationIntInformation(tinyInfo); la->length(tinyInfo.size()); for(int i=0;i<(int)tinyInfo.size();i++) @@ -129,16 +129,16 @@ void MEDCouplingMultiFieldsServant::getSerialisationData(CORBA::Long id, SALOME_ { const MEDCouplingFieldDouble *f=getPointer()->getFieldWithId(id); MEDCouplingFieldTemplate *f2=MEDCouplingFieldTemplate::New(*f); - DataArrayInt *dataInt; + DataArrayIdType *dataInt; f2->serialize(dataInt); // la=new SALOME_TYPES::ListOfLong; if(dataInt) { - int lgth=dataInt->getNbOfElems(); - const int *ptr=dataInt->getConstPointer(); + mcIdType lgth=dataInt->getNbOfElems(); + const mcIdType *ptr=dataInt->getConstPointer(); la->length(lgth); - for(int i=0;isetDescription("build1DMesh"); mesh->allocateCells(3); @@ -68,7 +68,7 @@ namespace SALOME_TEST MEDCoupling::MEDCouplingUMesh *MEDCouplingCorbaServBasicsTest::build2DMesh() { double targetCoords[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 }; - int targetConn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + mcIdType targetConn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; MEDCoupling::MEDCouplingUMesh *targetMesh=MEDCoupling::MEDCouplingUMesh::New(); targetMesh->setMeshDimension(2); targetMesh->setName("MyMesh2D"); @@ -93,7 +93,7 @@ namespace SALOME_TEST double targetCoords[81]={ 0., 0., 0., 50., 0., 0. , 200., 0., 0. , 0., 50., 0., 50., 50., 0. , 200., 50., 0., 0., 200., 0., 50., 200., 0. , 200., 200., 0. , 0., 0., 50., 50., 0., 50. , 200., 0., 50. , 0., 50., 50., 50., 50., 50. , 200., 50., 50., 0., 200., 50., 50., 200., 50. , 200., 200., 50. , 0., 0., 200., 50., 0., 200. , 200., 0., 200. , 0., 50., 200., 50., 50., 200. , 200., 50., 200., 0., 200., 200., 50., 200., 200. , 200., 200., 200. }; - int targetConn[64]={0,1,4,3,9,10,13,12, 1,2,5,4,10,11,14,13, 3,4,7,6,12,13,16,15, 4,5,8,7,13,14,17,16, + mcIdType targetConn[64]={0,1,4,3,9,10,13,12, 1,2,5,4,10,11,14,13, 3,4,7,6,12,13,16,15, 4,5,8,7,13,14,17,16, 9,10,13,12,18,19,22,21, 10,11,14,13,19,20,23,22, 12,13,16,15,21,22,25,24, 13,14,17,16,22,23,26,25}; MEDCoupling::MEDCouplingUMesh *targetMesh=MEDCoupling::MEDCouplingUMesh::New(); targetMesh->setMeshDimension(3); @@ -115,7 +115,7 @@ namespace SALOME_TEST MEDCoupling::MEDCouplingUMesh *MEDCouplingCorbaServBasicsTest::build3DSurfMesh() { double targetCoords[27]={-0.3,-0.3,0.5, 0.2,-0.3,1., 0.7,-0.3,1.5, -0.3,0.2,0.5, 0.2,0.2,1., 0.7,0.2,1.5, -0.3,0.7,0.5, 0.2,0.7,1., 0.7,0.7,1.5}; - int targetConn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; + mcIdType targetConn[18]={0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4}; MEDCoupling::MEDCouplingUMesh *targetMesh=MEDCoupling::MEDCouplingUMesh::New(); targetMesh->setMeshDimension(2); targetMesh->setName("MyMesh3DSurf"); @@ -141,7 +141,7 @@ namespace SALOME_TEST MEDCoupling::MEDCouplingUMesh *MEDCouplingCorbaServBasicsTest::build0DMesh() { double targetCoords[27]={-0.3,-0.3,0.5, 0.2,-0.3,1., 0.7,-0.3,1.5, -0.3,0.2,0.5, 0.2,0.2,1., 0.7,0.2,1.5, -0.3,0.7,0.5, 0.2,0.7,1., 0.7,0.7,1.5}; - const int targetConn[]={0,1,2,3,4,5,7,6}; + const mcIdType targetConn[]={0,1,2,3,4,5,7,6}; MEDCoupling::MEDCouplingUMesh *targetMesh=MEDCoupling::MEDCouplingUMesh::New(); targetMesh->setMeshDimension(0); targetMesh->allocateCells(8); @@ -228,7 +228,7 @@ namespace SALOME_TEST targetMesh->setTimeUnit("us"); targetMesh->setName("Example of IMesh"); targetMesh->setDescription("buildIMesh"); - int ns[3]={6,7,8}; + mcIdType ns[3]={6,7,8}; double orig[3]={4.25,3.75,-6.125}; double inter[3]={0.5,0.375,0.75}; targetMesh->setSpaceDimension(3); @@ -252,7 +252,7 @@ namespace SALOME_TEST a1->rearrange(3); targetMesh->setCoords(a1); a1->decrRef(); - int structure[2]={4,5}; + mcIdType structure[2]={4,5}; targetMesh->setNodeGridStructure(structure,structure+2); // targetMesh->checkConsistencyLight(); @@ -268,9 +268,9 @@ namespace SALOME_TEST targetMesh->setDescription("My Description of 1SGTU"); MEDCoupling::DataArrayDouble *a1=MEDCoupling::DataArrayDouble::New(); a1->alloc(10,3); a1->setInfoOnComponent(0,"X1 [m]"); a1->setInfoOnComponent(1,"YY2 [km]"); a1->setInfoOnComponent(2,"ZZZ3 [km]"); const double coords[30]={1.,1.,0.,2.,1.,0.,3.,1.,0.,1.,0.,0.,2.,0.,0.,0.,0.,0.,0.,1.,0.,3.,0.,0.,4.,0.,0.,4.,1.,0.}; - const int conn[16]={6,0,3,5,3,0,1,4,1,2,7,4,8,7,2,9}; + const mcIdType conn[16]={6,0,3,5,3,0,1,4,1,2,7,4,8,7,2,9}; std::copy(coords,coords+30,a1->getPointer()); targetMesh->setCoords(a1); a1->decrRef(); - MEDCoupling::DataArrayInt *a2(MEDCoupling::DataArrayInt::New()); a2->alloc(4*4,1); + MEDCoupling::DataArrayIdType *a2(MEDCoupling::DataArrayIdType::New()); a2->alloc(4*4,1); std::copy(conn,conn+16,a2->getPointer()); targetMesh->setNodalConnectivity(a2); a2->decrRef(); // @@ -287,12 +287,12 @@ namespace SALOME_TEST targetMesh->setDescription("My Description of 1DGTU"); MEDCoupling::DataArrayDouble *a1=MEDCoupling::DataArrayDouble::New(); a1->alloc(10,3); a1->setInfoOnComponent(0,"X1 [m]"); a1->setInfoOnComponent(1,"YY2 [km]"); a1->setInfoOnComponent(2,"ZZZ3 [km]"); const double coords[30]={1.,1.,0.,2.,1.,0.,3.,1.,0.,1.,0.,0.,2.,0.,0.,0.,0.,0.,0.,1.,0.,3.,0.,0.,4.,0.,0.,4.,1.,0.}; - const int conn[15]={6,0,3,5,3,0,1,4,1,2,7,4,8,7,2}; - const int conni[5]={0,4,8,12,15}; + const mcIdType conn[15]={6,0,3,5,3,0,1,4,1,2,7,4,8,7,2}; + const mcIdType conni[5]={0,4,8,12,15}; std::copy(coords,coords+30,a1->getPointer()); targetMesh->setCoords(a1); a1->decrRef(); - MEDCoupling::DataArrayInt *a2(MEDCoupling::DataArrayInt::New()); a2->alloc(15,1); + MEDCoupling::DataArrayIdType *a2(MEDCoupling::DataArrayIdType::New()); a2->alloc(15,1); std::copy(conn,conn+15,a2->getPointer()); - MEDCoupling::DataArrayInt *a3(MEDCoupling::DataArrayInt::New()); a3->alloc(5,1); + MEDCoupling::DataArrayIdType *a3(MEDCoupling::DataArrayIdType::New()); a3->alloc(5,1); std::copy(conni,conni+5,a3->getPointer()); targetMesh->setNodalConnectivity(a2,a3); a2->decrRef(); a3->decrRef(); // diff --git a/src/MEDCouplingCorba_Swig/CMakeLists.txt b/src/MEDCouplingCorba_Swig/CMakeLists.txt index 6284e9f5c..570b7648b 100644 --- a/src/MEDCouplingCorba_Swig/CMakeLists.txt +++ b/src/MEDCouplingCorba_Swig/CMakeLists.txt @@ -28,6 +28,9 @@ INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES SWIG_FLAGS "-py3") SET(SWIG_MODULE_MEDCouplingCorba_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}") +IF(MEDCOUPLING_USE_64BIT_IDS) + STRING(APPEND SWIG_MODULE_MEDCouplingCorba_EXTRA_FLAGS ";-DMEDCOUPLING_USE_64BIT_IDS") +ENDIF(MEDCOUPLING_USE_64BIT_IDS) SET(MEDCouplingCorba_SWIG_DPYS_FILES MEDCouplingCorbaTypemaps.i) diff --git a/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt b/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt index a45af8f40..fa7f4cf23 100644 --- a/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt +++ b/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt @@ -26,6 +26,9 @@ INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(MEDCouplingClient.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(MEDCouplingClient.i PROPERTIES SWIG_FLAGS "-py3") SET(SWIG_MODULE_MEDCouplingClient_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}") +IF(MEDCOUPLING_USE_64BIT_IDS) + STRING(APPEND SWIG_MODULE_MEDCouplingClient_EXTRA_FLAGS ";-DMEDCOUPLING_USE_64BIT_IDS") +ENDIF(MEDCOUPLING_USE_64BIT_IDS) INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} -- 2.30.2