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
# =========================
void MEDCalculatorDBFieldReal::write(const char *fName, bool writeFromScratch) const throw(INTERP_KERNEL::Exception)
{
fetchData();
- std::vector<int> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> 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<const MEDCouplingUMesh *>(field->getMesh());
}
}
WriteUMesh(fName,mesh,writeFromScratch);
- for(std::vector<int>::const_iterator iter=ids.begin();iter!=ids.end();iter++)
+ for(std::vector<std::size_t>::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<int> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
std::vector< MCAuto<MEDCouplingFieldDouble> > fs2(ids.size());
int ii=0;
- for(std::vector<int>::const_iterator iter=ids.begin();iter!=ids.end();iter++)
+ for(std::vector<std::size_t>::const_iterator iter=ids.begin();iter!=ids.end();iter++)
fs2[ii++]=_time_steps[*iter]->getFieldWithoutQuestion(_c_labels.size(),_c);
std::vector<MEDCouplingFieldDouble *> fs(fs2.size());
std::copy(fs2.begin(),fs2.end(),fs.begin());
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<int> ids=_c.getIds(_c_labels.size());
- for(std::vector<int>::const_iterator iter=ids.begin();iter!=ids.end();iter++)
+ std::vector<std::size_t> ids=_c.getIds(_c_labels.size());
+ for(std::vector<std::size_t>::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();
const MEDCalculatorDBFieldReal& MEDCalculatorDBFieldReal::operator=(const MEDCalculatorDBFieldReal& other) throw(INTERP_KERNEL::Exception)
{
checkConsistencyLight(other);
- std::vector<int> ids=_t.getIds(_time_steps.size());
- std::vector<int> ids2=other._t.getIds(other._time_steps.size());
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> 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 !");
MCAuto<MEDCalculatorDBFieldReal> ret=new MEDCalculatorDBFieldReal(_type);
fetchData();
other.fetchData();
- DataArrayInt *cellCor,*nodeCor;
- std::vector<int> ids=_t.getIds(_time_steps.size());
- std::vector<int> ids2=other._t.getIds(other._time_steps.size());
+ DataArrayIdType *cellCor,*nodeCor;
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> 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];
return false;
fetchData();
other.fetchData();
- DataArrayInt *cellCor,*nodeCor;
- std::vector<int> ids=_t.getIds(_time_steps.size());
- std::vector<int> ids2=other._t.getIds(other._time_steps.size());
+ DataArrayIdType *cellCor,*nodeCor;
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> ids2=other._t.getIds(other._time_steps.size());
if(ids.size()!=ids2.size())
return false;
int step=ids[0];
MCAuto<MEDCalculatorDBFieldReal> ret=new MEDCalculatorDBFieldReal(_type);
fetchData();
other.fetchData();
- DataArrayInt *cellCor,*nodeCor;
- std::vector<int> ids=_t.getIds(_time_steps.size());
- std::vector<int> ids2=other._t.getIds(other._time_steps.size());
+ DataArrayIdType *cellCor,*nodeCor;
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> 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];
MCAuto<MEDCalculatorDBFieldReal> ret=new MEDCalculatorDBFieldReal(_type);
fetchData();
other.fetchData();
- DataArrayInt *cellCor,*nodeCor;
- std::vector<int> ids=_t.getIds(_time_steps.size());
- std::vector<int> ids2=other._t.getIds(other._time_steps.size());
+ DataArrayIdType *cellCor,*nodeCor;
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> 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];
MCAuto<MEDCalculatorDBFieldReal> ret=new MEDCalculatorDBFieldReal(_type);
fetchData();
other.fetchData();
- DataArrayInt *cellCor,*nodeCor;
- std::vector<int> ids=_t.getIds(_time_steps.size());
- std::vector<int> ids2=other._t.getIds(other._time_steps.size());
+ DataArrayIdType *cellCor,*nodeCor;
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> 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];
MCAuto<MEDCalculatorDBFieldReal> ret=new MEDCalculatorDBFieldReal(_type);
fetchData();
other.fetchData();
- std::vector<int> ids=_t.getIds(_time_steps.size());
- std::vector<int> ids2=other._t.getIds(other._time_steps.size());
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> 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 !");
MCAuto<MEDCalculatorDBFieldReal> ret=new MEDCalculatorDBFieldReal(_type);
fetchData();
other.fetchData();
- std::vector<int> ids=_t.getIds(_time_steps.size());
- std::vector<int> ids2=other._t.getIds(other._time_steps.size());
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> 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 !");
{
MCAuto<MEDCalculatorDBFieldReal> ret=new MEDCalculatorDBFieldReal(_type);
fetchData();
- std::vector<int> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
unsigned int sz=ids.size();
ret->_time_steps.resize(sz);
for(unsigned int i=0;i<sz;i++)
{
MCAuto<MEDCalculatorDBFieldReal> ret=new MEDCalculatorDBFieldReal(_type);
fetchData();
- std::vector<int> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
unsigned int sz=ids.size();
ret->_time_steps.resize(sz);
for(unsigned int i=0;i<sz;i++)
{
MCAuto<MEDCalculatorDBFieldReal> ret=new MEDCalculatorDBFieldReal(_type);
fetchData();
- std::vector<int> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
unsigned int sz=ids.size();
ret->_time_steps.resize(sz);
for(unsigned int i=0;i<sz;i++)
{
MCAuto<MEDCalculatorDBFieldReal> ret=new MEDCalculatorDBFieldReal(_type);
fetchData();
- std::vector<int> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
unsigned int sz=ids.size();
ret->_time_steps.resize(sz);
for(unsigned int i=0;i<sz;i++)
{
MCAuto<MEDCalculatorDBFieldReal> ret=new MEDCalculatorDBFieldReal(_type);
fetchData();
- std::vector<int> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
unsigned int sz=ids.size();
ret->_time_steps.resize(sz);
for(unsigned int i=0;i<sz;i++)
{
MCAuto<MEDCalculatorDBFieldReal> ret=new MEDCalculatorDBFieldReal(_type);
fetchData();
- std::vector<int> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
unsigned int sz=ids.size();
ret->_time_steps.resize(sz);
for(unsigned int i=0;i<sz;i++)
{
MCAuto<MEDCalculatorDBFieldReal> ret=new MEDCalculatorDBFieldReal(_type);
fetchData();
- std::vector<int> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
unsigned int sz=ids.size();
ret->_time_steps.resize(sz);
for(unsigned int i=0;i<sz;i++)
{
MCAuto<MEDCalculatorDBFieldReal> ret=new MEDCalculatorDBFieldReal(_type);
fetchData();
- std::vector<int> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
unsigned int sz=ids.size();
ret->_time_steps.resize(sz);
for(unsigned int i=0;i<sz;i++)
void MEDCalculatorDBFieldReal::applyFunc(const char *func) throw(INTERP_KERNEL::Exception)
{
fetchData();
- std::vector<int> ids=_t.getIds(_time_steps.size());
- for(std::vector<int>::const_iterator it=ids.begin();it!=ids.end();it++)
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
+ for(std::vector<std::size_t>::const_iterator it=ids.begin();it!=ids.end();it++)
_time_steps[*it]->applyFunc(func,_c_labels.size(),_c);
}
MCAuto<MEDCalculatorDBFieldReal> ret=new MEDCalculatorDBFieldReal(_type);
ret->_p=_p;
ret->_c_labels.resize(_c.getSize(_c_labels.size()));
- std::vector<int> stps=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> stps=_t.getIds(_time_steps.size());
int stepSize=stps.size();
ret->_time_steps.resize(stepSize);
if(stepSize==0)
void MEDCalculatorDBFieldReal::fetchData() const throw(INTERP_KERNEL::Exception)
{
std::vector<std::pair<int,int> > idstoFetch;
- std::vector<int> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
int sz=ids.size();
- std::vector<int> idsInGlobalToFetch;
+ std::vector<std::size_t> idsInGlobalToFetch;
for(int i=0;i<sz;i++)
{
MCAuto<MEDCalculatorDBSliceField> elt=_time_steps[ids[i]];
int MEDCalculatorDBFieldReal::getNumberOfFetchedSteps() const
{
int ret=0;
- std::vector<int> ids=_t.getIds(_time_steps.size());
- for(std::vector<int>::const_iterator it=ids.begin();it!=ids.end();it++)
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
+ for(std::vector<std::size_t>::const_iterator it=ids.begin();it!=ids.end();it++)
if(_time_steps[*it]->isFetched())
ret++;
return ret;
std::vector<MEDCouplingFieldDouble *> MEDCalculatorDBFieldReal::getFields() const throw(INTERP_KERNEL::Exception)
{
fetchData();
- std::vector<int> ids=_t.getIds(_time_steps.size());
+ std::vector<std::size_t> ids=_t.getIds(_time_steps.size());
std::vector<MEDCouplingFieldDouble *> ret(ids.size());
int i=0;
- for(std::vector<int>::const_iterator it=ids.begin();it!=ids.end();it++,i++)
+ for(std::vector<std::size_t>::const_iterator it=ids.begin();it!=ids.end();it++,i++)
ret[i]=_time_steps[*it]->getFieldWithoutQuestion(_c_labels.size(),_c);
return ret;
}
_end=TraducePyVal(val);
}
-std::vector<int> MEDCalculatorDBRangeSelection::getIds(int lgth) const throw(INTERP_KERNEL::Exception)
+std::vector<std::size_t> MEDCalculatorDBRangeSelection::getIds(int lgth) const throw(INTERP_KERNEL::Exception)
{
if(_start>=lgth || _start<0)
{
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<int> ret(trueEnd-_start);
+ std::vector<std::size_t> ret(trueEnd-_start);
int j=0;
for(int i=_start;i<trueEnd;i++,j++)
ret[j]=i;
void setPyEnd(int val);
MEDCalculatorDBRangeSelection& operator=(const char *v) throw(INTERP_KERNEL::Exception);
MEDCalculatorDBRangeSelection& operator=(int v) throw(INTERP_KERNEL::Exception);
- std::vector<int> getIds(int lgth) const throw(INTERP_KERNEL::Exception);
+ std::vector<std::size_t> getIds(int lgth) const throw(INTERP_KERNEL::Exception);
int getSize(int lgth) const throw(INTERP_KERNEL::Exception);
bool isAll() const;
void setAll();
*/
MEDCouplingFieldDouble *MEDCalculatorDBSliceField::getFieldWithoutQuestion(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const
{
- std::vector<int> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
return _field->keepSelectedComponents(tIds);
}
void MEDCalculatorDBSliceField::assign(const MEDCalculatorDBSliceField* other, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
int sizeCOther, const MEDCalculatorDBRangeSelection& otherC)
{
- std::vector<int> tIds=thisC.getIds(sizeCThis);
- std::vector<int> oIds=otherC.getIds(sizeCOther);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> oIds=otherC.getIds(sizeCOther);
MCAuto<MEDCouplingFieldDouble> 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<int> tIds=thisC.getIds(sizeCThis);
- std::vector<int> oIds=otherC.getIds(sizeCOther);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> oIds=otherC.getIds(sizeCOther);
MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MCAuto<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
f2->setMesh(f1->getMesh());
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<int> tIds=thisC.getIds(sizeCThis);
- std::vector<int> oIds=otherC.getIds(sizeCOther);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> oIds=otherC.getIds(sizeCOther);
MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MCAuto<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
f2->setMesh(f1->getMesh());
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<int> tIds=thisC.getIds(sizeCThis);
- std::vector<int> oIds=otherC.getIds(sizeCOther);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> oIds=otherC.getIds(sizeCOther);
MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MCAuto<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
f2->setMesh(f1->getMesh());
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<int> tIds=thisC.getIds(sizeCThis);
- std::vector<int> oIds=otherC.getIds(sizeCOther);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> oIds=otherC.getIds(sizeCOther);
MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MCAuto<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
f2->setMesh(f1->getMesh());
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::dot(const MEDCalculatorDBSliceField* other, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const
{
- std::vector<int> tIds=thisC.getIds(sizeCThis);
- std::vector<int> oIds=otherC.getIds(sizeCOther);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> oIds=otherC.getIds(sizeCOther);
MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MCAuto<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
f2->setMesh(f1->getMesh());
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::crossProduct(const MEDCalculatorDBSliceField* other, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC,
int sizeCOther, const MEDCalculatorDBRangeSelection& otherC) const
{
- std::vector<int> tIds=thisC.getIds(sizeCThis);
- std::vector<int> oIds=otherC.getIds(sizeCOther);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> oIds=otherC.getIds(sizeCOther);
MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MCAuto<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
f2->setMesh(f1->getMesh());
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::doublyContractedProduct(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
- std::vector<int> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->doublyContractedProduct();
return new MEDCalculatorDBSliceField(f2);
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::determinant(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
- std::vector<int> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->determinant();
return new MEDCalculatorDBSliceField(f2);
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::eigenValues(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
- std::vector<int> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->eigenValues();
return new MEDCalculatorDBSliceField(f2);
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::eigenVectors(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
- std::vector<int> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->eigenVectors();
return new MEDCalculatorDBSliceField(f2);
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::inverse(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
- std::vector<int> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->inverse();
return new MEDCalculatorDBSliceField(f2);
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::trace(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
- std::vector<int> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->trace();
return new MEDCalculatorDBSliceField(f2);
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::deviator(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
- std::vector<int> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->deviator();
return new MEDCalculatorDBSliceField(f2);
MEDCalculatorDBSliceField *MEDCalculatorDBSliceField::magnitude(int sizeCThis, const MEDCalculatorDBRangeSelection& thisC) const throw(INTERP_KERNEL::Exception)
{
- std::vector<int> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MEDCouplingFieldDouble *f2=f1->magnitude();
return new MEDCalculatorDBSliceField(f2);
void MEDCalculatorDBSliceField::applyFunc(const char *func, int sizeCThis, const MEDCalculatorDBRangeSelection& thisC)
{
- std::vector<int> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
MCAuto<MEDCouplingFieldDouble> 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<int> tIds=thisC.getIds(sizeCThis);
- std::vector<int> oIds=otherC.getIds(sizeCOther);
+ std::vector<std::size_t> tIds=thisC.getIds(sizeCThis);
+ std::vector<std::size_t> oIds=otherC.getIds(sizeCOther);
MCAuto<MEDCouplingFieldDouble> f1=_field->keepSelectedComponents(tIds);
MCAuto<MEDCouplingFieldDouble> f2=other->_field->keepSelectedComponents(oIds);
f2->setMesh(f1->getMesh());
//
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,
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:
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()
void MEDCoupling::MEDCalculatorBasicsTest::testRangeSelection1()
{
MEDCalculatorDBRangeSelection sel1(":");
- std::vector<int> v=sel1.getIds(6);
+ std::vector<std::size_t> 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()));
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);
dadPtr->getTinyInfo(tinyL,tinyS);
DataArrayDouble *ret=DataArrayDouble::New();
int tinyLgth=tinyL->length();
- std::vector<int> v1(tinyLgth);
+ std::vector<mcIdType> v1(tinyLgth);
for(int j=0;j<tinyLgth;j++)
v1[j]=(*tinyL)[j];
delete tinyL; tinyL=0;
dadPtr->getTinyInfo(tinyL,tinyS);
DataArrayInt *ret=DataArrayInt::New();
int tinyLgth=tinyL->length();
- std::vector<int> v1(tinyLgth);
+ std::vector<mcIdType> v1(tinyLgth);
for(int j=0;j<tinyLgth;j++)
v1[j]=(*tinyL)[j];
delete tinyL; tinyL=0;
//1st CORBA call : getting all tiny info of all types (int, double string).
fieldPtr->getTinyInfo(tinyL,tinyD,tinyS);
int tinyLgth=tinyL->length();
- std::vector<int> tinyLV(tinyLgth);
+ std::vector<mcIdType> tinyLV(tinyLgth);
for(int i=0;i<tinyLgth;i++)
tinyLV[i]=(*tinyL)[i];
delete tinyL;
CORBA::release(meshPtr);
ret->setMesh(mesh);
mesh->decrRef();
- DataArrayInt *array0;
+ DataArrayIdType *array0;
std::vector<DataArrayDouble *> arrays;
ret->resizeForUnserialization(tinyLV,array0,arrays);
SALOME_TYPES::ListOfLong *bigArr0;
fieldPtr->getSerialisationData(bigArr0,bigArr);
if(bigArr0->length()!=0)
{
- int *pt=array0->getPointer();
- int lgth=array0->getNbOfElems();
- for(int i=0;i<lgth;i++)
+ mcIdType *pt=array0->getPointer();
+ mcIdType lgth=array0->getNbOfElems();
+ for(mcIdType i=0;i<lgth;i++)
pt[i]=(*bigArr0)[i];
}
delete bigArr0;
CORBA::Long nbOfFields;
CORBA::Long nbOfMeshes=_field_ptr->getMainTinyInfo(tinyL,tinyD,nbOfArrays,nbOfFields);
int tinyLgth=tinyL->length();
- std::vector<int> mainI(tinyLgth);
+ std::vector<mcIdType> mainI(tinyLgth);
for(int i=0;i<tinyLgth;i++)
mainI[i]=(*tinyL)[i];
delete tinyL; tinyL=0;
{
_field_ptr->getTinyInfo(i,tinyL,tinyD,tinyS);
int tinyLgth=tinyL->length();
- std::vector<int> tinyLV(tinyLgth);
+ std::vector<mcIdType> tinyLV(tinyLgth);
for(int j=0;j<tinyLgth;j++)
tinyLV[j]=(*tinyL)[j];
delete tinyL; tinyL=0;
TypeOfField type=(TypeOfField) tinyLV[0];
MEDCouplingFieldTemplate *f1=MEDCouplingFieldTemplate::New(type);
//
- DataArrayInt *array0;
+ DataArrayIdType *array0;
f1->resizeForUnserialization(tinyLV,array0);
if(array0)
{
_field_ptr->getSerialisationData(i,tinyL);
tinyLgth=tinyL->length();
- int *ptr=array0->getPointer();
+ mcIdType *ptr=array0->getPointer();
for(int j=0;j<tinyLgth;j++)
ptr[j]=(*tinyL)[j];
delete tinyL; tinyL=0;
//1st CORBA call : getting all tiny info of all types (int, double string).
fieldPtr->getTinyInfo(tinyL,tinyD,tinyS);
int tinyLgth=tinyL->length();
- std::vector<int> tinyLV(tinyLgth);
+ std::vector<mcIdType> tinyLV(tinyLgth);
for(int i=0;i<tinyLgth;i++)
tinyLV[i]=(*tinyL)[i];
delete tinyL;
CORBA::release(meshPtr);
ret->setMesh(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;i<lgth;i++)
+ mcIdType *pt=array0->getPointer();
+ mcIdType lgth=array0->getNbOfElems();
+ for(mcIdType i=0;i<lgth;i++)
pt[i]=(*bigArr0)[i];
}
delete bigArr0;
SALOME_TYPES::ListOfString *tinyS;
meshPtr->getTinyInfo(tinyD,tinyI,tinyS);
int tinyLgth=tinyI->length();
- std::vector<int> tinyV(tinyLgth);
+ std::vector<mcIdType> tinyV(tinyLgth);
for(int i=0;i<tinyLgth;i++)
tinyV[i]=(*tinyI)[i];
int tinyLgth2=tinyD->length();
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.
SALOME_TYPES::ListOfDouble *a2Corba;
meshPtr->getSerialisationData(a1Corba,a2Corba);
int myLgth=a1Corba->length();
- int *ptToFill=a1->getPointer();
+ mcIdType *ptToFill=a1->getPointer();
for(int i=0;i<myLgth;i++)
ptToFill[i]=(*a1Corba)[i];
delete a1Corba;
CORBA::Long nbOfFields;
CORBA::Long nbOfMeshes=fieldPtr->getMainTinyInfo(tinyL,tinyD,nbOfArrays,nbOfFields);
int tinyLgth=tinyL->length();
- std::vector<int> mainI(tinyLgth);
+ std::vector<mcIdType> mainI(tinyLgth);
for(int i=0;i<tinyLgth;i++)
mainI[i]=(*tinyL)[i];
delete tinyL; tinyL=0;
{
fieldPtr->getTinyInfo(i,tinyL,tinyD,tinyS);
int tinyLgth2=tinyL->length();
- std::vector<int> tinyLV(tinyLgth2);
+ std::vector<mcIdType> tinyLV(tinyLgth2);
for(int j=0;j<tinyLgth2;j++)
tinyLV[j]=(*tinyL)[j];
delete tinyL; tinyL=0;
TypeOfField type=(TypeOfField) tinyLV[0];
MEDCouplingFieldTemplate *f1=MEDCouplingFieldTemplate::New(type);
//
- DataArrayInt *array0;
+ DataArrayIdType *array0;
f1->resizeForUnserialization(tinyLV,array0);
if(array0)
{
fieldPtr->getSerialisationData(i,tinyL);
tinyLgth2=tinyL->length();
- int *ptr=array0->getPointer();
+ mcIdType *ptr=array0->getPointer();
for(int j=0;j<tinyLgth2;j++)
ptr[j]=(*tinyL)[j];
delete tinyL; tinyL=0;
void DataArrayDoubleServant::getTinyInfo(SALOME_TYPES::ListOfLong_out la, SALOME_TYPES::ListOfString_out sa)
{
la=new SALOME_TYPES::ListOfLong;
- std::vector<int> tinyInfo;
+ std::vector<mcIdType> tinyInfo;
getPointer()->getTinySerializationIntInformation(tinyInfo);
la->length(tinyInfo.size());
for(int i=0;i<(int)tinyInfo.size();i++)
void DataArrayIntServant::getTinyInfo(SALOME_TYPES::ListOfLong_out la, SALOME_TYPES::ListOfString_out sa)
{
la=new SALOME_TYPES::ListOfLong;
- std::vector<int> tinyInfo;
+ std::vector<mcIdType> tinyInfo;
getPointer()->getTinySerializationIntInformation(tinyInfo);
la->length(tinyInfo.size());
for(int i=0;i<(int)tinyInfo.size();i++)
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<int> tinyInfo;
+ std::vector<mcIdType> tinyInfo;
getPointer()->getTinySerializationIntInformation(tinyInfo);
la->length(tinyInfo.size());
for(int i=0;i<(int)tinyInfo.size();i++)
void MEDCouplingFieldDoubleServant::getSerialisationData(SALOME_TYPES::ListOfLong_out la, SALOME_TYPES::ListOfDouble2_out da2)
{
std::vector<DataArrayDouble *> 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<lgth;i++)
+ for(mcIdType i=0;i<lgth;i++)
(*la)[i]=ptr[i];
}
else
void MEDCouplingFieldTemplateServant::getTinyInfo(SALOME_TYPES::ListOfLong_out la, SALOME_TYPES::ListOfDouble_out da, SALOME_TYPES::ListOfString_out sa)
{
la=new SALOME_TYPES::ListOfLong;
- std::vector<int> tinyInfo;
+ std::vector<mcIdType> tinyInfo;
getPointer()->getTinySerializationIntInformation(tinyInfo);
la->length(tinyInfo.size());
for(int i=0;i<(int)tinyInfo.size();i++)
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<lgth;i++)
+ for(mcIdType i=0;i<lgth;i++)
(*la)[i]=ptr[i];
}
else
da=new SALOME_TYPES::ListOfDouble;
la=new SALOME_TYPES::ListOfLong;
std::vector<double> tinyInfoD;
- std::vector<int> tinyInfoI;
+ std::vector<mcIdType> tinyInfoI;
std::vector<std::string> tinyInfoS;
getPointer()->getTinySerializationInformation(tinyInfoD,tinyInfoI,tinyInfoS);
da->length(tinyInfoD.size());
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<lgth;i++)
(*la)[i]=data[i];
CORBA::Long MEDCouplingMultiFieldsServant::getMainTinyInfo(SALOME_TYPES::ListOfLong_out la, SALOME_TYPES::ListOfDouble_out da, CORBA::Long& nbOfArrays, CORBA::Long& nbOfFields)
{
- std::vector<int> tinyInfo;
+ std::vector<mcIdType> tinyInfo;
std::vector<double> tinyInfo2;
int nbOfDiffMeshes, nbOfDiffArr;
nbOfFields=getPointer()->getNumberOfFields();
const MEDCouplingFieldDouble *f=getPointer()->getFieldWithId(id);
MEDCouplingFieldTemplate *f2=MEDCouplingFieldTemplate::New(*f);
la=new SALOME_TYPES::ListOfLong;
- std::vector<int> tinyInfo;
+ std::vector<mcIdType> tinyInfo;
f2->getTinySerializationIntInformation(tinyInfo);
la->length(tinyInfo.size());
for(int i=0;i<(int)tinyInfo.size();i++)
{
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;i<lgth;i++)
+ for(mcIdType i=0;i<lgth;i++)
(*la)[i]=ptr[i];
}
else
MEDCoupling::MEDCouplingUMesh *MEDCouplingCorbaServBasicsTest::build1DMesh()
{
double coords[4]={ 0.0, 0.3, 0.75, 1.0 };
- int conn[2*3]={ 0,1, 1,2, 2,3 };
+ mcIdType conn[2*3]={ 0,1, 1,2, 2,3 };
MEDCoupling::MEDCouplingUMesh *mesh=MEDCoupling::MEDCouplingUMesh::New("1DMeshForCorba",1);
mesh->setDescription("build1DMesh");
mesh->allocateCells(3);
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");
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);
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");
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);
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);
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();
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();
//
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();
//
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)
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}