template<class T>
void MemArray<T>::pack() const
{
- if(_nb_of_elem>=0)
- (const_cast<MemArray<T> * >(this))->reserve(_nb_of_elem);
+ (const_cast<MemArray<T> * >(this))->reserve(_nb_of_elem);
}
template<class T>
void MemArray<T>::alloc(std::size_t nbOfElements)
{
destroy();
- if(nbOfElements<0)
- throw INTERP_KERNEL::Exception("MemArray::alloc : request for negative length of data !");
_nb_of_elem=nbOfElements;
_nb_of_elem_alloc=nbOfElements;
_pointer.setInternal((T*)malloc(_nb_of_elem_alloc*sizeof(T)));
template<class T>
void MemArray<T>::reAlloc(std::size_t newNbOfElements)
{
- if(newNbOfElements<0)
- throw INTERP_KERNEL::Exception("MemArray::reAlloc : request for negative length of data !");
if(_nb_of_elem==newNbOfElements)
return ;
T *pointer=(T*)malloc(newNbOfElements*sizeof(T));
{
}
-MEDCouplingMesh::MEDCouplingMesh(const MEDCouplingMesh& other):_name(other._name),_description(other._description),
+MEDCouplingMesh::MEDCouplingMesh(const MEDCouplingMesh& other):RefCountObject(other),_name(other._name),_description(other._description),
_time(other._time),_iteration(other._iteration),
_order(other._order),_time_unit(other._time_unit)
{
/*!
* Performs deepCpy.
*/
-MEDCouplingMultiFields::MEDCouplingMultiFields(const MEDCouplingMultiFields& other)
+MEDCouplingMultiFields::MEDCouplingMultiFields(const MEDCouplingMultiFields& other):RefCountObject(other)
{
std::size_t sz=other._fs.size();
_fs.resize(sz);
local_group=_target_group;
else
throw INTERP_KERNEL::Exception("Invalid procgroup for field attachment to DEC");
- ParaMESH *paramesh=new ParaMESH((MEDCouplingPointSet *)field->getMesh(),*local_group,field->getMesh()->getName());
+ ParaMESH *paramesh=new ParaMESH(static_cast<MEDCouplingPointSet *>(const_cast<MEDCouplingMesh *>(field->getMesh())),*local_group,field->getMesh()->getName());
ParaFIELD *tmp=new ParaFIELD(field, paramesh, *local_group);
tmp->setOwnSupport(true);
attachLocalField(tmp,true);
const ICoCo::TrioField* triofield=dynamic_cast<const ICoCo::TrioField*> (field);
if (triofield !=0)
{
+ /* Strange part of code localgroup not used !
ProcessorGroup* localgroup;
if (_source_group->containsMyRank())
localgroup=_source_group;
else
- localgroup=_target_group;
+ localgroup=_target_group;*/
delete _icoco_field;
_icoco_field=new ICoCo::MEDField(*const_cast<ICoCo::TrioField* >(triofield));
distant_mesh->unserialization(tinyInfoDistantD,tinyInfoDistant,v1Distant,v2Distant,unusedTinyDistantSts);
//
distant_ids_recv=new int[tinyInfoDistant.back()];
- comm_interface.sendRecv((void *)distant_ids_send->getConstPointer(),tinyInfoLocal.back(), MPI_INT,
+ comm_interface.sendRecv(const_cast<void *>(reinterpret_cast<const void *>(distant_ids_send->getConstPointer())),tinyInfoLocal.back(), MPI_INT,
iprocdistant_in_union, 1113,
distant_ids_recv,tinyInfoDistant.back(), MPI_INT,
iprocdistant_in_union,1113,
const vector<double>& valued=partialSumRelToDistantIds[procId];
int lgth=eltIds.size();
comm.send(&lgth,1,MPI_INT,*iter,1114,*_comm);
- comm.send((void *)&eltIds[0],lgth,MPI_INT,*iter,1115,*_comm);
- comm.send((void *)&valued[0],lgth,MPI_DOUBLE,*iter,1116,*_comm);
+ comm.send(const_cast<void *>(reinterpret_cast<const void *>(&eltIds[0])),lgth,MPI_INT,*iter,1115,*_comm);
+ comm.send(const_cast<void *>(reinterpret_cast<const void *>(&valued[0])),lgth,MPI_DOUBLE,*iter,1116,*_comm);
}
}
const vector<int>& eltIds=distantLocEltIds[procId];
int lgth=eltIds.size();
comm.send(&lgth,1,MPI_INT,*iter,1121,*_comm);
- comm.send((void *)&eltIds[0],lgth,MPI_INT,*iter,1122,*_comm);
+ comm.send(const_cast<void *>(reinterpret_cast<const void *>(&eltIds[0])),lgth,MPI_INT,*iter,1122,*_comm);
}
}
for(vector<int>::const_iterator iter=_distant_proc_ids.begin();iter!=_distant_proc_ids.end();iter++,procId++)
{
comm.send(&lgth,1,MPI_INT,*iter,1124,*_comm);
- comm.send((void*)&distantGlobIds[0],lgth,MPI_INT,*iter,1125,*_comm);
- comm.send((void*)&sum[0],lgth,MPI_DOUBLE,*iter,1126,*_comm);
+ comm.send(const_cast<void *>(reinterpret_cast<const void *>(&distantGlobIds[0])),lgth,MPI_INT,*iter,1125,*_comm);
+ comm.send(const_cast<void *>(reinterpret_cast<const void *>(&sum[0])),lgth,MPI_DOUBLE,*iter,1126,*_comm);
}
}
int lgth=distantGlobIds.size();
for(vector<int>::const_iterator iter=_distant_proc_ids.begin();iter!=_distant_proc_ids.end();iter++,procId++)
{
- comm.send(&lgth,1,MPI_INT,*iter,1128,*_comm);
- comm.send((void*)&distantGlobIds[0],lgth,MPI_INT,*iter,1129,*_comm);
+ comm.send(const_cast<void *>(reinterpret_cast<const void *>(&lgth)),1,MPI_INT,*iter,1128,*_comm);
+ comm.send(const_cast<void *>(reinterpret_cast<const void *>(&distantGlobIds[0])),lgth,MPI_INT,*iter,1129,*_comm);
}
}
{
const std::vector<int>& vals=_ids_per_working_proc3[procId];
int size=vals.size();
- comm.send((void *)&size,1,MPI_INT,*iter,1130,*_comm);
- comm.send((void *)&vals[0],size,MPI_INT,*iter,1131,*_comm);
+ comm.send(const_cast<void *>(reinterpret_cast<const void *>(&size)),1,MPI_INT,*iter,1130,*_comm);
+ comm.send(const_cast<void *>(reinterpret_cast<const void *>(&vals[0])),size,MPI_INT,*iter,1131,*_comm);
}
}
interpMethod+=srcMeth;
//creating the interpolator structure
vector<map<int,double> > surfaces;
- int colSize=0;
//computation of the intersection volumes between source and target elements
MEDCouplingUMesh *distant_supportC=dynamic_cast<MEDCouplingUMesh *>(&distant_support);
MEDCouplingUMesh *source_supportC=dynamic_cast<MEDCouplingUMesh *>(_source_support);
{
MEDCouplingNormalizedUnstructuredMesh<2,2> source_mesh_wrapper(source_supportC);
INTERP_KERNEL::Interpolation2D interpolation(*this);
- colSize=interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth.c_str());
+ interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth.c_str());
}
else if(source_supportC->getMeshDimension()==3 && source_supportC->getSpaceDimension()==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(source_supportC);
INTERP_KERNEL::Interpolation3D interpolation(*this);
- colSize=interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth.c_str());
+ interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth.c_str());
}
else if(source_supportC->getMeshDimension()==2 && source_supportC->getSpaceDimension()==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,2> source_mesh_wrapper(source_supportC);
INTERP_KERNEL::Interpolation3DSurf interpolation(*this);
- colSize=interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth.c_str());
+ interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth.c_str());
}
else
throw INTERP_KERNEL::Exception("No para interpolation available for the given mesh and space dimension of source mesh to -1D targetMesh");
{
MEDCouplingNormalizedUnstructuredMesh<2,2> distant_mesh_wrapper(distant_supportC);
INTERP_KERNEL::Interpolation2D interpolation(*this);
- colSize=interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth.c_str());
+ interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth.c_str());
}
else if(distant_supportC->getMeshDimension()==3 && distant_supportC->getSpaceDimension()==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,3> distant_mesh_wrapper(distant_supportC);
INTERP_KERNEL::Interpolation3D interpolation(*this);
- colSize=interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth.c_str());
+ interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth.c_str());
}
else if(distant_supportC->getMeshDimension()==2 && distant_supportC->getSpaceDimension()==3)
{
MEDCouplingNormalizedUnstructuredMesh<3,2> distant_mesh_wrapper(distant_supportC);
INTERP_KERNEL::Interpolation3DSurf interpolation(*this);
- colSize=interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth.c_str());
+ interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth.c_str());
}
else
throw INTERP_KERNEL::Exception("No para interpolation available for the given mesh and space dimension of distant mesh to -1D sourceMesh");
MEDCouplingNormalizedUnstructuredMesh<3,3> target_wrapper(distant_supportC);
MEDCouplingNormalizedUnstructuredMesh<3,3> source_wrapper(source_supportC);
INTERP_KERNEL::Interpolation3D2D interpolator (*this);
- colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
+ interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<2,2> target_wrapper(distant_supportC);
MEDCouplingNormalizedUnstructuredMesh<2,2> source_wrapper(source_supportC);
INTERP_KERNEL::Interpolation2D1D interpolator (*this);
- colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
+ interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<1,1> source_wrapper(source_supportC);
INTERP_KERNEL::Interpolation1D interpolation(*this);
- colSize=interpolation.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
+ interpolation.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<2,1> source_wrapper(source_supportC);
INTERP_KERNEL::Interpolation2DCurve interpolation(*this);
- colSize=interpolation.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
+ interpolation.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<3,2> source_wrapper(source_supportC);
INTERP_KERNEL::Interpolation3DSurf interpolator (*this);
- colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
+ interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<2,2> source_wrapper(source_supportC);
INTERP_KERNEL::Interpolation2D interpolator (*this);
- colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
+ interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
MEDCouplingNormalizedUnstructuredMesh<3,3> source_wrapper(source_supportC);
INTERP_KERNEL::Interpolation3D interpolator (*this);
- colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
+ interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str());
target_wrapper.releaseTempArrays();
source_wrapper.releaseTempArrays();
}
{
procs.insert(i) ;
}
- MPIProcessorGroup *mpilg = (MPIProcessorGroup *)&source_group;
+ MPIProcessorGroup *mpilg = static_cast<MPIProcessorGroup *>(const_cast<ProcessorGroup *>(&source_group));
_MPI_union_group = new ParaMEDMEM::MPIProcessorGroup( union_group->getCommInterface(),procs,mpilg->getWorldComm());
delete union_group ;
_my_rank = _MPI_union_group->myRank() ;
comInterface.send(v1Local->getPointer(),v1Local->getNbOfElems(),MPI_INT,procId,1142,*comm);
comInterface.send(v2Local->getPointer(),v2Local->getNbOfElems(),MPI_DOUBLE,procId,1143,*comm);
//finished for mesh, ids now
- comInterface.send((int *)idsToSend->getConstPointer(),lgth[1],MPI_INT,procId,1144,*comm);
+ comInterface.send(const_cast<int *>(idsToSend->getConstPointer()),lgth[1],MPI_INT,procId,1144,*comm);
//
v1Local->decrRef();
v2Local->decrRef();