break;
}
-
- _my_local_ref_dim = 3;
+/* _my_local_ref_dim = 3;
_my_local_nb_ref = 6;
penta6aInit();
aSatify = isSatisfy();
CHECK_MACRO;
}
break;
-
+*/
case NORM_PENTA15:
{
_my_local_ref_dim = 3;
// Check tangent vector of the arc circle at the common node with the linear segment.
// There we can tell if the arc of circle is 'moving away' from the seg, or if it might intersect it twice
const Node &n(*_earlyInter->getNodeOnly());
- const double * center(getE1().getCenter());
double tang[2] = {-(n[1]-center[1]), n[0]-center[0]}; // (-y, x) is the tangent vector in the trigo direction with (x,y) = (center->node)
bool invSeg = _i1S2E || _i1E2E;
namespace INTERP_KERNEL
{
- extern const unsigned MAX_SIZE_OF_LINE_XFIG_FILE=1024;
+ const unsigned MAX_SIZE_OF_LINE_XFIG_FILE=1024;
}
SegSegIntersector::SegSegIntersector(const EdgeLin& e1, const EdgeLin& e2):
else
{
faceType = cellModelCell.getSonType(ii);
- const CellModel& faceModel=CellModel::GetCellModel(faceType);
- assert(faceModel.getDimension() == 2);
+ assert(CellModel::GetCellModel(faceType).getDimension() == 2);
nbFaceNodes = cellModelCell.getNumberOfNodesConstituentTheSon(ii);
faceNodes = new ConnType[nbFaceNodes];
cellModelCell.fillSonCellNodalConnectivity(ii,cellNodes,faceNodes);
default:
break;
}
+ break;
case 5: // NORM_PYRA5
break;
Interpolation3D interpolator;
interpolator.interpolateMeshes(sMesh_wrapper, tMesh_wrapper,m,"P0P0");
- std::pair<int, int> eff = countNumberOfMatrixEntries(m);
+// std::pair<int, int> eff = countNumberOfMatrixEntries(m);
// LOG(1, eff.first << " of " << numTargetElems * numSrcElems << " intersections calculated : ratio = "
// << double(eff.first) / double(numTargetElems * numSrcElems));
LOG(1, eff.second << " non-zero elements of " << eff.first << " total : filter efficiency = "
double p2[] = {0.0, 1.0};
double e_center[] = {-0.71, 2.0};
double mid[] = {0.0,0.0}; // out
- double mide[] = {0.0,0.0}; // expected
Node * start = new Node(0.,0.); Node * end = new Node(0.,0.); // unused
// start, end, center_x, center_y, radius, angle0, angle
namespace INTERP_TEST
{
- const double _Epsilon = 1.e-12;
- const double _Precision = 1.e-12;
const double _losange1[8] = { 1,0, 0,1, -1,0, 0,-1 };
const double _losange2[8] = { 2,0, 1,1, 0,0, 1,-1 };
const double _losange3[8] = {2.5,0.5,1.5,1.5,0.5,0.5,1.5,-0.5 };
if(!c1->isEqualWithoutConsideringStr(*c2))
return false;
return true;
- c1=_conn_indx; c2=otherC->_conn_indx;
- if(c1==c2)
- return true;
- if(!c1 || !c2)
- return false;
- if(!c1->isEqualWithoutConsideringStr(*c2))
- return false;
- return true;
}
/*!
return nodeId;
}
}
+ break;
case 2:
if(spaceDim==2)
{
return nx+ny*_structure[0];
}
}
+ break;
case 3:
{
if(spaceDim==3)
}
}
}
+ break;
default:
throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::getCellContainingPoint : mesh dimension managed are 1, 2 or 3 !");
}
+ return 0;
}
void MEDCouplingCurveLinearMesh::getCellsContainingPoint(const double *pos, double eps, std::vector<mcIdType>& elts) const
double *retPtr(ret->getPointer());
if(dim!=ToIdType(ptsInRefCoo->getNumberOfComponents()))
throw INTERP_KERNEL::Exception("MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell : number of components of input coo is not equal to dim of element !");
- const std::vector<double>& wg(getWeights());
INTERP_KERNEL::GaussCoords calculator;
calculator.addGaussInfo(typ,dim, ptsInRefCoo->begin(),nbPts,&_ref_coord[0],getNumberOfPtsInRefCell());
//
{
case AX_CART:
ret=deepCopy();
+ break;
case AX_CYL:
if(nbOfComp==3)
{
throw INTERP_KERNEL::Exception("DataArrayInt::indexOfSameConsecutiveValueGroups : only single component allowed !");
const T *pt(this->begin());
const T *const ptEnd(this->end()) , * const ptBg(this->begin());
- const T *oldPt(pt);
// first find nb of different values in this
std::size_t nbOfTuplesOut(0);
while( pt != ptEnd )
/*!
* Returns coordinates of \a nodeId-th node.
* \param [in] nodeId - the ID of the node of interest.
- * \param [in, out] coo - the array filled with coordinates of the \a nodeId-th
+ * \param [in,out] coo - the array filled with coordinates of the \a nodeId-th
* node. This array is not cleared before filling in, the coordinates are
* appended to its end.
* \throw If the coordinates array is not set.
void MEDCouplingRemapper::computeDenoFromScratch(NatureOfField nat, const MEDCouplingFieldDouble *srcField, const MEDCouplingFieldDouble *trgField)
{
_nature_of_deno=nat;
- std::size_t _time_deno_update=getTimeOfThis();
switch(_nature_of_deno)
{
case IntensiveMaximum:
INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[posOfCurCell];
const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(type);
INTERP_KERNEL::NormalizedCellType newType=INTERP_KERNEL::NORM_ERROR;
- mcIdType newLgth;
+ mcIdType newLgth=0;
if(cm.isDynamic())
{
switch(cm.getDimension())
newType=INTERP_KERNEL::CellSimplify::tryToUnPoly3D(zipFullReprOfPolyh,nbOfFaces,lgthOfPolyhConn,conn+newPos+1,newLgth);
break;
}
- case 1:
+ /* case 1: // Not supported yet
{
newType=(lgthOfCurCell==3)?INTERP_KERNEL::NORM_SEG2:INTERP_KERNEL::NORM_POLYL;
break;
}
+ */
}
ret=ret || (newType!=type);
conn[newPos]=newType;
else
return 0;
}
-
- return work!=tmp+sz1?1:0;
}
else
{//case of SEG2 and SEG3
mcIdType nbNodes=getNumberOfNodes();
MCAuto<DataArrayDouble> nnpc;
{
- MCAuto<DataArrayIdType> tmp(computeNbOfNodesPerCell());
- nnpc=tmp->convertToDblArr();
+ MCAuto<DataArrayIdType> tmp2(computeNbOfNodesPerCell());
+ nnpc=tmp2->convertToDblArr();
}
std::for_each(nnpc->rwBegin(),nnpc->rwEnd(),[](double& v) { v=1./v; });
const double *nnpcPtr(nnpc->begin());
auto ptToMove(nc[*nci+3]);
auto attractor(aa?nc[*nci+1]:nc[*nci+2]),endPt(aa?nc[*nci+2]:nc[*nci+1]);
std::transform(coords+spaceDim*attractor,coords+spaceDim*(attractor+1),coords+spaceDim*endPt,
- coords+spaceDim*ptToMove,[ratio](const double& stPt, const double& endPt) { return stPt+ratio*(endPt-stPt); });
+ coords+spaceDim*ptToMove,[ratio](const double& stPt2, const double& endPt2) { return stPt2+ratio*(endPt2-stPt2); });
}
else
continue;//both 2 boundary nodes of current seg3 are un nodeIds input list -> skip it.
CPPUNIT_ASSERT_DOUBLES_EQUAL(correctLength, length, prec * std::max(correctLength, length));
INTERP_KERNEL::Interpolation2D3D::DuplicateFacesType duplicateFaces = myInterpolator.retrieveDuplicateFaces();
- int duplicateFacesNbr = duplicateFaces.size();
+ int duplicateFacesNbr = (int)duplicateFaces.size();
LOG(1, "duplicateFacesNbr = " << duplicateFacesNbr <<" correctDuplicateFacesNbr = " << correctDuplicateFacesNbr);
CPPUNIT_ASSERT_EQUAL(correctDuplicateFacesNbr, duplicateFacesNbr);
CPPUNIT_ASSERT_DOUBLES_EQUAL(correctSurf, surf, prec * std::max(correctSurf, surf));
INTERP_KERNEL::Interpolation2D3D::DuplicateFacesType duplicateFaces = myInterpolator.retrieveDuplicateFaces();
- int duplicateFacesNbr = duplicateFaces.size();
+ int duplicateFacesNbr = (int)duplicateFaces.size();
LOG(1, "duplicateFacesNbr = " << duplicateFacesNbr <<" correctDuplicateFacesNbr = " << correctDuplicateFacesNbr);
CPPUNIT_ASSERT_EQUAL(correctDuplicateFacesNbr, duplicateFacesNbr);
//
// Author : Anthony Geay (CEA/DEN)
-mcIdType connITT[201]={0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000, 1029, 1058, 1087, 1116, 1145, 1174, 1203,
+static mcIdType connITT[201]={0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000, 1029, 1058, 1087, 1116, 1145, 1174, 1203,
1232, 1261, 1290, 1319, 1348, 1377, 1406, 1435, 1464, 1493, 1522, 1551, 1580, 1609, 1638, 1667, 1696, 1725, 1754, 1783, 1812, 1841, 1870, 1899,
1928, 1957, 1986, 2015, 2044, 2073, 2102, 2131, 2160, 2189, 2218, 2247, 2276, 2305, 2334, 2363, 2392, 2421, 2450, 2479, 2508, 2537, 2566, 2595,
2624, 2653, 2682, 2711, 2740, 2769, 2798, 2827, 2856, 2885, 2914, 2943, 2972, 3001, 3030, 3059, 3088, 3117, 3146, 3175, 3204, 3233, 3262, 3291,
4712, 4741, 4770, 4799, 4828, 4857, 4886, 4915, 4944, 4973, 5002, 5031, 5060, 5089, 5118, 5147, 5176, 5205, 5234, 5263, 5292, 5321, 5350, 5379,
5408, 5437, 5466, 5495, 5524, 5553, 5582, 5611, 5640, 5669, 5698, 5727, 5756, 5785, 5814, 5843, 5872, 5901, 5930, 5959, 5988, 6017, 6046, 6075,
6104, 6133, 6162, 6191, 6220};
- mcIdType connTT[6220]={0, 1, 2, 3, 4, 5, 6, -1, 0, 7, 8, 1, -1, 1, 8, 9, 2, -1, 2, 9, 10, 3, -1, 3, 10, 11, 4, -1, 4, 11, 12, 5, -1, 5, 12, 13, 6, -1, 6, 13, 7, 0, -1, 7, 13, 12, 11, 10, 9, 8, 14, 15, 16, 17, 18, 19,
+static mcIdType connTT[6220]={0, 1, 2, 3, 4, 5, 6, -1, 0, 7, 8, 1, -1, 1, 8, 9, 2, -1, 2, 9, 10, 3, -1, 3, 10, 11, 4, -1, 4, 11, 12, 5, -1, 5, 12, 13, 6, -1, 6, 13, 7, 0, -1, 7, 13, 12, 11, 10, 9, 8, 14, 15, 16, 17, 18, 19,
20, -1, 14, 21, 22, 15, -1, 15, 22, 23, 16, -1, 16, 23, 24, 17, -1, 17, 24, 25, 18, -1, 18, 25, 26, 19, -1, 19, 26, 27, 20, -1, 20, 27, 21, 14, -1, 21, 27, 26, 25, 24, 23, 22, 28, 29, 30, 31, 32,
33, 34, -1, 28, 35, 36, 29, -1, 29, 36, 37, 30, -1, 30, 37, 38, 31, -1, 31, 38, 39, 32, -1, 32, 39, 40, 33, -1, 33, 40, 41, 34, -1, 34, 41, 35, 28, -1, 35, 41, 40, 39, 38, 37, 36, 42, 43, 44, 45,
46, 47, 48, -1, 42, 49, 50, 43, -1, 43, 50, 51, 44, -1, 44, 51, 52, 45, -1, 45, 52, 53, 46, -1, 46, 53, 54, 47, -1, 47, 54, 55, 48, -1, 48, 55, 49, 42, -1, 49, 55, 54, 53, 52, 51, 50, 56, 57, 58,
1703, 1699, -1, 1699, 1703, 1700, 1696, -1, 1700, 1703, 1702, 1701, 1704, 1705, 1706, 1707, -1, 1704, 1708, 1709, 1705, -1, 1705, 1709, 1710, 1706, -1, 1706, 1710, 1711, 1707, -1, 1707, 1711,
1708, 1704, -1, 1708, 1711, 1710, 1709, 1712, 1713, 1714, 1715, -1, 1712, 1716, 1717, 1713, -1, 1713, 1717, 1718, 1714, -1, 1714, 1718, 1719, 1715, -1, 1715, 1719, 1716, 1712, -1, 1716, 1719, 1718, 1717};
-double coordsTT[5160]={
+static double coordsTT[5160]={
0.0054015000000000044, 0.0054015000000000053, 0, 0.2106585, 0.0054015000000000053, 0, 0.2106585, 0.039611, 0, 0.2106585, 0.10803, 0, 0.2106585,
0.17644899999999999, 0, 0.2106585, 0.2106585, 0, 0.0054015000000000044, 0.2106585, 0, 0.0054015000000000044, 0.0054015000000000053, 0.21364999999999998,
0.2106585, 0.0054015000000000053, 0.21364999999999998, 0.2106585, 0.039611, 0.21364999999999998, 0.2106585, 0.10803, 0.21364999999999998, 0.2106585,
};
-const mcIdType connTFH8[2560]={
+static const mcIdType connTFH8[2560]={
1, 2, 7, 6, 28, 29, 34, 33, 2, 3, 8, 7, 29, 30, 35, 34, 3, 4, 9, 8, 30, 31, 36, 35, 4, 5, 10, 9, 31, 32, 37, 36, 6, 7, 12, 11, 33, 34, 39, 38, 7, 8, 13, 12, 34, 35, 40, 39,
8, 9, 14, 13, 35, 36, 41, 40, 9, 10, 15, 14, 36, 37, 42, 41, 11, 12, 17, 16, 38, 39, 44, 43, 12, 13, 18, 17, 39, 40, 45, 44, 13, 14, 19, 18, 40, 41, 46, 45, 14, 15, 20, 19,
41, 42, 47, 46, 16, 17, 21, 26, 43, 44, 48, 53, 17, 18, 22, 21, 44, 45, 49, 48, 18, 19, 23, 22, 45, 46, 50, 49, 19, 20, 24, 23, 46, 47, 51, 50, 28, 29, 34, 33, 55, 56, 61, 60,
526, 531, 530, 552, 553, 558, 557, 526, 527, 532, 531, 553, 554, 559, 558, 527, 528, 533, 532, 554, 555, 560, 559, 529, 530, 534, 539, 556, 557, 561, 566, 530, 531, 535, 534, 557, 558, 562, 561, 531, 532, 536, 535, 558, 559, 563,
562, 532, 533, 537, 536, 559, 560, 564, 563};
-const mcIdType connTFPOLH[1000]={
+static const mcIdType connTFPOLH[1000]={
0, 25, 26, 16, 11, 6, 1, -1, 27, 28, 33, 38, 43, 53, 52, -1, 0, 1, 28, 27, -1, 1, 6, 33, 28, -1, 6, 11, 38, 33, -1, 11, 16, 43, 38, -1, 16, 26, 53, 43, -1, 26, 25, 52, 53, -1, 25, 0, 27, 52, 27, 52, 53, 43, 38, 33, 28, -1, 54, 55,
60, 65, 70, 80, 79, -1, 27, 28, 55, 54, -1, 28, 33, 60, 55, -1, 33, 38, 65, 60, -1, 38, 43, 70, 65, -1, 43, 53, 80, 70, -1, 53, 52, 79, 80, -1, 52, 27, 54, 79, 54, 79, 80, 70, 65, 60, 55, -1, 81, 82, 87, 92, 97, 107, 106, -1, 54,
55, 82, 81, -1, 55, 60, 87, 82, -1, 60, 65, 92, 87, -1, 65, 70, 97, 92, -1, 70, 80, 107, 97, -1, 80, 79, 106, 107, -1, 79, 54, 81, 106, 81, 106, 107, 97, 92, 87, 82, -1, 108, 109, 114, 119, 124, 134, 133, -1, 81, 82, 109, 108, -1,
538, 539, 529, 524, 519, 514, -1, 540, 541, 546, 551, 556, 566, 565, -1, 513, 514, 541, 540, -1, 514, 519, 546, 541, -1, 519, 524, 551, 546, -1, 524, 529, 556, 551, -1, 529, 539, 566, 556, -1, 539, 538, 565, 566, -1, 538, 513, 540, 565
};
-const double coordsTF[1701]={
+static const double coordsTF[1701]={
0, 0, 0, 0.21606, 0, 0, 0.25207000000000002, 0, 0, 0.32408999999999999, 0, 0, 0.39610999999999996, 0, 0, 0.43212, 0, 0, 0.21606, 0.03601, 0,
0.25207000000000002, 0.03601, 0, 0.32408999999999999, 0.03601, 0, 0.39610999999999996, 0.03601, 0, 0.43212, 0.03601, 0, 0.21606, 0.10803, 0, 0.25207000000000002,
0.10803, 0, 0.32408999999999999, 0.10803, 0, 0.39610999999999996, 0.10803, 0, 0.43212, 0.10803, 0, 0.21606, 0.18004999999999999, 0, 0.25207000000000002,
4.2729999999999997, 0, 0.21606, 4.2729999999999997, 0.21606, 0.21606, 4.2729999999999997
};
-const mcIdType connTFPOLH_I[21]={0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000};
+static const mcIdType connTFPOLH_I[21]={0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000};
mesh1->fillFromAnalytic( MEDCoupling::ON_NODES,1,"x"); // field1 values == coords1
MCAuto<MEDCouplingFieldDouble> field2 =
mesh2->fillFromAnalytic( MEDCoupling::ON_NODES,1,"x"); // field2 values == coords2
- const double levOfCheck = 10; // nodes can be permuted
+ const int levOfCheck = 10; // nodes can be permuted
field1->substractInPlaceDM( field2, levOfCheck, 1e-13, 0 ); // values #0 and #2 must swap
//! [CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_2]
//! [CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_3]
//! [CppSnippet_MEDCouplingFieldDouble_changeUnderlyingMesh_2]
MCAuto<MEDCouplingFieldDouble> field =
mesh1->fillFromAnalytic( MEDCoupling::ON_NODES,1,"x"); // field values == coords1
- const double levOfCheck = 10; // nodes can be permuted
+ const int levOfCheck = 10; // nodes can be permuted
field->changeUnderlyingMesh( mesh2, levOfCheck, 1e-13, 0 ); // values #0 and #2 must swap
CPPUNIT_ASSERT( std::equal( coords2, coords2+4, field->getArray()->getConstPointer() ));
//! [CppSnippet_MEDCouplingFieldDouble_changeUnderlyingMesh_2]
{
vsType[i]=convertPyObjectToStr(o);
}
- catch(INTERP_KERNEL::Exception& e)
+ catch(INTERP_KERNEL::Exception& )
{
std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not a string ! only tuples of strings accepted !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
{
vsType[i]=convertPyObjectToStr(o);
}
- catch(INTERP_KERNEL::Exception& e)
+ catch(INTERP_KERNEL::Exception& )
{
std::ostringstream oss; oss << "List as been detected but element #" << i << " is not a string ! only tuples of strings accepted !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
{
MCAuto<DataArrayDouble> ptsForLoc;
MCAuto<MEDCouplingUMesh> geoMesh(BuildMeshCommon(gt,pfl,loc,zeStr,mesh,section,globs,ptsForLoc));
- mcIdType nbSecPts(section->getNumberOfNodes()),nbCells(geoMesh->getNumberOfCells()),nbg(ToIdType(loc.getGaussWeights().size()));
+ mcIdType nbCells(geoMesh->getNumberOfCells()),nbg(ToIdType(loc.getGaussWeights().size()));
MCConstAuto<DataArrayDouble> zeThickness;
if(!pfl.empty())
{
#include "MEDFileMesh.hxx"
#include "InterpKernelAutoPtr.hxx"
+// From MEDLOader.cxx TU
extern med_geometry_type typmai[MED_N_CELL_FIXED_GEO];
extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO];
extern med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE];
#include <algorithm>
#include <iterator>
+// From MEDLoader.cxx TU:
extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO];
extern med_geometry_type typmainoeud[1];
extern med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE];
for(std::vector< MCAuto<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++,i++)
{
const MEDFileAnyTypeFieldMultiTSWithoutSDA *cur=(*it);
- std::string chapter(17,'0'+i);
+ std::string chapter(17,(char)('0'+i));
oss << startLine << chapter << std::endl;
if(cur)
{
if(renumPol==1)
return ret.retn();
}
+ [[clang::fallthrough]]; // yes no break here - silence clang warning.
case 2:
{
//no need to test _field_per_mesh.empty() because geMeshName has already done it
}
return ret.retn();
}
+ break;
default:
throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::getFieldOnMeshAtLevel : unsupported renum policy ! Dealing with policy 0 1 2 and 3 !");
}
+ return nullptr;
}
/*!
/*!
* This method throws an INTERP_KERNEL::Exception if \a fieldName field is not in file pointed by \a fid and with name \a fileName.
*
- * \param [in] fid - MED file handler
- * \param [in] fieldName - name of the field
- * \param [out] posCFormat - index of the field in the file(?)
- * \param [out] typcha - type of the field
- * \param [out] infos - informations on the field
- * \param [out] dtunitOut - time unit description
- * \param [out] meshName - name of the mesh supporting the field
* \return in case of success the number of time steps available for the field with name \a fieldName.
*/
int MEDFileAnyTypeField1TS::LocateField(med_idt fid, const std::string& fieldName, int& posCFormat, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut, std::string& meshName)
#include "CellModel.hxx"
+// From MEDLOader.cxx TU
extern med_geometry_type typmai[MED_N_CELL_FIXED_GEO];
extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO];
extern med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE];
void MEDFileFieldPerMeshPerTypePerDisc::writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const
{
- TypeOfField type=getType();
- INTERP_KERNEL::NormalizedCellType geoType(getGeoType());
med_geometry_type mgeoti;
med_entity_type menti;
_father->entriesForMEDfile(getType(),mgeoti,menti);
int i=0;
for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,i++)
{
- std::string chapter(17,'0'+i);
+ std::string chapter(17,(char)('0'+i));
oss << startLine << chapter << std::endl;
const MEDFileAnyTypeField1TSWithoutSDA *cur=(*it);
if(cur)
#include "CellModel.hxx"
#include "InterpKernelAutoPtr.hxx"
-extern med_geometry_type typmai[MED_N_CELL_FIXED_GEO];
-extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO];
-extern med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE];
+// From MEDLOader.cxx TU
+extern const med_geometry_type typmai[MED_N_CELL_FIXED_GEO];
+extern const INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO];
+extern const med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE];
using namespace MEDCoupling;
#include <limits>
#include <cmath>
+// From MEDLOader.cxx TU
extern med_geometry_type typmai[MED_N_CELL_FIXED_GEO];
extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO];
extern med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE];
if(idsToKill->empty())
return ;
std::vector<std::string> newFamsOnGrp;
- for(std::vector<std::string>::const_iterator it=famsOnGrp.begin();it!=famsOnGrp.end();it++)
+ for(std::vector<std::string>::const_iterator itt=famsOnGrp.begin();itt!=famsOnGrp.end();itt++)
{
- if(!idsToKill->presenceOfValue(getFamilyId(*it)))
- newFamsOnGrp.push_back(*it);
+ if(!idsToKill->presenceOfValue(getFamilyId(*itt)))
+ newFamsOnGrp.push_back(*itt);
}
(*it).second=newFamsOnGrp;
}
{
fams=getFamilyFieldAtLevel(*it);
}
- catch(INTERP_KERNEL::Exception& e) { }
+ catch(INTERP_KERNEL::Exception& ) { }
if(!fams)
continue;
std::vector<bool> v(fams->getNumberOfTuples(),false);
{
fams=getFamilyFieldAtLevel(*it);
}
- catch(INTERP_KERNEL::Exception& e) { }
+ catch(INTERP_KERNEL::Exception& ) { }
if(!fams)
continue;
MCAuto<DataArrayIdType> idsToModif(fams->findIdsEqualList(famIdsSubstSession.second.data(),famIdsSubstSession.second.data()+famIdsSubstSession.second.size()));
mcIdType nbCells=mesh->getNumberOfCellsOfSubLevelMesh();
nameArr->checkNbOfTuplesAndComp(nbCells,MED_SNAME_SIZE,"MEDFileStructuredMesh::setNameFieldAtLevel : Problem in size of names arr ! Mismatch with number of faces of mesh !");
_names_faces=nameArr;
+ break;
}
default:
throw INTERP_KERNEL::Exception("MEDFileStructuredMesh::setNameFieldAtLevel : Only available for levels 0 or 1 or -1 !");
#include <iostream>
+// From MEDLOader.cxx TU
extern med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE];
using namespace MEDCoupling;
#include <set>
#include <iomanip>
+// From MEDLOader.cxx TU
extern med_geometry_type typmai[MED_N_CELL_FIXED_GEO];
extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO];
extern med_geometry_type typmainoeud[1];
INTERP_KERNEL::AutoPtr<char> gro=new char[MED_LNAME_SIZE*ngro+1];
MEDfamily23Info(fid,meshName.c_str(),i+1,nomfam,attide,attval,attdes,&numfam,gro);
std::string famName(MEDLoaderBase::buildStringFromFortran(nomfam,MED_NAME_SIZE));
- std::vector<std::string> grps(ngro);
+ std::vector<std::string> grps2(ngro);
for(int j=0;j<ngro;j++)
- grps[j]=MEDLoaderBase::buildStringFromFortran(gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE);
- crudeFams[i]=std::pair<std::string,std::pair<mcIdType,std::vector<std::string> > >(famName,std::pair<mcIdType,std::vector<std::string> >(numfam,grps));
+ grps2[j]=MEDLoaderBase::buildStringFromFortran(gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE);
+ crudeFams[i]=std::pair<std::string,std::pair<mcIdType,std::vector<std::string> > >(famName,std::pair<mcIdType,std::vector<std::string> >(numfam,grps2));
}
RenameFamiliesFromFileToMemInternal(crudeFams);
for(std::vector< std::pair<std::string,std::pair<mcIdType,std::vector<std::string> > > >::const_iterator it0=crudeFams.begin();it0!=crudeFams.end();it0++)
#include <algorithm>
#include <memory>
+extern med_geometry_type typmai[MED_N_CELL_FIXED_GEO];
+extern med_geometry_type typmainoeud[1];
+extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO];
+extern med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE];
+
+
med_geometry_type typmai[MED_N_CELL_FIXED_GEO] = { MED_POINT1,
MED_SEG2,
MED_SEG3,
MED_POLYGON2//32
};
-double _EPS_FOR_NODE_COMP=1.e-12;
-
-int _COMP_FOR_CELL=0;
+// Just for this translation unit:
+static double _EPS_FOR_NODE_COMP=1.e-12;
+static int _COMP_FOR_CELL=0;
+static int _TOO_LONG_STR=0;
-int _TOO_LONG_STR=0;
using namespace MEDCoupling;
template<class T>
int gatherArraysT(MPI_Comm comm, int root, const typename Traits<T>::ArrayType *array, std::unique_ptr<T[]>& result, std::unique_ptr<mcIdType[]>& resultIndex, int& rank) const
{
- using DataArrayT = typename Traits<T>::ArrayType;
int size;
this->commSize(comm,&size);
rank = -1;
template<class T>
int allGatherArraysT(MPI_Comm comm, const typename Traits<T>::ArrayType *array, std::unique_ptr<T[]>& result, std::unique_ptr<mcIdType[]>& resultIndex) const
{
- using DataArrayT = typename Traits<T>::ArrayType;
int size;
this->commSize(comm,&size);
std::unique_ptr<mcIdType[]> nbOfElems(new mcIdType[size]);
{
InterpKernelDEC::InterpKernelDEC():
DisjointDEC(),
- _nb_distant_points(0), _distant_coords(0),
- _distant_locations(0), _interpolation_matrix(0)
+ _interpolation_matrix(0)
{
}
*/
InterpKernelDEC::InterpKernelDEC(ProcessorGroup& source_group, ProcessorGroup& target_group):
DisjointDEC(source_group, target_group),
- _nb_distant_points(0), _distant_coords(0),
- _distant_locations(0), _interpolation_matrix(0)
+ _interpolation_matrix(0)
{
}
InterpKernelDEC::InterpKernelDEC(const std::set<int>& src_ids, const std::set<int>& trg_ids,
const MPI_Comm& world_comm):
DisjointDEC(src_ids,trg_ids,world_comm),
- _nb_distant_points(0), _distant_coords(0),
- _distant_locations(0), _interpolation_matrix(0)
+ _interpolation_matrix(0)
{
}
void prepareSourceDE() { }
void prepareTargetDE() { }
private :
- //Number of distant points to be located locally
- int _nb_distant_points;
- //coordinates of distant points
- const double* _distant_coords;
- //local element number containing the distant points
- const int* _distant_locations;
InterpolationMatrix* _interpolation_matrix;
};
}
int outcount = 0 ;
if ( sts == MPI_SUCCESS )
{
- MPI_Datatype datatype = MPIDatatype( RequestId ) ;
- _comm_interface.getCount(MPIStatus( RequestId ), datatype, &outcount ) ;
+ MPI_Datatype datatype2 = MPIDatatype( RequestId ) ;
+ _comm_interface.getCount(MPIStatus( RequestId ), datatype2, &outcount ) ;
setMPIOutCount( RequestId , outcount ) ;
setMPICompleted( RequestId , true ) ;
deleteStatus( RequestId ) ;
_target_field(target_field),
_source_support(source_field->getSupport()->getCellMesh()),
_target_support(target_field->getSupport()->getCellMesh()),
- _mapping(group, locator),
- _group(group)
+ _mapping(group, locator)
{
}
MEDCouplingPointSet *_source_support;
MEDCouplingPointSet *_target_support;
OverlapMapping _mapping;
-
- const ProcessorGroup& _group;
};
}
denoM.resize(mat.size());
if(isItem1==_sent_trg_ids.end() || curSrcId==myProcId)//item1 of step2 main algo. Simple, because rowId of mat are directly target ids.
{
- mcIdType rowId=0;
- for(std::vector< SparseDoubleVec >::const_iterator it1=mat.begin();it1!=mat.end();it1++,rowId++)
+ mcIdType rowId2=0;
+ for(std::vector< SparseDoubleVec >::const_iterator it1=mat.begin();it1!=mat.end();it1++,rowId2++)
for(SparseDoubleVec::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++)
- denoM[rowId][(*it2).first]=deno[rowId];
+ denoM[rowId2][(*it2).first]=deno[rowId2];
}
else
{
{
ParaGRID::ParaGRID(MEDCouplingCMesh* global_grid, Topology* topology) :
- _global_axis(), _my_domain_id(0)
+ _global_axis()
{
_block_topology = dynamic_cast<BlockTopology*>(topology);
if(_block_topology==0)
MEDCoupling::BlockTopology* _block_topology;
// stores the x,y,z axes on the global grid
std::vector<std::vector<double> > _global_axis;
- //id of the local grid
- int _my_domain_id;
};
}
skOut = skOut->uniqueNotSortedByPack();//remove duplicates
MCAuto<ParaSkyLineArray> ret(ParaSkyLineArray::New(skOut,globalIdsOut));
return ret.retn();
-}
\ No newline at end of file
+}
+
#include <unistd.h>
#endif
-#if OMPI_MAJOR_VERSION >= 4
-#define MPI_ERROR_HANDLER(var) MPI_Comm_set_errhandler(MPI_COMM_WORLD, var);
-#else
-#define MPI_ERROR_HANDLER(var) MPI_Errhandler_set(MPI_COMM_WORLD, var);
+
+#ifdef OMPI_MAJOR_VERSION
+# if OMPI_MAJOR_VERSION >= 4
+# define MPI_ERROR_HANDLER(var) MPI_Comm_set_errhandler(MPI_COMM_WORLD, var);
+# endif
+#else // MPICH and other versions:
+# define MPI_ERROR_HANDLER(var) MPI_Errhandler_set(MPI_COMM_WORLD, var);
#endif
MPI2Connector::MPI2Connector()
int my_stop_temp = stop?1:0;
if (s==sync_and)
MPI_Allreduce(&my_stop_temp,&my_stop,1,MPI_INTEGER,MPI_MIN,MPI_COMM_WORLD);
- else if (s==sync_or)
+ else // if (s==sync_or)
MPI_Allreduce(&my_stop_temp,&my_stop,1,MPI_INTEGER,MPI_MAX,MPI_COMM_WORLD);
stop =(my_stop==1);
}
recvbuf[j] = -1 ;
}
- int sts = MyMPIAccessDEC->allToAllTime( sendbuf, sendcount , MPI_INT ,
+ sts = MyMPIAccessDEC->allToAllTime( sendbuf, sendcount , MPI_INT ,
recvbuf, recvcount , MPI_INT ) ;
chksts( sts , myrank , mpi_access ) ;
delete [] sendbuf ;
}
else {
- int sts = MyMPIAccessDEC->allToAllvTime( sendbuf, sendcounts , sdispls , MPI_INT ,
+ int sts2 = MyMPIAccessDEC->allToAllvTime( sendbuf, sendcounts , sdispls , MPI_INT ,
recvbuf, recvcounts , rdispls , MPI_INT ) ;
- chksts( sts , myrank , mpi_access ) ;
+ chksts( sts2 , myrank , mpi_access ) ;
}
// debugStream << "test_AllToAllvTimeDEC" << myrank << " recvbuf before CheckSent" ;
// debugStream << "test_AllToAllvTimeDEC" << myrank << " check of recvbuf" << endl ;
bool badrecvbuf = false ;
for ( i = 0 ; i < size ; i++ ) {
- int j ;
- for ( j = 0 ; j < datamsglength ; j++ ) {
- int index = i*datamsglength+j ;
- if ( j < recvcounts[i] ) {
+ for ( int jj = 0 ; jj < datamsglength ; jj++ ) {
+ int index = i*datamsglength+jj ;
+ if ( jj < recvcounts[i] ) {
if ( recvbuf[index] != (index/datamsglength)*1000000 + myrank*1000 +
myrank*datamsglength+(index%datamsglength) ) {
badrecvbuf = true ;
//debugStream << endl ;
}
- int sts = MyMPIAccessDEC->allToAllvTime( sendbuf, sendcounts , sdispls , MPI_DOUBLE ,
+ sts = MyMPIAccessDEC->allToAllvTime( sendbuf, sendcounts , sdispls , MPI_DOUBLE ,
recvbuf, recvcounts , rdispls , MPI_DOUBLE ) ;
chksts( sts , myrank , mpi_access ) ;
// debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " check of recvbuf" << endl ;
bool badrecvbuf = false ;
for ( target = 0 ; target < size ; target++ ) {
- int j ;
- for ( j = 0 ; j < datamsglength ; j++ ) {
- int index = target*datamsglength+j ;
- if ( j < recvcounts[target] ) {
+ for ( int jj = 0 ; jj < datamsglength ; jj++ ) {
+ int index = target*datamsglength+jj ;
+ if ( jj < recvcounts[target] ) {
if ( fabs(recvbuf[index] - (target*1000000 + myrank*10000 +
- (timeLoc[target]/deltatime[target])*100 + j)) > 101) {
+ (timeLoc[target]/deltatime[target])*100 + jj)) > 101) {
badrecvbuf = true ;
debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " target " << target << " timeLoc[target] "
<< timeLoc[target] << " recvbuf[" << index << "] " << (int ) recvbuf[index]
<< " # " << (int ) (target*1000000 +
- myrank*10000 + (timeLoc[target]/deltatime[target])*100 + j)
+ myrank*10000 + (timeLoc[target]/deltatime[target])*100 + jj)
<< endl ;
}
else if ( badrecvbuf ) {
debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " recvbuf[" << index << "] "
<< recvbuf[index] << " ~= " << (int ) (target*1000000 +
- myrank*10000 + (timeLoc[target]/deltatime[target])*100 + j) << endl ;
+ myrank*10000 + (timeLoc[target]/deltatime[target])*100 + jj) << endl ;
}
}
else if ( recvbuf[index] != -1 ) {
sts = mpi_access.IRecv(&recvbuf,outcount,MPI_INT,source,
RequestId[i] ) ;
if ( datatype == MPI_INT ) {
- int source, tag, error, outcount ;
+ int error;
mpi_access.wait( RequestId[i] ) ;
mpi_access.status( RequestId[i], source, tag, error, outcount,
true ) ;
<< ")" << endl ;
mpi_access.test( SendRequestId[j], flag ) ;
if ( flag ) {
- int target, tag, error, outcount ;
+ int tag, error, outcount ;
mpi_access.status( SendRequestId[j], target, tag, error, outcount,
true ) ;
debugStream << "test" << myrank << " Send RequestId " << SendRequestId[j]
mpi_access.test( RecvRequestId[j], flag ) ;
}
if ( flag ) {
- int target,source, tag, error, outcount ;
+ int source, tag, error, outcount ;
if ( myrank == 0 ) {
mpi_access.status( SendRequestId[j], target, tag, error, outcount,
true ) ;
if ( myrank == 0 ) {
int sendrequests[maxreq] ;
int sendreqsize = mpi_access.sendRequestIds( target , maxreq , sendrequests ) ;
- int i ;
if ( sendreqsize != 0 ) {
ostringstream strstream ;
strstream << "=========================================================" << endl
if(MPI_ACCESS_VERBOSE) mpi_access.check() ;
if ( myrank == 0 ) {
- int size = mpi_access.sendRequestIdsSize() ;
- debugStream << "test" << myrank << " before WaitAll sendreqsize " << size << endl ;
+ int size2 = mpi_access.sendRequestIdsSize() ;
+ debugStream << "test" << myrank << " before WaitAll sendreqsize " << size2 << endl ;
mpi_access.waitAll(maxreq, SendRequestId) ;
- size = mpi_access.sendRequestIdsSize() ;
- debugStream << "test" << myrank << " after WaitAll sendreqsize " << size << endl ;
- int * ArrayOfSendRequests = new int[ size ] ;
- int nSendRequest = mpi_access.sendRequestIds( size , ArrayOfSendRequests ) ;
- int i ;
+ size2 = mpi_access.sendRequestIdsSize() ;
+ debugStream << "test" << myrank << " after WaitAll sendreqsize " << size2 << endl ;
+ int * ArrayOfSendRequests = new int[ size2 ] ;
+ int nSendRequest = mpi_access.sendRequestIds( size2 , ArrayOfSendRequests ) ;
for ( i = 0 ; i < nSendRequest ; i++ ) {
mpi_access.deleteRequest( ArrayOfSendRequests[i] ) ;
}
delete [] ArrayOfSendRequests ;
}
else {
- int size = mpi_access.recvRequestIdsSize() ;
- debugStream << "test" << myrank << " before WaitAll recvreqsize " << size << endl ;
+ int size2 = mpi_access.recvRequestIdsSize() ;
+ debugStream << "test" << myrank << " before WaitAll recvreqsize " << size2 << endl ;
mpi_access.waitAll(maxreq, RecvRequestId) ;
- size = mpi_access.recvRequestIdsSize() ;
- debugStream << "test" << myrank << " after WaitAll recvreqsize " << size << endl ;
- int * ArrayOfRecvRequests = new int[ size ] ;
- int nRecvRequest = mpi_access.recvRequestIds( size , ArrayOfRecvRequests ) ;
- int i ;
+ size2 = mpi_access.recvRequestIdsSize() ;
+ debugStream << "test" << myrank << " after WaitAll recvreqsize " << size2 << endl ;
+ int * ArrayOfRecvRequests = new int[ size2 ] ;
+ int nRecvRequest = mpi_access.recvRequestIds( size2 , ArrayOfRecvRequests ) ;
for ( i = 0 ; i < nRecvRequest ; i++ ) {
mpi_access.deleteRequest( ArrayOfRecvRequests[i] ) ;
}
if ( myrank == 0 ) {
int sendrequests[maxreq] ;
int sendreqsize = mpi_access.sendRequestIds( target , maxreq , sendrequests ) ;
- int i ;
if ( sendreqsize != 0 ) {
ostringstream strstream ;
strstream << "=========================================================" << endl
mpi_access.test( RecvRequestId[j], flag ) ;
}
if ( flag ) {
- int target,source, tag, error, outcount ;
+ int target2,source, tag, error, outcount ;
if ( myrank == 0 ) {
- mpi_access.status( SendRequestId[j], target, tag, error, outcount,
+ mpi_access.status( SendRequestId[j], target2, tag, error, outcount,
true ) ;
debugStream << "test" << myrank << " Test(Send RequestId " << SendRequestId[j]
- << ") : target " << target << " tag " << tag << " error " << error
+ << ") : target " << target2 << " tag " << tag << " error " << error
<< " flag " << flag << endl ;
}
else {
}
int j ;
for (j = 1 ; j <= i ; j++) {
- int source ;
+ int source = 0;
MPI_Datatype datatype = 0;
int outcount = 0;
int flag ;
}
if ( flag ) {
if ( myrank == 0 ) {
- int target, tag, error, outcount ;
+ int tag, error ;
mpi_access.status( SendRequestId[j], target, tag, error, outcount,
true ) ;
debugStream << "test" << myrank << " Test(Send RequestId " << SendRequestId[j]
debugStream << "test" << myrank << " TestAll SendRequest flag " << flag << endl ;
}
else {
- int i ;
int source ;
int outcount ;
- int flag ;
if ( maxirecv != maxreq ) {
ostringstream strstream ;
strstream << "==========================================================="
mpi_access.test( RecvTimeRequestId[j], flag ) ;
}
if ( flag ) {
- int target,source, tag, error, outcount ;
+ int source, tag, error, outcount ;
if ( myrank == 0 ) {
mpi_access.status( SendTimeRequestId[j], target, tag, error, outcount,
true ) ;
mpi_access.test( RecvRequestId[j], flag ) ;
}
if ( flag ) {
- int target,source, tag, error, outcount ;
+ int source, tag, error, outcount ;
if ( myrank == 0 ) {
mpi_access.status( SendRequestId[j], target, tag, error, outcount,
true ) ;
typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS,
boost::property<boost::vertex_color_t, boost::default_color_type,
boost::property<boost::vertex_degree_t,mcIdType> > > Graph;
- typedef boost::graph_traits<Graph>::vertex_descriptor Vertex;
- typedef boost::graph_traits<Graph>::vertices_size_type size_type;
Graph G(nbCell);
for (mcIdType i=0;i<nbCell;++i)
for (mcIdType j=index_graph[i];j<index_graph[i+1];++j)