-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2024 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
{
if(iter->count(i) != 0.0)
{
- std::map<int, double>::const_iterator iter2 = iter->find(i);
+ std::map<mcIdType, double>::const_iterator iter2 = iter->find(i);
vol += fabs(iter2->second);
}
}
double MeshTestToolkit<SPACEDIM,MESHDIM>::sumCol(const IntersectionMatrix& m, int i) const
{
double vol = 0.0;
- const std::map<int, double>& col = m[i];
- for(std::map<int, double>::const_iterator iter = col.begin() ; iter != col.end() ; ++iter)
+ const std::map<mcIdType, double>& col = m[i];
+ for(std::map<mcIdType, double>::const_iterator iter = col.begin() ; iter != col.end() ; ++iter)
{
vol += fabs(iter->second);
}
template <int SPACEDIM, int MESHDIM>
void MeshTestToolkit<SPACEDIM,MESHDIM>::getVolumes(MEDCoupling::MEDCouplingUMesh& mesh, double *tab) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> vol=mesh.getMeasureField(true);
+ MCAuto<MEDCouplingFieldDouble> vol=mesh.getMeasureField(true);
std::copy(vol->getArray()->begin(),vol->getArray()->end(),tab);
}
std::vector<double> volumes;
for(IntersectionMatrix::const_iterator iter = m.begin() ; iter != m.end() ; ++iter)
{
- for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<mcIdType, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
volumes.push_back(fabs(iter2->second));
}
int i = 0;
for(IntersectionMatrix::const_iterator iter = m1.begin() ; iter != m1.end() ; ++iter)
{
- for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<mcIdType, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
- int j = iter2->first;
+ mcIdType j = iter2->first;
if(m2.at(j).count(i) == 0)
{
if(!epsilonEqual(iter2->second, 0.0, _precision))
for(IntersectionMatrix::const_iterator iter = m1.begin() ; iter != m1.end() ; ++iter)
{
- for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<mcIdType, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
- int j = iter2->first;
+ mcIdType j = iter2->first;
const double v1 = fabs(iter2->second);
//if(m2[j - 1].count(i+1) > 0)
// {
- std::map<int, double> theMap = m2.at(j);
+ std::map<mcIdType, double> theMap = m2.at(j);
const double v2 = fabs(theMap[i]);
if(v1 != v2)
{
bool isDiagonal = true;
for(IntersectionMatrix::const_iterator iter = m.begin() ; iter != m.end() ; ++iter)
{
- for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<mcIdType, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
- int j = iter2->first;
+ mcIdType j = iter2->first;
const double vol = iter2->second;
if(vol != 0.0 && (i != j))
{
std::cout << "Intersection matrix is " << std::endl;
for(IntersectionMatrix::const_iterator iter = m.begin() ; iter != m.end() ; ++iter)
{
- for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
+ for(std::map<mcIdType, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
std::cout << "V(" << i << ", " << iter2->first << ") = " << iter2->second << std::endl;
}
LOG(1, std::endl << "=== -> intersecting src = " << mesh1path << ", target = " << mesh2path );
LOG(5, "Loading " << mesh1 << " from " << mesh1path);
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> sMeshML=MEDFileUMesh::New(INTERP_TEST::getResourceFile(mesh1path).c_str(),mesh1);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> sMesh=sMeshML->getMeshAtLevel(0);
+ MCAuto<MEDFileUMesh> sMeshML=MEDFileUMesh::New(INTERP_TEST::getResourceFile(mesh1path).c_str(),mesh1);
+ MCAuto<MEDCouplingUMesh> sMesh=sMeshML->getMeshAtLevel(0);
LOG(5, "Loading " << mesh2 << " from " << mesh2path);
- MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> tMeshML=MEDFileUMesh::New(INTERP_TEST::getResourceFile(mesh2path).c_str(),mesh2);
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tMesh=tMeshML->getMeshAtLevel(0);
+ MCAuto<MEDFileUMesh> tMeshML=MEDFileUMesh::New(INTERP_TEST::getResourceFile(mesh2path).c_str(),mesh2);
+ MCAuto<MEDCouplingUMesh> tMesh=tMeshML->getMeshAtLevel(0);
MEDCouplingNormalizedUnstructuredMesh<SPACEDIM,MESHDIM> sMesh_wrapper(sMesh);
MEDCouplingNormalizedUnstructuredMesh<SPACEDIM,MESHDIM> tMesh_wrapper(tMesh);
* @param mesh2path the path to the file containing the target mesh, relative to {$MEDCOUPLING_ROOT_DIR}/share/resources/med/
* @param mesh2 the name of the target mesh
* @param correctVol the total volume of the intersection of the two meshes
- * @param prec maximum relative error to be tolerated in volume comparisions
+ * @param prec maximum relative error to be tolerated in volume comparisons
* @param doubleTest if false, only the test with mesh 1 as the source mesh and mesh 2 as the target mesh will be performed
*
*/
* @param mesh1 the name of the source mesh
* @param mesh2 the name of the target mesh
* @param correctVol the total volume of the intersection of the two meshes
- * @param prec maximum relative error to be tolerated in volume comparisions
+ * @param prec maximum relative error to be tolerated in volume comparisons
* @param doubleTest if false, only the test with mesh 1 as the source mesh and mesh 2 as the target mesh will be performed
*
*/