-// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
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]
mesh->are2DCellsNotCorrectlyOriented( vec, false, badCellIds );
CPPUNIT_ASSERT( badCellIds.size() == 0 ); // the orientation is OK
//! [CppSnippet_MEDCouplingUMesh_are2DCellsNotCorrectlyOriented_2]
+ //! [CppSnippet_MEDCouplingUMesh_are2DCellsNotCorrectlyOriented_3]
+ mesh->orientCorrectly2DCells();
+ //! [CppSnippet_MEDCouplingUMesh_are2DCellsNotCorrectlyOriented_3]
+ //! [CppSnippet_MEDCouplingUMesh_are2DCellsNotCorrectlyOriented_4]
+ const mcIdType refCells[] = { 0,2 };
+ const mcIdType objCells[] = { 1,3 };
+ MCAuto<MEDCouplingUMesh> refGroup = mesh->buildPartOfMySelf( refCells, refCells + 2 );
+ MCAuto<MEDCouplingUMesh> objGroup = mesh->buildPartOfMySelf( objCells, objCells + 2 );
+ objGroup->orientCorrectly2DCells( refGroup );
+ mesh->setPartOfMySelf( objCells, objCells + 2, *objGroup );
+ //! [CppSnippet_MEDCouplingUMesh_are2DCellsNotCorrectlyOriented_4]
}
void CppExample_MEDCouplingUMesh_getCellsContainingPoints()