From 1150bce66d6e3c4c132d562b2499b038c3fa621b Mon Sep 17 00:00:00 2001 From: SONOLET Aymeric Date: Fri, 12 Apr 2024 10:45:07 +0200 Subject: [PATCH] format: complete compilation and link with minimal headers --- src/MEDLoader/Test/TestMEDLoader.cxx | 1 + src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx | 8 ++++---- src/MEDPartitioner/MEDPARTITIONER_MeshCollection.hxx | 6 +++--- .../MEDPARTITIONER_ParaDomainSelector.cxx | 1 + src/MEDPartitioner/MEDPARTITIONER_ScotchGraph.cxx | 2 +- src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx | 12 ++++++------ src/MEDPartitioner/Test/TestMEDPARTITIONER.cxx | 1 + 7 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/MEDLoader/Test/TestMEDLoader.cxx b/src/MEDLoader/Test/TestMEDLoader.cxx index 24bb107b7..9cf278301 100644 --- a/src/MEDLoader/Test/TestMEDLoader.cxx +++ b/src/MEDLoader/Test/TestMEDLoader.cxx @@ -23,3 +23,4 @@ CPPUNIT_TEST_SUITE_REGISTRATION( MEDCoupling::MEDLoaderTest ); +#include "BasicMainTest.hxx" diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx index 908f7bfea..54014d7ce 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx @@ -1082,7 +1082,7 @@ void MEDPARTITIONER::MeshCollection::buildConnectZones( const NodeMapping& nodeM for ( nmIt1 = nmIt2; nmIt1 != nodeMapping.end(); nmIt1 = nmIt2 ) { // look for an "old" node mapped into several "new" nodes in different domains - int const nbSameOld = 0; + int nbSameOld = 0; while ( ++nmIt2 != nodeMapping.end() && nmIt2->first == nmIt1->first ) nbSameOld += ( nmIt2->second != nmIt1->second ); @@ -1841,7 +1841,7 @@ int MEDPARTITIONER::MeshCollection::getMeshDimension() const int MEDPARTITIONER::MeshCollection::getNbOfLocalMeshes() const { - int const nb=0; + int nb=0; for (auto i : _mesh) { if (i) nb++; @@ -1851,7 +1851,7 @@ int MEDPARTITIONER::MeshCollection::getNbOfLocalMeshes() const mcIdType MEDPARTITIONER::MeshCollection::getNbOfLocalCells() const { - mcIdType const nb=0; + mcIdType nb=0; for (auto i : _mesh) { if (i) nb=nb+i->getNumberOfCells(); @@ -1861,7 +1861,7 @@ mcIdType MEDPARTITIONER::MeshCollection::getNbOfLocalCells() const mcIdType MEDPARTITIONER::MeshCollection::getNbOfLocalFaces() const { - mcIdType const nb=0; + mcIdType nb=0; for (auto i : _face_mesh) { if (i) nb=nb+i->getNumberOfCells(); diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.hxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.hxx index 5ba7b396b..43e71f0f7 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.hxx @@ -49,9 +49,9 @@ namespace MEDPARTITIONER class ConnectZone; class JointFinder; - using DriverType = enum{MedAscii, MedXml, Undefined}; - using NodeMapping = std::multimap, std::pair> ; - using NodeList = std::vector>; + typedef enum{MedAscii, MedXml, Undefined} DriverType; + typedef std::multimap, std::pair > NodeMapping ; + typedef std::vector > NodeList; class MEDPARTITIONER_EXPORT MeshCollection { diff --git a/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx b/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx index 884bcb690..ad8d3105d 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx @@ -18,6 +18,7 @@ // #include "MEDPARTITIONER_ParaDomainSelector.hxx" +#include "MEDPARTITIONER_Graph.hxx" #include "MCType.hxx" #include "MEDCouplingMemArray.hxx" #include "MEDCouplingPointSet.hxx" diff --git a/src/MEDPartitioner/MEDPARTITIONER_ScotchGraph.cxx b/src/MEDPartitioner/MEDPARTITIONER_ScotchGraph.cxx index 1193c29ad..97b2c6739 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ScotchGraph.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ScotchGraph.cxx @@ -50,7 +50,7 @@ SCOTCHGraph::SCOTCHGraph(MEDCoupling::MEDCouplingSkyLineArray* graph, int* edgew SCOTCHGraph::~SCOTCHGraph() = default; -void SCOTCHGraph::partGraph(int ndomain, const std::string& /*options_string*/, ParaDomainSelector* /*sel*/) +void SCOTCHGraph::partGraph(int ndomain, const std::string& options_string, ParaDomainSelector* /*sel*/) { if (MyGlobals::_Verbose>10) std::cout << "proc " << MyGlobals::_Rank << " : SCOTCHGraph::partGraph" << std::endl; diff --git a/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx b/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx index 18f35be7d..be29070d2 100644 --- a/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx +++ b/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx @@ -1076,20 +1076,20 @@ void MEDPARTITIONERTest::verifyMetisOrScotchMedpartitionerOnSmallSizeForMesh(std input=targetName+".xml"; MEDPARTITIONER::ParaDomainSelector parallelizer(false); - MEDPARTITIONER::MeshCollection const collection(input,parallelizer); + MEDPARTITIONER::MeshCollection collection(input,parallelizer); CPPUNIT_ASSERT_EQUAL(3, collection.getMeshDimension()); std::vectorcellMeshes=collection.getMesh(); CPPUNIT_ASSERT_EQUAL(5, (int) cellMeshes.size()); mcIdType nbcells=0; - for (std::size_t i = 0; i < cellMeshes.size(); i++) - nbcells+=cellMeshes[i]->getNumberOfCells(); + for (auto & cellMeshe : cellMeshes) + nbcells+=cellMeshe->getNumberOfCells(); CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), nbcells); std::vectorfaceMeshes=collection.getFaceMesh(); CPPUNIT_ASSERT_EQUAL(5, (int) faceMeshes.size()); mcIdType nbfaces=0; - for (std::size_t i=0; i < faceMeshes.size(); i++) - nbfaces+=faceMeshes[i]->getNumberOfCells(); + for (auto & faceMeshe : faceMeshes) + nbfaces+=faceMeshe->getNumberOfCells(); CPPUNIT_ASSERT_EQUAL(faceMesh->getNumberOfCells(), nbfaces); //merge split meshes and test equality @@ -1508,7 +1508,7 @@ void MEDPARTITIONERTest::testCreateBoundaryFaces2D() if ( okFamIds.count( na2id->second ) || na2id->first[0] != 'J') continue; na2id2 = na2id; - bool const groupOK = false; + bool groupOK = false; while ( !groupOK && ++na2id2 != famName2id.end() ) groupOK = ( na2id2->first.find_first_not_of( na2id->first ) == std::string::npos ); diff --git a/src/MEDPartitioner/Test/TestMEDPARTITIONER.cxx b/src/MEDPartitioner/Test/TestMEDPARTITIONER.cxx index c7e2cc11b..a95650853 100644 --- a/src/MEDPartitioner/Test/TestMEDPARTITIONER.cxx +++ b/src/MEDPartitioner/Test/TestMEDPARTITIONER.cxx @@ -25,3 +25,4 @@ CPPUNIT_TEST_SUITE_REGISTRATION( MEDPARTITIONERTest ); //generic Main program from KERNEL_SRC/src/Basics/Test +#include "BasicMainTest.hxx" -- 2.39.2