+\anchor cpp_mcumesh_
+<br><h2> </h2>
+
+First, we create a 2D mesh with 3 QUAD4 and 2 TRI3 cells.
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingUMesh_
+\snippet MEDCouplingExamplesTest.py PySnippet_MEDCouplingUMesh_
+\snippet MEDCouplingExamplesTest.py Snippet_MEDCouplingUMesh_
+
+
+\anchor cpp_mccmesh_getCoordsAt
+<br><h2> Getting node coordinates </h2>
+
+We create an 1D Cartesian mesh and retrieves node coordinates using
+\ref ParaMEDMEM::MEDCouplingCMesh::getCoordsAt "getCoordsAt()".
+\snippet MEDCouplingExamplesTest.cxx CppSnippet_MEDCouplingCMesh_getCoordsAt_1
+
+
+
\anchor cpp_mcumesh_areCellsIncludedIn
<br><h2> Cells correspondence in two meshes </h2>
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingMultiFields.hxx"
+void CppExample_MEDCouplingPointSet_getCoordsAt()
+{
+ using namespace ParaMEDMEM;
+ //! [CppSnippet_MEDCouplingCMesh_getCoordsAt_1]
+ const double coords[3] = {1.,2.,4.};
+ DataArrayDouble* x = DataArrayDouble::New();
+ x->useExternalArrayWithRWAccess( coords, 3, 1 );
+ MEDCouplingCMesh *mesh=MEDCouplingCMesh::New();
+ mesh->setCoordsAt(0,x);
+ const DataArrayDouble* x2=mesh->getCoordsAt(0);
+ CPPUNIT_ASSERT( x2->isEqual( *x, 1e-13 ));
+ //! [CppSnippet_MEDCouplingCMesh_getCoordsAt_1]
+}
void CppExample_MEDCouplingUMesh_areCellsIncludedIn()
{
int main(int argc, char *argv[])
{
+ CppExample_MEDCouplingPointSet_getCoordsAt();
CppExample_MEDCouplingUMesh_areCellsIncludedIn();
CppExample_MEDCouplingUMesh_findAndCorrectBadOriented3DExtrudedCells();
CppExample_MEDCouplingUMesh_arePolyhedronsNotCorrectlyOriented();
#! [PySnippet_MEDCouplingUMesh__1]
return
+ def testExample_MEDCouplingCMesh_getCoordsAt(self):
+ #! [PySnippet_MEDCouplingCMesh_getCoordsAt_1]
+ coords = [1.,2.,4.]
+ x=DataArrayDouble.New(coords,3,1)
+ mesh=MEDCouplingCMesh.New()
+ mesh.setCoordsAt(0,x)
+ x2=mesh.getCoordsAt(0)
+ assert coords == x2.getValues()
+ #! [PySnippet_MEDCouplingCMesh_getCoordsAt_1]
+ return
+
def testExample_MEDCouplingUMesh_areCellsIncludedIn(self):
#! [PySnippet_MEDCouplingUMesh_areCellsIncludedIn_1]
mesh1=MEDCouplingUMesh.New();