MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> field2 =
field1->cloneWithMesh( true );
double vec[1] = { 5. };
- ((ParaMEDMEM::MEDCouplingMesh *)field2->getMesh())->translate(vec); // translate mesh2
+ (const_cast<ParaMEDMEM::MEDCouplingMesh *>(field2->getMesh()))->translate(vec); // translate mesh2
field2->applyFunc("x + 5"); // "translate" field2
// concatenate field1 and field2
field->renumberNodes(renumber,false);
const MEDCouplingMesh* mesh2 = field->getMesh(); // field now refers to another mesh
values = field->getArray();
- nodeCoords = ((MEDCouplingUMesh*)mesh2)->getCoords();
+ nodeCoords = (static_cast<const MEDCouplingUMesh*>(mesh2))->getCoords();
CPPUNIT_ASSERT( values->isEqualWithoutConsideringStr( *nodeCoords, 1e-13 ));
//! [CppSnippet_MEDCouplingFieldDouble_renumberNodes_3]
}
0.3, 0.3, // point located somewhere inside the mesh
coords[2], coords[3]}; // point at the node #1
const double eps = 1e-4; // ball radius
- std::vector<int> cells, cellsIndex;
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cells, cellsIndex;
mesh->getCellsContainingPoints( pos, 3, eps, cells, cellsIndex );
const int cellsExpected[3]={4, 0, 1};
const int cellsIndexExpected[4]={0, 0, 1, 3};
- CPPUNIT_ASSERT(std::equal( cellsExpected, cellsExpected+3, &cells[0]));
- CPPUNIT_ASSERT(std::equal( cellsIndexExpected, cellsIndexExpected+4, &cellsIndex[0]));
+ CPPUNIT_ASSERT(std::equal( cellsExpected, cellsExpected+3, cells->begin()));
+ CPPUNIT_ASSERT(std::equal( cellsIndexExpected, cellsIndexExpected+4, cellsIndex->begin()));
//! [CppSnippet_MEDCouplingUMesh_getCellsContainingPoints_2]
}