From 768a43c8af8acce0486599a5a6706aea4f312ef0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Dec 2024 14:39:19 +0000 Subject: [PATCH] Apply autopep8 formatting --- Cassiopee/Apps/Apps/App.py | 2 +- Cassiopee/Apps/Apps/Chimera/Chimera.py | 16 +- .../Apps/Apps/Chimera/ExtractDoublyDefined.py | 2 +- Cassiopee/Apps/Apps/Chimera/__init__.py | 1 - Cassiopee/Apps/Apps/Coda/ToolboxIBM_CODA.py | 174 +- Cassiopee/Apps/Apps/Coda/__init__.py | 1 - Cassiopee/Apps/Apps/Fast/Common.py | 10 +- Cassiopee/Apps/Apps/Fast/Fast2Kim.py | 32 +- Cassiopee/Apps/Apps/Fast/IBM.py | 205 +- Cassiopee/Apps/Apps/Fast/IBMO.py | 184 +- Cassiopee/Apps/Apps/Fast/IBM_old.py | 97 +- Cassiopee/Apps/Apps/Fast/LBM.py | 18 +- Cassiopee/Apps/Apps/Fast/MB.py | 26 +- Cassiopee/Apps/Apps/Fast/WindTunnelOutPres.py | 43 +- Cassiopee/Apps/Apps/Fast/__init__.py | 1 - Cassiopee/Apps/Apps/Mesh/Cart.py | 18 +- Cassiopee/Apps/Apps/Mesh/Dragon.py | 206 +- Cassiopee/Apps/Apps/Mesh/Mirabelle3.py | 4 +- Cassiopee/Apps/Apps/Mesh/__init__.py | 1 - Cassiopee/Apps/setup.py | 2 +- .../Apps/test/FastIBMWireMeshModel_m1.py | 10 +- .../Apps/test/FastIBMWireMeshModel_t1.py | 8 +- Cassiopee/Apps/test/FastIBM_t8.py | 2 +- Cassiopee/Apps/test/FastLBM_t1.py | 14 +- .../Apps/test/IBMOutletControlPressure_t1.py | 10 +- Cassiopee/Apps/test/IBMrotation.py | 8 +- Cassiopee/Apps/test/IBMrotationCompute_t1.py | 8 +- Cassiopee/Apps/test/IBMrotation_t1.py | 7 +- .../test/Quarantine/FastIBMHybrideCurvi_t1.py | 5 +- Cassiopee/Apps/test/createDragonMesh.py | 6 +- Cassiopee/Apps/test/createDragonMesh_t1.py | 2 +- Cassiopee/Apps/test/getHangingNodesInfoPT.py | 1 - Cassiopee/Apps/test/t1.py | 2 +- Cassiopee/CPlot/CPlot/CPlot.py | 166 +- Cassiopee/CPlot/CPlot/ColorControler.py | 134 +- Cassiopee/CPlot/CPlot/ColorMaps.py | 1567 +++++----- Cassiopee/CPlot/CPlot/Decorator.py | 10 +- Cassiopee/CPlot/CPlot/Log.py | 14 +- Cassiopee/CPlot/CPlot/Menus.py | 8 +- Cassiopee/CPlot/CPlot/Panels.py | 100 +- Cassiopee/CPlot/CPlot/PyTree.py | 126 +- Cassiopee/CPlot/CPlot/Tk.py | 90 +- Cassiopee/CPlot/CPlot/Ttk.py | 32 +- Cassiopee/CPlot/CPlot/tkSearchBar.py | 54 +- Cassiopee/CPlot/apps/CCC.py | 16 +- Cassiopee/CPlot/apps/fly.py | 2 +- Cassiopee/CPlot/apps/streamLine.py | 2 +- Cassiopee/CPlot/apps/tkBC.py | 62 +- Cassiopee/CPlot/apps/tkBackground.py | 14 +- Cassiopee/CPlot/apps/tkBasicSurfs.py | 14 +- Cassiopee/CPlot/apps/tkBlader.py | 32 +- Cassiopee/CPlot/apps/tkBlock.py | 14 +- Cassiopee/CPlot/apps/tkBody.py | 10 +- Cassiopee/CPlot/apps/tkBoolean.py | 16 +- Cassiopee/CPlot/apps/tkCADFix.py | 28 +- Cassiopee/CPlot/apps/tkCADMesh.py | 4 +- Cassiopee/CPlot/apps/tkCamera.py | 2 +- Cassiopee/CPlot/apps/tkCanvas.py | 2 +- Cassiopee/CPlot/apps/tkCartWrap.py | 14 +- Cassiopee/CPlot/apps/tkCassiopee.py | 14 +- Cassiopee/CPlot/apps/tkCassiopeeSolver.py | 4 +- Cassiopee/CPlot/apps/tkCellN.py | 10 +- Cassiopee/CPlot/apps/tkCheckPyTree.py | 4 +- Cassiopee/CPlot/apps/tkChimera.py | 10 +- Cassiopee/CPlot/apps/tkCollarMesh.py | 30 +- Cassiopee/CPlot/apps/tkDemo.py | 4 +- Cassiopee/CPlot/apps/tkDist2Walls.py | 6 +- Cassiopee/CPlot/apps/tkDistributor.py | 14 +- Cassiopee/CPlot/apps/tkDraw.py | 12 +- Cassiopee/CPlot/apps/tkEffects.py | 8 +- Cassiopee/CPlot/apps/tkElsaSolver.py | 6 +- Cassiopee/CPlot/apps/tkExtendSurf.py | 4 +- Cassiopee/CPlot/apps/tkExtractBC.py | 6 +- Cassiopee/CPlot/apps/tkExtractEdges.py | 12 +- Cassiopee/CPlot/apps/tkExtractMesh.py | 4 +- Cassiopee/CPlot/apps/tkExtrusion.py | 16 +- Cassiopee/CPlot/apps/tkFamily.py | 4 +- Cassiopee/CPlot/apps/tkFastSolver.py | 32 +- Cassiopee/CPlot/apps/tkFilter.py | 10 +- Cassiopee/CPlot/apps/tkFind.py | 2 +- Cassiopee/CPlot/apps/tkFixer.py | 2 +- Cassiopee/CPlot/apps/tkFixer2.py | 20 +- Cassiopee/CPlot/apps/tkHats.py | 8 +- Cassiopee/CPlot/apps/tkIBC.py | 18 +- Cassiopee/CPlot/apps/tkIBC2.py | 20 +- Cassiopee/CPlot/apps/tkIBCWorflow.py | 36 +- Cassiopee/CPlot/apps/tkIJK.py | 12 +- Cassiopee/CPlot/apps/tkInit.py | 4 +- Cassiopee/CPlot/apps/tkInteg.py | 6 +- Cassiopee/CPlot/apps/tkIsoLine.py | 10 +- Cassiopee/CPlot/apps/tkIsoSurf.py | 4 +- Cassiopee/CPlot/apps/tkLuxRender.py | 18 +- Cassiopee/CPlot/apps/tkMMGs.py | 4 +- Cassiopee/CPlot/apps/tkMapEdge.py | 40 +- Cassiopee/CPlot/apps/tkMapUV.py | 4 +- Cassiopee/CPlot/apps/tkMeshInfo.py | 12 +- Cassiopee/CPlot/apps/tkMirabelle.py | 4 +- Cassiopee/CPlot/apps/tkNGon.py | 12 +- Cassiopee/CPlot/apps/tkNodeEdit.py | 8 +- Cassiopee/CPlot/apps/tkOctree.py | 14 +- Cassiopee/CPlot/apps/tkOffset.py | 10 +- Cassiopee/CPlot/apps/tkPaint.py | 2 +- Cassiopee/CPlot/apps/tkPerfo.py | 6 +- Cassiopee/CPlot/apps/tkPlot.py | 14 +- Cassiopee/CPlot/apps/tkPlotXY.py | 1074 +++---- Cassiopee/CPlot/apps/tkPovRay.py | 14 +- Cassiopee/CPlot/apps/tkPrefs.py | 8 +- Cassiopee/CPlot/apps/tkProbe.py | 12 +- Cassiopee/CPlot/apps/tkProjection.py | 4 +- Cassiopee/CPlot/apps/tkRenderSet.py | 12 +- Cassiopee/CPlot/apps/tkRenderTree.py | 6 +- Cassiopee/CPlot/apps/tkReorder.py | 2 +- Cassiopee/CPlot/apps/tkRigidMotion.py | 2 +- Cassiopee/CPlot/apps/tkRuler.py | 6 +- Cassiopee/CPlot/apps/tkSculpt.py | 2 +- Cassiopee/CPlot/apps/tkSlice.py | 4 +- Cassiopee/CPlot/apps/tkSmooth.py | 18 +- Cassiopee/CPlot/apps/tkSplit.py | 26 +- Cassiopee/CPlot/apps/tkState.py | 50 +- Cassiopee/CPlot/apps/tkStream.py | 12 +- Cassiopee/CPlot/apps/tkSurfaceWalk.py | 10 +- Cassiopee/CPlot/apps/tkTFI.py | 8 +- Cassiopee/CPlot/apps/tkTransform.py | 6 +- Cassiopee/CPlot/apps/tkTree.py | 42 +- Cassiopee/CPlot/apps/tkTreeOps.py | 2 +- Cassiopee/CPlot/apps/tkVariables.py | 42 +- Cassiopee/CPlot/apps/tkView.py | 70 +- Cassiopee/CPlot/apps/validCassiopee.py | 56 +- Cassiopee/CPlot/apps/validFast.py | 6 +- Cassiopee/CPlot/doc/source/conf.py | 36 +- Cassiopee/CPlot/setup.py | 32 +- Cassiopee/CPlot/setupLegacy.py | 6 +- Cassiopee/CPlot/srcs.py | 106 +- Cassiopee/CPlot/test/addRender2PyTreePT_t1.py | 2 +- Cassiopee/CPlot/test/addRender2ZonePT_t1.py | 2 +- Cassiopee/CPlot/test/changeBlanking.py | 1 - Cassiopee/CPlot/test/createArrowPT.py | 4 +- Cassiopee/CPlot/test/createTextPT.py | 4 +- Cassiopee/CPlot/test/display1D.py | 2 +- Cassiopee/CPlot/test/display1DPT.py | 2 - Cassiopee/CPlot/test/display2.py | 1 - Cassiopee/CPlot/test/display360sPT.py | 2 +- Cassiopee/CPlot/test/displayHO.py | 2 +- Cassiopee/CPlot/test/displayLegend.py | 1 - Cassiopee/CPlot/test/displayOSMesa_m1.py | 2 +- Cassiopee/CPlot/test/displayOSMesa_t2.py | 18 +- Cassiopee/CPlot/test/displayOffScreen.py | 2 +- Cassiopee/CPlot/test/displayOffScreen2.py | 2 +- Cassiopee/CPlot/test/displayScalar.py | 2 +- Cassiopee/CPlot/test/export.py | 2 +- Cassiopee/CPlot/test/replace.py | 1 - Cassiopee/CPlot/test/setDim.py | 1 - Cassiopee/CPlot/test/setShaderPath.py | 1 - Cassiopee/CPlot/test/t1.py | 2 +- Cassiopee/CPlot/test/tkPlotXYBatch.py | 6 +- Cassiopee/CPlot/test/tkPlotXYInteractive.py | 6 +- Cassiopee/CPlot/test/tkPlotXYSingleLine.py | 2 +- Cassiopee/CPlot/test/tkPlotXY_m1.py | 6 +- Cassiopee/CPlot/test/travel.py | 1 - Cassiopee/CPlot/test/travelPT.py | 1 - Cassiopee/Compressor/Compressor/Compressor.py | 4 +- Cassiopee/Compressor/Compressor/PyTree.py | 26 +- Cassiopee/Compressor/doc/source/conf.py | 24 +- Cassiopee/Compressor/setup.py | 30 +- Cassiopee/Compressor/setupLegacy.py | 8 +- Cassiopee/Compressor/srcs.py | 254 +- Cassiopee/Compressor/test/t1.py | 2 +- Cassiopee/Connector/Connector/Connector.py | 118 +- Cassiopee/Connector/Connector/Coupling.py | 25 +- Cassiopee/Connector/Connector/DoubleWall.py | 56 +- Cassiopee/Connector/Connector/IBM.py | 234 +- Cassiopee/Connector/Connector/Mpi.py | 146 +- Cassiopee/Connector/Connector/OversetData.py | 418 +-- .../Connector/Connector/OversetDataDtlocal.py | 100 +- .../Connector/Connector/OversetDataElsA.py | 138 +- Cassiopee/Connector/Connector/PyTree.py | 42 +- .../Connector/ToolboxIBM_Composite.py | 104 +- .../Connector/Connector/compactTransfers.py | 115 +- .../Connector/Connector/elsAChimPreProcess.py | 18 +- Cassiopee/Connector/doc/source/conf.py | 30 +- Cassiopee/Connector/installLib.py | 2 +- Cassiopee/Connector/srcs.py | 2 +- .../test/IBMinterpolateExtrude2Dto3D_t1.py | 4 +- Cassiopee/Connector/test/IBMrectilinear_t1.py | 8 +- .../Connector/test/applyBCOverlapsPT_t1.py | 4 +- Cassiopee/Connector/test/blankCellsPT_t1.py | 7 +- .../Connector/test/blankCellsTetra_t1.py | 3 - .../Connector/test/blankCellsTriPT_t2.py | 1 - .../Connector/test/blankCellsTriPT_t3.py | 1 - Cassiopee/Connector/test/blankCellsTri_t1.py | 3 - Cassiopee/Connector/test/blankCellsTri_t2.py | 1 - Cassiopee/Connector/test/blankCells_t1.py | 4 +- .../Connector/test/blankIntersectingCells.py | 2 +- .../test/blankIntersectingCellsPT.py | 2 +- .../test/blankIntersectingCells_t1.py | 2 +- .../test/blankIntersectingCells_t2.py | 4 +- .../Connector/test/buildFrontIBMPT_t1.py | 2 +- .../Connector/test/buildFrontIBMPT_t2.py | 2 +- Cassiopee/Connector/test/chimeraInfoPT_t1.py | 2 +- Cassiopee/Connector/test/chimeraTransferPT.py | 2 +- .../test/computeFrictionVelocityPT.py | 2 +- .../test/computeFrictionVelocityPT_t1.py | 2 +- Cassiopee/Connector/test/connectMatch.py | 2 +- Cassiopee/Connector/test/connectMatchPT_t3.py | 4 +- Cassiopee/Connector/test/connectMatchPT_t5.py | 2 +- .../Connector/test/connectMatchPeriodicPT.py | 2 +- .../test/connectMatchPeriodicPT_m1.py | 4 +- .../test/connectMatchPeriodicPT_m2.py | 4 +- .../test/connectMatchPeriodicPT_t1.py | 16 +- .../test/connectMatchPeriodicPT_t2.py | 4 +- Cassiopee/Connector/test/connectMatch_t3.py | 2 +- .../Connector/test/connectNearMatchPT_t1.py | 1 - .../Connector/test/connectNearMatchPT_t3.py | 4 +- Cassiopee/Connector/test/dist2wallIBMPT_t1.py | 2 +- .../test/getCEBBIntersectingDomainsPT_t1.py | 2 +- .../test/getCEBBIntersectingDomainsPT_t2.py | 4 +- .../Connector/test/getInterpolatedPointsPT.py | 2 +- .../test/getIntersectingDomainsPT_t1.py | 1 - Cassiopee/Connector/test/maskXRay3.py | 2 +- Cassiopee/Connector/test/maskXRayPT.py | 2 +- Cassiopee/Connector/test/maskXRayPT_t1.py | 2 +- Cassiopee/Connector/test/maskXRay_t1.py | 2 +- .../test/maximizeBlankedCellsPT_t1.py | 4 +- .../Connector/test/maximizeBlankedCells_t1.py | 1 - .../Connector/test/maximizeBlankedCells_t2.py | 1 - Cassiopee/Connector/test/optimizeOverlap.py | 2 +- .../Connector/test/optimizeOverlapPT_t2.py | 2 +- .../Connector/test/optimizeOverlapPT_t3.py | 2 +- .../Connector/test/optimizeOverlapPT_t4.py | 12 +- .../Connector/test/optimizeOverlap_t1.py | 2 +- Cassiopee/Connector/test/prepareIBMData_m1.py | 2 +- Cassiopee/Connector/test/prepareIBMData_t1.py | 2 +- .../Connector/test/setDoublyDefinedBC.py | 2 +- .../Connector/test/setDoublyDefinedBCPT_t3.py | 6 +- .../Connector/test/setDoublyDefinedBC_t2.py | 2 +- .../test/setHoleInterpolatedPtsPT_t6.py | 1 - Cassiopee/Connector/test/setIBCDataPT.py | 2 +- Cassiopee/Connector/test/setIBCDataPT_t1.py | 4 +- .../test/setInterpDataForGCNGonPT.py | 2 +- .../test/setInterpDataForGCNGonPT_t1.py | 2 +- .../Connector/test/setInterpDataIBMPT_t1.py | 2 +- .../Connector/test/setInterpDataIBMPT_t2.py | 2 +- .../Connector/test/setInterpDataPT_t1.py | 2 +- .../Connector/test/setInterpDataPT_t2.py | 6 +- .../Connector/test/setInterpDataPT_t3.py | 2 +- .../Connector/test/setInterpDataPT_t4.py | 8 +- .../Connector/test/setInterpDataPT_t5.py | 12 +- .../Connector/test/setInterpDataPT_t6.py | 2 +- .../Connector/test/setInterpDataPT_t7.py | 4 +- .../Connector/test/setInterpDataPT_t8.py | 4 +- .../Connector/test/setInterpTransfersDPT.py | 4 +- .../test/setInterpTransfersDPT_t1.py | 6 +- .../test/setInterpTransfersDPT_t2.py | 4 +- .../test/setInterpTransfersDPT_t3.py | 2 +- .../Connector/test/setInterpTransfersPT.py | 4 +- .../Connector/test/setInterpTransfersPT_t1.py | 4 +- .../Connector/test/setInterpTransfersPT_t2.py | 4 +- .../Connector/test/setInterpTransfersPT_t3.py | 2 +- .../Connector/test/setInterpTransfersPT_t4.py | 4 +- .../Connector/test/setInterpTransfersPT_t5.py | 4 +- .../Connector/test/setInterpTransfersPT_t7.py | 4 +- .../Connector/test/setInterpTransfersPT_t8.py | 4 +- .../Connector/test/setInterpTransfersPT_t9.py | 2 +- .../Connector/test/setInterpolationsPT_t3.py | 1 - .../Connector/test/setInterpolationsPT_t4.py | 1 - .../Connector/test/setInterpolationsPT_t5.py | 2 +- .../Connector/test/setInterpolationsPT_t6.py | 4 +- Cassiopee/Connector/test/t1.py | 2 +- .../Connector/test/transferVariablesPT.py | 2 +- .../Connector/test/transferVariablesPT_t1.py | 6 +- Cassiopee/Converter/Converter/Array3D.py | 1 - Cassiopee/Converter/Converter/Check.py | 61 +- Cassiopee/Converter/Converter/Converter.py | 84 +- Cassiopee/Converter/Converter/Distributed.py | 94 +- Cassiopee/Converter/Converter/Filter.py | 49 +- Cassiopee/Converter/Converter/Filter2.py | 26 +- Cassiopee/Converter/Converter/GhostCells.py | 309 +- Cassiopee/Converter/Converter/Gmsh.py | 2 +- Cassiopee/Converter/Converter/Internal.py | 74 +- Cassiopee/Converter/Converter/Mpi.py | 16 +- Cassiopee/Converter/Converter/Mpi4py.py | 138 +- Cassiopee/Converter/Converter/Partial.py | 4 +- Cassiopee/Converter/Converter/PyTree.py | 83 +- .../Converter/Converter/cgnskeywords2.py | 85 +- Cassiopee/Converter/Converter/cgnslib2.py | 328 +-- Cassiopee/Converter/Converter/cgnstypes2.py | 8 +- Cassiopee/Converter/Converter/cgnsutils2.py | 68 +- Cassiopee/Converter/Converter/elsAProfile.py | 284 +- Cassiopee/Converter/doc/source/conf.py | 42 +- Cassiopee/Converter/setup.py | 20 +- Cassiopee/Converter/setupLegacy.py | 2 +- Cassiopee/Converter/srcs.py | 3 +- .../test/Quarantine/adapt2FastP_t1.py | 2 +- .../test/Quarantine/addGhostcellNGFastP_t1.py | 5 +- .../Converter/test/adaptPeriodicMatchPT.py | 2 +- .../Converter/test/adaptPeriodicMatchPT_t1.py | 4 +- Cassiopee/Converter/test/addBC2Zone_t1.py | 13 +- Cassiopee/Converter/test/addBXZonesPT_m1.py | 8 +- .../Converter/test/addFlowSolutionEoRPT_t1.py | 8 +- .../Converter/test/addFlowSolutionPT_t1.py | 1 - .../Converter/test/addGhostCellsNGon_t1.py | 3 - Cassiopee/Converter/test/addMXZonesPT_m1.py | 8 +- .../Converter/test/addOutputFrictionPT_t1.py | 2 +- .../test/addPeriodicDataInSolverParamPT.py | 2 +- .../test/addPeriodicDataInSolverParamPT_t1.py | 9 +- Cassiopee/Converter/test/addStatePT_t1.py | 3 +- Cassiopee/Converter/test/addVars_t1.py | 3 +- Cassiopee/Converter/test/addXZonesPT_m1.py | 2 +- Cassiopee/Converter/test/allgatherTreePT.py | 1 - .../Converter/test/allgatherTreePT_m1.py | 1 - .../Converter/test/autoSetContainersPT_t1.py | 1 - .../Converter/test/breakConnectivityPT_t1.py | 2 +- Cassiopee/Converter/test/center2NodeDPT.py | 2 +- Cassiopee/Converter/test/center2NodeMpiPT.py | 2 +- Cassiopee/Converter/test/center2NodePT_m1.py | 2 +- .../Converter/test/computeBCMatchField_t1.py | 2 +- .../Converter/test/computeBCMatchField_t2.py | 2 +- Cassiopee/Converter/test/computeGraphPT_m1.py | 1 - Cassiopee/Converter/test/computeGraphPT_t2.py | 8 +- Cassiopee/Converter/test/conv6.py | 4 - Cassiopee/Converter/test/convAdf.py | 1 - Cassiopee/Converter/test/convFSTL.py | 1 - Cassiopee/Converter/test/convPov.py | 1 - Cassiopee/Converter/test/convWav.py | 2 +- .../Converter/test/convert2elsAxdtPT_t1.py | 1 - .../Converter/test/convertArray2TetraPT.py | 2 +- .../Converter/test/convertArray3D2Array_t1.py | 2 +- .../Converter/test/convertArrays2ZoneNode.py | 1 - .../Converter/test/convertFile2PyTreePT_t1.py | 2 +- .../Converter/test/convertFile2PyTreePT_t4.py | 2 +- Cassiopee/Converter/test/convertHO2LOPT_t1.py | 3 - Cassiopee/Converter/test/convertHO2LO_t1.py | 3 - .../Converter/test/convertHexa2Struct.py | 2 +- Cassiopee/Converter/test/convertHexa2Tetra.py | 2 +- .../Converter/test/convertHexa2Tetra_t1.py | 2 +- Cassiopee/Converter/test/convertLO2HOPT_t1.py | 3 - .../Converter/test/convertPrism2Tetra_t1.py | 2 - .../Converter/test/convertPyTree2Array.py | 2 +- .../Converter/test/convertPyTree2FileMPI.py | 4 +- .../Converter/test/convertPyTree2FilePT_t1.py | 2 +- .../Converter/test/convertPyTree2FilePT_t4.py | 2 +- .../Converter/test/convertStruct2Tetra.py | 2 +- .../Converter/test/convertSurfaceNGonPT_t1.py | 1 - Cassiopee/Converter/test/copyNodePT.py | 2 +- Cassiopee/Converter/test/copyNodePT_t1.py | 2 +- Cassiopee/Converter/test/copyRefPT.py | 2 +- Cassiopee/Converter/test/copyTreePT.py | 4 +- Cassiopee/Converter/test/copyValuePT_t1.py | 2 +- .../Converter/test/correctPyTreePT_t1.py | 6 +- Cassiopee/Converter/test/createChildPT.py | 2 +- .../Converter/test/createUniqueChildPT.py | 2 +- Cassiopee/Converter/test/diffArrays.py | 2 +- Cassiopee/Converter/test/diffArraysPT.py | 2 +- Cassiopee/Converter/test/diffArrays_t1.py | 2 +- Cassiopee/Converter/test/diffArrays_t2.py | 4 +- Cassiopee/Converter/test/ediff.py | 2 +- Cassiopee/Converter/test/elsAProfilePT.py | 12 +- Cassiopee/Converter/test/expressionTest.py | 2 +- .../Converter/test/extractAllBCMatch_t1.py | 1 - .../Converter/test/extractAllBCMatch_t2.py | 7 +- Cassiopee/Converter/test/extractBCFieldsPT.py | 1 - Cassiopee/Converter/test/extractBCMatch_t1.py | 6 +- Cassiopee/Converter/test/extractBCMatch_t2.py | 5 +- Cassiopee/Converter/test/extractBCMatch_t3.py | 6 +- Cassiopee/Converter/test/extractBCMatch_t4.py | 3 +- .../Converter/test/extractBCOfTypePT_t1.py | 2 +- Cassiopee/Converter/test/extractVars.py | 2 +- .../Converter/test/fillEmptyBCWith_t2.py | 2 +- .../Converter/test/fillEmptyBCWith_t3.py | 2 +- .../Converter/test/fillEmptyBCWith_t4.py | 2 +- .../test/fillMissingVariablesPT_t1.py | 1 - Cassiopee/Converter/test/getArgMaxPT_t1.py | 2 +- Cassiopee/Converter/test/getArgMinPT_t1.py | 2 +- Cassiopee/Converter/test/getBCDataSetPT.py | 2 +- Cassiopee/Converter/test/getBCDataSetPT_t1.py | 3 +- .../Converter/test/getBCFaceNodePT_t1.py | 1 - Cassiopee/Converter/test/getBCsPT_t1.py | 3 - .../Converter/test/getFamilyZoneNamesPT.py | 2 +- .../Converter/test/getFamilyZoneNamesPT_t1.py | 2 +- Cassiopee/Converter/test/getIndexField.py | 1 - .../Converter/test/getParentFromTypePT_t1.py | 1 - .../Converter/test/getParentsFromTypePT_t1.py | 2 - Cassiopee/Converter/test/getSizeOfPT_t1.py | 1 - Cassiopee/Converter/test/getStatePT.py | 4 +- Cassiopee/Converter/test/getStatePT_t1.py | 4 +- .../Converter/test/getStdNodesFromName.py | 2 +- .../Converter/test/getStdNodesFromName_t1.py | 2 +- Cassiopee/Converter/test/getValPT.py | 2 +- Cassiopee/Converter/test/getValue.py | 2 +- Cassiopee/Converter/test/getValue_t1.py | 3 - .../Converter/test/identifyElements_t2.py | 2 +- .../Converter/test/identifySolutionsPT_t1.py | 2 +- .../Converter/test/identifySolutionsPT_t2.py | 2 +- .../Converter/test/identifySolutionsPT_t3.py | 2 +- .../Converter/test/identifySolutions_t1.py | 4 +- .../Converter/test/identifySolutions_t2.py | 2 +- Cassiopee/Converter/test/initBCDataSetPT.py | 2 +- .../Converter/test/initBCDataSetPT_t1.py | 2 +- .../Converter/test/loadAndDistributePT_m1.py | 1 - .../Converter/test/makeParentElementsPT.py | 2 +- Cassiopee/Converter/test/mergeBCDataSetPT.py | 2 +- .../Converter/test/mergeBCDataSetPT_t1.py | 2 +- .../Converter/test/mergeConnectivityPT.py | 6 +- .../Converter/test/mergeConnectivityPT_t1.py | 2 +- Cassiopee/Converter/test/mergeTrees_t1.py | 4 +- Cassiopee/Converter/test/nearestNodes_t2.py | 2 +- Cassiopee/Converter/test/newBCPT_t1.py | 2 +- .../Converter/test/newDataConversionPT.py | 2 +- .../test/newDimensionalExponentsPT.py | 2 +- Cassiopee/Converter/test/newFlowSolutionPT.py | 2 +- .../test/newGridConnectivity1to1PT.py | 2 +- .../Converter/test/newGridConnectivityPT.py | 2 +- .../test/newGridConnectivityTypePT.py | 2 +- Cassiopee/Converter/test/newGridLocationPT.py | 4 +- Cassiopee/Converter/test/newOversetHolesPT.py | 2 +- Cassiopee/Converter/test/newPeriodicPT.py | 2 +- Cassiopee/Converter/test/newPointListPT.py | 2 +- Cassiopee/Converter/test/newPointRangePT.py | 4 +- Cassiopee/Converter/test/newPyTree_t1.py | 2 - .../test/newZoneGridConnectivityPT.py | 2 +- .../Converter/test/newZoneSubRegionPT.py | 2 +- .../Converter/test/newZoneSubRegionPT_t1.py | 2 +- Cassiopee/Converter/test/node2CenterPT_t2.py | 2 +- Cassiopee/Converter/test/normL2.py | 2 +- Cassiopee/Converter/test/normL2PT.py | 2 +- Cassiopee/Converter/test/normL2_t1.py | 2 +- Cassiopee/Converter/test/pushBCPT_t1.py | 1 - Cassiopee/Converter/test/randomizeVar_t1.py | 1 - Cassiopee/Converter/test/recoverBCsPT_t2.py | 10 +- .../Converter/test/recoverGlobalIndex.py | 1 - .../Converter/test/recoverGlobalIndexPT.py | 1 - Cassiopee/Converter/test/resignNGonFacesPT.py | 4 +- .../Converter/test/resignNGonFacesPT_t1.py | 2 +- Cassiopee/Converter/test/rmBCDataVarsPT.py | 1 - Cassiopee/Converter/test/rmBCOfNamePT.py | 4 +- Cassiopee/Converter/test/rmBCOfNamePT_t1.py | 4 +- Cassiopee/Converter/test/rmBCOfType.py | 4 +- Cassiopee/Converter/test/rmBCOfType_t2.py | 9 +- Cassiopee/Converter/test/rmGhostCellsNGon.py | 2 +- Cassiopee/Converter/test/sendMPI.py | 2 +- Cassiopee/Converter/test/setNANValuesAt.py | 1 - Cassiopee/Converter/test/setValueIPT.py | 2 +- Cassiopee/Converter/test/setValueIPT_t1.py | 2 +- Cassiopee/Converter/test/signNGonFacesPT.py | 2 +- Cassiopee/Converter/test/t1.py | 2 +- Cassiopee/Converter/test/unsignNGonFacesPT.py | 4 +- .../Converter/test/unsignNGonFacesPT_t1.py | 2 +- Cassiopee/Converter/test/writeZonesPT.py | 2 - Cassiopee/Dist2Walls/Dist2Walls/PyTree.py | 33 +- Cassiopee/Dist2Walls/doc/source/conf.py | 22 +- Cassiopee/Dist2Walls/setup.py | 6 +- Cassiopee/Dist2Walls/setupLegacy.py | 6 +- .../test/dist2WallsEikonalAlgosPT.py | 3 +- .../Dist2Walls/test/dist2WallsEikonalPT.py | 3 +- Cassiopee/Dist2Walls/test/distance2Walls.py | 2 +- .../Dist2Walls/test/distance2WallsPT_t1.py | 1 - .../Dist2Walls/test/distance2Walls_t1.py | 5 +- .../Distributor2/Distributor2/Distributor2.py | 2 +- Cassiopee/Distributor2/Distributor2/PyTree.py | 40 +- Cassiopee/Distributor2/doc/source/conf.py | 24 +- Cassiopee/Distributor2/setup.py | 2 +- Cassiopee/Distributor2/setupLegacy.py | 2 +- Cassiopee/Distributor2/test/addProcNodePT.py | 2 +- .../Distributor2/test/distributePT_m2.py | 2 +- .../Distributor2/test/distributePT_m3.py | 2 +- .../Distributor2/test/distributePT_t1.py | 2 +- .../Distributor2/test/redispatchPT_m1.py | 2 +- Cassiopee/Distributor2/test/t1.py | 2 +- Cassiopee/Generator/Generator/Buildings.py | 2 +- Cassiopee/Generator/Generator/CartGen.py | 82 +- Cassiopee/Generator/Generator/Collar.py | 112 +- Cassiopee/Generator/Generator/Generator.py | 208 +- Cassiopee/Generator/Generator/IBM.py | 130 +- .../Generator/Generator/IBMmodelHeight.py | 6 +- Cassiopee/Generator/Generator/Mpi.py | 2 +- Cassiopee/Generator/Generator/PolyC1.py | 18 +- Cassiopee/Generator/Generator/PolyLine.py | 4 +- Cassiopee/Generator/Generator/PolyTri.py | 2 +- Cassiopee/Generator/Generator/PyTree.py | 146 +- Cassiopee/Generator/Generator/Shapes.py | 20 +- Cassiopee/Generator/Generator/SurfaceWalk.py | 18 +- Cassiopee/Generator/Generator/TFIs.py | 22 +- Cassiopee/Generator/doc/source/conf.py | 28 +- Cassiopee/Generator/installLib.py | 4 +- Cassiopee/Generator/setup.py | 2 +- Cassiopee/Generator/setupLegacy.py | 2 +- Cassiopee/Generator/srcs.py | 34 +- .../Generator/test/CEBBIntersectionPT_t1.py | 2 - .../Generator/test/CEBBIntersection_t1.py | 1 - .../Generator/test/IBMExtrude2Dto3D_t1.py | 6 +- .../Generator/test/IBMExtrude2Dto3D_t2.py | 6 +- Cassiopee/Generator/test/TFI-TRI.py | 4 +- Cassiopee/Generator/test/TFI.py | 6 +- Cassiopee/Generator/test/TFI2D.py | 18 +- Cassiopee/Generator/test/TFI3D.py | 4 +- Cassiopee/Generator/test/TFIMono_t1.py | 2 +- Cassiopee/Generator/test/TFIO_t1.py | 2 +- Cassiopee/Generator/test/TFIPT.py | 4 +- Cassiopee/Generator/test/TFIPT_t1.py | 2 +- Cassiopee/Generator/test/TFIPT_t2.py | 4 +- Cassiopee/Generator/test/TFI_t1.py | 18 +- Cassiopee/Generator/test/TFI_t2.py | 4 +- Cassiopee/Generator/test/TTM.py | 2 +- Cassiopee/Generator/test/TTMPT_t1.py | 4 +- Cassiopee/Generator/test/TTM_t1.py | 4 +- Cassiopee/Generator/test/adaptOctree.py | 2 +- Cassiopee/Generator/test/adaptOctreePT.py | 2 +- Cassiopee/Generator/test/adaptOctreePT_t1.py | 2 +- Cassiopee/Generator/test/adaptOctreePT_t2.py | 2 +- Cassiopee/Generator/test/adaptOctree_t1.py | 2 +- Cassiopee/Generator/test/adaptOctree_t2.py | 2 +- Cassiopee/Generator/test/addNormalLayersPT.py | 2 +- .../Generator/test/addNormalLayersPT_t1.py | 6 +- .../Generator/test/addNormalLayersPT_t2.py | 6 +- .../Generator/test/addNormalLayers_t2.py | 2 +- .../test/addPointInDistribution_t1.py | 1 - Cassiopee/Generator/test/auto.py | 5 +- Cassiopee/Generator/test/bbox.py | 1 - .../Generator/test/bboxIntersectionPT_t2.py | 5 +- .../Generator/test/bboxIntersection_t2.py | 5 +- Cassiopee/Generator/test/bboxOfCellsPT_t2.py | 1 - Cassiopee/Generator/test/bboxPT.py | 1 - Cassiopee/Generator/test/cartHexa.py | 1 - Cassiopee/Generator/test/cartPyra.py | 1 - Cassiopee/Generator/test/close.py | 2 +- Cassiopee/Generator/test/closePT_t1.py | 2 +- Cassiopee/Generator/test/closePT_t2.py | 2 +- Cassiopee/Generator/test/close_t1.py | 2 +- Cassiopee/Generator/test/collarMesh.py | 2 +- Cassiopee/Generator/test/collarMeshPT.py | 2 +- .../Generator/test/constrainedDelaunay.py | 2 +- Cassiopee/Generator/test/cylinder.py | 2 +- Cassiopee/Generator/test/cylinder2.py | 1 - Cassiopee/Generator/test/cylinder3PT_t1.py | 1 - Cassiopee/Generator/test/cylinder3_t1.py | 1 - Cassiopee/Generator/test/cylinderPT.py | 2 +- Cassiopee/Generator/test/cylinderPT_t1.py | 2 +- Cassiopee/Generator/test/cylinder_t1.py | 6 +- Cassiopee/Generator/test/densify_t1.py | 1 - .../Generator/test/enforceCurvature2PT_t1.py | 2 +- .../Generator/test/enforceCurvature2_t1.py | 2 +- Cassiopee/Generator/test/enforceMoinsY_t1.py | 1 - Cassiopee/Generator/test/enforceXPT_t1.py | 2 +- Cassiopee/Generator/test/enforceZ.py | 1 - Cassiopee/Generator/test/enforceZ_t1.py | 2 +- Cassiopee/Generator/test/expandLayer.py | 2 +- Cassiopee/Generator/test/expandLayerPT.py | 2 +- Cassiopee/Generator/test/expandLayerPT_t1.py | 8 +- Cassiopee/Generator/test/expandLayer_t1.py | 16 +- Cassiopee/Generator/test/fittingPlasterPT.py | 1 - .../Generator/test/fittingPlasterPT_t1.py | 1 - Cassiopee/Generator/test/fittingPlaster_t1.py | 1 - Cassiopee/Generator/test/front2Hexa.py | 2 +- Cassiopee/Generator/test/front2Struct.py | 2 +- Cassiopee/Generator/test/gapsmanager_t1.py | 2 +- Cassiopee/Generator/test/gencartmb.py | 2 +- Cassiopee/Generator/test/gencartmb_t1.py | 2 +- .../Generator/test/getAngleRegularityMap.py | 2 +- .../Generator/test/getAngleRegularityMapPT.py | 2 +- .../test/getAngleRegularityMapPT_t1.py | 2 +- .../test/getAngleRegularityMapPT_t2.py | 2 +- .../test/getAngleRegularityMap_t1.py | 2 +- .../Generator/test/getCircumCircleMap_t1.py | 1 - Cassiopee/Generator/test/getEdgeRatio_t1.py | 4 +- Cassiopee/Generator/test/getInCircleMap_t1.py | 1 - Cassiopee/Generator/test/getMaxLength_t1.py | 4 +- .../Generator/test/getOrthogonalityMap.py | 2 +- .../Generator/test/getOrthogonalityMapPT.py | 2 +- .../test/getOrthogonalityMapPT_t1.py | 2 +- .../Generator/test/getOrthogonalityMap_t1.py | 3 +- Cassiopee/Generator/test/getRegularityMap.py | 2 +- .../Generator/test/getRegularityMapPT.py | 2 +- .../Generator/test/getRegularityMapPT_t1.py | 2 +- .../Generator/test/getRegularityMap_t1.py | 2 +- Cassiopee/Generator/test/getTriQualityMap.py | 2 +- .../Generator/test/getTriQualityMapPT.py | 1 - .../Generator/test/getTriQualityMap_t1.py | 1 - Cassiopee/Generator/test/hyper2d4.py | 4 - Cassiopee/Generator/test/hyper2d4PT.py | 3 - Cassiopee/Generator/test/mapSplitPT_t1.py | 2 +- Cassiopee/Generator/test/naca0012.py | 2 - .../Generator/test/octree2StructPT_t3.py | 1 - Cassiopee/Generator/test/octree2Struct_t3.py | 1 - Cassiopee/Generator/test/octree_t1.py | 4 +- Cassiopee/Generator/test/pointedHatPT_t1.py | 1 - Cassiopee/Generator/test/refinePT_t1.py | 2 +- Cassiopee/Generator/test/snapFront.py | 2 +- Cassiopee/Generator/test/snapFront_t1.py | 12 +- Cassiopee/Generator/test/snapSharpEdges.py | 2 +- Cassiopee/Generator/test/surfaceWalk.py | 2 +- Cassiopee/Generator/test/surfaceWalkPT.py | 2 +- Cassiopee/Generator/test/surfaceWalkPT_t1.py | 4 +- Cassiopee/Generator/test/zipPT.py | 4 +- Cassiopee/Generator/test/zipPT_t1.py | 4 +- Cassiopee/Geom/Geom/Geom.py | 36 +- Cassiopee/Geom/Geom/IBM.py | 48 +- Cassiopee/Geom/Geom/MapEdge.py | 18 +- Cassiopee/Geom/Geom/Offset.py | 8 +- Cassiopee/Geom/Geom/Parametrics.py | 3 +- Cassiopee/Geom/Geom/PyTree.py | 66 +- Cassiopee/Geom/Geom/text1.py | 3 +- Cassiopee/Geom/doc/source/conf.py | 30 +- Cassiopee/Geom/setup.py | 2 +- Cassiopee/Geom/setupLegacy.py | 2 +- Cassiopee/Geom/test/bezier_t1.py | 2 +- Cassiopee/Geom/test/changeIBCTypePT.py | 2 +- Cassiopee/Geom/test/changeIBCTypePT_t1.py | 2 +- Cassiopee/Geom/test/connect1D_t1.py | 1 - Cassiopee/Geom/test/enforceh.py | 2 +- .../Geom/test/getCurvatureRadiusPT_t1.py | 2 +- Cassiopee/Geom/test/getCurvatureRadius_t1.py | 8 +- .../Geom/test/getCurvilinearAbscissa_t1.py | 1 - Cassiopee/Geom/test/getDistributionPT_t1.py | 1 - Cassiopee/Geom/test/getDistribution_t1.py | 1 - Cassiopee/Geom/test/getLengthPT_t1.py | 2 +- Cassiopee/Geom/test/getLength_t1.py | 2 +- Cassiopee/Geom/test/getSharpestAngle.py | 2 +- Cassiopee/Geom/test/getSharpestAnglePT.py | 2 +- Cassiopee/Geom/test/getSharpestAnglePT_t1.py | 2 +- Cassiopee/Geom/test/getSharpestAngle_t1.py | 4 +- Cassiopee/Geom/test/getTangentPT.py | 2 +- Cassiopee/Geom/test/getTangentPT_t1.py | 2 +- Cassiopee/Geom/test/initInjPT_t1.py | 2 +- Cassiopee/Geom/test/initOutflowPT_t1.py | 2 +- Cassiopee/Geom/test/lineDrivePT_t1.py | 2 +- Cassiopee/Geom/test/lineDrive_t1.py | 2 +- Cassiopee/Geom/test/nurbsPT.py | 2 +- Cassiopee/Geom/test/nurbsPT_t1.py | 2 +- Cassiopee/Geom/test/orthoDrive.py | 1 - Cassiopee/Geom/test/orthoDrivePT.py | 1 - Cassiopee/Geom/test/refine.py | 1 - Cassiopee/Geom/test/refinePT.py | 1 - Cassiopee/Geom/test/spline.py | 1 - Cassiopee/Geom/test/text2DPT_t1.py | 2 +- Cassiopee/Geom/test/transformTc2PT.py | 2 +- Cassiopee/Geom/test/transformTc2PT_t1.py | 2 +- Cassiopee/Initiator/Initiator/Initiator.py | 8 +- Cassiopee/Initiator/Initiator/MeshSize.py | 2 +- Cassiopee/Initiator/Initiator/PyTree.py | 20 +- Cassiopee/Initiator/doc/source/conf.py | 24 +- Cassiopee/Initiator/setup.py | 2 +- Cassiopee/Initiator/setupLegacy.py | 2 +- Cassiopee/Initiator/test/adim1.py | 6 +- Cassiopee/Initiator/test/adim2.py | 6 +- Cassiopee/Initiator/test/adim3.py | 6 +- Cassiopee/Initiator/test/dim1.py | 6 +- Cassiopee/Initiator/test/dim2.py | 6 +- Cassiopee/Initiator/test/dim3.py | 8 +- Cassiopee/Initiator/test/initConstPT_t2.py | 2 +- Cassiopee/Initiator/test/lambPT_t1.py | 2 +- Cassiopee/Initiator/test/lambPT_t2.py | 2 +- Cassiopee/Initiator/test/overlay2.py | 3 - Cassiopee/Initiator/test/scullyPT_t2.py | 2 +- Cassiopee/Initiator/test/visbalPT_t1.py | 2 +- Cassiopee/Initiator/test/visbalPT_t2.py | 2 +- Cassiopee/Initiator/test/wissocqPT_t2.py | 2 +- Cassiopee/Initiator/test/yeePT_t2.py | 2 +- .../Intersector/Intersector/Intersector.py | 126 +- Cassiopee/Intersector/Intersector/Mpi.py | 22 +- Cassiopee/Intersector/Intersector/PyTree.py | 314 +- .../Intersector/Intersector/TurboMachine.py | 52 +- .../Intersector/PolyMeshTools/hook_hmesh.py | 10 +- .../Intersector/PolyMeshTools/prepare.py | 2 +- .../Intersector/PolyMeshTools/regularize.py | 8 +- Cassiopee/Intersector/doc/source/conf.py | 24 +- Cassiopee/Intersector/setup.py | 2 +- Cassiopee/Intersector/setupLegacy.py | 2 +- Cassiopee/Intersector/srcs.py | 3 +- .../test/P1ConsChimeraCoeffs_t1.py | 3 - .../test/Quarantine/adaptCellsPT_m1.py | 2 +- .../test/Quarantine/adaptCellsPT_m2.py | 2 +- .../test/Quarantine/getCollidingCellsPT_t1.py | 2 +- .../test/Quarantine/getCollidingCells_t1.py | 3 +- Cassiopee/Intersector/test/adaptBox.py | 1 - Cassiopee/Intersector/test/adaptBoxPT_t1.py | 1 - Cassiopee/Intersector/test/adaptBox_t1.py | 1 - Cassiopee/Intersector/test/adaptCells.py | 1 - .../Intersector/test/adaptCellsCenter.py | 5 +- .../Intersector/test/adaptCellsCenterPT.py | 10 +- .../Intersector/test/adaptCellsCenterPT_t1.py | 12 +- .../Intersector/test/adaptCellsCenter_t1.py | 2 +- Cassiopee/Intersector/test/adaptCellsDynPT.py | 4 +- Cassiopee/Intersector/test/adaptCellsNodal.py | 1 - .../Intersector/test/adaptCellsNodalPT.py | 10 +- .../Intersector/test/adaptCellsNodalPT_t1.py | 10 +- .../Intersector/test/adaptCellsNodal_t1.py | 4 +- Cassiopee/Intersector/test/adaptCellsPT.py | 7 +- Cassiopee/Intersector/test/adaptCellsPT_t1.py | 7 +- .../Intersector/test/adaptCellsPT_t10.py | 10 +- .../Intersector/test/adaptCellsPT_t11.py | 8 - .../Intersector/test/adaptCellsPT_t12.py | 16 +- .../Intersector/test/adaptCellsPT_t13.py | 8 - .../Intersector/test/adaptCellsPT_t14.py | 7 +- .../Intersector/test/adaptCellsPT_t15.py | 3 +- .../Intersector/test/adaptCellsPT_t16.py | 1 - Cassiopee/Intersector/test/adaptCellsPT_t2.py | 7 +- Cassiopee/Intersector/test/adaptCellsPT_t3.py | 8 +- Cassiopee/Intersector/test/adaptCellsPT_t4.py | 5 +- Cassiopee/Intersector/test/adaptCellsPT_t5.py | 2 +- Cassiopee/Intersector/test/adaptCellsPT_t6.py | 4 +- Cassiopee/Intersector/test/adaptCellsPT_t7.py | 2 +- Cassiopee/Intersector/test/adaptCellsPT_t8.py | 12 +- Cassiopee/Intersector/test/adaptCellsPT_t9.py | 8 - Cassiopee/Intersector/test/adaptCells_t1.py | 1 - Cassiopee/Intersector/test/adaptCells_t2.py | 1 - .../test/agglomerateNonStarCells.py | 1 - .../test/agglomerateNonStarCellsPT.py | 1 - .../test/agglomerateNonStarCells_t1.py | 1 - .../Intersector/test/agglomerateSmallCells.py | 3 +- .../test/agglomerateSmallCellsPT.py | 5 +- .../test/agglomerateSmallCellsPT_t1.py | 2 +- .../test/agglomerateSmallCells_t1.py | 2 +- .../test/booleanIntersectionNGPT_t1.py | 2 +- .../test/booleanIntersectionPT_t2.py | 1 - .../test/booleanIntersection_t1.py | 1 - .../test/booleanIntersection_t2.py | 1 - Cassiopee/Intersector/test/booleanMinus.py | 1 - Cassiopee/Intersector/test/booleanMinusNG.py | 2 +- .../Intersector/test/booleanMinusNGPT_t1.py | 2 +- .../Intersector/test/booleanMinusNG_t1.py | 2 +- .../Intersector/test/booleanMinusPT_t2.py | 1 - Cassiopee/Intersector/test/booleanMinus_t1.py | 1 - Cassiopee/Intersector/test/booleanMinus_t2.py | 1 - Cassiopee/Intersector/test/booleanUnion.py | 1 - Cassiopee/Intersector/test/booleanUnionNG.py | 2 +- .../Intersector/test/booleanUnionNGPT_t1.py | 2 +- .../Intersector/test/booleanUnionNGPT_t2.py | 2 +- .../Intersector/test/booleanUnionNGPT_t4.py | 4 +- .../Intersector/test/booleanUnionNG_t1.py | 2 +- .../Intersector/test/booleanUnionPT_t2.py | 1 - Cassiopee/Intersector/test/booleanUnion_t1.py | 1 - Cassiopee/Intersector/test/booleanUnion_t2.py | 1 - .../Intersector/test/checkCellsClosure.py | 3 - Cassiopee/Intersector/test/closeCellsPT.py | 1 - Cassiopee/Intersector/test/closeCellsPT_t1.py | 1 - .../Intersector/test/concatenatePT_t1.py | 14 +- .../Intersector/test/conformUnstrPT_t1.py | 1 - Cassiopee/Intersector/test/conformUnstr_t1.py | 1 - Cassiopee/Intersector/test/convexifyFaces.py | 1 - .../Intersector/test/convexifyFacesPT.py | 1 - Cassiopee/Intersector/test/diffMesh.py | 3 +- Cassiopee/Intersector/test/diffMeshPT.py | 3 +- Cassiopee/Intersector/test/diffMeshPT_t1.py | 3 +- Cassiopee/Intersector/test/diffMesh_t1.py | 3 +- Cassiopee/Intersector/test/diffSurf.py | 3 +- Cassiopee/Intersector/test/diffSurfPT.py | 5 +- Cassiopee/Intersector/test/diffSurfPT_t1.py | 2 +- Cassiopee/Intersector/test/diffSurf_t1.py | 2 +- .../Intersector/test/extractPathologicals.py | 1 - .../test/extractPathologicals_t1.py | 1 - .../Intersector/test/getCollidingCells.py | 3 +- .../Intersector/test/getCollidingCellsPT.py | 2 +- .../Intersector/test/getOverlappingFaces.py | 4 +- .../Intersector/test/getOverlappingFacesPT.py | 4 +- .../test/getOverlappingFacesPT_t1.py | 4 +- .../test/getOverlappingFaces_t1.py | 4 +- Cassiopee/Intersector/test/intersection_t1.py | 1 - .../Intersector/test/prepareCellsSplit.py | 3 +- .../Intersector/test/prepareCellsSplitPT.py | 3 +- .../test/prepareCellsSplitPT_t1.py | 12 +- .../Intersector/test/prepareCellsSplit_t1.py | 12 +- Cassiopee/Intersector/test/simplifyCells.py | 1 - Cassiopee/Intersector/test/simplifyCellsPT.py | 1 - .../Intersector/test/simplifyCells_t1.py | 1 - Cassiopee/Intersector/test/splitCells.py | 5 +- Cassiopee/Intersector/test/splitCellsPT.py | 5 +- Cassiopee/Intersector/test/splitCellsPT_t1.py | 4 +- Cassiopee/Intersector/test/splitCells_t1.py | 1 - .../Intersector/test/syncPerioFacesPT.py | 4 +- .../Intersector/test/syncPerioFacesPT_t1.py | 6 +- Cassiopee/Intersector/test/t1.py | 2 +- .../test/triangulateExteriorFaces.py | 1 - Cassiopee/Intersector/test/xcellnSph6PT_t1.py | 1 - .../Intersector/test/xcellnSphYinYangPT.py | 1 - Cassiopee/KCore/Dist.py | 86 +- Cassiopee/KCore/KCore/Adim.py | 8 +- Cassiopee/KCore/KCore/Vector.py | 2 +- Cassiopee/KCore/KCore/test.py | 12 +- Cassiopee/KCore/doc/source/conf.py | 24 +- Cassiopee/KCore/installBase.py | 2622 ++++++++--------- Cassiopee/KCore/installer.py | 12 +- Cassiopee/KCore/setup.py | 4 +- Cassiopee/KCore/setupLegacy.py | 6 +- Cassiopee/KCore/srcs.py | 98 +- Cassiopee/KCore/test/compareSessionLogs.py | 10 +- Cassiopee/KCore/test/notifyCheckout.py | 12 +- Cassiopee/KCore/test/notifyInstall.py | 10 +- Cassiopee/KCore/test/notifyValid.py | 12 +- Cassiopee/KCore/test/tester3.py | 1 - Cassiopee/KCore/test/tester4.py | 2 +- Cassiopee/Modeler/Modeler/Animator2D.py | 19 +- Cassiopee/Modeler/Modeler/Boxes.py | 2 +- Cassiopee/Modeler/Modeler/Cylinders.py | 2 +- Cassiopee/Modeler/Modeler/Hubs.py | 6 +- Cassiopee/Modeler/Modeler/Perso2D.py | 8 +- Cassiopee/Modeler/Modeler/Screws.py | 6 +- Cassiopee/Modeler/Modeler/Sound.py | 16 +- Cassiopee/Modeler/Modeler/SoundLess.py | 2 +- Cassiopee/Modeler/Modeler/Spirographs.py | 4 +- Cassiopee/Modeler/Modeler/Walls.py | 2 +- Cassiopee/Modeler/Modeler/Wings.py | 25 +- Cassiopee/Modeler/Modeler/WingsPT.py | 26 +- Cassiopee/Modeler/Modeler/World2D.py | 6 +- Cassiopee/Modeler/Modeler/WorldZ.py | 13 +- Cassiopee/Modeler/doc/source/conf.py | 24 +- Cassiopee/Modeler/setup.py | 2 +- Cassiopee/Modeler/test/animator2D.py | 2 +- Cassiopee/Modeler/test/animator2DParticles.py | 1 - Cassiopee/Modeler/test/animator2DViz.py | 3 +- Cassiopee/Modeler/test/box2.py | 2 +- Cassiopee/Modeler/test/column.py | 2 +- Cassiopee/Modeler/test/column_t1.py | 2 +- Cassiopee/Modeler/test/table.py | 1 - Cassiopee/Modeler/test/walk.py | 6 +- Cassiopee/Modeler/test/worldZ0.py | 2 +- Cassiopee/Modeler/test/worldZ1.py | 8 +- Cassiopee/Modeler/test/worldZ2.py | 8 +- Cassiopee/OCC/OCC/OCC.py | 32 +- Cassiopee/OCC/OCC/PyTree.py | 30 +- Cassiopee/OCC/OCC/depend.py | 10 +- Cassiopee/OCC/doc/source/conf.py | 24 +- Cassiopee/OCC/setup.py | 4 +- Cassiopee/OCC/setupLegacy.py | 2 +- Cassiopee/OCC/srcs.py | 80 +- .../Quarantine/getNodalParametersPT_t1.py | 8 +- .../OCC/test/Quarantine/linkNodes2CADPT_t1.py | 4 +- Cassiopee/OCC/test/getNodalParametersPT.py | 8 +- Cassiopee/OCC/test/linkNodes2CADPT.py | 8 +- Cassiopee/Post/Post/ExtraVariables2.py | 16 +- Cassiopee/Post/Post/IBM.py | 56 +- Cassiopee/Post/Post/IBM_OLDIES.py | 40 +- Cassiopee/Post/Post/Mpi.py | 6 +- Cassiopee/Post/Post/Post.py | 45 +- Cassiopee/Post/Post/Probe.py | 54 +- Cassiopee/Post/Post/PyTree.py | 132 +- Cassiopee/Post/Post/Rotor.py | 34 +- Cassiopee/Post/Post/extraVariables.py | 16 +- Cassiopee/Post/Post/extraVariablesPT.py | 36 +- Cassiopee/Post/doc/source/conf.py | 34 +- Cassiopee/Post/setup.py | 4 +- Cassiopee/Post/setupLegacy.py | 4 +- Cassiopee/Post/srcs.py | 36 +- Cassiopee/Post/test/coarsen_t1.py | 2 +- Cassiopee/Post/test/computeCurl2.py | 2 +- Cassiopee/Post/test/computeCurlPT.py | 2 +- Cassiopee/Post/test/computeCurlPT_t1.py | 8 +- Cassiopee/Post/test/computeCurlPT_t2.py | 10 +- Cassiopee/Post/test/computeDiffPT.py | 2 +- Cassiopee/Post/test/computeDiffPT_t1.py | 6 +- Cassiopee/Post/test/computeDiffPT_t2.py | 6 +- Cassiopee/Post/test/computeDiffPT_t3.py | 1 - Cassiopee/Post/test/computeDiff_t1.py | 8 +- Cassiopee/Post/test/computeDiff_t2.py | 24 +- Cassiopee/Post/test/computeDiff_t3.py | 22 +- Cassiopee/Post/test/computeDiv2PT_t2.py | 6 +- Cassiopee/Post/test/computeDiv2PT_t3.py | 2 +- Cassiopee/Post/test/computeDiv2PT_t4.py | 2 +- Cassiopee/Post/test/computeDivPT_t3.py | 1 - Cassiopee/Post/test/computeGrad2PT_t2.py | 3 +- Cassiopee/Post/test/computeGrad2PT_t3.py | 3 +- Cassiopee/Post/test/computeGrad2PT_t4.py | 9 +- Cassiopee/Post/test/computeGrad2PT_t5.py | 9 +- Cassiopee/Post/test/computeGrad2_t1.py | 2 +- Cassiopee/Post/test/computeGradPT_t3.py | 1 - Cassiopee/Post/test/computeGrad_t2.py | 8 +- Cassiopee/Post/test/computeIndicatorField.py | 2 +- .../Post/test/computeIndicatorFieldPT.py | 4 +- .../Post/test/computeIndicatorFieldPT_t1.py | 2 +- .../Post/test/computeIndicatorField_t1.py | 2 +- Cassiopee/Post/test/computeIndicatorValue.py | 2 +- .../Post/test/computeIndicatorValuePT.py | 2 +- .../Post/test/computeIndicatorValuePT_t1.py | 2 +- .../Post/test/computeIndicatorValue_t1.py | 2 +- Cassiopee/Post/test/computeNormCurlPT.py | 2 +- Cassiopee/Post/test/computeNormCurlPT_t1.py | 8 +- Cassiopee/Post/test/computeNormCurlPT_t2.py | 10 +- Cassiopee/Post/test/computeNormCurl_t1.py | 1 - Cassiopee/Post/test/computeVariables2PT_t1.py | 6 +- Cassiopee/Post/test/computeVariables2PT_t2.py | 6 +- Cassiopee/Post/test/computeVariables2PT_t3.py | 6 +- Cassiopee/Post/test/computeVariables2_t1.py | 4 +- Cassiopee/Post/test/computeVariablesBCPT.py | 2 +- Cassiopee/Post/test/computeVariablesPT_t1.py | 2 +- Cassiopee/Post/test/computeVariablesPT_t2.py | 2 +- Cassiopee/Post/test/computeVariables_t1.py | 8 +- .../Post/test/computeWallShearStressPT.py | 2 +- .../Post/test/computeWallShearStressPT_t1.py | 4 +- .../enforceIndicatorForCoarsestLevel_t1.py | 2 +- .../test/enforceIndicatorForFinestLevel_t1.py | 3 +- Cassiopee/Post/test/exteriorEltsPT_t1.py | 1 - Cassiopee/Post/test/exteriorFacesPT_t1.py | 2 +- Cassiopee/Post/test/exteriorFacesPT_t3.py | 2 +- .../Post/test/exteriorFacesStructuredPT_t1.py | 6 +- .../Post/test/exteriorFacesStructuredPT_t2.py | 4 +- Cassiopee/Post/test/extractMesh3.py | 2 +- Cassiopee/Post/test/extractMeshPT.py | 2 +- Cassiopee/Post/test/extractMeshPT_m1.py | 2 +- Cassiopee/Post/test/extractMeshPT_t2.py | 4 +- Cassiopee/Post/test/extractMesh_t3.py | 1 - Cassiopee/Post/test/extractMesh_t4.py | 1 - Cassiopee/Post/test/extractPlane_t1.py | 1 - Cassiopee/Post/test/extractPlane_t2.py | 1 - Cassiopee/Post/test/extractPoint_t1.py | 2 +- Cassiopee/Post/test/extractPoint_t3.py | 5 +- Cassiopee/Post/test/extractRadiusPT.py | 2 +- Cassiopee/Post/test/extractSlicesPT.py | 2 +- Cassiopee/Post/test/extractSlicesPT_t1.py | 4 +- Cassiopee/Post/test/extractThetaPT.py | 2 +- Cassiopee/Post/test/integ.py | 1 - Cassiopee/Post/test/integ2.py | 1 - Cassiopee/Post/test/integ2D.py | 2 +- Cassiopee/Post/test/integ3.py | 1 - Cassiopee/Post/test/integ4.py | 6 +- Cassiopee/Post/test/integ5.py | 4 +- Cassiopee/Post/test/integ6.py | 5 +- Cassiopee/Post/test/integMoment.py | 2 +- Cassiopee/Post/test/integMoment2.py | 4 +- Cassiopee/Post/test/integMomentNorm.py | 2 +- Cassiopee/Post/test/integMomentNormPT_t1.py | 8 +- Cassiopee/Post/test/integMomentPT_t1.py | 2 +- Cassiopee/Post/test/integMoment_t1.py | 10 +- Cassiopee/Post/test/integNorm.py | 2 +- Cassiopee/Post/test/integNormPT_m1.py | 1 - Cassiopee/Post/test/integNormPT_t1.py | 2 +- Cassiopee/Post/test/integNormProduct.py | 2 +- Cassiopee/Post/test/integNormProductPT_t1.py | 2 +- Cassiopee/Post/test/integNormProduct_t1.py | 1 - Cassiopee/Post/test/integPT_t1.py | 4 +- Cassiopee/Post/test/integPT_t2.py | 4 +- Cassiopee/Post/test/integ_t1.py | 10 +- Cassiopee/Post/test/interiorFaces.py | 2 +- Cassiopee/Post/test/interiorFacesPT_t1.py | 4 +- Cassiopee/Post/test/interiorFacesPT_t2.py | 4 +- Cassiopee/Post/test/interiorFaces_t1.py | 5 +- Cassiopee/Post/test/isoSurf_t1.py | 2 +- Cassiopee/Post/test/probePT_m2.py | 2 +- Cassiopee/Post/test/selectCells2PT_t2.py | 2 +- Cassiopee/Post/test/selectCells2PT_t3.py | 2 +- Cassiopee/Post/test/selectCells2PT_t4.py | 9 +- Cassiopee/Post/test/selectCells2_t3.py | 2 +- Cassiopee/Post/test/selectCellsPT_t3.py | 3 +- Cassiopee/Post/test/selectCellsPT_t4.py | 1 - Cassiopee/Post/test/selectCellsPT_t5.py | 4 +- Cassiopee/Post/test/selectCells_t2.py | 2 +- Cassiopee/Post/test/sharpEdges_t1.py | 2 +- Cassiopee/Post/test/silhouette.py | 2 +- Cassiopee/Post/test/silhouettePT.py | 2 +- Cassiopee/Post/test/silhouettePT_t1.py | 4 +- Cassiopee/Post/test/silhouette_t1.py | 6 +- Cassiopee/Post/test/streamLinePT.py | 2 +- Cassiopee/Post/test/streamRibbonPT.py | 4 +- Cassiopee/Post/test/streamRibbonPT_t1.py | 2 +- Cassiopee/Post/test/streamRibbon_t1.py | 4 +- Cassiopee/Post/test/streamSurfPT.py | 2 +- Cassiopee/Post/test/toutInteg.py | 3 - Cassiopee/Post/test/toutIntegMomentNorm.py | 4 - Cassiopee/Post/test/toutIntegNorm.py | 5 - Cassiopee/Post/test/usurp.py | 2 +- Cassiopee/Post/test/usurp2.py | 5 +- Cassiopee/Post/test/usurp_t1.py | 2 +- Cassiopee/Post/test/usurp_t2.py | 2 +- Cassiopee/Post/test/zipper2.py | 1 - Cassiopee/RigidMotion/RigidMotion/PyTree.py | 65 +- .../RigidMotion/RigidMotion/RigidMotion.py | 6 +- Cassiopee/RigidMotion/doc/source/conf.py | 24 +- Cassiopee/RigidMotion/setup.py | 2 +- Cassiopee/RigidMotion/setupLegacy.py | 2 +- Cassiopee/RigidMotion/srcs.py | 2 +- .../RigidMotion/test/evalGridSpeed3PT.py | 4 +- Cassiopee/RigidMotion/test/evalGridSpeedPT.py | 2 +- .../RigidMotion/test/evalGridSpeedPT_t2.py | 6 +- .../RigidMotion/test/evalGridSpeedPT_t3.py | 2 +- Cassiopee/RigidMotion/test/evalPosition1PT.py | 2 +- Cassiopee/RigidMotion/test/evalPosition2PT.py | 4 +- Cassiopee/RigidMotion/test/evalPosition3PT.py | 4 +- .../RigidMotion/test/evalPosition3PT_t1.py | 4 +- .../RigidMotion/test/evalPositionM12PT.py | 8 +- .../RigidMotion/test/evalPositionM12PT_t1.py | 8 +- .../RigidMotion/test/evalPositionM13PT.py | 8 +- .../RigidMotion/test/evalPositionM13PT_t1.py | 8 +- .../RigidMotion/test/evalPositionPT_t1.py | 2 +- .../RigidMotion/test/evalPositionPT_t2.py | 6 +- .../RigidMotion/test/evalPositionPT_t3.py | 2 +- .../test/setPrescribedMotion1PT.py | 2 +- .../test/setPrescribedMotion2PT.py | 4 +- .../test/setPrescribedMotion2PT_t1.py | 4 +- .../test/setPrescribedMotion3PT.py | 2 +- .../test/setPrescribedMotion3PT_t1.py | 4 +- .../test/setRotorMotionCoordsAndGridVelPT.py | 6 +- .../setRotorMotionCoordsAndGridVelPT_t1.py | 4 +- Cassiopee/Template/setupLegacy.py | 2 +- Cassiopee/Transform/Transform/PyTree.py | 112 +- Cassiopee/Transform/Transform/Stick.py | 4 +- Cassiopee/Transform/Transform/Transform.py | 220 +- Cassiopee/Transform/doc/source/conf.py | 24 +- Cassiopee/Transform/setup.py | 2 +- Cassiopee/Transform/setupLegacy.py | 2 +- Cassiopee/Transform/test/addkplane_t2.py | 1 - .../Transform/test/breakElementsPT_t1.py | 3 - Cassiopee/Transform/test/collapse_t1.py | 2 - Cassiopee/Transform/test/contractPT_t1.py | 8 +- Cassiopee/Transform/test/contractPT_t2.py | 6 +- Cassiopee/Transform/test/deform2.py | 2 +- Cassiopee/Transform/test/deformMeshPT_t1.py | 2 +- Cassiopee/Transform/test/dual.py | 2 - Cassiopee/Transform/test/dualPT_t1.py | 2 +- Cassiopee/Transform/test/homothetyPT_t1.py | 6 +- Cassiopee/Transform/test/homothetyPT_t2.py | 6 +- Cassiopee/Transform/test/joinPT_t3.py | 2 +- Cassiopee/Transform/test/join_t4.py | 3 +- Cassiopee/Transform/test/join_t6.py | 1 - Cassiopee/Transform/test/mergePT_t2.py | 2 - Cassiopee/Transform/test/patch.py | 2 +- Cassiopee/Transform/test/patchPT.py | 2 +- Cassiopee/Transform/test/patchPT_t1.py | 2 +- Cassiopee/Transform/test/perturbatePT_t1.py | 12 +- .../Transform/test/projectAllDirsPT_t1.py | 2 +- Cassiopee/Transform/test/projectOrtho_t1.py | 1 - Cassiopee/Transform/test/reorderAll.py | 3 +- Cassiopee/Transform/test/reorderPT_t3.py | 24 +- Cassiopee/Transform/test/rotate.py | 2 +- Cassiopee/Transform/test/rotatePT.py | 2 +- Cassiopee/Transform/test/rotatePT_t3.py | 2 +- Cassiopee/Transform/test/rotate_t4.py | 2 +- Cassiopee/Transform/test/smoothFieldPT_t1.py | 1 - Cassiopee/Transform/test/splitManifold.py | 2 - Cassiopee/Transform/test/splitManifoldPT.py | 1 - .../Transform/test/splitManifoldPT_t1.py | 4 - Cassiopee/Transform/test/splitManifold_t1.py | 2 - .../Transform/test/splitMultiplePtsPT2.py | 2 +- Cassiopee/Transform/test/splitTBranches.py | 1 - Cassiopee/Transform/test/splitTBranchesPT.py | 1 - Cassiopee/Transform/test/subzonePT_t1.py | 4 +- Cassiopee/Transform/test/subzonePT_t3.py | 2 +- Cassiopee/Transform/test/symetrizePT_t1.py | 8 +- Cassiopee/Transform/test/symetrizePT_t2.py | 6 +- Cassiopee/Transform/test/translatePT_t2.py | 1 - Cassiopee/XCore/XCore/AdaptMesh/test.py | 2 +- Cassiopee/XCore/XCore/PyTree.py | 10 +- Cassiopee/XCore/createLinks.py | 4 +- Cassiopee/XCore/installLib.py | 4 +- Cassiopee/XCore/setup.py | 22 +- Cassiopee/XCore/setupLegacy.py | 2 +- Cassiopee/XCore/srcs.py | 26 +- Cassiopee/XCore/srcs_scotch.py | 699 +++-- Cassiopee/XCore/srcs_zoltan.py | 146 +- Cassiopee/XCore/test/elementSplitSmallTest.py | 2 +- Cassiopee/XCore/test/t1.py | 2 +- 1048 files changed, 9218 insertions(+), 9637 deletions(-) diff --git a/Cassiopee/Apps/Apps/App.py b/Cassiopee/Apps/Apps/App.py index c8a578cd5..748f0440d 100644 --- a/Cassiopee/Apps/Apps/App.py +++ b/Cassiopee/Apps/Apps/App.py @@ -1,5 +1,5 @@ # General class of Cassiopee App -# Data oriented +# Data oriented # One method: run __version__ = '3.1' diff --git a/Cassiopee/Apps/Apps/Chimera/Chimera.py b/Cassiopee/Apps/Apps/Chimera/Chimera.py index dfb45482e..e58763681 100644 --- a/Cassiopee/Apps/Apps/Chimera/Chimera.py +++ b/Cassiopee/Apps/Apps/Chimera/Chimera.py @@ -1,5 +1,5 @@ import Converter.PyTree as C -import Converter.Internal as Internal +import Converter.Internal as Internal import Post.PyTree as P import Transform.PyTree as T import Converter.Filter as Filter @@ -9,7 +9,7 @@ import Geom.PyTree as D IMETHOD = 'AABB' -# Extraction de la solution sur une surface dans le plan (X,R) a partir d un maillage recouvrant +# Extraction de la solution sur une surface dans le plan (X,R) a partir d un maillage recouvrant # et d une courbe ou un nuage de points definis dans le plan(X,R) # t_sol et t_pts sont dans le systeme de coordonnees cartesiennes # t_sol et t_pts sont des fichiers @@ -31,7 +31,7 @@ def extractSurface(t_sol, t_pts=None, eq=(0.,0.,0.,0.), XC=(0.,0.,0.), AXIS=(1., C.convertPyTree2File(PtsXR,"Pts_XR.cgns") DTheta=C.getMaxValue(PtsXR,"CoordinateZ")-C.getMinValue(PtsXR,"CoordinateZ") - if isinstance(t_sol,str): + if isinstance(t_sol,str): h = Filter.Handle(t_sol) t = h.loadSkeleton() h._loadZonesWoVars(t) @@ -79,10 +79,10 @@ def extractSurface(t_sol, t_pts=None, eq=(0.,0.,0.,0.), XC=(0.,0.,0.), AXIS=(1., # resBB = G.BB(res,method=IMETHOD) res = XOR.conformUnstr(res,tol=0.,itermax=1) - if isinstance(t_sol,str): + if isinstance(t_sol,str): if len(variables)==0:# on interpole tout t = C.convertFile2PyTree(t_sol) - else: + else: h = Filter.Handle(t_sol) t = h.loadSkeleton() h._loadZonesWoVars(t) @@ -97,7 +97,7 @@ def extractSurface(t_sol, t_pts=None, eq=(0.,0.,0.,0.), XC=(0.,0.,0.), AXIS=(1., if G.bboxIntersection(resBB,zbbd,method=IMETHOD,isBB=True)==1: zd = Internal.getNodeFromName(t,zbbd[0]) dnrZones.append(zd) - P._extractMesh(dnrZones,res,order=2,constraint=10.,mode=mode) + P._extractMesh(dnrZones,res,order=2,constraint=10.,mode=mode) C._rmVars(res,[cellNName]) return res @@ -105,14 +105,14 @@ def extractIJSurface(t_sol, t_pts, XC=(0.,0.,0.), AXIS=(1.,0.,0.), loc='centers' # distrib en i (le long de la ligne) et j NI = 101; NJ = 201 dhi = G.cart((0.,0.,0.),(1./(NI-1),1,1),(NI,1,1)) - # on peut mettre un resserrement : + # on peut mettre un resserrement : # dhi = G.enforcePlusX(dhi, ... dhj = G.cart((0.,0.,0.),(1./(NJ-1),1,1),(NJ,1,1)) if loc == 'centers': cellNName2 = 'centers:'+cellNName else: cellNName2 = cellNName - if isinstance(t_sol,str): + if isinstance(t_sol,str): h = Filter.Handle(t_sol) t = h.loadSkeleton() h._loadZonesWoVars(t) diff --git a/Cassiopee/Apps/Apps/Chimera/ExtractDoublyDefined.py b/Cassiopee/Apps/Apps/Chimera/ExtractDoublyDefined.py index c145cdc7a..7e44c7984 100644 --- a/Cassiopee/Apps/Apps/Chimera/ExtractDoublyDefined.py +++ b/Cassiopee/Apps/Apps/Chimera/ExtractDoublyDefined.py @@ -26,7 +26,7 @@ def _extrapOnBCDataSet(t, variables): for var in variables: v = var.split(':',1) - if len(v) == 2: + if len(v) == 2: if v[0] == 'centers' or v[0] == 'nodes': v = v[1] else: v = var else: v = var diff --git a/Cassiopee/Apps/Apps/Chimera/__init__.py b/Cassiopee/Apps/Apps/Chimera/__init__.py index 8b1378917..e69de29bb 100644 --- a/Cassiopee/Apps/Apps/Chimera/__init__.py +++ b/Cassiopee/Apps/Apps/Chimera/__init__.py @@ -1 +0,0 @@ - diff --git a/Cassiopee/Apps/Apps/Coda/ToolboxIBM_CODA.py b/Cassiopee/Apps/Apps/Coda/ToolboxIBM_CODA.py index 983a9648d..3c1c8683e 100644 --- a/Cassiopee/Apps/Apps/Coda/ToolboxIBM_CODA.py +++ b/Cassiopee/Apps/Apps/Coda/ToolboxIBM_CODA.py @@ -23,13 +23,13 @@ rank = Cmpi.rank; size = Cmpi.size # suppose 1 connect quad par zone -def extractBCOfType(t,bndType): +def extractBCOfType(t,bndType): res = [] for z in Internal.getZones(t): zp = Internal.copyRef(z) Internal._rmNodesFromType(zp,"FlowSolution_t") connects = Internal.getNodesFromType(z,"Elements_t") - cnQUAD = None + cnQUAD = None for cn in connects: val = Internal.getValue(cn)[0] if val == 7 and cnQUAD is None: # QUAD @@ -62,7 +62,7 @@ def extractBCOfType(t,bndType): PL = Internal.getValue(PL)[0].tolist() # list of elements array = C.getFields(Internal.__GridCoordinates__, zp)[0] array = Transform.transform.subzoneElements(array, PL) - res.append(C.convertArrays2ZoneNode(gc[0],[array])) + res.append(C.convertArrays2ZoneNode(gc[0],[array])) return res def prepare(t_case, t, tskel, check=False): @@ -77,7 +77,7 @@ def prepare(t_case, t, tskel, check=False): procDict = Cmpi.getProcDict(tBB) bbo = G.bbox(tBB) rank = Cmpi.rank - comm = Cmpi.COMM_WORLD + comm = Cmpi.COMM_WORLD # reference state refstate = C.getState(tb) @@ -124,7 +124,7 @@ def prepare(t_case, t, tskel, check=False): Internal._rmNodesFromType(zf,"ZoneBC_t") zdname = Internal.getValue(gc) PLD = Internal.getNodeFromName(gc,'PointListDonor') - norankopp = procDict[zdname] + norankopp = procDict[zdname] if norankopp in dictOfAbuttingSurfaces: dictOfAbuttingSurfaces[norankopp] += [z[0], zf, zdname, PLD] else: @@ -204,14 +204,14 @@ def prepare(t_case, t, tskel, check=False): #Internal._rmNodesFromName(t,Internal.__FlowSolutionCenters__) C._rmVars(t,graddvars) # - # Extract front faces + # Extract front faces if IBCType == -1: X._setHoleInterpolatedPoints(t,loc='nodes',depth=-1) C._initVars(t,'{cellN}=minimum(1.,{cellN})') # Removal of fully blanked zones (must be done after gradient of distance for a correct gradient estimation near the obstacles) for z in Internal.getZones(t): - if C.getMaxValue(z,'cellN') < 0.5: + if C.getMaxValue(z,'cellN') < 0.5: (parent,noz) = Internal.getParentOfNode(t, z) del parent[2][noz] @@ -320,13 +320,13 @@ def prepare(t_case, t, tskel, check=False): ids = C.identifyElements(hook, zbc, tol=TOL) ids = ids[ids[:] > -1] ids = ids.tolist() - ids = [ids[i]-1 for i in range(len(ids))] + ids = [ids[i]-1 for i in range(len(ids))] zf = T.subzone(f,ids, type='elements') _addBC2ZoneLoc(z, zf[0], bctypes[nobc], zf) # recoverIBC familySpecified:IBMWall if front1 != []: # can be empty on a proc - front1[0]='IBMWall' + front1[0]='IBMWall' _addBC2ZoneLoc(z, 'IBMWall', 'FamilySpecified:IBMWall',front1) for bc in Internal.getNodesFromType(z,'BC_t'): @@ -342,12 +342,12 @@ def prepare(t_case, t, tskel, check=False): dnrPts[2].append(['CoordinateX',coordsPI[1][0,:], [], 'DataArray_t']) dnrPts[2].append(['CoordinateY',coordsPI[1][1,:], [], 'DataArray_t']) dnrPts[2].append(['CoordinateZ',coordsPI[1][2,:], [], 'DataArray_t']) - coordsPW = Converter.extractVars(allwall_pts, ['CoordinateX','CoordinateY','CoordinateZ']) + coordsPW = Converter.extractVars(allwall_pts, ['CoordinateX','CoordinateY','CoordinateZ']) wallPts[2].append(['CoordinateX',coordsPW[1][0,:], [], 'DataArray_t']) wallPts[2].append(['CoordinateY',coordsPW[1][1,:], [], 'DataArray_t']) wallPts[2].append(['CoordinateZ',coordsPW[1][2,:], [], 'DataArray_t']) - # modify PL for abutting 1to1 + # modify PL for abutting 1to1 datas={} for norankopp in dictOfAbuttingSurfaces: infos = dictOfAbuttingSurfaces[norankopp] @@ -355,21 +355,21 @@ def prepare(t_case, t, tskel, check=False): zrname = info[0] zf = info[1] zdname = info[2] - PLD = info[3] + PLD = info[3] ids = C.identifyElements(hook, zf, tol=TOL) - ids = ids[ids[:] > -1] + ids = ids[ids[:] > -1] ids = ids.tolist() if ids != []: - ids = [ids[i]-1 for i in range(len(ids))] + ids = [ids[i]-1 for i in range(len(ids))] zf = T.subzone(f,ids, type='elements') _addBC2ZoneLoc(z, zf[0], 'Abutting1to1', zf, zdnrName=zdname) C.freeHook(hook) mergeQuadConn(z) # convertBCAbutting to GC Abutting - # Add abutting 1to1 on one side only-(smallest proc number chosen) + # Add abutting 1to1 on one side only-(smallest proc number chosen) for zbc in Internal.getNodesFromType(z,'BC_t'): - if Internal.getValue(zbc)=='Abutting1to1': + if Internal.getValue(zbc)=='Abutting1to1': zdnrname = Internal.getNodeFromType1(zbc,'UserDefinedData_t') zdnrname = Internal.getValue(zdnrname) PL = Internal.getNodeFromName(zbc, 'PointList') @@ -377,7 +377,7 @@ def prepare(t_case, t, tskel, check=False): if rank < norankopp: ZGC = Internal.getNodeFromType1(z,'ZoneGridConnectivity_t') - if ZGC is None: + if ZGC is None: ZGC = Internal.createNode('ZoneGridConnectivity', 'ZoneGridConnectivity_t', parent=z) matchname = 'match_%d_%d'%(rank,norankopp) @@ -401,7 +401,7 @@ def prepare(t_case, t, tskel, check=False): matchname=info[0] PLD = info[1] gcnode = Internal.getNodeFromName(z,matchname) - if gcnode is not None: + if gcnode is not None: PLDN = Internal.createNode('PointListDonor','IndexArray_t',value=PLD,parent=gcnode) # remove all bc_t Abutting1to1 @@ -417,7 +417,7 @@ def prepare(t_case, t, tskel, check=False): # IBM prepro for CODA with Octree mesh #============================================== def prepareOctree(t_case, t_out, vmin=5, dfarList=[], dfar=10., snears=0.01, NP=0, - tbox=None, snearsf=None, expand=3, check=False, fileout='octree.cgns'): + tbox=None, snearsf=None, expand=3, check=False, fileout='octree.cgns'): recoverBC=False isHanging=False dfarDir=0 @@ -428,7 +428,7 @@ def prepareOctree(t_case, t_out, vmin=5, dfarList=[], dfar=10., snears=0.01, NP= else: tb = t_case rank = Cmpi.rank - comm = Cmpi.COMM_WORLD + comm = Cmpi.COMM_WORLD # list of dfars if dfarList == []: @@ -506,7 +506,7 @@ def prepareOctree(t_case, t_out, vmin=5, dfarList=[], dfar=10., snears=0.01, NP= for po in parento: del po t = C.newPyTree(['CARTESIAN', res]) - for z in Internal.getZones(t): + for z in Internal.getZones(t): zname = Internal.getName(z)+'_X%d'%rank Internal.setName(z,zname) Cmpi._setProc(t, rank) @@ -603,14 +603,14 @@ def prepareOctree(t_case, t_out, vmin=5, dfarList=[], dfar=10., snears=0.01, NP= #Internal._rmNodesFromName(t,Internal.__FlowSolutionCenters__) C._rmVars(t,graddvars) # - # Extract front faces + # Extract front faces if IBCType == -1: X._setHoleInterpolatedPoints(t,loc='nodes',depth=-1) C._initVars(t,'{cellN}=minimum(1.,{cellN})') # Removal of fully blanked zones (must be done after gradient of distance for a correct gradient estimation near the obstacles) for z in Internal.getZones(t): - if C.getMaxValue(z,'cellN') < 0.5: + if C.getMaxValue(z,'cellN') < 0.5: (parent,noz) = Internal.getParentOfNode(t, z) del parent[2][noz] @@ -638,7 +638,7 @@ def prepareOctree(t_case, t_out, vmin=5, dfarList=[], dfar=10., snears=0.01, NP= he = he*1.8 # distmax = sqrt(3)*dx => he min = distmax + dx + tol #varsn = ['gradxTurbulentDistance','gradyTurbulentDistance','gradzTurbulentDistance'] allip_pts=[]; allwall_pts=[]; allimage_pts=[] - _addExternalBCs(t, bbo, externalBCType, dimPb) + _addExternalBCs(t, bbo, externalBCType, dimPb) extBCs=C.extractBCOfType(t,externalBCType) extBCs=C.convertArray2Hexa(extBCs) @@ -659,7 +659,7 @@ def prepareOctree(t_case, t_out, vmin=5, dfarList=[], dfar=10., snears=0.01, NP= lvl = int(dh/dhMin) if lvl not in dictOfExtBCs: dictOfExtBCs[lvl]=[extBC] - else: + else: dictOfExtBCs[lvl].append(extBC) extBCs=[] for lvl in dictOfExtBCs: @@ -730,7 +730,7 @@ def prepareOctree(t_case, t_out, vmin=5, dfarList=[], dfar=10., snears=0.01, NP= C._addBC2Zone(z,'externalBC',externalBCType,subzone=extBC) # recoverIBC familySpecified:IBMWall if front1 != []: # can be empty on a proc - front1[0]='IBMWall' + front1[0]='IBMWall' C._addBC2Zone(z, 'IBMWall', 'FamilySpecified:IBMWall',subzone=front1) for bc in Internal.getNodesFromType(z,'BC_t'): famName = Internal.getNodeFromName(bc,'FamilyName') @@ -746,7 +746,7 @@ def prepareOctree(t_case, t_out, vmin=5, dfarList=[], dfar=10., snears=0.01, NP= dnrPts[2].append(['CoordinateX',coordsPI[1][0,:], [], 'DataArray_t']) dnrPts[2].append(['CoordinateY',coordsPI[1][1,:], [], 'DataArray_t']) dnrPts[2].append(['CoordinateZ',coordsPI[1][2,:], [], 'DataArray_t']) - coordsPW = Converter.extractVars(allwall_pts, ['CoordinateX','CoordinateY','CoordinateZ']) + coordsPW = Converter.extractVars(allwall_pts, ['CoordinateX','CoordinateY','CoordinateZ']) wallPts[2].append(['CoordinateX',coordsPW[1][0,:], [], 'DataArray_t']) wallPts[2].append(['CoordinateY',coordsPW[1][1,:], [], 'DataArray_t']) wallPts[2].append(['CoordinateZ',coordsPW[1][2,:], [], 'DataArray_t']) @@ -760,11 +760,11 @@ def prepareOctree(t_case, t_out, vmin=5, dfarList=[], dfar=10., snears=0.01, NP= hookVertex = C.createHook(zf,function='nodes') idNodes = C.identifyNodes(hookVertex,z) C.freeHook(hookVertex) - PL = idNodes[(idNodes>-1)!=0] + PL = idNodes[(idNodes>-1)!=0] # create GC if PL != [] and rank < norankopp: ZGC = Internal.getNodeFromType2(z,'ZoneGridConnectivity_t') - if ZGC is None: + if ZGC is None: ZGC = Internal.createNode('ZoneGridConnectivity', 'ZoneGridConnectivity_t', parent=z) matchname = 'match_%d_%d'%(rank,norankopp) @@ -784,7 +784,7 @@ def prepareOctree(t_case, t_out, vmin=5, dfarList=[], dfar=10., snears=0.01, NP= for origProc in rcvDataM: matchname=rcvDataM[origProc][0] PLD = rcvDataM[origProc][1] - lsize = len(PLD.shape) + lsize = len(PLD.shape) if lsize == 1: PLD = numpy.reshape(PLD,(1, PLD.shape[0]), order='F') gcnode = Internal.getNodeFromName(z,matchname) gcnode[2].append(Internal.createNode('PointListDonor','IndexArray_t',value=PLD)) @@ -822,7 +822,7 @@ def _recoverBCsStruct2QUAD(zoneS, zoneU): ids = C.identifyElements(hook, zbc, tol=1e-6) ids = ids[ids[:] > -1] ids = ids.tolist() - ids = [ids[i]-1 for i in range(len(ids))] + ids = [ids[i]-1 for i in range(len(ids))] zf = T.subzone(f,ids, type='elements') _addBC2ZoneLoc(zoneU, zbc[0], bctype, zbc) @@ -872,7 +872,7 @@ def _addBC2ZoneLoc(z, bndName, bndType, zbc, loc='FaceCenter', zdnrName=None): value=bndType2) Internal.createUniqueChild(info, 'GridLocation', 'GridLocation_t', - value='FaceCenter') + value='FaceCenter') if isinstance(faceList, numpy.ndarray): r = faceList else: r = numpy.array(faceList, dtype=numpy.int32) r = r.reshape((1,r.size), order='F') @@ -950,7 +950,7 @@ def cartRxLoc(X0, H, N, Nb, depth=0, addCellN=False, addBCMatch=False, rank=None if k < Nb[2]-1: Xp[2] += depth*H[2]; Np[2] += depth z = G.cart(Xp, H, Np); z[0] = 'cart%d.%d.%d'%(i,j,k) if rank is not None: - import Converter.Mpi as Cmpi + import Converter.Mpi as Cmpi Cmpi._setProc(z, rank) if addCellN: C._initVars(z, 'centers:cellN', 1) @@ -1012,7 +1012,7 @@ def mergeQuadConn(z): # first quad conn for name in rangeMinT: - if rangeMinT[name]==rminglob: + if rangeMinT[name]==rminglob: rmaxnext = rangeMaxT[name]+1 EltsT = Internal.getNodeFromName(allElts_t,name) rangeMinT[name]=-1; rangeMaxT[name]=-1 @@ -1070,7 +1070,7 @@ def mergeQuadConn0(z): rminall = min(rangeMinT[name],rminall) elif typeEt == 17: elts_t[0]='Hexas' - # init + # init rmin = rminall; rmax= -1 newElts_t=[]; etype = 7 while rmin < rmaxall: @@ -1080,7 +1080,7 @@ def mergeQuadConn0(z): rmax = rangeMaxT[name] EltsT = Internal.getNodeFromName1(z,name) name1 = name - break + break # looking for following elts_t found = 1 while found == 1: @@ -1112,7 +1112,7 @@ def mergeQuadConn0(z): if rmax2+1==rmaxall: EltsT[0]='Quads'# a priori, unique name... - newElts_t.append(EltsT) + newElts_t.append(EltsT) found = 0 rmin = rmax2+1 @@ -1120,7 +1120,7 @@ def mergeQuadConn0(z): typeEt = Internal.getValue(elts_t)[0] if typeEt == 7: Internal._rmNode(z,elts_t) - z[2] += newElts_t + z[2] += newElts_t return None # convert ZoneBC ElementRange to a PointList/FaceCenter according to QUAD connectivity @@ -1128,7 +1128,7 @@ def EltRange2FaceCenter(z): connects = Internal.getNodesFromType(z,'Elements_t') connectQUAD=None - for conn in connects: + for conn in connects: eltType = Internal.getValue(conn)[0] if eltType == 7: connectQUAD = conn @@ -1145,7 +1145,7 @@ def EltRange2FaceCenter(z): zbc[2].append(['PointList', PL, [], 'IndexRange_t']) gl = numpy.array([c for c in 'FaceCenter'],'c') zbc[2].append(['GridLocation', gl, [], 'GridLocation_t']) - Internal._rmNodesFromName(zbc,"ElementRange") + Internal._rmNodesFromName(zbc,"ElementRange") return None def get1To1Connect(a, b, indicesFacesOrig, bopp, indicesFacesOrigOpp): @@ -1153,7 +1153,7 @@ def get1To1Connect(a, b, indicesFacesOrig, bopp, indicesFacesOrigOpp): b[0]='extFaces'; bopp[0] = 'extFacesOpp' hookExtFaces=C.createHook(bopp,function='elementCenters') - # identify face centers + # identify face centers idFaces = C.identifyElements(hookExtFaces,b) eltType = Internal.getZoneDim(b)[3] @@ -1179,7 +1179,7 @@ def buildQuad4QuadInfo(a, graph=None): extFaces = T.splitConnexity(extFaces) res = [] for noext in range(len(extFaces)): - for noext2 in range(len(extFaces)): + for noext2 in range(len(extFaces)): if noext != noext2: res+=buildQuad4QuadInfoLocal(a, extFaces[noext], extFaces[noext2]) @@ -1198,7 +1198,7 @@ def buildQuad4QuadInfo(a, graph=None): for i in destDatas: for extFacesOpp in destDatas[i]: for noext in range(len(extFaces)): - for noext2 in range(len(extFacesOpp)): + for noext2 in range(len(extFacesOpp)): res+=buildQuad4QuadInfoLocal(a, extFacesOpp[noext2], extFaces[noext]) erange = numpy.ones(2, dtype=numpy.int32) @@ -1211,12 +1211,12 @@ def buildQuad4QuadInfo(a, graph=None): erange[0] = maxRange erange[1] = maxRange-1 + len(res)//9 - if res == []: + if res == []: res = None erange[1] = erange[0]-1 Internal.newElements(name='Quad4Quad', etype=1, - econnectivity=res, - erange=erange, eboundary=0, parent=a) + econnectivity=res, + erange=erange, eboundary=0, parent=a) Q4Q = Internal.getNodeFromName(a,"Quad4Quad") Internal.createNode('ElementTypeName', 'Descriptor_t', value='Quad4Quad', children=None, parent=Q4Q) @@ -1224,14 +1224,14 @@ def buildQuad4QuadInfo(a, graph=None): def buildQuad4QuadInfoLocal(a, b, bopp): b[0]='extFaces'; bopp[0] = 'extFacesOpp' - shiftElt=4; nfaces = 6 + shiftElt=4; nfaces = 6 # identify face centers of coarse (local) zone matching with a vertex of bopp (fine) hookExtFacesOpp = C.createHook(bopp,function='nodes') indicesVEFOpp = C.identifyElements(hookExtFacesOpp,b) #>0: vertex 9 found (= bopp is fine and b is coarse) # identify indices of vertices in original zone a with vertices of exterior faces of bopp hookA = C.createHook(a,function='nodes') - indicesVertexA = C.identifyNodes(hookA, bopp) + indicesVertexA = C.identifyNodes(hookA, bopp) cnExtFaceOpp = Internal.getNodeFromType(bopp,'Elements_t') cnExtFaceOpp = Internal.getNodeFromName(cnExtFaceOpp,'ElementConnectivity') @@ -1253,12 +1253,12 @@ def buildQuad4QuadInfoLocal(a, b, bopp): indV4 = cnExtFaceOpp[noptr+3] if indVertexEF == indV1: #P9P6P3P7 - GVIndices[5] = indV2 + GVIndices[5] = indV2 GVIndices[2] = indV3 GVIndices[6] = indV4 elif indVertexEF == indV2:#P8P9P7P4 GVIndices[7] = indV1 - GVIndices[6] = indV3 + GVIndices[6] = indV3 GVIndices[3] = indV4 elif indVertexEF == indV3:#P1P5P9P6 @@ -1268,7 +1268,7 @@ def buildQuad4QuadInfoLocal(a, b, bopp): elif indVertexEF == indV4:#P5P2P7P9 GVIndices[4] = indV1 - GVIndices[1] = indV2 + GVIndices[1] = indV2 GVIndices[6] = indV3 noptr+=shiftElt @@ -1294,7 +1294,7 @@ def _addIBCDataSet(bc,correctedPts, wallPts, imagePts): wallPointsFieldNode[2].append(['CoordinateX',coordsPW[1][0,:], [], 'DataArray_t']) wallPointsFieldNode[2].append(['CoordinateY',coordsPW[1][1,:], [], 'DataArray_t']) wallPointsFieldNode[2].append(['CoordinateZ',coordsPW[1][2,:], [], 'DataArray_t']) - return None + return None def _addIBDataZSR(z, correctedPts, wallPts, imagePts=None, prefix='IBCD_'): zname = Internal.getName(z) @@ -1315,7 +1315,7 @@ def _addIBDataZSR(z, correctedPts, wallPts, imagePts=None, prefix='IBCD_'): zsr[2].append(['CoordinateZ_PW',coordsPW[1][2,:], [], 'DataArray_t']) if imagePts is not None: - coordsPI = Converter.extractVars(imagePts, ['CoordinateX','CoordinateY','CoordinateZ'])[0] + coordsPI = Converter.extractVars(imagePts, ['CoordinateX','CoordinateY','CoordinateZ'])[0] zsr[2].append(['CoordinateX_PI',coordsPI[1][0,:], [], 'DataArray_t']) zsr[2].append(['CoordinateY_PI',coordsPI[1][1,:], [], 'DataArray_t']) zsr[2].append(['CoordinateZ_PI',coordsPI[1][2,:], [], 'DataArray_t']) @@ -1358,7 +1358,7 @@ def extractIBMWallFields(XCP, YCP, ZCP, arrayOfFields, tb, variables): dimPb = Internal.getNodeFromName(tb,'EquationDimension') - if dimPb is None: + if dimPb is None: print('Warning: extractIBMWallFields: pb dimension is set to 3.') dimPb = 3 else: @@ -1367,7 +1367,7 @@ def extractIBMWallFields(XCP, YCP, ZCP, arrayOfFields, tb, variables): td = Internal.copyRef(tb) for nob in range(len(td[2])): b = td[2][nob] - if b[3] == 'CGNSBase_t': + if b[3] == 'CGNSBase_t': zones = Internal.getNodesFromType1(b, 'Zone_t') if zones != []: zones = C.convertArray2Tetra(zones) @@ -1396,7 +1396,7 @@ def extractIBMInfo(t): return tinfo # -------------------------------------------------------------------------------- # Creation of 0-D zones of name 'Zone#IBCD_*' such that their original zones can be -# retrieved in post processing +# retrieved in post processing #typeOfPoint can be 'Wall','Image','IP' def createIBMZones(tc,variables=[], typeOfPoint='Wall'): if typeOfPoint=='Wall': suff='PW' @@ -1418,7 +1418,7 @@ def createIBMZones(tc,variables=[], typeOfPoint='Wall'): FSN = Internal.newFlowSolution(parent=zw) for varo in variables: fieldV = Internal.getNodeFromName2(IBCD,varo) - if fieldV is not None: + if fieldV is not None: C._initVars(zw,varo,0.) fieldW = Internal.getNodeFromName2(FSN,varo) fieldW[1] = fieldV[1] @@ -1430,10 +1430,10 @@ def createIBMZones(tc,variables=[], typeOfPoint='Wall'): # Create the 1to1 connectivity of two Cartesian zones as a PointList/PointListDonor info # convertOnly = True : abutting 1to1 gc nodes already exist def _create1To1Connectivity(t, tskel=None, dim=3, convertOnly=True): - dictOfDnrZoneDims={} - if tskel is None or not convertOnly: - Cmpi._addBXZones(t, depth=3) - t = X.connectMatch(t, dim=dim) + dictOfDnrZoneDims={} + if tskel is None or not convertOnly: + Cmpi._addBXZones(t, depth=3) + t = X.connectMatch(t, dim=dim) # dictionary of donor zone dimensions for each gc for z in Internal.getZones(t): for gc in Internal.getNodesFromType2(z,'GridConnectivity1to1_t'): @@ -1443,49 +1443,49 @@ def _create1To1Connectivity(t, tskel=None, dim=3, convertOnly=True): if SOD is not None: l2g = Internal.getNodeFromName1(SOD,'loc2glob') if l2g is not None: - l2g = Internal.getValue(l2g) + l2g = Internal.getValue(l2g) dictOfDnrZoneDims[gc[0]]=[l2g[-3],l2g[-2],l2g[-1]] else: Internal._rmNodesFromName(z,gc[0]) - Cmpi._rmBXZones(t) + Cmpi._rmBXZones(t) else: for z in Internal.getZones(t): for gc in Internal.getNodesFromType2(z,'GridConnectivity1to1_t'): znamed = Internal.getValue(gc) zd = Internal.getNodeFromName2(tskel,znamed) - if zd is not None: - l2g = Internal.getZoneDim(zd) + if zd is not None: + l2g = Internal.getZoneDim(zd) dictOfDnrZoneDims[gc[0]]=[l2g[-3],l2g[-2],l2g[-1]] for z in Internal.getZones(t): dimZ = Internal.getZoneDim(z) - ni = dimZ[1]; nj = dimZ[2]; nk = dimZ[3] + ni = dimZ[1]; nj = dimZ[2]; nk = dimZ[3] for gc in Internal.getNodesFromType2(z,'GridConnectivity1to1_t'): PR = Internal.getNodeFromName1(gc,'PointRange') PRD = Internal.getNodeFromName1(gc,'PointRangeDonor') - win = Internal.range2Window(PR[1]) + win = Internal.range2Window(PR[1]) imin = win[0]; imax = win[1] jmin = win[2]; jmax = win[3] - kmin = win[4]; kmax = win[5] - indicesL = Converter.converter.range2PointList(imin,imax,jmin,jmax,kmin,kmax, - ni, nj, nk) - if isinstance(indicesL, numpy.ndarray): r = indicesL + kmin = win[4]; kmax = win[5] + indicesL = Converter.converter.range2PointList(imin,imax,jmin,jmax,kmin,kmax, + ni, nj, nk) + if isinstance(indicesL, numpy.ndarray): r = indicesL else: r = numpy.array(indicesL, dtype=numpy.int32) r = r.reshape((1,r.size), order='F') gc[2].append(["PointList", r, [], "IndexArray_t"]) - if gc[0] not in dictOfDnrZoneDims: + if gc[0] not in dictOfDnrZoneDims: if rank==0: print("NOT FOUND", z[0], Internal.getValue(gc), gc[0]) else: dimZd = dictOfDnrZoneDims[gc[0]] nid = dimZd[0]; njd = dimZd[1]; nkd = dimZd[2] - win = Internal.range2Window(PRD[1]) + win = Internal.range2Window(PRD[1]) imin = win[0]; imax = win[1] jmin = win[2]; jmax = win[3] - kmin = win[4]; kmax = win[5] + kmin = win[4]; kmax = win[5] indicesOppL = Converter.converter.range2PointList(imin, imax, jmin, jmax, kmin, kmax, nid, njd, nkd) - if isinstance(indicesOppL, numpy.ndarray): r = indicesOppL + if isinstance(indicesOppL, numpy.ndarray): r = indicesOppL else: r = numpy.array(indicesOppL, dtype=numpy.int32) r = r.reshape((1,r.size), order='F') @@ -1496,7 +1496,7 @@ def _create1To1Connectivity(t, tskel=None, dim=3, convertOnly=True): Internal.setType(gc, 'GridConnectivity_t') Internal._createChild(gc, 'GridConnectivityType', 'GridConnectivityType_t', value='Abutting1to1') Internal._createChild(gc, 'GridLocation', 'GridLocation_t', value='FaceCenter') - C._mergeGCs(z) + C._mergeGCs(z) return None @@ -1516,7 +1516,7 @@ def _addExternalBCs(t, bbox, externalBCType='BCFarfield', dimPb=3): z2 = C.getValue(zp,'CoordinateZ',indM) bbz=[x1,y1,z1,x2,y2,z2] for idir in dirs: - if abs(bbz[idir]-bbox[idir])< 1.e-6: + if abs(bbz[idir]-bbox[idir])< 1.e-6: C._addBC2Zone(zp, 'external', externalBCType, rangeDir[idir]) return None @@ -1583,7 +1583,7 @@ def getHangingNodesInfoPara(a, b, indicesFacesOrig, bopp, indicesFacesOrigOpp): while noptr < sizeCNExtFaceOpp: indV1 = cnExtFaceOpp[noptr] indV2 = cnExtFaceOpp[noptr+1] - if indV1 == indVertexEF: + if indV1 == indVertexEF: efd = int(indicesFacesOrigOpp[noe]-1)//nfaces found +=1 if indV2 == indVertexEF: @@ -1597,7 +1597,7 @@ def getHangingNodesInfoPara(a, b, indicesFacesOrig, bopp, indicesFacesOrigOpp): break noptr+=shiftElt noe+=1 - return [HN_COARSE, HN_FINE1, HN_FINE2] + return [HN_COARSE, HN_FINE1, HN_FINE2] else: for noEltEF in range(len(HN)): @@ -1613,7 +1613,7 @@ def getHangingNodesInfoPara(a, b, indicesFacesOrig, bopp, indicesFacesOrigOpp): indV3 = cnExtFaceOpp[noptr+2] indV4 = cnExtFaceOpp[noptr+3] ef1=-1; ef2=-1; ef3=-1; ef4=-1 - if indVertexEF == indV1: + if indVertexEF == indV1: ef4 = int(indicesFacesOrigOpp[noe]-1)//nfaces found +=1 @@ -1629,7 +1629,7 @@ def getHangingNodesInfoPara(a, b, indicesFacesOrig, bopp, indicesFacesOrigOpp): ef2 = int(indicesFacesOrigOpp[noe]-1)//nfaces found += 1 - if found == 4: + if found == 4: if ef2 == ef1: ef2 =-1 if ef3 == ef1: ef3 =-1 if ef4 == ef1: ef4 =-1 @@ -1644,7 +1644,7 @@ def getHangingNodesInfoPara(a, b, indicesFacesOrig, bopp, indicesFacesOrigOpp): break noptr+=shiftElt noe+=1 - return [HN_COARSE, HN_FINE1, HN_FINE2, HN_FINE3, HN_FINE4] + return [HN_COARSE, HN_FINE1, HN_FINE2, HN_FINE3, HN_FINE4] def getHangingNodesInfoSeq(a): indicesFacesOrig = [] @@ -1760,7 +1760,7 @@ def _mergeConnectivityLoc(z1, z2, boundary=0, shared=False): Internal._sortNodesInZone(z1) elif boundary == 0 and shared: # connectivite ajoutee=volumique shared - # on cree des nouveaux noeuds connectivites dans z1 + # on cree des nouveaux noeuds connectivites dans z1 elts = Internal.getNodesFromType2(z2, 'Elements_t') z1[1][0,1] += neb # update le nbre d'elements de z1 nebb = 0 @@ -1803,7 +1803,7 @@ def _mergeConnectivityLoc(z1, z2, boundary=0, shared=False): nebb = neb node = Internal.createUniqueChild(z1, z2[0], 'Elements_t', value=[eltType,nebb]) Internal.createUniqueChild(node, 'ElementRange', 'IndexRange_t', - value=[maxElt+1,maxElt+neb]) + value=[maxElt+1,maxElt+neb]) #oldc = Internal.getNodeFromName2(z2, 'ElementConnectivity')[1] #newc = numpy.copy(oldc) newc = numpy.zeros((neb),dtype=numpy.int32) @@ -1841,7 +1841,7 @@ def _addBC2UnstructZoneLoc__(z, bndName, bndType, wrange=[], if bndType1 == 'BCMatch' or bndType1 == 'Abutting1to1': if (zoneDonor == [] or - faceListDonor is None and subzone is None and elementListDonor is None and elementRangeDonor is None): + faceListDonor is None and subzone is None and elementListDonor is None and elementRangeDonor is None): raise ValueError("addBC2Zone: unstructured match connectivity requires a donor zone and a faceListDonor or a subzone or an elementRangeDonor or an elementListDonor.") # si subzone fournie: cree le elementRangeDonor if subzone is not None: @@ -1909,7 +1909,7 @@ def _addBC2UnstructZoneLoc__(z, bndName, bndType, wrange=[], elif (bndType1 == 'FamilySpecified' and fnmatch.fnmatch(bndType2, 'BCStage*')) or (bndType1 == 'BCStage'): C._addFamilyOfStageGC__(z, bndName, bndType2, typeZone=2, elementRange=elementRange, - elementList=elementList, faceList=faceList, zoneDonor=zoneDonor) + elementList=elementList, faceList=faceList, zoneDonor=zoneDonor) else: # BC classique # Cree le noeud zoneBC si besoin @@ -2010,7 +2010,7 @@ def _recoverBCs1(a, T, tol=1.e-11): bcz = Internal.getNodeFromNameAndType(z, newNameOfBC, 'BC_t') ds = Internal.newBCDataSet(name='BCDataSet', value='UserDefined', - gridLocation='FaceCenter', parent=bcz) + gridLocation='FaceCenter', parent=bcz) d = Internal.newBCData('NeumannData', parent=ds) for node in Internal.getChildren(fsc): diff --git a/Cassiopee/Apps/Apps/Coda/__init__.py b/Cassiopee/Apps/Apps/Coda/__init__.py index 8b1378917..e69de29bb 100755 --- a/Cassiopee/Apps/Apps/Coda/__init__.py +++ b/Cassiopee/Apps/Apps/Coda/__init__.py @@ -1 +0,0 @@ - diff --git a/Cassiopee/Apps/Apps/Fast/Common.py b/Cassiopee/Apps/Apps/Fast/Common.py index b37e8e7be..7d6467941 100644 --- a/Cassiopee/Apps/Apps/Fast/Common.py +++ b/Cassiopee/Apps/Apps/Fast/Common.py @@ -49,7 +49,7 @@ def _distributeMem(t, tc, NP): def _distributeOpt(t_in, tc_in, corePerNode=28, nptMaxPerCore=4.e6): if isinstance(t_in, str): if Cmpi.rank == 0: _distributeOptFile(t_in, tc_in, corePerNode, nptMaxPerCore) - else: + else: #_distributeOptMem(t_in, tc_in, corePerNode, nptMaxPerCore) raise ValueError('Not implemented.') return None @@ -148,7 +148,7 @@ def finalize(t, t_out=None, it0=None, time0=None, format='single', compress=0): # format: single ou multiple # compress: si 1, compress le fichier de sortie pour le cartesien, 2 compressAll #====================================================================================== -def compute(t_in, tc_in, +def compute(t_in, tc_in, t_out, tc_out, numb, numz, NIT, @@ -193,7 +193,7 @@ def compute(t_in, tc_in, Internal.createUniqueChild(t, 'Time', 'DataArray_t', value=time0) if t_out is not None and isinstance(t_out,str): FastC.save(t, t_out, split=format, NP=Cmpi.size, compress=compress) - if tc_out is not None and isinstance(tc_out,str): + if tc_out is not None and isinstance(tc_out,str): FastC.save(tc, tc_out, split=format, NP=Cmpi.size) if Cmpi.size > 1: Cmpi.barrier() return t, tc @@ -221,7 +221,7 @@ def compute(self, t_in, tc_in, t_out, nit, tc_out=None): compress = self.compress return compute(t_in, tc_in, t_out, tc_out, numb, numz, - nit, + nit, format=self.data['format'], compress=compress) @@ -242,5 +242,3 @@ def _distribute(self, t_in, tc_in, NP=Cmpi.size): # distribue fichiers ou en memoire, trouve le NP optimal def _distributeOpt(self, t_in, tc_in, corePerNode=28, nptMaxPerCore=4.e6): return _distributeOpt(t_in, tc_in, corePerNode, nptMaxPerCore) - - diff --git a/Cassiopee/Apps/Apps/Fast/Fast2Kim.py b/Cassiopee/Apps/Apps/Fast/Fast2Kim.py index 32b74a104..7c483b1de 100644 --- a/Cassiopee/Apps/Apps/Fast/Fast2Kim.py +++ b/Cassiopee/Apps/Apps/Fast/Fast2Kim.py @@ -39,8 +39,8 @@ def __init__(self, config): # Data input self.config = config self.kimDir = './KIM' - self.kimEntreeDir = self.kimDir+os.sep+'ENTREES' - self.kimAeroDir = self.kimEntreeDir+os.sep+'AERO' + self.kimEntreeDir = self.kimDir+os.sep+'ENTREES' + self.kimAeroDir = self.kimEntreeDir+os.sep+'AERO' # Automatically executed functions self.createDirs() @@ -61,15 +61,15 @@ def update_config_w_default_values(self): if "number_mic" not in self.config: self.config["number_mic"] = DEFAULT_NBMIC if "form" not in self.config: - self.config["form"] = DEFAULT_FORM + self.config["form"] = DEFAULT_FORM if "corflux" not in self.config: self.config["corflux"] = DEFAULT_CORFLUX if "title" not in self.config: - self.config["title"] = DEFAULT_TITLE + self.config["title"] = DEFAULT_TITLE if "dom_id" not in self.config: self.config["dom_id"] = DEFAULT_ID if "overn" not in self.config: - self.config["overn"] = DEFAULT_OVERN + self.config["overn"] = DEFAULT_OVERN if "omega" not in self.config: self.config["omega"] = DEFAULT_OMEGA if "it_reprise" not in self.config: @@ -113,7 +113,7 @@ def createKimDonn(self): donnD['fwh_mobi'] = '.False.' else: donnD['fwh_soli'] = '.False.' - donnD['fwh_mobi'] = '.True.' + donnD['fwh_mobi'] = '.True.' donnD['integrat'] = 0 donnD['reflexion'] = '.False.' donnD['mail_def'] = '.True.' @@ -130,7 +130,7 @@ def createKimDonn(self): if self.config['form'] == 'porous': donnD['nvar'] = 5 else: - donnD['nvar'] = 1 + donnD['nvar'] = 1 donnD['ntemiss'] = self.config['number_dt'] donnD['ntrecep'] = 2*self.config['number_dt'] donnD['nper'] = 3 @@ -141,7 +141,7 @@ def createKimDonn(self): else: donnD['form_mail'] = '"formatted"' donnD['form_cham'] = '"formatted"' - donnD['litendian'] = '.True.' + donnD['litendian'] = '.True.' donnD['krepmaill'] = 1 donnD['krepvites'] = 1 donnD['ndupang'] = 1 @@ -188,7 +188,7 @@ def createKimDonn(self): donnD['harfin'] = 498 donnD['nivdba'] = '.True.' donnD['mapdb'] = '.True.' - donnD['mapdba'] = '.True.' + donnD['mapdba'] = '.True.' donnD['mapcomplex'] = '.False.' # Creation of donn.in lines @@ -302,7 +302,7 @@ def createKimDimdomHead(self): dimdomD = {} dimdomD['Version'] = 6 dimdomD['Strucaero'] = 317 - dimdomD['NbDecimal'] = 8 + dimdomD['NbDecimal'] = 8 dimdomD['Ndom'] = self.config['number_dom'] if self.config['form'] == 'porous': dimdomD['Nvar'] = 8 # x,y,z,ro,rou,rov,row,p @@ -420,13 +420,13 @@ def createKimAero(self): gc = Internal.newGridCoordinates(parent=cz) ox = Internal.newDataArray('CoordinateX', value=px, parent=gc) oy = Internal.newDataArray('CoordinateY', value=py, parent=gc) - oz = Internal.newDataArray('CoordinateZ', value=pz, parent=gc) + oz = Internal.newDataArray('CoordinateZ', value=pz, parent=gc) fs = Internal.newFlowSolution('FlowSolution#Centers', 'CellCenter', parent=cz) op = Internal.newDataArray('Pressure', value=p, parent=fs) cz = C.center2Node(cz, 'FlowSolution#Centers') cz = Internal.rmNodesByName(cz, 'FlowSolution#Centers') - if self.config['form_file']=='bin': + if self.config['form_file']=='bin': #fich = FortranFile(kimAeroFile, 'w') #fich.write_record(px) #fich.write_record(py) @@ -470,12 +470,12 @@ def createKimAero(self): gc = Internal.newGridCoordinates(parent=cz) ox = Internal.newDataArray('CoordinateX', value=px, parent=gc) oy = Internal.newDataArray('CoordinateY', value=py, parent=gc) - oz = Internal.newDataArray('CoordinateZ', value=pz, parent=gc) + oz = Internal.newDataArray('CoordinateZ', value=pz, parent=gc) fs = Internal.newFlowSolution('FlowSolution#Centers', 'CellCenter', parent=cz) op = Internal.newDataArray('Pressure', value=p, parent=fs) cz = C.center2Node(cz, 'FlowSolution#Centers') - cz = Internal.rmNodesByName(cz, 'FlowSolution#Centers') - if self.config['form_file']=='bin': + cz = Internal.rmNodesByName(cz, 'FlowSolution#Centers') + if self.config['form_file']=='bin': #fich = FortranFile(kimAeroFile, 'w') #fich.write_record(px) #fich.write_record(py) @@ -484,7 +484,7 @@ def createKimAero(self): x=Internal.getByName(cz, 'CoordinateX') y=Internal.getByName(cz, 'CoordinateY') z=Internal.getByName(cz, 'CoordinateZ') - pressure=Internal.getByName(cz, 'Pressure') + pressure=Internal.getByName(cz, 'Pressure') fich = open(kimAeroFile, 'wb') self.write_fortran_block(fich, x[2][0][1].reshape(x[2][0][1].shape[0]*x[2][0][1].shape[1]), DOUBLE_SIZE) #X self.write_fortran_block(fich, y[2][0][1].reshape(y[2][0][1].shape[0]*y[2][0][1].shape[1]), DOUBLE_SIZE) #Y diff --git a/Cassiopee/Apps/Apps/Fast/IBM.py b/Cassiopee/Apps/Apps/Fast/IBM.py index 0c785240a..6bb7559d8 100644 --- a/Cassiopee/Apps/Apps/Fast/IBM.py +++ b/Cassiopee/Apps/Apps/Fast/IBM.py @@ -27,8 +27,8 @@ import numpy from Geom.IBM import setSnear, _setSnear, setDfar, _setDfar, snearFactor, _snearFactor, \ -setFluidInside, _setFluidInside, setIBCType, _setIBCType, changeIBCType, \ -initOutflow, initInj, _initOutflow, _initInj, transformTc2, _addOneOverLocally + setFluidInside, _setFluidInside, setIBCType, _setIBCType, changeIBCType, \ + initOutflow, initInj, _initOutflow, _initInj, transformTc2, _addOneOverLocally import Post.IBM as P_IBM import Connector.IBM as X_IBM @@ -61,7 +61,7 @@ def _changeNameIBCD__(tc2, NewIBCD): zsplit[1] = str(NewIBCD) znew = '_'.join(zsplit) Internal.setName(z, znew) - return None + return None def dist2wallNearBody__(t, tb, type='ortho', signed=0, dim=3, loc='centers', model='NSLaminar'): if model == 'NSLaminar': @@ -73,7 +73,7 @@ def dist2wallNearBody__(t, tb, type='ortho', signed=0, dim=3, loc='centers', mod tbBB=G.BB(tb) ##PRT1 - Zones flagged by the intersection of the bounding boxes of t and tb - interDict = X.getIntersectingDomains(tBB, tbBB) + interDict = X.getIntersectingDomains(tBB, tbBB) zt = [] zt_names = [] for i in interDict: @@ -89,14 +89,14 @@ def dist2wallNearBody__(t, tb, type='ortho', signed=0, dim=3, loc='centers', mod list_additional_zones = getZonesScaleUpDown__(tbBB,tBB,zt_names,dim=dim) ##PRT2 - if list_additional_zones: + if list_additional_zones: zt=[] for i in list_additional_zones: zt.append(Internal.getNodeByName(t,i)) DTW._distance2Walls(zt, tb, type=type, signed=signed, dim=dim, loc=loc) else: - DTW._distance2Walls(t, tb, type=type, signed=signed, dim=dim, loc=loc) + DTW._distance2Walls(t, tb, type=type, signed=signed, dim=dim, loc=loc) return None @@ -104,8 +104,8 @@ def dist2wallNearBody__(t, tb, type='ortho', signed=0, dim=3, loc='centers', mod def getZonesScaleUpDown__(tbBB, tBB, zt_names, diff_percent=0.15, sweep_num=4, scaleDirection=0, dim=2): mean_tb=[] for bb in Internal.getZones(tbBB): - minval_tb = C.getMinValue(bb, ['CoordinateX', 'CoordinateY','CoordinateZ']); - maxval_tb = C.getMaxValue(bb, ['CoordinateX', 'CoordinateY','CoordinateZ']); + minval_tb = C.getMinValue(bb, ['CoordinateX', 'CoordinateY','CoordinateZ']); + maxval_tb = C.getMaxValue(bb, ['CoordinateX', 'CoordinateY','CoordinateZ']); mean_tb.append(getMean__(maxval_tb,minval_tb)) diff_percentz = diff_percent @@ -114,7 +114,7 @@ def getZonesScaleUpDown__(tbBB, tBB, zt_names, diff_percent=0.15, sweep_num=4, s list_additional_zones=[] list_additional_zonesCGNSFile=[] for i in range(1, sweep_num+1): - if scaleDirection >= 0: + if scaleDirection >= 0: tbBB_scale = T.scale(tbBB, factor=(1.0+i*diff_percent,1.0+i*diff_percent,1.0+i*diff_percentz)) add2listAdditionalZones__(list_additional_zones,tbBB_scale,tBB,mean_tb,zt_names) @@ -135,7 +135,7 @@ def getMean__(max_local, min_local): def add2listAdditionalZones__(list_additional_zones, tbBB_scale, tBB,mean_tb, zt_names): count=0 for bb in Internal.getZones(tbBB_scale): - minval_tbscale = C.getMinValue(bb, ['CoordinateX', 'CoordinateY','CoordinateZ']); + minval_tbscale = C.getMinValue(bb, ['CoordinateX', 'CoordinateY','CoordinateZ']); maxval_tbscale = C.getMaxValue(bb, ['CoordinateX', 'CoordinateY','CoordinateZ']); mean_tbscale = getMean__(maxval_tbscale,minval_tbscale) T._translate(bb, (mean_tb[count][0]-mean_tbscale[0],mean_tb[count][1]-mean_tbscale[1],mean_tb[count][2]-mean_tbscale[2])) @@ -144,7 +144,7 @@ def add2listAdditionalZones__(list_additional_zones, tbBB_scale, tBB,mean_tb, zt for i in interDict_scale: if interDict_scale[i] and i not in list_additional_zones and i not in zt_names: list_additional_zones.append(i) - count += 1 + count += 1 return None @@ -221,7 +221,7 @@ def post(t_case, t_in, tc_in, t_out, wall_out): X._setInterpTransfers(t, tc, variables=vars, variablesIBC=varsIBC, bcType=bcType, varType=varType, storage=1, - Gamma=Gamma, Cv=cvInf, MuS=Mus, + Gamma=Gamma, Cv=cvInf, MuS=Mus, Cs=Cs, Ts=Ts) zw = P_IBM.extractIBMWallFields(tc, tb=tb) @@ -317,7 +317,7 @@ def loads(t_case, tc_in=None, tc2_in=None, wall_out=None, alpha=0., beta=0., gra tc = P_IBM.extractPressureHO2(tc) # add gradP fields in tc2 if necessary - if tc2 is not None: + if tc2 is not None: for z in Internal.getZones(tc2): P_IBM._addGradxiP__(z) @@ -331,7 +331,7 @@ def loads(t_case, tc_in=None, tc2_in=None, wall_out=None, alpha=0., beta=0., gra #==================================== # Extraction des grandeurs a la paroi #==================================== - if tc is None: + if tc is None: zw = Internal.getZones(tb) zw = T.join(zw) else: @@ -399,7 +399,7 @@ def _projectMeshSize(t, NPas=10, span=1, dictNz=None, isCartesianExtrude=False): NPTS = numpy.zeros(NP, dtype=Internal.E_NpyInt) NCELLS = numpy.zeros(NP, dtype=Internal.E_NpyInt) NPTS_noghost = numpy.zeros(NP, dtype=Internal.E_NpyInt) - NCELLS_noghost = numpy.zeros(NP, dtype=Internal.E_NpyInt) + NCELLS_noghost = numpy.zeros(NP, dtype=Internal.E_NpyInt) if isinstance(t, str): h = Filter.Handle(t) t = h.loadFromProc(loadVariables=False) @@ -426,7 +426,7 @@ def _projectMeshSize(t, NPas=10, span=1, dictNz=None, isCartesianExtrude=False): NPTS = Cmpi.allreduce(NPTS ,op=Cmpi.SUM) NCELLS = Cmpi.allreduce(NCELLS,op=Cmpi.SUM) NPTS_noghost = Cmpi.allreduce(NPTS_noghost ,op=Cmpi.SUM) - NCELLS_noghost = Cmpi.allreduce(NCELLS_noghost,op=Cmpi.SUM) + NCELLS_noghost = Cmpi.allreduce(NCELLS_noghost,op=Cmpi.SUM) if rank ==0: print('Projected mesh size with ghost: {} million points & {} million cells'.format(numpy.sum(NPTS)/1.e6,numpy.sum(NCELLS)/1.e6)) print('Projected mesh size without ghost: {} million points & {} million cells'.format(numpy.sum(NPTS_noghost)/1.e6,numpy.sum(NCELLS_noghost)/1.e6)) @@ -444,7 +444,7 @@ def extrudeCartesian(t,tb, check=False, extrusion="cart", dz=0.01, NPas=10, span if extrusion == "cart": perio = span/float(Ntranche) else: perio = span/180.*math.pi/float(Ntranche) - for z in Internal.getZones(t): + for z in Internal.getZones(t): cellN = Internal.getNodeFromName(z, "cellN")[1] #cellNInit= Internal.getNodeFromName(z, "cellN#Init")[1] sh = numpy.shape(cellN) @@ -461,7 +461,7 @@ def extrudeCartesian(t,tb, check=False, extrusion="cart", dz=0.01, NPas=10, span #Dim = 3D c = 0 for tree in [t,tb]: - for dim in Internal.getNodesFromName(tree,'EquationDimension'): dim[1]=3 + for dim in Internal.getNodesFromName(tree,'EquationDimension'): dim[1]=3 dz_loc={}; Nk={} if c ==0: @@ -499,7 +499,7 @@ def extrudeCartesian(t,tb, check=False, extrusion="cart", dz=0.01, NPas=10, span for z in Internal.getZones(tree): Nk[z[0]] += 2*ific-1 #+c # -1, car un plan de maillage deja ajoute dans le cas 2D - for z in Internal.getZones(tree): + for z in Internal.getZones(tree): yy_2d = Internal.getNodeFromName(z, "CoordinateY")[1] zz_2d = Internal.getNodeFromName(z, "CoordinateZ")[1] @@ -543,7 +543,7 @@ def extrudeCartesian(t,tb, check=False, extrusion="cart", dz=0.01, NPas=10, span ng = 0 #Modif Ivan 11/10/24 #ng = 2 - for z in Internal.getZones(tree): + for z in Internal.getZones(tree): zdim = Internal.getValue(z) # Modif rind cellule GH en kmin et kmax @@ -553,7 +553,7 @@ def extrudeCartesian(t,tb, check=False, extrusion="cart", dz=0.01, NPas=10, span BCs = Internal.getNodesFromType(z, "BC_t") for bc in BCs: ptrg = Internal.getNodeFromName(bc, "PointRange")[1] - ptrg[2,0] = 3 + ptrg[2,0] = 3 ptrg[2,1] = Nk[z[0]] if not isAutoPeriodic: # Creatioon connectivite perio dans t @@ -575,7 +575,7 @@ def extrudeCartesian(t,tb, check=False, extrusion="cart", dz=0.01, NPas=10, span trans = perio else: angle = perio - trans = 0. + trans = 0. Conn = Internal.getNodeFromName(z, "ZoneGridConnectivity") name = 'match_'+z[0]+idir @@ -610,7 +610,7 @@ def extrudeCartesian(t,tb, check=False, extrusion="cart", dz=0.01, NPas=10, span rot = Internal.getNodeFromName(period, 'RotationAngle') Units=['Kilogram','Meter','Second','Kelvin','Radian'] Internal.createUniqueChild(rot ,'DimensionalUnits' ,'DimensionalUnits_t',Units) - if isAutoPeriodic: + if isAutoPeriodic: for node in Internal.getNodesFromName(t,'EquationDimension'): Internal.setValue(node,3) for z in Internal.getZones(t): C._addBC2Zone(z, z[0]+'periodKmin', 'BCautoperiod', 'kmin') @@ -619,17 +619,17 @@ def extrudeCartesian(t,tb, check=False, extrusion="cart", dz=0.01, NPas=10, span for bc in BCs: if Internal.getValue(bc)=='BCautoperiod': ptrg = Internal.getNodeFromName(bc, "PointRange")[1] - ptrg[0,0] = 3 + ptrg[0,0] = 3 ptrg[0,1] = ptrg[0,1]-2 - ptrg[1,0] = 3 + ptrg[1,0] = 3 ptrg[1,1] = ptrg[1,1]-2 return t, tb #================================================================================ -# Chimere: modif ghost planSym pour interp chimere +# Chimere: modif ghost planSym pour interp chimere # IN: t # IN: depth= nombre de couche # IN: plan= plan cible de la symmetrie ('X': x=cte= plan sym, ...) @@ -642,7 +642,7 @@ def _modifGhostSymmetryPlan(t, depth=2,dim=3,Plan='Y'): if bc is not None: bcs = Internal.getNodesFromType(bc,'BC_t') for bc in bcs: bctyp = Internal.getValue(bc) - if bctyp=='BCSymmetryPlane': + if bctyp=='BCSymmetryPlane': ptrg = Internal.getNodeFromName1(bc,'PointRange') dimZ = Internal.getZoneDim(z) #print(z[0], dimZ,'range', ptrg[1]) @@ -653,14 +653,14 @@ def _modifGhostSymmetryPlan(t, depth=2,dim=3,Plan='Y'): var = 'Coordinate'+Plan coord= Internal.getNodeFromName2(z,var)[1] - if idir==0: + if idir==0: jmin = ptrg[1][1,0]-3; jmax = ptrg[1][1,1]+2 kmin = ptrg[1][2,0]-3; kmax = ptrg[1][2,1]+2 for k in range(kmin,kmax): for j in range(jmin,jmax): for d in range(depth): coord[depth-1-d,j,k]= 2*coord[depth-d,j,k]-coord[depth+1-d,j,k] - if idir==1: + if idir==1: i1 = ptrg[1][0,1]-depth-1 jmin = ptrg[1][1,0]-3; jmax = ptrg[1][1,1]+2 kmin = ptrg[1][2,0]-3; kmax = ptrg[1][2,1]+2 @@ -668,14 +668,14 @@ def _modifGhostSymmetryPlan(t, depth=2,dim=3,Plan='Y'): for j in range(jmin,jmax): for d in range(depth): coord[i1+1+d,j,k]= 2.*coord[i1+d ,j,k]-coord[i1-1+d,j,k] - if idir==2: + if idir==2: imin = ptrg[1][0,0]-3; imax = ptrg[1][0,1]+2 kmin = ptrg[1][2,0]-3; kmax = ptrg[1][2,1]+2 for k in range(kmin,kmax): for i in range(imin,imax): for d in range(depth): coord[i,depth-1-d,k]= 2*coord[i,depth-d,k]-coord[i,depth+1-d,k] - if idir==3: + if idir==3: js = ptrg[1][1,1]-depth-1 imin = ptrg[1][0,0]-3; imax = ptrg[1][0,1]+2 kmin = ptrg[1][2,0]-3; kmax = ptrg[1][2,1]+2 @@ -683,7 +683,7 @@ def _modifGhostSymmetryPlan(t, depth=2,dim=3,Plan='Y'): for i in range(imin,imax): for d in range(depth): coord[i,js+1+d,k]= 2.*coord[i,js+d,k]-coord[i,js-1+d,k] - if idir==4: + if idir==4: imin = ptrg[1][0,0]-3; imax = ptrg[1][0,1]+2 jmin = ptrg[1][1,0]-3; jmax = ptrg[1][1,1]+2 for j in range(jmin,jmax): @@ -691,7 +691,7 @@ def _modifGhostSymmetryPlan(t, depth=2,dim=3,Plan='Y'): for d in range(depth): coord[i,j,depth-1-d]= 2*coord[i,j,depth-d]-coord[i,j,depth+1-d] - if idir==5: + if idir==5: ks = ptrg[1][2,1]-depth-1 imin = ptrg[1][0,0]-3; imax = ptrg[1][0,1]+2 jmin = ptrg[1][1,0]-3; jmax = ptrg[1][1,1]+2 @@ -702,7 +702,7 @@ def _modifGhostSymmetryPlan(t, depth=2,dim=3,Plan='Y'): return None #================================================================================ -# Chimere: modif cellN planSym pour interp chimere +# Chimere: modif cellN planSym pour interp chimere # IN: t # IN: depth= nombre de couche # IN: plan= plan cible de la symmetrie ('X': x=cte= plan sym, ...) @@ -715,7 +715,7 @@ def _modifcellNSymmetryPlan(t, depth=2,dim=3): if bc is not None: bcs = Internal.getNodesFromType(bc,'BC_t') for bc in bcs: bctyp = Internal.getValue(bc) - if bctyp=='BCSymmetryPlane': + if bctyp=='BCSymmetryPlane': ptrg = Internal.getNodeFromName1(bc,'PointRange') dimZ = Internal.getZoneDim(z) #print(z[0], dimZ,'range', ptrg[1]) @@ -725,14 +725,14 @@ def _modifcellNSymmetryPlan(t, depth=2,dim=3): #print('idir=',idir) cellN= Internal.getNodeFromName2(z,'cellN')[1] - if idir==0: + if idir==0: jmin = ptrg[1][1,0]-3; jmax = ptrg[1][1,1]+1 kmin = ptrg[1][2,0]-3; kmax = ptrg[1][2,1]+1 for k in range(kmin,kmax): for j in range(jmin,jmax): for d in range(depth): if cellN[depth-1-d,j,k]>=1.99 : cellN[depth-1-d,j,k]=1 - if idir==1: + if idir==1: i1 = ptrg[1][0,1]-depth-1 jmin = ptrg[1][1,0]-3; jmax = ptrg[1][1,1]+1 kmin = ptrg[1][2,0]-3; kmax = ptrg[1][2,1]+1 @@ -740,7 +740,7 @@ def _modifcellNSymmetryPlan(t, depth=2,dim=3): for j in range(jmin,jmax): for d in range(depth): if cellN[i1+d,j,k]>=1.99: cellN[i1+d,j,k]=1 - if idir==2: + if idir==2: imin = ptrg[1][0,0]-3; imax = ptrg[1][0,1]+1 kmin = ptrg[1][2,0]-3; kmax = ptrg[1][2,1]+1 #print(z[0],'range', imin, imax,kmin,kmax,depth-1) @@ -748,7 +748,7 @@ def _modifcellNSymmetryPlan(t, depth=2,dim=3): for i in range(imin,imax): for d in range(depth): if cellN[i,depth-1-d,k]>=1.99: cellN[i,depth-1-d,k]= 1 - if idir==3: + if idir==3: js = ptrg[1][1,1]-depth-1 imin = ptrg[1][0,0]-3; imax = ptrg[1][0,1]+1 kmin = ptrg[1][2,0]-3; kmax = ptrg[1][2,1]+1 @@ -756,7 +756,7 @@ def _modifcellNSymmetryPlan(t, depth=2,dim=3): for i in range(imin,imax): for d in range(depth): if cellN[i,js+d,k]>=1.99: cellN[i,js+d,k]= 1. - if idir==4: + if idir==4: imin = ptrg[1][0,0]-3; imax = ptrg[1][0,1]+1 jmin = ptrg[1][1,0]-3; jmax = ptrg[1][1,1]+1 for j in range(jmin,jmax): @@ -764,7 +764,7 @@ def _modifcellNSymmetryPlan(t, depth=2,dim=3): for d in range(depth): if cellN[i,j,depth-1-d]>=1.99: cellN[i,j,depth-1-d]= 1. - if idir==5: + if idir==5: ks = ptrg[1][2,1]-depth-1 imin = ptrg[1][0,0]-3; imax = ptrg[1][0,1]+1 jmin = ptrg[1][1,0]-3; jmax = ptrg[1][1,1]+1 @@ -892,9 +892,9 @@ def setInterpData_Hybride(t_octree, tc_octree, t_curvi, blankingMatrix=None, bla X._applyBCOverlaps(z,loc='centers',depth=4, val=2) X._applyBCOverlaps(z,loc='centers',depth=2, val=0) - # blanking des zones curvi si necessaire + # blanking des zones curvi si necessaire if blankingMatrix is not None: - if dim==2: + if dim==2: print('revoir blanking en 2d') import sys; sys.exit() @@ -970,7 +970,7 @@ def setInterpData_Hybride(t_octree, tc_octree, t_curvi, blankingMatrix=None, bla if zsrname[0]!='IBCD' or zsrname[1] != itype: Internal._rmNodesFromName(zc,zsr[0]) - #construction arbre skeleton global (tcs) pour calcul graph + #construction arbre skeleton global (tcs) pour calcul graph tcs_local = Cmpi.convert2SkeletonTree(tc_filtre) tcs = Cmpi.allgatherTree(tcs_local) graph = Cmpi.computeGraph(tcs, type='IBCD', reduction=True) @@ -997,7 +997,7 @@ def setInterpData_Hybride(t_octree, tc_octree, t_curvi, blankingMatrix=None, bla i = l-k*ninj - j*ni cellN[ i,j,k ]=2 else: - #print("shapeD", numpy.shape(ptlistD), numpy.size(ptlistD),flush=True) + #print("shapeD", numpy.shape(ptlistD), numpy.size(ptlistD),flush=True) if proc not in datas: datas[proc] = [[zrname, ptlistD]] else: datas[proc] += [[zrname, ptlistD]] #print ("dataS", proc, datas, flush=True) @@ -1042,9 +1042,9 @@ def setInterpData_Hybride(t_octree, tc_octree, t_curvi, blankingMatrix=None, bla #print('apr manip cellN', flush=True) Cmpi.barrier() - # + # # double wall operation - # + # # tag for double wall static for n in ['Rotor', 'Stator']: base = Internal.getNodeFromName1(t_curvi, n) @@ -1067,11 +1067,11 @@ def setInterpData_Hybride(t_octree, tc_octree, t_curvi, blankingMatrix=None, bla base2c = Internal.getNodeFromName1(tc_curvi, 'ROTOR%d'%(i+1)) tp = C.newPyTree([base1, base2]) tpc = C.newPyTree([base1c, base2c]) - #if rank == 0: + #if rank == 0: # C.convertPyTree2File(tp,'bug'+str(rank)+'.cgns') # C.convertPyTree2File(tpc,'bugC'+str(rank)+'.cgns') Cmpi.barrier() - X._doubleWall(tp,tpc,'WALL_ROTORBLADE','WALL_Rotor',ghostCells=True,check=False) #Souci + X._doubleWall(tp,tpc,'WALL_ROTORBLADE','WALL_Rotor',ghostCells=True,check=False) #Souci #Internal._rmNodesByName(tp,'*inactive*') Cmpi.barrier() #if rank == 0: print("DB : {} -> {}".format('ROTOR', 'ROTORBLADE%d'%(i+1)), flush=True) @@ -1115,7 +1115,7 @@ def setInterpData_Hybride(t_octree, tc_octree, t_curvi, blankingMatrix=None, bla zonelist=[] for z in Internal.getZones(t_octree): if C.getMaxValue(z,'centers:cellN')==2: - dnrZones = [] + dnrZones = [] for zdname in interDict[z[0]]: zd = Internal.getNodeFromName(tc_curvi,zdname) dnrZones.append(zd) @@ -1128,7 +1128,7 @@ def setInterpData_Hybride(t_octree, tc_octree, t_curvi, blankingMatrix=None, bla print(" Interp curvi from Cartesian") for z in Internal.getZones(t_curvi): if C.getMaxValue(z,'centers:cellN')==2: - dnrZones = [] + dnrZones = [] for zdname in interDict_curvi[z[0]]: zd = Internal.getNodeFromName(tc_octree,zdname) dnrZones.append(zd) @@ -1191,7 +1191,7 @@ def setInterpData_Hybride(t_octree, tc_octree, t_curvi, blankingMatrix=None, bla Xmpi._setInterpData(t, tc, nature=0, loc='centers', storage='inverse', sameName=1, sameBase=0, dim=dim, itype='chimera', order=InterpOrder,verbose=verbose) - #reaffection du vrai cellN + #reaffection du vrai cellN C._initVars(t, '{centers:cellN}={centers:cellN#Init}') if extrusion == 'cyl': @@ -1273,7 +1273,7 @@ def _checkNcellsNptsPerProc(ts, NP, isAtCenter=False): NCELLS = numpy.zeros(NP, dtype=Internal.E_NpyInt) ##Done by zone for flexibility for z in Internal.getZones(ts): - proc_num = Cmpi.getProc(z) + proc_num = Cmpi.getProc(z) NPTS[proc_num] += C.getNPts(z) if not isAtCenter: NCELLS[proc_num] += C.getNCells(z) @@ -1326,7 +1326,7 @@ def interpolateSolutionCoarse2Fine(tCoarse, tFine, NPprep, NPinterp): C._rmVars(tCoarse,['centers:cellN','centers:TurbulentDistance']) if C.isNamePresent(tCoarse, 'centers:MomentumX')==-1 and C.isNamePresent(tFine, 'centers:MomentumX')>-1: C._rmVars(tFine,['centers:MomentumX','centers:MomentumY','centers:MomentumZ', - 'centers:EnergyStagnationDensity','centers:TurbulentSANuTildeDensity']) + 'centers:EnergyStagnationDensity','centers:TurbulentSANuTildeDensity']) ## Extract mesh from COARSE to CURRENT tFine = Pmpi.extractMesh(tCoarse, tFine) tFine = C.node2Center(tFine,'FlowSolution') @@ -1372,7 +1372,7 @@ def __init__(self): self.dfarDir = 0 self.dictNz = None self.distrib = True - self.dz = 0.01 + self.dz = 0.01 self.expand = 3 self.nature = 1 self.ext = 2 @@ -1392,7 +1392,7 @@ def __init__(self): self.smoothing = False self.snears = 0.01 self.snearsf = None - self.span = 1 + self.span = 1 self.t_in = None self.tbox = None self.tinit = None @@ -1418,12 +1418,12 @@ def __init__(self, format=None, numb=None, numz=None): self.dimPb = None self.isOrthoProjectFirst = None self.model = None - self.nbZonesIBC = None + self.nbZonesIBC = None self.procDict = None self.rank = None self.refstate = None - self.res = None - self.res2 = None + self.res = None + self.res2 = None self.tbFilament = None self.tbFilamentWMM = None self.filamentBases = None @@ -1436,7 +1436,7 @@ def __init__(self, format=None, numb=None, numz=None): #================================================================================ # Selection/determination of tb for closed solid & filament - #================================================================================ + #================================================================================ def _determineClosedSolidFilament__(self,tb): ## General case where only a closeSolid is in tb ## or tb only has a filament @@ -1447,7 +1447,7 @@ def _determineClosedSolidFilament__(self,tb): if "IBCFil" in b[0]:self.filamentBases.append(b[0]) self.isFilamentOnly=False - if len(self.filamentBases) == len_tb: + if len(self.filamentBases) == len_tb: self.isFilamentOnly=True self.isOrthoProjectFirst = self.isFilamentOnly ## if tb has both a closed solid and filaments @@ -1458,16 +1458,16 @@ def _determineClosedSolidFilament__(self,tb): for b in self.filamentBases: node_local = Internal.getNodeFromNameAndType(tb, b, 'CGNSBase_t') tbFilament.append(node_local) - Internal._rmNode(tb,node_local) + Internal._rmNode(tb,node_local) self.isOrthoProjectFirst = True - self.tbFilament = C.newPyTree(tbFilament); + self.tbFilament = C.newPyTree(tbFilament); return None #================================================================================ # Cartesian grid generator #================================================================================ - def generateCartesian__(self, tb, ext_local=3, to=None): + def generateCartesian__(self, tb, ext_local=3, to=None): # list of dfars if self.input_var.dfars == []: zones = Internal.getZones(tb) @@ -1538,7 +1538,7 @@ def generateCartesian__(self, tb, ext_local=3, to=None): C._addState(t, 'EquationDimension', self.dimPb) test.printMem(">>> Octree struct [end]") - # Add xzones for ext + # Add xzones for ext test.printMem(">>> extended cart grids [start]") tbb = Cmpi.createBBoxTree(t) interDict = X.getIntersectingDomains(tbb) @@ -1552,7 +1552,7 @@ def generateCartesian__(self, tb, ext_local=3, to=None): exit() #Turn Cartesian grid into a rectilinear grid - test.printMem(">>> cart grids --> rectilinear grids [start]") + test.printMem(">>> cart grids --> rectilinear grids [start]") listDone = [] if self.input_var.tbOneOver: tbb = G.BB(t) @@ -1562,7 +1562,7 @@ def generateCartesian__(self, tb, ext_local=3, to=None): ##RECTILINEAR REGION ##Select regions that need to be coarsened - tbbB = G.BB(self.input_var.tbOneOver) + tbbB = G.BB(self.input_var.tbOneOver) interDict_scale = X.getIntersectingDomains(tbbB, tbb) ##Avoid a zone to be coarsened twice for i in interDict_scale: @@ -1576,7 +1576,7 @@ def generateCartesian__(self, tb, ext_local=3, to=None): zLocal = Internal.getNodeFromName(t,z) T._oneovern(zLocal, (oneoverX,oneoverY,oneoverZ)); listDone.append(z) - test.printMem(">>> cart grids --> rectilinear grids [end]") + test.printMem(">>> cart grids --> rectilinear grids [end]") zones = Internal.getZones(t) coords = C.getFields(Internal.__GridCoordinates__, zones, api=2) @@ -1591,7 +1591,7 @@ def generateCartesian__(self, tb, ext_local=3, to=None): Internal.newRind(value=rinds[noz], parent=zones[noz]) Cmpi._rmXZones(t) coords = None; zones = None - test.printMem(">>> extended cart grids (after rmXZones) [end]") + test.printMem(">>> extended cart grids (after rmXZones) [end]") G_IBM._addBCOverlaps(t, bbox=bb) G_IBM._addExternalBCs(t, bbox=bb, dimPb=self.dimPb) @@ -1609,7 +1609,7 @@ def generateCartesian__(self, tb, ext_local=3, to=None): def _distance2wallCalc__(self,t,tb): - test.printMem(">>> Wall distance [start]") + test.printMem(">>> Wall distance [start]") self.cptBody =0 FSC = Internal.getNodeFromType(t,"FlowSolution_t") if (FSC is None or Internal.getNodeFromName(FSC,'TurbulentDistance') is None) and self.input_var.extrusion is None: @@ -1623,7 +1623,7 @@ def _distance2wallCalc__(self,t,tb): if self.filamentBases: C._initVars(t,'{centers:TurbulentDistanceSolid}={centers:TurbulentDistance}') - tb2 = C.initVars(self.tbFilament, 'CoordinateZ', self.input_var.dz*0.5) + tb2 = C.initVars(self.tbFilament, 'CoordinateZ', self.input_var.dz*0.5) tbFilamentnoWMM = [] tbFilamentWMM = [] for z in Internal.getZones(tb2): @@ -1730,7 +1730,7 @@ def _distance2wallCalc__(self,t,tb): coordY[0][1] = coordY[0][1] + shiftDist coordY[1][1] = coordY[1][1] + shiftDist Internal.getNodeFromName(bboxBody, 'CoordinateY')[1] = coordY - coordZ = Internal.getNodeFromName(bboxBody, 'CoordinateZ')[1] + coordZ = Internal.getNodeFromName(bboxBody, 'CoordinateZ')[1] coordZ[0][0][0] = coordZ[0][0][0] - shiftDist coordZ[0][1][0] = coordZ[0][1][0] - shiftDist coordZ[1][0][0] = coordZ[1][0][0] - shiftDist @@ -2012,7 +2012,7 @@ def setInterpDataAndSetInterpTransfer__(self, t): test.printMem(">>> Interpdata [start]") tc = C.node2Center(t) - # abutting ? + # abutting ? if Internal.getNodeFromType(t,"GridConnectivity1to1_t") is not None: test.printMem("setInterpData abutting") Xmpi._setInterpData(t, tc, nature=1, loc='centers', storage='inverse', sameName=1, dim=3, itype='abutting') @@ -2051,7 +2051,7 @@ def setInterpDataAndSetInterpTransfer__(self, t): if levelZone_loc[i] +1 > Nlevels : Nlevels = int(levelZone_loc[i]) +1 ## partage des info level en mpi - levelZone = Cmpi.allgather(levelZone_loc) + levelZone = Cmpi.allgather(levelZone_loc) # #etape1: calcul interpolation entre grille de meme niveau (ordre2, nature1, pas d'extrap)a @@ -2088,7 +2088,7 @@ def setInterpDataAndSetInterpTransfer__(self, t): if i[0][0:2] == 'ID': Internal.rmNodesByName(i,'OrphanPointList') - if Internal.getValue(i)==zrname: + if Internal.getValue(i)==zrname: IDs.append(i) PtlistD = Internal.getNodeFromName(i, "PointListDonor")[1] @@ -2145,7 +2145,7 @@ def setInterpDataAndSetInterpTransfer__(self, t): dnrZones = [] for zdname in interDict[zrname]: zd = Internal.getNodeFromName2(tc, zdname) - if levelZone[zd[0]]==level+1 or levelZone[zd[0]]==level-1 : + if levelZone[zd[0]]==level+1 or levelZone[zd[0]]==level-1 : dnrZones.append(zd) print("ZoneD=", zd[0], levelZone[zd[0]]) if dnrZones: @@ -2158,7 +2158,7 @@ def setInterpDataAndSetInterpTransfer__(self, t): IDs = [] for i in zd[2]: if i[0][0:2] == 'ID': - if Internal.getValue(i)==zrname: + if Internal.getValue(i)==zrname: IDs.append(i) if IDs != []: if destProc == self.rank: @@ -2179,7 +2179,7 @@ def setInterpDataAndSetInterpTransfer__(self, t): dnrZones.append(zd) if dnrZones: X._setInterpData(zrcv, dnrZones, nature=self.input_var.nature, penalty=1, loc='centers', storage='inverse', - sameName=1, interpDataType=self.input_var.interpDataType, order=self.input_var.order, itype='chimera') + sameName=1, interpDataType=self.input_var.interpDataType, order=self.input_var.order, itype='chimera') for zd in dnrZones: zdname = zd[0] destProc = self.procDict[zdname] @@ -2215,7 +2215,7 @@ def setInterpDataAndSetInterpTransfer__(self, t): test.printMem(">>> Interpdata [after free]") test.printMem(">>> Interpdata [end]") - #tmp = Internal.copyTree(t) + #tmp = Internal.copyTree(t) #t4 = X.getOversetInfo(tmp, tc, loc='center',type='extrapolated') #t5 = X.getOversetInfo(tmp, tc, loc='center',type='orphan') #C.convertPyTree2File(tc,'tc3_old.cgns') @@ -2318,7 +2318,7 @@ def _specialFront2__(self, t, tc): sizeOne = int(numpy.sum(cellNFront)) if sizeOne < sizeTot: # Modification du Front uniquement lorsque celui-ci est repousse - C._initVars(z,'{centers:cellNFront}={centers:cellNFront}*({centers:cellNFront_origin}>0.5)') + C._initVars(z,'{centers:cellNFront}={centers:cellNFront}*({centers:cellNFront_origin}>0.5)') # i.e. if cellNFront_origin == 0 and cellNFront == 1 => cellNfront = 0 C._initVars(z,'{centers:cellNIBC}={centers:cellNIBC}*(1.-({centers:cellNChim}==1.)*({centers:cellNIBC_origin}>1.5)*({centers:cellNIBC_origin}<2.5)) \ @@ -2450,7 +2450,7 @@ def _buildFront__(self, t, tc, tb): return None - def _ibcInterpolation__(self, t, tc): + def _ibcInterpolation__(self, t, tc): test.printMem(">>> Interpolating IBM [start]") @@ -2472,7 +2472,7 @@ def _ibcInterpolation__(self, t, tc): dictOfCorrectedPtsByIBCType2={} dictOfWallPtsByIBCType2 ={} dictOfInterpPtsByIBCType2 ={} - interDictIBM2={} + interDictIBM2={} if dictOfCorrectedPtsByIBCType!={}: for ibcTypeL in dictOfCorrectedPtsByIBCType: @@ -2662,7 +2662,7 @@ def _ibcInterpolation__(self, t, tc): return None - def _printCheckIBMInfo__(self,tc): + def _printCheckIBMInfo__(self,tc): test.printMem(">>> Saving IBM infos [start]") tibm = X_IBM.extractIBMInfo(tc) @@ -2690,9 +2690,9 @@ def _printCheckIBMInfo__(self,tc): return None - def _recomputeDistRANS__(self,t,tb): + def _recomputeDistRANS__(self,t,tb): if 'outpress' in self.ibctypes or 'inj' in self.ibctypes or 'slip' in self.ibctypes or 'wallmodel' in self.ibctypes or 'overlap' in self.ibctypes: - test.printMem(">>> wall distance for viscous wall only - RANS [start]") + test.printMem(">>> wall distance for viscous wall only - RANS [start]") for z in Internal.getZones(tb): ibc = Internal.getNodeFromName(z,'ibctype') if Internal.getValue(ibc)=='outpress' or Internal.getValue(ibc)=='inj' or Internal.getValue(ibc)=='slip' or Internal.getValue(ibc)=='wallmodel' or Internal.getValue(ibc)=='overlap': @@ -2702,12 +2702,12 @@ def _recomputeDistRANS__(self,t,tb): DTW._distance2Walls(t,self.tbsave,type='ortho', signed=0, dim=self.dimPb, loc='centers') else: DTW._distance2Walls(t,self.tbsave,type='ortho', signed=0, dim=self.dimPb, loc='centers') - C._initVars(t, '{centers:TurbulentDistance}={centers:TurbulentDistance}*({centers:cellN}>0.)+(-1.)*{centers:TurbulentDistance}*({centers:cellN}<1.)') - test.printMem(">>> wall distance for viscous wall only - RANS [end]") + C._initVars(t, '{centers:TurbulentDistance}={centers:TurbulentDistance}*({centers:cellN}>0.)+(-1.)*{centers:TurbulentDistance}*({centers:cellN}<1.)') + test.printMem(">>> wall distance for viscous wall only - RANS [end]") return None - def _tInitialize__(self,t,tb=None): + def _tInitialize__(self,t,tb=None): if self.input_var.tinit is None: I._initConst(t, loc='centers') else: t = Pmpi.extractMesh(self.input_var.tinit, t, mode='accurate') @@ -2715,7 +2715,7 @@ def _tInitialize__(self,t,tb=None): if self.isWireModel: vars_wm = ['Density','VelocityX','VelocityY','VelocityZ','Temperature'] - if self.model == 'NSTurbulent':vars_wm.append('TurbulentSANuTilde') + if self.model == 'NSTurbulent':vars_wm.append('TurbulentSANuTilde') for z in Internal.getZones(t): for v_local in vars_wm: C._initVars(z,'{centers:'+v_local+'_WM}=0.') @@ -2741,7 +2741,7 @@ def _tInitialize__(self,t,tb=None): # Prepare - def prepare(self, t_case, t_out, tc_out): + def prepare(self, t_case, t_out, tc_out): self.rank = Cmpi.rank self.DEPTH = 2 self.isWireModel=False @@ -2772,7 +2772,7 @@ def prepare(self, t_case, t_out, tc_out): ##OUT - isOrthoProjectFirst :bolean to do orthonormal projection first ##OUT - tb(in place) :tb of solid geometries only ##OUT - tbFilament :tb of filament geometries only - self._determineClosedSolidFilament__(tb) + self._determineClosedSolidFilament__(tb) ## ================================================ ## ============ Get gen. info on test case ======== @@ -2859,7 +2859,7 @@ def prepare(self, t_case, t_out, tc_out): ## ============== Geometry blanking =============== ## ================================================ ##IN - t :t tree (cartesian mesh or input mesh) - ##IN - tb :closed geometry tree + ##IN - tb :closed geometry tree ##OUT - t :t tree with blanked done t = self.blanking__(t,tb) @@ -2916,7 +2916,7 @@ def prepare(self, t_case, t_out, tc_out): ##IN - t :t tree (cartesian mesh or input mesh) ##OUT - tc :front 42 if yplus is not provided or if the wallAdapt approach is used ##OUT - procDict :Dictionary of procs - ##OUT - tbbc :pytree of the bounding box of tc + ##OUT - tbbc :pytree of the bounding box of tc tc=self.setInterpDataAndSetInterpTransfer__(t) ## ================================================ @@ -2946,7 +2946,7 @@ def prepare(self, t_case, t_out, tc_out): ## ================================================ ## ============== IBC Interpolation =============== ## ================================================ - self._ibcInterpolation__(t, tc) + self._ibcInterpolation__(t, tc) C._initVars(t,'{centers:cellN}=minimum({centers:cellNChim}*{centers:cellNIBCDnr},2.)') varsRM = ['centers:cellNChim','centers:cellNIBCDnr'] @@ -2992,7 +2992,7 @@ def prepare(self, t_case, t_out, tc_out): zsrname = Internal.getName(zsr) zsrname = zsrname.split('_') if zsrname[0]=='IBCD': - for var in ['C','W','I']: + for var in ['C','W','I']: r = Internal.getNodeFromName(zsr,'CoordinateY_P'+var)[1] theta = Internal.getNodeFromName(zsr,'CoordinateZ_P'+var)[1] for l in range(numpy.size(r)): @@ -3052,13 +3052,13 @@ def prepare(self, t_case, t_out, tc_out): if RENAMEIBCNODES: for zc in Internal.getZones(tc): - for ibcd in Internal.getNodesFromName1(zc,'IBCD_*'): + for ibcd in Internal.getNodesFromName1(zc,'IBCD_*'): proposedName = Internal.getName(ibcd)[0:6]+'_X%d'%(self.rank) ibcd[0] = getIBCDName(proposedName) if self.input_var.twoFronts: for zc in Internal.getZones(tc2): - for ibcd in Internal.getNodesFromName1(zc,'2_IBCD_*'): + for ibcd in Internal.getNodesFromName1(zc,'2_IBCD_*'): proposedName = Internal.getName(ibcd)[0:8]+'_X%d'%(self.rank) ibcd[0] = getIBCDName(proposedName) @@ -3081,7 +3081,7 @@ def prepare(self, t_case, t_out, tc_out): if 'Mafzal' in self.ibctypes: Internal._createUniqueChild(solverIBC, 'isgradP' , 'DataArray_t', 'True') Internal._createUniqueChild(solverIBC, 'mafzalMode', 'DataArray_t', 0) - Internal._createUniqueChild(solverIBC, 'alphaGrad' , 'DataArray_t', 0) + Internal._createUniqueChild(solverIBC, 'alphaGrad' , 'DataArray_t', 0) if self.input_var.twoFronts: Internal._createUniqueChild(solverIBC, 'isgradP' , 'DataArray_t', 'True') Internal._createUniqueChild(solverIBC, 'alphaGrad' , 'DataArray_t', 0) @@ -3090,11 +3090,11 @@ def prepare(self, t_case, t_out, tc_out): Internal._createUniqueChild(solverIBC, 'DeltaVWire' , 'DataArray_t', 0) Internal._createUniqueChild(solverIBC, 'KWire' , 'DataArray_t', 0) Internal._createUniqueChild(solverIBC, 'DiameterWire', 'DataArray_t', 0) - Internal._createUniqueChild(solverIBC, 'CtWire' , 'DataArray_t', 0) + Internal._createUniqueChild(solverIBC, 'CtWire' , 'DataArray_t', 0) if 'TBLE' in self.ibctypes or 'TBLE_FULL' in self.ibctypes: Internal._createUniqueChild(solverIBC, 'isTBLE' , 'DataArray_t', 'True') Internal._createUniqueChild(solverIBC, 'alphaGrad' , 'DataArray_t', 0) - Internal._createUniqueChild(solverIBC, 'NbPtsLinelits' , 'DataArray_t', 0) + Internal._createUniqueChild(solverIBC, 'NbPtsLinelits' , 'DataArray_t', 0) if isinstance(tc_out, str): tcp = Compressor.compressCartesian(tc) @@ -3121,7 +3121,7 @@ def prepare(self, t_case, t_out, tc_out): if not self.input_var.redistribute: self._checkNcellsNptsPerProc(tc,isAtCenter=True) - # Save t + # Save t if isinstance(t_out, str): tp = Compressor.compressCartesian(t) Cmpi.convertPyTree2File(tp, t_out, ignoreProcNodes=True) @@ -3258,7 +3258,7 @@ def prepare1(t_case, t_out, tc_out, t_in=None, to=None, snears=0.01, dfars=10., tbox=None, snearsf=None, yplus=100., Lref=1., vmin=21, check=False, format='single', interpDataType=0, order=2, ext=2, nature=1,optimized=1, frontType=1, extrusion=None, smoothing=False, balancing=False, recomputeDist=False, - distrib=True, expand=3, tinit=None, initWithBBox=-1., wallAdapt=None, yplusAdapt=100., dfarDir=0, + distrib=True, expand=3, tinit=None, initWithBBox=-1., wallAdapt=None, yplusAdapt=100., dfarDir=0, correctionMultiCorpsF42=False, blankingF42=False, twoFronts=False, redistribute=False, IBCType=1, height_in=-1.0,isFilamentOnly=False, cleanCellN=True, check_snear=False, generateCartesianMeshOnly=False, tbOneOver=None): prep_local=IBM() @@ -3303,4 +3303,3 @@ def prepare1(t_case, t_out, tc_out, t_in=None, to=None, snears=0.01, dfars=10., t,tc = prep_local.prepare(t_case, t_out, tc_out) return t, tc - diff --git a/Cassiopee/Apps/Apps/Fast/IBMO.py b/Cassiopee/Apps/Apps/Fast/IBMO.py index b77c603e9..2d110b8c9 100644 --- a/Cassiopee/Apps/Apps/Fast/IBMO.py +++ b/Cassiopee/Apps/Apps/Fast/IBMO.py @@ -37,8 +37,8 @@ def isZoneChimera(z): if Internal.getValue(n) == 'Overset': return True return False -def buildAllBodies__(t_case, distrib, motion=False): - if isinstance(t_case, str): +def buildAllBodies__(t_case, distrib, motion=False): + if isinstance(t_case, str): h = Filter.Handle(t_case) if distrib: tb = h.loadAndSplit(NParts=Cmpi.size) @@ -48,34 +48,34 @@ def buildAllBodies__(t_case, distrib, motion=False): else: tb = t_case dimPb = Internal.getNodeFromName(tb, 'EquationDimension') - dimPb = Internal.getValue(dimPb) + dimPb = Internal.getValue(dimPb) - # tbchim : arbre des corps chimeres + # tbchim : arbre des corps chimeres tbchim = C.newPyTree() tbov = C.newPyTree() tbblank = C.newPyTree() # tbibm : arbre des corps ibms en z = 0 - tbibm = C.newPyTree() - # chargement des zones Chimere par proc + tbibm = C.newPyTree() + # chargement des zones Chimere par proc bases = Internal.getBases(tb) baseNamesChim=[] for b in bases: isChimera = False for z in Internal.getZones(b): - if isZoneChimera(z): + if isZoneChimera(z): isChimera = True baseNamesChim.append(b[0]) break if isChimera: zoneChimNames=[] - for z in Internal.getZones(b): + for z in Internal.getZones(b): proc = Internal.getNodeFromName2(z,'proc') proc = Internal.getValue(proc) if proc == rank: zoneChimNames.append(z[0]) - else: + else: Internal._rmNodesFromName1(b,z[0]) if zoneChimNames != []: Cmpi._readZones(tb, t_case, rank=rank, zoneNames=zoneChimNames) @@ -89,7 +89,7 @@ def buildAllBodies__(t_case, distrib, motion=False): zwalls = C.extractBCOfType(z, 'BCWall') now = 1 - for zw in zwalls: + for zw in zwalls: zw[0] = b[0]+'_'+z[0]+'_W'+str(now) if TM is not None: zw[2].append(TM) if SD is not None: zw[2].append(SD) @@ -99,7 +99,7 @@ def buildAllBodies__(t_case, distrib, motion=False): zovs = C.extractBCOfType(z, 'BCOverlap') nov = 1 - for zo in zovs: + for zo in zovs: zo[0] = b[0]+'_'+z[0]+'_OV'+str(nov) if TM is not None: zo[2].append(TM) if SD is not None: zo[2].append(SD) @@ -109,17 +109,17 @@ def buildAllBodies__(t_case, distrib, motion=False): else: zoneIBMNames = [] - for z in Internal.getZones(b): + for z in Internal.getZones(b): proc = Internal.getNodeFromName2(z,'proc') proc = Internal.getValue(proc) if proc == rank: zoneIBMNames.append(z[0]) - else: + else: Internal._rmNodesFromName1(b,z[0]) if zoneIBMNames!=[]: Cmpi._readZones(tb, t_case, rank=rank, zoneNames=zoneIBMNames) - tbibm[2].append(b) + tbibm[2].append(b) if dimPb == 2: C._initVars(tb, 'CoordinateZ', 0.) @@ -127,7 +127,7 @@ def buildAllBodies__(t_case, distrib, motion=False): C._initVars(tbibm, 'CoordinateZ', 0.) C._initVars(tbov, 'CoordinateZ', 0.) - # allgather: everybody sees all the bodies and overlaps + # allgather: everybody sees all the bodies and overlaps tbchim = Cmpi.allgatherTree(tbchim) tbibm = Cmpi.allgatherTree(tbibm) tbov = Cmpi.allgatherTree(tbov) @@ -144,7 +144,7 @@ def buildAllBodies__(t_case, distrib, motion=False): if motion: RM._copyGrid2GridInit(tbov) - RM._copyGrid2GridInit(tbchim) + RM._copyGrid2GridInit(tbchim) return [tb, tbov, tbchim, tbibm, tball, baseNamesChim] @@ -163,15 +163,15 @@ def createChimeraTree__(tb, tbchim, tball, baseNamesChim, dimPb=3, motion=False) t2 = X.connectMatch(t2, tol=1.e-6, dim=dimPb) Internal._addGhostCells(t2, t2, DEPTH, adaptBCs=1, fillCorner=0) - # Suppression des XZones et correction des matchs + # Suppression des XZones et correction des matchs if Cmpi.size > 1:Cmpi._rmBXZones(t2) - # Suppression des XZones et correction des matchs + # Suppression des XZones et correction des matchs if Cmpi.size > 1:Cmpi._rmBXZones(t2) - # Fusion des fenetres des raccords + # Fusion des fenetres des raccords if Cmpi.size > 1: t2 = Xmpi.mergeWindows(t2) - if dimPb == 2: + if dimPb == 2: T._addkplane(t2) T._contract(t2, (0,0,0), (1,0,0), (0,1,0), dz) T._makeDirect(t2) @@ -196,7 +196,7 @@ def createChimeraTree__(tb, tbchim, tball, baseNamesChim, dimPb=3, motion=False) Cmpi._addXZones(tc2[2][nob], graphMatch, noCoordinates=True, cartesian=False) Cmpi._addXZones(t2[2][nob], graphMatch, noCoordinates=True, cartesian=False) # on construit les donnees des raccords match - X._setInterpData(t2[2][nob], tc2[2][nob], nature=1, penalty=1, loc='centers', + X._setInterpData(t2[2][nob], tc2[2][nob], nature=1, penalty=1, loc='centers', storage='inverse', sameName=1, dim=dimPb, itype='abutting') Cmpi._rmXZones(tc2[2][nob]) Cmpi._rmXZones(t2[2][nob]) @@ -211,14 +211,14 @@ def createChimeraTree__(tb, tbchim, tball, baseNamesChim, dimPb=3, motion=False) return t2, tc2 def prepareMotion(t_case, t_out, tc_out, t_in=None, to=None, snears=0.01, dfars=10., - tbox=None, snearsf=None, yplus=100., Lref=1., - vmin=21, check=False, NP=0, format='single', - frontType=1, extrusion=False, smoothing=False, balancing=False, - distrib=True, expand=3, tinit=None, initWithBBox=-1., wallAdapt=None, yplusAdapt=100., - dfarDir=0,dz_in=0.01,span_in=0.25,NPas_in=10,height_in=0.1, - correctionMultiCorpsF42=False, blankingF42=False, twoFronts=False, - redistribute=False,isDist2WallNearBodyOnly=False,isoverideheight=False,check2Donly=False, - dict_Nz={},isCartesianExtrude=False,isExtrudeByZone=False,directory_tmp_files='./'): + tbox=None, snearsf=None, yplus=100., Lref=1., + vmin=21, check=False, NP=0, format='single', + frontType=1, extrusion=False, smoothing=False, balancing=False, + distrib=True, expand=3, tinit=None, initWithBBox=-1., wallAdapt=None, yplusAdapt=100., + dfarDir=0,dz_in=0.01,span_in=0.25,NPas_in=10,height_in=0.1, + correctionMultiCorpsF42=False, blankingF42=False, twoFronts=False, + redistribute=False,isDist2WallNearBodyOnly=False,isoverideheight=False,check2Donly=False, + dict_Nz={},isCartesianExtrude=False,isExtrudeByZone=False,directory_tmp_files='./'): motion = True rank = Cmpi.rank comm = Cmpi.COMM_WORLD @@ -230,7 +230,7 @@ def prepareMotion(t_case, t_out, tc_out, t_in=None, to=None, snears=0.01, dfars= # dimension du pb dimPb = Internal.getNodeFromName(tb, 'EquationDimension') - dimPb = Internal.getValue(dimPb) + dimPb = Internal.getValue(dimPb) # Reference state refstate = C.getState(tb) @@ -246,19 +246,19 @@ def prepareMotion(t_case, t_out, tc_out, t_in=None, to=None, snears=0.01, dfars= # if bodies in motion taken into account # either by a tbox or input octree to defined t,tc = AppIBM.prepare1(tbibm, None, None, t_in=None, to=to, - snears=snears, dfars=dfars, - tbox=tbox, snearsf=snearsf, yplus=yplus, Lref=Lref, - vmin=vmin, check=check, NP=NP, format='single', - frontType=1, extrusion=extrusion, smoothing=smoothing, balancing=balancing, - distrib=distrib, expand=expand, tinit=tinit, initWithBBox=initWithBBox, wallAdapt=None, yplusAdapt=100., - dfarDir=dfarDir,dz_in=dz_in,span_in=span_in,NPas_in=NPas_in,height_in=height_in, - correctionMultiCorpsF42=correctionMultiCorpsF42, blankingF42=blankingF42, twoFronts=twoFronts, - redistribute=redistribute, - isDist2WallNearBodyOnly=isDist2WallNearBodyOnly, - isoverideheight=isoverideheight, - check2Donly=check2Donly, - dict_Nz=dict_Nz,isCartesianExtrude=isCartesianExtrude,isExtrudeByZone=isExtrudeByZone, - directory_tmp_files=directory_tmp_files) + snears=snears, dfars=dfars, + tbox=tbox, snearsf=snearsf, yplus=yplus, Lref=Lref, + vmin=vmin, check=check, NP=NP, format='single', + frontType=1, extrusion=extrusion, smoothing=smoothing, balancing=balancing, + distrib=distrib, expand=expand, tinit=tinit, initWithBBox=initWithBBox, wallAdapt=None, yplusAdapt=100., + dfarDir=dfarDir,dz_in=dz_in,span_in=span_in,NPas_in=NPas_in,height_in=height_in, + correctionMultiCorpsF42=correctionMultiCorpsF42, blankingF42=blankingF42, twoFronts=twoFronts, + redistribute=redistribute, + isDist2WallNearBodyOnly=isDist2WallNearBodyOnly, + isoverideheight=isoverideheight, + check2Donly=check2Donly, + dict_Nz=dict_Nz,isCartesianExtrude=isCartesianExtrude,isExtrudeByZone=isExtrudeByZone, + directory_tmp_files=directory_tmp_files) # merge trees tp1 = Internal.copyRef(t) @@ -298,14 +298,14 @@ def prepareMotion(t_case, t_out, tc_out, t_in=None, to=None, snears=0.01, dfars= if motion: RM._copyGrid2GridInit(tpc) Internal._rmNodesFromName(tpc,'ZoneRind') - if isinstance(tc_out, str): + if isinstance(tc_out, str): #import Compressor.PyTree as Compressor #Compressor._compressCartesian(tpc[2][1]) Cmpi.convertPyTree2File(tpc, tc_out, ignoreProcNodes=True) # Initialization if tinit is None: I._initConst(tp, loc='centers') - else: + else: import Post.PyTree as Pmpi tp = Pmpi.extractMesh(tinit, tp, mode='accurate') if model != "Euler": C._initVars(tp, 'centers:ViscosityEddy', 0.) @@ -322,7 +322,7 @@ def prepareMotion(t_case, t_out, tc_out, t_in=None, to=None, snears=0.01, dfars= T._scale(bodybb, factor=(initWithBBox,initWithBBox,initWithBBox)) tbb = G.BB(tp) interDict = X.getIntersectingDomains(tbb,bodybb,taabb=tbb,taabb2=bodybb) - for zone in Internal.getZones(tp[2][1]): + for zone in Internal.getZones(tp[2][1]): zname = Internal.getName(zone) if interDict[zname] != []: C._initVars(zone, 'centers:MomentumX', 0.) @@ -345,23 +345,23 @@ def prepareMotion(t_case, t_out, tc_out, t_in=None, to=None, snears=0.01, dfars= #Compressor._compressCartesian(tp[2][1]) Cmpi.convertPyTree2File(tp, t_out, ignoreProcNodes=True) - if Cmpi.size > 1: Cmpi.barrier() + if Cmpi.size > 1: Cmpi.barrier() return tp, tpc #================================================================================ # IBMO prepare # #================================================================================ -def prepare(t_case, t_out, tc_out, tblank=None, to=None, +def prepare(t_case, t_out, tc_out, tblank=None, to=None, vmin=21, check=False, NP=0, frontType=1, tbox=None, snearsf=None, - expand=3, distrib=False, tinit=None, initWithBBox=-1., + expand=3, distrib=False, tinit=None, initWithBBox=-1., dfarDir=0): rank = Cmpi.rank comm = Cmpi.COMM_WORLD tolMatch = 1.e-6 DEPTH = 2 IBCType = 1 - if frontType!=1: + if frontType!=1: print("Warning: IBMO.prepare: currently implemented for frontType=1 algorithm only.") frontType=1 @@ -372,7 +372,7 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, tbblank = C.convertFile2PyTree(tblank) else: tbblank = tblank - if isinstance(t_case, str): + if isinstance(t_case, str): h = Filter.Handle(t_case) if distrib: tb = h.loadAndSplit(NParts=Cmpi.size) @@ -398,31 +398,31 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, dimPb = Internal.getNodeFromName(tb, 'EquationDimension') dimPb = Internal.getValue(dimPb) - # tbchim : arbre des corps chimeres + # tbchim : arbre des corps chimeres tbchim = C.newPyTree() tbov = C.newPyTree() # tbibm : arbre des corps ibms en z = 0 - tbibm = C.newPyTree() - # chargement des zones Chimere par proc + tbibm = C.newPyTree() + # chargement des zones Chimere par proc bases = Internal.getBases(tb) baseNamesChim=[] for b in bases: isChimera = False for z in Internal.getZones(b): - if isZoneChimera(z): + if isZoneChimera(z): isChimera = True baseNamesChim.append(b[0]) break if isChimera: zoneChimNames=[] - for z in Internal.getZones(b): + for z in Internal.getZones(b): proc = Internal.getNodeFromName2(z,'proc') proc = Internal.getValue(proc) if proc == rank: zoneChimNames.append(z[0]) - else: + else: Internal._rmNodesFromName1(b,z[0]) if zoneChimNames != []: Cmpi._readZones(tb, t_case, rank=rank, zoneNames=zoneChimNames) @@ -434,17 +434,17 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, else: zoneIBMNames = [] - for z in Internal.getZones(b): + for z in Internal.getZones(b): proc = Internal.getNodeFromName2(z,'proc') proc = Internal.getValue(proc) if proc == rank: zoneIBMNames.append(z[0]) - else: + else: Internal._rmNodesFromName1(b,z[0]) if zoneIBMNames!=[]: Cmpi._readZones(tb, t_case, rank=rank, zoneNames=zoneIBMNames) - tbibm[2].append(b) + tbibm[2].append(b) if dimPb == 2: @@ -453,7 +453,7 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, C._initVars(tbibm, 'CoordinateZ', 0.) C._initVars(tbov, 'CoordinateZ', 0.) - # allgather: everybody sees all the bodies and overlaps + # allgather: everybody sees all the bodies and overlaps tbchim = Cmpi.allgatherTree(tbchim) tbibm = Cmpi.allgatherTree(tbibm) tbov = Cmpi.allgatherTree(tbov) @@ -483,11 +483,11 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, # Extraction de la liste des dfars de tb zones = Internal.getZones(tbo) dfars = [10.]*len(zones) - for c, z in enumerate(zones): + for c, z in enumerate(zones): n = Internal.getNodeFromName2(z, 'dfar') if n is not None: dfars[c] = Internal.getValue(n)*1. - o = TIBM.buildOctree(tbo, snearFactor=1., dfars=dfars, + o = TIBM.buildOctree(tbo, snearFactor=1., dfars=dfars, dimPb=dimPb, vmin=vmin, expand=expand, dfarDir=dfarDir) @@ -509,7 +509,7 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, # fill vmin + merge in parallel test.printMem(">>> Octree struct [start]") res = TIBM.octree2StructLoc__(p, vmin=vmin, ext=-1, optimized=0, parento=parento, sizeMax=1000000) - del p + del p if parento is not None: for po in parento: del po t = C.newPyTree(['CARTESIAN', res]) @@ -558,13 +558,13 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, t2 = X.connectMatch(t2, tol=tolMatch, dim=dimPb) Internal._addGhostCells(t2, t2, DEPTH, adaptBCs=1, fillCorner=0) - # Suppression des XZones et correction des matchs + # Suppression des XZones et correction des matchs Cmpi._rmBXZones(t2) - # Fusion des fenetres des raccords + # Fusion des fenetres des raccords t2 = Xmpi.mergeWindows(t2) - if dimPb == 2: + if dimPb == 2: T._addkplane(t2) T._contract(t2, (0,0,0), (1,0,0), (0,1,0), dz) T._makeDirect(t2) @@ -581,7 +581,7 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, DTW._distance2Walls(t2, tball, loc='centers', type='ortho') test.printMem(">>> Wall distance on Chimera grids [end]") - # ReferenceState + # ReferenceState C._addState(t, state=refstate) C._addState(t, 'GoverningEquations', model) C._addState(t, 'EquationDimension', dimPb) @@ -643,7 +643,7 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, if frontType < 2: X._setHoleInterpolatedPoints(t,depth=2,dir=0,loc='centers',cellNName='cellNIBC',addGC=False) else: - X._setHoleInterpolatedPoints(t,depth=3,dir=0,loc='centers',cellNName='cellNIBC',addGC=False) + X._setHoleInterpolatedPoints(t,depth=3,dir=0,loc='centers',cellNName='cellNIBC',addGC=False) TIBM._removeBlankedGrids(t, loc='centers') test.printMem(">>> Blanking [end]") @@ -709,7 +709,7 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, for zdname in interDict[zrname]: zd = Internal.getNodeFromName2(tpc, zdname) isDnrCart=False - # base receveuse cartesienne : on prend les donneurs meme ds la meme base + # base receveuse cartesienne : on prend les donneurs meme ds la meme base if isCartBaseR: dnrZonesChim.append(zd) prefix=zdname.split('.') @@ -718,9 +718,9 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, if prefix=='Cart': isDnrCart=True if isDnrCart: listOfInterpDataTypes.append(0) - else: + else: listOfInterpDataTypes.append(1) - else: + else: if nobOfDnrBases[zdname]!=nob: dnrZonesChim.append(zd) prefix=zdname.split('.') @@ -729,12 +729,12 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, if prefix=='Cart': isDnrCart=True if isDnrCart: listOfInterpDataTypes.append(0) - else: + else: listOfInterpDataTypes.append(1) #3- A OPTIMISER : des cartesiens et des ADT # for i in range(len(dnrZonesChim)): # print(dnrZonesChim[i][0],listOfInterpDataTypes[i]) - X._setInterpData(zrcv, dnrZonesChim, nature=1, penalty=1, loc='centers', storage='inverse', + X._setInterpData(zrcv, dnrZonesChim, nature=1, penalty=1, loc='centers', storage='inverse', sameName=1, interpDataType=listOfInterpDataTypes, itype='chimera') for zd in dnrZonesChim: @@ -747,7 +747,7 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, if Internal.getValue(i)==zrname: IDs.append(i) if IDs != []: - if destProc == rank: + if destProc == rank: zD = Internal.getNodeFromName2(tpc, zdname) zD[2] += IDs else: @@ -790,7 +790,7 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, Cmpi._addXZones(tpc[2][nob], graphMatch, noCoordinates=True, cartesian=False) Cmpi._addXZones(tp[2][nob], graphMatch, noCoordinates=True, cartesian=False) # on construit les donnees des raccords match - X._setInterpData(tp[2][nob], tpc[2][nob], nature=1, penalty=1, loc='centers', + X._setInterpData(tp[2][nob], tpc[2][nob], nature=1, penalty=1, loc='centers', storage='inverse', sameName=1, dim=dimPb, itype='abutting') Cmpi._rmXZones(tpc[2][nob]) Cmpi._rmXZones(tp[2][nob]) @@ -800,18 +800,18 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, test.printMem(">>> Abutting data [after free]") test.printMem(">>> Abutting data [end]") - # Traitement IBC : n est fait que sur le cartesien -> + # Traitement IBC : n est fait que sur le cartesien -> tp_cart = C.newPyTree(); tp_cart[2].append(Internal.copyRef(tp[2][1])) tpc_cart = C.newPyTree(); tpc_cart[2].append(Internal.copyRef(tpc[2][1])) C._rmVars(tp,['centers:cellNFront','centers:cellNIBC']) - # suppression des noeuds ID_* non cartesiens pour ne pas planter les transferts + # suppression des noeuds ID_* non cartesiens pour ne pas planter les transferts for ID in Internal.getNodesFromType3(tpc_cart,'ZoneSubRegion_t'): if ID[0][0:7]!='ID_Cart': Internal._rmNode(tpc_cart,ID) C._initVars(tp_cart,'{centers:cellNIBCDnr}=minimum(2.,abs({centers:cellNIBC}))') C._initVars(tp_cart,'{centers:cellNIBC}=maximum(0.,{centers:cellNIBC})')# vaut -3, 0, 1, 2, 3 initialement - C._initVars(tp_cart,'{centers:cellNIBC}={centers:cellNIBC}*({centers:cellNIBC}<2.5)') + C._initVars(tp_cart,'{centers:cellNIBC}={centers:cellNIBC}*({centers:cellNIBC}<2.5)') C._cpVars(tp_cart,'centers:cellNIBC',tp_cart,'centers:cellN') C._cpVars(tp_cart,'centers:cellN',tpc_cart,'cellN') @@ -839,7 +839,7 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, zrcvname = zrcv[0]; zonesRIBC.append(zrcv) nbZonesIBC = len(zonesRIBC) - if nbZonesIBC == 0: + if nbZonesIBC == 0: res = [{},{},{}] else: res = TIBM.getAllIBMPoints(zonesRIBC, loc='centers',tb=tbibm, tfront=front, frontType=frontType, @@ -855,10 +855,10 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, # graphe d'intersection des pts images de ce proc et des zones de tbbc tbbc_cart = C.newPyTree(); tbbc_cart[2].append(tbbc[2][1]) - zones = Internal.getZones(tbbc_cart) + zones = Internal.getZones(tbbc_cart) allBBs = [] dictOfCorrectedPtsByIBCType = res[0] - dictOfWallPtsByIBCType = res[1] + dictOfWallPtsByIBCType = res[1] dictOfInterpPtsByIBCType = res[2] interDictIBM={} if dictOfCorrectedPtsByIBCType!={}: @@ -877,7 +877,7 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, popp = Cmpi.getProc(z) Distributed.updateGraph__(graph, popp, rank, zname) if zrname not in interDictIBM: interDictIBM[zrname]=[zname] - else: + else: if zname not in interDictIBM[zrname]: interDictIBM[zrname].append(zname) else: graph={} del tbbc_cart @@ -928,12 +928,12 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, interpDataType=0, ReferenceState=ReferenceState, bcType=ibcTypeL,model=model) nozr += 1 - for zd in dnrZones: + for zd in dnrZones: zdname = zd[0] destProc = procDict[zdname] #allIDs = Internal.getNodesFromName(zd, 'IBCD*') - #IDs = [] + #IDs = [] #for zsr in allIDs: # if Internal.getValue(zsr)==zrname: IDs.append(zsr) @@ -943,7 +943,7 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, if Internal.getValue(i)==zrname: IDs.append(i) if IDs != []: - if destProc == rank: + if destProc == rank: zD = Internal.getNodeFromName2(tpc_cart,zdname) zD[2] += IDs else: @@ -1039,14 +1039,14 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, if len(zname)==2: Internal.setName(zone,zname[1]) for zone in Internal.getZones(tpc[2][2]): Internal._rmNodesFromName(zone,'RANSLES') - if isinstance(tc_out, str): + if isinstance(tc_out, str): import Compressor.PyTree as Compressor Compressor._compressCartesian(tpc[2][1]) Cmpi.convertPyTree2File(tpc, tc_out, ignoreProcNodes=True) # Initialisation if tinit is None: I._initConst(tp, loc='centers') - else: + else: import Post.PyTree as Pmpi tp = Pmpi.extractMesh(tinit, tp, mode='accurate') if model != "Euler": C._initVars(tp, 'centers:ViscosityEddy', 0.) @@ -1063,7 +1063,7 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, T._scale(bodybb, factor=(initWithBBox,initWithBBox,initWithBBox)) tbb = G.BB(tp) interDict = X.getIntersectingDomains(tbb,bodybb,taabb=tbb,taabb2=bodybb) - for zone in Internal.getZones(tp[2][1]): + for zone in Internal.getZones(tp[2][1]): zname = Internal.getName(zone) if interDict[zname] != []: C._initVars(zone, 'centers:MomentumX', 0.) @@ -1084,7 +1084,7 @@ def prepare(t_case, t_out, tc_out, tblank=None, to=None, #Compressor._compressCartesian(tp[2][1]) Cmpi.convertPyTree2File(tp, t_out, ignoreProcNodes=True) - if Cmpi.size > 1: Cmpi.barrier() + if Cmpi.size > 1: Cmpi.barrier() return tp, tpc #==================================================================================== @@ -1096,13 +1096,13 @@ def __init__(self, format=None, numb=None, numz=None): self.authors = ["stephanie@onera.fr", "ash@onera.fr"] self.cartesian = False - # Prepare + # Prepare def prepare(self, t_case, t_out, tc_out, distrib=False, vmin=21, check=False, frontType=1, NP=None, expand=3, dfarDir=0): if NP is None: NP = Cmpi.size if NP == 0: print('Preparing for a sequential computation.') else: print('Preparing for an IBMO computation on %d processors.'%NP) ret = prepare(t_case, t_out, tc_out, distrib=distrib, - vmin=vmin, check=check, NP=NP, + vmin=vmin, check=check, NP=NP, frontType=frontType, expand=expand, dfarDir=dfarDir) return ret diff --git a/Cassiopee/Apps/Apps/Fast/IBM_old.py b/Cassiopee/Apps/Apps/Fast/IBM_old.py index 7a161dacb..3400b6535 100644 --- a/Cassiopee/Apps/Apps/Fast/IBM_old.py +++ b/Cassiopee/Apps/Apps/Fast/IBM_old.py @@ -61,7 +61,7 @@ def _change_name_IBCD(tc2,NewIBCD): zsplit[1]=str(NewIBCD) znew = '_'.join(zsplit) Internal.setName(z, znew) - return None + return None # IN: maillage surfacique + reference State + snears #================================================================================ @@ -81,7 +81,7 @@ def _change_name_IBCD(tc2,NewIBCD): def prepare(t_case, t_out, tc_out, snears=0.01, dfar=10., dfarList=[], tbox=None, snearsf=None, yplus=100., vmin=21, check=False, NP=0, format='single', - frontType=1, expand=3, tinit=None, initWithBBox=-1., wallAdapt=None, + frontType=1, expand=3, tinit=None, initWithBBox=-1., wallAdapt=None, dfarDir=0, recomputeDist=False, redistribute=False): rank = Cmpi.rank; size = Cmpi.size ret = None @@ -93,9 +93,9 @@ def prepare(t_case, t_out, tc_out, snears=0.01, dfar=10., dfarList=[], # parallel prep #else: ret = prepare1(t_case, t_out, tc_out, snears=snears, dfar=dfar, dfarList=dfarList, - tbox=tbox, snearsf=snearsf, yplus=yplus, + tbox=tbox, snearsf=snearsf, yplus=yplus, vmin=vmin, check=check, NP=NP, format=format, frontType=frontType, - expand=expand, tinit=tinit, initWithBBox=initWithBBox, + expand=expand, tinit=tinit, initWithBBox=initWithBBox, wallAdapt=wallAdapt, dfarDir=dfarDir, redistribute=redistribute) return ret @@ -160,8 +160,8 @@ def prepare0(t_case, t_out, tc_out, snears=0.01, dfar=10., dfarList=[], #-------------------------------------------------------- # Generates the full Cartesian mesh t = G_IBM.generateIBMMesh_legacy(tb, vmin=vmin, snears=snears, dfar=dfar, dfarList=dfarList, DEPTH=2, - tbox=tbox, snearsf=snearsf, check=check, sizeMax=1000000, - expand=expand, dfarDir=dfarDir) + tbox=tbox, snearsf=snearsf, check=check, sizeMax=1000000, + expand=expand, dfarDir=dfarDir) test.printMem(">>> Build octree full [end]") #------------------------------------------------------ @@ -331,7 +331,7 @@ def generateCartesian(tb, dimPb=3, snears=0.01, dfar=10., dfarList=[], tbox=None # build parent octree 3 levels higher # returns a list of 4 octants of the parent octree in 2D and 8 in 3D parento = G_IBM.buildParentOctrees__(o, tb, snears=snears, snearFactor=4., dfar=dfar, dfarList=dfarList, to=to, tbox=tbox, snearsf=snearsf, - dimPb=dimPb, vmin=vmin, symmetry=symmetry, fileout=None, rank=rank) + dimPb=dimPb, vmin=vmin, symmetry=symmetry, fileout=None, rank=rank) test.printMem(">>> Octree unstruct [end]") # Split octree @@ -386,7 +386,7 @@ def generateCartesian(tb, dimPb=3, snears=0.01, dfar=10., dfarList=[], tbox=None # ReferenceState C._addState(t, state=refstate) C._addState(t, 'GoverningEquations', model) - C._addState(t, 'EquationDimension', dimPb) + C._addState(t, 'EquationDimension', dimPb) return t #================================================================================ @@ -420,7 +420,7 @@ def extrudeCartesian(t, tb, check=False, extrusion="cart", dz=0.01, NPas=10, spa #Dim = 3D c = 0 for tree in [t,tb]: - for dim in Internal.getNodesFromName(tree,'EquationDimension'): dim[1]=3 + for dim in Internal.getNodesFromName(tree,'EquationDimension'): dim[1]=3 dz_loc={}; Nk={} if c ==0: @@ -510,7 +510,7 @@ def extrudeCartesian(t, tb, check=False, extrusion="cart", dz=0.01, NPas=10, spa BCs = Internal.getNodesFromType(z, "BC_t") for bc in BCs: ptrg = Internal.getNodeFromName(bc, "PointRange")[1] - ptrg[2,0] = 3 + ptrg[2,0] = 3 ptrg[2,1] = Nk[z[0]] # Creatioon connectivite perio dans t @@ -619,7 +619,7 @@ def setInterpData_Hybride(t_3d, tc_3d, t_curvi, extrusion=None, interpDataType=1 for zsr in Internal.getNodesFromType(zc, "ZoneSubRegion_t"): zsrname = Internal.getName(zsr) zsrname = zsrname.split('_') - if zsrname[0]=='IBCD' and zsrname[1] == itype: + if zsrname[0]=='IBCD' and zsrname[1] == itype: zrname = Internal.getValue(zsr) ptlistD= Internal.getNodeFromName(zsr,'PointListDonor')[1] zloc = Internal.getNodeFromName(t_3d,zrname) @@ -657,7 +657,7 @@ def setInterpData_Hybride(t_3d, tc_3d, t_curvi, extrusion=None, interpDataType=1 zonelist=[] for z in Internal.getZones(t_3d): if C.getMaxValue(z,'centers:cellN')==2: - dnrZones = [] + dnrZones = [] for zdname in interDict[z[0]]: zd = Internal.getNodeFromName(tc2,zdname) dnrZones.append(zd) @@ -670,8 +670,8 @@ def setInterpData_Hybride(t_3d, tc_3d, t_curvi, extrusion=None, interpDataType=1 print(" Interp curvi from Cartesian") for z in Internal.getZones(t_curvi): if C.getMaxValue(z,'centers:cellN')==2: - #if 'join' in z[0]: - dnrZones = [] + #if 'join' in z[0]: + dnrZones = [] for zdname in interDict_curvi[z[0]]: zd = Internal.getNodeFromName(tc_3d,zdname) dnrZones.append(zd) @@ -716,7 +716,7 @@ def prepare1(t_case, t_out, tc_out, t_in=None, to=None, snears=0.01, dfar=10., d tbox=None, snearsf=None, yplus=100., Lref=1., vmin=21, check=False, NP=0, format='single', interpDataType=0, order=2, ext=2, frontType=1, extrusion=None, smoothing=False, balancing=False, recomputeDist=False, - distrib=True, expand=3, tinit=None, initWithBBox=-1., wallAdapt=None, yplusAdapt=100., dfarDir=0, + distrib=True, expand=3, tinit=None, initWithBBox=-1., wallAdapt=None, yplusAdapt=100., dfarDir=0, correctionMultiCorpsF42=False, blankingF42=False, twoFronts=False, redistribute=False, IBCType=1, height_in=1.0,isoverideheight=False,isFilamentOnly=False,closedSolid=[],isWireModel=False, cleanCellN=True): @@ -783,8 +783,8 @@ def prepare1(t_case, t_out, tc_out, t_in=None, to=None, snears=0.01, dfar=10., d if dimPb == 2 and cleanCellN == False: C._initVars(tb, 'CoordinateZ', 0.) # forced if t_in is None: t = generateCartesian(tb, dimPb=dimPb, snears=snears, dfar=dfar, dfarList=dfarList, tbox=tbox, ext=ext+1, - snearsf=snearsf, yplus=yplus,vmin=vmin, check=check, expand=expand, dfarDir=dfarDir) - else: + snearsf=snearsf, yplus=yplus,vmin=vmin, check=check, expand=expand, dfarDir=dfarDir) + else: t = t_in dimPb = Internal.getNodeFromName(tb, 'EquationDimension') @@ -858,9 +858,9 @@ def prepare1(t_case, t_out, tc_out, t_in=None, to=None, snears=0.01, dfar=10., d C._initVars(t,'{centers:TurbulentDistance_ori}={centers:TurbulentDistance}') Reynolds = Internal.getNodeFromName(tb, 'Reynolds') - if Reynolds is not None: + if Reynolds is not None: Reynolds = Internal.getValue(Reynolds) - else: + else: Reynolds = 6.e6 if yplus > 0.: @@ -887,7 +887,7 @@ def prepare1(t_case, t_out, tc_out, t_in=None, to=None, snears=0.01, dfar=10., d coordY[0][1] = coordY[0][1] + shiftDist coordY[1][1] = coordY[1][1] + shiftDist Internal.getNodeFromName(bboxBody, 'CoordinateY')[1] = coordY - coordZ = Internal.getNodeFromName(bboxBody, 'CoordinateZ')[1] + coordZ = Internal.getNodeFromName(bboxBody, 'CoordinateZ')[1] coordZ[0][0][0] = coordZ[0][0][0] - shiftDist coordZ[0][1][0] = coordZ[0][1][0] - shiftDist coordZ[1][0][0] = coordZ[1][0][0] - shiftDist @@ -1010,7 +1010,7 @@ def prepare1(t_case, t_out, tc_out, t_in=None, to=None, snears=0.01, dfar=10., d for z in Internal.getZones(t): h = abs(C.getValue(z,'CoordinateX',0)-C.getValue(z,'CoordinateX',1)) if yplus > 0.: - if isoverideheight:height = height_in + if isoverideheight:height = height_in else:height = G_IBM_Height.computeModelisationHeight(Re=Reynolds, yplus=yplus, L=Lref) else: if isoverideheight:height = height_in @@ -1163,7 +1163,7 @@ def findIsoFront(cellNFront, Dist_1, Dist_2): test.printMem(">>> Interpdata [start]") tc = C.node2Center(t) - # abutting ? + # abutting ? if Internal.getNodeFromType(t,"GridConnectivity1to1_t") is not None: test.printMem("setInterpData abutting") Xmpi._setInterpData(t, tc, nature=1, loc='centers', storage='inverse', sameName=1, dim=3, itype='abutting') @@ -1379,7 +1379,7 @@ def findIsoFront(cellNFront, Dist_1, Dist_2): cellNName='cellNIBC', depth=DEPTH, IBCType=IBCType, Reynolds=Reynolds, yplus=yplus, Lref=Lref, isOrthoFirst=isOrtho_Project_First) if twoFronts: res2 = X_IBM.getAllIBMPoints(zonesRIBC, loc='centers',tb=tb, tfront=front2, frontType=frontType, - cellNName='cellNIBC', depth=DEPTH, IBCType=IBCType, Reynolds=Reynolds, yplus=yplus, Lref=Lref) + cellNName='cellNIBC', depth=DEPTH, IBCType=IBCType, Reynolds=Reynolds, yplus=yplus, Lref=Lref) if isWireModel: res2 = X_IBM.getAllIBMPoints(zonesRIBC, loc='centers',tb=tb, tfront=front, frontType=frontType, cellNName='cellNIBC', depth=DEPTH, IBCType=IBCType, Reynolds=Reynolds, yplus=yplus, Lref=Lref,isWireModel=isWireModel, @@ -1535,8 +1535,8 @@ def findIsoFront(cellNFront, Dist_1, Dist_2): if zd is None: print('!!!Zone None', zrname, zdname) else: dnrZones.append(zd) XOD._setIBCDataForZone2__(zrcv, dnrZones, allCorrectedPts2[nozr], allWallPts2[nozr], None, allInterpPts2[nozr], - nature=1, penalty=1, loc='centers', storage='inverse', dim=dimPb, - interpDataType=interpDataType, ReferenceState=ReferenceState, bcType=ibcTypeL) + nature=1, penalty=1, loc='centers', storage='inverse', dim=dimPb, + interpDataType=interpDataType, ReferenceState=ReferenceState, bcType=ibcTypeL) nozr += 1 for zd in dnrZones: @@ -1633,7 +1633,7 @@ def findIsoFront(cellNFront, Dist_1, Dist_2): # Avoid that two procs write the same information for z in Internal.getZones(tibm): if int(z[0][-1]) != rank: - # Internal._rmNodesByName(tibm, z[0]) + # Internal._rmNodesByName(tibm, z[0]) z[0] = z[0]+"%{}".format(rank) Cmpi.convertPyTree2File(tibm, 'IBMInfo.cgns') @@ -1675,7 +1675,7 @@ def findIsoFront(cellNFront, Dist_1, Dist_2): zsrname = Internal.getName(zsr) zsrname = zsrname.split('_') if zsrname[0]=='IBCD': - for var in ['C','W','I']: + for var in ['C','W','I']: r = Internal.getNodeFromName(zsr,'CoordinateY_P'+var)[1] theta = Internal.getNodeFromName(zsr,'CoordinateZ_P'+var)[1] #print('cyl2cart', var, numpy.size(r), zsr[0], z[0], toto,tutu ) @@ -1724,7 +1724,7 @@ def findIsoFront(cellNFront, Dist_1, Dist_2): DTW._distance2Walls(t,tb,type='ortho', signed=0, dim=dimPb, loc='centers') C._initVars(t, '{centers:TurbulentDistance}={centers:TurbulentDistance}*({centers:cellN}>0.)+(-1.)*{centers:TurbulentDistance}*({centers:cellN}<1.)') - test.printMem(">>> wall distance for viscous wall only - RANS [end]") + test.printMem(">>> wall distance for viscous wall only - RANS [end]") # Save tc if twoFronts or isWireModel: tc2 = Internal.copyTree(tc) @@ -1735,13 +1735,13 @@ def findIsoFront(cellNFront, Dist_1, Dist_2): if RENAMEIBCNODES: for zc in Internal.getZones(tc): - for ibcd in Internal.getNodesFromName1(zc,'IBCD_*'): + for ibcd in Internal.getNodesFromName1(zc,'IBCD_*'): proposedName = Internal.getName(ibcd)[0:6]+'_X%d'%(rank) ibcd[0]=getIBCDName(proposedName) if twoFronts or isWireModel: for zc in Internal.getZones(tc2): - for ibcd in Internal.getNodesFromName1(zc,'2_IBCD_*'): + for ibcd in Internal.getNodesFromName1(zc,'2_IBCD_*'): proposedName = Internal.getName(ibcd)[0:8]+'_X%d'%(rank) ibcd[0]=getIBCDName(proposedName) @@ -1774,7 +1774,7 @@ def findIsoFront(cellNFront, Dist_1, Dist_2): if isWireModel: vars_wm = ['Density','VelocityX','VelocityY','VelocityZ','Temperature'] if model == 'NSTurbulent':vars_wm.append('TurbulentSANuTilde') - vars_wm.append('DistWall2IP') + vars_wm.append('DistWall2IP') for z in Internal.getZones(t): #if C.getMaxValue(C.rmGhostCells(z, z, 2, adaptBCs=1), 'centers:cellN')>1: for v_local in vars_wm: @@ -1803,7 +1803,7 @@ def findIsoFront(cellNFront, Dist_1, Dist_2): if rank == 0: checkNcellsNptsPerProc(tc_tmp, Cmpi.size, isAtCenter=True) del tc_tmp - # Save t + # Save t if isinstance(t_out, str): tp = Compressor.compressCartesian(t) Cmpi.convertPyTree2File(tp, t_out, ignoreProcNodes=True) @@ -1995,14 +1995,14 @@ def initOutflow(tc, familyNameOutflow, P_tot): return tc def initInj(tc, familyNameInj, P_tot, H_tot, injDir=[1.,0.,0.]): - tc=D_IBM.initInj(tc, familyNameInj, P_tot, H_tot, injDir) + tc=D_IBM.initInj(tc, familyNameInj, P_tot, H_tot, injDir) return tc def _initOutflow(tc, familyNameOutflow, P_tot): return D_IBM._initOutflow(tc, familyNameOutflow, P_tot) def _initInj(tc, familyNameInj, P_tot, H_tot, injDir=[1.,0.,0.]): - return D_IBM._initInj(tc, familyNameInj, P_tot, H_tot, injDir) + return D_IBM._initInj(tc, familyNameInj, P_tot, H_tot, injDir) def transformTc2(tc2): tc2=D_IBM.transformTc2(tc2) @@ -2080,7 +2080,7 @@ def post(t_case, t_in, tc_in, t_out, wall_out): X._setInterpTransfers(t, tc, variables=vars, variablesIBC=varsIBC, bcType=bcType, varType=varType, storage=1, - Gamma=Gamma, Cv=cvInf, MuS=Mus, + Gamma=Gamma, Cv=cvInf, MuS=Mus, Cs=Cs, Ts=Ts) zw = P_IBM.extractIBMWallFields(tc, tb=tb) @@ -2176,7 +2176,7 @@ def loads(t_case, tc_in=None, tc2_in=None, wall_out=None, alpha=0., beta=0., gra tc = P_IBM.extractPressureHO2(tc) # add gradP fields in tc2 if necessary - if tc2 is not None: + if tc2 is not None: for z in Internal.getZones(tc2): P_IBM._addGradxiP__(z) @@ -2190,7 +2190,7 @@ def loads(t_case, tc_in=None, tc2_in=None, wall_out=None, alpha=0., beta=0., gra #==================================== # Extraction des grandeurs a la paroi #==================================== - if tc is None: + if tc is None: zw = Internal.getZones(tb) zw = T.join(zw) else: @@ -2250,7 +2250,7 @@ def loads(t_case, tc_in=None, tc2_in=None, wall_out=None, alpha=0., beta=0., gra if isinstance(wall_out, str): C.convertPyTree2File(ts, wall_out) return ts -#==================================================================================== +#==================================================================================== ## IMPORTANT NOTE !! ## FUNCTIONS MIGRATED TO $CASSIOPEE/Cassiopee/Post/Post/IBM.py @@ -2319,7 +2319,7 @@ def dist2wallNearBody(t, tb, type='ortho', signed=0, dim=3, loc='centers'): tBB =G.BB(t) tbBB=G.BB(tb) - interDict = X.getIntersectingDomains(tBB, tbBB) + interDict = X.getIntersectingDomains(tBB, tbBB) #FULL TB zt = [] @@ -2336,7 +2336,7 @@ def dist2wallNearBody(t, tb, type='ortho', signed=0, dim=3, loc='centers'): list_additional_zones = get_zones_scale_up_down(tbBB,tBB,zt_names,dim=dim) ###PRT2 - if list_additional_zones: + if list_additional_zones: zt=[] for i in list_additional_zones: zt.append(Internal.getNodeByName(t,i)) @@ -2346,20 +2346,20 @@ def dist2wallNearBody(t, tb, type='ortho', signed=0, dim=3, loc='centers'): def get_zones_scale_up_down(tbBB,tBB,zt_names,diff_percent=0.15,sweep_num=4,scaleDirection=0,dim=2): - minval_tb = C.getMinValue(tbBB, ['CoordinateX', 'CoordinateY','CoordinateZ']); - maxval_tb = C.getMaxValue(tbBB, ['CoordinateX', 'CoordinateY','CoordinateZ']); + minval_tb = C.getMinValue(tbBB, ['CoordinateX', 'CoordinateY','CoordinateZ']); + maxval_tb = C.getMaxValue(tbBB, ['CoordinateX', 'CoordinateY','CoordinateZ']); mean_tb = get_mean(maxval_tb,minval_tb) diff_percentz=diff_percent if dim==2: diff_percentz=0 list_additional_zones=[] for i in range(1,sweep_num+1): - if scaleDirection>=0: + if scaleDirection>=0: tbBB_scale = T.scale(tbBB, factor=(1.0+i*diff_percent,1.0+i*diff_percent,1.0+i*diff_percentz)) add2listAdditionalZones(list_additional_zones,tbBB_scale,tBB,mean_tb,zt_names) if scaleDirection<=0: - tbBB_scale = T.scale(tbBB, factor=(1.0-i*diff_percent,1.0-i*diff_percent,1.0-i*diff_percentz)) + tbBB_scale = T.scale(tbBB, factor=(1.0-i*diff_percent,1.0-i*diff_percent,1.0-i*diff_percentz)) add2listAdditionalZones(list_additional_zones,tbBB_scale,tBB,mean_tb,zt_names) @@ -2374,17 +2374,12 @@ def get_mean(max_local,min_local): def add2listAdditionalZones(list_additional_zones,tbBB_scale,tBB,mean_tb,zt_names): - minval_tbscale = C.getMinValue(tbBB_scale, ['CoordinateX', 'CoordinateY','CoordinateZ']); + minval_tbscale = C.getMinValue(tbBB_scale, ['CoordinateX', 'CoordinateY','CoordinateZ']); maxval_tbscale = C.getMaxValue(tbBB_scale, ['CoordinateX', 'CoordinateY','CoordinateZ']); - mean_tbscale = get_mean(maxval_tbscale,minval_tbscale) + mean_tbscale = get_mean(maxval_tbscale,minval_tbscale) T._translate(tbBB_scale, (mean_tb[0]-mean_tbscale[0],mean_tb[1]-mean_tbscale[1],mean_tb[2]-mean_tbscale[2])) interDict_scale = X.getIntersectingDomains(tBB, tbBB_scale) for i in interDict_scale: if interDict_scale[i] and i not in list_additional_zones and i not in zt_names: list_additional_zones.append(i) return None - - - - - diff --git a/Cassiopee/Apps/Apps/Fast/LBM.py b/Cassiopee/Apps/Apps/Fast/LBM.py index 4e7df1952..3856a057a 100644 --- a/Cassiopee/Apps/Apps/Fast/LBM.py +++ b/Cassiopee/Apps/Apps/Fast/LBM.py @@ -6,14 +6,14 @@ import Converter.Internal as Internal import Connector.PyTree as X from Apps.Fast.Common import Common -import numpy +import numpy try: range = xrange except: pass #================================================================================ # Multiblock prepare (avec split) # NP is the target number of processors -#================================================================================ +#================================================================================ def prepare(t_case, t_out, tc_out, translation=[0.,0.,0.], NP=0, format='single', NG=1): import Converter.Mpi as Cmpi rank = Cmpi.rank; size = Cmpi.size @@ -53,7 +53,7 @@ def prepare0(t_case, t_out, tc_out, translation=[0.,0.,0.], NP=0, format='single # Rajout des coins zonesDup=[]; zonesDupNames=[] for z in Internal.getZones(t[2][1]): - isperiod = Internal.getNodeFromName1(z, 'TempPeriodicZone') + isperiod = Internal.getNodeFromName1(z, 'TempPeriodicZone') if isperiod is not None: C._rmBCOfType(z,'BCMatch') zonesDup.append(z) @@ -63,7 +63,7 @@ def prepare0(t_case, t_out, tc_out, translation=[0.,0.,0.], NP=0, format='single isperiod = Internal.getNodeFromName1(z, 'TempPeriodicZone') if isperiod is None: for j in [-1,1]: - for i in [-1,1]: + for i in [-1,1]: zdup = T.translate(z,(i*TX,j*TY,0.)) C._rmBCOfType(zdup,"BCMatch") zdupname = C.getZoneName(Internal.getName(zdup)+'_dup') @@ -71,7 +71,7 @@ def prepare0(t_case, t_out, tc_out, translation=[0.,0.,0.], NP=0, format='single zonesDup.append(zdup) # zonesDup = X.connectMatch(zonesDup) - zdup=zonesDup[-1] + zdup=zonesDup[-1] gc = Internal.getNodeFromType(zdup,'GridConnectivity1to1_t') if gc is not None: zdonorname = Internal.getValue(gc) @@ -79,7 +79,7 @@ def prepare0(t_case, t_out, tc_out, translation=[0.,0.,0.], NP=0, format='single value=zdonorname,children=None) zcorners.append(zdup) del zonesDup[-1] - del zonesDup + del zonesDup t[2][1][2]+= zcorners del zcorners @@ -113,13 +113,13 @@ def prepare0(t_case, t_out, tc_out, translation=[0.,0.,0.], NP=0, format='single # if isPerio: C._removeDuplicatedPeriodicZones__(t) # - tc = X.setInterpData(t,tc,nature=1, loc='centers', storage='inverse', + tc = X.setInterpData(t,tc,nature=1, loc='centers', storage='inverse', sameName=1,itype='chimera') # on remet chez la zone initiale les donnees d interp if isPerio: for z in Internal.getZones(tc): - if z[0] not in zonesNamesORIG: + if z[0] not in zonesNamesORIG: parentz,noz = Internal.getParentOfNode(tc,z) zdnames = z[0].split('_') znameorig = zdnames[0] @@ -354,7 +354,7 @@ def __init__(self, format=None, numb=None, numz=None): self.authors = ["stephanie.peron@onera.fr"] self.cartesian = True - # Prepare + # Prepare def prepare(self, t_case, t_out=None, tc_out=None, NP=0, translation=[0.,0.,0.],NG=1): #if NP is None: NP = Cmpi.size #if NP == 0: print('Preparing for a sequential computation.') diff --git a/Cassiopee/Apps/Apps/Fast/MB.py b/Cassiopee/Apps/Apps/Fast/MB.py index adde4406a..814d8bde6 100644 --- a/Cassiopee/Apps/Apps/Fast/MB.py +++ b/Cassiopee/Apps/Apps/Fast/MB.py @@ -1,7 +1,7 @@ # Class for FastS "Multiblock" prepare and compute # IN: maillage volumique + BCs + raccords + reference State -# optionel: solution initiale +# optionel: solution initiale # Si 2D, maillage 1 seul plan (XY) import FastC.PyTree as FastC @@ -14,7 +14,7 @@ #================================================================================ # Multibloc prepare (avec split) # NP is the target number of processors -#================================================================================ +#================================================================================ def prepare(t_case, t_out, tc_out, NP=0, format='single', removeGC=True): import Converter.Mpi as Cmpi rank = Cmpi.rank; size = Cmpi.size @@ -29,7 +29,7 @@ def prepare(t_case, t_out, tc_out, NP=0, format='single', removeGC=True): def prepare0(t_case, t_out, tc_out, NP=0, format='single', removeGC=True): if isinstance(t_case, str): t = C.convertFile2PyTree(t_case) - else: t = t_case + else: t = t_case if NP > 0: import Distributor2.PyTree as D2 @@ -44,14 +44,14 @@ def prepare0(t_case, t_out, tc_out, NP=0, format='single', removeGC=True): t = T.splitSize(t, R=NP, type=2, minPtsPerDir=9) t = X.connectMatch(t, dim=dim) for p in perioInfo: - if p[0] != []: + if p[0] != []: [xc,yc,zc,vx,vy,vz,angle] = p[0] t = X.connectMatchPeriodic(t, rotationCenter=[xc,yc,zc], rotationAngle=[vx*angle,vy*angle,vz*angle], tol=1.e-6, dim=dim) if p[1] != []: [tx,ty,tz] = p[1] t = X.connectMatchPeriodic(t, translation=[tx,ty,tz], tol=1.e-6, dim=dim) stats = D2._distribute(t, NP, useCom='match') - else: + else: Internal._rmNodesByName(t, 'proc') # Solution initiale @@ -65,7 +65,7 @@ def prepare0(t_case, t_out, tc_out, NP=0, format='single', removeGC=True): if state is None: raise ValueError('Reference state is missing in input cgns.') vars = ['Density', 'MomentumX', 'MomentumY', 'MomentumZ', - 'EnergyStagnationDensity'] + 'EnergyStagnationDensity'] for v in vars: node = Internal.getNodeFromName(state, v) if node is not None: @@ -93,14 +93,14 @@ def prepare0(t_case, t_out, tc_out, NP=0, format='single', removeGC=True): # Ajout des ghost-cells C.addState2Node__(t, 'EquationDimension', dim) Internal._addGhostCells(t, t, 2, adaptBCs=1, fillCorner=0) - if dim == 2: + if dim == 2: T._addkplane(t) T._contract(t, (0,0,0), (1,0,0), (0,1,0), 0.01) T._makeDirect(t) # Raccords tc = C.node2Center(t) - tc = X.setInterpData(t, tc, nature=1, loc='centers', storage='inverse', + tc = X.setInterpData(t, tc, nature=1, loc='centers', storage='inverse', sameName=1, dim=dim) C._rmVars(tc, 'FlowSolution') if removeGC: C._rmVars(tc, 'GridCoordinates') @@ -151,11 +151,11 @@ def prepare1(t_case, t_out, tc_out, NP=0, format='single', removeGC=True): #interDict = X.getIntersectingDomains(tbb) #graph = Cmpi.computeGraph(tbb, type='bbox', intersectionsDict=interDict, reduction=False) #del tbb - graph = Cmpi.computeGraph(t, type='match', reduction=True) + graph = Cmpi.computeGraph(t, type='match', reduction=True) Cmpi._addXZones(t, graph, variables=[], noCoordinates=True) Cmpi._addXZones(tc, graph, variables=[], noCoordinates=True) - X._setInterpData(t, tc, nature=1, loc='centers', storage='inverse', + X._setInterpData(t, tc, nature=1, loc='centers', storage='inverse', sameName=1, dim=dim, itype='abutting') Cmpi._rmXZones(t) Cmpi._rmXZones(tc) @@ -228,7 +228,7 @@ def post0(t_in, t_out, wall_out, format='single'): # Use filter load here! if isinstance(t_in, str): a = FastC.loadFile(t_in) - else: a = t_in + else: a = t_in #============================= # Supprime les champs inutiles @@ -263,8 +263,8 @@ def post0(t_in, t_out, wall_out, format='single'): # Extraction Kp sur les surfaces #================================= [RoInf, RouInf, RovInf, RowInf, RoeInf, PInf, TInf, cvInf, MInf, - ReInf, Cs, Gamma, RokInf, RoomegaInf, RonutildeInf, - Mus, Cs, Ts, Pr] = C.getState(a) + ReInf, Cs, Gamma, RokInf, RoomegaInf, RonutildeInf, + Mus, Cs, Ts, Pr] = C.getState(a) gam1cv = (Gamma-1.)*cvInf RoUInf2I = 1./(RouInf*RouInf+RovInf*RovInf+RowInf*RowInf) C._initVars(a,'{Pressure}={Density}*{Temperature}*%f'%gam1cv) diff --git a/Cassiopee/Apps/Apps/Fast/WindTunnelOutPres.py b/Cassiopee/Apps/Apps/Fast/WindTunnelOutPres.py index 603566ee8..fda011080 100644 --- a/Cassiopee/Apps/Apps/Fast/WindTunnelOutPres.py +++ b/Cassiopee/Apps/Apps/Fast/WindTunnelOutPres.py @@ -54,11 +54,11 @@ def _scalarSigmaFunctionInv__(s, gamma=GAMMA, range='subsonic'): import scipy.optimize eps = numpy.finfo(float).eps if range == 'subsonic': - sol = scipy.optimize.root_scalar(lambda M: sigmaFunction__(M, gamma) - s, - x0=0.5, bracket=(2*eps, 1. - 2*eps), method='brentq') + sol = scipy.optimize.root_scalar(lambda M: sigmaFunction__(M, gamma) - s, + x0=0.5, bracket=(2*eps, 1. - 2*eps), method='brentq') elif range == 'supersonic': - sol = scipy.optimize.root_scalar(lambda M: sigmaFunction__(M, gamma) - s, - x0=1.5, bracket=(1. + 2*eps, 1e3), method='brentq') # it is unlikely that user require Mach number above 1000. + sol = scipy.optimize.root_scalar(lambda M: sigmaFunction__(M, gamma) - s, + x0=1.5, bracket=(1. + 2*eps, 1e3), method='brentq') # it is unlikely that user require Mach number above 1000. else: raise RuntimeError("Unexpected value for `range`: {:s}".format(str(range))) return sol.root @@ -77,9 +77,9 @@ def sigmaFunctionInv__(s, gamma=1.4, range='subsonic'): range : ['subsonic', 'supersonic'] Range over which the inverse is to be looked for """ - with numpy.nditer([s, None], - op_flags = [['readonly'], ['writeonly', 'allocate', 'no_broadcast']], - op_dtypes=['float64', 'float64']) as it: + with numpy.nditer([s, None], + op_flags=[['readonly'], ['writeonly', 'allocate', 'no_broadcast']], + op_dtypes=['float64', 'float64']) as it: for x, y in it: y[...] = _scalarSigmaFunctionInv__(s, gamma=gamma) return it.operands[1] @@ -144,7 +144,7 @@ def getInfo(tcase,familyName): sigmaFunctionDerivate__(m1), sigmaFunctionDerivate__(m2is), 0, - 0] + 0] return values4gain,controlProbeName,itExtrctPrb @@ -172,13 +172,13 @@ def getPointsFromTree(tree): def setupMachProbe(t,buffer_size,isRestart,DIRECTORY_PROBES): - Post._computeVariables(t, ['centers:Mach']) + Post._computeVariables(t, ['centers:Mach']) - dct_probe_point = {} + dct_probe_point = {} dct_points_for_probes = getPointsFromTree(C.convertFile2PyTree(os.path.join(DIRECTORY_PROBES, "probes.cgns"))) for name, point in dct_points_for_probes.items(): - probe = Probe.Probe(os.path.join(DIRECTORY_PROBES, "probe_{:s}.cgns".format(name)), t, X=point, fields=['centers:Mach'], bufferSize=buffer_size, append=isRestart) + probe = Probe.Probe(os.path.join(DIRECTORY_PROBES, "probe_{:s}.cgns".format(name)), t, X=point, fields=['centers:Mach'], bufferSize=buffer_size, append=isRestart) dct_probe_point[name] = probe C._rmVars(t, ['centers:Mach']) @@ -186,39 +186,38 @@ def setupMachProbe(t,buffer_size,isRestart,DIRECTORY_PROBES): def recordDataMach(t,dct_probe_point,it): - Post._computeVariables(t, ['centers:Mach']) + Post._computeVariables(t, ['centers:Mach']) for name, probe in dct_probe_point.items(): probe.extract(t, time=it) - C._rmVars(t, ['centers:Mach']) + C._rmVars(t, ['centers:Mach']) return dct_probe_point def _controlOutletPressureMachProbe(tc,dctProbes,controlProbeName,DIRECTORY_PROBES,itValues4gain,values4gain,itExtractProbe,it,familyName): for name, probe in dctProbes.items(): - probe.flush() + probe.flush() Cmpi.barrier() if Cmpi.rank == 0: print(" iteration {:06d}: adjusting back pressure...".format(it), end='') - probe_tmp = C.convertFile2PyTree(os.path.join(DIRECTORY_PROBES, "probe_{:s}.cgns".format(controlProbeName))) + probe_tmp = C.convertFile2PyTree(os.path.join(DIRECTORY_PROBES, "probe_{:s}.cgns".format(controlProbeName))) time = numpy.concatenate([node[1] for node in Internal.getNodesFromName(probe_tmp,'time')]) mach = numpy.concatenate([node[1] for node in Internal.getNodesFromName(probe_tmp,'Mach')]) select = (time >= 0.) # select values that have been recorded: array is prefilled with -1 time = time[select] mach = mach[select] - index_current = -1 - index_previous = -2 #-1 - (itValues4gain[1] // itExtractProbe) + index_current = -1 + index_previous = -2 #-1 - (itValues4gain[1] // itExtractProbe) current_it = time[index_current] current_mach = mach[index_current] - previous_it = time[index_previous] + previous_it = time[index_previous] previous_mach = mach[index_previous] #print(current_it, previous_it, current_mach, previous_mach,flush=True) oldPressure = values4gain[0] - values4gain[0] += values4gain[7] * (current_mach - values4gain[1]) + values4gain[8] * (current_mach - previous_mach) + values4gain[0] += values4gain[7] * (current_mach - values4gain[1]) + values4gain[8] * (current_mach - previous_mach) print("Control of Output Pressure:: target Ma = {:.5f}, current Ma = {:.5f}|| old Pout = {:.1f} Pa, new Pout = {:.1f} Pa, ".format(values4gain[1], current_mach, oldPressure, values4gain[0])) - Cmpi.bcast(values4gain[0], root=0) - D_IBM._initOutflow(tc, familyName, values4gain[0]) + Cmpi.bcast(values4gain[0], root=0) + D_IBM._initOutflow(tc, familyName, values4gain[0]) Cmpi.barrier() return None - diff --git a/Cassiopee/Apps/Apps/Fast/__init__.py b/Cassiopee/Apps/Apps/Fast/__init__.py index 8b1378917..e69de29bb 100644 --- a/Cassiopee/Apps/Apps/Fast/__init__.py +++ b/Cassiopee/Apps/Apps/Fast/__init__.py @@ -1 +0,0 @@ - diff --git a/Cassiopee/Apps/Apps/Mesh/Cart.py b/Cassiopee/Apps/Apps/Mesh/Cart.py index 44c6516ec..42a7de2d5 100755 --- a/Cassiopee/Apps/Apps/Mesh/Cart.py +++ b/Cassiopee/Apps/Apps/Mesh/Cart.py @@ -7,11 +7,11 @@ import Connector.ToolboxIBM as TIBM import Connector.PyTree as X import Transform.PyTree as T -import numpy +import numpy # Generates in parallel a Cartesian mesh # if ext=0, match and nearmatch joins are not computed -def generateCartMesh(t_case, snears=0.01, dfar=10., dfarList=[], vmin=21, check=False, tbox=None, snearsf=None, +def generateCartMesh(t_case, snears=0.01, dfar=10., dfarList=[], vmin=21, check=False, tbox=None, snearsf=None, ext=2, dimPb=3, sizeMax=1000000, expand=0): if isinstance(t_case, str): tb = C.convertFile2PyTree(t_case) @@ -21,10 +21,10 @@ def generateCartMesh(t_case, snears=0.01, dfar=10., dfarList=[], vmin=21, check= if dfarList == []: zones = Internal.getZones(tb) dfarList = [dfar*1.]*len(zones) - for c, z in enumerate(zones): + for c, z in enumerate(zones): n = Internal.getNodeFromName2(z, 'dfar') if n is not None: dfarList[c] = Internal.getValue(n)*1. - # a mettre dans la classe ou en parametre de prepare1 ??? + # a mettre dans la classe ou en parametre de prepare1 ??? to = None fileout = None if check: fileout = 'octree.cgns' @@ -43,7 +43,7 @@ def generateCartMesh(t_case, snears=0.01, dfar=10., dfarList=[], vmin=21, check= # build parent octree 3 levels higher # returns a list of 4 octants of the parent octree in 2D and 8 in 3D - parento = TIBM.buildParentOctrees__(o, tb, snears=snears, snearFactor=4., dfars=dfarList, to=to, tbox=tbox, + parento = TIBM.buildParentOctrees__(o, tb, snears=snears, snearFactor=4., dfars=dfarList, to=to, tbox=tbox, snearsf=snearsf, dimPb=dimPb, vmin=vmin) test.printMem(">>> Octree unstruct [end]") @@ -59,7 +59,7 @@ def generateCartMesh(t_case, snears=0.01, dfar=10., dfarList=[], vmin=21, check= # fill vmin + merge in parallel test.printMem(">>> Octree struct [start]") res = TIBM.octree2StructLoc__(p, vmin=vmin, ext=-1, optimized=0, parento=parento, sizeMax=sizeMax) - del p + del p if parento is not None: for po in parento: del po t = C.newPyTree(['CARTESIAN', res]) @@ -122,7 +122,7 @@ def addRefinementZones(o, tbox, snearsf=None, vmin=15, dim=3): # volume minimum au dela duquel on ne peut pas raffiner volmin0 = 1.*volmin0 while end == 0: - # Do not refine inside obstacles + # Do not refine inside obstacles nob = 0 C._initVars(to, 'centers:indicator', 0.) for box in boxes: @@ -137,7 +137,7 @@ def addRefinementZones(o, tbox, snearsf=None, vmin=15, dim=3): C._initVars(to,'{centers:indicator}={centers:indicator}*({centers:vol}>%g)'%volmin0) print("max value", C.getMaxValue(to, 'centers:indicator')) C.convertPyTree2File(to,'to.cgns') - if C.getMaxValue(to, 'centers:indicator') == 1.: + if C.getMaxValue(to, 'centers:indicator') == 1.: end = 0 # Maintien du niveau de raffinement le plus fin o = Internal.getZones(to)[0] @@ -176,7 +176,7 @@ def _setSnear(z, value): Internal._createUniqueChild(n, 'snear', 'DataArray_t', value) return None -# Set dfar in zones +# Set dfar in zones def setDfar(t, value): tp = Internal.copyRef(t) _setDfar(t, value) diff --git a/Cassiopee/Apps/Apps/Mesh/Dragon.py b/Cassiopee/Apps/Apps/Mesh/Dragon.py index f1d044774..44f025df3 100644 --- a/Cassiopee/Apps/Apps/Mesh/Dragon.py +++ b/Cassiopee/Apps/Apps/Mesh/Dragon.py @@ -50,10 +50,10 @@ def remeshLevelSet(z, X=0, dir=1): T._homothety(z, (0.,0.,0.), 1.e3) T._homothety(z2, (0.,0.,0.), 1.e3) hmin = 1e3*hmin; hmax = 1e3*hmax - z2 = G.mmgs(z2, ridgeAngle=60, hmin=hmin, hmax=hmax, hausd=0.01, grow=1.1, + z2 = G.mmgs(z2, ridgeAngle=60, hmin=hmin, hmax=hmax, hausd=0.01, grow=1.1, anisotropy=1, optim=0, fixedConstraints=[], sizeConstraints=[]) edges = P.exteriorFaces(z2); del z2 - z = G.mmgs(z, ridgeAngle=60, hmin=hmin, hmax=hmax, hausd=0.01, grow=1.1, + z = G.mmgs(z, ridgeAngle=60, hmin=hmin, hmax=hmax, hausd=0.01, grow=1.1, anisotropy=1, optim=0, fixedConstraints=[], sizeConstraints=[edges3]) if SCALED: T._homothety(z, (0.,0.,0.), 1.e-3) @@ -120,7 +120,7 @@ def createDragonMesh0(body, dictOfParams={}, check=False, directory_tmp_files='. T._reorderAll(body, dir=1) - # on travaille sur des geometries triangulees + # on travaille sur des geometries triangulees body = C.deleteFlowSolutions__(body) body = C.convertArray2Tetra(body) body = T.join(body); body = G.close(body) @@ -156,15 +156,15 @@ def createDragonMesh0(body, dictOfParams={}, check=False, directory_tmp_files='. if nblayerforced != 0: nlayer = nblayerforced else: nlayer = int(math.log(snear/(height_factor*hWall))/math.log(raison)); print('Number of prismatic layers = ',nlayer) - dlayer = hWall*(1.-raison**nlayer)/(1.-raison) + dlayer = hWall*(1.-raison**nlayer)/(1.-raison) print('Thickness of prismatic layer: ',dlayer) distrib = G.cart((0.,0.,0.), (dlayer/nlayer,1,1), (nlayer,1,1)) for i in range(0,nlayer): C.setValue(distrib, 'CoordinateX', i, hWall*(1.-raison**i)/(1.-raison)) - hLast = C.getValue(distrib, 'CoordinateX', nlayer-1)-C.getValue(distrib, 'CoordinateX', nlayer-2) ; + hLast = C.getValue(distrib, 'CoordinateX', nlayer-1)-C.getValue(distrib, 'CoordinateX', nlayer-2) ; print('hauteur de la derniere couche de prisme = ',hLast) #C.convertPyTree2File(body,"surface.cgns") lay1 = G.addNormalLayers(body, distrib, check=1, niter=smoothIter) - lay.append(lay1); # layy = lay[0] ? + lay.append(lay1); # layy = lay[0] ? if check: C.convertPyTree2File(lay, directory_tmp_files+'layer.cgns') ext = P.exteriorFaces(lay[0]) if sym is None: @@ -201,7 +201,7 @@ def createDragonMesh0(body, dictOfParams={}, check=False, directory_tmp_files='. maxsize = C.getMaxValue(o,'centers:vol')**0.5;print(maxsize) nblevels = int(math.log(maxsize/minsize)/math.log(2)) maxnpts = int(round(locmax/minsize)) - maxnpts = 64 # SP to TR : en dur ? + maxnpts = 64 # SP to TR : en dur ? tsym = C.newPyTree(['Base']) for i in range(nblevels+1): @@ -237,7 +237,7 @@ def createDragonMesh0(body, dictOfParams={}, check=False, directory_tmp_files='. s2 = [T.splitConnexity(s2)[0]] sexts = P.exteriorFaces(s2) sexts = T.splitConnexity(sexts) - for sext in sexts: + for sext in sexts: sext = G.tetraMesher(sext, grading=0.2, maxh=0.5*snear, algo=1) s2.append(sext) @@ -407,7 +407,7 @@ def createDragonMesh0(body, dictOfParams={}, check=False, directory_tmp_files='. if NParts > 0: print('Decoupage en ',NParts,' blocs') - tp = T.splitNParts(tp,NParts) + tp = T.splitNParts(tp,NParts) return tp @@ -432,12 +432,12 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director surf_shroud = Internal.getNodeFromName(ts,"SHROUD") if surf_shroud is None or surf_shroud==[]: - raise("ValueError: no base/zone of name SHROUD found.") + raise("ValueError: no base/zone of name SHROUD found.") return None surf_blade = Internal.getNodeFromName(ts,'BLADE') if surf_blade is None or surf_blade==[]: - raise("ValueError: no base/zone of name BLADE found.") + raise("ValueError: no base/zone of name BLADE found.") return None if 'remesh_input' in dictOfParams: @@ -456,7 +456,7 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director if "q" in dictOfParams: raison = dictOfParams["q"] else: raison = 1.2 - if 'nlayers' in dictOfParams: nlayer = dictOfParams['nlayers'] + if 'nlayers' in dictOfParams: nlayer = dictOfParams['nlayers'] else: nlayer = 10 # auto print('Warning: createDragonMesh: nlayer not defined. Set to %d.'%nlayer) @@ -467,7 +467,7 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director else: typePerio = 1 else: print(" periodicity key not found in dictOfParams. Set to default (rotation).") - typePerio = 0 + typePerio = 0 centre = (0.,0.,0.); axis = (0.,0.,1.); THETA = 0 translx = 0; transly = 0; translz = 0 @@ -476,7 +476,7 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director if 'nb_blades' in dictOfParams: nb_aubes_fan = dictOfParams["nb_blades"] else: raise ValueError("createDragonMesh: nb_blades required for periodicity by rotation.") - return None + return None if 'rotation_axis' in dictOfParams: axis = dictOfParams['rotation_axis'] else: @@ -484,7 +484,7 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director if 'rotation_center' in dictOfParams: centre = dictOfParams['rotation_center'] else: - print('Warning: createDragonMesh: rotation center not defined. Set to default :', centre) + print('Warning: createDragonMesh: rotation center not defined. Set to default :', centre) THETA = 360./dictOfParams["nb_blades"] else: @@ -496,14 +496,14 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director hext = hWall*raison**(nlayer) # cell height at outer prism layer # projection of the blade root and tip onto the hub and shroud surf_aube = Internal.getZones(surf_blade)[0] - surf_shroud = Internal.getZones(surf_shroud)[0] - surf_hub = Internal.getZones(surf_hub)[0] - lines_ext_aube = P.exteriorFaces(surf_aube) + surf_shroud = Internal.getZones(surf_shroud)[0] + surf_hub = Internal.getZones(surf_hub)[0] + lines_ext_aube = P.exteriorFaces(surf_aube) lines_ext_aube = T.splitConnexity(lines_ext_aube) # which one is the root/tip ? DTW._distance2Walls(lines_ext_aube, surf_hub,loc='nodes') - distl0 = C.getMaxValue(lines_ext_aube[0],'TurbulentDistance') - distl1 = C.getMaxValue(lines_ext_aube[1],'TurbulentDistance') + distl0 = C.getMaxValue(lines_ext_aube[0],'TurbulentDistance') + distl1 = C.getMaxValue(lines_ext_aube[1],'TurbulentDistance') if distl0 < distl1: lines_ext_aube[0][0]='line_BLADE_HUB' lines_ext_aube[1][0]='line_BLADE_SHROUD' @@ -511,11 +511,11 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director lines_ext_aube[0][0]='line_BLADE_SHROUD' lines_ext_aube[1][0]='line_BLADE_HUB' - line_aube_hub = Internal.getNodeFromName(lines_ext_aube,'line_BLADE_HUB') - line_aube_shroud = Internal.getNodeFromName(lines_ext_aube,'line_BLADE_SHROUD') + line_aube_hub = Internal.getNodeFromName(lines_ext_aube,'line_BLADE_HUB') + line_aube_shroud = Internal.getNodeFromName(lines_ext_aube,'line_BLADE_SHROUD') hook = C.createHook(surf_aube, function='nodes') - nodesMatch=C.identifyNodes(hook, line_aube_hub) + nodesMatch=C.identifyNodes(hook, line_aube_hub) T._projectOrtho(line_aube_hub, surf_hub) for noind in range(len(nodesMatch)): @@ -524,9 +524,9 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director xp = C.getValue(line_aube_hub, 'GridCoordinates', noind) C.setValue(surf_aube, 'CoordinateX', inds-1, xp[0]) C.setValue(surf_aube, 'CoordinateY', inds-1, xp[1]) - C.setValue(surf_aube, 'CoordinateZ', inds-1, xp[2]) + C.setValue(surf_aube, 'CoordinateZ', inds-1, xp[2]) - nodesMatch=C.identifyNodes(hook, line_aube_shroud) + nodesMatch=C.identifyNodes(hook, line_aube_shroud) T._projectOrtho(line_aube_shroud, surf_shroud) for noind in range(len(nodesMatch)): @@ -535,11 +535,11 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director xp = C.getValue(line_aube_shroud, 'GridCoordinates', noind) C.setValue(surf_aube, 'CoordinateX', inds-1, xp[0]) C.setValue(surf_aube, 'CoordinateY', inds-1, xp[1]) - C.setValue(surf_aube, 'CoordinateZ', inds-1, xp[2]) + C.setValue(surf_aube, 'CoordinateZ', inds-1, xp[2]) - C.freeHook(hook) + C.freeHook(hook) - # Creation of channel borders - HUB + # Creation of channel borders - HUB lines_hub = extractExternalLines__(surf_hub, surf_aube, BA2BF) lines_perios_hub = lines_hub[:2] line_in_h = lines_hub[2]; line_out_h = lines_hub[3] @@ -558,16 +558,16 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director line_periom_h = lines_perios_hub[1] line_periop_h = lines_perios_hub[0] - # Creation of channel borders - SHROUD + # Creation of channel borders - SHROUD lines_shroud= extractExternalLines__(surf_shroud, surf_aube, BA2BF) lines_perios_shroud = lines_shroud[:2] - line_in_s = lines_shroud[2]; line_out_s = lines_shroud[3] + line_in_s = lines_shroud[2]; line_out_s = lines_shroud[3] line_periom_s = lines_perios_shroud[0] line_periop_s = lines_perios_shroud[1] if typePerio==1: periomdup = T.translate(line_periom_s,(translx, transly, translz)) else: - periomdup = T.rotate(line_periom_s, centre, axis, THETA) + periomdup = T.rotate(line_periom_s, centre, axis, THETA) periomdup = C.diffArrays(line_periop_s,periomdup) C._initVars(periomdup,'{dist}=sqrt({DCoordinateX}**2+{DCoordinateY}**2+{DCoordinateZ}**2)') @@ -584,7 +584,7 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director ptA = getMatchingPoint__(line_out_h, line_periom_h) ptB = getMatchingPoint__(line_out_s, line_periom_s) linem_out = D.line(ptA, ptB, N=NPTS_L) - surf_periom = G.TFI([line_periom_h,line_periom_s, linem_in, linem_out]); + surf_periom = G.TFI([line_periom_h,line_periom_s, linem_in, linem_out]); surf_periom[0]='PERIOM' if typePerio==0: @@ -602,11 +602,11 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director surf_inlet = G.TFI([linem_in,linep_in,line_in_h,line_in_s]) surf_inlet[0]='INLET' surf_outlet = G.TFI([linem_out,linep_out,line_out_h,line_out_s]) - surf_outlet[0]='OUTLET' + surf_outlet[0]='OUTLET' lines_ext_aube = P.exteriorFaces(surf_aube) lines_ext_aube = T.splitConnexity(lines_ext_aube) - #which one is hub and shroud ? + #which one is hub and shroud ? DTW._distance2Walls(lines_ext_aube,surf_hub, loc='nodes') d0 = C.getMaxValue(lines_ext_aube[0], 'TurbulentDistance') d1 = C.getMaxValue(lines_ext_aube[1], 'TurbulentDistance') @@ -616,15 +616,15 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director line_aube_shroud = lines_ext_aube[1] else: line_aube_hub = lines_ext_aube[1] - line_aube_shroud = lines_ext_aube[0] + line_aube_shroud = lines_ext_aube[0] - mesh_hub = generateTriMeshBetweenContours__(line_aube_hub, surf_hub, - hmin = hWall, + mesh_hub = generateTriMeshBetweenContours__(line_aube_hub, surf_hub, + hmin=hWall, remeshBorders=remeshBorders) mesh_shroud = generateTriMeshBetweenContours__(line_aube_shroud, surf_shroud, - hmin = hWall, - remeshBorders=remeshBorders) + hmin=hWall, + remeshBorders=remeshBorders) surfs = T.join([mesh_hub,mesh_shroud, surf_aube]) surfs = T.reorder(surfs,(-1,)) @@ -634,7 +634,7 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director ts[2][2][2] = Internal.getZones(mesh_hub) ts[2][3][2] = Internal.getZones(surf_aube) ts[2][4][2] = Internal.getZones(surf_inlet) - ts[2][5][2] = Internal.getZones(surf_outlet) + ts[2][5][2] = Internal.getZones(surf_outlet) ts[2][6][2] = [surf_periop, surf_periom] # input: surfaces bases ['WALL','AMONT','AVAL','PERIODIC'] print('Generating boundary layers...') @@ -645,10 +645,10 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director surfs_wall=Internal.getZones(surfs) prismatic = True volmin = -1e10 - if prismatic : - lay = G.addNormalLayers(surfs_wall, d, check=0, niterType=0, niter=smoothIter, niterK=[], - smoothType=0, eps=0.4, nitLocal=3, - kappaType=0, kappaS=[0.2,1.6], blanking=False, algo=0) + if prismatic : + lay = G.addNormalLayers(surfs_wall, d, check=0, niterType=0, niter=smoothIter, niterK=[], + smoothType=0, eps=0.4, nitLocal=3, + kappaType=0, kappaS=[0.2,1.6], blanking=False, algo=0) lay = C.convertArray2NGon(lay, recoverBC=0) G._getVolumeMap(lay) @@ -671,7 +671,7 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director if npts == 0: raise ValueError("createDragonMesh: tetraMesher failed. Please check input data.") return None - mesh_final = C.convertArray2NGon(mesh_final) + mesh_final = C.convertArray2NGon(mesh_final) else: # Reprojection des frontieres QUAD sur les frontieres du domaine Internal._rmNodesByName(lay,'FlowSol*') @@ -683,7 +683,7 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director zdim = Internal.getZoneDim(bc) if zdim[3]=='QUAD': ext_QUAD.append(bc) - ext_QUAD = T.join(ext_QUAD) + ext_QUAD = T.join(ext_QUAD) hook = C.createHook(lay, function='nodes') surf_inlet[0] = 'INLET'; surf_outlet[0]='OUTLET' surf_periom[0]='PERIOM'; surf_periop[0]= 'PERIOP' @@ -698,7 +698,7 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director nodes = C.identifyNodes(hook, extq) allnodes.append(nodes) - # force periodicity + # force periodicity DTW._distance2Walls(ext_QUAD0,surf_periom,loc='nodes') C._initVars(ext_QUAD0,"{distM}={TurbulentDistance}") DTW._distance2Walls(ext_QUAD0,surf_periop, loc='nodes') @@ -706,15 +706,15 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director noperm = -1; noperp = -1 distm = 1e10; distp = 1e10 for nol, zl in enumerate(ext_QUAD0): - dl = C.getMaxValue(zl,'distM') + dl = C.getMaxValue(zl,'distM') if dl < distm: distm = dl; noperm = nol - dl = C.getMaxValue(zl,'distP') + dl = C.getMaxValue(zl,'distP') if dl < distp: distp = dl; noperp = nol ext_QUADPERP = None - projsurf = T.projectOrtho(ext_QUAD0[noperm], extBorders) + projsurf = T.projectOrtho(ext_QUAD0[noperm], extBorders) if typePerio==1: ext_QUADPERP=T.translate(projsurf,(translx, transly, translz)) else: @@ -736,9 +736,9 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director coordproj = C.getValue(projsurf, 'GridCoordinates', indproj) C.setValue(lay, 'CoordinateX', ind-1, coordproj[0]) C.setValue(lay, 'CoordinateY', ind-1, coordproj[1]) - C.setValue(lay, 'CoordinateZ', ind-1, coordproj[2]) + C.setValue(lay, 'CoordinateZ', ind-1, coordproj[2]) - C.freeHook(hook) + C.freeHook(hook) #--------------------------------------- # on cherche la frontiere ext TRI sur le maillage reprojete bcc = P.exteriorFaces(lay) @@ -747,7 +747,7 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director ext_TRI = [] for bc in bcc: zdim = Internal.getZoneDim(bc) - if zdim[3]=='TRI': ext_TRI.append(bc) + if zdim[3]=='TRI': ext_TRI.append(bc) DTW._distance2Walls(ext_TRI, surfs_wall, loc='nodes') ext_TRI0 = T.splitConnexity(ext_TRI) @@ -757,12 +757,12 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director ext_TRI = T.join(ext_TRI) T._reorder(ext_TRI,(1,)) Internal._rmNodesFromType(ext_TRI,'FlowSolution_t') - tetMesh = createInternalTetraMesh__(ext_TRI, ts, hext) - tetMesh = C.convertArray2NGon(tetMesh) + tetMesh = createInternalTetraMesh__(ext_TRI, ts, hext) + tetMesh = C.convertArray2NGon(tetMesh) mesh_final = T.join(tetMesh,lay) G._close(mesh_final, toldist) - G._getVolumeMap(mesh_final) + G._getVolumeMap(mesh_final) volmin = C.getMinValue(mesh_final,'centers:vol') print("final min volume =",volmin) Internal._rmNodesByName(mesh_final,'FlowSol*') @@ -783,7 +783,7 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director d1 = C.getMaxValue(ze,'TurbulentDistance') if d1 < distmin: distmin = d1; efound = noe - if efound >-1: + if efound >-1: C._addBC2Zone(mesh_final,bcname,'FamilySpecified:%s'%bcname,subzone=extFaces[efound]) print('add families') @@ -796,7 +796,7 @@ def createDragonMeshForBladeInChannel(ts, dictOfParams={}, check=False, director C._addFamily2Base(base, 'BLADE', bndType='BCWall') return tp -def createInternalTetraMesh__(ext_TRI, ts, hext): +def createInternalTetraMesh__(ext_TRI, ts, hext): # ts : ['HUB','SHROUD','BLADE','AMONT','AVAL','PERIODIC'] mesh_cart = Internal.getNodesFromName(ts,'SHROUD') mesh_spin = Internal.getNodesFromName(ts,'HUB') @@ -806,7 +806,7 @@ def createInternalTetraMesh__(ext_TRI, ts, hext): ext = P.exteriorFaces(ext_TRI) # ATTENTION REORDER COHERENT CAR NORMALES VERS L INTERIEUR - # on remet les ext tous dans le meme sens + # on remet les ext tous dans le meme sens ext = T.join(ext) ext = T.splitConnexity(ext) ext = C.convertBAR2Struct(ext) @@ -827,10 +827,10 @@ def createInternalTetraMesh__(ext_TRI, ts, hext): lines_aval.append(e1[1]) else: lines_amont.append(e1[1]) - lines_aval.append(e1[0]) + lines_aval.append(e1[0]) e1 = P.selectCells(e,'{TurbulentDistance}<%g'%toldistrel,strict=1) - e1 = T.splitConnexity(e1) # on doit en avoir 2 - perios+=e1 + e1 = T.splitConnexity(e1) # on doit en avoir 2 + perios+=e1 lines_amont = C.convertBAR2Struct(lines_amont) lines_aval = C.convertBAR2Struct(lines_aval) @@ -891,7 +891,7 @@ def createInternalTetraMesh__(ext_TRI, ts, hext): pt2 = C.getValue(lines_aval[1],'GridCoordinates',npts-1) pt4 = C.getValue(lines_aval[1],'GridCoordinates',0) - line3 = D.line(pt1, pt2,N=npts); line4 = D.line(pt3, pt4,N=npts) + line3 = D.line(pt1, pt2,N=npts); line4 = D.line(pt3, pt4,N=npts) Internal._rmNodesFromType(lines_aval,'FlowSolution_t') lines = T.join([line3,line4]+lines_aval) lines = T.splitSharpEdges(lines) @@ -905,16 +905,16 @@ def createInternalTetraMesh__(ext_TRI, ts, hext): for e in perios: alp0 = 80. nsplit = 0 - while nsplit < 4: + while nsplit < 4: zsplit = T.splitSharpEdges(e, alp0) alp0 = alp0-10. nsplit = len(zsplit) - if nsplit == 4: + if nsplit == 4: zsplit = C.convertBAR2Struct(zsplit) sides.append(zsplit) TFIPERM = G.TFI(sides[0]) - TFIPERP = G.TFI(sides[1]) + TFIPERP = G.TFI(sides[1]) # remap ZONES = [AMONT,AVAL,TFIPERM,TFIPERP] @@ -923,9 +923,9 @@ def createInternalTetraMesh__(ext_TRI, ts, hext): ZONES = C.convertArray2Tetra(ZONES) surfs = Internal.getZones(ZONES)+Internal.getZones(ext_TRI) surfs = T.join(surfs) - surfs = T.reorder(surfs,(1,)) - tetMesh = G.tetraMesher(surfs) - return tetMesh + surfs = T.reorder(surfs,(1,)) + tetMesh = G.tetraMesher(surfs) + return tetMesh def remapSurf__(z, hmin=1e-6, dir=1): diri = dir @@ -945,7 +945,7 @@ def remapSurf__(z, hmin=1e-6, dir=1): Npts_orig = Internal.getZoneDim(distrib)[1] Nr = int(0.1*Npts_orig) distrib = G.enforcePlusX(distrib, hmin/l, Nr, Nr) - Npts_fin = Internal.getZoneDim(distrib)[1] + Npts_fin = Internal.getZoneDim(distrib)[1] Nr2 = int(0.1*Npts_fin) distrib = G.enforceMoinsX(distrib, hmin/l, Nr2, Nr2) z = G.map(z, distrib, diri) @@ -959,18 +959,18 @@ def extractExternalLines__(surf, surf_aube, BA2BF=1): DTW._distance2Walls(lines_ext, surf_aube, loc='nodes') lines_ext = T.splitConnexity(lines_ext) lines_ext = C.convertBAR2Struct(lines_ext) - distl0 = C.getMaxValue(lines_ext[0],'TurbulentDistance') - distl1 = C.getMaxValue(lines_ext[1],'TurbulentDistance') + distl0 = C.getMaxValue(lines_ext[0],'TurbulentDistance') + distl1 = C.getMaxValue(lines_ext[1],'TurbulentDistance') Internal._rmNodesFromType(lines_ext,'FlowSolution_t') if distl0 < distl1: line_ext = lines_ext[1] else: line_ext = lines_ext[0] lines_ext = []; nsplit = 0; alp0 = 80. - while nsplit < 4: + while nsplit < 4: zsplit = T.splitSharpEdges(line_ext, alp0) alp0 = alp0-5. - nsplit = len(zsplit) + nsplit = len(zsplit) if nsplit >= 4: lines_ext = zsplit break @@ -985,7 +985,7 @@ def extractExternalLines__(surf, surf_aube, BA2BF=1): elif BA2BF == 2: imin = 1; imax = 4 # amont/aval selon axe Y+ elif BA2BF ==-2: - imin = 4; imax = 1 # amont/aval selon axe Y- + imin = 4; imax = 1 # amont/aval selon axe Y- elif BA2BF == 3: imin = 2; imax = 5 # amont/aval selon axe Z+ elif BA2BF ==-3: @@ -995,16 +995,16 @@ def extractExternalLines__(surf, surf_aube, BA2BF=1): l0 = lines_ext[nol0] bbl = G.bbox(l0) dl = abs(bbl[imax]-bbl[imin]) - if abs(bbl[imin]-bb_all[imin])<1e-10: + if abs(bbl[imin]-bb_all[imin])<1e-10: if dl < dmin: if BA2BF>0: no_inflow=nol0 else: no_outflow=nol0 dmin = dl - elif abs(bbl[imax]-bb_all[imax])<1e-10: + elif abs(bbl[imax]-bb_all[imax])<1e-10: if dl < dmax: if BA2BF<0: no_inflow=nol0 else: no_outflow=nol0 - dmax = dl + dmax = dl lines_perios = [] for noz in range(len(lines_ext)): if noz != no_inflow and noz != no_outflow: @@ -1023,10 +1023,10 @@ def orderExteriorEdges__(surf, lineb): lines_ext = P.exteriorFaces(surf) lines_ext = C.convertArray2Hexa(lines_ext) lines_ext = T.splitConnexity(lines_ext) - DTW._distance2Walls(lines_ext, lineb,type='ortho',loc='nodes') + DTW._distance2Walls(lines_ext, lineb,type='ortho',loc='nodes') dmax = -1e10 line_ext = None; line_in = None - if len(lines_ext) != 2: + if len(lines_ext) != 2: raise ValueError("DRAGON: more than two curves defined to generate the TRI mesh.Case not taken into account.") nol_ext = -1 @@ -1034,11 +1034,11 @@ def orderExteriorEdges__(surf, lineb): d0 = C.getMaxValue(lines_ext[l0],'TurbulentDistance') if d0 > dmax: dmax = d0; line_ext = lines_ext[l0]; nol_ext=l0 - if nol_ext==0: + if nol_ext==0: line_in = lines_ext[1] - else: + else: line_in = lines_ext[0] - return [line_in,line_ext] + return [line_in,line_ext] def generateTriMeshBetweenContours__(lineb, surfp, hmin=1e-6,remeshBorders=False): extFaces0 = P.exteriorFaces(surfp) @@ -1060,7 +1060,7 @@ def generateTriMeshBetweenContours__(lineb, surfp, hmin=1e-6,remeshBorders=False distrib = G.cart((0,0,0),(h0,1,1),(N0,1,1)) distrib = G.enforcePlusX(distrib,hmin,N0//2,N0*3//2) tri_in = G.surfaceWalk(surfp, lineb, distrib, constraints=[], niter=50, - alphaRef=180., check=0, toldist=1.e-6) + alphaRef=180., check=0, toldist=1.e-6) tri_in = C.convertArray2Tetra(tri_in); tri_in = G.close(tri_in) [line_in,line_ext0] = orderExteriorEdges__(tri_in, lineb) @@ -1070,7 +1070,7 @@ def generateTriMeshBetweenContours__(lineb, surfp, hmin=1e-6,remeshBorders=False contour = T.join([line_ext0,line_ext]) tri_ext = G.tetraMesher(contour) - # check qu on a bien triangule la zone entre les deux ?? + # check qu on a bien triangule la zone entre les deux ?? # par distance des frontieres exterieures aux lignes en entree ext = P.exteriorFaces(tri_ext) DTW._distance2Walls(line_ext, tri_ext, loc='nodes', type='ortho') @@ -1085,7 +1085,7 @@ def generateTriMeshBetweenContours__(lineb, surfp, hmin=1e-6,remeshBorders=False # projection sur la surface de depart... #...sans bouger les frontieres... _projectOrthoWithConstraints__(tri_ext, surfp, contour) - # + # if remeshBorders: extFaces0 = P.exteriorFaces(tri_ext) extFaces = T.splitConnexity(extFaces0) @@ -1098,37 +1098,37 @@ def generateTriMeshBetweenContours__(lineb, surfp, hmin=1e-6,remeshBorders=False npts = C.getNPts(ef) density = lmax/npts - tri_ext = G.mmgs(tri_ext,ridgeAngle=45., - hmin=0., hmax=density, hausd=0.01, - optim=0, fixedConstraints=extFaces0, - sizeConstraints=extFaces0) - tri = T.join(tri_in,tri_ext) + tri_ext = G.mmgs(tri_ext,ridgeAngle=45., + hmin=0., hmax=density, hausd=0.01, + optim=0, fixedConstraints=extFaces0, + sizeConstraints=extFaces0) + tri = T.join(tri_in,tri_ext) return tri # after project Ortho : recover borders of surface mesh def _projectOrthoWithConstraints__(trimesh, surfp, lines_ext): hook = C.createHook(trimesh, function='nodes') - nodes = C.identifyNodes(hook, lines_ext) + nodes = C.identifyNodes(hook, lines_ext) T._projectOrtho(trimesh, surfp) for indbc in range(len(nodes)): indv = nodes[indbc]-1 coord = C.getValue(lines_ext, 'GridCoordinates', indbc) C.setValue(trimesh, 'CoordinateX', indv, coord[0]) C.setValue(trimesh, 'CoordinateY', indv, coord[1]) - C.setValue(trimesh, 'CoordinateZ', indv, coord[2]) - C.freeHook(hook) + C.setValue(trimesh, 'CoordinateZ', indv, coord[2]) + C.freeHook(hook) return None def getMatchingPoint__(line_in_h, line_periom_h): npts = C.getNPts(line_periom_h) nptsi = C.getNPts(line_in_h) - # INFLOW HUB + # INFLOW HUB pt11 = C.getValue(line_in_h,'GridCoordinates',0) pt12 = C.getValue(line_in_h,'GridCoordinates',nptsi-1) pt21 = C.getValue(line_periom_h,'GridCoordinates',0) - pt22 = C.getValue(line_periom_h,'GridCoordinates',npts-1) + pt22 = C.getValue(line_periom_h,'GridCoordinates',npts-1) dist11_21 = math.sqrt((pt11[0]-pt21[0])**2+(pt11[1]-pt21[1])**2+(pt11[2]-pt21[2])**2) dist11_22 = math.sqrt((pt11[0]-pt22[0])**2+(pt11[1]-pt22[1])**2+(pt11[2]-pt22[2])**2) @@ -1138,10 +1138,10 @@ def getMatchingPoint__(line_in_h, line_periom_h): dist21_21 = math.sqrt((pt21[0]-pt21[0])**2+(pt21[1]-pt21[1])**2+(pt21[2]-pt21[2])**2) dist21_22 = math.sqrt((pt21[0]-pt22[0])**2+(pt21[1]-pt22[1])**2+(pt21[2]-pt22[2])**2) if dist21_21 NEW GEOMETRY FOR BACKGROUND ovs = C.extractBCOfType(t_ibm,'BCExtrapolate') -G._getVolumeMap(ovs) +G._getVolumeMap(ovs) DZ = C.getMaxValue(ovs,'CoordinateZ')-C.getMinValue(ovs,'CoordinateZ') C._initVars(ovs,'{centers:vol}={centers:vol}*%g'%(1./DZ)) ovs = T.subzone(ovs,(1,1,1),(-1,1,1)) @@ -124,7 +124,7 @@ R._setPrescribedMotion3(tc_ibm,'rot', axis_pnt=(0.,0.,0.), axis_vct=(0,0,1),omega=-OMG) -## BLANKING OF BACKGROUND MESH -- USING AN OFFSET OF IMMERSED GEOMETRY +## BLANKING OF BACKGROUND MESH -- USING AN OFFSET OF IMMERSED GEOMETRY blankingBody= D.offsetSurface(Internal.getZones(tb_off), offset=-offset, pointsPerUnitLength=20000, algo=0, dim=dimPb) tb_blank = C.newPyTree(["BODY"]); tb_blank[2][1][2] = Internal.getZones(blankingBody) R._setPrescribedMotion3(tb_blank ,'rot', axis_pnt=(0.,0.,0.), axis_vct=(0,0,1),omega=-OMG) @@ -135,7 +135,7 @@ DZ = C.getMaxValue(zl,'CoordinateZ')-C.getMinValue(zl,'CoordinateZ') T._addkplane(tb_blank) T._contract(tb_blank, (0,0,0), (1,0,0), (0,1,0), DZ) -R._copyGrid2GridInit(tb_blank) +R._copyGrid2GridInit(tb_blank) C.convertPyTree2File(tb_blank, LOCAL+'/bodiesBlankRotComp.cgns') # suppress static BCOverlap in t_off @@ -178,5 +178,3 @@ Internal._rmNodesByName(t, '.Solver#ownData') Internal._rmNodesByName(tc, '.Solver#Param') Internal._rmNodesByName(tc, '.Solver#ownData') - - diff --git a/Cassiopee/Apps/test/IBMrotationCompute_t1.py b/Cassiopee/Apps/test/IBMrotationCompute_t1.py index d17fc189d..1a21d6528 100644 --- a/Cassiopee/Apps/test/IBMrotationCompute_t1.py +++ b/Cassiopee/Apps/test/IBMrotationCompute_t1.py @@ -28,7 +28,7 @@ rpm = 100 OMG = rpm*2*math.pi/60 -time_step= 1/(OMG*180/math.pi)/600 +time_step= 1/(OMG*180/math.pi)/600 ## ======================= ## ======================= @@ -37,7 +37,7 @@ "omp_mode":0, "modulo_verif":modulo_verif} -numz={"time_step": time_step, +numz={"time_step": time_step, "time_step_nature": "global", "epsi_newton": 0.1} @@ -172,9 +172,9 @@ C._initVars(t, "{centers:cellN#Motion}=({centers:cellN#Static}<2)*{centers:cellN#Motion}+({centers:cellN#Static}>1)*minimum(1,{centers:cellN#Motion})") C._initVars(t,"{centers:cellN}=minimum({centers:cellN#Motion}*{centers:cellN#Static},2.)") C._cpVars(t, 'centers:cellN',tc, 'cellN') - ucData = (graphX, intersectionDict, dictOfADT, + ucData = (graphX, intersectionDict, dictOfADT, dictOfNobOfRcvZones, dictOfNozOfRcvZones, - dictOfNobOfDnrZones, dictOfNozOfDnrZones, + dictOfNobOfDnrZones, dictOfNozOfDnrZones, dictOfNobOfRcvZonesC, dictOfNozOfRcvZonesC, timeiter, procDict, True, varType, 1, 2, 1) diff --git a/Cassiopee/Apps/test/IBMrotation_t1.py b/Cassiopee/Apps/test/IBMrotation_t1.py index 72e5b7321..5bbd9a670 100644 --- a/Cassiopee/Apps/test/IBMrotation_t1.py +++ b/Cassiopee/Apps/test/IBMrotation_t1.py @@ -78,7 +78,7 @@ ##GETTING EDGE OF OVERSET IBM MESH --> NEW GEOMETRY FOR BACKGROUND ovs = C.extractBCOfType(t_ibm,'BCExtrapolate') -G._getVolumeMap(ovs) +G._getVolumeMap(ovs) DZ = C.getMaxValue(ovs,'CoordinateZ')-C.getMinValue(ovs,'CoordinateZ') C._initVars(ovs,'{centers:vol}={centers:vol}*%g'%(1./DZ)) ovs = T.subzone(ovs,(1,1,1),(-1,1,1)) @@ -124,7 +124,7 @@ R._setPrescribedMotion3(tc_ibm,'rot', axis_pnt=(0.,0.,0.), axis_vct=(0,0,1),omega=-OMG) -## BLANKING OF BACKGROUND MESH -- USING AN OFFSET OF IMMERSED GEOMETRY +## BLANKING OF BACKGROUND MESH -- USING AN OFFSET OF IMMERSED GEOMETRY blankingBody= D.offsetSurface(Internal.getZones(tb_off), offset=-offset, pointsPerUnitLength=20000, algo=0, dim=dimPb) tb_blank = C.newPyTree(["BODY"]); tb_blank[2][1][2] = Internal.getZones(blankingBody) R._setPrescribedMotion3(tb_blank ,'rot', axis_pnt=(0.,0.,0.), axis_vct=(0,0,1),omega=-OMG) @@ -135,7 +135,7 @@ DZ = C.getMaxValue(zl,'CoordinateZ')-C.getMinValue(zl,'CoordinateZ') T._addkplane(tb_blank) T._contract(tb_blank, (0,0,0), (1,0,0), (0,1,0), DZ) -R._copyGrid2GridInit(tb_blank) +R._copyGrid2GridInit(tb_blank) C.convertPyTree2File(tb_blank, LOCAL+'/bodiesBlank.cgns') # suppress static BCOverlap in t_off @@ -181,4 +181,3 @@ test.testT(t, 1) test.testT(tc, 2) - diff --git a/Cassiopee/Apps/test/Quarantine/FastIBMHybrideCurvi_t1.py b/Cassiopee/Apps/test/Quarantine/FastIBMHybrideCurvi_t1.py index c479c7ad1..2182a5c38 100644 --- a/Cassiopee/Apps/test/Quarantine/FastIBMHybrideCurvi_t1.py +++ b/Cassiopee/Apps/test/Quarantine/FastIBMHybrideCurvi_t1.py @@ -17,7 +17,7 @@ LOCAL = test.getLocal() -#Fabrication case 2d pour maillage octree +#Fabrication case 2d pour maillage octree lines=[] lines.append( D.line((0.05,-0.15, 0), (0.1 ,-0.08,0), N=10) ) lines.append( D.line((0.10,-0.03, 0), (0.1 ,-0.08,0), N=10) ) @@ -101,7 +101,7 @@ t_curvi = C.newPyTree(['Base', a]) zones = Internal.getZones(t_curvi) -#les zones curviligne possedanr raccord chimere avec zone Cart IBC doit avoir la racine "joinIBC" dans leur nom +#les zones curviligne possedanr raccord chimere avec zone Cart IBC doit avoir la racine "joinIBC" dans leur nom zones[0][0]='curvi_joinIBC' t_curvi = X.connectMatchPeriodic(t_curvi, translation=[0.,0.,0.04]) #stretch maillage plaque direction normal paroi @@ -157,4 +157,3 @@ Internal._rmNodesByName(t_final, '*M1*') Internal._rmNodesFromType(t_final, 'Rind_t') test.testT(t_final, 7) - diff --git a/Cassiopee/Apps/test/createDragonMesh.py b/Cassiopee/Apps/test/createDragonMesh.py index f78b0e476..dce4afe54 100755 --- a/Cassiopee/Apps/test/createDragonMesh.py +++ b/Cassiopee/Apps/test/createDragonMesh.py @@ -6,8 +6,8 @@ s = D.sphere((0,0,0),1,N=30) dictOfParams={} dictOfParams['hWall']=1e-3 # hauteur premiere maille -dictOfParams['h_factor']=4 -dictOfParams['h_ext_factor']=4 #facteur*hauteur de la couche externe de prismes, -1 +dictOfParams['h_factor']=4 +dictOfParams['h_ext_factor']=4 #facteur*hauteur de la couche externe de prismes, -1 t = AppMesh.createDragonMesh(s, dictOfParams) C.convertPyTree2File(t, "out.cgns") @@ -19,6 +19,6 @@ #dictOfParams['q']=raison # raison pour l extrusion des prismes, ex 1.2 #dictOfParams['nlayers']=nblayersforced # on force le nb de couches de prismes #dictOfParams['h_ext']=snear # hauteur de la couche externe de prismes, -1 auto -#dictOfParams['dfar']=dfar # extension du domaine de calcul, auto si -1 +#dictOfParams['dfar']=dfar # extension du domaine de calcul, auto si -1 #dictOfParams['NParts']=0 # decoupage en N parties de la zone #dictOfParams['holeFactor']=1.25 # facteur sur la hauteur de l evidement diff --git a/Cassiopee/Apps/test/createDragonMesh_t1.py b/Cassiopee/Apps/test/createDragonMesh_t1.py index ce0b25d5f..d6cb2a15f 100644 --- a/Cassiopee/Apps/test/createDragonMesh_t1.py +++ b/Cassiopee/Apps/test/createDragonMesh_t1.py @@ -6,7 +6,7 @@ s = D.sphere((0,0,0),1,N=30) dictOfParams={} dictOfParams['hWall']=1e-3 # hauteur premiere maille -dictOfParams['h_factor']=4 +dictOfParams['h_factor']=4 dictOfParams['h_ext_factor']=4 #fact*hauteur de la couche externe de prismes, -1 t = AppMesh.createDragonMesh(s, dictOfParams) test.testT(t,1) diff --git a/Cassiopee/Apps/test/getHangingNodesInfoPT.py b/Cassiopee/Apps/test/getHangingNodesInfoPT.py index 6be50b50e..c9e5d938b 100644 --- a/Cassiopee/Apps/test/getHangingNodesInfoPT.py +++ b/Cassiopee/Apps/test/getHangingNodesInfoPT.py @@ -51,4 +51,3 @@ if res[0] != []: dictOfHangingNodes[i]=res print("Hanging node on coarse mpi rank:", rank, ": ", dictOfHangingNodes) - diff --git a/Cassiopee/Apps/test/t1.py b/Cassiopee/Apps/test/t1.py index 8d45941f5..326669978 100644 --- a/Cassiopee/Apps/test/t1.py +++ b/Cassiopee/Apps/test/t1.py @@ -1,3 +1,3 @@ # Apps installation test import KCore.Dist as Dist -Dist.checkModuleImport('Apps') +Dist.checkModuleImport('Apps') diff --git a/Cassiopee/CPlot/CPlot/CPlot.py b/Cassiopee/CPlot/CPlot/CPlot.py index 03c016bfd..9a84b0b62 100644 --- a/Cassiopee/CPlot/CPlot/CPlot.py +++ b/Cassiopee/CPlot/CPlot/CPlot.py @@ -53,8 +53,8 @@ def display(arrays, dirCam=(-999,-999,-999), viewAngle=-1., bgColor=-1, backgroundFile="None", - shadow=-1, lightOffset=(-999,-999), - dof=-1, dofPower=-1, gamma=-1, toneMapping=-1, + shadow=-1, lightOffset=(-999,-999), + dof=-1, dofPower=-1, gamma=-1, toneMapping=-1, stereo=-1, stereoDist=-1., panorama=0, export="None", exportResolution="None", zoneNames=[], renderTags=[], frameBuffer=-1, @@ -70,33 +70,33 @@ def display(arrays, shaderPath = os.path.dirname(__file__)+'/OSMESA/' cplotOSMesa.setShaderPath(shaderPath) cplotOSMesa.displayNew(arrays, dim, mode, scalarField, vectorField1, - vectorField2, vectorField3, displayBB, displayInfo, - displayIsoLegend, meshStyle, solidStyle, - scalarStyle, vectorStyle, vectorScale, vectorDensity, vectorNormalize, - vectorShowSurface, vectorShape, vectorProjection, - colormap, colormapC1, colormapC2, colormapC3, colormapC, - niso, isoEdges, isoScales, win, - posCam, posEye, dirCam, viewAngle, bgColor, backgroundFile, - shadow, lightOffset, dof, dofPower, gamma, toneMapping, - stereo, stereoDist, panorama, - export, exportResolution, zoneNames, renderTags, - frameBuffer, offscreen, - posCamList, posEyeList, dirCamList) + vectorField2, vectorField3, displayBB, displayInfo, + displayIsoLegend, meshStyle, solidStyle, + scalarStyle, vectorStyle, vectorScale, vectorDensity, vectorNormalize, + vectorShowSurface, vectorShape, vectorProjection, + colormap, colormapC1, colormapC2, colormapC3, colormapC, + niso, isoEdges, isoScales, win, + posCam, posEye, dirCam, viewAngle, bgColor, backgroundFile, + shadow, lightOffset, dof, dofPower, gamma, toneMapping, + stereo, stereoDist, panorama, + export, exportResolution, zoneNames, renderTags, + frameBuffer, offscreen, + posCamList, posEyeList, dirCamList) __slot__ = 1 else: cplotOSMesa.displayAgain(arrays, dim, mode, scalarField, vectorField1, - vectorField2, vectorField3, displayBB, displayInfo, - displayIsoLegend, meshStyle, solidStyle, - scalarStyle, vectorStyle, vectorScale, vectorDensity, vectorNormalize, - vectorShowSurface, vectorShape, vectorProjection, - colormap, colormapC1, colormapC2, colormapC3, colormapC, - niso, isoEdges, isoScales, win, - posCam, posEye, dirCam, viewAngle, bgColor, backgroundFile, - shadow, lightOffset, dof, dofPower, gamma, toneMapping, - stereo, stereoDist, panorama, - export, exportResolution, zoneNames, renderTags, - frameBuffer, offscreen, - posCamList, posEyeList, dirCamList) + vectorField2, vectorField3, displayBB, displayInfo, + displayIsoLegend, meshStyle, solidStyle, + scalarStyle, vectorStyle, vectorScale, vectorDensity, vectorNormalize, + vectorShowSurface, vectorShape, vectorProjection, + colormap, colormapC1, colormapC2, colormapC3, colormapC, + niso, isoEdges, isoScales, win, + posCam, posEye, dirCam, viewAngle, bgColor, backgroundFile, + shadow, lightOffset, dof, dofPower, gamma, toneMapping, + stereo, stereoDist, panorama, + export, exportResolution, zoneNames, renderTags, + frameBuffer, offscreen, + posCamList, posEyeList, dirCamList) return from . import cplot if __slot__ is None: @@ -105,12 +105,12 @@ def display(arrays, displayNew__(arrays, dim, mode, scalarField, vectorField1, vectorField2, vectorField3, displayBB, displayInfo, displayIsoLegend, meshStyle, solidStyle, - scalarStyle, vectorStyle, vectorScale, vectorDensity, vectorNormalize, - vectorShowSurface, vectorShape, vectorProjection, + scalarStyle, vectorStyle, vectorScale, vectorDensity, vectorNormalize, + vectorShowSurface, vectorShape, vectorProjection, colormap, colormapC1, colormapC2, colormapC3, colormapC, niso, isoEdges, isoScales, win, posCam, posEye, dirCam, viewAngle, bgColor, backgroundFile, - shadow, lightOffset, dof, dofPower, gamma, toneMapping, + shadow, lightOffset, dof, dofPower, gamma, toneMapping, stereo, stereoDist, panorama, export, exportResolution, zoneNames, renderTags, frameBuffer, offscreen, @@ -121,10 +121,10 @@ def display(arrays, displayIsoLegend, meshStyle, solidStyle, scalarStyle, vectorStyle, vectorScale, vectorDensity, vectorNormalize, vectorShowSurface, vectorShape, vectorProjection, - colormap, colormapC1, colormapC2, colormapC3, colormapC, + colormap, colormapC1, colormapC2, colormapC3, colormapC, niso, isoEdges, isoScales, win, posCam, posEye, dirCam, viewAngle, bgColor, backgroundFile, - shadow, lightOffset, dof, dofPower, gamma, toneMapping, + shadow, lightOffset, dof, dofPower, gamma, toneMapping, stereo, stereoDist, panorama, export, exportResolution, zoneNames, renderTags, frameBuffer, offscreen, @@ -305,15 +305,15 @@ def filterColormap(values): if colormap == 16 or colormap == 17: # Viridis colormapC = ColorMaps.Viridis if colormap == 16: colormap = 10 - elif colormap == 17: colormap = 11 + elif colormap == 17: colormap = 11 elif colormap == 18 or colormap == 19: # Inferno colormapC = ColorMaps.Inferno if colormap == 18: colormap = 10 - elif colormap == 19: colormap = 11 + elif colormap == 19: colormap = 11 elif colormap == 20 or colormap == 21: # Magma colormapC = ColorMaps.Magma if colormap == 20: colormap = 10 - elif colormap == 21: colormap = 11 + elif colormap == 21: colormap = 11 elif colormap == 22 or colormap == 23: # Plasma colormapC = ColorMaps.Plasma if colormap == 22: colormap = 10 @@ -321,11 +321,11 @@ def filterColormap(values): elif colormap == 24 or colormap == 25: # Jet colormapC = ColorMaps.Jet2 if colormap == 24: colormap = 10 - elif colormap == 25: colormap = 11 + elif colormap == 25: colormap = 11 elif colormap == 26 or colormap == 27: # Greys colormapC = ColorMaps.Greys if colormap == 26: colormap = 10 - elif colormap == 27: colormap = 11 + elif colormap == 27: colormap = 11 elif colormap == 28 or colormap == 29: # NiceBlue colormapC1='#000000'; colormapC2='#FFFFFF'; colormapC3='#0061A5' if colormap == 28: colormap = 6 @@ -333,7 +333,7 @@ def filterColormap(values): elif colormap == 30 or colormap == 31: # Greys colormapC = ColorMaps.Greens if colormap == 30: colormap = 10 - elif colormap == 31: colormap = 11 + elif colormap == 31: colormap = 11 return [colormap, colormapC1, colormapC2, colormapC3, colormapC] @@ -395,7 +395,7 @@ def setState(dim=-1, offscreen=0): """Set CPlot state. Usage: setState(posCam=(12,0,0))""" - if colormap != -1: + if colormap != -1: [colormap, colormapC1, colormapC2, colormapC3, colormapC] = filterColormap( [colormap, colormapC1, colormapC2, colormapC3, colormapC] ) if offscreen == 1 or offscreen == 5 or offscreen == 6 or offscreen == 7: # must set in the right module from . import cplotOSMesa as cplot @@ -409,16 +409,16 @@ def setState(dim=-1, colormap, colormapC1, colormapC2, colormapC3, colormapC, niso, isoEdges, isoScales, win, posCam, posEye, dirCam, viewAngle, lightOffset, - bgColor, backgroundFile, shadow, - dof, dofPower, gamma, toneMapping, + bgColor, backgroundFile, shadow, + dof, dofPower, gamma, toneMapping, sobelThreshold, sharpenPower, ssaoPower, ghostifyDeactivatedZones, edgifyActivatedZones, edgifyDeactivatedZones, simplifyOnDrag, export, exportResolution, continuousExport, envmap, message, - stereo, stereoDist, + stereo, stereoDist, cursor, gridSize, timer, selectionStyle, - activateShortCuts, billBoards, billBoardSize, + activateShortCuts, billBoards, billBoardSize, materials, bumpMaps, frameBuffer, offscreen) def setMode(mode): @@ -502,7 +502,7 @@ def fitView(): def finalizeExport(action=0): """Finalize export.""" - if action == 1 or action == 5 or action == 6 or action == 7: + if action == 1 or action == 5 or action == 6 or action == 7: from . import cplotOSMesa cplotOSMesa.finalizeExport(action) return @@ -555,7 +555,7 @@ def moveCamera(posCams, posEyes=None, dirCams=None, moveEye=False, N=100, speed= p = Geom.polyline(pOut) d = Geom.spline(p, 2, N) else: - p = Geom.polyline(pOut) + p = Geom.polyline(pOut) d = Geom.spline(p, 3, N) pinc = None @@ -774,54 +774,54 @@ def displayNew__(arrays, dim, mode, scalarField, vectorField1, vectorField2, meshStyle, solidStyle, scalarStyle, vectorStyle, vectorScale, vectorDensity, vectorNormalize, vectorShowSurface, vectorShape, vectorProjection, - colormap, colormapC1, colormapC2, colormapC3, colormapC, + colormap, colormapC1, colormapC2, colormapC3, colormapC, niso, isoEdges, isoScales, win, posCam, posEye, dirCam, viewAngle, bgColor, backgroundFile, - shadow, lightOffset, dof, dofPower, gamma, toneMapping, + shadow, lightOffset, dof, dofPower, gamma, toneMapping, stereo, stereoDist, panorama, export, exportResolution, zoneNames, renderTags, frameBuffer, offscreen, posCamList, posEyeList, dirCamList): global __slot__ import threading - if colormap != -1: + if colormap != -1: [colormap, colormapC1, colormapC2, colormapC3, colormapC] = filterColormap( [colormap, colormapC1, colormapC2, colormapC3, colormapC] ) if offscreen > 0: daemon = True else: daemon = False from . import cplot if version_info[0] == 2: # python 2 - no daemon a = threading.Thread(None, cplot.displayNew, None, - (arrays, dim, mode, scalarField, vectorField1, - vectorField2, vectorField3, displayBB, displayInfo, - displayIsoLegend, - meshStyle, solidStyle, scalarStyle, - vectorStyle, vectorScale, vectorDensity, vectorNormalize, - vectorShowSurface, vectorShape, vectorProjection, - colormap, colormapC1, colormapC2, colormapC3, colormapC, - niso, isoEdges, isoScales, - win, posCam, posEye, dirCam, viewAngle, - bgColor, backgroundFile, - shadow, lightOffset, dof, dofPower, gamma, toneMapping, - stereo, stereoDist, panorama, - export, exportResolution, - zoneNames, renderTags, frameBuffer, offscreen, - posCamList, posEyeList, dirCamList), {}) + (arrays, dim, mode, scalarField, vectorField1, + vectorField2, vectorField3, displayBB, displayInfo, + displayIsoLegend, + meshStyle, solidStyle, scalarStyle, + vectorStyle, vectorScale, vectorDensity, vectorNormalize, + vectorShowSurface, vectorShape, vectorProjection, + colormap, colormapC1, colormapC2, colormapC3, colormapC, + niso, isoEdges, isoScales, + win, posCam, posEye, dirCam, viewAngle, + bgColor, backgroundFile, + shadow, lightOffset, dof, dofPower, gamma, toneMapping, + stereo, stereoDist, panorama, + export, exportResolution, + zoneNames, renderTags, frameBuffer, offscreen, + posCamList, posEyeList, dirCamList), {}) else: # python3 - daemon a = threading.Thread(None, cplot.displayNew, None, - (arrays, dim, mode, scalarField, vectorField1, - vectorField2, vectorField3, displayBB, displayInfo, - displayIsoLegend, - meshStyle, solidStyle, scalarStyle, - vectorStyle, vectorScale, vectorDensity, vectorNormalize, - vectorShowSurface, vectorShape, vectorProjection, - colormap, colormapC1, colormapC2, colormapC3, colormapC, - niso, isoEdges, isoScales, - win, posCam, posEye, dirCam, viewAngle, - bgColor, backgroundFile, - shadow, lightOffset, dof, dofPower, gamma, toneMapping, - stereo, stereoDist, panorama, - export, exportResolution, - zoneNames, renderTags, frameBuffer, offscreen, - posCamList, posEyeList, dirCamList), {}, daemon=daemon) + (arrays, dim, mode, scalarField, vectorField1, + vectorField2, vectorField3, displayBB, displayInfo, + displayIsoLegend, + meshStyle, solidStyle, scalarStyle, + vectorStyle, vectorScale, vectorDensity, vectorNormalize, + vectorShowSurface, vectorShape, vectorProjection, + colormap, colormapC1, colormapC2, colormapC3, colormapC, + niso, isoEdges, isoScales, + win, posCam, posEye, dirCam, viewAngle, + bgColor, backgroundFile, + shadow, lightOffset, dof, dofPower, gamma, toneMapping, + stereo, stereoDist, panorama, + export, exportResolution, + zoneNames, renderTags, frameBuffer, offscreen, + posCamList, posEyeList, dirCamList), {}, daemon=daemon) a.start() __slot__ = a @@ -833,25 +833,25 @@ def displayAgain__(arrays, dim, mode, scalarField, vectorField1, vectorField2, colormap, colormapC1, colormapC2, colormapC3, colormapC, niso, isoEdges, isoScales, win, posCam, posEye, dirCam, viewAngle, bgColor, backgroundFile, - shadow, lightOffset, dof, dofPower, gamma, toneMapping, + shadow, lightOffset, dof, dofPower, gamma, toneMapping, stereo, stereoDist, panorama, export, exportResolution, zoneNames, renderTags, frameBuffer, offscreen, posCamList, posEyeList, dirCamList): - if colormap != -1: + if colormap != -1: [colormap, colormapC1, colormapC2, colormapC3, colormapC] = filterColormap( [colormap, colormapC1, colormapC2, colormapC3, colormapC] ) from . import cplot cplot.displayAgain(arrays, dim, mode, scalarField, vectorField1, vectorField2, vectorField3, displayBB, displayInfo, displayIsoLegend, meshStyle, solidStyle, scalarStyle, vectorStyle, - vectorScale, vectorDensity, vectorNormalize, vectorShowSurface, + vectorScale, vectorDensity, vectorNormalize, vectorShowSurface, vectorShape, vectorProjection, colormap, colormapC1, colormapC2, colormapC3, colormapC, niso, isoEdges, isoScales, win, posCam, posEye, dirCam, viewAngle, bgColor, backgroundFile, - shadow, lightOffset, dof, dofPower, gamma, toneMapping, - stereo, stereoDist, panorama, + shadow, lightOffset, dof, dofPower, gamma, toneMapping, + stereo, stereoDist, panorama, export, exportResolution, zoneNames, renderTags, - frameBuffer, offscreen, + frameBuffer, offscreen, posCamList, posEyeList, dirCamList) time.sleep(__timeStep__) diff --git a/Cassiopee/CPlot/CPlot/ColorControler.py b/Cassiopee/CPlot/CPlot/ColorControler.py index 8c4b20f24..9d44a1ffd 100644 --- a/Cassiopee/CPlot/CPlot/ColorControler.py +++ b/Cassiopee/CPlot/CPlot/ColorControler.py @@ -293,7 +293,7 @@ def changeColor(self,h,s,v): def createColorMap(self, colormapName, nbColorMap): colormapList = [] - try: + try: import matplotlib.pyplot as plt cm = plt.get_cmap(colormapName) for ind in range(nbColorMap): @@ -301,136 +301,136 @@ def createColorMap(self, colormapName, nbColorMap): html = '#%02x%02x%02x' % (int(255*rgb[0]),int(255*rgb[1]),int(255*rgb[2])) colormapList.append(html) except: - if colormapName == 'Set1': + if colormapName == 'Set1': colormapList = ['#e41a1c', '#377eb7', '#4dae4a', '#994ea1', '#ff8100', '#fdfb32', '#a7572b', '#f481bd'] - elif colormapName == 'Set2': + elif colormapName == 'Set2': colormapList = ['#66c2a5', '#e9936a', '#a79bb1', '#c692c5', '#c5b289', '#c8d845', '#f7d34a', '#ddc198'] - elif colormapName == 'Set3': + elif colormapName == 'Set3': colormapList = ['#8dd3c7', '#e6e4c1', '#ec8d8a', '#91b1c3', '#d6c965', '#f4ced8', '#d0bfd1', '#c6c6c2'] - elif colormapName == 'Greys': + elif colormapName == 'Greys': colormapList = ['#ffffff', '#efefef', '#d8d8d8', '#bcbcbc', '#959595', '#727272', '#505050', '#232323'] - elif colormapName == 'Purples': + elif colormapName == 'Purples': colormapList = ['#fcfbfd', '#eeecf4', '#d9d9ea', '#bbbcdb', '#9d99c7', '#7f7cb9', '#6950a2', '#53258e'] - elif colormapName == 'Blues': + elif colormapName == 'Blues': colormapList = ['#f7fbff', '#ddeaf6', '#c5daee', '#9dc9e0', '#6aadd5', '#4191c5', '#2070b4', '#08509a'] - elif colormpaName == 'Greens': + elif colormpaName == 'Greens': colormapList = ['#f7fcf5', '#e4f4df', '#c6e8bf', '#a0d89a', '#73c375', '#40aa5c', '#228a44', '#006b2b'] - elif colormapName == 'Oranges': + elif colormapName == 'Oranges': colormapList = ['#fff5eb', '#fde5cd', '#fdcfa1', '#fdad6a', '#fc8c3b', '#f06812', '#d74701', '#a43503'] - elif colormapName == 'Reds': + elif colormapName == 'Reds': colormapList = ['#fff5f0', '#fddfd1', '#fcbaa0', '#fb9171', '#fa6949', '#ee3a2b', '#ca171c', '#a30e14'] - elif colormapName == 'YlOrBr': + elif colormapName == 'YlOrBr': colormapList = ['#ffffe5', '#fef6bb', '#fee290', '#fec34e', '#fd9828', '#eb6f13', '#ca4b02', '#973304'] - elif colormapName == 'YlOrRd': + elif colormapName == 'YlOrRd': colormapList = ['#ffffcc', '#feec9f', '#fed875', '#fdb14b', '#fc8c3b', '#fb4c29', '#e2191c', '#bb0026'] - elif colormapName == 'PuRd': + elif colormapName == 'PuRd': colormapList = ['#f7f4f9', '#e6e0ee', '#d3b8d9', '#c993c6', '#df64af', '#e62888', '#cc1155', '#960042'] - elif colormapName == 'RdPu': + elif colormapName == 'RdPu': colormapList = ['#fff7f3', '#fcdfdc', '#fbc4bf', '#f99eb4', '#f667a0', '#dc3396', '#ac017d', '#780076'] - elif colormapName == 'BuPu': + elif colormapName == 'BuPu': colormapList = ['#f7fcfd', '#dfebf3', '#bed2e5', '#9dbbd9', '#8c95c5', '#8b6ab0', '#873f9c', '#7f0e7a'] - elif colormapName == 'GnBu': + elif colormapName == 'GnBu': colormapList = ['#f7fcf0', '#dff2da', '#cbeac4', '#a7dcb5', '#7acbc4', '#4db2d2', '#2a8bbd', '#0866aa'] - elif colormapName == 'PuBu': + elif colormapName == 'PuBu': colormapList = ['#fff7fb', '#ebe6f1', '#cfd0e5', '#a5bcda', '#73a8ce', '#358fbf', '#046faf', '#03598b'] - elif colormapName == 'YlGnBu': + elif colormapName == 'YlGnBu': colormapList = ['#ffffd9', '#ecf7b1', '#c6e8b4', '#7eccbb', '#40b5c3', '#1d90bf', '#225da7', '#243392'] - elif colormapName == 'PuBuGn': + elif colormapName == 'PuBuGn': colormapList = ['#fff7fb', '#ebe1ef', '#cfd0e5', '#a5bcda', '#66a8ce', '#348fbe', '#018088', '#016a58'] - elif colormapName == 'BuGn': + elif colormapName == 'BuGn': colormapList = ['#f7fcfd', '#e4f4f8', '#cbebe5', '#98d7c8', '#65c1a3', '#40ad75', '#228a44', '#006b2b'] - elif colormapName == 'YlGn': + elif colormapName == 'YlGn': colormapList = ['#ffffe5', '#f6fbb8', '#d8efa2', '#acdc8d', '#77c578', '#40aa5c', '#228342', '#006736'] - elif colormapName == 'binary': + elif colormapName == 'binary': colormapList = ['#ffffff', '#dfdfdf', '#bfbfbf', '#9f9f9f', '#7f7f7f', '#5f5f5f', '#3f3f3f', '#1f1f1f'] - elif colormapName == 'gist_yarg': + elif colormapName == 'gist_yarg': colormapList = ['#ffffff', '#dfdfdf', '#bfbfbf', '#9f9f9f', '#7f7f7f', '#5f5f5f', '#3f3f3f', '#1f1f1f'] - elif colormapName == 'gist_gray': + elif colormapName == 'gist_gray': colormapList = ['#000000', '#202020', '#404040', '#606060', '#808080', '#a0a0a0', '#c0c0c0', '#e0e0e0'] - elif colormapName == 'gray': + elif colormapName == 'gray': colormapList = ['#000000', '#202020', '#404040', '#606060', '#808080', '#a0a0a0', '#c0c0c0', '#e0e0e0'] - elif colormapName == 'bone': + elif colormapName == 'bone': colormapList = ['#000000', '#1c1b26', '#38374d', '#545473', '#707b8f', '#8ca1ab', '#a8c7c7', '#d4e3e3'] - elif colormapName == 'pink': + elif colormapName == 'pink': colormapList = ['#1e0000', '#744949', '#a16868', '#c2827f', '#d0ab93', '#ddcda4', '#e9e9b6', '#f4f4de'] - elif colormapName == 'spring': + elif colormapName == 'spring': colormapList = ['#ff00ff', '#ff20df', '#ff40bf', '#ff609f', '#ff807f', '#ffa05f', '#ffc03f', '#ffe01f'] - elif colormapName == 'summer': + elif colormapName == 'summer': colormapList = ['#007f66', '#208f66', '#409f66', '#60af66', '#80bf66', '#a0cf66', '#c0df66', '#e0ef66'] - elif colormapName == 'autumn': + elif colormapName == 'autumn': colormapList = ['#ff0000', '#ff2000', '#ff4000', '#ff6000', '#ff8000', '#ffa000', '#ffc000', '#ffe000'] - elif colormapName == 'winter': + elif colormapName == 'winter': colormapList = ['#0000ff', '#0020ef', '#0040df', '#0060cf', '#0080bf', '#00a0af', '#00c09f', '#00e08f'] - elif colormapName == 'cool': + elif colormapName == 'cool': colormapList = ['#00ffff', '#20dfff', '#40bfff', '#609fff', '#807fff', '#a05fff', '#c03fff', '#e01fff'] - elif colormapName == 'hot': + elif colormapName == 'hot': colormapList = ['#0a0000', '#5e0000', '#b20000', '#ff0700', '#ff5b00', '#ffaf00', '#ffff06', '#ffff84'] - elif colormapName == 'afmhot': + elif colormapName == 'afmhot': colormapList = ['#000000', '#400000', '#800000', '#c04000', '#ff8000', '#ffc041', '#ffff81', '#ffffc1'] - elif colormapName == 'gist_heat': + elif colormapName == 'gist_heat': colormapList = ['#000000', '#300000', '#600000', '#900000', '#c00000', '#f04100', '#ff8102', '#ffc183'] - elif colormapName == 'copper': + elif colormapName == 'copper': colormapList = ['#000000', '#27180f', '#4f311f', '#764a2f', '#9e633f', '#c57c4f', '#ed955f', '#ffae6f'] - elif colormapName == 'PRGn': + elif colormapName == 'PRGn': colormapList = ['#40004b', '#7e3b8d', '#ad8bbd', '#dec8e2', '#f6f6f6', '#cbeac5', '#7dc37e', '#288340'] - elif colormapName == 'BrBG': + elif colormapName == 'BrBG': colormapList = ['#543005', '#995d12', '#cfa255', '#f0dfb2', '#f4f4f4', '#b3e2db', '#58b0a6', '#0c7068'] - elif colormapName == 'PuOr': + elif colormapName == 'PuOr': colormapList = ['#7f3b08', '#be6209', '#ee9d3c', '#fdd6a2', '#f6f6f6', '#cdcde4', '#978dbd', '#5d378f'] - elif colormapName == 'RdGy': + elif colormapName == 'RdGy': colormapList = ['#67001f', '#bb2a33', '#e58368', '#faceb6', '#fefefe', '#d5d5d5', '#9f9f9f', '#595959'] - elif colormapName == 'RdBu': + elif colormapName == 'RdBu': colormapList = ['#67001f', '#bb2a33', '#e58368', '#faceb6', '#f6f6f6', '#bfdceb', '#68aacf', '#286fb0'] - elif colormpaName == 'RdYlGn': + elif colormpaName == 'RdYlGn': colormapList = ['#a50026', '#de3f2e', '#f88e52', '#fdd481', '#fefebd', '#cbe881', '#84ca66', '#2a9f54'] - elif colormapName == 'Spectral': + elif colormapName == 'Spectral': colormapList = ['#9e0142', '#dc494b', '#f88e52', '#fdd481', '#fefebe', '#d5ee9b', '#86cea4', '#3d94b7'] - elif colormapName == 'coolwarm': + elif colormapName == 'coolwarm': colormapList = ['#3a4cc0', '#6182ea', '#8daffd', '#b8cff8', '#dddcdb', '#f4c3ab', '#f39879', '#dc5e4b'] - elif colormapName == 'bwr': + elif colormapName == 'bwr': colormapList = ['#0000ff', '#4040ff', '#8080ff', '#c0c0ff', '#fffefe', '#ffbebe', '#ff7e7e', '#ff3e3e'] - elif colormapName == 'seismic': + elif colormapName == 'seismic': colormapList = ['#00004c', '#0000a6', '#0101ff', '#8181ff', '#fffdfd', '#ff7d7d', '#fd0000', '#bd0000'] - elif colormapName == 'hsv': + elif colormapName == 'hsv': colormapList = ['#ff0000', '#ffbd00', '#83ff00', '#00ff39', '#00fff5', '#004bff', '#7100ff', '#ff00cf'] - elif colormapName == 'Pastel1': + elif colormapName == 'Pastel1': colormapList = ['#fbb4ae', '#b3cde2', '#cceac5', '#decbe3', '#fed9a6', '#fefecb', '#e5d8be', '#fcdaec'] - elif colormapName == 'Pastel2': + elif colormapName == 'Pastel2': colormapList = ['#b3e2cd', '#f4cfb0', '#d7d3d9', '#e5cee5', '#ece0d6', '#eff3be', '#fbedb6', '#ebdecc'] - elif colormapName == 'Paired': + elif colormapName == 'Paired': colormapList = ['#a6cee3', '#569fa4', '#51af42', '#f78787', '#f07047', '#fe850a', '#ae90c5', '#ccbd99'] - elif colormapName == 'Accent': + elif colormapName == 'Accent': colormapList = ['#7fc97f', '#b6b1c9', '#edbb98', '#fee892', '#98b3a4', '#80429c', '#e21a62', '#b15c22'] - elif colormapName == 'Dark2': + elif colormapName == 'Dark2': colormapList = ['#1b9e77', '#c16610', '#8d6b87', '#bd4298', '#a46952', '#98a713', '#d49c09', '#9c7327'] - elif colormapName == 'flag': + elif colormapName == 'flag': colormapList = ['#ff0000', '#f10000', '#d90000', '#bf0000', '#a40000', '#880000', '#6c0000', '#500000'] - elif colormapName == 'prism': + elif colormapName == 'prism': colormapList = ['#ff0000', '#f5ff00', '#0056c3', '#f00070', '#ffd700', '#00a362', '#a200ce', '#ff9400'] - elif colormapName == 'ocean': + elif colormapName == 'ocean': colormapList = ['#007f00', '#004f20', '#001f40', '#001060', '#004080', '#0070a0', '#41a0c0', '#a2d0e0'] - elif colormapName == 'gist_earth': + elif colormapName == 'gist_earth': colormapList = ['#000000', '#153878', '#2a737e', '#3b8d62', '#5da04b', '#99ae58', '#bcaa62', '#dab69f'] - elif colormapName == 'terrain': + elif colormapName == 'terrain': colormapList = ['#333399', '#0888ee', '#01cc66', '#81e57f', '#fefd98', '#beab75', '#815d56', '#c1afab'] - elif colormapName == 'gist_stern': + elif colormapName == 'gist_stern': colormapList = ['#000000', '#a52040', '#404080', '#6060c0', '#8080fc', '#a0a074', '#c0c011', '#e0e08a'] - elif colormapName == 'gnuplot': + elif colormapName == 'gnuplot': colormapList = ['#000000', '#5a00b4', '#7f04fe', '#9c0db2', '#b42000', '#c93e00', '#dd6c00', '#eeac00'] - elif colormapName == 'gnuplot2': + elif colormapName == 'gnuplot2': colormapList = ['#000000', '#000080', '#0000ff', '#6400ff', '#c829d5', '#ff6995', '#ffa955', '#ffe915'] - elif colormapName == 'CMRmap': + elif colormapName == 'CMRmap': colormapList = ['#000000', '#26267f', '#4d26be', '#9a337e', '#fe4025', '#e58000', '#e5c01b', '#e6e683'] - elif colormapName == 'cubehelix': + elif colormapName == 'cubehelix': colormapList = ['#000000', '#1a1d3b', '#15534b', '#437730', '#a1794a', '#d383a9', '#c6b4ed', '#cbe7ef'] - elif colormapName == 'brg': + elif colormapName == 'brg': colormapList = ['#0000ff', '#4000bf', '#80007f', '#c0003f', '#fe0100', '#be4100', '#7e8100', '#3ec100'] - elif colormapName == 'gist_rainbow': + elif colormapName == 'gist_rainbow': colormapList = ['#ff0028', '#ff8300', '#cdff00', '#20ff00', '#00ff8b', '#00c5ff', '#0017ff', '#9600ff'] - elif colormapName == 'jet': + elif colormapName == 'jet': colormapList = ['#00007f', '#0000ff', '#0080ff', '#15ffe1', '#7cff79', '#e4ff12', '#ff9400', '#ff1d00'] - elif colormapName == 'nipy_spectral': - colormapList = ['#000000', '#4200a1', '#0077dd', '#00aa97', '#00bc00', '#66ff00', '#ffc900', '#eb0000'] + elif colormapName == 'nipy_spectral': + colormapList = ['#000000', '#4200a1', '#0077dd', '#00aa97', '#00bc00', '#66ff00', '#ffc900', '#eb0000'] else: colormapList = ['#e41a1c','#377eb7','#4dae4a','#994ea1','#ff8100','#fdfb32','#a7572b','#f481bd'] return colormapList diff --git a/Cassiopee/CPlot/CPlot/ColorMaps.py b/Cassiopee/CPlot/CPlot/ColorMaps.py index 268cf07df..9a199a802 100644 --- a/Cassiopee/CPlot/CPlot/ColorMaps.py +++ b/Cassiopee/CPlot/CPlot/ColorMaps.py @@ -3,8 +3,8 @@ # and (in the case of viridis) Eric Firing. #============================================================================ -Jet = [0, 0, 143, - 0, 0, 159, +Jet = [0, 0, 143, + 0, 0, 159, 0, 0, 175, 0, 0, 191, 0, 0, 207, @@ -63,40 +63,40 @@ #============================================================================ Jet2 = [0., 0., 0.5, 0., 0., 0.54591368, - 0., 0., 0.59182736, - 0., 0., 0.63774105, - 0., 0., 0.68365473, - 0., 0., 0.72956841, - 0., 0., 0.77548209, - 0., 0., 0.82139578, - 0., 0., 0.86730946, - 0., 0., 0.91322314, - 0., 0., 0.95913682, - 0., 0., 1., - 0., 0., 1., - 0., 0.02525253, 1., - 0., 0.06565657, 1., - 0., 0.10606061, 1., - 0., 0.14646465, 1., - 0., 0.18686869, 1., - 0., 0.22727273, 1., - 0., 0.26767677, 1., - 0., 0.30808081, 1., - 0., 0.34848485, 1., - 0., 0.38888889, 1., - 0., 0.42929293, 1., - 0., 0.46969697, 1., - 0., 0.51010101, 1., - 0., 0.55050505, 1., - 0., 0.59090909, 1., - 0., 0.63131313, 1., - 0., 0.67171717, 1., - 0., 0.71212121, 1., - 0., 0.75252525, 1., - 0., 0.79292929, 1., - 0., 0.83333333, 1., - 0., 0.87373737, 0.98892147, - 0.01140437, 0.91414141, 0.95633757, + 0., 0., 0.59182736, + 0., 0., 0.63774105, + 0., 0., 0.68365473, + 0., 0., 0.72956841, + 0., 0., 0.77548209, + 0., 0., 0.82139578, + 0., 0., 0.86730946, + 0., 0., 0.91322314, + 0., 0., 0.95913682, + 0., 0., 1., + 0., 0., 1., + 0., 0.02525253, 1., + 0., 0.06565657, 1., + 0., 0.10606061, 1., + 0., 0.14646465, 1., + 0., 0.18686869, 1., + 0., 0.22727273, 1., + 0., 0.26767677, 1., + 0., 0.30808081, 1., + 0., 0.34848485, 1., + 0., 0.38888889, 1., + 0., 0.42929293, 1., + 0., 0.46969697, 1., + 0., 0.51010101, 1., + 0., 0.55050505, 1., + 0., 0.59090909, 1., + 0., 0.63131313, 1., + 0., 0.67171717, 1., + 0., 0.71212121, 1., + 0., 0.75252525, 1., + 0., 0.79292929, 1., + 0., 0.83333333, 1., + 0., 0.87373737, 0.98892147, + 0.01140437, 0.91414141, 0.95633757, 0.04398827, 0.95454545, 0.92375367, 0.07657217, 0.99494949, 0.89116976, 0.10915608, 1., 0.85858586, @@ -105,773 +105,773 @@ 0.20690779, 1., 0.76083415, 0.23949169, 1., 0.72825024, 0.27207559, 1., 0.69566634, - 0.3046595, 1., 0.66308244, - 0.3372434, 1., 0.63049853, - 0.36982731, 1., 0.59791463, - 0.40241121, 1., 0.56533073, - 0.43499511, 1., 0.53274682, - 0.46757902, 1., 0.50016292, - 0.50016292, 1., 0.46757902, - 0.53274682, 1., 0.43499511, - 0.56533073, 1., 0.40241121, - 0.59791463, 1., 0.36982731, - 0.63049853, 1., 0.3372434, - 0.66308244, 1., 0.3046595, - 0.69566634, 1., 0.27207559, - 0.72825024, 1., 0.23949169, - 0.76083415, 1., 0.20690779, - 0.79341805, 1., 0.17432388, - 0.82600196, 1., 0.14173998, - 0.85858586, 1., 0.10915608, - 0.89116976, 1., 0.07657217, - 0.92375367, 1., 0.04398827, - 0.95633757, 0.97605686, 0.01140437, - 0.98892147, 0.93864572, 0., - 1., 0.90123457, 0., - 1., 0.86382342, 0., - 1., 0.82641227, 0., - 1., 0.78900112, 0., - 1., 0.75158997, 0., - 1., 0.71417883, 0., - 1., 0.67676768, 0., - 1., 0.63935653, 0., - 1., 0.60194538, 0., - 1., 0.56453423, 0., - 1., 0.52712308, 0., - 1., 0.48971193, 0., - 1., 0.45230079, 0., - 1., 0.41488964, 0., - 1., 0.37747849, 0., - 1., 0.34006734, 0., - 1., 0.30265619, 0., - 1., 0.26524504, 0., - 1., 0.22783389, 0., - 1., 0.19042275, 0., - 1., 0.1530116, 0., - 1., 0.11560045, 0., - 1., 0.0781893, 0., - 0.95913682, 0.04077815, 0., - 0.91322314, 0.003367, 0., - 0.86730946, 0., 0., - 0.82139578, 0., 0., - 0.77548209, 0., 0., - 0.72956841, 0., 0., - 0.68365473, 0., 0., - 0.63774105, 0., 0., - 0.59182736, 0., 0., - 0.54591368, 0., 0., + 0.3046595, 1., 0.66308244, + 0.3372434, 1., 0.63049853, + 0.36982731, 1., 0.59791463, + 0.40241121, 1., 0.56533073, + 0.43499511, 1., 0.53274682, + 0.46757902, 1., 0.50016292, + 0.50016292, 1., 0.46757902, + 0.53274682, 1., 0.43499511, + 0.56533073, 1., 0.40241121, + 0.59791463, 1., 0.36982731, + 0.63049853, 1., 0.3372434, + 0.66308244, 1., 0.3046595, + 0.69566634, 1., 0.27207559, + 0.72825024, 1., 0.23949169, + 0.76083415, 1., 0.20690779, + 0.79341805, 1., 0.17432388, + 0.82600196, 1., 0.14173998, + 0.85858586, 1., 0.10915608, + 0.89116976, 1., 0.07657217, + 0.92375367, 1., 0.04398827, + 0.95633757, 0.97605686, 0.01140437, + 0.98892147, 0.93864572, 0., + 1., 0.90123457, 0., + 1., 0.86382342, 0., + 1., 0.82641227, 0., + 1., 0.78900112, 0., + 1., 0.75158997, 0., + 1., 0.71417883, 0., + 1., 0.67676768, 0., + 1., 0.63935653, 0., + 1., 0.60194538, 0., + 1., 0.56453423, 0., + 1., 0.52712308, 0., + 1., 0.48971193, 0., + 1., 0.45230079, 0., + 1., 0.41488964, 0., + 1., 0.37747849, 0., + 1., 0.34006734, 0., + 1., 0.30265619, 0., + 1., 0.26524504, 0., + 1., 0.22783389, 0., + 1., 0.19042275, 0., + 1., 0.1530116, 0., + 1., 0.11560045, 0., + 1., 0.0781893, 0., + 0.95913682, 0.04077815, 0., + 0.91322314, 0.003367, 0., + 0.86730946, 0., 0., + 0.82139578, 0., 0., + 0.77548209, 0., 0., + 0.72956841, 0., 0., + 0.68365473, 0., 0., + 0.63774105, 0., 0., + 0.59182736, 0., 0., + 0.54591368, 0., 0., 0.5, 0., 0. ] #============================================================================ Magma = [ 0.003279, 0.002305, 0.023708, - 0.007588, 0.006356, 0.044973, - 0.011465, 0.009828, 0.060750, - 0.018815, 0.016026, 0.084584, - 0.024792, 0.020715, 0.100676, - 0.035520, 0.028397, 0.125209, - 0.048062, 0.036607, 0.150327, - 0.056615, 0.042160, 0.167446, - 0.069764, 0.049726, 0.193735, - 0.078815, 0.054184, 0.211667, - 0.092949, 0.059904, 0.239164, - 0.107899, 0.064335, 0.267289, - 0.118405, 0.066479, 0.286321, - 0.135053, 0.068391, 0.315000, - 0.146785, 0.068738, 0.334011, - 0.165308, 0.067911, 0.361816, - 0.178212, 0.066576, 0.379497, - 0.198177, 0.063862, 0.404009, - 0.218512, 0.061158, 0.425392, - 0.232077, 0.059889, 0.437695, - 0.252220, 0.059415, 0.453248, - 0.265447, 0.060237, 0.461840, - 0.284951, 0.063168, 0.472451, - 0.304081, 0.067835, 0.480812, - 0.316654, 0.071690, 0.485380, - 0.335308, 0.078236, 0.491024, - 0.347636, 0.082946, 0.494121, - 0.366012, 0.090314, 0.497960, - 0.378211, 0.095332, 0.500067, - 0.396467, 0.102902, 0.502658, - 0.414709, 0.110431, 0.504662, - 0.426877, 0.115395, 0.505714, - 0.445163, 0.122724, 0.506901, - 0.457386, 0.127522, 0.507448, - 0.475780, 0.134577, 0.507921, - 0.494258, 0.141462, 0.507988, - 0.506629, 0.145958, 0.507806, - 0.525270, 0.152569, 0.507192, - 0.537755, 0.156894, 0.506551, - 0.556571, 0.163269, 0.505230, - 0.575490, 0.169530, 0.503466, - 0.588158, 0.173652, 0.502035, - 0.607238, 0.179779, 0.499492, - 0.620005, 0.183840, 0.497524, - 0.639216, 0.189921, 0.494150, - 0.652056, 0.193986, 0.491611, - 0.671349, 0.200133, 0.487358, - 0.690661, 0.206384, 0.482558, - 0.703532, 0.210638, 0.479049, - 0.722805, 0.217194, 0.473316, - 0.735616, 0.221713, 0.469180, - 0.754737, 0.228772, 0.462509, - 0.773695, 0.236249, 0.455289, - 0.786212, 0.241514, 0.450184, - 0.804752, 0.249911, 0.442102, - 0.816914, 0.255895, 0.436461, - 0.834791, 0.265540, 0.427671, - 0.846416, 0.272473, 0.421631, - 0.863320, 0.283729, 0.412403, - 0.879464, 0.296125, 0.403118, - 0.889731, 0.305079, 0.397002, - 0.904281, 0.319610, 0.388137, - 0.913354, 0.330052, 0.382563, - 0.925937, 0.346844, 0.374959, - 0.937221, 0.364929, 0.368567, - 0.944006, 0.377643, 0.365136, - 0.953099, 0.397563, 0.361438, - 0.958464, 0.411324, 0.360014, - 0.965549, 0.432519, 0.359529, - 0.971582, 0.454210, 0.361030, - 0.975082, 0.468861, 0.363111, - 0.979645, 0.491014, 0.367783, - 0.982279, 0.505851, 0.371874, - 0.985693, 0.528148, 0.379371, - 0.987646, 0.543015, 0.385210, - 0.990138, 0.565296, 0.395122, - 0.992196, 0.587502, 0.406299, - 0.993326, 0.602275, 0.414390, - 0.994738, 0.624350, 0.427397, - 0.995480, 0.639027, 0.436607, - 0.996341, 0.660969, 0.451160, - 0.996925, 0.682828, 0.466526, - 0.997186, 0.697349, 0.477182, - 0.997351, 0.719089, 0.493755, - 0.997341, 0.733545, 0.505167, - 0.997138, 0.755190, 0.522806, - 0.996898, 0.769591, 0.534892, - 0.996369, 0.791167, 0.553499, - 0.995680, 0.812706, 0.572645, - 0.995131, 0.827052, 0.585701, - 0.994222, 0.848540, 0.605696, - 0.993545, 0.862859, 0.619299, - 0.992440, 0.884330, 0.640099, - 0.991332, 0.905763, 0.661309, - 0.990570, 0.920049, 0.675675, - 0.989434, 0.941470, 0.697519, - 0.988717, 0.955742, 0.712242, - 0.987691, 0.977154, 0.734536, - 0.987053, 0.991438, 0.749504] + 0.007588, 0.006356, 0.044973, + 0.011465, 0.009828, 0.060750, + 0.018815, 0.016026, 0.084584, + 0.024792, 0.020715, 0.100676, + 0.035520, 0.028397, 0.125209, + 0.048062, 0.036607, 0.150327, + 0.056615, 0.042160, 0.167446, + 0.069764, 0.049726, 0.193735, + 0.078815, 0.054184, 0.211667, + 0.092949, 0.059904, 0.239164, + 0.107899, 0.064335, 0.267289, + 0.118405, 0.066479, 0.286321, + 0.135053, 0.068391, 0.315000, + 0.146785, 0.068738, 0.334011, + 0.165308, 0.067911, 0.361816, + 0.178212, 0.066576, 0.379497, + 0.198177, 0.063862, 0.404009, + 0.218512, 0.061158, 0.425392, + 0.232077, 0.059889, 0.437695, + 0.252220, 0.059415, 0.453248, + 0.265447, 0.060237, 0.461840, + 0.284951, 0.063168, 0.472451, + 0.304081, 0.067835, 0.480812, + 0.316654, 0.071690, 0.485380, + 0.335308, 0.078236, 0.491024, + 0.347636, 0.082946, 0.494121, + 0.366012, 0.090314, 0.497960, + 0.378211, 0.095332, 0.500067, + 0.396467, 0.102902, 0.502658, + 0.414709, 0.110431, 0.504662, + 0.426877, 0.115395, 0.505714, + 0.445163, 0.122724, 0.506901, + 0.457386, 0.127522, 0.507448, + 0.475780, 0.134577, 0.507921, + 0.494258, 0.141462, 0.507988, + 0.506629, 0.145958, 0.507806, + 0.525270, 0.152569, 0.507192, + 0.537755, 0.156894, 0.506551, + 0.556571, 0.163269, 0.505230, + 0.575490, 0.169530, 0.503466, + 0.588158, 0.173652, 0.502035, + 0.607238, 0.179779, 0.499492, + 0.620005, 0.183840, 0.497524, + 0.639216, 0.189921, 0.494150, + 0.652056, 0.193986, 0.491611, + 0.671349, 0.200133, 0.487358, + 0.690661, 0.206384, 0.482558, + 0.703532, 0.210638, 0.479049, + 0.722805, 0.217194, 0.473316, + 0.735616, 0.221713, 0.469180, + 0.754737, 0.228772, 0.462509, + 0.773695, 0.236249, 0.455289, + 0.786212, 0.241514, 0.450184, + 0.804752, 0.249911, 0.442102, + 0.816914, 0.255895, 0.436461, + 0.834791, 0.265540, 0.427671, + 0.846416, 0.272473, 0.421631, + 0.863320, 0.283729, 0.412403, + 0.879464, 0.296125, 0.403118, + 0.889731, 0.305079, 0.397002, + 0.904281, 0.319610, 0.388137, + 0.913354, 0.330052, 0.382563, + 0.925937, 0.346844, 0.374959, + 0.937221, 0.364929, 0.368567, + 0.944006, 0.377643, 0.365136, + 0.953099, 0.397563, 0.361438, + 0.958464, 0.411324, 0.360014, + 0.965549, 0.432519, 0.359529, + 0.971582, 0.454210, 0.361030, + 0.975082, 0.468861, 0.363111, + 0.979645, 0.491014, 0.367783, + 0.982279, 0.505851, 0.371874, + 0.985693, 0.528148, 0.379371, + 0.987646, 0.543015, 0.385210, + 0.990138, 0.565296, 0.395122, + 0.992196, 0.587502, 0.406299, + 0.993326, 0.602275, 0.414390, + 0.994738, 0.624350, 0.427397, + 0.995480, 0.639027, 0.436607, + 0.996341, 0.660969, 0.451160, + 0.996925, 0.682828, 0.466526, + 0.997186, 0.697349, 0.477182, + 0.997351, 0.719089, 0.493755, + 0.997341, 0.733545, 0.505167, + 0.997138, 0.755190, 0.522806, + 0.996898, 0.769591, 0.534892, + 0.996369, 0.791167, 0.553499, + 0.995680, 0.812706, 0.572645, + 0.995131, 0.827052, 0.585701, + 0.994222, 0.848540, 0.605696, + 0.993545, 0.862859, 0.619299, + 0.992440, 0.884330, 0.640099, + 0.991332, 0.905763, 0.661309, + 0.990570, 0.920049, 0.675675, + 0.989434, 0.941470, 0.697519, + 0.988717, 0.955742, 0.712242, + 0.987691, 0.977154, 0.734536, + 0.987053, 0.991438, 0.749504] #=================================================================== Inferno = [ 0.001462, 0.000466, 0.013866, - 0.003299, 0.002249, 0.024239, - 0.007676, 0.006136, 0.046836, - 0.011663, 0.009417, 0.063460, - 0.019373, 0.015133, 0.088767, - 0.025793, 0.019331, 0.105930, - 0.037668, 0.025921, 0.132232, - 0.051644, 0.032474, 0.159254, - 0.061340, 0.036590, 0.177642, - 0.076637, 0.041905, 0.205799, - 0.087411, 0.044556, 0.224813, - 0.104551, 0.047008, 0.253430, - 0.122908, 0.047536, 0.281624, - 0.135778, 0.046856, 0.299776, - 0.155850, 0.044559, 0.325338, - 0.169575, 0.042489, 0.340874, - 0.190367, 0.039309, 0.361447, - 0.204209, 0.037632, 0.373238, - 0.224763, 0.036405, 0.388129, - 0.244967, 0.037055, 0.400007, - 0.258234, 0.038571, 0.406485, - 0.277850, 0.042353, 0.414392, - 0.290763, 0.045644, 0.418637, - 0.309935, 0.051407, 0.423721, - 0.328921, 0.057827, 0.427511, - 0.341500, 0.062325, 0.429425, - 0.360284, 0.069247, 0.431497, - 0.372768, 0.073915, 0.432400, - 0.391453, 0.080927, 0.433109, - 0.403894, 0.085580, 0.433179, - 0.422549, 0.092501, 0.432714, - 0.441207, 0.099338, 0.431594, - 0.453651, 0.103848, 0.430498, - 0.472328, 0.110547, 0.428334, - 0.484789, 0.114974, 0.426548, - 0.503493, 0.121575, 0.423356, - 0.522206, 0.128150, 0.419549, - 0.534683, 0.132534, 0.416667, - 0.553392, 0.139134, 0.411829, - 0.565854, 0.143567, 0.408258, - 0.584521, 0.150294, 0.402385, - 0.603139, 0.157151, 0.395891, - 0.615513, 0.161817, 0.391219, - 0.633998, 0.168992, 0.383704, - 0.646260, 0.173914, 0.378359, - 0.664540, 0.181539, 0.369846, - 0.676638, 0.186807, 0.363849, - 0.694627, 0.195021, 0.354388, - 0.712396, 0.203656, 0.344383, - 0.724103, 0.209670, 0.337424, - 0.741423, 0.219112, 0.326576, - 0.752794, 0.225706, 0.319085, - 0.769556, 0.236077, 0.307485, - 0.785929, 0.247056, 0.295477, - 0.796607, 0.254728, 0.287264, - 0.812239, 0.266786, 0.274661, - 0.822386, 0.275197, 0.266085, - 0.837165, 0.288385, 0.252988, - 0.846709, 0.297559, 0.244113, - 0.860533, 0.311892, 0.230606, - 0.873741, 0.326906, 0.216886, - 0.882188, 0.337287, 0.207628, - 0.894305, 0.353399, 0.193584, - 0.902003, 0.364492, 0.184116, - 0.912966, 0.381636, 0.169755, - 0.923215, 0.399359, 0.155193, - 0.929644, 0.411479, 0.145367, - 0.938675, 0.430091, 0.130438, - 0.944285, 0.442772, 0.120354, - 0.952075, 0.462178, 0.105031, - 0.959114, 0.482014, 0.089499, - 0.963387, 0.495462, 0.079073, - 0.969163, 0.515946, 0.063488, - 0.972590, 0.529798, 0.053324, - 0.977092, 0.550850, 0.039050, - 0.979666, 0.565057, 0.031409, - 0.982881, 0.586606, 0.024661, - 0.985315, 0.608422, 0.024202, - 0.986502, 0.623105, 0.027814, - 0.987622, 0.645320, 0.039886, - 0.987926, 0.660250, 0.051750, - 0.987714, 0.682807, 0.072489, - 0.986694, 0.705540, 0.095694, - 0.985566, 0.720782, 0.112229, - 0.983196, 0.743758, 0.138453, - 0.981173, 0.759135, 0.156863, - 0.977497, 0.782258, 0.185923, - 0.974638, 0.797692, 0.206332, - 0.969783, 0.820825, 0.238686, - 0.964394, 0.843848, 0.273391, - 0.960626, 0.859069, 0.298010, - 0.954997, 0.881569, 0.337475, - 0.951546, 0.896226, 0.365627, - 0.947594, 0.917399, 0.410665, - 0.946403, 0.937159, 0.458592, - 0.947937, 0.949318, 0.491426, - 0.954529, 0.965896, 0.540361, - 0.961812, 0.975924, 0.571925, - 0.976511, 0.989753, 0.616760, - 0.988362, 0.998364, 0.644924] + 0.003299, 0.002249, 0.024239, + 0.007676, 0.006136, 0.046836, + 0.011663, 0.009417, 0.063460, + 0.019373, 0.015133, 0.088767, + 0.025793, 0.019331, 0.105930, + 0.037668, 0.025921, 0.132232, + 0.051644, 0.032474, 0.159254, + 0.061340, 0.036590, 0.177642, + 0.076637, 0.041905, 0.205799, + 0.087411, 0.044556, 0.224813, + 0.104551, 0.047008, 0.253430, + 0.122908, 0.047536, 0.281624, + 0.135778, 0.046856, 0.299776, + 0.155850, 0.044559, 0.325338, + 0.169575, 0.042489, 0.340874, + 0.190367, 0.039309, 0.361447, + 0.204209, 0.037632, 0.373238, + 0.224763, 0.036405, 0.388129, + 0.244967, 0.037055, 0.400007, + 0.258234, 0.038571, 0.406485, + 0.277850, 0.042353, 0.414392, + 0.290763, 0.045644, 0.418637, + 0.309935, 0.051407, 0.423721, + 0.328921, 0.057827, 0.427511, + 0.341500, 0.062325, 0.429425, + 0.360284, 0.069247, 0.431497, + 0.372768, 0.073915, 0.432400, + 0.391453, 0.080927, 0.433109, + 0.403894, 0.085580, 0.433179, + 0.422549, 0.092501, 0.432714, + 0.441207, 0.099338, 0.431594, + 0.453651, 0.103848, 0.430498, + 0.472328, 0.110547, 0.428334, + 0.484789, 0.114974, 0.426548, + 0.503493, 0.121575, 0.423356, + 0.522206, 0.128150, 0.419549, + 0.534683, 0.132534, 0.416667, + 0.553392, 0.139134, 0.411829, + 0.565854, 0.143567, 0.408258, + 0.584521, 0.150294, 0.402385, + 0.603139, 0.157151, 0.395891, + 0.615513, 0.161817, 0.391219, + 0.633998, 0.168992, 0.383704, + 0.646260, 0.173914, 0.378359, + 0.664540, 0.181539, 0.369846, + 0.676638, 0.186807, 0.363849, + 0.694627, 0.195021, 0.354388, + 0.712396, 0.203656, 0.344383, + 0.724103, 0.209670, 0.337424, + 0.741423, 0.219112, 0.326576, + 0.752794, 0.225706, 0.319085, + 0.769556, 0.236077, 0.307485, + 0.785929, 0.247056, 0.295477, + 0.796607, 0.254728, 0.287264, + 0.812239, 0.266786, 0.274661, + 0.822386, 0.275197, 0.266085, + 0.837165, 0.288385, 0.252988, + 0.846709, 0.297559, 0.244113, + 0.860533, 0.311892, 0.230606, + 0.873741, 0.326906, 0.216886, + 0.882188, 0.337287, 0.207628, + 0.894305, 0.353399, 0.193584, + 0.902003, 0.364492, 0.184116, + 0.912966, 0.381636, 0.169755, + 0.923215, 0.399359, 0.155193, + 0.929644, 0.411479, 0.145367, + 0.938675, 0.430091, 0.130438, + 0.944285, 0.442772, 0.120354, + 0.952075, 0.462178, 0.105031, + 0.959114, 0.482014, 0.089499, + 0.963387, 0.495462, 0.079073, + 0.969163, 0.515946, 0.063488, + 0.972590, 0.529798, 0.053324, + 0.977092, 0.550850, 0.039050, + 0.979666, 0.565057, 0.031409, + 0.982881, 0.586606, 0.024661, + 0.985315, 0.608422, 0.024202, + 0.986502, 0.623105, 0.027814, + 0.987622, 0.645320, 0.039886, + 0.987926, 0.660250, 0.051750, + 0.987714, 0.682807, 0.072489, + 0.986694, 0.705540, 0.095694, + 0.985566, 0.720782, 0.112229, + 0.983196, 0.743758, 0.138453, + 0.981173, 0.759135, 0.156863, + 0.977497, 0.782258, 0.185923, + 0.974638, 0.797692, 0.206332, + 0.969783, 0.820825, 0.238686, + 0.964394, 0.843848, 0.273391, + 0.960626, 0.859069, 0.298010, + 0.954997, 0.881569, 0.337475, + 0.951546, 0.896226, 0.365627, + 0.947594, 0.917399, 0.410665, + 0.946403, 0.937159, 0.458592, + 0.947937, 0.949318, 0.491426, + 0.954529, 0.965896, 0.540361, + 0.961812, 0.975924, 0.571925, + 0.976511, 0.989753, 0.616760, + 0.988362, 0.998364, 0.644924] #=============================================================== Viridis = [ 0.267004, 0.004874, 0.329415, - 0.269944, 0.014625, 0.341379, - 0.273809, 0.031497, 0.358853, - 0.276022, 0.044167, 0.370164, - 0.278791, 0.062145, 0.386592, - 0.280267, 0.073417, 0.397163, - 0.281924, 0.089666, 0.412415, - 0.282910, 0.105393, 0.426902, - 0.283197, 0.115680, 0.436115, - 0.283072, 0.130895, 0.449241, - 0.282623, 0.140926, 0.457517, - 0.281412, 0.155834, 0.469201, - 0.279574, 0.170599, 0.479997, - 0.278012, 0.180367, 0.486697, - 0.275191, 0.194905, 0.496005, - 0.273006, 0.204520, 0.501721, - 0.269308, 0.218818, 0.509577, - 0.266580, 0.228262, 0.514349, - 0.262138, 0.242286, 0.520837, - 0.257322, 0.256130, 0.526563, - 0.253935, 0.265254, 0.529983, - 0.248629, 0.278775, 0.534556, - 0.244972, 0.287675, 0.537260, - 0.239346, 0.300855, 0.540844, - 0.233603, 0.313828, 0.543914, - 0.229739, 0.322361, 0.545706, - 0.223925, 0.334994, 0.548053, - 0.220057, 0.343307, 0.549413, - 0.214298, 0.355619, 0.551184, - 0.210503, 0.363727, 0.552206, - 0.204903, 0.375746, 0.553533, - 0.199430, 0.387607, 0.554642, - 0.195860, 0.395433, 0.555276, - 0.190631, 0.407061, 0.556089, - 0.187231, 0.414746, 0.556547, - 0.182256, 0.426184, 0.557120, - 0.177423, 0.437527, 0.557565, - 0.174274, 0.445044, 0.557792, - 0.169646, 0.456262, 0.558030, - 0.166617, 0.463708, 0.558119, - 0.162142, 0.474838, 0.558140, - 0.157729, 0.485932, 0.558013, - 0.154815, 0.493313, 0.557840, - 0.150476, 0.504369, 0.557430, - 0.147607, 0.511733, 0.557049, - 0.143343, 0.522773, 0.556295, - 0.140536, 0.530132, 0.555659, - 0.136408, 0.541173, 0.554483, - 0.132444, 0.552216, 0.553018, - 0.129933, 0.559582, 0.551864, - 0.126453, 0.570633, 0.549841, - 0.124395, 0.578002, 0.548287, - 0.121831, 0.589055, 0.545623, - 0.120092, 0.600104, 0.542530, - 0.119512, 0.607464, 0.540218, - 0.119699, 0.618490, 0.536347, - 0.120638, 0.625828, 0.533488, - 0.123444, 0.636809, 0.528763, - 0.126326, 0.644107, 0.525311, - 0.132268, 0.655014, 0.519661, - 0.140210, 0.665859, 0.513427, - 0.146616, 0.673050, 0.508936, - 0.157851, 0.683765, 0.501686, - 0.166383, 0.690856, 0.496502, - 0.180653, 0.701402, 0.488189, - 0.196571, 0.711827, 0.479221, - 0.208030, 0.718701, 0.472873, - 0.226397, 0.728888, 0.462789, - 0.239374, 0.735588, 0.455688, - 0.259857, 0.745492, 0.444467, - 0.281477, 0.755203, 0.432552, - 0.296479, 0.761561, 0.424223, - 0.319809, 0.770914, 0.411152, - 0.335885, 0.777018, 0.402049, - 0.360741, 0.785964, 0.387814, - 0.377779, 0.791781, 0.377939, - 0.404001, 0.800275, 0.362552, - 0.430983, 0.808473, 0.346476, - 0.449368, 0.813768, 0.335384, - 0.477504, 0.821444, 0.318195, - 0.496615, 0.826376, 0.306377, - 0.525776, 0.833491, 0.288127, - 0.555484, 0.840254, 0.269281, - 0.575563, 0.844566, 0.256415, - 0.606045, 0.850733, 0.236712, - 0.626579, 0.854645, 0.223353, - 0.657642, 0.860219, 0.203082, - 0.678489, 0.863742, 0.189503, - 0.709898, 0.868751, 0.169257, - 0.741388, 0.873449, 0.149561, - 0.762373, 0.876424, 0.137064, - 0.793760, 0.880678, 0.120005, - 0.814576, 0.883393, 0.110347, - 0.845561, 0.887322, 0.099702, - 0.876168, 0.891125, 0.095250, - 0.896320, 0.893616, 0.096335, - 0.926106, 0.897330, 0.104071, - 0.945636, 0.899815, 0.112838, - 0.974417, 0.903590, 0.130215, - 0.993248, 0.906157, 0.143936] + 0.269944, 0.014625, 0.341379, + 0.273809, 0.031497, 0.358853, + 0.276022, 0.044167, 0.370164, + 0.278791, 0.062145, 0.386592, + 0.280267, 0.073417, 0.397163, + 0.281924, 0.089666, 0.412415, + 0.282910, 0.105393, 0.426902, + 0.283197, 0.115680, 0.436115, + 0.283072, 0.130895, 0.449241, + 0.282623, 0.140926, 0.457517, + 0.281412, 0.155834, 0.469201, + 0.279574, 0.170599, 0.479997, + 0.278012, 0.180367, 0.486697, + 0.275191, 0.194905, 0.496005, + 0.273006, 0.204520, 0.501721, + 0.269308, 0.218818, 0.509577, + 0.266580, 0.228262, 0.514349, + 0.262138, 0.242286, 0.520837, + 0.257322, 0.256130, 0.526563, + 0.253935, 0.265254, 0.529983, + 0.248629, 0.278775, 0.534556, + 0.244972, 0.287675, 0.537260, + 0.239346, 0.300855, 0.540844, + 0.233603, 0.313828, 0.543914, + 0.229739, 0.322361, 0.545706, + 0.223925, 0.334994, 0.548053, + 0.220057, 0.343307, 0.549413, + 0.214298, 0.355619, 0.551184, + 0.210503, 0.363727, 0.552206, + 0.204903, 0.375746, 0.553533, + 0.199430, 0.387607, 0.554642, + 0.195860, 0.395433, 0.555276, + 0.190631, 0.407061, 0.556089, + 0.187231, 0.414746, 0.556547, + 0.182256, 0.426184, 0.557120, + 0.177423, 0.437527, 0.557565, + 0.174274, 0.445044, 0.557792, + 0.169646, 0.456262, 0.558030, + 0.166617, 0.463708, 0.558119, + 0.162142, 0.474838, 0.558140, + 0.157729, 0.485932, 0.558013, + 0.154815, 0.493313, 0.557840, + 0.150476, 0.504369, 0.557430, + 0.147607, 0.511733, 0.557049, + 0.143343, 0.522773, 0.556295, + 0.140536, 0.530132, 0.555659, + 0.136408, 0.541173, 0.554483, + 0.132444, 0.552216, 0.553018, + 0.129933, 0.559582, 0.551864, + 0.126453, 0.570633, 0.549841, + 0.124395, 0.578002, 0.548287, + 0.121831, 0.589055, 0.545623, + 0.120092, 0.600104, 0.542530, + 0.119512, 0.607464, 0.540218, + 0.119699, 0.618490, 0.536347, + 0.120638, 0.625828, 0.533488, + 0.123444, 0.636809, 0.528763, + 0.126326, 0.644107, 0.525311, + 0.132268, 0.655014, 0.519661, + 0.140210, 0.665859, 0.513427, + 0.146616, 0.673050, 0.508936, + 0.157851, 0.683765, 0.501686, + 0.166383, 0.690856, 0.496502, + 0.180653, 0.701402, 0.488189, + 0.196571, 0.711827, 0.479221, + 0.208030, 0.718701, 0.472873, + 0.226397, 0.728888, 0.462789, + 0.239374, 0.735588, 0.455688, + 0.259857, 0.745492, 0.444467, + 0.281477, 0.755203, 0.432552, + 0.296479, 0.761561, 0.424223, + 0.319809, 0.770914, 0.411152, + 0.335885, 0.777018, 0.402049, + 0.360741, 0.785964, 0.387814, + 0.377779, 0.791781, 0.377939, + 0.404001, 0.800275, 0.362552, + 0.430983, 0.808473, 0.346476, + 0.449368, 0.813768, 0.335384, + 0.477504, 0.821444, 0.318195, + 0.496615, 0.826376, 0.306377, + 0.525776, 0.833491, 0.288127, + 0.555484, 0.840254, 0.269281, + 0.575563, 0.844566, 0.256415, + 0.606045, 0.850733, 0.236712, + 0.626579, 0.854645, 0.223353, + 0.657642, 0.860219, 0.203082, + 0.678489, 0.863742, 0.189503, + 0.709898, 0.868751, 0.169257, + 0.741388, 0.873449, 0.149561, + 0.762373, 0.876424, 0.137064, + 0.793760, 0.880678, 0.120005, + 0.814576, 0.883393, 0.110347, + 0.845561, 0.887322, 0.099702, + 0.876168, 0.891125, 0.095250, + 0.896320, 0.893616, 0.096335, + 0.926106, 0.897330, 0.104071, + 0.945636, 0.899815, 0.112838, + 0.974417, 0.903590, 0.130215, + 0.993248, 0.906157, 0.143936] #======================================================================= Plasma = [ 0.050383, 0.029803, 0.527975, - 0.075353, 0.027206, 0.538007, - 0.105980, 0.024309, 0.551368, - 0.123903, 0.022878, 0.559423, - 0.148607, 0.021154, 0.570562, - 0.164070, 0.020171, 0.577478, - 0.186213, 0.018803, 0.587228, - 0.207435, 0.017442, 0.596333, - 0.221197, 0.016497, 0.602083, - 0.241396, 0.014979, 0.610259, - 0.254627, 0.013882, 0.615419, - 0.274191, 0.012109, 0.622722, - 0.293478, 0.010213, 0.629490, - 0.306210, 0.008902, 0.633694, - 0.325150, 0.006915, 0.639512, - 0.337683, 0.005618, 0.643049, - 0.356359, 0.003798, 0.647810, - 0.368733, 0.002724, 0.650601, - 0.387183, 0.001434, 0.654177, - 0.405503, 0.000678, 0.656977, - 0.417642, 0.000564, 0.658390, - 0.435734, 0.001127, 0.659797, - 0.447714, 0.002080, 0.660240, - 0.465550, 0.004545, 0.660139, - 0.483210, 0.008460, 0.659095, - 0.494877, 0.011990, 0.657865, - 0.512206, 0.018833, 0.655209, - 0.523633, 0.024532, 0.652901, - 0.540570, 0.034950, 0.648640, - 0.551715, 0.043136, 0.645277, - 0.568201, 0.055778, 0.639477, - 0.584391, 0.068579, 0.632812, - 0.595011, 0.077190, 0.627917, - 0.610667, 0.090204, 0.619951, - 0.620919, 0.098934, 0.614257, - 0.636008, 0.112092, 0.605205, - 0.650746, 0.125309, 0.595617, - 0.660374, 0.134144, 0.588971, - 0.674522, 0.147419, 0.578688, - 0.683758, 0.156278, 0.571660, - 0.697324, 0.169573, 0.560919, - 0.710549, 0.182868, 0.550004, - 0.719181, 0.191729, 0.542663, - 0.731862, 0.205013, 0.531601, - 0.740143, 0.213864, 0.524216, - 0.752312, 0.227133, 0.513149, - 0.760264, 0.235976, 0.505794, - 0.771958, 0.249237, 0.494813, - 0.783383, 0.262500, 0.483918, - 0.790855, 0.271345, 0.476706, - 0.801855, 0.284626, 0.465971, - 0.809052, 0.293491, 0.458870, - 0.819651, 0.306812, 0.448306, - 0.830018, 0.320172, 0.437836, - 0.836801, 0.329105, 0.430905, - 0.846788, 0.342551, 0.420579, - 0.853319, 0.351553, 0.413734, - 0.862927, 0.365119, 0.403519, - 0.869203, 0.374212, 0.396738, - 0.878423, 0.387932, 0.386600, - 0.887402, 0.401762, 0.376494, - 0.893250, 0.411048, 0.369768, - 0.901807, 0.425087, 0.359688, - 0.907365, 0.434524, 0.352970, - 0.915471, 0.448807, 0.342890, - 0.923287, 0.463251, 0.332801, - 0.928329, 0.472975, 0.326067, - 0.935630, 0.487712, 0.315952, - 0.940313, 0.497642, 0.309197, - 0.947051, 0.512699, 0.299049, - 0.953428, 0.527960, 0.288883, - 0.957469, 0.538250, 0.282096, - 0.963203, 0.553865, 0.271909, - 0.966798, 0.564396, 0.265118, - 0.971835, 0.580382, 0.254931, - 0.974947, 0.591165, 0.248151, - 0.979233, 0.607532, 0.238013, - 0.983041, 0.624131, 0.227937, - 0.985301, 0.635330, 0.221265, - 0.988260, 0.652325, 0.211364, - 0.989935, 0.663787, 0.204859, - 0.991985, 0.681179, 0.195295, - 0.993456, 0.698810, 0.186041, - 0.994103, 0.710698, 0.180097, - 0.994553, 0.728728, 0.171622, - 0.994495, 0.740880, 0.166335, - 0.993851, 0.759304, 0.159092, - 0.993033, 0.771720, 0.154808, - 0.991209, 0.790537, 0.149377, - 0.988648, 0.809579, 0.145357, - 0.986509, 0.822401, 0.143557, - 0.982653, 0.841812, 0.142303, - 0.979644, 0.854866, 0.142453, - 0.974443, 0.874622, 0.144061, - 0.968443, 0.894564, 0.147014, - 0.964021, 0.907950, 0.149370, - 0.956808, 0.928152, 0.152409, - 0.951726, 0.941671, 0.152925, - 0.944152, 0.961916, 0.146861, - 0.940015, 0.975158, 0.131326] + 0.075353, 0.027206, 0.538007, + 0.105980, 0.024309, 0.551368, + 0.123903, 0.022878, 0.559423, + 0.148607, 0.021154, 0.570562, + 0.164070, 0.020171, 0.577478, + 0.186213, 0.018803, 0.587228, + 0.207435, 0.017442, 0.596333, + 0.221197, 0.016497, 0.602083, + 0.241396, 0.014979, 0.610259, + 0.254627, 0.013882, 0.615419, + 0.274191, 0.012109, 0.622722, + 0.293478, 0.010213, 0.629490, + 0.306210, 0.008902, 0.633694, + 0.325150, 0.006915, 0.639512, + 0.337683, 0.005618, 0.643049, + 0.356359, 0.003798, 0.647810, + 0.368733, 0.002724, 0.650601, + 0.387183, 0.001434, 0.654177, + 0.405503, 0.000678, 0.656977, + 0.417642, 0.000564, 0.658390, + 0.435734, 0.001127, 0.659797, + 0.447714, 0.002080, 0.660240, + 0.465550, 0.004545, 0.660139, + 0.483210, 0.008460, 0.659095, + 0.494877, 0.011990, 0.657865, + 0.512206, 0.018833, 0.655209, + 0.523633, 0.024532, 0.652901, + 0.540570, 0.034950, 0.648640, + 0.551715, 0.043136, 0.645277, + 0.568201, 0.055778, 0.639477, + 0.584391, 0.068579, 0.632812, + 0.595011, 0.077190, 0.627917, + 0.610667, 0.090204, 0.619951, + 0.620919, 0.098934, 0.614257, + 0.636008, 0.112092, 0.605205, + 0.650746, 0.125309, 0.595617, + 0.660374, 0.134144, 0.588971, + 0.674522, 0.147419, 0.578688, + 0.683758, 0.156278, 0.571660, + 0.697324, 0.169573, 0.560919, + 0.710549, 0.182868, 0.550004, + 0.719181, 0.191729, 0.542663, + 0.731862, 0.205013, 0.531601, + 0.740143, 0.213864, 0.524216, + 0.752312, 0.227133, 0.513149, + 0.760264, 0.235976, 0.505794, + 0.771958, 0.249237, 0.494813, + 0.783383, 0.262500, 0.483918, + 0.790855, 0.271345, 0.476706, + 0.801855, 0.284626, 0.465971, + 0.809052, 0.293491, 0.458870, + 0.819651, 0.306812, 0.448306, + 0.830018, 0.320172, 0.437836, + 0.836801, 0.329105, 0.430905, + 0.846788, 0.342551, 0.420579, + 0.853319, 0.351553, 0.413734, + 0.862927, 0.365119, 0.403519, + 0.869203, 0.374212, 0.396738, + 0.878423, 0.387932, 0.386600, + 0.887402, 0.401762, 0.376494, + 0.893250, 0.411048, 0.369768, + 0.901807, 0.425087, 0.359688, + 0.907365, 0.434524, 0.352970, + 0.915471, 0.448807, 0.342890, + 0.923287, 0.463251, 0.332801, + 0.928329, 0.472975, 0.326067, + 0.935630, 0.487712, 0.315952, + 0.940313, 0.497642, 0.309197, + 0.947051, 0.512699, 0.299049, + 0.953428, 0.527960, 0.288883, + 0.957469, 0.538250, 0.282096, + 0.963203, 0.553865, 0.271909, + 0.966798, 0.564396, 0.265118, + 0.971835, 0.580382, 0.254931, + 0.974947, 0.591165, 0.248151, + 0.979233, 0.607532, 0.238013, + 0.983041, 0.624131, 0.227937, + 0.985301, 0.635330, 0.221265, + 0.988260, 0.652325, 0.211364, + 0.989935, 0.663787, 0.204859, + 0.991985, 0.681179, 0.195295, + 0.993456, 0.698810, 0.186041, + 0.994103, 0.710698, 0.180097, + 0.994553, 0.728728, 0.171622, + 0.994495, 0.740880, 0.166335, + 0.993851, 0.759304, 0.159092, + 0.993033, 0.771720, 0.154808, + 0.991209, 0.790537, 0.149377, + 0.988648, 0.809579, 0.145357, + 0.986509, 0.822401, 0.143557, + 0.982653, 0.841812, 0.142303, + 0.979644, 0.854866, 0.142453, + 0.974443, 0.874622, 0.144061, + 0.968443, 0.894564, 0.147014, + 0.964021, 0.907950, 0.149370, + 0.956808, 0.928152, 0.152409, + 0.951726, 0.941671, 0.152925, + 0.944152, 0.961916, 0.146861, + 0.940015, 0.975158, 0.131326] #============================================================ # coolwarm Diverging = [0.229806, 0.298718, 0.753683, - 0.241580, 0.316294, 0.769128, - 0.253355, 0.333871, 0.784574, - 0.265130, 0.351447, 0.800019, - 0.277258, 0.368749, 0.814207, - 0.289423, 0.386023, 0.828265, - 0.301588, 0.403296, 0.842323, - 0.314094, 0.420250, 0.855140, - 0.326680, 0.437130, 0.867671, - 0.339265, 0.454010, 0.880202, - 0.352146, 0.470527, 0.891546, - 0.365143, 0.486903, 0.902427, - 0.378140, 0.503278, 0.913308, - 0.391368, 0.519263, 0.923091, - 0.404736, 0.535014, 0.932217, - 0.418104, 0.550765, 0.941342, - 0.431633, 0.566118, 0.949489, - 0.445305, 0.581121, 0.956773, - 0.458977, 0.596124, 0.964058, - 0.472743, 0.610745, 0.970507, - 0.486632, 0.624876, 0.975883, - 0.500521, 0.639007, 0.981260, - 0.514448, 0.652797, 0.985965, - 0.528450, 0.665936, 0.989387, - 0.542452, 0.679075, 0.992809, - 0.556453, 0.691937, 0.995736, - 0.570452, 0.703968, 0.997178, - 0.584451, 0.715998, 0.998620, - 0.598430, 0.727839, 0.999751, - 0.612301, 0.738651, 0.999206, - 0.626172, 0.749463, 0.998662, - 0.640027, 0.760193, 0.997994, - 0.653640, 0.769685, 0.995477, - 0.667253, 0.779176, 0.992959, - 0.680866, 0.788668, 0.990442, - 0.694099, 0.796789, 0.986046, - 0.707320, 0.804866, 0.981589, - 0.720541, 0.812943, 0.977132, - 0.733300, 0.819708, 0.971023, - 0.745994, 0.826286, 0.964678, - 0.758688, 0.832864, 0.958333, - 0.770866, 0.838213, 0.950567, - 0.782898, 0.843217, 0.942404, - 0.794931, 0.848222, 0.934240, - 0.806419, 0.852102, 0.924884, - 0.817660, 0.855471, 0.914987, - 0.828900, 0.858839, 0.905090, - 0.839594, 0.861206, 0.894222, - 0.849915, 0.862888, 0.882692, - 0.860235, 0.864569, 0.871161, - 0.870630, 0.862748, 0.858201, - 0.881100, 0.857423, 0.843813, - 0.891571, 0.852099, 0.829424, - 0.901246, 0.846107, 0.814791, - 0.909760, 0.839141, 0.799802, - 0.918274, 0.832174, 0.784813, - 0.926182, 0.824712, 0.769683, - 0.932757, 0.816161, 0.754241, - 0.939332, 0.807609, 0.738800, - 0.945486, 0.798724, 0.723291, - 0.950135, 0.788652, 0.707540, - 0.954785, 0.778581, 0.691790, - 0.959195, 0.768328, 0.676018, - 0.961935, 0.756810, 0.660097, - 0.964674, 0.745291, 0.644175, - 0.967355, 0.733730, 0.628253, - 0.968203, 0.720844, 0.612293, - 0.969052, 0.707958, 0.596333, - 0.969901, 0.695072, 0.580373, - 0.969002, 0.680980, 0.564493, - 0.967986, 0.666808, 0.548619, - 0.966970, 0.652636, 0.532744, - 0.964409, 0.637445, 0.517040, - 0.961562, 0.622066, 0.501367, - 0.958715, 0.606687, 0.485694, - 0.954526, 0.590457, 0.470253, - 0.949890, 0.573942, 0.454889, - 0.945254, 0.557428, 0.439525, - 0.939479, 0.540203, 0.424428, - 0.933106, 0.522605, 0.409471, - 0.926733, 0.505007, 0.394514, - 0.919418, 0.486809, 0.379836, - 0.911370, 0.468142, 0.365374, - 0.903322, 0.449476, 0.350912, - 0.894522, 0.430280, 0.336720, - 0.884871, 0.410483, 0.322833, - 0.875219, 0.390686, 0.308946, - 0.864997, 0.370381, 0.295302, - 0.853824, 0.349229, 0.282060, - 0.842651, 0.328077, 0.268819, - 0.831076, 0.306366, 0.255776, - 0.818474, 0.283226, 0.243243, - 0.805871, 0.260085, 0.230709, - 0.793020, 0.236191, 0.218319, - 0.779090, 0.209027, 0.206550, - 0.765159, 0.181863, 0.194781, - 0.751115, 0.152952, 0.183088, - 0.735968, 0.107154, 0.172137, - 0.720820, 0.061355, 0.161185, - 0.705673, 0.015556, 0.150233] + 0.241580, 0.316294, 0.769128, + 0.253355, 0.333871, 0.784574, + 0.265130, 0.351447, 0.800019, + 0.277258, 0.368749, 0.814207, + 0.289423, 0.386023, 0.828265, + 0.301588, 0.403296, 0.842323, + 0.314094, 0.420250, 0.855140, + 0.326680, 0.437130, 0.867671, + 0.339265, 0.454010, 0.880202, + 0.352146, 0.470527, 0.891546, + 0.365143, 0.486903, 0.902427, + 0.378140, 0.503278, 0.913308, + 0.391368, 0.519263, 0.923091, + 0.404736, 0.535014, 0.932217, + 0.418104, 0.550765, 0.941342, + 0.431633, 0.566118, 0.949489, + 0.445305, 0.581121, 0.956773, + 0.458977, 0.596124, 0.964058, + 0.472743, 0.610745, 0.970507, + 0.486632, 0.624876, 0.975883, + 0.500521, 0.639007, 0.981260, + 0.514448, 0.652797, 0.985965, + 0.528450, 0.665936, 0.989387, + 0.542452, 0.679075, 0.992809, + 0.556453, 0.691937, 0.995736, + 0.570452, 0.703968, 0.997178, + 0.584451, 0.715998, 0.998620, + 0.598430, 0.727839, 0.999751, + 0.612301, 0.738651, 0.999206, + 0.626172, 0.749463, 0.998662, + 0.640027, 0.760193, 0.997994, + 0.653640, 0.769685, 0.995477, + 0.667253, 0.779176, 0.992959, + 0.680866, 0.788668, 0.990442, + 0.694099, 0.796789, 0.986046, + 0.707320, 0.804866, 0.981589, + 0.720541, 0.812943, 0.977132, + 0.733300, 0.819708, 0.971023, + 0.745994, 0.826286, 0.964678, + 0.758688, 0.832864, 0.958333, + 0.770866, 0.838213, 0.950567, + 0.782898, 0.843217, 0.942404, + 0.794931, 0.848222, 0.934240, + 0.806419, 0.852102, 0.924884, + 0.817660, 0.855471, 0.914987, + 0.828900, 0.858839, 0.905090, + 0.839594, 0.861206, 0.894222, + 0.849915, 0.862888, 0.882692, + 0.860235, 0.864569, 0.871161, + 0.870630, 0.862748, 0.858201, + 0.881100, 0.857423, 0.843813, + 0.891571, 0.852099, 0.829424, + 0.901246, 0.846107, 0.814791, + 0.909760, 0.839141, 0.799802, + 0.918274, 0.832174, 0.784813, + 0.926182, 0.824712, 0.769683, + 0.932757, 0.816161, 0.754241, + 0.939332, 0.807609, 0.738800, + 0.945486, 0.798724, 0.723291, + 0.950135, 0.788652, 0.707540, + 0.954785, 0.778581, 0.691790, + 0.959195, 0.768328, 0.676018, + 0.961935, 0.756810, 0.660097, + 0.964674, 0.745291, 0.644175, + 0.967355, 0.733730, 0.628253, + 0.968203, 0.720844, 0.612293, + 0.969052, 0.707958, 0.596333, + 0.969901, 0.695072, 0.580373, + 0.969002, 0.680980, 0.564493, + 0.967986, 0.666808, 0.548619, + 0.966970, 0.652636, 0.532744, + 0.964409, 0.637445, 0.517040, + 0.961562, 0.622066, 0.501367, + 0.958715, 0.606687, 0.485694, + 0.954526, 0.590457, 0.470253, + 0.949890, 0.573942, 0.454889, + 0.945254, 0.557428, 0.439525, + 0.939479, 0.540203, 0.424428, + 0.933106, 0.522605, 0.409471, + 0.926733, 0.505007, 0.394514, + 0.919418, 0.486809, 0.379836, + 0.911370, 0.468142, 0.365374, + 0.903322, 0.449476, 0.350912, + 0.894522, 0.430280, 0.336720, + 0.884871, 0.410483, 0.322833, + 0.875219, 0.390686, 0.308946, + 0.864997, 0.370381, 0.295302, + 0.853824, 0.349229, 0.282060, + 0.842651, 0.328077, 0.268819, + 0.831076, 0.306366, 0.255776, + 0.818474, 0.283226, 0.243243, + 0.805871, 0.260085, 0.230709, + 0.793020, 0.236191, 0.218319, + 0.779090, 0.209027, 0.206550, + 0.765159, 0.181863, 0.194781, + 0.751115, 0.152952, 0.183088, + 0.735968, 0.107154, 0.172137, + 0.720820, 0.061355, 0.161185, + 0.705673, 0.015556, 0.150233] Greys = [ 1.000000, 1.000000, 1.000000, - 0.995247, 0.995247, 0.995247, - 0.990493, 0.990493, 0.990493, - 0.985740, 0.985740, 0.985740, - 0.980986, 0.980986, 0.980986, - 0.976233, 0.976233, 0.976233, - 0.971480, 0.971480, 0.971480, - 0.966726, 0.966726, 0.966726, - 0.961973, 0.961973, 0.961973, - 0.957219, 0.957219, 0.957219, - 0.952466, 0.952466, 0.952466, - 0.947712, 0.947712, 0.947712, - 0.942959, 0.942959, 0.942959, - 0.936621, 0.936621, 0.936621, - 0.929333, 0.929333, 0.929333, - 0.922044, 0.922044, 0.922044, - 0.914755, 0.914755, 0.914755, - 0.907467, 0.907467, 0.907467, - 0.900178, 0.900178, 0.900178, - 0.892890, 0.892890, 0.892890, - 0.885601, 0.885601, 0.885601, - 0.878313, 0.878313, 0.878313, - 0.871024, 0.871024, 0.871024, - 0.863735, 0.863735, 0.863735, - 0.856447, 0.856447, 0.856447, - 0.848762, 0.848762, 0.848762, - 0.839889, 0.839889, 0.839889, - 0.831016, 0.831016, 0.831016, - 0.822143, 0.822143, 0.822143, - 0.813270, 0.813270, 0.813270, - 0.804397, 0.804397, 0.804397, - 0.795524, 0.795524, 0.795524, - 0.786651, 0.786651, 0.786651, - 0.777778, 0.777778, 0.777778, - 0.768905, 0.768905, 0.768905, - 0.760032, 0.760032, 0.760032, - 0.751159, 0.751159, 0.751159, - 0.742286, 0.742286, 0.742286, - 0.730362, 0.730362, 0.730362, - 0.718004, 0.718004, 0.718004, - 0.705645, 0.705645, 0.705645, - 0.693286, 0.693286, 0.693286, - 0.680927, 0.680927, 0.680927, - 0.668568, 0.668568, 0.668568, - 0.656209, 0.656209, 0.656209, - 0.643850, 0.643850, 0.643850, - 0.631491, 0.631491, 0.631491, - 0.619133, 0.619133, 0.619133, - 0.606774, 0.606774, 0.606774, - 0.594415, 0.594415, 0.594415, - 0.582690, 0.582690, 0.582690, - 0.571598, 0.571598, 0.571598, - 0.560507, 0.560507, 0.560507, - 0.549416, 0.549416, 0.549416, - 0.538324, 0.538324, 0.538324, - 0.527233, 0.527233, 0.527233, - 0.516142, 0.516142, 0.516142, - 0.505051, 0.505051, 0.505051, - 0.493959, 0.493959, 0.493959, - 0.482868, 0.482868, 0.482868, - 0.471777, 0.471777, 0.471777, - 0.460685, 0.460685, 0.460685, - 0.449673, 0.449673, 0.449673, - 0.439216, 0.439216, 0.439216, - 0.428758, 0.428758, 0.428758, - 0.418301, 0.418301, 0.418301, - 0.407843, 0.407843, 0.407843, - 0.397386, 0.397386, 0.397386, - 0.386928, 0.386928, 0.386928, - 0.376471, 0.376471, 0.376471, - 0.366013, 0.366013, 0.366013, - 0.355556, 0.355556, 0.355556, - 0.345098, 0.345098, 0.345098, - 0.334641, 0.334641, 0.334641, - 0.324183, 0.324183, 0.324183, - 0.310873, 0.310873, 0.310873, - 0.296613, 0.296613, 0.296613, - 0.282353, 0.282353, 0.282353, - 0.268093, 0.268093, 0.268093, - 0.253832, 0.253832, 0.253832, - 0.239572, 0.239572, 0.239572, - 0.225312, 0.225312, 0.225312, - 0.211052, 0.211052, 0.211052, - 0.196791, 0.196791, 0.196791, - 0.182531, 0.182531, 0.182531, - 0.168271, 0.168271, 0.168271, - 0.154011, 0.154011, 0.154011, - 0.140701, 0.140701, 0.140701, - 0.128976, 0.128976, 0.128976, - 0.117251, 0.117251, 0.117251, - 0.105526, 0.105526, 0.105526, - 0.093801, 0.093801, 0.093801, - 0.082076, 0.082076, 0.082076, - 0.070351, 0.070351, 0.070351, - 0.058625, 0.058625, 0.058625, - 0.046900, 0.046900, 0.046900, - 0.035175, 0.035175, 0.035175, - 0.023450, 0.023450, 0.023450, - 0.011725, 0.011725, 0.011725, - 0.000000, 0.000000, 0.000000] + 0.995247, 0.995247, 0.995247, + 0.990493, 0.990493, 0.990493, + 0.985740, 0.985740, 0.985740, + 0.980986, 0.980986, 0.980986, + 0.976233, 0.976233, 0.976233, + 0.971480, 0.971480, 0.971480, + 0.966726, 0.966726, 0.966726, + 0.961973, 0.961973, 0.961973, + 0.957219, 0.957219, 0.957219, + 0.952466, 0.952466, 0.952466, + 0.947712, 0.947712, 0.947712, + 0.942959, 0.942959, 0.942959, + 0.936621, 0.936621, 0.936621, + 0.929333, 0.929333, 0.929333, + 0.922044, 0.922044, 0.922044, + 0.914755, 0.914755, 0.914755, + 0.907467, 0.907467, 0.907467, + 0.900178, 0.900178, 0.900178, + 0.892890, 0.892890, 0.892890, + 0.885601, 0.885601, 0.885601, + 0.878313, 0.878313, 0.878313, + 0.871024, 0.871024, 0.871024, + 0.863735, 0.863735, 0.863735, + 0.856447, 0.856447, 0.856447, + 0.848762, 0.848762, 0.848762, + 0.839889, 0.839889, 0.839889, + 0.831016, 0.831016, 0.831016, + 0.822143, 0.822143, 0.822143, + 0.813270, 0.813270, 0.813270, + 0.804397, 0.804397, 0.804397, + 0.795524, 0.795524, 0.795524, + 0.786651, 0.786651, 0.786651, + 0.777778, 0.777778, 0.777778, + 0.768905, 0.768905, 0.768905, + 0.760032, 0.760032, 0.760032, + 0.751159, 0.751159, 0.751159, + 0.742286, 0.742286, 0.742286, + 0.730362, 0.730362, 0.730362, + 0.718004, 0.718004, 0.718004, + 0.705645, 0.705645, 0.705645, + 0.693286, 0.693286, 0.693286, + 0.680927, 0.680927, 0.680927, + 0.668568, 0.668568, 0.668568, + 0.656209, 0.656209, 0.656209, + 0.643850, 0.643850, 0.643850, + 0.631491, 0.631491, 0.631491, + 0.619133, 0.619133, 0.619133, + 0.606774, 0.606774, 0.606774, + 0.594415, 0.594415, 0.594415, + 0.582690, 0.582690, 0.582690, + 0.571598, 0.571598, 0.571598, + 0.560507, 0.560507, 0.560507, + 0.549416, 0.549416, 0.549416, + 0.538324, 0.538324, 0.538324, + 0.527233, 0.527233, 0.527233, + 0.516142, 0.516142, 0.516142, + 0.505051, 0.505051, 0.505051, + 0.493959, 0.493959, 0.493959, + 0.482868, 0.482868, 0.482868, + 0.471777, 0.471777, 0.471777, + 0.460685, 0.460685, 0.460685, + 0.449673, 0.449673, 0.449673, + 0.439216, 0.439216, 0.439216, + 0.428758, 0.428758, 0.428758, + 0.418301, 0.418301, 0.418301, + 0.407843, 0.407843, 0.407843, + 0.397386, 0.397386, 0.397386, + 0.386928, 0.386928, 0.386928, + 0.376471, 0.376471, 0.376471, + 0.366013, 0.366013, 0.366013, + 0.355556, 0.355556, 0.355556, + 0.345098, 0.345098, 0.345098, + 0.334641, 0.334641, 0.334641, + 0.324183, 0.324183, 0.324183, + 0.310873, 0.310873, 0.310873, + 0.296613, 0.296613, 0.296613, + 0.282353, 0.282353, 0.282353, + 0.268093, 0.268093, 0.268093, + 0.253832, 0.253832, 0.253832, + 0.239572, 0.239572, 0.239572, + 0.225312, 0.225312, 0.225312, + 0.211052, 0.211052, 0.211052, + 0.196791, 0.196791, 0.196791, + 0.182531, 0.182531, 0.182531, + 0.168271, 0.168271, 0.168271, + 0.154011, 0.154011, 0.154011, + 0.140701, 0.140701, 0.140701, + 0.128976, 0.128976, 0.128976, + 0.117251, 0.117251, 0.117251, + 0.105526, 0.105526, 0.105526, + 0.093801, 0.093801, 0.093801, + 0.082076, 0.082076, 0.082076, + 0.070351, 0.070351, 0.070351, + 0.058625, 0.058625, 0.058625, + 0.046900, 0.046900, 0.046900, + 0.035175, 0.035175, 0.035175, + 0.023450, 0.023450, 0.023450, + 0.011725, 0.011725, 0.011725, + 0.000000, 0.000000, 0.000000] Greens = [ 0.968627, 0.988235, 0.960784, - 0.962923, 0.986017, 0.954130, - 0.957219, 0.983799, 0.947475, - 0.951515, 0.981581, 0.940820, - 0.945811, 0.979362, 0.934165, - 0.940107, 0.977144, 0.927510, - 0.934403, 0.974926, 0.920856, - 0.928699, 0.972707, 0.914201, - 0.922995, 0.970489, 0.907546, - 0.917291, 0.968271, 0.900891, - 0.911586, 0.966053, 0.894236, - 0.905882, 0.963834, 0.887582, - 0.900178, 0.961616, 0.880927, - 0.892097, 0.958408, 0.872093, - 0.882591, 0.954605, 0.861953, - 0.873084, 0.950802, 0.851812, - 0.863577, 0.946999, 0.841672, - 0.854070, 0.943197, 0.831531, - 0.844563, 0.939394, 0.821390, - 0.835056, 0.935591, 0.811250, - 0.825550, 0.931788, 0.801109, - 0.816043, 0.927986, 0.790969, - 0.806536, 0.924183, 0.780828, - 0.797029, 0.920380, 0.770687, - 0.787522, 0.916578, 0.760547, - 0.777382, 0.912458, 0.750010, - 0.765340, 0.907388, 0.738285, - 0.753298, 0.902317, 0.726560, - 0.741256, 0.897247, 0.714835, - 0.729214, 0.892177, 0.703110, - 0.717172, 0.887106, 0.691384, - 0.705130, 0.882036, 0.679659, - 0.693088, 0.876966, 0.667934, - 0.681046, 0.871895, 0.656209, - 0.669004, 0.866825, 0.644484, - 0.656962, 0.861755, 0.632759, - 0.644920, 0.856684, 0.621034, - 0.632878, 0.851614, 0.609309, - 0.618895, 0.845157, 0.597584, - 0.604635, 0.838503, 0.585859, - 0.590374, 0.831848, 0.574133, - 0.576114, 0.825193, 0.562408, - 0.561854, 0.818538, 0.550683, - 0.547594, 0.811884, 0.538958, - 0.533333, 0.805229, 0.527233, - 0.519073, 0.798574, 0.515508, - 0.504813, 0.791919, 0.503783, - 0.490553, 0.785264, 0.492058, - 0.476292, 0.778610, 0.480333, - 0.462032, 0.771955, 0.468608, - 0.446821, 0.764666, 0.458784, - 0.430660, 0.756744, 0.450862, - 0.414498, 0.748822, 0.442939, - 0.398336, 0.740899, 0.435017, - 0.382175, 0.732977, 0.427094, - 0.366013, 0.725054, 0.419172, - 0.349851, 0.717132, 0.411250, - 0.333690, 0.709210, 0.403327, - 0.317528, 0.701287, 0.395405, - 0.301367, 0.693365, 0.387483, - 0.285205, 0.685443, 0.379560, - 0.269043, 0.677520, 0.371638, - 0.253714, 0.669321, 0.363755, - 0.244207, 0.659180, 0.356150, - 0.234700, 0.649039, 0.348544, - 0.225193, 0.638899, 0.340939, - 0.215686, 0.628758, 0.333333, - 0.206179, 0.618618, 0.325728, - 0.196673, 0.608477, 0.318122, - 0.187166, 0.598336, 0.310517, - 0.177659, 0.588196, 0.302911, - 0.168152, 0.578055, 0.295306, - 0.158645, 0.567914, 0.287701, - 0.149138, 0.557774, 0.280095, - 0.139632, 0.547633, 0.272490, - 0.128936, 0.537968, 0.264646, - 0.117845, 0.528461, 0.256724, - 0.106754, 0.518954, 0.248802, - 0.095663, 0.509447, 0.240879, - 0.084571, 0.499941, 0.232957, - 0.073480, 0.490434, 0.225035, - 0.062389, 0.480927, 0.217112, - 0.051297, 0.471420, 0.209190, - 0.040206, 0.461913, 0.201268, - 0.029115, 0.452406, 0.193345, - 0.018023, 0.442900, 0.185423, - 0.006932, 0.433393, 0.177500, - 0.000000, 0.422579, 0.170529, - 0.000000, 0.409586, 0.165142, - 0.000000, 0.396593, 0.159754, - 0.000000, 0.383601, 0.154367, - 0.000000, 0.370608, 0.148980, - 0.000000, 0.357615, 0.143593, - 0.000000, 0.344623, 0.138206, - 0.000000, 0.331630, 0.132818, - 0.000000, 0.318637, 0.127431, - 0.000000, 0.305645, 0.122044, - 0.000000, 0.292652, 0.116657, - 0.000000, 0.279659, 0.111270, - 0.000000, 0.266667, 0.105882] + 0.962923, 0.986017, 0.954130, + 0.957219, 0.983799, 0.947475, + 0.951515, 0.981581, 0.940820, + 0.945811, 0.979362, 0.934165, + 0.940107, 0.977144, 0.927510, + 0.934403, 0.974926, 0.920856, + 0.928699, 0.972707, 0.914201, + 0.922995, 0.970489, 0.907546, + 0.917291, 0.968271, 0.900891, + 0.911586, 0.966053, 0.894236, + 0.905882, 0.963834, 0.887582, + 0.900178, 0.961616, 0.880927, + 0.892097, 0.958408, 0.872093, + 0.882591, 0.954605, 0.861953, + 0.873084, 0.950802, 0.851812, + 0.863577, 0.946999, 0.841672, + 0.854070, 0.943197, 0.831531, + 0.844563, 0.939394, 0.821390, + 0.835056, 0.935591, 0.811250, + 0.825550, 0.931788, 0.801109, + 0.816043, 0.927986, 0.790969, + 0.806536, 0.924183, 0.780828, + 0.797029, 0.920380, 0.770687, + 0.787522, 0.916578, 0.760547, + 0.777382, 0.912458, 0.750010, + 0.765340, 0.907388, 0.738285, + 0.753298, 0.902317, 0.726560, + 0.741256, 0.897247, 0.714835, + 0.729214, 0.892177, 0.703110, + 0.717172, 0.887106, 0.691384, + 0.705130, 0.882036, 0.679659, + 0.693088, 0.876966, 0.667934, + 0.681046, 0.871895, 0.656209, + 0.669004, 0.866825, 0.644484, + 0.656962, 0.861755, 0.632759, + 0.644920, 0.856684, 0.621034, + 0.632878, 0.851614, 0.609309, + 0.618895, 0.845157, 0.597584, + 0.604635, 0.838503, 0.585859, + 0.590374, 0.831848, 0.574133, + 0.576114, 0.825193, 0.562408, + 0.561854, 0.818538, 0.550683, + 0.547594, 0.811884, 0.538958, + 0.533333, 0.805229, 0.527233, + 0.519073, 0.798574, 0.515508, + 0.504813, 0.791919, 0.503783, + 0.490553, 0.785264, 0.492058, + 0.476292, 0.778610, 0.480333, + 0.462032, 0.771955, 0.468608, + 0.446821, 0.764666, 0.458784, + 0.430660, 0.756744, 0.450862, + 0.414498, 0.748822, 0.442939, + 0.398336, 0.740899, 0.435017, + 0.382175, 0.732977, 0.427094, + 0.366013, 0.725054, 0.419172, + 0.349851, 0.717132, 0.411250, + 0.333690, 0.709210, 0.403327, + 0.317528, 0.701287, 0.395405, + 0.301367, 0.693365, 0.387483, + 0.285205, 0.685443, 0.379560, + 0.269043, 0.677520, 0.371638, + 0.253714, 0.669321, 0.363755, + 0.244207, 0.659180, 0.356150, + 0.234700, 0.649039, 0.348544, + 0.225193, 0.638899, 0.340939, + 0.215686, 0.628758, 0.333333, + 0.206179, 0.618618, 0.325728, + 0.196673, 0.608477, 0.318122, + 0.187166, 0.598336, 0.310517, + 0.177659, 0.588196, 0.302911, + 0.168152, 0.578055, 0.295306, + 0.158645, 0.567914, 0.287701, + 0.149138, 0.557774, 0.280095, + 0.139632, 0.547633, 0.272490, + 0.128936, 0.537968, 0.264646, + 0.117845, 0.528461, 0.256724, + 0.106754, 0.518954, 0.248802, + 0.095663, 0.509447, 0.240879, + 0.084571, 0.499941, 0.232957, + 0.073480, 0.490434, 0.225035, + 0.062389, 0.480927, 0.217112, + 0.051297, 0.471420, 0.209190, + 0.040206, 0.461913, 0.201268, + 0.029115, 0.452406, 0.193345, + 0.018023, 0.442900, 0.185423, + 0.006932, 0.433393, 0.177500, + 0.000000, 0.422579, 0.170529, + 0.000000, 0.409586, 0.165142, + 0.000000, 0.396593, 0.159754, + 0.000000, 0.383601, 0.154367, + 0.000000, 0.370608, 0.148980, + 0.000000, 0.357615, 0.143593, + 0.000000, 0.344623, 0.138206, + 0.000000, 0.331630, 0.132818, + 0.000000, 0.318637, 0.127431, + 0.000000, 0.305645, 0.122044, + 0.000000, 0.292652, 0.116657, + 0.000000, 0.279659, 0.111270, + 0.000000, 0.266667, 0.105882] #======================================================================== # export une colormap a plat (CPlot interne) @@ -894,4 +894,3 @@ def export2MatplotLib2(cmap): for i in range(size): out.append((i*1./(size-1), [cmap[3*i], cmap[3*i+1], cmap[3*i+2]])) return out - diff --git a/Cassiopee/CPlot/CPlot/Decorator.py b/Cassiopee/CPlot/CPlot/Decorator.py index f0fc64096..99d2f4525 100644 --- a/Cassiopee/CPlot/CPlot/Decorator.py +++ b/Cassiopee/CPlot/CPlot/Decorator.py @@ -82,7 +82,7 @@ def createColormap(type='Blue2Red'): def createColorBar(fig, ax, levels=None, title=None, cmap=None, valueFormat='%0.3f', discrete=True, fontSize=20, color="black", location="right", pad=0.): """Create a color bar.""" - if cmap is None: + if cmap is None: cmap = CPlot.getState('colormap') if cmap == 0 or cmap == 1: # primaire cmap = createColormap('Blue2Red') @@ -121,7 +121,7 @@ def createColorBar(fig, ax, levels=None, title=None, cmap=None, valueFormat='%0. cset = matplotlib.cm.ScalarMappable(norm=norm, cmap=cmap) fontdict = {'fontsize':fontSize} - from mpl_toolkits.axes_grid1 import make_axes_locatable + from mpl_toolkits.axes_grid1 import make_axes_locatable divider = make_axes_locatable(ax) cax = divider.append_axes(location, size="2%", pad=pad) if location == "top" or location == "bottom": orientation = "horizontal" @@ -136,7 +136,7 @@ def createColorBar(fig, ax, levels=None, title=None, cmap=None, valueFormat='%0. if title is not None: cbar.ax.set_title(title, fontdict=fontdict, color=color, pad=0.15*dpi) - fig.subplots_adjust(wspace=0.) + fig.subplots_adjust(wspace=0.) return cbar #========================================================== @@ -149,7 +149,7 @@ def getImage(fileName): #========================================================== # Create subplot with image in it # IN: img: image or image file name -# OUT: fig, ax: figure and axes +# OUT: fig, ax: figure and axes #========================================================== def createSubPlot(img='.decorator.png', title=None, box=False): """Create a sub plot figure.""" @@ -166,7 +166,7 @@ def createSubPlot(img='.decorator.png', title=None, box=False): return fig, ax #========================================================== -# Create a text +# Create a text #========================================================== def createText(ax, posx=0, posy=0, text='', size=20, color="black", box=False, boxColor="black", boxBackColor="white", **kwargs): diff --git a/Cassiopee/CPlot/CPlot/Log.py b/Cassiopee/CPlot/CPlot/Log.py index 36a13d63e..f9f5960a7 100644 --- a/Cassiopee/CPlot/CPlot/Log.py +++ b/Cassiopee/CPlot/CPlot/Log.py @@ -96,10 +96,10 @@ def readToEnd(ptf, ret): res = ptf.readline() rend = endExp.search(res) if rend is not None: cont = False - else: ret.append(res) + else: ret.append(res) #=============================================================================== -# Retourne une liste de chaines contenant le code python de la liste des zones +# Retourne une liste de chaines contenant le code python de la liste des zones # selectionnees (zones) # Retourne None si pas de zone a traiter #=============================================================================== @@ -117,8 +117,8 @@ def getSelectedZones(): if nobu > 0: base = Internal.getBases(CTK.t)[nobu-1] if len(nzs) == len(Internal.getZones(base)): - return ['base = Internal.getBases(t)[%d]'%(nobu-1), - 'zones = Internal.getZones(base)'] + return ['base = Internal.getBases(t)[%d]'%(nobu-1), + 'zones = Internal.getZones(base)'] ret = ['zones = []'] for nz in nzs: nob = CTK.Nb[nz]+1; noz = CTK.Nz[nz] @@ -143,7 +143,7 @@ def getSelectedZones2(): if nobu == -1: nobu = nob elif nobu != nob: nobu = -2; break if nobu > 0: - path = Internal.getPath(t[2][nobu]) + path = Internal.getPath(t[2][nobu]) return ['zonesPath = [%s]'%path] ret = ['zonesPath = []'] @@ -158,7 +158,7 @@ def getSelectedZones2(): #================================================================================ def initLog(): global LOG - LOG = ['import Converter.PyTree as C', + LOG = ['import Converter.PyTree as C', 'import Converter.Internal as Internal'] if CTK.FILE != '': LOG.append('C.convertFile2PyTree(%s)\n'%CTK.FILE) @@ -172,7 +172,7 @@ def addImportModule(moduleName): for i in LOG: sp = i.split(' ') if sp[0] == 'import': modules.append(sp[1]) - else: break + else: break c += 1 if moduleName not in modules: LOG.insert(c, 'import %s'%moduleName) diff --git a/Cassiopee/CPlot/CPlot/Menus.py b/Cassiopee/CPlot/CPlot/Menus.py index e7a994514..dd84c5736 100644 --- a/Cassiopee/CPlot/CPlot/Menus.py +++ b/Cassiopee/CPlot/CPlot/Menus.py @@ -22,11 +22,11 @@ def submenu(items): CPlot.setState(activateShortCuts=0) current = 0 go = True; l = '' - while go: + while go: while l == '': l = CPlot.getKeyboard(); time.sleep(dt) v = ord(l[0]); print(v) - if v == 1: # up + if v == 1: # up b = CPlot.addRender2Zone(out[current], color='White') CPlot.replace(t, 1, current, b) current -= 1 @@ -58,8 +58,8 @@ def submenu(items): b = CPlot.addRender2Zone(out[current], color='Red') CPlot.replace(t, 1, current, b) CPlot.render() - elif v == 13: + elif v == 13: print('returning %s.'%str(current)) - return current, items[current] + return current, items[current] time.sleep(dt) l = ''; v = -1; CPlot.resetKeyboard() diff --git a/Cassiopee/CPlot/CPlot/Panels.py b/Cassiopee/CPlot/CPlot/Panels.py index cae81f1e6..9257f2711 100644 --- a/Cassiopee/CPlot/CPlot/Panels.py +++ b/Cassiopee/CPlot/CPlot/Panels.py @@ -182,7 +182,7 @@ def about(): # position de la fenetre parent xpos = winl.master.winfo_rootx()+45 ypos = winl.master.winfo_rooty()+45 - winl.geometry("%+d%+d" % (xpos, ypos)) + winl.geometry("%+d%+d" % (xpos, ypos)) scrollbar = TTK.Scrollbar(winl, orient=TK.VERTICAL, width=10) scrollbar.grid(sticky=TK.NSEW, row=0, column=1) @@ -352,7 +352,7 @@ def submitKey(event=None): # Essai dans home/.CassiopeeKey import os.path - path = os.path.expanduser('~') + path = os.path.expanduser('~') file = path+'/.CassiopeeKey' d = readKeyFile(file) d[name] = key @@ -383,7 +383,7 @@ def _destroyErrorWindow(event): #============================================================================== # IN: errors: [A,B,C,D,...]: display B, C, -# A is intended to be error number or garbage +# A is intended to be error number or garbage #============================================================================== def displayErrors(errors, header=''): if len(errors) == 0: return @@ -443,7 +443,7 @@ def cancelMail(event=None): mailData.pop('mailWindow') def createMail(): - try: + try: import smtplib from email.mime.image import MIMEImage from email.mime.text import MIMEText @@ -461,7 +461,7 @@ def createMail(): CPlot.setState(export='.tmp001203.png') friendText = mailData['mailFriends'] - if friendText is None: + if friendText is None: os.remove('.tmp001203.png') return # cancelMail me = mailData['mailMe'] @@ -503,8 +503,8 @@ def createMail(): s = smtplib.SMTP('localhost') except: os.remove('.tmp001203.png') - CTK.TXT.insert('START', 'No valid SMTP server on your machine.\n') - CTK.TXT.insert('START', 'Error: ', 'Error'); return + CTK.TXT.insert('START', 'No valid SMTP server on your machine.\n') + CTK.TXT.insert('START', 'Error: ', 'Error'); return # essai de passer par gmail #s = smtplib.SMTP('smtp.gmail.com', 587) #s = smtplib.SMTP('mailhost.onera') @@ -634,7 +634,7 @@ def createDoc(): from odf.text import P from odf.draw import Frame, Image from odf.style import Style, MasterPage, PageLayout, PageLayoutProperties, TextProperties, GraphicProperties, ParagraphProperties, DrawingPageProperties - except: + except: CTK.TXT.insert('START', 'odf module unavailable.\n') CTK.TXT.insert('START', 'Error: ', 'Error'); return @@ -647,7 +647,7 @@ def createDoc(): CPlot.setState(export='.tmp001204.png') text = docData['docText'] - if text is None: + if text is None: os.remove('.tmp001204.png') return # cancel @@ -703,7 +703,7 @@ def createDoc(): imgFrame = Frame(width="%fcm"%15., height="%fcm"%(15.*coeff), x="%fcm"%0.1, y="56pt") doc.text.addElement(imgFrame) href = doc.addPicture('.tmp001205.png') - imgFrame.addElement(Image(href=href)) + imgFrame.addElement(Image(href=href)) p = P() p.addElement(imgFrame) @@ -735,7 +735,7 @@ def writeBlog(event=None): CTK.PREFS['docName'] = docData['docName'] #s = docData['docText'].encode('base64', 'strict') s = docData['docText'] - s = s.split('\n'); s = "".join(s) + s = s.split('\n'); s = "".join(s) CTK.PREFS['docText'] = s CTK.savePrefFile() createDoc() @@ -793,7 +793,7 @@ def openDocWindow(): s = CTK.PREFS['docText'] B.insert(TK.END, s) B = TTK.Button(DOCWINDOW, text="Cancel", command=cancelDocument) - B.grid(row=2, column=0, sticky=TK.EW) + B.grid(row=2, column=0, sticky=TK.EW) B = TTK.Button(DOCWINDOW, text="Add image", command=writeDocument) BB = CTK.infoBulle(parent=B, text='Add current screenshot and text to \nyour document.') B.grid(row=2, column=1, sticky=TK.EW) @@ -824,7 +824,7 @@ def updateRenderPanel(): for l in WIDGETS['myLists']: cur = l.curselection() for s in cur: - zname = listz.get(s) + zname = listz.get(s) selzones.add(zname) for l in WIDGETS['myLists']: l.delete(0, TK.END) @@ -880,7 +880,7 @@ def renderSelect(event=None): for i in sel: myset.add(i) # setter values - material = None; color = None; blending = None; + material = None; color = None; blending = None; meshOverlay = None; shader1 = None; shader2 = None # select les zones dans CPlot @@ -989,7 +989,7 @@ def getSelection(event=None): name = baseName+'/'+CTK.t[2][nob][2][noz][0] for c in range(myList.size()): name2 = myList.get(c) - if name2.strip() == name: + if name2.strip() == name: myList.see(c) myList.selection_set(c) break @@ -1015,7 +1015,7 @@ def reselect(i): def setColorVar(l): if l == 'Custom>': try: import tkinter.colorchooser as tkColorChooser - except: import tkColorChooser + except: import tkColorChooser ret = tkColorChooser.askcolor() l = ret[1] VARS[1].set(l) @@ -1168,7 +1168,7 @@ def yscrolli(i, *args): l0 = WIDGETS['myLists'][i] for c, l in enumerate(WIDGETS['myLists']): if c != i: - if l.yview() != l0.yview(): + if l.yview() != l0.yview(): l.yview_moveto(args[0]) WIDGETS['scrollbar'].set(*args) @@ -1212,53 +1212,53 @@ def openRenderPanel(): if i == 0: # I cant find another way of setting constant in lambda functions # ZoneName listbox myList = TTK.Listbox(RENDERPANEL, selectmode=TK.EXTENDED, - yscrollcommand=lambda *args: yscrolli(0,*args), - #width=30, height=20, - background='white', exportselection=1) + yscrollcommand=lambda *args: yscrolli(0,*args), + #width=30, height=20, + background='white', exportselection=1) myList.bind('', lambda event: fitZone(0, event)) myList.bind('', deactivateZone) elif i == 1: # Material listbox myList = TTK.Listbox(RENDERPANEL, selectmode=TK.EXTENDED, - yscrollcommand=lambda *args: yscrolli(1,*args), - #width=30, height=20, - background='white', exportselection=1) + yscrollcommand=lambda *args: yscrolli(1,*args), + #width=30, height=20, + background='white', exportselection=1) myList.bind('', lambda event: fitZone(1, event)) elif i == 2: # Color listbox myList = TTK.Listbox(RENDERPANEL, selectmode=TK.EXTENDED, - yscrollcommand=lambda *args: yscrolli(2,*args), - #width=30, height=20, - background='white', exportselection=1) + yscrollcommand=lambda *args: yscrolli(2,*args), + #width=30, height=20, + background='white', exportselection=1) myList.bind('', openScalar) elif i == 3: # Blend listbox myList = TTK.Listbox(RENDERPANEL, selectmode=TK.EXTENDED, - yscrollcommand=lambda *args: yscrolli(3,*args), - width=4, - background='white', exportselection=1) + yscrollcommand=lambda *args: yscrolli(3,*args), + width=4, + background='white', exportselection=1) myList.bind('', lambda event: fitZone(3, event)) elif i == 4: # Mesh listbox myList = TTK.Listbox(RENDERPANEL, selectmode=TK.EXTENDED, - yscrollcommand=lambda *args: yscrolli(4,*args), - width=4, - background='white', exportselection=1) - myList.bind('', lambda event: fitZone(4, event)) + yscrollcommand=lambda *args: yscrolli(4,*args), + width=4, + background='white', exportselection=1) + myList.bind('', lambda event: fitZone(4, event)) elif i == 5: # Shader param1 listbox myList = TTK.Listbox(RENDERPANEL, selectmode=TK.EXTENDED, - yscrollcommand=lambda *args: yscrolli(5,*args), - width=4, - background='white', exportselection=1) + yscrollcommand=lambda *args: yscrolli(5,*args), + width=4, + background='white', exportselection=1) myList.bind('', lambda event: fitZone(5, event)) elif i == 6: # shader param2 listbox myList = TTK.Listbox(RENDERPANEL, selectmode=TK.EXTENDED, - yscrollcommand=lambda *args: yscrolli(6,*args), - width=4, - background='white', exportselection=1) + yscrollcommand=lambda *args: yscrolli(6,*args), + width=4, + background='white', exportselection=1) myList.bind('', lambda event: fitZone(6, event)) myList.grid(sticky=TK.NSEW, row=2, column=i) @@ -1311,7 +1311,7 @@ def openRenderPanel(): B.grid(row=3, column=0, columnspan=7, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Filter zones by this regexp.') - # -- Setters -- + # -- Setters -- # zone get selection from CPlot B = TTK.Button(RENDERPANEL, command=getSelection, text='Get', @@ -1333,8 +1333,8 @@ def openRenderPanel(): F.grid(row=1, column=2, sticky=TK.EW) WIDGETS['colors'] = B else: - B = ttk.Combobox(F, textvariable=VARS[1], - values=[], state='readonly', height=11) + B = ttk.Combobox(F, textvariable=VARS[1], + values=[], state='readonly', height=11) B.bind('<>', setColor) B.grid(sticky=TK.EW) F.bind('', updateVarNameList2) @@ -1342,8 +1342,8 @@ def openRenderPanel(): WIDGETS['colors'] = B # blending setter - B = TTK.Scale(RENDERPANEL, from_=0, to=100, orient=TK.HORIZONTAL, - command=setBlend, showvalue=0, borderwidth=1, value=100) + B = TTK.Scale(RENDERPANEL, from_=0, to=100, orient=TK.HORIZONTAL, + command=setBlend, showvalue=0, borderwidth=1, value=100) WIDGETS['blending'] = B B.grid(row=1, column=3, sticky=TK.EW) BB = CTK.infoBulle(parent=B, textVariable=VARS[6]) @@ -1355,16 +1355,16 @@ def openRenderPanel(): BB = CTK.infoBulle(parent=B, text="Toggle mesh overlay") # shader param1 setter - B = TTK.Scale(RENDERPANEL, from_=0, to=100, orient=TK.HORIZONTAL, - command=setShaderParameter1, showvalue=0, borderwidth=1, value=100) + B = TTK.Scale(RENDERPANEL, from_=0, to=100, orient=TK.HORIZONTAL, + command=setShaderParameter1, showvalue=0, borderwidth=1, value=100) WIDGETS['shader1'] = B WIDGETS['shader1'].set(50) B.grid(row=1, column=5, sticky=TK.EW) BB = CTK.infoBulle(parent=B, textVariable=VARS[7]) # shaderparam2 setter - B = TTK.Scale(RENDERPANEL, from_=0, to=100, orient=TK.HORIZONTAL, - command=setShaderParameter2, showvalue=0, borderwidth=1, value=100) + B = TTK.Scale(RENDERPANEL, from_=0, to=100, orient=TK.HORIZONTAL, + command=setShaderParameter2, showvalue=0, borderwidth=1, value=100) WIDGETS['shader2'] = B WIDGETS['shader2'].set(50) B.grid(row=1, column=6, sticky=TK.EW) @@ -1393,7 +1393,7 @@ def openLoadFileDialog(event=None): # OUT: retourne: le nom (/Base/Zone) et le nom tagge (/Base/Zone [X]) def ripTag(wname): l = len(wname) - if wname[l-4:l] == ' [X]': + if wname[l-4:l] == ' [X]': pname = wname[0:l-4] tname = wname else: @@ -1495,7 +1495,7 @@ def loadZones(event=None): import Converter.Filter as Filter # First load if len(Internal.getZones(CTK.t)) == 0: firstLoad = True - else: firstLoad = False + else: firstLoad = False # Recupere les zones selectionnees selection = WIDGETS['LBZONES'].curselection() zList = [] diff --git a/Cassiopee/CPlot/CPlot/PyTree.py b/Cassiopee/CPlot/CPlot/PyTree.py index 9dbd4460f..38d648a3c 100644 --- a/Cassiopee/CPlot/CPlot/PyTree.py +++ b/Cassiopee/CPlot/CPlot/PyTree.py @@ -49,7 +49,7 @@ def display(t, bgColor=-1, backgroundFile="None", shadow=-1, lightOffset=(-999,-999), - dof=-1, dofPower=-1, gamma=-1, toneMapping=-1, + dof=-1, dofPower=-1, gamma=-1, toneMapping=-1, stereo=-1, stereoDist=-1., panorama=0, export="None", exportResolution="None", location="unchanged", @@ -69,69 +69,69 @@ def display(t, CPlot.display(arrays, dim, mode, scalarField, vectorField1, vectorField2, vectorField3, displayBB, displayInfo, displayIsoLegend, meshStyle, - solidStyle, scalarStyle, vectorStyle, + solidStyle, scalarStyle, vectorStyle, vectorScale, vectorDensity, vectorNormalize, vectorShowSurface, vectorShape, vectorProjection, colormap, colormapC1, colormapC2, colormapC3, colormapC, niso, isoEdges, isoScales, win, posCam, posEye, dirCam, viewAngle, - bgColor, backgroundFile, - shadow, lightOffset, dof, dofPower, gamma, toneMapping, + bgColor, backgroundFile, + shadow, lightOffset, dof, dofPower, gamma, toneMapping, stereo, stereoDist, panorama, - export, exportResolution, + export, exportResolution, zoneNames, renderTags, frameBuffer, offscreen, posCamList, posEyeList, dirCamList) # CB: temporaire. Raw data direct display. def displayRaw(t, - dim=-1, - mode=-1, - scalarField=-1, - vectorField1=-1, vectorField2=-1, vectorField3=-1, - displayBB=-1, - displayInfo=-1, - displayIsoLegend=-1, - meshStyle=-1, - solidStyle=-1, - scalarStyle=-1, - vectorStyle=-1, - vectorScale=-1., vectorDensity=-1., vectorNormalize=-1, - vectorShowSurface=-1, vectorShape=-1, vectorProjection=-1, - colormap=-1, - colormapC1="", colormapC2="", colormapC3="", colormapC=None, - niso=25, - isoEdges=-0.5, - isoScales=[], - win=(-1,-1), - posCam=(-999,-999,-999), - posEye=(-999,-999,-999), - dirCam=(-999,-999,-999), - viewAngle=-1., - bgColor=-1, - backgroundFile="None", - shadow=-1, lightOffset=(-999,-999), - dof=-1, dofPower=-1, gamma=-1, toneMapping=-1, - stereo=-1, stereoDist=-1., panorama=0, - export="None", exportResolution="None", - location="unchanged", - frameBuffer=-1, - offscreen=0): + dim=-1, + mode=-1, + scalarField=-1, + vectorField1=-1, vectorField2=-1, vectorField3=-1, + displayBB=-1, + displayInfo=-1, + displayIsoLegend=-1, + meshStyle=-1, + solidStyle=-1, + scalarStyle=-1, + vectorStyle=-1, + vectorScale=-1., vectorDensity=-1., vectorNormalize=-1, + vectorShowSurface=-1, vectorShape=-1, vectorProjection=-1, + colormap=-1, + colormapC1="", colormapC2="", colormapC3="", colormapC=None, + niso=25, + isoEdges=-0.5, + isoScales=[], + win=(-1,-1), + posCam=(-999,-999,-999), + posEye=(-999,-999,-999), + dirCam=(-999,-999,-999), + viewAngle=-1., + bgColor=-1, + backgroundFile="None", + shadow=-1, lightOffset=(-999,-999), + dof=-1, dofPower=-1, gamma=-1, toneMapping=-1, + stereo=-1, stereoDist=-1., panorama=0, + export="None", exportResolution="None", + location="unchanged", + frameBuffer=-1, + offscreen=0): zoneNames = C.getZoneNames(t) renderTags = getRenderTags(t) arrays = C.getAllFields(t, 'nodes', api=3) CPlot.display(arrays, dim, mode, scalarField, vectorField1, vectorField2, vectorField3, displayBB, displayInfo, displayIsoLegend, meshStyle, - solidStyle, scalarStyle, vectorStyle, + solidStyle, scalarStyle, vectorStyle, vectorScale, vectorDensity, vectorNormalize, vectorShowSurface, vectorShape, vectorProjection, colormap, colormapC1, colormapC2, colormapC3, colormapC, niso, isoEdges, isoScales, win, posCam, posEye, dirCam, viewAngle, - bgColor, backgroundFile, - shadow, lightOffset, dof, dofPower, gamma, toneMapping, + bgColor, backgroundFile, + shadow, lightOffset, dof, dofPower, gamma, toneMapping, stereo, stereoDist, panorama, - export, exportResolution, + export, exportResolution, zoneNames, renderTags, frameBuffer, offscreen) #============================================================================== @@ -144,7 +144,7 @@ def render(): # This function doesnt remove zone from t def delete(zlist): """Delete zones from plotter.""" - CPlot.delete(zlist) + CPlot.delete(zlist) #============================================================================== def add(t, nob, noz, zone): @@ -202,7 +202,7 @@ def display1D(t, slot=0, gridPos=(0,0), gridSize=(-1,-1), arrays = [array] else: arrays = C.getAllFields(t, 'nodes') # as pyZone - CPlot.display1D(arrays, slot, gridPos, gridSize, bgBlend, + CPlot.display1D(arrays, slot, gridPos, gridSize, bgBlend, var1, var2, r1, r2) #============================================================================== @@ -337,13 +337,13 @@ def setState(dim=-1, CPlot.setState(dim, mode, scalarField, vectorField1, vectorField2, vectorField3, displayBB, displayInfo, displayIsoLegend, meshStyle, solidStyle, scalarStyle, - vectorStyle, vectorScale, vectorDensity, vectorNormalize, - vectorShowSurface, vectorShape, vectorProjection, + vectorStyle, vectorScale, vectorDensity, vectorNormalize, + vectorShowSurface, vectorShape, vectorProjection, colormap, colormapC1, colormapC2, colormapC3, colormapC, niso, isoEdges, isoScales, win, posCam, posEye, dirCam, viewAngle, lightOffset, - bgColor, backgroundFile, - shadow, dof, dofPower, gamma, toneMapping, + bgColor, backgroundFile, + shadow, dof, dofPower, gamma, toneMapping, sobelThreshold, sharpenPower, ssaoPower, ghostifyDeactivatedZones, edgifyActivatedZones, edgifyDeactivatedZones, simplifyOnDrag, @@ -351,7 +351,7 @@ def setState(dim=-1, envmap, message, stereo, stereoDist, cursor, gridSize, timer, selectionStyle, - activateShortCuts, billBoards, billBoardSize, + activateShortCuts, billBoards, billBoardSize, materials, bumpMaps, frameBuffer, offscreen) def setMode(mode): @@ -710,7 +710,7 @@ def getRenderTags__(z, renderTags): for i in range(lgt): shaderParameters += str(v[i]) if i < lgt-1: shaderParameters += ':' - else: shaderParameters = 'None:None' + else: shaderParameters = 'None:None' renderTags.append(color+':'+material+':'+blending+':'+meshOverlay+':'+shaderParameters) return renderTags @@ -774,13 +774,13 @@ def addRender2PyTree(t, slot=0, posCam=None, posEye=None, dirCam=None, return a def _addRender2PyTree(a, slot=0, posCam=None, posEye=None, dirCam=None, - mode=None, scalarField=None, niso=None, isoScales=None, - isoEdges=None, isoLight=None, isoLegend=None, - colormap=None, colormapC1=None, colormapC2=None, colormapC3=None, colormapC=None, - materials=None, bumpMaps=None, billBoards=None, - shadow=None, lightOffsetX=None, lightOffsetY=None, - dof=None, tone=None, gamma=None, dofPower=None, - sharpenPower=None, ssaoPower=None): + mode=None, scalarField=None, niso=None, isoScales=None, + isoEdges=None, isoLight=None, isoLegend=None, + colormap=None, colormapC1=None, colormapC2=None, colormapC3=None, colormapC=None, + materials=None, bumpMaps=None, billBoards=None, + shadow=None, lightOffsetX=None, lightOffsetY=None, + dof=None, tone=None, gamma=None, dofPower=None, + sharpenPower=None, ssaoPower=None): """Add a renderInfo node to a tree. Usage: addRender2PyTree(t, renderInfo)""" if a[3] != 'CGNSTree_t': return None @@ -1015,7 +1015,7 @@ def loadView(t, slot=0): pos = Internal.getNodeFromName1(slot, 'colormapC') if pos is not None: colormapC = Internal.getValue(pos) else: colormapC = [] - style = colormap2Style(colormap, light) + style = colormap2Style(colormap, light) if legend == 1: CPlot.setState(displayIsoLegend=legend) @@ -1111,7 +1111,7 @@ def display360__(t, posCam, posEye, dirCam, offscreen, exportRez, kwargs): finalizeExport(offscreen) # left - posCam0 = posCam + posCam0 = posCam posEye0 = Vector.add(posCam, v2) dirCam0 = dirCam lkwargs['posCam'] = posCam0 @@ -1121,7 +1121,7 @@ def display360__(t, posCam, posEye, dirCam, offscreen, exportRez, kwargs): lkwargs['exportResolution'] = locRez lkwargs['export'] = 'run/cube_left.png' display(t, **lkwargs) - finalizeExport(offscreen) + finalizeExport(offscreen) # front posCam0 = posCam @@ -1134,7 +1134,7 @@ def display360__(t, posCam, posEye, dirCam, offscreen, exportRez, kwargs): lkwargs['exportResolution'] = locRez lkwargs['export'] = 'run/cube_front.png' display(t, **lkwargs) - finalizeExport(offscreen) + finalizeExport(offscreen) # back posCam0 = posCam @@ -1362,7 +1362,7 @@ def display360ODS__(t, posCam, posEye, dirCam, offscreen, exportRez, stereoShift # start from -pi to pi and rotate left for i in range(nangles): - # simple parallel hack + # simple parallel hack #if i%Cmpi.size != Cmpi.rank: continue theta = 180. - i*360./nangles @@ -1560,7 +1560,7 @@ def display360(t, type360=0, **kwargs): # display if stereo == 0: - # display 6 views + # display 6 views display360__(t, posCam, posEye, dirCam, offscreen, exportRez, kwargs) # Create the 360 image from cube images if Cmpi.rank == 0: @@ -1732,7 +1732,7 @@ def panoramaStereo(export, export1, export2, exportRez, type360=0): pr[0:ni,0:nj] = pr1[0:ni, 0:nj] pr[0:ni,nj:2*nj] = pr2[0:ni, 0:nj] else: - if v == 'a': pr[0:ni, 0:2*nj] = 255 + if v == 'a': pr[0:ni, 0:2*nj] = 255 else: pr[0:ni, 0:2*nj] = 0 else: # 180 ni = int(locRez[1]); nj = int(locRez[1]) diff --git a/Cassiopee/CPlot/CPlot/Tk.py b/Cassiopee/CPlot/CPlot/Tk.py index 9eb067ce3..20e9d30c6 100644 --- a/Cassiopee/CPlot/CPlot/Tk.py +++ b/Cassiopee/CPlot/CPlot/Tk.py @@ -64,7 +64,7 @@ # Status de l'arbre (MAIN=1 ou <=0 - voir ci-dessous) __MAINTREE__ = 1 # Les differents status pour l'arbre -MAIN=1; DEFINEDBC=-1; TIME=-2; SLICE=-2; CELLN=-3; MESHQUAL=-4; +MAIN=1; DEFINEDBC=-1; TIME=-2; SLICE=-2; CELLN=-3; MESHQUAL=-4; UNDEFINEDBC=-5; IJK=-6; MONITOR=-7;UNDEFINEDIBC=-8; # Sauvegarde des zones actives de main (avant de basculer sur un arbre @@ -337,7 +337,7 @@ def display(t, dim=-1, bgColor=-1, backgroundFile="None", shadow=-1, lightOffset=(-999,-999), - dof=-1, dofPower=-1, gamma=-1, toneMapping=-1, + dof=-1, dofPower=-1, gamma=-1, toneMapping=-1, stereo=-1, stereoDist=-1., panorama=0, export='None', exportResolution='None', location='unchanged', @@ -358,7 +358,7 @@ def display(t, dim=-1, colormap, colormapC1, colormapC2, colormapC3, colormapC, niso, isoEdges, isoScales, win, posCam, posEye, dirCam, viewAngle, - bgColor, backgroundFile, + bgColor, backgroundFile, shadow, lightOffset, dof, dofPower, gamma, toneMapping, stereo, stereoDist, panorama, export, exportResolution, @@ -626,7 +626,7 @@ def addFile(): if t == []: t = t2 else: #t = C.mergeTrees(t, t2) - if Internal.getBases(t2) != []: # merge trees + if Internal.getBases(t2) != []: # merge trees t = C.mergeTrees(t, t2) else: # ajoute le noeud sous la selection de tkTree node = TKTREE.getCurrentSelectedNode() @@ -808,7 +808,7 @@ def saveSelZones2File(): def saveNode2File(): if t == []: return - # Get selected node from tkTree + # Get selected node from tkTree if TKTREE is None: return node = TKTREE.getCurrentSelectedNode() @@ -1013,10 +1013,10 @@ def savePrefFile(): if homePath is None: homePath = '' kdir = homePath+'/.cassiopee' exist = os.path.exists(kdir) - if not exist: + if not exist: os.makedirs(kdir) file = open(homePath+'/.cassiopee/config', 'w') - else: + else: isdir = os.path.isdir(kdir) # ok if not isdir: file = open(homePath+'/.cassiopee', 'w') @@ -1244,11 +1244,11 @@ def toggleSelectAll(): #============================================================================== # Inverse les zones activee et desactivees def revertActivated(): - if t == []: return - nz = len(Internal.getZones(t)) + if t == []: return + nz = len(Internal.getZones(t)) nzs = CPlot.getActiveZones() active = [(i,1) for i in range(nz)] - for n in nzs: active[n] = (n,0) + for n in nzs: active[n] = (n,0) CPlot.setActiveZones(active) #============================================================================== @@ -1270,7 +1270,7 @@ def __init__(self, parent=None, text='', temps=1000, btype=0, l = TK.Label(self, textvariable=textVariable, bg="white", justify='right', takefocus=0) else: - l = TK.Label(self, text=text, bg="white", justify='right', + l = TK.Label(self, text=text, bg="white", justify='right', takefocus=0) else: # std label if textVariable is not None: @@ -1345,7 +1345,7 @@ def stt__(s, mode=0): # ces chaines sont de la forme : # type0,1,2: 'var1; var2; var3' ou 'var1' # type3: 'ind;(ind);(i,j,k)' -# On retourne une liste de variables. +# On retourne une liste de variables. # type0,1,2: [var1,var2,var3] # type3: [ind, ind, (i,j,k)] # Si la liste est vide, c'est que la conversion a echoue. @@ -1386,7 +1386,7 @@ def varsFromWidget(varString, type=0): # except: ret.append(0) for i in s: - try: + try: val = eval(i) if isinstance(val, list): ret += val else: ret.append(val) @@ -1444,33 +1444,33 @@ def toolBar(win, mode=0): width, height = 30,30 if mode == 0: # Cassiopee - B = TTK.Button2(frame, compound=TK.TOP, width=width, height=height, - image=iconics.PHOTO[0], borderwidth=0, - command=quickSaveFile) + B = TTK.Button2(frame, compound=TK.TOP, width=width, height=height, + image=iconics.PHOTO[0], borderwidth=0, + command=quickSaveFile) BB = infoBulle(parent=B, text='Save.') B.grid(row=0, column=0) B = TTK.Button2(frame, compound=TK.TOP, width=width, height=height, - image=iconics.PHOTO[1], borderwidth=0, - command=undo) + image=iconics.PHOTO[1], borderwidth=0, + command=undo) BB = infoBulle(parent=B, text='Undo.') B.grid(row=0, column=1) B = TTK.Button2(frame, compound=TK.TOP, width=width, height=height, - image=iconics.PHOTO[11], borderwidth=0, - command=quickReloadFile) + image=iconics.PHOTO[11], borderwidth=0, + command=quickReloadFile) BB = infoBulle(parent=B, text='Reload current file.') B.grid(row=0, column=2) B = TTK.Button2(frame, compound=TK.TOP, width=width, height=height, - image=iconics.PHOTO[3], borderwidth=0, - command=cplotExport) + image=iconics.PHOTO[3], borderwidth=0, + command=cplotExport) BB = infoBulle(parent=B, text='Export image.') B.grid(row=0, column=3) B = TTK.Button2(frame, compound=TK.TOP, width=width, height=height, - image=iconics.PHOTO[4], borderwidth=0, - command=lookFor) + image=iconics.PHOTO[4], borderwidth=0, + command=lookFor) BB = infoBulle(parent=B, text='Fit view to selection\nor fit to full size.') B.grid(row=0, column=4) @@ -1480,43 +1480,43 @@ def toolBar(win, mode=0): # BB = infoBulle(parent=B, text='Select/unselect all zones.') # B.grid(row=0, column=5) B = TTK.Button2(frame, compound=TK.TOP, width=width, height=height, - image=iconics.PHOTO[14], borderwidth=0, - command=copyBlock) + image=iconics.PHOTO[14], borderwidth=0, + command=copyBlock) BB = infoBulle(parent=B, text='Duplicate selected zones.') B.grid(row=0, column=5) B = TTK.Button2(frame, compound=TK.TOP, width=width, height=height, - image=iconics.PHOTO[2], borderwidth=0, - command=rmBlock) + image=iconics.PHOTO[2], borderwidth=0, + command=rmBlock) BB = infoBulle(parent=B, text='Remove selected zones.') B.grid(row=0, column=6) B = TTK.Button2(frame, compound=TK.TOP, width=width, height=height, - image=iconics.PHOTO[6], borderwidth=0, - command=viewDeactivatedZones) + image=iconics.PHOTO[6], borderwidth=0, + command=viewDeactivatedZones) BB = infoBulle(parent=B, text='View deactivated zones.') B.grid(row=0, column=7) B = TTK.Button2(frame, compound=TK.TOP, width=width, height=height, - image=iconics.PHOTO[12], borderwidth=0, - command=revertActivated) + image=iconics.PHOTO[12], borderwidth=0, + command=revertActivated) BB = infoBulle(parent=B, text='Switch active <-> inactive zones.') B.grid(row=0, column=8) B = TTK.Button2(frame, compound=TK.TOP, width=width, height=height, - image=iconics.PHOTO[7], borderwidth=0, - command=displayMainTree) + image=iconics.PHOTO[7], borderwidth=0, + command=displayMainTree) BB = infoBulle(parent=B, text='Display main tree.') B.grid(row=0, column=9) else: # kcgnsview B = TTK.Button2(frame, compound=TK.TOP, width=width, height=height, - image=iconics.PHOTO[11], borderwidth=0, - command=quickReloadSkeleton) + image=iconics.PHOTO[11], borderwidth=0, + command=quickReloadSkeleton) BB = infoBulle(parent=B, text='Reload current file.') B.grid(row=0, column=0) B = TTK.Button2(frame, compound=TK.TOP, width=width, height=height, - image=iconics.PHOTO[1], borderwidth=0, - command=undo) + image=iconics.PHOTO[1], borderwidth=0, + command=undo) BB = infoBulle(parent=B, text='Undo.') B.grid(row=0, column=1) @@ -1644,13 +1644,13 @@ def minimal(title, show=True, mode=0): TXT.mark_set('START', TK.INSERT) TXT.mark_gravity('START', TK.LEFT) TXT.grid(sticky=TK.EW) - from . import tkSearchBar + from . import tkSearchBar E = tkSearchBar.createSearchBar2(F) E.grid(row=1, sticky=TK.NSEW) F.grid(sticky=TK.NSEW, columnspan=2) try: TKTREE = __import__('tkTree'); TKTREE.createApp(win) - except: TKTREE = None + except: TKTREE = None return (win, menu, file, tools) @@ -1864,7 +1864,7 @@ def __call__(self): # add a new frame (screen) to the (bottom/left of the) notebook def add_screen(self, fr, title, menu_fr=None): - if menu_fr is None: + if menu_fr is None: b = TTK.Radiobutton(self.rb_fr, text=title, #image=image, compound=TK.TOP, pady=0, border=TK.ROUND, offrelief=TK.GROOVE, @@ -2029,7 +2029,7 @@ def GIF(Function, functionName='myFunction', *args): TKTREE.updateApp() CPlot.render() - # Log + # Log import Log if Log.LOGGING: sel = Log.getSelectedZones() @@ -2054,7 +2054,7 @@ def save2Doc(): #Panels.docData['docWindow'].master.wait_window(Panels.docData['docWindow']) #============================================================================== -# Change title : change le titre dans la fenetre CPlot (if top window) + Tk +# Change title : change le titre dans la fenetre CPlot (if top window) + Tk #============================================================================== def changeWindowTitle(fileName, filePath="."): if fileName == '': return @@ -2084,7 +2084,7 @@ def tkLoadFile(files, mode='full'): try: size = 0 for f in files: size += os.path.getsize(f) # en octets - except: + except: print('Error: convertFile2PyTree: fail to read file %s.'%files[0]) return if size > 1000000000: print('INFO: size: %f Gb'%(size/1000000000)) @@ -2101,7 +2101,7 @@ def tkLoadFile(files, mode='full'): except: print('Error: convertFile2PyTree: fail to read file %s.'%fileName) return - if format != 'bin_adf' and format != 'bin_hdf': mode = 'full' + if format != 'bin_adf' and format != 'bin_hdf': mode = 'full' if mode == 'partial': # partial load import Converter.Filter as Filter diff --git a/Cassiopee/CPlot/CPlot/Ttk.py b/Cassiopee/CPlot/CPlot/Ttk.py index 7df738129..f37ee52f3 100644 --- a/Cassiopee/CPlot/CPlot/Ttk.py +++ b/Cassiopee/CPlot/CPlot/Ttk.py @@ -1,11 +1,11 @@ try: import tkinter as TK except: import Tkinter as TK -try: import Tk as CTK +try: import Tk as CTK except: from . import Tk as CTK ttk = None try: import tkinter.ttk as ttk -except: +except: try: import ttk except: ttk = None #Uncomment that for a pure Tk interface @@ -210,7 +210,7 @@ def OptionMenu(*args, **kwargs): if ttk is None: return TK.OptionMenu(*args, **kwargs) else: # add default arg - largs = (args[0],args[1],None)+args[2:] + largs = (args[0],args[1],None)+args[2:] o = ttk.OptionMenu(*largs, **kwargs) o["menu"].config(bg=BACKGROUNDCOLOR, fg=FOREGROUNDCOLOR) return o @@ -222,15 +222,15 @@ def Combobox(*args, **kwargs): else: return ComboboxAuto(*args, **kwargs) -def superOptionMenu(F, var, itemList, command, +def superOptionMenu(F, var, itemList, command, updateCommand1, updateCommand2): if ttk is None: B = TK.OptionMenu(F, var, *itemList, command=command) F.bind('', updateCommand1) else: - B = ttk.Combobox(F, textvariable=var, - values=itemList, + B = ttk.Combobox(F, textvariable=var, + values=itemList, state='readonly', width=10) B.bind('<>', command) F.bind('', updateCommand2) @@ -265,23 +265,23 @@ def Entry(*args, **kwargs): # Pas de menu specifique en ttk def Menu(*args, **kwargs): - if ttk is None: return TK.Menu(*args, **kwargs) - else: + if ttk is None: return TK.Menu(*args, **kwargs) + else: M = TK.Menu(*args, **kwargs) M.config(bg=BACKGROUNDCOLOR, fg=FOREGROUNDCOLOR) return M def Menubutton(*args, **kwargs): - if ttk is None: return TK.Menubutton(*args, **kwargs) - else: return ttk.Menubutton(*args, **kwargs) + if ttk is None: return TK.Menubutton(*args, **kwargs) + else: return ttk.Menubutton(*args, **kwargs) # Pas de texte specifique en ttk def Text(*args, **kwargs): - if ttk is None: return TK.Text(*args, **kwargs) + if ttk is None: return TK.Text(*args, **kwargs) else: return TK.Text(*args, **kwargs) def Radiobutton(*args, **kwargs): - if ttk is None: TK.Radiobutton(*args, **kwargs) + if ttk is None: TK.Radiobutton(*args, **kwargs) else: if 'offrelief' in kwargs: kwargs.pop('offrelief') if 'selectcolor' in kwargs: kwargs.pop('selectcolor') @@ -307,7 +307,7 @@ def Scrollbar(*args, **kwargs): else: width = 0 if 'width' in kwargs: - width = kwargs.get('width', 10) + width = kwargs.get('width', 10) kwargs.pop('width') b = ttk.Scrollbar(*args, **kwargs) #if width != 0: b.configure(style='TKTREE.TScrollbar') @@ -338,15 +338,15 @@ def raiseButton(B): def sunkButton(B): if ttk is None: B.config(relief=TK.SUNKEN) - else: B.configure(style='SUNKEN.TButton') + else: B.configure(style='SUNKEN.TButton') def setButtonRed(B): if ttk is None: B.config(bg='red') - else: B.configure(style='RED.TButton') + else: B.configure(style='RED.TButton') def setButtonGreen(B): if ttk is None: B.config(bg='green') - else: B.configure(style='GREEN.TButton') + else: B.configure(style='GREEN.TButton') if ttk is not None: # Combobox avec accelerateur clavier diff --git a/Cassiopee/CPlot/CPlot/tkSearchBar.py b/Cassiopee/CPlot/CPlot/tkSearchBar.py index 78b4f39f6..22a229968 100755 --- a/Cassiopee/CPlot/CPlot/tkSearchBar.py +++ b/Cassiopee/CPlot/CPlot/tkSearchBar.py @@ -9,25 +9,25 @@ # tkNodeEdir 'tkNodeEdit':'tkNodeEdit', 'Edit/change node value':'tkNodeEdit', 'Load a node':'tkNodeEdit', # tkTreeOps - 'tkTreeOps':'tkTreeOps', 'Move node':'tkTreeOps', 'Delete/remove node':'tkTreeOps', + 'tkTreeOps':'tkTreeOps', 'Move node':'tkTreeOps', 'Delete/remove node':'tkTreeOps', 'Move zone to another base':'tkTreeOps', # tkCheckPyTree - 'tkCheckPyTree':'tkCheckPyTree', 'Correct pyTree':'tkCheckPyTree', + 'tkCheckPyTree':'tkCheckPyTree', 'Correct pyTree':'tkCheckPyTree', 'Correct nodes':'tkCheckPyTree', 'Correct BCs':'tkCheckPyTree', # tkFilter 'tkFilter':'tkFilter', 'Find multigrid zones':'tkFilter', 'Find zone of given name':'tkFilter', 'Find zone of given proc':'tkFilter', # tkFamily - 'tkFamily':'tkFamily', 'Create/tag zone family':'tkFamily', + 'tkFamily':'tkFamily', 'Create/tag zone family':'tkFamily', 'Create BCFamily':'tkFamily', # tkCADFix - 'tkCADFix':'tkCADFix', 'Read/load CAD file':'tkCADFix', + 'tkCADFix':'tkCADFix', 'Read/load CAD file':'tkCADFix', 'Write/save CAD file':'tkCADFix', 'Repair CAD':'tkCADFix', # tkState - 'tkState':'tkState', 'Set problem dimension':'tkState', + 'tkState':'tkState', 'Set problem dimension':'tkState', 'Set reference state':'tkState', # tkPrefs - 'tkPrefs':'tkPrefs', 'Change background image/color':'tkPrefs', + 'tkPrefs':'tkPrefs', 'Change background image/color':'tkPrefs', 'Change export resolution':'tkPrefs', 'Customize':'tkPrefs', # tkPerfo 'tkPerfo':'tkPerfo', 'Improve performance':'tkPerfo', @@ -44,10 +44,10 @@ # tkProbe 'tkProbe':'tkProbe', 'Probe value in cell or vertex':'tkProbe', 'Set a field value in a cell':'tkProbe', # tkCanvas - 'tkCanvas':'tkCanvas', 'Create Canvas for drawing':'tkCanvas', + 'tkCanvas':'tkCanvas', 'Create Canvas for drawing':'tkCanvas', 'Enlarge canvas':'tkCanvas', 'Reduce canvas':'tkCanvas', # tkPoint - 'tkPoint':'tkPoint', 'Create a point':'tkPoint', + 'tkPoint':'tkPoint', 'Create a point':'tkPoint', 'Modify point coordinates':'tkPoint', # tkDraw 'tkDraw':'tkDraw', 'Draw lines/beziers/splines':'tkDraw', @@ -66,7 +66,7 @@ # tkBasicSurfs 'tkBasicSurfs':'tkBasicSurfs', 'Create Sphere/Cube/Cylinder surface mesh':'tkBasicSurfs', 'Create Tetra/Hexa/Pyramid/Torus surface mesh':'tkBasicSurfs', - 'Create Plane mesh':'tkBasicSurfs', + 'Create Plane mesh':'tkBasicSurfs', 'Create Classical surface meshes':'tkBasicSurfs', 'Create mesh from Geometry data base':'tkBasicSurfs', # tkText 'tkText':'tkText', 'Create mesh of text':'tkText', @@ -78,7 +78,7 @@ 'ConformUnstr':'tkFixer2', 'Conformize a TRI surface':'tkFixer2', # tkBoolean 'tkBoolean':'tkBoolean', 'Union two surfaces':'tkBoolean', - 'Intersection of rwo surfaces':'tkBoolean', + 'Intersection of rwo surfaces':'tkBoolean', 'Difference of two surfaces':'tkBoolean', # tkMapUV 'tkMapUV':'tkMapUV', 'UV map of surface':'tkMapUV', @@ -91,7 +91,7 @@ 'tkMMGs':'tkMMGs', 'Remesh a TRI surface':'tkMMGs', 'Refine a TRI surface':'tkMMGs', # tkSurfaceWalk - 'tkSurfaceWalk':'tkSurfaceWalk', + 'tkSurfaceWalk':'tkSurfaceWalk', 'Mesh a surface -othogonal/structured-':'tkSurfaceWalk', # tkProjection 'tkProjection':'tkProjection', 'Project a mesh on a surface':'tkProjection', @@ -111,7 +111,7 @@ 'Fill with triangles':'tkTetraMesher', 'Triangulate mesh':'tkTetraMesher', 'Generate tetra/triangle mesh':'tkTetraMesher', # tkTFI - 'TkTFI':'tkTFI', 'TFI Mesh -structured-':'tkTFI', + 'TkTFI':'tkTFI', 'TFI Mesh -structured-':'tkTFI', 'O Mesh -structured-':'tkTFI', # tkSmooth 'tkSmooth':'tkSmooth', 'Smooth mesh':'tkSmooth', @@ -120,7 +120,7 @@ 'Create Octree -structured-':'tkOctree', # tkMeshQual 'tkMeshQual':'tkMeshQual', 'Check mesh quality':'tkMeshQual', - 'Check mesh regularity':'tkMeshQual', + 'Check mesh regularity':'tkMeshQual', 'Check mesh orthogonality':'tkMeshQual', 'Compute cell volume':'tkMeshQual', 'View negative volume cells':'tkMeshQual', @@ -130,7 +130,7 @@ # tkBlock 'tkBlock':'tkBlock', 'Delete/remove block':'tkBlock', 'Convert to tetra':'tkBlock', 'Convert to hexa':'tkBlock', 'Convert to node':'tkBlock', - 'Exterior faces':'tkBlock', 'Close block':'tkBlock', + 'Exterior faces':'tkBlock', 'Close block':'tkBlock', 'Suppress multiple points':'tkBlock', 'Take one over n points':'tkBlock', 'Element type conversion':'tkBlock', # tkTransform @@ -157,7 +157,7 @@ # tkIBC 'tkIBC':'tkIBC', 'Set snear on surface':'tkIBC', 'Immersed boundaries':'tkIBC', 'Set data for IBM':'tkIBC', # tkChimera - 'tkChimera':'tkChimera', 'Blank cells':'tkChimera', + 'tkChimera':'tkChimera', 'Blank cells':'tkChimera', 'Optimize overlap':'tkChimera', # tkExtractBC 'tkExtractBC':'tkExtractBC', 'Extract BC':'tkExtractBC', @@ -178,7 +178,7 @@ 'tkFastSolver':'tkFastSolver', 'Compute CFD with IBM':'tkFastSolver', # tkVariables 'tkVariables':'tkVariables', 'Compute variables/fields':'tkVariables', - 'Center2Node or Node2Center variables/fields':'tkVariables', + 'Center2Node or Node2Center variables/fields':'tkVariables', 'Grad/curl variables/fields':'tkVariables', 'Remove/delete variables/fields':'tkVariables', 'Compute Pressure/Mach/Vorticity':'tkVariables', 'Init variables/fields -with formula-':'tkVariables', @@ -216,14 +216,14 @@ 'Set color on surface':'tkRenderSet', 'Set Surface texture':'tkRenderSet', 'Set Transparency/blending':'tkRenderSet', # tkStereo - 'tkStereo':'tkStereo', 'View anaglyph':'tkStereo', '3D effect':'tkStereo', + 'tkStereo':'tkStereo', 'View anaglyph':'tkStereo', '3D effect':'tkStereo', 'Use Red/Blue glasses':'tkStereo', # tkEffects 'tkEffects':'tkEffects', 'Add shadow':'tkEffects', 'Change camera angle':'tkEffects', 'Add depth of field': 'tkEffects', 'Set gamma': 'tkEffects', 'Set camera angle': 'tkEffects', # tkDemo 'tkDemo':'tkDemo', 'Automatic camera motion':'tkDemo' - } +} # Liste des actions lista = applet.keys() @@ -233,7 +233,7 @@ def __init__(self, lista, *args, **kwargs): TK.Entry.__init__(self, *args, **kwargs) TK.Entry.config(self, bg=TTK.BACKGROUNDCOLOR, fg=TTK.FOREGROUNDCOLOR) self.lista = lista - self.var = self["textvariable"] + self.var = self["textvariable"] if self.var == '': self.var = self["textvariable"] = TK.StringVar() self.var.set("Ask me...") @@ -260,7 +260,7 @@ def changed(self, name, index, mode): self.lb_up = False else: words = self.comparison() - if words: + if words: if not self.lb_up: # listbox exists self.lb = TTK.Listbox(width=self.winfo_width()) self.lb.bind("", self.selection) @@ -293,11 +293,11 @@ def up(self, event): if self.lb_up: if self.lb.curselection() == (): index = '0' else: index = self.lb.curselection()[0] - if index != '0': + if index != '0': self.lb.selection_clear(first=index) - index = str(int(index)-1) + index = str(int(index)-1) self.lb.selection_set(first=index) - self.lb.activate(index) + self.lb.activate(index) def down(self, event): if self.lb_up: @@ -305,9 +305,9 @@ def down(self, event): else: index = self.lb.curselection()[0] if index != TK.END: self.lb.selection_clear(first=index) - index = str(int(index)+1) + index = str(int(index)+1) self.lb.selection_set(first=index) - self.lb.activate(index) + self.lb.activate(index) def comparison(self): import re @@ -328,7 +328,7 @@ def comparison(self): ret = [] for s in sol: lr = len(ret); ls = len(s) - if lr < 8: + if lr < 8: if lr + ls < 8: ret += s else: ret += s[0:8-lr] #ret = [w for w in self.lista if re.match(pattern, w)] @@ -350,7 +350,7 @@ def enter(self, event=None): frames = CTK.WIDGETS['noteBookFrames'] menus = CTK.WIDGETS['noteBookMenus'] buttons = CTK.WIDGETS['noteBookButtons'] - if app in TREEAPPS: + if app in TREEAPPS: frame = frames[0]; menu = menus[0]; bt = buttons[0] elif app in STATEAPPS: frame = frames[1]; menu = menus[1]; bt = buttons[1] diff --git a/Cassiopee/CPlot/apps/CCC.py b/Cassiopee/CPlot/apps/CCC.py index 55d0e74c9..b769facee 100644 --- a/Cassiopee/CPlot/apps/CCC.py +++ b/Cassiopee/CPlot/apps/CCC.py @@ -86,7 +86,7 @@ def caseSelector(): F = TK.Frame(CSWINDOW, borderwidth=0) F.grid(row=0, column=0) F.columnconfigure(0, weight=1) - lb = TK.Listbox(F, selectmode=TK.SINGLE, + lb = TK.Listbox(F, selectmode=TK.SINGLE, width=120, height=22, background='White') WIDGETS['selectListBox'] = lb @@ -100,7 +100,7 @@ def caseSelector(): # populate list getCases() for i in range(len(CASES)): - txt = CASES[i].ljust(20) + separatorl + INFOS[i].ljust(75) + STATUS[i].ljust(6) + txt = CASES[i].ljust(20) + separatorl + INFOS[i].ljust(75) + STATUS[i].ljust(6) lb.insert(TK.END, txt) else: CSWINDOW.withdraw(); CSWINDOW.deiconify(); CSWINDOW.focus_set() @@ -227,7 +227,7 @@ def getCases(): reps = os.listdir(path) for i in reps: a = os.access(path+'/'+i+'/run.py', os.F_OK) - if a: + if a: CASES.append(i) a = os.access(path+'/'+i+'/Readme.txt', os.F_OK) if a: @@ -331,14 +331,14 @@ def rmFile(path, file): try: subprocess.call(cmd, shell=True, stderr=subprocess.STDOUT) subprocess.call(cmd2, shell=True, stderr=subprocess.STDOUT) - except: pass + except: pass return #============================================================================== # Fait un rm de restart.cgns #============================================================================== def cleanCases(): - res = tkMessageBox.askquestion("Clean", "Are You Sure to rm restart.cgns\nfor selected cases?", + res = tkMessageBox.askquestion("Clean", "Are You Sure to rm restart.cgns\nfor selected cases?", icon='warning') if (res == 'no'): return path = CASSIOPEE+'/Cases' @@ -370,8 +370,8 @@ def buildString(info): gfx = info[3] status = info[4] string = case.ljust(20) + separatorl + nit.ljust(10) + separatorl + \ - scale.ljust(5) + separatorl + gfx.ljust(2) + separatorl + \ - status.ljust(10) + scale.ljust(5) + separatorl + gfx.ljust(2) + separatorl + \ + status.ljust(10) return string #============================================================================== @@ -518,7 +518,7 @@ def viewCase(event=None): # F.bind('', updateCases1) # F.grid(row=1, column=0, sticky=TK.EW) #else: -# B = ttk.Combobox(F, textvariable=VARS[0], +# B = ttk.Combobox(F, textvariable=VARS[0], # values=[], state='normal') # B.grid(sticky=TK.EW) # WIDGETS['case'] = B diff --git a/Cassiopee/CPlot/apps/fly.py b/Cassiopee/CPlot/apps/fly.py index c0233c116..9b79d8162 100644 --- a/Cassiopee/CPlot/apps/fly.py +++ b/Cassiopee/CPlot/apps/fly.py @@ -12,7 +12,7 @@ def fly(a, bb, posCam, posEye, dirCam, step): yc = 0.5*(bb[4]+bb[1]) zc = 0.5*(bb[5]+bb[2]) x = posCam[0]-xc; y = posCam[2]-yc; z = posCam[1]-zc - x = 10*x /(bb[3]-bb[0]); y = 10*y /(bb[4]-bb[1]); z = 30*z /(bb[5]-bb[2]); + x = 10*x /(bb[3]-bb[0]); y = 10*y /(bb[4]-bb[1]); z = 30*z /(bb[5]-bb[2]); xp = x + step*sigma*(y - x) yp = y + step*(ro*x - y - x*z) zp = z + step*(x*y - beta*z) diff --git a/Cassiopee/CPlot/apps/streamLine.py b/Cassiopee/CPlot/apps/streamLine.py index 2b9e71dd4..93b6ebe54 100644 --- a/Cassiopee/CPlot/apps/streamLine.py +++ b/Cassiopee/CPlot/apps/streamLine.py @@ -20,6 +20,6 @@ C.convertArrays2File(b, 'out.plt') import sys; sys.exit(); time.sleep(0.1) - stream = P.streamLine(a, (l[0],l[1],l[2])) + stream = P.streamLine(a, (l[0],l[1],l[2])) b += [stream] CPlot.display(b) diff --git a/Cassiopee/CPlot/apps/tkBC.py b/Cassiopee/CPlot/apps/tkBC.py index 8c2f252cb..d2c6d73cc 100644 --- a/Cassiopee/CPlot/apps/tkBC.py +++ b/Cassiopee/CPlot/apps/tkBC.py @@ -272,8 +272,8 @@ def check(): if CTK.__MAINTREE__ == 1: CTK.__MAINACTIVEZONES__ = CPlot.getActiveZones() CTK.dt = C.newPyTree(['Base', 'Edges']) - tp = Internal.appendBaseName2ZoneName(CTK.t, updateRef=False, - separator=Internal.SEP1, + tp = Internal.appendBaseName2ZoneName(CTK.t, updateRef=False, + separator=Internal.SEP1, trailing=Internal.SEP1) bases = Internal.getBases(tp) nb = 0 @@ -332,7 +332,7 @@ def check(): if len(bases) > 0: l = len(Internal.getZones(bases[0])) else: l = 0 if l == 0: TTK.setButtonGreen(WIDGETS['undefinedBC']) - else: TTK.setButtonRed(WIDGETS['undefinedBC']) + else: TTK.setButtonRed(WIDGETS['undefinedBC']) WIDGETS['undefinedBC'].update() #============================================================================== @@ -374,12 +374,12 @@ def setDegeneratedBC(): for nz in nzs: nob = CTK.Nb[nz]+1; noz = CTK.Nz[nz] CTK.t[2][nob][2][noz] = sel[c]; c += 1 - CTK.TKTREE.updateApp() + CTK.TKTREE.updateApp() CTK.TXT.insert('START', 'Degenerated BCs successfully set.\n') except Exception as e: Panels.displayErrors([0,str(e)], header='Error: setDegeneratedBC') CTK.TXT.insert('START', 'Degenerated BCs failed.\n') - CTK.TXT.insert('START', 'Error: ', 'Error') + CTK.TXT.insert('START', 'Error: ', 'Error') check() #============================================================================== @@ -400,7 +400,7 @@ def connectMatch(): mode = VARS[9].get() translation = [0.,0.,0.]; rotationCenter = [0.,0.,0.]; rotationAngle = [0.,0.,0.] - if mode == 'Translation': + if mode == 'Translation': mode = 1; translation = CTK.varsFromWidget(VARS[10].get(), type=1) elif mode == 'Rotation (Degree)': mode = 1; f = CTK.varsFromWidget(VARS[10].get(), type=1) @@ -413,9 +413,9 @@ def connectMatch(): if CTK.__MAINTREE__ <= 0 or nzs == []: try: if mode == 0: CTK.t = X.connectMatch(CTK.t, tol=eps, dim=ndim) - else: + else: CTK.t = X.connectMatchPeriodic(CTK.t, rotationCenter=rotationCenter, - rotationAngle=rotationAngle, + rotationAngle=rotationAngle, translation=translation, tol=eps, dim=ndim, unitAngle=None) CTK.TKTREE.updateApp() @@ -432,21 +432,21 @@ def connectMatch(): sel.append(z) try: if mode == 0: sel = X.connectMatch(sel, tol=eps, dim=ndim) - else: + else: sel = X.connectMatchPeriodic(sel, rotationCenter=rotationCenter, - rotationAngle=rotationAngle, - translation=translation, tol=eps, + rotationAngle=rotationAngle, + translation=translation, tol=eps, dim=ndim, unitAngle=None) c = 0 for nz in nzs: nob = CTK.Nb[nz]+1; noz = CTK.Nz[nz] CTK.t[2][nob][2][noz] = sel[c]; c += 1 - CTK.TKTREE.updateApp() + CTK.TKTREE.updateApp() CTK.TXT.insert('START', 'Matching BCs successfully set.\n') except Exception as e: Panels.displayErrors([0,str(e)], header='Error: connectMatch') CTK.TXT.insert('START', 'Matching BCs failed.\n') - CTK.TXT.insert('START', 'Error: ', 'Error') + CTK.TXT.insert('START', 'Error: ', 'Error') check() CTK.setCursor(0, WIDGETS['connectMatch']) @@ -467,13 +467,13 @@ def connectNearMatch(): CTK.TXT.insert('START', 'Error: ', 'Error'); return if len(ratio) == 1: ratio = ratio[0] - node = Internal.getNodeFromName(CTK.t, 'EquationDimension') + node = Internal.getNodeFromName(CTK.t, 'EquationDimension') if node is not None: ndim = Internal.getValue(node) else: CTK.TXT.insert('START', 'EquationDimension not found (tkState). Using 3D.\n') CTK.TXT.insert('START', 'Warning: ', 'Warning'); ndim = 3 - CTK.setCursor(2, WIDGETS['connectNearMatch']) + CTK.setCursor(2, WIDGETS['connectNearMatch']) nzs = CPlot.getSelectedZones() CTK.saveTree() if CTK.__MAINTREE__ <= 0 or nzs == []: @@ -497,12 +497,12 @@ def connectNearMatch(): for nz in nzs: nob = CTK.Nb[nz]+1; noz = CTK.Nz[nz] CTK.t[2][nob][2][noz] = sel[c]; c += 1 - CTK.TKTREE.updateApp() + CTK.TKTREE.updateApp() CTK.TXT.insert('START', 'n/m matching BCs successfully set.\n') except Exception as e: Panels.displayErrors([0,str(e)], header='Error: connectNearMatch') CTK.TXT.insert('START', 'n/m matching BCs failed.\n') - CTK.TXT.insert('START', 'Error: ', 'Error') + CTK.TXT.insert('START', 'Error: ', 'Error') check() CTK.setCursor(0, WIDGETS['connectNearMatch']) @@ -557,17 +557,17 @@ def rmBCOfType(): CTK.saveTree() nzs = CPlot.getSelectedZones() if CTK.__MAINTREE__ <= 0 or nzs == []: - if 'FamilySpecified:-All BC-' in BCTypes: + if 'FamilySpecified:-All BC-' in BCTypes: Internal._rmNodesByType(CTK.t, 'BC_t') - else: + else: for t in BCTypes: C._rmBCOfType(CTK.t, t) else: for nz in nzs: nob = CTK.Nb[nz]+1; noz = CTK.Nz[nz] z = CTK.t[2][nob][2][noz] - if 'FamilySpecified:-All BC-' in BCTypes: + if 'FamilySpecified:-All BC-' in BCTypes: Internal._rmNodesByType(z, 'BC_t') - else: + else: for t in BCTypes: C._rmBCOfType(z, t) if len(BCTypes) > 0: CTK.TXT.insert('START', 'BCs of type %s have been removed.\n'%BCTypes[0]) @@ -606,7 +606,7 @@ def setBCWith(): return CTK.saveTree() - CTK.setCursor(2, WIDGETS['setBCWith']) + CTK.setCursor(2, WIDGETS['setBCWith']) wins = C.getEmptyBC(CTK.t, ndim, splitFactor) @@ -653,7 +653,7 @@ def setBCWith(): CTK.TXT.insert('START', 'BCs set to %s.\n'%typeBC) CTK.TKTREE.updateApp() check() - CTK.setCursor(0, WIDGETS['setBCWith']) + CTK.setCursor(0, WIDGETS['setBCWith']) #============================================================================== def setSplitFactor(event=None): @@ -689,7 +689,7 @@ def createApp(win): ttk = CTK.importTtk() # - Frame - - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, + Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, text='tkBC [ + ] ', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='Manage boundary conditions.\nCtrl+w to close applet.', btype=1) Frame.bind('', hideApp) @@ -748,7 +748,7 @@ def createApp(win): # - Edges - B = TTK.Checkbutton(Frame, text='Edges', variable=VARS[7]) BB = CTK.infoBulle(parent=B, text='Show edges of zones of the tree.') - B.grid(row=0, column=1, sticky=TK.EW) + B.grid(row=0, column=1, sticky=TK.EW) # - View type de BC - B = TTK.Button(Frame, text="View BC", command=view) @@ -768,8 +768,8 @@ def createApp(win): LB.bind('', updateBCNameList) # LB.bind('', view) for i, value in enumerate(['-All BC-']+getAllDefinedBC(CTK.t)): LB.insert(i, value) - SB.config(command = LB.yview) - LB.config(yscrollcommand = SB.set) + SB.config(command=LB.yview) + LB.config(yscrollcommand=SB.set) LB.grid(row=0, column=0, sticky=TK.NSEW) SB.grid(row=0, column=1, sticky=TK.NSEW) LBFrame.bind('', updateFamilyBCNameList1_2) @@ -783,7 +783,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='View undefined BC in ALL tree.\nUse this to setBC or fillEmptyBC.') # - Slider for splitFactor - - B = TTK.Scale(Frame, from_=0, to=100, orient=TK.HORIZONTAL, + B = TTK.Scale(Frame, from_=0, to=100, orient=TK.HORIZONTAL, command=setSplitFactor, showvalue=0, borderwidth=1, value=0) WIDGETS['splitFactor'] = B B.grid(row=3, columnspan=1, sticky=TK.EW) @@ -808,7 +808,7 @@ def createApp(win): F.grid(row=6, column=1, sticky=TK.EW) WIDGETS['BCs2'] = B else: - B = TTK.Combobox(F, textvariable=VARS[6], + B = TTK.Combobox(F, textvariable=VARS[6], values=Internal.KNOWNBCS, state='readonly', width=10) B.grid(sticky=TK.EW) F.bind('', updateFamilyBCNameList3_2) @@ -828,7 +828,7 @@ def createApp(win): F.grid(row=6, column=1, sticky=TK.EW) WIDGETS['BCs4'] = B else: - B = TTK.Combobox(F, textvariable=VARS[4], + B = TTK.Combobox(F, textvariable=VARS[4], values=Internal.KNOWNBCS, state='readonly', width=10) B.grid(sticky=TK.EW) F.bind('', updateFamilyBCNameList4_2) @@ -849,7 +849,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='BC family type to be created.') B.grid(row=8, column=1, sticky=TK.EW) else: - B = TTK.Combobox(Frame, textvariable=VARS[12], + B = TTK.Combobox(Frame, textvariable=VARS[12], values=Internal.KNOWNBCS, state='readonly', width=10) BB = CTK.infoBulle(parent=B, text='BC family type to be created.') B.grid(row=8, column=1, sticky=TK.EW) diff --git a/Cassiopee/CPlot/apps/tkBackground.py b/Cassiopee/CPlot/apps/tkBackground.py index a5d625d31..d6b517598 100644 --- a/Cassiopee/CPlot/apps/tkBackground.py +++ b/Cassiopee/CPlot/apps/tkBackground.py @@ -146,7 +146,7 @@ def createZEllipse(): try: box = G.bbox(CTK.t) except: box = [0,0,0,1,1,1] hx = box[3]-box[0] - hy = box[4]-box[1] + hy = box[4]-box[1] if hx < 1.e-10: hx = 0.1 if hy < 1.e-10: hy = 0.1 @@ -154,10 +154,10 @@ def createZEllipse(): cx = 0.5*(box[0]+box[3]) cy = 0.5*(box[1]+box[4]) if hx < hy: - s = D.circle( (cx,cy,box[2]), hx, N=50) - s = T.contract(s, (cx,cy,box[2]), (1,0,0), (0,0,1), hy/hx ) + s = D.circle( (cx,cy,box[2]), hx, N=50) + s = T.contract(s, (cx,cy,box[2]), (1,0,0), (0,0,1), hy/hx ) else: - s = D.circle( (cx,cy,box[2]), hy, N=50) + s = D.circle( (cx,cy,box[2]), hy, N=50) s = T.contract(s, (cx,cy,box[2]), (0,1,0), (0,0,1), hx/hy ) s = C.convertArray2Tetra(s); s = G.close(s, 1.e-6) @@ -186,7 +186,7 @@ def createZPlane(): try: box = G.bbox(CTK.t) except: box = [0,0,0,1,1,1] hx = box[3]-box[0] - hy = box[4]-box[1] + hy = box[4]-box[1] if hx < 1.e-10: hx = 0.1 if hy < 1.e-10: hy = 0.1 @@ -373,11 +373,11 @@ def createApp(win): # - VARS - # -0- Type de background - V = TK.StringVar(win); V.set('None'); VARS.append(V) - if 'tkBackgroundType' in CTK.PREFS: + if 'tkBackgroundType' in CTK.PREFS: V.set(CTK.PREFS['tkBackgroundType']) # -1- Border V = TK.StringVar(win); V.set('2'); VARS.append(V) - if 'tkBackgroundBorder' in CTK.PREFS: + if 'tkBackgroundBorder' in CTK.PREFS: V.set(CTK.PREFS['tkBackgroundBorder']) # - Type de background - diff --git a/Cassiopee/CPlot/apps/tkBasicSurfs.py b/Cassiopee/CPlot/apps/tkBasicSurfs.py index 2167ec7b6..7d100c1a3 100644 --- a/Cassiopee/CPlot/apps/tkBasicSurfs.py +++ b/Cassiopee/CPlot/apps/tkBasicSurfs.py @@ -7,7 +7,7 @@ import CPlot.PyTree as CPlot import CPlot.Tk as CTK import CPlot.CPlot as CP -import Geom.PyTree as D +import Geom.PyTree as D import Transform.PyTree as T import Generator.PyTree as G import Converter.Internal as Internal @@ -47,7 +47,7 @@ def meshTri(P0, P1, P2, N): l3 = D.line(P2, C02, N) l4 = D.line(C02, C, N) m3 = G.TFI([l1, l2, l3, l4]) - m3 = T.reorder(m3, (-1,2,3)) + m3 = T.reorder(m3, (-1,2,3)) return [m1, m2, m3] #============================================================================== @@ -194,7 +194,7 @@ def generate(event=None): CTK.add(CTK.t, nob, -1, s) else: nob = C.getNobOfBase(b, CTK.t) - if CP.__slot__ is None: + if CP.__slot__ is None: CTK.t[2][nob][2] += s; CTK.display(CTK.t) else: for i in s: CTK.add(CTK.t, nob, -1, i) @@ -234,15 +234,15 @@ def createApp(win): # - VARS - # -0- NPts - V = TK.StringVar(win); V.set('10'); VARS.append(V) - if 'tkBasicSurfsNpts' in CTK.PREFS: + if 'tkBasicSurfsNpts' in CTK.PREFS: V.set(CTK.PREFS['tkBasicSurfsNpts']) # -1- Type d'elements V = TK.StringVar(win); V.set('TRI'); VARS.append(V) - if 'tkBasicSurfsElts' in CTK.PREFS: + if 'tkBasicSurfsElts' in CTK.PREFS: V.set(CTK.PREFS['tkBasicSurfsElts']) # -2- Type de surface V = TK.StringVar(win); V.set('Sphere'); VARS.append(V) - if 'tkBasicSurfsType' in CTK.PREFS: + if 'tkBasicSurfsType' in CTK.PREFS: V.set(CTK.PREFS['tkBasicSurfsType']) # - Npts - @@ -265,7 +265,7 @@ def createApp(win): if ttk is None: B = TK.OptionMenu(Frame, VARS[2], *SURFTYPES) else: - B = TTK.Combobox(Frame, textvariable=VARS[2], values=SURFTYPES, + B = TTK.Combobox(Frame, textvariable=VARS[2], values=SURFTYPES, state='readonly', width=10) B.grid(row=1, column=0, sticky=TK.EW) diff --git a/Cassiopee/CPlot/apps/tkBlader.py b/Cassiopee/CPlot/apps/tkBlader.py index 3417c1579..1652fc868 100755 --- a/Cassiopee/CPlot/apps/tkBlader.py +++ b/Cassiopee/CPlot/apps/tkBlader.py @@ -48,7 +48,7 @@ def trimesh(a1, a2, a3): P00 = (a2[1][0,0], a2[1][1,0], a2[1][2,0]) P01 = (a2[1][0,N2-1], a2[1][1,N2-1], a2[1][2,N2-1]) if (abs(P0[0]-P00[0]) + abs(P0[1]-P00[1]) + abs(P0[2]-P00[2]) > 1.e-6 - and abs(P0[0]-P01[0]) + abs(P0[1]-P01[1]) + abs(P0[2]-P01[2]) > 1.e-6): + and abs(P0[0]-P01[0]) + abs(P0[1]-P01[1]) + abs(P0[2]-P01[2]) > 1.e-6): t = a2; a2 = a3; a3 = t N2 = a2[2]; N3 = a3[2] P00 = (a2[1][0,0], a2[1][1,0], a2[1][2,0]) @@ -151,7 +151,7 @@ def step1(): noz = CTK.Nz[nz] z = CTK.t[2][nob][2][noz] dim = Internal.getZoneDim(z) - if dim[0] == 'Unstructured': + if dim[0] == 'Unstructured': try: z = C.convertBAR2Struct(z) except Exception as e: #print('Error: blader: %s'%str(e)) @@ -173,7 +173,7 @@ def step1(): if culot == 1: ac = C.getAllFields(zones[1], 'nodes')[0] bb1 = G.bbox(a); bb2 = G.bbox(ac) - if bb1[0] > bb2[0]: temp = a; a = ac; ac = temp + if bb1[0] > bb2[0]: temp = a; a = ac; ac = temp # taille de maille trailing edge et culot h = float(VARS[1].get()) @@ -262,7 +262,7 @@ def step1(): median = G.map(median, s) median = G.refine(median, 0.9, 1) - N1 = c1[2]; N2 = median[2]; d = N1-N2 + N1 = c1[2]; N2 = median[2]; d = N1-N2 if d/2 != d*0.5: factor = (N2+2.)/N2 median = G.refine(median, factor, 1) @@ -272,7 +272,7 @@ def step1(): if culot == 0: #Converter.convertArrays2File([b1,b2,delta], 'bout1.plt') m3 = trimesh(b1, b2, delta) - if m3[0] == 0: raise ValueError(m3[1]) + if m3[0] == 0: raise ValueError(m3[1]) #Converter.convertArrays2File([b1,b2,delta]+m3, 'bout1.plt') else: # Dans le cas avec culot, on remaille le culot comme delta @@ -310,7 +310,7 @@ def step1(): P1 = Converter.getValue(a1,0) P2 = Converter.getValue(a1,1) - P3 = (P1[0]+Dfar,P1[1],P1[2]) + P3 = (P1[0]+Dfar,P1[1],P1[2]) line2 = D.line(P1, P3, N=50) N = 50 @@ -354,7 +354,7 @@ def step1(): vol = G.getVolumeMap(m4[0]) nk = vol[4]; ni = vol[2] for k in range(nk-1): - sub = T.subzone(vol, (1,1,k+1), (ni,1,k+2)) + sub = T.subzone(vol, (1,1,k+1), (ni,1,k+2)) volmin = Converter.getMinValue(sub, 'vol') if volmin < 0.: if k > 10: kc = k-4 @@ -435,7 +435,7 @@ def step2(): M1 = [] for z in zones[0:l-2]: M1.append(C.getAllFields(z, 'nodes')[0]) - else: + else: # 3 zones exterieures, le reste interieur M2 = [C.getAllFields(zones[l-2], 'nodes')[0], C.getAllFields(zones[l-1], 'nodes')[0], @@ -495,7 +495,7 @@ def step2(): CTK.t = C.addBase2PyTree(CTK.t, 'STEP2', 3) base = Internal.getNodesFromName1(CTK.t, 'STEP2')[0] - (p, c) = Internal.getParentOfNode(CTK.t, base) + (p, c) = Internal.getParentOfNode(CTK.t, base) base[2] += zones # Add BCs @@ -558,7 +558,7 @@ def step2(): base[2][3+i] = z base = C.fillEmptyBCWith(base, 'wall', 'BCWall') - CTK.t[2][c] = base + CTK.t[2][c] = base CTK.TXT.insert('START', 'Step2 performed.\n') (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) @@ -592,29 +592,29 @@ def createApp(win): # - VARS - # -0- front split % - V = TK.StringVar(win); V.set('0.5'); VARS.append(V) - if 'tkBladerFrontSplit' in CTK.PREFS: + if 'tkBladerFrontSplit' in CTK.PREFS: V.set(CTK.PREFS['tkBladerFrontSplit']) # -1- front step - V = TK.StringVar(win); V.set('0.001'); VARS.append(V) - if 'tkBladerFrontStep' in CTK.PREFS: + if 'tkBladerFrontStep' in CTK.PREFS: V.set(CTK.PREFS['tkBladerFrontStep']) # -2- other step - V = TK.StringVar(win); V.set('0.01'); VARS.append(V) - if 'tkBladerStep' in CTK.PREFS: + if 'tkBladerStep' in CTK.PREFS: V.set(CTK.PREFS['tkBladerStep']) # -3- delta line index - V = TK.StringVar(win); V.set('15'); VARS.append(V) # -4- Dfar. Mesh height - V = TK.StringVar(win); V.set('0.3'); VARS.append(V) - if 'tkBladerHeight' in CTK.PREFS: + if 'tkBladerHeight' in CTK.PREFS: V.set(CTK.PREFS['tkBladerHeight']) # -5- hp: step en envergure - V = TK.StringVar(win); V.set('0.02'); VARS.append(V) - if 'tkBladerSpanStep' in CTK.PREFS: + if 'tkBladerSpanStep' in CTK.PREFS: V.set(CTK.PREFS['tkBladerSpanStep']) # -6- span: longeur de l'envergure - V = TK.StringVar(win); V.set('5.'); VARS.append(V) - if 'tkBladerSpan' in CTK.PREFS: + if 'tkBladerSpan' in CTK.PREFS: V.set(CTK.PREFS['tkBladerSpan']) # - Step1 - diff --git a/Cassiopee/CPlot/apps/tkBlock.py b/Cassiopee/CPlot/apps/tkBlock.py index f94101eb7..a2415be8c 100644 --- a/Cassiopee/CPlot/apps/tkBlock.py +++ b/Cassiopee/CPlot/apps/tkBlock.py @@ -43,7 +43,7 @@ def rmBlock(): CTK.TXT.insert('START', 'Selected zones deleted.\n') (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() - CPlot.delete(deletedZoneNames) + CPlot.delete(deletedZoneNames) CPlot.render() #============================================================================== @@ -130,7 +130,7 @@ def convert2Tetra(): #============================================================================== # Converti un bloc ou tous les blocs en hexa # IN: t, cplot.selectedZones -# OUT: t modifie et affiche. +# OUT: t modifie et affiche. #============================================================================== def convert2Hexa(): if CTK.t == []: return @@ -165,7 +165,7 @@ def convert2Hexa(): Panels.displayErrors(errors, header='Error: convert2Hexa') CTK.TXT.insert('START', 'Hexa conversion fails for at least one zone.\n') CTK.TXT.insert('START', 'Warning: ', 'Warning') - #C._fillMissingVariables(CTK.t) + #C._fillMissingVariables(CTK.t) (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() CPlot.render() @@ -173,7 +173,7 @@ def convert2Hexa(): #============================================================================== # Converti un bloc en node # IN: t, cplot.selectedZones -# OUT: t modifie et affiche. +# OUT: t modifie et affiche. #============================================================================== def convert2Node(): if CTK.t == []: return @@ -188,7 +188,7 @@ def convert2Node(): for nz in nzs: nob = CTK.Nb[nz]+1 - noz = CTK.Nz[nz] + noz = CTK.Nz[nz] a = C.convertArray2Node(CTK.t[2][nob][2][noz]) CTK.replace(CTK.t, nob, noz, a) @@ -254,7 +254,7 @@ def oneovern(): nzs = CPlot.getSelectedZones() if nzs == []: CTK.TXT.insert('START', 'Selection is empty.\n') - CTK.TXT.insert('START', 'Error: ', 'Error'); return + CTK.TXT.insert('START', 'Error: ', 'Error'); return args = VARS[0].get() args = args.split(';') if (len(args) != 3): @@ -330,7 +330,7 @@ def close(): #============================================================================== def createApp(win): # - Frame - - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, + Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, text='tkBlock [ + ] ', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='General block operations.\nCtrl+w to close applet.', temps=0, btype=1) Frame.bind('', hideApp) diff --git a/Cassiopee/CPlot/apps/tkBody.py b/Cassiopee/CPlot/apps/tkBody.py index a642905f8..c9c4d8e5e 100644 --- a/Cassiopee/CPlot/apps/tkBody.py +++ b/Cassiopee/CPlot/apps/tkBody.py @@ -43,7 +43,7 @@ def extractBodies(): CTK.TXT.insert('START', 'Walls extracted.\n') (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() - CTK.display(CTK.t) + CTK.display(CTK.t) #========================================================================= def extractExternalContours(): @@ -95,7 +95,7 @@ def stitchedHat(): CTK.TXT.insert('START', 'Stitched hat created.\n') (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() - CTK.display(CTK.t) + CTK.display(CTK.t) return #============================================================================== @@ -121,7 +121,7 @@ def pointedHat(): CTK.TXT.insert('START', 'Pointed hat created.\n') (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() - CTK.display(CTK.t) + CTK.display(CTK.t) return #============================================================================== @@ -135,7 +135,7 @@ def closeBody(): #============================================================================== def createApp(win): # - Frame - - Frame = TK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, + Frame = TK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, text='tkBody [ + ] ', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='Close surface meshes.\nCtrl+w to close applet.', temps=0, btype=1) Frame.bind('', hideApp) @@ -156,7 +156,7 @@ def createApp(win): V = TK.StringVar(win); V.set('1.e-5;1.e-5'); VARS.append(V) # -2- stitchedHat : offx,offy,offz V = TK.StringVar(win); V.set('0.;0.;0.'); VARS.append(V) - # -3- pointedHat : x,y,z + # -3- pointedHat : x,y,z V = TK.StringVar(win); V.set('0.;0.;0.'); VARS.append(V) # - extractBodies - diff --git a/Cassiopee/CPlot/apps/tkBoolean.py b/Cassiopee/CPlot/apps/tkBoolean.py index 3e65bea67..1de26307a 100644 --- a/Cassiopee/CPlot/apps/tkBoolean.py +++ b/Cassiopee/CPlot/apps/tkBoolean.py @@ -29,7 +29,7 @@ def union(): tol = CTK.varsFromWidget(VARS[0].get(), type=1) if len(tol) != 1: - CTK.TXT.insert('START', 'Tolerance is incorrect.\n') + CTK.TXT.insert('START', 'Tolerance is incorrect.\n') CTK.TXT.insert('START', 'Error: ', 'Error'); return tol = tol[0] @@ -44,7 +44,7 @@ def union(): z = CTK.t[2][nob][2][noz] zlist.append(z) - try: + try: j = XOR.booleanUnion(zlist[0], zlist[1], tol=tol) except Exception as e: CTK.setCursor(0, WIDGETS['union']) @@ -52,14 +52,14 @@ def union(): CTK.TXT.insert('START', 'Union failed\n'); return for nz in range(len(zlist)-2): - try: + try: j = XOR.booleanUnion(j, zlist[nz+2], tol=tol) except Exception as e: CTK.setCursor(0, WIDGETS['union']) Panels.displayErrors([0,str(e)], header='Error: union') CTK.TXT.insert('START', 'Union failed.\n'); return - CTK.setCursor(0, WIDGETS['union']) + CTK.setCursor(0, WIDGETS['union']) CTK.t = CPlot.deleteSelection(CTK.t, CTK.Nb, CTK.Nz, nzs) CPlot.delete(deletedZoneNames) CTK.add(CTK.t, CTK.Nb[0]+1, -1, j) @@ -84,7 +84,7 @@ def difference(): tol = CTK.varsFromWidget(VARS[0].get(), type=1) if len(tol) != 1: - CTK.TXT.insert('START', 'Tolerance is incorrect.\n') + CTK.TXT.insert('START', 'Tolerance is incorrect.\n') CTK.TXT.insert('START', 'Error: ', 'Error'); return tol = tol[0] @@ -133,7 +133,7 @@ def difference2(): tol = CTK.varsFromWidget(VARS[0].get(), type=1) if len(tol) != 1: - CTK.TXT.insert('START', 'Tolerance is incorrect.\n') + CTK.TXT.insert('START', 'Tolerance is incorrect.\n') CTK.TXT.insert('START', 'Error: ', 'Error'); return tol = tol[0] @@ -162,7 +162,7 @@ def difference2(): Panels.displayErrors([0,str(e)], header='Error: difference') CTK.TXT.insert('START', 'Difference failed.\n') - CTK.setCursor(0, WIDGETS['revdiff']) + CTK.setCursor(0, WIDGETS['revdiff']) #C._fillMissingVariables(CTK.t) (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() @@ -182,7 +182,7 @@ def intersection(): tol = CTK.varsFromWidget(VARS[0].get(), type=1) if len(tol) != 1: - CTK.TXT.insert('START', 'Tolerance is incorrect.\n') + CTK.TXT.insert('START', 'Tolerance is incorrect.\n') CTK.TXT.insert('START', 'Error: ', 'Error'); return tol = tol[0] diff --git a/Cassiopee/CPlot/apps/tkCADFix.py b/Cassiopee/CPlot/apps/tkCADFix.py index 5684b05d6..ac64e171f 100644 --- a/Cassiopee/CPlot/apps/tkCADFix.py +++ b/Cassiopee/CPlot/apps/tkCADFix.py @@ -43,7 +43,7 @@ def readCAD(event=None): #============================================================================== def writeCAD(event=None): import OCC.PyTree as OCC - if CTK.CADHOOK is None: return + if CTK.CADHOOK is None: return hook = CTK.CADHOOK fileName = VARS[0].get() fileFmt = VARS[1].get() @@ -115,7 +115,7 @@ def filletCAD(event=None): no = Internal.getNodeFromName1(CAD, 'no') no = Internal.getValue(no) edges.append(no) - if edges == []: + if edges == []: CTK.TXT.insert('START', 'No valid edges in selection.\n') return @@ -165,7 +165,7 @@ def removeFaces(event=None): no = Internal.getNodeFromName1(CAD, 'no') no = Internal.getValue(no) faces.append(no) - if faces == []: + if faces == []: CTK.TXT.insert('START', 'No valid faces in selection.\n') return @@ -273,7 +273,7 @@ def fillHole(event=None): #print('edgeList', edges, flush=True) try: OCC._fillHole(hook, edges) - except: + except: CTK.setCursor(0, WIDGETS['frame']) CTK.setCursor(0, WIDGETS['fillHoleButton']) CTK.TXT.insert('START', 'Fill hole fails.\n') @@ -342,7 +342,7 @@ def trimFaces(event=None): no = Internal.getNodeFromName1(CAD, 'no') no = Internal.getValue(no) faces1.append(no) - if faces1 == []: + if faces1 == []: CTK.TXT.insert('START', 'No valid faces in selection.\n') return @@ -350,13 +350,13 @@ def trimFaces(event=None): st = VARS[5].get() st = st.split(' ') for s in st: - try: - val = int(s) + try: + val = int(s) faces2.append(val) except: pass - if faces2 == []: + if faces2 == []: CTK.TXT.insert('START', 'No valid faces in selection.\n') - return + return CTK.setCursor(2, WIDGETS['frame']) CTK.setCursor(2, WIDGETS['trimFacesButton']) @@ -400,7 +400,7 @@ def checkWatertight(event=None): p = Internal.getNodeFromName1(CTK.t, 'LEAKS') if p is not None: zones = [] - for z in Internal.getZones(p): zones.append('LEAKS'+Internal.SEP1+z[0]) + for z in Internal.getZones(p): zones.append('LEAKS'+Internal.SEP1+z[0]) CPlot.delete(zones) gnob = C.getNobOfBase(p, CTK.t) del CTK.t[2][gnob] @@ -438,7 +438,7 @@ def checkWatertight(event=None): CTK.setCursor(0, WIDGETS['checkWatertight']) if isWatertight: TTK.setButtonGreen(WIDGETS['checkWatertight']) - else: TTK.setButtonRed(WIDGETS['checkWatertight']) + else: TTK.setButtonRed(WIDGETS['checkWatertight']) if isWatertight: CTK.TXT.insert('START', 'CAD is watertight with tol %g.\n'%tol) else: CTK.TXT.insert('START', 'CAD is not watertight with tol %g.\n'%tol) @@ -472,11 +472,11 @@ def createApp(win): import OCC.PyTree as OCC fileName, fileFmt = OCC.getFileAndFormat(CTK.CADHOOK) CAD = Internal.getNodeFromName1(CTK.t, 'CAD') - if CAD is not None: + if CAD is not None: NL = OCC.getNbLonelyEdges(CTK.t) tol = Internal.getNodeFromName1(CAD, 'hmax') tol = Internal.getValue(tol) - power = math.floor(math.log10(abs(tol))) + power = math.floor(math.log10(abs(tol))) tol = round(tol, -power) else: fileName = ''; fileFmt = 'fmt_step'; NL = 0 @@ -504,7 +504,7 @@ def createApp(win): B = TTK.OptionMenu(Frame, VARS[1], 'fmt_step', 'fmt_iges') B.grid(row=0, column=1, sticky=TK.EW) - # Read/write CAD file + # Read/write CAD file B = TTK.Button(Frame, text="Read", command=readCAD) B.grid(row=1, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Read CAD in tree.') diff --git a/Cassiopee/CPlot/apps/tkCADMesh.py b/Cassiopee/CPlot/apps/tkCADMesh.py index de57a1efd..aae22fc97 100644 --- a/Cassiopee/CPlot/apps/tkCADMesh.py +++ b/Cassiopee/CPlot/apps/tkCADMesh.py @@ -49,7 +49,7 @@ def meshCADEdges(event=None): #============================================================================== def meshCADFaces(event=None): if CTK.CADHOOK is None: return - if CTK.t == []: return + if CTK.t == []: return mtype = VARS[2].get() import OCC.PyTree as OCC hmin = CTK.varsFromWidget(VARS[3].get(), 1)[0] @@ -120,7 +120,7 @@ def createApp(win): # -3- hmin - V = TK.StringVar(win); V.set('%g'%hmin); VARS.append(V) - # Hmin + # Hmin B = TTK.Entry(Frame, textvariable=VARS[3], background='White', width=10) B.grid(row=0, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Hmin step of surface mesh.') diff --git a/Cassiopee/CPlot/apps/tkCamera.py b/Cassiopee/CPlot/apps/tkCamera.py index 5e250c887..75344191f 100644 --- a/Cassiopee/CPlot/apps/tkCamera.py +++ b/Cassiopee/CPlot/apps/tkCamera.py @@ -68,7 +68,7 @@ def exportInfo(event=None): scalarStyle = CPlot.getState('scalarStyle'); com += ', scalarStyle=%d'%scalarStyle colormap = CPlot.getState('colormap'); com += ', colormap=%d'%colormap isoEdges = CPlot.getState('isoEdges'); com += ', isoEdges=%g'%isoEdges - isoScale = CPlot.getState('isoScale'); + isoScale = CPlot.getState('isoScale'); isoScale = [field]+isoScale com += ', isoScales=%s'%str(isoScale) diff --git a/Cassiopee/CPlot/apps/tkCanvas.py b/Cassiopee/CPlot/apps/tkCanvas.py index 2bb478e9d..5e3e6471f 100644 --- a/Cassiopee/CPlot/apps/tkCanvas.py +++ b/Cassiopee/CPlot/apps/tkCanvas.py @@ -273,7 +273,7 @@ def createApp(win): # - Direction - B = TTK.OptionMenu(Frame, VARS[0], - 'None', 'View', 'XY', 'XZ', 'YZ', + 'None', 'View', 'XY', 'XZ', 'YZ', command=initCanvas) B.grid(row=0, column=0, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Create a canvas.') diff --git a/Cassiopee/CPlot/apps/tkCartWrap.py b/Cassiopee/CPlot/apps/tkCartWrap.py index 5cdd18a3e..95748857f 100644 --- a/Cassiopee/CPlot/apps/tkCartWrap.py +++ b/Cassiopee/CPlot/apps/tkCartWrap.py @@ -60,7 +60,7 @@ def mapSurf(z, density, smoothIter, eltType, constraints, strength): # Masquage xrayDim1 = 2000; xrayDim2 = 2000 - cellno = X.blankCells([b], [celln], [a], blankingType=1, delta=h*0.05, + cellno = X.blankCells([b], [celln], [a], blankingType=1, delta=h*0.05, dim=3, XRaydim1=xrayDim1, XRaydim2=xrayDim2) # Selection du front @@ -82,7 +82,7 @@ def mapSurf(z, density, smoothIter, eltType, constraints, strength): f = T.projectOrtho(f, [a]) elif smoothIter == 0: f = T.projectOrtho(f, [a]) - if constraints != []: + if constraints != []: f = Converter.initVars(f, 'indic', 0) f = G.snapSharpEdges(f, constraints, step=0.3*h, angle=30.) else: @@ -90,7 +90,7 @@ def mapSurf(z, density, smoothIter, eltType, constraints, strength): #if constraints != []: # f = G.snapSharpEdges(f, constraints, step=0.3*h, angle=30.) for smooth in range(smoothIter): - f = T.smooth(f, eps=0.5, niter=2, + f = T.smooth(f, eps=0.5, niter=2, fixedConstraints=constraints, #projConstraints=constraints, delta=strength) @@ -229,21 +229,21 @@ def createApp(win): # - VARS - # -0- Point density - V = TK.StringVar(win); V.set('1.'); VARS.append(V) - if 'tkCartWrapDensity' in CTK.PREFS: + if 'tkCartWrapDensity' in CTK.PREFS: V.set(CTK.PREFS['tkCartWrapDensity']) # -1- Smoother power - V = TK.StringVar(win); V.set('10'); VARS.append(V) - if 'tkCartWrapSmooth' in CTK.PREFS: + if 'tkCartWrapSmooth' in CTK.PREFS: V.set(CTK.PREFS['tkCartWrapSmooth']) # -2- Elt type - V = TK.StringVar(win); V.set('QUAD'); VARS.append(V) - if 'tkCartWrapElts' in CTK.PREFS: + if 'tkCartWrapElts' in CTK.PREFS: V.set(CTK.PREFS['tkCartWrapElts']) # -3- Constraint V = TK.StringVar(win); V.set(''); VARS.append(V) # -4- Constraint strength V = TK.StringVar(win); V.set('1.'); VARS.append(V) - if 'tkCartWrapConsStrength' in CTK.PREFS: + if 'tkCartWrapConsStrength' in CTK.PREFS: V.set(CTK.PREFS['tkCartWrapConsStrength']) # - Point density - diff --git a/Cassiopee/CPlot/apps/tkCassiopee.py b/Cassiopee/CPlot/apps/tkCassiopee.py index c19ba9f2c..37947bb20 100644 --- a/Cassiopee/CPlot/apps/tkCassiopee.py +++ b/Cassiopee/CPlot/apps/tkCassiopee.py @@ -18,7 +18,7 @@ EDGEAPPS = ['tkCanvas', 'tkPoint', 'tkDraw','---', 'tkExtractEdges', 'tkMapEdge'] SURFAPPS = ['tkBasicSurfs', 'tkText', '---', - 'tkCADMesh', + 'tkCADMesh', 'tkFixer2', 'tkBoolean', '---', 'tkMapUV', 'tkSculpt', '---', 'tkMMGs', 'tkCartWrap', 'tkOffset', 'tkSurfaceWalk', '---', @@ -44,7 +44,7 @@ 'tkExtractMesh', '---', 'tkStream', 'tkIsoLine', 'tkIsoSurf', '---', 'tkInteg'] -VISUAPPS = ['tkView', #'tkPlot', +VISUAPPS = ['tkView', #'tkPlot', 'tkPlotXY', '---', 'tkSlice', 'tkIJK', 'tkCellN', '---', 'tkBackground'] @@ -53,15 +53,15 @@ 'tkPovRay', 'tkLuxRender'] ALLAPPS = TREEAPPS + STATEAPPS + EDGEAPPS + SURFAPPS + MESHAPPS + \ - BLOCKAPPS + BCAPPS + MOTIONAPPS + SOLVERAPPS + POSTAPPS + \ - VISUAPPS + RENDERAPPS + BLOCKAPPS + BCAPPS + MOTIONAPPS + SOLVERAPPS + POSTAPPS + \ + VISUAPPS + RENDERAPPS PERSOAPPS = [] #============================================================================== # Add a personal app to pref file #============================================================================== def addPersonalApp(): - try: import tkinter.filedialog as tkFileDialog + try: import tkinter.filedialog as tkFileDialog except: import tkFileDialog file = tkFileDialog.askopenfilename(filetypes=[('python', '*.py')]) a = os.access(file, os.F_OK) @@ -211,7 +211,7 @@ def run(t=None): CTK.t = Internal.correctPyTree(CTK.t, level=5) CTK.display(CTK.t) - # - Update apps - + # - Update apps - CTK.TKTREE.updateApp() if CTK.TKMODULES['tkContainers'] is not None: CTK.TKMODULES['tkContainers'].updateApp() if CTK.TKPLOTXY is not None: CTK.TKPLOTXY.updateApp() @@ -236,7 +236,7 @@ def run(t=None): win.mainloop() # Del photos - CTK.PHOTOS = [] + CTK.PHOTOS = [] #============================================================================== if __name__ == "__main__": diff --git a/Cassiopee/CPlot/apps/tkCassiopeeSolver.py b/Cassiopee/CPlot/apps/tkCassiopeeSolver.py index b42572b55..e25d3eac4 100644 --- a/Cassiopee/CPlot/apps/tkCassiopeeSolver.py +++ b/Cassiopee/CPlot/apps/tkCassiopeeSolver.py @@ -218,7 +218,7 @@ def run(): def createApp(win): # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, - text='tkCassiopeeSolver [ + ] ', font=CTK.FRAMEFONT, + text='tkCassiopeeSolver [ + ] ', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='Export to Cassiopee \nCartesian solver.\nCtrl+w to close applet.', temps=0, btype=1) Frame.bind('', hideApp) @@ -250,7 +250,7 @@ def createApp(win): # -5- double wall tolerance - V = TK.StringVar(win); V.set('10.'); VARS.append(V) # -6- delta XRay - - V = TK.StringVar(win); V.set('1.e-10'); VARS.append(V) + V = TK.StringVar(win); V.set('1.e-10'); VARS.append(V) # -7- tolerance XRay - V = TK.StringVar(win); V.set('1.e-8'); VARS.append(V) # -8- Cartesian option - diff --git a/Cassiopee/CPlot/apps/tkCellN.py b/Cassiopee/CPlot/apps/tkCellN.py index 4c8bc8294..28b07cada 100644 --- a/Cassiopee/CPlot/apps/tkCellN.py +++ b/Cassiopee/CPlot/apps/tkCellN.py @@ -21,7 +21,7 @@ def chimeraInfo(): if CTK.t == []: return nzs = CPlot.getSelectedZones() typename = VARS[1].get() - CTK.saveTree() + CTK.saveTree() X._chimeraInfo(CTK.t,typename) CTK.TXT.insert('START', 'Field %s added.\n'%typename) CTK.TKTREE.updateApp() @@ -155,7 +155,7 @@ def selectWithFormula(zones, formula): formula = formula.replace('cellN', 'centers:cellN') if res == 1: # cellN en noeuds - Z = P.selectCells(zones, formula) + Z = P.selectCells(zones, formula) else: # cellN en centres Z = P.selectCells(zones, formula) for z in Z: z[0] = C.getZoneName(z[0]) @@ -196,7 +196,7 @@ def extract(): Z = X.extractChimeraInfo(zones,type='orphan',loc='centers') if Z == []: Z = None elif type == 'cf>1': - Z = X.extractChimeraInfo(zones,type='cf>1',loc='centers') + Z = X.extractChimeraInfo(zones,type='cf>1',loc='centers') if Z == []: Z = None if Z is not None: @@ -247,7 +247,7 @@ def createApp(win): B = TTK.OptionMenu(Frame, VARS[0], 'Mesh', 'cellN=0', 'cellN=-99999', 'cellN=2', 'cellN<0', '01', 'Orphan points', 'Extrapolated points','Interpolated points') - B.grid(row=norow, column=0, columnspan=2, sticky=TK.EW) + B.grid(row=norow, column=0, columnspan=2, sticky=TK.EW) # - View cellN - norow += 1 @@ -270,7 +270,7 @@ def createApp(win): B = TTK.Button(Frame, text="Chimera info", command=chimeraInfo) B.grid(row=norow, column=0, sticky=TK.EW) B = TTK.OptionMenu(Frame, VARS[1], 'interpolated', 'extrapolated', 'orphan', - 'cellRatio','donorAspect') + 'cellRatio','donorAspect') B.grid(row=norow, column=1, sticky=TK.EW) #============================================================================== diff --git a/Cassiopee/CPlot/apps/tkCheckPyTree.py b/Cassiopee/CPlot/apps/tkCheckPyTree.py index 1ae83108a..330a1c513 100644 --- a/Cassiopee/CPlot/apps/tkCheckPyTree.py +++ b/Cassiopee/CPlot/apps/tkCheckPyTree.py @@ -56,7 +56,7 @@ def runCheckPyTree(): if len(minBlk)>0: errors = Internal.checkSize(CTK.t, sizeMax=minBlk[0]) - if len(errors) == 0: + if len(errors) == 0: TTK.setButtonGreen(WIDGETS['CheckPyTree']) errors = [0, 'No error found.'] CTK.TXT.insert('START', 'No error found in pyTree.\n') @@ -169,7 +169,7 @@ def createApp(win): B.grid(row=0, column=4, columnspan=2, sticky=TK.EW) # Option menu - B = TTK.OptionMenu(Frame, VARS[3], 'All conformity', ' > Node conformity', ' > Unique base name', ' > Unique zone name', ' > Unique BC name', + B = TTK.OptionMenu(Frame, VARS[3], 'All conformity', ' > Node conformity', ' > Unique base name', ' > Unique zone name', ' > Unique BC name', ' > Valid BC ranges', ' > Valid BC match', ' > Referenced families', ' > Valid CGNS types', ' > Valid element nodes', ' > Valid CGNS flowfield name', ' > NAN in fields', 'Node name length < 32', 'Zones of homogeneous cellDim in bases', 'Multigrid compatibility', 'Maximum number of nodes') diff --git a/Cassiopee/CPlot/apps/tkChimera.py b/Cassiopee/CPlot/apps/tkChimera.py index 0ed18ad94..426a992bd 100644 --- a/Cassiopee/CPlot/apps/tkChimera.py +++ b/Cassiopee/CPlot/apps/tkChimera.py @@ -105,7 +105,7 @@ def setHoleInterpolatedPoints(): #============================================================================== # blanking -# Blank la selection avec la surface fournie +# Blank la selection avec la surface fournie #============================================================================== def blank(): if CTK.t == []: return @@ -266,7 +266,7 @@ def createApp(win): # -0- double wall: active ? - V = TK.StringVar(win); V.set('inactive'); VARS.append(V) # -1- delta XRay - - V = TK.StringVar(win); V.set('1.e-10'); VARS.append(V) + V = TK.StringVar(win); V.set('1.e-10'); VARS.append(V) # -2- tolerance XRay - V = TK.StringVar(win); V.set('1.e-8'); VARS.append(V) # -3- Base name 1 @@ -304,7 +304,7 @@ def createApp(win): B = TTK.Button(Frame, text="Init cellN", command=initCellN) B.grid(row=r, column=0, columnspan=4, sticky=TK.EW) BB = CTK.infoBulle(parent=B, - text='Init the cellN to 1. in the tree or selection.') + text='Init the cellN to 1. in the tree or selection.') r += 1 # - applyBCOverlap - @@ -365,14 +365,14 @@ def createApp(win): B.grid(row=r, column=3, sticky=TK.EW) # - optimizeOverlap - - B = TTK.Button(Frame, text="Optimize overlap", command= optimize) + B = TTK.Button(Frame, text="Optimize overlap", command=optimize) B.grid(row=r, column=0, columnspan=4, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Optimize the overlapping') r += 1 # - createOversetHoles - B = TTK.Button(Frame, text="Create OversetHoles nodes", - command= createOversetHoles) + command=createOversetHoles) B.grid(row=r, column=0, columnspan=4, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Create the nodes OversetHoles in pyTree.') r += 1 diff --git a/Cassiopee/CPlot/apps/tkCollarMesh.py b/Cassiopee/CPlot/apps/tkCollarMesh.py index ddfcd649a..bbb7fbab3 100644 --- a/Cassiopee/CPlot/apps/tkCollarMesh.py +++ b/Cassiopee/CPlot/apps/tkCollarMesh.py @@ -108,7 +108,7 @@ def unionCollarMesh(): for z in nodes: if (z[0] == sname[1]): surface1.append(z) - # - surfaces2 - + # - surfaces2 - name = VARS[1].get() names = name.split(';') surface2 = [] @@ -122,7 +122,7 @@ def unionCollarMesh(): if z[0] == sname[1]: surface2.append(z) # - constraints1 - - constraints1 = [] + constraints1 = [] name = VARS[8].get() names = name.split(';') for v in names: @@ -174,16 +174,16 @@ def unionCollarMesh(): zlist = [] if contours != []: for c in contours: - zones = G.collarMesh(surface1, surface2, distribj, distribk, + zones = G.collarMesh(surface1, surface2, distribj, distribk, niterj=niterj, niterk=niterk, alphaRef=180., - type='union', contour=c, - constraints1=constraints1, + type='union', contour=c, + constraints1=constraints1, constraints2=constraints2) zlist += zones else: - zones = G.collarMesh(surface1, surface2, distribj, distribk, + zones = G.collarMesh(surface1, surface2, distribj, distribk, niterj=niterj, niterk=niterk, - type='union', constraints1=constraints1, + type='union', constraints1=constraints1, constraints2=constraints2) zlist += zones @@ -230,7 +230,7 @@ def differenceCollarMesh(): for z in nodes: if z[0] == sname[1]: surface2.append(z) # - constraints1 - - constraints1 = [] + constraints1 = [] name = VARS[8].get() names = name.split(';') for v in names: @@ -282,16 +282,16 @@ def differenceCollarMesh(): zlist = [] if contours != []: for c in contours: - zones = G.collarMesh(surface1, surface2, distribj, distribk, + zones = G.collarMesh(surface1, surface2, distribj, distribk, niterj=niterj, niterk=niterk, alphaRef=180., - type='difference', contour=c, - constraints1=constraints1, + type='difference', contour=c, + constraints1=constraints1, constraints2=constraints2) zlist += zones else: - zones = G.collarMesh(surface1, surface2, distribj, distribk, + zones = G.collarMesh(surface1, surface2, distribj, distribk, niterj=niterj, niterk=niterk, - type='difference', constraints1=constraints1, + type='difference', constraints1=constraints1, constraints2=constraints2) zlist += zones CTK.saveTree() @@ -332,9 +332,9 @@ def createApp(win): WIDGETS['frameMenu'] = FrameMenu # - VARS - - # -0- Surface1- + # -0- Surface1- V = TK.StringVar(win); V.set(''); VARS.append(V) - # -1- Surface2- + # -1- Surface2- V = TK.StringVar(win); V.set(''); VARS.append(V) # -2- hauteur de la maille dans la direction j V = TK.StringVar(win); V.set('1.e-1'); VARS.append(V) diff --git a/Cassiopee/CPlot/apps/tkDemo.py b/Cassiopee/CPlot/apps/tkDemo.py index 244710841..3b7616dd0 100644 --- a/Cassiopee/CPlot/apps/tkDemo.py +++ b/Cassiopee/CPlot/apps/tkDemo.py @@ -97,7 +97,7 @@ def fly(): x = posCam[0]-xc; y = posCam[2]-yc; z = posCam[1]-zc x = 10*x /max((bb[3]-bb[0]), 1.e-10) y = 10*y /max((bb[4]-bb[1]), 1.e-10) - z = 30*z /max((bb[5]-bb[2]), 1.e-10) + z = 30*z /max((bb[5]-bb[2]), 1.e-10) xp = x + step*speed*sigma*(y - x) yp = y + step*speed*(ro*x - y - x*z) zp = z + step*speed*(x*y - beta*z) @@ -195,7 +195,7 @@ def createApp(win): CTK.addPinMenu(FrameMenu, 'tkDemo') WIDGETS['frameMenu'] = FrameMenu - # -0- Orbiter path - + # -0- Orbiter path - V = TK.StringVar(win); V.set(''); VARS.append(V) # - Slider - diff --git a/Cassiopee/CPlot/apps/tkDist2Walls.py b/Cassiopee/CPlot/apps/tkDist2Walls.py index 4521190d3..e63970f66 100644 --- a/Cassiopee/CPlot/apps/tkDist2Walls.py +++ b/Cassiopee/CPlot/apps/tkDist2Walls.py @@ -114,17 +114,17 @@ def createApp(win): # - VARS - # -0- Type de distance - V = TK.StringVar(win); V.set('ortho'); VARS.append(V) - if 'tkDist2WallsType' in CTK.PREFS: + if 'tkDist2WallsType' in CTK.PREFS: V.set(CTK.PREFS['tkDist2WallsType']) # -1- Surfaces - V = TK.StringVar(win); V.set(''); VARS.append(V) # -2- Signed ou absolute - V = TK.StringVar(win); V.set('absolute'); VARS.append(V) - if 'tkDist2WallsSigned' in CTK.PREFS: + if 'tkDist2WallsSigned' in CTK.PREFS: V.set(CTK.PREFS['tkDist2WallsSigned']) # -3- Vars location - V = TK.StringVar(win); V.set('nodes'); VARS.append(V) - if 'tkVariablesLoc' in CTK.PREFS: + if 'tkVariablesLoc' in CTK.PREFS: V.set(CTK.PREFS['tkVariablesLoc']) # - Surfaces - diff --git a/Cassiopee/CPlot/apps/tkDistributor.py b/Cassiopee/CPlot/apps/tkDistributor.py index 934ebc92a..2b751c2b5 100644 --- a/Cassiopee/CPlot/apps/tkDistributor.py +++ b/Cassiopee/CPlot/apps/tkDistributor.py @@ -303,14 +303,14 @@ def adjustNProc(): useCom=useCom, algorithm=algo) # Best - VARS[0].set(str(classes[c])) + VARS[0].set(str(classes[c])) CTK.t, STATS = D.distribute(CTK.t, classes[c], perfo=(1.,0.,comSpeed), useCom=useCom, algorithm=algo) CTK.TXT.insert('START', 'Blocks distributed.\n') CTK.TKTREE.updateApp() updateStats() - return + return #============================================================================== # Create app widgets @@ -340,25 +340,25 @@ def createApp(win): # - VARS - # -0- NProc - V = TK.StringVar(win); V.set('10'); VARS.append(V) - if 'tkDistributorNProc' in CTK.PREFS: + if 'tkDistributorNProc' in CTK.PREFS: V.set(CTK.PREFS['tkDistributorNProc']) # -1- ComSpeed - V = TK.StringVar(win); V.set('0.1'); VARS.append(V) - if 'tkDistributorComSpeed' in CTK.PREFS: + if 'tkDistributorComSpeed' in CTK.PREFS: V.set(CTK.PREFS['tkDistributorComSpeed']) # -2- Algorithm V = TK.StringVar(win); V.set('graph'); VARS.append(V) - if 'tkDistributorAlgorithm' in CTK.PREFS: + if 'tkDistributorAlgorithm' in CTK.PREFS: V.set(CTK.PREFS['tkDistributorAlgorithm']) # -3- Communication types V = TK.StringVar(win); V.set('all'); VARS.append(V) - if 'tkDistributorComType' in CTK.PREFS: + if 'tkDistributorComType' in CTK.PREFS: V.set(CTK.PREFS['tkDistributorComType']) # -4- Manual proc setting V = TK.StringVar(win); V.set('0'); VARS.append(V) # -5- Multigrid level V = TK.StringVar(win); V.set('0'); VARS.append(V) - if 'tkDistributorMultigrid' in CTK.PREFS: + if 'tkDistributorMultigrid' in CTK.PREFS: V.set(CTK.PREFS['tkDistributorMultigrid']) # - NProc - diff --git a/Cassiopee/CPlot/apps/tkDraw.py b/Cassiopee/CPlot/apps/tkDraw.py index 36ec3a49f..1b98a2142 100644 --- a/Cassiopee/CPlot/apps/tkDraw.py +++ b/Cassiopee/CPlot/apps/tkDraw.py @@ -193,7 +193,7 @@ def drawCircle(npts): tx = tx*normi; ty = ty*normi; tz = tz*normi; alpha = R*R - (xa*xa+ya*ya+za*za)*0.25 if alpha >= 0: alpha = math.sqrt(alpha) - else: alpha = 0. + else: alpha = 0. center = [0,0,0] center[0] = 0.5*(x1+x2) + alpha*tx center[1] = 0.5*(y1+y2) + alpha*ty @@ -206,8 +206,8 @@ def drawCircle(npts): center[1] = 0.5*(y1+y2) - alpha*ty center[2] = 0.5*(z1+z2) - alpha*tz l = (center[0]-x3)*(center[0]-x3) + \ - (center[1]-y3)*(center[1]-y3) + \ - (center[2]-z3)*(center[2]-z3) + (center[1]-y3)*(center[1]-y3) + \ + (center[2]-z3)*(center[2]-z3) circle = D.circle( (center[0],center[1],center[2]), R, N=npts) e1 = [x1-center[0], y1-center[1], z1-center[2]] e2 = [x2-center[0], y2-center[1], z2-center[2]] @@ -320,7 +320,7 @@ def drawArc(npts): e3 = Vector.cross(e1, e2) e4 = Vector.cross(e1, e3) - # Images des pts dans le plan xyz + # Images des pts dans le plan xyz pt1 = D.point((x1,y1,z1)) pt2 = D.point((x2,y2,z2)) pt3 = D.point((x3,y3,z3)) @@ -370,7 +370,7 @@ def drawArc(npts): if teta3 > teta2: teta1 = 360. else: teta1 = 0. - circle = D.circle((center[0],center[1],center[2]), R, + circle = D.circle((center[0],center[1],center[2]), R, tetas=teta2, tetae=teta1, N=npts) circle = T.rotate(circle, (center[0], center[1], center[2]), @@ -708,7 +708,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Underlaying model surfaces.') # - Figure type - - B = TTK.OptionMenu(Frame, VARS[0], 'Line', 'Circle', 'Circular arc', + B = TTK.OptionMenu(Frame, VARS[0], 'Line', 'Circle', 'Circular arc', 'Rectangle', 'Polyline', 'Cubic', 'Free hand') BB = CTK.infoBulle(parent=B, text='Type of drawing.') B.grid(row=1, column=0, sticky=TK.EW) diff --git a/Cassiopee/CPlot/apps/tkEffects.py b/Cassiopee/CPlot/apps/tkEffects.py index ef683534d..0ae5a2f46 100644 --- a/Cassiopee/CPlot/apps/tkEffects.py +++ b/Cassiopee/CPlot/apps/tkEffects.py @@ -14,15 +14,15 @@ #============================================================================== def setShadow(event=None): - if VARS[1].get() == '1': shadow= 1 - else: shadow = 0 + if VARS[1].get() == '1': shadow= 1 + else: shadow = 0 CPlot.setState(shadow=shadow) CPlot._addRender2PyTree(CTK.t, shadow=shadow) #============================================================================== def setDOF(event=None): if VARS[2].get() == '1': dof = 1 - else: dof = 0 + else: dof = 0 CPlot.setState(dof=dof) CPlot._addRender2PyTree(CTK.t, dof=dof) @@ -95,7 +95,7 @@ def getData(event=None): if pos is not None: out = [] for i in pos[2]: out.append(Internal.getValue(i)) - CPlot.setState(bumpMaps=out) + CPlot.setState(bumpMaps=out) pos = Internal.getNodeFromName1(renderInfo, 'billBoards') if pos is not None: out = [] diff --git a/Cassiopee/CPlot/apps/tkElsaSolver.py b/Cassiopee/CPlot/apps/tkElsaSolver.py index 4b975a6dc..2e6b3cfea 100644 --- a/Cassiopee/CPlot/apps/tkElsaSolver.py +++ b/Cassiopee/CPlot/apps/tkElsaSolver.py @@ -62,7 +62,7 @@ def createApp(win): # - VARS - # -0- file name for export - V = TK.StringVar(win); V.set('elsA.cgns'); VARS.append(V) - if 'tkElsaSolverFile' in CTK.PREFS: + if 'tkElsaSolverFile' in CTK.PREFS: V.set(CTK.PREFS['tkElsaSolverFile']) # -1- Method for createElsaHybrid V = TK.IntVar(win); V.set(0); VARS.append(V) @@ -75,12 +75,12 @@ def createApp(win): B.grid(row=0, column=1, sticky=TK.EW) B.bind('', export) - # - Adapt in memory tree - + # - Adapt in memory tree - B = TTK.Button(Frame, text="Adapt current tree", command=adapt) B.grid(row=1, column=0, columnspan=2, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Adapt in memory tree to make it suitable for elsA.CGNS.') - # - Create elsA Hybrid node - + # - Create elsA Hybrid node - B = TTK.Button(Frame, text="Create elsA Hybrid Node", command=elsAHybridNode) B.grid(row=2, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Create elsAHybrid node for unstructured mesh') diff --git a/Cassiopee/CPlot/apps/tkExtendSurf.py b/Cassiopee/CPlot/apps/tkExtendSurf.py index be0d6e60d..c91e9269b 100755 --- a/Cassiopee/CPlot/apps/tkExtendSurf.py +++ b/Cassiopee/CPlot/apps/tkExtendSurf.py @@ -60,7 +60,7 @@ def extendSurf(): noz = CTK.Nz[nz] CTK.t[2][nob][2][noz] = zlist[c]; c += 1 - CTK.TXT.insert('START', 'Surface extension done.\n') + CTK.TXT.insert('START', 'Surface extension done.\n') (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() CTK.display(CTK.t) @@ -98,7 +98,7 @@ def createApp(win): WIDGETS['frame'] = Frame # - VARS - - # -0- Surface to extend - + # -0- Surface to extend - V = TK.StringVar(win); V.set(''); VARS.append(V) # -1- Hauteur de chaque maille - V = TK.StringVar(win); V.set('1.e-1'); VARS.append(V) diff --git a/Cassiopee/CPlot/apps/tkExtractBC.py b/Cassiopee/CPlot/apps/tkExtractBC.py index 9981583dd..ad49202da 100644 --- a/Cassiopee/CPlot/apps/tkExtractBC.py +++ b/Cassiopee/CPlot/apps/tkExtractBC.py @@ -172,7 +172,7 @@ def createApp(win): # - VARS - # - 0 - Type de BC - V = TK.StringVar(win); V.set('-All BC-'); VARS.append(V) - if 'tkExtractBCType' in CTK.PREFS: + if 'tkExtractBCType' in CTK.PREFS: V.set(CTK.PREFS['tkExtractBCType']) # - 1 - List of zoneBCs to recover V = TK.StringVar(win); V.set(''); VARS.append(V) @@ -191,8 +191,8 @@ def createApp(win): F.grid(row=0, column=1, columnspan=2, sticky=TK.EW) WIDGETS['BC'] = B else: - B = ttk.Combobox(F, textvariable=VARS[0], - values=Internal.KNOWNBCS, + B = ttk.Combobox(F, textvariable=VARS[0], + values=Internal.KNOWNBCS, state='readonly', width=10) B.grid(sticky=TK.EW) F.bind('', updateFamilyBCNameList2) diff --git a/Cassiopee/CPlot/apps/tkExtractEdges.py b/Cassiopee/CPlot/apps/tkExtractEdges.py index ac2e4cc7d..2b5942cea 100644 --- a/Cassiopee/CPlot/apps/tkExtractEdges.py +++ b/Cassiopee/CPlot/apps/tkExtractEdges.py @@ -84,14 +84,14 @@ def exteriorFaces(): ext = G.close(ext) ext = T.splitConnexity(ext) exts += ext - except Exception as e: + except Exception as e: fail = True; errors += [0,str(e)] else: ext = P.exteriorFacesStructured(z) exts += ext if fail: - Panels.displayErrors(errors, header='Error: exteriorFaces') + Panels.displayErrors(errors, header='Error: exteriorFaces') if exts == []: CTK.TXT.insert('START', 'External edges set is empty.\n') @@ -130,7 +130,7 @@ def silhouette(): eye = CPlot.getState('posEye') vector = [cam[0]-eye[0], cam[1]-eye[1], cam[2]-eye[2]] - fail = False; exts = []; errors = [] + fail = False; exts = []; errors = [] for nz in nzs: nob = CTK.Nb[nz]+1 noz = CTK.Nz[nz] @@ -142,7 +142,7 @@ def silhouette(): except Exception as e: fail = True; errors += [0,str(e)] - if fail: + if fail: Panels.displayErrors(errors, header='Error: silhouette') if exts == []: CTK.TXT.insert('START', 'Silhouette set is empty.\n') @@ -195,7 +195,7 @@ def sharpEdges(): ext = []; fail = True; errors += [0,str(e)] sharps += ext - if fail: + if fail: Panels.displayErrors(errors, header='Error: sharpEdges') if sharps == []: @@ -325,7 +325,7 @@ def convertBAR2Struct(): def createApp(win): # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, - text='tkExtractEdges [ + ] ', font=CTK.FRAMEFONT, + text='tkExtractEdges [ + ] ', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='Extract edges.\nCtrl+w to close applet.', temps=0, btype=1) Frame.bind('', hideApp) diff --git a/Cassiopee/CPlot/apps/tkExtractMesh.py b/Cassiopee/CPlot/apps/tkExtractMesh.py index b1efa10c4..dbcca2c38 100644 --- a/Cassiopee/CPlot/apps/tkExtractMesh.py +++ b/Cassiopee/CPlot/apps/tkExtractMesh.py @@ -69,7 +69,7 @@ def extractMesh(): fail = False try: - meshes = P.extractMesh(sources, meshes, order=2, tol=1.e-6) + meshes = P.extractMesh(sources, meshes, order=2, tol=1.e-6) except Exception as e: fail = True Panels.displayErrors([0,str(e)], header='Error: extractMesh') @@ -86,7 +86,7 @@ def extractMesh(): CTK.TXT.insert('START', 'Error: ', 'Error') (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() - CTK.display(CTK.t) + CTK.display(CTK.t) #============================================================================== # Create app widgets diff --git a/Cassiopee/CPlot/apps/tkExtrusion.py b/Cassiopee/CPlot/apps/tkExtrusion.py index f2e5af058..7bf00bf77 100644 --- a/Cassiopee/CPlot/apps/tkExtrusion.py +++ b/Cassiopee/CPlot/apps/tkExtrusion.py @@ -40,7 +40,7 @@ def revolve(): teta = CTK.varsFromWidget(VARS[5].get(), type=1) if len(teta) != 1: - CTK.TXT.insert('START', 'Revolve angle is incorrect.\n') + CTK.TXT.insert('START', 'Revolve angle is incorrect.\n') CTK.TXT.insert('START', 'Error: ', 'Error'); return teta = teta[0] @@ -79,7 +79,7 @@ def revolve(): try: z = D.axisym(z, (xo,yo,zo), (ntx,nty,ntz), teta, Nteta, rmod) CTK.replace(CTK.t, nob, noz, z) - except Exception as e: + except Exception as e: fail = True; errors += [0,str(e)] if not fail: @@ -109,7 +109,7 @@ def setAxis(): z = CTK.t[2][nob][2][noz] selected += CTK.t[2][nob][0]+'/'+z[0]+';' selected = selected[0:-1] - VARS[4].set(selected) + VARS[4].set(selected) #============================================================================== def setCurve(): @@ -128,7 +128,7 @@ def setCurve(): z = CTK.t[2][nob][2][noz] selected += CTK.t[2][nob][0]+'/'+z[0]+';' selected = selected[0:-1] - VARS[3].set(selected) + VARS[3].set(selected) #============================================================================= def lineDrive(): @@ -174,7 +174,7 @@ def extrudeWCurve(mode=0): if mode == 0: z = D.lineDrive(z, curve) else: z = D.orthoDrive(z, curve) CTK.replace(CTK.t, nob, noz, z) - except Exception as e: + except Exception as e: fail = True; errors += [0,str(e)] if not fail: @@ -216,7 +216,7 @@ def addLayers(): CTK.TXT.insert('START', 'Selection is empty.\n') CTK.TXT.insert('START', 'Error: ', 'Error'); return - CTK.setCursor(2, WIDGETS['addLayers']) + CTK.setCursor(2, WIDGETS['addLayers']) CTK.saveTree() zlist = [] for nz in nzs: @@ -229,7 +229,7 @@ def addLayers(): fail = False; errors = [] try: zlist = G.addNormalLayers(zlist, d, niter=smooth) - except Exception as e: + except Exception as e: fail = True; errors += [0,str(e)] for z in zlist: z[0] = C.getZoneName(z[0]) # unique name @@ -275,7 +275,7 @@ def addkplanes(): CTK.replace(CTK.t, nob, noz, z) #except Exception as e: fail = True if not fail: CTK.TXT.insert('START', 'K planes added.\n') - else: + else: CTK.TXT.insert('START', 'add K planes failed.\n') CTK.TXT.insert('START', 'Error: ', 'Error') (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) diff --git a/Cassiopee/CPlot/apps/tkFamily.py b/Cassiopee/CPlot/apps/tkFamily.py index f095ccc63..8360a987d 100644 --- a/Cassiopee/CPlot/apps/tkFamily.py +++ b/Cassiopee/CPlot/apps/tkFamily.py @@ -160,7 +160,7 @@ def createApp(win): F.grid(row=1, column=1, columnspan=2, sticky=TK.EW) WIDGETS['zones'] = B else: - B = TTK.Combobox(F, textvariable=VARS[2], + B = TTK.Combobox(F, textvariable=VARS[2], values=[], state='readonly') B.grid(sticky=TK.EW) F.bind('', updateFamilyZoneNameList2) @@ -181,7 +181,7 @@ def createApp(win): B = TK.OptionMenu(Frame, VARS[3], *(Internal.KNOWNBCS)) B.grid(row=2, column=2, sticky=TK.EW) else: - B = TTK.Combobox(Frame, textvariable=VARS[3], + B = TTK.Combobox(Frame, textvariable=VARS[3], values=Internal.KNOWNBCS, state='readonly', width=10) B.grid(row=2, column=2, sticky=TK.EW) diff --git a/Cassiopee/CPlot/apps/tkFastSolver.py b/Cassiopee/CPlot/apps/tkFastSolver.py index 240aca2af..10a29f3e7 100644 --- a/Cassiopee/CPlot/apps/tkFastSolver.py +++ b/Cassiopee/CPlot/apps/tkFastSolver.py @@ -106,7 +106,7 @@ def reloadPrevStep(event=None): CTK.TXT.insert('START', 'Revert to previous solution step.\n') VARS[10].set('Main') NITRUN -= 1 - except: + except: CTK.TXT.insert('START', 'restart file not found.\n') VARS[10].set('Body') @@ -244,7 +244,7 @@ def run(event=None): prepare() # save t, tc CTK.TXT.insert('START', 'Prepare OK.\n') except: - CTK.setCursor(0, WIDGETS['compute']) + CTK.setCursor(0, WIDGETS['compute']) CTK.TXT.insert('START', 'Prepare failed.\n') return @@ -308,7 +308,7 @@ def prepare(tinit=None): if dim is not None: dim = Internal.getNodeFromName1(dim, 'EquationDimension') dim = Internal.getValue(dim) - if dim == 2: + if dim == 2: # in 2D, the case must be in XY plane C._initVars(CTK.t, 'CoordinateZ', 0.) @@ -330,7 +330,7 @@ def prepare(tinit=None): CTK.t, tc = myApp.prepare(CTK.t, t_out='t.cgns', tc_out='tc.cgns') # Preparation pour le front 42 - #CTK.t, tc = myApp.prepare(CTK.t, t_out='t.cgns', tc_out='tc.cgns', vmin=21, + #CTK.t, tc = myApp.prepare(CTK.t, t_out='t.cgns', tc_out='tc.cgns', vmin=21, # tbox=tbox, check=False, tinit=tinit, frontType=42, yplus=150.) return None @@ -365,17 +365,17 @@ def compute(nrun): myApp = App.IBM(format='single') myApp.set(numb={ - "temporal_scheme": temporal_scheme, - "ss_iteration": ss_iteration, - "omp_mode": 1, - "modulo_verif": 50 + "temporal_scheme": temporal_scheme, + "ss_iteration": ss_iteration, + "omp_mode": 1, + "modulo_verif": 50 }) myApp.set(numz={ - "time_step": val, - "scheme": scheme, - "time_step_nature": time_step_nature, - "cfl": val + "time_step": val, + "scheme": scheme, + "time_step_nature": time_step_nature, + "cfl": val }) nit = VARS[9].get() # nbre d'iterations a faire @@ -428,7 +428,7 @@ def compute(nrun): C.convertPyTree2File(tc, 'tc_restart.cgns') # optional plots - if CTK.TKPLOTXY is not None: + if CTK.TKPLOTXY is not None: updateWallPlot(WALL) updateLoadPlot(CL, CD, NITRUN, nit) return None @@ -465,7 +465,7 @@ def updateWallPlot(walls): wallsz = Internal.getZones(walls) for c, b in enumerate(Internal.getBases(BODY)): zones = Internal.getZones(b) - if zones: + if zones: n = Internal.getNodeFromPath(zones[0], '.Solver#define/extractWalls') if n is not None: v = Internal.getValue(n) @@ -507,7 +507,7 @@ def updateLoadPlot(CL, CD, nitrun, nit): outCL = []; outCD = [] for c, b in enumerate(Internal.getBases(BODY)): zones = Internal.getZones(b) - if zones: + if zones: n = Internal.getNodeFromPath(zones[0], '.Solver#define/extractLoads') if n is not None: v = Internal.getValue(n) @@ -701,7 +701,7 @@ def displaySlices(): def createApp(win): # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, - text='tkFastSolver [ + ] ', font=CTK.FRAMEFONT, + text='tkFastSolver [ + ] ', font=CTK.FRAMEFONT, takefocus=1) Frame.bind('', hideApp) Frame.bind('', displayFrameMenu) diff --git a/Cassiopee/CPlot/apps/tkFilter.py b/Cassiopee/CPlot/apps/tkFilter.py index 662ad209c..cdaee3d07 100644 --- a/Cassiopee/CPlot/apps/tkFilter.py +++ b/Cassiopee/CPlot/apps/tkFilter.py @@ -62,7 +62,7 @@ def setFilter(event=None): for i in familySelect: listFmlySlct.append(i[0]) del familySelect for b in bases: - baseName = b[0] + baseName = b[0] for z in b[2]: if z[3] == 'Zone_t': zoneName = baseName + '/' + z[0] @@ -284,7 +284,7 @@ def setFilter(event=None): for z in b[2]: if z[3] == 'Zone_t': i = CPlot.getCPlotNumber(CTK.t, b[0], z[0]) - active.append((i,1)) + active.append((i,1)) elif prios == [] and prio == 0: for z in b[2]: if z[3] == 'Zone_t': @@ -325,12 +325,12 @@ def setFilter(event=None): return b1 = formula.find('==') formula1 = formula; formula2 = formula - if b1 != -1: + if b1 != -1: formula1 = formula.replace('==', '<=') formula2 = formula.replace('==', '>=') else: b1 = formula.find('=') - if b1 != -1: + if b1 != -1: formula1 = formula.replace('=', '<=') formula2 = formula.replace('=', '>=') @@ -401,7 +401,7 @@ def createApp(win): B = TTK.OptionMenu(Frame, VARS[1], 'By Zone name', 'By Zone family' ,'By size >', 'By size <', 'By MG lvl =', 'By MG lvl !=', - 'By proc', 'By priority', 'By number', + 'By proc', 'By priority', 'By number', 'By formula (or)', 'By formula (and)') BB = CTK.infoBulle(parent=B, text='Filter criteria.') B.grid(row=0, column=1, sticky=TK.EW) diff --git a/Cassiopee/CPlot/apps/tkFind.py b/Cassiopee/CPlot/apps/tkFind.py index a11fbe21b..0d01b1fc5 100644 --- a/Cassiopee/CPlot/apps/tkFind.py +++ b/Cassiopee/CPlot/apps/tkFind.py @@ -120,7 +120,7 @@ def extract(event=None): else: # unstruct a = T.subzone(z, inds, type='elements') b = Internal.createUniqueChild(CTK.t, 'EXTRACT', 'CGNSBase_t') - nob = C.getNobOfBase(b, CTK.t) + nob = C.getNobOfBase(b, CTK.t) CTK.add(CTK.t, nob, -1, a) except: pass #zp = C.node2Center(z) diff --git a/Cassiopee/CPlot/apps/tkFixer.py b/Cassiopee/CPlot/apps/tkFixer.py index b4af1e814..d0a2787b2 100644 --- a/Cassiopee/CPlot/apps/tkFixer.py +++ b/Cassiopee/CPlot/apps/tkFixer.py @@ -90,7 +90,7 @@ def fixGap(): CTK.saveTree() CTK.t[2][1][2].append(b) #C._fillMissingVariables(CTK.t) - CTK.TXT.insert('START', 'Gap fixed.\n') + CTK.TXT.insert('START', 'Gap fixed.\n') (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() CTK.display(CTK.t) diff --git a/Cassiopee/CPlot/apps/tkFixer2.py b/Cassiopee/CPlot/apps/tkFixer2.py index 90fd665d9..01e30b2ec 100644 --- a/Cassiopee/CPlot/apps/tkFixer2.py +++ b/Cassiopee/CPlot/apps/tkFixer2.py @@ -108,7 +108,7 @@ def fixGaps(): CTK.t[2][nob0][2] += b #C._fillMissingVariables(CTK.t) - CTK.TXT.insert('START', 'Gaps fixed.\n') + CTK.TXT.insert('START', 'Gaps fixed.\n') (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() CTK.display(CTK.t) @@ -127,7 +127,7 @@ def conformUnstr(): tol = CTK.varsFromWidget(VARS[1].get(), type=1) if len(tol) != 1: - CTK.TXT.insert('START', 'Tolerance is incorrect.\n') + CTK.TXT.insert('START', 'Tolerance is incorrect.\n') CTK.TXT.insert('START', 'Error: ', 'Error'); return tol = tol[0] @@ -221,15 +221,15 @@ def forceMatch(): tol = CTK.varsFromWidget(VARS[3].get(), type=1) if len(tol) != 1: - CTK.TXT.insert('START', 'Tolerance is incorrect.\n') + CTK.TXT.insert('START', 'Tolerance is incorrect.\n') CTK.TXT.insert('START', 'Error: ', 'Error'); return tol = tol[0] #P1 = CTK.varsFromWidget(VARS[4].get(), type=1) #P2 = CTK.varsFromWidget(VARS[5].get(), type=1) - #if len(nzs) != 2: - # CTK.TXT.insert('START', 'Need two patches.\n') + #if len(nzs) != 2: + # CTK.TXT.insert('START', 'Need two patches.\n') # CTK.TXT.insert('START', 'Error: ', 'Error'); return CTK.setCursor(2, WIDGETS['forceMatch']) @@ -300,12 +300,12 @@ def forceMatch(): if z[0] == sname[1]: c2.append(z) if c2 != []: c2 = T.join(c2) - if c1 == [] and c2 == []: + if c1 == [] and c2 == []: G._close(z1, tol) if z2 is not None: G._close(z2, tol) elif c1 != [] and c2 != []: G._forceMatch(z1, z2, C1=c1, C2=c2) - else: + else: G._forceMatch(z1, z2, tol=tol) # Try merge @@ -368,7 +368,7 @@ def getFix(t): if dim[3] == 'TRI': zonesF.append(z) try: ext = P.exteriorFaces(zonesF) except: ext = [] - if ext != []: + if ext != []: ext = T.splitManifold(ext) #ext = T.splitSharpEdges(ext) return ext @@ -441,7 +441,7 @@ def createApp(win): # - VARS - # -0- mode pour gapsmanager - - V = TK.StringVar(win); V.set('Nodes'); VARS.append(V) + V = TK.StringVar(win); V.set('Nodes'); VARS.append(V) # -1- tol pour conformUnstr - V = TK.StringVar(win); V.set('0.'); VARS.append(V) # -2- checkbox if split in conformization @@ -532,7 +532,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Tolerance used in forceMatch operations.') B = TTK.Checkbutton(Frame, text='', variable=VARS[10], command=toggleFix) BB = CTK.infoBulle(parent=B, text='Show curves to fix.') - B.grid(row=4, column=3, sticky=TK.EW) + B.grid(row=4, column=3, sticky=TK.EW) #============================================================================== # Called to display widgets diff --git a/Cassiopee/CPlot/apps/tkHats.py b/Cassiopee/CPlot/apps/tkHats.py index 552c10bd3..44ee19568 100644 --- a/Cassiopee/CPlot/apps/tkHats.py +++ b/Cassiopee/CPlot/apps/tkHats.py @@ -41,7 +41,7 @@ def extractBodies(): CTK.TXT.insert('START', 'Walls extracted.\n') (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() - CTK.display(CTK.t) + CTK.display(CTK.t) #============================================================================== def stitchedHat(): @@ -97,7 +97,7 @@ def pointedHat(): CTK.TXT.insert('START', 'Pointed hat created.\n') (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() - CPlot.render() + CPlot.render() return #============================================================================== @@ -111,7 +111,7 @@ def closeBody(): #============================================================================== def createApp(win): # - Frame - - Frame = TK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, + Frame = TK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, text='tkHats [ + ] ', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='Fix holes with hats.\nCtrl+w to close applet.', temps=0, btype=1) Frame.bind('', hideApp) @@ -126,7 +126,7 @@ def createApp(win): V = TK.StringVar(win); V.set('1.e-5;1.e-5'); VARS.append(V) # -2- stitchedHat : offx,offy,offz V = TK.StringVar(win); V.set('0.;0.;0.'); VARS.append(V) - # -3- pointedHat : x,y,z + # -3- pointedHat : x,y,z V = TK.StringVar(win); V.set('0.;0.;0.'); VARS.append(V) # - create hat - diff --git a/Cassiopee/CPlot/apps/tkIBC.py b/Cassiopee/CPlot/apps/tkIBC.py index 784e28a06..68a7fd33d 100644 --- a/Cassiopee/CPlot/apps/tkIBC.py +++ b/Cassiopee/CPlot/apps/tkIBC.py @@ -68,7 +68,7 @@ def symmetrize(): if axis == 'Around XY-': dir_sym = 1 elif axis == 'Around XZ-': dir_sym = 2 - elif axis == 'Around YZ-': dir_sym = 3 + elif axis == 'Around YZ-': dir_sym = 3 D_IBM._symetrizePb(CTK.t, bodySymName, snear_sym, dir_sym=dir_sym) CTK.TXT.insert('START', 'Symmetry plane has been created with snear=%f.\n'%snear_sym) @@ -120,7 +120,7 @@ def ViewUndefinedIBC(): ZoneLocal = [] bases = CTK.t[2][1:] for b in bases: - for zone in Internal.getZones(b): + for zone in Internal.getZones(b): n = Internal.getNodeFromPath(zone, '.Solver#define/snear') if n is not None: val = Internal.getValue(n) @@ -149,7 +149,7 @@ def ViewUndefinedIBC(): def ViewAllDefinedIBC(t): natives = set() zones = Internal.getZones(t) - for zone in zones: + for zone in zones: n = Internal.getNodeFromPath(zone, '.Solver#define/ibctype') if n is not None: natives.add(Internal.getValue(n)) @@ -179,7 +179,7 @@ def updateIBCNameList(event=None): def ViewIBC(event=None): if CTK.t == []: return - nz = len(Internal.getZones(CTK.t)) + nz = len(Internal.getZones(CTK.t)) nzs = CPlot.getActiveZones() active = [(i,1) for i in range(nz)] CPlot.setActiveZones(active) @@ -194,7 +194,7 @@ def ViewIBC(event=None): ZoneLocal = [] bases = CTK.t[2][1:] for b in bases: - for zone in Internal.getZones(b): + for zone in Internal.getZones(b): n = Internal.getNodeFromPath(zone, '.Solver#define/ibctype') if n is not None: @@ -263,7 +263,7 @@ def getData(): def createApp(win): # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, - text='tkIBC [ + ] ', font=CTK.FRAMEFONT, + text='tkIBC [ + ] ', font=CTK.FRAMEFONT, takefocus=1) Frame.bind('', hideApp) Frame.bind('', displayFrameMenu) @@ -329,7 +329,7 @@ def createApp(win): B = TTK.Button(Frame, text="Set symmetry plane", command=symmetrize) B.grid(row=4, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, - text='Create a symmetry plane.') + text='Create a symmetry plane.') B = TTK.OptionMenu(Frame, VARS[7], 'Around YZ-', 'Around XZ-', 'Around XY-') B.grid(row=4, column=1, columnspan=2, sticky=TK.EW) @@ -375,8 +375,8 @@ def createApp(win): LB.bind('', ViewIBC) LB.bind('', updateIBCNameList) for i, value in enumerate(['-All IBC-']+ViewAllDefinedIBC(CTK.t)): LB.insert(i, value) - SB.config(command = LB.yview) - LB.config(yscrollcommand = SB.set) + SB.config(command=LB.yview) + LB.config(yscrollcommand=SB.set) LB.grid(row=0, column=0, sticky=TK.NSEW) SB.grid(row=0, column=1, sticky=TK.NSEW) WIDGETS['IBCLB'] = LB diff --git a/Cassiopee/CPlot/apps/tkIBC2.py b/Cassiopee/CPlot/apps/tkIBC2.py index b1e008346..b9a9bcf1f 100644 --- a/Cassiopee/CPlot/apps/tkIBC2.py +++ b/Cassiopee/CPlot/apps/tkIBC2.py @@ -71,7 +71,7 @@ def _setDataInZone(z, bLocal, snear, ibctype, dfar, inv): -# Change the mode +# Change the mode def setMode(event=None): mode = VARS[1].get() if mode == 'wall': VARS[1].set('noslip') @@ -95,7 +95,7 @@ def setMode(event=None): elif mode == 'rectilinear': imode = 0; WIDGETS['rec'].grid(row=10, column=0, columnspan=3, sticky=TK.EW) elif mode == 'wiremodel': - imode = 0; WIDGETS['wmm'].grid(row=10, column=0, columnspan=3, sticky=TK.EW) + imode = 0; WIDGETS['wmm'].grid(row=10, column=0, columnspan=3, sticky=TK.EW) CPlot.setState(mode=imode) CTK.TXT.insert('START', 'Mode %s displayed.\n'%mode) @@ -126,7 +126,7 @@ def symmetrize(): if axis == 'Around XY-': dir_sym = 1 elif axis == 'Around XZ-': dir_sym = 2 - elif axis == 'Around YZ-': dir_sym = 3 + elif axis == 'Around YZ-': dir_sym = 3 D_IBM._symetrizePb(CTK.t, bodySymName, snear_sym, dir_sym=dir_sym) CTK.TXT.insert('START', 'Symmetry plane has been created with snear=%f.\n'%snear_sym) @@ -179,7 +179,7 @@ def ViewUndefinedIBC(): ZoneLocal = [] bases = CTK.t[2][1:] for b in bases: - for zone in Internal.getZones(b): + for zone in Internal.getZones(b): n = Internal.getNodeFromPath(zone, '.Solver#define/snear') if n is not None: val = Internal.getValue(n) @@ -208,7 +208,7 @@ def ViewUndefinedIBC(): def ViewAllDefinedIBC(t): natives = set() zones = Internal.getZones(t) - for zone in zones: + for zone in zones: n = Internal.getNodeFromPath(zone, '.Solver#define/ibctype') if n is not None: natives.add(Internal.getValue(n)) @@ -238,7 +238,7 @@ def updateIBCNameList(event=None): def ViewIBC(event=None): if CTK.t == []: return - nz = len(Internal.getZones(CTK.t)) + nz = len(Internal.getZones(CTK.t)) nzs = CPlot.getActiveZones() active = [(i,1) for i in range(nz)] CPlot.setActiveZones(active) @@ -253,7 +253,7 @@ def ViewIBC(event=None): ZoneLocal = [] bases = CTK.t[2][1:] for b in bases: - for zone in Internal.getZones(b): + for zone in Internal.getZones(b): n = Internal.getNodeFromPath(zone, '.Solver#define/ibctype') if n is not None: @@ -323,7 +323,7 @@ def getData(): def createApp(win): # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, - text='tkIBC2 [ + ] ', font=CTK.FRAMEFONT, + text='tkIBC2 [ + ] ', font=CTK.FRAMEFONT, takefocus=1) Frame.bind('', hideApp) Frame.bind('', displayFrameMenu) @@ -429,8 +429,8 @@ def createApp(win): LB.bind('', ViewIBC) LB.bind('', updateIBCNameList) for i, value in enumerate(['-All IBC-']+ViewAllDefinedIBC(CTK.t)): LB.insert(i, value) - SB.config(command = LB.yview) - LB.config(yscrollcommand = SB.set) + SB.config(command=LB.yview) + LB.config(yscrollcommand=SB.set) LB.grid(row=0, column=0, sticky=TK.NSEW) SB.grid(row=0, column=1, sticky=TK.NSEW) WIDGETS['IBCLB'] = LB diff --git a/Cassiopee/CPlot/apps/tkIBCWorflow.py b/Cassiopee/CPlot/apps/tkIBCWorflow.py index 408238e84..f55db8170 100644 --- a/Cassiopee/CPlot/apps/tkIBCWorflow.py +++ b/Cassiopee/CPlot/apps/tkIBCWorflow.py @@ -44,11 +44,11 @@ def getIBCFrontForZone__(a): #============================================================================== # Calcul de la normale et de delta pour les pts du front # IN: fc1: front IBC sous forme de zone -# IN: parentZone: zone dont provient la zone IBC, localisee comme +# IN: parentZone: zone dont provient la zone IBC, localisee comme # souhaitee pour les interpolations (ex en centres avec cell fict) -# OUT: front fc1 avec delta +# OUT: front fc1 avec delta # la normale = delta * grad TurbulentDistance -# l'indice global dans le maillage parent correspondant au pt IBC +# l'indice global dans le maillage parent correspondant au pt IBC #============================================================================== def getIBCFrontInfo__(fc1, parentZone, dhloc, toldist=1.e-10): listPts = [] # on ne modifie pas localement le maillage @@ -93,7 +93,7 @@ def getIBCFrontInfo__(fc1, parentZone, dhloc, toldist=1.e-10): if dxloc < toldist: dxloc = 1.e10 if dyloc < toldist: dyloc = 1.e10 - if dzloc < toldist: dzloc = 1.e10 + if dzloc < toldist: dzloc = 1.e10 dhLoc[ind] = min(dxloc,dyloc,dzloc) C.setFields([coords1], fc1, loc='nodes') @@ -113,9 +113,9 @@ def getIBCFrontInfo__(fc1, parentZone, dhloc, toldist=1.e-10): dist = distance[0,ind] # NOUVELLE VERSION # # cas 1 : le centre est proche paroi, le point interpole est alors positionne a dhloc+eps de la paroi - # if abs(dist) < dhLoc[ind]: deltaa[1][0,ind] = 2*dhLoc[ind] + eps + # if abs(dist) < dhLoc[ind]: deltaa[1][0,ind] = 2*dhLoc[ind] + eps # # cas 2 : le centre est loin de la paroi, le point interpole est alors positionne a dist+eps de la paroi - # else: deltaa[1][0,ind] = 2.*abs(dist) + eps + # else: deltaa[1][0,ind] = 2.*abs(dist) + eps # FIN NOUVELLE VERSION # cas 1 : le centre est proche paroi, le point interpole est alors positionne a dhloc+eps de la paroi @@ -155,7 +155,7 @@ def setSurface(): VARS[5].set(selected) #============================================================================== -# blanking de la selection avec la surface fournie +# blanking de la selection avec la surface fournie #============================================================================== def blank(): if CTK.t == []: return @@ -216,13 +216,13 @@ def blank(): t = X.setHoleInterpolatedPoints(t, depth=-depth) tp = C.newPyTree(['Base']); donorNoz=[] - for noz in range(len(t[2][1][2])): + for noz in range(len(t[2][1][2])): z = t[2][1][2][noz] valmax = C.getMaxValue(z, 'centers:cellN') if valmax == 2.: tp[2][1][2].append(z); donorNoz.append(noz) tp = DTW.distance2Walls(tp, surfaces, type='ortho', loc='centers', signed=1,dim=dimPb) - tp = Internal.correctPyTree(tp, level= 6) + tp = Internal.correctPyTree(tp, level=6) tp = C.center2Node(tp,'centers:TurbulentDistance') tp = P.computeGrad(tp, 'TurbulentDistance') for noz2 in range(len(donorNoz)): @@ -241,7 +241,7 @@ def blank(): C._fillMissingVariables(CTK.t) CTK.TXT.insert('START', 'Blanking done.\n') CTK.TKTREE.updateApp() - CTK.display(CTK.t) + CTK.display(CTK.t) #============================================================================== def getIBCFront(): @@ -273,7 +273,7 @@ def getIBCFront(): if nghostcells > 0: td = Internal.addGhostCells(td, td, nghostcells, adaptBCs=0) if locD == 'centers': td = C.node2Center(td) - elif locD == 'ext_centers': td = C.node2ExtCenter(td) + elif locD == 'ext_centers': td = C.node2ExtCenter(td) CTK.saveTree() # dhloc : distmin a partir de laquelle on peut symetriser fc1 @@ -296,7 +296,7 @@ def getIBCFront(): if interpType == '2nd order': interpOrder = 2 elif interpType == '3rd order Lagrangian': interpOrder = 3 elif interpType == '5th order Lagrangian': interpOrder = 5 - front2 = X.setInterpData(front2, td, order=interpOrder,loc='nodes',penalty=1,nature=0) + front2 = X.setInterpData(front2, td, order=interpOrder,loc='nodes',penalty=1,nature=0) front2 = C.rmNodes(front2,Internal.__FlowSolutionCenters__) CTK.t = C.addBase2PyTree(CTK.t, 'IBCFront') @@ -306,7 +306,7 @@ def getIBCFront(): C._fillMissingVariables(CTK.t) CTK.t = C.rmVars(CTK.t,'centers:cellN') - CTK.TXT.insert('START', 'IBC front zones added.\n') + CTK.TXT.insert('START', 'IBC front zones added.\n') (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() CPlot.render() @@ -339,7 +339,7 @@ def createApp(win): # -1- Blanking surface V = TK.StringVar(win); V.set(''); VARS.append(V) # -2- delta XRay - - V = TK.StringVar(win); V.set('1.e-10'); VARS.append(V) + V = TK.StringVar(win); V.set('1.e-10'); VARS.append(V) # -3- tolerance XRay - V = TK.StringVar(win); V.set('1.e-8'); VARS.append(V) # -4- blank inside bodies - outside @@ -347,9 +347,9 @@ def createApp(win): # -5- Blanking surface V = TK.StringVar(win); V.set(''); VARS.append(V) # -6- Nb de rangees de pts du front1 - V = TK.StringVar(win); V.set('2'); VARS.append(V) + V = TK.StringVar(win); V.set('2'); VARS.append(V) # -7- Nb de rangees de ghost cells du maillage donneur - V = TK.StringVar(win); V.set('0'); VARS.append(V) + V = TK.StringVar(win); V.set('0'); VARS.append(V) # -8- Localisation du maillage donneur V = TK.StringVar(win); V.set('centers'); VARS.append(V) # -9- distance minimale a la paroi des pts du front interieur pour pouvoir construire le symetrique @@ -445,7 +445,7 @@ def createApp(win): B.grid(row=r, column=1, sticky=TK.EW) r += 1 - # - interpolation type : + # - interpolation type : B = TTK.Label(Frame, text="Interpolation type") B.grid(row=r, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Interpolation type of IBC points.') @@ -455,7 +455,7 @@ def createApp(win): r += 1 - # - create IBC front - + # - create IBC front - B = TTK.Button(Frame, text="Create IBC front", command=getIBCFront) B.grid(row=r, column=0, columnspan=4, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Create inside front.') diff --git a/Cassiopee/CPlot/apps/tkIJK.py b/Cassiopee/CPlot/apps/tkIJK.py index 56ed52e19..64da541e4 100644 --- a/Cassiopee/CPlot/apps/tkIJK.py +++ b/Cassiopee/CPlot/apps/tkIJK.py @@ -88,7 +88,7 @@ def show(event=None): if CTK.__MAINTREE__ == CTK.MAIN: CTK.__MAINACTIVEZONES__ = CPlot.getActiveZones() active = [] - tp = Internal.appendBaseName2ZoneName(CTK.t, updateRef=False, + tp = Internal.appendBaseName2ZoneName(CTK.t, updateRef=False, separator=Internal.SEP1) for z in CTK.__MAINACTIVEZONES__: active.append(tp[2][CTK.Nb[z]+1][2][CTK.Nz[z]]) @@ -121,7 +121,7 @@ def show(event=None): #zp = P.sharpEdges(zp) zp = [] exts += zp - CTK.dt[2][2][2] += exts + CTK.dt[2][2][2] += exts # deactivate les zones exts lenZ = len(CTK.dt[2][1][2]); lenExts = len(CTK.dt[2][2][2]) @@ -155,7 +155,7 @@ def extract(event=None): if CTK.__MAINTREE__ == 1: CTK.__MAINACTIVEZONES__ = CPlot.getActiveZones() active = [] - tp = Internal.appendBaseName2ZoneName(CTK.t, updateRef=False, + tp = Internal.appendBaseName2ZoneName(CTK.t, updateRef=False, separator=Internal.SEP1) for z in CTK.__MAINACTIVEZONES__: active.append(tp[2][CTK.Nb[z]+1][2][CTK.Nz[z]]) @@ -198,7 +198,7 @@ def viewIJK(event=None): nzs = CPlot.getSelectedZones() if nzs == []: CTK.TXT.insert('START', 'Selection is empty.\n') - CTK.TXT.insert('START', 'Error: ', 'Error'); return + CTK.TXT.insert('START', 'Error: ', 'Error'); return sel = [] for nz in nzs: nob = CTK.Nb[nz]+1 @@ -279,7 +279,7 @@ def createApp(win): # - Subzone indices - F = TTK.LabelFrame(Frame, borderwidth=2, relief=CTK.FRAMESTYLE, - text='I', font=CTK.FRAMEFONT, takefocus=1) + text='I', font=CTK.FRAMEFONT, takefocus=1) F.columnconfigure(0, weight=1) F.columnconfigure(1, weight=1) F.columnconfigure(2, weight=0) @@ -331,7 +331,7 @@ def createApp(win): B.grid(row=1, column=2, columnspan=1, sticky=TK.EW) F = TTK.LabelFrame(Frame, borderwidth=2, relief=CTK.FRAMESTYLE, - text='K', font=CTK.FRAMEFONT, takefocus=1) + text='K', font=CTK.FRAMEFONT, takefocus=1) F.columnconfigure(0, weight=1) F.columnconfigure(1, weight=1) F.columnconfigure(2, weight=0) diff --git a/Cassiopee/CPlot/apps/tkInit.py b/Cassiopee/CPlot/apps/tkInit.py index a35d2d319..43bfcb1e2 100644 --- a/Cassiopee/CPlot/apps/tkInit.py +++ b/Cassiopee/CPlot/apps/tkInit.py @@ -47,7 +47,7 @@ def initSolution(): if eqs is not None: Model = Internal.getValue(eqs) zvars = ['Density', 'MomentumX', 'MomentumY', 'MomentumZ', - 'EnergyStagnationDensity'] + 'EnergyStagnationDensity'] for v in zvars: node = Internal.getNodeFromName(state, v) if node is not None: @@ -59,7 +59,7 @@ def initSolution(): return if Model == 'NSTurbulent': zvars = ['TurbulentSANuTildeDensity', 'TurbulentEnergyKineticDensity', - 'TurbulentDissipationDensity'] + 'TurbulentDissipationDensity'] for v in zvars: node = Internal.getNodeFromName(state, v) if node is not None: diff --git a/Cassiopee/CPlot/apps/tkInteg.py b/Cassiopee/CPlot/apps/tkInteg.py index 434f6bb07..ec9f82957 100644 --- a/Cassiopee/CPlot/apps/tkInteg.py +++ b/Cassiopee/CPlot/apps/tkInteg.py @@ -168,7 +168,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Variable 1 (v1).') WIDGETS['variable1'] = B else: - B = ttk.Combobox(F, textvariable=VARS[2], + B = ttk.Combobox(F, textvariable=VARS[2], values=[], state='readonly', width=10) B.grid(sticky=TK.EW) F.bind('', updateVarNameList1_2) @@ -186,7 +186,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Variable 2 (v2).') WIDGETS['variable2'] = B else: - B = ttk.Combobox(F, textvariable=VARS[3], + B = ttk.Combobox(F, textvariable=VARS[3], values=[], state='readonly', width=10) B.grid(sticky=TK.EW) F.bind('', updateVarNameList2_2) @@ -204,7 +204,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Variable 3 (v3).') WIDGETS['variable3'] = B else: - B = ttk.Combobox(F, textvariable=VARS[4], + B = ttk.Combobox(F, textvariable=VARS[4], values=[], state='readonly', width=10) B.grid(sticky=TK.EW) F.bind('', updateVarNameList3_2) diff --git a/Cassiopee/CPlot/apps/tkIsoLine.py b/Cassiopee/CPlot/apps/tkIsoLine.py index 8d32b5b2f..2047d5f5e 100644 --- a/Cassiopee/CPlot/apps/tkIsoLine.py +++ b/Cassiopee/CPlot/apps/tkIsoLine.py @@ -184,20 +184,20 @@ def createApp(win): V = TK.StringVar(win); V.set('CoordinateX'); VARS.append(V) # -1- nlevels - V = TK.StringVar(win); V.set('25'); VARS.append(V) - if 'tkIsoLineLevels' in CTK.PREFS: + if 'tkIsoLineLevels' in CTK.PREFS: V.set(CTK.PREFS['tkIsoLineLevels']) # -2- value - V = TK.StringVar(win); V.set('1.'); VARS.append(V) - if 'tkIsoLineValue' in CTK.PREFS: + if 'tkIsoLineValue' in CTK.PREFS: V.set(CTK.PREFS['tkIsoLineValue']) # -3- min iso V = TK.StringVar(win); V.set('MIN'); VARS.append(V) - if 'tkIsoLineMin' in CTK.PREFS: + if 'tkIsoLineMin' in CTK.PREFS: V.set(CTK.PREFS['tkIsoLineMin']) # -4- max iso V = TK.StringVar(win); V.set('MAX'); VARS.append(V) V = TK.StringVar(win); V.set('MIN'); VARS.append(V) - if 'tkIsoLineMax' in CTK.PREFS: + if 'tkIsoLineMax' in CTK.PREFS: V.set(CTK.PREFS['tkIsoLineMax']) # - field name - @@ -214,7 +214,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Extracted field.') WIDGETS['field'] = B else: - B = ttk.Combobox(F, textvariable=VARS[0], + B = ttk.Combobox(F, textvariable=VARS[0], values=[], state='readonly') B.grid(sticky=TK.EW) F.bind('', updateVarNameList2) diff --git a/Cassiopee/CPlot/apps/tkIsoSurf.py b/Cassiopee/CPlot/apps/tkIsoSurf.py index b7c99f54a..fd9614174 100644 --- a/Cassiopee/CPlot/apps/tkIsoSurf.py +++ b/Cassiopee/CPlot/apps/tkIsoSurf.py @@ -152,7 +152,7 @@ def createApp(win): V = TK.StringVar(win); V.set('CoordinateX'); VARS.append(V) # -1- value - V = TK.StringVar(win); V.set('1.'); VARS.append(V) - if 'tkIsoSurfValue' in CTK.PREFS: + if 'tkIsoSurfValue' in CTK.PREFS: V.set(CTK.PREFS['tkIsoSurfValue']) # - field name - @@ -167,7 +167,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Extracted field.') WIDGETS['field'] = B else: - B = ttk.Combobox(F, textvariable=VARS[0], + B = ttk.Combobox(F, textvariable=VARS[0], values=[], state='readonly', width=10) B.grid(sticky=TK.EW) F.bind('', updateVarNameList2) diff --git a/Cassiopee/CPlot/apps/tkLuxRender.py b/Cassiopee/CPlot/apps/tkLuxRender.py index 489568544..99f50d251 100644 --- a/Cassiopee/CPlot/apps/tkLuxRender.py +++ b/Cassiopee/CPlot/apps/tkLuxRender.py @@ -188,7 +188,7 @@ def writeChrome0(file, dict, c, colorR, colorG, colorB, scale): name = 'chrome' if name not in dict: dict[name] = 0 - file.write('MakeNamedMaterial "material'+str(c)+'"\n') + file.write('MakeNamedMaterial "material'+str(c)+'"\n') file.write(' "float film" [0.000000000000000]\n') file.write(' "float filmindex" [1.333299994468689]\n') #file.write(' "color Kr" [0.69999999 0.69999999 0.69999999]\n') @@ -210,7 +210,7 @@ def writeMetal0(file, dict, c, colorR, colorG, colorB, scale): name = 'metal' if name not in dict: dict[name] = 0 - file.write('MakeNamedMaterial "material'+str(c)+'"\n') + file.write('MakeNamedMaterial "material'+str(c)+'"\n') file.write(' "bool multibounce" ["false"]\n') file.write(' "color Kd" ['+str(colorR)+' '+str(colorG)+' '+str(colorB)+']\n') #file.write(' "color Kd" [0.11725003 0.11927158 0.10916383]\n') @@ -255,7 +255,7 @@ def writeMarble0(file, dict, c, colorR, colorG, colorB, scale): file.write(' "color tex2" ['+str(colorR)+' '+str(colorG)+' '+str(colorB)+']\n') file.write('\n') - file.write('MakeNamedMaterial "material'+str(c)+'"\n') + file.write('MakeNamedMaterial "material'+str(c)+'"\n') file.write(' "bool multibounce" ["false"]\n') file.write(' "texture Kd" ["Texture.002"]\n') file.write(' "color Ks" [0.07657672 0.07657672 0.07657672]\n') @@ -301,7 +301,7 @@ def writeWood0(file, dict, c, colorR, colorG, colorB, scale): file.write(' "string coordinates" ["local"]\n') file.write(' "vector translate" [0.0 0.0 0.0]\n') file.write(' "vector rotate" [0.0 0.0 0.0]\n') - file.write(' "vector scale" ['+str(scale)+' '+str(scale)+' '+str(scale)+']\n') + file.write(' "vector scale" ['+str(scale)+' '+str(scale)+' '+str(scale)+']\n') file.write('\n') file.write('Texture "wood alder mix" "float" "mix"\n') @@ -374,7 +374,7 @@ def writeCassiopeeLamps(file): n = Vector.mul(0.4*norm, n) pos = Vector.sub(eye, n) - if type == 'Interior': pass + if type == 'Interior': pass ## # distant light ## file.write('AttributeBegin\n') ## file.write('LightGroup "default"\n') @@ -599,15 +599,15 @@ def createApp(win): # - VARS - # -0- Image size V = TK.StringVar(win); V.set('800x600'); VARS.append(V) - if 'tkLuxRenderSize' in CTK.PREFS: + if 'tkLuxRenderSize' in CTK.PREFS: V.set(CTK.PREFS['tkLuxRenderSize']) # -1- Rep name V = TK.StringVar(win); V.set('LuxRender'); VARS.append(V) - if 'tkLuxRenderOutput' in CTK.PREFS: + if 'tkLuxRenderOutput' in CTK.PREFS: V.set(CTK.PREFS['tkLuxRenderOutput']) # -2- Interior / exterior - V = TK.StringVar(win); V.set('Exterior'); VARS.append(V) - if 'tkLuxRenderType' in CTK.PREFS: + V = TK.StringVar(win); V.set('Exterior'); VARS.append(V) + if 'tkLuxRenderType' in CTK.PREFS: V.set(CTK.PREFS['tkLuxRenderType']) # - Type of scene diff --git a/Cassiopee/CPlot/apps/tkMMGs.py b/Cassiopee/CPlot/apps/tkMMGs.py index 8a9b678b8..fd2b48e6b 100644 --- a/Cassiopee/CPlot/apps/tkMMGs.py +++ b/Cassiopee/CPlot/apps/tkMMGs.py @@ -133,8 +133,8 @@ def remesh(): nob = CTK.Nb[nz]+1 noz = CTK.Nz[nz] z = CTK.t[2][nob][2][noz] - zp = G.mmgs(z, ridgeAngle=ridgeAngle, hausd=hausd, - hmin=hmin, hmax=hmax, optim=optim, + zp = G.mmgs(z, ridgeAngle=ridgeAngle, hausd=hausd, + hmin=hmin, hmax=hmax, optim=optim, fixedConstraints=fixedConstraints, sizeConstraints=sizeConstraints) CTK.replace(CTK.t, nob, noz, zp) diff --git a/Cassiopee/CPlot/apps/tkMapEdge.py b/Cassiopee/CPlot/apps/tkMapEdge.py index d390fc858..acc64afdd 100644 --- a/Cassiopee/CPlot/apps/tkMapEdge.py +++ b/Cassiopee/CPlot/apps/tkMapEdge.py @@ -32,7 +32,7 @@ def copyDistrib1D(source): try: zp = G.map(z, source, 1) cad = Internal.getNodeFromName1(z, 'CAD') - if cad is not None: zp[2].append(cad) + if cad is not None: zp[2].append(cad) CTK.replace(CTK.t, nob, noz, zp) except Exception as e: fail = True; errors += [0,str(e)] @@ -193,7 +193,7 @@ def enforceH(event=None): zones.append(z) npts = C.getNPts(zones) if VARS[9].get() == 'NFactor': N = v*npts - else: N = v + else: N = v D._enforceh(zones, N=N) for c, nz in enumerate(nzs): nob = CTK.Nb[nz]+1 @@ -357,7 +357,7 @@ def apply2D(density, h, npts, factor, ntype=0): C._initVars(distrib, 'CoordinateZ', 0.) distrib = C.rmVars(distrib, 's') bornes = P.exteriorFaces(distrib) - distrib = T.smooth(distrib, eps=eps, niter=niter, + distrib = T.smooth(distrib, eps=eps, niter=niter, fixedConstraints=[bornes]) b = G.map(i, distrib, 1) dimb = Internal.getZoneDim(b) @@ -479,7 +479,7 @@ def apply3D(density, h, npts, factor, ntype): C._initVars(distrib, 'CoordinateZ', 0.) distrib = C.rmVars(distrib, 's') bornes = P.exteriorFaces(distrib) - distrib = T.smooth(distrib, eps=eps, niter=niter, + distrib = T.smooth(distrib, eps=eps, niter=niter, fixedConstraints=[bornes]) b = G.map(i, distrib, 1) dimb = Internal.getZoneDim(b) @@ -652,7 +652,7 @@ def getEdges3D(zone, factor): ind = k-1 m = [e10] f = [f6,f3] - if factor != 1.: + if factor != 1.: r = [e9,e11,e12] f += [f5,f4] @@ -774,9 +774,9 @@ def uniformize(event=None): zone = CTK.t[2][nob][2][noz] dim = Internal.getZoneDim(zone) if dim[0] == 'Structured': - if dim[2] != 1 and dim[3] != 1: + if dim[2] != 1 and dim[3] != 1: fail = apply3D(density, h, npts, factor, ntype=0) - elif dim[2] != 1 and dim[3] == 1: + elif dim[2] != 1 and dim[3] == 1: fail = apply2D(density, h, npts, factor, ntype=0) else: fail = uniformize1D(density, h, npts, gnpts, factor) else: fail = uniformize1D(density, h, npts, gnpts, factor) # all zones @@ -823,9 +823,9 @@ def enforce(event=None): zone = CTK.t[2][nob][2][noz] dim = Internal.getZoneDim(zone) if dim[0] == 'Structured': - if dim[2] != 1 and dim[3] != 1: + if dim[2] != 1 and dim[3] != 1: fail = apply3D(1., -1, 1, h, ntype=2) - elif dim[2] != 1 and dim[3] == 1: + elif dim[2] != 1 and dim[3] == 1: fail = apply2D(1., -1, 1, h, ntype=2) else: fail = stretch1D(h) else: fail = stretch1D(h) @@ -877,9 +877,9 @@ def refine(event=None): zone = CTK.t[2][nob][2][noz] dim = Internal.getZoneDim(zone) if dim[0] == 'Structured': - if dim[2] != 1 and dim[3] != 1: + if dim[2] != 1 and dim[3] != 1: fail = apply3D(1., -1, npts, factor, ntype=1) - elif dim[2] != 1 and dim[3] == 1: + elif dim[2] != 1 and dim[3] == 1: fail = apply2D(1., -1, npts, factor, ntype=1) else: fail = refine1D(1., npts, factor) # all zones else: fail = refine1D(1., npts, factor) # all zones @@ -931,9 +931,9 @@ def smooth(event=None): zone = CTK.t[2][nob][2][noz] dim = Internal.getZoneDim(zone) if dim[0] == 'Structured': - if dim[2] != 1 and dim[3] != 1: + if dim[2] != 1 and dim[3] != 1: fail = apply3D(1., -1, niter, eps, ntype=4) - elif dim[2] != 1 and dim[3] == 1: + elif dim[2] != 1 and dim[3] == 1: fail = apply2D(1., -1, niter, eps, ntype=4) else: fail = smooth1D(niter, eps) else: fail = smooth1D(niter, eps) # all zones @@ -1054,9 +1054,9 @@ def copyDistrib(): # Traitement if dim[0] == 'Structured': - if dim[2] != 1 and dim[3] != 1: + if dim[2] != 1 and dim[3] != 1: fail = apply3D(1., -1, 1, source, ntype=3) - elif dim[2] != 1 and dim[3] == 1: + elif dim[2] != 1 and dim[3] == 1: fail = apply2D(1., -1, 1, source, ntype=3) else: fail = copyDistrib1D(source) else: fail = copyDistrib1D(source) # all zones @@ -1128,7 +1128,7 @@ def enforceLocal(event=None): noz = CTK.Nz[nz] z = CTK.t[2][nob][2][noz] dim = Internal.getZoneDim(z) - if dim[4] != 1: + if dim[4] != 1: CTK.TXT.insert('START', 'Zone must be an edge.\n') CTK.TXT.insert('START', 'Error: ', 'Error') return @@ -1199,7 +1199,7 @@ def enforceLocal(event=None): # elif factor < 1.: # N = npts + (1./factor)/100.*npts # N = int(N)+1 - # else: + # else: # N = npts - (1./factor)/100.*npts # N = int(N)+1 # print("nbre de points=", N) @@ -1273,7 +1273,7 @@ def createApp(win): V = TK.StringVar(win); V.set(''); VARS.append(V) # -4- Option for refine V = TK.StringVar(win); V.set('NFactor'); VARS.append(V) - # -5- Number of points/factor for refine + # -5- Number of points/factor for refine V = TK.StringVar(win); V.set('1.'); VARS.append(V) # -6- Smoothing iterations V = TK.StringVar(win); V.set('5'); VARS.append(V) @@ -1292,7 +1292,7 @@ def createApp(win): # -11- Type of local enforce V = TK.StringVar(win); V.set('HFactor'); VARS.append(V) # -12- Factor for local enforce - V = TK.StringVar(win); V.set('1.'); VARS.append(V) + V = TK.StringVar(win); V.set('1.'); VARS.append(V) # - Uniformize - B = TTK.Button(Frame, text="Uniformize", command=uniformize) @@ -1375,7 +1375,7 @@ def createApp(win): B.grid(row=6, column=2, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Enforced variable.') B.bind('', enforceLocal) - B = TTK.Scale(Frame, from_=0, to=100, orient=TK.HORIZONTAL, + B = TTK.Scale(Frame, from_=0, to=100, orient=TK.HORIZONTAL, showvalue=0, borderwidth=1, value=50) WIDGETS['widthScale'] = B B.grid(row=6, column=3, sticky=TK.EW) diff --git a/Cassiopee/CPlot/apps/tkMapUV.py b/Cassiopee/CPlot/apps/tkMapUV.py index da97eb4bd..6bd755480 100644 --- a/Cassiopee/CPlot/apps/tkMapUV.py +++ b/Cassiopee/CPlot/apps/tkMapUV.py @@ -19,7 +19,7 @@ def generateUVMap(): if CTK.t == []: return nzs = CPlot.getSelectedZones() - if nzs == []: + if nzs == []: CTK.TXT.insert('START', 'Selection is empty.\n') CTK.TXT.insert('START', 'Error: ', 'Error'); return @@ -68,7 +68,7 @@ def createApp(win): V = TK.StringVar(win); V.set('Normal deviation.'); VARS.append(V) # - set Normal deviation - - B = TTK.Scale(Frame, from_=0, to=100, orient=TK.HORIZONTAL, + B = TTK.Scale(Frame, from_=0, to=100, orient=TK.HORIZONTAL, command=setNormalDeviation, showvalue=0, borderwidth=1, value=100) WIDGETS['deviation'] = B WIDGETS['deviation'].set(20.) diff --git a/Cassiopee/CPlot/apps/tkMeshInfo.py b/Cassiopee/CPlot/apps/tkMeshInfo.py index b268dc165..8a872058d 100644 --- a/Cassiopee/CPlot/apps/tkMeshInfo.py +++ b/Cassiopee/CPlot/apps/tkMeshInfo.py @@ -46,8 +46,8 @@ def computeMeshInfo(z, dim): nfaces = dim[1]*(dim[2]-1)+dim[2]*(dim[1]-1) elif dim[4] == 3: nfaces = dim[1]*(dim[2]-1)*(dim[3]-1)+ \ - dim[2]*(dim[3]-1)*(dim[1]-1)+ \ - dim[3]*(dim[1]-1)*(dim[2]-1) + dim[2]*(dim[3]-1)*(dim[1]-1)+ \ + dim[3]*(dim[1]-1)*(dim[2]-1) else: # Compute nodes number np = dim[1] @@ -280,8 +280,8 @@ def createApp(win): F.grid(row=4, column=1, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Selected var name.') WIDGETS['variable'] = B - else: - B = ttk.Combobox(F, textvariable=VARS[5], + else: + B = ttk.Combobox(F, textvariable=VARS[5], values=[], state='readonly') B.grid(sticky=TK.EW) F.bind('', updateVarNameList2) @@ -289,7 +289,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Selected var name.') WIDGETS['variable'] = B - # - Min de la variable - + # - Min de la variable - B = TTK.Label(Frame, text="Min:") B.grid(row=5, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Min of variable.') @@ -298,7 +298,7 @@ def createApp(win): B.grid(row=5, column=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Min of variable.') - # - Max de la variable - + # - Max de la variable - B = TTK.Label(Frame, text="Max:") B.grid(row=6, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Max of variable.') diff --git a/Cassiopee/CPlot/apps/tkMirabelle.py b/Cassiopee/CPlot/apps/tkMirabelle.py index 534ddd480..4f1893385 100644 --- a/Cassiopee/CPlot/apps/tkMirabelle.py +++ b/Cassiopee/CPlot/apps/tkMirabelle.py @@ -33,7 +33,7 @@ def extractEdge(event=None): noz = CTK.Nz[nzs[0]] z = CTK.t[2][nob][2][noz] dimz = Internal.getZoneDim(z) - if dimz[0] == 'Unstructured': + if dimz[0] == 'Unstructured': CTK.TXT.insert('START', 'Selected block must be structured.\n') CTK.TXT.insert('START', 'Error: ', 'Error'); return ni = dimz[1]; nj = dimz[2]; nk = dimz[3] @@ -54,7 +54,7 @@ def extractEdge(event=None): erange = [1,ni,ind[3],ind[3],ind[4],ind[4]] else: CTK.TXT.insert('START', 'Not a valid edge.\n') - CTK.TXT.insert('START', 'Error: ', 'Error'); return + CTK.TXT.insert('START', 'Error: ', 'Error'); return CTK.saveTree() diff --git a/Cassiopee/CPlot/apps/tkNGon.py b/Cassiopee/CPlot/apps/tkNGon.py index f5c1209e6..d2fc5fdf9 100644 --- a/Cassiopee/CPlot/apps/tkNGon.py +++ b/Cassiopee/CPlot/apps/tkNGon.py @@ -86,13 +86,13 @@ def breakElts(): Panels.displayErrors(errors, header='Error: breakElts') CTK.TXT.insert('START', 'Break elts fails for at least one zone.\n') CTK.TXT.insert('START', 'Warning: ', 'Warning') - #C._fillMissingVariables(CTK.t) + #C._fillMissingVariables(CTK.t) (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() CPlot.render() #============================================================================== -# Calcul le dual des zones +# Calcul le dual des zones # IN: t, cplot.selectedZones # OUT: t avec zones remplacees et affiche #============================================================================== @@ -125,13 +125,13 @@ def dual(): Panels.displayErrors(errors, header='Error: dual') CTK.TXT.insert('START', 'Dual fails for at least one zone.\n') CTK.TXT.insert('START', 'Warning: ', 'Warning') - #C._fillMissingVariables(CTK.t) + #C._fillMissingVariables(CTK.t) (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() CPlot.render() #============================================================================== -# Conformise un NGON topologique (hanging nodes) +# Conformise un NGON topologique (hanging nodes) # IN: t, cplot.selectedZones # OUT: t avec zones remplacees et affiche #============================================================================== @@ -164,7 +164,7 @@ def conformize(): Panels.displayErrors(errors, header='Error: conformize') CTK.TXT.insert('START', 'Conformize fails for at least one zone.\n') CTK.TXT.insert('START', 'Warning: ', 'Warning') - #C._fillMissingVariables(CTK.t) + #C._fillMissingVariables(CTK.t) (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() CPlot.render() @@ -172,7 +172,7 @@ def conformize(): #============================================================================== def createApp(win): # - Frame - - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, + Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, text='tkNGon [ + ] ', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='Manage Polyhedral (NGON) meshes.\nCtrl+w to close applet.', temps=0, btype=1) Frame.bind('', hideApp) diff --git a/Cassiopee/CPlot/apps/tkNodeEdit.py b/Cassiopee/CPlot/apps/tkNodeEdit.py index 23d34ccde..a1ec968b2 100644 --- a/Cassiopee/CPlot/apps/tkNodeEdit.py +++ b/Cassiopee/CPlot/apps/tkNodeEdit.py @@ -47,7 +47,7 @@ def showNodeValue(event=None): if isinstance(v, float): v = strFormat2(v); flatView2[2] = v; index = 0 elif isinstance(v, int): v = strFormat2(v); flatView2[2] = v; index = 0 elif isinstance(v, numpy.ndarray): - if v.dtype == 'c': + if v.dtype == 'c': v = Internal.getValue(node); flatView2[2] = v; index = 0 else: sh = v.shape @@ -123,13 +123,13 @@ def showNodeValue(event=None): flatView = strFormat(vf[index]) CTK.TXT.insert('START', flatView, 'Warning') flatView = dim - CTK.TXT.insert('START', flatView) + CTK.TXT.insert('START', flatView) v = strFormat2(vf[index]) SIZE = 10 flatView2[0] = dim - if index-SIZE//2 >= 0 and index+SIZE//2 < vf.size: + if index-SIZE//2 >= 0 and index+SIZE//2 < vf.size: left = index - SIZE//2 right = index + SIZE//2 elif index - SIZE//2 < 0: @@ -143,7 +143,7 @@ def showNodeValue(event=None): for i in range(left, index): rep += strFormat(vf[i])+' ' if rep != '': - if left > 0: rep = '...'+rep + if left > 0: rep = '...'+rep flatView2[1] = rep rep = strFormat(vf[index])+' ' diff --git a/Cassiopee/CPlot/apps/tkOctree.py b/Cassiopee/CPlot/apps/tkOctree.py index 3ed4e0634..7e5bdc0fa 100644 --- a/Cassiopee/CPlot/apps/tkOctree.py +++ b/Cassiopee/CPlot/apps/tkOctree.py @@ -106,9 +106,9 @@ def octree2Struct(): noz = CTK.Nz[nz] z = CTK.t[2][nob][2][noz] try: - zlist = G.octree2Struct(z, vmin=vmin, ext=ext, optimized=optimized, - merged=merged, AMR=AMR) - except Exception as e: + zlist = G.octree2Struct(z, vmin=vmin, ext=ext, optimized=optimized, + merged=merged, AMR=AMR) + except Exception as e: fail = True; errors += [0,str(e)] CTK.t = C.addBase2PyTree(CTK.t, 'CARTESIAN') @@ -260,7 +260,7 @@ def adaptInsideOctree(): CTK.TXT.insert('START', 'Invalid body surface.\n') CTK.TXT.insert('START', 'Error: ', 'Error'); return - # Blank + # Blank CTK.saveTree() BM = numpy.zeros((1, 1), dtype=Internal.E_NpyInt); BM[0,0] = 1 @@ -289,12 +289,12 @@ def adaptInsideOctree(): #C._fillMissingVariables(CTK.t) if fail == False: CTK.TXT.insert('START', 'Adapt octree computed.\n') - else: + else: CTK.TXT.insert('START', 'Adapt octree failed.\n') CTK.TXT.insert('START', 'Error: ', 'Error') (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() - CPlot.render() + CPlot.render() #============================================================================== def hexaOctree(): @@ -352,7 +352,7 @@ def hexaOctree(): #C._fillMissingVariables(CTK.t) if fail == False: CTK.TXT.insert('START', 'Hexa octree computed.\n') - else: + else: CTK.TXT.insert('START', 'Hexa octree failed.\n') CTK.TXT.insert('START', 'Error: ', 'Error') (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) diff --git a/Cassiopee/CPlot/apps/tkOffset.py b/Cassiopee/CPlot/apps/tkOffset.py index bd697b1a6..fc9ccc2fb 100644 --- a/Cassiopee/CPlot/apps/tkOffset.py +++ b/Cassiopee/CPlot/apps/tkOffset.py @@ -6,7 +6,7 @@ import Converter.PyTree as C import CPlot.PyTree as CPlot import CPlot.Tk as CTK -import Geom.PyTree +import Geom.PyTree # local widgets list WIDGETS = {}; VARS = [] @@ -62,7 +62,7 @@ def remap(): CPlot.render() else: CTK.TXT.insert('START', 'Surface filter failed.\n') - CTK.TXT.insert('START', 'Error: ', 'Error') + CTK.TXT.insert('START', 'Error: ', 'Error') #============================================================================== # Create app widgets @@ -93,15 +93,15 @@ def createApp(win): # - VARS - # -0- Point density - V = TK.StringVar(win); V.set('1.'); VARS.append(V) - if 'tkOffsetDensity' in CTK.PREFS: + if 'tkOffsetDensity' in CTK.PREFS: V.set(CTK.PREFS['tkOffsetDensity']) # -1- Offset - V = TK.StringVar(win); V.set('0.1'); VARS.append(V) - if 'tkOffsetOffset' in CTK.PREFS: + if 'tkOffsetOffset' in CTK.PREFS: V.set(CTK.PREFS['tkOffsetOffset']) # -2- Algorithm cart/octree V = TK.StringVar(win); V.set('0'); VARS.append(V) - if 'tkOffsetType' in CTK.PREFS: + if 'tkOffsetType' in CTK.PREFS: V.set(CTK.PREFS['tkOffsetType']) # - Point density - diff --git a/Cassiopee/CPlot/apps/tkPaint.py b/Cassiopee/CPlot/apps/tkPaint.py index 16ed2ea2a..8733b6441 100644 --- a/Cassiopee/CPlot/apps/tkPaint.py +++ b/Cassiopee/CPlot/apps/tkPaint.py @@ -60,7 +60,7 @@ def paint(): if len(varNames) > field+3: var = varNames[field+3] C.setValue(z, var, ind[0], value) - else: + else: CTK.TXT.insert('START', 'Field %d not found. Use scalar mode.\n'%field) CTK.TXT.insert('START', 'Error: ', 'Error') CTK.replace(CTK.t, nob, noz, z) diff --git a/Cassiopee/CPlot/apps/tkPerfo.py b/Cassiopee/CPlot/apps/tkPerfo.py index 65bbfedd1..85765bd43 100644 --- a/Cassiopee/CPlot/apps/tkPerfo.py +++ b/Cassiopee/CPlot/apps/tkPerfo.py @@ -89,7 +89,7 @@ def getThreads(): #============================================================================== def getMaxProcs(): - try: + try: import multiprocessing return str(multiprocessing.cpu_count()) except: return '?' @@ -160,8 +160,8 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Display only certain fields.') WIDGETS['fields'] = B else: - B = ttk.Combobox(F, textvariable=VARS[0], - values=['All fields', 'No field'], + B = ttk.Combobox(F, textvariable=VARS[0], + values=['All fields', 'No field'], state='readonly', width=10) B.grid(sticky=TK.EW) B.bind('<>', setViewMode2) diff --git a/Cassiopee/CPlot/apps/tkPlot.py b/Cassiopee/CPlot/apps/tkPlot.py index 8a07271e3..ebefbe2f4 100644 --- a/Cassiopee/CPlot/apps/tkPlot.py +++ b/Cassiopee/CPlot/apps/tkPlot.py @@ -111,7 +111,7 @@ def display1D(event=None): selected = CTK.t[2][nob][0]+'/'+z[0] index = CPlot.getActivePointIndex() points = (selected,index) - else: # les coupes -> recupere les coord du pt + else: # les coupes -> recupere les coord du pt point = CPlot.getActivePoint() if point == []: point = (0.,0.,0.) @@ -124,9 +124,9 @@ def display1D(event=None): # Recupere les zones actives actives = [] zones = Internal.getZones(CTK.t) - if CTK.__MAINTREE__ == 1: + if CTK.__MAINTREE__ == 1: nzs = CPlot.getActiveZones() - for nz in nzs: actives.append(zones[nz]) + for nz in nzs: actives.append(zones[nz]) else: actives = zones if actives == []: return @@ -258,8 +258,8 @@ def display1D(event=None): maxv2 = C.getMaxValue(p, var2) # display - CPlot.display1D(p, slot=slot, bgBlend=0., gridPos=gridPos, - var1=var1, var2=var2, + CPlot.display1D(p, slot=slot, bgBlend=0., gridPos=gridPos, + var1=var1, var2=var2, r1=(r1min,r1max), r2=(minv2,maxv2)) CTK.TXT.insert('START', 'Plot displayed.\n') @@ -338,7 +338,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Variable 1 (abcsiss).') WIDGETS['var1'] = B else: - B = ttk.Combobox(F, textvariable=VARS[3], + B = ttk.Combobox(F, textvariable=VARS[3], values=[], state='readonly', width=10) B.grid(sticky=TK.EW) F.bind('', updateVar1NameList2) @@ -358,7 +358,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Variable 2 (ordinates).') WIDGETS['var2'] = B else: - B = ttk.Combobox(F, textvariable=VARS[4], + B = ttk.Combobox(F, textvariable=VARS[4], values=[], state='readonly', width=10) B.grid(sticky=TK.EW) F.bind('', updateVar2NameList2) diff --git a/Cassiopee/CPlot/apps/tkPlotXY.py b/Cassiopee/CPlot/apps/tkPlotXY.py index 7f33d0b51..56d7ebd48 100644 --- a/Cassiopee/CPlot/apps/tkPlotXY.py +++ b/Cassiopee/CPlot/apps/tkPlotXY.py @@ -23,7 +23,7 @@ except: IMPORTOK = False try: import tkinter.ttk as cttk -except: +except: try: import ttk as cttk except: IMPORTOK = False @@ -194,204 +194,204 @@ def __init__(self): return t = np.arange(0., 5., 0.002) data = { - 'Iteration':t, - 'Residual':np.sin(t), - 'Cf':np.sin(t/2), - 'Debit':t*t - } + 'Iteration':t, + 'Residual':np.sin(t), + 'Cf':np.sin(t/2), + 'Debit':t*t +} # ============================================================================== # ============================================================================== default_values = { -'Shape': - { - 'shape_type' : 'Arrow', - 'points' : [(0.17,0.17),(0.5,0.3)], - 'arrowstyle' : 'Curve', - 'bracketstyle' : 'BracketA', - 'head_length' : 0.4, - 'head_width' : 0.2, - 'tail_width' : 0.2, - 'scale' : 100., - 'linewidth' : 1., - 'edgecolor' : '#000000', - 'facecolor' : '#ffffff', - 'hatch' : 'none', - 'radius' : 0.1, - 'linestyle' : 'solid', - 'height' : 0.1, - 'width' : 0.1, - 'angle' : 0., - 'linecolor' : '#000000', - 'alpha' : 1., - 'widthA' : 0.1, - 'lengthA' : 0.1, - 'angleA' : 0., - 'widthB' : 0.1, - 'lengthB' : 0.1, - 'angleB' : 0., - }, -'Text': - { - 'text' : "", - 'visibility' : True, - 'text_size' : 11., - 'text_alpha' : 1., - 'box_alpha' : 1., - 'box_backgroundcolor' : '#FFFFFF', - 'box_edgecolor' : '#FFFFFF', - 'box_linewidth' : 3., - 'box_style' : 'round4', - 'active_background' : True, - 'text_color' : '#000000', - 'use_tex' : False, - 'rotation' : 0., - 'posx' : 0., - 'posy' : 0., - 'ha' : 'center', - 'va' : 'center', - 'font_style' : 'normal', - 'font_weight' : 'normal', - 'font_type' : 'serif' - }, -'Graph': - { - 'image_background_color':'#FFFFFF', #White - 'image_background_alpha':1.0, - 'subgraph_background_color':'#FFFFFF', #White - 'subgraph_background_alpha':1.0 - }, -'Curve':{ - 'varx':'', - 'vary':'', - 'line_color':None, - 'line_style':'solid', - 'line_width':1.5, - 'marker_style':'none', - 'marker_size':6.5, - 'marker_edge_width':0.5, - 'marker_face_color':None, - 'marker_edge_color':None, - 'marker_sampling_start':'', - 'marker_sampling_end':'', - 'marker_sampling_step':1, - 'legend_label':'', - 'legend_display': True, - 'ind_axis' : 0, - 'visible':True - }, -'Grid':{ - # Reglage initiaux de Matthieu - #'Mx_display' : True, - #'Mx_grid_color' : '#000000', - #'Mx_grid_style' : 'dashed', - #'Mx_grid_width' : 1., - #'Mx_grid_tick_number':5, - #'Mx_grid_tick_size':10., - #'My_display' : True, - #'My_grid_color' : '#000000', - #'My_grid_style' : 'dashed', - #'My_grid_width' : 1., - #'My_grid_tick_number':5, - #'My_grid_tick_size':10., - #'mx_display' : False, - #'mx_grid_color' : '#000000', - #'mx_grid_style' : 'dashed', - #'mx_grid_width' : 1., - #'mx_grid_tick_number':5, - #'mx_grid_tick_size':10., - #'my_display' : False, - #'my_grid_color' : '#000000', - #'my_grid_style' : 'dashed', - #'my_grid_width' : 1., - #'my_grid_tick_number':5, - #'my_grid_tick_size':10. - # reglages de CB - 'Mx_display' : True, - 'Mx_grid_color' : '#95a5a6', - 'Mx_grid_style' : 'solid', - 'Mx_grid_width' : 1., - 'Mx_grid_tick_number':5, - 'Mx_grid_tick_size':10., - 'My_display' : True, - 'My_grid_color' : '#95a5a6', - 'My_grid_style' : 'solid', - 'My_grid_width' : 1., - 'My_grid_tick_number':5, - 'My_grid_tick_size':10., - 'mx_display' : True, - 'mx_grid_color' : '#bfc9ca', - 'mx_grid_style' : 'solid', - 'mx_grid_width' : 1., - 'mx_grid_tick_number':5, - 'mx_grid_tick_size':10., - 'my_display' : True, - 'my_grid_color' : '#bfc9ca', - 'my_grid_style' : 'solid', - 'my_grid_width' : 1., - 'my_grid_tick_number':5, - 'my_grid_tick_size':10. - }, -'Legend':{ - 'legend_display' : True, - 'legend_title' : '', - 'legend_border_width' : 0.5, - 'legend_border_color' : '#000000', - 'vary':'', - 'legend_background_color' : '#ffffff', - 'legend_background_color_active' : True, - 'legend_position' : 'best', - 'legend_ncol' : 1, - 'legend_label_weight' : 'normal', - 'legend_label_style' : 'normal', - 'legend_label_size' : 10, - 'legend_label_color' : '#000000', - 'legend_title_weight' : 'normal', - 'legend_title_style' : 'normal', - 'legend_title_size' : 8, - 'legend_title_color' : '#000000' - }, -'Axis':{ - 'axis_x_logscale' : False, - 'axis_y_logscale' : False, - 'axis_x_autoscale' : True, - 'axis_y_autoscale' : True, - 'axis_x_min' : 0., - 'axis_x_max' : 1., - 'axis_y_min' : 0., - 'axis_y_max' : 1., - 'axis_x_label' : '', - 'axis_y_label' : '', - 'axis_x_inverted' : False, - 'axis_y_inverted' : False, - 'axis_x_visible' : 1, - 'axis_y_visible' : 1, - 'axis_x_position' : 'both', - 'axis_y_position' : 'both', - 'axis_x_offset' : 0., - 'axis_y_offset' : 0., - 'axis_x_label_fontsize' : pltFontSize, - 'axis_y_label_fontsize' : pltFontSize, - #'axis_x_label_format' : '{x:.2e}', - #'axis_y_label_format' : '{x:.2e}', - 'axis_x_label_format' : '{x:.5g}', - 'axis_y_label_format' : '{x:.5g}', - - }, -'SubPlotParams':{ - 'left' : pltLeft, - 'right' : pltRight, - 'top' : pltTop, - 'bottom' : pltBottom, - 'wspace' : pltWSpace, - 'hspace' : pltHSpace, - 'isActive':True - }, -'TightLayout':{ - 'pad' : 1.08, # pad can not be None as default value !!! - 'hpad' : None, - 'wpad' : None - } + 'Shape': + { + 'shape_type' : 'Arrow', + 'points' : [(0.17,0.17),(0.5,0.3)], + 'arrowstyle' : 'Curve', + 'bracketstyle' : 'BracketA', + 'head_length' : 0.4, + 'head_width' : 0.2, + 'tail_width' : 0.2, + 'scale' : 100., + 'linewidth' : 1., + 'edgecolor' : '#000000', + 'facecolor' : '#ffffff', + 'hatch' : 'none', + 'radius' : 0.1, + 'linestyle' : 'solid', + 'height' : 0.1, + 'width' : 0.1, + 'angle' : 0., + 'linecolor' : '#000000', + 'alpha' : 1., + 'widthA' : 0.1, + 'lengthA' : 0.1, + 'angleA' : 0., + 'widthB' : 0.1, + 'lengthB' : 0.1, + 'angleB' : 0., + }, + 'Text': + { + 'text' : "", + 'visibility' : True, + 'text_size' : 11., + 'text_alpha' : 1., + 'box_alpha' : 1., + 'box_backgroundcolor' : '#FFFFFF', + 'box_edgecolor' : '#FFFFFF', + 'box_linewidth' : 3., + 'box_style' : 'round4', + 'active_background' : True, + 'text_color' : '#000000', + 'use_tex' : False, + 'rotation' : 0., + 'posx' : 0., + 'posy' : 0., + 'ha' : 'center', + 'va' : 'center', + 'font_style' : 'normal', + 'font_weight' : 'normal', + 'font_type' : 'serif' + }, + 'Graph': + { + 'image_background_color':'#FFFFFF', #White + 'image_background_alpha':1.0, + 'subgraph_background_color':'#FFFFFF', #White + 'subgraph_background_alpha':1.0 + }, + 'Curve':{ + 'varx':'', + 'vary':'', + 'line_color':None, + 'line_style':'solid', + 'line_width':1.5, + 'marker_style':'none', + 'marker_size':6.5, + 'marker_edge_width':0.5, + 'marker_face_color':None, + 'marker_edge_color':None, + 'marker_sampling_start':'', + 'marker_sampling_end':'', + 'marker_sampling_step':1, + 'legend_label':'', + 'legend_display': True, + 'ind_axis' : 0, + 'visible':True + }, + 'Grid':{ + # Reglage initiaux de Matthieu + #'Mx_display' : True, + #'Mx_grid_color' : '#000000', + #'Mx_grid_style' : 'dashed', + #'Mx_grid_width' : 1., + #'Mx_grid_tick_number':5, + #'Mx_grid_tick_size':10., + #'My_display' : True, + #'My_grid_color' : '#000000', + #'My_grid_style' : 'dashed', + #'My_grid_width' : 1., + #'My_grid_tick_number':5, + #'My_grid_tick_size':10., + #'mx_display' : False, + #'mx_grid_color' : '#000000', + #'mx_grid_style' : 'dashed', + #'mx_grid_width' : 1., + #'mx_grid_tick_number':5, + #'mx_grid_tick_size':10., + #'my_display' : False, + #'my_grid_color' : '#000000', + #'my_grid_style' : 'dashed', + #'my_grid_width' : 1., + #'my_grid_tick_number':5, + #'my_grid_tick_size':10. + # reglages de CB + 'Mx_display' : True, + 'Mx_grid_color' : '#95a5a6', + 'Mx_grid_style' : 'solid', + 'Mx_grid_width' : 1., + 'Mx_grid_tick_number':5, + 'Mx_grid_tick_size':10., + 'My_display' : True, + 'My_grid_color' : '#95a5a6', + 'My_grid_style' : 'solid', + 'My_grid_width' : 1., + 'My_grid_tick_number':5, + 'My_grid_tick_size':10., + 'mx_display' : True, + 'mx_grid_color' : '#bfc9ca', + 'mx_grid_style' : 'solid', + 'mx_grid_width' : 1., + 'mx_grid_tick_number':5, + 'mx_grid_tick_size':10., + 'my_display' : True, + 'my_grid_color' : '#bfc9ca', + 'my_grid_style' : 'solid', + 'my_grid_width' : 1., + 'my_grid_tick_number':5, + 'my_grid_tick_size':10. + }, + 'Legend':{ + 'legend_display' : True, + 'legend_title' : '', + 'legend_border_width' : 0.5, + 'legend_border_color' : '#000000', + 'vary':'', + 'legend_background_color' : '#ffffff', + 'legend_background_color_active' : True, + 'legend_position' : 'best', + 'legend_ncol' : 1, + 'legend_label_weight' : 'normal', + 'legend_label_style' : 'normal', + 'legend_label_size' : 10, + 'legend_label_color' : '#000000', + 'legend_title_weight' : 'normal', + 'legend_title_style' : 'normal', + 'legend_title_size' : 8, + 'legend_title_color' : '#000000' + }, + 'Axis':{ + 'axis_x_logscale' : False, + 'axis_y_logscale' : False, + 'axis_x_autoscale' : True, + 'axis_y_autoscale' : True, + 'axis_x_min' : 0., + 'axis_x_max' : 1., + 'axis_y_min' : 0., + 'axis_y_max' : 1., + 'axis_x_label' : '', + 'axis_y_label' : '', + 'axis_x_inverted' : False, + 'axis_y_inverted' : False, + 'axis_x_visible' : 1, + 'axis_y_visible' : 1, + 'axis_x_position' : 'both', + 'axis_y_position' : 'both', + 'axis_x_offset' : 0., + 'axis_y_offset' : 0., + 'axis_x_label_fontsize' : pltFontSize, + 'axis_y_label_fontsize' : pltFontSize, + #'axis_x_label_format' : '{x:.2e}', + #'axis_y_label_format' : '{x:.2e}', + 'axis_x_label_format' : '{x:.5g}', + 'axis_y_label_format' : '{x:.5g}', + + }, + 'SubPlotParams':{ + 'left' : pltLeft, + 'right' : pltRight, + 'top' : pltTop, + 'bottom' : pltBottom, + 'wspace' : pltWSpace, + 'hspace' : pltHSpace, + 'isActive':True + }, + 'TightLayout':{ + 'pad' : 1.08, # pad can not be None as default value !!! + 'hpad' : None, + 'wpad' : None + } } #========================================================== @@ -597,7 +597,7 @@ def createFrame(self): ######################### Manip #################### ######################################################################## - lblframeManip = TTK.LabelFrame(self.frame, text = "Manip.") + lblframeManip = TTK.LabelFrame(self.frame, text="Manip.") lblframeManip.grid(row=0,column=0,sticky='NSEW') lblframeManip.grid_rowconfigure(0,weight=1) lblframeManip.grid_columnconfigure(0,weight=1) @@ -718,7 +718,7 @@ def createFrame(self): ######################### Text #################### ######################################################################## - lblframeText = TTK.LabelFrame(self.frame, text = "Text") + lblframeText = TTK.LabelFrame(self.frame, text="Text") lblframeText.grid(row=0,column=1,sticky='NSEW') lblframeText.grid_rowconfigure(0,weight=1) lblframeText.grid_columnconfigure(0,weight=1) @@ -853,7 +853,7 @@ def createFrame(self): ######################### Font #################### ######################################################################## - lblframeFont = TTK.LabelFrame(self.frame, text = "Font") + lblframeFont = TTK.LabelFrame(self.frame, text="Font") lblframeFont.grid(row=0,column=2,sticky='NSEW') lblframeFont.grid_rowconfigure(0,weight=1) lblframeFont.grid_columnconfigure(0,weight=1) @@ -1078,7 +1078,7 @@ def createFrame(self): ######################### Position #################### ######################################################################## - lblframePosition = TTK.LabelFrame(self.frame, text = "Position") + lblframePosition = TTK.LabelFrame(self.frame, text="Position") lblframePosition.grid(row=0,column=3,sticky='NSEW') lblframePosition.grid_rowconfigure(0,weight=1) lblframePosition.grid_columnconfigure(0,weight=1) @@ -1297,7 +1297,7 @@ def createFrame(self): ######################### Box #################### ######################################################################## - lblframeBox = TTK.LabelFrame(self.frame, text = "Box") + lblframeBox = TTK.LabelFrame(self.frame, text="Box") lblframeBox.grid(row=0,column=4,sticky='NSEW') lblframeBox.grid_rowconfigure(0,weight=1) lblframeBox.grid_columnconfigure(0,weight=1) @@ -2810,28 +2810,28 @@ def cmd_duplicateTexts(self): for ind, select in enumerate(self.frame.selectionItem): if select.val.get(): t= Text( - zone = self.zone, - text = self.frame.textItem[ind].val, - visibility = self.frame.visibilityItem[ind].val.get(), - text_color = self.frame.text_colorItem[ind].val, - text_size = self.frame.text_sizeItem[ind].val, - font_type = self.frame.font_typeItem[ind].val, - police = self.frame.policeItem[ind].val, - font_style = self.frame.font_styleItem[ind].val, - font_weight = self.frame.font_weightItem[ind].val, - text_alpha = self.frame.text_alphaItem[ind].val, - ha = self.frame.haItem[ind].val, - va = self.frame.vaItem[ind].val, - posx = self.frame.posxItem[ind].val, - posy = self.frame.posyItem[ind].val, - rotation = self.frame.rotationItem[ind].val, - use_tex = self.frame.use_texItem[ind].val.get(), - box_backgroundcolor = self.frame.box_backgroundcolorItem[ind].val, - box_edgecolor = self.frame.box_edgecolorItem[ind].val, - box_linewidth = self.frame.box_linewidthItem[ind].val, - box_style = self.frame.box_styleItem[ind].val, - active_background = self.frame.active_backgroundItem[ind].val.get(), - box_alpha = self.frame.box_alphaItem[ind].val) + zone=self.zone, + text=self.frame.textItem[ind].val, + visibility=self.frame.visibilityItem[ind].val.get(), + text_color=self.frame.text_colorItem[ind].val, + text_size=self.frame.text_sizeItem[ind].val, + font_type=self.frame.font_typeItem[ind].val, + police=self.frame.policeItem[ind].val, + font_style=self.frame.font_styleItem[ind].val, + font_weight=self.frame.font_weightItem[ind].val, + text_alpha=self.frame.text_alphaItem[ind].val, + ha=self.frame.haItem[ind].val, + va=self.frame.vaItem[ind].val, + posx=self.frame.posxItem[ind].val, + posy=self.frame.posyItem[ind].val, + rotation=self.frame.rotationItem[ind].val, + use_tex=self.frame.use_texItem[ind].val.get(), + box_backgroundcolor=self.frame.box_backgroundcolorItem[ind].val, + box_edgecolor=self.frame.box_edgecolorItem[ind].val, + box_linewidth=self.frame.box_linewidthItem[ind].val, + box_style=self.frame.box_styleItem[ind].val, + active_background=self.frame.active_backgroundItem[ind].val.get(), + box_alpha=self.frame.box_alphaItem[ind].val) # Add texts self.subGraph.texts.append(t) # self.frame.destroy() @@ -2845,28 +2845,28 @@ def cmd_createText(self): ind = len(self.subGraph.texts) t = Text( - zone = self.zone, - text = self.frame.textItem[ind].val, - visibility = self.frame.visibilityItem[ind].val.get(), - text_color = self.frame.text_colorItem[ind].val, - text_size = self.frame.text_sizeItem[ind].val, - font_type = self.frame.font_typeItem[ind].val, - police = self.frame.policeItem[ind].val, - font_style = self.frame.font_styleItem[ind].val, - font_weight = self.frame.font_weightItem[ind].val, - text_alpha = self.frame.text_alphaItem[ind].val, - ha = self.frame.haItem[ind].val, - va = self.frame.vaItem[ind].val, - posx = self.frame.posxItem[ind].val, - posy = self.frame.posyItem[ind].val, - rotation = self.frame.rotationItem[ind].val, - use_tex = self.frame.use_texItem[ind].val.get(), - box_backgroundcolor = self.frame.box_backgroundcolorItem[ind].val, - box_edgecolor = self.frame.box_edgecolorItem[ind].val, - box_linewidth = self.frame.box_linewidthItem[ind].val, - box_style = self.frame.box_styleItem[ind].val, - active_background = self.frame.active_backgroundItem[ind].val.get(), - box_alpha = self.frame.box_alphaItem[ind].val) + zone=self.zone, + text=self.frame.textItem[ind].val, + visibility=self.frame.visibilityItem[ind].val.get(), + text_color=self.frame.text_colorItem[ind].val, + text_size=self.frame.text_sizeItem[ind].val, + font_type=self.frame.font_typeItem[ind].val, + police=self.frame.policeItem[ind].val, + font_style=self.frame.font_styleItem[ind].val, + font_weight=self.frame.font_weightItem[ind].val, + text_alpha=self.frame.text_alphaItem[ind].val, + ha=self.frame.haItem[ind].val, + va=self.frame.vaItem[ind].val, + posx=self.frame.posxItem[ind].val, + posy=self.frame.posyItem[ind].val, + rotation=self.frame.rotationItem[ind].val, + use_tex=self.frame.use_texItem[ind].val.get(), + box_backgroundcolor=self.frame.box_backgroundcolorItem[ind].val, + box_edgecolor=self.frame.box_edgecolorItem[ind].val, + box_linewidth=self.frame.box_linewidthItem[ind].val, + box_style=self.frame.box_styleItem[ind].val, + active_background=self.frame.active_backgroundItem[ind].val.get(), + box_alpha=self.frame.box_alphaItem[ind].val) # Add curves self.subGraph.texts.append(t) # self.frame.destroy() @@ -3602,7 +3602,7 @@ def createFrame(self): # ######################################################################## #################### -> Level 1 - mainFrame = TTK.LabelFrame(self.frame, text = "Liste des shapes") + mainFrame = TTK.LabelFrame(self.frame, text="Liste des shapes") mainFrame.grid(row=0,column=0,sticky='NSEW') mainFrame.grid_rowconfigure(0,weight=1) # @@ -4256,27 +4256,27 @@ def cmd_duplicateShapes(self): pass s = Shape( - zone = self.zone, - shape_type = self.frame.shape_typeItem[ind].val, - points = points, - arrowstyle = arrowstyle, - bracketstyle = bracketstyle, - head_length = head_length, - head_width = head_width, - tail_width = tail_width, - scale = scale, - linewidth = linewidth, - edgecolor = edgecolor, - facecolor = facecolor, - hatch = hatch, - radius = radius, - linestyle = linestyle, - height = height, - width = width, - angle = angle, - linecolor = linecolor, - alpha = alpha, - ) + zone=self.zone, + shape_type=self.frame.shape_typeItem[ind].val, + points=points, + arrowstyle=arrowstyle, + bracketstyle=bracketstyle, + head_length=head_length, + head_width=head_width, + tail_width=tail_width, + scale=scale, + linewidth=linewidth, + edgecolor=edgecolor, + facecolor=facecolor, + hatch=hatch, + radius=radius, + linestyle=linestyle, + height=height, + width=width, + angle=angle, + linecolor=linecolor, + alpha=alpha, + ) # Add texts self.subGraph.shapes.append(s) # self.frame.destroy() @@ -4384,27 +4384,27 @@ def cmd_createShape(self): pass s = Shape( - zone = self.zone, - shape_type = self.frame.shape_typeItem[ind].val, - points = points, - arrowstyle = arrowstyle, - bracketstyle = bracketstyle, - head_length = head_length, - head_width = head_width, - tail_width = tail_width, - scale = scale, - linewidth = linewidth, - edgecolor = edgecolor, - facecolor = facecolor, - hatch = hatch, - radius = radius, - linestyle = linestyle, - height = height, - width = width, - angle = angle, - linecolor = linecolor, - alpha = alpha, - ) + zone=self.zone, + shape_type=self.frame.shape_typeItem[ind].val, + points=points, + arrowstyle=arrowstyle, + bracketstyle=bracketstyle, + head_length=head_length, + head_width=head_width, + tail_width=tail_width, + scale=scale, + linewidth=linewidth, + edgecolor=edgecolor, + facecolor=facecolor, + hatch=hatch, + radius=radius, + linestyle=linestyle, + height=height, + width=width, + angle=angle, + linecolor=linecolor, + alpha=alpha, + ) # Add curves self.subGraph.shapes.append(s) @@ -4578,15 +4578,15 @@ def cmd_close(self): def Modify_CircleShape(self,s,parent,ind): framePosition = parent.childframe for (B,svar) in [ - (framePosition.positionItem,s.points), - (framePosition.radiusItem,s.radius), - (framePosition.linewidthItem,s.linewidth), - (framePosition.linestyleItem,s.linestyle), - (framePosition.edgecolorItem,s.edgecolor), - (framePosition.facecolorItem,s.facecolor), - (framePosition.hatchItem,s.hatch), - (framePosition.alphaItem,s.alpha), - ]: + (framePosition.positionItem,s.points), + (framePosition.radiusItem,s.radius), + (framePosition.linewidthItem,s.linewidth), + (framePosition.linestyleItem,s.linestyle), + (framePosition.edgecolorItem,s.edgecolor), + (framePosition.facecolorItem,s.facecolor), + (framePosition.hatchItem,s.hatch), + (framePosition.alphaItem,s.alpha), + ]: if B.var == 'points': B.shape = s B.list = s.points @@ -4604,17 +4604,17 @@ def Modify_CircleShape(self,s,parent,ind): def Modify_EllipseShape(self,s,parent,ind): framePosition = parent.childframe for (B,svar) in [ - (framePosition.positionItem,s.points), - (framePosition.heightItem,s.height), - (framePosition.widthItem,s.width), - (framePosition.angleItem,s.angle), - (framePosition.linewidthItem,s.linewidth), - (framePosition.linestyleItem,s.linestyle), - (framePosition.edgecolorItem,s.edgecolor), - (framePosition.facecolorItem,s.facecolor), - (framePosition.hatchItem,s.hatch), - (framePosition.alphaItem,s.alpha), - ]: + (framePosition.positionItem,s.points), + (framePosition.heightItem,s.height), + (framePosition.widthItem,s.width), + (framePosition.angleItem,s.angle), + (framePosition.linewidthItem,s.linewidth), + (framePosition.linestyleItem,s.linestyle), + (framePosition.edgecolorItem,s.edgecolor), + (framePosition.facecolorItem,s.facecolor), + (framePosition.hatchItem,s.hatch), + (framePosition.alphaItem,s.alpha), + ]: if B.var == 'points': B.shape = s B.list = s.points @@ -4635,19 +4635,19 @@ def Modify_RectangleShape(self,s,parent,ind): def Modify_ArrowShape(self,s,parent,ind): framePosition = parent.childframe for (B,svar) in [ - (framePosition.positionItem,s.points), - (framePosition.arrowstyleItem,s.arrowstyle), - (framePosition.head_lengthItem,s.head_length), - (framePosition.head_widthItem,s.head_width), - (framePosition.tail_widthItem,s.tail_width), - (framePosition.scaleItem,s.scale), - (framePosition.linewidthItem,s.linewidth), - (framePosition.linestyleItem,s.linestyle), - (framePosition.edgecolorItem,s.edgecolor), - (framePosition.facecolorItem,s.facecolor), - (framePosition.hatchItem,s.hatch), - (framePosition.alphaItem,s.alpha), - ]: + (framePosition.positionItem,s.points), + (framePosition.arrowstyleItem,s.arrowstyle), + (framePosition.head_lengthItem,s.head_length), + (framePosition.head_widthItem,s.head_width), + (framePosition.tail_widthItem,s.tail_width), + (framePosition.scaleItem,s.scale), + (framePosition.linewidthItem,s.linewidth), + (framePosition.linestyleItem,s.linestyle), + (framePosition.edgecolorItem,s.edgecolor), + (framePosition.facecolorItem,s.facecolor), + (framePosition.hatchItem,s.hatch), + (framePosition.alphaItem,s.alpha), + ]: if B.var == 'points': B.shape = s B.list = s.points @@ -4665,20 +4665,20 @@ def Modify_ArrowShape(self,s,parent,ind): def Modify_BracketShape(self,s,parent,ind): framePosition = parent.childframe for (B,svar) in [ - (framePosition.positionItem,s.points), - (framePosition.bracketstyleItem,s.bracketstyle), - (framePosition.lengthAItem,s.lengthA), - (framePosition.lengthBItem,s.lengthB), - (framePosition.widthAItem,s.widthA), - (framePosition.widthBItem,s.widthB), - (framePosition.angleAItem,s.angleA), - (framePosition.angleBItem,s.angleB), - (framePosition.scaleItem,s.scale), - (framePosition.linewidthItem,s.linewidth), - (framePosition.linestyleItem,s.linestyle), - (framePosition.edgecolorItem,s.edgecolor), - (framePosition.alphaItem,s.alpha), - ]: + (framePosition.positionItem,s.points), + (framePosition.bracketstyleItem,s.bracketstyle), + (framePosition.lengthAItem,s.lengthA), + (framePosition.lengthBItem,s.lengthB), + (framePosition.widthAItem,s.widthA), + (framePosition.widthBItem,s.widthB), + (framePosition.angleAItem,s.angleA), + (framePosition.angleBItem,s.angleB), + (framePosition.scaleItem,s.scale), + (framePosition.linewidthItem,s.linewidth), + (framePosition.linestyleItem,s.linestyle), + (framePosition.edgecolorItem,s.edgecolor), + (framePosition.alphaItem,s.alpha), + ]: if B.var == 'points': B.shape = s B.list = s.points @@ -4700,12 +4700,12 @@ def Modify_FancyBboxShape(self,s,parent,ind): def Modify_LineShape(self,s,parent,ind): framePosition = parent.childframe for (B,svar) in [ - (framePosition.positionItem,s.points), - (framePosition.linewidthItem,s.linewidth), - (framePosition.linestyleItem,s.linestyle), - (framePosition.linecolorItem,s.linecolor), - (framePosition.alphaItem,s.alpha), - ]: + (framePosition.positionItem,s.points), + (framePosition.linewidthItem,s.linewidth), + (framePosition.linestyleItem,s.linestyle), + (framePosition.linecolorItem,s.linecolor), + (framePosition.alphaItem,s.alpha), + ]: if B.var == 'points': B.shape = s B.list = s.points @@ -7376,7 +7376,7 @@ def createFrame(self): self.legend_position = ['best','upper left','upper center','upper right','center left','center','center right','lower left','lower center','lower right'] - cbox = cttk.Combobox(posFrame,values = self.legend_position,state='readonly') + cbox = cttk.Combobox(posFrame,values=self.legend_position,state='readonly') cbox.val = self.subGraph.legend_property.legend_position cbox.set(cbox.val) cbox.bind("<>",self.cmd_positionChange) @@ -7950,11 +7950,11 @@ def cmd_configure(self): # Nevertheless, the user, can change the size of the toplevel window (graphtk) with the mouse, # it will change the size of the figure in the mean time. # TODO : find a real a solution to this issue !!! -# tkwidget = self.graphInstance.canvas.get_tk_widget() -# figsizeStr = self.sizeItem['figsize'].val[1:-1] -# figsize = (int(figsizeStr.split(',')[0]),int(figsizeStr.split(',')[1])) -# self.fig.set_size_inches(figsize,forward=True) -# tkwidget = self.graphInstance.canvas.get_tk_widget() + # tkwidget = self.graphInstance.canvas.get_tk_widget() + # figsizeStr = self.sizeItem['figsize'].val[1:-1] + # figsize = (int(figsizeStr.split(',')[0]),int(figsizeStr.split(',')[1])) + # self.fig.set_size_inches(figsize,forward=True) + # tkwidget = self.graphInstance.canvas.get_tk_widget() # dpi = int(self.sizeItem['dpi'].val) self.fig.set_dpi(dpi) @@ -7975,8 +7975,8 @@ def cmd_configure(self): if isParamsOk: self.graphInstance.updateSubPlotParams(params) else: -# self.lift() -# self.focus() + # self.lift() + # self.focus() return else: params = {'pad':None,'hpad':None,'wpad':None,'isActive':True} @@ -8022,7 +8022,7 @@ def updateColor(self,color,B,extra_data): # fig = self.parent.graphWdwL[self.graph].getFig() # for axe in fig.get_axes(): # axe.patch.set_facecolor(B.val) - # axe.patch.set_alpha(1.0) + # axe.patch.set_alpha(1.0) # for axes in self.subGraph.axis : # # axes.patch.set_facecolor(B.val) # axes.set_axis_bgcolor(B.val) @@ -8879,7 +8879,7 @@ def cmd_addSelection(self): for index in items: zones.append(self.unused_zones.get(index)) for zone in zones: - # Find index in unused listbox + # Find index in unused listbox try: index = self.unused_zones.list.index(zone) except ValueError: continue self.used_zones.list.append(zone) @@ -8892,7 +8892,7 @@ def cmd_addSelection(self): def cmd_removeAll(self): # Add all used to used list for zone in self.used_zones.get(0,TK.END): - # Find index in used listbox + # Find index in used listbox try: index = self.used_zones.list.index(zone) except ValueError: continue self.unused_zones.list.append(zone) @@ -8907,7 +8907,7 @@ def cmd_removeSelection(self): for index in items: zones.append(self.used_zones.get(index)) for zone in zones: - # Find index in used listbox + # Find index in used listbox try: index = self.used_zones.list.index(zone) except ValueError: continue self.unused_zones.list.append(zone) @@ -9179,7 +9179,7 @@ def cmd_deleteXY(self): for index in items: positions.append(self.pos_list.get(index)) for pos in positions: - # Find index in used listbox + # Find index in used listbox try: index = self.pos_list.list.index(pos) except ValueError: continue del self.pos_list.list[index] @@ -9834,8 +9834,8 @@ def _onMouseWheel(self, event): for ax in y_axes: ylim = ax.get_ylim() ylim = self._zoomRange(ylim[0], ylim[1], - ydata, scale_factor, - ax.get_yscale()) + ydata, scale_factor, + ax.get_yscale()) ax.set_ylim(ylim) if x_axes or y_axes: self._draw() @@ -9843,8 +9843,8 @@ def _onMousePress(self, event): try: ax = event.inaxes self.parent.selectPositionByName(ax.name) - except: pass - if self._pressed_button is not None: return + except: pass + if self._pressed_button is not None: return if event.button in (1, 3): # Start x_axes, y_axes = self._axesToUpdate(event) @@ -9881,8 +9881,8 @@ def _onKeyPress(self, event): iCurSubGraph = self.parent.position.val curves = self.fig.subGraph[iCurSubGraph].curves - varyExcludes = ['CoordinateX', 'CoordinateY', 'CoordinateZ', 'x', 'y', 'z', 'xsc', 'index', 'it', - 'xsc@FlowSolution', 'index@FlowSolution', 'it@FlowSolution'] + varyExcludes = ['CoordinateX', 'CoordinateY', 'CoordinateZ', 'x', 'y', 'z', 'xsc', 'index', 'it', + 'xsc@FlowSolution', 'index@FlowSolution', 'it@FlowSolution'] if event.key == '&': # x+1 for c in curves: @@ -9928,7 +9928,7 @@ def _onKeyPress(self, event): if c.vary == v: if n > 1: c.setValue('vary', varlist[n-1]) else: c.setValue('vary', varlist[n-1]) - break + break self.updateGraph(iCurSubGraph) @@ -10072,23 +10072,23 @@ def updateGroupCurvesZoneName(self, iCurSubGraph, oldZoneList, newZoneList): def applyViewSettings(self): if self.subPlotParams.isActive: -# Was aimed to turn off eventually the tight_layout, but seems useless ... and not working ! -# try: -# self.fig.instance.tight_layout(False) -# print('STOP TIGHT LAYOUT') -# except AttributeError: -# pass + # Was aimed to turn off eventually the tight_layout, but seems useless ... and not working ! + # try: + # self.fig.instance.tight_layout(False) + # print('STOP TIGHT LAYOUT') + # except AttributeError: + # pass self.fig.instance.subplots_adjust(left=self.subPlotParams.left, - right=self.subPlotParams.right, - top=self.subPlotParams.top, - bottom=self.subPlotParams.bottom, - hspace=self.subPlotParams.hspace, - wspace=self.subPlotParams.wspace) + right=self.subPlotParams.right, + top=self.subPlotParams.top, + bottom=self.subPlotParams.bottom, + hspace=self.subPlotParams.hspace, + wspace=self.subPlotParams.wspace) if self.tightLayout.isActive: self.fig.instance.tight_layout(pad=self.tightLayout.pad, - h_pad=self.tightLayout.hpad, - w_pad=self.tightLayout.wpad) + h_pad=self.tightLayout.hpad, + w_pad=self.tightLayout.wpad) self.drawFigure() # ------------------------------------------------------ updateSubPlotParams def updateSubPlotParams(self, params): @@ -10348,7 +10348,7 @@ def createFrame(self): # ######################################################################## #################### -> Level 1 - lblframeManip = TTK.LabelFrame(self.frame, text = "Manip.") + lblframeManip = TTK.LabelFrame(self.frame, text="Manip.") lblframeManip.grid(row=0,column=0,sticky='NSEW') lblframeManip.grid_columnconfigure(0,weight=1) lblframeManip.grid_rowconfigure(0,weight=1) @@ -10505,7 +10505,7 @@ def createFrame(self): CB.container = self.frame.visibilityItem self.frame.visibilityItem.append(CB) #&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& - lblframeData = TTK.LabelFrame(self.frame, text = "Data") + lblframeData = TTK.LabelFrame(self.frame, text="Data") lblframeData.grid(row=0,column=1,sticky='NSEW') lblframeData.grid_columnconfigure(0,weight=1) lblframeData.grid_rowconfigure(0,weight=1) @@ -10778,7 +10778,7 @@ def createFrame(self): B.container = self.frame.line_styleItem self.frame.line_styleItem.append(B) #&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& - lblframeSymbol = TTK.LabelFrame(self.frame, text = "Symbol") + lblframeSymbol = TTK.LabelFrame(self.frame, text="Symbol") lblframeSymbol.grid(row=0,column=3,sticky='NSEW') lblframeSymbol.grid_columnconfigure(0,weight=1) lblframeSymbol.grid_rowconfigure(0,weight=1) @@ -10987,7 +10987,7 @@ def createFrame(self): B.container = self.frame.marker_edge_widthItem self.frame.marker_edge_widthItem.append(B) #&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& - lblframeSymbolSampling = TTK.LabelFrame(self.frame, text = "Symb. Sampling") + lblframeSymbolSampling = TTK.LabelFrame(self.frame, text="Symb. Sampling") lblframeSymbolSampling.grid(row=0,column=4,sticky='NSEW') lblframeSymbolSampling.grid_columnconfigure(0,weight=1) lblframeSymbolSampling.grid_rowconfigure(0,weight=1) @@ -11256,12 +11256,12 @@ def updateAxisList(self): # --------------------------------------------------------------- updatelblFrameSize def updatelblFrameSize(self): for action in [self.frame.selectionItem,self.frame.IdItem,self.frame.axisItem, - self.frame.visibilityItem,self.frame.zoneItem,self.frame.varxItem, - self.frame.varyItem,self.frame.line_colorItem,self.frame.line_widthItem, - self.frame.line_styleItem,self.frame.marker_face_colorItem,self.frame.marker_sizeItem, - self.frame.marker_styleItem,self.frame.marker_edge_colorItem,self.frame.marker_edge_widthItem, - self.frame.marker_sampling_startItem,self.frame.marker_sampling_endItem,self.frame.marker_sampling_stepItem, - self.frame.legend_labelItem,self.frame.legend_displayItem]: + self.frame.visibilityItem,self.frame.zoneItem,self.frame.varxItem, + self.frame.varyItem,self.frame.line_colorItem,self.frame.line_widthItem, + self.frame.line_styleItem,self.frame.marker_face_colorItem,self.frame.marker_sizeItem, + self.frame.marker_styleItem,self.frame.marker_edge_colorItem,self.frame.marker_edge_widthItem, + self.frame.marker_sampling_startItem,self.frame.marker_sampling_endItem,self.frame.marker_sampling_stepItem, + self.frame.legend_labelItem,self.frame.legend_displayItem]: ### get lblframe lblframe = action[0].winfo_parent() # Returns the name of the parent lblframe = self.frame.nametowidget(lblframe) # returns the instance of the parent # Returns the name of the parent @@ -12156,14 +12156,14 @@ def cmd_rmCurves(self): # del self.subGraph.curves[indRemove] # self.popUpCurveLine(indRemove) # ind += 1 - # print(' - ',ind) - # indRemove = ind -nbDeletion - # nbDeletion += 1 - # del self.subGraph.curves[indRemove] - # self.popUpCurveLine(indRemove) - # self.updatelblFrameSize() - # else: - # print(' + ',ind) + # print(' - ',ind) + # indRemove = ind -nbDeletion + # nbDeletion += 1 + # del self.subGraph.curves[indRemove] + # self.popUpCurveLine(indRemove) + # self.updatelblFrameSize() + # else: + # print(' + ',ind) # self.reloadWindow() # Update Graph self.parent.graphWdwL[self.graph].updateGraph(self.zone) @@ -12174,23 +12174,23 @@ def cmd_createCurve(self): ind = len(self.subGraph.curves) c = Curve( - zone = self.frame.zoneItem[ind].val, - varx = self.frame.varxItem[ind].val, - vary = self.frame.varyItem[ind].val, - line_color = self.frame.line_colorItem[ind].val, - line_style = self.frame.line_styleItem[ind].val, - line_width = self.frame.line_widthItem[ind].val, - marker_style = self.frame.marker_styleItem[ind].val, - marker_size = self.frame.marker_sizeItem[ind].val, - marker_edge_width = self.frame.marker_edge_widthItem[ind].val, - marker_face_color = self.frame.marker_face_colorItem[ind].val, - marker_edge_color = self.frame.marker_edge_colorItem[ind].val, - marker_sampling_start = self.frame.marker_sampling_startItem[ind].val, - marker_sampling_end = self.frame.marker_sampling_endItem[ind].val, - marker_sampling_step = self.frame.marker_sampling_stepItem[ind].val, - legend_label = self.frame.legend_labelItem[ind].val, - legend_display = True, - visible = True) + zone=self.frame.zoneItem[ind].val, + varx=self.frame.varxItem[ind].val, + vary=self.frame.varyItem[ind].val, + line_color=self.frame.line_colorItem[ind].val, + line_style=self.frame.line_styleItem[ind].val, + line_width=self.frame.line_widthItem[ind].val, + marker_style=self.frame.marker_styleItem[ind].val, + marker_size=self.frame.marker_sizeItem[ind].val, + marker_edge_width=self.frame.marker_edge_widthItem[ind].val, + marker_face_color=self.frame.marker_face_colorItem[ind].val, + marker_edge_color=self.frame.marker_edge_colorItem[ind].val, + marker_sampling_start=self.frame.marker_sampling_startItem[ind].val, + marker_sampling_end=self.frame.marker_sampling_endItem[ind].val, + marker_sampling_step=self.frame.marker_sampling_stepItem[ind].val, + legend_label=self.frame.legend_labelItem[ind].val, + legend_display=True, + visible=True) # Add curves self.subGraph.curves.append(c) # self.frame.destroy() @@ -12205,26 +12205,26 @@ def reloadWindow(self): self.createFrame() # ------------------------------------------------------ cmd_duplicateCurves def cmd_duplicateCurves(self): - for ind, select in enumerate(self.frame.selectionItem): + for ind, select in enumerate(self.frame.selectionItem): if select.val.get(): c = Curve( - zone = self.frame.zoneItem[ind].val, - varx = self.frame.varxItem[ind].val, - vary = self.frame.varyItem[ind].val, - line_color = self.frame.line_colorItem[ind].val, - line_style = self.frame.line_styleItem[ind].val, - line_width = self.frame.line_widthItem[ind].val, - marker_style = self.frame.marker_styleItem[ind].val, - marker_size = self.frame.marker_sizeItem[ind].val, - marker_edge_width = self.frame.marker_edge_widthItem[ind].val, - marker_face_color = self.frame.marker_face_colorItem[ind].val, - marker_edge_color = self.frame.marker_edge_colorItem[ind].val, - marker_sampling_start = self.frame.marker_sampling_startItem[ind].val, - marker_sampling_end = self.frame.marker_sampling_endItem[ind].val, - marker_sampling_step = self.frame.marker_sampling_stepItem[ind].val, - legend_label = self.frame.legend_labelItem[ind].val, - legend_display = True, - visible = True) + zone=self.frame.zoneItem[ind].val, + varx=self.frame.varxItem[ind].val, + vary=self.frame.varyItem[ind].val, + line_color=self.frame.line_colorItem[ind].val, + line_style=self.frame.line_styleItem[ind].val, + line_width=self.frame.line_widthItem[ind].val, + marker_style=self.frame.marker_styleItem[ind].val, + marker_size=self.frame.marker_sizeItem[ind].val, + marker_edge_width=self.frame.marker_edge_widthItem[ind].val, + marker_face_color=self.frame.marker_face_colorItem[ind].val, + marker_edge_color=self.frame.marker_edge_colorItem[ind].val, + marker_sampling_start=self.frame.marker_sampling_startItem[ind].val, + marker_sampling_end=self.frame.marker_sampling_endItem[ind].val, + marker_sampling_step=self.frame.marker_sampling_stepItem[ind].val, + legend_label=self.frame.legend_labelItem[ind].val, + legend_display=True, + visible=True) # Add curves self.subGraph.curves.append(c) # self.frame.destroy() @@ -12720,7 +12720,7 @@ def initialize(self): self.graphNameList = [g.name for g in self.graphWdwL] if len(self.graphNameList) == 0: self.graphNameList.append('') - self.activeGraph = cttk.Combobox(lblframe,values = self.graphNameList,state='readonly') + self.activeGraph = cttk.Combobox(lblframe,values=self.graphNameList,state='readonly') try: self.updateGraphName2Id() self.activeGraph.val = self.graphName2Id[self.graphNameList[0]] @@ -12742,7 +12742,7 @@ def initialize(self): try: self.positionList = list(self.graphWdwL[self.activeGraph.val].subGraph.keys()) except IndexError: self.positionList = [''] except TypeError: self.positionList = [''] - self.position = cttk.Combobox(lblframe, values = self.positionList, state='readonly') + self.position = cttk.Combobox(lblframe, values=self.positionList, state='readonly') self.position.val = self.positionList[0] self.position.set(self.position.val) self.position.bind("<>",self.cmd_positionChange) @@ -12956,14 +12956,14 @@ def confSave(self, filename, withUI): # lines +=''' indAxis_%s_%s_%s = 0\n'''%(indgraph,indsubgraph,ind_axis) elif f.type[0]=='twinx': lines +=''' axis_%s_%s_%s = graph_%s.addAxis('%s',shared='x',axis=axis_%s_%s_%s)\n'''%(indgraph,indsubgraph, - ind_axis,indgraph,subgraph.name, - indgraph,indsubgraph, - f.type[1]) + ind_axis,indgraph,subgraph.name, + indgraph,indsubgraph, + f.type[1]) elif f.type[0]=='twiny': lines +=''' axis_%s_%s_%s = graph_%s.addAxis('%s',shared='y',axis=axis_%s_%s_%s)\n'''%(indgraph,indsubgraph, - ind_axis,indgraph,subgraph.name, - indgraph,indsubgraph, - f.type[1]) + ind_axis,indgraph,subgraph.name, + indgraph,indsubgraph, + f.type[1]) elif f.type[0] == 'new': lines +=''' axis_%s_%s_%s = graph_%s.addAxis('%s')\n'''%(indgraph,indsubgraph, ind_axis,indgraph,subgraph.name) @@ -13781,17 +13781,17 @@ def confSave(self,filename): lines +=''' indAxis_%s_%s_%s = 0\n'''%(indgraph,indsubgraph,ind_axis) elif subgraph.axis[ind_axis].type[0]=='twinx': lines +=''' indAxis_%s_%s_%s = graph_%s.addAxis('%s',shared='x',axis=indAxis_%s_%s_%s)\n'''%(indgraph,indsubgraph, - ind_axis,indgraph,subgraph.name, - indgraph,indsubgraph, - subgraph.axis[ind_axis].type[1]) + ind_axis,indgraph,subgraph.name, + indgraph,indsubgraph, + subgraph.axis[ind_axis].type[1]) elif subgraph.axis[ind_axis].type[0]=='twiny': lines +=''' indAxis_%s_%s_%s = graph_%s.addAxis('%s',shared='y',axis=indAxis_%s_%s_%s)\n'''%(indgraph,indsubgraph, - ind_axis,indgraph,subgraph.name, - indgraph,indsubgraph, - subgraph.axis[ind_axis].type[1]) + ind_axis,indgraph,subgraph.name, + indgraph,indsubgraph, + subgraph.axis[ind_axis].type[1]) elif subgraph.axis[ind_axis].type[0] == 'new': lines +=''' indAxis_%s_%s_%s = graph_%s.addAxis('%s')\n'''%(indgraph,indsubgraph, - ind_axis,indgraph,subgraph.name) + ind_axis,indgraph,subgraph.name) # Loop on curves for curve in subgraph.curves: lines += '''%s\n'''%(curve.write(indgraph,subgraph.name,indcurve)) @@ -14085,7 +14085,7 @@ def drawOneFigure(self, iCurSubGraph): for zone in c.zone: try: if self.parent.data[zone][c.varx].shape != self.parent.data[zone][c.vary].shape: - # print('''### Message : can not plot %s vs %s since their shape are different.'''%(c.varx,c.vary)) + # print('''### Message : can not plot %s vs %s since their shape are different.'''%(c.varx,c.vary)) continue except AttributeError: try: @@ -14114,8 +14114,8 @@ def drawOneFigure(self, iCurSubGraph): yaxis_label += c.vary.split('@')[0]+',' # Create the plot of the curve thisPlot, = self.subGraph[iCurSubGraph].axis[iCurrentAxis].plot(sortedData[0],sortedData[1],color=c.line_color,linestyle=c.line_style,linewidth=c.line_width, - marker=marker_dic[c.marker_style],markersize=c.marker_size,markerfacecolor=c.marker_face_color, - markeredgecolor=c.marker_edge_color,markeredgewidth=c.marker_edge_width,markevery=markingSampling) + marker=marker_dic[c.marker_style],markersize=c.marker_size,markerfacecolor=c.marker_face_color, + markeredgecolor=c.marker_edge_color,markeredgewidth=c.marker_edge_width,markevery=markingSampling) # thisPlot, = plt.plot(sortedData[0],sortedData[1],color=c.line_color,linestyle=c.line_style,linewidth=c.line_width, # marker=marker_dic[c.marker_style],markersize=c.marker_size,markerfacecolor=c.marker_face_color, # markeredgecolor=c.marker_edge_color,markeredgewidth=c.marker_edge_width,markevery=markingSampling) @@ -14142,15 +14142,15 @@ def drawOneFigure(self, iCurSubGraph): except: val = val.replace('x:', '%') val = val.replace('{', '') - val = val.replace('}', '') + val = val.replace('}', '') self.subGraph[iCurSubGraph].axis[iCurrentAxis].xaxis.set_major_formatter(matplotlib.ticker.FormatStrFormatter (val)) val = self.subGraph[iCurSubGraph].axis_property[iCurrentAxis].y.axis_label_format try: self.subGraph[iCurSubGraph].axis[iCurrentAxis].yaxis.set_major_formatter(matplotlib.ticker.StrMethodFormatter(val)) - except: + except: val = val.replace('x:', '%') val = val.replace('{', '') val = val.replace('}', '') - self.subGraph[iCurSubGraph].axis[iCurrentAxis].xaxis.set_major_formatter(matplotlib.ticker.FormatStrFormatter (val)) + self.subGraph[iCurSubGraph].axis[iCurrentAxis].xaxis.set_major_formatter(matplotlib.ticker.FormatStrFormatter (val)) ## logscale if self.subGraph[iCurSubGraph].axis_property[iCurrentAxis].x.axis_logscale: self.subGraph[iCurSubGraph].axis[iCurrentAxis].set_xscale("log") @@ -14193,7 +14193,7 @@ def drawOneFigure(self, iCurSubGraph): #dx = pround(dx) #xmin = (round(xmin/dx))*dx #xmax = xmin+ntickMx*dx - #iymin = ymin; iymax = ymax + #iymin = ymin; iymax = ymax #dy = (ymax-ymin)/(float(ntickMy)) #dy = pround(dy) #ymin = round(ymin/dy)*dy @@ -14323,9 +14323,9 @@ def drawOneFigure(self, iCurSubGraph): if self.subGraph[iCurSubGraph].axis_property[iCurrentAxis].y.axis_label: yaxis_label = self.subGraph[iCurSubGraph].axis_property[iCurrentAxis].y.axis_label self.subGraph[iCurSubGraph].axis[iCurrentAxis].set_xlabel(r'%s'%xaxis_label, - fontsize=self.subGraph[iCurSubGraph].axis_property[iCurrentAxis].x.axis_label_fontsize) + fontsize=self.subGraph[iCurSubGraph].axis_property[iCurrentAxis].x.axis_label_fontsize) self.subGraph[iCurSubGraph].axis[iCurrentAxis].set_ylabel(r'%s'%yaxis_label, - fontsize=self.subGraph[iCurSubGraph].axis_property[iCurrentAxis].y.axis_label_fontsize) + fontsize=self.subGraph[iCurSubGraph].axis_property[iCurrentAxis].y.axis_label_fontsize) # self.subGraph[iCurSubGraph].axis[iCurrentAxis].grid(color='r', linestyle='-', linewidth=2) @@ -14333,37 +14333,37 @@ def drawOneFigure(self, iCurSubGraph): ### major grid ### ---> X self.subGraph[iCurSubGraph].axis[iCurrentAxis].grid(color=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].major.x.grid_color, - linestyle=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].major.x.grid_style, - linewidth=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].major.x.grid_width, which='major', axis='x') + linestyle=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].major.x.grid_style, + linewidth=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].major.x.grid_width, which='major', axis='x') # self.subGraph[iCurSubGraph].axis[iCurrentAxis].grid(TrueFalseDic[self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].major.x.display], which='major', axis='x') self.subGraph[iCurSubGraph].axis[iCurrentAxis].grid(self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].major.x.display, which='major', axis='x') ### ---> Y self.subGraph[iCurSubGraph].axis[iCurrentAxis].grid(color=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].major.y.grid_color, - linestyle=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].major.y.grid_style, - linewidth=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].major.y.grid_width, which='major', axis='y') + linestyle=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].major.y.grid_style, + linewidth=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].major.y.grid_width, which='major', axis='y') # self.subGraph[iCurSubGraph].axis[iCurrentAxis].grid(TrueFalseDic[self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].major.y.display], which='major', axis='y') self.subGraph[iCurSubGraph].axis[iCurrentAxis].grid(self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].major.y.display, which='major', axis='y') ### minor grid ### ---> X self.subGraph[iCurSubGraph].axis[iCurrentAxis].grid(color=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].minor.x.grid_color, - linestyle=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].minor.x.grid_style, - linewidth=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].minor.x.grid_width, which='minor', axis='x') + linestyle=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].minor.x.grid_style, + linewidth=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].minor.x.grid_width, which='minor', axis='x') # self.subGraph[iCurSubGraph].axis[iCurrentAxis].grid(TrueFalseDic[self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].minor.x.display], which='minor', axis='x') self.subGraph[iCurSubGraph].axis[iCurrentAxis].grid(self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].minor.x.display, which='minor', axis='x') ### ---> Y self.subGraph[iCurSubGraph].axis[iCurrentAxis].grid(color=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].minor.y.grid_color, - linestyle=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].minor.y.grid_style, - linewidth=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].minor.y.grid_width, which='minor', axis='y') + linestyle=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].minor.y.grid_style, + linewidth=self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].minor.y.grid_width, which='minor', axis='y') # self.subGraph[iCurSubGraph].axis[iCurrentAxis].grid(TrueFalseDic[self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].minor.y.display], which='minor', axis='y') self.subGraph[iCurSubGraph].axis[iCurrentAxis].grid(self.subGraph[iCurSubGraph].grid_property[iCurrentAxis].minor.y.display, which='minor', axis='y') #### LEGEND CONFIGURATION if self.subGraph[iCurSubGraph].legend_property.legend_display: legend_label_prop = {'weight':self.subGraph[iCurSubGraph].legend_property.legend_label_weight,'size':self.subGraph[iCurSubGraph].legend_property.legend_label_size, - 'style':self.subGraph[iCurSubGraph].legend_property.legend_label_style} + 'style':self.subGraph[iCurSubGraph].legend_property.legend_label_style} legend = self.subGraph[iCurSubGraph].axis[iCurrentAxis].legend(legend_list,legend_text,loc=self.subGraph[iCurSubGraph].legend_property.legend_position, - ncol=self.subGraph[iCurSubGraph].legend_property.legend_ncol, - prop = legend_label_prop) # Can add the frameon=True option to activate/desactivate the frame (border + background) for legend + ncol=self.subGraph[iCurSubGraph].legend_property.legend_ncol, + prop=legend_label_prop) # Can add the frameon=True option to activate/desactivate the frame (border + background) for legend # Interactive legend setPickerInLegend(legend) @@ -14372,7 +14372,7 @@ def drawOneFigure(self, iCurSubGraph): text.set_color(self.subGraph[iCurSubGraph].legend_property.legend_label_color) #### LEGEND TITLE legend_title_prop = {'weight':self.subGraph[iCurSubGraph].legend_property.legend_title_weight,'size':self.subGraph[iCurSubGraph].legend_property.legend_title_size, - 'style':self.subGraph[iCurSubGraph].legend_property.legend_title_style} + 'style':self.subGraph[iCurSubGraph].legend_property.legend_title_style} legend.set_title(self.subGraph[iCurSubGraph].legend_property.legend_title, prop=legend_title_prop) legend.get_title().set_color(self.subGraph[iCurSubGraph].legend_property.legend_title_color) #### LEGEND BORDER @@ -14400,17 +14400,17 @@ def drawOneFigure(self, iCurSubGraph): # family=t.font_type,fontweight=t.font_weight,horizontalalignment=t.ha,verticalalignment=t.va, # rotation=t.rotation,usetex=t.use_tex,alpha=t.text_alpha,backgroundcolor=background_color) text = self.subGraph[iCurSubGraph].axis[iCurrentAxis].text(posx,posy,t.text,color=t.text_color,visible=t.visibility, - family=t.font_type,fontweight=t.font_weight,horizontalalignment=t.ha,verticalalignment=t.va, - rotation=t.rotation,alpha=t.text_alpha,fontsize=t.text_size, - usetex=t.use_tex) + family=t.font_type,fontweight=t.font_weight,horizontalalignment=t.ha,verticalalignment=t.va, + rotation=t.rotation,alpha=t.text_alpha,fontsize=t.text_size, + usetex=t.use_tex) except AttributeError: print("usetex has been disabled => your version of matplotlib is to old") # text = self.subGraph[iCurSubGraph].axis[iCurrentAxis].text(t.posx,t.posy,t.text,color=t.text_color,visible=t.visibility, # family=t.font_type,fontweight=t.font_weight,horizontalalignment=t.ha,verticalalignment=t.va, # rotation=t.rotation,alpha=t.text_alpha,backgroundcolor=background_color) text = self.subGraph[iCurSubGraph].axis[iCurrentAxis].text(posx,posy,t.text,color=t.text_color,visible=t.visibility, - family=t.font_type,fontweight=t.font_weight,horizontalalignment=t.ha,verticalalignment=t.va, - rotation=t.rotation,alpha=t.text_alpha,fontsize=t.text_size) + family=t.font_type,fontweight=t.font_weight,horizontalalignment=t.ha,verticalalignment=t.va, + rotation=t.rotation,alpha=t.text_alpha,fontsize=t.text_size) text.set_bbox(dict( facecolor=box_backgroundcolor,edgecolor=t.box_edgecolor,alpha=t.box_alpha, boxstyle=t.box_style,linewidth=t.box_linewidth)) @@ -14430,41 +14430,41 @@ def drawOneFigure(self, iCurSubGraph): hatch = s.hatch if s.shape_type == 'Arrow': dico_arrow = { - 'Curve' :mpatch.ArrowStyle.Curve(), - 'CurveB' :mpatch.ArrowStyle.CurveB(head_length=s.head_length,head_width=s.head_width), - 'CurveFilledB' :mpatch.ArrowStyle.CurveFilledB(head_length=s.head_length,head_width=s.head_width), - 'CurveA' :mpatch.ArrowStyle.CurveA(head_length=s.head_length,head_width=s.head_width), - 'CurveAB' :mpatch.ArrowStyle.CurveAB(head_length=s.head_length,head_width=s.head_width), - 'CurveFilledA' :mpatch.ArrowStyle.CurveFilledA(head_length=s.head_length,head_width=s.head_width), - 'CurveFilledAB' :mpatch.ArrowStyle.CurveFilledAB(head_length=s.head_length,head_width=s.head_width), - 'Fancy' :mpatch.ArrowStyle.Fancy(head_length=s.head_length,head_width=s.head_width,tail_width=s.tail_width), - 'Simple' :mpatch.ArrowStyle.Simple(head_length=s.head_length,head_width=s.head_width,tail_width=s.tail_width) - } + 'Curve' :mpatch.ArrowStyle.Curve(), + 'CurveB' :mpatch.ArrowStyle.CurveB(head_length=s.head_length,head_width=s.head_width), + 'CurveFilledB' :mpatch.ArrowStyle.CurveFilledB(head_length=s.head_length,head_width=s.head_width), + 'CurveA' :mpatch.ArrowStyle.CurveA(head_length=s.head_length,head_width=s.head_width), + 'CurveAB' :mpatch.ArrowStyle.CurveAB(head_length=s.head_length,head_width=s.head_width), + 'CurveFilledA' :mpatch.ArrowStyle.CurveFilledA(head_length=s.head_length,head_width=s.head_width), + 'CurveFilledAB' :mpatch.ArrowStyle.CurveFilledAB(head_length=s.head_length,head_width=s.head_width), + 'Fancy' :mpatch.ArrowStyle.Fancy(head_length=s.head_length,head_width=s.head_width,tail_width=s.tail_width), + 'Simple' :mpatch.ArrowStyle.Simple(head_length=s.head_length,head_width=s.head_width,tail_width=s.tail_width) + } if len(points)==2: shape = mpatch.FancyArrowPatch(points[0],points[1],arrowstyle=dico_arrow[s.arrowstyle], - mutation_scale=s.scale,linewidth=s.linewidth, - hatch=hatch, - edgecolor=s.edgecolor, - facecolor=s.facecolor, - linestyle=s.linestyle, - alpha=s.alpha) + mutation_scale=s.scale,linewidth=s.linewidth, + hatch=hatch, + edgecolor=s.edgecolor, + facecolor=s.facecolor, + linestyle=s.linestyle, + alpha=s.alpha) self.subGraph[iCurSubGraph].axis[iCurrentAxis].add_patch(shape) elif len(points)==3: codes = [ - Path.MOVETO, - Path.CURVE3, - Path.CURVE3, - ] + Path.MOVETO, + Path.CURVE3, + Path.CURVE3, + ] path = Path(points,codes) self.subGraph[iCurSubGraph].axis[iCurrentAxis].add_patch(mpatch.FancyArrowPatch( - path=path, - arrowstyle=dico_arrow[s.arrowstyle], - mutation_scale=s.scale, - linewidth=s.linewidth, - hatch=hatch, - edgecolor=s.edgecolor, - facecolor=s.facecolor,linestyle=s.linestyle,alpha=s.alpha)) + path=path, + arrowstyle=dico_arrow[s.arrowstyle], + mutation_scale=s.scale, + linewidth=s.linewidth, + hatch=hatch, + edgecolor=s.edgecolor, + facecolor=s.facecolor,linestyle=s.linestyle,alpha=s.alpha)) elif s.shape_type == 'Circle': shape = mpatch.Circle( xy=[points[0][0],points[0][1]],radius=s.radius,clip_on=False, @@ -14487,34 +14487,34 @@ def drawOneFigure(self, iCurSubGraph): self.subGraph[iCurSubGraph].axis[iCurrentAxis].add_line(line) elif s.shape_type == 'Bracket': dico_bracket = { - 'BracketA' :mpatch.ArrowStyle.BracketA(widthA=s.widthA,lengthA=s.lengthA,angleA=s.angleA), - 'BracketB' :mpatch.ArrowStyle.BracketB(widthB=s.widthB,lengthB=s.lengthB,angleB=s.angleB), - 'BracketAB' :mpatch.ArrowStyle.BracketAB(widthA=s.widthA,lengthA=s.lengthA,angleA=s.angleA, - widthB=s.widthB,lengthB=s.lengthB,angleB=s.angleB), - } + 'BracketA' :mpatch.ArrowStyle.BracketA(widthA=s.widthA,lengthA=s.lengthA,angleA=s.angleA), + 'BracketB' :mpatch.ArrowStyle.BracketB(widthB=s.widthB,lengthB=s.lengthB,angleB=s.angleB), + 'BracketAB' :mpatch.ArrowStyle.BracketAB(widthA=s.widthA,lengthA=s.lengthA,angleA=s.angleA, + widthB=s.widthB,lengthB=s.lengthB,angleB=s.angleB), + } if len(points)==2: shape = mpatch.FancyArrowPatch(points[0],points[1],arrowstyle=dico_bracket[s.bracketstyle], - mutation_scale=s.scale,linewidth=s.linewidth, - edgecolor=s.edgecolor, - facecolor=s.facecolor, - linestyle=s.linestyle, - alpha=s.alpha) + mutation_scale=s.scale,linewidth=s.linewidth, + edgecolor=s.edgecolor, + facecolor=s.facecolor, + linestyle=s.linestyle, + alpha=s.alpha) self.subGraph[iCurSubGraph].axis[iCurrentAxis].add_patch(shape) elif len(points)==3: codes = [ - Path.MOVETO, - Path.CURVE3, - Path.CURVE3, - ] + Path.MOVETO, + Path.CURVE3, + Path.CURVE3, + ] path = Path(points,codes) self.subGraph[iCurSubGraph].axis[iCurrentAxis].add_patch(mpatch.FancyArrowPatch( - path=path, - arrowstyle=dico_bracket[s.bracketstyle], - mutation_scale=s.scale, - linewidth=s.linewidth, - edgecolor=s.edgecolor, - facecolor=s.facecolor,linestyle=s.linestyle,alpha=s.alpha)) + path=path, + arrowstyle=dico_bracket[s.bracketstyle], + mutation_scale=s.scale, + linewidth=s.linewidth, + edgecolor=s.edgecolor, + facecolor=s.facecolor,linestyle=s.linestyle,alpha=s.alpha)) @@ -14588,9 +14588,9 @@ def __init__(self, *args, **kwargs): axis_y_label_format = kwargs.get('axis_y_label_format', default_values['Axis']['axis_y_label_format']) self.x = DirAxis(axis_x_logscale,axis_x_autoscale,axis_x_min,axis_x_max,axis_x_label, - axis_x_inverted,axis_x_visible,axis_x_position,axis_x_offset,axis_x_label_fontsize,axis_x_label_format) + axis_x_inverted,axis_x_visible,axis_x_position,axis_x_offset,axis_x_label_fontsize,axis_x_label_format) self.y = DirAxis(axis_y_logscale,axis_y_autoscale,axis_y_min,axis_y_max,axis_y_label, - axis_y_inverted,axis_y_visible,axis_y_position,axis_y_offset,axis_x_label_fontsize,axis_y_label_format) + axis_y_inverted,axis_y_visible,axis_y_position,axis_y_offset,axis_x_label_fontsize,axis_y_label_format) def getInd(self): return self.ind @@ -15441,7 +15441,7 @@ def __init__(self, canvas, parent, graph): # def _Button(self, text, file, command, extension='.ppm'): - # #def _Button(self, text, file, toggle, command): + # #def _Button(self, text, file, toggle, command): # fileimage = file # im = TK.PhotoImage(data=IMAGE_DICT[fileimage]) # b = TK.Button(master=self, text=text, padx=2, pady=2, image=im, command=command) @@ -15693,7 +15693,7 @@ def updateFromTree(event=None, t=None): global PREVTPZONES if PREVTPZONES == []: DESKTOP.setData(tp) else: - to = getPlotTree(tp) + to = getPlotTree(tp) DESKTOP.replaceGroupZones(to, PREVTPZONES) PREVTPZONES = Internal.getZonePaths(to, 2) @@ -15766,12 +15766,12 @@ def updateApp2(t=None): #============================================================================== def saveApp(): -# A completer ... + # A completer ... CTK.savePrefFile() #============================================================================== def resetApp(): -# A completer ... + # A completer ... CTK.savePrefFile() #============================================================================== @@ -15781,15 +15781,15 @@ def displayFrameMenu(event=None): #============================================================================== # IMAGE RESSOURCES IMAGE_DICT = { -'initial':'''R0lGODlhGAAYAOekAAAAAAsNDQ8RERIUFRQXGCgtLjc9P0lSVNd/MrePX9aJTNmLT8OXVNmRVNyRVN6RUtmSW5GiptyWXt2YVtGacOCYWsicfN2gcLyojdqjbOWhZdumfuipSaO2uuStad6uh5G/ya+5uOuva+uweeizZey1VpHFz961l9+3l5PI0u+7WpfJ3qHI0fS8VLDFyp3K0fO9VZ7K0u+6g6DK05/L06PK0qjJ0KTK0qHL1KTL0qTL06nK0KHM1aXL1KrK0KLM1KfL0/TAXqTM1KXM0qTM1fTAYaLN1anL1fXBYOLApajN1LTM1qTR16fQ2a3Q1PbFbarR2arR2vbGb7XP1qvS26zT2LnQ2KzU27fR27LT163U3bnR2a3V2bLU1/fJea7V27TU1/TIl/fKfLDW2/fLfrHX27HX3LXW3bfW2bfW2rHY2+LOvrrX27rX3LbY3/jOiMDX3L/X4PjPirrZ3uLQw7fa373Z3cHY4bjb4L7a3sLa37vc4fbRocDb38nY47/c4MnZ5cnZ5vnTl8Lc4crZ6fjToPnUmc3b6cbe4s7b6cbe4/LVwc/c6dDc6fnXouPZ0dDd6dHd6frYo9Ld6NTe587g8NXf6eXf29vh5+Xi3+Xj4uLk5+Xl5uTm5+bm5tro+Nvo99zp993p+N7q+P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gA9CRxIsKDBgwgTKlwocI2DBZkYGsx0QUMhESgkEkzyIIwhMkUQFNzUiJHJSJ0GPpIwwpEcKS1IKBjIKZGfHTlu9PARyJKnDxX4CBKDRMWEDZcEbiJ0RMufPnbYtKFixYIMSW+ewPAAgQ7NQyzcIFJENk+aLlFCZPASpESDE5oIQgJyRhEcAwICkC1TJgUGDgwSGNzk58ogRXoidNBLdg+TKRQWHWxkYw5Zsi4YK9qjhkgohIx0sLmsKDPpMjREga6BhrRpsnXKxBgF+gYY15oVlcFB++AkH2myXH69V0dvg5wAQXFCtsAAAAQO7L2jkNKWJmXwkN4LAtTCSUtMIBj5YmYMlyo/lFSSiGkFFiE8XswYEueTxvv48+vfjzAgADs=''', -'move':'''R0lGODlhGAAYAOe1AA5efg9efw5ffg9ffxBgfxFgfxFggBNhgBRhgRRigRRighVigRdkghhlgxplhBxlhBpmhBtmhBxnhR1ohR5ohiJriCNriCRsiSVsiSRtiShuiylviylwjCtwjCxxjS1xjS1yjS9zjjV3kTl5kzp5kz17lUSAmEiDmkuEnE2GnVaMoVeMoViNolmNolqOo1uPpF+RpWOUp2SUqNd/MmaVqGiXqm2arG6brbePX9aJTHSer9mLT3WfsHmisnqissOXVNmRVNyRVN6RUtmSW9yWXt2YVuCYWsicfN2gcLyojZGwvdqjbOWhZZSyv9umfuipSZ24w+Stad6uh5G/ya+5uOuva+uweeizZaa9x+y1VpHFz6m/yd61l9+3l5PI0u+7WpfJ3rDEzKHI0fS8VPO9Ve+6g6TK0qHL1KTL0qTL06nK0KHM1aXL1KrK0KfL0/TAXqTM1PTAYaLN1anL1fXBYOLApbTM1qfQ2a3Q1PbFbarR2fbGb7fR27LT163U3bnR2ffJea7V27TU18TQ1fTIl/fKfPfLfrHX27HX3LfW2sjT2OLOvrrX27bY3/jOiMDX3PjPiuLQw73Z3cHY4bjb4L7a3s7X2/bRocDb38nY47/c4MnZ5fnTl8rZ6fjToPnUmc3b6cbe4s7b6cbe48/c6dDc6fnXouPZ0dDd6frYo9Ld6NTe5+Xf29vh5+Xi3+Xj4uLk5+Xl5ubm5tvo997q+P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gBlCRxIsKDBgwdfIFxYsAcHGQcXBdnhaiGWFQA+QCHoCgkTT1W6ILRUYwEAACUUCawjhNAnQ3FmFIRVihSICQUAGHBw4RQRK6Yg7RlzJcfAWKIyqUFjho0IABtkSTFyiVMhOl+KOGElEFanOX40YZLEiATUI2VSOcpDJsqQSEdBiWkUapTdSiagUlkC6E0WIFxeEUTlxlKFR3bt5t3gJcmTHzgyqBwIK5MSDAdsaNZsIQAFGzp8iEYQosnAUikYnFy9OgFr1g9YCIyhosHr1rdPFkABkVSYGyMIwBg+HIKACDZoED+gAUYYgaTMCArTIbHdpxsOnaEl0MMWgqraWCTqY/061ENpuB+MtUkPnvKjsB+axHDVnzuHKFnHPmUWQ1mq2KGFHIEg4oEEBgAwgAIX/CdLK2DwAccalriwmgmDOGgQFidktJGGBvGgAUQgHtRCiSgWFBAAOw==''', -'move_active':'''R0lGODlhGAAYAOevAAtLZQxLZgtMZQxMZg1NZg5NZg9OZhBOZxBOaBFOZxJQaBNRaRVRahZRahVSahZSahdTahhTaxtWbRxWbR1Wbh5Wbh1XbiBYbyFZbyFacCJacCNacSRacSRbcSZccipfdC5hdjFidzZmejppezxqfT5rfkVwgUZwgUZxgkdxgkhygklyg0x0hE92hlB2hlJ3hqxmKFN5iFd7ilh8ipJyTKtuPV1+jK5vP15/jWGCjmKCjpx5Q650Q7B0Q7J0Qq51SbB4S7F6RbN6SKB9Y7GAWpaGca6CVnSNl7eBUXaOma+FZbqHOn6TnLaKVLKLbHSZoYyUk7yMVrqPUYWXn7yNYb2RRXSepoeZobKRebKSeXagqL+WSMOWQ3mhsoGgp42do8KXRL+VaYGiqoOiqIOiqYSiqoGjqoeipoaiqYOjqoiipoeiqsOaS4KkqsOaTsSaTbWahJCjq4amroqmqoinrsWeV8WeWZKnr5Snro6prIqqsYuqr8ahYZ2mqpCqrMOgecaiY8aiZY6sr5Krro6ssJWsr6CprbWlmJKtssalbZqssLWmnMambpeusZOvs5qttJiussWngaWsr5qvsqGttpmws6Gut8epecapgKKuuseqeqSvuqWvup6ytZ6ytqawusesgraup6axusitgqixuqqyubeyr6+0ube1srW2ube2tbe3uLi4uK+6xrK7xv///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gBZCRxIsKDBgwdXIFxYMEcGFwcP9biBauGUEwA4MCGIiggSTFGyIJQUIwEAACEMCYTj44+mQG5gFEz16VMHCAUAFGBAIRQQKqAY2eEipcbAVZwonRkzpswHABhYORES6RKgN1uCKDElMFWmNXoqTWpUCATUIWFGJaoDpsmPRUc3eUHUyZNdSCKgQjHCh00VHlhUERSFRpIERXbt5sWgpciSHTQsqByYitKRCgZkaNY8IUAEGTZ0iD7gIcnATyUUnFy9+gBr1g1QCGxhYsHr1rdPFiAB8dOXGSAIsBg+3IGABzJeEDdwgcUXgZ/G+PmiIbHdpxgEiXElcMMVgqTUVwzKY/06VEFkuB9cZYnOnPKesAt6xLAUHjmCHFnH/qQVQ1akxGFFG3sQssEDOQ2AAAX/sXJKF3ekYYYkKqwmQh8NGjTFCBltlKFBOFwA0YcHpUDiiQUFBAA7''', -'zoom_to_rect':'''R0lGODlhGAAYAOfxADqInUKNoUSNo0aOpUeQo0yRqE6Up1OXqtd/MliarVicrFycsF6dsV2fr7ePX9aJTGKisdmLT2aktGSls2elt2mmtmintcOXVNmRVNyRVN6RUmypt9mSW26ruW+rudyWXt2YVtGacOCYWsicfHSvvHixvniyvHqzv92gcLyojdqjbOWhZYO5w9umfuipSXm+yIW8xIi8x4q9x37ByuStaY2/yt6uh4DDzJG/yYPDzYLEz6+5uOuva5LBzITFz+uweeizZey1VpHFz4rH0ZnExZbEzt61l5fF0IjJ1Y3I0d+3l5PI0ozK1IrL14/K1I3L1e+7WpfJ3qHI0fS8VJ3K0fO9VZ7K0u+6g5TN16DK05PO2J/L06PK0pTO2KjJ0KTK0qHL1KTL0qTL06nK0KHM1aXL1KrK0KLM1JfP2KfL0/TAXqTM1KXM0qTM1fTAYZbQ2qLN1anL1fXBYOLApZfR26jN1JnR25jS3LTM1qTR16fQ2a3Q1J3U3vbFbZ7U3qrR2arR2vbGb7XP1p/V4KvS26zT2LnQ2KzU27fR27LT163U3bnR2a3V2bLU1/fJea7V27TU1/TIl/fKfLDW2/fLfrHX27HX3LXW3bfW2bfW2rjW2rHY2+LOvrrX27rX3LbY3/jOiL/X4PjPirrZ3uLQw7fa373Z3cHY4bjb4L7a3rvc4fbRocDb38nY48Hb37/c4MnZ5cnZ5vnTl8Lc4crZ6fjToL7e4/nUmb7f47/f5M3b6cbe4s7b6cbe4/LVwcHg5c/c6dDc6cjf4/nXouPZ0dDd6dHd6frYo9Ld6MTi59Te58Xj587g8Mfj6NXf6cnl6uXf29vh58vm68zn687n7OXi3+Xj4uLk59Dp7tHp7uXl5tPq7+Tm5+bm5tro+Nvo99Tr8NXr8Nzp993p+N7q+Njt8tnu89vv9d7w9t/x9uL0+eP0+e3z+/D0+/L1+/n5/f78/v///////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gC7CRxIsKDBgwgTKlwokFOGCNUYGqyGYkUtHkokEpyjIdItSm4QFLwWDJhJY9wGEvvwY5ioQFOAPBiojVerMWG+lDETy1k3GyJWyZIkBwqIFtAEXqMVR9ErVqY6eSJkaMSVY6D6VKHBgRRNXVI+7RLWa1aqTI0A7VDhSE0QDEasESyW5tITPoP82NHCxMeNJSlcXHBApEsXJEpbHZqFBp26dOWyPfulKo+gEL7gaYZ3R2AwL6MYo1sHWTLlTW3EbdbcuRswMZ1cYTF3jkGBAQICADixZdxqzgKBccFkysm2cOCwSUtmq1QlK+R+twb2BZKmIdOoUViQ4IABAibAhkRf3RqZmUyJcixrdqRIjxoxWMAQM35za22w/uyZgSuXhwoSQNCAAjKc4o50AymziB4voIIKCR1sYMEEJeDwzW/ADYQMHkLA8YglkzBSyBl1MPMOhq0NFE0UiKxBBhVZsBGKNyeiaFAS7IgzDjk8toOhfQbp8MaQRA5Jx5FIHtmERkw2WVBAADs=''', -'zoom_to_rect_active':'''R0lGODlhGAAYAOfnAC5tfjVxgTZxgjhyhDlzgj10hj52hkJ5iKxmKEZ7ikZ9ikp9jUt+jkp/jJJyTKtuPU6Cjq5vP1KDkFCEj1KEklSFklOGkZx5Q650Q7B0Q1aHkrJ0Qq51SViJlFmJlLB4S7F6Rad7WrN6SKB9Y12MlmCOlmCOmGKPmbGAWpaGca6CVreBUWmUnK+FZbqHOmGYoGqWnW2Wn26Xn2WaoraKVGaco7KLbHGZonSZoWmcpIyUk7yMVmidpnWao2qeprqPUbyNYb2RRW6fp3qdnnSepnidpbKReXGgp22hqnmeprKSeXagqG6irHCiqnGiqnKiqr+WSMOWQ3mhsoGgp8KXRH6ip7+VaX6iqHakrH+iqYCiqYGiqnalrYahpoKiqIOiqIOiqYSiqoGjqoKjqoeipoaiqYOjqoiipoSjqHimroeiqnmmrcOaS4KkqsOaTsSaTXmnr3qnr4akqrWahHqosJCjq4OnrIamroqmqoinrsWeV36qssWeWX+qs5Gmq4mor5SmrYqprZKnr5Snro6prIqqroqqr4qqsYuqr46qrMahYZCqrMOgeY2rr8aiY8aiZY6sr5KrrpGrsY6ssJOrro6tr5Wsr5WssLWlmJKtssalbZKuspmss7WmnMambpWuspeusZOvs5qttJiussWngZqvspawtKGttpmws5uwtKGut8epeaGuuMapgKKuuseqepiytpmytqSvuqWvusKqmp6ytZqzt56ytqCytqawusesgraup6axuqexusitgqixup21uaqyuaqyuqWzwJ62uZ+2uqG3u7eyr6+0uaK4vKO5vKW5vbe1srW2uaa6vre2tae6vre3uKm7v7a4ubi4uK66xqq8wK+6xrC6xrG6xrK7xq2+wq6+wq+/xLLAxbLBxbXDx7bDx77CycDDycLEycfHysvKy////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gCpCRxIsKDBgwgTKlwoEFOGCMwYGmSGYkWrHUokEpyzgdGrR24QFGyWq2SuXtMG7voARJcnPlF+PBgYbdYpMl++hDnDShg1GyJIrXL0BgqIFscENnOl5hCqUqAsXfoDaIQVX5r0UKHBoRNNWVMy1cJ1K9WoSIny6FChiE0QDEaeEeRVRpKTPX32xOHSxEeNJSlcXHAwhAsXJEpPGUq1xhu4b9ugGbNlyo6fELTMaTZHR2CuLp8YewsHWTLlSmawbdbcmVouMJZKYeHWjUGBAQICADiRJdtqzp69RAL1RJo1a86SAYO1CdIVbb9b5/qyiJIQZcsoLEhwwACBElugha9u/etMJEI5iBVLUqTHjRgsYIARv7l1NFV58MyAFctDBQkQNKCADKKQE91AwQxyxwuhhEJCBxpYMIEJOFzzG3AD/VIHEW0gMkkjhQQyhhzDlHNhawMhI4UgZohRhRZocFKNiScadIQ42GSjzY7jXFifQTykIeSQQsJh5JFGMqHRkkwWFBAAOw==''', -'previous':'''R0lGODlhGAAYAOe4AAAAAAEBAQMDAwUGBgoMDA8REREUFBQWFxgbHCMoKDI4OTU8PT5FR1JcXlReYV1pa2x5fHeGiXiGidd/MoSUmLePX9aJTNmLT4ydocOXVNmRVNyRVN6RUtmSW9yWXt2YVtGacOCYWsicfJWnqpiqrt2gcLyojdqjbOWhZdumfuipSeStaaS4vN6uh5G/ya+5uOuva+uweeizZey1VpHFz961l9+3l5PI0u+7WpfJ3qHI0fS8VJ3K0fO9VZ7K0u+6g6DK05/L06PK0qjJ0KTK0rHHy6HL1KTL0qTL06nK0KHM1aXL1KrK0KLM1KfL0/TAXqTM1KXM0qTM1fTAYaLN1anL1fXBYOLApajN1LTM1rbM0aTR16fQ2bfN0q3Q1PbFbarR2arR2vbGb7XP1qvS26zT2LnQ1LnQ2KzU27fR27LT163U3bnR2a3V2bLU1/fJea7V27TU1/TIl/fKfLDW2/fLfrHX27HX3LXW3bfW2bfW2rHY2+LOvrrX27rX3LbY3/jOiL/X28DX3L/X4PjPirrZ3uLQw7fa373Z3cHY4bjb4L7a3sLa37vc4fbRocDb38nY47/c4MnZ5cnZ5vnTl8Lc4crZ6fjToMTc4fnUmcXd4s3b6cbe4s7b6cbe4/LVwc/c6dDc6fnXouPZ0dDd6dHd6frYo9Ld6NTe587g8NXf6eXf29vh5+Xi3+Xj4uLk5+Xl5uTm5+bm5tro+Nvo99zp993p+N7q+P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gBlCRxIsKDBgwgTKlwokM+GC60YGmxVAsUlGDYkErzCQU6mOlMmFHwVCpTJUrEGjvIQQxQhMTtkWBgIqxOkJEeILGEySZWsFiEcUZpjBceHFKsEvrJUZU2kR4j6+CFzRsQPU4C+9FjRwRDNTTr+cPJEdpEeN2FenHjzZIaGGq4IknKCx5Mgsp4YYbBj54YJFRkqGHwFCU0lsppINCgAwFOjLWNAfDoYakghTyweIABwwAEJx3uk1EIICkmfBAAMNBiBCa8nO0FskRaShwAABRG0uD5kx8ct0kTiBKLAYICABRK6kLVj5PfBU0z0qCFrRoKCAAKWI3FuEJYkMF5cOHsqAmF5IoWo2HCxo0j8axe0Fp7KQoMKnDt02pRpgiWVRFY5pAGFEjwAEcUgs2ik4IIMNuggQgEBADs=''', -'next':'''R0lGODlhGAAYAOe5AAAAAAEBAQMDAwUGBgsNDQ8REREUFBMVFhgbHCMoKDI4OTU8PT5GSFFbXVJcXlReYV5qbGx5fHeGiXiGiXmHitd/MoSUmLePX9aJTNmLT4ydocOXVNmRVNyRVN6RUtmSW9yWXt2YVtGacOCYWsicfJWnqpiqrpirr92gcLyojdqjbOWhZdumfuipSeStaaS4vN6uh5G/ya+5uOuva+uweeizZey1VpHFz961l9+3l5PI0u+7WpfJ3qHI0fS8VJ3K0fO9VZ7K0u+6g6DK05/L06PK0qjJ0KTK0rHHy6HL1KTL0qTL06nK0KHM1aXL1KrK0KLM1KfL0/TAXqTM1KXM0qTM1fTAYaLN1anL1fXBYOLApajN1LTM1rbM0aTR16fQ2bfN0q3Q1PbFbarR2arR2vbGb7XP1qvS26zT2LnQ1LnQ2KzU27fR27LT163U3bnR2a3V2bLU1/fJea7V27TU1/TIl/fKfLDW27zT2PfLfrHX27HX3LXW3bfW2bfW2rHY2+LOvrrX27rX3LbY3/jOiL/X27/X4PjPirrZ3uLQw7fa373Z3cHY4bjb4L7a3rvc4fbRocDb38nY47/c4MnZ5cnZ5vnTl8Lc4crZ6fjToMTc4fnUmc3b6cbe4s7b6cbe4/LVwc/c6dDc6fnXouPZ0dDd6dHd6frYo9Ld6NTe587g8NXf6eXf29vh5+Xi3+Xj4uLk5+Xl5uTm5+bm5tro+Nvo99zp993p+N7q+P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gBnCRxIsKDBgwgTKlwoEFCHDK4YGnSFYkWmGTkkEtTioc6mPFYqFIQlKpRJU7IGkgJBY9ShMj5qYBgYy5MkJkqOOHlSadUsGCMgWbKTZUcIFqwEwsKExc2kSIsCCTqjhoSQU4TEAHHxIRFNTj0GdfpE1pGfOGRkqJAjxQYHHK8IlorCRwMesnj16NGRosWGCwZhSVpzCUABByfwfnrkxYwIUAdFGUH0ycSDAwAQQHix+E8VWwhDLQmEV1OJBgYAJPikh8it0EX6KO4iQQEAAor0BMEV+gidT2AmLBAwgIGFQqyT8D6I6omfNgICKKCQRrGeJcsNxqI0JkwEJIrzMzJSmOrNFz2NwrOOUWshKi43rszZcwcOGihbVElsxYPNlCY/DEGFIbRoZOCBCCaoIEIBAQA7''', -'subplots':'''R0lGODlhGAAYAMZHAA5efg9efw5ffg9ffxBgfxFgfxFggBNhgBRhgRRigRRighVigRdkghhlgxplhBxlhBpmhBtmhBxnhR1ohR5ohiJriCNriCRsiSVsiSRtiShuiylviylwjCtwjCxxjS1xjS1yjS9zjjV3kTl5kzp5kz17lUSAmEiDmkuEnE2GnVaMoVeMoViNolmNolqOo1uPpF+RpWOUp2SUqGaVqGiXqm2arG6brXSer3WfsHmisnqispGwvZSyv524w6a9x6m/ybDEzMTQ1cjT2M7X29/i4+Lj5Obm5v///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAHsoBGgoOEhYaHhkUvRIiNhDkcMo6OPisAHz2Th0M0CwAAJUKahSATBQAGDhdFo4UiAButhySwsoYmtaNDFYW4sYQZooU7GAc1x8cWARQ1NzrPCCE8g0UpDJ/Y2AnZ2Q8sjDEqDdza5J8FKJJGQDYjBDDw8BACETUz8QcaMECFQB2uuQZ5+NHq1S9bgwwiJKRwoQcJBgAMULDK1hAX2EwEWejjxKVMC43g0KAuZJEWjELKCgQAOw==''', -'filesave':'''R0lGODlhGAAYAOfWABgqQwNAYQVBYgBDaQdCYwBEagBFayU9VgBGbAtEZR5AWABHbSY+VwBIbg1FZh9BWQBJbwBKaw9GZxBGaAFLbBJHaQNMbRNIagBNcgBNcypDXCNFXSRGXh5IZQdObyVHXyZIYABRdwpPcABSeCdJYShJYgxQcQBTeSlKYw5RcipLZBBScwBXdjJKZCtMZQBYdxJTdCxNZh1RbRNUdQJZeDlLYS1OZwRZeTpMYhdVdzpNYwdaehhWeDVQYwlbewxcfA5dfSZYdBBefmhLOzJYditdeXlNN3JPR0dZb0xbbE5dbkxfdVFgcYNWRU5hdz5nf1Nic1BjeVVkdVJle1NmfFRnfVpoeltpe1Jtgjt0kUhxiUJ1jER2jUV3jlJ1iV51haBrPqFsP6JtQGN5ill8kKNuQWB7kKRvQaVwQqZxQ1x/k6dyRGh+j2CDl2uBknKFkGuGm6t9WHWIlKx+WXaJla1/Wm2Mm3eKlq6AW26NnLR/XGuOo6+BXLWAXXmMmGyPpLCCXXCPnraBXnqNmXuOmm6RpnKRoHOSoX2QnHSTon6RnXGUqXWUo3KVqnaVpICTn3eWpYGUoIKVoXyXoXmYqIOXonqZqXCcr4SYo3uaqoWZpHybq4aapYGcpn6drYmcp3+froqdqHaitnuisIueqYWgqnejt4yfqo2gq4eirI6hrYijrYmlr4qmsJGksIunsZKlsYyospSns4uqupWotJCrtZeqtpmsuJSvuZWwupuvupywu56yvpm0v5+zv6C0wKG1waS3w6W4xKa5xae6xqi7x6m8yKq+yau/y6zAzK7Czq/Dz7DE0LLG0rPH07jIzrbJ1rvL0r7P1dTZ29vg4/7//P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gCrCRxIsKBBgj8SKvTBsKHDhjRo/Kj2w0dEI2vSoNlYpmNHMWHCgBlCgcKLhE/MwGgiqI8eQHxi4qlDc86cOEdkwIFBw0ebaSJESYvmbJmxYsJ+7dJ1y5YsWFmIUCvSM0cQGKaiPWM2q9GiRIcK/dmTx04nLgMEOOg5A8YMUdCcKfMCAsSHuxw4bNighosBAxMijhhxwlRRY8OA7cJlixYsVqlOneIyAXDEFCJWjFp2zJiWB6BDKxhNpgsCyzREZDbVeVisTZYoOWJ06FCgPJNMoxaBYcSlXrlu1XrValUpUJ4yUYKUiMvpwDQsUMAgBEjCiNix83iRI8df6BQixVyosKDy3/Po00O/sKCC+fTw0QfmQf50/PvfafA47eAvgQAABiigAOgtQIN36GnwBRZTUHGFFVVMEYUTDBR4YHotGCMFAAD4QYsrqHxSSQ8WInheC8RAwaEcsKjyCSaP6FAihsIwweEbqoSiSSSI4DAjei74sgSHbpCyoyJ++HiegTSk58IuSnDIBieSKDIIHTWgB0FEMKDXwi1jIJGEHJUoQsgdb9SQwF9bTqRfdzl0YEMMLqiAQgkl2MXBASy88IJE1QQEADs=''' + 'initial':'''R0lGODlhGAAYAOekAAAAAAsNDQ8RERIUFRQXGCgtLjc9P0lSVNd/MrePX9aJTNmLT8OXVNmRVNyRVN6RUtmSW5GiptyWXt2YVtGacOCYWsicfN2gcLyojdqjbOWhZdumfuipSaO2uuStad6uh5G/ya+5uOuva+uweeizZey1VpHFz961l9+3l5PI0u+7WpfJ3qHI0fS8VLDFyp3K0fO9VZ7K0u+6g6DK05/L06PK0qjJ0KTK0qHL1KTL0qTL06nK0KHM1aXL1KrK0KLM1KfL0/TAXqTM1KXM0qTM1fTAYaLN1anL1fXBYOLApajN1LTM1qTR16fQ2a3Q1PbFbarR2arR2vbGb7XP1qvS26zT2LnQ2KzU27fR27LT163U3bnR2a3V2bLU1/fJea7V27TU1/TIl/fKfLDW2/fLfrHX27HX3LXW3bfW2bfW2rHY2+LOvrrX27rX3LbY3/jOiMDX3L/X4PjPirrZ3uLQw7fa373Z3cHY4bjb4L7a3sLa37vc4fbRocDb38nY47/c4MnZ5cnZ5vnTl8Lc4crZ6fjToPnUmc3b6cbe4s7b6cbe4/LVwc/c6dDc6fnXouPZ0dDd6dHd6frYo9Ld6NTe587g8NXf6eXf29vh5+Xi3+Xj4uLk5+Xl5uTm5+bm5tro+Nvo99zp993p+N7q+P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gA9CRxIsKDBgwgTKlwocI2DBZkYGsx0QUMhESgkEkzyIIwhMkUQFNzUiJHJSJ0GPpIwwpEcKS1IKBjIKZGfHTlu9PARyJKnDxX4CBKDRMWEDZcEbiJ0RMufPnbYtKFixYIMSW+ewPAAgQ7NQyzcIFJENk+aLlFCZPASpESDE5oIQgJyRhEcAwICkC1TJgUGDgwSGNzk58ogRXoidNBLdg+TKRQWHWxkYw5Zsi4YK9qjhkgohIx0sLmsKDPpMjREga6BhrRpsnXKxBgF+gYY15oVlcFB++AkH2myXH69V0dvg5wAQXFCtsAAAAQO7L2jkNKWJmXwkN4LAtTCSUtMIBj5YmYMlyo/lFSSiGkFFiE8XswYEueTxvv48+vfjzAgADs=''', + 'move':'''R0lGODlhGAAYAOe1AA5efg9efw5ffg9ffxBgfxFgfxFggBNhgBRhgRRigRRighVigRdkghhlgxplhBxlhBpmhBtmhBxnhR1ohR5ohiJriCNriCRsiSVsiSRtiShuiylviylwjCtwjCxxjS1xjS1yjS9zjjV3kTl5kzp5kz17lUSAmEiDmkuEnE2GnVaMoVeMoViNolmNolqOo1uPpF+RpWOUp2SUqNd/MmaVqGiXqm2arG6brbePX9aJTHSer9mLT3WfsHmisnqissOXVNmRVNyRVN6RUtmSW9yWXt2YVuCYWsicfN2gcLyojZGwvdqjbOWhZZSyv9umfuipSZ24w+Stad6uh5G/ya+5uOuva+uweeizZaa9x+y1VpHFz6m/yd61l9+3l5PI0u+7WpfJ3rDEzKHI0fS8VPO9Ve+6g6TK0qHL1KTL0qTL06nK0KHM1aXL1KrK0KfL0/TAXqTM1PTAYaLN1anL1fXBYOLApbTM1qfQ2a3Q1PbFbarR2fbGb7fR27LT163U3bnR2ffJea7V27TU18TQ1fTIl/fKfPfLfrHX27HX3LfW2sjT2OLOvrrX27bY3/jOiMDX3PjPiuLQw73Z3cHY4bjb4L7a3s7X2/bRocDb38nY47/c4MnZ5fnTl8rZ6fjToPnUmc3b6cbe4s7b6cbe48/c6dDc6fnXouPZ0dDd6frYo9Ld6NTe5+Xf29vh5+Xi3+Xj4uLk5+Xl5ubm5tvo997q+P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gBlCRxIsKDBgwdfIFxYsAcHGQcXBdnhaiGWFQA+QCHoCgkTT1W6ILRUYwEAACUUCawjhNAnQ3FmFIRVihSICQUAGHBw4RQRK6Yg7RlzJcfAWKIyqUFjho0IABtkSTFyiVMhOl+KOGElEFanOX40YZLEiATUI2VSOcpDJsqQSEdBiWkUapTdSiagUlkC6E0WIFxeEUTlxlKFR3bt5t3gJcmTHzgyqBwIK5MSDAdsaNZsIQAFGzp8iEYQosnAUikYnFy9OgFr1g9YCIyhosHr1rdPFkABkVSYGyMIwBg+HIKACDZoED+gAUYYgaTMCArTIbHdpxsOnaEl0MMWgqraWCTqY/061ENpuB+MtUkPnvKjsB+axHDVnzuHKFnHPmUWQ1mq2KGFHIEg4oEEBgAwgAIX/CdLK2DwAccalriwmgmDOGgQFidktJGGBvGgAUQgHtRCiSgWFBAAOw==''', + 'move_active':'''R0lGODlhGAAYAOevAAtLZQxLZgtMZQxMZg1NZg5NZg9OZhBOZxBOaBFOZxJQaBNRaRVRahZRahVSahZSahdTahhTaxtWbRxWbR1Wbh5Wbh1XbiBYbyFZbyFacCJacCNacSRacSRbcSZccipfdC5hdjFidzZmejppezxqfT5rfkVwgUZwgUZxgkdxgkhygklyg0x0hE92hlB2hlJ3hqxmKFN5iFd7ilh8ipJyTKtuPV1+jK5vP15/jWGCjmKCjpx5Q650Q7B0Q7J0Qq51SbB4S7F6RbN6SKB9Y7GAWpaGca6CVnSNl7eBUXaOma+FZbqHOn6TnLaKVLKLbHSZoYyUk7yMVrqPUYWXn7yNYb2RRXSepoeZobKRebKSeXagqL+WSMOWQ3mhsoGgp42do8KXRL+VaYGiqoOiqIOiqYSiqoGjqoeipoaiqYOjqoiipoeiqsOaS4KkqsOaTsSaTbWahJCjq4amroqmqoinrsWeV8WeWZKnr5Snro6prIqqsYuqr8ahYZ2mqpCqrMOgecaiY8aiZY6sr5Krro6ssJWsr6CprbWlmJKtssalbZqssLWmnMambpeusZOvs5qttJiussWngaWsr5qvsqGttpmws6Gut8epecapgKKuuseqeqSvuqWvup6ytZ6ytqawusesgraup6axusitgqixuqqyubeyr6+0ube1srW2ube2tbe3uLi4uK+6xrK7xv///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gBZCRxIsKDBgwdXIFxYMEcGFwcP9biBauGUEwA4MCGIiggSTFGyIJQUIwEAACEMCYTj44+mQG5gFEz16VMHCAUAFGBAIRQQKqAY2eEipcbAVZwonRkzpswHABhYORES6RKgN1uCKDElMFWmNXoqTWpUCATUIWFGJaoDpsmPRUc3eUHUyZNdSCKgQjHCh00VHlhUERSFRpIERXbt5sWgpciSHTQsqByYitKRCgZkaNY8IUAEGTZ0iD7gIcnATyUUnFy9+gBr1g1QCGxhYsHr1rdPFiAB8dOXGSAIsBg+3IGABzJeEDdwgcUXgZ/G+PmiIbHdpxgEiXElcMMVgqTUVwzKY/06VEFkuB9cZYnOnPKesAt6xLAUHjmCHFnH/qQVQ1akxGFFG3sQssEDOQ2AAAX/sXJKF3ekYYYkKqwmQh8NGjTFCBltlKFBOFwA0YcHpUDiiQUFBAA7''', + 'zoom_to_rect':'''R0lGODlhGAAYAOfxADqInUKNoUSNo0aOpUeQo0yRqE6Up1OXqtd/MliarVicrFycsF6dsV2fr7ePX9aJTGKisdmLT2aktGSls2elt2mmtmintcOXVNmRVNyRVN6RUmypt9mSW26ruW+rudyWXt2YVtGacOCYWsicfHSvvHixvniyvHqzv92gcLyojdqjbOWhZYO5w9umfuipSXm+yIW8xIi8x4q9x37ByuStaY2/yt6uh4DDzJG/yYPDzYLEz6+5uOuva5LBzITFz+uweeizZey1VpHFz4rH0ZnExZbEzt61l5fF0IjJ1Y3I0d+3l5PI0ozK1IrL14/K1I3L1e+7WpfJ3qHI0fS8VJ3K0fO9VZ7K0u+6g5TN16DK05PO2J/L06PK0pTO2KjJ0KTK0qHL1KTL0qTL06nK0KHM1aXL1KrK0KLM1JfP2KfL0/TAXqTM1KXM0qTM1fTAYZbQ2qLN1anL1fXBYOLApZfR26jN1JnR25jS3LTM1qTR16fQ2a3Q1J3U3vbFbZ7U3qrR2arR2vbGb7XP1p/V4KvS26zT2LnQ2KzU27fR27LT163U3bnR2a3V2bLU1/fJea7V27TU1/TIl/fKfLDW2/fLfrHX27HX3LXW3bfW2bfW2rjW2rHY2+LOvrrX27rX3LbY3/jOiL/X4PjPirrZ3uLQw7fa373Z3cHY4bjb4L7a3rvc4fbRocDb38nY48Hb37/c4MnZ5cnZ5vnTl8Lc4crZ6fjToL7e4/nUmb7f47/f5M3b6cbe4s7b6cbe4/LVwcHg5c/c6dDc6cjf4/nXouPZ0dDd6dHd6frYo9Ld6MTi59Te58Xj587g8Mfj6NXf6cnl6uXf29vh58vm68zn687n7OXi3+Xj4uLk59Dp7tHp7uXl5tPq7+Tm5+bm5tro+Nvo99Tr8NXr8Nzp993p+N7q+Njt8tnu89vv9d7w9t/x9uL0+eP0+e3z+/D0+/L1+/n5/f78/v///////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gC7CRxIsKDBgwgTKlwokFOGCNUYGqyGYkUtHkokEpyjIdItSm4QFLwWDJhJY9wGEvvwY5ioQFOAPBiojVerMWG+lDETy1k3GyJWyZIkBwqIFtAEXqMVR9ErVqY6eSJkaMSVY6D6VKHBgRRNXVI+7RLWa1aqTI0A7VDhSE0QDEasESyW5tITPoP82NHCxMeNJSlcXHBApEsXJEpbHZqFBp26dOWyPfulKo+gEL7gaYZ3R2AwL6MYo1sHWTLlTW3EbdbcuRswMZ1cYTF3jkGBAQICADixZdxqzgKBccFkysm2cOCwSUtmq1QlK+R+twb2BZKmIdOoUViQ4IABAibAhkRf3RqZmUyJcixrdqRIjxoxWMAQM35za22w/uyZgSuXhwoSQNCAAjKc4o50AymziB4voIIKCR1sYMEEJeDwzW/ADYQMHkLA8YglkzBSyBl1MPMOhq0NFE0UiKxBBhVZsBGKNyeiaFAS7IgzDjk8toOhfQbp8MaQRA5Jx5FIHtmERkw2WVBAADs=''', + 'zoom_to_rect_active':'''R0lGODlhGAAYAOfnAC5tfjVxgTZxgjhyhDlzgj10hj52hkJ5iKxmKEZ7ikZ9ikp9jUt+jkp/jJJyTKtuPU6Cjq5vP1KDkFCEj1KEklSFklOGkZx5Q650Q7B0Q1aHkrJ0Qq51SViJlFmJlLB4S7F6Rad7WrN6SKB9Y12MlmCOlmCOmGKPmbGAWpaGca6CVreBUWmUnK+FZbqHOmGYoGqWnW2Wn26Xn2WaoraKVGaco7KLbHGZonSZoWmcpIyUk7yMVmidpnWao2qeprqPUbyNYb2RRW6fp3qdnnSepnidpbKReXGgp22hqnmeprKSeXagqG6irHCiqnGiqnKiqr+WSMOWQ3mhsoGgp8KXRH6ip7+VaX6iqHakrH+iqYCiqYGiqnalrYahpoKiqIOiqIOiqYSiqoGjqoKjqoeipoaiqYOjqoiipoSjqHimroeiqnmmrcOaS4KkqsOaTsSaTXmnr3qnr4akqrWahHqosJCjq4OnrIamroqmqoinrsWeV36qssWeWX+qs5Gmq4mor5SmrYqprZKnr5Snro6prIqqroqqr4qqsYuqr46qrMahYZCqrMOgeY2rr8aiY8aiZY6sr5KrrpGrsY6ssJOrro6tr5Wsr5WssLWlmJKtssalbZKuspmss7WmnMambpWuspeusZOvs5qttJiussWngZqvspawtKGttpmws5uwtKGut8epeaGuuMapgKKuuseqepiytpmytqSvuqWvusKqmp6ytZqzt56ytqCytqawusesgraup6axuqexusitgqixup21uaqyuaqyuqWzwJ62uZ+2uqG3u7eyr6+0uaK4vKO5vKW5vbe1srW2uaa6vre2tae6vre3uKm7v7a4ubi4uK66xqq8wK+6xrC6xrG6xrK7xq2+wq6+wq+/xLLAxbLBxbXDx7bDx77CycDDycLEycfHysvKy////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gCpCRxIsKDBgwgTKlwoEFOGCMwYGmSGYkWrHUokEpyzgdGrR24QFGyWq2SuXtMG7voARJcnPlF+PBgYbdYpMl++hDnDShg1GyJIrXL0BgqIFscENnOl5hCqUqAsXfoDaIQVX5r0UKHBoRNNWVMy1cJ1K9WoSIny6FChiE0QDEaeEeRVRpKTPX32xOHSxEeNJSlcXHAwhAsXJEpPGUq1xhu4b9ugGbNlyo6fELTMaTZHR2CuLp8YewsHWTLlSmawbdbcmVouMJZKYeHWjUGBAQICADiRJdtqzp69RAL1RJo1a86SAYO1CdIVbb9b5/qyiJIQZcsoLEhwwACBElugha9u/etMJEI5iBVLUqTHjRgsYIARv7l1NFV58MyAFctDBQkQNKCADKKQE91AwQxyxwuhhEJCBxpYMIEJOFzzG3AD/VIHEW0gMkkjhQQyhhzDlHNhawMhI4UgZohRhRZocFKNiScadIQ42GSjzY7jXFifQTykIeSQQsJh5JFGMqHRkkwWFBAAOw==''', + 'previous':'''R0lGODlhGAAYAOe4AAAAAAEBAQMDAwUGBgoMDA8REREUFBQWFxgbHCMoKDI4OTU8PT5FR1JcXlReYV1pa2x5fHeGiXiGidd/MoSUmLePX9aJTNmLT4ydocOXVNmRVNyRVN6RUtmSW9yWXt2YVtGacOCYWsicfJWnqpiqrt2gcLyojdqjbOWhZdumfuipSeStaaS4vN6uh5G/ya+5uOuva+uweeizZey1VpHFz961l9+3l5PI0u+7WpfJ3qHI0fS8VJ3K0fO9VZ7K0u+6g6DK05/L06PK0qjJ0KTK0rHHy6HL1KTL0qTL06nK0KHM1aXL1KrK0KLM1KfL0/TAXqTM1KXM0qTM1fTAYaLN1anL1fXBYOLApajN1LTM1rbM0aTR16fQ2bfN0q3Q1PbFbarR2arR2vbGb7XP1qvS26zT2LnQ1LnQ2KzU27fR27LT163U3bnR2a3V2bLU1/fJea7V27TU1/TIl/fKfLDW2/fLfrHX27HX3LXW3bfW2bfW2rHY2+LOvrrX27rX3LbY3/jOiL/X28DX3L/X4PjPirrZ3uLQw7fa373Z3cHY4bjb4L7a3sLa37vc4fbRocDb38nY47/c4MnZ5cnZ5vnTl8Lc4crZ6fjToMTc4fnUmcXd4s3b6cbe4s7b6cbe4/LVwc/c6dDc6fnXouPZ0dDd6dHd6frYo9Ld6NTe587g8NXf6eXf29vh5+Xi3+Xj4uLk5+Xl5uTm5+bm5tro+Nvo99zp993p+N7q+P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gBlCRxIsKDBgwgTKlwokM+GC60YGmxVAsUlGDYkErzCQU6mOlMmFHwVCpTJUrEGjvIQQxQhMTtkWBgIqxOkJEeILGEySZWsFiEcUZpjBceHFKsEvrJUZU2kR4j6+CFzRsQPU4C+9FjRwRDNTTr+cPJEdpEeN2FenHjzZIaGGq4IknKCx5Mgsp4YYbBj54YJFRkqGHwFCU0lsppINCgAwFOjLWNAfDoYakghTyweIABwwAEJx3uk1EIICkmfBAAMNBiBCa8nO0FskRaShwAABRG0uD5kx8ct0kTiBKLAYICABRK6kLVj5PfBU0z0qCFrRoKCAAKWI3FuEJYkMF5cOHsqAmF5IoWo2HCxo0j8axe0Fp7KQoMKnDt02pRpgiWVRFY5pAGFEjwAEcUgs2ik4IIMNuggQgEBADs=''', + 'next':'''R0lGODlhGAAYAOe5AAAAAAEBAQMDAwUGBgsNDQ8REREUFBMVFhgbHCMoKDI4OTU8PT5GSFFbXVJcXlReYV5qbGx5fHeGiXiGiXmHitd/MoSUmLePX9aJTNmLT4ydocOXVNmRVNyRVN6RUtmSW9yWXt2YVtGacOCYWsicfJWnqpiqrpirr92gcLyojdqjbOWhZdumfuipSeStaaS4vN6uh5G/ya+5uOuva+uweeizZey1VpHFz961l9+3l5PI0u+7WpfJ3qHI0fS8VJ3K0fO9VZ7K0u+6g6DK05/L06PK0qjJ0KTK0rHHy6HL1KTL0qTL06nK0KHM1aXL1KrK0KLM1KfL0/TAXqTM1KXM0qTM1fTAYaLN1anL1fXBYOLApajN1LTM1rbM0aTR16fQ2bfN0q3Q1PbFbarR2arR2vbGb7XP1qvS26zT2LnQ1LnQ2KzU27fR27LT163U3bnR2a3V2bLU1/fJea7V27TU1/TIl/fKfLDW27zT2PfLfrHX27HX3LXW3bfW2bfW2rHY2+LOvrrX27rX3LbY3/jOiL/X27/X4PjPirrZ3uLQw7fa373Z3cHY4bjb4L7a3rvc4fbRocDb38nY47/c4MnZ5cnZ5vnTl8Lc4crZ6fjToMTc4fnUmc3b6cbe4s7b6cbe4/LVwc/c6dDc6fnXouPZ0dDd6dHd6frYo9Ld6NTe587g8NXf6eXf29vh5+Xi3+Xj4uLk5+Xl5uTm5+bm5tro+Nvo99zp993p+N7q+P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gBnCRxIsKDBgwgTKlwoEFCHDK4YGnSFYkWmGTkkEtTioc6mPFYqFIQlKpRJU7IGkgJBY9ShMj5qYBgYy5MkJkqOOHlSadUsGCMgWbKTZUcIFqwEwsKExc2kSIsCCTqjhoSQU4TEAHHxIRFNTj0GdfpE1pGfOGRkqJAjxQYHHK8IlorCRwMesnj16NGRosWGCwZhSVpzCUABByfwfnrkxYwIUAdFGUH0ycSDAwAQQHix+E8VWwhDLQmEV1OJBgYAJPikh8it0EX6KO4iQQEAAor0BMEV+gidT2AmLBAwgIGFQqyT8D6I6omfNgICKKCQRrGeJcsNxqI0JkwEJIrzMzJSmOrNFz2NwrOOUWshKi43rszZcwcOGihbVElsxYPNlCY/DEGFIbRoZOCBCCaoIEIBAQA7''', + 'subplots':'''R0lGODlhGAAYAMZHAA5efg9efw5ffg9ffxBgfxFgfxFggBNhgBRhgRRigRRighVigRdkghhlgxplhBxlhBpmhBtmhBxnhR1ohR5ohiJriCNriCRsiSVsiSRtiShuiylviylwjCtwjCxxjS1xjS1yjS9zjjV3kTl5kzp5kz17lUSAmEiDmkuEnE2GnVaMoVeMoViNolmNolqOo1uPpF+RpWOUp2SUqGaVqGiXqm2arG6brXSer3WfsHmisnqispGwvZSyv524w6a9x6m/ybDEzMTQ1cjT2M7X29/i4+Lj5Obm5v///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAHsoBGgoOEhYaHhkUvRIiNhDkcMo6OPisAHz2Th0M0CwAAJUKahSATBQAGDhdFo4UiAButhySwsoYmtaNDFYW4sYQZooU7GAc1x8cWARQ1NzrPCCE8g0UpDJ/Y2AnZ2Q8sjDEqDdza5J8FKJJGQDYjBDDw8BACETUz8QcaMECFQB2uuQZ5+NHq1S9bgwwiJKRwoQcJBgAMULDK1hAX2EwEWejjxKVMC43g0KAuZJEWjELKCgQAOw==''', + 'filesave':'''R0lGODlhGAAYAOfWABgqQwNAYQVBYgBDaQdCYwBEagBFayU9VgBGbAtEZR5AWABHbSY+VwBIbg1FZh9BWQBJbwBKaw9GZxBGaAFLbBJHaQNMbRNIagBNcgBNcypDXCNFXSRGXh5IZQdObyVHXyZIYABRdwpPcABSeCdJYShJYgxQcQBTeSlKYw5RcipLZBBScwBXdjJKZCtMZQBYdxJTdCxNZh1RbRNUdQJZeDlLYS1OZwRZeTpMYhdVdzpNYwdaehhWeDVQYwlbewxcfA5dfSZYdBBefmhLOzJYditdeXlNN3JPR0dZb0xbbE5dbkxfdVFgcYNWRU5hdz5nf1Nic1BjeVVkdVJle1NmfFRnfVpoeltpe1Jtgjt0kUhxiUJ1jER2jUV3jlJ1iV51haBrPqFsP6JtQGN5ill8kKNuQWB7kKRvQaVwQqZxQ1x/k6dyRGh+j2CDl2uBknKFkGuGm6t9WHWIlKx+WXaJla1/Wm2Mm3eKlq6AW26NnLR/XGuOo6+BXLWAXXmMmGyPpLCCXXCPnraBXnqNmXuOmm6RpnKRoHOSoX2QnHSTon6RnXGUqXWUo3KVqnaVpICTn3eWpYGUoIKVoXyXoXmYqIOXonqZqXCcr4SYo3uaqoWZpHybq4aapYGcpn6drYmcp3+froqdqHaitnuisIueqYWgqnejt4yfqo2gq4eirI6hrYijrYmlr4qmsJGksIunsZKlsYyospSns4uqupWotJCrtZeqtpmsuJSvuZWwupuvupywu56yvpm0v5+zv6C0wKG1waS3w6W4xKa5xae6xqi7x6m8yKq+yau/y6zAzK7Czq/Dz7DE0LLG0rPH07jIzrbJ1rvL0r7P1dTZ29vg4/7//P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAGAAYAAAI/gCrCRxIsKBBgj8SKvTBsKHDhjRo/Kj2w0dEI2vSoNlYpmNHMWHCgBlCgcKLhE/MwGgiqI8eQHxi4qlDc86cOEdkwIFBw0ebaSJESYvmbJmxYsJ+7dJ1y5YsWFmIUCvSM0cQGKaiPWM2q9GiRIcK/dmTx04nLgMEOOg5A8YMUdCcKfMCAsSHuxw4bNighosBAxMijhhxwlRRY8OA7cJlixYsVqlOneIyAXDEFCJWjFp2zJiWB6BDKxhNpgsCyzREZDbVeVisTZYoOWJ06FCgPJNMoxaBYcSlXrlu1XrValUpUJ4yUYKUiMvpwDQsUMAgBEjCiNix83iRI8df6BQixVyosKDy3/Po00O/sKCC+fTw0QfmQf50/PvfafA47eAvgQAABiigAOgtQIN36GnwBRZTUHGFFVVMEYUTDBR4YHotGCMFAAD4QYsrqHxSSQ8WInheC8RAwaEcsKjyCSaP6FAihsIwweEbqoSiSSSI4DAjei74sgSHbpCyoyJ++HiegTSk58IuSnDIBieSKDIIHTWgB0FEMKDXwi1jIJGEHJUoQsgdb9SQwF9bTqRfdzl0YEMMLqiAQgkl2MXBASy88IJE1QQEADs=''' } #IMAGE_DICT = { #'initial':'''UDYKIyBDUkVBVE9SOiBHSU1QIFBOTSBGaWx0ZXIgVmVyc2lvbiAxLjEKMjQgMjQKMjU1Cubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5uLOvtyRVNmLT+Xi3+bm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5uXi392gcOWhZfjToOuva9+3l+bm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5uLApd6RUvTIl/nUmffLfvTAYdd/Mubm5ubm5ubm5ubm5ubm5uLk59Dc6c/c6c/c6c/c6dHd6eTm5+bm5ubm5ubm5uPZ0dyWXuuwefnXovjPivbGb/S8VOizZdaJTObm5ubm5ubm5uXl5s7b6cnY46nK0KTL0qTK0qXL1KrK0MnZ5tXf6ebm5t6uh+CYWvbRofnTl/fKfPXBYO+7Wt2YVtumfuXf2+bm5ubm5uLk58rZ6anL1a3U3b/c4MDb373Z3brX27rX3KvS27nQ2MicfO+6g/rYo/jOiPbFbfO9VeStadmSW+LQw+bm5ubm5ubm5uXl5s3b6aHI0bbY38be4sbe48be48be477a3rfW2rLU16rR2q+5uNqjbPfJefTAXuy1VtmRVN61l+Xj4ubm5ubm5ubm5ubm5tDd6afL07XW3cbe48DX3Dc9Pw8REQsNDcbe48be47HX27HX25PI0ryojeipScOXVLePX+bm5ubm5ubm5ubm5ubm5ubm5uLk58nY46zU28Lc4cbe48La35GipqO2ugsNDcbe48be48be47vc4aTR17XP1tGacPLVwebm5ubm5ubm5ubm5ubm5ubm5ubm5tDc6ajJ0LrZ3sbe48be48be48be47DFygsNDcbe48be48be47vc4bHY26TM1dzp9+bm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5s/c6aTL07rX28be48be48be48be47DFygsNDcbe48be48be48be47HX25/L093p+Obm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5s/c6aPK0rfW2cbe48be48be48be47DFygsNDcbe48be48be47fa37HX257K0t7q+Obm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5s/c6aTK0rTU18be48be48be48be47DFygsNDcbe48be48be48be47HX26HL1N7q+Obm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5tLd6KrK0LfW2rLT18be48be48be47DFygsNDcbe48be48be48be47HX26TL097q+Obm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5uXl5snZ5arR2a3Q1Mbe48be4ygtLhIUFQAAABQXGElSVMbe48be47HX28HY4ebm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5tTe57nR2afQ2bHX27jb4Mbe48be48be48be48be48be47HX25G/ydvo9+bm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5tLd6LTM1pHFz6LN1a7V27HX3LDW263V2azT2KLM1KjN1M7g8Obm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5tvh55fJ3rfR26TM1KHM1Z3K0aDK06XM0r/X4Nro+Obm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5g==''', @@ -15808,16 +15808,16 @@ def displayFrameMenu(event=None): # plot toutes les zones 1d de a sur le meme graphe # si export != None: ecrit le fichier en mode batch #============================================================================== -def plot(a, varx='CoordinateX', vary='F', - export=None, - rangex=None, rangey=None, +def plot(a, varx='CoordinateX', vary='F', + export=None, + rangex=None, rangey=None, xlabel=None, ylabel=None, xformat=None, yformat=None, xFontSize=None, yFontSize=None, legends=None, legendFontSize=10, lineWidth=1.5, lineColor=None, - markerStyle='none', markerSize=6.5, + markerStyle='none', markerSize=6.5, markerFaceColor=None, markerEdgeColor=None): if export is not None: setBatch() @@ -15836,7 +15836,7 @@ def plot(a, varx='CoordinateX', vary='F', for c, z in enumerate(zones): conc[c].append(z) a = [] for zs in conc: - try: + try: za = T.join(zs) except: zs = C.convertArray2Hexa(zs) @@ -15904,7 +15904,7 @@ def plot(a, varx='CoordinateX', vary='F', line_color=lineColors[c], line_width=lineWidths[c], marker_style=markerStyles[c], - marker_face_color=markerFaceColors[c], + marker_face_color=markerFaceColors[c], marker_edge_color=markerEdgeColor, marker_size=markerSizes[c], legend_label=legendLabels[c], @@ -15933,11 +15933,11 @@ def plot(a, varx='CoordinateX', vary='F', if xFontSize is not None: axis.x.setValue('axis_label_fontsize', xFontSize) if yFontSize is not None: - axis.y.setValue('axis_label_fontsize', yFontSize) + axis.y.setValue('axis_label_fontsize', yFontSize) graph.updateGraph('1:1') - if export is not None: # export in image + if export is not None: # export in image graph.save(export) graph.close() else: # interactive diff --git a/Cassiopee/CPlot/apps/tkPovRay.py b/Cassiopee/CPlot/apps/tkPovRay.py index 9f47d50fa..2309fce46 100644 --- a/Cassiopee/CPlot/apps/tkPovRay.py +++ b/Cassiopee/CPlot/apps/tkPovRay.py @@ -180,7 +180,7 @@ def savePovFile(): file.write(' [0.65 rgb <0.1,0.2,0.8>]\n') file.write(' [1.00 rgb <0.6,0.7,1.0>]\n') file.write(' }\n') - file.write(' scale 2\n') + file.write(' scale 2\n') file.write(' } // end of pigment\n') file.write(' } //end of skysphere\n') elif (bckgrd == 'Cloudy sky'): # on pourrait faire beaucoup mieux @@ -328,7 +328,7 @@ def savePovFile(): file.write('#include "'+f+'"\n') file.write('object {mesh_'+str(c)+'\n') file.write('texture{pigment{color '+color+' filter 1.}\n') - #file.write('texture{pigment { rgbt 1 }\n') + #file.write('texture{pigment { rgbt 1 }\n') file.write('finish {ambient 0.1 diffuse 0.1 }}\n') file.write('hollow\n') file.write('interior{ //---------------------\n') @@ -405,15 +405,15 @@ def createApp(win): # - VARS - # -0- background - V = TK.StringVar(win); V.set('Black'); VARS.append(V) - if 'tkPovRayBackground' in CTK.PREFS: + if 'tkPovRayBackground' in CTK.PREFS: V.set(CTK.PREFS['tkPovRayBackground']) # -1- Image size V = TK.StringVar(win); V.set('800x600'); VARS.append(V) - if 'tkPovRaySize' in CTK.PREFS: + if 'tkPovRaySize' in CTK.PREFS: V.set(CTK.PREFS['tkPovRaySize']) # -2- Dir name (file.pov et file.png) - V = TK.StringVar(win); V.set('PovRay'); VARS.append(V) - if 'tkPovRayOutput' in CTK.PREFS: + V = TK.StringVar(win); V.set('PovRay'); VARS.append(V) + if 'tkPovRayOutput' in CTK.PREFS: V.set(CTK.PREFS['tkPovRayOutput']) # - File - @@ -422,7 +422,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Directory name for output (.pov and .png).') # - Background selection - - B = TTK.OptionMenu(Frame, VARS[0], 'Black', 'White', 'Blue sky', + B = TTK.OptionMenu(Frame, VARS[0], 'Black', 'White', 'Blue sky', 'Cloudy sky', 'Starfield' ) B.grid(row=1, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Output background.') diff --git a/Cassiopee/CPlot/apps/tkPrefs.py b/Cassiopee/CPlot/apps/tkPrefs.py index 6ed8dd68d..fcae2db31 100644 --- a/Cassiopee/CPlot/apps/tkPrefs.py +++ b/Cassiopee/CPlot/apps/tkPrefs.py @@ -84,7 +84,7 @@ def setBgColor(event=None): if 'backgroundFile' in CTK.PREFS: initFile = CTK.PREFS['backgroundFile'] else: initFile = 'paperBackground1.png' files = tkFileDialog.askopenfilenames( - filetypes=[('png image file', '*.png')], initialfile=initFile, multiple=0) + filetypes=[('png image file', '*.png')], initialfile=initFile, multiple=0) if files == '' or files is None or files == (): # user cancel return files = CTK.fixFileString__(files, initFile) @@ -265,9 +265,9 @@ def createApp(win): F.grid(row=r, column=1, sticky=TK.EW) WIDGETS['guitheme'] = B else: - B = ttk.Combobox(F, textvariable=VARS[9], - values=[], state='readonly', width=10) - B.bind('<>', setTheme) + B = ttk.Combobox(F, textvariable=VARS[9], + values=[], state='readonly', width=10) + B.bind('<>', setTheme) B.grid(sticky=TK.EW) F.bind('', updateThemeList2) F.grid(row=r, column=1, sticky=TK.EW) diff --git a/Cassiopee/CPlot/apps/tkProbe.py b/Cassiopee/CPlot/apps/tkProbe.py index 4f3222a06..3a0b99d2a 100644 --- a/Cassiopee/CPlot/apps/tkProbe.py +++ b/Cassiopee/CPlot/apps/tkProbe.py @@ -70,9 +70,9 @@ def getVariableValue(event=None): CTK.TXT.insert('START', 'Error: ', 'Error'); return cvar = VARS[0].get() - if cvar == 'CoordinateX': + if cvar == 'CoordinateX': VARS[1].set(str(point[0])) - elif cvar == 'CoordinateY': + elif cvar == 'CoordinateY': VARS[1].set(str(point[1])) elif cvar == 'CoordinateZ': VARS[1].set(str(point[2])) @@ -103,7 +103,7 @@ def setVariableValue(event=None): z = CTK.t[2][nob][2][noz] ind = CPlot.getActivePointIndex() if ind == []: - CTK.TXT.insert('START', 'No selected point.\n') + CTK.TXT.insert('START', 'No selected point.\n') CTK.TXT.insert('START', 'Error: ', 'Error'); return indv = ind[0]; inde = ind[1] @@ -113,7 +113,7 @@ def setVariableValue(event=None): svar = cvar.split(':') if len(svar) == 2 and svar[0] == 'centers': C.setValue(zp, cvar, inde, val[0]) - else: + else: C.setValue(zp, cvar, indv, val[0]) CPlot.replace(CTK.t, nob, noz, zp) CTK.TXT.insert('START', 'Point modified.\n') @@ -160,8 +160,8 @@ def createApp(win): F.grid(row=0, column=0, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Selected var name.') WIDGETS['variable'] = B - else: - B = ttk.Combobox(F, textvariable=VARS[0], + else: + B = ttk.Combobox(F, textvariable=VARS[0], values=[], state='readonly') B.grid(sticky=TK.EW) F.bind('', updateVarNameList2) diff --git a/Cassiopee/CPlot/apps/tkProjection.py b/Cassiopee/CPlot/apps/tkProjection.py index 2a37f7285..0c595d79c 100644 --- a/Cassiopee/CPlot/apps/tkProjection.py +++ b/Cassiopee/CPlot/apps/tkProjection.py @@ -108,7 +108,7 @@ def dirProject(): eye = CPlot.getState('posEye') cam = CPlot.getState('posCam') - dir = (eye[0]-cam[0], eye[1]-cam[1], eye[2]-cam[2]) + dir = (eye[0]-cam[0], eye[1]-cam[1], eye[2]-cam[2]) CTK.saveTree() fail = False; errors = [] for nz in nzs: @@ -153,7 +153,7 @@ def createApp(win): WIDGETS['frameMenu'] = FrameMenu # - VARS - - # -0- Projection surface - + # -0- Projection surface - V = TK.StringVar(win); V.set(''); VARS.append(V) # - Surface - diff --git a/Cassiopee/CPlot/apps/tkRenderSet.py b/Cassiopee/CPlot/apps/tkRenderSet.py index 4ed2d9f35..49fb6e193 100644 --- a/Cassiopee/CPlot/apps/tkRenderSet.py +++ b/Cassiopee/CPlot/apps/tkRenderSet.py @@ -21,7 +21,7 @@ def setColorVar(l): if l == 'Custom>': try: import tkinter.colorchooser as tkColorChooser - except: import tkColorChooser + except: import tkColorChooser ret = tkColorChooser.askcolor() l = ret[1] VARS[1].set(l) @@ -32,7 +32,7 @@ def setColorVar2(event=None): l = VARS[1].get() if l == 'Custom>': try: import tkinter.colorchooser as tkColorChooser - except: import tkColorChooser + except: import tkColorChooser ret = tkColorChooser.askcolor() l = ret[1] VARS[1].set(l) @@ -142,7 +142,7 @@ def setAll(): material=material, color=color, blending=blending, - shaderParameters=[shaderParameter1, + shaderParameters=[shaderParameter1, shaderParameter2]) CTK.replace(CTK.t, nob, noz, a) CTK.TKTREE.updateApp() @@ -216,7 +216,7 @@ def setShaderParameter(event=None): nob = CTK.Nb[nz]+1 noz = CTK.Nz[nz] a = CPlot.addRender2Zone(CTK.t[2][nob][2][noz], - shaderParameters=[shaderParameter1, + shaderParameters=[shaderParameter1, shaderParameter2]) CTK.replace(CTK.t, nob, noz, a) CTK.TKTREE.updateApp() @@ -304,7 +304,7 @@ def createApp(win): V = TK.StringVar(win); V.set('Blending.'); VARS.append(V) # - set Blending - - B = TTK.Scale(Frame, from_=0, to=100, orient=TK.HORIZONTAL, + B = TTK.Scale(Frame, from_=0, to=100, orient=TK.HORIZONTAL, command=setBlending, showvalue=0, borderwidth=1, value=100) WIDGETS['blending'] = B B.grid(row=0, column=0, sticky=TK.EW) @@ -352,7 +352,7 @@ def createApp(win): F.grid(row=3, column=1, sticky=TK.EW) WIDGETS['colors'] = B else: - B = ttk.Combobox(F, textvariable=VARS[1], + B = ttk.Combobox(F, textvariable=VARS[1], values=[], state='readonly', height=11) B.bind('<>', setColorVar2) B.grid(sticky=TK.EW) diff --git a/Cassiopee/CPlot/apps/tkRenderTree.py b/Cassiopee/CPlot/apps/tkRenderTree.py index 807cc04a7..9abdccff2 100644 --- a/Cassiopee/CPlot/apps/tkRenderTree.py +++ b/Cassiopee/CPlot/apps/tkRenderTree.py @@ -19,7 +19,7 @@ def addBillboardFile(event=None): v = v.split(';') vo = [] for i in v: - if i != '': vo.append(i) + if i != '': vo.append(i) CPlot._addRender2PyTree(CTK.t, billBoards=vo) CTK.TKTREE.updateApp() @@ -38,7 +38,7 @@ def addBumpMapFile(event=None): v = v.split(';') vo = [] for i in v: - if i != '': vo.append(i) + if i != '': vo.append(i) CPlot._addRender2PyTree(CTK.t, bumpMaps=vo) CTK.TKTREE.updateApp() @@ -74,7 +74,7 @@ def addTextureFile(event=None): params = Internal.getNodeFromName1(info, 'ShaderParameters')[1] params[1] = params[1]*nprev/(nprev+len(vo)) - # Add new materials + # Add new materials CPlot._addRender2PyTree(CTK.t, materials=vo) CTK.TKTREE.updateApp() diff --git a/Cassiopee/CPlot/apps/tkReorder.py b/Cassiopee/CPlot/apps/tkReorder.py index 21cf670a0..d5727e701 100644 --- a/Cassiopee/CPlot/apps/tkReorder.py +++ b/Cassiopee/CPlot/apps/tkReorder.py @@ -171,7 +171,7 @@ def createApp(win): # -2- Transformation de k - V = TK.StringVar(win); V.set('K -> K'); VARS.append(V) - # - Index switch for structured grids + # - Index switch for structured grids B = TTK.OptionMenu(Frame, VARS[0], 'I -> I', 'I -> -I', 'I -> J', 'I -> -J', 'I -> K', 'I -> -K') B.grid(row=0, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Transformation of i index.') diff --git a/Cassiopee/CPlot/apps/tkRigidMotion.py b/Cassiopee/CPlot/apps/tkRigidMotion.py index 4da7d3383..86ed4cb65 100644 --- a/Cassiopee/CPlot/apps/tkRigidMotion.py +++ b/Cassiopee/CPlot/apps/tkRigidMotion.py @@ -572,7 +572,7 @@ def createApp(win): # - Settings - B = TTK.OptionMenu(Frame, VARS[11], '1:MotionStrings', '2:KMotionRotor', - '3:ConstantMotion', + '3:ConstantMotion', command=changeMotionType) B.grid(row=0, column=0, columnspan=3, sticky=TK.EW) diff --git a/Cassiopee/CPlot/apps/tkRuler.py b/Cassiopee/CPlot/apps/tkRuler.py index eab157fa1..48b90f984 100644 --- a/Cassiopee/CPlot/apps/tkRuler.py +++ b/Cassiopee/CPlot/apps/tkRuler.py @@ -34,8 +34,8 @@ def measure(): CTK.TXT.insert('START', 'Click second point...\n') elif prev != l: dist = (l[0]-prev[0])*(l[0]-prev[0])+\ - (l[1]-prev[1])*(l[1]-prev[1])+\ - (l[2]-prev[2])*(l[2]-prev[2]) + (l[1]-prev[1])*(l[1]-prev[1])+\ + (l[2]-prev[2])*(l[2]-prev[2]) dist = math.sqrt(dist) CTK.TXT.insert('START', 'd= %.4e\n'%dist) time.sleep(CPlot.__timeStep__) @@ -95,7 +95,7 @@ def vector(): def createApp(win): # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, - text='tkRuler [ + ] ', font=CTK.FRAMEFONT, takefocus=1) + text='tkRuler [ + ] ', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='Take measures by clicking.\nCtrl+w to close applet.', temps=0, btype=1) Frame.bind('', hideApp) Frame.bind('', displayFrameMenu) diff --git a/Cassiopee/CPlot/apps/tkSculpt.py b/Cassiopee/CPlot/apps/tkSculpt.py index f2c441aa6..3fb019680 100644 --- a/Cassiopee/CPlot/apps/tkSculpt.py +++ b/Cassiopee/CPlot/apps/tkSculpt.py @@ -187,7 +187,7 @@ def createApp(win): # - Width - B = TTK.Scale(Frame, from_=0, to=100, orient=TK.HORIZONTAL, showvalue=0, - command=setWidth, borderwidth=1, value=50) + command=setWidth, borderwidth=1, value=50) WIDGETS['width'] = B B.grid(row=1, columnspan=2, sticky=TK.EW) BB = CTK.infoBulle(parent=B, textVariable=VARS[5]) diff --git a/Cassiopee/CPlot/apps/tkSlice.py b/Cassiopee/CPlot/apps/tkSlice.py index 9169726a8..76fec904b 100644 --- a/Cassiopee/CPlot/apps/tkSlice.py +++ b/Cassiopee/CPlot/apps/tkSlice.py @@ -145,7 +145,7 @@ def view(event=None): if CTK.__MAINTREE__ == CTK.MAIN: CTK.__MAINACTIVEZONES__ = CPlot.getActiveZones() active = [] - tp = Internal.appendBaseName2ZoneName(CTK.t, updateRef=False, + tp = Internal.appendBaseName2ZoneName(CTK.t, updateRef=False, separator=Internal.SEP1) for z in CTK.__MAINACTIVEZONES__: active.append(tp[2][CTK.Nb[z]+1][2][CTK.Nz[z]]) @@ -202,7 +202,7 @@ def view(event=None): except Exception as e: Panels.displayErrors([0,str(e)], header='Error: slice') CTK.TXT.insert('START', 'Slice failed.\n') - CTK.TXT.insert('START', 'Error: ', 'Error'); return + CTK.TXT.insert('START', 'Error: ', 'Error'); return CTK.setCursor(0, WIDGETS['view'], WIDGETS['plus'], WIDGETS['moins']) #============================================================================== diff --git a/Cassiopee/CPlot/apps/tkSmooth.py b/Cassiopee/CPlot/apps/tkSmooth.py index 66e86641b..87661879e 100644 --- a/Cassiopee/CPlot/apps/tkSmooth.py +++ b/Cassiopee/CPlot/apps/tkSmooth.py @@ -76,7 +76,7 @@ def smooth(): fixedConstraints = []; projConstraints = [] name = VARS[1].get() - names = name.split(';') + names = name.split(';') for v in names: v = v.lstrip(); v = v.rstrip() sname = v.split('/', 1) @@ -111,7 +111,7 @@ def smooth(): if dims[3] == 'TRI': pbDim = 2 # Keep external faces - if VARS[3].get() == 1 or pbDim == 3: + if VARS[3].get() == 1 or pbDim == 3: try: ext = P.exteriorFaces(A) except: ext = [] if VARS[3].get() == 1 and ext != []: fixedConstraints.append(ext) @@ -149,13 +149,13 @@ def smooth(): try: if Pj == 0: zones = T.smooth(zones, eps=eps, niter=smooth, type=ntype, - fixedConstraints=fixedConstraints, + fixedConstraints=fixedConstraints, projConstraints=projConstraints, delta=strength) else: for s in range(smooth): zones = T.smooth(zones, eps=eps, niter=2, type=ntype, - fixedConstraints=fixedConstraints, - projConstraints=projConstraints, + fixedConstraints=fixedConstraints, + projConstraints=projConstraints, delta=strength) zones = T.projectOrtho(zones, [projSurf]) except Exception as e: @@ -216,25 +216,25 @@ def createApp(win): V = TK.StringVar(win); V.set(''); VARS.append(V) # -2- Constraint strength V = TK.StringVar(win); V.set('0.1'); VARS.append(V) - if 'tkSmoothConsStrength' in CTK.PREFS: + if 'tkSmoothConsStrength' in CTK.PREFS: V.set(CTK.PREFS['tkSmoothConsStrength']) # -3- Constraint external faces V = TK.IntVar(win); V.set(1); VARS.append(V) # -4- smooth eps V = TK.StringVar(win); V.set('0.5'); VARS.append(V) - if 'tkSmoothEps' in CTK.PREFS: + if 'tkSmoothEps' in CTK.PREFS: V.set(CTK.PREFS['tkSmoothEps']) # -5- Constraint sharp edges V = TK.IntVar(win); V.set(0); VARS.append(V) # -6- Sharp edges detection angle V = TK.StringVar(win); V.set('30.'); VARS.append(V) - if 'tkSmoothSharpAngle' in CTK.PREFS: + if 'tkSmoothSharpAngle' in CTK.PREFS: V.set(CTK.PREFS['tkSmoothSharpAngle']) # -7- Project on surface V = TK.IntVar(win); V.set(0); VARS.append(V) # -8- Type de smoothing V = TK.StringVar(win); V.set('Volume'); VARS.append(V) - if 'tkSmoothType' in CTK.PREFS: + if 'tkSmoothType' in CTK.PREFS: V.set(CTK.PREFS['tkSmoothType']) # - Smoother power - diff --git a/Cassiopee/CPlot/apps/tkSplit.py b/Cassiopee/CPlot/apps/tkSplit.py index b39620f26..6fc373a39 100644 --- a/Cassiopee/CPlot/apps/tkSplit.py +++ b/Cassiopee/CPlot/apps/tkSplit.py @@ -104,7 +104,7 @@ def join(): CTK.TXT.insert('START', 'Join failed.\n') CTK.TXT.insert('START', 'Error: ', 'Error') - #C._fillMissingVariables(CTK.t) + #C._fillMissingVariables(CTK.t) (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() CPlot.render() @@ -136,7 +136,7 @@ def merge(): Z.append(CTK.t[2][nob][2][noz]) nob0 = CTK.Nb[nzs[0]]+1 - if dircons == 'Names': # fait des paquets par noms homogenes + if dircons == 'Names': # fait des paquets par noms homogenes zoneNames = {} zoneNames['__Pool__'] = [] for z in Z: @@ -145,7 +145,7 @@ def merge(): if len(s) == 2: try: no = int(s[1]) except: no = -1 - if no > -1: + if no > -1: if s[0] in zoneNames: zoneNames[s[0]] += [n] else: zoneNames[s[0]] = [n] else: zoneNames['__Pool__'] += [n] @@ -181,7 +181,7 @@ def merge(): CTK.TXT.insert('START', 'Merge failed.\n') CTK.TXT.insert('START', 'Error: ', 'Error') - #C._fillMissingVariables(CTK.t) + #C._fillMissingVariables(CTK.t) (CTK.Nb, CTK.Nz) = CPlot.updateCPlotNumbering(CTK.t) CTK.TKTREE.updateApp() CTK.display(CTK.t) @@ -324,7 +324,7 @@ def splitSize(event=None): CTK.saveTree() fail = False; errors = [] if nzs == []: - try: + try: CTK.t = T.splitSize(CTK.t, size, multigrid=level) CTK.display(CTK.t) except Exception as e: @@ -354,7 +354,7 @@ def splitSize(event=None): #============================================================================== # splitNParts -# IN: t, cplot.selectedZones, N: nb de parties +# IN: t, cplot.selectedZones, N: nb de parties # OUT: t modifie et affiche #============================================================================== def splitNParts(event=None): @@ -373,7 +373,7 @@ def splitNParts(event=None): CTK.saveTree() fail = False; errors = [] if nzs == []: - try: + try: CTK.t = T.splitNParts(CTK.t, NParts, multigrid=level) CTK.display(CTK.t) except Exception as e: @@ -625,28 +625,28 @@ def createApp(win): V = TK.StringVar(win); V.set('i-indices'); VARS.append(V) # -2- multigrid (niveau) V = TK.StringVar(win); V.set('0'); VARS.append(V) - if 'tkSplitSizeMultigrid' in CTK.PREFS: + if 'tkSplitSizeMultigrid' in CTK.PREFS: V.set(CTK.PREFS['tkSplitSizeMultigrid']) # -3- splitSharpEdges angle - V = TK.StringVar(win); V.set('30.'); VARS.append(V) - if 'tkSplitSharpEdges' in CTK.PREFS: + if 'tkSplitSharpEdges' in CTK.PREFS: V.set(CTK.PREFS['tkSplitSharpEdges']) # -4- tol for join - V = TK.StringVar(win); V.set('1.e-8'); VARS.append(V) - if 'tkSplitJoinTol' in CTK.PREFS: + if 'tkSplitJoinTol' in CTK.PREFS: V.set(CTK.PREFS['tkSplitJoinTol']) # -5- tol for merge - V = TK.StringVar(win); V.set('1.e-8'); VARS.append(V) - if 'tkSplitMergeTol' in CTK.PREFS: + if 'tkSplitMergeTol' in CTK.PREFS: V.set(CTK.PREFS['tkSplitMergeTol']) # -6- constraint direction for merge - - V = TK.StringVar(win); V.set('0'); VARS.append(V) + V = TK.StringVar(win); V.set('0'); VARS.append(V) # -7- Nparts for splitNParts - V = TK.StringVar(win); V.set('2'); VARS.append(V) if 'tkSplitNParts' in CTK.PREFS: V.set(CTK.PREFS['tkSplitNParts']) # -8- Multigrid level for splitNParts - V = TK.StringVar(win); V.set('0'); VARS.append(V) - if 'tkSplitNPartsMultigrid' in CTK.PREFS: + if 'tkSplitNPartsMultigrid' in CTK.PREFS: V.set(CTK.PREFS['tkSplitNPartsMultigrid']) # -9- distance for splitSharpEdges V = TK.StringVar(win); V.set('0.'); VARS.append(V) diff --git a/Cassiopee/CPlot/apps/tkState.py b/Cassiopee/CPlot/apps/tkState.py index 14ff9e01c..90971664a 100644 --- a/Cassiopee/CPlot/apps/tkState.py +++ b/Cassiopee/CPlot/apps/tkState.py @@ -87,7 +87,7 @@ def getState(): # Reynolds node = Internal.getNodeFromName1(state, 'Reynolds') if node is not None: - reynolds = Internal.getValue(node) + reynolds = Internal.getValue(node) VARS[3].set(str(reynolds)) else: reynolds = None @@ -109,19 +109,19 @@ def getState(): # TInf node = Internal.getNodeFromName1(state, 'Temperature') - if node is not None: + if node is not None: TInf = Internal.getValue(node) VARS[13].set(str(TInf)) # PInf node = Internal.getNodeFromName1(state, 'Pressure') - if node is not None: + if node is not None: PInf = Internal.getValue(node) VARS[14].set(str(PInf)) # RoInf node = Internal.getNodeFromName1(state, 'Density') - if node is not None: + if node is not None: RoInf = Internal.getValue(node) VARS[16].set(str(RoInf)) @@ -141,14 +141,14 @@ def getState(): else: RokInf = None if (reynolds is not None and Density is not None and - RokInf is not None and Vit is not None and Vit > 1.e-10): + RokInf is not None and Vit is not None and Vit > 1.e-10): TurbLevel = math.sqrt(2*RokInf/(3*Vit*Vit*Density)) VARS[10].set(str(TurbLevel)) MuInf = Density*Vit / max(reynolds,1.e-10) # L=1 node = Internal.getNodeFromName(state, 'TurbulentSANuTildeDensity') - if node is not None: + if node is not None: RoNuTilde = Internal.getValue(node) MutInf = RoNuTilde MutSMu = MutInf / max(MuInf, 1.e-12) @@ -266,7 +266,7 @@ def setState(event=None): C.addState2Node__(p[2][r], 'TurbulenceModel', 'TwoEquation_MenterSST') - C._addState(p[2][r], MInf=mach, alphaZ=alphaZ, alphaY=alphaY, + C._addState(p[2][r], MInf=mach, alphaZ=alphaZ, alphaY=alphaY, ReInf=Re, MutSMuInf=MutSMuInf, TurbLevelInf=TurbLevelInf, UInf=UInf, TInf=TInf, LInf=LInf, RoInf=RoInf, PInf=PInf, adim=adim) @@ -283,53 +283,53 @@ def switchAdim(event=None): if adim == 'adim1(Ro,A,T)' or adim == 'adim2(Ro,U,T)': # switch UInf and Mach for w in WIDGETS['UInf']: w.grid_forget() - for c, w in enumerate(WIDGETS['Mach']): + for c, w in enumerate(WIDGETS['Mach']): w.grid(row=2, column=c, sticky=TK.EW) # switch TInf or PInf to Reynolds for w in WIDGETS['TInf']: w.grid_forget() for w in WIDGETS['PInf']: w.grid_forget() for w in WIDGETS['RoInf']: w.grid_forget() for w in WIDGETS['LInf']: w.grid_forget() - for c, w in enumerate(WIDGETS['Reynolds']): + for c, w in enumerate(WIDGETS['Reynolds']): w.grid(row=4, column=c, sticky=TK.EW) elif adim == 'dim1(real UInf,TInf,PInf)': # switch Mach and UInf for w in WIDGETS['Mach']: w.grid_forget() - for c, w in enumerate(WIDGETS['UInf']): + for c, w in enumerate(WIDGETS['UInf']): w.grid(row=2, column=c, sticky=TK.EW) for w in WIDGETS['Reynolds']: w.grid_forget() for w in WIDGETS['RoInf']: w.grid_forget() - for c, w in enumerate(WIDGETS['TInf']): + for c, w in enumerate(WIDGETS['TInf']): w.grid(row=4, column=c, sticky=TK.EW) - for c, w in enumerate(WIDGETS['PInf']): + for c, w in enumerate(WIDGETS['PInf']): w.grid(row=4, column=c+2, sticky=TK.EW) - for c, w in enumerate(WIDGETS['LInf']): + for c, w in enumerate(WIDGETS['LInf']): w.grid(row=5, column=c, sticky=TK.EW) elif adim == 'dim2(real UInf,TInf,RoInf)': # switch Mach and UInf for w in WIDGETS['Mach']: w.grid_forget() - for c, w in enumerate(WIDGETS['UInf']): + for c, w in enumerate(WIDGETS['UInf']): w.grid(row=2, column=c, sticky=TK.EW) for w in WIDGETS['Reynolds']: w.grid_forget() for w in WIDGETS['PInf']: w.grid_forget() - for c, w in enumerate(WIDGETS['TInf']): + for c, w in enumerate(WIDGETS['TInf']): w.grid(row=4, column=c, sticky=TK.EW) - for c, w in enumerate(WIDGETS['RoInf']): + for c, w in enumerate(WIDGETS['RoInf']): w.grid(row=4, column=c+2, sticky=TK.EW) for c, w in enumerate(WIDGETS['LInf']): w.grid(row=5, column=c, sticky=TK.EW) elif adim == 'dim3(real UInf,PInf,RoInf)': # switch Mach and UInf for w in WIDGETS['Mach']: w.grid_forget() - for c, w in enumerate(WIDGETS['UInf']): + for c, w in enumerate(WIDGETS['UInf']): w.grid(row=2, column=c, sticky=TK.EW) for w in WIDGETS['Reynolds']: w.grid_forget() for w in WIDGETS['TInf']: w.grid_forget() - for c, w in enumerate(WIDGETS['PInf']): + for c, w in enumerate(WIDGETS['PInf']): w.grid(row=4, column=c, sticky=TK.EW) - for c, w in enumerate(WIDGETS['RoInf']): + for c, w in enumerate(WIDGETS['RoInf']): w.grid(row=4, column=c+2, sticky=TK.EW) - for c, w in enumerate(WIDGETS['LInf']): + for c, w in enumerate(WIDGETS['LInf']): w.grid(row=5, column=c, sticky=TK.EW) #============================================================================== @@ -521,7 +521,7 @@ def createApp(win): B.grid(row=6, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Type of turbulence model.') B = TTK.OptionMenu(F, VARS[6], 'SpalartAllmaras', 'JonesLaunder(k-eps)', - 'Wilcox(k-w)', 'MenterSST(k-w)') + 'Wilcox(k-w)', 'MenterSST(k-w)') B.grid(row=6, column=1, columnspan=3, sticky=TK.EW) # - Valeurs des grandeurs turbulentes - @@ -542,10 +542,10 @@ def createApp(win): B.grid(row=8, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Type of adimensionalization.') B = TTK.OptionMenu(F, VARS[11], 'adim1(Ro,A,T)','adim2(Ro,U,T)', - 'dim1(real UInf,TInf,PInf)', - 'dim2(real UInf,TInf,RoInf)', - 'dim3(real UInf,PInf,RoInf)', - command=switchAdim) + 'dim1(real UInf,TInf,PInf)', + 'dim2(real UInf,TInf,RoInf)', + 'dim3(real UInf,PInf,RoInf)', + command=switchAdim) B.grid(row=8, column=1, columnspan=3, sticky=TK.EW) # - get state, inutile a mon avis - diff --git a/Cassiopee/CPlot/apps/tkStream.py b/Cassiopee/CPlot/apps/tkStream.py index 0ce290e5f..e3ff6775e 100644 --- a/Cassiopee/CPlot/apps/tkStream.py +++ b/Cassiopee/CPlot/apps/tkStream.py @@ -178,7 +178,7 @@ def streamRibbon(): source[2].append(b) try: - stream = P.streamRibbon(source, (l[0], l[1], l[2]), (0,0,0.01), + stream = P.streamRibbon(source, (l[0], l[1], l[2]), (0,0,0.01), [v1, v2, v3], N=npts) CTK.add(CTK.t, nob, -1, stream) CTK.TXT.insert('START', 'Stream ribbon created.\n') @@ -221,14 +221,14 @@ def createApp(win): # - VARS - # -0- nptsmax - V = TK.StringVar(win); V.set('2000'); VARS.append(V) - if 'tkStreamNpts' in CTK.PREFS: + if 'tkStreamNpts' in CTK.PREFS: V.set(CTK.PREFS['tkStreamNpts']) # -1- Var0 for vector - V = TK.StringVar(win); V.set('CoordinateX'); VARS.append(V) # -2- Var1 for vector - V = TK.StringVar(win); V.set('CoordinateY'); VARS.append(V) # -3- Var2 for vector - - V = TK.StringVar(win); V.set('CoordinateZ'); VARS.append(V) + V = TK.StringVar(win); V.set('CoordinateZ'); VARS.append(V) # - Menu des variables - F = TTK.Frame(Frame, borderwidth=0) @@ -241,7 +241,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Variable 1.') WIDGETS['variable1'] = B else: - B = ttk.Combobox(F, textvariable=VARS[1], + B = ttk.Combobox(F, textvariable=VARS[1], values=[], state='readonly', width=10) B.grid(sticky=TK.EW) F.bind('', updateVarNameList1_2) @@ -259,7 +259,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Variable 2.') WIDGETS['variable2'] = B else: - B = ttk.Combobox(F, textvariable=VARS[2], + B = ttk.Combobox(F, textvariable=VARS[2], values=[], state='readonly', width=10) B.grid(sticky=TK.EW) F.bind('', updateVarNameList2_2) @@ -277,7 +277,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Variable 3.') WIDGETS['variable3'] = B else: - B = ttk.Combobox(F, textvariable=VARS[3], + B = ttk.Combobox(F, textvariable=VARS[3], values=[], state='readonly', width=10) B.grid(sticky=TK.EW) F.bind('', updateVarNameList3_2) diff --git a/Cassiopee/CPlot/apps/tkSurfaceWalk.py b/Cassiopee/CPlot/apps/tkSurfaceWalk.py index 6ad1aaf78..8fcff3095 100755 --- a/Cassiopee/CPlot/apps/tkSurfaceWalk.py +++ b/Cassiopee/CPlot/apps/tkSurfaceWalk.py @@ -238,19 +238,19 @@ def createApp(win): # - VARS - # -0- Constraint contour - V = TK.StringVar(win); V.set(''); VARS.append(V) - # -1- Projection surface - + # -1- Projection surface - V = TK.StringVar(win); V.set(''); VARS.append(V) # -2- Hauteur de chaque maille - V = TK.StringVar(win); V.set('1.e-1'); VARS.append(V) - if 'tkSurfaceWalkHeight' in CTK.PREFS: + if 'tkSurfaceWalkHeight' in CTK.PREFS: V.set(CTK.PREFS['tkSurfaceWalkHeight']) # -3- Nombre de layers a ajouter V = TK.StringVar(win); V.set('1'); VARS.append(V) - if 'tkSurfaceWalkNLayers' in CTK.PREFS: + if 'tkSurfaceWalkNLayers' in CTK.PREFS: V.set(CTK.PREFS['tkSurfaceWalkNLayers']) # -4- Nombre d'iterations de lissage V = TK.StringVar(win); V.set('0'); VARS.append(V) - if 'tkSurfaceWalkSmooth' in CTK.PREFS: + if 'tkSurfaceWalkSmooth' in CTK.PREFS: V.set(CTK.PREFS['tkSurfaceWalkSmooth']) # - Surface - @@ -262,7 +262,7 @@ def createApp(win): B.grid(row=0, column=0, columnspan=2, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Projection surfaces.') - # - Contours - + # - Contours - B = TTK.Button(Frame, text="Constraints", command=setConstraintContour, image=iconics.PHOTO[8], padx=0, pady=0, compound=TK.RIGHT) B.grid(row=1, column=2, sticky=TK.EW) diff --git a/Cassiopee/CPlot/apps/tkTFI.py b/Cassiopee/CPlot/apps/tkTFI.py index d32576245..38551d899 100644 --- a/Cassiopee/CPlot/apps/tkTFI.py +++ b/Cassiopee/CPlot/apps/tkTFI.py @@ -253,7 +253,7 @@ def HOTFI(): weight = CTK.varsFromWidget(VARS[1].get(), type=1); weight = weight[0] # Nombre de pts (tous les 2 pairs ou tous les 2 impairs) - Nt1 = Internal.getZoneDim(zones[0])[1] + Nt1 = Internal.getZoneDim(zones[0])[1] Nt2 = Internal.getZoneDim(zones[1])[1] if Nt1//2 - Nt1*0.5 == 0 and Nt2//2 - Nt2*0.5 != 0: CTK.TXT.insert('START', 'Number of points of countours must be all odd or all even.\n') @@ -278,7 +278,7 @@ def HOTFI(): optWeight = i; optScore = score; optOffset = j except: pass print('Resulting score=%g'%optScore) - [m,m1,m2,m3] = TFIs.TFIHalfO__(coords1, coords2, optWeight, optOffset) + [m,m1,m2,m3] = TFIs.TFIHalfO__(coords1, coords2, optWeight, optOffset) m = C.convertArrays2ZoneNode('TFI1', [m]) m1 = C.convertArrays2ZoneNode('TFI2', [m1]) @@ -291,7 +291,7 @@ def HOTFI(): m2 = T.projectOrthoSmooth(m2, surf) m3 = T.projectOrthoSmooth(m3, surf) - CTK.saveTree() + CTK.saveTree() CTK.setCursor(0, WIDGETS['ho']) CTK.t = C.addBase2PyTree(CTK.t, 'MESHES') @@ -347,7 +347,7 @@ def TRITFI(): m2 = T.projectOrthoSmooth(m2, surf) m3 = T.projectOrthoSmooth(m3, surf) - CTK.saveTree() + CTK.saveTree() CTK.t = C.addBase2PyTree(CTK.t, 'MESHES') bases = Internal.getNodesFromName1(CTK.t, 'MESHES') nob = C.getNobOfBase(bases[0], CTK.t) diff --git a/Cassiopee/CPlot/apps/tkTransform.py b/Cassiopee/CPlot/apps/tkTransform.py index b64cbb06b..e159fc4d5 100644 --- a/Cassiopee/CPlot/apps/tkTransform.py +++ b/Cassiopee/CPlot/apps/tkTransform.py @@ -80,8 +80,8 @@ def rotate(event=None): axis = VARS[2].get() angle = CTK.varsFromWidget(VARS[3].get(), type=1) if len(angle) == 1: angle = angle[0]; X=None - elif len(angle) == 4: X=(angle[1],angle[2],angle[3]); angle = angle[0] - else: + elif len(angle) == 4: X=(angle[1],angle[2],angle[3]); angle = angle[0] + else: CTK.TXT.insert('START', 'Invalid angle or angle+rotation center.\n') CTK.TXT.insert('START', 'Error: ', 'Error'); return if axis == 'around X': axe = (1.,0.,0.) @@ -249,7 +249,7 @@ def scale(): X = [v[3],v[4],v[5]] else: X = G.barycenter(selection) - if len(v) == 1 and v[0] == 0.: # scale unitaire + if len(v) == 1 and v[0] == 0.: # scale unitaire bbox = G.bbox(selection) dx = bbox[3]-bbox[0] dy = bbox[4]-bbox[1] diff --git a/Cassiopee/CPlot/apps/tkTree.py b/Cassiopee/CPlot/apps/tkTree.py index ad5d57aa1..d9d50a3e4 100644 --- a/Cassiopee/CPlot/apps/tkTree.py +++ b/Cassiopee/CPlot/apps/tkTree.py @@ -442,7 +442,7 @@ def PVT_tag_move(self, dist): bbox1=self.widget.bbox(self.widget.root.symbol, self.label) bbox2=self.widget.bbox('all') self.widget.dtag('move') - self.widget.addtag('move', 'overlapping', + self.widget.addtag('move', 'overlapping', bbox2[0], bbox1[3], bbox2[2], bbox2[3]) # untag cursor & node so they don't get moved too self.widget.dtag(self.widget.cursor_box, 'move') @@ -858,7 +858,7 @@ def PVT_displayNode(self, clear=False): CTK.TXT.insert('START', 'Displaying '+pid[0]+'\n') contName = pid[0] CPlot.setMode(3) - gp = Internal.getNodeFromType1(pid, 'GridLocation_t') + gp = Internal.getNodeFromType1(pid, 'GridLocation_t') if gp is not None: if Internal.getValue(gp) == 'CellCenter' and Internal.__FlowSolutionCenters__ != contName: Internal.__FlowSolutionCenters__ = contName @@ -933,8 +933,8 @@ def PVT_displayNode(self, clear=False): #------------------------------------------------------------------------------ class Tree(TK.Canvas): def __init__(self, master, root_id, root_label='', - get_contents_callback=None, dist_x=8+CTK.FONTSIZE, - dist_y=8+CTK.FONTSIZE, text_offset=12, + get_contents_callback=None, dist_x=8+CTK.FONTSIZE, + dist_y=8+CTK.FONTSIZE, text_offset=12, line_flag=1, expanded_icon=None, collapsed_icon=None, regular_icon=None, plus_icon=None, minus_icon=None, node_class=Node, drop_callback=None, @@ -1051,12 +1051,12 @@ def __init__(self, master, root_id, root_label='', expanded_icon=self.expanded_icon, x=dist_x, y=dist_y, parent_widget=self) # configure for scrollbar(s) - x1, y1, x2, y2 = self.bbox('all') + x1, y1, x2, y2 = self.bbox('all') self.configure(scrollregion=(x1, y1, x2+5, y2+5)) # add a cursor self.cursor_box = self.create_rectangle(0, 0, 0, 0, outline='sky blue') - #fill='sky blue') + #fill='sky blue') self.move_cursor(self.root) # make it easy to point to control self.bind('', self.PVT_mousefocus) @@ -1167,7 +1167,7 @@ def add_node(self, name=None, id=None, flag=0, expanded_icon=None, collapsed_icon=None): """Add a node during get_contents_callback()""" if id is not None and len(id) >= 4: - if id[3] == 'Zone_t': + if id[3] == 'Zone_t': collapsed_icon = self.collapsed_zone expanded_icon = self.expanded_zone elif id[3] == 'CGNSBase_t': @@ -1330,7 +1330,7 @@ def dnd_enter(self, source, event): else: self.dnd_symbol = self.create_image(x, y, image=source.collapsed_icon) - self.dnd_label = self.create_text(x+self.text_offset, y, + self.dnd_label = self.create_text(x+self.text_offset, y, text=source.get_label(), justify='left', anchor='w', @@ -1381,7 +1381,7 @@ def focusOnGivenZone(self, baseName, zoneName=None, bcName=None): for c in children: # bases if c.id[0] == baseName: baseNode = c; break if baseNode is None: return - if zoneName is None: + if zoneName is None: baseNode.widget.move_cursor(baseNode) baseNode.PVT_highlight(TK.CURRENT) return @@ -1396,7 +1396,7 @@ def focusOnGivenZone(self, baseName, zoneName=None, bcName=None): baseNode.widget.move_cursor(baseNode) baseNode.PVT_highlight(TK.CURRENT) return - if bcName is None: + if bcName is None: zoneNode.widget.move_cursor(zoneNode) zoneNode.PVT_highlight(TK.CURRENT) return @@ -1553,14 +1553,14 @@ def updateApp(): OPENTREE = False OPENBASES = {} # Dict des noeuds ouverts (niv 0) OPENZONES = [] # Liste de dict des noeuds ouverts (niv 1) - OPENNODES = [] # Liste de liste de dict des noeuds ouverts (niv 2) + OPENNODES = [] # Liste de liste de dict des noeuds ouverts (niv 2) SELECTED = None # nom du noeud selectionne - LEVSEL = -1 # niveau du noeud selectionne + LEVSEL = -1 # niveau du noeud selectionne if len(oldChildren) > 0: OPENTREE = True for c in oldChildren: children = c.children() if len(children) > 0: OPENBASES[c.get_label()] = 1 - if c.widget.pos == c: SELECTED = c.get_label(); LEVSEL = 0 + if c.widget.pos == c: SELECTED = c.get_label(); LEVSEL = 0 ZONES = {}; NODES = [] for d in children: children2 = d.children() @@ -1570,10 +1570,10 @@ def updateApp(): for e in children2: children3 = e.children() if len(children3) > 0: NODESL[e.get_label()] = 1 - if e.widget.pos == e: + if e.widget.pos == e: SELECTED = e.get_label(); LEVSEL = 2 for f in children3: - if f.widget.pos == f: + if f.widget.pos == f: SELECTED = f.get_label(); LEVSEL = 3 if len(children2) > 0: NODES.append(NODESL) if len(children) > 0: OPENNODES.append(NODES) @@ -1597,7 +1597,7 @@ def updateApp(): bcount = 0 for c in children: # Bases if c.get_label() in OPENBASES: c.expand() - if LEVSEL == 0 and c.get_label() == SELECTED: + if LEVSEL == 0 and c.get_label() == SELECTED: c.widget.move_cursor(c) children2 = c.children() @@ -1609,13 +1609,13 @@ def updateApp(): children3 = d.children() for e in children3: elabel = e.get_label() - if elabel in OPENNODES[bcount][zcount]: + if elabel in OPENNODES[bcount][zcount]: e.expand() - if LEVSEL == 2 and elabel == SELECTED: + if LEVSEL == 2 and elabel == SELECTED: e.widget.move_cursor(e) children4 = e.children() for f in children4: - if LEVSEL == 3 and f.get_label() == SELECTED: + if LEVSEL == 3 and f.get_label() == SELECTED: f.widget.move_cursor(f) if len(children3) > 0: zcount += 1 if len(children2) > 0: bcount += 1 @@ -1660,10 +1660,10 @@ def get_contents(node): node.widget.add_node(name=i[0], id=i, flag=folder) #============================================================================== -def expandCanvas(): +def expandCanvas(): WIDGETS['tree'].expandCanvas() -def shrinkCanvas(): +def shrinkCanvas(): WIDGETS['tree'].shrinkCanvas() #============================================================================== diff --git a/Cassiopee/CPlot/apps/tkTreeOps.py b/Cassiopee/CPlot/apps/tkTreeOps.py index 32de4b49a..5b0a32f17 100644 --- a/Cassiopee/CPlot/apps/tkTreeOps.py +++ b/Cassiopee/CPlot/apps/tkTreeOps.py @@ -211,7 +211,7 @@ def createApp(win): F.bind('', updateBaseNameList) else: VARS[0].set('newBase') - B = ttk.Combobox(F, textvariable=VARS[0], + B = ttk.Combobox(F, textvariable=VARS[0], values=[], state='normal') B.grid(sticky=TK.EW) F.bind('', updateBaseNameList2) diff --git a/Cassiopee/CPlot/apps/tkVariables.py b/Cassiopee/CPlot/apps/tkVariables.py index f5bc76030..f02af2dcd 100644 --- a/Cassiopee/CPlot/apps/tkVariables.py +++ b/Cassiopee/CPlot/apps/tkVariables.py @@ -73,7 +73,7 @@ def updateVarNameList2_2(event=None): else: nob = CTK.Nb[0]+1 noz = CTK.Nz[0] - zvars = C.getVarNames(CTK.t[2][nob][2][noz]) + zvars = C.getVarNames(CTK.t[2][nob][2][noz]) if len(zvars) == 0: return if 'var2' in WIDGETS: WIDGETS['var2']['values'] = zvars[0] @@ -93,7 +93,7 @@ def updateVarNameList3(event=None): m = WIDGETS['var3'].children['menu'] m.delete(0, TK.END) zvars = ['FlowSolutionCenters'] - if len(varsl) != 0: zvars += varsl[0] + if len(varsl) != 0: zvars += varsl[0] for i in zvars: m.add_command(label=i, command=lambda v=VARS[8],l=i:v.set(l)) @@ -236,7 +236,7 @@ def node2CenterVar(): #============================================================================== def chooseImportFile(event=None): try: import tkFileDialog - except: import tkinter.filedialog as tkFileDialog + except: import tkinter.filedialog as tkFileDialog init = VARS[4].get() init = init.split(';')[0] files = tkFileDialog.askopenfilenames( @@ -328,7 +328,7 @@ def computeVariables(): TInf = Internal.getNodeFromName(state, 'Temperature') if TInf is not None: TInf = Internal.getValue(TInf) - else: fail = True + else: fail = True Ts = Internal.getNodeFromName(state, 'Ts') if Ts is not None: Ts = Internal.getValue(Ts) @@ -347,11 +347,11 @@ def computeVariables(): CTK.TXT.insert('START', 'Error: ', 'Error'); return rgp = (gamma-1)*Cv - loc = VARS[6].get() + loc = VARS[6].get() CTK.saveTree() if (varname == 'Vorticity' or varname == 'VorticityMagnitude' or varname == 'QCriterion' or varname == 'ShearStress' or - varname == 'SkinFriction' or varname == 'SkinFrictionTangential'): # extra variables + varname == 'SkinFriction' or varname == 'SkinFrictionTangential'): # extra variables varloc = loc+':'+varname if CTK.__MAINTREE__ <= 0 or nzs == []: try: @@ -383,7 +383,7 @@ def computeVariables(): CTK.TXT.insert('START', 'Computation of variable %s failed.\n'%varloc) CTK.TXT.insert('START', 'Error: ', 'Error') - else: # std variables + else: # std variables varloc = loc+':'+varname if CTK.__MAINTREE__ <= 0 or nzs == []: try: @@ -394,7 +394,7 @@ def computeVariables(): except Exception as e: Panels.displayErrors([0,str(e)], header='Error: computeVariables') CTK.TXT.insert('START', 'Computation of variable %s failed.\n'%varloc) - CTK.TXT.insert('START', 'Error: ', 'Error') + CTK.TXT.insert('START', 'Error: ', 'Error') else: fail = False; errors = [] for nz in nzs: @@ -407,7 +407,7 @@ def computeVariables(): except Exception as e: fail = True; errors += [0,str(e)] - if not fail: + if not fail: CTK.TXT.insert('START', 'Variable %s computed.\n'%varloc) else: Panels.displayErrors(errors, header='Error: computeVariables') @@ -545,11 +545,11 @@ def createApp(win): # - VARS - # -0- computeVariable name V = TK.StringVar(win); V.set('Pressure'); VARS.append(V) - if 'tkVariablesName' in CTK.PREFS: + if 'tkVariablesName' in CTK.PREFS: V.set(CTK.PREFS['tkVariablesName']) # -1- addVar V = TK.StringVar(win); V.set('Density'); VARS.append(V) - if 'tkVariablesAddVar' in CTK.PREFS: + if 'tkVariablesAddVar' in CTK.PREFS: V.set(CTK.PREFS['tkVariablesAddVar']) # -2- computeGrad - V = TK.StringVar(win); V.set('CoordinateX'); VARS.append(V) @@ -558,17 +558,17 @@ def createApp(win): VARS.append(V) # -4- importFile - V = TK.StringVar(win); V.set('output.plt'); VARS.append(V) - if 'tkVariablesImportFile' in CTK.PREFS: + if 'tkVariablesImportFile' in CTK.PREFS: V.set(CTK.PREFS['tkVariablesImportFile']) # -5- Rm variable V = TK.StringVar(win); V.set('All'); VARS.append(V) # -6- Var location V = TK.StringVar(win); V.set('centers'); VARS.append(V) - if 'tkVariablesLoc' in CTK.PREFS: + if 'tkVariablesLoc' in CTK.PREFS: V.set(CTK.PREFS['tkVariablesLoc']) # -7- adim type V = TK.StringVar(win); V.set('Adim1 (ro,a,T)'); VARS.append(V) - if 'tkVariablesAdim' in CTK.PREFS: + if 'tkVariablesAdim' in CTK.PREFS: V.set(CTK.PREFS['tkVariablesAdim']) # -8- center2Node variable V = TK.StringVar(win); V.set('FlowSolutionCenters'); VARS.append(V) @@ -622,7 +622,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Removed variable.') WIDGETS['var1'] = B else: - B = ttk.Combobox(F, textvariable=VARS[5], + B = ttk.Combobox(F, textvariable=VARS[5], values=[], state='readonly') B.grid(sticky=TK.EW) F.bind('', updateVarNameList1_2) @@ -630,7 +630,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Removed variable.') WIDGETS['var1'] = B - # - renameVar - + # - renameVar - #norow+= 1 #F = TTK.Frame(Frame, borderwidth=0) #F.columnconfigure(0, weight=1) @@ -642,7 +642,7 @@ def createApp(win): # BB = CTK.infoBulle(parent=B, text='Renamed variable.') # WIDGETS['var5'] = B #else: - # B = ttk.Combobox(F, textvariable=VARS[11], + # B = ttk.Combobox(F, textvariable=VARS[11], # values=[], state='readonly') # B.grid(sticky=TK.EW) # F.bind('', updateVarNameList5_2) @@ -655,7 +655,7 @@ def createApp(win): #norow+=1 #B = TK.Button(Frame, text="Rename variable", command=renameVar) #B.grid(row=norow, column=0, columnspan=2, sticky=TK.EW) - #BB = CTK.infoBulle(parent=B, text='Rename variable from pyTree.') + #BB = CTK.infoBulle(parent=B, text='Rename variable from pyTree.') # - center2Node var - norow += 1 @@ -673,7 +673,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Center variable to be set in nodes.') WIDGETS['var3'] = B else: - B = ttk.Combobox(F, textvariable=VARS[8], + B = ttk.Combobox(F, textvariable=VARS[8], values=[], state='readonly') B.grid(sticky=TK.EW) F.bind('', updateVarNameList3_2) @@ -698,7 +698,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Node variable to be set in centers.') WIDGETS['var4'] = B else: - B = ttk.Combobox(F, textvariable=VARS[9], + B = ttk.Combobox(F, textvariable=VARS[9], values=[], state='readonly') B.grid(sticky=TK.EW) F.bind('', updateVarNameList4_2) @@ -728,7 +728,7 @@ def createApp(win): BB = CTK.infoBulle(parent=B, text='Variable for gradient.') WIDGETS['var2'] = B else: - B = ttk.Combobox(F, textvariable=VARS[2], + B = ttk.Combobox(F, textvariable=VARS[2], values=[], state='readonly') B.grid(sticky=TK.EW) F.bind('', updateVarNameList2_2) diff --git a/Cassiopee/CPlot/apps/tkView.py b/Cassiopee/CPlot/apps/tkView.py index 9fc164b2f..960968c68 100644 --- a/Cassiopee/CPlot/apps/tkView.py +++ b/Cassiopee/CPlot/apps/tkView.py @@ -1,4 +1,4 @@ -# - tkView - +# - tkView - """Set the view in plotter.""" try: import tkinter as TK except ImportError: import Tkinter as TK @@ -220,11 +220,11 @@ def displayField(event=None): if CTK.t == []: return global VARNO field = VARS[18].get() - if CTK.__MAINTREE__ == 1: + if CTK.__MAINTREE__ == 1: zvars = C.getVarNames(CTK.t, mode=1) if zvars == []: return zvars = zvars[0] - else: + else: zvars = C.getVarNames(CTK.dt, mode=1) if zvars == []: return zvars = zvars[0] @@ -334,7 +334,7 @@ def saveSlot(): else: legend = 0 colormap = VARS[4].get() fmin = float(VARS[9].get()) - fmax = float(VARS[10].get()) + fmax = float(VARS[10].get()) isoScales = [field, niso, fmin, fmax] CPlot._addRender2PyTree(CTK.t, slot=int(slot), posCam=posCam, posEye=posEye, dirCam=dirCam, @@ -354,7 +354,7 @@ def loadSlot(): if slot is None: return pos = Internal.getNodeFromName(slot, 'posCam') if pos is not None: - n = pos[1] + n = pos[1] CPlot.setState(posCam=(n[0], n[1], n[2])) pos = Internal.getNodeFromName1(slot, 'posEye') if pos is not None: @@ -420,7 +420,7 @@ def loadSlot(): if pos is not None: out = [] for i in pos[2]: out.append(Internal.getValue(i)) - CPlot.setState(bumpMaps=out) + CPlot.setState(bumpMaps=out) pos = Internal.getNodeFromName1(renderInfo, 'billBoards') if pos is not None: out = [] @@ -501,7 +501,7 @@ def setColormapLight(event=None): WIDGETS['colormapC1'].grid(row=7, column=0, sticky=TK.EW) WIDGETS['colormapC2'].grid(row=7, column=2, sticky=TK.EW) WIDGETS['colormapC3'].grid(row=7, column=1, sticky=TK.EW) - else: + else: WIDGETS['colormapC1'].grid_forget() WIDGETS['colormapC2'].grid_forget() WIDGETS['colormapC3'].grid_forget() @@ -655,17 +655,17 @@ def compMin(): if CTK.t == []: return if VARNO < 0: return var = VARS[18].get() - if CTK.__MAINTREE__ == 1: + if CTK.__MAINTREE__ == 1: VARMIN = C.getMinValue(CTK.t, var) isFinite = C.isFinite(CTK.t, var) - if not isFinite: + if not isFinite: CTK.TXT.insert('START', 'NAN values detected.\n') CTK.TXT.insert('START', 'Warning: ', 'Warning') VARMIN = -1.e299 - else: + else: VARMIN = C.getMinValue(CTK.dt, var) isFinite = C.isFinite(CTK.dt, var) - if not isFinite: + if not isFinite: CTK.TXT.insert('START', 'NAN values detected.\n') CTK.TXT.insert('START', 'Warning: ', 'Warning') VARMIN = -1.e299 @@ -674,7 +674,7 @@ def compMin(): def compIsoMinFull(event=None): zones = CTK.getValidZones() if zones == []: compMin() - if len(zones) == len(Internal.getZones(CTK.t)): compMin() + if len(zones) == len(Internal.getZones(CTK.t)): compMin() compIsoMin() #============================================================================== @@ -684,7 +684,7 @@ def compIsoMin(event=None): var = VARS[18].get() zones = CTK.getValidZones() if zones == []: - if CTK.__MAINTREE__ == 1: + if CTK.__MAINTREE__ == 1: zones = Internal.getZones(CTK.t) else: zones = Internal.getZones(CTK.dt) if zones == []: return @@ -711,17 +711,17 @@ def compMax(): if CTK.t == []: return if VARNO < 0: return var = VARS[18].get() - if CTK.__MAINTREE__ == 1: + if CTK.__MAINTREE__ == 1: VARMAX = C.getMaxValue(CTK.t, var) isFinite = C.isFinite(CTK.t, var) - if not isFinite: + if not isFinite: CTK.TXT.insert('START', 'NAN values detected.\n') CTK.TXT.insert('START', 'Warning: ', 'Warning') VARMAX = +1.e299 - else: + else: VARMAX = C.getMaxValue(CTK.dt, var) isFinite = C.isFinite(CTK.t, var) - if not isFinite: + if not isFinite: CTK.TXT.insert('START', 'NAN values detected.\n') CTK.TXT.insert('START', 'Warning: ', 'Warning') VARMAX = +1.e299 @@ -730,7 +730,7 @@ def compMax(): def compIsoMaxFull(event=None): zones = CTK.getValidZones() if zones == []: compMax() - if len(zones) == len(Internal.getZones(CTK.t)): compMax() + if len(zones) == len(Internal.getZones(CTK.t)): compMax() compIsoMax() #============================================================================== @@ -740,14 +740,14 @@ def compIsoMax(event=None): var = VARS[18].get() zones = CTK.getValidZones() if zones == []: - if CTK.__MAINTREE__ == 1: + if CTK.__MAINTREE__ == 1: zones = Internal.getZones(CTK.t) else: zones = Internal.getZones(CTK.dt) if zones == []: return try: varmax = C.getMaxValue(zones, var) isFinite = C.isFinite(zones, var) - if not isFinite: + if not isFinite: CTK.TXT.insert('START', 'NAN values detected.\n') CTK.TXT.insert('START', 'Warning: ', 'Warning') varmax = +1.e299 @@ -1033,17 +1033,17 @@ def createApp(win): V = TK.StringVar(win); V.set('0'); VARS.append(V) # -16- Mesh style V = TK.StringVar(win); V.set('Multicolor wires+solid'); VARS.append(V) - if 'tkViewMeshStyle' in CTK.PREFS: + if 'tkViewMeshStyle' in CTK.PREFS: V.set(CTK.PREFS['tkViewMeshStyle']) # -17- Solid style V = TK.StringVar(win); V.set('Monocolor/1-side'); VARS.append(V) - if 'tkViewSolidStyle' in CTK.PREFS: + if 'tkViewSolidStyle' in CTK.PREFS: V.set(CTK.PREFS['tkViewSolidStyle']) # -18- scalar variable V = TK.StringVar(win); V.set('None'); VARS.append(V) # -19- Scalar style V = TK.StringVar(win); V.set('Bands'); VARS.append(V) - if 'tkViewScalarStyle' in CTK.PREFS: + if 'tkViewScalarStyle' in CTK.PREFS: V.set(CTK.PREFS['tkViewScalarStyle']) # -20- vector variable 1 V = TK.StringVar(win); V.set('None'); VARS.append(V) @@ -1151,9 +1151,9 @@ def createApp(win): F.grid(row=0, column=1, columnspan=2, sticky=TK.EW) WIDGETS['scalarField'] = B else: - B = ttk.Combobox(F, textvariable=VARS[18], + B = ttk.Combobox(F, textvariable=VARS[18], values=[], state='readonly', width=10) - B.bind('<>', displayField) + B.bind('<>', displayField) B.grid(sticky=TK.EW) F.bind('', updateVarNameList_2) F.grid(row=0, column=1, columnspan=2, sticky=TK.EW) @@ -1161,7 +1161,7 @@ def createApp(win): B = TTK.Label(Scalar, text='Style:') B.grid(row=1, column=0, sticky=TK.EW) - B = TTK.OptionMenu(Scalar, VARS[19], 'Bands', 'Bands+mesh', + B = TTK.OptionMenu(Scalar, VARS[19], 'Bands', 'Bands+mesh', 'Lines', 'Lines+mesh', command=setScalarStyle) B.grid(row=1, column=1, columnspan=2, sticky=TK.EW) @@ -1238,8 +1238,8 @@ def createApp(win): B.grid(row=6, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Display color legend.') B = TTK.OptionMenu(Scalar, VARS[4], 'Blue2Red', - 'Diverging', - 'Viridis', 'Inferno', 'Magma', + 'Diverging', + 'Viridis', 'Inferno', 'Magma', 'Plasma', 'Jet', 'Greys', 'NiceBlue', 'Greens', 'BiColorRGB', 'BiColorHSV', 'TriColorRGB', 'TriColorHSV', @@ -1333,9 +1333,9 @@ def createApp(win): F.grid(row=5, column=1, columnspan=2, sticky=TK.EW) WIDGETS['vectorField3'] = B else: - B = ttk.Combobox(F, textvariable=VARS[20], + B = ttk.Combobox(F, textvariable=VARS[20], values=[], state='readonly', width=15) - B.bind('<>', displayVector1) + B.bind('<>', displayVector1) B.grid(sticky=TK.EW) F.bind('', updateVarNameList1_2) F.grid(row=3, column=1, columnspan=2, sticky=TK.EW) @@ -1344,9 +1344,9 @@ def createApp(win): B.grid(row=4, column=0, sticky=TK.EW) F = TTK.Frame(Vector, borderwidth=0) F.columnconfigure(0, weight=1) - B = ttk.Combobox(F, textvariable=VARS[21], + B = ttk.Combobox(F, textvariable=VARS[21], values=[], state='readonly', width=15) - B.bind('<>', displayVector) + B.bind('<>', displayVector) B.grid(sticky=TK.EW) F.bind('', updateVarNameList2_2) F.grid(row=4, column=1, columnspan=2, sticky=TK.EW) @@ -1355,9 +1355,9 @@ def createApp(win): B.grid(row=5, column=0, sticky=TK.EW) F = TTK.Frame(Vector, borderwidth=0) F.columnconfigure(0, weight=1) - B = ttk.Combobox(F, textvariable=VARS[22], + B = ttk.Combobox(F, textvariable=VARS[22], values=[], state='readonly', width=15) - B.bind('<>', displayVector) + B.bind('<>', displayVector) B.grid(sticky=TK.EW) F.bind('', updateVarNameList3_2) F.grid(row=5, column=1, columnspan=2, sticky=TK.EW) @@ -1366,7 +1366,7 @@ def createApp(win): B = TTK.Checkbutton(Vector, text='Normalize', variable=VARS[26], command=setNormalizeVector) BB = CTK.infoBulle(parent=B, text='Normalize all vectors before displaying.') - B.grid(row=6, column=1, sticky=TK.EW) + B.grid(row=6, column=1, sticky=TK.EW) B = TTK.Checkbutton(Vector, text='Show Surface', variable=VARS[27], command=setShowSurfaceVector) diff --git a/Cassiopee/CPlot/apps/validCassiopee.py b/Cassiopee/CPlot/apps/validCassiopee.py index 8c5b60000..25d7ebc0d 100644 --- a/Cassiopee/CPlot/apps/validCassiopee.py +++ b/Cassiopee/CPlot/apps/validCassiopee.py @@ -1,7 +1,7 @@ # *Cassiopee* GUI for validation and tests import os, sys, re, glob, signal, platform import numpy as np -import subprocess +import subprocess import threading import time import KCore @@ -15,7 +15,7 @@ machine = socket.gethostname() # Support MPI? -try: +try: import mpi4py isMpi = True except: isMpi = False @@ -67,8 +67,8 @@ #============================================================================== -# Classes used to by-pass tkinter in the absence of a display environment or -# for command-line execution +# Classes used to by-pass tkinter in the absence of a display environment or +# for command-line execution #============================================================================== class NoDisplayListbox: def __init__(self, *args, **kwargs): @@ -174,7 +174,7 @@ def getInstallPaths(): import FastC.installPath fastIncDir = FastC.installPath.includePath fastIncDir = os.path.dirname(fastIncDir) - except: + except: fastIncDir = None pmodulesDir = os.path.join(os.path.dirname(os.path.dirname(cassiopeeIncDir)), 'PModules') @@ -396,7 +396,7 @@ def _setModuleDirs(cassiopeeIncDir, fastIncDir, pmodulesIncDir, loc='LOCAL'): for i in mods: if i not in MODULESDIR[loc]: a = os.access(os.path.join(cassiopeeIncDir, i, 'test'), os.F_OK) - if a: + if a: MODULESDIR[loc][i] = cassiopeeIncDir # Validation CFD @@ -501,7 +501,7 @@ def writeTime(fileTime, CPUtime, coverage): except: pass #============================================================================== -# Ecrit un fichier contenant date, machine, nbre de threads, git info +# Ecrit un fichier contenant date, machine, nbre de threads, git info # et logTxt #============================================================================== def writeFinal(filename, gitInfo="", logTxt=None, append=False): @@ -602,7 +602,7 @@ def extractCPUTimeUnix(output): tf += dt[i]*float(output[i]) hf = tf//3600 tf = tf%3600 - output = [int(hf), int(tf//60), float(tf%60)] + output = [int(hf), int(tf//60), float(tf%60)] if hf > 0.: CPUtime = '{:d}h{:d}m{:.2f}'.format(*output) elif output[1] > 0.: CPUtime = '{:d}m{:.2f}'.format(*output[1:]) else: CPUtime = '0m{:.2f}'.format(output[-1]) @@ -947,11 +947,11 @@ def buildTestList(loadSession=False, modules=[]): sessionLog = [line.rstrip().split(':') for line in g.readlines()] # Remove header from logfile sessionLog = [testLog for testLog in sessionLog - if (isinstance(testLog, list) and len(testLog) == ncolumns)] + if (isinstance(testLog, list) and len(testLog) == ncolumns)] if not sessionLog: ncolumns = 7 sessionLog = [testLog for testLog in sessionLog - if (isinstance(testLog, list) and len(testLog) == ncolumns)] + if (isinstance(testLog, list) and len(testLog) == ncolumns)] # Create array and remove leading and trailing white spaces arr = np.array([entry.strip() for testLog in sessionLog for entry in testLog], dtype=object) @@ -965,11 +965,11 @@ def buildTestList(loadSession=False, modules=[]): with open(logname, "r") as g: sessionLog = [line.rstrip().split(':') for line in g.readlines()] sessionLog = [testLog for testLog in sessionLog - if (isinstance(testLog, list) and len(testLog) == ncolumns)] + if (isinstance(testLog, list) and len(testLog) == ncolumns)] if not sessionLog: ncolumns = 7 sessionLog = [testLog for testLog in sessionLog - if (isinstance(testLog, list) and len(testLog) == ncolumns)] + if (isinstance(testLog, list) and len(testLog) == ncolumns)] arr2 = np.array([entry.strip() for testLog in sessionLog for entry in testLog], dtype=object) arr2 = arr2.reshape(-1, ncolumns) @@ -1225,7 +1225,7 @@ def showPartialCovered(): Listbox.delete(0, 'end') for s in TESTS: if (re.search(filter1, s) is None and re.search(filter2, s) is None - and re.search(filter3, s) is None): + and re.search(filter3, s) is None): Listbox.insert('end', s) Listbox.config(yscrollcommand=Scrollbar.set) Scrollbar.config(command=Listbox.yview) @@ -1330,7 +1330,7 @@ def stopTests(): global STOP, THREAD, PROCESS STOP = 1 - if PROCESS is not None: + if PROCESS is not None: if mySystem == 'mingw' or mySystem == 'windows': subprocess.call(['taskkill', '/F', '/T', '/PID', str(PROCESS.pid)]) else: # unix @@ -1396,7 +1396,7 @@ def getThreads(): #============================================================================== def export2Text(): try: import tkFileDialog - except: import tkinter.filedialog as tkFileDialog + except: import tkinter.filedialog as tkFileDialog ret = tkFileDialog.asksaveasfilename() if ret == '' or ret is None or ret == (): # user cancel return @@ -1428,8 +1428,8 @@ def writeSessionLog(): writeFinal(os.path.join(VALIDDIR['LOCAL'], 'session.log'), logTxt=messageText) #============================================================================== -# Notify "Commit ready" -#============================================================================== +# Notify "Commit ready" +#============================================================================== def notifyValidOK(): cassiopeeIncDir = getInstallPaths()[0] gitOrigin = Dist.getGitOrigin(cassiopeeIncDir) @@ -1573,7 +1573,7 @@ def setupGlobal(**kwargs): buildTestList(**kwargs) updateDBLabel() -def getDBInfo(): +def getDBInfo(): dbInfo = '' if os.access('/stck/cassiope/git/Cassiopee/', os.R_OK): filename = '/stck/cassiope/git/Cassiopee/Cassiopee/Valid{}/base.time' @@ -1584,7 +1584,7 @@ def getDBInfo(): except: pass return dbInfo -def updateDBLabel(): +def updateDBLabel(): if not INTERACTIVE: return dbInfo = getDBInfo() if not dbInfo: return @@ -1671,7 +1671,7 @@ def updateASANOptions(): print("Info: ASAN_OPTIONS = " + os.getenv("ASAN_OPTIONS", "")) print(" LSAN_OPTIONS = " + os.getenv("LSAN_OPTIONS", "")) -def updateASANLabel(entry_index): +def updateASANLabel(entry_index): if not INTERACTIVE: return if getDBInfo(): entry_index += 2 label = toolsTab.entrycget(entry_index, "label") @@ -1805,14 +1805,14 @@ def updateASANLabel(entry_index): TextFilter.grid(row=1, column=2, columnspan=3, sticky=TK.EW) filterInfoBulle = 'Filter test database using a regexp.\n'+'-'*70+'\n'\ - '1) White-spaced: ^cylinder ^sphere\n'\ - '2) Module filter using #: #Apps #Fast #FF or simply #[A,F] \n'\ - '3) Status filter using /: /FAILED /MEMLEAK or simply /F\n'\ - '4) Coverage filter using %: %100\n'\ - '5) Tag symbol filter using @: @r to catch red-coloured cases\n'\ - '6) Keyworded filters: , , , , , .\n'\ - '7) Logical OR ops unless prefixed with & (AND): #Converter &/FAILED\n'\ - '8) Negated using !: #Fast &#!FastC (innermost symbol)' + '1) White-spaced: ^cylinder ^sphere\n'\ + '2) Module filter using #: #Apps #Fast #FF or simply #[A,F] \n'\ + '3) Status filter using /: /FAILED /MEMLEAK or simply /F\n'\ + '4) Coverage filter using %: %100\n'\ + '5) Tag symbol filter using @: @r to catch red-coloured cases\n'\ + '6) Keyworded filters: , , , , , .\n'\ + '7) Logical OR ops unless prefixed with & (AND): #Converter &/FAILED\n'\ + '8) Negated using !: #Fast &#!FastC (innermost symbol)' RunButton = TK.Button(Frame, text='Run', command=runTestsInThread, fg='blue') diff --git a/Cassiopee/CPlot/apps/validFast.py b/Cassiopee/CPlot/apps/validFast.py index 830077894..8d6daa0bb 100644 --- a/Cassiopee/CPlot/apps/validFast.py +++ b/Cassiopee/CPlot/apps/validFast.py @@ -57,7 +57,7 @@ def getCases(): reps = os.listdir(path) for i in reps: a = os.access(path+'/'+i+'/valid', os.F_OK) - if (a == True): + if (a == True): CASES.append(i) a = os.access(path+'/'+i+'/Readme.txt', os.F_OK) if (a == True): @@ -138,8 +138,8 @@ def buildString(info): gfx = info[3] status = info[4] string = case.ljust(20) + separatorl + nit.ljust(10) + separatorl + \ - scale.ljust(5) + separatorl + gfx.ljust(2) + separatorl + \ - status.ljust(10) + scale.ljust(5) + separatorl + gfx.ljust(2) + separatorl + \ + status.ljust(10) return string #============================================================================== diff --git a/Cassiopee/CPlot/doc/source/conf.py b/Cassiopee/CPlot/doc/source/conf.py index 36a929f76..3f868766c 100644 --- a/Cassiopee/CPlot/doc/source/conf.py +++ b/Cassiopee/CPlot/doc/source/conf.py @@ -192,15 +192,15 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', -'preamble': r''' + # Additional stuff for the LaTeX preamble. + #'preamble': '', + 'preamble': r''' \usepackage{charter} \usepackage[defaultsans]{lato} \usepackage{inconsolata} @@ -211,14 +211,14 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('CPlot', 'CPlot.tex', u'CPlot Documentation', - u'/ELSA/MU-10020/V'+__version__, 'manual'), - ('tkCassiopee', 'tkCassiopee.tex', u'tkCassiopee Documentation', - u'/ELSA/MU-10020/V'+__version__, 'manual'), - ('tkPlotXY', 'tkPlotXY.tex', u'tkPlotXY Documentation', - u'/ELSA/MU-10020/V'+__version__, 'manual'), - ('Decorator', 'Decorator.tex', u'Decorator Documentation', - u'/ELSA/MU-10020/V'+__version__, 'manual'), + ('CPlot', 'CPlot.tex', u'CPlot Documentation', + u'/ELSA/MU-10020/V'+__version__, 'manual'), + ('tkCassiopee', 'tkCassiopee.tex', u'tkCassiopee Documentation', + u'/ELSA/MU-10020/V'+__version__, 'manual'), + ('tkPlotXY', 'tkPlotXY.tex', u'tkPlotXY Documentation', + u'/ELSA/MU-10020/V'+__version__, 'manual'), + ('Decorator', 'Decorator.tex', u'Decorator Documentation', + u'/ELSA/MU-10020/V'+__version__, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -261,9 +261,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'CPlot', u'CPlot Documentation', - u'ONERA', 'CPlot', 'One line description of project.', - 'Miscellaneous'), + ('index', 'CPlot', u'CPlot Documentation', + u'ONERA', 'CPlot', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/CPlot/setup.py b/Cassiopee/CPlot/setup.py index 626c584ab..2e288cd23 100644 --- a/Cassiopee/CPlot/setup.py +++ b/Cassiopee/CPlot/setup.py @@ -66,7 +66,7 @@ libGL = ['opengl32', 'glu32'] elif mySystem[0] == 'Darwin': libraries += ["X11", "Xmu"] - libGL = ['GL', 'GLU'] + libGL = ['GL', 'GLU'] else: libraries += ["Xi", "Xmu", "rt"] libGL = ['GL', 'GLU'] @@ -87,24 +87,24 @@ extensions = [] if isGL: extensions += [ - Extension('CPlot.cplot', - sources=['CPlot/cplot.cpp'], - include_dirs=["CPlot", "CPlot/Shaders"]+additionalIncludePaths+includeDirs, - library_dirs=additionalLibPaths+libraryDirs, - libraries=['cplot', 'cplot1', 'cplot', 'cplot1']+libGL+libraries+additionalLibs, - extra_compile_args=EXTRA, - extra_link_args=Dist.getLinkArgs()) + Extension('CPlot.cplot', + sources=['CPlot/cplot.cpp'], + include_dirs=["CPlot", "CPlot/Shaders"]+additionalIncludePaths+includeDirs, + library_dirs=additionalLibPaths+libraryDirs, + libraries=['cplot', 'cplot1', 'cplot', 'cplot1']+libGL+libraries+additionalLibs, + extra_compile_args=EXTRA, + extra_link_args=Dist.getLinkArgs()) ] if OSMesa: extensions += [ - Extension('CPlot.cplotOSMesa', - sources=['CPlot/cplotOSMesa.cpp'], - include_dirs=["CPlot", "CPlot/Shaders2.0"]+additionalIncludePaths+includeDirs+[OSMesaIncDir], - library_dirs=additionalLibPaths+libraryDirs+[OSMesaLibDir], - libraries=['cplot', 'cplot2', 'cplot', 'cplot2', OSMesaLibname]+libraries+additionalLibs+libGL, - extra_compile_args=EXTRA+['-D__MESA__'], - extra_link_args=Dist.getLinkArgs()) + Extension('CPlot.cplotOSMesa', + sources=['CPlot/cplotOSMesa.cpp'], + include_dirs=["CPlot", "CPlot/Shaders2.0"]+additionalIncludePaths+includeDirs+[OSMesaIncDir], + library_dirs=additionalLibPaths+libraryDirs+[OSMesaLibDir], + libraries=['cplot', 'cplot2', 'cplot', 'cplot2', OSMesaLibname]+libraries+additionalLibs+libGL, + extra_compile_args=EXTRA+['-D__MESA__'], + extra_link_args=Dist.getLinkArgs()) ] @@ -118,7 +118,7 @@ packages=['CPlot'], package_dir={"":"."}, ext_modules=extensions - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/CPlot/setupLegacy.py b/Cassiopee/CPlot/setupLegacy.py index 65121e4c4..ae749c687 100644 --- a/Cassiopee/CPlot/setupLegacy.py +++ b/Cassiopee/CPlot/setupLegacy.py @@ -81,8 +81,8 @@ libraries=libraries+additionalLibs, extra_compile_args=EXTRA, extra_link_args=Dist.getLinkArgs() - ) - ] + ) +] # Setup ====================================================================== setup( @@ -93,7 +93,7 @@ package_dir={"":"."}, packages=['CPlot'], ext_modules=extensions - ) +) # Install shaders + textures ================================================== os.system("cp CPlot/Shaders/*.vert %s/CPlot/"%KCore.installPath.installPath) diff --git a/Cassiopee/CPlot/srcs.py b/Cassiopee/CPlot/srcs.py index 62bb6afad..c264827ef 100644 --- a/Cassiopee/CPlot/srcs.py +++ b/Cassiopee/CPlot/srcs.py @@ -4,7 +4,7 @@ MPEG = False if MPEG: (mpeg, mpegIncDir, mpegLib) = Dist.checkMpeg(additionalLibPaths, - additionalIncludePaths) + additionalIncludePaths) else: mpeg = False # Choix des SHADERS (2 ou 4) pour GL et OSMESA @@ -75,7 +75,7 @@ 'CPlot/Display/displaySMeshZone.cpp', 'CPlot/Display/displayUMesh.cpp', 'CPlot/Display/displayUMeshZone.cpp', - 'CPlot/Display/displayUMeshHOZone.cpp', + 'CPlot/Display/displayUMeshHOZone.cpp', 'CPlot/Display/displaySSolid.cpp', 'CPlot/Display/displaySSolidZone.cpp', 'CPlot/Display/displayUSolid.cpp', @@ -178,65 +178,65 @@ if SHADERS1 == 4 and SHADERS2 == 4: cpp_srcs += [ - 'CPlot/Shaders/TesselationShaderManager.cpp', - 'CPlot/Shaders/TesselationControlShader.cpp', - 'CPlot/Shaders/TesselationEvaluationShader.cpp', - 'CPlot/Shaders/triggerShader.cpp', - 'CPlot/Shaders/FragmentShader.cpp', - 'CPlot/Shaders/VertexShader.cpp', - 'CPlot/Shaders/GeomShader.cpp', - 'CPlot/Shaders/ShaderObject.cpp', - 'CPlot/Shaders/Shader.cpp', - 'CPlot/Shaders/ShaderManager.cpp'] + 'CPlot/Shaders/TesselationShaderManager.cpp', + 'CPlot/Shaders/TesselationControlShader.cpp', + 'CPlot/Shaders/TesselationEvaluationShader.cpp', + 'CPlot/Shaders/triggerShader.cpp', + 'CPlot/Shaders/FragmentShader.cpp', + 'CPlot/Shaders/VertexShader.cpp', + 'CPlot/Shaders/GeomShader.cpp', + 'CPlot/Shaders/ShaderObject.cpp', + 'CPlot/Shaders/Shader.cpp', + 'CPlot/Shaders/ShaderManager.cpp'] elif SHADERS1 == 2 and SHADERS2 == 2: cpp_srcs += [ - 'CPlot/Shaders2.0/triggerShader.cpp', - 'CPlot/Shaders2.0/FragmentShader.cpp', - 'CPlot/Shaders2.0/VertexShader.cpp', - 'CPlot/Shaders2.0/GeomShader.cpp', - 'CPlot/Shaders2.0/ShaderObject.cpp', - 'CPlot/Shaders2.0/Shader.cpp', - 'CPlot/Shaders2.0/ShaderManager.cpp'] + 'CPlot/Shaders2.0/triggerShader.cpp', + 'CPlot/Shaders2.0/FragmentShader.cpp', + 'CPlot/Shaders2.0/VertexShader.cpp', + 'CPlot/Shaders2.0/GeomShader.cpp', + 'CPlot/Shaders2.0/ShaderObject.cpp', + 'CPlot/Shaders2.0/Shader.cpp', + 'CPlot/Shaders2.0/ShaderManager.cpp'] elif SHADERS1 == 4 and SHADERS2 == 2: cpp_srcs1 += [ - 'CPlot/Shaders/TesselationShaderManager.cpp', - 'CPlot/Shaders/TesselationControlShader.cpp', - 'CPlot/Shaders/TesselationEvaluationShader.cpp', - 'CPlot/Shaders/triggerShader.cpp', - 'CPlot/Shaders/FragmentShader.cpp', - 'CPlot/Shaders/VertexShader.cpp', - 'CPlot/Shaders/GeomShader.cpp', - 'CPlot/Shaders/ShaderObject.cpp', - 'CPlot/Shaders/Shader.cpp', - 'CPlot/Shaders/ShaderManager.cpp'] + 'CPlot/Shaders/TesselationShaderManager.cpp', + 'CPlot/Shaders/TesselationControlShader.cpp', + 'CPlot/Shaders/TesselationEvaluationShader.cpp', + 'CPlot/Shaders/triggerShader.cpp', + 'CPlot/Shaders/FragmentShader.cpp', + 'CPlot/Shaders/VertexShader.cpp', + 'CPlot/Shaders/GeomShader.cpp', + 'CPlot/Shaders/ShaderObject.cpp', + 'CPlot/Shaders/Shader.cpp', + 'CPlot/Shaders/ShaderManager.cpp'] cpp_srcs2 += [ - 'CPlot/Shaders2.0/triggerShader.cpp', - 'CPlot/Shaders2.0/FragmentShader.cpp', - 'CPlot/Shaders2.0/VertexShader.cpp', - 'CPlot/Shaders2.0/GeomShader.cpp', - 'CPlot/Shaders2.0/ShaderObject.cpp', - 'CPlot/Shaders2.0/Shader.cpp', - 'CPlot/Shaders2.0/ShaderManager.cpp'] + 'CPlot/Shaders2.0/triggerShader.cpp', + 'CPlot/Shaders2.0/FragmentShader.cpp', + 'CPlot/Shaders2.0/VertexShader.cpp', + 'CPlot/Shaders2.0/GeomShader.cpp', + 'CPlot/Shaders2.0/ShaderObject.cpp', + 'CPlot/Shaders2.0/Shader.cpp', + 'CPlot/Shaders2.0/ShaderManager.cpp'] else: cpp_srcs1 += [ - 'CPlot/Shaders2.0/triggerShader.cpp', - 'CPlot/Shaders2.0/FragmentShader.cpp', - 'CPlot/Shaders2.0/VertexShader.cpp', - 'CPlot/Shaders2.0/GeomShader.cpp', - 'CPlot/Shaders2.0/ShaderObject.cpp', - 'CPlot/Shaders2.0/Shader.cpp', - 'CPlot/Shaders2.0/ShaderManager.cpp'] + 'CPlot/Shaders2.0/triggerShader.cpp', + 'CPlot/Shaders2.0/FragmentShader.cpp', + 'CPlot/Shaders2.0/VertexShader.cpp', + 'CPlot/Shaders2.0/GeomShader.cpp', + 'CPlot/Shaders2.0/ShaderObject.cpp', + 'CPlot/Shaders2.0/Shader.cpp', + 'CPlot/Shaders2.0/ShaderManager.cpp'] cpp_srcs2 += [ - 'CPlot/Shaders/TesselationShaderManager.cpp', - 'CPlot/Shaders/TesselationControlShader.cpp', - 'CPlot/Shaders/TesselationEvaluationShader.cpp', - 'CPlot/Shaders/triggerShader.cpp', - 'CPlot/Shaders/FragmentShader.cpp', - 'CPlot/Shaders/VertexShader.cpp', - 'CPlot/Shaders/GeomShader.cpp', - 'CPlot/Shaders/ShaderObject.cpp', - 'CPlot/Shaders/Shader.cpp', - 'CPlot/Shaders/ShaderManager.cpp'] + 'CPlot/Shaders/TesselationShaderManager.cpp', + 'CPlot/Shaders/TesselationControlShader.cpp', + 'CPlot/Shaders/TesselationEvaluationShader.cpp', + 'CPlot/Shaders/triggerShader.cpp', + 'CPlot/Shaders/FragmentShader.cpp', + 'CPlot/Shaders/VertexShader.cpp', + 'CPlot/Shaders/GeomShader.cpp', + 'CPlot/Shaders/ShaderObject.cpp', + 'CPlot/Shaders/Shader.cpp', + 'CPlot/Shaders/ShaderManager.cpp'] #============================================================================== # Fichiers fortran diff --git a/Cassiopee/CPlot/test/addRender2PyTreePT_t1.py b/Cassiopee/CPlot/test/addRender2PyTreePT_t1.py index c1a295551..60cf48ce4 100644 --- a/Cassiopee/CPlot/test/addRender2PyTreePT_t1.py +++ b/Cassiopee/CPlot/test/addRender2PyTreePT_t1.py @@ -6,7 +6,7 @@ a = G.cart( (0,0,0), (1,1,1), (10,10,1) ) a = C.addBC2Zone(a,'wall','BCWall','imin') -a = C.initVars(a,'F',1.); a = C.initVars(a,'centers:G',2.) +a = C.initVars(a,'F',1.); a = C.initVars(a,'centers:G',2.) t = C.newPyTree(['Base', 2, a]) t = CPlot.addRender2PyTree(t, slot=0, posCam=(1,1,1), posEye=(10,1,1), mode='Solid', niso=10, isoScales=[0, 10, 0., 1.], diff --git a/Cassiopee/CPlot/test/addRender2ZonePT_t1.py b/Cassiopee/CPlot/test/addRender2ZonePT_t1.py index d953dd72d..3c40faabf 100644 --- a/Cassiopee/CPlot/test/addRender2ZonePT_t1.py +++ b/Cassiopee/CPlot/test/addRender2ZonePT_t1.py @@ -6,7 +6,7 @@ a = G.cart((0,0,0), (1,1,1), (10,10,1)) a = C.addBC2Zone(a,'wall','BCWall','imin') -C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) +C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) a = CPlot.addRender2Zone(a, material='Glass', color='Blue') t = C.newPyTree(['Base', 2, a]) test.testT(t, 1) diff --git a/Cassiopee/CPlot/test/changeBlanking.py b/Cassiopee/CPlot/test/changeBlanking.py index fe39c335a..919df1441 100644 --- a/Cassiopee/CPlot/test/changeBlanking.py +++ b/Cassiopee/CPlot/test/changeBlanking.py @@ -10,4 +10,3 @@ CPlot.changeBlanking(); time.sleep(2) CPlot.changeBlanking(); time.sleep(2) - diff --git a/Cassiopee/CPlot/test/createArrowPT.py b/Cassiopee/CPlot/test/createArrowPT.py index d7a305909..16baa567b 100644 --- a/Cassiopee/CPlot/test/createArrowPT.py +++ b/Cassiopee/CPlot/test/createArrowPT.py @@ -11,8 +11,8 @@ export=CPlot.decorator, offscreen=2, bgColor=1, - posCam=(16.493430100289256, 23.422964886666588, -13.69258647223435), - posEye=(4.5, 4.5, 4.5), + posCam=(16.493430100289256, 23.422964886666588, -13.69258647223435), + posEye=(4.5, 4.5, 4.5), dirCam=(0.7444990345982689, 0.1529242342484992, 0.6498733461696639),) CPlot.finalizeExport() diff --git a/Cassiopee/CPlot/test/createTextPT.py b/Cassiopee/CPlot/test/createTextPT.py index 61bd71422..08cc7dcb2 100644 --- a/Cassiopee/CPlot/test/createTextPT.py +++ b/Cassiopee/CPlot/test/createTextPT.py @@ -11,8 +11,8 @@ export=CPlot.decorator, offscreen=2, bgColor=1, - posCam=(16.493430100289256, 23.422964886666588, -13.69258647223435), - posEye=(4.5, 4.5, 4.5), + posCam=(16.493430100289256, 23.422964886666588, -13.69258647223435), + posEye=(4.5, 4.5, 4.5), dirCam=(0.7444990345982689, 0.1529242342484992, 0.6498733461696639),) CPlot.finalizeExport() diff --git a/Cassiopee/CPlot/test/display1D.py b/Cassiopee/CPlot/test/display1D.py index 41dce5a3d..ae6ddebf7 100755 --- a/Cassiopee/CPlot/test/display1D.py +++ b/Cassiopee/CPlot/test/display1D.py @@ -12,7 +12,7 @@ for i in range(100): B = C.initVars(B, '{f}=sin({x}+0.02*%d)'%i) B = C.initVars(B, '{g}={x}') - CPlot.display1D(B, slot=0, bgBlend=1., gridPos=(0,0), + CPlot.display1D(B, slot=0, bgBlend=1., gridPos=(0,0), var1='x', var2='f') # 1D data defined in numpys diff --git a/Cassiopee/CPlot/test/display1DPT.py b/Cassiopee/CPlot/test/display1DPT.py index 9cacb5f13..18a530c94 100755 --- a/Cassiopee/CPlot/test/display1DPT.py +++ b/Cassiopee/CPlot/test/display1DPT.py @@ -19,5 +19,3 @@ x = numpy.linspace(0, 2*numpy.pi) y = numpy.sin(x) CPlot.display1D([x,y], slot=1, var1='x', var2='y', gridPos=(0,1), bgBlend=0.8) - - diff --git a/Cassiopee/CPlot/test/display2.py b/Cassiopee/CPlot/test/display2.py index a77a71daf..db22d4cfe 100644 --- a/Cassiopee/CPlot/test/display2.py +++ b/Cassiopee/CPlot/test/display2.py @@ -118,4 +118,3 @@ def F(x): return x for j in range(28): C.setValue(a, i+j*18, (i,j,0.)) CPlot.display(a, mode=0); time.sleep(2) - diff --git a/Cassiopee/CPlot/test/display360sPT.py b/Cassiopee/CPlot/test/display360sPT.py index bed4772d8..4db9a0b1e 100644 --- a/Cassiopee/CPlot/test/display360sPT.py +++ b/Cassiopee/CPlot/test/display360sPT.py @@ -18,4 +18,4 @@ CPlot.display360(a, mode="Mesh", posCam=posCam, posEye=posEye, dirCam=dirCam, offscreen=offscreen, type360=0, stereo=1, stereoDist=0.1, - export='image360.png', exportResolution='4096x2048') + export='image360.png', exportResolution='4096x2048') diff --git a/Cassiopee/CPlot/test/displayHO.py b/Cassiopee/CPlot/test/displayHO.py index 1be58f53d..050d34605 100644 --- a/Cassiopee/CPlot/test/displayHO.py +++ b/Cassiopee/CPlot/test/displayHO.py @@ -107,7 +107,7 @@ t[2][7][2] += Internal.getZones(tsph13) for shader in ["Chrome","Glass", "Wood", 'Marble', 'XRay', 'Metal', 'Granite', 'Brick', 'Cloud', 'Gooch']: - s = CPlot.addRender2Zone(t, material=shader, color='White') + s = CPlot.addRender2Zone(t, material=shader, color='White') CPlot.display(s, mode="Render") l = '' while l != 'n': diff --git a/Cassiopee/CPlot/test/displayLegend.py b/Cassiopee/CPlot/test/displayLegend.py index cc68446ce..bb2538dbd 100644 --- a/Cassiopee/CPlot/test/displayLegend.py +++ b/Cassiopee/CPlot/test/displayLegend.py @@ -10,4 +10,3 @@ def F(x,y): return x*x + y*y CPlot.display(a, mode=3, scalarField=0, dim=2, displayIsoLegend=1) - diff --git a/Cassiopee/CPlot/test/displayOSMesa_m1.py b/Cassiopee/CPlot/test/displayOSMesa_m1.py index 37551fab1..3a4e50107 100644 --- a/Cassiopee/CPlot/test/displayOSMesa_m1.py +++ b/Cassiopee/CPlot/test/displayOSMesa_m1.py @@ -10,7 +10,7 @@ a = D.sphere((0,Cmpi.rank,0), 1, N=200) # posCam, posEye, dirCam are compulsary for parallel export (otherwise autofit) -CPlot.display(a, mode=1, solidStyle=1, offscreen=7, export=LOCAL+'/out.png', +CPlot.display(a, mode=1, solidStyle=1, offscreen=7, export=LOCAL+'/out.png', posCam=(-3,0,0), posEye=(0,0,0), dirCam=(0,0,1)) CPlot.finalizeExport(7) Cmpi.barrier() diff --git a/Cassiopee/CPlot/test/displayOSMesa_t2.py b/Cassiopee/CPlot/test/displayOSMesa_t2.py index d71e1af5c..3f3aa14a7 100644 --- a/Cassiopee/CPlot/test/displayOSMesa_t2.py +++ b/Cassiopee/CPlot/test/displayOSMesa_t2.py @@ -8,7 +8,7 @@ LOCAL = test.getLocal() -offscreen = 1 +offscreen = 1 def F(x): return x @@ -19,7 +19,7 @@ def F(x): return x a = C.initVars(a, 'p', F, ['x']) # mesh (mode 0) -CPlot.display([a], mode='mesh', posCam=(40,-2,15), posEye=(8,13,0), +CPlot.display([a], mode='mesh', posCam=(40,-2,15), posEye=(8,13,0), offscreen=offscreen, export=LOCAL+'/out.png') CPlot.finalizeExport(offscreen) test.testF(LOCAL+"/out.png", 1) @@ -42,7 +42,7 @@ def F(x): return x a = C.convertArray2Hexa(a) # mesh (mode 0) -CPlot.display([a], mode=0, posCam=(40,-2,15), posEye=(8,13,0), +CPlot.display([a], mode=0, posCam=(40,-2,15), posEye=(8,13,0), offscreen=offscreen, export=LOCAL+'/out.png') CPlot.finalizeExport(offscreen) test.testF(LOCAL+"/out.png", 4) @@ -62,7 +62,7 @@ def F(x): return x a = C.initVars(a, 'p', F, ['x']) # mesh (mode 0) -CPlot.display([a], mode=0, posCam=(40,-2,15), posEye=(8,13,0), +CPlot.display([a], mode=0, posCam=(40,-2,15), posEye=(8,13,0), offscreen=offscreen, export=LOCAL+'/out.png') CPlot.finalizeExport(offscreen) test.testF(LOCAL+"/out.png", 7) @@ -84,7 +84,7 @@ def F(x): return x a = C.convertArray2Tetra(a) # mesh (mode 0) -CPlot.display([a], mode=0, posCam=(40,-2,15), posEye=(8,13,0), +CPlot.display([a], mode=0, posCam=(40,-2,15), posEye=(8,13,0), offscreen=offscreen, export=LOCAL+'/out.png') CPlot.finalizeExport(offscreen) test.testF(LOCAL+"/out.png", 10) @@ -106,7 +106,7 @@ def F(x): return x a = C.convertArray2Hexa(a) # mesh (mode 0) -CPlot.display([a], mode=0, posCam=(40,-2,15), posEye=(8,13,0), +CPlot.display([a], mode=0, posCam=(40,-2,15), posEye=(8,13,0), offscreen=offscreen, export=LOCAL+'/out.png') CPlot.finalizeExport(offscreen) test.testF(LOCAL+"/out.png", 13) @@ -128,7 +128,7 @@ def F(x): return x a = C.convertArray2Tetra(a) # mesh (mode 0) -CPlot.display([a], mode=0, posCam=(40,-2,15), posEye=(8,13,0), +CPlot.display([a], mode=0, posCam=(40,-2,15), posEye=(8,13,0), offscreen=offscreen, export=LOCAL+'/out.png') CPlot.finalizeExport(offscreen) test.testF(LOCAL+"/out.png", 16) @@ -139,7 +139,7 @@ def F(x): return x test.testF(LOCAL+"/out.png", 17) # scalar field (mode 3) -CPlot.display([a], mode=3, scalarField=0, offscreen=offscreen, +CPlot.display([a], mode=3, scalarField=0, offscreen=offscreen, export=LOCAL+'/out.png') CPlot.finalizeExport(offscreen) test.testF(LOCAL+"/out.png", 18) @@ -151,7 +151,7 @@ def F(x): return x a = C.convertArray2Hexa(a) # mesh (mode 0) -CPlot.display(a, mode=0, posCam=(40,-2,15), posEye=(8,13,0), +CPlot.display(a, mode=0, posCam=(40,-2,15), posEye=(8,13,0), offscreen=offscreen, export=LOCAL+'/out.png') CPlot.finalizeExport(offscreen) test.testF(LOCAL+"/out.png", 19) diff --git a/Cassiopee/CPlot/test/displayOffScreen.py b/Cassiopee/CPlot/test/displayOffScreen.py index cf5d594ab..ea7430308 100644 --- a/Cassiopee/CPlot/test/displayOffScreen.py +++ b/Cassiopee/CPlot/test/displayOffScreen.py @@ -14,7 +14,7 @@ for i in range(50): a = T.rotate(a, (0,0,0), (0,0,1), 1.) CPlot.display(a, offscreen=1, bgColor=1, mode=1, meshStyle=2, - solidStyle=1, posCam=(0,6,0), + solidStyle=1, posCam=(0,6,0), exportResolution='680x600', export="export.mpeg") # free osmesa context (not compulsary) diff --git a/Cassiopee/CPlot/test/displayOffScreen2.py b/Cassiopee/CPlot/test/displayOffScreen2.py index c54acd968..894e434dc 100644 --- a/Cassiopee/CPlot/test/displayOffScreen2.py +++ b/Cassiopee/CPlot/test/displayOffScreen2.py @@ -13,7 +13,7 @@ for i in range(5): a = T.rotate(a, (0,0,0), (0,0,1), 1.) CPlot.display(a, offscreen=2, bgColor=1, mode=0, meshStyle=2, - solidStyle=1, posCam=(0,6,0), export='one%d.png'%i) + solidStyle=1, posCam=(0,6,0), export='one%d.png'%i) CPlot.finalizeExport(2) # wait for end of file write import os; os._exit(0) diff --git a/Cassiopee/CPlot/test/displayScalar.py b/Cassiopee/CPlot/test/displayScalar.py index d75defc69..7175eb9a5 100644 --- a/Cassiopee/CPlot/test/displayScalar.py +++ b/Cassiopee/CPlot/test/displayScalar.py @@ -1,4 +1,4 @@ -# - display (array) - +# - display (array) - # test scalar mode - import Converter as C import Generator as G diff --git a/Cassiopee/CPlot/test/export.py b/Cassiopee/CPlot/test/export.py index c01e7a682..80c9c38a6 100644 --- a/Cassiopee/CPlot/test/export.py +++ b/Cassiopee/CPlot/test/export.py @@ -10,7 +10,7 @@ CPlot.display(a, mode=0, export='export.ppm'); time.sleep(1) # Bitmap postscript CPlot.display(a, mode=0, export='export.ps'); time.sleep(1) -# PNG +# PNG CPlot.display(a, mode=0, export='export.png'); time.sleep(1) # MPEG for i in range(200): diff --git a/Cassiopee/CPlot/test/replace.py b/Cassiopee/CPlot/test/replace.py index bda01a324..7a21f1f80 100644 --- a/Cassiopee/CPlot/test/replace.py +++ b/Cassiopee/CPlot/test/replace.py @@ -10,4 +10,3 @@ for i in range(10): b = G.cart( (i,0,0), (1,1,1), (30,30,30) ) CPlot.replace(A, 0, b); CPlot.render(); time.sleep(0.1) - diff --git a/Cassiopee/CPlot/test/setDim.py b/Cassiopee/CPlot/test/setDim.py index 06e61d445..6ad2ff75d 100644 --- a/Cassiopee/CPlot/test/setDim.py +++ b/Cassiopee/CPlot/test/setDim.py @@ -6,4 +6,3 @@ a = G.cart( (0,0,0), (1,1,1), (5,5,1) ); t = [a] CPlot.display(t); time.sleep(2) CPlot.setDim(2); time.sleep(2) - diff --git a/Cassiopee/CPlot/test/setShaderPath.py b/Cassiopee/CPlot/test/setShaderPath.py index 545211913..eb584d967 100644 --- a/Cassiopee/CPlot/test/setShaderPath.py +++ b/Cassiopee/CPlot/test/setShaderPath.py @@ -1,4 +1,3 @@ # - setShaderPath (array) - import CPlot.cplot CPlot.cplot.setShaderPath('toto') - diff --git a/Cassiopee/CPlot/test/t1.py b/Cassiopee/CPlot/test/t1.py index ee23525ce..e9e36a9ad 100644 --- a/Cassiopee/CPlot/test/t1.py +++ b/Cassiopee/CPlot/test/t1.py @@ -1,3 +1,3 @@ # CPlot installation test import KCore.Dist as Dist -Dist.checkModuleImport('CPlot') +Dist.checkModuleImport('CPlot') diff --git a/Cassiopee/CPlot/test/tkPlotXYBatch.py b/Cassiopee/CPlot/test/tkPlotXYBatch.py index 8ca243e46..9160ddb05 100644 --- a/Cassiopee/CPlot/test/tkPlotXYBatch.py +++ b/Cassiopee/CPlot/test/tkPlotXYBatch.py @@ -12,9 +12,9 @@ desktop.setData(a) graph0 = desktop.createGraph('graph', '1:1') -curve0 = tkPlotXY.Curve(zone=['Base/cart'], varx='CoordinateX', - vary='F@FlowSolution', line_color='#7f00ff', - marker_face_color='#7f00ff', +curve0 = tkPlotXY.Curve(zone=['Base/cart'], varx='CoordinateX', + vary='F@FlowSolution', line_color='#7f00ff', + marker_face_color='#7f00ff', marker_edge_color='#7f00ff') graph0.addCurve('1:1', curve0) diff --git a/Cassiopee/CPlot/test/tkPlotXYInteractive.py b/Cassiopee/CPlot/test/tkPlotXYInteractive.py index 826252e47..4ff253dc6 100644 --- a/Cassiopee/CPlot/test/tkPlotXYInteractive.py +++ b/Cassiopee/CPlot/test/tkPlotXYInteractive.py @@ -12,9 +12,9 @@ graph0 = desktop.createGraph('graph', '1:1') # La localisation des champs dans Curve doit etre homogene -curve0 = tkPlotXY.Curve(zone=['Base/cart'], varx='CoordinateX', - vary='F@FlowSolution', line_color='#7f00ff', - marker_face_color='#7f00ff', +curve0 = tkPlotXY.Curve(zone=['Base/cart'], varx='CoordinateX', + vary='F@FlowSolution', line_color='#7f00ff', + marker_face_color='#7f00ff', marker_edge_color='#7f00ff', legend_label='expe0') graph0.addCurve('1:1', curve0) diff --git a/Cassiopee/CPlot/test/tkPlotXYSingleLine.py b/Cassiopee/CPlot/test/tkPlotXYSingleLine.py index bad39c154..99e7ca15c 100644 --- a/Cassiopee/CPlot/test/tkPlotXYSingleLine.py +++ b/Cassiopee/CPlot/test/tkPlotXYSingleLine.py @@ -11,7 +11,7 @@ C._initVars(b, '{F}={CoordinateX}*{CoordinateX}') C._initVars(b, '{centers:G}={centers:CoordinateX}') -tkPlotXY.plot([a,b], varx='CoordinateX', vary='centers:G', +tkPlotXY.plot([a,b], varx='CoordinateX', vary='centers:G', xlabel='x', xformat='03.1f', yformat='03.1f', legends=['courbe1', 'courbe2'], diff --git a/Cassiopee/CPlot/test/tkPlotXY_m1.py b/Cassiopee/CPlot/test/tkPlotXY_m1.py index 2d806b962..836750eef 100644 --- a/Cassiopee/CPlot/test/tkPlotXY_m1.py +++ b/Cassiopee/CPlot/test/tkPlotXY_m1.py @@ -17,10 +17,10 @@ C._initVars(a, '{F}={CoordinateX}*{CoordinateX}') C._initVars(a, '{centers:G}={centers:CoordinateX}') else: - a = None + a = None -tkPlotXY.plot([a], varx='CoordinateX', vary='centers:G', - xlabel='x', +tkPlotXY.plot([a], varx='CoordinateX', vary='centers:G', + xlabel='x', xformat='03.1f', yformat='03.1f', legends=['no1', 'no2'], xFontSize=11, diff --git a/Cassiopee/CPlot/test/travel.py b/Cassiopee/CPlot/test/travel.py index 35a912a98..7e03e5a7f 100644 --- a/Cassiopee/CPlot/test/travel.py +++ b/Cassiopee/CPlot/test/travel.py @@ -23,4 +23,3 @@ elif i < 400: CPlot.travelRight(0.001, N=3) elif i < 600: CPlot.travelUp(0.001, N=3) elif i < 800: CPlot.travelIn(0.001, N=3) - diff --git a/Cassiopee/CPlot/test/travelPT.py b/Cassiopee/CPlot/test/travelPT.py index a21a2c1ec..3a6bfa4e2 100644 --- a/Cassiopee/CPlot/test/travelPT.py +++ b/Cassiopee/CPlot/test/travelPT.py @@ -22,4 +22,3 @@ elif i < 400: CPlot.travelRight(0.001, N=3) elif i < 600: CPlot.travelUp(0.001, N=3) elif i < 800: CPlot.travelIn(0.001, N=3) - diff --git a/Cassiopee/Compressor/Compressor/Compressor.py b/Cassiopee/Compressor/Compressor/Compressor.py index fb01a0011..649506268 100644 --- a/Cassiopee/Compressor/Compressor/Compressor.py +++ b/Cassiopee/Compressor/Compressor/Compressor.py @@ -7,7 +7,7 @@ import numpy import Converter.Internal as Internal try: import cPickle as pickle # best for now -except: import pickle +except: import pickle #============================================================================== # deltaIndex @@ -54,5 +54,3 @@ def unpack(a, method=0): return pickle.loads(zlib.decompress(a)) else: return pickle.loads(a) - - diff --git a/Cassiopee/Compressor/Compressor/PyTree.py b/Cassiopee/Compressor/Compressor/PyTree.py index 1ecdf65be..f9650e2dd 100644 --- a/Cassiopee/Compressor/Compressor/PyTree.py +++ b/Cassiopee/Compressor/Compressor/PyTree.py @@ -117,7 +117,7 @@ def writeUnsteadyCoefs(iteration, indices, filename, loc, format="b"): # # if layers not None, only communicate the desired number of layers # bboxDict is dict with the zones of t as keys and their specific bboxes as key values, used when layers not None -# if subr, the tree subregions are kept during the exchange +# if subr, the tree subregions are kept during the exchange def compressCartesian(t, bbox=[], layers=None, subr=True, tol=1.e-10): """For Cartesian grids, replace Grid Coordinates with a compressed node.""" tp = Internal.copyRef(t) @@ -195,23 +195,23 @@ def _compressCartesian__(z, ztype, gc, tol=1.e-10): elif nk > 2: hk = zp[2*ni*nj]-zp[ni*nj] elif nk > 1: hk = zp[ni*nj]-z0 else: hk = 1. - if nk > 1: + if nk > 1: if abs(zp[ni*nj] - zp[0] - hk) > tol: cartesian = False if abs(xp[ni*nj] - x0) > tol: cartesian = False if abs(yp[ni*nj] - y0) > tol: cartesian = False - if nk > 2: + if nk > 2: if abs(zp[2*ni*nj] - zp[ni*nj] - hk) > tol: cartesian = False if abs(xp[ni*nj] - x0) > tol: cartesian = False if abs(yp[ni*nj] - y0) > tol: cartesian = False - if nk > 3: + if nk > 3: if abs(zp[3*ni*nj] - zp[2*ni*nj] - hk) > tol: cartesian = False if abs(xp[2*ni*nj] - x0) > tol: cartesian = False if abs(yp[2*ni*nj] - y0) > tol: cartesian = False - if nk > 4: + if nk > 4: if abs(zp[4*ni*nj] - zp[3*ni*nj] - hk) > tol: cartesian = False if abs(xp[3*ni*nj] - x0) > tol: cartesian = False if abs(yp[3*ni*nj] - y0) > tol: cartesian = False - if nk > 5: + if nk > 5: if abs(zp[5*ni*nj] - zp[4*ni*nj] - hk) > tol: cartesian = False if abs(xp[4*ni*nj] - x0) > tol: cartesian = False if abs(yp[4*ni*nj] - y0) > tol: cartesian = False @@ -461,7 +461,7 @@ def _compressCoords(t, tol=1.e-8, ctype=0): fields = [] for c in GC: fields += Internal.getNodesFromType1(c, 'DataArray_t') for f in fields: - if Internal.getNodeFromName1(f, 'ZData') is None: + if Internal.getNodeFromName1(f, 'ZData') is None: _packNode(f, tol, ctype) return None @@ -488,10 +488,10 @@ def _compressFields(t, tol=1.e-8, ctype=0, varNames=None): for v in varNames: varname = v.split(':', 1) container = Internal.__FlowSolutionNodes__ - if len(varname) == 2 and varname[0] == 'centers': + if len(varname) == 2 and varname[0] == 'centers': container = Internal.__FlowSolutionCenters__ varname = varname[1] - elif len(varname) == 2 and varname[0] == 'nodes': + elif len(varname) == 2 and varname[0] == 'nodes': varname = varname[1] else: varname = v FS = Internal.getNodeFromName1(z, container) @@ -522,7 +522,7 @@ def _compressCellN(t, varNames=['cellN']): return None def compressCellN(t, varNames=['cellN']): - """Compress cellN (0,1,2) lossless on 2 bits.""" + """Compress cellN (0,1,2) lossless on 2 bits.""" tp = Internal.copyRef(t) _compressCellN(tp, varNames) return tp @@ -538,14 +538,14 @@ def _compressElements(t): if eltno == 22 or eltno == 23: # NGON n = Internal.getNodeFromName1(e, 'ElementConnectivity') _packNode(n, 0, 4) - else: + else: (stype, net) = Internal.eltNo2EltName(eltno) n = Internal.getNodeFromName1(e, 'ElementConnectivity') _packNode(n, net, 3) return None def compressElements(t): - """Compress lossless Element connectivity.""" + """Compress lossless Element connectivity.""" tp = Internal.copyRef(t) _compressElements(tp) return tp @@ -559,7 +559,7 @@ def _uncompressAll(t): GC = Internal.getNodesFromType1(z, 'GridCoordinates_t') FS = Internal.getNodesFromType1(z, 'FlowSolution_t') fields = [] - for c in GC+FS: + for c in GC+FS: fields += Internal.getNodesFromType1(c, 'DataArray_t') for f in fields: _unpackNode(f) diff --git a/Cassiopee/Compressor/doc/source/conf.py b/Cassiopee/Compressor/doc/source/conf.py index 2c1278040..c080ebfe8 100644 --- a/Cassiopee/Compressor/doc/source/conf.py +++ b/Cassiopee/Compressor/doc/source/conf.py @@ -202,15 +202,15 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', -'preamble': r''' + # Additional stuff for the LaTeX preamble. + #'preamble': '', + 'preamble': r''' \usepackage{charter} \usepackage[defaultsans]{lato} \usepackage{inconsolata} @@ -221,8 +221,8 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('Compressor', 'Compressor.tex', u'Compressor Documentation', - u'/ELSA/MU-14010/V'+__version__, 'manual'), + ('Compressor', 'Compressor.tex', u'Compressor Documentation', + u'/ELSA/MU-14010/V'+__version__, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -265,9 +265,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Compressor', u'Compressor Documentation', - u'ONERA', 'Compressor', 'One line description of project.', - 'Miscellaneous'), + ('index', 'Compressor', u'Compressor Documentation', + u'ONERA', 'Compressor', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/Compressor/setup.py b/Cassiopee/Compressor/setup.py index 85606c2c9..4f61dfe10 100644 --- a/Cassiopee/Compressor/setup.py +++ b/Cassiopee/Compressor/setup.py @@ -46,22 +46,22 @@ else: additionalLibs += ["z"] extensions += [ - Extension('Compressor.sz.csz', - sources=["Compressor/sz/compressor.cpp"], - include_dirs=["Compressor", "Compressor/sz/include"]+additionalIncludePaths+[numpyIncDir, kcoreIncDir], - library_dirs=additionalLibPaths+libraryDirs, - libraries=libraries+["ksz", "kzstd"]+additionalLibs, - extra_compile_args=Dist.getCppArgs(), - extra_link_args=Dist.getLinkArgs())] + Extension('Compressor.sz.csz', + sources=["Compressor/sz/compressor.cpp"], + include_dirs=["Compressor", "Compressor/sz/include"]+additionalIncludePaths+[numpyIncDir, kcoreIncDir], + library_dirs=additionalLibPaths+libraryDirs, + libraries=libraries+["ksz", "kzstd"]+additionalLibs, + extra_compile_args=Dist.getCppArgs(), + extra_link_args=Dist.getLinkArgs())] if srcs.ZFP: extensions += [ - Extension('Compressor.zfp.czfp', - sources=["Compressor/zfp/compressor.cpp"], - include_dirs=["Compressor", "Compressor/zfp/include"]+additionalIncludePaths+[numpyIncDir, kcoreIncDir], - library_dirs=additionalLibPaths+libraryDirs, - libraries=libraries+["kzfp"]+additionalLibs, - extra_compile_args=Dist.getCppArgs(), - extra_link_args=Dist.getLinkArgs())] + Extension('Compressor.zfp.czfp', + sources=["Compressor/zfp/compressor.cpp"], + include_dirs=["Compressor", "Compressor/zfp/include"]+additionalIncludePaths+[numpyIncDir, kcoreIncDir], + library_dirs=additionalLibPaths+libraryDirs, + libraries=libraries+["kzfp"]+additionalLibs, + extra_compile_args=Dist.getCppArgs(), + extra_link_args=Dist.getLinkArgs())] # Setup ====================================================================== setup( @@ -73,7 +73,7 @@ package_dir={"":"."}, packages=['Compressor', 'Compressor.sz', 'Compressor.zfp'], ext_modules=extensions - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Compressor/setupLegacy.py b/Cassiopee/Compressor/setupLegacy.py index f1fae3999..323838a65 100644 --- a/Cassiopee/Compressor/setupLegacy.py +++ b/Cassiopee/Compressor/setupLegacy.py @@ -43,15 +43,15 @@ # library_dirs=additionalLibPaths+libraryDirs, # libraries=libraries+["SZ",]+additionalLibs, # extra_compile_args=Dist.getCppArgs(), - # extra_link_args=Dist.getLinkArgs()), + # extra_link_args=Dist.getLinkArgs()), #Extension('Compressor.zfp.czfp', # sources=["Compressor/zfp/compressor.cpp"], # include_dirs=["Compressor"]+additionalIncludePaths+[numpyIncDir, kcoreIncDir], # library_dirs=additionalLibPaths+libraryDirs, # libraries=libraries+["zfp",]+additionalLibs, # extra_compile_args=Dist.getCppArgs(), - # extra_link_args=Dist.getLinkArgs()), - ] + # extra_link_args=Dist.getLinkArgs()), +] # Setup ====================================================================== setup( @@ -63,7 +63,7 @@ #packages=['Compressor', 'Compressor.zfp', 'Compressor.sz'], packages=['Compressor'], ext_modules=extensions - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Compressor/srcs.py b/Cassiopee/Compressor/srcs.py index 439014ea7..dcd3dae6b 100644 --- a/Cassiopee/Compressor/srcs.py +++ b/Cassiopee/Compressor/srcs.py @@ -15,141 +15,141 @@ if ZSTD: zstd_srcs = ["Compressor/zstd/common/debug.c", - "Compressor/zstd/common/entropy_common.c", - "Compressor/zstd/common/error_private.c", - "Compressor/zstd/common/fse_decompress.c", - "Compressor/zstd/common/pool.c", - "Compressor/zstd/common/threading.c", - "Compressor/zstd/common/xxhash.c", - "Compressor/zstd/common/zstd_common.c", - "Compressor/zstd/common/error_private.c", - "Compressor/zstd/common/fse_decompress.c", - "Compressor/zstd/common/pool.c", - "Compressor/zstd/common/threading.c", - "Compressor/zstd/common/xxhash.c", - "Compressor/zstd/common/zstd_common.c", - "Compressor/zstd/dictBuilder/cover.c", - "Compressor/zstd/dictBuilder/divsufsort.c", - "Compressor/zstd/dictBuilder/zdict.c", - "Compressor/zstd/decompress/huf_decompress.c", - "Compressor/zstd/decompress/zstd_decompress.c", - "Compressor/zstd/compress/fse_compress.c", - "Compressor/zstd/compress/huf_compress.c", - "Compressor/zstd/compress/zstd_double_fast.c", - "Compressor/zstd/compress/zstd_lazy.c", - "Compressor/zstd/compress/zstd_opt.c", - "Compressor/zstd/compress/hist.c", - "Compressor/zstd/compress/zstd_compress.c", - "Compressor/zstd/compress/zstd_fast.c", - "Compressor/zstd/compress/zstd_ldm.c", - "Compressor/zstd/compress/zstdmt_compress.c", - "Compressor/zstd/legacy/zstd_v01.c", - "Compressor/zstd/legacy/zstd_v02.c", - "Compressor/zstd/legacy/zstd_v03.c", - "Compressor/zstd/legacy/zstd_v04.c", - "Compressor/zstd/legacy/zstd_v05.c", - "Compressor/zstd/legacy/zstd_v06.c", - "Compressor/zstd/legacy/zstd_v07.c" - ] + "Compressor/zstd/common/entropy_common.c", + "Compressor/zstd/common/error_private.c", + "Compressor/zstd/common/fse_decompress.c", + "Compressor/zstd/common/pool.c", + "Compressor/zstd/common/threading.c", + "Compressor/zstd/common/xxhash.c", + "Compressor/zstd/common/zstd_common.c", + "Compressor/zstd/common/error_private.c", + "Compressor/zstd/common/fse_decompress.c", + "Compressor/zstd/common/pool.c", + "Compressor/zstd/common/threading.c", + "Compressor/zstd/common/xxhash.c", + "Compressor/zstd/common/zstd_common.c", + "Compressor/zstd/dictBuilder/cover.c", + "Compressor/zstd/dictBuilder/divsufsort.c", + "Compressor/zstd/dictBuilder/zdict.c", + "Compressor/zstd/decompress/huf_decompress.c", + "Compressor/zstd/decompress/zstd_decompress.c", + "Compressor/zstd/compress/fse_compress.c", + "Compressor/zstd/compress/huf_compress.c", + "Compressor/zstd/compress/zstd_double_fast.c", + "Compressor/zstd/compress/zstd_lazy.c", + "Compressor/zstd/compress/zstd_opt.c", + "Compressor/zstd/compress/hist.c", + "Compressor/zstd/compress/zstd_compress.c", + "Compressor/zstd/compress/zstd_fast.c", + "Compressor/zstd/compress/zstd_ldm.c", + "Compressor/zstd/compress/zstdmt_compress.c", + "Compressor/zstd/legacy/zstd_v01.c", + "Compressor/zstd/legacy/zstd_v02.c", + "Compressor/zstd/legacy/zstd_v03.c", + "Compressor/zstd/legacy/zstd_v04.c", + "Compressor/zstd/legacy/zstd_v05.c", + "Compressor/zstd/legacy/zstd_v06.c", + "Compressor/zstd/legacy/zstd_v07.c" + ] else: zstd_srcs = [] if SZ: sz_srcs = ["Compressor/sz/src/ArithmeticCoding.c", - "Compressor/sz/src/exafelSZ.c", - "Compressor/sz/src/sz_float.c", - "Compressor/sz/src/szd_double.c", - "Compressor/sz/src/szd_uint64.c", - "Compressor/sz/src/ByteToolkit.c", - "Compressor/sz/src/Huffman.c", - "Compressor/sz/src/sz_float_pwr.c", - "Compressor/sz/src/szd_double_pwr.c", - "Compressor/sz/src/szd_uint8.c", - "Compressor/sz/src/CacheTable.c", - "Compressor/sz/src/iniparser.c", - "Compressor/sz/src/sz_float_ts.c", - "Compressor/sz/src/szd_double_ts.c", - "Compressor/sz/src/szf.c", - "Compressor/sz/src/callZlib.c", - "Compressor/sz/src/MultiLevelCacheTable.c", - "Compressor/sz/src/sz_int16.c", - "Compressor/sz/src/szd_float.c", - "Compressor/sz/src/TightDataPointStorageD.c", - "Compressor/sz/src/CompressElement.c", - "Compressor/sz/src/MultiLevelCacheTableWideInterval.c", - "Compressor/sz/src/sz_int32.c", - "Compressor/sz/src/szd_float_pwr.c", - "Compressor/sz/src/TightDataPointStorageF.c", - "Compressor/sz/src/conf.c", - "Compressor/sz/src/pastri.c", - "Compressor/sz/src/sz_int64.c", - "Compressor/sz/src/szd_float_ts.c", - "Compressor/sz/src/TightDataPointStorageI.c", - "Compressor/sz/src/dataCompression.c", - "Compressor/sz/src/rw.c", - "Compressor/sz/src/sz_int8.c", - "Compressor/sz/src/szd_int16.c", - "Compressor/sz/src/TypeManager.c", - "Compressor/sz/src/dictionary.c", - "Compressor/sz/src/rwf.c", - "Compressor/sz/src/sz_omp.c", - "Compressor/sz/src/szd_int32.c", - "Compressor/sz/src/utility.c", - "Compressor/sz/src/DynamicByteArray.c", - "Compressor/sz/src/sz.c", - "Compressor/sz/src/sz_uint16.c", - "Compressor/sz/src/szd_int64.c", - "Compressor/sz/src/VarSet.c", - "Compressor/sz/src/DynamicDoubleArray.c", - "Compressor/sz/src/sz_double.c", - "Compressor/sz/src/sz_uint32.c", - "Compressor/sz/src/szd_int8.c", - "Compressor/sz/src/DynamicFloatArray.c", - "Compressor/sz/src/sz_double_pwr.c", - "Compressor/sz/src/sz_uint64.c", - "Compressor/sz/src/szd_uint16.c", - "Compressor/sz/src/DynamicIntArray.c", - "Compressor/sz/src/sz_double_ts.c", - "Compressor/sz/src/sz_uint8.c", - "Compressor/sz/src/szd_uint32.c" - ] + "Compressor/sz/src/exafelSZ.c", + "Compressor/sz/src/sz_float.c", + "Compressor/sz/src/szd_double.c", + "Compressor/sz/src/szd_uint64.c", + "Compressor/sz/src/ByteToolkit.c", + "Compressor/sz/src/Huffman.c", + "Compressor/sz/src/sz_float_pwr.c", + "Compressor/sz/src/szd_double_pwr.c", + "Compressor/sz/src/szd_uint8.c", + "Compressor/sz/src/CacheTable.c", + "Compressor/sz/src/iniparser.c", + "Compressor/sz/src/sz_float_ts.c", + "Compressor/sz/src/szd_double_ts.c", + "Compressor/sz/src/szf.c", + "Compressor/sz/src/callZlib.c", + "Compressor/sz/src/MultiLevelCacheTable.c", + "Compressor/sz/src/sz_int16.c", + "Compressor/sz/src/szd_float.c", + "Compressor/sz/src/TightDataPointStorageD.c", + "Compressor/sz/src/CompressElement.c", + "Compressor/sz/src/MultiLevelCacheTableWideInterval.c", + "Compressor/sz/src/sz_int32.c", + "Compressor/sz/src/szd_float_pwr.c", + "Compressor/sz/src/TightDataPointStorageF.c", + "Compressor/sz/src/conf.c", + "Compressor/sz/src/pastri.c", + "Compressor/sz/src/sz_int64.c", + "Compressor/sz/src/szd_float_ts.c", + "Compressor/sz/src/TightDataPointStorageI.c", + "Compressor/sz/src/dataCompression.c", + "Compressor/sz/src/rw.c", + "Compressor/sz/src/sz_int8.c", + "Compressor/sz/src/szd_int16.c", + "Compressor/sz/src/TypeManager.c", + "Compressor/sz/src/dictionary.c", + "Compressor/sz/src/rwf.c", + "Compressor/sz/src/sz_omp.c", + "Compressor/sz/src/szd_int32.c", + "Compressor/sz/src/utility.c", + "Compressor/sz/src/DynamicByteArray.c", + "Compressor/sz/src/sz.c", + "Compressor/sz/src/sz_uint16.c", + "Compressor/sz/src/szd_int64.c", + "Compressor/sz/src/VarSet.c", + "Compressor/sz/src/DynamicDoubleArray.c", + "Compressor/sz/src/sz_double.c", + "Compressor/sz/src/sz_uint32.c", + "Compressor/sz/src/szd_int8.c", + "Compressor/sz/src/DynamicFloatArray.c", + "Compressor/sz/src/sz_double_pwr.c", + "Compressor/sz/src/sz_uint64.c", + "Compressor/sz/src/szd_uint16.c", + "Compressor/sz/src/DynamicIntArray.c", + "Compressor/sz/src/sz_double_ts.c", + "Compressor/sz/src/sz_uint8.c", + "Compressor/sz/src/szd_uint32.c" + ] else: sz_srcs = [] if ZFP: zfp_srcs = ["Compressor/zfp/src/bitstream.c", - "Compressor/zfp/src/decode1l.c", - "Compressor/zfp/src/decode2l.c", - "Compressor/zfp/src/decode3l.c", - "Compressor/zfp/src/decode4l.c", - "Compressor/zfp/src/encode1l.c", - "Compressor/zfp/src/encode2l.c", - "Compressor/zfp/src/encode3l.c", - "Compressor/zfp/src/encode4l.c", - "Compressor/zfp/src/decode1d.c", - "Compressor/zfp/src/decode2d.c", - "Compressor/zfp/src/decode3d.c", - "Compressor/zfp/src/decode4d.c", - "Compressor/zfp/src/encode1d.c", - "Compressor/zfp/src/encode2d.c", - "Compressor/zfp/src/encode3d.c", - "Compressor/zfp/src/encode4d.c", - "Compressor/zfp/src/zfp.c", - "Compressor/zfp/src/decode1f.c", - "Compressor/zfp/src/decode2f.c", - "Compressor/zfp/src/decode3f.c", - "Compressor/zfp/src/decode4f.c", - "Compressor/zfp/src/encode1f.c", - "Compressor/zfp/src/encode2f.c", - "Compressor/zfp/src/encode3f.c", - "Compressor/zfp/src/encode4f.c", - "Compressor/zfp/src/decode1i.c", - "Compressor/zfp/src/decode2i.c", - "Compressor/zfp/src/decode3i.c", - "Compressor/zfp/src/decode4i.c", - "Compressor/zfp/src/encode1i.c", - "Compressor/zfp/src/encode2i.c", - "Compressor/zfp/src/encode3i.c", - "Compressor/zfp/src/encode4i.c" - ] + "Compressor/zfp/src/decode1l.c", + "Compressor/zfp/src/decode2l.c", + "Compressor/zfp/src/decode3l.c", + "Compressor/zfp/src/decode4l.c", + "Compressor/zfp/src/encode1l.c", + "Compressor/zfp/src/encode2l.c", + "Compressor/zfp/src/encode3l.c", + "Compressor/zfp/src/encode4l.c", + "Compressor/zfp/src/decode1d.c", + "Compressor/zfp/src/decode2d.c", + "Compressor/zfp/src/decode3d.c", + "Compressor/zfp/src/decode4d.c", + "Compressor/zfp/src/encode1d.c", + "Compressor/zfp/src/encode2d.c", + "Compressor/zfp/src/encode3d.c", + "Compressor/zfp/src/encode4d.c", + "Compressor/zfp/src/zfp.c", + "Compressor/zfp/src/decode1f.c", + "Compressor/zfp/src/decode2f.c", + "Compressor/zfp/src/decode3f.c", + "Compressor/zfp/src/decode4f.c", + "Compressor/zfp/src/encode1f.c", + "Compressor/zfp/src/encode2f.c", + "Compressor/zfp/src/encode3f.c", + "Compressor/zfp/src/encode4f.c", + "Compressor/zfp/src/decode1i.c", + "Compressor/zfp/src/decode2i.c", + "Compressor/zfp/src/decode3i.c", + "Compressor/zfp/src/decode4i.c", + "Compressor/zfp/src/encode1i.c", + "Compressor/zfp/src/encode2i.c", + "Compressor/zfp/src/encode3i.c", + "Compressor/zfp/src/encode4i.c" + ] else: zfp_srcs = [] #============================================================================== # Fichiers fortran diff --git a/Cassiopee/Compressor/test/t1.py b/Cassiopee/Compressor/test/t1.py index 25e81100a..596dc2b43 100644 --- a/Cassiopee/Compressor/test/t1.py +++ b/Cassiopee/Compressor/test/t1.py @@ -1,3 +1,3 @@ # Compressor installation test import KCore.Dist as Dist -Dist.checkModuleImport('Compressor') +Dist.checkModuleImport('Compressor') diff --git a/Cassiopee/Connector/Connector/Connector.py b/Cassiopee/Connector/Connector/Connector.py index fae9bbb30..7ce6c99b0 100644 --- a/Cassiopee/Connector/Connector/Connector.py +++ b/Cassiopee/Connector/Connector/Connector.py @@ -8,11 +8,11 @@ try: range = xrange except: pass -__all__ = ['blankCells', '_blankCells', 'blankCellsTetra', 'blankCellsTri', 'blankIntersectingCells', 'chimeraTransfer', 'connectMatch', - 'getIntersectingDomainsAABB', 'maximizeBlankedCells', 'optimizeOverlap', 'setDoublyDefinedBC', 'setHoleInterpolatedPoints', - 'setIBCTransfers', 'setIBCTransfersD', 'setInterpTransfers', 'setInterpTransfersD', 'writeCoefs','maskXRay__', - '_applyBCOverlapsStruct__', 'applyBCOverlapsStruct__', 'applyBCOverlapsNG__', - 'getInterpolatedPoints__', 'getEXPoints__', '_modCellN1', '_modCellN2', 'changeWall__'] +__all__ = ['blankCells', '_blankCells', 'blankCellsTetra', 'blankCellsTri', 'blankIntersectingCells', 'chimeraTransfer', 'connectMatch', + 'getIntersectingDomainsAABB', 'maximizeBlankedCells', 'optimizeOverlap', 'setDoublyDefinedBC', 'setHoleInterpolatedPoints', + 'setIBCTransfers', 'setIBCTransfersD', 'setInterpTransfers', 'setInterpTransfersD', 'writeCoefs','maskXRay__', + '_applyBCOverlapsStruct__', 'applyBCOverlapsStruct__', 'applyBCOverlapsNG__', + 'getInterpolatedPoints__', 'getEXPoints__', '_modCellN1', '_modCellN2', 'changeWall__'] #=============================================================================== def connectMatch(a1, a2, sameZone=0, tol=1.e-6, dim=3): @@ -38,7 +38,7 @@ def connectMatch(a1, a2, sameZone=0, tol=1.e-6, dim=3): elif win1 == 3: jmax1 = 1 elif win1 == 4: jmin1 = jmax1 elif win1 == 5: kmax1 = 1 - elif win1 == 6: kmin1 = kmax1 + elif win1 == 6: kmin1 = kmax1 win = T.subzone(a1,(imin1,jmin1,kmin1),(imax1,jmax1,kmax1)) if win1 == 1 or win1 == 2: win = T.reorder(win,(3,1,2)) elif win1 == 3 or win1 == 4: win = T.reorder(win,(1,3,2)) @@ -47,13 +47,13 @@ def connectMatch(a1, a2, sameZone=0, tol=1.e-6, dim=3): typeOfWins.append(win1) if sameZone == 0: for win2 in range(1, nwins): - imin2 = 1; jmin2 = 1; kmin2 = 1; imax2 = a2[2]; jmax2 = a2[3]; kmax2 = a2[4] + imin2 = 1; jmin2 = 1; kmin2 = 1; imax2 = a2[2]; jmax2 = a2[3]; kmax2 = a2[4] if win2 == 1: imax2 = 1 elif win2 == 2: imin2 = imax2 elif win2 == 3: jmax2 = 1 elif win2 == 4: jmin2 = jmax2 elif win2 == 5: kmax2 = 1 - elif win2 == 6: kmin2 = kmax2 + elif win2 == 6: kmin2 = kmax2 win = T.subzone(a2,(imin2,jmin2,kmin2),(imax2,jmax2,kmax2)) if win2 == 1 or win2 == 2: win = T.reorder(win,(3,1,2)) elif win2 == 3 or win2 == 4: win = T.reorder(win,(1,3,2)) @@ -98,22 +98,22 @@ def identifyDegenerated(A, tol=1.e-6): #=============================================================================== # Retourne [ [[noz1,noz2],[imin1,imax1,...],[imin2,imax2,...],trirac] ] -def gatherMatching(listOfWins, listOfTags, typeOfWins, blkOfWins, +def gatherMatching(listOfWins, listOfTags, typeOfWins, blkOfWins, allNI, allNJ, allNK, dim=3, tol=1.e-6): - return connector.gatherMatching(listOfWins, listOfTags, typeOfWins, + return connector.gatherMatching(listOfWins, listOfTags, typeOfWins, blkOfWins, allNI, allNJ, allNK, dim, tol) -def gatherMatchingNM(listOfWins, listOfTags, typeOfWins, blkOfWins, +def gatherMatchingNM(listOfWins, listOfTags, typeOfWins, blkOfWins, allNI, allNJ, allNK, dim=3, tol=1.e-6): - return connector.gatherMatchingNM(listOfWins, listOfTags, typeOfWins, + return connector.gatherMatchingNM(listOfWins, listOfTags, typeOfWins, blkOfWins, allNI, allNJ, allNK, dim, tol) def gatherMatchingNGon__(tagsF, allExtIndices): return connector.gatherMatchingNGon(tagsF, allExtIndices) -def gatherDegenerated(listOfTags, typeOfWins, blkOfWins, +def gatherDegenerated(listOfTags, typeOfWins, blkOfWins, allNI, allNJ, allNK, dim=3): - return connector.gatherDegenerated(listOfTags, typeOfWins, blkOfWins, + return connector.gatherDegenerated(listOfTags, typeOfWins, blkOfWins, allNI, allNJ, allNK, dim) #------------------------------------------------------------------------------ # Verifie si les deux windows en raccord match ont des normales opposees @@ -151,15 +151,15 @@ def optimizeOverlap(nodes1, centers1, nodes2, centers2, prio1=0, prio2=0, isDW=0 if posv2 == -1: res[1] = C.rmVars(res[1],'vol') return res -def optimizeOverlap__(extCenters1, centers1, extCenters2, centers2, +def optimizeOverlap__(extCenters1, centers1, extCenters2, centers2, prio1=0, prio2=0, isDW=0, hook1=None, hook2=None): - return connector.optimizeOverlap(extCenters1, centers1, extCenters2, + return connector.optimizeOverlap(extCenters1, centers1, extCenters2, centers2, prio1, prio2, isDW, hook1, hook2) #------------------------------------------------------------------------------ def maximizeBlankedCells(a, depth=2, dir=1, cellNName='cellN'): """Maximize the blanked region.""" - if isinstance(a[0], list): + if isinstance(a[0], list): b = [] for i in a: b.append(connector.maximizeBlankedCells(i, depth, dir, cellNName)) @@ -183,14 +183,14 @@ def _setHoleInterpolatedPoints(cellN, depth=2, dir=0, cellNName='cellN'): Converter._initVars(cellN,'{%s} = 1-{%s}+({%s}>1.5)*3'%(cellNName, cellNName, cellNName)) _getOversetHolesInterpNodes__(cellN, -depth, dir, cellNName) Converter._initVars(cellN,'{%s} = 1-{%s}+({%s}>1.5)*3'%(cellNName, cellNName, cellNName)) - else: + else: _getOversetHolesInterpNodes__(cellN, depth, dir, cellNName) else: # non structure avec champ celln en centres if depth < 0: Converter._initVars(cellN,'{%s} = 1-{%s}+({%s}>1.5)*3'%(cellNName, cellNName, cellNName)) _getOversetHolesInterpCellCenters__(cellN, -depth, dir, cellNName) Converter._initVars(cellN,'{%s} = 1-{%s}+({%s}>1.5)*3'%(cellNName, cellNName, cellNName)) - else: + else: _getOversetHolesInterpCellCenters__(cellN, depth, dir, cellNName) return None @@ -204,18 +204,18 @@ def setHoleInterpolatedPoints(celln, depth=2, dir=0, cellNName='cellN'): if celln[3][-1]=='*': loc = 'centers' if loc == 'nodes': if depth < 0: - celln = Converter.initVars(celln, + celln = Converter.initVars(celln, '{%s} = 1-{%s}+({%s}>1.5)*3'%(cellNName, cellNName, cellNName)) celln = getOversetHolesInterpNodes__(celln, -depth, dir, cellNName) - celln = Converter.initVars(celln, + celln = Converter.initVars(celln, '{%s} = 1-{%s}+({%s}>1.5)*3'%(cellNName, cellNName, cellNName)) else: celln = getOversetHolesInterpNodes__(celln, depth, dir, cellNName) else: # non structure avec champ celln en centres if depth < 0: - celln = Converter.initVars(celln, + celln = Converter.initVars(celln, '{%s} = 1-{%s}+({%s}>1.5)*3'%(cellNName, cellNName, cellNName)) celln = getOversetHolesInterpCellCenters__(celln, -depth, dir, cellNName) - celln = Converter.initVars(celln, + celln = Converter.initVars(celln, '{%s} = 1-{%s}+({%s}>1.5)*3'%(cellNName, cellNName, cellNName)) else: celln = getOversetHolesInterpCellCenters__(celln, depth, dir, cellNName) return celln @@ -241,11 +241,11 @@ def blankCells(coords, cellnfields, body, blankingType=1, \ z = C.convertArray2Tetra(z) bodyt.append(z) if blankingType == 2: # center_in: simplement un node_in sur les centres - coords = C.node2Center(coords); blankingType = 0 + coords = C.node2Center(coords); blankingType = 0 return connector.blankCells(coords, cellnfields, bodyt, blankingType, \ delta, dim, masknot, tol, XRaydim1, XRaydim2, cellNName) #------------------------------------------------------------------------------ -# in place version: modifies cellnfields +# in place version: modifies cellnfields def _blankCells(coords, cellnfields, body, blankingType=1, \ delta=1.e-10, dim=3, masknot=0, tol=1.e-8, \ XRaydim1=1000, XRaydim2=1000, cellNName='cellN'): @@ -266,7 +266,7 @@ def _blankCells(coords, cellnfields, body, blankingType=1, \ z = C.convertArray2Tetra(z) bodyt.append(z) if blankingType == 2: # center_in: simplement un node_in sur les centres - coords = C.node2Center(coords); blankingType = 0 + coords = C.node2Center(coords); blankingType = 0 return connector._blankCells(coords, cellnfields, bodyt, blankingType, \ delta, dim, masknot, tol, XRaydim1, XRaydim2, cellNName) @@ -291,11 +291,11 @@ def blankIntersectingCells(a, cellN, tol=1.e-12): # IN: tol: geometric tolerance # OUT: returns the cellnfields, 0 for cells intersecting or inside the tet mesh #============================================================================== -def blankCellsTetra(coords, cellnfields, meshT4, blankingType=1, tol = 1.e-12, cellnval=0, overwrite=0, cellNName='cellN'): +def blankCellsTetra(coords, cellnfields, meshT4, blankingType=1, tol=1.e-12, cellnval=0, overwrite=0, cellNName='cellN'): """Blank cells in coords (by setting the cellN to cellnval) falling inside a Tetra Mesh mask defined by meshT4. If overwrite is enabled (1), cells detected outside have a celln reset to 1. Usage: blankCellsTetra(coords, cellnfields, meshT4, connectT4, blankingType, tol, cellnval, overwrite)""" - try: + try: import Converter as C import Transform as T import Post as P @@ -305,7 +305,7 @@ def blankCellsTetra(coords, cellnfields, meshT4, blankingType=1, tol = 1.e-12, c maskSkin = T.reorderAll(maskSkin, 1) #orient outward maskSkin = T.join(maskSkin) - mask = connector.createTetraMask(meshT4, maskSkin, tol) + mask = connector.createTetraMask(meshT4, maskSkin, tol) for i in range(len(coords)): #print 'coords : %d / %d' %(i+1, len(coords)) @@ -325,7 +325,7 @@ def blankCellsTetra(coords, cellnfields, meshT4, blankingType=1, tol = 1.e-12, c # IN: tol: geometric tolerance # OUT: returns the cellnfields, 0 for cells intersecting or inside the tet mesh #============================================================================== -def blankCellsTri(coords, cellnfields, meshT3, blankingType=1, tol=1.e-12, +def blankCellsTri(coords, cellnfields, meshT3, blankingType=1, tol=1.e-12, cellnval=0, overwrite=0, cellNName='cellN'): """Blank cells in coords (by setting the cellN to cellnval) falling inside a Triangular surface mesh mask defined by meshT3. If overwrite is enabled (1), cells detected outside have a celln reset to 1. @@ -359,13 +359,13 @@ def getIntersectingDomainsAABB(arrays, tol=1.e-10): #============================================================================= def applyBCOverlapsNG__(a, faceList, depth, loc, val=2, cellNName='cellN'): if loc == 'nodes': locI = 0 - elif loc == 'centers': locI = 1 + elif loc == 'centers': locI = 1 else: raise ValueError("applyBCOverlapsUnstr: invalid location.") return connector.applyBCOverlapsNG(a, faceList, depth, locI, val, cellNName) #============================================================================= # set cellN to 2 for nodes/cells in a neighborhood of depth nodes/cells -# for structured arrays. +# for structured arrays. # in place #============================================================================= def _applyBCOverlapsStruct__(a, minIndex, maxIndex, depth, loc, val=2, cellNName='cellN'): @@ -397,15 +397,15 @@ def setDoublyDefinedBC(z, cellN, listOfInterpZones, listOfCelln, winrange, import Converter as C listOfCelln = C.initVars(listOfCelln,'{cellN}=minimum(1.,{cellN})') except: pass - return connector.setDoublyDefinedBC(z, cellN, listOfInterpZones, + return connector.setDoublyDefinedBC(z, cellN, listOfInterpZones, listOfCelln, winrange, depth) #=============================================================================== # Calcul les donneurs et coefs d interpolation pour une zone receveuse # a partir d'une liste de zones donneuses. Si plusieurs candidats possibles # pour l'interpolation issus de plusieurs zones donneuses, selectionne la # cellule d interpolation de plus petit volume -# -# IN: interpPts: pts a interpoler (sous forme de liste d arrays avec coordonnees modifiees pour le double wall) +# +# IN: interpPts: pts a interpoler (sous forme de liste d arrays avec coordonnees modifiees pour le double wall) # IN: zonesD: liste de zones donneuses, contenant la variable cellN # IN: order: ordre des interpolations # IN: penalty=1: penalise une cellule donneuse en terme de volume si elle est au bord @@ -422,15 +422,15 @@ def setDoublyDefinedBC(z, cellN, listOfInterpZones, listOfCelln, winrange, # res[3] liste par bloc donneur des coefs d interpolation, sous forme d un tableau 1D # res[4] liste par bloc donneur des pts extrapoles # res[5] orphanInd1D: indice 1D des points orphelins (numero ds interpPts) -# +# #=============================================================================== -def setInterpData__(interpPts, zonesD, order=2, penalty=1, extrap=1, nature=0, method='lagrangian', interpDataType=1, hook=None, dim=3): - if method == 'lagrangian': +def setInterpData__(interpPts, zonesD, order=2, penalty=1, extrap=1, nature=0, method='lagrangian', interpDataType=1, hook=None, dim=3): + if method == 'lagrangian': if isinstance(interpPts[0], list): # liste d'arrays if interpPts[0][1].shape[1] >0: return connector.setInterpDataDW(interpPts, zonesD, order, nature, penalty, hook) else: return None - else: # pas de liste d'arrays = pas de double wall - if interpPts[1].shape[1]>0: + else: # pas de liste d'arrays = pas de double wall + if interpPts[1].shape[1]>0: if not isinstance(interpDataType,list): interpDataTypeL=[interpDataType]*len(zonesD) else: interpDataTypeL = interpDataType return connector.setInterpData(interpPts, zonesD, order, nature, penalty, extrap, interpDataTypeL, hook) @@ -439,11 +439,11 @@ def setInterpData__(interpPts, zonesD, order=2, penalty=1, extrap=1, nature=0, m elif method == 'leastsquares': if isinstance(interpPts[0], list): # liste d'arrays print('Warning: setInterpData: only 1st zone in 1st arg taken into account.') - if interpPts[0][1].shape[1]>0: + if interpPts[0][1].shape[1]>0: return connector.setInterpDataLS(interpPts[0], zonesD, order, nature, penalty, hook, dim) else: return None else: - if interpPts[1].shape[1]>0: + if interpPts[1].shape[1]>0: return connector.setInterpDataLS(interpPts, zonesD, order, nature, penalty, hook, dim) else: return None else: @@ -471,13 +471,13 @@ def setInterpData__(interpPts, zonesD, order=2, penalty=1, extrap=1, nature=0, m #----------------------------------------------------------------------------- def setInterpolations__(rcvzonename,nir, njr, interpPts, listOfInterpolationZones=[], - listOfInterpolationCelln=[], isEX=0, cfMax=30., zoneId=-1, + listOfInterpolationCelln=[], isEX=0, cfMax=30., zoneId=-1, check=True): """Compute and store interpolation coefficients.""" resInterp = connector.setInterpolations(nir, njr, interpPts, listOfInterpolationZones, listOfInterpolationCelln, isEX, zoneId, cfMax) - # Bilan : + # Bilan : nborphan = 0; nbextrapolated = 0; nbinterpolated = 0 nbinterpolated = interpPts[0][1].shape[1] if len(resInterp[5])>0: @@ -485,7 +485,7 @@ def setInterpolations__(rcvzonename,nir, njr, interpPts, nborphan = resInterp[7][0].size nbinterpolated = nbinterpolated-nbextrapolated-nborphan if check: # sequential context - if isEX == 0: + if isEX == 0: print('Zone %s: interpolated=%d ; extrapolated=%d ; orphan=%d'%(rcvzonename, nbinterpolated, nbextrapolated, nborphan)) if nborphan>0: print('Warning: zone %s has %d orphan points !'%(rcvzonename, nborphan)) else: @@ -494,7 +494,7 @@ def setInterpolations__(rcvzonename,nir, njr, interpPts, return resInterp #----------------------------------------------------------------------------- -# Ecriture des coefficients d'interpolation dans des fichiers pour elsA +# Ecriture des coefficients d'interpolation dans des fichiers pour elsA # IN: ntotZones: nombre total de zones # IN: listRcvId: liste des Id des zones interpolees par bloc donneur # IN: listCellIndicesRcv: liste des tableaux d'indices des cellules interpolees, par bloc donneur @@ -511,7 +511,7 @@ def setInterpolations__(rcvzonename,nir, njr, interpPts, # IN: nGhostCells: nb de cellules fictives pour l ecriture des donnees pour elsA #----------------------------------------------------------------------------- def writeCoefs(ntotZones,listRcvId,listCellIndicesRcv,listOfDirectionEX,listCellIndicesDonor,listInterpolantsDonor, - listInterpTypes, listCellN, listDonorDim, nbInterpCellsForDonor, + listInterpTypes, listCellN, listDonorDim, nbInterpCellsForDonor, PrefixFile, isEX=0, solver=1, nGhostCells=2): """Write interpolation coefficients in files for elsA.""" connector.writeCoefs(ntotZones,listRcvId,listCellIndicesRcv,listOfDirectionEX,listCellIndicesDonor,listInterpolantsDonor, listInterpTypes, listCellN, listDonorDim, nbInterpCellsForDonor, PrefixFile, isEX, solver, nGhostCells) @@ -594,11 +594,11 @@ def _modCellN2(a, cellNName='cellN'): #------------------------------------------------------------------------------ # IN: x,y,z, cellN localises au meme endroit -# OUT: array 'NODE' avec 'x,y,z,indcell' +# OUT: array 'NODE' avec 'x,y,z,indcell' # avec indcell l'indice du noeud correspondant de z tq cellN(indcell)=2 #----------------------------------------------------------------------------- def getInterpolatedPoints__(a): - if isinstance(a[0], list): + if isinstance(a[0], list): b = [] for i in a: b.append(connector.getInterpolatedPoints(i)) return b @@ -632,7 +632,7 @@ def changeWallEX__(EXPts, zc, zn, firstWallCenters, projectionSurfaces, planarTo #---------------------------------------------------------------------------------------------- # Pour determiner les frontieres de projection double wall, dans le cas ou les frontieres -# sont decoupees en sous fenetres, on etend la sous-fenetre en centres etendus (input +# sont decoupees en sous fenetres, on etend la sous-fenetre en centres etendus (input # array) qu on modifie localement en prenant le pt milieu avec le point interieur # IN: array : frontiere structuree 2D en centres etendus # IN: iminL, imaxL, jminL, jmaxL : indices de la sous fenetre dans la fenetre topologique @@ -649,7 +649,7 @@ def modifyBorders__(array,iminL,imaxL,jminL,jmaxL): # IN: lRcvArrays : liste des champs sur lesquels le transfert est applique (array) # IN: lDonorArrays: liste des champs du domaine d'interpolation (array) #----------------------------------------------------------------------------- -def chimeraTransfer(cellRcv, cellDonor, interpType, +def chimeraTransfer(cellRcv, cellDonor, interpType, interpDonor, lRcvArrays, lDonorArrays): return connector.chimeraTransfer(cellRcv, cellDonor, interpType, interpDonor,lRcvArrays,lDonorArrays) @@ -681,14 +681,14 @@ def setInterpTransfers(rcvFields, donorFields, indicesRcv, indicesDnr, # bcType : 'slip','noslip' # varType : 1=[ro,rou,rov,row,roE], 2=[ro,u,v,w,t], 3=[ro,u,v,w,p] #------------------------------------------------------------------------------ -def setIBCTransfers(rcvFields, donorFields, indicesRcv, indicesDnr, donorType, - coefs, xPC, yPC, zPC, xPW, yPW, zPW, xPI, yPI, zPI, +def setIBCTransfers(rcvFields, donorFields, indicesRcv, indicesDnr, donorType, + coefs, xPC, yPC, zPC, xPW, yPW, zPW, xPI, yPI, zPI, bcType='slip', variables=['Density','MomentumX','MomentumY','MomentumZ','EnergyStagnationDensity'], varType=1): - return connector.setIBCTransfers(rcvFields, donorFields, variables, - indicesRcv, indicesDnr, donorType, coefs, - xPC, yPC, zPC, xPW, yPW, zPW, xPI, yPI, zPI, + return connector.setIBCTransfers(rcvFields, donorFields, variables, + indicesRcv, indicesDnr, donorType, coefs, + xPC, yPC, zPC, xPW, yPW, zPW, xPI, yPI, zPI, bcType, varType) #------------------------------------------------------------------------------ @@ -712,9 +712,9 @@ def setInterpTransfersD(donorFields, indicesDnr, donorType, coefs): # bcType : type de CL (slip, noslip) # varType : 1=[ro,rou,rov,row,roE], 2=[ro,u,v,w,t], 3=[ro,u,v,w,p] #------------------------------------------------------------------------------ -def setIBCTransfersD(donorFields, indicesDnr, donorType, coefs, - xPC, yPC, zPC, xPW, yPW, zPW, xPI, yPI, zPI, +def setIBCTransfersD(donorFields, indicesDnr, donorType, coefs, + xPC, yPC, zPC, xPW, yPW, zPW, xPI, yPI, zPI, bcType='slip', varType=1): return connector.setIBCTransfersD(donorFields, indicesDnr, donorType, coefs, - xPC,yPC,zPC,xPW,yPW,zPW,xPI,yPI,zPI, + xPC,yPC,zPC,xPW,yPW,zPW,xPI,yPI,zPI, bcType, varType) diff --git a/Cassiopee/Connector/Connector/Coupling.py b/Cassiopee/Connector/Connector/Coupling.py index faa4e0555..07994749f 100644 --- a/Cassiopee/Connector/Connector/Coupling.py +++ b/Cassiopee/Connector/Connector/Coupling.py @@ -3,8 +3,8 @@ # 2 fonctionnements possibles : # update direct de la solution par interpolation # ajout d'une contribution d'un donneur a un champ existant - plusieurs donneurs possibles -import Converter.Mpi as Cmpi -import Converter.Internal as Internal +import Converter.Mpi as Cmpi +import Converter.Internal as Internal import Converter.Filter as Filter import Converter.PyTree as C import Geom.PyTree as D @@ -55,7 +55,7 @@ def _interpolate(tR, tD, interpTree, graph, procDict, typeTransfer=0): else: fsname = Internal.getName(fs) for fnode in Internal.getNodesFromType(fs,'DataArray_t'): - fname = Internal.getName(fnode) + fname = Internal.getName(fnode) varsI.append(fname) dictOfFSN[fsname] = varsI @@ -74,7 +74,7 @@ def _interpolate(tR, tD, interpTree, graph, procDict, typeTransfer=0): C._cpVars(tD,'%s'%varl, interpTree, varl) C._initVars(tR,'%s'%varl,0) _setInterpTransfers(tR, interpTree, variables=varsI, cellNVariable='cellN', - graph=graph, procDict=procDict, type='ID', typeTransfer=typeTransfer) + graph=graph, procDict=procDict, type='ID', typeTransfer=typeTransfer) Internal.__FlowSolutionCenters__ = FSC_SAV Internal.__FlowSolutionNodes__ = FSN_SAV @@ -96,7 +96,7 @@ def prepareInterpData(tR, tD, order=2, loc='CellCenter', cartesian=False, cleanI def _setInterpData2__(tR, tD, order=2, loc='centers', cartesian=False, cleanID=True, typeTransfer=0): if loc == 'nodes': varcelln = 'cellN' - else: varcelln = 'centers:cellN' + else: varcelln = 'centers:cellN' # Clean previous IDs if necessary if cleanID: @@ -134,12 +134,12 @@ def _setInterpData2__(tR, tD, order=2, loc='centers', cartesian=False, cleanID=T if cellNPresent==-1: C._initVars(zs, varcelln, 2.) # interp all if dnrZones != []: if typeTransfer == 0: - X._setInterpData(zs, dnrZones, nature=1, penalty=1, order=order, loc=loc, + X._setInterpData(zs, dnrZones, nature=1, penalty=1, order=order, loc=loc, storage='inverse', extrap=0, verbose=0, sameName=0, interpDataType=interpDataType, itype='chimera') else: for zd in dnrZones: - X._setInterpData(zs, zd, nature=1, penalty=1, order=order, loc=loc, + X._setInterpData(zs, zd, nature=1, penalty=1, order=order, loc=loc, storage='inverse', extrap=0, verbose=0, sameName=0, interpDataType=interpDataType, itype='chimera') @@ -187,12 +187,12 @@ def _setInterpData2__(tR, tD, order=2, loc='centers', cartesian=False, cleanID=T #=============================================================================== # typeTransfer=0 : replace field by interpolated value -# typeTransfer=1 : sum to existing field the interpolated value +# typeTransfer=1 : sum to existing field the interpolated value def _setInterpTransfers(aR, aD, variables=[], cellNVariable='', - variablesIBC=['Density','MomentumX','MomentumY','MomentumZ','EnergyStagnationDensity'], - bcType=0, varType=1, compact=0, graph=None, + variablesIBC=['Density','MomentumX','MomentumY','MomentumZ','EnergyStagnationDensity'], + bcType=0, varType=1, compact=0, graph=None, procDict=None, type='ALLD', - Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08, + Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08, Cs=0.3831337844872463, Ts=1.0, alpha=1., typeTransfer=0): if procDict is None: procDict = Cmpi.getProcDict(aD) @@ -205,7 +205,7 @@ def _setInterpTransfers(aR, aD, variables=[], cellNVariable='', zonesD = Internal.getZones(aD) for zD in zonesD: infos = X.setInterpTransfersD(zD, variables=variables, cellNVariable=cellNVariable, - variablesIBC=variablesIBC, + variablesIBC=variablesIBC, bcType=bcType, varType=varType, compact=compact, Gamma=Gamma, Cv=Cv, MuS=MuS, Cs=Cs, Ts=Ts, alpha=alpha) for n in infos: @@ -245,4 +245,3 @@ def _setInterpTransfers(aR, aD, variables=[], cellNVariable='', C._updatePartialFields(z, [field], [listIndices], loc=n[3]) return None - diff --git a/Cassiopee/Connector/Connector/DoubleWall.py b/Cassiopee/Connector/Connector/DoubleWall.py index 69af2b07e..8d80514de 100644 --- a/Cassiopee/Connector/Connector/DoubleWall.py +++ b/Cassiopee/Connector/Connector/DoubleWall.py @@ -1,4 +1,4 @@ -# - Double Wall functions - +# - Double Wall functions - from . import Connector __version__ = Connector.__version__ @@ -18,7 +18,7 @@ raise ImportError("Connector.DoubleWall requires Transform, Converter, Geom modules.") #------------------------------------------------------------------------------ -# Retourne les ranges (en noeuds) des frontieres paroi de la zone z +# Retourne les ranges (en noeuds) des frontieres paroi de la zone z #------------------------------------------------------------------------------ def getBCWallRanges__(z, familyNames=[]): walls = [] @@ -39,7 +39,7 @@ def getBCWallRanges__(z, familyNames=[]): r = Internal.range2Window(range0[1]) i1 = int(r[0]); j1 = int(r[2]); k1 = int(r[4]) i2 = int(r[1]); j2 = int(r[3]); k2 = int(r[5]) - walls.append([i1,i2,j1,j2,k1,k2]) + walls.append([i1,i2,j1,j2,k1,k2]) return walls #=============================================================================== @@ -102,7 +102,7 @@ def getFirstPointsInfo0__(z, wallRanges, loc='nodes', ghostCells=False): i1 = w[0]; i2 = w[1]; j1 = w[2]; j2 = w[3]; k1 = w[4]; k2 = w[5] if i1 == i2: if i1 == 1: diri=1; ic = 1 - else: diri=-1; ic = i1-shift + else: diri=-1; ic = i1-shift z2w = Transform.subzone(z,(ic,j1-s2,k1-s2),(ic,j2-shift+s2,k2-shift+s2)) elif j1 == j2: @@ -118,7 +118,7 @@ def getFirstPointsInfo0__(z, wallRanges, loc='nodes', ghostCells=False): wallsc.append(z2w) # conversion en 'QUAD' - # wallsc = T.merge(wallsc)# NE SERT A RIEN + # wallsc = T.merge(wallsc)# NE SERT A RIEN wallsc = Converter.convertArray2Hexa(wallsc) wallsc = Transform.join(wallsc) return wallsc @@ -139,18 +139,18 @@ def getFirstPointsInfo__(z, wallRanges, loc='nodes', ghostCells=False): return wallsc #---------------------------------------------------------------------------------------- -# Met a jour les coordonnees des points frontieres d'un maillage surfacique +# Met a jour les coordonnees des points frontieres d'un maillage surfacique # Pour traiter les surfaces de projection en centres etendus issues de BCWall splittees # ---------------------------------------------------------------------------------------- -def modifyBorders__(a, iminL, imaxL, jminL, jmaxL): +def modifyBorders__(a, iminL, imaxL, jminL, jmaxL): return C.TZGC1(a, 'nodes', True, Connector.modifyBorders__, iminL, imaxL, jminL, jmaxL) # ---------------------------------------------------------------------------------------- -# determination de toutes les sous fenetres definissant une frontiere i=imax par ex +# determination de toutes les sous fenetres definissant une frontiere i=imax par ex # ---------------------------------------------------------------------------------------- def getExtCenterSubWin(wloc, allIndices, dirW=0): wloc = C.node2ExtCenter(wloc) - dimsW = Internal.getZoneDim(wloc) + dimsW = Internal.getZoneDim(wloc) niW=dimsW[1]; njW=dimsW[2]; nkW=dimsW[3] if dirW == 1: wLoc = T.subzone(wloc,(2,1,1),(2,njW,nkW)) elif dirW == 2: wLoc = T.subzone(wloc,(1,2,1),(niW,2,nkW)) @@ -164,13 +164,13 @@ def getExtCenterSubWin(wloc, allIndices, dirW=0): dimS = Internal.getZoneDim(wLoc) niS = dimS[1]; njS = dimS[2]; nkS = dimS[3] - if dirW == 1: + if dirW == 1: iminL = jmin ; jminL = kmin imaxL = jmax+1; jmaxL = kmax+1 elif dirW == 2: iminL = imin; jminL = kmin imaxL = imax+1; jmaxL = kmax+1 - else: + else: iminL = imin; jminL = jmin imaxL = imax+1; jmaxL = jmax+1 @@ -183,16 +183,16 @@ def getExtCenterSubWin(wloc, allIndices, dirW=0): return surfs #------------------------------------------------------------------------------- -def getExtCenterSurfaces__(a, walls): +def getExtCenterSurfaces__(a, walls): dims0 = Internal.getZoneDim(a) ni0 = dims0[1]; nj0 = dims0[2]; nk0 = dims0[3] indicesI1=[]; indicesI2=[];indicesJ1=[];indicesJ2=[];indicesK1=[];indicesK2=[] for w in walls: i1 = int(w[0]); i2=int(w[1]); j1 = int(w[2]); j2 = int(w[3]); k1 = int(w[4]); k2 = int(w[5]) - if i1 == i2: + if i1 == i2: if i1==1: indicesI1.append([i1,j1,k1,i2,j2,k2]) else: indicesI2.append([i1,j1,k1,i2,j2,k2]) - elif j1 == j2: + elif j1 == j2: if j1 == 1: indicesJ1.append([i1,j1,k1,i2,j2,k2]) else: indicesJ2.append([i1,j1,k1,i2,j2,k2]) elif k1 == k2: @@ -203,26 +203,26 @@ def getExtCenterSurfaces__(a, walls): if indicesI1 != []: wloc = T.subzone(a,(1,1,1),(2,nj0,nk0)) surfs += getExtCenterSubWin(wloc,indicesI1,1) - if indicesI2 != []: + if indicesI2 != []: wloc = T.subzone(a,(ni0-1,1,1),(ni0,nj0,nk0)) surfs += getExtCenterSubWin(wloc,indicesI2,1) if indicesJ1 != []: wloc = T.subzone(a,(1,1,1),(ni0,2,nk0)) surfs += getExtCenterSubWin(wloc,indicesJ1,2) if indicesJ2 != []: - wloc = T.subzone(a,(1,nj0-1,1),(ni0,nj0,nk0)) + wloc = T.subzone(a,(1,nj0-1,1),(ni0,nj0,nk0)) surfs += getExtCenterSubWin(wloc,indicesJ2,2) if indicesK1 != []: - wloc = T.subzone(a,(1,1,1),(ni0,nj0,2)) + wloc = T.subzone(a,(1,1,1),(ni0,nj0,2)) surfs += getExtCenterSubWin(wloc,indicesK1,3) if indicesK2 != []: - wloc = T.subzone(a,(1,1,nk0-1),(ni0,nj0,nk0)) + wloc = T.subzone(a,(1,1,nk0-1),(ni0,nj0,nk0)) surfs += getExtCenterSubWin(wloc,indicesK2,3) - return surfs + return surfs #------------------------------------------------------------------------------- -# Information sur les parois de a (pour le double wall) -# utilise pour setInterpolations +# Information sur les parois de a (pour le double wall) +# utilise pour setInterpolations # Retourne: res sous forme d'arrays pour chaque base, pour chaque zone # res[0]: indices,dir1,dir2,dir3,hmax des premiers points pres de la paroi # res[1]: parois decrites par des maillages TRI avec point milieu. Contient hmax. @@ -266,7 +266,7 @@ def extractDoubleWallInfo__(t): #surfs = T.merge(surfs) surfs = Converter.convertArray2Hexa(surfs) surfs = Transform.join(surfs) - surfacesPerBase.append(surfs) + surfacesPerBase.append(surfs) surfacesExt.append(surfs) noz += 1 @@ -277,10 +277,10 @@ def extractDoubleWallInfo__(t): hsRef = Geom.getCurvatureHeight(surfacesPerBase) hsRef = Converter.node2Center(hsRef) hsRef = Converter.center2Node(hsRef) # lissage en prenant le premier voisinage - # + # # Identify nodes hsRef = hsRef[1] - hook = Converter.createHook(surfacesPerBase,'nodes') + hook = Converter.createHook(surfacesPerBase,'nodes') for nosz in range(len(surfacesExt)): # identification par zone surfECZ = surfacesExt[nosz] if surfECZ != []: @@ -288,9 +288,9 @@ def extractDoubleWallInfo__(t): hsLoc = Converter.extractVars(surfECZ,['hmax']) indices = Converter.identifyNodes(hook, surfECZ) i = 0 - for indh in indices: + for indh in indices: hsLoc[1][0,i] = hsRef[0,indh-1] - i += 1 + i += 1 surfECZ = Converter.addVars([surfECZ,hsLoc]) surfECZ = Converter.convertArray2Tetra(surfECZ, split='withBarycenters') surfacesExt[nosz]=[surfECZ] @@ -301,9 +301,9 @@ def extractDoubleWallInfo__(t): hsLoc = Converter.addVars(wallZ,'hmax') hsLoc = Converter.extractVars(hsLoc,['hmax']) i = 0 - for indh in indices2: + for indh in indices2: hsLoc[1][0,i] = hsRef[0,indh-1] - i += 1 + i += 1 firstCenters[nob][nozOfNob] = Converter.addVars([wallZ,hsLoc]) Converter.freeHook(hook) wallSurfacesEC.append(surfacesExt) diff --git a/Cassiopee/Connector/Connector/IBM.py b/Cassiopee/Connector/Connector/IBM.py index 748683ce2..95da2e8ee 100644 --- a/Cassiopee/Connector/Connector/IBM.py +++ b/Cassiopee/Connector/Connector/IBM.py @@ -59,7 +59,7 @@ def _changeNameIBCD__(tc,NewIBCD): zsplit[1] = str(NewIBCD) znew = '_'.join(zsplit) Internal.setName(z, znew) - return None + return None def getIBCDName(proposedName): global __IBCNameServer__ @@ -124,8 +124,8 @@ def computeMeshInfo__(z, dim): nfaces = dim[1]*(dim[2]-1)+dim[2]*(dim[1]-1) elif dim[4] == 3: nfaces = dim[1]*(dim[2]-1)*(dim[3]-1)+ \ - dim[2]*(dim[3]-1)*(dim[1]-1)+ \ - dim[3]*(dim[1]-1)*(dim[2]-1) + dim[2]*(dim[3]-1)*(dim[1]-1)+ \ + dim[3]*(dim[1]-1)*(dim[2]-1) return np, ncells, nfaces return 0, 0, 0 @@ -163,7 +163,7 @@ def _computeMeshInfo(t): for i in range(NP): ncells_percent.append(NCELLS[i]/NcellsTot*100) print('Info: Rank {} has {:.3f}e06 points & {:.3f}e06 cells & {} % of cells - no ghost cells'.format(i,int(NPTS[i])/1e06,int(NCELLS[i])/1e06,round(ncells_percent[i],2))) - print('Info: Range of % of cells: {} - {}'.format(round(min(ncells_percent),2),round(max(ncells_percent),2))) + print('Info: Range of % of cells: {} - {}'.format(round(min(ncells_percent),2),round(max(ncells_percent),2))) Cmpi.barrier() np_total = Cmpi.allreduce(np_total, op=Cmpi.SUM) @@ -220,7 +220,7 @@ def prepareIBMData(t_case, t_out, tc_out, t_in=None, to=None, tbox=None, tinit=N ##else: fileoutpre = ['.','template.cgns'] refstate = Internal.getNodeFromName(tb, 'ReferenceState') - flowEqn = Internal.getNodeFromName(tb, 'FlowEquationSet') + flowEqn = Internal.getNodeFromName(tb, 'FlowEquationSet') Reynolds = Internal.getNodeFromName(tb, 'Reynolds') if Reynolds is not None: @@ -274,7 +274,7 @@ def prepareIBMData(t_case, t_out, tc_out, t_in=None, to=None, tbox=None, tinit=N _redispatch__(t=t) if verbose: printTimeAndMemory__('generate Cartesian mesh', time=python_time.time()-pt0) - else: + else: t = t_in for b in Internal.getBases(t): @@ -283,7 +283,7 @@ def prepareIBMData(t_case, t_out, tc_out, t_in=None, to=None, tbox=None, tinit=N #=================== # STEP 2 : DIST2WALL - #=================== + #=================== if verbose: pt0 = python_time.time(); printTimeAndMemory__('compute wall distance', time=-1) _dist2wallIBM(t, tb, dimPb=dimPb, frontType=frontType, Reynolds=Reynolds, yplus=yplus, Lref=Lref, correctionMultiCorpsF42=correctionMultiCorpsF42, heightMaxF42=heightMaxF42, @@ -294,9 +294,9 @@ def prepareIBMData(t_case, t_out, tc_out, t_in=None, to=None, tbox=None, tinit=N # STEP 3 : BLANKING IBM #=================== if verbose: pt0 = python_time.time(); printTimeAndMemory__('blank by IBC bodies', time=-1) - _blankingIBM(t, tb, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, - Reynolds=Reynolds, yplus=yplus, Lref=Lref, twoFronts=twoFronts, - heightMaxF42=heightMaxF42, correctionMultiCorpsF42=correctionMultiCorpsF42, + _blankingIBM(t, tb, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, + Reynolds=Reynolds, yplus=yplus, Lref=Lref, twoFronts=twoFronts, + heightMaxF42=heightMaxF42, correctionMultiCorpsF42=correctionMultiCorpsF42, wallAdaptF42=wallAdaptF42, blankingF42=blankingF42, tbFilament=tbFilament) ##Keep for now to check @@ -320,17 +320,17 @@ def prepareIBMData(t_case, t_out, tc_out, t_in=None, to=None, tbox=None, tinit=N # STEP 4 : BUILD FRONT #=================== if verbose: pt0 = python_time.time(); printTimeAndMemory__('build IBM front', time=-1) - t, tc, front, front2, frontWMM = buildFrontIBM(t, tc, tb=tb, dimPb=dimPb, frontType=frontType, - cartesian=cartesian, twoFronts=twoFronts, check=check, - tbFilament=tbFilament) + t, tc, front, front2, frontWMM = buildFrontIBM(t, tc, tb=tb, dimPb=dimPb, frontType=frontType, + cartesian=cartesian, twoFronts=twoFronts, check=check, + tbFilament=tbFilament) if verbose: printTimeAndMemory__('build IBM front', time=python_time.time()-pt0) #=================== # STEP 5 : INTERP DATA IBM #=================== if verbose: pt0 = python_time.time(); printTimeAndMemory__('compute interpolation data (IBM)', time=-1) - _setInterpDataIBM(t, tc, tb, front, front2=front2, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, - Reynolds=Reynolds, yplus=yplus, Lref=Lref, + _setInterpDataIBM(t, tc, tb, front, front2=front2, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, + Reynolds=Reynolds, yplus=yplus, Lref=Lref, cartesian=cartesian, twoFronts=twoFronts, check=check, tbFilament=tbFilament, frontWMM=frontWMM) if verbose: printTimeAndMemory__('compute interpolation data (IBM)', time=python_time.time()-pt0) @@ -371,9 +371,9 @@ def prepareIBMData(t_case, t_out, tc_out, t_in=None, to=None, tbox=None, tinit=N else: return t, tc def prepareIBMDataExtrude(t_case, t_out, tc_out, t, to=None, - depth=2, frontType=1, octreeMode=0, IBCType=1, + depth=2, frontType=1, octreeMode=0, IBCType=1, verbose=True, check=False, twoFronts=False, cartesian=True, - yplus=100., Lref=1., correctionMultiCorpsF42=False, blankingF42=False, wallAdaptF42=None, heightMaxF42=-1., + yplus=100., Lref=1., correctionMultiCorpsF42=False, blankingF42=False, wallAdaptF42=None, heightMaxF42=-1., tbox=None, extrusion='cart'): import Generator.IBM as G_IBM import time as python_time @@ -399,7 +399,7 @@ def prepareIBMDataExtrude(t_case, t_out, tc_out, t, to=None, # print("===========================================") refstate = Internal.getNodeFromName(tb, 'ReferenceState') - flowEqn = Internal.getNodeFromName(tb, 'FlowEquationSet') + flowEqn = Internal.getNodeFromName(tb, 'FlowEquationSet') Reynolds = Internal.getNodeFromName(tb, 'Reynolds') if Reynolds is not None: @@ -427,8 +427,8 @@ def prepareIBMDataExtrude(t_case, t_out, tc_out, t, to=None, raise ValueError("prepareIBMDataPara: governing equations (Euler) not consistent with ibc types %s"%(ibctypes)) #=================== - # STEP 0 : GET FILAMENT BODIES - #=================== + # STEP 0 : GET FILAMENT BODIES + #=================== tb, tbFilament = D_IBM.determineClosedSolidFilament__(tb) isFilamentOnly, isWireModel = D_IBM.localWMMFlags__(tb, tbFilament) @@ -450,12 +450,12 @@ def prepareIBMDataExtrude(t_case, t_out, tc_out, t, to=None, ##SKIPPED - mesh is provided as an input & has TurbulentDistance already #=================== - # STEP 3 : BLANKING IBM + # STEP 3 : BLANKING IBM #=================== if verbose: pt0 = python_time.time(); printTimeAndMemory__('blank by IBC bodies', time=-1, functionName='prepareIBMDataExtrude') - _blankingIBM(t, tb, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, - Reynolds=Reynolds, yplus=yplus, Lref=Lref, twoFronts=twoFronts, - heightMaxF42=heightMaxF42, correctionMultiCorpsF42=correctionMultiCorpsF42, + _blankingIBM(t, tb, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, + Reynolds=Reynolds, yplus=yplus, Lref=Lref, twoFronts=twoFronts, + heightMaxF42=heightMaxF42, correctionMultiCorpsF42=correctionMultiCorpsF42, wallAdaptF42=wallAdaptF42, blankingF42=blankingF42, tbFilament=tbFilament) @@ -489,27 +489,27 @@ def prepareIBMDataExtrude(t_case, t_out, tc_out, t, to=None, # STEP 5 : BUILD FRONT #=================== if verbose: pt0 = python_time.time(); printTimeAndMemory__('build IBM front', time=-1, functionName='prepareIBMDataExtrude') - t, tc, front, front2, frontWMM = buildFrontIBM(t, tc, tb=tb, dimPb=dimPb, frontType=frontType, - cartesian=cartesian, twoFronts=twoFronts, check=check, - tbFilament=tbFilament) + t, tc, front, front2, frontWMM = buildFrontIBM(t, tc, tb=tb, dimPb=dimPb, frontType=frontType, + cartesian=cartesian, twoFronts=twoFronts, check=check, + tbFilament=tbFilament) if verbose: printTimeAndMemory__('build IBM front', time=python_time.time()-pt0, functionName='prepareIBMDataExtrude') #=================== # STEP 6 : INTERP DATA IBM #=================== if verbose: pt0 = python_time.time(); printTimeAndMemory__('compute interpolation data (IBM)', time=-1, functionName='prepareIBMDataExtrude') - _setInterpDataIBM(t, tc, tb, front, front2=front2, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, - Reynolds=Reynolds, yplus=yplus, Lref=Lref, + _setInterpDataIBM(t, tc, tb, front, front2=front2, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, + Reynolds=Reynolds, yplus=yplus, Lref=Lref, cartesian=cartesian, twoFronts=twoFronts, check=check, tbFilament=tbFilament, frontWMM=frontWMM) if verbose: printTimeAndMemory__('compute interpolation data (IBM)', time=python_time.time()-pt0, functionName='prepareIBMDataExtrude') #=================== - # STEP 7 : INIT IBM + # STEP 7 : INIT IBM #=================== if verbose: pt0 = python_time.time(); printTimeAndMemory__('initialize and clean', time=-1, functionName='prepareIBMDataExtrude') - tsave = Internal.copyTree(t) # Modification needed to by pass the initialization of t in the macro function initializeIBM + tsave = Internal.copyTree(t) # Modification needed to by pass the initialization of t in the macro function initializeIBM t = None # t, tc, tc2 = initializeIBM(t, tc, tb, dimPb=dimPb, twoFronts=twoFronts, tbFilament=tbFilament) - t = Internal.copyTree(tsave) # Modification needed to by pass the initialization of t in the macro function initializeIBM + t = Internal.copyTree(tsave) # Modification needed to by pass the initialization of t in the macro function initializeIBM _redispatch__(t=t, tc=tc, tc2=tc2) if extrusion == 'cyl': #__ @@ -528,7 +528,7 @@ def prepareIBMDataExtrude(t_case, t_out, tc_out, t, to=None, yy = r[l]*numpy.cos( theta[l] ) # | zz = r[l]*numpy.sin( theta[l] ) # | r[l]= yy; theta[l] = zz # | - #__ + #__ if isinstance(tc_out, str): tcp = Compressor.compressCartesian(tc) @@ -552,9 +552,9 @@ def prepareIBMDataExtrude(t_case, t_out, tc_out, t, to=None, else: return t, tc def prepareIBMDataAdapt(t_case, t_out, tc_out, t_in, - depth=2, IBCType=1, verbose=True, - check=False, twoFronts=False, cartesian=True, - yplus=100., Lref=1., correctionMultiCorpsF42=False, blankingF42=False, wallAdaptF42=None, heightMaxF42=-1.): + depth=2, IBCType=1, verbose=True, + check=False, twoFronts=False, cartesian=True, + yplus=100., Lref=1., correctionMultiCorpsF42=False, blankingF42=False, wallAdaptF42=None, heightMaxF42=-1.): import time as python_time @@ -569,7 +569,7 @@ def prepareIBMDataAdapt(t_case, t_out, tc_out, t_in, frontType = 42 refstate = Internal.getNodeFromName(tb, 'ReferenceState') - flowEqn = Internal.getNodeFromName(tb, 'FlowEquationSet') + flowEqn = Internal.getNodeFromName(tb, 'FlowEquationSet') Reynolds = Internal.getNodeFromName(tb, 'Reynolds') if Reynolds is not None: @@ -603,9 +603,9 @@ def prepareIBMDataAdapt(t_case, t_out, tc_out, t_in, # STEP 3 : BLANKING IBM #=================== if verbose: pt0 = python_time.time(); printTimeAndMemory__('blank by IBC bodies', time=-1) - _blankingIBM(t, tb, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, - Reynolds=Reynolds, yplus=yplus, Lref=Lref, twoFronts=twoFronts, - heightMaxF42=heightMaxF42, correctionMultiCorpsF42=correctionMultiCorpsF42, + _blankingIBM(t, tb, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, + Reynolds=Reynolds, yplus=yplus, Lref=Lref, twoFronts=twoFronts, + heightMaxF42=heightMaxF42, correctionMultiCorpsF42=correctionMultiCorpsF42, wallAdaptF42=wallAdaptF42, blankingF42=blankingF42) Cmpi.barrier() _redispatch__(t=t) @@ -626,16 +626,16 @@ def prepareIBMDataAdapt(t_case, t_out, tc_out, t_in, # STEP 4 : BUILD FRONT #=================== if verbose: pt0 = python_time.time(); printTimeAndMemory__('build IBM front', time=-1) - t, tc, front, front2, frontWMM = buildFrontIBM(t, tc, tb=tb, dimPb=dimPb, frontType=frontType, - cartesian=cartesian, twoFronts=twoFronts, check=check) + t, tc, front, front2, frontWMM = buildFrontIBM(t, tc, tb=tb, dimPb=dimPb, frontType=frontType, + cartesian=cartesian, twoFronts=twoFronts, check=check) if verbose: printTimeAndMemory__('build IBM front', time=python_time.time()-pt0) #=================== # STEP 5 : INTERP DATA IBM #=================== if verbose: pt0 = python_time.time(); printTimeAndMemory__('compute interpolation data (IBM)', time=-1) - _setInterpDataIBM(t, tc, tb, front, front2=front2, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, - Reynolds=Reynolds, yplus=yplus, Lref=Lref, + _setInterpDataIBM(t, tc, tb, front, front2=front2, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, + Reynolds=Reynolds, yplus=yplus, Lref=Lref, cartesian=cartesian, twoFronts=twoFronts, check=check) if verbose: printTimeAndMemory__('compute interpolation data (IBM)', time=python_time.time()-pt0) @@ -689,14 +689,14 @@ def _redispatch__(t=None, tc=None, tc2=None): D2._copyDistribution(tc, tcs) D2mpi._redispatch(tc, verbose=1) - if t is not None: + if t is not None: D2._copyDistribution(t, tcs) D2mpi._redispatch(t) - if tc2: + if tc2: D2._copyDistribution(tc2, tcs) D2mpi._redispatch(tc2) - del tcs - else: + del tcs + else: algo = 'fast' tskel = Cmpi.convert2SkeletonTree(t) ts = Cmpi.allgatherTree(tskel) @@ -719,9 +719,9 @@ def _redispatch__(t=None, tc=None, tc2=None): # IN: Reynolds (float): Reynolds number (F42) # IN: yplus (float): estimated yplus at the first computed cells (F42) # IN: Lref (float): characteristic length of the geometry (F42) -# IN: correctionMultiCorpsF42 (boolean): if True, computes the wall distance +# IN: correctionMultiCorpsF42 (boolean): if True, computes the wall distance # w.r.t each body that is not a symmetry plane (F42) -# IN: heightMaxF42 (float): if heightMaxF42 > 0: uses a maximum modeling height +# IN: heightMaxF42 (float): if heightMaxF42 > 0: uses a maximum modeling height # to speed up individual wall distance calculations when correctionMultiCorpsF42 is active (F42) # OUT: centers:TurbulentDistance field # OUT: (optional) centers:TurbulentDistance_body%i fields @@ -790,7 +790,7 @@ def _dist2wallIBM(t, tb, dimPb=3, frontType=1, Reynolds=1.e6, yplus=100, Lref=1. if tbFilament and not isFilamentOnly: C._initVars(t,'{centers:TurbulentDistanceSolid}={centers:TurbulentDistance}') if dimPb ==2: tb2 = C.initVars(tbFilament, 'CoordinateZ', dz) - _dist2wallIBMFilamentWMM__(t, tb2, tbsave, dimPb) + _dist2wallIBMFilamentWMM__(t, tb2, tbsave, dimPb) elif isFilamentOnly: C._initVars(t,"{centers:TurbulentDistanceSolid}=0") C._initVars(t,"{centers:TurbulentDistanceFilament}={centers:TurbulentDistance}") @@ -830,7 +830,7 @@ def _dist2wallIBM(t, tb, dimPb=3, frontType=1, Reynolds=1.e6, yplus=100, Lref=1. coordY[0][1] = coordY[0][1] + shiftDist coordY[1][1] = coordY[1][1] + shiftDist Internal.getNodeFromName(bboxBody, 'CoordinateY')[1] = coordY - coordZ = Internal.getNodeFromName(bboxBody, 'CoordinateZ')[1] + coordZ = Internal.getNodeFromName(bboxBody, 'CoordinateZ')[1] coordZ[0][0][0] = coordZ[0][0][0] - shiftDist coordZ[0][1][0] = coordZ[0][1][0] - shiftDist coordZ[1][0][0] = coordZ[1][0][0] - shiftDist @@ -868,10 +868,10 @@ def _dist2wallIBM(t, tb, dimPb=3, frontType=1, Reynolds=1.e6, yplus=100, Lref=1. # IN: yplus (float): estimated yplus at the first computed cells (F42) # IN: Lref (float): characteristic length of the geometry (F42) # IN: twoFronts (boolean): if True, performs the IBM pre-processing for an additional image point positioned farther away -# IN: correctionMultiCorpsF42 (boolean): if True, ensures that there are calculated points between +# IN: correctionMultiCorpsF42 (boolean): if True, ensures that there are calculated points between # the immersed bodies by using individual wall distances (F42) # IN: blankingF42 (boolean): if True, reduces as much as possible the number of IB target points inside the boundary layer (F42) -# IN: wallAdaptF42 (cloud of IB target points with yplus information): +# IN: wallAdaptF42 (cloud of IB target points with yplus information): # use a previous computation to adapt the positioning of IB target points around the geometry according to a target yplus (F42) # IN: heightMaxF42 (float): maximum modeling height for the location of IB target points around the geometry (F42) # IN: filamentBases: list of bases that are IBC filaments @@ -880,14 +880,14 @@ def _dist2wallIBM(t, tb, dimPb=3, frontType=1, Reynolds=1.e6, yplus=100, Lref=1. # OUT: centers:cellN, centers:cellNIBC, centers:cellNChim, centers:cellNFront fields # OUT: (optional) centers:cellNIBC_2, centers:cellNFront_2 fields for second image points #========================================================================= -def _blankingIBM__(t, tb, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, yplus=100, Lref=1., +def _blankingIBM__(t, tb, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, yplus=100, Lref=1., correctionMultiCorpsF42=False, blankingF42=False, wallAdaptF42=None, heightMaxF42=-1., tbFilament=None): isFilamentOnly, isWireModel = D_IBM.localWMMFlags__(tb, tbFilament) isSkipDist = False - minval = C.getMinValue(t, 'centers:TurbulentDistance'); + minval = C.getMinValue(t, 'centers:TurbulentDistance'); minval = Cmpi.allreduce(minval, op=Cmpi.MIN) if minval<0: isSkipDist=True @@ -1021,7 +1021,7 @@ def findIsoFront(cellNFront, Dist_1, Dist_2): yplus = Cmpi.allreduce(yplus, op=Cmpi.MAX)[0] # Only keep the layer of target points useful for solver iterations, particularly useful in 3D - if blankingF42: + if blankingF42: if wallAdaptF42 is None: X._maximizeBlankedCells(t, depth=2, addGC=False) else: print("Info: blankingIBM: blankingF42 cannot operate with a local modeling height") @@ -1103,9 +1103,9 @@ def blankingIBM(t, tb, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, tbFilament=None): """Blank the computational tree by IBC bodies for IBM pre-processing.""" tp = Internal.copyRef(t) - _blankingIBM(t, tb, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, - Reynolds=Reynolds, yplus=yplus, Lref=Lref, twoFronts=twoFronts, - heightMaxF42=heightMaxF42, correctionMultiCorpsF42=correctionMultiCorpsF42, + _blankingIBM(t, tb, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, + Reynolds=Reynolds, yplus=yplus, Lref=Lref, twoFronts=twoFronts, + heightMaxF42=heightMaxF42, correctionMultiCorpsF42=correctionMultiCorpsF42, wallAdaptF42=wallAdaptF42, blankingF42=blankingF42, tbFilament=tbFilament) return tp @@ -1128,9 +1128,9 @@ def _blankingIBM(t, tb, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, C._initVars(t,'{centers:cellNChim}={centers:cellN}') C._initVars(t, 'centers:cellN', 1.) - _blankingIBM__(t, tb, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, + _blankingIBM__(t, tb, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, Reynolds=Reynolds, yplus=yplus, Lref=Lref, - heightMaxF42=heightMaxF42, correctionMultiCorpsF42=correctionMultiCorpsF42, + heightMaxF42=heightMaxF42, correctionMultiCorpsF42=correctionMultiCorpsF42, wallAdaptF42=wallAdaptF42, blankingF42=blankingF42, tbFilament=tbFilament) @@ -1142,9 +1142,9 @@ def _blankingIBM(t, tb, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, C._rmVars(t, ['centers:cellNDummy']) for z in Internal.getZones(t): connector._updateNatureForIBM(z, IBCType, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) else: C._initVars(t,'{centers:cellNFront}=logical_and({centers:cellNIBC}>0.5, {centers:cellNIBC}<1.5)') if isWireModel: @@ -1162,9 +1162,9 @@ def _blankingIBM(t, tb, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, C._initVars(z,'{centers:cellNFront_2}=logical_and({centers:cellNIBC_2}>0.5, {centers:cellNIBC_2}<1.5)') connector._updateNatureForIBM(z, IBCType, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) C._initVars(t,'{centers:cellN}=maximum(0.,{centers:cellNChim})') # vaut -3, 0, 1, 2 initialement return None @@ -1183,7 +1183,7 @@ def _blankingIBM(t, tb, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, # OUT: front: front of image points # OUT: front2: (optional): front of second image points #========================================================================= -def _pushBackImageFront2__(t, tc, tbbc, cartesian=True): +def _pushBackImageFront2__(t, tc, tbbc, cartesian=True): # bboxDict needed for optimised AddXZones (i.e. "layers" not None) # Return a dict with the zones of t as keys and their specific bboxes as key values bboxDict = Cmpi.createBboxDict(t) @@ -1195,9 +1195,9 @@ def _pushBackImageFront2__(t, tc, tbbc, cartesian=True): # if subr, the tree subregions are kept during the exchange # if layers not None, only communicate the desired number of layers Cmpi._addLXZones(tc, graph, variables=['cellNIBC','cellNChim','cellNFront'], cartesian=cartesian, - interDict=interDict,bboxDict=bboxDict, layers=4, subr=False) + interDict=interDict,bboxDict=bboxDict, layers=4, subr=False) Cmpi._addLXZones(t, graph, variables=['centers:cellNIBC', 'centers:cellNChim', 'centers:cellNFront'], cartesian=cartesian, - interDict=interDict, bboxDict=bboxDict, layers=4, subr=False) + interDict=interDict, bboxDict=bboxDict, layers=4, subr=False) # Zones of tc are modified after addXZones, new tbbc, interDict and intersectionDict tbbcx = G.BB(tc) @@ -1240,11 +1240,11 @@ def _pushBackImageFront2__(t, tc, tbbc, cartesian=True): if zc[0] in intersectionsDict[z[0]]: C._cpVars(zc,'cellN_interp',zc,'cellN') fields = X.transferFields(zc, XI, YI, ZI, hook=None, variables=['cellNFront_origin','cellNIBC_origin'], - interpDataType=interpDataType, nature=1) + interpDataType=interpDataType, nature=1) allInterpFields.append(fields) if allInterpFields!=[]: C._filterPartialFields(z, allInterpFields, indicesI, loc='centers', startFrom=0, filterName='donorVol', - verbose=False) + verbose=False) Cmpi._rmXZones(tc) Cmpi._rmXZones(t) @@ -1258,7 +1258,7 @@ def _pushBackImageFront2__(t, tc, tbbc, cartesian=True): sizeOne = int(numpy.sum(cellNFront)) if sizeOne < sizeTot: # Modification du Front uniquement lorsque celui-ci est repousse - C._initVars(z,'{centers:cellNFront}={centers:cellNFront}*({centers:cellNFront_origin}>0.5)') + C._initVars(z,'{centers:cellNFront}={centers:cellNFront}*({centers:cellNFront_origin}>0.5)') # i.e. if cellNFront_origin == 0 and cellNFront == 1 => cellNfront = 0 C._initVars(z,'{centers:cellNIBC}={centers:cellNIBC}*(1.-({centers:cellNChim}==1.)*({centers:cellNIBC_origin}>1.5)*({centers:cellNIBC_origin}<2.5)) \ @@ -1362,20 +1362,20 @@ def buildFrontIBM(t, tc, tb=None, dimPb=3, frontType=1, cartesian=True, twoFront # OUT: IBCD* zones inside tc # OUT: (optional) 2_IBCD* zones inside tc #========================================================================= -def setInterpDataIBM(t, tc, tb, front, front2=None, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, +def setInterpDataIBM(t, tc, tb, front, front2=None, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, yplus=100, Lref=1., cartesian=True, twoFronts=False, check=False, tbFilament=None, frontWMM=None): """Compute the transfer coefficients and data for IBM pre-processing.""" tp = Internal.copyRef(t) - _setInterpDataIBM(t, tc, tb, front, front2=front2, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, - Reynolds=Reynolds, yplus=yplus, Lref=Lref, + _setInterpDataIBM(t, tc, tb, front, front2=front2, dimPb=dimPb, frontType=frontType, IBCType=IBCType, depth=depth, + Reynolds=Reynolds, yplus=yplus, Lref=Lref, cartesian=cartesian, twoFronts=twoFronts, check=check, tbFilament=tbFilament, frontWMM=frontWMM) return tp -def _setInterpDataIBM(t, tc, tb, front, front2=None, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, +def _setInterpDataIBM(t, tc, tb, front, front2=None, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, yplus=100, Lref=1., cartesian=True, twoFronts=False, check=False, - tbFilament=None, frontWMM=None): + tbFilament=None, frontWMM=None): """Compute the transfer coefficients and data for IBM pre-processing.""" isFilamentOnly, isWireModel = D_IBM.localWMMFlags__(tb, tbFilament) @@ -1429,7 +1429,7 @@ def _setInterpDataIBM(t, tc, tb, front, front2=None, dimPb=3, frontType=1, IBCTy ##detele in res2 item_del=[] for ii in res2[j]: - if "140" not in ii: item_del.append(ii) + if "140" not in ii: item_del.append(ii) for ii in item_del: del res2[j][ii] ##add to res for ii in restmp[j]: res[j][ii] = restmp[j][ii] @@ -1466,7 +1466,7 @@ def _setInterpDataIBM(t, tc, tb, front, front2=None, dimPb=3, frontType=1, IBCTy dictOfCorrectedPtsByIBCType2={} dictOfWallPtsByIBCType2 ={} dictOfInterpPtsByIBCType2 ={} - interDictIBM2={} + interDictIBM2={} if dictOfCorrectedPtsByIBCType!={}: for ibcTypeL in dictOfCorrectedPtsByIBCType: @@ -1501,13 +1501,13 @@ def _setInterpDataIBM(t, tc, tb, front, front2=None, dimPb=3, frontType=1, IBCTy allInterpPts2 = dictOfInterpPtsByIBCType2[ibcTypeL] for nozr in range(nbZonesIBC): if allCorrectedPts2[nozr] != []: - ##[AJ] Keep temporarily - ##if ibcTypeL=="140#filament": - ## nlen = numpy.shape(allInterpPts2[nozr][1])[1] - ## save2file = numpy.zeros((nlen,2),dtype=float) - ## save2file[:,0]=allInterpPts2[nozr][1][0][:] - ## save2file[:,1]=allInterpPts2[nozr][1][1][:] - ## numpy.savetxt('allInterpPts2.txt', save2file, delimiter=',') # X is an array + ##[AJ] Keep temporarily + ##if ibcTypeL=="140#filament": + ## nlen = numpy.shape(allInterpPts2[nozr][1])[1] + ## save2file = numpy.zeros((nlen,2),dtype=float) + ## save2file[:,0]=allInterpPts2[nozr][1][0][:] + ## save2file[:,1]=allInterpPts2[nozr][1][1][:] + ## numpy.savetxt('allInterpPts2.txt', save2file, delimiter=',') # X is an array zrname = zonesRIBC[nozr][0] interpPtsBB2 = Generator.BB(allInterpPts2[nozr]) for z in zones: @@ -1557,8 +1557,8 @@ def _setInterpDataIBM(t, tc, tb, front, front2=None, dimPb=3, frontType=1, IBCTy if zd is None: print('!!!Zone None', zrname, zdname) else: dnrZones.append(zd) XOD._setIBCDataForZone__(zrcv, dnrZones, allCorrectedPts[nozr], allWallPts[nozr], allInterpPts[nozr], - nature=1, penalty=1, loc='centers', storage='inverse', dim=dimPb, - interpDataType=interpDataType, ReferenceState=ReferenceState, bcType=ibcTypeL,model=model) + nature=1, penalty=1, loc='centers', storage='inverse', dim=dimPb, + interpDataType=interpDataType, ReferenceState=ReferenceState, bcType=ibcTypeL,model=model) nozr += 1 for zd in dnrZones: @@ -1596,8 +1596,8 @@ def _setInterpDataIBM(t, tc, tb, front, front2=None, dimPb=3, frontType=1, IBCTy if zd is None: print('!!!Zone None', zrname, zdname) else: dnrZones.append(zd) XOD._setIBCDataForZone2__(zrcv, dnrZones, allCorrectedPts2[nozr], allWallPts2[nozr], None, allInterpPts2[nozr], - nature=1, penalty=1, loc='centers', storage='inverse', dim=dimPb, - interpDataType=interpDataType, ReferenceState=ReferenceState, bcType=ibcTypeL) + nature=1, penalty=1, loc='centers', storage='inverse', dim=dimPb, + interpDataType=interpDataType, ReferenceState=ReferenceState, bcType=ibcTypeL) nozr += 1 for zd in dnrZones: @@ -1727,13 +1727,13 @@ def _tcInitialize__(tc, tc2=None, ibctypes=[], isWireModel=False): if RENAMEIBCNODES: for zc in Internal.getZones(tc): - for ibcd in Internal.getNodesFromName1(zc,'IBCD_*'): + for ibcd in Internal.getNodesFromName1(zc,'IBCD_*'): proposedName = Internal.getName(ibcd)[0:6]+'_X%d'%(Cmpi.rank) ibcd[0] = getIBCDName(proposedName) if tc2: for zc in Internal.getZones(tc2): - for ibcd in Internal.getNodesFromName1(zc,'IBCD_*'): + for ibcd in Internal.getNodesFromName1(zc,'IBCD_*'): proposedName = Internal.getName(ibcd)[0:8]+'_X%d'%(Cmpi.rank) ibcd[0] = getIBCDName(proposedName) @@ -1756,7 +1756,7 @@ def _tcInitialize__(tc, tc2=None, ibctypes=[], isWireModel=False): if 'Mafzal' in ibctypes: Internal._createUniqueChild(solverIBC, 'isgradP' , 'DataArray_t', 'True') Internal._createUniqueChild(solverIBC, 'mafzalMode', 'DataArray_t', 0) - Internal._createUniqueChild(solverIBC, 'alphaGrad' , 'DataArray_t', 0) + Internal._createUniqueChild(solverIBC, 'alphaGrad' , 'DataArray_t', 0) # if twoFronts: # Internal._createUniqueChild(solverIBC, 'isgradP' , 'DataArray_t', 'True') # Internal._createUniqueChild(solverIBC, 'alphaGrad' , 'DataArray_t', 0) @@ -1765,11 +1765,11 @@ def _tcInitialize__(tc, tc2=None, ibctypes=[], isWireModel=False): Internal._createUniqueChild(solverIBC, 'DeltaVWire' , 'DataArray_t', 0) Internal._createUniqueChild(solverIBC, 'KWire' , 'DataArray_t', 0) Internal._createUniqueChild(solverIBC, 'DiameterWire', 'DataArray_t', 0) - Internal._createUniqueChild(solverIBC, 'CtWire' , 'DataArray_t', 0) + Internal._createUniqueChild(solverIBC, 'CtWire' , 'DataArray_t', 0) if 'TBLE' in ibctypes or 'TBLE_FULL' in ibctypes: Internal._createUniqueChild(solverIBC, 'isTBLE' , 'DataArray_t', 'True') Internal._createUniqueChild(solverIBC, 'alphaGrad' , 'DataArray_t', 0) - Internal._createUniqueChild(solverIBC, 'NbPtsLinelits' , 'DataArray_t', 0) + Internal._createUniqueChild(solverIBC, 'NbPtsLinelits' , 'DataArray_t', 0) return None @@ -1780,7 +1780,7 @@ def _tInitialize__(t, tinit=None, model='NSTurbulent', isWireModel=False): if model != "Euler": C._initVars(t, 'centers:ViscosityEddy', 0.) if isWireModel: vars_wm = ['Density','VelocityX','VelocityY','VelocityZ','Temperature'] - if model == 'NSTurbulent':vars_wm.append('TurbulentSANuTilde') + if model == 'NSTurbulent':vars_wm.append('TurbulentSANuTilde') for z in Internal.getZones(t): for v_local in vars_wm: C._initVars(z,'{centers:'+v_local+'_WM}=0.') @@ -1957,7 +1957,7 @@ def _blankByIBCBodies(t, tb, loc, dim, cellNName='cellN'): print('Info: blankByIBCBodies: reverse blanking for body.') X._blankCellsTri(t, [body], BM2, blankingType=typeb, cellNName=cellNName) C._initVars(t,'{centers:%s}=1-{centers:%s}'%(cellNName,cellNName)) # ecoulement interne - for body in bodies: + for body in bodies: X._blankCellsTri(t, [body], BM2, blankingType=typeb, cellNName=cellNName) return None @@ -1968,7 +1968,7 @@ def _blankByIBCBodies(t, tb, loc, dim, cellNName='cellN'): #============================================================================= # Returns the front defining the image points -# IN: frontvar: +# IN: frontvar: # IN: dim: 2 or 3 # IN: frontType: 0 (equal distance), 1 (minimum distance), 42 (modelling height) #============================================================================= @@ -2311,7 +2311,7 @@ def extractIBMInfo(tc_in, IBCNames="IBCD_*", fileout=None): # IN: isOrthoFirst: Apply orthogonal projection first and level set normal decscent second. Needed for IBC filaments only. # IN: twoFront: Needed to change the output of the projection write files. # ============================================================================= -def getAllIBMPoints(t, loc='nodes', hi=0., he=0., tb=None, tfront=None, frontType=0, cellNName='cellN', +def getAllIBMPoints(t, loc='nodes', hi=0., he=0., tb=None, tfront=None, frontType=0, cellNName='cellN', IBCType=1, depth=2, Reynolds=6.e6, yplus=100., Lref=1., hmod=0.1, isLBM=False, isWireModel=False, isOrthoFirst=False, check=False, twoFronts=False): """Returns the dictionary of IBM points.""" @@ -2347,7 +2347,7 @@ def getAllIBMPoints(t, loc='nodes', hi=0., he=0., tb=None, tfront=None, frontTyp if frontType == 42: listOfModelisationHeightsLoc.append(G_IBM_Height.computeModelisationHeight(Re=Reynolds, yplus=yplus, L=Lref)) else: listOfModelisationHeightsLoc.append(0.) - else: + else: for z in Internal.getZones(t): an = C.getFields(Internal.__GridCoordinates__,z)[0] an = Converter.node2Center(an) @@ -2429,7 +2429,7 @@ def getAllIBMPoints(t, loc='nodes', hi=0., he=0., tb=None, tfront=None, frontTyp front = Converter.convertArray2Tetra(front) allCorrectedPts = Converter.extractVars(allCorrectedPts,['CoordinateX','CoordinateY','CoordinateZ']+varsn) res = connector.getIBMPtsWithFront(allCorrectedPts, listOfSnearsLoc, listOfModelisationHeightsLoc, bodies, - front, varsn, signOfDistCorrected, depth, int(isWireModel), int(isOrthoFirst)) + front, varsn, signOfDistCorrected, depth, int(isWireModel), int(isOrthoFirst)) allWallPts = res[0] allWallPts = Converter.extractVars(allWallPts,['CoordinateX','CoordinateY','CoordinateZ']) @@ -2443,7 +2443,7 @@ def getAllIBMPoints(t, loc='nodes', hi=0., he=0., tb=None, tfront=None, frontTyp dictOfWallPtsByIBCType={} nzonesR = len(allInterpPts) - ## Ouput the IBM points that have a type 3 and type 4 projection + ## Ouput the IBM points that have a type 3 and type 4 projection if len(res)>3: nameZone = ['IBM', 'Wall', 'Image'] tLocal3 = C.newPyTree(nameZone) @@ -3771,7 +3771,7 @@ def prepareIBMData2(t, tbody, DEPTH=2, loc='centers', frontType=1, inv=False, in else: dictOfADT = None print('Interpolations Chimere.') tc = doInterp2(t, tc, tbb, tb=None, typeI='ID', dim=dimPb, - interpDataType=interpDataType, dictOfADT=dictOfADT) + interpDataType=interpDataType, dictOfADT=dictOfADT) if dictOfADT is not None: for dnrname in dictOfADT: C.freeHook(dictOfADT[dnrname]) @@ -3918,20 +3918,20 @@ def doInterp3(t, tc, tbb, tb=None, typeI='ID', dim=3, dictOfADT=None, frontType= # dir_list=[] # for join in listofjoins: # prange_ = Internal.getNodeFromName1(join,'PointRange')[1] - #dirR = CGC.getDirBorderStruct__(prange_,dimPb) - #dir_list.append(dirR) - #print 'prange_= ', prange_ + #dirR = CGC.getDirBorderStruct__(prange_,dimPb) + #dir_list.append(dirR) + #print 'prange_= ', prange_ # for i in range(3): # if prange_[i,1] == prange_[i,0] and prange_[i,1] != 1: # prange_[i,1] = prange_[i,1]-1 # prange_[i,0] = prange_[i,0]-1 # elif prange_[i,1] != prange_[i,0] and prange_[i,1] != 1 : - # prange_[i,1] = prange_[i,1]-1 - # prange_=numpy.reshape(prange_,6) - # prange_list.append(prange_) - # dico[zrcv[0]]=prange_list - #dico[zrcv[0]]=dir_list - # print prange_, zrcv[0] + # prange_[i,1] = prange_[i,1]-1 + # prange_=numpy.reshape(prange_,6) + # prange_list.append(prange_) + # dico[zrcv[0]]=prange_list + #dico[zrcv[0]]=dir_list + # print prange_, zrcv[0] nozr = 0 @@ -4144,7 +4144,7 @@ def _setInjOutlet__(tc, tb): hStag = Internal.getValue(Internal.getNodeFromName(sol, 'StagnationEnthalpy')); dirx = Internal.getValue(Internal.getNodeFromName(sol, 'dirx')); diry = Internal.getValue(Internal.getNodeFromName(sol, 'diry')); - dirz = Internal.getValue(Internal.getNodeFromName(sol, 'dirz')); + dirz = Internal.getValue(Internal.getNodeFromName(sol, 'dirz')); DicInj[famName] = str(pStag)+'|'+str(hStag)+'|'+str(dirx)+'|'+str(diry)+'|'+str(dirz) for dic in DicOutP: @@ -4188,12 +4188,12 @@ def _writeOutputProject__(outputProjection, tLocal): size = len(outputProjection[i*3]) coordxPC = numpy.array(outputProjection[i*3 ]) coordyPC = numpy.array(outputProjection[i*3+1]) - coordzPC = numpy.array(outputProjection[i*3+2]) + coordzPC = numpy.array(outputProjection[i*3+2]) zone = G.cart((0,0,0),(1,1,1),(size,1,1)) zone[0] = nameZone[i]+"%"+str(Cmpi.rank) cont = Internal.getNodeFromName1(zone, Internal.__GridCoordinates__) XPC0 = Internal.getNodeFromName1(cont, 'CoordinateX') - XPC0[1] = coordxPC + XPC0[1] = coordxPC YPC0 = Internal.getNodeFromName1(cont, 'CoordinateY') YPC0[1] = coordyPC ZPC0 = Internal.getNodeFromName1(cont, 'CoordinateZ') diff --git a/Cassiopee/Connector/Connector/Mpi.py b/Cassiopee/Connector/Connector/Mpi.py index b20f556ea..bfb1eeccb 100644 --- a/Cassiopee/Connector/Connector/Mpi.py +++ b/Cassiopee/Connector/Connector/Mpi.py @@ -4,7 +4,7 @@ import Converter.Internal as Internal import Converter.PyTree as C import Converter.converter -import numpy +import numpy from . import connector import RigidMotion.PyTree as RM @@ -38,13 +38,13 @@ def connectMatch(a, tol=1.e-6, dim=3): # Ajout des bandelettes Cmpi._addBXZones(a, depth=2) - # Construction des raccords + # Construction des raccords a = X.connectMatch(a, tol=tol, dim=dim) - # Suppression des XZones et correction des matchs + # Suppression des XZones et correction des matchs Cmpi._rmBXZones(a) - # Fusion des fenetres des raccords + # Fusion des fenetres des raccords a = mergeWindows(a) return a @@ -52,7 +52,7 @@ def connectMatch(a, tol=1.e-6, dim=3): #============================================================================== def connectNearMatch(a, ratio=2, tol=1.e-6, dim=3): """Find boundaries that matches with a given ratio.""" - if not isinstance(ratio, list): + if not isinstance(ratio, list): iratio = ratio else: iratio = 1 @@ -66,7 +66,7 @@ def connectNearMatch(a, ratio=2, tol=1.e-6, dim=3): for z in Internal.getZones(a): gcs = Internal.getNodesFromType1(z, 'ZoneGridConnectivity_t') - for g in gcs: + for g in gcs: nodes = Internal.getNodesFromType1(g, 'GridConnectivity_t') for n in nodes: gctype = Internal.getNodeFromType(n,'GridConnectivityType_t') @@ -79,16 +79,16 @@ def connectNearMatch(a, ratio=2, tol=1.e-6, dim=3): if fratio==1.: Internal._rmNodesByName(z,n[0]) - # Suppression des XZones et correction des matchs + # Suppression des XZones et correction des matchs Cmpi._rmBXZones(a) - # Fusion des fenetres des raccords + # Fusion des fenetres des raccords a = mergeWindows(a) return a #============================================================================== -# connectMatchPeriodic +# connectMatchPeriodic #============================================================================== def connectMatchPeriodic(a, rotationCenter=[0.,0.,0.], rotationAngle=[0.,0.,0.], @@ -98,16 +98,16 @@ def connectMatchPeriodic(a, rotationCenter=[0.,0.,0.], # Ajout des bandelettes Cmpi._addBXZones(a, depth=2,allB=True) - # Construction des raccords + # Construction des raccords a = X.connectMatchPeriodic(a,rotationCenter,rotationAngle,translation,tol,dim,unitAngle) - # Suppression des XZones et correction des matchs + # Suppression des XZones et correction des matchs Cmpi._rmBXZones(a) - # Fusion des fenetres des raccords + # Fusion des fenetres des raccords a = mergeWindows(a) - return a + return a #============================================================================== def giveName2Window(p, zname, zopp): @@ -132,10 +132,10 @@ def mergeWindows(t): for z in zones: xz = Internal.getNodeFromName1(z, 'XZone') if xz is None: - # Construction du dictionnaire des matchs + # Construction du dictionnaire des matchs dico = {} gcs = Internal.getNodesFromType1(z, 'ZoneGridConnectivity_t') - for g in gcs: + for g in gcs: nodes = Internal.getNodesFromType1(g, 'GridConnectivity1to1_t') for n in Internal.getNodesFromType1(g,'GridConnectivity_t'): @@ -166,18 +166,18 @@ def mergeWindows(t): if pglob[0] is None: pglob[0] = p[0] ; pglob[1] = p[1] pglob[2] = p[2] ; pglob[3] = p[3] - pglob[4] = p[4] ; pglob[5] = p[5] + pglob[4] = p[4] ; pglob[5] = p[5] else: if pglob[0] > p[0] : pglob[0] = p[0] if pglob[1] < p[1] : pglob[1] = p[1] if pglob[2] > p[2] : pglob[2] = p[2] - if pglob[3] < p[3] : pglob[3] = p[3] + if pglob[3] < p[3] : pglob[3] = p[3] if pglob[4] > p[4] : pglob[4] = p[4] if pglob[5] < p[5] : pglob[5] = p[5] surfMatch = max(1,(pglob[1]-pglob[0]))*max(1,(pglob[3]-pglob[2]))*max(1,(pglob[5]-pglob[4])) - # Fusion des matchs + # Fusion des matchs if surfMatch == sumSurf: # Fenetre du match donneur pglobD = [None]*6 @@ -195,15 +195,15 @@ def mergeWindows(t): if pglobD[0] > pd[0] : pglobD[0] = pd[0] if pglobD[1] < pd[1] : pglobD[1] = pd[1] if pglobD[2] > pd[2] : pglobD[2] = pd[2] - if pglobD[3] < pd[3] : pglobD[3] = pd[3] + if pglobD[3] < pd[3] : pglobD[3] = pd[3] if pglobD[4] > pd[4] : pglobD[4] = pd[4] if pglobD[5] < pd[5] : pglobD[5] = pd[5] - # Modif du 1er match et suppression des autres - first = True + # Modif du 1er match et suppression des autres + first = True for name in dico[match]: if first: - first = False + first = False modifMatch = dico[match][0] node = Internal.getNodeFromName(z,modifMatch) pr = Internal.getNodeFromName1(node, 'PointRange') @@ -234,23 +234,23 @@ def mergeWindows(t): # Adim: KCore.adim1 for Minf=0.1 #=============================================================================== def setInterpTransfers(aR, aD, variables=[], cellNVariable='', - variablesIBC=['Density','MomentumX','MomentumY','MomentumZ','EnergyStagnationDensity'], + variablesIBC=['Density','MomentumX','MomentumY','MomentumZ','EnergyStagnationDensity'], bcType=0, varType=1, graph=None, - procDict=None, type='ALLD', - Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08, + procDict=None, type='ALLD', + Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08, Cs=0.3831337844872463, Ts=1.0, alpha=1.): tp = Internal.copyRef(aR) compact = 0 - _setInterpTransfers(tp, aD, variables=variables, cellNVariable=cellNVariable, variablesIBC=variablesIBC, - bcType=bcType, varType=varType, compact=compact, graph=graph, + _setInterpTransfers(tp, aD, variables=variables, cellNVariable=cellNVariable, variablesIBC=variablesIBC, + bcType=bcType, varType=varType, compact=compact, graph=graph, procDict=procDict, type=type, Gamma=Gamma, Cv=Cv, MuS=MuS, Cs=Cs, Ts=Ts) return tp #=============================================================================== def _setInterpTransfers(aR, aD, variables=[], cellNVariable='', - variablesIBC=['Density','MomentumX','MomentumY','MomentumZ','EnergyStagnationDensity'], - bcType=0, varType=1, compact=0, graph=None, + variablesIBC=['Density','MomentumX','MomentumY','MomentumZ','EnergyStagnationDensity'], + bcType=0, varType=1, compact=0, graph=None, procDict=None, type='ALLD', - Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08, + Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08, Cs=0.3831337844872463, Ts=1.0, alpha=1.): if procDict is None: procDict = Cmpi.getProcDict(aD) @@ -262,8 +262,8 @@ def _setInterpTransfers(aR, aD, variables=[], cellNVariable='', datas = {} zonesD = Internal.getZones(aD) for zD in zonesD: - infos = X.setInterpTransfersD(zD, variables=variables, cellNVariable=cellNVariable, variablesIBC=variablesIBC, - bcType=bcType, varType=varType, compact=compact, Gamma=Gamma, Cv=Cv, MuS=MuS, + infos = X.setInterpTransfersD(zD, variables=variables, cellNVariable=cellNVariable, variablesIBC=variablesIBC, + bcType=bcType, varType=varType, compact=compact, Gamma=Gamma, Cv=Cv, MuS=MuS, Cs=Cs, Ts=Ts, alpha=alpha) for n in infos: rcvName = n[0] @@ -337,7 +337,7 @@ def _setInterpTransfersForPressureGradients(aR, aD, ibctypes=[], secondOrder=Fal return None #=============================================================================== -# __setInterpTransfers - version optimisee de _setInterpTransfers: arbre t et tc compact, +# __setInterpTransfers - version optimisee de _setInterpTransfers: arbre t et tc compact, # moins de python + de C # # Warning: inverse storage! @@ -390,7 +390,7 @@ def __setInterpTransfers(zones, zonesD, vars, dtloc, param_int, param_real, type rank = Cmpi.rank infos = connector.__setInterpTransfersD(zones, zonesD, vars, dtloc, param_int, param_real, it_target, varType, type_transfert, no_transfert, nstep, nitmax, rk, exploc, num_passage, rank, - isWireModel_int, isIbmMoving_int) + isWireModel_int, isIbmMoving_int) if infos != []: for n in infos: rcvNode = dest @@ -412,7 +412,7 @@ def __setInterpTransfers(zones, zonesD, vars, dtloc, param_int, param_real, type ## count+=1 # Envoie des numpys suivant le graph - if graph is not None: + if graph is not None: rcvDatas = Cmpi.sendRecvC(datas, graph) #rcvDatas = Cmpi.sendRecv(datas, graph) else: rcvDatas = {} @@ -442,11 +442,11 @@ def __setInterpTransfers(zones, zonesD, vars, dtloc, param_int, param_real, type # transfert de ['Density', 'VelocityX', 'VelocityY', 'VelocityZ', 'Temperature', 'nuSA'] -> 6 vars # transfert de ['gradx/y/zDensity', 'gradx/y/zTemperature'] -> 6 varsGrad # varType 22 : tc2/tc -> RCV ZONES -# varType 23 : RCV ZONES -> tc +# varType 23 : RCV ZONES -> tc #=============================================================================== def __setInterpTransfers4GradP(zones, zonesD, vars, param_int, param_real, type_transfert, it_target, - nstep, nitmax, rk, exploc, num_passage, varType=1, compact=1, - graph=None, procDict=None): + nstep, nitmax, rk, exploc, num_passage, varType=1, compact=1, + graph=None, procDict=None): isWireModelPrep= False isWireModel = False # Transferts locaux/globaux @@ -468,9 +468,9 @@ def __setInterpTransfers4GradP(zones, zonesD, vars, param_int, param_real, type_ isWireModel) else: - if varType != 24: + if varType != 24: allInfos = connector.__setInterpTransfersD4GradP(zones, zonesD, vars, param_int, param_real, it_target, varType, - type_transfert, no_transfert, nstep, nitmax, rk, exploc, num_passage) + type_transfert, no_transfert, nstep, nitmax, rk, exploc, num_passage) infos = allInfos[0] infosGrad = allInfos[1] @@ -520,7 +520,7 @@ def __setInterpTransfers4GradP(zones, zonesD, vars, param_int, param_real, type_ # absFrame=True: les coordonnees de t sont deja dans le repere absolu en entree # interpInDnrFrame=True: interpolation avec les coordonnees des pts a interpoler dans le repere relatif au donneur # applicable en mouvement rigide; en mvt avec deformation: mettre False -# verbose: 0 (rien), 1 (bilan interpolation), 2 (ecrit les indices de pts orphelins), +# verbose: 0 (rien), 1 (bilan interpolation), 2 (ecrit les indices de pts orphelins), # 3 (met cellN=-1 pour les points orphelins) #--------------------------------------------------------------------------------------------------------- def _transfer2(t, tc, variables, graph, intersectionDict, dictOfADT, @@ -559,8 +559,8 @@ def _transfer2(t, tc, variables, graph, intersectionDict, dictOfADT, raise ValueError("_transfer: t and tc skeletons must be identical.") C._cpVars(z, 'centers:'+cellNName, zc, cellNName) - res = X.getInterpolatedPoints(zc, loc='nodes', cellNName=cellNName) - if res is not None: + res = X.getInterpolatedPoints(zc, loc='nodes', cellNName=cellNName) + if res is not None: indicesI, XI, YI, ZI = res #indiceI des pts cellN=2 et coord des pts # passage des coordonnees du recepteur dans le repere absolu # si mouvement gere par FastS -> les coordonnees dans z sont deja les coordonnees en absolu @@ -591,7 +591,7 @@ def _transfer2(t, tc, variables, graph, intersectionDict, dictOfADT, for oppNode in g: # Envoie les datas necessaires au noeud oppose #print('%d: On envoie a %d: %s'%(rank,oppNode,g[oppNode])) - if oppNode in datas: + if oppNode in datas: s = Converter.converter.iSend(datas[oppNode], oppNode, Cmpi.rank, Cmpi.KCOMM) else: s = Converter.converter.iSend(None, oppNode, Cmpi.rank, Cmpi.KCOMM) @@ -626,8 +626,8 @@ def _transfer2(t, tc, variables, graph, intersectionDict, dictOfADT, fields = X.transferFields(zdnr, XIRel, YIRel, ZIRel, order=order, hook=adt, variables=variables, interpDataType=interpDataType) # hack par CB - if interpInDnrFrame and Internal.getNodeFromName1(zdnr, 'TimeMotion') is not None: - TEMP = GC1[2]; GC1[2] = GC2[2]; GC2[2] = TEMP + if interpInDnrFrame and Internal.getNodeFromName1(zdnr, 'TimeMotion') is not None: + TEMP = GC1[2]; GC1[2] = GC2[2]; GC2[2] = TEMP if zname not in dictOfFields: dictOfFields[zname] = [fields] @@ -667,17 +667,17 @@ def _transfer2(t, tc, variables, graph, intersectionDict, dictOfADT, else: [XIRel,YIRel,ZIRel] = [XI,YI,ZI] # [XIRel,YIRel,ZIRel] = RM.moveN([XI,YI,ZI],coordsC,coordsD,MatAbs2RelD) - # transferts avec coordonnees dans le repere relatif + # transferts avec coordonnees dans le repere relatif if interpInDnrFrame and Internal.getNodeFromName1(zdnr, 'TimeMotion') is not None: GC1 = Internal.getNodeFromName1(zdnr, 'GridCoordinates') GC2 = Internal.getNodeFromName1(zdnr, 'GridCoordinates#Init') - TEMP = GC1[2]; GC1[2] = GC2[2]; GC2[2] = TEMP + TEMP = GC1[2]; GC1[2] = GC2[2]; GC2[2] = TEMP fields = X.transferFields(zdnr, XIRel, YIRel, ZIRel, hook=adt, variables=variables, interpDataType=interpDataType) # hack par CB if interpInDnrFrame and Internal.getNodeFromName1(zdnr, 'TimeMotion') is not None: - TEMP = GC1[2]; GC1[2] = GC2[2]; GC2[2] = TEMP + TEMP = GC1[2]; GC1[2] = GC2[2]; GC2[2] = TEMP procR = procDict[zrcvname] if procR not in transferedDatas: @@ -709,8 +709,8 @@ def _transfer2(t, tc, variables, graph, intersectionDict, dictOfADT, noz = dictOfNozOfRcvZones[zrcvname] z = t[2][nob][2][noz] allInterpFields = dictOfFields[zrcvname] - indicesI = dictOfIndices[zrcvname] - C._filterPartialFields(z, allInterpFields, indicesI, loc='centers', startFrom=0, + indicesI = dictOfIndices[zrcvname] + C._filterPartialFields(z, allInterpFields, indicesI, loc='centers', startFrom=0, filterName='donorVol', verbose=verbose) #Cmpi.trace("8. transfer2 end") @@ -747,12 +747,12 @@ def _setInterpData(aR, aD, order=2, penalty=1, nature=0, extrap=1, # Le graph doit correspondre au probleme if itype == 'abutting': graph = Cmpi.computeGraph(aR, type='match', reduction=True) - Cmpi._addXZones(aR, graph, variables=[], noCoordinates=True, + Cmpi._addXZones(aR, graph, variables=[], noCoordinates=True, cartesian=False, zoneGC=True, keepOldNodes=False) - Cmpi._addXZones(aD, graph, variables=[], noCoordinates=True, + Cmpi._addXZones(aD, graph, variables=[], noCoordinates=True, cartesian=False, zoneGC=True, keepOldNodes=False) X._setInterpData(aR, aD, order=order, penalty=penalty, nature=nature, extrap=extrap, - method=method, loc=loc, storage=storage, interpDataType=interpDataType, hook=hook, + method=method, loc=loc, storage=storage, interpDataType=interpDataType, hook=hook, topTreeRcv=topTreeRcv, topTreeDnr=topTreeDnr, sameName=sameName, dim=dim, itype=itype, dictOfModels=dictOfModels) Cmpi._rmXZones(aR); Cmpi._rmXZones(aD) @@ -767,24 +767,24 @@ def _setInterpData(aR, aD, order=2, penalty=1, nature=0, extrap=1, for i in interDict: bi = baseNames[i] out = [] - for z in interDict[i]: + for z in interDict[i]: if bi != baseNames[z]: out.append(z) interDict[i] = out graph = Cmpi.computeGraph(tbbc, type='bbox', intersectionsDict=interDict, reduction=False) - Cmpi._addXZones(aR, graph, variables=['centers:cellN'], noCoordinates=False, + Cmpi._addXZones(aR, graph, variables=['centers:cellN'], noCoordinates=False, cartesian=False, zoneGC=False, keepOldNodes=False) - Cmpi._addXZones(aD, graph, variables=['centers:cellN'], noCoordinates=False, + Cmpi._addXZones(aD, graph, variables=['centers:cellN'], noCoordinates=False, cartesian=False, zoneGC=False, keepOldNodes=False) X._setInterpData(aR, aD, order=order, penalty=penalty, nature=nature, extrap=extrap, - method=method, loc=loc, storage=storage, interpDataType=interpDataType, hook=hook, + method=method, loc=loc, storage=storage, interpDataType=interpDataType, hook=hook, topTreeRcv=topTreeRcv, topTreeDnr=topTreeDnr, sameName=sameName, dim=dim, itype=itype, dictOfModels=dictOfModels) Cmpi._rmXZones(aR); Cmpi._rmXZones(aD) - elif itype == 'chimera': # nouvelle version + elif itype == 'chimera': # nouvelle version tbbc = Cmpi.createBBoxTree(aD) interDict = X.getIntersectingDomains(tbbc) procDict = Cmpi.getProcDict(aD) @@ -805,23 +805,23 @@ def _setInterpData(aR, aD, order=2, penalty=1, nature=0, extrap=1, # Perform addXZones on aD graph = Cmpi.computeGraph(tbbc, type='bbox', intersectionsDict=interDict, reduction=False) - Cmpi._addXZones(aD, graph, variables=['cellN'], noCoordinates=False, + Cmpi._addXZones(aD, graph, variables=['cellN'], noCoordinates=False, cartesian=cartesian, zoneGC=False, keepOldNodes=False) # serialisation eventuelle #graphs = Cmpi.splitGraph(graph) #for g in graphs: - # Cmpi._addXZones(aD, g, variables=['centers:cellN'], noCoordinates=False, + # Cmpi._addXZones(aD, g, variables=['centers:cellN'], noCoordinates=False, # cartesian=False, zoneGC=False, keepOldNodes=False) # Build hook on local aD zones - hooks = {}; + hooks = {}; for b in Internal.getBases(aD): if b[0] == 'CARTESIAN': for z in Internal.getZones(b): hooks[z[0]] = None # must be None for Cartesian else: - for z in Internal.getZones(b): + for z in Internal.getZones(b): hooks[z[0]] = C.createHook(z, 'adt') datas = {} @@ -846,12 +846,12 @@ def _setInterpData(aR, aD, order=2, penalty=1, nature=0, extrap=1, else: interpDataTypeL.append(1) if dnrZones != []: - X._setInterpData(zr, dnrZones, order=order, penalty=penalty, - nature=nature, extrap=extrap, verbose=verbose, - method=method, loc=loc, storage=storage, - interpDataType=interpDataTypeL, hook=hookL, - topTreeRcv=topTreeRcv, topTreeDnr=topTreeDnr, - sameName=sameName, dim=dim, itype="chimera", dictOfModels=dictOfModels) + X._setInterpData(zr, dnrZones, order=order, penalty=penalty, + nature=nature, extrap=extrap, verbose=verbose, + method=method, loc=loc, storage=storage, + interpDataType=interpDataTypeL, hook=hookL, + topTreeRcv=topTreeRcv, topTreeDnr=topTreeDnr, + sameName=sameName, dim=dim, itype="chimera", dictOfModels=dictOfModels) for zd in dnrZones: zdname = zd[0] @@ -898,7 +898,7 @@ def _setInterpData2(tR, tD, order=2, loc='centers', cartesian=False): """Compute interpolation data for 2 different trees.""" if loc == 'nodes': varcelln = 'cellN' - else: varcelln = 'centers:cellN' + else: varcelln = 'centers:cellN' # Clean previous IDs if necessary Internal._rmNodesFromType(tD, 'ZoneSubRegion_t') @@ -916,9 +916,9 @@ def _setInterpData2(tR, tD, order=2, loc='centers', cartesian=False): interDictD2R = X.getIntersectingDomains(tDBB, tsBB) graph = Cmpi.computeGraph(tDBB, type='bbox3', intersectionsDict=interDictD2R, - procDict=procDictD, procDict2=procDicts, t2=tsBB, reduction=True) + procDict=procDictD, procDict2=procDicts, t2=tsBB, reduction=True) graph2 = Cmpi.computeGraph(tsBB, type='bbox3', intersectionsDict=interDicts, - procDict=procDicts, procDict2=procDictD, t2=tDBB, reduction=True) + procDict=procDicts, procDict2=procDictD, t2=tDBB, reduction=True) Cmpi._addXZones(tD, graph, variables=['cellN'], cartesian=cartesian, subr=False, keepOldNodes=False) datas = {} @@ -1026,7 +1026,7 @@ def __setInterpTransfers_WireModel(zones, zonesD, vars, dtloc, param_int, param_ for dest in rcvDatas: for [name, zname, ListDonor, ListRcv, dens_wm, velx_wm, vely_wm, velz_wm, temp_wm, sanu_wm] in rcvDatas[dest]: zr = znr[zname] - connector._WM_getVal2tc(zr, variablesIBC, ListRcv, + connector._WM_getVal2tc(zr, variablesIBC, ListRcv, dens_wm, velx_wm, vely_wm, velz_wm, temp_wm, sanu_wm, 1, nvars, Internal.__GridCoordinates__, diff --git a/Cassiopee/Connector/Connector/OversetData.py b/Cassiopee/Connector/Connector/OversetData.py index f6caa797b..25796186a 100644 --- a/Cassiopee/Connector/Connector/OversetData.py +++ b/Cassiopee/Connector/Connector/OversetData.py @@ -236,7 +236,7 @@ def getCEBBIntersectingDomains(basis0, bases0, sameBase=0): [xmin2,ymin2,zmin2,xmax2,ymax2,zmax2] = G.bbox(b) if (xmax1 > xmin2-tol and xmin1 < xmax2+tol and ymax1 > ymin2-tol and ymin1 < ymax2+tol and - zmax1 > zmin2-tol and zmin1 < zmax2+tol): + zmax1 > zmin2-tol and zmin1 < zmax2+tol): bases2.append(b) # recherche des zones intersectantes par base @@ -343,11 +343,11 @@ def getCEBBTimeIntersectingDomains(base0, func, bases0, funcs, \ #============================================================================= def setIBCData(tR, tD, order=2, penalty=0, nature=0, method='lagrangian', loc='nodes', storage='direct', - interpDataType=1, hook=None, sameName=0, he=0., hi=0., tfront=None, dim=3, bcType=0, + interpDataType=1, hook=None, sameName=0, he=0., hi=0., tfront=None, dim=3, bcType=0, Reynolds=6.e6, yplus=100., Lref=1., frontType=0, tb=None): """Compute Immersed Boundary data.""" aR = Internal.copyRef(tR) - aD = Internal.copyRef(tD) + aD = Internal.copyRef(tD) _setIBCData(aR, aD, order=order, penalty=penalty, nature=nature, method=method, loc=loc, storage=storage, interpDataType=interpDataType, hook=hook, sameName=sameName, he=he, hi=hi, tfront=tfront, dim=dim, bcType=bcType, Reynolds=Reynolds, yplus=yplus, tb=tb, frontType=frontType) @@ -355,9 +355,9 @@ def setIBCData(tR, tD, order=2, penalty=0, nature=0, else: return aD def _setIBCData(aR, aD, order=2, penalty=0, nature=0, - method='lagrangian', loc='nodes', storage='direct', - interpDataType=1, hook=None, sameName=0, he=0., hi=0., tfront=None, dim=3, bcType=0, - Reynolds=6.e6, yplus=100., Lref=1., frontType=0, tb=None): + method='lagrangian', loc='nodes', storage='direct', + interpDataType=1, hook=None, sameName=0, he=0., hi=0., tfront=None, dim=3, bcType=0, + Reynolds=6.e6, yplus=100., Lref=1., frontType=0, tb=None): """Compute Immersed Boundary data.""" try: from . import ToolboxIBM as IBM except: raise ImportError("setIBCData: requires ToolboxIBM module.") @@ -378,7 +378,7 @@ def _setIBCData(aR, aD, order=2, penalty=0, nature=0, locCellND = 'nodes' # pour l'enlever ensuite si addCellN le cree dictIsCellNPresent={} - for zd in Internal.getZones(aD): + for zd in Internal.getZones(aD): dictIsCellNPresent[zd[0]]=C.isNamePresent(zd, 'cellN') _addCellN__(aD, loc=locCellND) @@ -555,14 +555,14 @@ def _setIBCDataForZone__(z, zonesDnr, correctedPts, wallPts, interpPts, loc='nod if storage == 'direct': _createInterpRegion__(z, zonesDnr[noz][0],resInterp[0][noz],resInterp[1][noz],resInterp[3][noz],\ - resInterp[2][noz], VOL, EXTRAP, ORPHAN, \ - tag='Receiver', loc=loc,itype='ibc', prefix=prefixIBCD) + resInterp[2][noz], VOL, EXTRAP, ORPHAN, \ + tag='Receiver', loc=loc,itype='ibc', prefix=prefixIBCD) # add coordinates of corrected point, wall point, interpolated point _addIBCCoords__(z, zonesDnr[noz][0], allCorrectedPts[noz], allWallPts[noz], allMirrorPts[noz], bcType, \ bcName=bcName, ReferenceState=ReferenceState, prefix=prefixIBCD,model=model) else: # inverse _createInterpRegion__(zonesDnr[noz],z[0],resInterp[1][noz],resInterp[0][noz],resInterp[3][noz],\ - resInterp[2][noz], VOL, EXTRAP, ORPHAN, \ + resInterp[2][noz], VOL, EXTRAP, ORPHAN, \ tag='Donor', loc=loc,itype='ibc', prefix=prefixIBCD) # add coordinates of corrected point, wall point, interpolated point _addIBCCoords__(zonesDnr[noz], z[0], allCorrectedPts[noz], allWallPts[noz], allMirrorPts[noz], bcType, \ @@ -571,13 +571,13 @@ def _setIBCDataForZone__(z, zonesDnr, correctedPts, wallPts, interpPts, loc='nod elif nborphan==nbinterpolated0: # Only orphan pts: orphan pt list is stored in any candidate donor zone if storage == 'direct': _createInterpRegion__(z, zonesDnr[noz][0],PL, PLD, CFS, INTERPTYPE,VOL,EXTRAP,ORPHAN, - tag='Receiver', loc=loc,itype='ibc', prefix=prefixIBCD) + tag='Receiver', loc=loc,itype='ibc', prefix=prefixIBCD) # add coordinates of corrected point, wall point, interpolated point _addIBCCoords__(z, zonesDnr[noz][0], correctedPts, wallPts, interpPts, bcType, \ bcName=bcName, ReferenceState=ReferenceState, prefix=prefixIBCD,model=model) else: # inverse _createInterpRegion__(zonesDnr[noz],z[0],PL, PLD, CFS, INTERPTYPE,VOL,EXTRAP,ORPHAN, - tag='Donor', loc=loc,itype='ibc', prefix=prefixIBCD) + tag='Donor', loc=loc,itype='ibc', prefix=prefixIBCD) # add coordinates of corrected point, wall point, interpolated point _addIBCCoords__(zonesDnr[noz], z[0], correctedPts, wallPts, interpPts, bcType, \ bcName=bcName, ReferenceState=ReferenceState, prefix=prefixIBCD,model=model) @@ -586,8 +586,8 @@ def _setIBCDataForZone__(z, zonesDnr, correctedPts, wallPts, interpPts, loc='nod # 2nd PI def _setIBCDataForZone2__(z, zonesDnr, correctedPts, wallPts, interpPts, interpPts2=None, loc='nodes', \ - order=2, penalty=0, nature=0, method='lagrangian', storage='direct',\ - interpDataType=1, hook=None, dim=3, bcType=-1, ReferenceState=None): + order=2, penalty=0, nature=0, method='lagrangian', storage='direct',\ + interpDataType=1, hook=None, dim=3, bcType=-1, ReferenceState=None): prefixIBCD ='IBCD_' prefixIBC2D ='2_IBCD_' @@ -630,8 +630,8 @@ def _setIBCDataForZone2__(z, zonesDnr, correctedPts, wallPts, interpPts, interpP if interpPts2 is not None: resInterp2 = Connector.setInterpData__(interpPts2, arraysD, order=order, penalty=penalty, \ - nature=nature, method=method, interpDataType=interpDataType,\ - hook=hook, dim=dim) + nature=nature, method=method, interpDataType=interpDataType,\ + hook=hook, dim=dim) else: resInterp2 = None @@ -725,15 +725,15 @@ def _setIBCDataForZone2__(z, zonesDnr, correctedPts, wallPts, interpPts, interpP if storage == 'direct': _createInterpRegion__(z, zonesDnr[noz][0],resInterp[0][noz],resInterp[1][noz],resInterp[3][noz],\ - resInterp[2][noz], VOL, EXTRAP, ORPHAN, \ - tag='Receiver', loc=loc,itype='ibc', prefix=prefixIBCD) + resInterp[2][noz], VOL, EXTRAP, ORPHAN, \ + tag='Receiver', loc=loc,itype='ibc', prefix=prefixIBCD) # add coordinates of corrected point, wall point, interpolated point _addIBCCoords__(z, zonesDnr[noz][0], allCorrectedPts[noz], allWallPts[noz], allMirrorPts[noz], bcType, \ bcName=bcName, ReferenceState=ReferenceState, prefix=prefixIBCD,model=model) else: # inverse _createInterpRegion__(zonesDnr[noz],z[0],resInterp[1][noz],resInterp[0][noz],resInterp[3][noz],\ - resInterp[2][noz], VOL, EXTRAP, ORPHAN, \ - tag='Donor', loc=loc,itype='ibc', prefix=prefixIBCD) + resInterp[2][noz], VOL, EXTRAP, ORPHAN, \ + tag='Donor', loc=loc,itype='ibc', prefix=prefixIBCD) # add coordinates of corrected point, wall point, interpolated point _addIBCCoords__(zonesDnr[noz], z[0], allCorrectedPts[noz], allWallPts[noz], allMirrorPts[noz], bcType, \ bcName=bcName, ReferenceState=ReferenceState, prefix=prefixIBCD,model=model) @@ -741,13 +741,13 @@ def _setIBCDataForZone2__(z, zonesDnr, correctedPts, wallPts, interpPts, interpP elif nborphan==nbinterpolated0: # Only orphan pts: orphan pt list is stored in any candidate donor zone if storage == 'direct': _createInterpRegion__(z, zonesDnr[noz][0],PL, PLD, CFS, INTERPTYPE,VOL,EXTRAP,ORPHAN, - tag='Receiver', loc=loc,itype='ibc', prefix=prefixIBCD) + tag='Receiver', loc=loc,itype='ibc', prefix=prefixIBCD) # add coordinates of corrected point, wall point, interpolated point _addIBCCoords__(z, zonesDnr[noz][0], correctedPts, wallPts, interpPts, bcType, \ bcName=bcName, ReferenceState=ReferenceState, prefix=prefixIBCD,model=model) else: # inverse _createInterpRegion__(zonesDnr[noz],z[0],PL, PLD, CFS, INTERPTYPE,VOL,EXTRAP,ORPHAN, - tag='Donor', loc=loc,itype='ibc', prefix=prefixIBCD) + tag='Donor', loc=loc,itype='ibc', prefix=prefixIBCD) # add coordinates of corrected point, wall point, interpolated point _addIBCCoords__(zonesDnr[noz], z[0], correctedPts, wallPts, interpPts, bcType, \ bcName=bcName, ReferenceState=ReferenceState, prefix=prefixIBCD,model=model) @@ -842,31 +842,31 @@ def _setIBCDataForZone2__(z, zonesDnr, correctedPts, wallPts, interpPts, interpP if storage == 'direct': _createInterpRegion__(z, zonesDnr[noz][0],resInterp2[0][noz],resInterp2[1][noz],resInterp2[3][noz],\ - resInterp2[2][noz], VOL, EXTRAP, ORPHAN, \ - tag='Receiver', loc=loc,itype='ibc2', prefix=prefixIBC2D) + resInterp2[2][noz], VOL, EXTRAP, ORPHAN, \ + tag='Receiver', loc=loc,itype='ibc2', prefix=prefixIBC2D) # add coordinates of corrected point, wall point, interpolated point _addIBCCoords2__(z, zonesDnr[noz][0], allCorrectedPts[noz], allWallPts[noz], allMirrorPts[noz], bcType, \ - bcName=bcName, ReferenceState=ReferenceState, prefix=prefixIBC2D) + bcName=bcName, ReferenceState=ReferenceState, prefix=prefixIBC2D) else: # inverse _createInterpRegion__(zonesDnr[noz],z[0],resInterp2[1][noz],resInterp2[0][noz],resInterp2[3][noz],\ - resInterp2[2][noz], VOL, EXTRAP, ORPHAN, \ - tag='Donor', loc=loc,itype='ibc2', prefix=prefixIBC2D) + resInterp2[2][noz], VOL, EXTRAP, ORPHAN, \ + tag='Donor', loc=loc,itype='ibc2', prefix=prefixIBC2D) # add coordinates of corrected point, wall point, interpolated point _addIBCCoords2__(zonesDnr[noz], z[0], allCorrectedPts[noz], allWallPts[noz], allMirrorPts[noz], bcType, \ - bcName=bcName, ReferenceState=ReferenceState, prefix=prefixIBC2D) + bcName=bcName, ReferenceState=ReferenceState, prefix=prefixIBC2D) elif nborphan==nbinterpolated0: # Only orphan pts: orphan pt list is stored in any candidate donor zone if storage == 'direct': _createInterpRegion__(z, zonesDnr[noz][0],PL, PLD, CFS, INTERPTYPE,VOL,EXTRAP,ORPHAN, - tag='Receiver', loc=loc,itype='ibc2', prefix=prefixIBC2D) + tag='Receiver', loc=loc,itype='ibc2', prefix=prefixIBC2D) # add coordinates of corrected point, wall point, interpolated point _addIBCCoords2__(z, zonesDnr[noz][0], correctedPts, wallPts, interpPts2, bcType, \ - bcName=bcName, ReferenceState=ReferenceState, prefix=prefixIBC2D) + bcName=bcName, ReferenceState=ReferenceState, prefix=prefixIBC2D) else: # inverse _createInterpRegion__(zonesDnr[noz],z[0],PL, PLD, CFS, INTERPTYPE,VOL,EXTRAP,ORPHAN, - tag='Donor', loc=loc,itype='ibc2', prefix=prefixIBC2D) + tag='Donor', loc=loc,itype='ibc2', prefix=prefixIBC2D) # add coordinates of corrected point, wall point, interpolated point _addIBCCoords2__(zonesDnr[noz], z[0], correctedPts, wallPts, interpPts2, bcType, \ - bcName=bcName, ReferenceState=ReferenceState, prefix=prefixIBC2D) + bcName=bcName, ReferenceState=ReferenceState, prefix=prefixIBC2D) return None @@ -1093,11 +1093,11 @@ def _setInterpData2(aR, aD, order=2, loc='centers', cartesian=False): else: interpDataType = 1 if loc == 'nodes': varcelln = 'cellN' - else: varcelln = 'centers:cellN' + else: varcelln = 'centers:cellN' cellNPresent = C.isNamePresent(aR, varcelln) if cellNPresent==-1: C._initVars(aR, varcelln, 2.) # interp all - _setInterpData(aR, aD, order=order, penalty=1, nature=1, extrap=1, - method='lagrangian', loc=loc, storage='inverse', + _setInterpData(aR, aD, order=order, penalty=1, nature=1, extrap=1, + method='lagrangian', loc=loc, storage='inverse', interpDataType=interpDataType, sameName=0, itype="chimera") if cellNPresent==-1: C._rmVars(aR, [varcelln]) return None @@ -1129,7 +1129,7 @@ def _setInterpData2(aR, aD, order=2, loc='centers', cartesian=False): # IN: itype='both','chimera','abutting': calcule toutes les donnees de transferts, seules les chimere, seules les match/nearmatch # OUT: stockage direct: retourne tR avec les donnees d'interpolation # OUT: stockage indirect: retourne tD avec les donnees d'interpolation -# verbose: 0 (rien), 1 (bilan interpolation), 2 (ecrit les indices de pts orphelins), +# verbose: 0 (rien), 1 (bilan interpolation), 2 (ecrit les indices de pts orphelins), # RMQ: method='conservative' -> tout le domaine receveur est pour l'instant considere a interpoler (maquette) #============================================================================== def setInterpData(tR, tD, order=2, penalty=1, nature=0, extrap=1, @@ -1536,7 +1536,7 @@ def _setInterpDataForGhostCellsNGon__(aR, aD, storage='inverse', loc='centers'): ret = connector.setInterpDataForGCNGon(FL, FLd, p, pd, a1, a2, PE, PEd) # Stockage _createInterpRegion__(zdonorp, zp[0], ret[1], ret[0], ret[3], ret[2], vols, indicesExtrap, - indicesOrphan, tag = 'Donor', loc='centers', EXDir=EXdir, + indicesOrphan, tag='Donor', loc='centers', EXDir=EXdir, itype='abutting', prefix=prefix, RotationAngle=RotationAngle, RotationCenter=RotationCenter) @@ -1689,12 +1689,12 @@ def _setInterpDataForGhostCellsStruct__(aR, aD, storage='direct', loc='nodes'): else: prefix = 'IDPERM_' if storage == 'direct': _createInterpRegion__(zp, zdonorname,res[0],res[1],res[3],res[2],vols,indicesExtrap,\ - indicesOrphan,tag = 'Receiver',loc=loc,EXDir=EXdir,itype='abutting',\ + indicesOrphan,tag='Receiver',loc=loc,EXDir=EXdir,itype='abutting',\ prefix=prefix, RotationAngle=RotationAngle, RotationCenter=RotationCenter) else: _createInterpRegion__(zdonorp, zname, res[1], res[0], res[3], res[2], vols, indicesExtrap,\ - indicesOrphan, tag = 'Donor',loc=loc,EXDir=EXdir,itype='abutting',\ + indicesOrphan, tag='Donor',loc=loc,EXDir=EXdir,itype='abutting',\ prefix=prefix,RotationAngle=RotationAngle, RotationCenter=RotationCenter) return None @@ -1750,7 +1750,7 @@ def _adaptForRANSLES__(tR, tD, dictOfModels=None): return None def _createInterpRegion__(z, zname, pointlist, pointlistdonor, interpCoef, interpType, interpVol, indicesExtrap, indicesOrphan, \ - EXDir = [], pointlistdonorExtC=None, tag='Receiver', loc='centers', itype='chimera', + EXDir=[], pointlistdonorExtC=None, tag='Receiver', loc='centers', itype='chimera', prefix=None, RotationAngle=None, RotationCenter=None): if prefix is None: if itype == 'chimera': nameSubRegion = 'ID_'+zname @@ -1919,7 +1919,7 @@ def transferFields(z, interpXN, interpYN, interpZN, order=2, penalty=1, nature=0 # IN: storage=-1/0/1: unknown/direct/inverse # IN: loc = 'nodes' or 'centers': location of receiver zone field # Pour les IBCs avec loi de paroi, il faut specifier Gamma, Cv, MuS, Cs, Ts -# compactD : 1 for IBC transfers. In that case, fields in IBCD zonesubregions must be aligned with density +# compactD : 1 for IBC transfers. In that case, fields in IBCD zonesubregions must be aligned with density #=============================================================================== def setInterpTransfers(aR, topTreeD, variables=[], cellNVariable='cellN', variablesIBC=['Density','VelocityX','VelocityY','VelocityZ','Temperature'], @@ -1934,7 +1934,7 @@ def setInterpTransfers(aR, topTreeD, variables=[], cellNVariable='cellN', tR = Internal.copyRef(aR) - _setInterpTransfers(tR, topTreeD, variables=variables, variablesIBC=variablesIBC, + _setInterpTransfers(tR, topTreeD, variables=variables, variablesIBC=variablesIBC, bcType=bcType, varType=varType, storage=storage, compact=compact, compactD=compactD, cellNVariable=cellNVariable, Gamma=Gamma, Cv=Cv, MuS=MuS, Cs=Cs, Ts=Ts) return tR @@ -1957,7 +1957,7 @@ def setInterpTransfers(aR, topTreeD, variables=[], cellNVariable='cellN', # IN: storage=-1/0/1: unknown/direct/inverse # Pour les IBCs avec loi de paroi, il faut specifier Gamma, Cv, MuS, Cs, Ts # compact: 1 if fields in t are compacted -# compactD: 1 for IBC transfers. In that case, fields in IBCD zonesubregions must be aligned with density +# compactD: 1 for IBC transfers. In that case, fields in IBCD zonesubregions must be aligned with density #=============================================================================== def _setInterpTransfers(aR, topTreeD, variables=[], cellNVariable='', variablesIBC=['Density','VelocityX','VelocityY','VelocityZ','Temperature'], @@ -1975,8 +1975,8 @@ def _setInterpTransfers(aR, topTreeD, variables=[], cellNVariable='', for zr in zonesR: subRegions = Internal.getNodesFromType1(zr, 'ZoneSubRegion_t') for s in subRegions: - sname = s[0][0:2] - # test pour eviter parcours arbre inutile + sname = s[0][0:2] + # test pour eviter parcours arbre inutile if ((sname == 'ID') and variables is not None) or (sname == 'IB' and variablesIBC is not None): idn = Internal.getNodeFromName1(s, 'InterpolantsDonor') if idn is not None: # la subRegion decrit des interpolations @@ -1986,7 +1986,7 @@ def _setInterpTransfers(aR, topTreeD, variables=[], cellNVariable='', location = Internal.getNodeFromName1(s, 'GridLocation') if location is not None: location = Internal.getValue(location) Coefs = idn[1] - DonorType = Internal.getNodeFromName1(s, 'InterpolantsType')[1] + DonorType = Internal.getNodeFromName1(s, 'InterpolantsType')[1] ListRcv = Internal.getNodeFromName1(s, 'PointList')[1] ListDonor = Internal.getNodeFromName1(s, 'PointListDonor')[1] # Recup des champs du receveur @@ -1998,22 +1998,22 @@ def _setInterpTransfers(aR, topTreeD, variables=[], cellNVariable='', # Transferts if sname == 'ID': RotAngleNode = Internal.getNodeFromName1(s, 'RotationAngle') - RotAngleX = 0.; RotAngleY = 0.; RotAngleZ = 0. + RotAngleX = 0.; RotAngleY = 0.; RotAngleZ = 0. if RotAngleNode is not None: RotAngle = Internal.getValue(RotAngleNode) RotAngleX = RotAngle[0] RotAngleY = RotAngle[1] RotAngleZ = RotAngle[2] - connector._setInterpTransfers(zr, zd, variables, ListRcv, ListDonor, DonorType, Coefs, loc, varType, compact, + connector._setInterpTransfers(zr, zd, variables, ListRcv, ListDonor, DonorType, Coefs, loc, varType, compact, cellNVariable, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__, RotAngleX, RotAngleY, RotAngleZ) elif sname == 'IB' and compactD: - xPC = Internal.getNodeFromName1(s,'CoordinateX_PC')[1] + xPC = Internal.getNodeFromName1(s,'CoordinateX_PC')[1] yPC = Internal.getNodeFromName1(s,'CoordinateY_PC')[1] zPC = Internal.getNodeFromName1(s,'CoordinateZ_PC')[1] xPW = Internal.getNodeFromName1(s,'CoordinateX_PW')[1] @@ -2024,12 +2024,12 @@ def _setInterpTransfers(aR, topTreeD, variables=[], cellNVariable='', zPI = Internal.getNodeFromName1(s,'CoordinateZ_PI')[1] density = Internal.getNodeFromName1(s,'Density')[1] # Transferts - connector._setIBCTransfers(zr, zd, variablesIBC, ListRcv, ListDonor, DonorType, Coefs, - xPC, yPC, zPC, xPW, yPW, zPW, xPI, yPI, zPI, - density, + connector._setIBCTransfers(zr, zd, variablesIBC, ListRcv, ListDonor, DonorType, Coefs, + xPC, yPC, zPC, xPW, yPW, zPW, xPI, yPI, zPI, + density, bcType, loc, varType, compactD, Gamma, Cv, MuS, Cs, Ts, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, Internal.__FlowSolutionCenters__) # Recup des donnees a partir des zones donneuses @@ -2043,7 +2043,7 @@ def _setInterpTransfers(aR, topTreeD, variables=[], cellNVariable='', subRegions = Internal.getNodesFromType1(zd, 'ZoneSubRegion_t') for s in subRegions: sname = s[0][0:2] - # test pour eviter parcours arbre inutile + # test pour eviter parcours arbre inutile if (sname=='ID' and variables is not None) or (sname == 'IB' and variablesIBC is not None): idn = Internal.getNodeFromName1(s, 'InterpolantsDonor') if idn is not None: @@ -2066,15 +2066,15 @@ def _setInterpTransfers(aR, topTreeD, variables=[], cellNVariable='', # Transferts if sname == 'ID': RotAngleNode = Internal.getNodeFromName1(s,'RotationAngle') - RotAngleX = 0.; RotAngleY = 0.; RotAngleZ = 0. + RotAngleX = 0.; RotAngleY = 0.; RotAngleZ = 0. if RotAngleNode is not None: RotAngleNode=RotAngleNode[1] RotAngleX = RotAngleNode[0] RotAngleY = RotAngleNode[1] RotAngleZ = RotAngleNode[2] connector._setInterpTransfers(zr, zd, variables, ListRcv, ListDonor, DonorType, Coefs,loc, varType, compact, cellNVariable, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, Internal.__FlowSolutionCenters__, RotAngleX, RotAngleY, RotAngleZ) elif sname == 'IB' and compactD: @@ -2089,12 +2089,12 @@ def _setInterpTransfers(aR, topTreeD, variables=[], cellNVariable='', zPI = Internal.getNodeFromName1(s,'CoordinateZ_PI')[1] Density = Internal.getNodeFromName1(s,'Density')[1] - connector._setIBCTransfers(zr, zd, variablesIBC, ListRcv, ListDonor, DonorType, Coefs, - xPC, yPC, zPC, xPW, yPW, zPW, xPI, yPI, zPI, - Density, + connector._setIBCTransfers(zr, zd, variablesIBC, ListRcv, ListDonor, DonorType, Coefs, + xPC, yPC, zPC, xPW, yPW, zPW, xPI, yPI, zPI, + Density, bcType, loc, varType, compact, Gamma, Cv, MuS, Cs, Ts, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, Internal.__FlowSolutionCenters__) return None @@ -2171,16 +2171,16 @@ def setInterpTransfersD(topTreeD, variables=[], cellNVariable='', Cs=0.3831337844872463, Ts=1.0, extract=0, alpha=1.): tD = Internal.copyRef(topTreeD) return _setInterpTransfersD(tD, variables=variables, cellNVariable=cellNVariable, - variablesIBC=variablesIBC, - bcType=bcType, varType=varType, compact=compact, compactD=compactD, - Gamma=Gamma, Cv=Cv, MuS=MuS, - Cs=Cs, Ts=Ts, extract=extract) + variablesIBC=variablesIBC, + bcType=bcType, varType=varType, compact=compact, compactD=compactD, + Gamma=Gamma, Cv=Cv, MuS=MuS, + Cs=Cs, Ts=Ts, extract=extract) def _setInterpTransfersD(topTreeD, variables=[], cellNVariable='', - variablesIBC=['Density','VelocityX','VelocityY','VelocityZ','Temperature'], - bcType=0, varType=2, compact=0, compactD=0, - Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08, - Cs=0.3831337844872463, Ts=1.0, extract=0, alpha=1.): + variablesIBC=['Density','VelocityX','VelocityY','VelocityZ','Temperature'], + bcType=0, varType=2, compact=0, compactD=0, + Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08, + Cs=0.3831337844872463, Ts=1.0, extract=0, alpha=1.): # Recup des donnees a partir des zones donneuses zonesD = Internal.getZones(topTreeD) @@ -2189,9 +2189,9 @@ def _setInterpTransfersD(topTreeD, variables=[], cellNVariable='', subRegions = Internal.getNodesFromType1(zd, 'ZoneSubRegion_t') for s in subRegions: sname = s[0][0:2] - #test pour eviter parcours arbre inutile + #test pour eviter parcours arbre inutile if (sname=='ID' and variables is not None) or (sname == 'IB' and variablesIBC is not None): - dname = Internal.getValue(s) + dname = Internal.getValue(s) idn = Internal.getNodeFromName1(s, 'InterpolantsDonor') if idn is not None: # la subRegion decrit des interpolations zoneRole = Internal.getNodeFromName2(s, 'ZoneRole') @@ -2206,11 +2206,11 @@ def _setInterpTransfersD(topTreeD, variables=[], cellNVariable='', ListDonor = Internal.getNodeFromName1(s,'PointList')[1] ListRcv = Internal.getNodeFromName1(s,'PointListDonor')[1] if sname == 'ID': - # print 'transfert ID: zd ', zd[0] + # print 'transfert ID: zd ', zd[0] arrayT = connector._setInterpTransfersD(zd, variables, ListDonor, DonorType, Coefs, varType, compact, cellNVariable, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, Internal.__FlowSolutionCenters__) infos.append([dname,arrayT,ListRcv,loc]) @@ -2225,13 +2225,13 @@ def _setInterpTransfersD(topTreeD, variables=[], cellNVariable='', yPI = Internal.getNodeFromName1(s,'CoordinateY_PI')[1] zPI = Internal.getNodeFromName1(s,'CoordinateZ_PI')[1] Density = Internal.getNodeFromName1(s,'Density')[1] - arrayT = connector._setIBCTransfersD(zd, variablesIBC, ListDonor, DonorType, Coefs, - xPC, yPC, zPC, xPW, yPW, zPW, xPI, yPI, zPI, - Density, - bcType, varType, compact, Gamma, Cv, MuS, Cs, Ts, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + arrayT = connector._setIBCTransfersD(zd, variablesIBC, ListDonor, DonorType, Coefs, + xPC, yPC, zPC, xPW, yPW, zPW, xPI, yPI, zPI, + Density, + bcType, varType, compact, Gamma, Cv, MuS, Cs, Ts, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) infos.append([dname,arrayT,ListRcv,loc]) elif sname == 'IB' and "gradxDensity" in variablesIBC: @@ -2258,12 +2258,12 @@ def _setInterpTransfersD(topTreeD, variables=[], cellNVariable='', #print 'transfert IBC : zd ', zd[0] arrayT = connector._setIBCTransfersD4GradP(zd, variablesIBC, ListDonor, DonorType, Coefs, - pressure, - gradxP, gradyP, gradzP, - bcType, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + pressure, + gradxP, gradyP, gradzP, + bcType, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) infos.append([dname,arrayT,ListRcv,loc]) # Sortie @@ -2890,7 +2890,7 @@ def _setIBCTransfersDForPressureGradients(topTreeD, ibctypes=[], secondOrder=Fal for var in variables: field = Internal.getNodeFromName1(IBCD, var) - if field is not None: + if field is not None: dictOfNumpys[var] = field[1] else: fieldNP = numpy.zeros((nIBC),numpy.float64) @@ -2899,23 +2899,23 @@ def _setIBCTransfersDForPressureGradients(topTreeD, ibctypes=[], secondOrder=Fal if secondOrder: arrayT = connector._setIBCTransfersDForPressureGradientsOrder2(zd, variables, ListDonor, DonorType, Coefs, - dictOfNumpys['Pressure'], - dictOfNumpys['gradxPressure'] , dictOfNumpys['gradyPressure'] , dictOfNumpys['gradzPressure'], - dictOfNumpys['gradxgradxPressure'], dictOfNumpys['gradxgradyPressure'], dictOfNumpys['gradxgradzPressure'], - dictOfNumpys['gradygradxPressure'], dictOfNumpys['gradygradyPressure'], dictOfNumpys['gradygradzPressure'], - dictOfNumpys['gradzgradxPressure'], dictOfNumpys['gradzgradyPressure'], dictOfNumpys['gradzgradzPressure'], - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + dictOfNumpys['Pressure'], + dictOfNumpys['gradxPressure'] , dictOfNumpys['gradyPressure'] , dictOfNumpys['gradzPressure'], + dictOfNumpys['gradxgradxPressure'], dictOfNumpys['gradxgradyPressure'], dictOfNumpys['gradxgradzPressure'], + dictOfNumpys['gradygradxPressure'], dictOfNumpys['gradygradyPressure'], dictOfNumpys['gradygradzPressure'], + dictOfNumpys['gradzgradxPressure'], dictOfNumpys['gradzgradyPressure'], dictOfNumpys['gradzgradzPressure'], + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) else: arrayT = connector._setIBCTransfersDForPressureGradientsOrder1(zd, variables, ListDonor, DonorType, Coefs, - dictOfNumpys['Pressure'], - dictOfNumpys['gradxPressure'] , dictOfNumpys['gradyPressure'] , dictOfNumpys['gradzPressure'], - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + dictOfNumpys['Pressure'], + dictOfNumpys['gradxPressure'] , dictOfNumpys['gradyPressure'] , dictOfNumpys['gradzPressure'], + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) - infos.append([zrcvname,arrayT,ListRcv,loc]) + infos.append([zrcvname,arrayT,ListRcv,loc]) return infos @@ -2965,7 +2965,7 @@ def _setIBCTransfersForPressureGradients(aR, topTreeD, ibctypes=[], secondOrder= for var in variables: field = Internal.getNodeFromName1(IBCD, var) - if field is not None: + if field is not None: dictOfNumpys[var] = field[1] else: fieldNP = numpy.zeros((nIBC),numpy.float64) @@ -2974,23 +2974,23 @@ def _setIBCTransfersForPressureGradients(aR, topTreeD, ibctypes=[], secondOrder= if secondOrder: connector._setIBCTransfersForPressureGradientsOrder2(zr, zd, variables, ListRcv, ListDonor, DonorType, Coefs, - dictOfNumpys['Pressure'], - dictOfNumpys['gradxPressure'] , dictOfNumpys['gradyPressure'] , dictOfNumpys['gradzPressure'], - dictOfNumpys['gradxgradxPressure'], dictOfNumpys['gradxgradyPressure'], dictOfNumpys['gradxgradzPressure'], - dictOfNumpys['gradygradxPressure'], dictOfNumpys['gradygradyPressure'], dictOfNumpys['gradygradzPressure'], - dictOfNumpys['gradzgradxPressure'], dictOfNumpys['gradzgradyPressure'], dictOfNumpys['gradzgradzPressure'], - loc, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + dictOfNumpys['Pressure'], + dictOfNumpys['gradxPressure'] , dictOfNumpys['gradyPressure'] , dictOfNumpys['gradzPressure'], + dictOfNumpys['gradxgradxPressure'], dictOfNumpys['gradxgradyPressure'], dictOfNumpys['gradxgradzPressure'], + dictOfNumpys['gradygradxPressure'], dictOfNumpys['gradygradyPressure'], dictOfNumpys['gradygradzPressure'], + dictOfNumpys['gradzgradxPressure'], dictOfNumpys['gradzgradyPressure'], dictOfNumpys['gradzgradzPressure'], + loc, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) else: connector._setIBCTransfersForPressureGradientsOrder1(zr, zd, variables, ListRcv, ListDonor, DonorType, Coefs, - dictOfNumpys['Pressure'], - dictOfNumpys['gradxPressure'] , dictOfNumpys['gradyPressure'] , dictOfNumpys['gradzPressure'], - loc, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + dictOfNumpys['Pressure'], + dictOfNumpys['gradxPressure'] , dictOfNumpys['gradyPressure'] , dictOfNumpys['gradzPressure'], + loc, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) return None # NOTE !! @@ -3002,9 +3002,9 @@ def _setIBCTransfersForPressureGradients(aR, topTreeD, ibctypes=[], secondOrder= # tc/tc2 -> RCV ZONES #============================================================================== def _setIBCTransfers4GradP(aR, topTreeD, variables=[], cellNVariable='', - variablesIBC=["Density", "Temperature", "gradxDensity", "gradyDensity", "gradzDensity", "gradxTemperature", "gradyTemperature", "gradzTemperature"], - bcType=3, varType=1, compact=0, - Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08,Cs=0.3831337844872463, Ts=1.0, alpha=1.0): + variablesIBC=["Density", "Temperature", "gradxDensity", "gradyDensity", "gradzDensity", "gradxTemperature", "gradyTemperature", "gradzTemperature"], + bcType=3, varType=1, compact=0, + Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08,Cs=0.3831337844872463, Ts=1.0, alpha=1.0): # Recup des donnees a partir des zones donneuses # Dictionnaire pour optimisation @@ -3060,12 +3060,12 @@ def _setIBCTransfers4GradP(aR, topTreeD, variables=[], cellNVariable='', gradzP = Internal.getNodeFromName1(s, 'gradzPressure')[1] connector._setIBCTransfers4GradP(zr, zd, variablesIBC, ListRcv, ListDonor, DonorType, Coefs, - Pressure, - gradxP, gradyP, gradzP, - bcType, loc, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + Pressure, + gradxP, gradyP, gradzP, + bcType, loc, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) return None #============================================================================== @@ -3073,9 +3073,9 @@ def _setIBCTransfers4GradP(aR, topTreeD, variables=[], cellNVariable='', # tc/tc2 -> RCV ZONES #============================================================================== def _setIBCTransfers4GradP2(aR, topTreeD, variables=[], cellNVariable='', - variablesIBC=["Density", "Temperature", "gradxDensity", "gradyDensity", "gradzDensity", "gradxTemperature", "gradyTemperature", "gradzTemperature"], - bcType=3, varType=1, compact=0, - Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08,Cs=0.3831337844872463, Ts=1.0, alpha=1.0): + variablesIBC=["Density", "Temperature", "gradxDensity", "gradyDensity", "gradzDensity", "gradxTemperature", "gradyTemperature", "gradzTemperature"], + bcType=3, varType=1, compact=0, + Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08,Cs=0.3831337844872463, Ts=1.0, alpha=1.0): # Recup des donnees a partir des zones donneuses # Dictionnaire pour optimisation @@ -3192,15 +3192,15 @@ def _setIBCTransfers4GradP2(aR, topTreeD, variables=[], cellNVariable='', gradzzP = Internal.getNodeFromName1(s, 'gradzzPressure')[1] connector._setIBCTransfers4GradP2(zr, zd, variablesIBC, ListRcv, ListDonor, DonorType, Coefs, - Pressure, - gradxP, gradyP, gradzP, - gradxxP, gradxyP, gradxzP, - gradyxP, gradyyP, gradyzP, - gradzxP, gradzyP, gradzzP, - bcType, loc, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + Pressure, + gradxP, gradyP, gradzP, + gradxxP, gradxyP, gradxzP, + gradyxP, gradyyP, gradyzP, + gradzxP, gradzyP, gradzzP, + bcType, loc, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) return None #============================================================================== @@ -3209,16 +3209,16 @@ def _setIBCTransfers4GradP2(aR, topTreeD, variables=[], cellNVariable='', # Parallel version + compact #============================================================================== def _setIBCTransfers4GradP3(zones, zonesD, graphInvIBCD, graphIBCD, procDict, - variablesIBC=['Density', 'Temperature', 'gradxDensity', 'gradyDensity', 'gradzDensity', 'gradxTemperature', 'gradyTemperature', 'gradzTemperature'], - bcType=0, varType=1, compact=1, - Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08,Cs=0.3831337844872463, Ts=1.0, alpha=1.0): + variablesIBC=['Density', 'Temperature', 'gradxDensity', 'gradyDensity', 'gradzDensity', 'gradxTemperature', 'gradyTemperature', 'gradzTemperature'], + bcType=0, varType=1, compact=1, + Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08,Cs=0.3831337844872463, Ts=1.0, alpha=1.0): import Converter.Mpi as Cmpi rank=Cmpi.rank datas = {} znr = {} - for z in zones: + for z in zones: znr[z[0]] = z for zd in zonesD: @@ -3247,11 +3247,11 @@ def _setIBCTransfers4GradP3(zones, zonesD, graphInvIBCD, graphIBCD, procDict, for [name, zname, Coefs, DonorType, ListDonor, ListRcv, gradxP, gradyP, gradzP] in rcvDatas[dest]: zr = znr[zname] connector._setIBCTransfers4GradP3(zr, variablesIBC, ListRcv, ListDonor, DonorType, Coefs, - gradxP, gradyP, gradzP, - bcType, 1, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + gradxP, gradyP, gradzP, + bcType, 1, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) rcvNode = dest infos = [name, zname, gradxP, gradyP, gradzP] if rcvNode not in datas: datas[rcvNode] = [infos] @@ -3272,9 +3272,9 @@ def _setIBCTransfers4GradP3(zones, zonesD, graphInvIBCD, graphIBCD, procDict, gradxP = Internal.getNodeFromName1(s, 'gradxPressure')[1] gradyP = Internal.getNodeFromName1(s, 'gradyPressure')[1] gradzP = Internal.getNodeFromName1(s, 'gradzPressure')[1] - connector._setIBCTransfers4GradP4( - gradxP_new, gradyP_new, gradzP_new, - gradxP, gradyP, gradzP) + connector._setIBCTransfers4GradP4( + gradxP_new, gradyP_new, gradzP_new, + gradxP, gradyP, gradzP) return None @@ -3284,9 +3284,9 @@ def _setIBCTransfers4GradP3(zones, zonesD, graphInvIBCD, graphIBCD, procDict, #============================================================================== def _setIBCTransfers4FULLTBLE(aR, topTreeD, variables=[], cellNVariable='', - variablesIBC=['Density','MomentumX','MomentumY','MomentumZ','EnergyStagnationDensity'], - bcType=0, varType=1, storage=-1, compact=0, - Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08,Cs=0.3831337844872463, Ts=1.0, alpha=1.0): + variablesIBC=['Density','MomentumX','MomentumY','MomentumZ','EnergyStagnationDensity'], + bcType=0, varType=1, storage=-1, compact=0, + Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08,Cs=0.3831337844872463, Ts=1.0, alpha=1.0): # Recup des donnees a partir des zones receveuses if storage < 1: @@ -3425,16 +3425,16 @@ def _setIBCTransfers4FULLTBLE(aR, topTreeD, variables=[], cellNVariable='', #print 'transfert IBC : zr ', zr[0], ' et donor : ', zd[0] connector._setIBCTransfers4FULLTBLE(zr, zd, variablesIBC, ListRcv, ListDonor, DonorType, Coefs, - pressure, - vx, vy, vz, - gradxP, gradyP, gradzP, - gradxU, gradyU, gradzU, - gradxV, gradyV, gradzV, - gradxW, gradyW, gradzW, - bcType, loc, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + pressure, + vx, vy, vz, + gradxP, gradyP, gradzP, + gradxU, gradyU, gradzU, + gradxV, gradyV, gradzV, + gradxW, gradyW, gradzW, + bcType, loc, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) # Recup des donnees a partir des zones donneuses if storage != 0: @@ -3572,16 +3572,16 @@ def _setIBCTransfers4FULLTBLE(aR, topTreeD, variables=[], cellNVariable='', # print 'transfert IBC : zr ', zr[0], ' et donor : ', zd[0] connector._setIBCTransfers4FULLTBLE(zr, zd, variablesIBC, ListRcv, ListDonor, DonorType, Coefs, - pressure, - vx, vy, vz, - gradxP, gradyP, gradzP, - gradxU, gradyU, gradzU, - gradxV, gradyV, gradzV, - gradxW, gradyW, gradzW, - bcType, loc, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + pressure, + vx, vy, vz, + gradxP, gradyP, gradzP, + gradxU, gradyU, gradzU, + gradxV, gradyV, gradzV, + gradxW, gradyW, gradzW, + bcType, loc, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) return None #============================================================================== @@ -3590,9 +3590,9 @@ def _setIBCTransfers4FULLTBLE(aR, topTreeD, variables=[], cellNVariable='', #============================================================================== def _setIBCTransfers4FULLTBLE2(aR, topTreeD, variables=[], cellNVariable='', - variablesIBC=['Density','MomentumX','MomentumY','MomentumZ','EnergyStagnationDensity'], - bcType=0, varType=1, storage=-1, compact=0, - Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08,Cs=0.3831337844872463, Ts=1.0, alpha=1.0): + variablesIBC=['Density','MomentumX','MomentumY','MomentumZ','EnergyStagnationDensity'], + bcType=0, varType=1, storage=-1, compact=0, + Gamma=1.4, Cv=1.7857142857142865, MuS=1.e-08,Cs=0.3831337844872463, Ts=1.0, alpha=1.0): # Recup des donnees a partir des zones receveuses if storage < 1: @@ -3731,16 +3731,16 @@ def _setIBCTransfers4FULLTBLE2(aR, topTreeD, variables=[], cellNVariable='', #print 'transfert IBC : zr ', zr[0], ' et donor : ', zd[0] connector._setIBCTransfers4FULLTBLE2(zr, zd, variablesIBC, ListRcv, ListDonor, DonorType, Coefs, - pressure, - vx, vy, vz, - gradxP, gradyP, gradzP, - gradxU, gradyU, gradzU, - gradxV, gradyV, gradzV, - gradxW, gradyW, gradzW, - bcType, loc, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + pressure, + vx, vy, vz, + gradxP, gradyP, gradzP, + gradxU, gradyU, gradzU, + gradxV, gradyV, gradzV, + gradxW, gradyW, gradzW, + bcType, loc, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) # Recup des donnees a partir des zones donneuses if storage != 0: @@ -3878,16 +3878,16 @@ def _setIBCTransfers4FULLTBLE2(aR, topTreeD, variables=[], cellNVariable='', # print 'transfert IBC : zr ', zr[0], ' et donor : ', zd[0] connector._setIBCTransfers4FULLTBLE2(zr, zd, variablesIBC, ListRcv, ListDonor, DonorType, Coefs, - pressure, - vx, vy, vz, - gradxP, gradyP, gradzP, - gradxU, gradyU, gradzU, - gradxV, gradyV, gradzV, - gradxW, gradyW, gradzW, - bcType, loc, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + pressure, + vx, vy, vz, + gradxP, gradyP, gradzP, + gradxU, gradyU, gradzU, + gradxV, gradyV, gradzV, + gradxW, gradyW, gradzW, + bcType, loc, varType, compact, Gamma, Cv, MuS, Cs, Ts, alpha, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) return None #============================================================================== @@ -4041,7 +4041,7 @@ def _modifcellNBC(t, BCTarget=['BCWall'], depth=2,dim=3): if bc is not None: bcs = Internal.getNodesFromType(bc,'BC_t') for bc in bcs: bctyp = Internal.getValue(bc) - if bctyp in BCTarget: + if bctyp in BCTarget: ptrg = Internal.getNodeFromName1(bc,'PointRange') dimZ = Internal.getZoneDim(z) #print(z[0], dimZ,'range', ptrg[1]) @@ -4051,14 +4051,14 @@ def _modifcellNBC(t, BCTarget=['BCWall'], depth=2,dim=3): #print('idir=',idir) cellN= Internal.getNodeFromName2(z,'cellN')[1] - if idir==0: + if idir==0: jmin = ptrg[1][1,0]-3; jmax = ptrg[1][1,1]+1 kmin = ptrg[1][2,0]-3; kmax = ptrg[1][2,1]+1 for k in range(kmin,kmax): for j in range(jmin,jmax): for d in range(depth): if cellN[depth-1-d,j,k]>=1.99 : cellN[depth-1-d,j,k]=1 - if idir==1: + if idir==1: i1 = ptrg[1][0,1]-depth-1 jmin = ptrg[1][1,0]-3; jmax = ptrg[1][1,1]+1 kmin = ptrg[1][2,0]-3; kmax = ptrg[1][2,1]+1 @@ -4066,7 +4066,7 @@ def _modifcellNBC(t, BCTarget=['BCWall'], depth=2,dim=3): for j in range(jmin,jmax): for d in range(depth): if cellN[i1+d,j,k]>=1.99: cellN[i1+d,j,k]=1 - if idir==2: + if idir==2: imin = ptrg[1][0,0]-3; imax = ptrg[1][0,1]+1 kmin = ptrg[1][2,0]-3; kmax = ptrg[1][2,1]+1 #print(z[0],'range', imin, imax,kmin,kmax,depth-1) @@ -4074,7 +4074,7 @@ def _modifcellNBC(t, BCTarget=['BCWall'], depth=2,dim=3): for i in range(imin,imax): for d in range(depth): if cellN[i,depth-1-d,k]>=1.99: cellN[i,depth-1-d,k]= 1 - if idir==3: + if idir==3: js = ptrg[1][1,1]-depth-1 imin = ptrg[1][0,0]-3; imax = ptrg[1][0,1]+1 kmin = ptrg[1][2,0]-3; kmax = ptrg[1][2,1]+1 @@ -4082,7 +4082,7 @@ def _modifcellNBC(t, BCTarget=['BCWall'], depth=2,dim=3): for i in range(imin,imax): for d in range(depth): if cellN[i,js+d,k]>=1.99: cellN[i,js+d,k]= 1. - if idir==4: + if idir==4: imin = ptrg[1][0,0]-3; imax = ptrg[1][0,1]+1 jmin = ptrg[1][1,0]-3; jmax = ptrg[1][1,1]+1 for j in range(jmin,jmax): @@ -4090,7 +4090,7 @@ def _modifcellNBC(t, BCTarget=['BCWall'], depth=2,dim=3): for d in range(depth): if cellN[i,j,depth-1-d]>=1.99: cellN[i,j,depth-1-d]= 1. - if idir==5: + if idir==5: ks = ptrg[1][2,1]-depth-1 imin = ptrg[1][0,0]-3; imax = ptrg[1][0,1]+1 jmin = ptrg[1][1,0]-3; jmax = ptrg[1][1,1]+1 diff --git a/Cassiopee/Connector/Connector/OversetDataDtlocal.py b/Cassiopee/Connector/Connector/OversetDataDtlocal.py index 05acec798..ed36ef9e1 100644 --- a/Cassiopee/Connector/Connector/OversetDataDtlocal.py +++ b/Cassiopee/Connector/Connector/OversetDataDtlocal.py @@ -27,8 +27,8 @@ def setInterpData3(tR, tD, double_wall=0, order=2, penalty=1, nature=0, aR = Internal.copyRef(tR) aD = Internal.copyRef(tD) - bases = Internal.getNodesFromType1(aR , 'CGNSBase_t') - dimmm = Internal.getNodeFromName2(bases[0], 'EquationDimension') + bases = Internal.getNodesFromType1(aR , 'CGNSBase_t') + dimmm = Internal.getNodeFromName2(bases[0], 'EquationDimension') dimPb = Internal.getValue(dimmm) zones = Internal.getZones(aR) @@ -75,7 +75,7 @@ def setInterpData3(tR, tD, double_wall=0, order=2, penalty=1, nature=0, # Recherche pour les pts coincidents (base sur les GridConnectivity) if itype != 'chimera': if storage == 'direct': aR = setInterpDataForGhostCells2__(aR,aD,storage,loc) - else: + else: aD = setInterpDataForGhostCells2__(aR,aD,storage,loc) # Si pas de cellN receveur, on retourne @@ -90,7 +90,7 @@ def setInterpData3(tR, tD, double_wall=0, order=2, penalty=1, nature=0, locCellND = 'nodes' aD = OversetData.addCellN__(aD, loc=locCellND) - if method == 'conservative' and itype != 'abutting': + if method == 'conservative' and itype != 'abutting': if loc != 'centers': raise ValueError("setInterpData: conservative type is available only for loc='centers'.") else: return setInterpDataConservative__(aR, aD, storage=storage) @@ -177,30 +177,30 @@ def setInterpData3(tR, tD, double_wall=0, order=2, penalty=1, nature=0, #dico={} #for z in zonesRcv: - # listofjoins = Internal.getNodesFromType2(z, 'GridConnectivity_t') - # if listofjoins is not None: - # prange_list=[] - # for join in listofjoins: - # prange = Internal.getNodeFromName1(join,'PointRange')[1] - # for i in range(3): - # if prange[i,1] == prange[i,0] and prange[i,1] != 1: - # prange[i,1] = prange[i,1]-1 - # prange[i,0] = prange[i,0]-1 - # elif prange[i,1] != prange[i,0] and prange[i,1] != 1 : - # prange[i,1] = prange[i,1]-1 - # prange=numpy.reshape(prange,6) - # #print prange - # prange_list.append(prange) - # dico[z[0]] = prange_list + # listofjoins = Internal.getNodesFromType2(z, 'GridConnectivity_t') + # if listofjoins is not None: + # prange_list=[] + # for join in listofjoins: + # prange = Internal.getNodeFromName1(join,'PointRange')[1] + # for i in range(3): + # if prange[i,1] == prange[i,0] and prange[i,1] != 1: + # prange[i,1] = prange[i,1]-1 + # prange[i,0] = prange[i,0]-1 + # elif prange[i,1] != prange[i,0] and prange[i,1] != 1 : + # prange[i,1] = prange[i,1]-1 + # prange=numpy.reshape(prange,6) + # #print prange + # prange_list.append(prange) + # dico[z[0]] = prange_list #print dico.get('cart.0') for z in zonesRcv: dim_ = Internal.getZoneDim(z) #if nodes is not None: - #nodesname = nodes[0][0][0:6] - #if nodesname == 'nmatch': - #print 'ok' - #print nodes[0] + #nodesname = nodes[0][0][0:6] + #if nodesname == 'nmatch': + #print 'ok' + #print nodes[0] nozr += 1 @@ -338,13 +338,13 @@ def setInterpData3(tR, tD, double_wall=0, order=2, penalty=1, nature=0, dim__ = Internal.getZoneDim(zonesDnr[noz]) - prange = numpy.zeros(6,dtype=Internal.E_NpyInt) + prange = numpy.zeros(6,dtype=Internal.E_NpyInt) dirR=numpy.zeros(1,dtype=Internal.E_NpyInt) leveldnr = niveaux_temps[zonesDnr[noz][0]] #print('donneur= ', zonesDnr[noz][0],noz) #print 'donneur= ', zonesRcv[noz][0],noz - #print('receveur= ', z[0]) + #print('receveur= ', z[0]) #connector.indiceToCoordbis(resInterp[0][noz],prange,dirR,resInterp[0][noz].size,resInterp[2][noz][0],dim_[1],dim_[2],dim_[3]) prange=numpy.reshape(prange,(3,2)) @@ -371,7 +371,7 @@ def setInterpData3(tR, tD, double_wall=0, order=2, penalty=1, nature=0, connector.correctCoeffList(resInterp[1][noz],resInterp[3][noz],resInterp[2][noz],resInterp[2][noz].size,dim__[1]+1,dim__[2]+1,dim__[3]+1) ### Determination du point pivot symetrique dans zoneR du point (imin,jmin,kmin) de la zoneD - pt_pivot=numpy.array(prange[0:3,0]) # Point (imin,jmin,kmin) de la zone R + pt_pivot=numpy.array(prange[0:3,0]) # Point (imin,jmin,kmin) de la zone R if (abs(dirR)==1): # Le point ne peut varier que dans son plan (j,k) pour etre en face du point de la zone D if (transfo[1] < 0) : pt_pivot[1] = prange[1,1] #Le vecteur j et son transforme sont opposes jmin -> jmax if (transfo[2] < 0) : pt_pivot[2] = prange[2,1] @@ -404,7 +404,7 @@ def setInterpData3(tR, tD, double_wall=0, order=2, penalty=1, nature=0, #print('NMratio= ',NMratio) info[2].append(['NMratio', NMratio , [], 'IndexArray_t']) - info[2].append(['DnrZoneName', zonesDnr[noz][0] , [], 'IndexArray_t']) + info[2].append(['DnrZoneName', zonesDnr[noz][0] , [], 'IndexArray_t']) @@ -455,7 +455,7 @@ def getTransfo(zdonor,zrcv): a=Vector.dot(l1,x);b=Vector.dot(l1,y) c=Vector.dot(l2,x);d=Vector.dot(l2,y) mat_ = numpy.array([[a,b], - [c,d]]) + [c,d]]) a = C.getFields(Internal.__GridCoordinates__, zrcv)[0] ni = a[2]; nj=a[3]; nk=a[4] @@ -489,13 +489,13 @@ def getTransfo(zdonor,zrcv): mat = numpy.array([[a,b], [c,d]]) mat=mat.T - a=mat_[0,0]*mat[0,0] + mat_[0,1]*mat[1,0] + a=mat_[0,0]*mat[0,0] + mat_[0,1]*mat[1,0] b=mat_[0,0]*mat[0,1] + mat_[0,1]*mat[1,1] - c=mat_[1,0]*mat[0,0] + mat_[1,1]*mat[1,0] + c=mat_[1,0]*mat[0,0] + mat_[1,1]*mat[1,0] d=mat_[1,0]*mat[0,1] + mat_[1,1]*mat[1,1] mat__ = numpy.array([[a,b], [c,d]]) - #print mat__[0,:] + #print mat__[0,:] #print mat__[1,:] transfo[0]=(numpy.nonzero(mat__[0,:])[0][0]+1)*numpy.sign(mat__[0,numpy.nonzero(mat__[0,:])[0][0]]) transfo[1]=(numpy.nonzero(mat__[1,:])[0][0]+1)*numpy.sign(mat__[1,numpy.nonzero(mat__[1,:])[0][0]]) @@ -584,14 +584,14 @@ def getTransfo(zdonor,zrcv): mat__ = numpy.array([[a,b,c], [d,e,f], [g,h,i]]) - #print mat__[0,:] + #print mat__[0,:] #print mat__[1,:] transfo[0]=(numpy.nonzero(mat__[0,:])[0][0]+1)*numpy.sign(mat__[0,numpy.nonzero(mat__[0,:])[0][0]]) transfo[1]=(numpy.nonzero(mat__[1,:])[0][0]+1)*numpy.sign(mat__[1,numpy.nonzero(mat__[1,:])[0][0]]) transfo[2]=(numpy.nonzero(mat__[2,:])[0][0]+1)*numpy.sign(mat__[2,numpy.nonzero(mat__[2,:])[0][0]]) #print transfo - return transfo + return transfo #print 'mat= ',mat__ @@ -608,7 +608,7 @@ def getTransfo(zdonor,zrcv): # IN: tag:'Receiver' or 'Donor' # IN: loc='centers', 'nodes' ou 'faces' # IN: EXDir: direction pour les pts EX (Chimere depth=1) -# IN: itype: 'abutting' pour transferts multidomaine, 'chimera' pour les interp chimere, +# IN: itype: 'abutting' pour transferts multidomaine, 'chimera' pour les interp chimere, # 'ibc' pour les IBC #------------------------------------------------------------------------------ @@ -625,7 +625,7 @@ def setInterpDataForGhostCells2__(tR, tD, storage='direct', loc='nodes'): EXdir = numpy.array([],Internal.E_NpyInt) bases = Internal.getNodesFromType1(tR , 'CGNSBase_t') # noeud - dimmm = Internal.getNodeFromName2(bases[0], 'EquationDimension') + dimmm = Internal.getNodeFromName2(bases[0], 'EquationDimension') dimm = Internal.getValue(dimmm) if loc == 'nodes': locR = 0; locS = 'Vertex' @@ -711,7 +711,7 @@ def setInterpDataForGhostCells2__(tR, tD, storage='direct', loc='nodes'): rinddnr = [rindimin,rindimax,rindjmin,rindjmax,rindkmin,rindkmax] # get directions of receptor and donor borders dirR = GhostCells.getDirBorderStruct__(prange,dimPb) - dirD = GhostCells.getDirBorderStruct__(prangedonor,dimPb) + dirD = GhostCells.getDirBorderStruct__(prangedonor,dimPb) # get list of border nodes and direction of border if dimPb != 1: @@ -770,21 +770,21 @@ def setInterpDataForGhostCells2__(tR, tD, storage='direct', loc='nodes'): if RotationAngle is not None: val = Internal.getValue(RotationAngle) if val[0]>0. or val[1]>0. or val[2]>0.: prefix='IDPERP' - else: prefix = 'IDPERM' + else: prefix = 'IDPERM' if storage == 'direct': OversetData._createInterpRegion__(zp, zdonorname,res[0],res[1],res[3],res[2],vols,indicesExtrap,\ - indicesOrphan,tag = 'Receiver',loc=loc,EXDir=EXdir,itype='abutting',\ + indicesOrphan,tag='Receiver',loc=loc,EXDir=EXdir,itype='abutting',\ prefix=prefix, RotationAngle=RotationAngle, RotationCenter=RotationCenter) else: OversetData._createInterpRegion__(zdonorp, zname, res[1], res[0], res[3], res[2], vols, indicesExtrap,\ - indicesOrphan, tag = 'Donor',loc=loc,EXDir=EXdir,itype='abutting',\ + indicesOrphan, tag='Donor',loc=loc,EXDir=EXdir,itype='abutting',\ prefix=prefix,RotationAngle=RotationAngle, RotationCenter=RotationCenter) - zoneDimR2 = list(zoneDimR) + zoneDimR2 = list(zoneDimR) zoneDimR2[4] = dimm - zoneDimD2 = list(zoneDimD) + zoneDimD2 = list(zoneDimD) zoneDimD2[4] = dimm #print 'zoneDimD2= ', zoneDimD2 @@ -828,7 +828,7 @@ def setInterpDataForGhostCells2__(tR, tD, storage='direct', loc='nodes'): ### Determination du point pivot symetrique dans zoneR du point (imin,jmin,kmin) de la zoneD - pt_pivot=numpy.array(prange[0:3,0]) # Point (imin,jmin,kmin) de la zone R + pt_pivot=numpy.array(prange[0:3,0]) # Point (imin,jmin,kmin) de la zone R if abs(dirR)==1: # Le point ne peut varier que dans son plan (j,k) pour etre en face du point de la zone D if (transfo[1][1] < 0) : pt_pivot[1] = prange[1,1] #Le vecteur j et son transforme sont opposes jmin -> jmax if (transfo[1][2] < 0) : pt_pivot[2] = prange[2,1] @@ -843,10 +843,10 @@ def setInterpDataForGhostCells2__(tR, tD, storage='direct', loc='nodes'): #print 'pt_pivot_ap= ',pt_pivot # Inversion du vector transform pour l explicite local - transfo_inv=numpy.array(transfo[1][0:3]) + transfo_inv=numpy.array(transfo[1][0:3]) for i in range(0,3): transfo_inv[abs(transfo[1][i])-1]=i+1 - if transfo[1][i] < 0: transfo_inv[abs(transfo[1][i])-1]=-(i+1) + if transfo[1][i] < 0: transfo_inv[abs(transfo[1][i])-1]=-(i+1) dirR = GhostCells.getDirBorderStruct__(prange,dimm) dirD = GhostCells.getDirBorderStruct__(prangedonor,dimm) @@ -871,12 +871,12 @@ def setInterpDataForGhostCells2__(tR, tD, storage='direct', loc='nodes'): #print zdonor z_ = Internal.getNodeFromName2(aR, zname) node = Internal.getNodeFromName1(z_, 'FlowSolution#Centers') - sol = Internal.getNodeFromName1(node, 'niveaux_temps') + sol = Internal.getNodeFromName1(node, 'niveaux_temps') levelrcv = Internal.getValue(sol)[0][0][0] z_ = Internal.getNodeFromName2(aR, zdonorname) node = Internal.getNodeFromName1(z_, 'FlowSolution#Centers') - sol = Internal.getNodeFromName1(node, 'niveaux_temps') + sol = Internal.getNodeFromName1(node, 'niveaux_temps') leveldnr = Internal.getValue(sol)[0][0][0] @@ -890,8 +890,8 @@ def setInterpDataForGhostCells2__(tR, tD, storage='direct', loc='nodes'): info[2].append(['PointPivot', pt_pivot , [], 'IndexArray_t']) info[2].append(['Profondeur', profondeur , [], 'IndexArray_t']) info[2].append(['NMratio', NMratio , [], 'IndexArray_t']) - info[2].append(['LevelZRcv', levelrcv , [], 'IndexArray_t']) - info[2].append(['LevelZDnr', leveldnr , [], 'IndexArray_t']) + info[2].append(['LevelZRcv', levelrcv , [], 'IndexArray_t']) + info[2].append(['LevelZDnr', leveldnr , [], 'IndexArray_t']) else: info = zdonorp[2][len(zdonorp[2])-1] @@ -903,8 +903,8 @@ def setInterpDataForGhostCells2__(tR, tD, storage='direct', loc='nodes'): info[2].append(['PointPivot', pt_pivot , [], 'IndexArray_t']) info[2].append(['Profondeur', profondeur , [], 'IndexArray_t']) info[2].append(['NMratio', NMratio , [], 'IndexArray_t']) - info[2].append(['LevelZRcv', levelrcv , [], 'IndexArray_t']) - info[2].append(['LevelZDnr', leveldnr , [], 'IndexArray_t']) + info[2].append(['LevelZRcv', levelrcv , [], 'IndexArray_t']) + info[2].append(['LevelZDnr', leveldnr , [], 'IndexArray_t']) if storage == 'direct': return aR else: return aD diff --git a/Cassiopee/Connector/Connector/OversetDataElsA.py b/Cassiopee/Connector/Connector/OversetDataElsA.py index 230ae46d9..3926218c8 100644 --- a/Cassiopee/Connector/Connector/OversetDataElsA.py +++ b/Cassiopee/Connector/Connector/OversetDataElsA.py @@ -16,7 +16,7 @@ #============================================================================= #============================================================================= -# 1. CALCUL DES DONNEES D INTERPOLATIONS +# 1. CALCUL DES DONNEES D INTERPOLATIONS #============================================================================= #============================================================================= @@ -47,11 +47,11 @@ def setInterpolations(t, loc='cell', double_wall=0, storage='inverse', prefixFil """Compute interpolation data for chimera and for elsA solver.""" a = Internal.copyRef(t) _setInterpolations(a, loc=loc, double_wall=double_wall, storage=storage, prefixFile=prefixFile, - sameBase=sameBase, solver=solver, nGhostCells=nGhostCells, parallelDatas=parallelDatas, + sameBase=sameBase, solver=solver, nGhostCells=nGhostCells, parallelDatas=parallelDatas, cfMax=cfMax, planarTol=planarTol, check=check) return a -def _setInterpolations(t, loc='cell', double_wall=0, storage='inverse', prefixFile='', sameBase=0, +def _setInterpolations(t, loc='cell', double_wall=0, storage='inverse', prefixFile='', sameBase=0, solver='elsA', nGhostCells=2, parallelDatas=[], cfMax=30., planarTol=0., check=True): if storage != 'direct' and storage != 'inverse': raise TypeError("Warning: setInterpolations: bad value for attribute 'storage'.") @@ -72,7 +72,7 @@ def _setInterpolations(t, loc='cell', double_wall=0, storage='inverse', prefixFi elif loc == 'face': depth=1 else: raise TypeError("setInterpolations: bad value for attribute 'loc'.") if parallelDatas == []: # mode sequentiel - _setSeqInterpolations(t, depth=depth, double_wall=double_wall, storage=storage, prefixFile=prefixFile, + _setSeqInterpolations(t, depth=depth, double_wall=double_wall, storage=storage, prefixFile=prefixFile, sameBase=sameBase, solver=Solver, nGhostCells=nGhostCells, cfMax=cfMax, planarTol=planarTol, check=check) else: # mode distribue @@ -84,7 +84,7 @@ def _setInterpolations(t, loc='cell', double_wall=0, storage='inverse', prefixFi # Calcul des coefficients d'interpolation et stockage dans l'arbre CGNS/Python # dans un environnement distribue #============================================================================== -def _setDistInterpolations(a, parallelDatas=[], depth=2, double_wall=0, +def _setDistInterpolations(a, parallelDatas=[], depth=2, double_wall=0, sameBase=0, solver=1, cfMax=30., check=True): try: import Generator.PyTree as G @@ -95,7 +95,7 @@ def _setDistInterpolations(a, parallelDatas=[], depth=2, double_wall=0, if parallelDatas == []: return None else: - if len(parallelDatas) != 3: + if len(parallelDatas) != 3: raise TypeError("setDistInterpolations: missing datas in parallelDatas.") else: graph = parallelDatas[0] @@ -115,7 +115,7 @@ def _setDistInterpolations(a, parallelDatas=[], depth=2, double_wall=0, # ---------------------------------------------------------------------------------------- # Calcul des cellules et coefficients d'interpolation et ecriture dans un arbre CGNS/Python # ---------------------------------------------------------------------------------------- - # Calcul des donnees sur les domaines d interpolations (coordonnees, noms des zones, cellN, surfaces) + # Calcul des donnees sur les domaines d interpolations (coordonnees, noms des zones, cellN, surfaces) # initialisation de liste de parois et de surfaces pour le traitement 'double_wall' firstWallCenters = []; surfacesExtC = []; walls1 = [] @@ -134,7 +134,7 @@ def _setDistInterpolations(a, parallelDatas=[], depth=2, double_wall=0, interpolationCellnD[oppZone] = [] surfiD[oppZone] = [] - bases = Internal.getBases(a); nbases = len(bases) + bases = Internal.getBases(a); nbases = len(bases) # remplissage des dictionnaires for oppNode in localGraph: oppZones = graph[oppNode][rank] @@ -235,8 +235,8 @@ def _setDistInterpolations(a, parallelDatas=[], depth=2, double_wall=0, # Calcul des coefficients d'interpolation et stockage dans l'arbre CGNS/Python # dans un environnement sequentiel #============================================================================== -def _setSeqInterpolations(a, depth=2, double_wall=0, storage='inverse', prefixFile='', - sameBase=0, solver=1, nGhostCells=2, +def _setSeqInterpolations(a, depth=2, double_wall=0, storage='inverse', prefixFile='', + sameBase=0, solver=1, nGhostCells=2, cfMax=30., planarTol=0., check=True): import Generator.PyTree as G if double_wall == 1: from . import DoubleWall @@ -301,7 +301,7 @@ def _setSeqInterpolations(a, depth=2, double_wall=0, storage='inverse', prefixFi # calcul des cellules d interpolations et des coefficients d interpolations zc = Converter.node2Center(zn) cellN = C.getField('centers:cellN',z)[0] # celln aux centres des cellules - if writeInFile == 1: + if writeInFile == 1: listCellN[ZonesId[z[0]]]=C.getField('centers:cellN',z, api=2)[0]#cellN[1] zc = Converter.addVars([zc,cellN]); del cellN firstWallCenters1 = [] @@ -454,12 +454,12 @@ def _interpInverseStorage(zname, zdonor, nozd, resInterp, depth): if depth == 2: EXdir=numpy.array([], Internal.E_NpyInt) elif depth == 1: EXdir = resInterp[8][nozd] cellIndExtrap = indicesExtrap; cellIndOrphan = indicesOrphan - coef=interpCoef; vol=interpVol; interptype=interpType + coef=interpCoef; vol=interpVol; interptype=interpType # creation des noeuds ZoneSubRegion_t contenant les coefficients d'interpolation et les indices des cellules donneuses # Il y a un noeud ZoneSubRegion_t par paire de blocs interpole / bloc donneur XOD._createInterpRegion__(zdonor,zname, indicesDonor, indRcv, coef, - interptype, vol, cellIndExtrap,cellIndOrphan, - EXdir,indicesDonorExtC, 'Donor',loc=loc) + interptype, vol, cellIndExtrap,cellIndOrphan, + EXdir,indicesDonorExtC, 'Donor',loc=loc) return None #----------------------------------------------------------------------------- @@ -485,8 +485,8 @@ def _interpDirectStorage(z, zdonorname, nozd, resInterp, depth): # les indices des cellules donneuses # Il y a un noeud ZoneSubRegion_t par paire de blocs interpole / bloc donneur XOD._createInterpRegion__(z, zdonorname, indRcv, indicesDonor, coef, - interptype, vol, cellIndExtrap, cellIndOrphan, - EXdir,indicesDonorExtC, 'Receiver', loc=loc) + interptype, vol, cellIndExtrap, cellIndOrphan, + EXdir,indicesDonorExtC, 'Receiver', loc=loc) return None @@ -521,7 +521,7 @@ def chimeraTransfer(t, storage='inverse', variables=[], loc='cell',mesh='extende # locinterp = 'cell' ou 'face' # Pour l'instant on suppose que les interpolations sont realisees aux centres # donc les transferts aussi -# de STEPHANIE : cette fonction semble obsolete... +# de STEPHANIE : cette fonction semble obsolete... #------------------------------------------------------------------------------ def directChimeraTransfer__(t, variables, locinterp): print('Warning: directChimeraTransfer__: donor mesh is located at cell centers.') @@ -648,7 +648,7 @@ def getInterpolationDomains__(bases, nob0, noz0, zn0, surfacest=[], # entres par l'utilisateur # IN: variables: liste des noms des champs sur lesquels le transfert est applique # IN: locinterp='cell' ou 'face', ne marche que pour cell actuellement -# IN: mesh='standard' or 'extended' +# IN: mesh='standard' or 'extended' #------------------------------------------------------------------------------ def inverseChimeraTransfer__(t, variables, locinterp='centers', mesh='extended'): @@ -672,9 +672,9 @@ def inverseChimeraTransfer__(t, variables, locinterp='centers', mesh='extended') localZonesName = [] for z in zones: localZonesName.append(z[0]) - # Definition de dictionnaires pour les champs interpoles : - # Cle : nom zone receveuse. Valeurs : champs interpole + indices pts receveurs + volume cellule donneuse - rcvFields = {} + # Definition de dictionnaires pour les champs interpoles : + # Cle : nom zone receveuse. Valeurs : champs interpole + indices pts receveurs + volume cellule donneuse + rcvFields = {} if depth == 1: rcvLocalFields = {} @@ -687,11 +687,11 @@ def inverseChimeraTransfer__(t, variables, locinterp='centers', mesh='extended') lDonorArrays = [] for i in variables: f = C.getField(i,zdonor)[0] - if f !=[]: + if f !=[]: # Passage du maillage donneur en centres etendus if mesh == 'extended': lDonorArrays.append(Converter.center2ExtCenter(f)) else: lDonorArrays.append(f) - if lDonorArrays != []: + if lDonorArrays != []: donorArray = Converter.addVars(lDonorArrays) # Parcours des ZoneSubRegion pour effectuer les transferts # (Les interpolations sont stockees dans les noeuds ZoneSubRegion_t) @@ -737,10 +737,10 @@ def inverseChimeraTransfer__(t, variables, locinterp='centers', mesh='extended') if f !=[]: lRcvArrays.append(f) if lRcvArrays != []: rcvArray = Converter.addVars(lRcvArrays) else: - raise ValueError("inverseChimeraTransfer: field to interpolate not in zone %d."%rcvZoneName) + raise ValueError("inverseChimeraTransfer: field to interpolate not in zone %d."%rcvZoneName) # A.3 interpolation Chimere - rcvField = Connector.chimeraTransfer(cellRcvPara, cellDonor, interpDonorType, - interpDonor, rcvArray, donorArray)[1] + rcvField = Connector.chimeraTransfer(cellRcvPara, cellDonor, interpDonorType, + interpDonor, rcvArray, donorArray)[1] if rcvZoneName not in localZonesName: # redimensionnement du tableau au nombre de cellules interpolees rcvField2 = numpy.empty((donorArray[1].shape[0]+2,cellRcv.shape[0]), order='F') @@ -834,7 +834,7 @@ def _chimeraInfo(t,type='interpolated'): def _chimeraCellRatio__(t): try: import Generator.PyTree as G except: raise ImportError("chimeraInfo: requires Generator module.") - G._getVolumeMap(t) + G._getVolumeMap(t) zones = Internal.getZones(t) # First pass : direct storage @@ -843,24 +843,24 @@ def _chimeraCellRatio__(t): subRegions = [] for s in subRegions2: sname = s[0][0:2] - if sname=='ID': + if sname=='ID': idn = Internal.getNodesFromName1(s,'InterpolantsDonor') if idn != []: # la subRegion decrit des interpolations subRegions.append(s) subRegions2 = [] volR = C.getField('centers:vol',zr)[0][1] - for s in subRegions: + for s in subRegions: zoneRole = Internal.getNodesFromName2(s,'ZoneRole')[0] zoneRole = Internal.getValue(zoneRole) - if zoneRole == 'Receiver': # direct storage ok + if zoneRole == 'Receiver': # direct storage ok ListVolD = Internal.getNodesFromName2(s,"InterpolantsVol") if ListVolD != []: ListVolD = ListVolD[0][1] - ListRcv = Internal.getNodesFromName1(s,'PointList')[0][1] - nindI = ListRcv.size + ListRcv = Internal.getNodesFromName1(s,'PointList')[0][1] + nindI = ListRcv.size if nindI > 0: field = Converter.array('cellRatio',nindI,1,1) - ListIndex = [] + ListIndex = [] for noind in range(nindI): index = ListRcv[noind] volr = volR[0,index] @@ -876,26 +876,26 @@ def _chimeraCellRatio__(t): subRegions = [] for s in subRegions2: sname = s[0][0:2] - if sname=='ID': + if sname=='ID': idn = Internal.getNodesFromName1(s,'InterpolantsDonor') if idn != []: # la subRegion decrit des interpolations subRegions.append(s) subRegions2 = [] - for s in subRegions: + for s in subRegions: zoneRole = Internal.getNodesFromName2(s,'ZoneRole')[0] zoneRole = Internal.getValue(zoneRole) if zoneRole == 'Donor': # inverse storage ok zrcvname = Internal.getValue(s) zreceivers = Internal.getNodesFromName2(t,zrcvname) zr = Internal.getNodesFromType1(zreceivers,'Zone_t') - if zr != []: - zr = zr[0] + if zr != []: + zr = zr[0] volR = C.getField('centers:vol',zr)[0][1] ListVolD = Internal.getNodesFromName2(s,"InterpolantsVol") if ListVolD != []: ListVolD = ListVolD[0][1] ListRcv = Internal.getNodesFromName1(s,'PointListDonor')[0][1] - nindI = ListRcv.size + nindI = ListRcv.size if nindI > 0: field = Converter.array('cellRatio',nindI,1,1) for noind in range(nindI): @@ -904,7 +904,7 @@ def _chimeraCellRatio__(t): vold = ListVolD[noind] cr = max(volr/vold,vold/volr) field[1][0,noind] = cr - C._setPartialFields(zr, [field], [ListRcv], loc='centers') + C._setPartialFields(zr, [field], [ListRcv], loc='centers') C._rmVars(t,'centers:vol') # faut il la detruire ou non ? pas de test leger pour savoir si c'etait ds l arbre avant return None @@ -916,7 +916,7 @@ def _chimeraCellRatio__(t): def _chimeraDonorAspect__(t): try: import Generator.PyTree as G except: raise ImportError("chimeraInfo: requires Generator module.") - G._getEdgeRatio(t) + G._getEdgeRatio(t) zones = Internal.getZones(t) # First pass : direct storage @@ -925,12 +925,12 @@ def _chimeraDonorAspect__(t): subRegions = [] for s in subRegions2: sname = s[0][0:2] - if sname=='ID': + if sname=='ID': idn = Internal.getNodesFromName1(s,'InterpolantsDonor') if idn != []: # la subRegion decrit des interpolations subRegions.append(s) subRegions2 = [] - for s in subRegions: + for s in subRegions: zoneRole = Internal.getNodesFromName2(s,'ZoneRole')[0] zoneRole = Internal.getValue(zoneRole) if zoneRole == 'Receiver': # direct storage ok @@ -938,18 +938,18 @@ def _chimeraDonorAspect__(t): zdonors = Internal.getNodesFromName2(t,zdnrname) zd = Internal.getNodesFromType1(zdonors,'Zone_t') if zd == []: raise ValueError("chimeraInfo: donor zone %s not found."%zdnrname) - else: zd = zd[0] + else: zd = zd[0] # ListDnr = Internal.getNodesFromName1(s,'PointListDonor')[0][1] # - ListRcv = Internal.getNodesFromName1(s,'PointList')[0][1] + ListRcv = Internal.getNodesFromName1(s,'PointList')[0][1] nindI = ListRcv.size # if nindI > 0: edgeRatio = C.getField('centers:EdgeRatio',zd)[0][1] field = Converter.array('donorAspect',nindI,1,1) - for noind in range(nindI): - indD = ListDnr[noind] + for noind in range(nindI): + indD = ListDnr[noind] field[1][0,noind] = edgeRatio[0,indD] C._setPartialFields(zr, [field], [ListRcv], loc='centers') @@ -960,7 +960,7 @@ def _chimeraDonorAspect__(t): subRegions = [] for s in subRegions2: sname = s[0][0:2] - if sname=='ID': + if sname=='ID': idn = Internal.getNodesFromName1(s, 'InterpolantsDonor') if idn != []: # la subRegion decrit des interpolations subRegions.append(s) @@ -970,26 +970,26 @@ def _chimeraDonorAspect__(t): njdc = max(dimsD[2]-1,1) nidcnjdc = nidc*njdc edgeRatio = C.getField('centers:EdgeRatio',zd)[0][1] - for s in subRegions: + for s in subRegions: zoneRole = Internal.getNodesFromName2(s,'ZoneRole')[0] zoneRole = Internal.getValue(zoneRole) if zoneRole == 'Donor': # inverse storage ok zrcvname = Internal.getValue(s) zreceivers = Internal.getNodesFromName2(t,zrcvname) zr = Internal.getNodesFromType1(zreceivers,'Zone_t') - if zr != []: - zr = zr[0] + if zr != []: + zr = zr[0] ListRcv = Internal.getNodesFromName1(s,'PointListDonor')[0][1] - nindI = ListRcv.size + nindI = ListRcv.size if nindI > 0: ListDnr = Internal.getNodesFromName1(s,'PointList')[0][1] field = Converter.array('donorAspect',nindI,1,1) for noind in range(nindI): - indD = ListDnr[noind] - field[1][0,noind] = edgeRatio[0,indD] - C._setPartialFields(zr, [field], [ListRcv],loc='centers') + indD = ListDnr[noind] + field[1][0,noind] = edgeRatio[0,indD] + C._setPartialFields(zr, [field], [ListRcv],loc='centers') - C._rmVars(t, 'centers:EdgeRatio') + C._rmVars(t, 'centers:EdgeRatio') return None # ============================================================================= @@ -1004,12 +1004,12 @@ def _chimeraNatureOfCells__(t, nature): subRegions = [] for s in subRegions2: sname = s[0][0:2] - if sname== 'ID': + if sname== 'ID': idn = Internal.getNodesFromName1(s,'InterpolantsDonor') if idn != []: # la subRegion decrit des interpolations subRegions.append(s) subRegions2 = [] - for s in subRegions: + for s in subRegions: zoneRole = Internal.getNodesFromName2(s,'ZoneRole')[0] zoneRole = Internal.getValue(zoneRole) if zoneRole == 'Receiver': # direct storage ok @@ -1024,19 +1024,19 @@ def _chimeraNatureOfCells__(t, nature): ListExtrap = Internal.getNodesFromName1(s,'ExtrapPointList') if ListExtrap != []: ListRcv = Internal.getNodesFromName1(s,'PointList')[0][1] - ListExtrap = ListExtrap[0][1] - DonorTypes = Internal.getNodesFromName1(s,'InterpolantsType')[0][1] + ListExtrap = ListExtrap[0][1] + DonorTypes = Internal.getNodesFromName1(s,'InterpolantsType')[0][1] Coefs = Internal.getNodesFromName1(s,'InterpolantsDonor')[0][1] # Somme des |coefs| : necessite ListRcv, ListExtrap, Coefs, DonorType field = Connector.connector.getExtrapAbsCoefs(ListRcv, ListExtrap, DonorTypes, Coefs) - C._setPartialFields(zr, [field], [ListExtrap],loc='centers') + C._setPartialFields(zr, [field], [ListExtrap],loc='centers') elif nature == 'orphan': orphans = Internal.getNodesFromName(s, 'OrphanPointList') if orphans != []: ListOrphan = orphans[0][1] field = Converter.array('orphan',ListOrphan.size,1,1) field = Converter.initVars(field,'orphan',1.) - C._setPartialFields(zr, [field], [ListOrphan],loc='centers') + C._setPartialFields(zr, [field], [ListOrphan],loc='centers') # 2nd pass: storage in donor zones zones = Internal.getZones(t) @@ -1045,41 +1045,41 @@ def _chimeraNatureOfCells__(t, nature): subRegions = [] for s in subRegions2: sname = s[0][0:2] - if sname== 'ID': + if sname== 'ID': idn = Internal.getNodesFromName1(s,'InterpolantsDonor') if idn != []: # la subRegion decrit des interpolations subRegions.append(s) subRegions2 = [] - for s in subRegions: + for s in subRegions: zoneRole = Internal.getNodesFromName2(s,'ZoneRole')[0] zoneRole = Internal.getValue(zoneRole) if zoneRole == 'Donor': # inverse storage ok zrcvname = Internal.getValue(s) zreceivers = Internal.getNodesFromName2(t,zrcvname) zr = Internal.getNodesFromType1(zreceivers,'Zone_t') - if zr != []: - zr = zr[0] + if zr != []: + zr = zr[0] if nature == 'interpolated': ListRcv = Internal.getNodesFromName1(s, 'PointListDonor')[0][1] if ListRcv is not None: field = Converter.array('interpolated',ListRcv.size,1,1) field = Converter.initVars(field,'interpolated',1.) - C._setPartialFields(zr, [field], [ListRcv], loc='centers') + C._setPartialFields(zr, [field], [ListRcv], loc='centers') elif nature == 'extrapolated': ListExtrap = Internal.getNodesFromName1(s,'ExtrapPointList') if ListExtrap != []: ListExtrap = ListExtrap[0][1] - DonorTypes = Internal.getNodesFromName1(s,'InterpolantsType')[0][1] + DonorTypes = Internal.getNodesFromName1(s,'InterpolantsType')[0][1] Coefs = Internal.getNodesFromName1(s,'InterpolantsDonor')[0][1] ListRcv = Internal.getNodesFromName1(s,'PointListDonor')[0][1] # Somme des |coefs| : necessite ListRcv, ListExtrap, Coefs, DonorType field = Connector.connector.getExtrapAbsCoefs(ListRcv, ListExtrap, DonorTypes, Coefs) - C._setPartialFields(zr, [field], [ListExtrap], loc='centers') + C._setPartialFields(zr, [field], [ListExtrap], loc='centers') elif nature == 'orphan': orphans = Internal.getNodesFromName(s, 'OrphanPointList') if orphans != []: ListOrphan = orphans[0][1] field = Converter.array('orphan',ListOrphan.size,1,1) field = Converter.initVars(field,'orphan',1.) - C._setPartialFields(zr, [field], [ListOrphan], loc='centers') + C._setPartialFields(zr, [field], [ListOrphan], loc='centers') return None diff --git a/Cassiopee/Connector/Connector/PyTree.py b/Cassiopee/Connector/Connector/PyTree.py index aeac41a0f..ac7ec4b5a 100644 --- a/Cassiopee/Connector/Connector/PyTree.py +++ b/Cassiopee/Connector/Connector/PyTree.py @@ -6,9 +6,9 @@ from .OversetDataDtlocal import setInterpData3 from .OversetData import setInterpTransfers, _setInterpTransfers, __setInterpTransfers, _addCellN__, setInterpData, _setInterpData, _setIBCData, setInterpTransfersD, \ -_setInterpTransfersD, _setIBCTransfersForPressureGradients, _setIBCTransfersDForPressureGradients, _setIBCTransfers4GradP, _setIBCTransfers4GradP2, \ -_setIBCTransfers4GradP3, _setIBCTransfers4FULLTBLE, _setIBCTransfers4FULLTBLE2, _modifcellNBC, getIntersectingDomains, getCEBBTimeIntersectingDomains, \ -getCEBBIntersectingDomains, cellN2OversetHoles, extractChimeraInfo, getOversetInfo, setIBCData, transferFields, setInterpData2, _setInterpData2 + _setInterpTransfersD, _setIBCTransfersForPressureGradients, _setIBCTransfersDForPressureGradients, _setIBCTransfers4GradP, _setIBCTransfers4GradP2, \ + _setIBCTransfers4GradP3, _setIBCTransfers4FULLTBLE, _setIBCTransfers4FULLTBLE2, _modifcellNBC, getIntersectingDomains, getCEBBTimeIntersectingDomains, \ + getCEBBIntersectingDomains, cellN2OversetHoles, extractChimeraInfo, getOversetInfo, setIBCData, transferFields, setInterpData2, _setInterpData2 from .OversetDataElsA import _chimeraInfo, setInterpolations, chimeraInfo, chimeraTransfer from .compactTransfers import ___setInterpTransfers, miseAPlatDonorTree__ @@ -202,7 +202,7 @@ def _connectMatchStruct__(a, tol, dim, glob): zones.append(z) if dimPb == -1: dimPb=Internal.getZoneDim(z)[4] else: - if dimPb != Internal.getZoneDim(z)[4]: + if dimPb != Internal.getZoneDim(z)[4]: print('Warning: some structured zones in connectMatch are not of same dimension. Function might fail...') # extract empty windows structTags,structWins,structIndirBlkOfWins,typeOfWins,dimsI,dimsJ,dimsK = \ @@ -243,7 +243,7 @@ def _connectMatchStruct__(a, tol, dim, glob): # addBC2Zone... name1 = 'match%d_%d'%(noz1+1,glob); glob += 1 name2 = 'match%d_%d'%(noz2+1,glob); glob += 1 - C._addBC2Zone(zones[noz1],name1,'BCMatch',range1,zones[noz2],range2,topp0) + C._addBC2Zone(zones[noz1],name1,'BCMatch',range1,zones[noz2],range2,topp0) C._addBC2Zone(zones[noz2],name2,'BCMatch',range2,zones[noz1],range1,topp) # couplage RANS/laminar ou euler @@ -680,9 +680,9 @@ def duplicatePeriodicZones__(t, rotationCenter=[0.,0.,0.], rotationAngle=[0.,0., dupZones = [typePeriodic,zonesdupP,zonesdupM] elif typePeriodic == 2: zonesdupP = T.rotate(zones,(rotationCenter[0],rotationCenter[1],rotationCenter[2]),\ - (rotationAngle[0],rotationAngle[1],rotationAngle[2])) + (rotationAngle[0],rotationAngle[1],rotationAngle[2])) zonesdupM = T.rotate(zones,(rotationCenter[0],rotationCenter[1],rotationCenter[2]),\ - (-rotationAngle[0],-rotationAngle[1],-rotationAngle[2])) + (-rotationAngle[0],-rotationAngle[1],-rotationAngle[2])) dupZones = [typePeriodic,zonesdupP,zonesdupM] @@ -943,9 +943,9 @@ def blankCells(t, bodies, blankingMatrix=[], depth=2, depth = 2 if blankingType != 'cell_intersect' and \ - blankingType != 'cell_intersect_opt' and \ - blankingType != 'center_in' and \ - blankingType != 'node_in': + blankingType != 'cell_intersect_opt' and \ + blankingType != 'center_in' and \ + blankingType != 'node_in': print('Warning: blankCells: blankingType must be cell_intersect, cell_intersect_opt, center_in or node_in.') print('Set to default (cell_intersect).') blankingType = 'cell_intersect' @@ -1013,9 +1013,9 @@ def _blankCells(a, bodies, blankingMatrix=[], depth=2, blankingType='cell_intersect' if blankingType != 'cell_intersect' and \ - blankingType != 'cell_intersect_opt' and \ - blankingType != 'center_in' and \ - blankingType != 'node_in': + blankingType != 'cell_intersect_opt' and \ + blankingType != 'center_in' and \ + blankingType != 'node_in': print('Warning: blankCells: blankingType must be cell_intersect, cell_intersect_opt, center_in or node_in.') print('Set to default (cell_intersect).') blankingType = 'cell_intersect' @@ -1130,7 +1130,7 @@ def blankCellsTetra(t, mT4, blankingMatrix=[], blankingType='node_in', # Masquage par Tri (surface Tri) #============================================================================== def blankCellsTri(t, mT3, blankingMatrix=[], blankingType='node_in', - tol=1.e-12, cellnval=0, overwrite=0, cellNName='cellN'): + tol=1.e-12, cellnval=0, overwrite=0, cellNName='cellN'): try: import Transform as T except: raise ImportError("blankCellsTri: requires Transform module.") @@ -1185,7 +1185,7 @@ def blankCellsTri(t, mT3, blankingMatrix=[], blankingType='node_in', return a def _blankCellsTri(a, mT3, blankingMatrix=[], blankingType='node_in', - tol=1.e-12, cellnval=0, overwrite=0, cellNName='cellN'): + tol=1.e-12, cellnval=0, overwrite=0, cellNName='cellN'): try: import Transform as T except: raise ImportError("blankCellsTri: requires Transform module.") @@ -1414,7 +1414,7 @@ def optimizeOverlap(t, double_wall=0, priorities=[], planarTol=0., intersections vol2 = C.getField('centers:vol',z2)[0] ac2 = Converter.addVars([ac2,sol2,vol2]) res = Connector.optimizeOverlap__(ae1, ac1, ae2, ac2, prio1=prio1, prio2=prio2, \ - isDW=isDW, hook1=adt1, hook2=adt2) + isDW=isDW, hook1=adt1, hook2=adt2) cellN1 = Converter.extractVars(res[0],['cellN']) cellN2 = Converter.extractVars(res[1],['cellN']) C.setFields([cellN1], z1, 'centers', False) @@ -1481,7 +1481,7 @@ def optimizeOverlap(t, double_wall=0, priorities=[], planarTol=0., intersections acn1 = Converter.addVars([acn1,cellN1]) acn2 = Converter.addVars([acn2,cellN2]) res = Connector.optimizeOverlap__(ae1, acn1, ae2, acn2, prio1,prio2,isDW,\ - hook1=adt1, hook2=adt2) + hook1=adt1, hook2=adt2) cellN1 = Converter.extractVars(res[0],['cellN']) cellN2 = Converter.extractVars(res[1],['cellN']) ac1 = Converter.rmVars(ac1,['cellN']); ac1 = Converter.addVars([ac1,cellN1]) @@ -1492,7 +1492,7 @@ def optimizeOverlap(t, double_wall=0, priorities=[], planarTol=0., intersections if isTempPeriodicZone2==0: parent2[2][d2] = z2 else: res = Connector.optimizeOverlap__(ae1, ac1, ae2, ac2, prio1,prio2,isDW,\ - hook1=adt1, hook2=adt2) + hook1=adt1, hook2=adt2) cellN1 = Converter.extractVars(res[0],['cellN']) cellN2 = Converter.extractVars(res[1],['cellN']) ac1 = Converter.rmVars(ac1,['cellN']); ac1 = Converter.addVars([ac1,cellN1]) @@ -1986,10 +1986,10 @@ def _doubleWall(t, tc, familyBC1, familyBC2, ghostCells=False, check=False, surf for z in Internal.getZones(b): for f1 in familyBC1: wall1 = C.getFamilyBCs(z, f1) - for w in wall1: listOfMismatch1.append(b[0]+'/'+z[0]+'/'+w[0]) + for w in wall1: listOfMismatch1.append(b[0]+'/'+z[0]+'/'+w[0]) for f2 in familyBC2: wall2 = C.getFamilyBCs(z, f2) - for w in wall2: listOfMismatch2.append(b[0]+'/'+z[0]+'/'+w[0]) + for w in wall2: listOfMismatch2.append(b[0]+'/'+z[0]+'/'+w[0]) # project interpolated points (cellN=2) from listOfMismatch2 onto listOfMismatch1 DoubleWall._changeWall2(t, tc, listOfMismatch1, listOfMismatch2, '_'.join(familyBC1), '_'.join(familyBC2), ghostCells, check, surfaceCenters1) @@ -2010,6 +2010,6 @@ def initDoubleWall(t, familyBC1, check=False): for z in Internal.getZones(b): for f1 in familyBC1: wall1 = C.getFamilyBCs(z, f1) - for w in wall1: listOfMismatch1.append(b[0]+'/'+z[0]+'/'+w[0]) + for w in wall1: listOfMismatch1.append(b[0]+'/'+z[0]+'/'+w[0]) return DoubleWall.getProjSurfaceForDoubleWall(t, listOfMismatch1, '_'.join(familyBC1), check) diff --git a/Cassiopee/Connector/Connector/ToolboxIBM_Composite.py b/Cassiopee/Connector/Connector/ToolboxIBM_Composite.py index f8129318d..95eeb7595 100644 --- a/Cassiopee/Connector/Connector/ToolboxIBM_Composite.py +++ b/Cassiopee/Connector/Connector/ToolboxIBM_Composite.py @@ -44,9 +44,9 @@ def generateCompositeIBMMesh(tb, vmin, snears, dfar, dfarloc=0., DEPTH=2, NP=0, base = tb[2][nob] if base[3] == 'CGNSBase_t': basename = base[0] - res = generateIBMMesh_legacy(base, vmin, snears, dfarloc, DEPTH=DEPTH, NP=NP, tbox=None, snearsf=None, - check=check, merged=merged, symmetry=symmetry, sizeMax=sizeMax, externalBCType='BCDummy', to=None, - composite=1, mergeByParents=False) + res = generateIBMMesh_legacy(base, vmin, snears, dfarloc, DEPTH=DEPTH, NP=NP, tbox=None, snearsf=None, + check=check, merged=merged, symmetry=symmetry, sizeMax=sizeMax, externalBCType='BCDummy', to=None, + composite=1, mergeByParents=False) res = Internal.getZones(res) t[2][nob][2]=res @@ -58,7 +58,7 @@ def generateCompositeIBMMesh(tb, vmin, snears, dfar, dfarloc=0., DEPTH=2, NP=0, if dimPb == 2: extf = T.subzone(extf,(1,1,1),(-1,1,1)) extf = G.getVolumeMap(extf) dxloc=C.getValue(extf,'centers:vol',0) - if dimPb == 3: + if dimPb == 3: dxloc=dxloc**0.5 lMax = max(lMax, dxloc) snearsExt.append(dxloc) @@ -71,16 +71,16 @@ def generateCompositeIBMMesh(tb, vmin, snears, dfar, dfarloc=0., DEPTH=2, NP=0, xminb = bbl[0]+DEPTHEXT*lMax; xmaxb = bbl[3]-DEPTHEXT*lMax yminb = bbl[1]+DEPTHEXT*lMax; ymaxb = bbl[4]-DEPTHEXT*lMax if dimPb == 3: - zminb = bbl[2]+DEPTHEXT*lMax; zmaxb = bbl[5]-DEPTHEXT*lMax + zminb = bbl[2]+DEPTHEXT*lMax; zmaxb = bbl[5]-DEPTHEXT*lMax blankingBoxL = G.cart((xminb,yminb,zminb),(xmaxb-xminb,ymaxb-yminb,zmaxb-zminb),(2,2,2)) else: blankingBoxL = G.cart((xminb,yminb,0.),(xmaxb-xminb,ymaxb-yminb,1.),(2,2,1)) blankingBoxL = P.exteriorFaces(blankingBoxL) tblank[2][nob][2]=[blankingBoxL] - tcart = generateIBMMesh_legacy(tov, vmin, snearsExt, dfar, DEPTH=DEPTH, NP=NP, tbox=tbox, - snearsf=snearsf, check=check, merged=1, sizeMax=sizeMax, - symmetry=symmetry, externalBCType='BCFarfield', to=None, mergeByParents=True) + tcart = generateIBMMesh_legacy(tov, vmin, snearsExt, dfar, DEPTH=DEPTH, NP=NP, tbox=tbox, + snearsf=snearsf, check=check, merged=1, sizeMax=sizeMax, + symmetry=symmetry, externalBCType='BCFarfield', to=None, mergeByParents=True) tcart[2][1][0] = 'OffBody' C._rmBCOfType(t,'BCDummy') # near body grids external borders must be BCOverlap t = C.fillEmptyBCWith(t,'ov_ext','BCOverlap',dim=dimPb) @@ -88,7 +88,7 @@ def generateCompositeIBMMesh(tb, vmin, snears, dfar, dfarloc=0., DEPTH=2, NP=0, model = Internal.getValue(model) C._addState(t,'GoverningEquations',model) C._addState(t,'EquationDimension',dimPb) - C._addState(t,state=refstate) + C._addState(t,state=refstate) return t, tblank #----------------------------------------------------------- @@ -112,35 +112,35 @@ def prepareCompositeIBMData(t,tb, DEPTH=2, loc='centers', frontType=1): tloc,tcloc=prepareIBMData_legacy(tloc,tbloc,DEPTH=DEPTH, loc=loc, frontType=frontType, interp='composite') C._cpVars(tloc,'centers:cellN',tcloc,'cellN') tc[2][nob][2]+=Internal.getZones(tcloc) - Internal._rmNodesFromType(t[2][nob],"Zone_t") + Internal._rmNodesFromType(t[2][nob],"Zone_t") t[2][nob][2]+=Internal.getZones(tloc) - # + # offbodyZones = C.node2Center(t[2][-1][2]) Internal._rmNodesByName(tc, "*TurbulentDistance*") Internal._rmNodesByName(tc, Internal.__FlowSolutionCenters__) tc[2][-1][2]+= offbodyZones - return t, tc + return t, tc def prepareCompositeChimeraData(t,tc,tblank,noBaseOff, DEPTH=2,loc='centers', NIT=1, RotationCenter=None, RotationAngle=None, Translation=None): tBB = G.BB(tc) listOfOffBodyIntersectingNBZones=getListOfOffBodyIntersectingNBZones(tBB, noBaseOff, NIT=NIT, DEPTH=DEPTH, - RotationCenter=RotationCenter, - RotationAngle=RotationAngle, + RotationCenter=RotationCenter, + RotationAngle=RotationAngle, Translation=Translation) listOfSteadyOffBodyZones=getListOfSteadyOffBodyZones(tBB,noBaseOff,listOfOffBodyIntersectingNBZones) - t,tc=prepareSteadyOffBodyChimeraData(t,tc,tblank, noBaseOff, tBB=tBB,DEPTH=2,loc='centers', NIT=NIT, + t,tc=prepareSteadyOffBodyChimeraData(t,tc,tblank, noBaseOff, tBB=tBB,DEPTH=2,loc='centers', NIT=NIT, RotationCenter=RotationCenter, RotationAngle=RotationAngle, Translation=Translation, listOfSteadyOffBodyZones=listOfSteadyOffBodyZones) - t,tc=prepareMotionChimeraData(t,tc,tblank,noBaseOff, tBB=tBB,DEPTH=2,loc='centers', NIT=NIT, + t,tc=prepareMotionChimeraData(t,tc,tblank,noBaseOff, tBB=tBB,DEPTH=2,loc='centers', NIT=NIT, RotationCenter=RotationCenter, RotationAngle=RotationAngle, Translation=Translation, listOfSteadyOffBodyZones=listOfSteadyOffBodyZones, listOfOffBodyIntersectingNBZones=listOfOffBodyIntersectingNBZones) Internal._rmNodesByName(tc,Internal.__FlowSolutionNodes__) - Internal._rmNodesByName(tc,Internal.__GridCoordinates__) + Internal._rmNodesByName(tc,Internal.__GridCoordinates__) return t,tc #------------------------------------------------------------------------------------------------------------------- @@ -190,7 +190,7 @@ def getListOfOffBodyIntersectingNBZones(tBB, noBaseOff, NIT=1, DEPTH=2, C._initVars(tBB[2][noBaseOff],"{CoordinateZInit}={CoordinateZ}") for it in range(NIT): - if constantMotion: + if constantMotion: if rotation: angleX = RotationAngle[0]*it angleY = RotationAngle[1]*it @@ -212,10 +212,10 @@ def getListOfOffBodyIntersectingNBZones(tBB, noBaseOff, NIT=1, DEPTH=2, tz = Translation[it][2] # on fait bouger le maillage de fond dans le mvt oppose - pour ne pas bouger ts les maillages proches corps - if rotation: - tBB[2][noBaseOff]=T.rotate(tBB[2][noBaseOff],(xc0,yc0,zc0),(-angleX,-angleY,-angleZ)) - elif translation: - tBB[2][noBaseOff]=T.translate(tBB[2][noBaseOff],(-tx,-ty,-tz)) + if rotation: + tBB[2][noBaseOff]=T.rotate(tBB[2][noBaseOff],(xc0,yc0,zc0),(-angleX,-angleY,-angleZ)) + elif translation: + tBB[2][noBaseOff]=T.translate(tBB[2][noBaseOff],(-tx,-ty,-tz)) for nob in range(len(tBB[2])): if nob != noBaseOff and Internal.getType(tBB[2][nob])=='CGNSBase_t': @@ -242,10 +242,10 @@ def prepareMotionChimeraData(t,tc,tblank,noBaseOff, tBB=None,DEPTH=2,loc='center # arbre de BBox des zones donneuses if tBB is None: tBB = G.BB(tc)# BB des zones donneuses - if listOfOffBodyIntersectingNBZones is None: + if listOfOffBodyIntersectingNBZones is None: listOfOffBodyIntersectingNBZones=getListOfOffBodyIntersectingNBZones(tBB, noBaseOff, NIT=NIT, DEPTH=DEPTH, - RotationCenter=RotationCenter, - RotationAngle=RotationAngle, + RotationCenter=RotationCenter, + RotationAngle=RotationAngle, Translation=Translation) listOfSteadyOffBodyZones=getListOfSteadyOffBodyZones(tBB,noBaseOff,listOfOffBodyIntersectingNBZones) @@ -297,13 +297,13 @@ def prepareMotionChimeraData(t,tc,tblank,noBaseOff, tBB=None,DEPTH=2,loc='center dictOfNearBodyBaseNb[zname]=nob dictOfOffBodyZoneNb={} - dictOfOffBodyADT={} # preconditionnement + dictOfOffBodyADT={} # preconditionnement for noz in range(len(tc[2][noBaseOff][2])): z = tc[2][noBaseOff][2][noz] zname = z[0] if Internal.getType(z)=='Zone_t': dictOfOffBodyZoneNb[zname] = noz - if zname in listOfOffBodyIntersectingNBZones: + if zname in listOfOffBodyIntersectingNBZones: zc = tc[2][noBaseOff][2][noz] hook0=C.createHook(zc,'adt') dictOfOffBodyADT[zname]=hook0 @@ -321,7 +321,7 @@ def prepareMotionChimeraData(t,tc,tblank,noBaseOff, tBB=None,DEPTH=2,loc='center if NIT > 1: for zc in Internal.getZones(tc): IDatas = Internal.getNodesFromName(zc,"ID_*") - for ID in IDatas: + for ID in IDatas: name=ID[0].split('_') ID[0]='IDSteady_%s'%(name[1]) @@ -346,7 +346,7 @@ def prepareMotionChimeraData(t,tc,tblank,noBaseOff, tBB=None,DEPTH=2,loc='center for it in range(NIT): print (' ------------------- Iteration %d ----------------------- '%it) - if constantMotion: + if constantMotion: if rotation: angleX = RotationAngle[0]*it angleY = RotationAngle[1]*it @@ -369,7 +369,7 @@ def prepareMotionChimeraData(t,tc,tblank,noBaseOff, tBB=None,DEPTH=2,loc='center ty = Translation[it][1] tz = Translation[it][2] - if rotation: tblankM = T.rotate(tblank,(xc0,yc0,zc0),(angleX,angleY,angleZ)) + if rotation: tblankM = T.rotate(tblank,(xc0,yc0,zc0),(angleX,angleY,angleZ)) elif translation: tblankM = T.translate(tblank,(tx,ty,tz)) C._initVars(tloc,"{centers:cellN}={centers:cellNInit}") @@ -386,23 +386,23 @@ def prepareMotionChimeraData(t,tc,tblank,noBaseOff, tBB=None,DEPTH=2,loc='center for nob in range(len(t[2])): base = t[2][nob] if nob != noBaseOff and Internal.getType(base)=='CGNSBase_t': - if rotation: - T._rotate(base,(xc0,yc0,zc0),(angleX,angleY,angleZ)) - T._rotate(tBB[2][nob],(xc0,yc0,zc0),(angleX,angleY,angleZ)) + if rotation: + T._rotate(base,(xc0,yc0,zc0),(angleX,angleY,angleZ)) + T._rotate(tBB[2][nob],(xc0,yc0,zc0),(angleX,angleY,angleZ)) T._rotate(tc[2][nob],(xc0,yc0,zc0),(angleX,angleY,angleZ)) - elif translation: + elif translation: T._translate(base,(tx,ty,tz)) T._translate(tBB[2][nob],(tx,ty,tz)) T._translate(tc[2][nob],(tx,ty,tz)) tBBNB = Internal.rmNodesByName(tBB, tBB[2][noBaseOff][0]) - intersectionsDictOffNB = X.getIntersectingDomains(tBB[2][noBaseOff], t2=tBBNB, method='AABB', - taabb=tBB[2][noBaseOff],taabb2=tBBNB) + intersectionsDictOffNB = X.getIntersectingDomains(tBB[2][noBaseOff], t2=tBBNB, method='AABB', + taabb=tBB[2][noBaseOff],taabb2=tBBNB) for nob in range(len(t[2])): base = t[2][nob] if nob != noBaseOff and Internal.getType(base)=='CGNSBase_t': # test intersection entre maillage proche corps et maillage de fond - intersectionsDictNBO = X.getIntersectingDomains(tBB[2][nob], t2=tBB[2][noBaseOff], method='AABB', + intersectionsDictNBO = X.getIntersectingDomains(tBB[2][nob], t2=tBB[2][noBaseOff], method='AABB', taabb=tBB[2][nob],taabb2=tBB[2][noBaseOff]) print('Near-body base %s in motion'%(base[0])) @@ -432,8 +432,8 @@ def prepareMotionChimeraData(t,tc,tblank,noBaseOff, tBB=None,DEPTH=2,loc='center for zd in donorZones: znamed = zd[0] if znamed in dictOfOffBodyZoneNb: - nozd = dictOfOffBodyZoneNb[znamed] - tc[2][noBaseOff][2][nozd] = zd + nozd = dictOfOffBodyZoneNb[znamed] + tc[2][noBaseOff][2][nozd] = zd elif znamed in dictOfNearBodyZoneNb: nozd = dictOfNearBodyZoneNb[znamed] nobd = dictOfNearBodyBaseNb[znamed] @@ -470,19 +470,19 @@ def prepareMotionChimeraData(t,tc,tblank,noBaseOff, tBB=None,DEPTH=2,loc='center for zd in donorZones: znamed = zd[0] if znamed in dictOfOffBodyZoneNb: - nozd = dictOfOffBodyZoneNb[znamed] - tc[2][noBaseOff][2][nozd] = zd + nozd = dictOfOffBodyZoneNb[znamed] + tc[2][noBaseOff][2][nozd] = zd elif znamed in dictOfNearBodyZoneNb: nozd = dictOfNearBodyZoneNb[znamed] nobd = dictOfNearBodyBaseNb[znamed] tc[2][nobd][2][nozd]=zd - for dnrname in dictOfMotionADT: C.freeHook(dictOfMotionADT[dnrname]) + for dnrname in dictOfMotionADT: C.freeHook(dictOfMotionADT[dnrname]) # Reinit if NIT == 1: - for dnrname in dictOfOffBodyADT: C.freeHook(dictOfOffBodyADT[dnrname]) - C._rmVars(tc,["CoordinateX","CoordinateY","CoordinateZ","cellNInit","CoordinateXInit","CoordinateYInit","CoordinateZInit"]) + for dnrname in dictOfOffBodyADT: C.freeHook(dictOfOffBodyADT[dnrname]) + C._rmVars(tc,["CoordinateX","CoordinateY","CoordinateZ","cellNInit","CoordinateXInit","CoordinateYInit","CoordinateZInit"]) C._initVars(t,'{CoordinateX}={CoordinateXInit}') C._initVars(t,'{CoordinateY}={CoordinateYInit}') C._initVars(t,'{CoordinateZ}={CoordinateZInit}') @@ -493,13 +493,13 @@ def prepareMotionChimeraData(t,tc,tblank,noBaseOff, tBB=None,DEPTH=2,loc='center else: for zc in Internal.getZones(tc): IDatas = Internal.getNodesFromName(zc,"ID_*") - for ID in IDatas: + for ID in IDatas: name=ID[0].split('_') ID[0]='ID#%d_%s'%(it,name[1]) - if it == 5: + if it == 5: C.convertPyTree2File(t,"t5.cgns") - C.convertPyTree2File(tc,"tc5.cgns") + C.convertPyTree2File(tc,"tc5.cgns") C._initVars(tc[2][noBaseOff],"{cellN}={cellNInit}")# reinit C._initVars(t[2][noBaseOff],"{centers:cellN}={centers:cellNInit}")# reinit C._initVars(tc,'{CoordinateX}={CoordinateXInit}') @@ -512,12 +512,12 @@ def prepareMotionChimeraData(t,tc,tblank,noBaseOff, tBB=None,DEPTH=2,loc='center C._initVars(tBB,'{CoordinateY}={CoordinateYInit}') C._initVars(tBB,'{CoordinateZ}={CoordinateZInit}') - for dnrname in dictOfOffBodyADT: C.freeHook(dictOfOffBodyADT[dnrname]) + for dnrname in dictOfOffBodyADT: C.freeHook(dictOfOffBodyADT[dnrname]) C._rmVars(t,["centers:cellNInit","CoordinateXInit","CoordinateYInit","CoordinateZInit"]) C._initVars(tc[2][noBaseOff],"{cellN}={cellNInit}") C._cpVars(tc,"cellN",t,"centers:cellN") - C._rmVars(tc,["cellNInit","CoordinateXInit","CoordinateYInit","CoordinateZInit"]) + C._rmVars(tc,["cellNInit","CoordinateXInit","CoordinateYInit","CoordinateZInit"]) return t, tc #------------------------------------------------------------------------------------------------------------------- @@ -546,7 +546,7 @@ def prepareSteadyOffBodyChimeraData(t,tc,tblank,noBaseOff, tBB=None,DEPTH=2,loc= C._initVars(t[2][noBaseOff],"centers:cellN", 1.) t[2][noBaseOff] = X.applyBCOverlaps(t[2][noBaseOff],depth=DEPTH,loc=loc) C._cpVars(t[2][noBaseOff],"centers:cellN",tc[2][noBaseOff],"cellN") - dictOfADT={} # preconditionnement + dictOfADT={} # preconditionnement for zname in listOfSteadyOffBodyZones: noz = dictOfOffBodyZoneNbRcv[zname] z = t[2][noBaseOff][2][noz] @@ -565,8 +565,8 @@ def prepareSteadyOffBodyChimeraData(t,tc,tblank,noBaseOff, tBB=None,DEPTH=2,loc= hook=hooks, itype='chimera') for zd in donorZones: znamed = zd[0] - nozd = dictOfOffBodyZoneNb[znamed] + nozd = dictOfOffBodyZoneNb[znamed] tc[2][noBaseOff][2][nozd] = zd - for dnrname in dictOfADT: C.freeHook(dictOfADT[dnrname]) + for dnrname in dictOfADT: C.freeHook(dictOfADT[dnrname]) return t, tc diff --git a/Cassiopee/Connector/Connector/compactTransfers.py b/Cassiopee/Connector/Connector/compactTransfers.py index 6905cf8d7..abf076f78 100644 --- a/Cassiopee/Connector/Connector/compactTransfers.py +++ b/Cassiopee/Connector/Connector/compactTransfers.py @@ -38,7 +38,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= if 'graphID_Unsteady' in graph: graphID_U = graph['graphID_Unsteady'] graphID_S = graph['graphID_Steady'] - else: + else: graphID_U = None; graphID_S = None elif graph is not None and graphliste==True: procDict = graph[0]['procDict'] @@ -53,7 +53,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= # print("GRAPH IBC IS : ",graph['graphIBCD']) # print("graphID IS :",graph['graphID']) - # print("procDict is : ",procDict) + # print("procDict is : ",procDict) size_int = 0 size_real = 0 listproc = [] @@ -142,7 +142,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= TimeLevelNumber = len(inst) - if TimeLevelNumber != 1+numero_max-numero_min and len(inst)!= 0: + if TimeLevelNumber != 1+numero_max-numero_min and len(inst)!= 0: raise ValueError("miseAPlatDonorTree__: missing timestep in tc : %d %d %d")%(numero_max,numero_min, TimeLevelNumber) @@ -156,12 +156,12 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= RotationAngle = Internal.getNodeFromName1(s, 'RotationAngle') RotationCenter= Internal.getNodeFromName1(s, 'RotationCenter') prange = Internal.getNodeFromName1(s, 'PointRange') # Besoin des point range pour l'explicite local - pranged = Internal.getNodeFromName1(s, 'PointRangeDonor') # Besoin des point range pour l'explicite local + pranged = Internal.getNodeFromName1(s, 'PointRangeDonor') # Besoin des point range pour l'explicite local direction = Internal.getNodeFromName1(s, 'DirReceveur') # Besoin des directions pour l'explicite local - directiond = Internal.getNodeFromName1(s, 'DirDonneur') # Besoin des point directions pour l'explicite local + directiond = Internal.getNodeFromName1(s, 'DirDonneur') # Besoin des point directions pour l'explicite local transfo = Internal.getNodeFromName1(s, 'Transform') # Besoin du transform pour l'explicite local pt_pivot = Internal.getNodeFromName1(s, 'PointPivot') # Besoin du point pivot pour l'explicite local (conservativite) - profondeur = Internal.getNodeFromName1(s, 'Profondeur') # Besoin de la profondeur pour l'explicite local (nearmatch) + profondeur = Internal.getNodeFromName1(s, 'Profondeur') # Besoin de la profondeur pour l'explicite local (nearmatch) ratio = Internal.getNodeFromName1(s, 'NMratio') # Besoin des ratios entre les pas d espace des zones donneuse et receveuse (exp local) levelrcv = Internal.getNodeFromName1(s, 'LevelZRcv') # Niveau en temps zone receveuse (exp local) leveldnr = Internal.getNodeFromName1(s, 'LevelZDnr') # Niveau en temps zone donneuse (exp local) @@ -180,7 +180,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= motion_type = Internal.getNodeFromName1(s, 'MotionType') kcurv = Internal.getNodeFromName1(s, XOD.__KCURV__) sd1 = Internal.getNodeFromName1(s, 'StagnationEnthalpy') - yline = Internal.getNodeFromName1(s, 'CoordinateN_ODE') + yline = Internal.getNodeFromName1(s, 'CoordinateN_ODE') # cas ou les vitesses n'ont pas ete ajoutees lors du prep (ancien tc) @@ -203,7 +203,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= if qloc_1 is None: for f_i in range (1,neq_trans+1): s[2].append([ibm_lbm_variables_1 + str(f_i) , numpy.zeros((nIBC),numpy.float64) , [], 'DataArray_t']) - qloc_1 = Internal.getNodeFromName1(s, ibm_lbm_variables_1 + str(1)) + qloc_1 = Internal.getNodeFromName1(s, ibm_lbm_variables_1 + str(1)) qloc_2 = Internal.getNodeFromName1(s, ibm_lbm_variables_2 + str(1)) if qloc_2 is None: @@ -243,22 +243,22 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= if xcInit is not None: ntab_IBC += 9 # 3 for each type IBM point - 3 wall points, 3 target points, & 3 image points if motion_type is not None: ntab_IBC += 11 #MotionType,transl_speed(x3),axis_pnt(x3),axis_vct(x3),omega if kcurv is not None: ntab_IBC += 1 - if sd1 is not None: ntab_IBC += 5 + if sd1 is not None: ntab_IBC += 5 if yline is not None: ntab_IBC += (7*nbpts_linelets+2) if sname == 'IB' and model == "LBMLaminar": if qloc_1 is not None: ntab_IBC += neq_trans - if qloc_2 is not None: ntab_IBC += neq_trans + if qloc_2 is not None: ntab_IBC += neq_trans if qloc_3 is not None: ntab_IBC += neq_trans - if sname == 'IB': + if sname == 'IB': size_IBC = Nbpts_D*ntab_IBC - count_IBC += 1 - else: + count_IBC += 1 + else: count_ID += 1 # periodicite azimutale rotation = 0 - if RotationAngle is not None: rotation +=3 - if RotationCenter is not None: rotation +=3 + if RotationAngle is not None: rotation +=3 + if RotationCenter is not None: rotation +=3 nrac = nrac + 1 if proc not in listproc: @@ -305,31 +305,31 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= if not graphliste: # Si le graph n est pas une liste, on n'est pas en explicite local - #on determine la liste des processus pour lequel rank est Receveur + #on determine la liste des processus pour lequel rank est Receveur graphIBCrcv=[];graphIDrcv=[] if graphIBCD is not None: - #on recupere les infos Steady + #on recupere les infos Steady graphIBCrcv_=[]; pos_IBC=[]; S_IBC= 1; graphloc=[] - S_IBC = _procSource(rank, S_IBC, pos_IBC, graphIBCD, graphloc, graphIBCrcv_) + S_IBC = _procSource(rank, S_IBC, pos_IBC, graphIBCD, graphloc, graphIBCrcv_) - graphIBCrcv = pos_IBC + graphIBCrcv_ + graphIBCrcv = pos_IBC + graphIBCrcv_ if graphID_U is not None: - #on recupere les infos Steady + #on recupere les infos Steady graphIDrcv_=[];graphrcv_S=[]; pos_ID=[]; S_ID=TimeLevelNumber + 1 - S_ID = _procSource(rank, S_ID, pos_ID, graphID_S, graphrcv_S, graphIDrcv_) - #on ajoute les infos UNsteady - for nstep in range(numero_min,numero_max+1): + S_ID = _procSource(rank, S_ID, pos_ID, graphID_S, graphrcv_S, graphIDrcv_) + #on ajoute les infos UNsteady + for nstep in range(numero_min,numero_max+1): graphloc=[] - S_ID = _procSource(rank, S_ID, pos_ID, graphID_U[nstep], graphloc, graphIDrcv_, filterGraph= graphrcv_S) + S_ID = _procSource(rank, S_ID, pos_ID, graphID_U[nstep], graphloc, graphIDrcv_, filterGraph=graphrcv_S) graphIDrcv = pos_ID + graphIDrcv_ else: - #on recupere les infos ID Steady + #on recupere les infos ID Steady graphIDrcv_=[];graphloc=[]; pos_ID=[]; S_ID=1 if graphID is not None: - S_ID = _procSource(rank, S_ID, pos_ID, graphID, graphloc, graphIDrcv_) + S_ID = _procSource(rank, S_ID, pos_ID, graphID, graphloc, graphIDrcv_) graphIDrcv = pos_ID + graphIDrcv_ @@ -340,11 +340,11 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= graphIBCD_= graph[nstep]['graphIBCD'] stokproc =[] - S_IBC = _procSource(rank, S_IBC, pos_IBC, graphIBCD_, stokproc, graphIBCrcv_) + S_IBC = _procSource(rank, S_IBC, pos_IBC, graphIBCD_, stokproc, graphIBCrcv_) graphID_ = graph[nstep]['graphID'] stokproc =[] - S_ID = _procSource(rank, S_ID, pos_ID, graphID_, stokproc, graphIDrcv_) + S_ID = _procSource(rank, S_ID, pos_ID, graphID_, stokproc, graphIDrcv_) graphIBCrcv = pos_IBC + graphIBCrcv_ graphIDrcv = pos_ID + graphIDrcv_ @@ -368,7 +368,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= _graphID = numpy.asarray([len(graphIDrcv)] +graphIDrcv, dtype=Internal.E_NpyInt) param_int[2 :3+len(graphIBCrcv) ] = _graphIBC - param_int[3+len(graphIBCrcv):4+len(graphIBCrcv)+len(graphIDrcv)] = _graphID + param_int[3+len(graphIBCrcv):4+len(graphIBCrcv)+len(graphIDrcv)] = _graphID # print("param_int is ",param_int[0:2+len(graphIBCrcv)+len(graphIDrcv)+1]) # Dictionnaire pour optimisation @@ -387,7 +387,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= size_coef = [] adr_coef = [] # pour cibler debut de echange dans param_real - shift_graph = len(graphIDrcv) + len(graphIBCrcv) + 4 + shift_graph = len(graphIDrcv) + len(graphIBCrcv) + 4 # print("shift_graph is ",shift_graph) shift_coef =0 shift = shift_graph # le shift prend en compte la postion des graphs (ID+IBC) entre la address contenant NbP2P et @@ -511,9 +511,9 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= temp_extra2_local=None;pttemp_extra2_local=0; wmodel_local_dens=None;wmodel_local_velx=None;wmodel_local_vely=None; - wmodel_local_velz=None;wmodel_local_temp=None;wmodel_local_sanu=None; + wmodel_local_velz=None;wmodel_local_temp=None;wmodel_local_sanu=None; pt_dens_wm_local=0;pt_velx_wm_local=0;pt_vely_wm_local=0; - pt_velz_wm_local=0;pt_temp_wm_local=0;pt_sanu_wm_local=0; + pt_velz_wm_local=0;pt_temp_wm_local=0;pt_sanu_wm_local=0; gradxP=None;gradyP=None;gradzP=None; ptgradxP=0;ptgradyP=0;ptgradzP=0; @@ -557,7 +557,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= qloc_3=[None]*(neq_loc) ptqloc_3=[0]*(neq_loc) - if sname == 'IB': + if sname == 'IB': zsrname = zsrname.split('_') if len(zsrname) < 3: #print('Warning: miseAPlatDonorTree: non consistent with the version of IBM preprocessing.') @@ -567,7 +567,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= elif model=='LBMLaminar': print('Assuming IBC type is no-slip.') param_int[iadr+rac[pos]*3] = 1 - else: + else: print('Assuming IBC type is Musker wall model.') param_int[iadr+rac[pos]*3] = 3 else: @@ -656,7 +656,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= pt_velz_wm_local = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+3) pt_temp_wm_local = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+4) pt_sanu_wm_local = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+5) - size_IBC += 6*Nbpts_D; inc += 6 + size_IBC += 6*Nbpts_D; inc += 6 gradxP = Internal.getNodeFromName1(s, 'gradxPressure') @@ -734,13 +734,13 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= ptmotion_type = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+0) pttransl_speedX = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+1) pttransl_speedY = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+2) - pttransl_speedZ = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+3) + pttransl_speedZ = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+3) ptaxis_pntX = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+4) ptaxis_pntY = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+5) - ptaxis_pntZ = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+6) + ptaxis_pntZ = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+6) ptaxis_vctX = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+7) ptaxis_vctY = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+8) - ptaxis_vctZ = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+9) + ptaxis_vctZ = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+9) ptomega = pt_coef + Nbpts_InterpD + Nbpts_D*(inc+10) size_IBC += 11*Nbpts_D; inc += 11 @@ -851,7 +851,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= ptutau,ptyplus, pttemp_local, pttemp_extra_local,pttemp_extra2_local, pt_dens_wm_local,pt_velx_wm_local,pt_vely_wm_local, - pt_velz_wm_local,pt_temp_wm_local,pt_sanu_wm_local, + pt_velz_wm_local,pt_temp_wm_local,pt_sanu_wm_local, ptgradxP, ptgradyP, ptgradzP, ptgradxU, ptgradyU, ptgradzU, ptgradxV, ptgradyV, ptgradzV, @@ -895,7 +895,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= ptutau,ptyplus, pttemp_local, pttemp_extra_local,pttemp_extra2_local, pt_dens_wm_local,pt_velx_wm_local,pt_vely_wm_local, - pt_velz_wm_local,pt_temp_wm_local,pt_sanu_wm_local, + pt_velz_wm_local,pt_temp_wm_local,pt_sanu_wm_local, ptgradxP, ptgradyP, ptgradzP, ptgradxU, ptgradyU, ptgradzU, ptgradxV, ptgradyV, ptgradzV, @@ -1055,7 +1055,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= qloc_2[f_i][1] = param_real[ ptqloc_2[f_i] : ptqloc_2[f_i] + Nbpts_D ] if qloc_3[0] is not None: for f_i in range(0,neq_loc): - qloc_3[f_i][1] = param_real[ ptqloc_3[f_i] : ptqloc_3[f_i] + Nbpts_D ] + qloc_3[f_i][1] = param_real[ ptqloc_3[f_i] : ptqloc_3[f_i] + Nbpts_D ] param_int[ iadr +rac[pos]*8 ] = adr_coef[pos] + size_coef[pos] # PtcoefAdr @@ -1083,7 +1083,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= else: param_int[ iadr +rac[pos]*13 ] = neq_loc tmp = Internal.getNodeFromName1(s , 'NSLBM') - if tmp is not None: + if tmp is not None: if neq_loc==5: param_int[ iadr +rac[pos]*13 ] = 11 # NS vers LBM else: param_int[ iadr +rac[pos]*13 ] = -5 # LBM vers NS @@ -1133,7 +1133,7 @@ def miseAPlatDonorTree__(zones, tc, graph=None, list_graph=None, nbpts_linelets= #print int([1] #print('model=', model, 'tmp=', tmp, 'neq_loc=', neq_loc) - ### Verifier position et choix entre Nbpts et NbptsD + ### Verifier position et choix entre Nbpts et NbptsD size_ptlistD[pos] = size_ptlistD[pos] + Nbpts_D size_ptlist[pos] = size_ptlist[pos] + Nbpts size_ptType[pos] = size_ptType[pos] + Nbpts_D + len(Nbtype)+1 @@ -1156,7 +1156,7 @@ def triMultiType(Nbpts_D, Nbpts, Nbpts_InterpD, meshtype, noi, lst,lstD,l0,ctyp, ptutau,ptyplus, pttemp_local, pttemp_extra_local, pttemp_extra2_local, pt_dens_wm_local,pt_velx_wm_local,pt_vely_wm_local, - pt_velz_wm_local,pt_temp_wm_local,pt_sanu_wm_local, + pt_velz_wm_local,pt_temp_wm_local,pt_sanu_wm_local, ptgradxP, ptgradyP, ptgradzP, ptgradxU, ptgradyU, ptgradzU, ptgradxV, ptgradyV, ptgradzV, @@ -1209,7 +1209,7 @@ def triMultiType(Nbpts_D, Nbpts, Nbpts_InterpD, meshtype, noi, lst,lstD,l0,ctyp, elif ltype == 4: sizecoef=4 if ltype == ntype: - # recopie interpolantType + # recopie interpolantType param_int[ ptTy + shift_typ + l + l0 ] = ltype # recopie pointlist @@ -1251,9 +1251,9 @@ def triMultiType(Nbpts_D, Nbpts, Nbpts_InterpD, meshtype, noi, lst,lstD,l0,ctyp, if temp_local is not None: param_real[ pttemp_local + l + l0 ]= temp_local[1][i] - if temp_extra_local is not None: + if temp_extra_local is not None: param_real[ pttemp_extra_local + l + l0 ]= temp_extra_local[1][i] - if temp_extra2_local is not None: + if temp_extra2_local is not None: param_real[ pttemp_extra2_local + l + l0 ]= temp_extra2_local[1][i] if wmodel_local_dens is not None: @@ -1336,7 +1336,7 @@ def triMultiType(Nbpts_D, Nbpts, Nbpts_InterpD, meshtype, noi, lst,lstD,l0,ctyp, param_real[ ptalphasbetaline + l + l0 ]= alphasbetaline[1][i] param_real[ ptindexline + l + l0 ]= indexline[1][i] - if model == 'LBMLaminar': + if model == 'LBMLaminar': if qloc_1[0] is not None: for f_i in range (0, neq_loc): param_real[ ptqloc_1[f_i] + l + l0 ]= qloc_1[f_i][1][i] @@ -1345,7 +1345,7 @@ def triMultiType(Nbpts_D, Nbpts, Nbpts_InterpD, meshtype, noi, lst,lstD,l0,ctyp, param_real[ ptqloc_2[f_i] + l + l0 ]= qloc_2[f_i][1][i] if qloc_3[0] is not None: for f_i in range (0, neq_loc): - param_real[ ptqloc_3[f_i] + l + l0 ]= qloc_3[f_i][1][i] + param_real[ ptqloc_3[f_i] + l + l0 ]= qloc_3[f_i][1][i] #recopie InterpD param_real[ pt_coef + nocoef: pt_coef + nocoef+sizecoef] = InterpD[1][ nocoef_old: nocoef_old+sizecoef] nocoef = nocoef + sizecoef @@ -1457,9 +1457,9 @@ def triMonoType(Nbpts_D, Nbpts, Nbpts_InterpD, meshtype, noi, lst,lstD,l0,ctyp,p if temp_local is not None: connector.initNuma(temp_local[1] , param_real, pttemp_local , Nbpts_D , 0, val) - if temp_extra_local is not None: + if temp_extra_local is not None: connector.initNuma(temp_extra_local[1], param_real, pttemp_extra_local , Nbpts_D , 0, val) - if temp_extra2_local is not None: + if temp_extra2_local is not None: connector.initNuma(temp_extra2_local[1], param_real, pttemp_extra2_local , Nbpts_D , 0, val) if wmodel_local_dens is not None: @@ -1555,7 +1555,7 @@ def triMonoType(Nbpts_D, Nbpts, Nbpts_InterpD, meshtype, noi, lst,lstD,l0,ctyp,p connector.initNuma(qloc_2[f_i][1] , param_real, ptqloc_2[f_i] , Nbpts_D , 0, val) if qloc_3[0] is not None: for f_i in range (0,neq_loc): - connector.initNuma(qloc_3[f_i][1] , param_real, ptqloc_3[f_i] , Nbpts_D , 0, val) + connector.initNuma(qloc_3[f_i][1] , param_real, ptqloc_3[f_i] , Nbpts_D , 0, val) # recopie InterpD connector.initNuma(InterpD[1] , param_real, pt_coef , Nbpts_InterpD , 0, val) @@ -1682,7 +1682,7 @@ def miseAPlatDonorZone__(zones, tc, procDict): zrcvname = Internal.getValue(rac) no_zone = 0 for z0 in zones: - if z0[0] == zrcvname: param_int[ pt_rac +6 ]= no_zone # No zone raccord + if z0[0] == zrcvname: param_int[ pt_rac +6 ]= no_zone # No zone raccord no_zone += 1 ideb = pt_rac +7 @@ -1740,7 +1740,7 @@ def miseAPlatDonorZone__(zones, tc, procDict): var_ibc.append('CoordinateX_PW#Init') var_ibc.append('CoordinateY_PW#Init') - var_ibc.append('CoordinateZ_PW#Init') + var_ibc.append('CoordinateZ_PW#Init') if motion_type is not None: var_ibc.append('MotionType') @@ -1756,7 +1756,7 @@ def miseAPlatDonorZone__(zones, tc, procDict): var_ibc.append('axis_vctY') var_ibc.append('axis_vctZ') - var_ibc.append('omega') + var_ibc.append('omega') if kcurv is not None: var_ibc.append('KCurv') if yline is not None: @@ -1800,7 +1800,7 @@ def miseAPlatDonorZone__(zones, tc, procDict): var_ibc.append('axis_vctY') var_ibc.append('axis_vctZ') - var_ibc.append('omega') + var_ibc.append('omega') count_ibc = 0 ideb = pt_coef + Nbpts_InterpD @@ -1862,7 +1862,7 @@ def ___setInterpTransfers(aR, topTreeD, # calcul les processus source pour rank ( graphrcv_) et la position dans param_int (pos_list) # filterGraph:: pour les cas unsteady, permet de ne pas ajouter les sources fournies par raccord steady # -def _procSource(rank, S_pos, pos_list, graph, graphloc, graphrcv_, filterGraph=None): +def _procSource(rank, S_pos, pos_list, graph, graphloc, graphrcv_, filterGraph=None): pos_list.append(S_pos) k_pos= 0 @@ -1882,4 +1882,3 @@ def _procSource(rank, S_pos, pos_list, graph, graphloc, graphrcv_, filterGraph=N #print("Spos=", S_pos,graphrcv_, filterGraph ) return S_pos - diff --git a/Cassiopee/Connector/Connector/elsAChimPreProcess.py b/Cassiopee/Connector/Connector/elsAChimPreProcess.py index 8233676bb..a4a52e3f7 100644 --- a/Cassiopee/Connector/Connector/elsAChimPreProcess.py +++ b/Cassiopee/Connector/Connector/elsAChimPreProcess.py @@ -78,7 +78,7 @@ def computeUnsteadyInterp(tp, hook, ite,loc='cell', nGhostCells=2): rcvId = hook[9][rcvName] # cells if Internal.getNodeFromName1(interp, ListExtC) is not None: - donorIndices = Internal.getNodeFromName1(interp, ListExtC)[1]; + donorIndices = Internal.getNodeFromName1(interp, ListExtC)[1]; donorIndices = donorIndices.reshape((donorIndices.shape[0])) if donorIndices.shape[0] != 0: # avoid interpolation regions with only orphan points coefs = Internal.getNodeFromName1(interp, InterpolantsDonor)[1][:,0:7] @@ -89,7 +89,7 @@ def computeUnsteadyInterp(tp, hook, ite,loc='cell', nGhostCells=2): faceDir = Internal.getNodeFromName1(interp, FaceDirection)[1]; faceDir= faceDir.reshape((faceDir.shape[0])) # cell index => faceIndex if FaceDirection is not None: - zRcv = Internal.getNodeFromName2(tp,rcvName) + zRcv = Internal.getNodeFromName2(tp,rcvName) dimrcv = Internal.getZoneDim(zRcv) imr = dimrcv[1];jmr = dimrcv[2];kmr = dimrcv[3] imrg = imr-1 + 2*nGhostCells @@ -114,7 +114,7 @@ def computeUnsteadyInterp(tp, hook, ite,loc='cell', nGhostCells=2): elif faceDir[i] == 5: # kmin rcvIndices[i] = (rk-1 + nGhostCells)*imrg*jmrg+(rj-1 + nGhostCells)*imrg+ ri-1 + nGhostCells + 2*nbintByDir # First iteration of storage: full storage - if ite == 0 or listInterpData[donorName] == [] or rcvId not in listInterpData[donorName][-1].keys(): + if ite == 0 or listInterpData[donorName] == [] or rcvId not in listInterpData[donorName][-1].keys(): interpData[rcvId]={} flag=0; i=0 if FaceDirection is None: # cell @@ -122,9 +122,9 @@ def computeUnsteadyInterp(tp, hook, ite,loc='cell', nGhostCells=2): interpData[rcvId][(int)(rcvIndex)]=[flag,(int)(donorIndices[i]),(int)(periodicity[i])]+[(float)(c) for c in coefs[i]]; i = i+1 else: # face for rcvIndex in rcvIndices: - interpData[rcvId][(int)(rcvIndex)]=[flag,(int)(donorIndices[i]),(int)(periodicity[i])]+[(float)(c) for c in coefs[i]]+[(int)(faceDir[i])]; i = i+1 + interpData[rcvId][(int)(rcvIndex)]=[flag,(int)(donorIndices[i]),(int)(periodicity[i])]+[(float)(c) for c in coefs[i]]+[(int)(faceDir[i])]; i = i+1 # delta storage - else: + else: if FaceDirection is None: data=[rcvIndices,donorIndices,periodicity,coefs] else: data=[rcvIndices,donorIndices,periodicity,coefs,faceDir] delta = Co.deltaInterpolations(data, ref[donorName][rcvId],loc) @@ -136,9 +136,9 @@ def computeUnsteadyInterp(tp, hook, ite,loc='cell', nGhostCells=2): for rcvId in ref[donorName]: if rcvId not in interpData: if FaceDirection is None: - data=[numpy.array([], dtype= Internal.E_NpyInt), numpy.array([], dtype= Internal.E_NpyInt), numpy.array([], dtype= Internal.E_NpyInt), numpy.array([], dtype= numpy.float64)] + data=[numpy.array([], dtype=Internal.E_NpyInt), numpy.array([], dtype=Internal.E_NpyInt), numpy.array([], dtype=Internal.E_NpyInt), numpy.array([], dtype=numpy.float64)] else: - data=[numpy.array([], dtype= Internal.E_NpyInt), numpy.array([], dtype= Internal.E_NpyInt), numpy.array([], dtype= Internal.E_NpyInt), numpy.array([], dtype= numpy.float64), numpy.array([], dtype= Internal.E_NpyInt)] + data=[numpy.array([], dtype=Internal.E_NpyInt), numpy.array([], dtype=Internal.E_NpyInt), numpy.array([], dtype=Internal.E_NpyInt), numpy.array([], dtype=numpy.float64), numpy.array([], dtype=Internal.E_NpyInt)] delta = Co.deltaInterpolations(data, ref[donorName][rcvId],loc) interpData[rcvId]=delta ref[donorName][rcvId] = data @@ -147,9 +147,9 @@ def computeUnsteadyInterp(tp, hook, ite,loc='cell', nGhostCells=2): elif donorName in listInterpData: for rcvId in ref[donorName]: if FaceDirection is None: - data=[numpy.array([], dtype= Internal.E_NpyInt), numpy.array([], dtype= Internal.E_NpyInt), numpy.array([], dtype= Internal.E_NpyInt), numpy.array([], dtype= numpy.float64)] + data=[numpy.array([], dtype=Internal.E_NpyInt), numpy.array([], dtype=Internal.E_NpyInt), numpy.array([], dtype=Internal.E_NpyInt), numpy.array([], dtype=numpy.float64)] else: - data=[numpy.array([], dtype= Internal.E_NpyInt), numpy.array([], dtype= Internal.E_NpyInt), numpy.array([], dtype= Internal.E_NpyInt), numpy.array([], dtype= numpy.float64), numpy.array([], dtype= Internal.E_NpyInt)] + data=[numpy.array([], dtype=Internal.E_NpyInt), numpy.array([], dtype=Internal.E_NpyInt), numpy.array([], dtype=Internal.E_NpyInt), numpy.array([], dtype=numpy.float64), numpy.array([], dtype=Internal.E_NpyInt)] delta = Co.deltaInterpolations(data, ref[donorName][rcvId],loc) interpData[rcvId]=delta ref[donorName][rcvId] = data diff --git a/Cassiopee/Connector/doc/source/conf.py b/Cassiopee/Connector/doc/source/conf.py index e11493671..44a69a107 100644 --- a/Cassiopee/Connector/doc/source/conf.py +++ b/Cassiopee/Connector/doc/source/conf.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Connector documentation build configuration file -# +# import sys import os @@ -192,15 +192,15 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', -'preamble': r''' + # Additional stuff for the LaTeX preamble. + #'preamble': '', + 'preamble': r''' \usepackage{charter} \usepackage[defaultsans]{lato} \usepackage{inconsolata} @@ -211,10 +211,10 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('Connector', 'Connector.tex', u'Connector Documentation', - u'/ELSA/MU-090XX/V'+__version__, 'manual'), - ('Connector_IBM', 'Connector_IBM.tex', u'Connector IBM Documentation', - u'/ELSA/MU-090XX/V'+__version__, 'manual') + ('Connector', 'Connector.tex', u'Connector Documentation', + u'/ELSA/MU-090XX/V'+__version__, 'manual'), + ('Connector_IBM', 'Connector_IBM.tex', u'Connector IBM Documentation', + u'/ELSA/MU-090XX/V'+__version__, 'manual') ] # The name of an image file (relative to this directory) to place at the top of @@ -257,9 +257,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Connector', u'Connector Documentation', - u'ONERA', 'Connector', 'One line description of project.', - 'Miscellaneous'), + ('index', 'Connector', u'Connector Documentation', + u'ONERA', 'Connector', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/Connector/installLib.py b/Cassiopee/Connector/installLib.py index 8d098aada..59da6b66a 100644 --- a/Cassiopee/Connector/installLib.py +++ b/Cassiopee/Connector/installLib.py @@ -26,6 +26,6 @@ a = os.access(installPathLocal+"/connector"+__EXTMODULE__, os.F_OK) if a: shutil.copyfile(installPathLocal+"/connector"+__EXTMODULE__, - libPath+"/libconnector"+__EXTSHARED__) + libPath+"/libconnector"+__EXTSHARED__) else: print("Error: connector"+__EXTMODULE__+" can not be found.") diff --git a/Cassiopee/Connector/srcs.py b/Cassiopee/Connector/srcs.py index 7921a9426..5114cf3b5 100644 --- a/Cassiopee/Connector/srcs.py +++ b/Cassiopee/Connector/srcs.py @@ -5,7 +5,7 @@ 'Connector/KInterp/KMesh.cpp', 'Connector/KInterp/BlkIntTreeNode.cpp', 'Connector/KInterp/BlkInterpData.cpp', - 'Connector/KInterp/BlkInterpDataStruct.cpp', + 'Connector/KInterp/BlkInterpDataStruct.cpp', 'Connector/KInterp/BlkInterpWithKMesh.cpp', 'Connector/KInterp/BlkInterpAdt.cpp', 'Connector/KInterp/BlkInterpAdt_getCell.cpp', diff --git a/Cassiopee/Connector/test/IBMinterpolateExtrude2Dto3D_t1.py b/Cassiopee/Connector/test/IBMinterpolateExtrude2Dto3D_t1.py index 0f31add23..8f3bc7f56 100644 --- a/Cassiopee/Connector/test/IBMinterpolateExtrude2Dto3D_t1.py +++ b/Cassiopee/Connector/test/IBMinterpolateExtrude2Dto3D_t1.py @@ -19,7 +19,7 @@ dfars = 5 snears = 1 t, tc = X_IBM.prepareIBMData(bodySurfaceFile, None , None , - snears=snears , dfars=dfars , vmin=vmin, + snears=snears , dfars=dfars , vmin=vmin, check=False , frontType=1 , cartesian=False) #C.convertPyTree2File(t,LOCAL+'/t2D_checking.cgns') @@ -47,7 +47,7 @@ T._translate(t, (0,0,0-zavg)) #C.convertPyTree2File(t3D ,LOCAL+'/t3D_checking.cgns') -#C.convertPyTree2File(tb3D,LOCAL+'/tb3D_checking.cgns') +#C.convertPyTree2File(tb3D,LOCAL+'/tb3D_checking.cgns') # Interpolation 3D t3D, tc3D = X_IBM.prepareIBMDataExtrude(tb3D, None, None, t3D, extrusion=extrusion) diff --git a/Cassiopee/Connector/test/IBMrectilinear_t1.py b/Cassiopee/Connector/test/IBMrectilinear_t1.py index 19a3fda80..a61328999 100644 --- a/Cassiopee/Connector/test/IBMrectilinear_t1.py +++ b/Cassiopee/Connector/test/IBMrectilinear_t1.py @@ -35,7 +35,7 @@ a = D.circle((0.,0.,0.), diam*0.5, N=densityOfPts) C._initVars(a, '{CoordinateZ}=0') -tb = C.newPyTree(["CYLINDER"]); tb[2][1][2] = Internal.getZones(a) +tb = C.newPyTree(["CYLINDER"]); tb[2][1][2] = Internal.getZones(a) snear = 1.0e-2 ModelTmp = Model D_IBM._setSnear(tb, snear) @@ -48,7 +48,7 @@ hlocal= Lx/10 tbOneOver = G.cart((-dfar*1.5,-dfar*1.5,0.), (hlocal,hlocal,0.1), (10,10,1)) tbOneOver2 = P.exteriorFaces(tbOneOver) -tbOneOver = C.newPyTree(["Base_OneOver"]); tbOneOver[2][1][2] = Internal.getZones(tbOneOver2) +tbOneOver = C.newPyTree(["Base_OneOver"]); tbOneOver[2][1][2] = Internal.getZones(tbOneOver2) C.convertPyTree2File(tbOneOver, LOCAL+'/tbOneOver.cgns') ##ADD DIRECTION OF ONE OVER IN TB RECTILINEAR REGION @@ -73,7 +73,3 @@ #C.convertPyTree2File(t ,LOCAL+'/t_check.cgns') #C.convertPyTree2File(tc,LOCAL+'/tc_check.cgns') - - - - diff --git a/Cassiopee/Connector/test/applyBCOverlapsPT_t1.py b/Cassiopee/Connector/test/applyBCOverlapsPT_t1.py index 770e64abd..90a50dbe2 100644 --- a/Cassiopee/Connector/test/applyBCOverlapsPT_t1.py +++ b/Cassiopee/Connector/test/applyBCOverlapsPT_t1.py @@ -23,7 +23,7 @@ # --- Apply on a zone -a2 = X.applyBCOverlaps(a, depth = 1,loc='centers') +a2 = X.applyBCOverlaps(a, depth=1,loc='centers') t2 = C.newPyTree(['Base',a2]) test.testT(t2, 2) @@ -41,6 +41,6 @@ test.testT(t2,4) # Apply at nodes -a2 = X.applyBCOverlaps(a, depth=2, loc ='nodes') +a2 = X.applyBCOverlaps(a, depth=2, loc='nodes') t2 = C.newPyTree(['Base',a2]) test.testT(t2,5) diff --git a/Cassiopee/Connector/test/blankCellsPT_t1.py b/Cassiopee/Connector/test/blankCellsPT_t1.py index df5603609..50acdf1c2 100644 --- a/Cassiopee/Connector/test/blankCellsPT_t1.py +++ b/Cassiopee/Connector/test/blankCellsPT_t1.py @@ -20,16 +20,15 @@ # Matrice de masquage (arbre d'assemblage) BM = numpy.array([[1]]) -t2 = X.blankCells(t, bodies, BM) +t2 = X.blankCells(t, bodies, BM) test.testT(t2, 1) # in place C._initVars(t2, 'centers:cellN', 1.) -X._blankCells(t2, bodies, BM) +X._blankCells(t2, bodies, BM) test.testT(t2,1) # masque inverse BM = numpy.array([[-1]]) -t2 = X.blankCells(t, bodies, BM) +t2 = X.blankCells(t, bodies, BM) test.testT(t2,2) - diff --git a/Cassiopee/Connector/test/blankCellsTetra_t1.py b/Cassiopee/Connector/test/blankCellsTetra_t1.py index f2c5351ec..e66a2d8f3 100644 --- a/Cassiopee/Connector/test/blankCellsTetra_t1.py +++ b/Cassiopee/Connector/test/blankCellsTetra_t1.py @@ -18,6 +18,3 @@ celln = C.addVars([[a], celln]) #C.convertArrays2File(celln, 'out0.plt') test.testA(celln,1) - - - diff --git a/Cassiopee/Connector/test/blankCellsTriPT_t2.py b/Cassiopee/Connector/test/blankCellsTriPT_t2.py index 55704388b..92649edfb 100644 --- a/Cassiopee/Connector/test/blankCellsTriPT_t2.py +++ b/Cassiopee/Connector/test/blankCellsTriPT_t2.py @@ -112,4 +112,3 @@ #tfin = time.time() #print "duree : ", tfin-tdebut, "s" - diff --git a/Cassiopee/Connector/test/blankCellsTriPT_t3.py b/Cassiopee/Connector/test/blankCellsTriPT_t3.py index 40c4cfb9b..47d3289a1 100644 --- a/Cassiopee/Connector/test/blankCellsTriPT_t3.py +++ b/Cassiopee/Connector/test/blankCellsTriPT_t3.py @@ -38,4 +38,3 @@ t = X.blankCellsTri(t, [[s1]], [], blankingType="cell_intersect", tol=1.e-12) #C.convertPyTree2File(t, 'out2.cgns') test.testT(t,2) - diff --git a/Cassiopee/Connector/test/blankCellsTri_t1.py b/Cassiopee/Connector/test/blankCellsTri_t1.py index fc8a03751..8e7309eb0 100644 --- a/Cassiopee/Connector/test/blankCellsTri_t1.py +++ b/Cassiopee/Connector/test/blankCellsTri_t1.py @@ -22,6 +22,3 @@ celln = C.addVars([[a], celln]) #C.convertArrays2File(celln, 'out0.plt') test.testA(celln,1) - - - diff --git a/Cassiopee/Connector/test/blankCellsTri_t2.py b/Cassiopee/Connector/test/blankCellsTri_t2.py index e7421883f..a66c4346d 100644 --- a/Cassiopee/Connector/test/blankCellsTri_t2.py +++ b/Cassiopee/Connector/test/blankCellsTri_t2.py @@ -21,4 +21,3 @@ celln = C.addVars([[a], celln]) #C.convertArrays2File(celln, 'out0.plt') test.testA(celln,1) - diff --git a/Cassiopee/Connector/test/blankCells_t1.py b/Cassiopee/Connector/test/blankCells_t1.py index 7005311e2..bfde82a93 100644 --- a/Cassiopee/Connector/test/blankCells_t1.py +++ b/Cassiopee/Connector/test/blankCells_t1.py @@ -25,11 +25,11 @@ elif masknot == 1 and delta > 0: c+= 1 else: celln = X.blankCells([a], [ca], [surf], type, - delta, dim, masknot) + delta, dim, masknot) test.testA(celln, c) ca2 = C.initVars(ca, 'cellN', 1.) X._blankCells([a], [ca2], [surf], type, - delta, dim, masknot) + delta, dim, masknot) test.testA([ca2], c) c += 1 diff --git a/Cassiopee/Connector/test/blankIntersectingCells.py b/Cassiopee/Connector/test/blankIntersectingCells.py index 9d1881689..966c26b9c 100644 --- a/Cassiopee/Connector/test/blankIntersectingCells.py +++ b/Cassiopee/Connector/test/blankIntersectingCells.py @@ -1,4 +1,4 @@ -# - blankIntersectingCells (array) +# - blankIntersectingCells (array) import Converter as C import Generator as G import Transform as T diff --git a/Cassiopee/Connector/test/blankIntersectingCellsPT.py b/Cassiopee/Connector/test/blankIntersectingCellsPT.py index 8bdde3bcd..b508498c7 100644 --- a/Cassiopee/Connector/test/blankIntersectingCellsPT.py +++ b/Cassiopee/Connector/test/blankIntersectingCellsPT.py @@ -1,4 +1,4 @@ -# - blankIntersectingCells (pyTree) +# - blankIntersectingCells (pyTree) import Converter.PyTree as C import Generator.PyTree as G import Transform.PyTree as T diff --git a/Cassiopee/Connector/test/blankIntersectingCells_t1.py b/Cassiopee/Connector/test/blankIntersectingCells_t1.py index cf8879d5b..fdfd467c4 100644 --- a/Cassiopee/Connector/test/blankIntersectingCells_t1.py +++ b/Cassiopee/Connector/test/blankIntersectingCells_t1.py @@ -1,4 +1,4 @@ -# - blankIntersectingCells (array) +# - blankIntersectingCells (array) import Converter as C import Generator as G import Transform as T diff --git a/Cassiopee/Connector/test/blankIntersectingCells_t2.py b/Cassiopee/Connector/test/blankIntersectingCells_t2.py index c301adcff..717f34290 100644 --- a/Cassiopee/Connector/test/blankIntersectingCells_t2.py +++ b/Cassiopee/Connector/test/blankIntersectingCells_t2.py @@ -1,4 +1,4 @@ -# - blankIntersectingCells (array) +# - blankIntersectingCells (array) import Converter as C import Generator as G import Geom as D @@ -38,7 +38,7 @@ ac = C.node2Center(a); ac = C.initVars(ac,'cellN',1) Ac.append(ac); A.append(a) res = X.blankIntersectingCells(A, Ac, tol=1.e-8) -test.testA(res,3) +test.testA(res,3) #------------------------------------------ # extrusion vers l interieur : intersection diff --git a/Cassiopee/Connector/test/buildFrontIBMPT_t1.py b/Cassiopee/Connector/test/buildFrontIBMPT_t1.py index d589d2632..4d1af5bc0 100755 --- a/Cassiopee/Connector/test/buildFrontIBMPT_t1.py +++ b/Cassiopee/Connector/test/buildFrontIBMPT_t1.py @@ -6,7 +6,7 @@ import Converter.Internal as Internal import KCore.test as test -# --- Front Type = 1 +# --- Front Type = 1 N = 50; h = 1./(N-1) c = G.cylinder((0.,0.,0.), 0.2, 1., 360., 0., 10., (2*N,1,1)); c[0] = 'cyl' DIBM._setIBCType(c, 'Musker') diff --git a/Cassiopee/Connector/test/buildFrontIBMPT_t2.py b/Cassiopee/Connector/test/buildFrontIBMPT_t2.py index aa8832584..b43239462 100755 --- a/Cassiopee/Connector/test/buildFrontIBMPT_t2.py +++ b/Cassiopee/Connector/test/buildFrontIBMPT_t2.py @@ -7,7 +7,7 @@ import Geom.PyTree as D import KCore.test as test -# --- Front Type=1 +# --- Front Type=1 N = 30; h = 1./(N-1) s1 = D.sphere((0.,0.,0.),0.2,N//2); s1[0] = 'sphere' DIBM._setIBCType(s1, 'Musker') diff --git a/Cassiopee/Connector/test/chimeraInfoPT_t1.py b/Cassiopee/Connector/test/chimeraInfoPT_t1.py index b374faffb..6010d9d35 100644 --- a/Cassiopee/Connector/test/chimeraInfoPT_t1.py +++ b/Cassiopee/Connector/test/chimeraInfoPT_t1.py @@ -23,7 +23,7 @@ t1 = X.chimeraInfo(t1,type='cellRatio') t2 = X.chimeraInfo(t1,type='donorAspect') test.testT(t2,1) -# in place +# in place X._chimeraInfo(t1,type='donorAspect') test.testT(t1,1) diff --git a/Cassiopee/Connector/test/chimeraTransferPT.py b/Cassiopee/Connector/test/chimeraTransferPT.py index 6a07f67e7..4e84b8d34 100644 --- a/Cassiopee/Connector/test/chimeraTransferPT.py +++ b/Cassiopee/Connector/test/chimeraTransferPT.py @@ -15,7 +15,7 @@ t = X.connectMatch(t, dim=2) C._fillEmptyBCWith(t,'nref','BCFarfield', dim=3) X._applyBCOverlaps(t, depth=2) -t = X.setInterpolations(t, storage = 'direct') +t = X.setInterpolations(t, storage='direct') for i in range(len(t[2])): C._initVars(t[2][i], 'centers:Density', float(i+1)) C._initVars(t[2][i], 'centers:MomentumX', float(i+1)) diff --git a/Cassiopee/Connector/test/computeFrictionVelocityPT.py b/Cassiopee/Connector/test/computeFrictionVelocityPT.py index 019ce6302..b7b52b643 100644 --- a/Cassiopee/Connector/test/computeFrictionVelocityPT.py +++ b/Cassiopee/Connector/test/computeFrictionVelocityPT.py @@ -9,7 +9,7 @@ zsize = numpy.empty((1,3), numpy.int32, order='F') zsize[0,0] = nb_node; zsize[0,1] = 0; zsize[0,2] = 0 z = Internal.newZone(name='IBW_Wall',zsize=zsize,ztype='Unstructured') -coord_node = Internal.newGridCoordinates(parent = z) +coord_node = Internal.newGridCoordinates(parent=z) # Image Points : PI coord_node[2].append(['CoordinateX',numpy.array([0.1,0.2,0.3]),[],'DataArray_t']) coord_node[2].append(['CoordinateY',numpy.array([0.1,0.2,0.3]),[],'DataArray_t']) diff --git a/Cassiopee/Connector/test/computeFrictionVelocityPT_t1.py b/Cassiopee/Connector/test/computeFrictionVelocityPT_t1.py index 1f968c1d5..c308f490c 100644 --- a/Cassiopee/Connector/test/computeFrictionVelocityPT_t1.py +++ b/Cassiopee/Connector/test/computeFrictionVelocityPT_t1.py @@ -10,7 +10,7 @@ zsize = numpy.empty((1,3), Internal.E_NpyInt, order='F') zsize[0,0] = nb_node; zsize[0,1] = 0; zsize[0,2] = 0 z = Internal.newZone(name='IBW_Wall',zsize=zsize,ztype='Unstructured') -coord_node = Internal.newGridCoordinates(parent = z) +coord_node = Internal.newGridCoordinates(parent=z) # Image Points : PI coord_node[2].append(['CoordinateX',numpy.array([0.1,0.2,0.3]),[],'DataArray_t']) coord_node[2].append(['CoordinateY',numpy.array([0.1,0.2,0.3]),[],'DataArray_t']) diff --git a/Cassiopee/Connector/test/connectMatch.py b/Cassiopee/Connector/test/connectMatch.py index ff075eaf2..f2019fcfb 100644 --- a/Cassiopee/Connector/test/connectMatch.py +++ b/Cassiopee/Connector/test/connectMatch.py @@ -4,7 +4,7 @@ import Geom as D import Transform as T import Converter as C -# 3D raccord i = 1 partiel profil NACA +# 3D raccord i = 1 partiel profil NACA msh = D.naca(12., 5001) msh2 = D.line((1.,0.,0.),(2.,0.,0.),5001); msh = T.join(msh, msh2) msh2 = D.line((2.,0.,0.),(1.,0.,0.),5001); msh = T.join(msh2, msh) diff --git a/Cassiopee/Connector/test/connectMatchPT_t3.py b/Cassiopee/Connector/test/connectMatchPT_t3.py index e9cd3277e..a164e8ca6 100644 --- a/Cassiopee/Connector/test/connectMatchPT_t3.py +++ b/Cassiopee/Connector/test/connectMatchPT_t3.py @@ -11,14 +11,14 @@ t = X.connectMatch(t) test.testT(t,1) -# 3D raccord i = 1 partiel profil NACA +# 3D raccord i = 1 partiel profil NACA a = D.naca(12., 5001) a2 = D.line((1.,0.,0.),(2.,0.,0.),5001); a = T.join(a, a2) a2 = D.line((2.,0.,0.),(1.,0.,0.),5001); a = T.join(a2, a) Ni = 300; Nj = 50 distrib = G.cart((0,0,0), (1./(Ni-1), 0.5/(Nj-1),1), (Ni,Nj,1)) naca = G.hyper2D(a, distrib, "C") -a = T.addkplane(naca) +a = T.addkplane(naca) # --- champ aux centres C._initVars(a, 'centers:Density', 1.) # --- champ aux noeuds diff --git a/Cassiopee/Connector/test/connectMatchPT_t5.py b/Cassiopee/Connector/test/connectMatchPT_t5.py index e64c4a165..b297dcf65 100644 --- a/Cassiopee/Connector/test/connectMatchPT_t5.py +++ b/Cassiopee/Connector/test/connectMatchPT_t5.py @@ -29,7 +29,7 @@ t[2][1][2] = X.connectMatch(t[2][1][2], tol=2.e-5) test.testT(t,2) -# CAS NGON +# CAS NGON a1 = G.cartNGon((0.,0.,0.), (0.1, 0.1, 0.1), (11, 21, 11)); a1[0] = 'cart1' a2 = G.cartNGon((1.,0.,0.), (0.1, 0.1, 0.1), (11, 21, 11)); a2[0] = 'cart2' t = C.newPyTree(['Base']); t[2][1][2] += [a1,a2] diff --git a/Cassiopee/Connector/test/connectMatchPeriodicPT.py b/Cassiopee/Connector/test/connectMatchPeriodicPT.py index af728db7c..aa64bfe70 100644 --- a/Cassiopee/Connector/test/connectMatchPeriodicPT.py +++ b/Cassiopee/Connector/test/connectMatchPeriodicPT.py @@ -3,7 +3,7 @@ import Connector.PyTree as X import Converter.PyTree as C -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) t = C.newPyTree(['Base',a]) t = X.connectMatchPeriodic(t, rotationCenter=[0.,0.,0.], translation=[0.,0.,5.]) diff --git a/Cassiopee/Connector/test/connectMatchPeriodicPT_m1.py b/Cassiopee/Connector/test/connectMatchPeriodicPT_m1.py index d13855701..df7faa3a6 100644 --- a/Cassiopee/Connector/test/connectMatchPeriodicPT_m1.py +++ b/Cassiopee/Connector/test/connectMatchPeriodicPT_m1.py @@ -1,7 +1,7 @@ # - connectMatchPeriodic 3D MPI (pyTree)- import Generator.PyTree as G import Converter.PyTree as C -import Transform.PyTree as T +import Transform.PyTree as T import Converter.Mpi as Cmpi import Connector.Mpi as Xmpi import Distributor2.PyTree as Distributor2 @@ -11,7 +11,7 @@ # Cree le fichier test if Cmpi.rank == 0: - a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) + a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) C._addBC2Zone(a,'wall','BCWall','jmin') C._addBC2Zone(a,'overlap','BCOverlap','jmax') diff --git a/Cassiopee/Connector/test/connectMatchPeriodicPT_m2.py b/Cassiopee/Connector/test/connectMatchPeriodicPT_m2.py index 581375922..39fa6394d 100644 --- a/Cassiopee/Connector/test/connectMatchPeriodicPT_m2.py +++ b/Cassiopee/Connector/test/connectMatchPeriodicPT_m2.py @@ -1,7 +1,7 @@ # - connectMatchPeriodic 3D MPI (pyTree)- import Generator.PyTree as G import Converter.PyTree as C -import Transform.PyTree as T +import Transform.PyTree as T import Converter.Mpi as Cmpi import Connector.Mpi as Xmpi import Distributor2.PyTree as Distributor2 @@ -12,7 +12,7 @@ # Cree le fichier test if Cmpi.rank == 0: - a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) + a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) C._addBC2Zone(a,'wall','BCWall','jmin') C._addBC2Zone(a,'overlap','BCOverlap','jmax') diff --git a/Cassiopee/Connector/test/connectMatchPeriodicPT_t1.py b/Cassiopee/Connector/test/connectMatchPeriodicPT_t1.py index 3386872e8..93fa7e8ed 100644 --- a/Cassiopee/Connector/test/connectMatchPeriodicPT_t1.py +++ b/Cassiopee/Connector/test/connectMatchPeriodicPT_t1.py @@ -6,7 +6,7 @@ import math # Un seul bloc -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) C._addBC2Zone(a,'wall','BCWall','jmin') C._addBC2Zone(a,'overlap','BCOverlap','jmax') @@ -15,7 +15,7 @@ t = X.connectMatchPeriodic(t,rotationCenter=[0.,0.,0.],rotationAngle=[0.,0.,90.]) test.testT(t,1) # 2 blocs coincidents -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 30., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 30., 5., (11,11,11)) C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) C._addBC2Zone(a,'wall','BCWall','jmin') C._addBC2Zone(a,'overlap','BCOverlap','jmax') @@ -24,7 +24,7 @@ t=X.connectMatchPeriodic(t,rotationCenter=[0.,0.,0.],rotationAngle=[0.,0.,90.]) test.testT(t,11) -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) C._addBC2Zone(a,'wall','BCWall','jmin') C._addBC2Zone(a,'overlap','BCOverlap','jmax') @@ -37,7 +37,7 @@ t = X.connectMatchPeriodic(t,translation=[0,0,5]) test.testT(t,2) # sur une liste de zones -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) C._addBC2Zone(a,'wall','BCWall','jmin') C._addBC2Zone(a,'overlap','BCOverlap','jmax') @@ -52,7 +52,7 @@ test.testT(t,4) # # sur une base -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) C._addBC2Zone(a,'wall','BCWall','jmin') C._addBC2Zone(a,'overlap','BCOverlap','jmax') @@ -67,7 +67,7 @@ test.testT(t,5) # # sur une base en radian -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) C._addBC2Zone(a,'wall','BCWall','jmin') C._addBC2Zone(a,'overlap','BCOverlap','jmax') @@ -82,7 +82,7 @@ test.testT(t,6) # # sur une base en degres -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) C._addBC2Zone(a,'wall','BCWall','jmin') C._addBC2Zone(a,'overlap','BCOverlap','jmax') @@ -95,7 +95,7 @@ t[2][1] = X.connectMatchPeriodic(t[2][1],rotationCenter=[0.,0.,0.],rotationAngle=[0.,0.,90.],unitAngle='Degree') test.testT(t,7) # sur une base en radian (par defaut) -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) C._addBC2Zone(a,'wall','BCWall','jmin') C._addBC2Zone(a,'overlap','BCOverlap','jmax') diff --git a/Cassiopee/Connector/test/connectMatchPeriodicPT_t2.py b/Cassiopee/Connector/test/connectMatchPeriodicPT_t2.py index 67653ec4c..6fc57644b 100644 --- a/Cassiopee/Connector/test/connectMatchPeriodicPT_t2.py +++ b/Cassiopee/Connector/test/connectMatchPeriodicPT_t2.py @@ -5,7 +5,7 @@ import KCore.test as test # Un seul bloc -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) a = C.convertArray2NGon(a); a =G.close(a) C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) t = C.newPyTree(['Base',a]) @@ -14,7 +14,7 @@ test.testT(t,1) # sur une base -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) b = G.cylinder((0.,0.,0.), 0.1, 1., 45., 90., 5., (11,11,11)); b[0] = 'cyl2' a = C.convertArray2NGon(a); a=G.close(a) b = C.convertArray2NGon(b); b=G.close(b) diff --git a/Cassiopee/Connector/test/connectMatch_t3.py b/Cassiopee/Connector/test/connectMatch_t3.py index 1173e9915..c053d2213 100644 --- a/Cassiopee/Connector/test/connectMatch_t3.py +++ b/Cassiopee/Connector/test/connectMatch_t3.py @@ -11,7 +11,7 @@ res = X.connectMatch(a,a,sameZone=1) test.testO(res,1) -# 3D raccord i = 1 partiel profil NACA +# 3D raccord i = 1 partiel profil NACA msh = D.naca(12., 5001) msh2 = D.line((1.,0.,0.),(2.,0.,0.),5001); msh = T.join(msh, msh2) msh2 = D.line((2.,0.,0.),(1.,0.,0.),5001); msh = T.join(msh2, msh) diff --git a/Cassiopee/Connector/test/connectNearMatchPT_t1.py b/Cassiopee/Connector/test/connectNearMatchPT_t1.py index a1c281c77..97c232eba 100755 --- a/Cassiopee/Connector/test/connectNearMatchPT_t1.py +++ b/Cassiopee/Connector/test/connectNearMatchPT_t1.py @@ -30,4 +30,3 @@ t = C.initVars(t, 'Density', 1.) t = X.connectNearMatch(t, dim=2, tol=2.e-5) test.testT(t,2) - diff --git a/Cassiopee/Connector/test/connectNearMatchPT_t3.py b/Cassiopee/Connector/test/connectNearMatchPT_t3.py index cc70b7ff3..0f3ff6170 100644 --- a/Cassiopee/Connector/test/connectNearMatchPT_t3.py +++ b/Cassiopee/Connector/test/connectNearMatchPT_t3.py @@ -14,14 +14,14 @@ t = X.connectNearMatch(t) test.testT(t,1) -# 3D raccord i = 1 partiel profil NACA +# 3D raccord i = 1 partiel profil NACA a = D.naca(12., 5001) a2 = D.line((1.,0.,0.),(2.,0.,0.),5001); a = T.join(a, a2) a2 = D.line((2.,0.,0.),(1.,0.,0.),5001); a = T.join(a2, a) Ni = 301; Nj = 51 distrib = G.cart((0,0,0), (1./(Ni-1), 0.5/(Nj-1),1), (Ni,Nj,1)) naca = G.hyper2D(a, distrib, "C") -a = T.addkplane(naca) +a = T.addkplane(naca) a1 = T.subzone(a,(1,1,1),(151,Nj,2)) a2 = T.subzone(a,(151,1,1),(Ni,Nj,2)) a2 = T.oneovern(a2,(2,2,1)) diff --git a/Cassiopee/Connector/test/dist2wallIBMPT_t1.py b/Cassiopee/Connector/test/dist2wallIBMPT_t1.py index 397757c14..73ed66bdc 100755 --- a/Cassiopee/Connector/test/dist2wallIBMPT_t1.py +++ b/Cassiopee/Connector/test/dist2wallIBMPT_t1.py @@ -6,7 +6,7 @@ import Converter.Internal as Internal import KCore.test as test -# --- Front Type=1 +# --- Front Type=1 N = 50; h = 1./(N-1) tb = G.cylinder((0.,0.,0.), 0.2, 1., 360., 0., 10., (2*N,1,1)); tb[0] = 'cyl' DIBM._setIBCType(tb, 'Musker') diff --git a/Cassiopee/Connector/test/getCEBBIntersectingDomainsPT_t1.py b/Cassiopee/Connector/test/getCEBBIntersectingDomainsPT_t1.py index 7a744767f..52dfa13b6 100644 --- a/Cassiopee/Connector/test/getCEBBIntersectingDomainsPT_t1.py +++ b/Cassiopee/Connector/test/getCEBBIntersectingDomainsPT_t1.py @@ -23,7 +23,7 @@ t[2][1][2] += [a, b, c] bases = Internal.getNodesFromType(t,'CGNSBase_t') base = bases[0] -doms = X.getCEBBIntersectingDomains(base, bases,sameBase=1) +doms = X.getCEBBIntersectingDomains(base, bases,sameBase=1) test.testO(doms) doms = X.getCEBBIntersectingDomains(base, bases,sameBase=0) test.testO(doms,2) diff --git a/Cassiopee/Connector/test/getCEBBIntersectingDomainsPT_t2.py b/Cassiopee/Connector/test/getCEBBIntersectingDomainsPT_t2.py index 6e6bbc4b1..34466ab61 100644 --- a/Cassiopee/Connector/test/getCEBBIntersectingDomainsPT_t2.py +++ b/Cassiopee/Connector/test/getCEBBIntersectingDomainsPT_t2.py @@ -24,7 +24,7 @@ C._initVars(t, 'F', 2.) bases = Internal.getNodesFromType(t,'CGNSBase_t') base = bases[0] -doms = X.getCEBBIntersectingDomains(base, bases, sameBase=1) +doms = X.getCEBBIntersectingDomains(base, bases, sameBase=1) test.testO(doms) -doms = X.getCEBBIntersectingDomains(base, bases, sameBase=0) +doms = X.getCEBBIntersectingDomains(base, bases, sameBase=0) test.testO(doms,2) diff --git a/Cassiopee/Connector/test/getInterpolatedPointsPT.py b/Cassiopee/Connector/test/getInterpolatedPointsPT.py index 35a1d6915..4432c1867 100644 --- a/Cassiopee/Connector/test/getInterpolatedPointsPT.py +++ b/Cassiopee/Connector/test/getInterpolatedPointsPT.py @@ -1,4 +1,4 @@ -# - getInterpolatedPoints (pyTree) - +# - getInterpolatedPoints (pyTree) - import Converter.PyTree as C import Connector.PyTree as X import Generator.PyTree as G diff --git a/Cassiopee/Connector/test/getIntersectingDomainsPT_t1.py b/Cassiopee/Connector/test/getIntersectingDomainsPT_t1.py index 4f11378c0..2fcca99ba 100644 --- a/Cassiopee/Connector/test/getIntersectingDomainsPT_t1.py +++ b/Cassiopee/Connector/test/getIntersectingDomainsPT_t1.py @@ -19,4 +19,3 @@ interDict = X.getIntersectingDomains(t, method='hybrid') test.testO(interDict,3) - diff --git a/Cassiopee/Connector/test/maskXRay3.py b/Cassiopee/Connector/test/maskXRay3.py index 9c56ee907..812be4f18 100644 --- a/Cassiopee/Connector/test/maskXRay3.py +++ b/Cassiopee/Connector/test/maskXRay3.py @@ -9,7 +9,7 @@ import Generator as G import Transform as T -surf = G.cylinder((0.,0.,0.), 0., 1., 360., 0., 1., (50,50,2)) +surf = G.cylinder((0.,0.,0.), 0., 1., 360., 0., 1., (50,50,2)) surf = T.subzone(surf,(1,50,1),(50,50,2)) surf = C.convertArray2Tetra(surf) res = [surf] diff --git a/Cassiopee/Connector/test/maskXRayPT.py b/Cassiopee/Connector/test/maskXRayPT.py index b8b45b12d..073aa4541 100644 --- a/Cassiopee/Connector/test/maskXRayPT.py +++ b/Cassiopee/Connector/test/maskXRayPT.py @@ -1,4 +1,4 @@ -# - maskXRay (pyTree) - +# - maskXRay (pyTree) - # sortie points de percage import Connector.PyTree as X import Geom.PyTree as D diff --git a/Cassiopee/Connector/test/maskXRayPT_t1.py b/Cassiopee/Connector/test/maskXRayPT_t1.py index 16dca7e57..b10fcea1d 100644 --- a/Cassiopee/Connector/test/maskXRayPT_t1.py +++ b/Cassiopee/Connector/test/maskXRayPT_t1.py @@ -21,7 +21,7 @@ test.testT(xray,2) # cas surface 2D avec body en TRI -surf = G.cylinder((0.,0.,0.), 0., 1., 360., 0., 1., (50,50,2)) +surf = G.cylinder((0.,0.,0.), 0., 1., 360., 0., 1., (50,50,2)) surf = T.subzone(surf,(1,50,1),(50,50,2)) surf = C.convertArray2Tetra(surf) xray = X.maskXRay__(surf, 0.,2) diff --git a/Cassiopee/Connector/test/maskXRay_t1.py b/Cassiopee/Connector/test/maskXRay_t1.py index 17126fb96..ebb4d8c19 100644 --- a/Cassiopee/Connector/test/maskXRay_t1.py +++ b/Cassiopee/Connector/test/maskXRay_t1.py @@ -20,7 +20,7 @@ test.testA([res0],2) # cas surface 2D avec body en TRI -surf = G.cylinder((0.,0.,0.), 0., 1., 360., 0., 1., (50,50,2)) +surf = G.cylinder((0.,0.,0.), 0., 1., 360., 0., 1., (50,50,2)) surf = T.subzone(surf,(1,50,1),(50,50,2)) surf = C.convertArray2Tetra(surf) res0 = X.maskXRay__([surf], 0.,2) diff --git a/Cassiopee/Connector/test/maximizeBlankedCellsPT_t1.py b/Cassiopee/Connector/test/maximizeBlankedCellsPT_t1.py index 672fe4474..88f5d0f04 100644 --- a/Cassiopee/Connector/test/maximizeBlankedCellsPT_t1.py +++ b/Cassiopee/Connector/test/maximizeBlankedCellsPT_t1.py @@ -8,7 +8,7 @@ def F(x,y): if (x+y<1): return 1 else: return 2 -# CAS 2D +# CAS 2D Ni = 50; Nj = 50 a = G.cart((0,0,0),(1./(Ni-1),1./(Nj-1),1),(Ni,Nj,1)) C._initVars(a,'cellN', F,['CoordinateX','CoordinateY']) @@ -24,7 +24,7 @@ def F(x,y): t2 = X.maximizeBlankedCells(t, depth=2, dir=1) test.testT(t2,21) -# CAS 3D +# CAS 3D Ni = 50; Nj = 50; Nk = 20 a = G.cart((0,0,0),(1./(Ni-1),1./(Nj-1),1./(Nk-1)),(Ni,Nj,Nk)) a = C.initVars(a,'cellN', F,['CoordinateX','CoordinateY']) diff --git a/Cassiopee/Connector/test/maximizeBlankedCells_t1.py b/Cassiopee/Connector/test/maximizeBlankedCells_t1.py index ba9616c34..c384b2e4a 100644 --- a/Cassiopee/Connector/test/maximizeBlankedCells_t1.py +++ b/Cassiopee/Connector/test/maximizeBlankedCells_t1.py @@ -18,4 +18,3 @@ def F(x,y): a2 = X.maximizeBlankedCells(a, 1,dir=0) test.testA([a2], 2) - diff --git a/Cassiopee/Connector/test/maximizeBlankedCells_t2.py b/Cassiopee/Connector/test/maximizeBlankedCells_t2.py index 1891296cb..3a3179acd 100644 --- a/Cassiopee/Connector/test/maximizeBlankedCells_t2.py +++ b/Cassiopee/Connector/test/maximizeBlankedCells_t2.py @@ -20,4 +20,3 @@ def F(x,y,z): a2 = X.maximizeBlankedCells(a, 1, dir=1) test.testA([a2], 3) - diff --git a/Cassiopee/Connector/test/optimizeOverlap.py b/Cassiopee/Connector/test/optimizeOverlap.py index dffc27577..833ecb046 100644 --- a/Cassiopee/Connector/test/optimizeOverlap.py +++ b/Cassiopee/Connector/test/optimizeOverlap.py @@ -11,6 +11,6 @@ a = T.translate(a, (0.5,0.5,0)) ca = C.node2Center(a); ca = C.initVars(ca, 'cellN', 1.) -cb = C.node2Center(b); cb = C.initVars(cb, 'cellN', 1.) +cb = C.node2Center(b); cb = C.initVars(cb, 'cellN', 1.) res = X.optimizeOverlap(a, ca, b, cb) C.convertArrays2File(res, "out.plt") diff --git a/Cassiopee/Connector/test/optimizeOverlapPT_t2.py b/Cassiopee/Connector/test/optimizeOverlapPT_t2.py index 051fbec90..ce850f862 100644 --- a/Cassiopee/Connector/test/optimizeOverlapPT_t2.py +++ b/Cassiopee/Connector/test/optimizeOverlapPT_t2.py @@ -21,6 +21,6 @@ # Same as first test, but now using an intersection dictionnary interDict = X.getIntersectingDomains(t, method='hybrid') -t2 = X.optimizeOverlap(t, double_wall=1,priorities=['Base2',0,'Base',1], +t2 = X.optimizeOverlap(t, double_wall=1,priorities=['Base2',0,'Base',1], intersectionsDict=interDict) test.testT(t2,2) diff --git a/Cassiopee/Connector/test/optimizeOverlapPT_t3.py b/Cassiopee/Connector/test/optimizeOverlapPT_t3.py index c7df89b72..380f4f4ba 100644 --- a/Cassiopee/Connector/test/optimizeOverlapPT_t3.py +++ b/Cassiopee/Connector/test/optimizeOverlapPT_t3.py @@ -1,4 +1,4 @@ -# - optimizeOverlap (pyTree) - +# - optimizeOverlap (pyTree) - import Converter.PyTree as C import Connector.PyTree as X import Generator.PyTree as G diff --git a/Cassiopee/Connector/test/optimizeOverlapPT_t4.py b/Cassiopee/Connector/test/optimizeOverlapPT_t4.py index 378f318d6..fa44b5ae6 100644 --- a/Cassiopee/Connector/test/optimizeOverlapPT_t4.py +++ b/Cassiopee/Connector/test/optimizeOverlapPT_t4.py @@ -5,12 +5,12 @@ import KCore.test as test H = 1.; NK = 4*int(H)+1 -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., H, (11,11,NK)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., H, (11,11,NK)) t = C.newPyTree(['Base','Base2']); t[2][1][2] += [a] t = X.connectMatchPeriodic(t,rotationCenter=[0.,0.,0.], translation=[0.,0.,H]) H2 = 4*H; NK = 2*int(H2)+1 -b = G.cylinder((0.,0.,-H), 0.1, 1., -30., 120., 3*H, (11,11,NK)) +b = G.cylinder((0.,0.,-H), 0.1, 1., -30., 120., 3*H, (11,11,NK)) t[2][2][2] += [b] # Same as first test, but now using an intersection dictionnary @@ -22,12 +22,12 @@ test.testT(t,1) # Periodicite par rotation H = 1.; NK = 4*int(H)+1 -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., H, (11,11,NK)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., H, (11,11,NK)) t = C.newPyTree(['Base','Base2']); t[2][1][2] += [a] t = X.connectMatchPeriodic(t, rotationCenter=[0.,0.,0.], rotationAngle=[0.,0.,90.]) H2 = 4*H; NK = 2*int(H2)+1 -b = G.cylinder((0.,0.,-H), 0.1, 1., -30., 120., 3*H, (11,11,NK)) +b = G.cylinder((0.,0.,-H), 0.1, 1., -30., 120., 3*H, (11,11,NK)) t[2][2][2] += [b] # Same as second test, but now using an intersection dictionnary InterDict = X.getIntersectingDomains(t, method='hybrid') @@ -53,11 +53,9 @@ t = X.connectMatchPeriodic(t,translation=(0,0,1)) # Same as third test, but now using an Intersection Dictionnary InterDict = X.getIntersectingDomains(t, method='hybrid') -t3 = X.optimizeOverlap(t, double_wall=1, priorities=['Base2',0,'Base',1], +t3 = X.optimizeOverlap(t, double_wall=1, priorities=['Base2',0,'Base',1], intersectionsDict=interDict) test.testT(t3,6) # Third test: t = X.optimizeOverlap(t, double_wall=1, priorities=['Base2',0,'Base',1]) test.testT(t,3) - - diff --git a/Cassiopee/Connector/test/optimizeOverlap_t1.py b/Cassiopee/Connector/test/optimizeOverlap_t1.py index d6e81086e..0b2d3529b 100644 --- a/Cassiopee/Connector/test/optimizeOverlap_t1.py +++ b/Cassiopee/Connector/test/optimizeOverlap_t1.py @@ -12,7 +12,7 @@ a = T.translate(a, (0.5,0.5,0)) ca = C.node2Center(a); ca = C.initVars(ca, 'cellN', 1.) -cb = C.node2Center(b); cb = C.initVars(cb, 'cellN', 1.) +cb = C.node2Center(b); cb = C.initVars(cb, 'cellN', 1.) # critere de volume res = X.optimizeOverlap(a,ca,b,cb) test.testA(res,1) diff --git a/Cassiopee/Connector/test/prepareIBMData_m1.py b/Cassiopee/Connector/test/prepareIBMData_m1.py index 017a31346..bfda0887f 100644 --- a/Cassiopee/Connector/test/prepareIBMData_m1.py +++ b/Cassiopee/Connector/test/prepareIBMData_m1.py @@ -11,7 +11,7 @@ dfars = 5 snears = 1 t, tc = X_IBM.prepareIBMData(tb , None , None , - snears=snears , dfars=dfars , vmin=vmin, + snears=snears , dfars=dfars , vmin=vmin, check=False , frontType=1 , cartesian=False) if Cmpi.rank==0: test.testT(t , 1) diff --git a/Cassiopee/Connector/test/prepareIBMData_t1.py b/Cassiopee/Connector/test/prepareIBMData_t1.py index 0f92e5904..74274bf3c 100644 --- a/Cassiopee/Connector/test/prepareIBMData_t1.py +++ b/Cassiopee/Connector/test/prepareIBMData_t1.py @@ -10,7 +10,7 @@ dfars = 5 snears = 1 t, tc = X_IBM.prepareIBMData(tb , None , None , - snears=snears , dfars=dfars , vmin=vmin, + snears=snears , dfars=dfars , vmin=vmin, check=False , frontType=1 , cartesian=False) test.testT(t , 1) test.testT(tc, 2) diff --git a/Cassiopee/Connector/test/setDoublyDefinedBC.py b/Cassiopee/Connector/test/setDoublyDefinedBC.py index d8fce215b..a31f5f3e0 100644 --- a/Cassiopee/Connector/test/setDoublyDefinedBC.py +++ b/Cassiopee/Connector/test/setDoublyDefinedBC.py @@ -11,7 +11,7 @@ celln[1][0][0:indmax] = 2 cellnb = C.array('cellN',b[2]-1,b[3]-1,b[4]-1) cellnb = C.initVars(cellnb, 'cellN', 1) -celln = X.setDoublyDefinedBC(a, celln, [b], [cellnb], [1,a[2],1,a[3],1,1], depth = 1) +celln = X.setDoublyDefinedBC(a, celln, [b], [cellnb], [1,a[2],1,a[3],1,1], depth=1) ac = C.node2Center(a) ac = C.addVars([ac,celln]) C.convertArrays2File([ac], 'out.plt') diff --git a/Cassiopee/Connector/test/setDoublyDefinedBCPT_t3.py b/Cassiopee/Connector/test/setDoublyDefinedBCPT_t3.py index 1e214f96e..062427c99 100755 --- a/Cassiopee/Connector/test/setDoublyDefinedBCPT_t3.py +++ b/Cassiopee/Connector/test/setDoublyDefinedBCPT_t3.py @@ -10,7 +10,7 @@ a = X.connectMatchPeriodic(a,rotationCenter=[0.,0.,0.],rotationAngle=[0.,0.,120.]) C._fillEmptyBCWith(a,"wall","BCWall") C._addBC2Zone(a,'overlapdd','BCOverlap','kmin',zoneDonor=[b],rangeDonor='doubly_defined')#dd -# +# C._addBC2Zone(b,'overlap','BCOverlap','kmax') C._fillEmptyBCWith(b,"wall","BCWall") for rangel in ['imin','imax','jmin','jmax']: @@ -25,8 +25,8 @@ # b = T.rotate(b,(0,0,0),(0,0,1),30.) import Converter.elsAProfile as CE -CE._addPeriodicDataInSolverParam(b,rotationCenter=[0.,0.,0.], - rotationAngle=[0.,0.,1.], +CE._addPeriodicDataInSolverParam(b,rotationCenter=[0.,0.,0.], + rotationAngle=[0.,0.,1.], NAzimutalSectors=10, isChimera=True) # t = C.newPyTree(['Base',a,'Base2',b]) diff --git a/Cassiopee/Connector/test/setDoublyDefinedBC_t2.py b/Cassiopee/Connector/test/setDoublyDefinedBC_t2.py index 736147481..51798fe06 100644 --- a/Cassiopee/Connector/test/setDoublyDefinedBC_t2.py +++ b/Cassiopee/Connector/test/setDoublyDefinedBC_t2.py @@ -14,7 +14,7 @@ range = [1,a[2],1,a[3],1,1] range = [1,1,1,a[3],1,a[4]] -celln = X.setDoublyDefinedBC(b, celln, [a], [cellna], range, depth = 2) +celln = X.setDoublyDefinedBC(b, celln, [a], [cellna], range, depth=2) bc = C.node2Center(b) bc = C.addVars([bc,celln]) diff --git a/Cassiopee/Connector/test/setHoleInterpolatedPtsPT_t6.py b/Cassiopee/Connector/test/setHoleInterpolatedPtsPT_t6.py index 7dfab35c8..a99a56d5f 100644 --- a/Cassiopee/Connector/test/setHoleInterpolatedPtsPT_t6.py +++ b/Cassiopee/Connector/test/setHoleInterpolatedPtsPT_t6.py @@ -53,4 +53,3 @@ def sphere(x,y,z): tp = Internal.copyTree(t) t2 = X.setHoleInterpolatedPoints(tp, depth=3, dir=2, loc='centers') test.testT(t2,6) - diff --git a/Cassiopee/Connector/test/setIBCDataPT.py b/Cassiopee/Connector/test/setIBCDataPT.py index b1539e5a4..bc38f96fc 100644 --- a/Cassiopee/Connector/test/setIBCDataPT.py +++ b/Cassiopee/Connector/test/setIBCDataPT.py @@ -8,7 +8,7 @@ import Transform.PyTree as T a = G.cart((-1,-1,-1),(0.01,0.01,1),(201,201,3)) -s = G.cylinder((0,0,-1), 0, 0.4, 360, 0, 4, (30,30,5)) +s = G.cylinder((0,0,-1), 0, 0.4, 360, 0, 4, (30,30,5)) s = C.convertArray2Tetra(s); s = T.join(s); s = P.exteriorFaces(s) t = C.newPyTree(['Base',a]) # Blanking diff --git a/Cassiopee/Connector/test/setIBCDataPT_t1.py b/Cassiopee/Connector/test/setIBCDataPT_t1.py index 716a51bf7..0ce5adac7 100644 --- a/Cassiopee/Connector/test/setIBCDataPT_t1.py +++ b/Cassiopee/Connector/test/setIBCDataPT_t1.py @@ -10,7 +10,7 @@ import numpy as N a = G.cart((-1,-1,-1),(0.1,0.1,1),(21,21,3)) -s = G.cylinder((0,0,-1), 0, 0.4, 360, 0, 4, (31,31,5)) +s = G.cylinder((0,0,-1), 0, 0.4, 360, 0, 4, (31,31,5)) s = C.convertArray2Tetra(s); s = T.join(s); s = P.exteriorFaces(s) t = C.newPyTree(['Base', a]) tb = C.newPyTree(['Base', s]) @@ -55,7 +55,7 @@ BM = N.array([[1]], Internal.E_NpyInt) t = X.blankCells(t,bodies,BM,blankingType='center_in') t = X.setHoleInterpolatedPoints(t,depth=-1) -t = X.setHoleInterpolatedPoints(t,depth= 2) +t = X.setHoleInterpolatedPoints(t,depth=2) # Dist2Walls DTW._distance2Walls(t,[s],type='ortho',loc='centers',signed=1) t = C.center2Node(t,'centers:TurbulentDistance') diff --git a/Cassiopee/Connector/test/setInterpDataForGCNGonPT.py b/Cassiopee/Connector/test/setInterpDataForGCNGonPT.py index 99cba49e4..598198b85 100644 --- a/Cassiopee/Connector/test/setInterpDataForGCNGonPT.py +++ b/Cassiopee/Connector/test/setInterpDataForGCNGonPT.py @@ -11,7 +11,7 @@ t = X.connectMatch(t) Internal._adaptNFace2PE(t, remove=False) -t = GC.addGhostCellsNG(t, nlayers=2) +t = GC.addGhostCellsNG(t, nlayers=2) tc = C.node2Center(t) Internal._rmNodesFromType(tc,'GridCoordinates_t') Internal._rmNodesFromType(tc,'Elements_t') diff --git a/Cassiopee/Connector/test/setInterpDataForGCNGonPT_t1.py b/Cassiopee/Connector/test/setInterpDataForGCNGonPT_t1.py index b34c4afe9..7b46b7862 100644 --- a/Cassiopee/Connector/test/setInterpDataForGCNGonPT_t1.py +++ b/Cassiopee/Connector/test/setInterpDataForGCNGonPT_t1.py @@ -12,7 +12,7 @@ t = X.connectMatch(t) Internal._adaptNFace2PE(t, remove=False) -t = GC.addGhostCellsNG(t, nlayers=2) +t = GC.addGhostCellsNG(t, nlayers=2) tc = C.node2Center(t) Internal._rmNodesFromType(tc,'GridCoordinates_t') Internal._rmNodesFromType(tc,'Elements_t') diff --git a/Cassiopee/Connector/test/setInterpDataIBMPT_t1.py b/Cassiopee/Connector/test/setInterpDataIBMPT_t1.py index 5e0bc2eee..78903242a 100755 --- a/Cassiopee/Connector/test/setInterpDataIBMPT_t1.py +++ b/Cassiopee/Connector/test/setInterpDataIBMPT_t1.py @@ -7,7 +7,7 @@ import KCore.test as test import Transform.PyTree as T -# --- Front Type=1 +# --- Front Type=1 N = 50; h = 1./(N-1) c = G.cylinder((0.,0.,0.), 0.2, 1., 360., 0., 10., (2*N,1,1)); c[0] = 'cyl' DIBM._setIBCType(c, 'Musker') diff --git a/Cassiopee/Connector/test/setInterpDataIBMPT_t2.py b/Cassiopee/Connector/test/setInterpDataIBMPT_t2.py index a7623679a..f44327174 100755 --- a/Cassiopee/Connector/test/setInterpDataIBMPT_t2.py +++ b/Cassiopee/Connector/test/setInterpDataIBMPT_t2.py @@ -7,7 +7,7 @@ import Geom.PyTree as D import KCore.test as test -# --- Front Type=1 +# --- Front Type=1 N = 30; h = 1./(N-1) s1 = D.sphere((0.,0.,0.),0.2,N//2); s1[0] = 'sphere' DIBM._setIBCType(s1, 'Musker') diff --git a/Cassiopee/Connector/test/setInterpDataPT_t1.py b/Cassiopee/Connector/test/setInterpDataPT_t1.py index 49373c9a5..b1b8a8d98 100644 --- a/Cassiopee/Connector/test/setInterpDataPT_t1.py +++ b/Cassiopee/Connector/test/setInterpDataPT_t1.py @@ -1,4 +1,4 @@ -# - setInterpData (pyTree) - +# - setInterpData (pyTree) - # case without cellN field: the whole receiver zone is interpolated import Converter.PyTree as C import Generator.PyTree as G diff --git a/Cassiopee/Connector/test/setInterpDataPT_t2.py b/Cassiopee/Connector/test/setInterpDataPT_t2.py index 196d5eccf..47118e832 100644 --- a/Cassiopee/Connector/test/setInterpDataPT_t2.py +++ b/Cassiopee/Connector/test/setInterpDataPT_t2.py @@ -1,4 +1,4 @@ -# - setInterpData (pyTree) - +# - setInterpData (pyTree) - # case without cellN field: the whole receiver zone is interpolated import Converter.PyTree as C import Generator.PyTree as G @@ -9,7 +9,7 @@ # Tetra donor zone a = G.cartTetra((0,0,-0.2),(0.01,0.01,0.1),(101,101,5)) pts = D.circle((0.5,0.5,0),0.05,N=20) -C._initVars(pts, 'cellN', 2); C._initVars(pts, 'centers:cellN',2) +C._initVars(pts, 'cellN', 2); C._initVars(pts, 'centers:cellN',2) # options to combine notest = 1 for location in ['nodes', 'centers']: @@ -18,7 +18,7 @@ for nat in [0,1]: for order in [2,3,5]: pts2 = X.setInterpData(pts, a, order=order, penalty=pen, - nature=nat, loc=location, + nature=nat, loc=location, storage=stk, hook=None) test.testT(pts2, notest) notest += 1 diff --git a/Cassiopee/Connector/test/setInterpDataPT_t3.py b/Cassiopee/Connector/test/setInterpDataPT_t3.py index 59ace430f..85c4d8c57 100644 --- a/Cassiopee/Connector/test/setInterpDataPT_t3.py +++ b/Cassiopee/Connector/test/setInterpDataPT_t3.py @@ -1,4 +1,4 @@ -# - setInterpData (pyTree) - +# - setInterpData (pyTree) - import Converter.PyTree as C import Generator.PyTree as G import Connector.PyTree as X diff --git a/Cassiopee/Connector/test/setInterpDataPT_t4.py b/Cassiopee/Connector/test/setInterpDataPT_t4.py index 81647d3c8..4256bb9ed 100644 --- a/Cassiopee/Connector/test/setInterpDataPT_t4.py +++ b/Cassiopee/Connector/test/setInterpDataPT_t4.py @@ -1,5 +1,5 @@ # - setInterpData (pyTree)- -# cas structure double wall +# cas structure double wall import Converter.PyTree as C import Connector.PyTree as X import Generator.PyTree as G @@ -11,7 +11,7 @@ C._addBC2Zone(a, 'match', 'BCMatch', 'imin', a, 'imax', trirac=[1,2,3]) C._addBC2Zone(a, 'match', 'BCMatch', 'imax', a, 'imin', trirac=[1,2,3]) C._addBC2Zone(b, 'wall', 'BCWall', 'jmin') -#b = C.addBC2Zone(b, 'wall', 'FamilySpecified:SKN', 'jmin') +#b = C.addBC2Zone(b, 'wall', 'FamilySpecified:SKN', 'jmin') C._addBC2Zone(b, 'overlap', 'BCOverlap', 'imin') C._addBC2Zone(b, 'overlap', 'BCOverlap', 'imax') t = C.newPyTree(['Base',a,'Base2',b]) @@ -19,11 +19,11 @@ C._initVars(t,'Density',1.); C._initVars(t,'centers:G',10.) C._addState(t[2][1], 'EquationDimension',2) -t1 = X.applyBCOverlaps(t, depth=2) +t1 = X.applyBCOverlaps(t, depth=2) t1[2][2] = X.setInterpData(t1[2][2],t1[2][1], loc='centers') test.testT(t1,1) t1 = X.applyBCOverlaps(t, depth=2) t1 = C.center2Node(t1,['centers:cellN']) t1[2][2] = X.setInterpData(t1[2][2],t1[2][1], loc='nodes') -test.testT(t1,2) +test.testT(t1,2) diff --git a/Cassiopee/Connector/test/setInterpDataPT_t5.py b/Cassiopee/Connector/test/setInterpDataPT_t5.py index dd4374b91..b29cef2af 100644 --- a/Cassiopee/Connector/test/setInterpDataPT_t5.py +++ b/Cassiopee/Connector/test/setInterpDataPT_t5.py @@ -1,5 +1,5 @@ # - setInterpData (pyTree)- -# cas structure double wall +# cas structure double wall import Converter.PyTree as C import Connector.PyTree as X import Generator.PyTree as G @@ -7,20 +7,20 @@ a = G.cylinder( (0,0,0), 1, 2, 0, 360, 1, (60, 20, 3) ) b = G.cylinder( (0,0,0), 1, 2, 3, 160, 1, (30, 20, 3) ) -C._addBC2Zone(a, 'wall', 'FamilySpecified:SKN1', 'jmin') +C._addBC2Zone(a, 'wall', 'FamilySpecified:SKN1', 'jmin') C._addBC2Zone(a, 'match', 'BCMatch', 'imin', a, 'imax', trirac=[1,2,3]) C._addBC2Zone(a, 'match', 'BCMatch', 'imax', a, 'imin', trirac=[1,2,3]) C._addBC2Zone(b, 'wall', 'BCWall', 'jmin') -C._addBC2Zone(b, 'wall', 'FamilySpecified:SKN2', 'jmin') +C._addBC2Zone(b, 'wall', 'FamilySpecified:SKN2', 'jmin') C._addBC2Zone(b, 'overlap', 'BCOverlap', 'imin') C._addBC2Zone(b, 'overlap', 'BCOverlap', 'imax') t = C.newPyTree(['Base',a,'Base2',b]) C._fillEmptyBCWith(t,'nref','BCFarfield') C._initVars(t,'Density',1.); C._initVars(t,'centers:G',10.) C._addState(t[2][1], 'EquationDimension',2) -C._addFamily2Base(t[2][1], 'SKN1', bndType="BCWall") -C._addFamily2Base(t[2][2], 'SKN2', bndType="BCWall") +C._addFamily2Base(t[2][1], 'SKN1', bndType="BCWall") +C._addFamily2Base(t[2][2], 'SKN2', bndType="BCWall") -t1 = X.applyBCOverlaps(t, depth=2) +t1 = X.applyBCOverlaps(t, depth=2) t1[2][2] = X.setInterpData(t1[2][2],t1[2][1], loc='centers') test.testT(t1,1) diff --git a/Cassiopee/Connector/test/setInterpDataPT_t6.py b/Cassiopee/Connector/test/setInterpDataPT_t6.py index 9b60249b8..5a148f0cf 100644 --- a/Cassiopee/Connector/test/setInterpDataPT_t6.py +++ b/Cassiopee/Connector/test/setInterpDataPT_t6.py @@ -1,4 +1,4 @@ -# - setInterpData (pyTree) - +# - setInterpData (pyTree) - # donneur NGON + leastsquare import Converter.PyTree as C import Generator.PyTree as G diff --git a/Cassiopee/Connector/test/setInterpDataPT_t7.py b/Cassiopee/Connector/test/setInterpDataPT_t7.py index dfbf3fe54..19cb6af4d 100644 --- a/Cassiopee/Connector/test/setInterpDataPT_t7.py +++ b/Cassiopee/Connector/test/setInterpDataPT_t7.py @@ -1,11 +1,11 @@ -# - setInterpData (pyTree) - +# - setInterpData (pyTree) - import Converter.PyTree as C import Generator.PyTree as G import Connector.PyTree as X import Geom.PyTree as D import KCore.test as test -# 2D structured donor zone +# 2D structured donor zone a = G.cart((0,0,0.),(0.01,0.01,0.1),(101,101,1)) pts = D.circle((0.5,0.5,0),0.05,N=20) C._initVars(pts, 'cellN', 2); C._initVars(pts, '{centers:cellN}=2') diff --git a/Cassiopee/Connector/test/setInterpDataPT_t8.py b/Cassiopee/Connector/test/setInterpDataPT_t8.py index fc9bfa8c1..5e0a213ab 100644 --- a/Cassiopee/Connector/test/setInterpDataPT_t8.py +++ b/Cassiopee/Connector/test/setInterpDataPT_t8.py @@ -11,8 +11,8 @@ # Receptor zR = G.cart((0.25,0.25,0.25), (0.1,0.1,0.1), (5,5,5)) C._initVars(zR,'{centers:cellN}=2.*({centers:CoordinateX}<1.)') -zR=X.setInterpData(zR, zD, order=2, penalty=1, nature=0, method='conservative', hook=None, dim=3, loc='centers',itype='chimera') +zR=X.setInterpData(zR, zD, order=2, penalty=1, nature=0, method='conservative', hook=None, dim=3, loc='centers',itype='chimera') test.testT(zR,1) -zD = X.setInterpData(zR, zD, order=2, penalty=1, nature=0, method='conservative', hook=None, dim=3, loc='centers',itype='chimera',storage='inverse') +zD = X.setInterpData(zR, zD, order=2, penalty=1, nature=0, method='conservative', hook=None, dim=3, loc='centers',itype='chimera',storage='inverse') test.testT(zD,2) diff --git a/Cassiopee/Connector/test/setInterpTransfersDPT.py b/Cassiopee/Connector/test/setInterpTransfersDPT.py index e4f7471ee..d5ad5af70 100644 --- a/Cassiopee/Connector/test/setInterpTransfersDPT.py +++ b/Cassiopee/Connector/test/setInterpTransfersDPT.py @@ -11,7 +11,7 @@ b = C.addBC2Zone(b, 'wall', 'BCWall', 'jmin') b = C.addBC2Zone(b, 'overlap', 'BCOverlap', 'imin') b = C.addBC2Zone(b, 'overlap', 'BCOverlap', 'imax') -tD = C.newPyTree(['Base']); tD[2][1][2] = [a]; +tD = C.newPyTree(['Base']); tD[2][1][2] = [a]; tR = C.newPyTree(['Base']); tR[2][1][2] = [b] tD = C.fillEmptyBCWith(tD, 'nref', 'BCFarfield') tR = C.fillEmptyBCWith(tR, 'nref', 'BCFarfield') @@ -25,7 +25,7 @@ tR = C.initVars(tR, '{centers:cellN}=1.') tR = C.initVars(tR, '{centers:MomentumX}=0.1') tR = C.initVars(tR, '{centers:MomentumY}=0.2') -tR = X.applyBCOverlaps(tR, depth=1) +tR = X.applyBCOverlaps(tR, depth=1) tD = X.setInterpData(tR, tD, loc='centers', storage='inverse', order=3) info = X.setInterpTransfersD(tD, variables=['MomentumX']) diff --git a/Cassiopee/Connector/test/setInterpTransfersDPT_t1.py b/Cassiopee/Connector/test/setInterpTransfersDPT_t1.py index 52c55dd47..ead4c4223 100644 --- a/Cassiopee/Connector/test/setInterpTransfersDPT_t1.py +++ b/Cassiopee/Connector/test/setInterpTransfersDPT_t1.py @@ -12,7 +12,7 @@ C._addBC2Zone(b, 'wall', 'BCWall', 'jmin') C._addBC2Zone(b, 'overlap', 'BCOverlap', 'imin') C._addBC2Zone(b, 'overlap', 'BCOverlap', 'imax') -tD = C.newPyTree(['Base',a]) +tD = C.newPyTree(['Base',a]) tR = C.newPyTree(['Base',b]) C._fillEmptyBCWith(tD, 'nref', 'BCFarfield') C._fillEmptyBCWith(tR, 'nref', 'BCFarfield') @@ -21,7 +21,7 @@ C._initVars(tD, 'cellN', 1.) C._initVars(tD, 'MomentumX', -0.1) C._initVars(tD, 'MomentumY', -0.2) -tR = X.applyBCOverlaps(tR, depth=1) +tR = X.applyBCOverlaps(tR, depth=1) tD = X.setInterpData(tR, tD, loc='centers', storage='inverse', order=3) info = X.setInterpTransfersD(tD, variables=['MomentumX']) @@ -38,7 +38,7 @@ C._initVars(tD, 'cellN', 1.) C._initVars(tD, 'MomentumX', -0.1) C._initVars(tD, 'MomentumY', -0.2) -tR = X.applyBCOverlaps(tR, depth=1,loc='nodes') +tR = X.applyBCOverlaps(tR, depth=1,loc='nodes') tD = X.setInterpData(tR, tD, loc='nodes', storage='inverse', order=2) info = X.setInterpTransfersD(tD,variables=['MomentumX','Density']) diff --git a/Cassiopee/Connector/test/setInterpTransfersDPT_t2.py b/Cassiopee/Connector/test/setInterpTransfersDPT_t2.py index 741430b77..aec093090 100644 --- a/Cassiopee/Connector/test/setInterpTransfersDPT_t2.py +++ b/Cassiopee/Connector/test/setInterpTransfersDPT_t2.py @@ -1,4 +1,4 @@ -# - setInterpTransfers (pyTree) - +# - setInterpTransfers (pyTree) - import Converter.PyTree as C import Connector.PyTree as X import Generator.PyTree as G @@ -14,7 +14,7 @@ def F(x,y,z): elif deg == 4 : return x*x*x*x + 2.*y*y*y*y +z*z else : return 2*x*x*x*x*x + 2.*y*y*z + z*z -# Donor mesh +# Donor mesh ni = 11; nj = 11; nk = 11 m = G.cartNGon((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) C._initVars(m, '{F}={CoordinateX}+2*{CoordinateY}+3*{CoordinateZ}') diff --git a/Cassiopee/Connector/test/setInterpTransfersDPT_t3.py b/Cassiopee/Connector/test/setInterpTransfersDPT_t3.py index 7f7f262c8..4d1ba1c4b 100644 --- a/Cassiopee/Connector/test/setInterpTransfersDPT_t3.py +++ b/Cassiopee/Connector/test/setInterpTransfersDPT_t3.py @@ -10,7 +10,7 @@ import KCore.test as test a = G.cart((-1,-1,-1),(0.04,0.04,1),(51,51,3)) -s = G.cylinder((0,0,-1), 0, 0.4, 360, 0, 4, (15,15,5)) +s = G.cylinder((0,0,-1), 0, 0.4, 360, 0, 4, (15,15,5)) s = C.convertArray2Tetra(s); s = T.join(s); s = P.exteriorFaces(s) t = C.newPyTree(['Base']); t[2][1][2] = [a] # Blanking diff --git a/Cassiopee/Connector/test/setInterpTransfersPT.py b/Cassiopee/Connector/test/setInterpTransfersPT.py index ac42dfece..ff2dcc4cf 100644 --- a/Cassiopee/Connector/test/setInterpTransfersPT.py +++ b/Cassiopee/Connector/test/setInterpTransfersPT.py @@ -11,7 +11,7 @@ b = C.addBC2Zone(b, 'wall', 'BCWall', 'jmin') b = C.addBC2Zone(b, 'overlap', 'BCOverlap', 'imin') b = C.addBC2Zone(b, 'overlap', 'BCOverlap', 'imax') -t1 = C.newPyTree(['Base']); t1[2][1][2] = [a]; +t1 = C.newPyTree(['Base']); t1[2][1][2] = [a]; t2 = C.newPyTree(['Base']); t2[2][1][2] = [b] t1 = C.fillEmptyBCWith(t1, 'nref', 'BCFarfield') t2 = C.fillEmptyBCWith(t2, 'nref', 'BCFarfield') @@ -20,7 +20,7 @@ t2 = C.initVars(t2, '{Density}=-1.') t2 = C.node2Center(t2, ['Density']) -t2 = X.applyBCOverlaps(t2, depth=1) +t2 = X.applyBCOverlaps(t2, depth=1) t1 = X.setInterpData(t2, t1, double_wall=1, loc='centers', storage='inverse', order=3) t2 = X.setInterpTransfers(t2, t1, variables=['Density']) diff --git a/Cassiopee/Connector/test/setInterpTransfersPT_t1.py b/Cassiopee/Connector/test/setInterpTransfersPT_t1.py index b0a37c8c4..04d514654 100755 --- a/Cassiopee/Connector/test/setInterpTransfersPT_t1.py +++ b/Cassiopee/Connector/test/setInterpTransfersPT_t1.py @@ -1,4 +1,4 @@ -# - setInterpTransfers (pyTree) - +# - setInterpTransfers (pyTree) - import Converter.PyTree as C import Connector.PyTree as X import Generator.PyTree as G @@ -14,7 +14,7 @@ def F(x,y,z): elif deg == 4 : return x*x*x*x + 2.*y*y*y*y +z*z else : return 2*x*x*x*x*x + 2.*y*y*z + z*z -# Donor mesh +# Donor mesh ni = 11; nj = 11; nk = 11 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) m = C.initVars(m, 'F', F, ['CoordinateX','CoordinateY','CoordinateZ']) diff --git a/Cassiopee/Connector/test/setInterpTransfersPT_t2.py b/Cassiopee/Connector/test/setInterpTransfersPT_t2.py index d4bbda076..a872f006b 100755 --- a/Cassiopee/Connector/test/setInterpTransfersPT_t2.py +++ b/Cassiopee/Connector/test/setInterpTransfersPT_t2.py @@ -1,4 +1,4 @@ -# - setInterpTransfers (pyTree) - +# - setInterpTransfers (pyTree) - import Converter.PyTree as C import Connector.PyTree as X import Generator.PyTree as G @@ -14,7 +14,7 @@ def F(x,y,z): elif deg == 4 : return x*x*x*x + 2.*y*y*y*y +z*z else : return 2*x*x*x*x*x + 2.*y*y*z + z*z -# Donor mesh +# Donor mesh ni = 11; nj = 11; nk = 11 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) m = C.initVars(m, 'F', F, ['CoordinateX','CoordinateY','CoordinateZ']) diff --git a/Cassiopee/Connector/test/setInterpTransfersPT_t3.py b/Cassiopee/Connector/test/setInterpTransfersPT_t3.py index 9acc5b7ae..65e126861 100755 --- a/Cassiopee/Connector/test/setInterpTransfersPT_t3.py +++ b/Cassiopee/Connector/test/setInterpTransfersPT_t3.py @@ -1,4 +1,4 @@ -# - setInterpTransfers (pyTree) - +# - setInterpTransfers (pyTree) - import Converter.PyTree as C import Connector.PyTree as X import Generator.PyTree as G diff --git a/Cassiopee/Connector/test/setInterpTransfersPT_t4.py b/Cassiopee/Connector/test/setInterpTransfersPT_t4.py index 8e52bc18e..54631c6ba 100644 --- a/Cassiopee/Connector/test/setInterpTransfersPT_t4.py +++ b/Cassiopee/Connector/test/setInterpTransfersPT_t4.py @@ -1,4 +1,4 @@ -# - setInterpTransfers (pyTree) - +# - setInterpTransfers (pyTree) - import Converter.PyTree as C import Connector.PyTree as X import Generator.PyTree as G @@ -14,7 +14,7 @@ def F(x,y,z): elif deg == 4 : return x*x*x*x + 2.*y*y*y*y +z*z else : return 2*x*x*x*x*x + 2.*y*y*z + z*z -# Donor mesh +# Donor mesh ni = 11; nj = 11; nk = 11 m = G.cartNGon((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) m = C.initVars(m, 'F', F, ['CoordinateX','CoordinateY','CoordinateZ']) diff --git a/Cassiopee/Connector/test/setInterpTransfersPT_t5.py b/Cassiopee/Connector/test/setInterpTransfersPT_t5.py index 4a967b1bd..a03fbc355 100644 --- a/Cassiopee/Connector/test/setInterpTransfersPT_t5.py +++ b/Cassiopee/Connector/test/setInterpTransfersPT_t5.py @@ -10,7 +10,7 @@ import KCore.test as test a = G.cart((-1,-1,-1),(0.04,0.04,1),(51,51,3)) -s = G.cylinder((0,0,-1), 0, 0.4, 360, 0, 4, (30,30,5)) +s = G.cylinder((0,0,-1), 0, 0.4, 360, 0, 4, (30,30,5)) s = C.convertArray2Tetra(s); s = T.join(s); s = P.exteriorFaces(s) t = C.newPyTree(['Base', a]) # Blanking @@ -28,7 +28,7 @@ C._initVars(t,"centers:VelocityY",0.) C._initVars(t,"centers:VelocityZ",0.) C._initVars(t,"centers:Temperature",1.) -C._addState(t, adim='adim1',MInf=0.2, GoverningEquations='Euler',EquationDimension=3) +C._addState(t, adim='adim1',MInf=0.2, GoverningEquations='Euler',EquationDimension=3) tc = C.node2Center(t) X._setIBCData(t, tc, loc='centers', storage='inverse') diff --git a/Cassiopee/Connector/test/setInterpTransfersPT_t7.py b/Cassiopee/Connector/test/setInterpTransfersPT_t7.py index 332ccb301..17e9b34b8 100644 --- a/Cassiopee/Connector/test/setInterpTransfersPT_t7.py +++ b/Cassiopee/Connector/test/setInterpTransfersPT_t7.py @@ -11,7 +11,7 @@ import KCore.test as test a = G.cart((-1,-1,-1),(0.04,0.04,1),(51,51,3)) -s = G.cylinder((0,0,-1), 0, 0.4, 360, 0, 4, (30,30,5)) +s = G.cylinder((0,0,-1), 0, 0.4, 360, 0, 4, (30,30,5)) s = C.convertArray2Tetra(s); s = T.join(s); s = P.exteriorFaces(s) t = C.newPyTree(['Base', a]) # Blanking @@ -29,7 +29,7 @@ C._initVars(t,"centers:VelocityY",0.) C._initVars(t,"centers:VelocityZ",0.) C._initVars(t,"centers:Temperature",1.) -C._addState(t, adim='adim1',MInf=0.2, GoverningEquations='Euler',EquationDimension=3) +C._addState(t, adim='adim1',MInf=0.2, GoverningEquations='Euler',EquationDimension=3) tc = C.node2Center(t) X._setIBCData(t, tc, loc='centers', storage='inverse', bcType=100) diff --git a/Cassiopee/Connector/test/setInterpTransfersPT_t8.py b/Cassiopee/Connector/test/setInterpTransfersPT_t8.py index c920c65f9..5b7f08356 100644 --- a/Cassiopee/Connector/test/setInterpTransfersPT_t8.py +++ b/Cassiopee/Connector/test/setInterpTransfersPT_t8.py @@ -11,7 +11,7 @@ # Receptor zR = G.cart((0.25,0.25,0.25), (0.1,0.1,0.1), (5,5,5)) C._initVars(zR,'{centers:cellN}=2.*({centers:CoordinateX}<1.)') -zR=X.setInterpData(zR, zD, method='conservative',itype='chimera') +zR=X.setInterpData(zR, zD, method='conservative',itype='chimera') C._initVars(zR,"centers:F", 0.) C._initVars(zD,'{centers:F}={centers:CoordinateX}*{centers:CoordinateY}') zD = C.node2Center(zD) @@ -30,7 +30,7 @@ # Receptor zR = G.cart((0.25,0.25,0.25), (0.1,0.1,0.1), (5,5,5)) C._initVars(zR,'{centers:cellN}=2.*({centers:CoordinateX}<1.)') -zD=X.setInterpData(zR, zD, method='conservative',itype='chimera',storage='inverse') +zD=X.setInterpData(zR, zD, method='conservative',itype='chimera',storage='inverse') C._initVars(zR,"centers:F", 0.) C._initVars(zD,'{centers:F}={centers:CoordinateX}*{centers:CoordinateY}') zD = C.node2Center(zD) diff --git a/Cassiopee/Connector/test/setInterpTransfersPT_t9.py b/Cassiopee/Connector/test/setInterpTransfersPT_t9.py index 191f14b00..167027b4f 100644 --- a/Cassiopee/Connector/test/setInterpTransfersPT_t9.py +++ b/Cassiopee/Connector/test/setInterpTransfersPT_t9.py @@ -12,7 +12,7 @@ t = X.connectMatch(t) Internal._adaptNFace2PE(t, remove=False) -t = GC.addGhostCellsNG(t, nlayers=2) +t = GC.addGhostCellsNG(t, nlayers=2) tc = C.node2Center(t) C._initVars(tc,"{F}={CoordinateX}*{CoordinateY}") Internal._rmNodesFromType(tc,'GridCoordinates_t') diff --git a/Cassiopee/Connector/test/setInterpolationsPT_t3.py b/Cassiopee/Connector/test/setInterpolationsPT_t3.py index 04af36d17..f9d29bb37 100644 --- a/Cassiopee/Connector/test/setInterpolationsPT_t3.py +++ b/Cassiopee/Connector/test/setInterpolationsPT_t3.py @@ -25,4 +25,3 @@ t2 = X.setInterpolations(t2, loc='face', double_wall=1, storage='direct') t2 = X.setInterpolations(t2, loc='cell', double_wall=1, storage='direct') test.testT(t2,2) - diff --git a/Cassiopee/Connector/test/setInterpolationsPT_t4.py b/Cassiopee/Connector/test/setInterpolationsPT_t4.py index b385c7701..d0e09e474 100644 --- a/Cassiopee/Connector/test/setInterpolationsPT_t4.py +++ b/Cassiopee/Connector/test/setInterpolationsPT_t4.py @@ -25,4 +25,3 @@ t2 = X.setInterpolations(t2, loc='face', double_wall=1, storage='inverse') t2 = X.setInterpolations(t2, loc='cell', double_wall=1, storage='inverse') test.testT(t2,2) - diff --git a/Cassiopee/Connector/test/setInterpolationsPT_t5.py b/Cassiopee/Connector/test/setInterpolationsPT_t5.py index c127f1779..1e70aed58 100644 --- a/Cassiopee/Connector/test/setInterpolationsPT_t5.py +++ b/Cassiopee/Connector/test/setInterpolationsPT_t5.py @@ -16,7 +16,7 @@ # 1 seule base, pas d'extrapolation t = C.newPyTree(['Base']); t[2][1][2].append(a); t[2][1][2].append(b) t = X.applyBCOverlaps(t, depth=2) -t = X.setInterpolations(t, loc='cell',storage='direct', sameBase = 1) +t = X.setInterpolations(t, loc='cell',storage='direct', sameBase=1) test.testT(t,1) # 1 seule base, extrapolations diff --git a/Cassiopee/Connector/test/setInterpolationsPT_t6.py b/Cassiopee/Connector/test/setInterpolationsPT_t6.py index 275e5d7d3..6d57db454 100644 --- a/Cassiopee/Connector/test/setInterpolationsPT_t6.py +++ b/Cassiopee/Connector/test/setInterpolationsPT_t6.py @@ -38,8 +38,8 @@ C._addBC2Zone(b,'overlapdd','BCOverlap',rangel,zoneDonor=[a],rangeDonor='doubly_defined') import Converter.elsAProfile as CE -CE._addPeriodicDataInSolverParam(b,rotationCenter=[0.,0.,0.], - rotationAngle=[0.,0.,1.], +CE._addPeriodicDataInSolverParam(b,rotationCenter=[0.,0.,0.], + rotationAngle=[0.,0.,1.], NAzimutalSectors=3, isChimera=True) T._rotate(b,(0,0,0),(0,0,1),60.) diff --git a/Cassiopee/Connector/test/t1.py b/Cassiopee/Connector/test/t1.py index 09c16564d..d5164a9a3 100644 --- a/Cassiopee/Connector/test/t1.py +++ b/Cassiopee/Connector/test/t1.py @@ -1,3 +1,3 @@ # Connector installation test import KCore.Dist as Dist -Dist.checkModuleImport('Connector') +Dist.checkModuleImport('Connector') diff --git a/Cassiopee/Connector/test/transferVariablesPT.py b/Cassiopee/Connector/test/transferVariablesPT.py index df350ca4c..67b6774d2 100644 --- a/Cassiopee/Connector/test/transferVariablesPT.py +++ b/Cassiopee/Connector/test/transferVariablesPT.py @@ -7,7 +7,7 @@ b = G.cart((9.,0.,0.),(0.5,0.5,1),(22,10,11)) c = G.cart((9.,3.,0.),(1,1,1),(11,10,11)) C._initVars(a,"centers:cellN=2*({centers:CoordinateX}>9)+({centers:CoordinateX}<9.)") -indicesI,XI,YI,ZI = X.getInterpolatedPoints(a,loc='centers') +indicesI,XI,YI,ZI = X.getInterpolatedPoints(a,loc='centers') C._initVars(a,"centers:Density=1.") C._initVars(b,"centers:Density=20.") C._initVars(c,"centers:Density=100.") diff --git a/Cassiopee/Connector/test/transferVariablesPT_t1.py b/Cassiopee/Connector/test/transferVariablesPT_t1.py index 625bd94e9..fea9474a5 100644 --- a/Cassiopee/Connector/test/transferVariablesPT_t1.py +++ b/Cassiopee/Connector/test/transferVariablesPT_t1.py @@ -8,7 +8,7 @@ a = D.sphere((5.,5.,5.),1) C._initVars(a,"centers:cellN=2.") C._initVars(a,"centers:Density=0.") -indicesI,XI,YI,ZI = X.getInterpolatedPoints(a,loc='centers') +indicesI,XI,YI,ZI = X.getInterpolatedPoints(a,loc='centers') zdnr = G.cart((0.,0.,0.),(1,1,1),(11,11,11)) C._initVars(zdnr,"centers:Density=1.") @@ -23,7 +23,7 @@ a = D.sphere((5.,5.,5.),1) C._initVars(a,"cellN=2.") C._initVars(a,"Density=0.") -indicesI,XI,YI,ZI = X.getInterpolatedPoints(a,loc='nodes') +indicesI,XI,YI,ZI = X.getInterpolatedPoints(a,loc='nodes') zdnr = G.cart((0.,0.,0.),(1,1,1),(11,11,11)) C._initVars(zdnr,"Density=1.") @@ -38,7 +38,7 @@ a = D.sphere((0.5,0.5,0.5),0.1) C._initVars(a,"cellN=2.") C._initVars(a,"Density=0.") -indicesI,XI,YI,ZI = X.getInterpolatedPoints(a,loc='nodes') +indicesI,XI,YI,ZI = X.getInterpolatedPoints(a,loc='nodes') Np = 101; hp = 1./(Np-1) zdnr = G.cart((0.,0.,0.),(hp,hp,hp),(Np,Np,Np)) diff --git a/Cassiopee/Converter/Converter/Array3D.py b/Cassiopee/Converter/Converter/Array3D.py index 4ebedcd8b..274ae4f70 100644 --- a/Cassiopee/Converter/Converter/Array3D.py +++ b/Cassiopee/Converter/Converter/Array3D.py @@ -53,4 +53,3 @@ def convertArray3D2Array(var, Var): V[n,:] = VV[:] CArray = [v, V, Shape0[0], Shape0[1], Shape0[2]] return CArray - diff --git a/Cassiopee/Converter/Converter/Check.py b/Cassiopee/Converter/Converter/Check.py index ac8dc220f..f687e528c 100644 --- a/Cassiopee/Converter/Converter/Check.py +++ b/Cassiopee/Converter/Converter/Check.py @@ -99,7 +99,7 @@ # IN: level: check level 0 (version node), 1 (node conformity), # 2 (unique base name), 3 (unique zone name), 4 (unique BC name), # 5 (BC ranges), 6 (BCMatch/NearMatch), 7 (FamilyZone et FamilyBCs), -# 8 (invalid CGNS Types), 9 (invalid connectivity), +# 8 (invalid CGNS Types), 9 (invalid connectivity), # 10 (invalid field names), 11 NAN in fields, 12 name length # if level=-n, perform check from 0 to n # OUT: error = [noeud posant probleme, message] @@ -272,7 +272,7 @@ def _correctVersionNode(t): if n[3] == 'CGNSLibraryVersion_t' and id(n) == id(node): del t[2][c]; break c += 1 - if added == 0: t[2].insert(0, node); added = 1 + if added == 0: t[2].insert(0, node); added = 1 return None #============================================================================== @@ -339,7 +339,7 @@ def _correctNodes(t): return None #============================================================================== -# Check name length +# Check name length # Check if node[0] has less than 32 chars (legacy constraint for cgnsview) #============================================================================== def checkNameLength(node): @@ -354,7 +354,7 @@ def checkNameLength(node): #============================================================================== def checkNameLength__(node, parent, errors): sons = [] - if len(node[0]) > 32: + if len(node[0]) > 32: errors += [node, parent, "Node name %s has a length > 32."%node[0]] for n in sons: checkNameLength__(n, node, errors) @@ -369,19 +369,19 @@ def _correctNameLength(t): node = errors[3*e] parent = errors[3*e+1] name = node[0] - if node[3] == 'Zone_t': + if node[3] == 'Zone_t': newName = name[0:31] newName = C.getZoneName(newName) if len(newName) > 32: newName = newName[0:32] node[0] = newName Internal._renameNode(t, name, newName) - elif node[3] == 'BC_t': + elif node[3] == 'BC_t': newName = name[0:31] newName = C.getBCName(newName) if len(newName) > 32: newName = newName[0:32] node[0] = newName Internal._renameNode(t, name, newName) - elif node[3] == 'CGNSBase_t': + elif node[3] == 'CGNSBase_t': newName = name[0:31] newName = C.getBaseName(newName) if len(newName) > 32: newName = newName[0:32] @@ -737,7 +737,7 @@ def checkOppositRanges(t, ntype): dim = Internal.getZoneDim(zdonor) error = 1 for nopp in nodesopp: - if n is not nopp: + if n is not nopp: prangeopp = Internal.getNodesFromName1(nopp, 'PointRange') prangedonoropp = Internal.getNodesFromName2(nopp, 'PointRangeDonor') # NearMatch: necessaire d'aller au niveau 2 mtypeopp = Internal.getNodeFromName1(nopp, 'GridConnectivityType') @@ -746,11 +746,11 @@ def checkOppositRanges(t, ntype): zoppdonorname = Internal.getValue(nopp) if zoppdonorname == zname and mtype == mtypeopp: # current zone - rangez = Internal.range2Window(prange[0][1]) + rangez = Internal.range2Window(prange[0][1]) rangezd = Internal.range2Window(prangedonor[0][1]) # donor zone - rangezopp = Internal.range2Window(prangeopp[0][1]) - rangezoppd = Internal.range2Window(prangedonoropp[0][1]) + rangezopp = Internal.range2Window(prangeopp[0][1]) + rangezoppd = Internal.range2Window(prangedonoropp[0][1]) if rangez == rangezoppd and rangezd == rangezopp: error = 0 if error == 1: errors += [n, bc, "Opposite window from zone %s of BC %s (zone %s) does not exist."%(zdonorname,n[0],zname)] @@ -793,13 +793,13 @@ def checkOppositRanges(t, ntype): if dimZone > 1: deltaopp[1] = abs(winopp[3] - winopp[2]) # delta j for winopp if dimZone == 3: deltaopp[2] = abs(winopp[5] - winopp[4]) # delta k for winopp if dimZone == 3: - if ((delta[0] != deltaopp[abs(transform[0])-1]) or + if ((delta[0] != deltaopp[abs(transform[0])-1]) or (delta[1] != deltaopp[abs(transform[1])-1]) or - (delta[2] != deltaopp[abs(transform[2])-1])): + (delta[2] != deltaopp[abs(transform[2])-1])): errors += [n, bc, "window of BC %s for zone %s does not match with its opposite window."%(n[0],z[0])] elif dimZone == 2: - if ((delta[0] != deltaopp[abs(transform[0])-1]) or - (delta[1] != deltaopp[abs(transform[1])-1])): + if ((delta[0] != deltaopp[abs(transform[0])-1]) or + (delta[1] != deltaopp[abs(transform[1])-1])): errors += [n, bc, "window of BC %s for zone %s does not match with its opposite window."%(n[0],z[0])] elif dimZone == 1: @@ -808,7 +808,7 @@ def checkOppositRanges(t, ntype): return errors #============================================================================== -# Efface les GCs qui n'ont pas de donneur existant +# Efface les GCs qui n'ont pas de donneur existant # qui ont des ranges non coherents # dont le donneur n'a pas le noeud reciproque #============================================================================== @@ -905,12 +905,12 @@ def checkBaseZonesDim(t): zones = Internal.getNodesFromType1(b, 'Zone_t') for z in zones: dim = Internal.getZoneDim(z) - if dim[4] != dimBase: errors += [b, b, "Zone %s cellDim (%d) is inconsistent with base %s cellDim (%d)."%(z[0],dim[4],b[0],dimBase)] + if dim[4] != dimBase: errors += [b, b, "Zone %s cellDim (%d) is inconsistent with base %s cellDim (%d)."%(z[0],dim[4],b[0],dimBase)] return errors #============================================================================== # Update all bases with the max dim found in their zones -# if splitBases: enforce bases to have homogenous cellDims by splitting base +# if splitBases: enforce bases to have homogenous cellDims by splitting base #============================================================================== def _correctBaseZonesDim(t, splitBases=False): bases = Internal.getBases(t) @@ -940,7 +940,7 @@ def _correctBaseZonesDim(t, splitBases=False): listOfAddBases.append([1, b[0]+'.1', z1]) if lz2 != 0: listOfAddBases.append([2, b[0]+'.2', z2]) - if lz3 != 0: + if lz3 != 0: listOfAddBases.append([3, b[0]+'.3', z3]) if splitBases: @@ -955,7 +955,7 @@ def _correctBaseZonesDim(t, splitBases=False): return None #=============================================================================== -# check if the PointRanges for a zone z (ZoneBC ou ZoneGridConnectivity) are +# check if the PointRanges for a zone z (ZoneBC ou ZoneGridConnectivity) are # compatible with multigrid #=============================================================================== def checkMGForBCRanges(z, ntype, multigrid, sizemin): @@ -987,7 +987,7 @@ def checkMGForBCRanges(z, ntype, multigrid, sizemin): return errors #=============================================================================== -# check if the PointRangeDonor for a zone z (ZoneBC ou ZoneGridConnectivity) +# check if the PointRangeDonor for a zone z (ZoneBC ou ZoneGridConnectivity) # are compatible with multigrid #=============================================================================== def checkMGForDonorBCRanges(z, ntype, multigrid, sizemin): @@ -1001,14 +1001,14 @@ def checkMGForDonorBCRanges(z, ntype, multigrid, sizemin): if imin != imax: di = (imax-imin) res = (di+1)/puiss - if di%puiss != 0: + if di%puiss != 0: errors+=[n,"PointRangeDonor for GC %s of zone %s is not multigrid of level %d in direction i."%(n[0],z[0],multigrid)] elif res < sizemin: errors+=[n,"PointRangeDonor for GC %s of zone %s: not enough points on coarse grid in direction i."%(n[0],z[0])] if jmin != jmax: dj = (jmax-jmin) res = (dj+1)/puiss - if dj%puiss != 0: + if dj%puiss != 0: errors+=[n,"PointRangeDonor for GC %s of zone %s is not multigrid of level %d in direction j."%(n[0],z[0],multigrid)] elif res < sizemin: errors+=[n,"PointRangeDonor for GC %s of zone %s: not enough points on coarse grid in direction j."%(n[0],z[0])] @@ -1036,7 +1036,7 @@ def checkMultigrid(t, level=1, nbMinCoarseB=5, nbMinCoarseW=3): if dims[0] == 'Structured': ni = dims[1]; nj = dims[2]; nk = dims[3] res = (ni-1)/puiss - if (ni-1)%puiss != 0: + if (ni-1)%puiss != 0: errors+=[z,"Zone %s is not multigrid of level %d in direction i."%(z[0],level)] elif res < nbMinCoarseB: errors+=[z,"Zone %s: not enough points on coarse grid for level %d in direction i."%(z[0],level)] @@ -1052,10 +1052,10 @@ def checkMultigrid(t, level=1, nbMinCoarseB=5, nbMinCoarseW=3): # check BC ranges (receptors) errors += checkMGForBCRanges(z,'BC_t',level,nbMinCoarseW) errors += checkMGForBCRanges(z,'GridConnectivity1to1_t',level,nbMinCoarseW) - errors += checkMGForBCRanges(z,'GridConnectivity_t',level,nbMinCoarseW) + errors += checkMGForBCRanges(z,'GridConnectivity_t',level,nbMinCoarseW) # check BC ranges (donors) errors += checkMGForDonorBCRanges(z,'GridConnectivity1to1_t',level,nbMinCoarseW) - errors += checkMGForDonorBCRanges(z,'GridConnectivity_t',level,nbMinCoarseW) + errors += checkMGForDonorBCRanges(z,'GridConnectivity_t',level,nbMinCoarseW) return errors #============================================================================= @@ -1133,7 +1133,7 @@ def checkElementNodes(t): c = Internal.getNodeFromName1(connects[iBE], 'ElementConnectivity') if c[1] is None: print("CheckPyTree: ElementConnectivity is None (may not be loaded).") else: - minv = numpy.min(c[1]); maxv = numpy.max(c[1]) + minv = numpy.min(c[1]); maxv = numpy.max(c[1]) npts = C.getNPts(z) if minv < 1 or maxv > npts: print(z[0], minv, maxv, npts) @@ -1145,7 +1145,7 @@ def checkElementNodes(t): minv = numpy.min(c[1]) if minv < 1: errors += [c, connects[iNFace], 'Negative NFace index'] if iNGon != -1 and iNFace != -1: pass - elif iNGon != -1 and iNFace == -1: + elif iNGon != -1 and iNFace == -1: errors += [z, b, 'NFace is missing for zone %s.'%z[0]] elif iBEMultiple == 1: errors += [z, b, 'Multiple BE connectivity for zone %s.'%z[0]] @@ -1192,7 +1192,7 @@ def _correctBCElementNodes(t): for GE in GEl: itype = GE[1][0] ibc = GE[1][1] - if ibc == 0: + if ibc == 0: if itype >= 3 and itype == 4: maxDim = max(maxDim, 1); minDim = min(minDim, 1) if itype >= 5 and itype <= 9: maxDim = max(maxDim, 2); minDim = min(minDim, 2) if itype >= 10: maxDim = max(maxDim, 3); minDim = min(minDim, 3) @@ -1255,7 +1255,7 @@ def _correctBC_PL2ER(t): return None #=============================================================================== -# Dans un maillage NGON, enleve les connectivites BE +# Dans un maillage NGON, enleve les connectivites BE #=============================================================================== def _cleanBEConnect(t): for z in Internal.getZones(t): @@ -1392,4 +1392,3 @@ def _correctNAN(t): node = errors[3*e] field = errors[3*e+1] C._setNANValuesAt(node, field, 0.) - diff --git a/Cassiopee/Converter/Converter/Converter.py b/Cassiopee/Converter/Converter/Converter.py index 0cfdd092b..f01d8380f 100644 --- a/Cassiopee/Converter/Converter/Converter.py +++ b/Cassiopee/Converter/Converter/Converter.py @@ -20,23 +20,23 @@ if EDOUBLEINT: E_NpyInt = numpy.int64 else: E_NpyInt = numpy.int32 -__all__ = ['array', 'getApi', 'addVars', '_addVars', 'addVars2', - 'center2ExtCenter', 'center2Node', 'conformizeNGon', - 'convertArray2Hexa', 'convertArray2NGon', 'convertArray2Node', - 'convertArray2Tetra', 'convertBAR2Struct', 'convertTri2Quad', - 'convertStrand2Penta', 'convertPenta2Strand', - 'convertArrays2File', 'convertFile2Arrays', 'copy', - 'createGlobalHook', 'createHook', - 'createGlobalIndex', '_createGlobalIndex', 'recoverGlobalIndex', '_recoverGlobalIndex', - 'createSockets', 'diffArrays', 'diffArrayGeom', 'isFinite', 'setNANValuesAt', 'extCenter2Node', - 'extractVars', 'getIndexField', - 'freeHook', 'getArgMax', 'getArgMin', 'getMaxValue', 'getMeanRangeValue', 'getMeanValue', 'getMinValue', - 'getNCells', 'getNPts', 'getValue', 'getVarNames', 'identifyElements', 'identifyFaces', 'identifyNodes', - 'identifySolutions', 'initVars', '_initVars', 'isNamePresent', 'listen', 'magnitude', - 'nearestElements', 'nearestFaces', 'nearestNodes', 'node2Center', 'node2ExtCenter', 'normL0', 'normL2', - 'normalize', '_normalize', 'randomizeVar', 'rmVars', 'send', 'setPartialFields', 'setValue', 'addGhostCellsNGon', - 'checkFileType', 'convertHO2LO', 'convertLO2HO', 'convertExt2Format__', 'mergeConnectivity', - '_signNGonFaces', '_unsignNGonFaces', 'makeParentElements'] +__all__ = ['array', 'getApi', 'addVars', '_addVars', 'addVars2', + 'center2ExtCenter', 'center2Node', 'conformizeNGon', + 'convertArray2Hexa', 'convertArray2NGon', 'convertArray2Node', + 'convertArray2Tetra', 'convertBAR2Struct', 'convertTri2Quad', + 'convertStrand2Penta', 'convertPenta2Strand', + 'convertArrays2File', 'convertFile2Arrays', 'copy', + 'createGlobalHook', 'createHook', + 'createGlobalIndex', '_createGlobalIndex', 'recoverGlobalIndex', '_recoverGlobalIndex', + 'createSockets', 'diffArrays', 'diffArrayGeom', 'isFinite', 'setNANValuesAt', 'extCenter2Node', + 'extractVars', 'getIndexField', + 'freeHook', 'getArgMax', 'getArgMin', 'getMaxValue', 'getMeanRangeValue', 'getMeanValue', 'getMinValue', + 'getNCells', 'getNPts', 'getValue', 'getVarNames', 'identifyElements', 'identifyFaces', 'identifyNodes', + 'identifySolutions', 'initVars', '_initVars', 'isNamePresent', 'listen', 'magnitude', + 'nearestElements', 'nearestFaces', 'nearestNodes', 'node2Center', 'node2ExtCenter', 'normL0', 'normL2', + 'normalize', '_normalize', 'randomizeVar', 'rmVars', 'send', 'setPartialFields', 'setValue', 'addGhostCellsNGon', + 'checkFileType', 'convertHO2LO', 'convertLO2HO', 'convertExt2Format__', 'mergeConnectivity', + '_signNGonFaces', '_unsignNGonFaces', 'makeParentElements'] # -- Create an array -- # Les champs sont mis a zero, sauf si pour les champs cellN et cellNF @@ -49,7 +49,7 @@ def array(vars, n1, n2, sub, api=1): else: return arrayS(vars, n1, n2, sub, api) -# -- Create a structured array -- +# -- Create a structured array -- def arrayS(vars, ni, nj, nk, api=1): """Create a structured array. Usage: array(vars, ni, nj, nk)""" @@ -105,7 +105,7 @@ def arrayNS(vars, npoints, nelts, eltType, api=1): for i in range(v): if vl[i] == 'cellN' or vl[i] == 'cellNF': a.append(numpy.ones((nelts), numpy.float64)) - else: + else: a.append(numpy.zeros((nelts), numpy.float64)) else: if api == 1: @@ -117,7 +117,7 @@ def arrayNS(vars, npoints, nelts, eltType, api=1): for i in range(v): if vl[i] == 'cellN' or vl[i] == 'cellNF': a.append(numpy.ones((npoints), numpy.float64)) - else: + else: a.append(numpy.zeros((npoints), numpy.float64)) if api == 1: c = numpy.ones((nt, nelts), E_NpyInt) @@ -173,7 +173,7 @@ def getNPts__(a): if len(a) == 5: # structure npts = a[2]*a[3]*a[4] elif len(a) == 4: # non structure - if a[3][-1] != '*': + if a[3][-1] != '*': if isinstance(a[1], list): npts = a[1][0].size else: npts = a[1].shape[1] else: npts = 0 # don't know @@ -361,7 +361,7 @@ def _addVars__(a, varNames): s = a[1].shape[1] nfld = a[1].shape[0] n = numpy.zeros((nfld+lg, s), dtype=numpy.float64) - for i in range(nfld): n[i,:] = a[1][i,:] + for i in range(nfld): n[i,:] = a[1][i,:] a[1] = n return None @@ -781,16 +781,16 @@ def convertFile2Arrays(fileName, format=None, nptsCurve=20, nptsLine=2, if isinstance(a[0], list): for i in a: if len(i) == 4: - if isinstance(i[2], list): # array2/3 - for c, k in enumerate(i[2]): - if k.dtype != E_NpyInt: i[2][c] = k.astype(E_NpyInt, order='K') + if isinstance(i[2], list): # array2/3 + for c, k in enumerate(i[2]): + if k.dtype != E_NpyInt: i[2][c] = k.astype(E_NpyInt, order='K') else: # array1 if i[2].dtype != E_NpyInt: i[2] = i[2].astype(E_NpyInt, order='K') else: if len(a) == 4: - if isinstance(a[2], list): # array2/3 - for c, k in enumerate(a[2]): - if k.dtype != E_NpyInt: a[2][c] = k.astype(E_NpyInt, order='K') + if isinstance(a[2], list): # array2/3 + for c, k in enumerate(a[2]): + if k.dtype != E_NpyInt: a[2][c] = k.astype(E_NpyInt, order='K') else: # array1 if a[2].dtype != E_NpyInt: a[2] = a[2].astype(E_NpyInt, order='K') @@ -802,7 +802,7 @@ def convertFile2Arrays(fileName, format=None, nptsCurve=20, nptsLine=2, a = OCC.convertCAD2Arrays(fileName, format=format, h=hmax, chordal_err=hausd, growth_ratio=grow, merge_tol=mergeTol, algo=occAlgo) - if zoneNames is not None: + if zoneNames is not None: for c in range(len(a)): zoneNames.append('zone%d'%c) return a elif format == 'fmt_free': @@ -847,16 +847,16 @@ def convertFile2Arrays(fileName, format=None, nptsCurve=20, nptsLine=2, return converter.convertFile2Arrays(fileName, format, nptsCurve, nptsLine, density, zoneNames, BCFaces, centerArrays, api) except: FORMATS = ['bin_ply', 'fmt_tp', 'fmt_v3d', - 'bin_tp', 'bin_v3d', 'bin_vtk', 'fmt_mesh', - 'fmt_gmsh', 'bin_gmsh', 'fmt_stl', - 'bin_stl', 'bin_gltf', - 'fmt_xfig', 'fmt_svg', 'bin_3ds', - 'fmt_obj', 'fmt_gts' , 'fmt_pov', 'bin_arc'] + 'bin_tp', 'bin_v3d', 'bin_vtk', 'fmt_mesh', + 'fmt_gmsh', 'bin_gmsh', 'fmt_stl', + 'bin_stl', 'bin_gltf', + 'fmt_xfig', 'fmt_svg', 'bin_3ds', + 'fmt_obj', 'fmt_gts' , 'fmt_pov', 'bin_arc'] for fmt in FORMATS: try: a = converter.convertFile2Arrays(fileName, fmt, nptsCurve, nptsLine, density, zoneNames, BCFaces, BCFields, centerArrays, api) return a - except: + except: return converter.convertFile2Arrays(fileName, format, nptsCurve, nptsLine, density, zoneNames, BCFaces, BCFields, centerArrays, api) def convertArrays2File(arrays, fileName, format=None, isize=4, rsize=8, @@ -911,7 +911,7 @@ def diffArrays(arrays1, arrays2, arrays3=[]): def diffArrayGeom(array1, array2, tol=1.e-10): """Diff arrays defining solutions, geometrically. Return the delta field.""" - if isinstance(array1[0], list): + if isinstance(array1[0], list): ret = [] for c, a in enumerate(array1): res = diffArrayGeom__(a, array2[c], tol) @@ -980,7 +980,7 @@ def _setNANValuesAt__(a, var=None, value=0.): for c, v in enumerate(vars): if var is None or v == var: ptr = a[1][c] - ptr = ptr.ravel(order="K") + ptr = ptr.ravel(order="K") converter.setNANValuesAt(ptr, value) return None @@ -1306,7 +1306,7 @@ def convertArray2Tetra1__(array, arrayC=[], split='simple'): elif t == 'NGON': if arrayC == []: return converter.convertNGon2TetraBary(array) - else: + else: return converter.convertNGon2TetraBaryBoth(array, arrayC) elif t == 'HEXA*' or t == 'PENTA*' or t == 'PYRA*' or t == 'BAR*': tmp = center2Node(array) @@ -1327,7 +1327,7 @@ def convertArray2Tetra(array, split='simple'): if isinstance(array[0], list): b = [] for i in array: - b.append(convertArray2Tetra1__(i, split=split)) + b.append(convertArray2Tetra1__(i, split=split)) return b else: return convertArray2Tetra1__(array, split=split) @@ -1625,9 +1625,9 @@ def freeHook(hook): """Free hook. Usage: freeHook(hook)""" if isinstance(hook, list): - for i in hook: + for i in hook: if i is not None: converter.freeHook(i) - else: + else: if hook is not None: converter.freeHook(hook) #============================================================================== @@ -1788,7 +1788,7 @@ def mergeConnectivity(a1, a2): # connectivity c1 = a1[2]; c2 = a2[2] - for cp in c2: cp[:] = cp[:]+npts + for cp in c2: cp[:] = cp[:]+npts co = c1+c2 return [a1[0], fo, co, a1[3]+','+a2[3]] diff --git a/Cassiopee/Converter/Converter/Distributed.py b/Cassiopee/Converter/Converter/Distributed.py index 425d41605..7d5d2612e 100644 --- a/Cassiopee/Converter/Converter/Distributed.py +++ b/Cassiopee/Converter/Converter/Distributed.py @@ -18,17 +18,17 @@ # Lit un arbre squelette # Warning: pour l'instant limite a hdf et adf #============================================================================== -def convertFile2SkeletonTree(fileName, format=None, maxFloatSize=5, +def convertFile2SkeletonTree(fileName, format=None, maxFloatSize=5, maxDepth=-1, dataShape=None, links=None): """Read a file and return a skeleton tree.""" return PyTree.convertFile2PyTree( - fileName, format, skeletonData=[maxFloatSize,maxDepth], + fileName, format, skeletonData=[maxFloatSize,maxDepth], dataShape=dataShape, links=links) #============================================================================== # Lit seulement un noeud de l'arbre ou ses enfants (suivant maxDepth) #============================================================================== -def readNodesFromPaths(fileName, paths, format=None, maxFloatSize=-1, maxDepth=-1, +def readNodesFromPaths(fileName, paths, format=None, maxFloatSize=-1, maxDepth=-1, dataShape=None, skipTypes=None, com=None): """Read nodes from file given their paths.""" if format is None: format = Converter.convertExt2Format__(fileName) @@ -40,20 +40,20 @@ def readNodesFromPaths(fileName, paths, format=None, maxFloatSize=-1, maxDepth=- ret = Converter.converter.readPyTreeFromPaths(fileName, p, format, maxFloatSize, maxDepth, 0, dataShape, skipTypes, com) if not isinstance(paths, list): return ret[0] - else: return ret + else: return ret #============================================================================== # Lit un noeud de l'arbre ou ses enfants (suivant maxDepth) # et complete t #============================================================================== -def readPyTreeFromPaths(t, fileName, paths, format=None, maxFloatSize=-1, maxDepth=-1, setOnlyValue=True, +def readPyTreeFromPaths(t, fileName, paths, format=None, maxFloatSize=-1, maxDepth=-1, setOnlyValue=True, dataShape=None, skipTypes=None, com=None): """Read nodes from file given their path and complete t.""" tp = Internal.copyRef(t) _readPyTreeFromPaths(tp, fileName, paths, format, maxFloatSize, maxDepth, setOnlyValue, dataShape, skipTypes, com) return tp -def _readPyTreeFromPaths(t, fileName, paths, format=None, maxFloatSize=-1, maxDepth=-1, setOnlyValue=True, +def _readPyTreeFromPaths(t, fileName, paths, format=None, maxFloatSize=-1, maxDepth=-1, setOnlyValue=True, dataShape=None, skipTypes=None, com=None): nodes = readNodesFromPaths(fileName, paths, format, maxFloatSize, maxDepth, dataShape, skipTypes, com) if not isinstance(paths, list): nodes = [nodes]; paths = [paths] @@ -101,7 +101,7 @@ def writePyTreeFromPaths(t, fileName, paths, format=None, maxDepth=-1): opaths = [] for p in paths: n = Internal.getNodeFromPath(t, p) - if n is not None: + if n is not None: nodes.append(n) opaths.append(p.rsplit('/',1)[0]) else: print('Warning: write: path %s not found.'%p) @@ -209,7 +209,7 @@ def _convert2PartialTree(t, rank=-1): else: proc = Internal.getNodeFromName2(z, 'proc') if proc is not None: - proc = Internal.getValue(proc) + proc = Internal.getValue(proc) crit = (rank != proc) if crit: # Supprime entierement la zone @@ -271,7 +271,7 @@ def _readZones(t, fileName, format=None, rank=None, zoneNames=None): loadedZones = Converter.converter.readPyTreeFromPaths(fileName, paths, format, -1, -1, 0, None, None, None) import Compressor.PyTree as Compressor - for z in loadedZones: + for z in loadedZones: Compressor._uncompressCartesian(z) Compressor._uncompressAll(z) @@ -383,11 +383,11 @@ def _setZonesInTree(t, zones): (p, nb) = Internal.getParentOfNode(base, z) p[2][nb] = zone else: - base[2].append(zone) + base[2].append(zone) else: base = Internal.newCGNSBase(baseName, parent=t) base[2].append(zone) - else: + else: z = Internal.getNodeFromName2(t, zoneName) if z is not None: (p, nb) = Internal.getParentOfNode(t, z) @@ -425,7 +425,7 @@ def mergeGraph(graph1, graph2): if zname not in graph[proc][popp]: graph[proc][popp].append(zname) else: graph[proc][popp] = graph2[proc][popp] - else: + else: graph[proc] = graph2[proc] return graph @@ -473,11 +473,11 @@ def getProcGlobal__(zoneName, t, procDict=None): # type='IBCD' si donnees IBC entres zones (full/skel/load skel/partial+procDict) # type='ALLD' si toutes donnees (Interp+IBC) (full/skel/load skel/partial+procDict) # type='proc' si la zone a un noeud proc different du proc courant (full/skel/load skel/partial) -# type='POST': t donor tree and t2 receptor tree. To interpolate data from donor to receptor where interpolation +# type='POST': t donor tree and t2 receptor tree. To interpolate data from donor to receptor where interpolation # data is stored in t in ID* subregions nodes. Requires procDict and procDict2 -# intersectionsDict: dictionnaire Python contenant la liste de zones intersectantes, +# intersectionsDict: dictionnaire Python contenant la liste de zones intersectantes, # comme produit par "X.getIntersectingDomains". Attention, si type='bbox3', -# l'utilisateur doit fournir l'arbre t2 et intersectionDict doit decrire les +# l'utilisateur doit fournir l'arbre t2 et intersectionDict doit decrire les # intersections entre t et t2, comme produit par "X.getIntersectingDomains(t,t2)". # exploc: True si explicite local # OUT: graph: dictionnaire contenant des informations d'envoie @@ -498,20 +498,20 @@ def computeGraph(t, type='bbox', t2=None, procDict=None, rank=0, if not intersectionsDict: try: import Connector.PyTree as X except: raise ImportError("computeGraph: requires Connector module.") - intersectionsDict = X.getIntersectingDomains(t) + intersectionsDict = X.getIntersectingDomains(t) for z in zones: proc = getProcLocal__(z, procDict) for z2 in zones: if z2[0] in intersectionsDict and z[0] in intersectionsDict[z2[0]]: - popp = getProcGlobal__(z2[0], t, procDict) + popp = getProcGlobal__(z2[0], t, procDict) updateGraph__(graph, proc, popp, z[0]) - #import Connector.PyTree as X - #for z in zones: - # proc = getProcLocal__(z, procDict) - # doms = X.getBBIntersectingDomains(t, z, tol=1.e-12) - # for d in doms: - # popp = getProcGlobal__(d[0], t, procDict) - # updateGraph__(graph, proc, popp, z[0]) + #import Connector.PyTree as X + #for z in zones: + # proc = getProcLocal__(z, procDict) + # doms = X.getBBIntersectingDomains(t, z, tol=1.e-12) + # for d in doms: + # popp = getProcGlobal__(d[0], t, procDict) + # updateGraph__(graph, proc, popp, z[0]) elif type == 'bbox2': # zone de t de P0 qui intersecte une zone de t de P1 mais qui n'est pas sur la meme base if not intersectionsDict: @@ -526,7 +526,7 @@ def computeGraph(t, type='bbox', t2=None, procDict=None, rank=0, if z2[0] in intersectionsDict and z[0] in intersectionsDict[z2[0]]: (p, c) = Internal.getParentOfNode(t, z2) based = p[0] - popp = getProcGlobal__(z2[0], t, procDict) + popp = getProcGlobal__(z2[0], t, procDict) if popp != proc and base != based: if proc not in graph: graph[proc] = {popp:[z[0]]} else: @@ -543,7 +543,7 @@ def computeGraph(t, type='bbox', t2=None, procDict=None, rank=0, # for d in doms: # (p, c) = Internal.getParentOfNode(t, d) # based = p[0] - # popp = getProcGlobal__(d[0], t, procDict) + # popp = getProcGlobal__(d[0], t, procDict) # if (popp != proc and base != based): # if proc not in graph: graph[proc] = {popp:[z[0]]} # else: @@ -674,25 +674,25 @@ def computeGraph(t, type='bbox', t2=None, procDict=None, rank=0, cycl = nssiter//levdnr if levdnr > levrcv and ssiter <= nssiter: - if ssiter%cycl==cycl-1 or ssiter%cycl==cycl//2 and (ssiter//cycl)%2==1: + if ssiter%cycl==cycl-1 or ssiter%cycl==cycl//2 and (ssiter//cycl)%2==1: if idn != []: # la subRegion decrit des interpolations popp = getProcGlobal__(donor, t, procDict) - updateGraph__(graph_, proc, popp, z[0]) + updateGraph__(graph_, proc, popp, z[0]) if levdnr < levrcv and ssiter <= nssiter: - if (ssiter%cycl==1 or ssiter%cycl==cycl//4 or ssiter%cycl==cycl//2-1 or ssiter%cycl==cycl//2+1 or ssiter%cycl==cycl//2+cycl//4 or ssiter%cycl==cycl-1): + if (ssiter%cycl==1 or ssiter%cycl==cycl//4 or ssiter%cycl==cycl//2-1 or ssiter%cycl==cycl//2+1 or ssiter%cycl==cycl//2+cycl//4 or ssiter%cycl==cycl-1): if idn != []: # la subRegion decrit des interpolations popp = getProcGlobal__(donor, t, procDict) - updateGraph__(graph_, proc, popp, z[0]) + updateGraph__(graph_, proc, popp, z[0]) if levdnr == levrcv and ssiter <= nssiter: if (ssiter%cycl==cycl//2-1 or (ssiter%cycl==cycl//2 and (ssiter//cycl)%2==0) or ssiter%cycl==cycl-1): - #print(donor, ssiter) + #print(donor, ssiter) if idn != []: # la subRegion decrit des interpolations popp = getProcGlobal__(donor, t, procDict) updateGraph__(graph_, proc, popp, z[0]) if levdnr == levrcv and ssiter > nssiter: ssiter_ = ssiter - nssiter if ssiter_%cycl==cycl//2 and (ssiter_//cycl)%2==1: - #if ssiter_%2==0 and ssiter_%cycl==cycl/2 and (ssiter_//cycl)%2==1: + #if ssiter_%2==0 and ssiter_%cycl==cycl/2 and (ssiter_//cycl)%2==1: if idn != []: # la subRegion decrit des interpolations popp = getProcGlobal__(donor, t, procDict) updateGraph__(graph_, proc, popp, z[0]) @@ -712,7 +712,7 @@ def computeGraph(t, type='bbox', t2=None, procDict=None, rank=0, idn = Internal.getNodesFromName1(s,'InterpolantsDonor') if idn != []: # la subRegion decrit des IBC popp = getProcGlobal__(donor, t, procDict) - updateGraph__(graph, proc, popp, z[0]) + updateGraph__(graph, proc, popp, z[0]) else: @@ -748,22 +748,22 @@ def computeGraph(t, type='bbox', t2=None, procDict=None, rank=0, idn = Internal.getNodesFromName1(s,'InterpolantsDonor') cycl = nssiter//levdnr if levdnr > levrcv and ssiter <= nssiter: - if ssiter%cycl==cycl-1 or ssiter%cycl==cycl//2 and (ssiter//cycl)%2==1: + if ssiter%cycl==cycl-1 or ssiter%cycl==cycl//2 and (ssiter//cycl)%2==1: if idn != []: # la subRegion decrit des interpolations popp = getProcGlobal__(donor, t, procDict) - updateGraph__(graph_, proc, popp, z[0]) + updateGraph__(graph_, proc, popp, z[0]) if levdnr < levrcv and ssiter <= nssiter: - if (ssiter%cycl==1 or ssiter%cycl==cycl//4 or ssiter%cycl==cycl//2-1 or ssiter%cycl==cycl//2+1 or ssiter%cycl==cycl//2+cycl//4 or ssiter%cycl==cycl-1): + if (ssiter%cycl==1 or ssiter%cycl==cycl//4 or ssiter%cycl==cycl//2-1 or ssiter%cycl==cycl//2+1 or ssiter%cycl==cycl//2+cycl//4 or ssiter%cycl==cycl-1): if idn != []: # la subRegion decrit des interpolations popp = getProcGlobal__(donor, t, procDict) - updateGraph__(graph_, proc, popp, z[0]) + updateGraph__(graph_, proc, popp, z[0]) if levdnr == levrcv and ssiter <= nssiter: - if (ssiter%cycl==cycl//2-1 or (ssiter%cycl==cycl//2 and (ssiter//cycl)%2==0) or ssiter%cycl==cycl-1): + if (ssiter%cycl==cycl//2-1 or (ssiter%cycl==cycl//2 and (ssiter//cycl)%2==0) or ssiter%cycl==cycl-1): if idn != []: # la subRegion decrit des interpolations popp = getProcGlobal__(donor, t, procDict) updateGraph__(graph_, proc, popp, z[0]) if levdnr == levrcv and ssiter > nssiter: - #if (ssiter%8==6): + #if (ssiter%8==6): ssiter_ = ssiter - nssiter if ssiter_%2==0 and ssiter_%cycl==cycl//2 and (ssiter_//cycl)%2==1: if idn != []: # la subRegion decrit des interpolations @@ -803,7 +803,7 @@ def computeGraph(t, type='bbox', t2=None, procDict=None, rank=0, idn = Internal.getNodesFromName1(s,'InterpolantsDonor') if idn != []: # la subRegion decrit des IBC popp = getProcGlobal__(donor, t, procDict) - updateGraph__(graph, proc, popp, z[0]) + updateGraph__(graph, proc, popp, z[0]) else: @@ -839,22 +839,22 @@ def computeGraph(t, type='bbox', t2=None, procDict=None, rank=0, idn = Internal.getNodesFromName1(s,'InterpolantsDonor') cycl = nssiter//levdnr if levdnr > levrcv and ssiter <= nssiter: - if ssiter%cycl==cycl-1 or ssiter%cycl==cycl//2 and (ssiter//cycl)%2==1: + if ssiter%cycl==cycl-1 or ssiter%cycl==cycl//2 and (ssiter//cycl)%2==1: if idn != []: # la subRegion decrit des interpolations popp = getProcGlobal__(donor, t, procDict) - updateGraph__(graph_, proc, popp, z[0]) + updateGraph__(graph_, proc, popp, z[0]) if levdnr < levrcv and ssiter <= nssiter: - if (ssiter%cycl==1 or ssiter%cycl==cycl//4 or ssiter%cycl==cycl//2-1 or ssiter%cycl==cycl//2+1 or ssiter%cycl==cycl//2+cycl//4 or ssiter%cycl==cycl-1): + if (ssiter%cycl==1 or ssiter%cycl==cycl//4 or ssiter%cycl==cycl//2-1 or ssiter%cycl==cycl//2+1 or ssiter%cycl==cycl//2+cycl//4 or ssiter%cycl==cycl-1): if idn != []: # la subRegion decrit des interpolations popp = getProcGlobal__(donor, t, procDict) - updateGraph__(graph_, proc, popp, z[0]) + updateGraph__(graph_, proc, popp, z[0]) if levdnr == levrcv and ssiter <= nssiter: - if (ssiter%cycl==cycl//2-1 or (ssiter%cycl==cycl//2 and (ssiter//cycl)%2==0) or ssiter%cycl==cycl-1): + if (ssiter%cycl==cycl//2-1 or (ssiter%cycl==cycl//2 and (ssiter//cycl)%2==0) or ssiter%cycl==cycl-1): if idn != []: # la subRegion decrit des interpolations popp = getProcGlobal__(donor, t, procDict) updateGraph__(graph_, proc, popp, z[0]) if levdnr == levrcv and ssiter > nssiter: - #if (ssiter%8==6): + #if (ssiter%8==6): ssiter_ = ssiter - nssiter if ssiter_%2==0 and ssiter_%cycl==cycl//2 and (ssiter_//cycl)%2==1: if idn != []: # la subRegion decrit des interpolations @@ -908,7 +908,7 @@ def splitGraph(graph): graphs = [] c = 0; goon = True while goon: - g = {} + g = {} goon = False for p1 in graph: g[p1] = {} diff --git a/Cassiopee/Converter/Converter/Filter.py b/Cassiopee/Converter/Converter/Filter.py index 1e59954c0..5a18d59b0 100644 --- a/Cassiopee/Converter/Converter/Filter.py +++ b/Cassiopee/Converter/Converter/Filter.py @@ -4,7 +4,7 @@ from . import Converter from . import Mpi as Cmpi from .Distributed import convert2PartialTree, _convert2PartialTree, convert2SkeletonTree, _convert2SkeletonTree, convertFile2SkeletonTree, \ - _readPyTreeFromPaths, readPyTreeFromPaths, _readZones, readNodesFromPaths, fixPaths__ + _readPyTreeFromPaths, readPyTreeFromPaths, _readZones, readNodesFromPaths, fixPaths__ from . import Distributed import Compressor.PyTree as Compressor import numpy @@ -199,7 +199,7 @@ def _loadContainerPartial(a, fileName, znp, variablesN=[], variablesC=[], format if dim[2] == 1 and dim[3] == 1: DataSpaceMMRY = [[0], [1], [j[1]-j[0]+1], [1]] DataSpaceFILE = [[j[0]-1], [1], [j[1]-j[0]+1], [1]] - DataSpaceGLOB = [[0]] + DataSpaceGLOB = [[0]] elif dim[3] == 1: DataSpaceMMRY = [[0,0], [1,1], [j[1]-j[0]+1,j[3]-j[2]+1], [1,1]] DataSpaceFILE = [[j[0]-1,j[2]-1], [1,1], [j[1]-j[0]+1,j[3]-j[2]+1], [1,1]] @@ -218,7 +218,7 @@ def _loadContainerPartial(a, fileName, znp, variablesN=[], variablesC=[], format if dim[2] == 1 and dim[3] == 1: DataSpaceMMRYC = [[0], [1], [max(j[1]-j[0],1)], [1]] DataSpaceFILEC = [[j[0]-1,j[2]-1], [1], [max(j[1]-j[0],1)], [1]] - DataSpaceGLOBC = [[0]] + DataSpaceGLOBC = [[0]] elif dim[3] == 1: DataSpaceMMRYC = [[0,0], [1,1], [max(j[1]-j[0],1),max(j[3]-j[2],1)], [1,1]] DataSpaceFILEC = [[j[0]-1,j[2]-1], [1,1], [max(j[1]-j[0],1),max(j[3]-j[2],1)], [1,1]] @@ -263,7 +263,7 @@ def _loadConnectivity(a, fileName, znp, format=None): elts = Internal.getNodesFromType1(z, 'Elements_t') paths = [] for e in elts: paths.append(p+'/'+e[0]) - _readPyTreeFromPaths(a, fileName, paths, format) + _readPyTreeFromPaths(a, fileName, paths, format) return None # force le proc node des zones au processeur courant @@ -289,9 +289,9 @@ def _loadVariables(a, fileName, znp, var, format): s = v.split(':',1) if v[0:10] == 'Coordinate': fvars.append(Internal.__GridCoordinates__+'/'+v); cont = Internal.__GridCoordinates__ - elif len(s) == 2 and s[0] == 'centers': + elif len(s) == 2 and s[0] == 'centers': fvars.append(Internal.__FlowSolutionCenters__+'/'+s[1]); cont = Internal.__FlowSolutionCenters__ - elif len(s) == 2 and s[0] == 'nodes': + elif len(s) == 2 and s[0] == 'nodes': fvars.append(Internal.__FlowSolutionNodes__+'/'+s[1]); cont = Internal.__FlowSolutionNodes__ else: s = v.split('/') @@ -398,7 +398,7 @@ def _loadZoneExtras(a, fileName, znp, format=None): for i in n[2]: if i[3] == 'DataArray_t' and i[1] is None: paths.append(p+'/'+i[0]) - # Level2 + # Level2 # UserDefinedData_t/DataArray_t for i in n[2]: if i[3] == 'UserDefinedData_t': @@ -410,7 +410,7 @@ def _loadZoneExtras(a, fileName, znp, format=None): # for j in i[2]: # if j[3] == 'DataArray_t' and j[1] is None: paths.append(p+'/'+i[0]+'/'+j[0]) - # Level3 + # Level3 # - FlowSolution_t/UserDefinedData_t/DataArray_t # - TimeMotion/TimeRigidMotion_t/DataArray_t for i in n[2]: @@ -573,7 +573,7 @@ def writeZonesWoVars(a, fileName, znp, format=None): for c, z in enumerate(zones): children = z[2] for i in children: - if i[3] != 'FlowSolution_t': + if i[3] != 'FlowSolution_t': nodes.append(i) paths.append(znps[c]) writeNodesFromPaths(fileName, paths, nodes, format, mode=0) @@ -598,7 +598,7 @@ def writeVariables(a, fileName, var, znp, format=None): loc = [] for v in vars: vs = v.split(':',1) - if len(vs) == 2: + if len(vs) == 2: if vs[0] == 'centers': loc.append(Internal.__FlowSolutionCenters__) else: loc.append(Internal.__FlowSolutionNodes__) else: loc.append(Internal.__FlowSolutionNodes__) @@ -606,10 +606,10 @@ def writeVariables(a, fileName, var, znp, format=None): conts = []; cpaths = []; nodes = []; npaths = [] for c, z in enumerate(zones): for i in z[2]: - if i[3] == 'FlowSolution_t': + if i[3] == 'FlowSolution_t': conts.append(i); cpaths.append(znps[c]) for j in i[2]: - if j[3] == 'GridLocation_t': + if j[3] == 'GridLocation_t': conts.append(j); cpaths.append(znps[c]+'/'+i[0]) for d, v in enumerate(vars): ns = PyTree.getStdNodesFromName(z, v) @@ -647,7 +647,7 @@ def getZonePaths(self, a): for z in zones: out.append('/'+b[0]+'/'+z[0]) else: zones = Internal.getZones(a) - for z in zones: + for z in zones: for p in self.znp: r = p.rsplit('/',1)[1] if r == z[0]: out.append(p); break @@ -713,18 +713,18 @@ def loadAndSplitSkeleton(self, NParts=None, NProc=Cmpi.size, splitByBase=False, # Lecture ZoneBC + ZoneGC necessaire pour le split for b in Internal.getBases(a): for z in Internal.getZones(b): - paths = [] - if Internal.getNodeFromName1(z,"ZoneBC") is not None: + paths = [] + if Internal.getNodeFromName1(z,"ZoneBC") is not None: paths.append(b[0]+'/'+z[0]+'/ZoneBC') - if Internal.getNodeFromName1(z,"ZoneGridConnectivity") is not None: + if Internal.getNodeFromName1(z,"ZoneGridConnectivity") is not None: paths.append(b[0]+'/'+z[0]+'/ZoneGridConnectivity') if paths != []: _readPyTreeFromPaths(a, self.fileName, paths) # Lecture des noms de variables varsN = ['%s/CoordinateX'%Internal.__GridCoordinates__, - '%s/CoordinateY'%Internal.__GridCoordinates__, - '%s/CoordinateZ'%Internal.__GridCoordinates__] + '%s/CoordinateY'%Internal.__GridCoordinates__, + '%s/CoordinateZ'%Internal.__GridCoordinates__] varsC = [] for b in Internal.getBases(a): for z in Internal.getZones(b): @@ -749,15 +749,15 @@ def loadAndSplitSkeleton(self, NParts=None, NProc=Cmpi.size, splitByBase=False, if NParts is not None: T._splitNParts(b, N=NParts) else: T._splitNParts(b, N=NProc) if NProc is not None: - import Distributor2.PyTree as D2 + import Distributor2.PyTree as D2 D2._distribute(b, NProc, algorithm=algorithm) else: # split on full skeleton if NParts is not None: T._splitNParts(a, N=NParts) else: T._splitNParts(a, N=NProc) if NProc is not None: - import Distributor2.PyTree as D2 + import Distributor2.PyTree as D2 D2._distribute(a, NProc, algorithm=algorithm) - else: + else: a = None; varsN = None; varsC = None a = Cmpi.bcast(a) self.varsN = Cmpi.bcast(varsN); self.varsC = Cmpi.bcast(varsC) @@ -842,7 +842,7 @@ def loadAndDistribute(self, strategy=None, algorithm='graph', loadVariables=True for z in zones: p = '%s/%s/ZoneType'%(b[0],z[0]) paths.append(p) - _readPyTreeFromPaths(t, self.fileName, paths, self.format) + _readPyTreeFromPaths(t, self.fileName, paths, self.format) # Load les extras de l'arbre (autre que base) self._loadTreeExtras(t) # Distribue @@ -1096,7 +1096,7 @@ def _loadZonesWoVars(self, a, znp=None, bbox=None): Compressor._uncompressAll(a) return None - # Charge toutes les BCs (avec BCDataSet) des zones de a + # Charge toutes les BCs (avec BCDataSet) des zones de a def _loadZoneBCs(self, a, znp=None): if znp is None: znp = self.getZonePaths(a) _loadZoneBCs(a, self.fileName, znp, self.format) @@ -1155,7 +1155,7 @@ def writeZones(self, a, fileName=None, znp=None): def writeZonesWoVars(self, a, fileName=None, znp=None): """Write specified zones without variables.""" if znp is None: znp = self.getZonePaths(a) - if fileName is None: fileName = self.fileName + if fileName is None: fileName = self.fileName writeZonesWoVars(a, fileName, znp, self.format) # Ecrit des variables @@ -1187,4 +1187,3 @@ def mergeAndSave(self, a, fileName=None): # Ecrit les zones partiellement fr = {} writePyTreeFromFilter(a, fileName, fr, skelData=[]) - diff --git a/Cassiopee/Converter/Converter/Filter2.py b/Cassiopee/Converter/Converter/Filter2.py index 7d8511194..e6409c586 100644 --- a/Cassiopee/Converter/Converter/Filter2.py +++ b/Cassiopee/Converter/Converter/Filter2.py @@ -366,7 +366,7 @@ def computeSlabs(array_shape, gnum_interval): ncell_to_load -= this_line_size hslab_list.append(start_line) # print('start_line {0}, loaded {1} elmts\n'.format( - # start_line, start_line[0][1] - start_line[0][0])) + # start_line, start_line[0][1] - start_line[0][0])) #If the plan is full, merged it with the block this_plan_size = min(ny, jstart+(ncell_to_load // nx)) - jstart @@ -377,7 +377,7 @@ def computeSlabs(array_shape, gnum_interval): ncell_to_load -= nx*this_plan_size hslab_list.append(start_plane) # print('start_plane {0}, loaded {1} lines ({2} elmts)\n'.format( - # start_plane, start_plane[1][1] - start_plane[1][0], nx*(start_plane[1][1] - start_plane[1][0]))) + # start_plane, start_plane[1][1] - start_plane[1][0], nx*(start_plane[1][1] - start_plane[1][0]))) this_block_size = min(nz, kstart+(ncell_to_load // plan_size)) - kstart if this_block_size > 0: @@ -385,20 +385,20 @@ def computeSlabs(array_shape, gnum_interval): ncell_to_load -= plan_size*this_block_size hslab_list.append(central_block) # print('central_block {0}, loaded {1} planes ({2} elmts)\n'.format( - # central_block, central_block[2][1] - central_block[2][0], plan_size*(central_block[2][1] - central_block[2][0]))) + # central_block, central_block[2][1] - central_block[2][0], plan_size*(central_block[2][1] - central_block[2][0]))) if ncell_to_load >= nx: end_plane = [[0, nx], [0, (ncell_to_load // nx)], [kmax, kmax+1]] ncell_to_load -= nx*(end_plane[1][1] - end_plane[1][0]) hslab_list.append(end_plane) # print('end_plane {0}, loaded {1} lines ({2} elmts)\n'.format( - # end_plane, end_plane[1][1] - end_plane[1][0], nx*(end_plane[1][1] - end_plane[1][0]))) + # end_plane, end_plane[1][1] - end_plane[1][0], nx*(end_plane[1][1] - end_plane[1][0]))) if ncell_to_load > 0: end_line = [[0, ncell_to_load], [jmax, jmax+1], [kmax, kmax+1]] ncell_to_load -= (end_line[0][1] - end_line[0][0]) hslab_list.append(end_line) # print('end_line {0}, loaded {1} elmts\n'.format( - # end_line, end_line[0][1] - end_line[0][0])) + # end_line, end_line[0][1] - end_line[0][0])) assert(ncell_to_load == 0) return hslab_list @@ -792,14 +792,14 @@ def updateTreeWithPartialLoadDict(dist_tree, partial_dict_load): def loadTreeFromFilter(filename, dist_tree, comm, hdf_filter): # print("load_tree_from_filter") hdf_filter_with_dim = {key: value for (key, value) in hdf_filter.items() \ - if isinstance(value, (list, tuple))} + if isinstance(value, (list, tuple))} partial_dict_load = C.convertFile2PartialPyTreeFromPath(filename, hdf_filter_with_dim, comm) updateTreeWithPartialLoadDict(dist_tree, partial_dict_load) # > Match with callable hdf_filter_with_func = {key: value for (key, value) in hdf_filter.items() \ - if not isinstance(value, (list, tuple))} + if not isinstance(value, (list, tuple))} unlock_at_least_one = True while (len(hdf_filter_with_func) > 0 and unlock_at_least_one): # Update if you can @@ -814,7 +814,7 @@ def loadTreeFromFilter(filename, dist_tree, comm, hdf_filter): partial_dict_load = C.convertFile2PartialPyTreeFromPath(filename, next_hdf_filter, comm) updateTreeWithPartialLoadDict(dist_tree, partial_dict_load) hdf_filter_with_func = {key: value for (key, value) in next_hdf_filter.items() \ - if not isinstance(value, (list, tuple))} + if not isinstance(value, (list, tuple))} if unlock_at_least_one is False: raise RuntimeError("Something strange in the loading process") @@ -832,7 +832,7 @@ def cleanDistributionInfo(dist_tree): I._rmNodesByName2(bc, 'PointList#Size') for zone_gc in I.getNodesFromType1(zone, 'ZoneGridConnectivity_t'): for gc in I.getNodesFromType1(zone_gc, 'GridConnectivity_t') + \ - I.getNodesFromType1(zone_gc, 'GridConnectivity1to1_t'): + I.getNodesFromType1(zone_gc, 'GridConnectivity1to1_t'): I._rmNodesByName1(gc, ':CGNS#Distribution') I._rmNodesByName1(gc, 'PointList#Size') for zone_subregion in I.getNodesFromType1(zone, 'ZoneSubRegion_t'): @@ -893,15 +893,15 @@ def chunk2part(dt): solc = []; solcNames = [] if fsolc is not None: for f in fsolc[2]: - if f[3] == 'DataArray_t': - solc.append(f[1]); solcNames.append(f[0]) + if f[3] == 'DataArray_t': + solc.append(f[1]); solcNames.append(f[0]) fsol = I.getNodeFromName2(z, I.__FlowSolutionNodes__) soln = []; solNames = [] if fsol is not None: for f in fsol[2]: - if f[3] == 'DataArray_t': - soln.append(f[1]); solNames.append(f[0]) + if f[3] == 'DataArray_t': + soln.append(f[1]); solNames.append(f[0]) zonebc = I.getNodeFromType(z, 'ZoneBC_t') bcs = [] diff --git a/Cassiopee/Converter/Converter/GhostCells.py b/Cassiopee/Converter/Converter/GhostCells.py index d02ca088d..a66887fca 100644 --- a/Cassiopee/Converter/Converter/GhostCells.py +++ b/Cassiopee/Converter/Converter/GhostCells.py @@ -19,14 +19,14 @@ # IN: b: tree/basis/zone to modify (defined in t) # IN: d: number of ghost cells to add # IN: modified: container names or the list of variables to be modified -# If modified != all: only the provided field is filled with ghost cells -# -> flow field and zone dimensions are not consistent -# +# If modified != all: only the provided field is filled with ghost cells +# -> flow field and zone dimensions are not consistent +# # adaptBCs = 0: BCs are not modified -# = 1: Physical BCs/BCMatch/BCOverlap ranges are modified +# = 1: Physical BCs/BCMatch/BCOverlap ranges are modified # BCMatch ranges are not relevant geometrically (graphically) -# fillCorner : method to fill edges and corners -# = 1: edges and corners are filled (grid coordinates+flow solution) according to +# fillCorner : method to fill edges and corners +# = 1: edges and corners are filled (grid coordinates+flow solution) according to # the grid connectivity -> geometrically, the corners and edges can be wrong # = 0: neighbouring vectors are extrapolated to build edge cells, no filling with flow field # fillCorner = 1 : non implemented for nearmatch @@ -60,9 +60,9 @@ def _addGhostCells(t, b, d, adaptBCs=0, modified=[], fillCorner=1): # --------- # - fill corner ghost cells for join border (using opposite ghost grid) # ========================================================================= - # In first loop, a dictionary dictjoins is built: + # In first loop, a dictionary dictjoins is built: # it contains the valid zones and the name of the related donor zones - # the corresponding list of valid connectivities is defined by 'validjoins' + # the corresponding list of valid connectivities is defined by 'validjoins' # This dictionary will be used in second loop validjoins = []; dictjoins = {}; indexjoin = 0 @@ -76,7 +76,7 @@ def _addGhostCells(t, b, d, adaptBCs=0, modified=[], fillCorner=1): # CB #isghost[c] = _addGhostCellsNGON__(zp, b, d, isghost[c], stdNode, modified) pass - else: + else: #print('Warning: addGhostCells: not yet implemented for BE.') pass # other elt types else : # Structured @@ -89,7 +89,7 @@ def _addGhostCells(t, b, d, adaptBCs=0, modified=[], fillCorner=1): # en presence de points triples notamment # les champs sont remplis #--------------------------------------------------------------------------- - if fillCorner == 1: + if fillCorner == 1: # Second loop only for joins (deals with ghost cells corner) _fillGhostCellCorners__(b, modified, d, validjoins, dictjoins, loop=2) # Third loop only for joins (deals with last ghost cells corner) @@ -105,7 +105,7 @@ def _addGhostCells(t, b, d, adaptBCs=0, modified=[], fillCorner=1): #------------------------------- # put ghost dimensions for zone - #------------------------------- + #------------------------------- for zp in zones: _updateZoneDim__(zp, d) #------------------------------------------------------------ @@ -115,7 +115,7 @@ def _addGhostCells(t, b, d, adaptBCs=0, modified=[], fillCorner=1): for zp in zones: if isghost[c]: rindplanes = [d,d,d,d,d,d] - Internal.createChild(zp, 'ZoneRind', 'Rind_t', + Internal.createChild(zp, 'ZoneRind', 'Rind_t', value=rindplanes, children=[]) c += 1 #------------------------------------------------------------ @@ -134,11 +134,11 @@ def _addGhostCells(t, b, d, adaptBCs=0, modified=[], fillCorner=1): # IN: bp: tree/basis/list of zones # IN: d: nb of ghost cells in all the directions # IN: modified: list of fields to be modified (GridCoordinates, FlowSolution or some fields only) -# IN: nodesRef: dictionary that identifies the first zone of a given name +# IN: nodesRef: dictionary that identifies the first zone of a given name # (if several zones with the same name in a multi-base tree. # IN/OUT: validjoins: list of nodes of type GridConnectivity1to1_t f # IN/OUT: dictjoins: dictionary of [zone, oppositezonename] -# IN/OUT: indexjoin: increment that relates the dictjoins to validjoins +# IN/OUT: indexjoin: increment that relates the dictjoins to validjoins #------------------------------------------------------------------------------- def _addGhostCellsStruct__(zp, bp, d, modified, nodesRef, validjoins, dictjoins, indexjoin): # In first loop, a dictionnary named 'validjoins' will defined the joins @@ -171,9 +171,9 @@ def _addGhostCellsNGON__(zp, bp, d, isghost, stdNode, modified): # # fieldsn and fieldsc contain coords, solution at nodes and centers # - if fieldsc == [] and fieldsn == []: + if fieldsc == [] and fieldsn == []: print('Warning: addGhostCells: variables not found. No ghost cells added.') - elif fieldsc == [] and fieldsn != []: # nodes only + elif fieldsc == [] and fieldsn != []: # nodes only out = Converter.converter.addGhostCellsNGonNodes(fieldsn,d) #PyTree.setFields([out], zp, 'nodes', writeDim=True) elif fieldsc != [] and fieldsn == []:# centers only @@ -185,10 +185,10 @@ def _addGhostCellsNGON__(zp, bp, d, isghost, stdNode, modified): #PyTree.setFields([out[0]], zp, 'nodes', writeDim=True) #PyTree.setFields([out[1]], zp, 'centers', writeDim=False) # zp is now modified - if parentN is not None: + if parentN is not None: if stdNode == 0: parentN[dN] = zp else: parentN[2][dN] = zp - else: bp = zp # liste de zones + else: bp = zp # liste de zones return isghost #============================================================================== @@ -220,9 +220,9 @@ def _rmGhostCells(t, b, d, adaptBCs=0, modified=[]): if typeElt == 'NGON': pass #_rmGhostCellsNGON__(zp, b, d, stdNode, modified) - else: + else: #print('Warning: rmGhostCells: not yet implemented for BE zones.') - pass # other elt types + pass # other elt types else: # Structured: # zone dimension with ghost cells @@ -230,7 +230,7 @@ def _rmGhostCells(t, b, d, adaptBCs=0, modified=[]): # Traitement particulier 2D if kmg == 2: try: - import Transform.PyTree as T + import Transform.PyTree as T zpp = T.subzone(zp, (1,1,1), (-1,-1,1)); kmg = 1 zp[2] = zpp[2] # force in place zp[1] = zpp[1] @@ -262,7 +262,7 @@ def _rmGhostCells(t, b, d, adaptBCs=0, modified=[]): #------------------------------- # Adapts physical BC #------------------------------- - if adaptBCs == 1: _adaptBCStruct__(zp, dim, -d, nodesRef) + if adaptBCs == 1: _adaptBCStruct__(zp, dim, -d, nodesRef) #--------------------------------- # Remove ghost dimensions for zone @@ -271,13 +271,13 @@ def _rmGhostCells(t, b, d, adaptBCs=0, modified=[]): #------------------------------------ # remove Rind_t node for zone - #------------------------------------ + #------------------------------------ Internal._rmNodesByName(zp, 'ZoneRind') return b #=============================================================================== # IN: zp: zone for which fields are extracted -# IN: modified: list of names of the container +# IN: modified: list of names of the container # __GridCoordinates__, __FlowSolution__ and list of variables # IN: coords=True: return the coordinates array if modified=Internal.__FlowSolutionCenters__ # OUT: return the list of arrays corresponding to fields at nodes and at centers @@ -285,12 +285,12 @@ def _rmGhostCells(t, b, d, adaptBCs=0, modified=[]): def getFieldsInContainer__(zp, modified, coords=True): fieldsn = []; fieldsc = [] for name in modified: - if name == Internal.__GridCoordinates__ or name == Internal.__FlowSolutionNodes__: + if name == Internal.__GridCoordinates__ or name == Internal.__FlowSolutionNodes__: if fieldsn == []: fieldsn = PyTree.getFields(name,zp)[0] - else: + else: sol = PyTree.getFields(name,zp)[0] if sol != []: fieldsn = Converter.addVars([fieldsn,sol]) - elif name == Internal.__FlowSolutionCenters__: + elif name == Internal.__FlowSolutionCenters__: fieldsc = PyTree.getFields(name,zp)[0] if coords: fieldsn = PyTree.getFields(Internal.__GridCoordinates__,zp)[0] @@ -304,15 +304,15 @@ def getFieldsInContainer__(zp, modified, coords=True): else: fn = PyTree.getField(vname,zp)[0] fieldsn = Converter.addVars([fieldsn,fn]) - else: - if vars0[0] == 'centers': + else: + if vars0[0] == 'centers': if fieldsc == []: fieldsc = PyTree.getField(vname,zp)[0] - else: + else: fc = PyTree.getField(vname,zp)[0] fieldsc = Converter.addVars([fieldsc,fc]) elif vars0[0] == 'nodes': # nodes if fieldsn == []: fieldsn = PyTree.getField(vname,zp)[0] - else: + else: fn = PyTree.getField(vname,zp)[0] fieldsn = Converter.addVars([fieldsn,fn]) else: @@ -343,14 +343,14 @@ def _rmGhostCellsNGON__(zp, bp, d, stdNode, modified): #PyTree.setFields([out[0]], zp, 'nodes', writeDim=True) #PyTree.setFields([out[1]], zp, 'centers', writeDim=False) # zp is now modified - if parentN is not None: + if parentN is not None: if stdNode == 0: parentN[dN] = zp else: parentN[2][dN] = zp else: bp = zp # liste de zones return None #============================================================================== -# Traitement de raccord : construction des cellules fictives au niveau des +# Traitement de raccord : construction des cellules fictives au niveau des # aretes entre deux fenetres topologiques et des coins du maillage GC # au depart : cellules degenerees # cas structure seulement @@ -402,7 +402,7 @@ def fillJoinGhostCellsStruct__(zp, join, modified, joininfo, try: import Transform except: raise ImportError("addGhostCells: periodicity requires Transform module.") tvx = -translVect[0]; tvy = -translVect[1]; tvz = -translVect[2] - if treatment > 0: zdonor = updateZoneDim__(zdonor,d) + if treatment > 0: zdonor = updateZoneDim__(zdonor,d) isCoordPresent = 0 if Internal.__GridCoordinates__ in modified: isCoordPresent = 3 else: @@ -421,13 +421,13 @@ def fillJoinGhostCellsStruct__(zp, join, modified, joininfo, angle = rotationData[6] if vy > 0.: anglep = angle else: anglep = -angle - if treatment > 0: zdonor = updateZoneDim__(zdonor,d) + if treatment > 0: zdonor = updateZoneDim__(zdonor,d) fieldsn, fieldsc = getFieldsInContainer__(zdonor, modified, coords=False) if fieldsn != []: - fieldsn = Transform.rotate(fieldsn, (xc,yc,zc), (vx,vy,vz), anglep, vectors=vectorsR) + fieldsn = Transform.rotate(fieldsn, (xc,yc,zc), (vx,vy,vz), anglep, vectors=vectorsR) PyTree.setFields([fieldsn], zdonor, 'nodes', writeDim=False) if fieldsc != []: - fieldsc = Transform.rotate(fieldsc, (xc,yc,zc), (vx,vy,vz), anglep, vectors=vectorsR) + fieldsc = Transform.rotate(fieldsc, (xc,yc,zc), (vx,vy,vz), anglep, vectors=vectorsR) PyTree.setFields([fieldsc], zdonor, 'centers', writeDim=False) elif translVect != [] and rotationData != []: print('Periodicity by rotation and translation cannot be applied at the same time.') @@ -448,7 +448,7 @@ def fillJoinGhostCellsStruct__(zp, join, modified, joininfo, if treatment == 0: cont[1] = fillJoinBorderStruct__(PR, PRD, trirac, dim, dimdonor, cont, containersD[noc], d, loc, dimZone, borderinfo, typegc) - else: + else: cont[1] = fillJoinCornerStruct__(PR, PRD, trirac, dim, dimdonor, cont, containersD[noc], d, loc, dimZone, borderinfo, treatment, typegc) noc += 1 @@ -463,7 +463,7 @@ def fillJoinBorderStruct__(prange, prangedonor, trirac, dim, dimdonor, frecv, fdonor, d, loc, dimZone, borderinfo, typegc): # copy of recv field (this field has already ghostcells) a = frecv[1]; f = fdonor[1] - [arrayborder,dim1,dim2,listdonor,direction,dirdonor,incrrecv,incrdonor,im,imdonor,shiftDir1,shiftDir2,isFine]=borderinfo + [arrayborder,dim1,dim2,listdonor,direction,dirdonor,incrrecv,incrdonor,im,imdonor,shiftDir1,shiftDir2,isFine]=borderinfo # fill ghost values (except corner values) for join if typegc == 0: Converter.converter.fillJoin(a, f, arrayborder, listdonor, loc, dim1, dim2, direction, dirdonor, @@ -473,8 +473,8 @@ def fillJoinBorderStruct__(prange, prangedonor, trirac, dim, dimdonor, frecv, Converter.converter.fillJoinNMNodes(a, f, arrayborder, listdonor, dim1, dim2, direction, dirdonor, incrrecv, incrdonor, dimZone, d, im, imdonor, shiftDir1, shiftDir2, isFine) - else: - Converter.converter.fillJoinNMCenters(a, f, arrayborder, listdonor, + else: + Converter.converter.fillJoinNMCenters(a, f, arrayborder, listdonor, dim1, dim2, direction, dirdonor, incrrecv, incrdonor, dimZone, d, im, imdonor, shiftDir1, shiftDir2, isFine) @@ -482,7 +482,7 @@ def fillJoinBorderStruct__(prange, prangedonor, trirac, dim, dimdonor, frecv, #=============================================================================== # #=============================================================================== -def getInfoForFillJoinsStruct__(prange, prangedonor, trirac, dim, dimdonor, +def getInfoForFillJoinsStruct__(prange, prangedonor, trirac, dim, dimdonor, d, loc, dimZone, nmratio=[], corner=0): if corner == 0: dloc = 0 else: dloc = d @@ -495,9 +495,9 @@ def getInfoForFillJoinsStruct__(prange, prangedonor, trirac, dim, dimdonor, if dimZone == 3: kmdonor = dimdonor[3] if loc == 'CellCenter': imdonor = imdonor-1 - im = im-1 ; jm = jm-1 ; km = km-1 + im = im-1 ; jm = jm-1 ; km = km-1 if dimZone != 1: jmdonor = jmdonor-1 - if dimZone == 3: kmdonor = kmdonor-1 + if dimZone == 3: kmdonor = kmdonor-1 # get directions of recv and donor borders direction = getDirBorderStruct__(prange, dimZone) @@ -513,22 +513,22 @@ def getInfoForFillJoinsStruct__(prange, prangedonor, trirac, dim, dimdonor, shiftDir1 = 1; shiftDir2 = 1 isFine = 0 if nmratio != []: - nmratioFact = nmratio[0]*nmratio[1]*nmratio[2] - if nmratioFact < 1: + nmratioFact = nmratio[0]*nmratio[1]*nmratio[2] + if nmratioFact < 1: isFine = 1 iratio = int(math.ceil(1./nmratio[0])) jratio = int(math.ceil(1./nmratio[1])) kratio = int(math.ceil(1./nmratio[2])) - else: + else: isFine = -1 iratio = int(nmratio[0]) jratio = int(nmratio[1]) kratio = int(nmratio[2]) if absdirection == 1: - shiftDir1 = jratio - shiftDir2 = kratio + shiftDir1 = jratio + shiftDir2 = kratio elif absdirection == 2: - shiftDir1 = iratio + shiftDir1 = iratio shiftDir2 = kratio else: shiftDir1 = iratio @@ -623,7 +623,7 @@ def getInfoForFillJoinsStruct__(prange, prangedonor, trirac, dim, dimdonor, # Return new field # ----- # passage: 1 corresponds to the first passage for corner ghost cells -# 2 corresponds to the second (and last) passage for unfilled ghost cells +# 2 corresponds to the second (and last) passage for unfilled ghost cells #============================================================================== def fillJoinCornerStruct__(prange, prangedonor, trirac, dim, dimdonor, frecv, fdonor, d, loc, dimZone, borderinfo, passage, typegc): @@ -636,11 +636,11 @@ def fillJoinCornerStruct__(prange, prangedonor, trirac, dim, dimdonor, frecv, # fill ghost corner values for join if typegc == 0: Converter.converter.fillCornerGhostCells(a, f, arrayborder, listdonor, loc, dim1, dim2, incrrecvI, incrrecvJ, - incrdonorI, incrdonorJ, direction, dirdonor, incrrecv, incrdonor, + incrdonorI, incrdonorJ, direction, dirdonor, incrrecv, incrdonor, dimZone, d, passage) else: # non implemented for nearmatch pass - return a + return a #============================================================================== # Return a list with donor indices for a matching join between structured zones @@ -689,7 +689,7 @@ def getBorderIndicesStruct__(prange, dim, direction, d, loc, dimZone, shift=0): # dimensions of zone im = dim[1] ; jm = dim[2] ; km = dim[3] if loc == 'CellCenter': - im = im-1 ; jm = jm-1 ; km = km-1 + im = im-1 ; jm = jm-1 ; km = km-1 # border window dimension [wimin,wimax,wjmin,wjmax,wkmin,wkmax] = Internal.range2Window(prange) @@ -809,14 +809,14 @@ def changePointRange__(prange, dimZone, direction, d, corners=0, extend=0): else: N = dimZone[3] indm = pr[ind][0]+d # if (indm <= d+1): indm = 1 # corner - if indm <= d+1: + if indm <= d+1: if extend == 0: indm = d+1 # nouvelle version : ne pas etendre les BC physiques else: indm = 1 # corner pr[ind][0] = indm indm = pr[ind][1]+d # if (indm >= N+d): indm = N+2*d # corner - if indm >= N+d: + if indm >= N+d: if extend == 0: indm = N+d # nouvelle version : ne pas etendre les BC physiques else: indm = N+2*d # corner @@ -829,7 +829,7 @@ def changePointRange__(prange, dimZone, direction, d, corners=0, extend=0): return None #----------------------------------------------------------------------------- -# return the containers defined by name in z +# return the containers defined by name in z #----------------------------------------------------------------------------- def getContainers__(name, z, zdonor=None): containers = []; locations = []; containersD = [] @@ -839,9 +839,9 @@ def getContainers__(name, z, zdonor=None): if name == Internal.__GridCoordinates__: for name in coordinate: coord = Internal.getNodesFromName2(z, name) - if coord != []: + if coord != []: if zdonor is None: containers.append(coord[0]); locations.append('Vertex') - else: + else: coorddonor = Internal.getNodesFromName2(zdonor,name) containersD.append(coorddonor[0]) containers.append(coord[0]); locations.append('Vertex') @@ -861,12 +861,12 @@ def getContainers__(name, z, zdonor=None): if zdonor is not None: fdonor = Internal.getNodesFromName2(zdonor, name) for i in f[0][2]: - if i[3] == 'DataArray_t': + if i[3] == 'DataArray_t': if zdonor is None: containers.append(i); locations.append(loc) else: if fdonor != []: # zdonor != None idonor = Internal.getNodesFromName1(fdonor[0], i[0]) - if idonor != []: + if idonor != []: containers.append(i); locations.append(loc); containersD.append(idonor[0]) #----------------------------------------- @@ -943,13 +943,13 @@ def _initWithExtrapStruct__(z, dim, modified, d): # Warning: z dimension is not already modified - containers of flow solutions are not consistent yet with zone dim def _setBCDataInGhostCellsStruct__(z, dim, modified, d): - if dim[0] == 'Unstructured': + if dim[0] == 'Unstructured': print('addGhostCells: _setBCDataInGhostCellsStruct__: not valid for unstructured zones.') return None dimZone = dim[4] imz = dim[1] ; jmz = dim[2] ; kmz = dim[3] for name in modified: - containers = Internal.getBCDataSetContainers(name, z) + containers = Internal.getBCDataSetContainers(name, z) if containers is not None: for cont in containers: varname = cont[0] @@ -962,7 +962,7 @@ def _setBCDataInGhostCellsStruct__(z, dim, modified, d): if e[1] is not None: # firewall pour les mauvaises BCDataSet bcranges.append(e[0]) dataBC.append(e[1]) - Converter.converter._setBCDataInGhostCellsStruct(z, bcranges, dataBC, imz, jmz, kmz, d, locI, varname, + Converter.converter._setBCDataInGhostCellsStruct(z, bcranges, dataBC, imz, jmz, kmz, d, locI, varname, Internal.__GridCoordinates__, Internal.__FlowSolutionNodes__,Internal.__FlowSolutionCenters__) return None @@ -1003,7 +1003,7 @@ def _rmGhostCellsStruct__(z, dim, modified, d): # IN: t: arbre contenant des containers "rind" (avec ghost cells) # IN: d: nbre de ghost cells dans le rind # IN: modified: la liste du nom des containers a modifier -# Modifie un ou plusieurs containers avec Rind pour le transformer en +# Modifie un ou plusieurs containers avec Rind pour le transformer en # container standard (centres ou noeuds) #============================================================================== def rmRindCells(t, d=-1, modified=[]): @@ -1031,7 +1031,7 @@ def _rmRindCells0(t): rindkmin = rindnode[4]; rindkmax = rindnode[5] zpp = T.subzone(zp, (1+rindimin,1+rindjmin, 1+rindkmin), (imz-rindimax,jmz-rindjmax,kmz-rindkmax)) - zp[2]=zpp[2]; zp[1]=zpp[1] # force in place + zp[2]=zpp[2]; zp[1]=zpp[1] # force in place return None def _rmRindCells(t, d=-1, modified=[]): @@ -1065,14 +1065,14 @@ def _rmRindCells(t, d=-1, modified=[]): a = numpy.empty((im), b.dtype, order='F') Converter.converter.cpyGhost2Real(a,b,d,im,0,0) cont[1] = a - noc += 1 + noc += 1 return None #----------------------------------------------------------------------------- -# fill all fields for ghost cell corners for structured zones +# fill all fields for ghost cell corners for structured zones # only for BCMatch currently # loop = 2: ghost cells corners -# loop = 3: only for 3D : deals with the very last ghost cell corners +# loop = 3: only for 3D : deals with the very last ghost cell corners #----------------------------------------------------------------------------- def _fillGhostCellCorners__(bp, modified, d, validjoins, dictjoins, loop=2): treatment = 0 @@ -1086,9 +1086,9 @@ def _fillGhostCellCorners__(bp, modified, d, validjoins, dictjoins, loop=2): dimZone = dim[4] joininfo = dictjoins[indexjoin][1] if dim[0] == 'Structured': - if (loop == 2) or (loop==3 and dimZone==3): + if (loop == 2) or (loop==3 and dimZone==3): zdonorname = joininfo[0][0] - zdonor = Internal.getNodesFromName2(bp, zdonorname) + zdonor = Internal.getNodesFromName2(bp, zdonorname) # Check if donor exists. # If not, zdonor does not have ghost cells, thus this second pass is useless. zd = [] @@ -1123,7 +1123,7 @@ def _fillGhostCellsForStructBCMatch__(zp, d, dimZone, modified, nodesRef, dictjoins[indexjoin] = (zp,joininfo) indexjoin += 1 - if dimZone == 1: return validjoins, dictjoins, indexjoin + if dimZone == 1: return validjoins, dictjoins, indexjoin # BCNearMatch joinlist = Internal.getNodesFromType2(zp, 'GridConnectivity_t') @@ -1141,7 +1141,7 @@ def _fillGhostCellsForStructBCMatch__(zp, d, dimZone, modified, nodesRef, fillJoinGhostCellsStruct__(zp, i, modified, joininfo, d, treatment=0) dictjoins[indexjoin] = (zp,joininfo) indexjoin += 1 - return validjoins, dictjoins, indexjoin + return validjoins, dictjoins, indexjoin #----------------------------------------------------------------------------- # adaptBCStruct: modifies ranges for structured zones: @@ -1181,7 +1181,7 @@ def _adaptBCStruct__(zp, dimZone, d, nodesRef): r = Internal.getNodeFromType2(i, 'GridConnectivityType_t') if r != []: val = Internal.getValue(r) - if val== 'Abutting': + if val== 'Abutting': prange = Internal.getNodesFromName1(i, 'PointRange') if prange != []: udd = Internal.getNodesFromType1(i, 'UserDefinedData_t') @@ -1207,7 +1207,7 @@ def _adaptBCStruct__(zp, dimZone, d, nodesRef): r = Internal.getNodesFromType(i, 'GridConnectivityType_t') if r != []: val = Internal.getValue(r[0]) - if val == 'Overset': + if val == 'Overset': prange = Internal.getNodesFromName1(i, 'PointRange') if prange != []: direction = getDirection__(dimPb, prange) @@ -1227,7 +1227,7 @@ def _adaptBCStruct__(zp, dimZone, d, nodesRef): #----------------------------------------------------------------------------- # For multi-base pyTrees, if t contains several zones with the same name # the first zone found is kept -# Returns the dictionary corresponding to the first zones found +# Returns the dictionary corresponding to the first zones found #----------------------------------------------------------------------------- def getFirstReferencedZones__(t): nodesRef = {} @@ -1239,7 +1239,7 @@ def getFirstReferencedZones__(t): if len(bases) == 0: # t is a zone or a list of zones nodes = Internal.getNodesFromType1(t, 'Zone_t') for n in nodes: - if n[0] not in nodesRef: nodesRef[n[0]] = [n] + if n[0] not in nodesRef: nodesRef[n[0]] = [n] return nodesRef #--------------------------------- @@ -1262,11 +1262,11 @@ def updateZoneDim__(z,d): #============================================================================= # Returns join info for BCMatch and BCNearMatch joins as a list: -# [zdonor,prange,prangedonor,trirac,nmratio,translvect,rotationData] +# [zdonor,prange,prangedonor,trirac,nmratio,translvect,rotationData] # nmratio=[] for BCMatch and [2,1,1] for BCNearMatch # translvect!=[] if translation-periodic # rotationData = [] if no periodicity by rotation -# rotationData = [xc,yc,zc, axisX, axisY, axisZ, angle] if rotation-per +# rotationData = [xc,yc,zc, axisX, axisY, axisZ, angle] if rotation-per #============================================================================= def getJoinInfo__(join, jointype, dimZone, nodesRef, d): prange = Internal.getNodesFromName1(join, 'PointRange') @@ -1301,7 +1301,7 @@ def getJoinInfo__(join, jointype, dimZone, nodesRef, d): # get trirac # ----------------------- if dimZone == 3: trirac = [1,2,3] - elif dimZone == 2: trirac = [1,2] + elif dimZone == 2: trirac = [1,2] else: trirac = [1] if transfo != []: trirac[0] = transfo[0][1][0] @@ -1312,13 +1312,13 @@ def getJoinInfo__(join, jointype, dimZone, nodesRef, d): # check donor zone dimension # check if dimensions of donor border match with dimension of current zone check = True - [wimin,wimax,wjmin,wjmax,wkmin,wkmax] = Internal.range2Window(prange[0][1]) + [wimin,wimax,wjmin,wjmax,wkmin,wkmax] = Internal.range2Window(prange[0][1]) [wimindonor,wimaxdonor,wjmindonor,wjmaxdonor,wkmindonor,wkmaxdonor]=Internal.range2Window(prangedonor[0][1]) if dimZone == 3: delta = [wimax-wimin,wjmax-wjmin,wkmax-wkmin] deltadonor = [wimaxdonor-wimindonor,wjmaxdonor-wjmindonor,wkmaxdonor-wkmindonor] if jointype == 'BCMatch': - if ((delta[1] != deltadonor[abs(trirac[1])-1]) or (delta[2] != deltadonor[abs(trirac[2])-1])): + if ((delta[1] != deltadonor[abs(trirac[1])-1]) or (delta[2] != deltadonor[abs(trirac[2])-1])): check = False elif dimZone == 2: delta = [wimax-wimin,wjmax-wjmin] @@ -1338,9 +1338,9 @@ def getJoinInfo__(join, jointype, dimZone, nodesRef, d): else: jmdonor = 0 ### useless value for 1d: test is also on dirborder. if dimZone == 3: kmdonor = dimdonor[3] else: kmdonor = 0 ### useless value for 2d: test is also on dirborder. - if (((abs(dirdonor) == 1) and (imdonor < d+1)) or - ((abs(dirdonor) == 2) and (abs(jmdonor) < d+1)) or - ((abs(dirdonor) == 3) and (kmdonor < d+1))): + if (((abs(dirdonor) == 1) and (imdonor < d+1)) or + ((abs(dirdonor) == 2) and (abs(jmdonor) < d+1)) or + ((abs(dirdonor) == 3) and (kmdonor < d+1))): print("Warning: addGhostCells: dimension of matching zone is too small for", d, "ghost cells. Skip join treatment for ghost extension.") return [] else: @@ -1353,8 +1353,8 @@ def getJoinInfo__(join, jointype, dimZone, nodesRef, d): #============================================================================== ##def getLayer(a, faceList=None, nlayers=2): # import Transform.PyTree as T -# Internal._adaptNFace2PE(a, remove=False) -# PE = Internal.getNodeFromPath(a, 'NGonElements/ParentElements')[1] +# Internal._adaptNFace2PE(a, remove=False) +# PE = Internal.getNodeFromPath(a, 'NGonElements/ParentElements')[1] # n = faceList.size # ptFace = faceList.flat # elts = set() @@ -1402,21 +1402,21 @@ def getLayer(zD, zR, elts_old, mask, xyz0, no_layer, faceListD=None, faceListR=N zbc_R = Internal.getNodeFromType1(zR , 'ZoneBC_t') - NG_PE_D = Internal.getNodeFromPath(zD, 'NGonElements/ParentElements')[1] - NG_EC_D = Internal.getNodeFromPath(zD, 'NGonElements/ElementConnectivity')[1] - NG_IDX_D= Internal.getNodeFromPath(zD, 'NGonElements/FaceIndex')[1] - FA_IDX_D= Internal.getNodeFromPath(zD, 'NFaceElements/ElementIndex')[1] - FA_EC_D = Internal.getNodeFromPath(zD, 'NFaceElements/ElementConnectivity')[1] + NG_PE_D = Internal.getNodeFromPath(zD, 'NGonElements/ParentElements')[1] + NG_EC_D = Internal.getNodeFromPath(zD, 'NGonElements/ElementConnectivity')[1] + NG_IDX_D= Internal.getNodeFromPath(zD, 'NGonElements/FaceIndex')[1] + FA_IDX_D= Internal.getNodeFromPath(zD, 'NFaceElements/ElementIndex')[1] + FA_EC_D = Internal.getNodeFromPath(zD, 'NFaceElements/ElementConnectivity')[1] coordxD = Internal.getNodeFromPath(zD, 'GridCoordinates/CoordinateX')[1] coordyD = Internal.getNodeFromPath(zD, 'GridCoordinates/CoordinateY')[1] coordzD = Internal.getNodeFromPath(zD, 'GridCoordinates/CoordinateZ')[1] if no_layer > 1: - NG_PE_R = Internal.getNodeFromPath(zR, 'NGonElements/ParentElements')[1] - NG_EC_R = Internal.getNodeFromPath(zR, 'NGonElements/ElementConnectivity')[1] - NG_IDX_R= Internal.getNodeFromPath(zR, 'NGonElements/FaceIndex')[1] - FA_EC_R = Internal.getNodeFromPath(zR, 'NFaceElements/ElementConnectivity')[1] - FA_IDX_R= Internal.getNodeFromPath(zR, 'NFaceElements/ElementIndex')[1] + NG_PE_R = Internal.getNodeFromPath(zR, 'NGonElements/ParentElements')[1] + NG_EC_R = Internal.getNodeFromPath(zR, 'NGonElements/ElementConnectivity')[1] + NG_IDX_R= Internal.getNodeFromPath(zR, 'NGonElements/FaceIndex')[1] + FA_EC_R = Internal.getNodeFromPath(zR, 'NFaceElements/ElementConnectivity')[1] + FA_IDX_R= Internal.getNodeFromPath(zR, 'NFaceElements/ElementIndex')[1] coordxR = Internal.getNodeFromPath(zR, 'GridCoordinates/CoordinateX')[1] coordyR = Internal.getNodeFromPath(zR, 'GridCoordinates/CoordinateY')[1] coordzR = Internal.getNodeFromPath(zR, 'GridCoordinates/CoordinateZ')[1] @@ -1444,7 +1444,7 @@ def getLayer(zD, zR, elts_old, mask, xyz0, no_layer, faceListD=None, faceListR=N eltD = FA_IDX_D[e1D-1] for face in range( 1, FA_EC_D[eltD ]+1): f = FA_EC_D[ eltD + face] -1 - ind_f = NG_IDX_D[ f] + ind_f = NG_IDX_D[ f] NvtxD = NG_EC_D[ ind_f] for vtx in range( NvtxD ): vtxD = NG_EC_D[ ind_f +vtx +1 ] -1 @@ -1458,7 +1458,7 @@ def getLayer(zD, zR, elts_old, mask, xyz0, no_layer, faceListD=None, faceListR=N #print('elts', elts) else: if (NG_PE_D[ faceD, 0] > NG_PE_D[ faceD, 1]): e1D = NG_PE_D[faceD,1] - else: e1D = NG_PE_D[faceD,0] + else: e1D = NG_PE_D[faceD,0] #recuperation adresse element dans ElementConnectivity pour recuperer faces de l'element ind_e1D = FA_IDX_D[e1D-1] @@ -1471,10 +1471,10 @@ def getLayer(zD, zR, elts_old, mask, xyz0, no_layer, faceListD=None, faceListR=N e3D = NG_PE_D[no_faceD,0] e4D = NG_PE_D[no_faceD,1] #on test si la cellule est un raccord ou un BC - if e3D*e4D != 0: + if e3D*e4D != 0: #print 'e34',e3D, e4D, NG_PE_D[faceD,0], NG_PE_D[faceD,1] #print 'face',no_faceD+1, faceD+1, face - if (e3D != e1D and ( e3D < mask[0] or e3D > mask[1]) ): + if (e3D != e1D and ( e3D < mask[0] or e3D > mask[1]) ): #calcul centre maille x0 = 0. y0 = 0. @@ -1482,7 +1482,7 @@ def getLayer(zD, zR, elts_old, mask, xyz0, no_layer, faceListD=None, faceListR=N eltD = FA_IDX_D[e3D-1] for face in range(1, FA_EC_D[eltD ]+1): f = FA_EC_D[ eltD + face] -1 - ind_f = NG_IDX_D[ f] + ind_f = NG_IDX_D[ f] NvtxD = NG_EC_D[ ind_f] for vtx in range(NvtxD): vtxD = NG_EC_D[ ind_f +vtx +1] -1 @@ -1496,7 +1496,7 @@ def getLayer(zD, zR, elts_old, mask, xyz0, no_layer, faceListD=None, faceListR=N size2_xyz = len( xyz0) if size2_xyz > size1_xyz: elts.add(e3D-one) - elif e4D < mask[0] or e4D > mask[1]: + elif e4D < mask[0] or e4D > mask[1]: #calcul centre maille x0 = 0.; y0 = 0.; z0 = 0. eltD = FA_IDX_D[e4D-1] @@ -1522,13 +1522,13 @@ def getLayer(zD, zR, elts_old, mask, xyz0, no_layer, faceListD=None, faceListR=N e2R = NG_PE_R[faceR,1] #element couche externe a forcemment un no + grand if e1R > e2R: elR = e1R - else : elR = e2R + else : elR = e2R eltR = FA_IDX_R[elR-1] face_bingo = [] faceSearch = True faceR = 1 while faceSearch: - #for faceR in range( 1, FA_EC_R[eltR]+1): + #for faceR in range( 1, FA_EC_R[eltR]+1): no_faceR = FA_EC_R[ eltR + faceR] -1 e3R = NG_PE_R[no_faceR,0] e4R = NG_PE_R[no_faceR,1] @@ -1554,15 +1554,15 @@ def getLayer(zD, zR, elts_old, mask, xyz0, no_layer, faceListD=None, faceListR=N # print 'cr=', cr if coordxD[vtxD] == coordxR[vtxR]: if coordyD[vtxD] == coordyR[vtxR]: - if coordzD[vtxD] == coordzR[vtxR]: - bingo +=1 + if coordzD[vtxD] == coordzR[vtxR]: + bingo +=1 searchR = False cr +=1 if cr == (NvtxR+1): searchR = False cd +=1 if cd == (NvtxD+1): searchD = False - if bingo == NvtxR: + if bingo == NvtxR: face_bingo.append(no_faceR) faceSearch = False @@ -1570,10 +1570,10 @@ def getLayer(zD, zR, elts_old, mask, xyz0, no_layer, faceListD=None, faceListR=N if (faceR == (FA_EC_R[eltR]+1)) : faceSearch = False #on modifie le Nombre de face BC si la face n 'est pas un raccord - for fbingo in face_bingo: + for fbingo in face_bingo: for gD in bc_D: ptlist = Internal.getNodeFromName1(gD, 'PointList')[1] - if no_faceD+1 in ptlist: + if no_faceD+1 in ptlist: ldone = False c = 0 clD = Internal.getValue(gD) @@ -1584,7 +1584,7 @@ def getLayer(zD, zR, elts_old, mask, xyz0, no_layer, faceListD=None, faceListR=N if clD == clR and ldone == False: ptlistR = Internal.getNodeFromName1(bc_R[c], 'PointList')[1] - if fbingo+1 not in ptlistR: + if fbingo+1 not in ptlistR: sizeR = numpy.size(ptlistR) datap = numpy.empty(sizeR+1, dtype=Internal.E_NpyInt) @@ -1623,7 +1623,7 @@ def addGhostCellsP(t, dims_woghost, list_elts, mask_elts, xyz0, no_layer): # -- Copy un arbre en gardant des references sur les numpy tp = Internal.copyRef(t) - # -- converti un node en arbre. dans le cas present, ne fait rien, car node = tree: + # -- converti un node en arbre. dans le cas present, ne fait rien, car node = tree: # tpp=tp tpp, ntype = Internal.node2PyTree(tp) @@ -1669,8 +1669,8 @@ def addGhostCellsP(t, dims_woghost, list_elts, mask_elts, xyz0, no_layer): maskD = zonenames.index(zdonor[0]) if no_layer ==1 : - Internal._adaptNFace2Index(zdonor) - Internal._adaptNGon2Index(zdonor) + Internal._adaptNFace2Index(zdonor) + Internal._adaptNGon2Index(zdonor) #if c==2: # print'maskD=',maskD, 'rac=', rac, 'plage=', mask_elts[ maskD ][ rac ], 'nolayer=',no_layer @@ -1699,8 +1699,8 @@ def addGhostCellsP(t, dims_woghost, list_elts, mask_elts, xyz0, no_layer): znameD[ z[0] ] = zp[0] Internal._adaptNFace2PE(zp, remove=False) - Internal._adaptNFace2Index(zp) - Internal._adaptNGon2Index(zp) + Internal._adaptNFace2Index(zp) + Internal._adaptNGon2Index(zp) b[2][c] = zp c += 1 @@ -1728,7 +1728,7 @@ def adapt2FastP(t, nlayers=2): zones = Internal.getZones(t) #sauvegarde taille de zone sans ghost et de la list des elememnt ajoutes for z in zones: - #Nombre de face totale + #Nombre de face totale NGON_range = Internal.getNodeFromPath(z, 'NGonElements/ElementRange')[1] nface_tot = NGON_range[1]-NGON_range[0] +1 #Nombre de face raccord @@ -1740,7 +1740,7 @@ def adapt2FastP(t, nlayers=2): elts.append( set() ) mask.append( None ) nface_rac = nface_rac + numpy.size( Internal.getNodeFromName1(g, 'PointListDonor')[1] ) - #Nombre de face BC + #Nombre de face BC gc = Internal.getNodesFromType2(z, 'BC_t') nface_bc = 0 for g in gc: @@ -1750,7 +1750,7 @@ def adapt2FastP(t, nlayers=2): list_elts.append( elts ) mask_elts.append( mask ) - xyz0.append( set() ) + xyz0.append( set() ) Nvtx = z[1][0][0] Nelts = z[1][0][1] @@ -1766,11 +1766,11 @@ def adapt2FastP(t, nlayers=2): zones = Internal.getZones(t) c = 0 nbzone = len(zones) - for z in zones: - #print 'verif',z[0] + for z in zones: + #print 'verif',z[0] NGON_range = Internal.getNodeFromPath(z, 'NGonElements/ElementRange')[1] nface_tot = NGON_range[1]-NGON_range[0] +1 - #Nombre de face BC + #Nombre de face BC gc = Internal.getNodesFromType2(z, 'BC_t') nface_bc = 0 for g in gc: @@ -1788,9 +1788,9 @@ def adapt2FastP(t, nlayers=2): data_ng[2] = dims_woghost[c][4] # couche 0: nbfacebc(0) l1 = c + nbzone l2 = c + nbzone*2 - if (nlayers ==2): + if (nlayers ==2): data_ng[4] = dims_woghost[l2][4] - dims_woghost[c ][4] # couche 1: nbfacebc(1) - data_ng[3] = dims_woghost[l1][2] - dims_woghost[c ][2] - data_ng[4] # couche 1: faceInterne(1)= nbfacetot -nfacebc(1) + data_ng[3] = dims_woghost[l1][2] - dims_woghost[c ][2] - data_ng[4] # couche 1: faceInterne(1)= nbfacetot -nfacebc(1) data_ng[5] = dims_woghost[l2][2] - dims_woghost[l1][2] # couche 2: nbintern(2) node = Internal.getNodeFromName1(z, 'NGonElements') @@ -1801,7 +1801,7 @@ def adapt2FastP(t, nlayers=2): l1 = c + nbzone l2 = c + nbzone*2 data_nf[1] = dims_woghost[l1][1] -dims_woghost[c][1] # couche 1: nombre element - if (nlayers ==2): + if (nlayers ==2): data_nf[2] = dims_woghost[l2][1] -dims_woghost[l1][1] # couche 2: nombre element node = Internal.getNodeFromName1(z, 'NFaceElements') Internal.createUniqueChild(node, 'IntExt', 'DataArray_t', data_nf) @@ -1816,17 +1816,17 @@ def adapt2FastP(t, nlayers=2): dim = Internal.getZoneDim(z) - NG_PE = Internal.getNodeFromPath(z, 'NGonElements/ParentElements')[1] - NG_EC = Internal.getNodeFromPath(z, 'NGonElements/ElementConnectivity')[1] - NG_IDX= Internal.getNodeFromPath(z, 'NGonElements/FaceIndex')[1] - FA_EC = Internal.getNodeFromPath(z, 'NFaceElements/ElementConnectivity')[1] - FA_IDX= Internal.getNodeFromPath(z, 'NFaceElements/ElementIndex')[1] + NG_PE = Internal.getNodeFromPath(z, 'NGonElements/ParentElements')[1] + NG_EC = Internal.getNodeFromPath(z, 'NGonElements/ElementConnectivity')[1] + NG_IDX= Internal.getNodeFromPath(z, 'NGonElements/FaceIndex')[1] + FA_EC = Internal.getNodeFromPath(z, 'NFaceElements/ElementConnectivity')[1] + FA_IDX= Internal.getNodeFromPath(z, 'NFaceElements/ElementIndex')[1] zbc = Internal.getNodeFromType1(z , 'ZoneBC_t') bcs = Internal.getNodesFromType1(zbc, 'BC_t') ptlist_bc=[] - for bc in bcs: - ptlist_bc.append( Internal.getNodeFromName1( bc , 'PointList')[1] ) + for bc in bcs: + ptlist_bc.append( Internal.getNodeFromName1( bc , 'PointList')[1] ) #print 'zone=',z[0], ' bc=', bc[0] zgc = Internal.getNodeFromType1( z, 'ZoneGridConnectivity_t') @@ -1834,14 +1834,14 @@ def adapt2FastP(t, nlayers=2): if zgc is not None: gcs = Internal.getNodesFromType1(zgc, 'GridConnectivity_t') ptlist_rac =[] ptlist_racD=[] - for gc in gcs: + for gc in gcs: ptlist_rac.append( Internal.getNodeFromName1( gc , 'PointList')[1] ) #print 'zone=',z[0], ' rac =', gc[0] donor = Internal.getValue(gc) zdonor = Internal.getNodesFromName1(zones, donor)[0] zgc_D = Internal.getNodeFromType1( zdonor, 'ZoneGridConnectivity_t') gcs_D = Internal.getNodesFromType1( zgc_D, 'GridConnectivity_t') - for gc_D in gcs_D: + for gc_D in gcs_D: receiver = Internal.getValue(gc_D) if (receiver == z[0]): ptlist_racD.append( Internal.getNodeFromName1( gc_D , 'PointListDonor')[1] ) @@ -1850,7 +1850,7 @@ def adapt2FastP(t, nlayers=2): FA_intext= Internal.getNodeFromPath(z,'NFaceElements/IntExt')[1] - FA_RG = Internal.getNodeFromPath(z, 'NFaceElements/ElementRange')[1] + FA_RG = Internal.getNodeFromPath(z, 'NFaceElements/ElementRange')[1] NG_intext= Internal.getNodeFromPath(z,'NGonElements/IntExt')[1] NF = Internal.getNodeFromPath(z, 'NFaceElements/ElementConnectivity') nf = converter.adapt2FastP(NG_EC, FA_EC, NG_PE, NG_intext, FA_intext, ptlist_bc, ptlist_rac, ptlist_racD, dim[2]) @@ -1859,8 +1859,8 @@ def adapt2FastP(t, nlayers=2): print('FA_RG[1]', FA_RG[1], 'NG_intext[2]',NG_intext[2],'NG_intext[4]', NG_intext[4]) print('voir christophe pour probleme visu') FA_RG[1] = FA_RG[1] + NG_intext[2] + NG_intext[4] - z[1][0,1]= z[1][0,1]+ NG_intext[2] + NG_intext[4] - Internal._adaptNFace2Index(z) + z[1][0,1]= z[1][0,1]+ NG_intext[2] + NG_intext[4] + Internal._adaptNFace2Index(z) return t @@ -1874,7 +1874,7 @@ def adapt2FastP2(t, nlayers=2): zones = Internal.getZones(t) #sauvegarde taille de zone sans ghost et de la list des elements ajoutes for z in zones: - #Nombre de face totale + #Nombre de face totale NGON_range = Internal.getNodeFromPath(z, 'NGonElements/ElementRange')[1] nface_tot = NGON_range[1]-NGON_range[0] +1 #Nombre de face raccord @@ -1883,7 +1883,7 @@ def adapt2FastP2(t, nlayers=2): for g in gc: nface_rac = nface_rac + numpy.size( Internal.getNodeFromName1(g, 'PointListDonor')[1] ) - #Nombre de face BC + #Nombre de face BC gc = Internal.getNodesFromType2(z, 'BC_t') nface_bc = 0 for g in gc: @@ -1900,15 +1900,15 @@ def adapt2FastP2(t, nlayers=2): # creation nouvel arbre avec ghost t = addGhostCellsNG(t, nlayers) - # + # zones = Internal.getZones(t) c = 0 nbzone = len(zones) - for z in zones: - #print 'verif',z[0] + for z in zones: + #print 'verif',z[0] NGON_range = Internal.getNodeFromPath(z, 'NGonElements/ElementRange')[1] nface_tot = NGON_range[1]-NGON_range[0] +1 - #Nombre de face BC + #Nombre de face BC gc = Internal.getNodesFromType2(z, 'BC_t') nface_bc = 0 for g in gc: @@ -1958,7 +1958,7 @@ def adapt2FastP2(t, nlayers=2): #=============================================================================== def addGhostCellsNG(t, nlayers=2): - bases = Internal.getBases(t) + bases = Internal.getBases(t) zones = Internal.getZones(t) nbz = len(zones) @@ -1980,8 +1980,8 @@ def addGhostCellsNG(t, nlayers=2): max_face=-10000000 for bc in bc_type[key]: ptlist = Internal.getNodeFromName1(bc, 'PointList')[1] - min_face= min(min_face, numpy.amin(ptlist)) - max_face= max(max_face, numpy.amax(ptlist)) + min_face= min(min_face, numpy.amin(ptlist)) + max_face= max(max_face, numpy.amax(ptlist)) size_fen+= numpy.size(ptlist) #print("minmax", min_face, max_face, size_fen) #bc contigu @@ -2128,9 +2128,9 @@ def addGhostCellsNG(t, nlayers=2): ###################################################################################### # FIXME : can be retrieved from K_CONVERTER::addGhostCellsNG instead of regenerating it - Internal._adaptNFace2PE(zwgh, remove=False) - Internal._adaptNFace2Index(zwgh) - Internal._adaptNGon2Index(zwgh) + Internal._adaptNFace2PE(zwgh, remove=False) + Internal._adaptNFace2Index(zwgh) + Internal._adaptNGon2Index(zwgh) ####################################################################################### # MAJ BCs @@ -2166,10 +2166,10 @@ def addGhostCellsNG(t, nlayers=2): if (donnor_zid == i): break PyTree._addBC2Zone(zwgh, JNames[oid], JTypes[oid], - zoneDonor=ozones[zid], - faceList=ids , #elementList=elementList, elementRange=elementRange, data=data, subzone=subzone, - faceListDonor=donnor_ids #, elementListDonor=elementListDonor, elementRangeDonor=elementRangeDonor - ) + zoneDonor=ozones[zid], + faceList=ids , #elementList=elementList, elementRange=elementRange, data=data, subzone=subzone, + faceListDonor=donnor_ids #, elementListDonor=elementListDonor, elementRangeDonor=elementRangeDonor + ) node = Internal.getNodeFromName1(zwgh, 'NFaceElements') Internal.createUniqueChild(node, 'IntExt', 'DataArray_t', nodes[i][3]) node = Internal.getNodeFromName1(zwgh, 'NGonElements') @@ -2200,6 +2200,3 @@ def _adaptBCStruct3__(join, dimZoneR,dimZoneD, d): return None - - - diff --git a/Cassiopee/Converter/Converter/Gmsh.py b/Cassiopee/Converter/Converter/Gmsh.py index 7e0d3d135..702c4c2e9 100644 --- a/Cassiopee/Converter/Converter/Gmsh.py +++ b/Cassiopee/Converter/Converter/Gmsh.py @@ -52,7 +52,7 @@ def convertMesh2Arrays(dim=2, tag=-1): ne = eltTags.size kelts = numpy.empty( (nof,ne), dtype=numpy.int32) for n in range(nof): # bottleneck - for i in range(ne): + for i in range(ne): kelts[n,i] = inverse.get(nodeEltTags[nof*i+n], 1) a = ['x,y,z', crds, kelts, eltType] diff --git a/Cassiopee/Converter/Converter/Internal.py b/Cassiopee/Converter/Converter/Internal.py index 48a99fb82..87ff350e9 100644 --- a/Cassiopee/Converter/Converter/Internal.py +++ b/Cassiopee/Converter/Converter/Internal.py @@ -32,34 +32,34 @@ # other var names to CGNS var names name2CGNS = { \ -'x' :'CoordinateX' , \ -'y' :'CoordinateY' , \ -'z' :'CoordinateZ' , \ -'x3d' :'CoordinateX' , \ -'y3d' :'CoordinateY' , \ -'z3d' :'CoordinateZ' , \ -'X' :'CoordinateX' , \ -'Y' :'CoordinateY' , \ -'Z' :'CoordinateZ' , \ -'ro' :'Density' , \ -'rou' :'MomentumX' , \ -'rov' :'MomentumY' , \ -'row' :'MomentumZ' , \ -'rovx' :'MomentumX' , \ -'rovy' :'MomentumY' , \ -'rovz' :'MomentumZ' , \ -'roe' :'EnergyStagnationDensity' , \ -'roE' :'EnergyStagnationDensity' , \ -'rok' :'TurbulentEnergyKineticDensity' , \ -'ronutilde' :'TurbulentSANuTildeDensity' , \ -'roeps' :'TurbulentDissipationDensity' , \ -'roomega' :'TurbulentDissipationRateDensity', \ -'mach' :'Mach' , \ -'psta' :'Pressure' , \ -'tsta' :'Temperature' , \ -'viscrapp' :'Viscosity_EddyMolecularRatio' , \ -'walldistance' :'TurbulentDistance' , \ -'wallglobalindex':'TurbulentDistanceIndex' , \ + 'x' :'CoordinateX' , \ + 'y' :'CoordinateY' , \ + 'z' :'CoordinateZ' , \ + 'x3d' :'CoordinateX' , \ + 'y3d' :'CoordinateY' , \ + 'z3d' :'CoordinateZ' , \ + 'X' :'CoordinateX' , \ + 'Y' :'CoordinateY' , \ + 'Z' :'CoordinateZ' , \ + 'ro' :'Density' , \ + 'rou' :'MomentumX' , \ + 'rov' :'MomentumY' , \ + 'row' :'MomentumZ' , \ + 'rovx' :'MomentumX' , \ + 'rovy' :'MomentumY' , \ + 'rovz' :'MomentumZ' , \ + 'roe' :'EnergyStagnationDensity' , \ + 'roE' :'EnergyStagnationDensity' , \ + 'rok' :'TurbulentEnergyKineticDensity' , \ + 'ronutilde' :'TurbulentSANuTildeDensity' , \ + 'roeps' :'TurbulentDissipationDensity' , \ + 'roomega' :'TurbulentDissipationRateDensity', \ + 'mach' :'Mach' , \ + 'psta' :'Pressure' , \ + 'tsta' :'Temperature' , \ + 'viscrapp' :'Viscosity_EddyMolecularRatio' , \ + 'walldistance' :'TurbulentDistance' , \ + 'wallglobalindex':'TurbulentDistanceIndex' , \ } # Known BCs @@ -668,7 +668,7 @@ def newElements(name='Elements', etype='UserDefined', else: etp, nnodes = eltName2EltNo(etype) if parent is None: node = createNode(name, 'Elements_t', value=[etp,eboundary]) - else: + else: node = createUniqueChild(parent, name, 'Elements_t', value=[etp,eboundary]) #node[1] = node[1].astype(numpy.int32) # force I4 newDataArray('ElementConnectivity', econnectivity, parent=node) @@ -1013,9 +1013,9 @@ def newThermalRelaxationModel(value='Null', parent=None): def newChemicalKineticsModel(value='Null', parent=None): """Create a new ChemicalKineticsModel node.""" ChemicalKineticsModel_l = ['Null', 'UserDefined', 'Frozen', - 'ChemicalEquilibCurveFit', - 'ChemicalEquilibMinimization', - 'ChemicalNonequilib'] + 'ChemicalEquilibCurveFit', + 'ChemicalEquilibMinimization', + 'ChemicalNonequilib'] if value not in ChemicalKineticsModel_l: raise ValueError('newChemicalFineticsModel: value must be in %s.'%str(ChemicalKineticsModel_l)) if parent is None: @@ -1198,7 +1198,7 @@ def newArbitraryGridMotion(name='Motion', value='Null', parent=None): node = createNode(name, 'ArbitraryGridMotion_t') else: node = createUniqueChild(parent, name, 'ArbitraryGridMotion_t') createUniqueChild(node, 'ArbitraryGridMotion', - 'ArbitraryGridMotionType_t', value=value) + 'ArbitraryGridMotionType_t', value=value) return node # -- newUserDefinedData @@ -2718,7 +2718,7 @@ def eltName2EltNo(name): elif nnodes == 6: eltno = 6 elif nnodes == 9: eltno = 25 # D'apres l'enumeration CGNS elif nnodes == 10: eltno = 26 # - # Pour l'ordre 4, rien dans l'enumeration CGNS... + # Pour l'ordre 4, rien dans l'enumeration CGNS... elif name[0:4] == 'QUAD': if len(name) == 4: nnodes = 4 else: nnodes = int(name[5:]) @@ -2726,8 +2726,8 @@ def eltName2EltNo(name): elif nnodes == 8: eltno = 8 elif nnodes == 9: eltno = 9 elif nnodes == 12: eltno = 27 # D'apres l'enumeration CGNS - elif nnodes == 16: eltno = 28 # Attention, ici, je prends par defaut QUAD_16 mais cela pourrait etre QUAD_P4_16... Que faire ? - # Pour l'ordre 4,rien dans l'enumeration CGNS + elif nnodes == 16: eltno = 28 # Attention, ici, je prends par defaut QUAD_16 mais cela pourrait etre QUAD_P4_16... Que faire ? + # Pour l'ordre 4,rien dans l'enumeration CGNS elif name[0:5] == 'TETRA': if len(name) == 5: nnodes = 4 else: nnodes = int(name[6:]) @@ -3650,7 +3650,7 @@ def getZoneDim(zone): # zone type info = zone[2] for i in info: - # Noeud zone type + # Noeud zone type if i[3] == 'ZoneType_t': cellDim = 3 gtype = getValue(i) diff --git a/Cassiopee/Converter/Converter/Mpi.py b/Cassiopee/Converter/Converter/Mpi.py index c184b20e5..4532b5ff6 100644 --- a/Cassiopee/Converter/Converter/Mpi.py +++ b/Cassiopee/Converter/Converter/Mpi.py @@ -45,7 +45,7 @@ def _rmBXZones(t): return None def createBboxDict(t): import Generator.PyTree as G bboxDict = {} - for z in Internal.getZones(t): bboxDict[z[0]] = G.bbox(z) + for z in Internal.getZones(t): bboxDict[z[0]] = G.bbox(z) return bboxDict #print("Warning: Converter:Mpi: Sequential behaviour is forced by MPIRUN=0.") @@ -86,7 +86,7 @@ def _rmBXZones(t): return None def createBboxDict(t): import Generator.PyTree as G bboxDict = {} - for z in Internal.getZones(t): bboxDict[z[0]] = G.bbox(z) + for z in Internal.getZones(t): bboxDict[z[0]] = G.bbox(z) return bboxDict print("Warning: Converter:Mpi: mpi4py is not available. Sequential behaviour.") @@ -97,7 +97,7 @@ def createBboxDict(t): # IN: t: full/loaded skel/partial #============================================================================== def center2Node(t, var=None, cellNType=0, graph=None): - allstructured = 1 + allstructured = 1 for z in Internal.getZones(t): type = Internal.getZoneType(z) if type != 1: allstructured = 0; break @@ -151,7 +151,7 @@ def _addGhostCells(t, b, d, adaptBCs=1, modified=[], fillCorner=1): elif modified is None: variables = []; modified = [] else: variables = modified - _addMXZones(t, depth=2, variables=variables, noCoordinates=False, + _addMXZones(t, depth=2, variables=variables, noCoordinates=False, keepOldNodes=False) #print("%d: addGC(max): Nblocs=%d, NPts(M)=%g"%(rank,len(Internal.getZones(t)), C.getNPts(t)*1./1.e6), flush=True) Internal._addGhostCells(t, t, d, adaptBCs, modified, fillCorner) @@ -159,7 +159,7 @@ def _addGhostCells(t, b, d, adaptBCs=1, modified=[], fillCorner=1): # ancienne version utilisant addXZones #graph = computeGraph(t, type='match', reduction=True) - #_addXZones(t, graph, variables=variable, noCoordinates=False, + #_addXZones(t, graph, variables=variable, noCoordinates=False, # zoneGC=False, keepOldNodes=False) #print("%d: addGC(max): Nblocs=%d, NPts(M)=%g"%(rank,len(Internal.getZones(t)), C.getNPts(t)*1./1.e6), flush=True) #Internal._addGhostCells(t, t, d, adaptBCs, modified, fillCorner) @@ -227,7 +227,7 @@ def trace(text=">>> IN XXX: ", cpu=True, mem=True, stdout=False, reset=False, fi msg += ' [%g secs]'%dt if mem: pid = os.getpid() - try: + try: f = open("/proc/%s/smaps"%(pid)) s = f.readlines() f.close() @@ -250,7 +250,7 @@ def trace(text=">>> IN XXX: ", cpu=True, mem=True, stdout=False, reset=False, fi fileName = "stdout" if fileName == "stdout": - print('%d: %s'%(rank, msg)) + print('%d: %s'%(rank, msg)) sys.stdout.flush() else: # dans des fichiers par processes fileName = fileName.split('.') @@ -269,7 +269,7 @@ def trace(text=">>> IN XXX: ", cpu=True, mem=True, stdout=False, reset=False, fi # Construit un arbre de BBox a partir d'un arbre squelette charge # ou d'un arbre partiel # L'arbre des BBox final est identique sur tous les processeurs -# Nota Bene: Si method='OBB' et weighting=1, les zones de t doivent etre +# Nota Bene: Si method='OBB' et weighting=1, les zones de t doivent etre # formees par des triangles. Pour cela, appliquer au prealable (par exemple): # createBBoxTree(C.convertArray2Tetra(P.exteriorFaces(t)),isOBB=1,weighting=1) #============================================================================== diff --git a/Cassiopee/Converter/Converter/Mpi4py.py b/Cassiopee/Converter/Converter/Mpi4py.py index e36bd6828..51f0d4ae4 100644 --- a/Cassiopee/Converter/Converter/Mpi4py.py +++ b/Cassiopee/Converter/Converter/Mpi4py.py @@ -7,21 +7,21 @@ # Acces a Distributed from .Distributed import readZones, _readZones, convert2PartialTree, _convert2PartialTree, convert2SkeletonTree, readNodesFromPaths, readPyTreeFromPaths, writeNodesFromPaths, mergeGraph, splitGraph -__all__ = ['rank', 'size', 'KCOMM', 'COMM_WORLD', 'SUM', 'MIN', 'MAX', 'LAND', - 'setCommunicator', 'barrier', 'send', 'recv', 'sendRecv', 'sendRecvC', - 'bcast', 'Bcast', 'gather', 'Gather', - 'reduce', 'Reduce', 'allreduce', 'Allreduce', - 'bcastZone', 'gatherZones', 'allgatherZones', - 'createBBTree', 'intersect', 'intersect2', 'allgatherDict', - 'allgather', 'readZones', 'writeZones', 'convert2PartialTree', - 'convert2SkeletonTree', - 'readNodesFromPaths', 'readPyTreeFromPaths', 'writeNodesFromPaths', - 'allgatherTree', 'convertFile2SkeletonTree', 'convertFile2PyTree', - 'convertPyTree2File', 'seq', 'print0', 'printA', - 'createBboxDict', 'computeGraph', 'addXZones', - '_addXZones', '_addMXZones', '_addBXZones', '_addLXZones', - 'rmXZones', '_rmXZones', '_rmMXZones', '_rmBXZones', 'getProcDict', - 'getProc', 'setProc', '_setProc', 'getPropertyDict', 'getProperty', 'COMM_WORLD'] +__all__ = ['rank', 'size', 'KCOMM', 'COMM_WORLD', 'SUM', 'MIN', 'MAX', 'LAND', + 'setCommunicator', 'barrier', 'send', 'recv', 'sendRecv', 'sendRecvC', + 'bcast', 'Bcast', 'gather', 'Gather', + 'reduce', 'Reduce', 'allreduce', 'Allreduce', + 'bcastZone', 'gatherZones', 'allgatherZones', + 'createBBTree', 'intersect', 'intersect2', 'allgatherDict', + 'allgather', 'readZones', 'writeZones', 'convert2PartialTree', + 'convert2SkeletonTree', + 'readNodesFromPaths', 'readPyTreeFromPaths', 'writeNodesFromPaths', + 'allgatherTree', 'convertFile2SkeletonTree', 'convertFile2PyTree', + 'convertPyTree2File', 'seq', 'print0', 'printA', + 'createBboxDict', 'computeGraph', 'addXZones', + '_addXZones', '_addMXZones', '_addBXZones', '_addLXZones', + 'rmXZones', '_rmXZones', '_rmMXZones', '_rmBXZones', 'getProcDict', + 'getProc', 'setProc', '_setProc', 'getPropertyDict', 'getProperty', 'COMM_WORLD'] from mpi4py import MPI import numpy @@ -160,7 +160,7 @@ def sendRecvC(datas, graph): for oppNode in g: # Envoie les datas necessaires au noeud oppose #print('%d: On envoie a %d: %s'%(rank,oppNode,g[oppNode])) - if oppNode in datas: + if oppNode in datas: s = converter.iSend(datas[oppNode], oppNode, rank, KCOMM) else: s = converter.iSend(None, oppNode, rank, KCOMM) @@ -211,7 +211,7 @@ def intersect(zone, BBTree): return converter.intersect(minBBox, maxBBox, BBTree) def intersect2(t, BBTree): - zones = Internal.getZones(t) + zones = Internal.getZones(t) inBB = numpy.empty((6*len(zones)), dtype=numpy.float64) for c, z in enumerate(zones): gc = Internal.getNodeFromName1(z, Internal.__GridCoordinates__) @@ -270,7 +270,7 @@ def allgather(data): ret = KCOMM.allgather(data) # Si dictionnaire de listes, on fusionne les listes # Si dictionnaire d'autre chose, on append dans des listes - if isinstance(data, dict): + if isinstance(data, dict): out = {} for r in ret: for k in r: @@ -376,7 +376,7 @@ def bcastZone(z, root=0, coord=True, variables=[]): if rank != root: # Reconstruction de la zone flowSol = Internal.__FlowSolutionNodes__ if loc == 'nodes' else Internal.__FlowSolutionCenters__ - if cpt == 0: + if cpt == 0: Internal._createUniqueChild(zp, flowSol, 'FlowSolution_t') n = Internal.getNodeFromName1(zp, flowSol) if loc == 'centers': Internal._createUniqueChild(n, 'GridLocation', 'GridLocation_t', 'CellCenter') @@ -384,7 +384,7 @@ def bcastZone(z, root=0, coord=True, variables=[]): n = Internal.getNodeFromName1(zp, flowSol) Internal._createUniqueChild(n, var, 'DataArray_t', value=pv) - if rank == root: + if rank == root: zp = Internal.copyRef(z) # suppression coord si coord=False et des autres champs if not coord: Internal._rmNodesFromType(zp, 'GridCoordinates_t') @@ -392,14 +392,14 @@ def bcastZone(z, root=0, coord=True, variables=[]): else: varszp = C.getVarNames(zp, excludeXYZ=True, loc='both')[0] for var in varszp: - if var not in variables: + if var not in variables: Internal._rmNodesFromName(zp, var.replace('centers:','')) return zp # All gather une liste de zones, recuperation identique sur tous les procs # dans une liste a plat # Partage les coordonnees si coord=True -# Partage les variables renseignees et supprime les autres +# Partage les variables renseignees et supprime les autres def allgatherZones(zones, coord=True, variables=[]): # Chaque processeur bcast ses zones vers les autres ranks zones = Internal.getZones(zones) @@ -415,7 +415,7 @@ def allgatherZones(zones, coord=True, variables=[]): # varszp = C.getVarNames(zp, excludeXYZ=True, loc='both')[0] # for var in varszp: # if var not in variables: Internal._rmNodesFromName(zp, var.replace('centers:','')) - else: + else: zp = bcastZone(None, root=i, coord=coord, variables=variables) #if rank == i: zp = zones[cz] @@ -490,11 +490,11 @@ def _merge__(t): # Avec recuperation de toutes les zones # si ignoreProcNodes=True, toutes les zones non squelette sont ecrites, # sinon ecrit seulement les zones procNode correspondant a rank -# si merge=True, effectue un merge prealable des arbres de tous les procs +# si merge=True, effectue un merge prealable des arbres de tous les procs # sans zones (pour recuperer toutes les bases et les data des bases) #============================================================================== -def convertPyTree2File(t, fileName, format=None, links=[], - ignoreProcNodes=False, merge=True): +def convertPyTree2File(t, fileName, format=None, links=[], + ignoreProcNodes=False, merge=True): """Write a skeleton or partial tree.""" tp = convert2PartialTree(t) tp = C.deleteEmptyZones(tp) @@ -565,7 +565,7 @@ def createBboxDict(t): #============================================================================== # Calcule le graph -# graph[proc1][proc2] est la liste des zones de proc1 intersectant au moins +# graph[proc1][proc2] est la liste des zones de proc1 intersectant au moins # une zone de proc2 # IN: type: type de graph # IN: reduction: si True, on assure que le graph est le meme sur tous @@ -575,11 +575,11 @@ def createBboxDict(t): # IN: intersectionsDict: dictionnaire d'intersections. Consulter la doc de # computeGraph dans Distributed.py pour plus de details. #============================================================================== -def computeGraph(t, type='bbox', t2=None, procDict=None, reduction=True, +def computeGraph(t, type='bbox', t2=None, procDict=None, reduction=True, intersectionsDict=None, exploc=False, procDict2=None, it=0): """Return the communication graph for different block relation types.""" if not procDict: procDict = getProcDict(t) - graph = Distributed.computeGraph(t, type, t2, procDict, rank, + graph = Distributed.computeGraph(t, type, t2, procDict, rank, intersectionsDict, exploc, procDict2, it) if reduction: @@ -614,22 +614,22 @@ def GetIntersectionBbox(bbox1, bbox2): # if subr=True, the ZoneSubRegions are sent # if zoneGC=True, the ZoneGridConnectivity are sent #============================================================================== -def addXZones(t, graph, variables=None, noCoordinates=False, - cartesian=False, subr=True, +def addXZones(t, graph, variables=None, noCoordinates=False, + cartesian=False, subr=True, keepOldNodes=True, zoneGC=True): """Add zones specified in graph on current proc.""" tp = Internal.copyRef(t) - _addXZones(tp, graph, variables, noCoordinates, cartesian, subr, - keepOldNodes, zoneGC) + _addXZones(tp, graph, variables, noCoordinates, cartesian, subr, + keepOldNodes, zoneGC) return tp -def _addXZones(t, graph, variables=None, noCoordinates=False, - cartesian=False, subr=True, +def _addXZones(t, graph, variables=None, noCoordinates=False, + cartesian=False, subr=True, keepOldNodes=True, zoneGC=True): """Add zones specified in graph on current proc.""" if not graph: return t reqs = [] - if cartesian: import Compressor.PyTree as Compressor + if cartesian: import Compressor.PyTree as Compressor if rank in graph: g = graph[rank] # graph du proc courant for oppNode in g: @@ -646,18 +646,18 @@ def _addXZones(t, graph, variables=None, noCoordinates=False, elif variables == []: vars = None else: vars = variables zonep = C.extractVars(zone, vars=variables, keepOldNodes=False) - if noCoordinates: C._rmVars(zonep, ['CoordinateX', 'CoordinateY', 'CoordinateZ']) + if noCoordinates: C._rmVars(zonep, ['CoordinateX', 'CoordinateY', 'CoordinateZ']) if cartesian: Compressor._compressCartesian(zonep) - if zoneGC: + if zoneGC: zGC = Internal.getNodeFromType1(zone, 'ZoneGridConnectivity_t') if zGC is not None: zonep[2].append(zGC) elif variables is not None: # all nodes but vars and coordinates v = C.getVarNames(zone, excludeXYZ=True)[0] - for i in variables: + for i in variables: if i in v: v.remove(i) if noCoordinates: v += ['CoordinateX', 'CoordinateY', 'CoordinateZ'] zonep = C.rmVars(zone, v) - if cartesian: Compressor._compressCartesian(zonep, subr=subr) + if cartesian: Compressor._compressCartesian(zonep, subr=subr) else: # full zone zonep = Internal.copyRef(zone) if cartesian: Compressor._compressCartesian(zonep) @@ -676,7 +676,7 @@ def _addXZones(t, graph, variables=None, noCoordinates=False, if cartesian: import Compressor.PyTree as Compressor Compressor._uncompressCartesian(z) - Internal.createChild(z, 'XZone', 'UserDefinedData_t') + Internal.createChild(z, 'XZone', 'UserDefinedData_t') ret = z[0].split('/',1) if len(ret) == 2: @@ -706,7 +706,7 @@ def _addXZones(t, graph, variables=None, noCoordinates=False, # Recupere les zones specifiees dans le graph, les ajoute a l'arbre local t # if layers not None, only communicate the desired number of layers # bboxDict is dict with the zones of t as keys and their specific bboxes as key values, used when layers not None -# if subr=True, the ZoneSubRegions are kept during the exchange +# if subr=True, the ZoneSubRegions are kept during the exchange #============================================================================== def addLXZones(t, graph, variables=None, cartesian=False, interDict=[], bboxDict={}, layers=2, subr=True): """Add zones specified in graph on current proc.""" @@ -719,7 +719,7 @@ def _addLXZones(t, graph, variables=None, cartesian=False, interDict=[], bboxDic # create bboXDict if necessary if not bboxDict: bboxDict = createBboxDict(t) reqs = [] - if cartesian: import Compressor.PyTree as Compressor + if cartesian: import Compressor.PyTree as Compressor if rank in graph: g = graph[rank] # graph du proc courant for oppNode in g: @@ -731,7 +731,7 @@ def _addLXZones(t, graph, variables=None, cartesian=False, interDict=[], bboxDic zone = Internal.getNodeFromName2(t, n) if variables is not None: v = C.getVarNames(zone, excludeXYZ=True)[0] - for i in variables: + for i in variables: if i in v: v.remove(i) zonep = C.rmVars(zone, v) if cartesian: @@ -775,12 +775,12 @@ def _addLXZones(t, graph, variables=None, cartesian=False, interDict=[], bboxDic import Compressor.PyTree as Compressor Compressor._uncompressCartesian(z) #print('%d: recoit la zone %s.'%(rank,z[0])) - Internal.createChild(z, 'XZone', 'UserDefinedData_t') - # Existe deja? + Internal.createChild(z, 'XZone', 'UserDefinedData_t') + # Existe deja? zone = Internal.getNodeFromName2(t, z[0]) if zone is not None: # replace if cartesian: # a cartesian block might be splitted into several parts... - # Hence the counter, to avoid two identical zone names in the tree + # Hence the counter, to avoid two identical zone names in the tree cpt = 1 z[0] = z[0][:-2]+'#'+str(cpt)+z[0][-2:] while Internal.getNodeFromName2(t, z[0]) is not None: @@ -849,7 +849,7 @@ def _updateGridConnectivity(a): for g in gcs: nodes = Internal.getNodesFromType1(g, 'GridConnectivity1to1_t') for n in nodes: - # Recherche le nom de la bandelette en raccord + # Recherche le nom de la bandelette en raccord oppName = Internal.getValue(n) # suffix @@ -881,12 +881,12 @@ def _updateGridConnectivity(a): p = Internal.window2Range(p) Internal.setValue(prd, p) - # Update XZone + # Update XZone gcopp = Internal.getNodesFromType1(zopp, 'ZoneGridConnectivity_t') match = Internal.getNodesFromType1(gcopp, 'GridConnectivity1to1_t')[0] # 1 seul match dans les XZone pr = Internal.getNodeFromName1(match, 'PointRange') - Internal.setValue(pr, p) + Internal.setValue(pr, p) return None @@ -900,10 +900,10 @@ def _revertMXGridConnectivity(a): for z in zonesReal: gcs = Internal.getNodesFromType1(z, 'ZoneGridConnectivity_t') - for g in gcs: + for g in gcs: nodes = Internal.getNodesFromType1(g, 'GridConnectivity1to1_t') for n in nodes: - # Recherche le nom de la bandelette en raccord + # Recherche le nom de la bandelette en raccord oppName = Internal.getValue(n) zopp = Internal.getNodeFromName(a, oppName) @@ -934,10 +934,10 @@ def _revertBXGridConnectivity(a): for z in zonesReal: gcs = Internal.getNodesFromType1(z, 'ZoneGridConnectivity_t') - for g in gcs: + for g in gcs: nodes = Internal.getNodesFromType1(g, 'GridConnectivity1to1_t') for n in nodes: - # Recherche le nom de la bandelette en raccord + # Recherche le nom de la bandelette en raccord oppName = Internal.getValue(n) zopp = Internal.getNodeFromName(a, oppName) if zopp is not None: @@ -958,12 +958,12 @@ def _revertBXGridConnectivity(a): prr = Internal.getNodeFromName1(n,'PointRange') p2 = Internal.range2Window(prr[1]) for i in range(6): - if p2[i] != p[i]: + if p2[i] != p[i]: remove=False break if not remove: p = Internal.window2Range(p) - Internal.setValue(prd, p) + Internal.setValue(prd, p) else: Internal._rmNodesByName(z,n[0]) @@ -972,7 +972,7 @@ def _revertBXGridConnectivity(a): gctype = Internal.getNodeFromType(n,'GridConnectivityType_t') gctype = Internal.getValue(gctype) if gctype == 'Abutting': - # Recherche le nom de la bandelette en raccord + # Recherche le nom de la bandelette en raccord oppName = Internal.getValue(n) zopp = Internal.getNodeFromName(a, oppName) if zopp is not None: @@ -1004,21 +1004,21 @@ def _addMXZones(a, depth=2, variables=None, noCoordinates=False, keepOldNodes=Tr elif variables == []: vars = None else: vars = variables zsp = C.extractVars(zs, vars=variables, keepOldNodes=False) - if noCoordinates: C._rmVars(zsp, ['CoordinateX', 'CoordinateY', 'CoordinateZ']) + if noCoordinates: C._rmVars(zsp, ['CoordinateX', 'CoordinateY', 'CoordinateZ']) for c, z in enumerate(zsp): ns = Internal.getNodeFromName1(zs[c], 'XZone') if ns is not None: z[2].append(ns) ns = Internal.getNodeFromName1(zs[c], '.Solver#ownData') - if ns is not None: + if ns is not None: if 'Parameter_int' in ns[2]: ns[2].remove('Parameter_int') if 'Parameter_real' in ns[2]: ns[2].remove('Parameter_real') z[2].append(ns) ns = Internal.getNodesFromType1(zs[c], 'ZoneGridConnectivity_t') - z[2] += ns + z[2] += ns zs = zsp elif variables is not None: v = C.getVarNames(zs, excludeXYZ=True)[0] - for i in variables: + for i in variables: if i in v: v.remove(i) if noCoordinates: v += ['CoordinateX', 'CoordinateY', 'CoordinateZ'] C._rmVars(zs, v) @@ -1063,7 +1063,7 @@ def subzone(a, indMin, indMax, supp): # Ajoute les bandelettes des autres procs sur le procs locaux # si allB=True, les 6 bandelettes de chaque zone voisine sont ramenees (necessaire pour connectMatchPeriodic). -# IN: variables: None (all vars), ['Density'], [] +# IN: variables: None (all vars), ['Density'], [] def _addBXZones(a, depth=2, allB=False, variables=None): import Generator.PyTree as G # Calcul des bbox des zones locales @@ -1099,10 +1099,10 @@ def _addBXZones(a, depth=2, allB=False, variables=None): # Bandelettes non recouvrantes b1 = subzone(z, (1,1,1), (ri1,nj,nk), 'S1') b2 = subzone(z, (ri2,1,1), (ni,nj,nk), 'S2') - b3 = subzone(z, (rip1,1,1), (rip2,rj1,nk), 'S3') - b4 = subzone(z, (rip1,rj2,1), (rip2,nj,nk), 'S4') - b5 = subzone(z, (rip1,rjp1,1), (rip2,rjp2,rk1), 'S5') - b6 = subzone(z, (rip1,rjp1,rk2), (rip2,rjp2,nk), 'S6') + b3 = subzone(z, (rip1,1,1), (rip2,rj1,nk), 'S3') + b4 = subzone(z, (rip1,rj2,1), (rip2,nj,nk), 'S4') + b5 = subzone(z, (rip1,rjp1,1), (rip2,rjp2,rk1), 'S5') + b6 = subzone(z, (rip1,rjp1,rk2), (rip2,rjp2,nk), 'S6') if variables is not None: # no var b1 = C.extractVars(b1, vars=variables, keepOldNodes=False) @@ -1148,11 +1148,11 @@ def _addBXZones(a, depth=2, allB=False, variables=None): if not allB: data_i[k] = sz[k] else: - zname = k[:len(k)-2] + zname = k[:len(k)-2] if zname not in zone_i: - zone_i.append(zname) + zone_i.append(zname) - if allB: + if allB: for z in zone_i: data_i[z+'S1'] = sz[z+'S1'] data_i[z+'S2'] = sz[z+'S2'] diff --git a/Cassiopee/Converter/Converter/Partial.py b/Cassiopee/Converter/Converter/Partial.py index a09367224..b0e74b7ad 100644 --- a/Cassiopee/Converter/Converter/Partial.py +++ b/Cassiopee/Converter/Converter/Partial.py @@ -2,8 +2,8 @@ # -- convertPyTree2FileMPI def convertPyTree2FileMPI(t, fileName, comm, SkeletonTree, ParallelHDF=False, - format=None, isize=4, rsize=8, - endian='big', colormap=0, dataFormat='%.9e '): + format=None, isize=4, rsize=8, + endian='big', colormap=0, dataFormat='%.9e '): """Convert a pyTree to a file. Usage: convertPyTree2File(t, fileName, format, options)""" diff --git a/Cassiopee/Converter/Converter/PyTree.py b/Cassiopee/Converter/Converter/PyTree.py index 5a6f2abe1..126f6e306 100755 --- a/Cassiopee/Converter/Converter/PyTree.py +++ b/Cassiopee/Converter/Converter/PyTree.py @@ -462,7 +462,7 @@ def getValue__(t, var, ind): for i in v[2]: if ((i[0] == var or var == Internal.__GridCoordinates__) and (loc == 'nodes' or loc == '*') - and i[3] == 'DataArray_t'): + and i[3] == 'DataArray_t'): if cellDim == 3: result.append(i[1][im,jm,km]) elif cellDim == 2: result.append(i[1][im,jm]) else: result.append(i[1][im]) @@ -473,7 +473,7 @@ def getValue__(t, var, ind): for i in v[2]: if ((i[0] == var or var == Internal.__FlowSolutionNodes__) and (loc == 'nodes' or loc == '*') - and i[3] == 'DataArray_t'): + and i[3] == 'DataArray_t'): if cellDim == 3: result.append(i[1][im,jm,km]) elif cellDim == 2: result.append(i[1][im,jm]) else: result.append(i[1][im]) @@ -484,7 +484,7 @@ def getValue__(t, var, ind): for i in v[2]: if ((i[0] == var or var == Internal.__FlowSolutionCenters__) and (loc == 'centers' or loc == '*') - and i[3] == 'DataArray_t'): + and i[3] == 'DataArray_t'): if cellDim == 3: result.append(i[1][im,jm,km]) elif cellDim == 2: result.append(i[1][im,jm]) else: result.append(i[1][im]) @@ -496,7 +496,7 @@ def getValue__(t, var, ind): for i in v[2]: if ((i[0] == var or var == Internal.__GridCoordinates__) and (loc == 'nodes' or loc == '*') - and i[3] == 'DataArray_t'): + and i[3] == 'DataArray_t'): result.append(i[1][ind]) # FlowSolutionNodes @@ -505,7 +505,7 @@ def getValue__(t, var, ind): for i in v[2]: if ((i[0] == var or var == Internal.__FlowSolutionNodes__) and (loc == 'nodes' or loc == '*') - and i[3] == 'DataArray_t'): + and i[3] == 'DataArray_t'): result.append(i[1][ind]) # FlowSolutionCenters @@ -514,7 +514,7 @@ def getValue__(t, var, ind): for i in v[2]: if ((i[0] == var or var == Internal.__FlowSolutionCenters__) and (loc == 'centers' or loc == '*') - and i[3] == 'DataArray_t'): + and i[3] == 'DataArray_t'): result.append(i[1][ind]) if len(result) == 1: return result[0] @@ -568,7 +568,7 @@ def setValue(t, var, ind, val): if v is not None: for i in v[2]: if ((i[0] == var or var == Internal.__GridCoordinates__) - and (loc == 'nodes' or loc == '*')): + and (loc == 'nodes' or loc == '*')): if cellDim == 3: i[1][im,jm,km] = val[c]; c += 1 elif cellDim == 2: @@ -580,7 +580,7 @@ def setValue(t, var, ind, val): if v is not None: for i in v[2]: if ((i[0] == var or var == Internal.__FlowSolutionNodes__) - and (loc == 'nodes' or loc == '*')): + and (loc == 'nodes' or loc == '*')): if cellDim == 3: i[1][im,jm,km] = val[c]; c += 1 elif cellDim == 2: @@ -592,7 +592,7 @@ def setValue(t, var, ind, val): if v is not None: for i in v[2]: if ((i[0] == var or var == Internal.__FlowSolutionCenters__) - and (loc == 'centers' or loc == '*')): + and (loc == 'centers' or loc == '*')): if cellDim == 3: i[1][im,jm,km] = val[c]; c += 1 elif cellDim == 2: @@ -605,7 +605,7 @@ def setValue(t, var, ind, val): if v is not None: for i in v[2]: if ((i[0] == var or var == Internal.__GridCoordinates__) - and (loc == 'nodes' or loc == '*')): + and (loc == 'nodes' or loc == '*')): i[1][ind] = val[c]; c += 1 # FlowSolutionNodes @@ -613,7 +613,7 @@ def setValue(t, var, ind, val): if v is not None: for i in v[2]: if ((i[0] == var or var == Internal.__FlowSolutionNodes__) - and (loc == 'nodes' or loc == '*')): + and (loc == 'nodes' or loc == '*')): i[1][ind] = val[c]; c += 1 # FlowSolutionCenters @@ -621,7 +621,7 @@ def setValue(t, var, ind, val): if v is not None: for i in v[2]: if ((i[0] == var or var == Internal.__FlowSolutionCenters__) - and (loc == 'centers' or loc == '*')): + and (loc == 'centers' or loc == '*')): i[1][ind] = val[c]; c += 1 return None @@ -1060,7 +1060,7 @@ def convertFile2PyTree(fileName, format=None, nptsCurve=20, nptsLine=2, import CPlot.Tk as CTK hook = OCC.readCAD(fileName, format) if hmax == 0.: - # auto setting + # auto setting (hmin,hmax,hausd) = OCC.occ.analyseEdges(hook) CTK.CADHOOK = hook t = OCC.meshAll(hook, hmax, hmax, hausd) # constant hmax @@ -1263,8 +1263,8 @@ def convertPyTree2FilePartial(t, fileName, comm, Filter, ParallelHDF=False, format = 'bin_hdf' if not ParallelHDF: - # :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - # > Write Tree Data except Data in Filter + # :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + # > Write Tree Data except Data in Filter SkeletonTree = Internal.copyRef(t) for path in Filter: #print(path) @@ -1371,7 +1371,7 @@ def getField(name, t, api=1): for z in zones: dim = Internal.getZoneDim(z) if dim[0] == 'Structured': - #np = dim[1]*dim[2]*dim[3] + #np = dim[1]*dim[2]*dim[3] connects = [] else: #np = dim[1] @@ -1614,7 +1614,7 @@ def setFields(arrays, t, loc, writeDim=True): if variable != v: renamed = 1 else: variable = v if (variable == 'CoordinateX' or variable == 'CoordinateY' - or variable == 'CoordinateZ') and loc == 'nodes': + or variable == 'CoordinateZ') and loc == 'nodes': coordNode = Internal.getNodeFromName1(z, Internal.__GridCoordinates__) if coordNode is None: info = [Internal.__GridCoordinates__, None, [], 'GridCoordinates_t'] @@ -3583,10 +3583,10 @@ def convertSurfaceNGon(a, rmEmptyNFaceElements=True): nface = Internal.createNode('NFaceElements', 'Elements_t', parent=z, value=numpy.array([23,0], - dtype=Internal.E_NpyInt, order='F')) + dtype=Internal.E_NpyInt, order='F')) value = numpy.array([rnGon[1]+1, rnGon[1]+1], - dtype=Internal.E_NpyInt, order='F') + dtype=Internal.E_NpyInt, order='F') Internal.createNode('ElementRange', 'IndexRange_t', parent=nface, value=value) value = numpy.array([], dtype=Internal.E_NpyInt, order='F') @@ -4118,7 +4118,7 @@ def _addBC2UnstructZone__(z, bndName, bndType, elementList, elementRange, if bndType1 == 'BCMatch' or bndType1 == 'Abutting1to1': if (zoneDonor == [] or - faceListDonor is None and subzone is None and elementListDonor is None and elementRangeDonor is None): + faceListDonor is None and subzone is None and elementListDonor is None and elementRangeDonor is None): raise ValueError("addBC2Zone: unstructured match connectivity requires a donor zone and a faceListDonor or a subzone or an elementRangeDonor or an elementListDonor.") # si subzone fournie: cree le elementRangeDonor if subzone is not None: @@ -4499,7 +4499,7 @@ def _recoverBCs1(a, T, tol=1.e-11): bcz = Internal.getNodeFromNameAndType(z, newNameOfBC, 'BC_t') ds = Internal.newBCDataSet(name='BCDataSet', value='UserDefined', - gridLocation='FaceCenter', parent=bcz) + gridLocation='FaceCenter', parent=bcz) d = Internal.newBCData('NeumannData', parent=ds) for node in Internal.getChildren(fsc): @@ -5127,7 +5127,7 @@ def _keepBCDataSet(zbc, zorig, bc, extrapFlow=True): if not extrapFlow: Internal._rmNodesByName(zbc, Internal.__FlowSolutionCenters__) f = Internal.createUniqueChild(zbc, Internal.__FlowSolutionCenters__, - 'FlowSolution_t') + 'FlowSolution_t') Internal.newGridLocation(value='CellCenter', parent=f) for d in datas: Internal.createUniqueChild(f, d[0], d[3], value=d[1]) return None @@ -5299,7 +5299,7 @@ def extractBCOfType(t, bndType, topTree=None, reorder=True, extrapFlow=True, shi res = [] if bndType == 'BCMatch': for z in zones: - # Cherche GridConnectivity1to1_t + # Cherche GridConnectivity1to1_t nodes = Internal.getNodesFromType2(z, 'GridConnectivity1to1_t') for i in nodes: getBC__(i, z, T, res, reorder=reorder, extrapFlow=extrapFlow, shift=shift) # Cherche GridConnectivity_t + Abutting1to1 @@ -5359,7 +5359,7 @@ def extractBCOfName(t, bndName, reorder=True, extrapFlow=True, shift=0): res = [] if len(names) == 1: # real bnd name for z in Internal.getZones(t): - # Pas de niveau 2 car pas de wild card autorisee dans ce cas + # Pas de niveau 2 car pas de wild card autorisee dans ce cas nodes = Internal.getNodesFromName(z, bndName) for i in nodes: if Internal.getType(i) in ['BC_t', 'GridConnectivity1to1_t', 'GridConnectivity_t']: @@ -5441,7 +5441,7 @@ def _mergeGCs(z): gctype = Internal.getNodeFromType(gc,'GridConnectivityType_t') gctype = Internal.getValue(gctype) if gctype == 'Abutting1to1': - #GCP = Internal.getNodeFromType(gc,'GridConnectivityProperty_t') + #GCP = Internal.getNodeFromType(gc,'GridConnectivityProperty_t') PL = Internal.getNodeFromName(gc,'PointList')[1] PLD = Internal.getNodeFromName(gc,'PointListDonor')[1] if zoppname not in dictOfGCs: @@ -5547,7 +5547,7 @@ def computeBCMatchField(z, allMatch, variables=None): if zoneType == 1: # Structured mesh # Tableau des champs a extraire for var in varList: - # on verifie qu'on cherche des variables aux centres + # on verifie qu'on cherche des variables aux centres spl = var.split(':') if len(spl) != 1: if spl[0] != 'centers': @@ -5678,13 +5678,13 @@ def computeBCMatchField(z, allMatch, variables=None): # fldFace : champ de la zone donneuse extrapole sur les faces frontieres # =================================================================================== def extractBCMatch(zdonor,gc,dimzR,variables=None): - # On verifie que gc donne le raccord dans zdonor - # ============================================== - # print("================================================") - # print("zdonor :", zdonor[0]) - # print("gc : ", gc[0]) - # if Internal.getValue(gc) != zdonor[0]: - # raise ValueError("extractBCMatch: GridConnectivity doesn't match zdonor.") + # On verifie que gc donne le raccord dans zdonor + # ============================================== + # print("================================================") + # print("zdonor :", zdonor[0]) + # print("gc : ", gc[0]) + # if Internal.getValue(gc) != zdonor[0]: + # raise ValueError("extractBCMatch: GridConnectivity doesn't match zdonor.") dim = Internal.getZoneDim(zdonor) @@ -5715,7 +5715,7 @@ def extractBCMatch(zdonor,gc,dimzR,variables=None): if zoneType == 1: # Structured mesh # Tableau des champs a extraire for var in varList: - # on verifie qu'on cherche des variables aux centres + # on verifie qu'on cherche des variables aux centres spl = var.split(':') if len(spl) != 1: if spl[0] != 'centers': @@ -5778,8 +5778,8 @@ def extractBCMatch(zdonor,gc,dimzR,variables=None): else: t3 = 0 [indR,fldD] = Converter.converter.extractBCMatchStruct(fields,(iminD,jminD,kminD,imaxD,jmaxD,kmaxD), - (iminR,jminR,kminR,imaxR,jmaxR,kmaxR), - (niR,njR,nkR),(t1,t2,t3)) + (iminR,jminR,kminR,imaxR,jmaxR,kmaxR), + (niR,njR,nkR),(t1,t2,t3)) else: fldD = None indR = None @@ -6472,7 +6472,7 @@ def center2Node(t, var=None, cellNType=0, useGhost=True): ghost = Internal.getNodeFromName(t, 'ZoneRind') if var is None: # all grid - # solution en centres + # solution en centres res = Internal.getNodesFromName3(t, Internal.__FlowSolutionCenters__) fieldsc = [] if res != []: @@ -7335,10 +7335,10 @@ def mergeConnectivity(z1, z2=None, boundary=0): def _mergeConnectivity(z1, z2=None, boundary=0, shared=False): if z2 is None: - # Checking that z1 is a list of zones + # Checking that z1 is a list of zones zones = Internal.getZones(z1) if len(zones) > 1: - # Merge all BE connectivities within z1 + # Merge all BE connectivities within z1 return _mergeConnectivities(zones, boundary, shared) else: return z1 @@ -7476,7 +7476,7 @@ def _mergeConnectivity(z1, z2=None, boundary=0, shared=False): nebb = neb node = Internal.createUniqueChild(z1, z2[0], 'Elements_t', value=[eltType,nebb]) Internal.createUniqueChild(node, 'ElementRange', 'IndexRange_t', - value=[maxElt+1,maxElt+neb]) + value=[maxElt+1,maxElt+neb]) oldc = Internal.getNodeFromName2(z2, 'ElementConnectivity')[1] newc = numpy.copy(oldc) newc[:] = ids[oldc[:]-1] @@ -7672,7 +7672,7 @@ def breakConnectivity(t): for c in range(l): z = b[2][c] if z[3] == 'Zone_t': - # compte les connectivites elements (hors boundary) + # compte les connectivites elements (hors boundary) connects = Internal.getElementNodes(z) N = len(connects) if N <= 1: break # une seule connectivite @@ -8262,4 +8262,3 @@ def createSockets(nprocs=1, port=15555): def listen(s): """Listen to one socket.""" return Converter.listen(s) - diff --git a/Cassiopee/Converter/Converter/cgnskeywords2.py b/Cassiopee/Converter/Converter/cgnskeywords2.py index c7ce1cc71..2c6ef6f6e 100644 --- a/Cassiopee/Converter/Converter/cgnskeywords2.py +++ b/Cassiopee/Converter/Converter/cgnskeywords2.py @@ -1,9 +1,9 @@ # --------------------------------------------------------------------------- -# Taken from pyCGNS - Python package for CFD General Notation System - +# Taken from pyCGNS - Python package for CFD General Notation System - # See license.txt file in the root directory of this Python module source -# Written by M. Poinot +# Written by M. Poinot # --------------------------------------------------------------------------- -# +# """ TYPES, ENUMERATES, CONSTANTS, NAMES from CGNS/MLL @@ -72,18 +72,18 @@ def enumAsKeyDict(l): InwardNormalIndex_ts2 = '"int[IndexDimension]"' weirdSIDStypes={ - Transform_ts2: IntIndexDimension_ts, - DiffusionModel_ts2: DiffusionModel_ts, - EquationDimension_ts2: EquationDimension_ts, - InwardNormalIndex_ts2: IntIndexDimension_ts, - } + Transform_ts2: IntIndexDimension_ts, + DiffusionModel_ts2: DiffusionModel_ts, + EquationDimension_ts2: EquationDimension_ts, + InwardNormalIndex_ts2: IntIndexDimension_ts, +} weirdSIDStypes_={ - Transform_ts: Transform_ts2, - DiffusionModel_ts: DiffusionModel_ts2, - EquationDimension_ts: EquationDimension_ts2, - InwardNormalIndex_ts: InwardNormalIndex_ts2, - } + Transform_ts: Transform_ts2, + DiffusionModel_ts: DiffusionModel_ts2, + EquationDimension_ts: EquationDimension_ts2, + InwardNormalIndex_ts: InwardNormalIndex_ts2, +} # -------------------------------------------------- (SIDS) # SIDS @@ -184,7 +184,7 @@ def enumAsKeyDict(l): Candle_s = "Candle" Carcel_s = "Carcel" Hefner_s = "Hefner" -Violle_s = "Violle" +Violle_s = "Violle" LuminousIntensityUnits_l = [Null_s,UserDefined_s, Candela_s,Candle_s,Carcel_s,Hefner_s,Violle_s] @@ -200,9 +200,9 @@ def enumAsKeyDict(l): AdditionalExponents_s = "AdditionalExponents" AllDimensionalUnits_l = TimeUnits_l+MassUnits_l+LengthUnits_l\ - +TemperatureUnits_l+AngleUnits_l + +TemperatureUnits_l+AngleUnits_l AllAdditionalUnits_l = LuminousIntensityUnits_l+SubstanceAmountUnits_l\ - +ElectricCurrentUnits_l + +ElectricCurrentUnits_l AllUnits_l = AllDimensionalUnits_l+AllAdditionalUnits_l # -------------------------------------------------- @@ -889,15 +889,15 @@ def enumAsKeyDict(l): BCWallViscousIsothermal_s = "BCWallViscousIsothermal" BCType_l = [Null_s,UserDefined_s, - BCAxisymmetricWedge_s,BCDegenerateLine_s,BCDegeneratePoint_s, - BCDirichlet_s,BCExtrapolate_s,BCFarfield_s, - BCGeneral_s,BCInflow_s,BCInflowSubsonic_s,BCInflowSupersonic_s, - BCNeumann_s,BCOutflow_s,BCOutflowSubsonic_s,BCOutflowSupersonic_s, - BCSymmetryPlane_s,BCSymmetryPolar_s, - BCTunnelInflow_s,BCTunnelOutflow_s, - BCWall_s,BCWallInviscid_s,BCWallViscous_s, - BCWallViscousHeatFlux_s,BCWallViscousIsothermal_s, - FamilySpecified_s] + BCAxisymmetricWedge_s,BCDegenerateLine_s,BCDegeneratePoint_s, + BCDirichlet_s,BCExtrapolate_s,BCFarfield_s, + BCGeneral_s,BCInflow_s,BCInflowSubsonic_s,BCInflowSupersonic_s, + BCNeumann_s,BCOutflow_s,BCOutflowSubsonic_s,BCOutflowSupersonic_s, + BCSymmetryPlane_s,BCSymmetryPolar_s, + BCTunnelInflow_s,BCTunnelOutflow_s, + BCWall_s,BCWallInviscid_s,BCWallViscous_s, + BCWallViscousHeatFlux_s,BCWallViscousIsothermal_s, + FamilySpecified_s] BCType = stringAsKeyDict(BCType_l) BCType_ = enumAsKeyDict(BCType_l) (Null,UserDefined, @@ -1176,24 +1176,24 @@ def enumAsKeyDict(l): ElementType_s = "ElementType" Elements_s = "Elements" ElementType_l = [Null_s, UserDefined_s, NODE_s, BAR_2_s, BAR_3_s, - TRI_3_s, TRI_6_s, QUAD_4_s, QUAD_8_s, QUAD_9_s, - TETRA_4_s, TETRA_10_s, PYRA_5_s, PYRA_14_s, - PENTA_6_s, PENTA_15_s, PENTA_18_s, - HEXA_8_s, HEXA_20_s, HEXA_27_s, MIXED_s, PYRA_13_s, - NGON_n_s, NFACE_n_s, BAR_4_s, TRI_9_s, TRI_10_s, QUAD_12_s, - QUAD_16_s, TETRA_16_s, TETRA_20_s, PYRA_21_s, PYRA_29_s, - PYRA_30_s, PENTA_24_s, PENTA_38_s, PENTA_40_s, HEXA_32_s, - HEXA_56_s, HEXA_64_s ] + TRI_3_s, TRI_6_s, QUAD_4_s, QUAD_8_s, QUAD_9_s, + TETRA_4_s, TETRA_10_s, PYRA_5_s, PYRA_14_s, + PENTA_6_s, PENTA_15_s, PENTA_18_s, + HEXA_8_s, HEXA_20_s, HEXA_27_s, MIXED_s, PYRA_13_s, + NGON_n_s, NFACE_n_s, BAR_4_s, TRI_9_s, TRI_10_s, QUAD_12_s, + QUAD_16_s, TETRA_16_s, TETRA_20_s, PYRA_21_s, PYRA_29_s, + PYRA_30_s, PENTA_24_s, PENTA_38_s, PENTA_40_s, HEXA_32_s, + HEXA_56_s, HEXA_64_s ] ElementTypeNPE_l = [Null_npe, UserDefined_npe, NODE_npe, BAR_2_npe, BAR_3_npe, - TRI_3_npe, TRI_6_npe, QUAD_4_npe, QUAD_8_npe, QUAD_9_npe, - TETRA_4_npe, TETRA_10_npe, PYRA_5_npe, PYRA_14_npe, - PENTA_6_npe, PENTA_15_npe, PENTA_18_npe, - HEXA_8_npe, HEXA_20_npe, HEXA_27_npe, MIXED_npe, - PYRA_13_npe, NGON_n_npe, NFACE_n_npe, BAR_4_npe, TRI_9_npe, - TRI_10_npe, QUAD_12_npe, QUAD_16_npe, TETRA_16_npe, - TETRA_20_npe, PYRA_21_npe, PYRA_29_npe, - PYRA_30_npe, PENTA_24_npe, PENTA_38_npe, PENTA_40_npe, - HEXA_32_npe, HEXA_56_npe, HEXA_64_npe] + TRI_3_npe, TRI_6_npe, QUAD_4_npe, QUAD_8_npe, QUAD_9_npe, + TETRA_4_npe, TETRA_10_npe, PYRA_5_npe, PYRA_14_npe, + PENTA_6_npe, PENTA_15_npe, PENTA_18_npe, + HEXA_8_npe, HEXA_20_npe, HEXA_27_npe, MIXED_npe, + PYRA_13_npe, NGON_n_npe, NFACE_n_npe, BAR_4_npe, TRI_9_npe, + TRI_10_npe, QUAD_12_npe, QUAD_16_npe, TETRA_16_npe, + TETRA_20_npe, PYRA_21_npe, PYRA_29_npe, + PYRA_30_npe, PENTA_24_npe, PENTA_38_npe, PENTA_40_npe, + HEXA_32_npe, HEXA_56_npe, HEXA_64_npe] ElementType = stringAsKeyDict(ElementType_l) ElementType_ = enumAsKeyDict(ElementType_l) ElementTypeNPE = dict(zip(ElementType_l,ElementTypeNPE_l)) @@ -1267,4 +1267,3 @@ def enumAsKeyDict(l): RigidGridMotion_t=RigidGridMotion_ts # # --- last line - diff --git a/Cassiopee/Converter/Converter/cgnslib2.py b/Cassiopee/Converter/Converter/cgnslib2.py index e0768d6e6..ecdce3c98 100644 --- a/Cassiopee/Converter/Converter/cgnslib2.py +++ b/Cassiopee/Converter/Converter/cgnslib2.py @@ -1,9 +1,9 @@ # --------------------------------------------------------------------------- -# Taken from pyCGNS - Python package for CFD General Notation System - +# Taken from pyCGNS - Python package for CFD General Notation System - # See license.txt file in the root directory of this Python module source -# Written by M. Poinot +# Written by M. Poinot # --------------------------------------------------------------------------- -# +# from . import cgnskeywords as CK from . import cgnstypes as CT from . import cgnsutils as CU @@ -95,12 +95,12 @@ def newBase(tree,name,ncell,nphys): if (nphys < ncell): raise cgnsException(12,name) if ((tree is not None) and (not CU.checkNode(tree))): raise cgnsException(6,name) - if ((tree is not None) and (tree[0] == CK.CGNSTree_s)): parent=tree[2] + if ((tree is not None) and (tree[0] == CK.CGNSTree_s)): parent=tree[2] else: parent=tree CU.checkDuplicatedName(["",None,parent],name) node=CU.newNode(name, - NPY.array([ncell,nphys],dtype=NPY.int32,order='F'), - [],CK.CGNSBase_ts) + NPY.array([ncell,nphys],dtype=NPY.int32,order='F'), + [],CK.CGNSBase_ts) if (parent is not None): parent.append(node) return node @@ -126,7 +126,7 @@ def updateBase(tree,name=None,ncell=None,nphys=None): if (name is not None): tree[0]=name if((ncell is not None) and (nphys is not None) and tree): tree[1]=NPY.array([ncell,nphys],dtype=NPY.int32,order='F') - else: raise cgnsException(12) + else: raise cgnsException(12) # ----------------------------------------------------------------------------- def newZone(parent,name,zsize=None, @@ -157,7 +157,7 @@ def newZone(parent,name,zsize=None, """ asize=None if (ztype not in CK.ZoneType_l): raise cgnsException(206,ztype) - if (zsize is None): raise cgnsException(300) + if (zsize is None): raise cgnsException(300) CU.checkDuplicatedName(parent,name) CU.checkArray(zsize,dienow=True) znode=CU.newNode(name,zsize,[],CK.Zone_ts,parent) @@ -180,7 +180,7 @@ def readZone(tree,basename,zonename,gtype=None): z=CU.hasChildName(b,zonename) if (z is None): raise cgnsException(21,zonename) if (z[3] != CK.Zone_ts): raise cgnsException(20,(CK.Zone_ts,name)) - if gtype: + if gtype: zt=CU.hasChildName(z,CK.ZoneType_s) if (zt is None): raise cgnsException(21,CK.ZoneType_s) return (z[0],z[1],zt[1]) @@ -323,11 +323,11 @@ def newDataClass(parent,value=CK.UserDefined_s): """ CU.checkDuplicatedName(parent,CK.DataClass_s) node=CU.newNode(CK.DataClass_s,CU.setStringAsArray(value),[], - CK.DataClass_ts,parent) + CK.DataClass_ts,parent) return checkDataClass(node) def updateDataClass(node,value): - CU.checkNode(node) + CU.checkNode(node) if (value is not None): node[1]=value return checkDataClass(node) @@ -361,7 +361,7 @@ def checkDataClass(node,parent=None): CK.ConvergenceHistory_ts, CK.DiscreteData_ts,CK.IntegralData_ts, CK.UserDefinedData_ts,CK.Gravity_ts] - ,CK.DataClass_s) + ,CK.DataClass_s) return node # ----------------------------------------------------------------------------- @@ -397,31 +397,31 @@ def newDimensionalUnits(parent,value=[CK.Kilogram_s,CK.Meter_s, for v in value: if (v not in CK.AllUnits_l): raise cgnsException(203,v) if ((v in CK.MassUnits_l) - and (v not in [CK.Null_s,CK.UserDefined_s])): + and (v not in [CK.Null_s,CK.UserDefined_s])): if (v in vunit): raise cgnsException(204,v) else: vunit[0]=v if ((v in CK.LengthUnits_l) - and (v not in [CK.Null_s,CK.UserDefined_s])): + and (v not in [CK.Null_s,CK.UserDefined_s])): if (v in vunit): raise cgnsException(204,v) else: vunit[1]=v if ((v in CK.TimeUnits_l) - and (v not in [CK.Null_s,CK.UserDefined_s])): + and (v not in [CK.Null_s,CK.UserDefined_s])): if (v in vunit): raise cgnsException(204,v) else: vunit[2]=v if ((v in CK.TemperatureUnits_l) - and (v not in [CK.Null_s,CK.UserDefined_s])): + and (v not in [CK.Null_s,CK.UserDefined_s])): if (v in vunit): raise cgnsException(204,v) else: vunit[3]=v if ((v in CK.AngleUnits_l) - and (v not in [CK.Null_s,CK.UserDefined_s])): + and (v not in [CK.Null_s,CK.UserDefined_s])): if (v in vunit): raise cgnsException(204,v) else: vunit[4]=v node=CU.newNode(CK.DimensionalUnits_s,CU.concatenateForArrayChar(vunit),[], - CK.DimensionalUnits_ts,parent) + CK.DimensionalUnits_ts,parent) snode=CU.newNode(CK.AdditionalUnits_s, - CU.concatenateForArrayChar([CK.Null_s,CK.Null_s,CK.Null_s]), - [], - CK.AdditionalUnits_ts,node) + CU.concatenateForArrayChar([CK.Null_s,CK.Null_s,CK.Null_s]), + [], + CK.AdditionalUnits_ts,node) return node # ----------------------------------------------------------------------------- @@ -456,12 +456,12 @@ def newDimensionalExponents(parent, """ CU.checkDuplicatedName(parent,CK.DimensionalExponents_s) node=CU.newNode(CK.DimensionalExponents_s, - NPY.array([MassExponent, - LengthExponent, - TimeExponent, - TemperatureExponent, - AngleExponent],dtype='Float64',order='F'), - [],CK.DimensionalExponents_ts,parent) + NPY.array([MassExponent, + LengthExponent, + TimeExponent, + TemperatureExponent, + AngleExponent],dtype='Float64',order='F'), + [],CK.DimensionalExponents_ts,parent) return node # ----------------------------------------------------------------------------- @@ -494,9 +494,9 @@ def newDataConversion(parent,ConversionScale=1.0,ConversionOffset=1.0): """ CU.checkDuplicatedName(parent,CK.DataConversion_s) node=CU.newNode(CK.DataConversion_s, - NPY.array([ConversionScale,ConversionOffset], - dtype='Float64',order='F'), - [],CK.DataConversion_ts,parent) + NPY.array([ConversionScale,ConversionOffset], + dtype='Float64',order='F'), + [],CK.DataConversion_ts,parent) return node # ----------------------------------------------------------------------------- @@ -528,37 +528,37 @@ def checkDescriptor(node,parent=None): raise cgnsException(110,node[0]) if (parent is not None): CU.checkTypeList(parent,[CK.DataArray_ts,CK.CGNSBase_ts,CK.Zone_ts, - CK.GridCoordinates_ts,CK.Elements_ts, - CK.Axisymmetry_ts, - CK.RotatingCoordinates_ts,CK.FlowSolution_ts, - CK.ZoneGridConnectivity_ts, - CK.GridConnectivity1to1_ts, - CK.GridConnectivity_ts, - CK.GridConnectivityProperty_ts, - CK.AverageInterface_ts,CK.OversetHoles_ts, - CK.Periodic_ts,CK.ZoneBC_ts,CK.BC_ts, - CK.BCDataSet_ts, - CK.BCData_ts,CK.FlowEquationSet_ts, - CK.GasModel_ts, - CK.BCProperty_ts,CK.WallFunction_ts, - CK.Area_ts, - CK.GoverningEquations_ts, - CK.ViscosityModel_ts, - CK.ThermalConductivityModel_ts, - CK.TurbulenceClosure_ts,CK.TurbulenceModel_ts, - CK.ThermalRelaxationModel_ts, - CK.ChemicalKineticsModel_ts, - CK.EMElectricFieldModel_ts, - CK.EMMagneticFieldModel_ts, - CK.EMConductivityModel_ts, - CK.BaseIterativeData_ts, - CK.ZoneIterativeData_ts,CK.RigidGridMotion_ts, - CK.ArbitraryGridMotion_ts,CK.ReferenceState_ts, - CK.ConvergenceHistory_ts, - CK.DiscreteData_ts,CK.IntegralData_ts, - CK.Family_ts,CK.GeometryReference_ts, - CK.UserDefinedData_ts,CK.Gravity_ts] - ,CK.DataClass_s) + CK.GridCoordinates_ts,CK.Elements_ts, + CK.Axisymmetry_ts, + CK.RotatingCoordinates_ts,CK.FlowSolution_ts, + CK.ZoneGridConnectivity_ts, + CK.GridConnectivity1to1_ts, + CK.GridConnectivity_ts, + CK.GridConnectivityProperty_ts, + CK.AverageInterface_ts,CK.OversetHoles_ts, + CK.Periodic_ts,CK.ZoneBC_ts,CK.BC_ts, + CK.BCDataSet_ts, + CK.BCData_ts,CK.FlowEquationSet_ts, + CK.GasModel_ts, + CK.BCProperty_ts,CK.WallFunction_ts, + CK.Area_ts, + CK.GoverningEquations_ts, + CK.ViscosityModel_ts, + CK.ThermalConductivityModel_ts, + CK.TurbulenceClosure_ts,CK.TurbulenceModel_ts, + CK.ThermalRelaxationModel_ts, + CK.ChemicalKineticsModel_ts, + CK.EMElectricFieldModel_ts, + CK.EMMagneticFieldModel_ts, + CK.EMConductivityModel_ts, + CK.BaseIterativeData_ts, + CK.ZoneIterativeData_ts,CK.RigidGridMotion_ts, + CK.ArbitraryGridMotion_ts,CK.ReferenceState_ts, + CK.ConvergenceHistory_ts, + CK.DiscreteData_ts,CK.IntegralData_ts, + CK.Family_ts,CK.GeometryReference_ts, + CK.UserDefinedData_ts,CK.Gravity_ts] + ,CK.DataClass_s) return node # ----------------------------------------------------------------------------- @@ -660,7 +660,7 @@ def newPointRange(parent,name=CK.PointRange_s,value=[]): return node # ----------------------------------------------------------------------------- -def newRind(parent,value): +def newRind(parent,value): """ *Rind* node creation, indicates extra *ghost* cells around the grid:: @@ -740,9 +740,9 @@ def newDiscreteData(parent,name): - :rsids:`SIDS DiscreteData ` """ - CU.checkDuplicatedName(parent,name) + CU.checkDuplicatedName(parent,name) node=CU.newNode(name,None,[],CK.DiscreteData_ts,parent) - return node + return node #----------------------------------------------------------------------------- def newIntegralData(parent,name): @@ -817,12 +817,12 @@ def newZoneBC(parent): def newBC(parent,bname,brange=[[1,1],[1,1],[1,1]], btype=CK.Null_s,bcType=CK.Null_s, family=CK.Null_s,pttype=CK.PointRange_s): - return newBoundary(parent,bname,brange,btype,family,pttype) + return newBoundary(parent,bname,brange,btype,family,pttype) def newBoundary(parent,bname,brange, btype=CK.Null_s, family=None, - pttype=CK.PointRange_s): + pttype=CK.PointRange_s): """-BC node creation -BC 'newNode:N='*newBoundary*'(parent:N,bname:S,brange:[*i],btype:S)' @@ -837,7 +837,7 @@ def newBoundary(parent,bname,brange, CU.checkDuplicatedName(parent,bname) zbnode=parent if ((zbnode is not None) and - (zbnode[0]!=CK.ZoneBC_s) and (zbnode[3]!=CK.ZoneBC_ts)): + (zbnode[0]!=CK.ZoneBC_s) and (zbnode[3]!=CK.ZoneBC_ts)): zbnode=CU.newNode(CK.ZoneBC_s,None,[],CK.ZoneBC_ts,parent) bnode=CU.newNode(bname,CU.setStringAsArray(btype),[],CK.BC_ts,zbnode) if (pttype==CK.PointRange_s): @@ -848,7 +848,7 @@ def newBoundary(parent,bname,brange, CU.newNode(CK.PointList_s,arange,[],CK.IndexArray_ts,bnode) if (family): CU.newNode(CK.FamilyName_s,CU.setStringAsArray(family),[], - CK.FamilyName_ts,bnode) + CK.FamilyName_ts,bnode) return bnode # ----------------------------------------------------------------------------- @@ -862,14 +862,14 @@ def newBCDataSet(parent,name,valueType=CK.Null_s): chapter 9.4 Add node BCTypeSimple is required """ node=CU.hasChildName(parent,name) - if (node is None): + if (node is None): node=CU.newNode(name,None,[],CK.BCDataSet_ts,parent) if (valueType not in CK.BCTypeSimple_l): raise cgnsException(252,valueType) node[1]=CU.setStringAsArray(valueType) return node -# --------------------------------------------------------------------------- +# --------------------------------------------------------------------------- def newBCData(parent,name): """-BCData node creation -BCData @@ -878,9 +878,9 @@ def newBCData(parent,name): Returns a new representing a BCData_t sub-tree. chapter 9.5 """ - CU.checkDuplicatedName(parent,name) + CU.checkDuplicatedName(parent,name) node=CU.newNode(name,None,[],CK.BCData_ts,parent) - return node + return node # ----------------------------------------------------------------------------- def newBCProperty(parent,wallfunction=CK.Null_s,area=CK.Null_s): @@ -892,13 +892,13 @@ def newBCProperty(parent,wallfunction=CK.Null_s,area=CK.Null_s): If a parent is given, the new is added to the parent children list. chapter 9.6 """ - CU.checkDuplicatedName(parent,CK.BCProperty_s) + CU.checkDuplicatedName(parent,CK.BCProperty_s) node=CU.newNode(CK.BCProperty_s,None,[],CK.BCProperty_ts,parent) wf=CU.newNode(CK.WallFunction_s,None,[],CK.WallFunction_ts,node) CU.newNode(CK.WallFunctionType_s,CU.setStringAsArray(wallfunction),[],CK.WallFunctionType_ts,wf) ar=CU.newNode(CK.Area_s,None,[],CK.Area_ts,node) CU.newNode(CK.AreaType_s,CU.setStringAsArray(area),[],CK.AreaType_ts,ar) - return node + return node # ----------------------------------------------------------------------------- def newAxisymmetry(parent, @@ -938,19 +938,19 @@ def newRotatingCoordinates(parent, If a parent is given, the new is added to the parent children list. rotcenter,ratev should be a real array. chapter 7.6 Add DataArray RotationRateVector,RotationCenter are required - """ + """ if (parent): CU.checkNode(parent) CU.checkTypeList(parent,[CK.CGNSBase_ts,CK.Zone_ts,CK.Family_ts], - CK.RotatingCoordinates_s) + CK.RotatingCoordinates_s) CU.checkDuplicatedName(parent,CK.RotatingCoordinates_s) CU.checkArrayReal(rotcenter) CU.checkArrayReal(ratev) node=CU.newNode(CK.RotatingCoordinates_s,None,[],CK.RotatingCoordinates_ts,parent) n=CU.hasChildName(node,CK.RotationCenter_s) - if (n is None): + if (n is None): n=newDataArray(node,CK.RotationCenter_s,NPY.array(rotcenter)) n=CU.hasChildName(node,CK.RotationRateVector_s) - if (n is None): + if (n is None): n=newDataArray(node,CK.RotationRateVector_s,NPY.array(ratev)) return node @@ -967,7 +967,7 @@ def newFlowSolution(parent,name='{FlowSolution}',gridlocation=None): node=CU.newNode(name,None,[],CK.FlowSolution_ts,parent) if (gridlocation is None): newGridLocation(node) else: newGridLocation(node,gridlocation) - return node + return node # ----------------------------------------------------------------------------- def newZoneGridConnectivity(parent,name=CK.ZoneGridConnectivity_s): @@ -982,8 +982,8 @@ def newZoneGridConnectivity(parent,name=CK.ZoneGridConnectivity_s): chapter 8.1 """ CU.checkDuplicatedName(parent,name) - cnode=CU.hasChildName(parent,CK.ZoneGridConnectivity_s) - if (cnode is None): + cnode=CU.hasChildName(parent,CK.ZoneGridConnectivity_s) + if (cnode is None): cnode=CU.newNode(CK.ZoneGridConnectivity_s, None,[],CK.ZoneGridConnectivity_ts,parent) return cnode @@ -1006,10 +1006,10 @@ def newGridConnectivity1to1(parent,name,dname,window,dwindow,trans): CK.Transform_ts2,zcnode) CU.newNode(CK.PointRange_s, NPY.array(window,dtype=NPY.int32,order='F'),[], - CK.IndexRange_ts,zcnode) + CK.IndexRange_ts,zcnode) CU.newNode(CK.PointRangeDonor_s, NPY.array(dwindow,dtype=NPY.int32,order='F'),[], - CK.IndexRange_ts,zcnode) + CK.IndexRange_ts,zcnode) return zcnode # ----------------------------------------------------------------------------- @@ -1042,11 +1042,11 @@ def newGridConnectivityType(parent,ctype=CK.Overset_s): chapter 8 """ zctnode=CU.newNode(CK.GridConnectivityType_s,CU.setStringAsArray(ctype), - [],CK.GridConnectivityType_ts,parent) + [],CK.GridConnectivityType_ts,parent) return zctnode # ----------------------------------------------------------------------------- -def newGridConnectivityProperty(parent): +def newGridConnectivityProperty(parent): """-GridConnectivityProperty node creation -GridConnectivityProperty 'newNode:N='*newGridConnectivityProperty*'(parent:N)' @@ -1055,9 +1055,9 @@ def newGridConnectivityProperty(parent): If a parent is given, the new is added to the parent children list. chapter 8.5 """ - CU.checkDuplicatedName(parent,CK.GridConnectivityProperty_s) + CU.checkDuplicatedName(parent,CK.GridConnectivityProperty_s) nodeType=CU.newNode(CK.GridConnectivityProperty_s,None,[], - CK.GridConnectivityProperty_ts,parent) + CK.GridConnectivityProperty_ts,parent) return nodeType def newPeriodic(parent, @@ -1075,7 +1075,7 @@ def newPeriodic(parent, rotcenter,ratev,trans should be a real array. chapter 8.5.1 Add DataArray RotationCenter,RotationAngle,Translation are required """ - if (parent): CU.checkNode(parent) + if (parent): CU.checkNode(parent) CU.checkArrayReal(rotcenter) CU.checkArrayReal(ratev) CU.checkArrayReal(trans) @@ -1083,14 +1083,14 @@ def newPeriodic(parent, if (cnode is None): cnode=CU.newNode(CK.Periodic_s,None,[],CK.Periodic_ts,parent) n=CU.hasChildName(cnode,CK.RotationCenter_s) - if (n is None): + if (n is None): newDataArray(cnode,CK.RotationCenter_s,NPY.array(rotcenter)) n=CU.hasChildName(cnode,CK.RotationAngle_s) - if (n is None): + if (n is None): newDataArray(cnode,CK.RotationAngle_s,NPY.array(ratev)) n=CU.hasChildName(cnode,CK.Translation_s) - if (n is None): - newDataArray(cnode,CK.Translation_s,NPY.array(trans)) + if (n is None): + newDataArray(cnode,CK.Translation_s,NPY.array(trans)) return cnode # ----------------------------------------------------------------------------- @@ -1106,15 +1106,15 @@ def newAverageInterface(parent,valueType=CK.Null_s): chapter 8.5.2 """ node=CU.hasChildName(parent,CK.AverageInterface_s) - if (node is None): + if (node is None): node=CU.newNode(CK.AverageInterface_s,None,[], - CK.AverageInterface_ts,parent) + CK.AverageInterface_ts,parent) if (valueType not in CK.AverageInterfaceType_l): raise cgnsException(253,valueType) - CU.checkDuplicatedName(node,CK.AverageInterfaceType_s) + CU.checkDuplicatedName(node,CK.AverageInterfaceType_s) ## code correction: Modify valueType string into NPY string array nodeType=CU.newNode(CK.AverageInterfaceType_s,CU.setStringAsArray(valueType),[], - CK.AverageInterfaceType_ts,node) + CK.AverageInterfaceType_ts,node) return node # ----------------------------------------------------------------------------- @@ -1131,11 +1131,11 @@ def newOversetHoles(parent,name,hrange): cnode=CU.hasChildName(parent,CK.ZoneGridConnectivity_s) if (cnode is None): cnode=CU.newNode(CK.ZoneGridConnectivity_s,None,[],CK.ZoneGridConnectivity_ts,parent) - CU.checkDuplicatedName(cnode,name) + CU.checkDuplicatedName(cnode,name) node=CU.newNode(name,None,[],CK.OversetHoles_ts,cnode) #if(pname!=None and value!=None): - #newPointList(node,pname,value) - if (hrange is not None): + #newPointList(node,pname,value) + if (hrange is not None): ## code correction: Modify PointRange shape and order newPointRange(node,CK.PointRange_s,NPY.array(hrange,dtype=NPY.int32,order='F')) #newNode(CK.PointRange_s,NPY.array(list(hrange),'i'),[],CK.IndexRange_ts,node) @@ -1153,9 +1153,9 @@ def newFlowEquationSet(parent): """ if (parent): CU.checkNode(parent) CU.checkDuplicatedName(parent,CK.FlowEquationSet_s) - CU.checkTypeList(parent,[CK.CGNSBase_ts,CK.Zone_ts],CK.FlowEquationSet_s) - node=CU.newNode(CK.FlowEquationSet_s,None,[],CK.FlowEquationSet_ts,parent) - return node + CU.checkTypeList(parent,[CK.CGNSBase_ts,CK.Zone_ts],CK.FlowEquationSet_s) + node=CU.newNode(CK.FlowEquationSet_s,None,[],CK.FlowEquationSet_ts,parent) + return node def newGoverningEquations(parent,valueType=CK.Euler_s): """-GoverningEquations node creation -GoverningEquations @@ -1169,7 +1169,7 @@ def newGoverningEquations(parent,valueType=CK.Euler_s): chapter 10.2 Add node GoverningEquationsType is required """ node=CU.hasChildName(parent,CK.GoverningEquations_s) - if (node is None): + if (node is None): node=CU.newNode(CK.GoverningEquations_s,None,[],CK.GoverningEquations_ts,parent) if (valueType not in CK.GoverningEquationsType_l): raise cgnsException(221,valueType) @@ -1190,15 +1190,15 @@ def newGasModel(parent,valueType=CK.Ideal_s): chapter 10.3 Add node GasModelType is required """ node=CU.hasChildName(parent,CK.GasModel_s) - if (node is None): + if (node is None): node=CU.newNode(CK.GasModel_s,None,[],CK.GasModel_ts,parent) if (valueType not in CK.GasModelType_l): raise cgnsException(224,valueType) - CU.checkDuplicatedName(node,CK.GasModelType_s) + CU.checkDuplicatedName(node,CK.GasModelType_s) node[1]=CU.setStringAsArray(valueType) return node -def newThermalConductivityModel(parent,valueType=CK.SutherlandLaw_s): +def newThermalConductivityModel(parent,valueType=CK.SutherlandLaw_s): """-ThermalConductivityModel node creation -ThermalConductivityModel 'newNode:N='*newThermalConductivityModel*'(parent:N,valueType:CK.ThermalConductivityModelType)' @@ -1210,16 +1210,16 @@ def newThermalConductivityModel(parent,valueType=CK.SutherlandLaw_s): chapter 10.5 Add node ThermalConductivityModelType is required """ node=CU.hasChildName(parent,CK.ThermalConductivityModel_s) - if (node is None): + if (node is None): node=CU.newNode(CK.ThermalConductivityModel_s,None,[], - CK.ThermalConductivityModel_ts,parent) + CK.ThermalConductivityModel_ts,parent) if (valueType not in CK.ThermalConductivityModelType_l): raise cgnsException(227,valueType) CU.checkDuplicatedName(node,CK.ThermalConductivityModelType_s) node[1]=CU.setStringAsArray(valueType) return node -def newViscosityModel(parent,valueType=CK.SutherlandLaw_s): +def newViscosityModel(parent,valueType=CK.SutherlandLaw_s): """-ViscosityModel node creation -ViscosityModel 'newNode:N='*newViscosityModel*'(parent:N,valueType:CK.ViscosityModelType)' @@ -1229,17 +1229,17 @@ def newViscosityModel(parent,valueType=CK.SutherlandLaw_s): If the parent has already a child name ViscosityModel then only the ViscosityModelType is created. chapter 10.4 Add node ViscosityModelType is (r) - """ + """ node=CU.hasChildName(parent,CK.ViscosityModel_s) - if (node is None): - node=CU.newNode(CK.ViscosityModel_s,None,[],CK.ViscosityModel_ts,parent) + if (node is None): + node=CU.newNode(CK.ViscosityModel_s,None,[],CK.ViscosityModel_ts,parent) if (valueType not in CK.ViscosityModelType_l): - raise cgnsException(230,valueType) - CU.checkDuplicatedName(node,CK.ViscosityModelType_s) + raise cgnsException(230,valueType) + CU.checkDuplicatedName(node,CK.ViscosityModelType_s) node[1]=CU.setStringAsArray(valueType) return node -def newTurbulenceClosure(parent,valueType=CK.Null_s): +def newTurbulenceClosure(parent,valueType=CK.Null_s): """-TurbulenceClosure node creation -TurbulenceClosure 'newNode:N='*newTurbulenceClosure*'(parent:N,valueType:CK.TurbulenceClosureType)' @@ -1250,7 +1250,7 @@ def newTurbulenceClosure(parent,valueType=CK.Null_s): chapter 10.5 Add node TurbulenceClosureType is (r) """ node=CU.hasChildName(parent,CK.TurbulenceClosure_s) - if (node is None): + if (node is None): node=CU.newNode(CK.TurbulenceClosure_s,None,[],CK.TurbulenceClosure_ts,parent) if (valueType not in CK.TurbulenceClosureType_l): raise cgnsException(233,valueType) @@ -1258,7 +1258,7 @@ def newTurbulenceClosure(parent,valueType=CK.Null_s): node[1]=CU.setStringAsArray(valueType) return node -def newTurbulenceModel(parent,valueType=CK.OneEquation_SpalartAllmaras_s): +def newTurbulenceModel(parent,valueType=CK.OneEquation_SpalartAllmaras_s): """-TurbulenceModel node creation -TurbulenceModel 'newNode:N='*newTurbulenceModel*'(parent:N,valueType:CK.TurbulenceModelType)' @@ -1268,12 +1268,12 @@ def newTurbulenceModel(parent,valueType=CK.OneEquation_SpalartAllmaras_s): If the parent has already a child name TurbulenceModel then only the TurbulenceModelType is created. chapter 10.6.2 Add node TurbulenceModelType is (r) - """ + """ node=CU.hasChildName(parent,CK.TurbulenceModel_s) if (node is None): node=CU.newNode(CK.TurbulenceModel_s,None,[],CK.TurbulenceModel_ts,parent) if (valueType not in CK.TurbulenceModelType_l): - raise cgnsException(236,valueType) + raise cgnsException(236,valueType) CU.checkDuplicatedName(node,CK.TurbulenceModelType_s) node[1]=CU.setStringAsArray(valueType) return node @@ -1289,13 +1289,13 @@ def newThermalRelaxationModel(parent,valueType=CK.Null_s): only the ThermalRelaxationModelType is created. chapter 10.7 Add node ThermalRelaxationModelType is (r) """ - node=CU.hasChildName(parent,CK.ThermalRelaxationModel_s) - if (node is None): + node=CU.hasChildName(parent,CK.ThermalRelaxationModel_s) + if (node is None): node=CU.newNode(CK.ThermalRelaxationModel_s,None,[], - CK.ThermalRelaxationModel_ts,parent) + CK.ThermalRelaxationModel_ts,parent) if (valueType not in CK.ThermalRelaxationModelType_l): - raise cgnsException(239,valueType) - CU.checkDuplicatedName(node,CK.ThermalRelaxationModelType_s) + raise cgnsException(239,valueType) + CU.checkDuplicatedName(node,CK.ThermalRelaxationModelType_s) node[1]=CU.setStringAsArray(valueType) return node @@ -1310,13 +1310,13 @@ def newChemicalKineticsModel(parent,valueType=CK.Null_s): only the ChemicalKineticsModelType is created. chapter 10.8 Add node ChemicalKineticsModelType is (r) """ - node=CU.hasChildName(parent,CK.ChemicalKineticsModel_s) - if (node is None): + node=CU.hasChildName(parent,CK.ChemicalKineticsModel_s) + if (node is None): node=CU.newNode(CK.ChemicalKineticsModel_s,None,[], - CK.ChemicalKineticsModel_ts,parent) + CK.ChemicalKineticsModel_ts,parent) if (valueType not in CK.ChemicalKineticsModelType_l): raise cgnsException(242,valueType) - CU.checkDuplicatedName(node,CK.ChemicalKineticsModelType_s) + CU.checkDuplicatedName(node,CK.ChemicalKineticsModelType_s) node[1]=CU.setStringAsArray(valueType) return node @@ -1331,13 +1331,13 @@ def newEMElectricFieldModel(parent,valueType=CK.Null_s): only the EMElectricFieldModelType is created. chapter 10.9 Add node EMElectricFieldModelType is (r) """ - node=CU.hasChildName(parent,CK.EMElectricFieldModel_s) - if (node is None): + node=CU.hasChildName(parent,CK.EMElectricFieldModel_s) + if (node is None): node=CU.newNode(CK.EMElectricFieldModel_s,None,[], - CK.EMElectricFieldModel_ts,parent) + CK.EMElectricFieldModel_ts,parent) if (valueType not in CK.EMElectricFieldModelType_l): raise cgnsException(245,valueType) - CU.checkDuplicatedName(node,CK.EMElectricFieldModelType_s) + CU.checkDuplicatedName(node,CK.EMElectricFieldModelType_s) node[1]=CU.setStringAsArray(valueType) return node @@ -1352,13 +1352,13 @@ def newEMMagneticFieldModel(parent,valueType=CK.Null_s): only the EMMagneticFieldModelType is created. chapter 10.9.2 Add node EMMagneticFieldModelType is (r) """ - node=CU.hasChildName(parent,CK.EMMagneticFieldModel_s) - if (node is None): + node=CU.hasChildName(parent,CK.EMMagneticFieldModel_s) + if (node is None): node=CU.newNode(CK.EMMagneticFieldModel_s,None,[], - CK.EMMagneticFieldModel_ts,parent) + CK.EMMagneticFieldModel_ts,parent) if (valueType not in CK.EMMagneticFieldModelType_l): - raise cgnsException(248,valueType) - CU.checkDuplicatedName(node,CK.EMMagneticFieldModelType_s) + raise cgnsException(248,valueType) + CU.checkDuplicatedName(node,CK.EMMagneticFieldModelType_s) node[1]=CU.setStringAsArray(valueType) return node @@ -1373,13 +1373,13 @@ def newEMConductivityModel(parent,valueType=CK.Null_s): only the EMConductivityModelType is created. chapter 10.9.3 Add node EMConductivityModelType is (r) """ - node=CU.hasChildName(parent,CK.EMConductivityModel_s) - if (node is None): + node=CU.hasChildName(parent,CK.EMConductivityModel_s) + if (node is None): node=CU.newNode(CK.EMConductivityModel_s,None,[], - CK.EMConductivityModel_ts,parent) + CK.EMConductivityModel_ts,parent) if (valueType not in CK.EMConductivityModelType_l): - raise cgnsException(218,stype) - CU.checkDuplicatedName(node,CK.EMConductivityModelType_s) + raise cgnsException(218,stype) + CU.checkDuplicatedName(node,CK.EMConductivityModelType_s) node[1]=CU.setStringAsArray(valueType) return node @@ -1394,7 +1394,7 @@ def newBaseIterativeData(parent,name,nsteps=0, If a parent is given, the new is added to the parent children list. chapter 11.1.1 NumberOfSteps is required, TimeValues or IterationValues are required - """ + """ if (parent): CU.checkNode(parent) CU.checkDuplicatedName(parent,name) @@ -1405,7 +1405,7 @@ def newBaseIterativeData(parent,name,nsteps=0, CK.BaseIterativeData_ts,parent) if (itype not in [CK.IterationValues_s, CK.TimeValues_s]): raise cgnsException(210,(CK.IterationValues_s, CK.TimeValues_s)) - CU.newNode(itype,asteps,[],CK.DataArray_ts,node) + CU.newNode(itype,asteps,[],CK.DataArray_ts,node) return node # ----------------------------------------------------------------------------- @@ -1417,12 +1417,12 @@ def newZoneIterativeData(parent,name): Returns a new representing a ZoneIterativeData_t sub-tree. If a parent is given, the new is added to the parent children list. chapter 11.1.2 - """ + """ CU.checkDuplicatedName(parent,name) node=CU.newNode(name,None,[],CK.ZoneIterativeData_ts,parent) return node -# --------------------------------------------------------------------------- +# --------------------------------------------------------------------------- def newRigidGridMotion(parent,name, valueType=CK.Null_s, vector=NPY.array([0.0,0.0,0.0])): @@ -1436,7 +1436,7 @@ def newRigidGridMotion(parent,name, only the RigidGridMotionType is created and OriginLocation is created chapter 11.2 Add Node RigidGridMotionType and add DataArray OriginLocation are the only required """ - if (parent): CU.checkNode(parent) + if (parent): CU.checkNode(parent) CU.checkDuplicatedName(parent,name) node=CU.newNode(name,None,[],CK.RigidGridMotion_ts,parent) @@ -1444,7 +1444,7 @@ def newRigidGridMotion(parent,name, raise cgnsException(254,valueType) node[1]=CU.setStringAsArray(valueType) n=CU.hasChildName(parent,CK.OriginLocation_s) - if (n is None): + if (n is None): n=newDataArray(node,CK.OriginLocation_s,NPY.array(vector)) return node @@ -1456,7 +1456,7 @@ def newReferenceState(parent,name=CK.ReferenceState_s): Returns a new representing a ReferenceState_t sub-tree. If a parent is given, the new is added to the parent children list. - chapter 12.1 """ + chapter 12.1 """ if (parent): CU.checkNode(parent) node=CU.hasChildName(parent,name) if (node is None): @@ -1466,14 +1466,14 @@ def newReferenceState(parent,name=CK.ReferenceState_s): #----------------------------------------------------------------------------- def newConvergenceHistory(parent,name=CK.GlobalConvergenceHistory_s, - iterations=0): + iterations=0): """-ConvergenceHistory node creation -ConvergenceHistory 'newNode:N='*newConvergenceHistory*'(parent:N,name:S,iterations:i)' Returns a new representing a ConvergenceHistory_t sub-tree. If a parent is given, the new is added to the parent children list. - chapter 12.3 """ + chapter 12.3 """ if (name not in CK.ConvergenceHistory_l): raise cgnsException(201,name) if (parent): CU.checkNode(parent) @@ -1495,7 +1495,7 @@ def newFamily(parent,name): Returns a new representing a Family_t sub-tree. If a parent is given, the new is added to the parent children list. chapter 12.6 - """ + """ if (parent): CU.checkNode(parent) CU.checkType(parent,CK.CGNSBase_ts,name) CU.checkDuplicatedName(parent,name) @@ -1520,18 +1520,18 @@ def newGeometryReference(parent,name='{GeometryReference}', chapter 12.7 Add node CK.GeometryFormat_t is (r) and GeometryFile_t definition not find but is required (CAD file) """ node=CU.hasChildName(parent,CK.GeometryReference_s) - if (node is None): + if (node is None): node=CU.newNode(name,None,[],CK.GeometryReference_ts,parent) if (valueType not in CK.GeometryFormat_l): raise cgnsException(256,valueType) CU.checkDuplicatedName(node,CK.GeometryFormat_s) ## code correction: Modify valueType string into NPY string array nodeType=CU.newNode(CK.GeometryFormat_s,CU.setStringAsArray(valueType),[], - CK.GeometryFormat_ts,node) + CK.GeometryFormat_ts,node) return node # ----------------------------------------------------------------------------- -def newFamilyBC(parent,valueType=CK.UserDefined_s): +def newFamilyBC(parent,valueType=CK.UserDefined_s): """-FamilyBC node creation -FamilyBC 'newNode:N='*newFamilyBC*'(parent:N,valueType:CK.BCTypeSimple/CK.BCTypeCompound)' @@ -1541,12 +1541,12 @@ def newFamilyBC(parent,valueType=CK.UserDefined_s): If the parent has already a child name FamilyBC then only the BCType is created chapter 12.8 Add node BCType is required - """ + """ node=CU.hasChildName(parent,CK.FamilyBC_s) if ( valueType not in CK.BCTypeSimple_l - and valueType not in CK.BCTypeCompound_l): + and valueType not in CK.BCTypeCompound_l): raise cgnsException(257,valueType) - if (node is None): + if (node is None): node=CU.newNode(CK.FamilyBC_s, CU.setStringAsArray(valueType), [], @@ -1572,10 +1572,10 @@ def newArbitraryGridMotion(parent,name,valuetype=CK.Null_s): node=None if (parent): node=CU.hasChildName(parent,name) if (node is None): - node=CU.newNode(name,None,[],CK.ArbitraryGridMotion_ts,parent) + node=CU.newNode(name,None,[],CK.ArbitraryGridMotion_ts,parent) if (valuetype not in CK.ArbitraryGridMotionType_l): - raise cgnsException(255,valuetype) - CU.checkDuplicatedName(node,CK.ArbitraryGridMotionType_s) + raise cgnsException(255,valuetype) + CU.checkDuplicatedName(node,CK.ArbitraryGridMotionType_s) node[1]=CU.setStringAsArray(valuetype) return node @@ -1588,7 +1588,7 @@ def newUserDefinedData(parent,name): Returns a new representing a UserDefinedData_t sub-tree. If a parent is given, the new is added to the parent children list. chapter 12.9 - """ + """ CU.checkDuplicatedName(parent,name) node=CU.newNode(name,None,[],CK.UserDefinedData_ts,parent) return node @@ -1603,14 +1603,14 @@ def newGravity(parent,gvector=NPY.array([0.0,0.0,0.0])): If a parent is given, the new is added to the parent children list. gvector should be a real array chapter 12.10 Add DataArray GravityVector is required - """ + """ if (parent): CU.checkNode(parent) CU.checkType(parent,CK.CGNSBase_ts,CK.Gravity_s) CU.checkDuplicatedName(parent,CK.Gravity_s) CU.checkArrayReal(gvector) node=CU.newNode(CK.Gravity_s,None,[],CK.Gravity_ts,parent) n=CU.hasChildName(parent,CK.GravityVector_s) - if (n is None): + if (n is None): n=newDataArray(node,CK.GravityVector_s,NPY.array(gvector)) return node diff --git a/Cassiopee/Converter/Converter/cgnstypes2.py b/Cassiopee/Converter/Converter/cgnstypes2.py index bffc22b92..ee85e6e6a 100644 --- a/Cassiopee/Converter/Converter/cgnstypes2.py +++ b/Cassiopee/Converter/Converter/cgnstypes2.py @@ -1,7 +1,7 @@ # ------------------------------------------------------------------------- -# Taken from pyCGNS - Python package for CFD General Notation System - +# Taken from pyCGNS - Python package for CFD General Notation System - # See license.txt file in the root directory of this Python module source -# Written by M. Poinot +# Written by M. Poinot # ------------------------------------------------------------------------- # from . import cgnskeywords as CK @@ -11,7 +11,7 @@ CK.UserDefinedData_ts, CK.DataClass_ts, CK.DimensionalUnits_ts, - ] +] allDT=[CK.C1,CK.MT,CK.I4,CK.I8,CK.R4,CK.R8] # LK is default @@ -646,7 +646,7 @@ def hasReservedNameType(self,name): # -------------------------------------------------------- t=CK.ArbitraryGridMotionType_ts cgt[t]=CGNStype(t,dtype=[CK.C1], - names=[CK.ArbitraryGridMotionType_s]) + names=[CK.ArbitraryGridMotionType_s]) cgt[t].shape=(0,) # -------------------------------------------------------- diff --git a/Cassiopee/Converter/Converter/cgnsutils2.py b/Cassiopee/Converter/Converter/cgnsutils2.py index b935b24bf..de352875a 100644 --- a/Cassiopee/Converter/Converter/cgnsutils2.py +++ b/Cassiopee/Converter/Converter/cgnsutils2.py @@ -1,6 +1,6 @@ # --------------------------------------------------------------------------- -# pyCGNS - Python package for CFD General Notation System - -# See license.txt file in the root directory of this Python module source +# pyCGNS - Python package for CFD General Notation System - +# See license.txt file in the root directory of this Python module source # --------------------------------------------------------------------------- # from . import cgnskeywords as CK @@ -167,7 +167,7 @@ def checkNodeName(node,dienow=False): - See also :py:func:`checkNodeCompliant` """ - if (not checkNode(node)): + if (not checkNode(node)): if (dienow): raise cgnsNameError(2) return False return checkName(node[0],dienow) @@ -389,15 +389,15 @@ def checkType(parent,ltype,name,dienow=False): return True if ((type(ltype)==list) and (parent[3] in ltype)): return True - if (parent[3] == ltype): + if (parent[3] == ltype): return True if ((ltype==[]) and (parent[3] not in CK.cgnstypes)): if (dienow): raise cgnsTypeError(40,(parent,parent[3])) return False - if (parent[3] != ltype): + if (parent[3] != ltype): if (dienow): raise cgnsTypeError(103,(parent,ltype)) return False - if ((type(ltype)==list) and (parent[3] not in ltype)): + if ((type(ltype)==list) and (parent[3] not in ltype)): if (dienow): raise cgnsTypeError(104,(parent,ltype)) return False return True @@ -412,7 +412,7 @@ def checkParentType(parent,stype): # ----------------------------------------------------------------------------- def checkTypeList(parent,ltype,name): if (parent == None): return None - if (parent[3] not in ltype): + if (parent[3] not in ltype): raise cgnsException(104,(name,ltype)) return None @@ -507,9 +507,9 @@ def isRootNode(node,legacy=False,version=False,dienow=False): if ((not legacy) and (node[3] == CK.CGNSTree_ts)): start=node if (legacy): start=node for n in start[2]: - if (not checkNode(n,dienow)): return False + if (not checkNode(n,dienow)): return False if ( (n[0] == CK.CGNSLibraryVersion_s) - and (n[3] == CK.CGNSLibraryVersion_ts) ): + and (n[3] == CK.CGNSLibraryVersion_ts) ): if versionfound and dienow: raise cgnsNodeError(99) return False @@ -657,9 +657,9 @@ def checkNodeCompliant(node,parent=None,dienow=False): """ r=checkNode(node,dienow=dienow)\ - and checkNodeName(node,dienow=dienow)\ - and checkArray(node[1],dienow=dienow)\ - and checkNodeType(node,dienow=dienow) + and checkNodeName(node,dienow=dienow)\ + and checkArray(node[1],dienow=dienow)\ + and checkNodeType(node,dienow=dienow) return r # ----------------------------------------------------------------------------- @@ -750,7 +750,7 @@ def setStringAsArray(a): """ if ((type(a)==type(NPY.array((1)))) - and (a.shape != ()) and (a.dtype.kind=='S')): + and (a.shape != ()) and (a.dtype.kind=='S')): return a if ((type(a) in [str, unicode]) or (type(a)==type(NPY.array((1))))): return NPY.array(tuple(a),dtype='|S',order='Fortran') @@ -883,7 +883,7 @@ def hasFortranFlag(node): if (node[1]==[]): return True if (type(node[1])==type('')): return True # link if (not node[1].shape): return True - if (len(node[1].shape)==1): return True + if (len(node[1].shape)==1): return True return node[1].flags.f_contiguous # -------------------------------------------------- @@ -1252,8 +1252,8 @@ def sortbytypesasincriteria(a,b): if (type(criteria)==list): __criteria=criteria if ( (type(criteria)==dict) - and (parent is not None) - and (parent[3] in criteria)): + and (parent is not None) + and (parent[3] in criteria)): __criteria=criteria[parent[3]] r=[] for i in range(len(node[2])): @@ -1385,8 +1385,8 @@ def nodeByPath(path,tree): if (not checkPath(path)): return None if (path[0]=='/'): path=path[1:] if (tree[3]==CK.CGNSTree_ts): -# path=string.join([CK.CGNSTree_s]+path.split('/')[1:],'/') -# path=string.join(path.split('/')[1:],'/') + # path=string.join([CK.CGNSTree_s]+path.split('/')[1:],'/') + # path=string.join(path.split('/')[1:],'/') n=getNodeFromPath(path.split('/'),tree) else: n=getNodeFromPath(path.split('/'),[None,None,[tree],None]) @@ -1718,7 +1718,7 @@ def getPaths(tree,path,plist): plist.append(path+'/'+c[0]) getPaths(c,path+'/'+c[0],plist) -# -------------------------------------------------- +# -------------------------------------------------- def getAllPaths(tree): plist=[] path='' @@ -1733,11 +1733,11 @@ def wsort(a,b): if (a[1] > b[1]): return 1 return 0 -# -------------------------------------------------- +# -------------------------------------------------- def getPathFullTree(tree,width=False): return getPathsFullTree(tree,width) -# -------------------------------------------------- +# -------------------------------------------------- def getPathsFullTree(tree,width=False): """ Returns the list of all possible node paths of a CGNS/Python tree:: @@ -1766,7 +1766,7 @@ def getPathsFullTree(tree,width=False): r.append(p[1]) return r -# -------------------------------------------------- +# -------------------------------------------------- def checkPath(path,dienow=False): """ Checks the compliance of a path, which is basically a UNIX-like @@ -1784,7 +1784,7 @@ def checkPath(path,dienow=False): if (not checkName(p,dienow)): return False return True -# -------------------------------------------------- +# -------------------------------------------------- def hasSameRootPath(pathroot,pathtocompare): """ Compares two paths:: @@ -1809,7 +1809,7 @@ def hasSameRootPath(pathroot,pathtocompare): if (l1[i]!=l2[i]): return False return True -# -------------------------------------------------- +# -------------------------------------------------- def getPathListCommonAncestor(pathlist): """ Finds the common ancestor for all paths in list:: @@ -1821,7 +1821,7 @@ def getPathListCommonAncestor(pathlist): :args list pathlist: list of path strings :return: The common root path (at least '/') - """ + """ if (len(pathlist)==0): return '/' if (len(pathlist)==1): return pathlist[0] lp=[] @@ -1846,7 +1846,7 @@ def getPathListCommonAncestor(pathlist): c='/' return c -# -------------------------------------------------- +# -------------------------------------------------- def getPathToList(path,nofirst=False,noroot=True): """ Return the path as a list of node names:: @@ -1877,7 +1877,7 @@ def getPathToList(path,nofirst=False,noroot=True): if (path not in ['/','']): lp=path.split('/') return lp -# -------------------------------------------------- +# -------------------------------------------------- def getPathAncestor(path,level=1,noroot=True): """ Return the path of the node parent of the argument node path:: @@ -1903,7 +1903,7 @@ def getPathAncestor(path,level=1,noroot=True): ancestor=getPathAncestor(ancestor,level-1) return ancestor -# -------------------------------------------------- +# -------------------------------------------------- def getPathLeaf(path): """ Return the leaf node name of the path:: @@ -1922,7 +1922,7 @@ def getPathLeaf(path): if (len(lp)>0): leaf=lp[-1] return leaf -# -------------------------------------------------- +# -------------------------------------------------- def getPathNoRoot(path): """ Return the path without the implementation nodes 'HDF5 Mother node' @@ -1949,7 +1949,7 @@ def getPathNoRoot(path): path='/'.join(lp) return path -# -------------------------------------------------- +# -------------------------------------------------- def getPathAsTypes(tree,path,legacy=True): """Return the list of types corresponding to the argument path in the tree:: @@ -1978,7 +1978,7 @@ def getPathAsTypes(tree,path,legacy=True): ltypes.reverse() return ltypes -# -------------------------------------------------- +# -------------------------------------------------- def getPathNormalize(path): """Return the same path as minimal string, removes `////` and `/./` and other simplifiable UNIX-like path elements:: @@ -2220,7 +2220,7 @@ def getBCFromFamily(tree,families,additional=True): if (additional): zlist+=getAllNodesByTypeOrNameList(tree,fpth2) r=[] for pth in zlist: - if (getValueByPath(tree,pth).tostring() in families): + if (getValueByPath(tree,pth).tostring() in families): r+=[getPathAncestor(pth)] return r @@ -2234,7 +2234,7 @@ def getZoneSubRegionFromFamily(tree,families): if (additional): zlist+=getAllNodesByTypeOrNameList(tree,fpth2) r=[] for pth in zlist: - if (getValueByPath(tree,pth).tostring() in families): + if (getValueByPath(tree,pth).tostring() in families): r+=[getPathAncestor(pth)] return r @@ -2371,7 +2371,7 @@ def stringNameMatches(node,reval): def stringValueMatches(node,reval): """True if the string matches the node value""" if (node is None): return False - if (node[1] is None): return False + if (node[1] is None): return False if (getNodeType(node)!=CK.C1): return False tn=type(node[1]) if (tn==type('')): vn=node[1] diff --git a/Cassiopee/Converter/Converter/elsAProfile.py b/Cassiopee/Converter/Converter/elsAProfile.py index 29270e2c5..a930276f7 100755 --- a/Cassiopee/Converter/Converter/elsAProfile.py +++ b/Cassiopee/Converter/Converter/elsAProfile.py @@ -25,113 +25,113 @@ # Traduction : keyword elsA -> keyword CGNS keyselsA2CGNS = {\ -'config' :'EquationDimension' , \ -'fluid' :'GasModel' , \ -'' :'GasModelType' , \ -'pg' :'Ideal' , \ -'gamma' :'SpecificHeatRatio' , \ -'cv' :'SpecificHeatVolume' , \ -'_' :'IdealGasConstant' , \ -'__' :'ThermalConductivityModel' , \ -'___' :'TurbulenceClosure' , \ -'prandtl' :'ConstantPrandtl' , \ -'prandtltb' :'PrandtlTurbulent' , \ -'phymod' :"GoverningEquations" , \ -'turbmod' :'TurbulenceModel' , \ -'euler' :'Euler' , \ -'nstur' :'NSTurbulent' , \ -'nslam' :'NSLaminar' , \ -'spalart' :'OneEquation_SpalartAllmaras' , \ -'kepsjl' :'TwoEquation_JonesLaunder' , \ -'komega_menter' :'TwoEquation_MenterSST' , \ -'komega_wilcox' :'TwoEquation_Wilcox' , \ -'komega_kok' :'UserDefined' , \ -'smith' :'UserDefined' , \ -'visclaw' :'ViscosityModel' , \ -'sutherland' :'Sutherland' , \ -'suth_const' :'SutherlandLawConstant' , \ -'suth_muref' :'ViscosityMolecularReference' , \ -'suth_tref' :'TemperatureReference' , \ -'walladia' :'BCWall' , \ -'wallslip' :'BCWallInviscid' , \ -'cell' :'CellCenter' , \ -'node' :'Vertex' , \ -'x' :'CoordinateX' , \ -'y' :'CoordinateY' , \ -'z' :'CoordinateZ' , \ -'X' :'CoordinateX' , \ -'Y' :'CoordinateY' , \ -'Z' :'CoordinateZ' , \ -'ro' :'Density' , \ -'rou' :'MomentumX' , \ -'rov' :'MomentumY' , \ -'row' :'MomentumZ' , \ -'rovx' :'MomentumX' , \ -'rovy' :'MomentumY' , \ -'rovz' :'MomentumZ' , \ -'roe' :'EnergyStagnationDensity' , \ -'roE' :'EnergyStagnationDensity' , \ -'rok' :'TurbulentEnergyKineticDensity' , \ -'roeps' :'TurbulentDissipationDensity' , \ -'ronutilde' :'TurbulentSANuTildeDensity' , \ -'mach' :'Mach' , \ -'psta' :'Pressure' , \ -'tsta' :'Temperature' , \ -'viscrapp' :'Viscosity_EddyMolecularRatio' , \ -'walldistance' :'TurbulentDistance' , \ -'wallglobalindex':'TurbulentDistanceIndex' , \ + 'config' :'EquationDimension' , \ + 'fluid' :'GasModel' , \ + '' :'GasModelType' , \ + 'pg' :'Ideal' , \ + 'gamma' :'SpecificHeatRatio' , \ + 'cv' :'SpecificHeatVolume' , \ + '_' :'IdealGasConstant' , \ + '__' :'ThermalConductivityModel' , \ + '___' :'TurbulenceClosure' , \ + 'prandtl' :'ConstantPrandtl' , \ + 'prandtltb' :'PrandtlTurbulent' , \ + 'phymod' :"GoverningEquations" , \ + 'turbmod' :'TurbulenceModel' , \ + 'euler' :'Euler' , \ + 'nstur' :'NSTurbulent' , \ + 'nslam' :'NSLaminar' , \ + 'spalart' :'OneEquation_SpalartAllmaras' , \ + 'kepsjl' :'TwoEquation_JonesLaunder' , \ + 'komega_menter' :'TwoEquation_MenterSST' , \ + 'komega_wilcox' :'TwoEquation_Wilcox' , \ + 'komega_kok' :'UserDefined' , \ + 'smith' :'UserDefined' , \ + 'visclaw' :'ViscosityModel' , \ + 'sutherland' :'Sutherland' , \ + 'suth_const' :'SutherlandLawConstant' , \ + 'suth_muref' :'ViscosityMolecularReference' , \ + 'suth_tref' :'TemperatureReference' , \ + 'walladia' :'BCWall' , \ + 'wallslip' :'BCWallInviscid' , \ + 'cell' :'CellCenter' , \ + 'node' :'Vertex' , \ + 'x' :'CoordinateX' , \ + 'y' :'CoordinateY' , \ + 'z' :'CoordinateZ' , \ + 'X' :'CoordinateX' , \ + 'Y' :'CoordinateY' , \ + 'Z' :'CoordinateZ' , \ + 'ro' :'Density' , \ + 'rou' :'MomentumX' , \ + 'rov' :'MomentumY' , \ + 'row' :'MomentumZ' , \ + 'rovx' :'MomentumX' , \ + 'rovy' :'MomentumY' , \ + 'rovz' :'MomentumZ' , \ + 'roe' :'EnergyStagnationDensity' , \ + 'roE' :'EnergyStagnationDensity' , \ + 'rok' :'TurbulentEnergyKineticDensity' , \ + 'roeps' :'TurbulentDissipationDensity' , \ + 'ronutilde' :'TurbulentSANuTildeDensity' , \ + 'mach' :'Mach' , \ + 'psta' :'Pressure' , \ + 'tsta' :'Temperature' , \ + 'viscrapp' :'Viscosity_EddyMolecularRatio' , \ + 'walldistance' :'TurbulentDistance' , \ + 'wallglobalindex':'TurbulentDistanceIndex' , \ } # Traduction : keyword CGNS -> keyword elsA # keysCGNS2elsA = dict((v, k) for k, v in keyselsA2CGNS.iteritems()) keysCGNS2elsA={ -'EquationDimension' :'config' , \ -'GasModel' :'fluid' , \ -'GasModelType' :'' , \ -'Ideal' :'pg' , \ -#'CalloricallyPerfect' :'pg' , \ -'SpecificHeatRatio' :'gamma' , \ -'SpecificHeatVolume' :'cv' , \ -'IdealGasConstant' :'_' , \ -'ThermalConductivityModel' :'__' , \ -'TurbulenceClosure' :'___' , \ -'ConstantPrandtl' :'prandtl' , \ -'PrandtlTurbulent' :'prandtltb' , \ -"GoverningEquations" :'phymod' , \ -'TurbulenceModel' :'turbmod' , \ -'Euler' :'euler' , \ -'NSTurbulent' :'nstur' , \ -'NSLaminar' :'nslam' , \ -'OneEquation_SpalartAllmaras' :'spalart' , \ -'TwoEquation_JonesLaunder' :'kepsjl' , \ -'TwoEquation_MenterSST' :'komega_menter', \ -'TwoEquation_Wilcox' :'komega_wilcox', \ -'UserDefined' :'komega_kok' , \ -'UserDefined' :'smith' , \ -'ViscosityModel' :'visclaw' , \ -'Sutherland' :'sutherland' , \ -'SutherlandLawConstant' :'suth_const' , \ -'ViscosityMolecularReference' :'suth_muref' , \ -'TemperatureReference' :'suth_tref' , \ -'BCWall' :'walladia' , \ -'BCWallInviscid' :'wallslip' , \ -'CellCenter' :'cell' , \ -'Vertex' :'node' , \ -'CoordinateX' :'x' , \ -'CoordinateY' :'y' , \ -'CoordinateZ' :'z' , \ -'Density' :'ro' , \ -'MomentumX' :'rou' , \ -'MomentumY' :'rov' , \ -'MomentumZ' :'row' , \ -'EnergyStagnationDensity' :'roe' , \ -"TurbulentEnergyKineticDensity" :'rok' , \ -"TurbulentDissipationDensity" :'roeps' , \ -"TurbulentSANuTildeDensity" :'ronutilde' , \ -'Mach' :'mach' , \ -'Pressure' :'psta' , \ -'Temperature' :'tsta' , \ -'Viscosity_EddyMolecularRatio' :'viscrapp' , \ + 'EquationDimension' :'config' , \ + 'GasModel' :'fluid' , \ + 'GasModelType' :'' , \ + 'Ideal' :'pg' , \ + #'CalloricallyPerfect' :'pg' , \ + 'SpecificHeatRatio' :'gamma' , \ + 'SpecificHeatVolume' :'cv' , \ + 'IdealGasConstant' :'_' , \ + 'ThermalConductivityModel' :'__' , \ + 'TurbulenceClosure' :'___' , \ + 'ConstantPrandtl' :'prandtl' , \ + 'PrandtlTurbulent' :'prandtltb' , \ + "GoverningEquations" :'phymod' , \ + 'TurbulenceModel' :'turbmod' , \ + 'Euler' :'euler' , \ + 'NSTurbulent' :'nstur' , \ + 'NSLaminar' :'nslam' , \ + 'OneEquation_SpalartAllmaras' :'spalart' , \ + 'TwoEquation_JonesLaunder' :'kepsjl' , \ + 'TwoEquation_MenterSST' :'komega_menter', \ + 'TwoEquation_Wilcox' :'komega_wilcox', \ + 'UserDefined' :'komega_kok' , \ + 'UserDefined' :'smith' , \ + 'ViscosityModel' :'visclaw' , \ + 'Sutherland' :'sutherland' , \ + 'SutherlandLawConstant' :'suth_const' , \ + 'ViscosityMolecularReference' :'suth_muref' , \ + 'TemperatureReference' :'suth_tref' , \ + 'BCWall' :'walladia' , \ + 'BCWallInviscid' :'wallslip' , \ + 'CellCenter' :'cell' , \ + 'Vertex' :'node' , \ + 'CoordinateX' :'x' , \ + 'CoordinateY' :'y' , \ + 'CoordinateZ' :'z' , \ + 'Density' :'ro' , \ + 'MomentumX' :'rou' , \ + 'MomentumY' :'rov' , \ + 'MomentumZ' :'row' , \ + 'EnergyStagnationDensity' :'roe' , \ + "TurbulentEnergyKineticDensity" :'rok' , \ + "TurbulentDissipationDensity" :'roeps' , \ + "TurbulentSANuTildeDensity" :'ronutilde' , \ + 'Mach' :'mach' , \ + 'Pressure' :'psta' , \ + 'Temperature' :'tsta' , \ + 'Viscosity_EddyMolecularRatio' :'viscrapp' , \ } #============================================================================== @@ -143,7 +143,7 @@ # In elsA: it is the opposite #=============================================================================== def adaptPeriodicMatch(t, clean=False): - """Convert Periodic Match Grid Connectivity (GC) data to be compliant with elsA solver.""" + """Convert Periodic Match Grid Connectivity (GC) data to be compliant with elsA solver.""" tp = Internal.copyRef(t) _adaptPeriodicMatch(tp, clean=clean) return tp @@ -167,13 +167,13 @@ def _adaptPeriodicMatch(t, clean=False): periodic = Internal.getNodeFromType2(c, 'Periodic_t') if periodic is not None: rotAngleNode = Internal.getNodeFromName1(periodic, 'RotationAngle') - if rotAngleNode is not None: + if rotAngleNode is not None: #rotAngle = Internal.getValue(rotAngleNode) rotAngle = numpy.zeros(3,numpy.float64) rotAngleDeg = Internal.getRotationAngleValueInDegrees(rotAngleNode) for i in range(3): rotAngle[i]=rotAngleDeg[i] Internal._rmNodesByNameAndType(rotAngleNode,'DimensionalUnits','DimensionalUnits_t') - else: + else: rotAngle = numpy.empty(0,numpy.float64) rotCenter = Internal.getNodeFromName1(periodic, 'RotationCenter') @@ -225,7 +225,7 @@ def _adaptPeriodicMatch(t, clean=False): sp += [Internal.createNode('ztran','DataArray_t',value=-translation[2])] Internal.createNode('.Solver#Property','UserDefinedData_t',value=None,children=sp, parent=c) - if clean: + if clean: Internal._rmNodesFromType(c, 'Periodic_t') return None @@ -234,7 +234,7 @@ def _adaptPeriodicMatch(t, clean=False): # add periodic data for grid connectivity in zone in a .Solver#Param node # direction: for periodic Chimera #--------------------------------------------------------------------------------------------------------- -def _addPeriodicDataInSolverParam(a, rotationCenter=[0.,0.,0.], rotationAngle=[0.,0.,0.], +def _addPeriodicDataInSolverParam(a, rotationCenter=[0.,0.,0.], rotationAngle=[0.,0.,0.], NAzimutalSectors=0, isChimera=False): if isChimera: periodicDir=3 else: periodicDir=0 @@ -248,7 +248,7 @@ def _addPeriodicDataInSolverParam(a, rotationCenter=[0.,0.,0.], rotationAngle=[0 axis=[0.,0.,0.]; axis[diraxis] = 1. if NAzimutalSectors>0: angle1 = int(NAzimutalSectors) else: angle1 = int(round(360./abs(rotationAngle[diraxis]))) # number of angular sectors of the component which includes the zone in radian - angle2 = 1 + angle2 = 1 paramNames = ['axis_ang_1','axis_ang_2','axis_pnt_x','axis_pnt_y','axis_pnt_z','axis_vct_x','axis_vct_y','axis_vct_z'] paramValues = [angle1,angle2,xc,yc,zc,axis[0],axis[1],axis[2]] @@ -261,7 +261,7 @@ def _addPeriodicDataInSolverParam(a, rotationCenter=[0.,0.,0.], rotationAngle=[0 for nop, v in enumerate(paramValues): nodes.append(Internal.createNode(paramNames[nop],'DataArray_t',value=v)) Internal._createChild(z,".Solver#Param",'UserDefinedData_t',value=None, children=nodes) - else: + else: for nop, v in enumerate(paramValues): node = Internal.getNodeFromName(solverParam, paramNames[nop]) if node is None: @@ -271,7 +271,7 @@ def _addPeriodicDataInSolverParam(a, rotationCenter=[0.,0.,0.], rotationAngle=[0 return None -def addPeriodicDataInSolverParam(a, rotationCenter=[0.,0.,0.], +def addPeriodicDataInSolverParam(a, rotationCenter=[0.,0.,0.], rotationAngle=[1.,0.,0.], NAzimutalSectors=0, isChimera=False): """Add periodic data for grid connectivity in zone in a .Solver#Param node.""" tp = Internal.copyRef(a) @@ -304,7 +304,7 @@ def _addOutput(a, Dict, name='', update=False): for each in Dict: nodeso+=[Internal.createNode(each,'DataArray_t',value=Dict[each])] a[2].append(Internal.createNode(outputName, 'UserDefinedData_t',children=nodeso)) else: - if update: + if update: Internal._rmNodesByName(a, outputName) nodeso = [] for each in Dict: nodeso+=[Internal.createNode(each,'DataArray_t',value=Dict[each])] @@ -441,7 +441,7 @@ def _addReferenceState(t, conservative=None, temp=None, turbmod='spalart', Usage: _addReferenceState(t, conservative, temp, turbmod, name, comments)""" strcomments = str(comments) - if conservative is None: + if conservative is None: raise ValueError("addReferenceState: conservative arg must be defined as a list of strings.") nvars = len(conservative) if nvars < 5: @@ -451,9 +451,9 @@ def _addReferenceState(t, conservative=None, temp=None, turbmod='spalart', if nvars == 5: pass elif nvars == 6: if turbmod == 'spalart': varnames+=['TurbulentSANuTildeDensity'] - else: raise ValueError("Inconsistent model for 6-variable equations. Must be 'spalart'.") + else: raise ValueError("Inconsistent model for 6-variable equations. Must be 'spalart'.") elif nvars == 7: - if turbmod[0:6] =='komega': + if turbmod[0:6] =='komega': varnames.append('TurbulentEnergyKineticDensity') varnames.append('TurbulentDissipationRateDensity') elif turbmod[0:4]=='keps' or turbmod == 'chien' or turbmod == 'asm': @@ -534,7 +534,7 @@ def _addFlowSolution(t, name='', loc='CellCenter', variables=None, addBCExtract=False, protocol="end"): """Add a node to extract the flow solution.""" if governingEquations is not None: gE0 = governingEquations - else: + else: gE0 = None GE = Internal.getNodeFromType2(t,'GoverningEquations_t') if GE is not None: gE0 = Internal.getValue(GE) @@ -566,8 +566,8 @@ def _addFlowSolution(t, name='', loc='CellCenter', variables=None, childrenNodes = [] childrenNodes.append(Internal.createNode('GridLocation','GridLocation_t',value=loc)) if variables is None: - if gE0 is None: - if variables is None: variables = [] + if gE0 is None: + if variables is None: variables = [] else: variables = __CONSERVATIVE__+__COMMONS__ @@ -576,17 +576,17 @@ def _addFlowSolution(t, name='', loc='CellCenter', variables=None, #print('addFlowSolution: extracted variables are: ',variables) else: if isinstance(variables,str): variables = variables.split() - if "xyz" in variables: + if "xyz" in variables: variables+= __XYZ__; novar = variables.index("xyz"); variables.pop(novar) - if "Conservative" in variables: + if "Conservative" in variables: variables += __CONSERVATIVE__; novar = variables.index("Conservative"); variables.pop(novar) - if 'Turbulent' in variables: + if 'Turbulent' in variables: variables+=__TURBULENT__; novar = variables.index("Turbulent"); variables.pop(novar) - if "Commons" in variables: + if "Commons" in variables: variables+=__COMMONS__; novar = variables.index("Commons"); variables.pop(novar) - if 'CommonsNS' in variables: + if 'CommonsNS' in variables: variables+=__COMMONSNS__; novar = variables.index("CommonsNS"); variables.pop(novar) - if 'WallDistance' in variables: + if 'WallDistance' in variables: variables+=__WALLDISTANCE__; novar = variables.index("WallDistance"); variables.pop(novar) variables= list(set(variables)) @@ -596,7 +596,7 @@ def _addFlowSolution(t, name='', loc='CellCenter', variables=None, if addBCExtract: subChildren1 = [] for bc in Internal.getNodesFromType2(z, "BC_t"): - prval = Internal.getValue(Internal.getNodeFromName1(bc, "PointRange")) + prval = Internal.getValue(Internal.getNodeFromName1(bc, "PointRange")) subChildren2 = [Internal.createNode("PointRange","DataArray_t", value=prval)] subChildren2+= [Internal.createNode("Protocol","Descriptor_t",value=protocol)] strval = '\n'.join(['SurfaceSolution/NeumannData/'+variable for variable in variables]) @@ -621,7 +621,7 @@ def _buildMaskFiles(t, keepOversetHoles=True, fileDir='.', prefixBase=False): basename = Internal.getName(base) for z in Internal.getZones(base): ho = Internal.getNodeFromType2(z, 'OversetHoles_t') - if ho is not None: + if ho is not None: pl = Internal.getNodeFromName1(ho,'PointList') h = Internal.getValue(pl) dim = Internal.getZoneDim(z) @@ -645,7 +645,7 @@ def buildMaskFiles(t, keepOversetHoles=True, fileDir='.', prefixBase=False): return tp #============================================================================== -# set BCOverlap - version 1: a la Thomas +# set BCOverlap - version 1: a la Thomas #============================================================================== def overlapGC2BC(t): """ Convert the Overlap boundary conditions from GC (Grid Connectivity) to BC (Boundary Condition) for elsA solver. @@ -684,7 +684,7 @@ def _overlapGC2BC(t): foundDD = False ovsons = [PRBC] for childov in Internal.getChildren(ov): - if Internal.getType(childov)=='UserDefinedData_t': + if Internal.getType(childov)=='UserDefinedData_t': if Internal.getNodeFromName1(childov,"doubly_defined") is not None: isDD = True foundDD = True @@ -695,7 +695,7 @@ def _overlapGC2BC(t): if dnrList=="": dnrList+=dnr else: dnrList+=" "+dnr - # family dd + # family dd famOvlpName = __FAMOVERLAPDDBC__+ov[0] DDnode=Internal.createNode('doubly_defined','DataArray_t',value='active') NLnode=Internal.createNode('NeighbourList','DataArray_t',value=dnrList) @@ -709,7 +709,7 @@ def _overlapGC2BC(t): overlapbcs.append(ovbc) if not foundDD: isClassical = True - if zbc is None: + if zbc is None: newZoneBC = Internal.createNode("ZoneBC","ZoneBC_t",value=None,children=overlapbcs) Internal._addChild(t[2][nob][2][noz],newZoneBC) else: @@ -723,12 +723,12 @@ def _overlapGC2BC(t): FamOvlp = Internal.getNodeFromName1(base, famOvlpName) if FamOvlp: NLnode = Internal.createNode('NeighbourList', 'DataArray_t') - Internal._createChild(FamOvlp, '.Solver#Overlap', 'UserDefinedData_t', + Internal._createChild(FamOvlp, '.Solver#Overlap', 'UserDefinedData_t', value=None, children=[NLnode]) # renommage en FamilySpecified des doubly defined UserDefinedDD - for bc in Internal.getNodesFromType3(t[2][nob],'BC_t'): - if Internal.getValue(bc)=='UserDefinedDD': + for bc in Internal.getNodesFromType3(t[2][nob],'BC_t'): + if Internal.getValue(bc)=='UserDefinedDD': Internal.setValue(bc,'FamilySpecified') return None @@ -816,7 +816,7 @@ def _fillNeighbourList(t, sameBase=0): Internal.createNode("FamilyName", "FamilyName_t", value=chimgroupname, parent=t[2][nobd][2][nozd]) # create ChimGroup for donor base - if nobd not in listOfDnrBasesNob: + if nobd not in listOfDnrBasesNob: listOfDnrBasesNob.append(nobd) chimgroupsons = [Internal.createNode("FamilyBC","FamilyBC_t",value='UserDefined')] chmg=Internal.createNode(chimgroupname,"Family_t",children=chimgroupsons) @@ -859,7 +859,7 @@ def _fillNeighbourList(t, sameBase=0): baseName = baseLoc[0] dnrname = baseName+'/'+dnrname if dnrListNL =="": dnrListNL=dnrname - else: dnrListNL += " "+dnrname + else: dnrListNL += " "+dnrname else: if dnrListNL =="": dnrListNL=dnrname else: dnrListNL += " "+dnrname @@ -869,7 +869,7 @@ def _fillNeighbourList(t, sameBase=0): nobd = dictOfNobOfZone[dnrname] Internal.createNode("FamilyName", "FamilyName_t", value=chimgroupnamedd, parent=t[2][nobd][2][nozd]) # create ChimGroup for donor base - if nobd not in listOfDnrBasesNob: + if nobd not in listOfDnrBasesNob: listOfDnrBasesNob.append(nobd) chimgroupsons = [Internal.createNode("FamilyBC","FamilyBC_t",value='UserDefined')] chmg=Internal.createNode(chimgroupnamedd,"Family_t",children=chimgroupsons) @@ -963,7 +963,7 @@ def _adaptNearMatch(t): PRD2 = Internal.createNode("PointRangeDonor","IndexRange_t",value=Internal.getValue(PRD),parent=gc) transfo2 = Internal.createNode('Transform','\"int[IndexDimension]\"',value=Internal.getValue(transfo),parent=gc) Internal._rmNodesByName(gc,udd[0]) - Internal._rmNodesByName(gc,"PointListDonor") + Internal._rmNodesByName(gc,"PointListDonor") Internal._rmNodesByName(gc,'GridConnectivityType') # fine or coarse fine = 0; iratio=1; jratio=1; kratio=1 @@ -1015,7 +1015,7 @@ def _createElsaHybrid(t, method=0, axe2D=0, methodPE=0): CE = Internal.getNodeFromName1(node, 'ElementConnectivity') PE = Internal.getNodeFromName1(node, 'ParentElements') if PE is None: - Internal._adaptNFace2PE(z, remove=False, methodPE = methodPE) + Internal._adaptNFace2PE(z, remove=False, methodPE=methodPE) PE = Internal.getNodeFromName1(node, 'ParentElements') er = Internal.getNodeFromName1(node, 'ElementRange') nfaces = er[1][1]-er[1][0]+1 @@ -1055,7 +1055,7 @@ def _createElsaHybrid(t, method=0, axe2D=0, methodPE=0): return None #============================================================================== -# Prefix ID_* zone subregion donors +# Prefix ID_* zone subregion donors #============================================================================== def prefixDnrInSubRegions(t): """Prefix zone subregion ID_* donor names with base name.""" @@ -1078,7 +1078,7 @@ def _prefixDnrInSubRegions(t): subRegions= Internal.getNodesFromType1(z,'ZoneSubRegion_t') for s in subRegions: sname = Internal.getName(s) - if sname.split('_')[0] == 'ID': + if sname.split('_')[0] == 'ID': dnrname = Internal.getValue(s) s2 = dnrname.split('/') if len(s2)==1: @@ -1551,7 +1551,7 @@ def buildPart__(g): return equivalenceNames -# Nettoie l'arbre +# Nettoie l'arbre def cleanTree__(t): tp = Internal.copyRef(t) g = buildGraph__(tp) @@ -1585,7 +1585,7 @@ def _splitHybridBCMatch(t): name = g[0] Internal._rmNodesFromName(zgc, name) for i in range(6): - if SPL[i] is not None: + if SPL[i] is not None: n = Internal.createChild(zgc, C.getBCName(name), 'GridConnectivity1to1_t', value=Internal.getValue(g)) Internal.createChild(n, 'GridLocation', 'GridLocation_t', value='FaceCenter') Internal.createChild(n, 'PointList', 'IndexArray_t', value=SPL[i].reshape(1,SPL[i].size)) @@ -1608,7 +1608,7 @@ def _splitHybridBCMatch(t): name = g[0] Internal._rmNodesFromName(zgc, name) for i in range(6): - if SPL[i] is not None: + if SPL[i] is not None: n = Internal.createChild(zgc, C.getBCName(name), 'GridConnectivity_t', value=zdname) Internal.createChild(n, 'GridLocation', 'GridLocation_t', value='FaceCenter') Internal.createChild(n, 'PointList', 'IndexArray_t', value=SPL[i+6].reshape(1,SPL[i+6].size)) diff --git a/Cassiopee/Converter/doc/source/conf.py b/Cassiopee/Converter/doc/source/conf.py index d4dcfc06e..56c49db94 100644 --- a/Cassiopee/Converter/doc/source/conf.py +++ b/Cassiopee/Converter/doc/source/conf.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Converter documentation build configuration file -# +# import sys import os @@ -192,15 +192,15 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', -'preamble': r''' + # Additional stuff for the LaTeX preamble. + #'preamble': '', + 'preamble': r''' \usepackage{charter} \usepackage[defaultsans]{lato} \usepackage{inconsolata} @@ -211,16 +211,16 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('Converter', 'Converter.tex', u'Converter Documentation', - u'/ELSA/MU-09020/V'+__version__, 'manual'), - ('Internal', 'Internal.tex', u'Internal Documentation', - u'/ELSA/MU-09020/V'+__version__, 'manual'), - ('Filter', 'Filter.tex', u'Filter Documentation', - u'/ELSA/MU-09020/V'+__version__, 'manual'), - ('ConverterMpi', 'ConverterMpi.tex', u'Converter.Mpi Documentation', - u'/ELSA/MU-09020/V'+__version__, 'manual'), - ('elsAProfile', 'elsAProfile.tex', u'Converter.elsAProfile Documentation', - u'/ELSA/MU-09020/V'+__version__, 'manual'), + ('Converter', 'Converter.tex', u'Converter Documentation', + u'/ELSA/MU-09020/V'+__version__, 'manual'), + ('Internal', 'Internal.tex', u'Internal Documentation', + u'/ELSA/MU-09020/V'+__version__, 'manual'), + ('Filter', 'Filter.tex', u'Filter Documentation', + u'/ELSA/MU-09020/V'+__version__, 'manual'), + ('ConverterMpi', 'ConverterMpi.tex', u'Converter.Mpi Documentation', + u'/ELSA/MU-09020/V'+__version__, 'manual'), + ('elsAProfile', 'elsAProfile.tex', u'Converter.elsAProfile Documentation', + u'/ELSA/MU-09020/V'+__version__, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -263,9 +263,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Converter', u'Converter Documentation', - u'ONERA', 'Converter', 'One line description of project.', - 'Miscellaneous'), + ('index', 'Converter', u'Converter Documentation', + u'ONERA', 'Converter', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/Converter/setup.py b/Cassiopee/Converter/setup.py index bdcc189b1..be5543e35 100644 --- a/Cassiopee/Converter/setup.py +++ b/Cassiopee/Converter/setup.py @@ -52,14 +52,14 @@ if mpi4py: includeDirs.append(mpi4pyIncDir) -if hdf: +if hdf: for l in hdflibs: libraries.append(l) if mpi: libraries += mpiLibs (ok, libs, paths) = Dist.checkFortranLibs([], additionalLibPaths) libraryDirs += paths; libraries += libs (ok, libs, paths) = Dist.checkCppLibs([], additionalLibPaths) -libraryDirs += paths; libraries += libs +libraryDirs += paths; libraries += libs # Extensions ================================================================== listExtensions = [] @@ -75,13 +75,13 @@ import srcs if srcs.EXPRESSION: listExtensions.append( - Extension('Converter.expression', - sources=['Converter/Expression/Expression.cpp'], - include_dirs=["Converter"]+additionalIncludePaths+includeDirs, - library_dirs=additionalLibPaths+libraryDirs, - libraries=libraries+additionalLibs, - extra_compile_args=Dist.getCppArgs()+ADDITIONALCPPFLAGS, - extra_link_args=Dist.getLinkArgs() ) ) + Extension('Converter.expression', + sources=['Converter/Expression/Expression.cpp'], + include_dirs=["Converter"]+additionalIncludePaths+includeDirs, + library_dirs=additionalLibPaths+libraryDirs, + libraries=libraries+additionalLibs, + extra_compile_args=Dist.getCppArgs()+ADDITIONALCPPFLAGS, + extra_link_args=Dist.getLinkArgs() ) ) # setup ====================================================================== setup( @@ -93,7 +93,7 @@ packages=['Converter'], package_dir={"":"."}, ext_modules=listExtensions - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Converter/setupLegacy.py b/Cassiopee/Converter/setupLegacy.py index f69181505..b75326bad 100644 --- a/Cassiopee/Converter/setupLegacy.py +++ b/Cassiopee/Converter/setupLegacy.py @@ -102,7 +102,7 @@ package_dir={"":"."}, packages=['Converter'], ext_modules=listExtensions - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Converter/srcs.py b/Cassiopee/Converter/srcs.py index 9ce04bdf0..d9704a03d 100644 --- a/Cassiopee/Converter/srcs.py +++ b/Cassiopee/Converter/srcs.py @@ -154,7 +154,7 @@ 'Converter/Expression/parser.cpp', 'Converter/Expression/symbol_table.cpp', 'Converter/Expression/simd_vector_wrapper.cpp' - ] + ] if hdf: cpp_srcs += ['Converter/IO/GenIO_hdfcgns.cpp'] @@ -175,4 +175,3 @@ 'Converter/Fortran/WriteGridF.for', 'Converter/Fortran/WriteIBFileF.for', 'Converter/Fortran/WriteFFDFileF.for'] - diff --git a/Cassiopee/Converter/test/Quarantine/adapt2FastP_t1.py b/Cassiopee/Converter/test/Quarantine/adapt2FastP_t1.py index b69babfe6..e18d14728 100644 --- a/Cassiopee/Converter/test/Quarantine/adapt2FastP_t1.py +++ b/Cassiopee/Converter/test/Quarantine/adapt2FastP_t1.py @@ -12,7 +12,7 @@ t = C.newPyTree(['Base', b]) t = X.connectMatch(t) C._fillEmptyBCWith(t, 'wall', 'BCWall', dim=3) -Internal._adaptNFace2PE(t, remove=False) +Internal._adaptNFace2PE(t, remove=False) # Test avec deux couches t = GC.adapt2FastP(t, nlayers=2) # creation parentElement du NGon test.testT(t, 1) diff --git a/Cassiopee/Converter/test/Quarantine/addGhostcellNGFastP_t1.py b/Cassiopee/Converter/test/Quarantine/addGhostcellNGFastP_t1.py index 5998d2329..5ebd18ef0 100644 --- a/Cassiopee/Converter/test/Quarantine/addGhostcellNGFastP_t1.py +++ b/Cassiopee/Converter/test/Quarantine/addGhostcellNGFastP_t1.py @@ -12,7 +12,6 @@ C._fillEmptyBCWith(t, 'extrap', 'BCExtrapolate', dim=3) t = T.splitNParts(t, 2) t = X.connectMatch(t,dim=3) -Internal._adaptNFace2PE(t, remove=False) -t = GC.addGhostCellsNG(t, nlayers=2) +Internal._adaptNFace2PE(t, remove=False) +t = GC.addGhostCellsNG(t, nlayers=2) test.testT(t, 1) - diff --git a/Cassiopee/Converter/test/adaptPeriodicMatchPT.py b/Cassiopee/Converter/test/adaptPeriodicMatchPT.py index 8abb6d04c..309a91406 100644 --- a/Cassiopee/Converter/test/adaptPeriodicMatchPT.py +++ b/Cassiopee/Converter/test/adaptPeriodicMatchPT.py @@ -5,7 +5,7 @@ import Converter.Internal as Internal import Converter.elsAProfile as elsAProfile -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) t = C.newPyTree(['Base',a]) t = X.connectMatchPeriodic(t, rotationCenter=[0.,0.,0.], translation=[0.,0.,5.]) diff --git a/Cassiopee/Converter/test/adaptPeriodicMatchPT_t1.py b/Cassiopee/Converter/test/adaptPeriodicMatchPT_t1.py index aa21b0fd2..5115db2c3 100644 --- a/Cassiopee/Converter/test/adaptPeriodicMatchPT_t1.py +++ b/Cassiopee/Converter/test/adaptPeriodicMatchPT_t1.py @@ -5,14 +5,14 @@ import Converter.elsAProfile as elsAProfile import KCore.test as test -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) t = C.newPyTree(['Base',a]) t = X.connectMatchPeriodic(t, rotationCenter=[0.,0.,0.], rotationAngle=[0.,0.,90.]) tp = elsAProfile.adaptPeriodicMatch(t) test.testT(tp,1) -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) t = C.newPyTree(['Base',a]) t = X.connectMatchPeriodic(t,translation=[0.,0.,5.]) tp = elsAProfile.adaptPeriodicMatch(t) diff --git a/Cassiopee/Converter/test/addBC2Zone_t1.py b/Cassiopee/Converter/test/addBC2Zone_t1.py index 271e9c452..a297a229f 100644 --- a/Cassiopee/Converter/test/addBC2Zone_t1.py +++ b/Cassiopee/Converter/test/addBC2Zone_t1.py @@ -8,8 +8,8 @@ a = G.cart((-0.1,0.9,0), (0.01,0.01,1.), (20,20,2)) a = C.initVars(a,'F',1.); a = C.initVars(a,'centers:G',2.) a = C.addBC2Zone(a, 'wall1', 'BCWall', 'jmin') -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imin', a, 'imax', [1,2,3]) -a = C.addBC2Zone(a, 'nearmatch1','BCNearMatch', 'imax', a, 'imin', [1,2,3]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imin', a, 'imax', [1,2,3]) +a = C.addBC2Zone(a, 'nearmatch1','BCNearMatch', 'imax', a, 'imin', [1,2,3]) a = C.addBC2Zone(a, 'overlap1', 'BCOverlap', 'jmax') a = C.addBC2Zone(a, 'overlap2', 'BCOverlap', 'jmin', \ zoneDonor=[a], rangeDonor='doubly_defined') @@ -20,8 +20,8 @@ a = G.cart((-0.1,0.9,0), (0.01,0.01,1.), (20,20,1)) a = C.initVars(a,'F',1.); a = C.initVars(a,'centers:G',2.) a = C.addBC2Zone(a, 'wall1', 'BCWall', 'jmin') -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imin', a, 'imax', [1,2]) -a = C.addBC2Zone(a, 'nearmatch1', 'BCNearMatch', 'imax', a, 'imin', [1,2]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imin', a, 'imax', [1,2]) +a = C.addBC2Zone(a, 'nearmatch1', 'BCNearMatch', 'imax', a, 'imin', [1,2]) a = C.addBC2Zone(a, 'overlap1', 'BCOverlap', 'jmax') a = C.addBC2Zone(a, 'overlap2', 'BCOverlap', 'jmin', \ zoneDonor=[a], rangeDonor='doubly_defined') @@ -31,8 +31,8 @@ # 1D a = G.cart((-0.1,0.9,0), (0.01,0.01,1.), (20,1,1)) a = C.initVars(a,'F',1.); a = C.initVars(a,'centers:G',2.) -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imin', a, 'imax', [1]) -a = C.addBC2Zone(a, 'nearmatch1', 'BCNearMatch', 'imax', a, 'imin', [1]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imin', a, 'imax', [1]) +a = C.addBC2Zone(a, 'nearmatch1', 'BCNearMatch', 'imax', a, 'imin', [1]) t = C.newPyTree(['Base',1]); t[2][1][2].append(a) test.testT(t, 3) @@ -64,4 +64,3 @@ t[2][1][2].append(a); t[2][2][2].append(b) C._addFamily2Base(t[2][2], 'FENTE') test.testT(t,6) - diff --git a/Cassiopee/Converter/test/addBXZonesPT_m1.py b/Cassiopee/Converter/test/addBXZonesPT_m1.py index a539a7074..94aa01fb8 100644 --- a/Cassiopee/Converter/test/addBXZonesPT_m1.py +++ b/Cassiopee/Converter/test/addBXZonesPT_m1.py @@ -1,7 +1,7 @@ -# - addBXZones (pyTree) - +# - addBXZones (pyTree) - import Converter.PyTree as C import Generator.PyTree as G -import Transform.PyTree as T +import Transform.PyTree as T import Converter.Filter as Filter import Converter.Mpi as Cmpi import KCore.test as test @@ -23,12 +23,12 @@ Cmpi.barrier() -# Load +# Load h = Filter.Handle(LOCAL+'/case.cgns') a = h.loadAndDistribute() # Ajout XZones Cmpi._addBXZones(a) -# Test +# Test if Cmpi.rank == 0: test.testT(a, 1) diff --git a/Cassiopee/Converter/test/addFlowSolutionEoRPT_t1.py b/Cassiopee/Converter/test/addFlowSolutionEoRPT_t1.py index 7bc51a202..9fd64b0e5 100644 --- a/Cassiopee/Converter/test/addFlowSolutionEoRPT_t1.py +++ b/Cassiopee/Converter/test/addFlowSolutionEoRPT_t1.py @@ -12,20 +12,20 @@ notest = 1 for gvEq in ["Euler","NSLaminar","NSTurbulent",None]: tp = elsAProfile.addFlowSolutionEoR(t,governingEquations=gvEq) - test.testT(tp,notest) + test.testT(tp,notest) notest+=1 for extractBC in [False,True]: tp = elsAProfile.addFlowSolutionEoR(t,addBCExtract=extractBC) - test.testT(tp,notest) + test.testT(tp,notest) notest+=1 for frame in ['relative','absolute']: tp = elsAProfile.addFlowSolutionEoR(t,writingFrame=frame) - test.testT(tp,notest) + test.testT(tp,notest) notest+=1 for protocol in ['end','iteration','after']: tp = elsAProfile.addFlowSolutionEoR(t,protocol=protocol) - test.testT(tp,notest) + test.testT(tp,notest) notest+=1 diff --git a/Cassiopee/Converter/test/addFlowSolutionPT_t1.py b/Cassiopee/Converter/test/addFlowSolutionPT_t1.py index fd397b6cc..ce737f578 100644 --- a/Cassiopee/Converter/test/addFlowSolutionPT_t1.py +++ b/Cassiopee/Converter/test/addFlowSolutionPT_t1.py @@ -62,4 +62,3 @@ tp = elsAProfile.addFlowSolution(t,protocol=protocol,variables=[]) test.testT(tp, notest) notest += 1 - diff --git a/Cassiopee/Converter/test/addGhostCellsNGon_t1.py b/Cassiopee/Converter/test/addGhostCellsNGon_t1.py index 6fa09266c..56f8a7fe9 100644 --- a/Cassiopee/Converter/test/addGhostCellsNGon_t1.py +++ b/Cassiopee/Converter/test/addGhostCellsNGon_t1.py @@ -27,6 +27,3 @@ a = G.close(a) b = C.addGhostCellsNGon(a, depth=1) test.testA([b],4) - - - diff --git a/Cassiopee/Converter/test/addMXZonesPT_m1.py b/Cassiopee/Converter/test/addMXZonesPT_m1.py index a9fa3370c..d963c013c 100644 --- a/Cassiopee/Converter/test/addMXZonesPT_m1.py +++ b/Cassiopee/Converter/test/addMXZonesPT_m1.py @@ -1,7 +1,7 @@ # - addMXZones (pyTree) - import Converter.PyTree as CP import Generator.PyTree as GP -import Transform.PyTree as TP +import Transform.PyTree as TP import Converter.Filter as Filter import Converter.Mpi as Cmpi import KCore.test as test @@ -19,12 +19,12 @@ CP.convertPyTree2File(t, LOCAL+'/case.cgns') Cmpi.barrier() -# Load +# Load h = Filter.Handle(LOCAL+'/case.cgns') a = h.loadAndDistribute() -# # Ajout XZones +# # Ajout XZones Cmpi._addMXZones(a) -# Test +# Test if Cmpi.rank == 0: test.testT(a, 1) diff --git a/Cassiopee/Converter/test/addOutputFrictionPT_t1.py b/Cassiopee/Converter/test/addOutputFrictionPT_t1.py index 0564c2a7a..cc721ddb5 100644 --- a/Cassiopee/Converter/test/addOutputFrictionPT_t1.py +++ b/Cassiopee/Converter/test/addOutputFrictionPT_t1.py @@ -6,7 +6,7 @@ import KCore.test as test a = G.cart( (0,0,0), (1,1,1), (10,10,10) ) -a = C.addBC2Zone(a, 'wall', 'BCWall', 'imin') +a = C.addBC2Zone(a, 'wall', 'BCWall', 'imin') bcs = Internal.getNodesFromName(a, 'wall') for b in bcs: elsAProfile._addOutputFriction(b) diff --git a/Cassiopee/Converter/test/addPeriodicDataInSolverParamPT.py b/Cassiopee/Converter/test/addPeriodicDataInSolverParamPT.py index b6bdc497c..d3fcd5c16 100644 --- a/Cassiopee/Converter/test/addPeriodicDataInSolverParamPT.py +++ b/Cassiopee/Converter/test/addPeriodicDataInSolverParamPT.py @@ -3,7 +3,7 @@ import Converter.PyTree as C import Converter.elsAProfile as elsAProfile -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) t = C.newPyTree(['Base', a]) tp = elsAProfile.addPeriodicDataInSolverParam(t, rotationAngle=[0.,0.,90.], isChimera=True) C.convertPyTree2File(tp, 'out.cgns') diff --git a/Cassiopee/Converter/test/addPeriodicDataInSolverParamPT_t1.py b/Cassiopee/Converter/test/addPeriodicDataInSolverParamPT_t1.py index 14492f4eb..cb5cef6cb 100644 --- a/Cassiopee/Converter/test/addPeriodicDataInSolverParamPT_t1.py +++ b/Cassiopee/Converter/test/addPeriodicDataInSolverParamPT_t1.py @@ -3,20 +3,17 @@ import Converter.PyTree as C import Converter.elsAProfile as elsAProfile import KCore.test as test -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) t = C.newPyTree(['Base',a]) tp = elsAProfile.addPeriodicDataInSolverParam(t,rotationAngle=[0.,0.,90.],isChimera=True) test.testT(tp,1) -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) t = C.newPyTree(['Base',a]) tp = elsAProfile.addPeriodicDataInSolverParam(t,NAzimutalSectors=4,isChimera=True) test.testT(tp,2) -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 90., 5., (11,11,11)) t = C.newPyTree(['Base',a]) elsAProfile._addPeriodicDataInSolverParam(t,NAzimutalSectors=4,isChimera=True) test.testT(t,3) - - - diff --git a/Cassiopee/Converter/test/addStatePT_t1.py b/Cassiopee/Converter/test/addStatePT_t1.py index 042f17558..502c832ff 100644 --- a/Cassiopee/Converter/test/addStatePT_t1.py +++ b/Cassiopee/Converter/test/addStatePT_t1.py @@ -6,7 +6,7 @@ a = G.cylinder((0,0,0), 1., 1.5, 0., 360., 1., (80,30,2)) a = C.addBC2Zone(a,'wall','BCWall','imin') a = C.addBC2Zone(a,'overlap','BCOverlap','imax') -a = C.initVars(a,'F',1.); a = C.initVars(a,'centers:G',2.) +a = C.initVars(a,'F',1.); a = C.initVars(a,'centers:G',2.) t = C.newPyTree(['Base',3]); t[2][1][2].append(a) # Add state by value @@ -30,4 +30,3 @@ t = C.newPyTree(['Base',3]); t[2][1][2].append(a) t = C.addState(t, adim='dim2', UInf=35., TInf=294., RoInf=1.2, LInf=1.) test.testT(t, 3) - diff --git a/Cassiopee/Converter/test/addVars_t1.py b/Cassiopee/Converter/test/addVars_t1.py index 1ee7c3f03..ce4a8e743 100644 --- a/Cassiopee/Converter/test/addVars_t1.py +++ b/Cassiopee/Converter/test/addVars_t1.py @@ -37,7 +37,7 @@ f = C.addVars([c,d]) test.testA(f, 3) -# NGON +# NGON a = G.cartNGon((0,0,0),(1,1,1),(11,11,11)) b = C.addVars(a, 'F') test.testA([b], 4) @@ -45,4 +45,3 @@ f = ['f',a[1][0:1,:],a[2],a[3]] b = C.addVars([a,f]) test.testA([b], 5) - diff --git a/Cassiopee/Converter/test/addXZonesPT_m1.py b/Cassiopee/Converter/test/addXZonesPT_m1.py index 7b3b27ca5..b89ee6029 100644 --- a/Cassiopee/Converter/test/addXZonesPT_m1.py +++ b/Cassiopee/Converter/test/addXZonesPT_m1.py @@ -27,6 +27,6 @@ graph = Cmpi.computeGraph(tb) # Add X Zones t = Cmpi.addXZones(t, graph) -if Cmpi.rank == 0: +if Cmpi.rank == 0: #Internal.printTree(t) test.testT(t, 1) diff --git a/Cassiopee/Converter/test/allgatherTreePT.py b/Cassiopee/Converter/test/allgatherTreePT.py index 15a5e92f5..622b98b79 100644 --- a/Cassiopee/Converter/test/allgatherTreePT.py +++ b/Cassiopee/Converter/test/allgatherTreePT.py @@ -20,4 +20,3 @@ t = Cmpi.convert2PartialTree(t) t = Cmpi.allgatherTree(t) # full tree on every processors if Cmpi.rank == 0: Internal.printTree(t) - diff --git a/Cassiopee/Converter/test/allgatherTreePT_m1.py b/Cassiopee/Converter/test/allgatherTreePT_m1.py index 616d43c01..e0dd80e43 100644 --- a/Cassiopee/Converter/test/allgatherTreePT_m1.py +++ b/Cassiopee/Converter/test/allgatherTreePT_m1.py @@ -22,4 +22,3 @@ t = Cmpi.convert2PartialTree(t) t = Cmpi.allgatherTree(t) # full tree on every processors if Cmpi.rank == 0: test.testT(t, 1) - diff --git a/Cassiopee/Converter/test/autoSetContainersPT_t1.py b/Cassiopee/Converter/test/autoSetContainersPT_t1.py index ff74665a1..943e09c2c 100644 --- a/Cassiopee/Converter/test/autoSetContainersPT_t1.py +++ b/Cassiopee/Converter/test/autoSetContainersPT_t1.py @@ -12,4 +12,3 @@ t = C.newPyTree(['Base',a]) Internal.autoSetContainers(t) test.testO([Internal.__FlowSolutionNodes__, Internal.__FlowSolutionCenters__]) - diff --git a/Cassiopee/Converter/test/breakConnectivityPT_t1.py b/Cassiopee/Converter/test/breakConnectivityPT_t1.py index 449421e45..4cd487b2c 100644 --- a/Cassiopee/Converter/test/breakConnectivityPT_t1.py +++ b/Cassiopee/Converter/test/breakConnectivityPT_t1.py @@ -3,7 +3,7 @@ import Generator.PyTree as G import KCore.test as test -a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) +a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) b = G.cartTetra((9,0,0), (1,1,1), (10,10,10)) c = C.mergeConnectivity(a, b, boundary=0) diff --git a/Cassiopee/Converter/test/center2NodeDPT.py b/Cassiopee/Converter/test/center2NodeDPT.py index 151eed850..afb1784e3 100755 --- a/Cassiopee/Converter/test/center2NodeDPT.py +++ b/Cassiopee/Converter/test/center2NodeDPT.py @@ -22,7 +22,7 @@ sk = Cmpi.convertFile2SkeletonTree('in.cgns') # equilibrage -(sk, dic) = Distributor2.distribute(sk, NProc=Cmpi.size, algorithm='gradient0', +(sk, dic) = Distributor2.distribute(sk, NProc=Cmpi.size, algorithm='gradient0', useCom='match') # load des zones locales dans le squelette diff --git a/Cassiopee/Converter/test/center2NodeMpiPT.py b/Cassiopee/Converter/test/center2NodeMpiPT.py index 15357ea72..0dc94b99f 100755 --- a/Cassiopee/Converter/test/center2NodeMpiPT.py +++ b/Cassiopee/Converter/test/center2NodeMpiPT.py @@ -20,7 +20,7 @@ # Reread in parallel sk = Cmpi.convertFile2SkeletonTree('in.cgns') -(sk, dic) = Distributor2.distribute(sk, NProc=Cmpi.size, algorithm='gradient0', +(sk, dic) = Distributor2.distribute(sk, NProc=Cmpi.size, algorithm='gradient0', useCom='match') a = Cmpi.readZones(sk, 'in.cgns', rank=Cmpi.rank) diff --git a/Cassiopee/Converter/test/center2NodePT_m1.py b/Cassiopee/Converter/test/center2NodePT_m1.py index b5c46ae71..a062314bc 100755 --- a/Cassiopee/Converter/test/center2NodePT_m1.py +++ b/Cassiopee/Converter/test/center2NodePT_m1.py @@ -25,7 +25,7 @@ sk = Cmpi.convertFile2SkeletonTree(LOCAL+'/in.cgns') # equilibrage -(sk, dic) = Distributor2.distribute(sk, NProc=Cmpi.size, algorithm='gradient0', +(sk, dic) = Distributor2.distribute(sk, NProc=Cmpi.size, algorithm='gradient0', useCom='match') # load des zones locales dans le squelette diff --git a/Cassiopee/Converter/test/computeBCMatchField_t1.py b/Cassiopee/Converter/test/computeBCMatchField_t1.py index 00b7060ec..961a8a8fb 100644 --- a/Cassiopee/Converter/test/computeBCMatchField_t1.py +++ b/Cassiopee/Converter/test/computeBCMatchField_t1.py @@ -19,7 +19,7 @@ t = X.connectMatch(t, dim=3) t = C.fillEmptyBCWith(t, 'wall', 'BCWall') -dico = C.extractAllBCMatch(t,['centers:G','centers:H','centers:M']) +dico = C.extractAllBCMatch(t,['centers:G','centers:H','centers:M']) for z in Internal.getZones(t): indR, fld = C.computeBCMatchField(z,dico) diff --git a/Cassiopee/Converter/test/computeBCMatchField_t2.py b/Cassiopee/Converter/test/computeBCMatchField_t2.py index a7b974760..ffce7e065 100644 --- a/Cassiopee/Converter/test/computeBCMatchField_t2.py +++ b/Cassiopee/Converter/test/computeBCMatchField_t2.py @@ -19,7 +19,7 @@ t = X.connectMatch(t, dim=3) t = CP.fillEmptyBCWith(t, "wall", 'BCWall') -dico = CP.extractAllBCMatch(t, varL) +dico = CP.extractAllBCMatch(t, varL) it = 0 for z in Internal.getZones(t): diff --git a/Cassiopee/Converter/test/computeGraphPT_m1.py b/Cassiopee/Converter/test/computeGraphPT_m1.py index ee0836bca..d4fc3286c 100644 --- a/Cassiopee/Converter/test/computeGraphPT_m1.py +++ b/Cassiopee/Converter/test/computeGraphPT_m1.py @@ -28,4 +28,3 @@ # Through match graph = Cmpi.computeGraph(t, type='match') if Cmpi.rank == 0: test.testO(graph, 2) - diff --git a/Cassiopee/Converter/test/computeGraphPT_t2.py b/Cassiopee/Converter/test/computeGraphPT_t2.py index d695834f2..d3cfa4e48 100644 --- a/Cassiopee/Converter/test/computeGraphPT_t2.py +++ b/Cassiopee/Converter/test/computeGraphPT_t2.py @@ -26,14 +26,14 @@ # full graph = Cmpi.computeGraph(t, type='match') -for i in graph: +for i in graph: for k in graph[i]: graph[i][k].sort() if Cmpi.rank == 0: test.testO(graph, 1) # skel (doit etre identique) t = Cmpi.convertFile2SkeletonTree(LOCAL+'/in.cgns') graph = Cmpi.computeGraph(t, type='match') -for i in graph: +for i in graph: for k in graph[i]: graph[i][k].sort() if Cmpi.rank == 0: test.testO(graph, 2) @@ -41,7 +41,7 @@ t = Cmpi.convertFile2SkeletonTree(LOCAL+'/in.cgns') t = Cmpi.readZones(t, LOCAL+'/in.cgns', rank=Cmpi.rank) graph = Cmpi.computeGraph(t, type='match') -for i in graph: +for i in graph: for k in graph[i]: graph[i][k].sort() if Cmpi.rank == 0: test.testO(graph, 3) @@ -53,6 +53,6 @@ # procDict est requis pour les arbres partiels # Le graph est correct uniquement quand on lance sur 5 procs graph = Cmpi.computeGraph(t, type='match', procDict=procDict) -for i in graph: +for i in graph: for k in graph[i]: graph[i][k].sort() if Cmpi.rank == 0: test.testO(graph, 4) diff --git a/Cassiopee/Converter/test/conv6.py b/Cassiopee/Converter/test/conv6.py index f8d055fe8..46fd9207d 100644 --- a/Cassiopee/Converter/test/conv6.py +++ b/Cassiopee/Converter/test/conv6.py @@ -8,7 +8,3 @@ # Write a binary file C.convertArrays2File(arrays, "out.dat.gbin,out.dat.qbin", "bin_plot3d",['int',4]) - - - - diff --git a/Cassiopee/Converter/test/convAdf.py b/Cassiopee/Converter/test/convAdf.py index f22469801..6653ea0b4 100644 --- a/Cassiopee/Converter/test/convAdf.py +++ b/Cassiopee/Converter/test/convAdf.py @@ -3,4 +3,3 @@ t = C.convertFile2PyTree('out.cgns') C.convertPyTree2File(t, 'out2.cgns') - diff --git a/Cassiopee/Converter/test/convFSTL.py b/Cassiopee/Converter/test/convFSTL.py index cb44f3e57..2c3f53e4f 100644 --- a/Cassiopee/Converter/test/convFSTL.py +++ b/Cassiopee/Converter/test/convFSTL.py @@ -5,4 +5,3 @@ a = G.cartTetra((0,0,0), (1,1,1), (10,10,1)) a = C.convertArrays2File([a], 'out.stl', 'fmt_stl') a = C.convertFile2Arrays('out.stl', 'fmt_stl') - diff --git a/Cassiopee/Converter/test/convPov.py b/Cassiopee/Converter/test/convPov.py index 87ec2a755..6158497c3 100644 --- a/Cassiopee/Converter/test/convPov.py +++ b/Cassiopee/Converter/test/convPov.py @@ -16,4 +16,3 @@ # Execute povray import os; os.system("povray -W800 -H600 +a0.3 +SP16 render.pov +P") - diff --git a/Cassiopee/Converter/test/convWav.py b/Cassiopee/Converter/test/convWav.py index 17fb95e94..0aada81ae 100644 --- a/Cassiopee/Converter/test/convWav.py +++ b/Cassiopee/Converter/test/convWav.py @@ -28,7 +28,7 @@ def F(time): a = C.array('Time, Pressure', N, 1, 1) # Time -for i in range(N): a[1][0,i] = Deltat*i +for i in range(N): a[1][0,i] = Deltat*i # Pressure a = C.initVars(a, 'Pressure', F, ['Time']) diff --git a/Cassiopee/Converter/test/convert2elsAxdtPT_t1.py b/Cassiopee/Converter/test/convert2elsAxdtPT_t1.py index e3e57eb12..93860d342 100644 --- a/Cassiopee/Converter/test/convert2elsAxdtPT_t1.py +++ b/Cassiopee/Converter/test/convert2elsAxdtPT_t1.py @@ -27,4 +27,3 @@ #C._initVars(t, "centers:TurbulentDistance",1.) CE._convert2elsAxdt(t, fileDir=LOCAL) test.testT(t, 1) - diff --git a/Cassiopee/Converter/test/convertArray2TetraPT.py b/Cassiopee/Converter/test/convertArray2TetraPT.py index 1ff214fbe..b22c89024 100644 --- a/Cassiopee/Converter/test/convertArray2TetraPT.py +++ b/Cassiopee/Converter/test/convertArray2TetraPT.py @@ -2,7 +2,7 @@ import Converter.PyTree as C import Generator.PyTree as G -# 2D : triangles +# 2D : triangles a = G.cart((0.,0.,0.), (0.1,0.1,0.2), (10,10,1)) b = C.convertArray2Tetra(a) diff --git a/Cassiopee/Converter/test/convertArray3D2Array_t1.py b/Cassiopee/Converter/test/convertArray3D2Array_t1.py index bfac4c746..e1d3e46c8 100644 --- a/Cassiopee/Converter/test/convertArray3D2Array_t1.py +++ b/Cassiopee/Converter/test/convertArray3D2Array_t1.py @@ -7,5 +7,5 @@ a = G.cart( (0,0,0), (0.1, 0.2, 1.), (11, 4, 2)) b = Converter.Array3D.convertArrays2Arrays3D([a]) -c = Converter.Array3D.convertArrays3D2Arrays(b) +c = Converter.Array3D.convertArrays3D2Arrays(b) T.testA(c, 1) diff --git a/Cassiopee/Converter/test/convertArrays2ZoneNode.py b/Cassiopee/Converter/test/convertArrays2ZoneNode.py index ab6bdfacb..0c6048575 100644 --- a/Cassiopee/Converter/test/convertArrays2ZoneNode.py +++ b/Cassiopee/Converter/test/convertArrays2ZoneNode.py @@ -5,4 +5,3 @@ a = G.cart((0.,0.,0.),(1.,1.,1.),(5,5,5)) zone = C.convertArrays2ZoneNode('cart',[a]) print(zone) - diff --git a/Cassiopee/Converter/test/convertFile2PyTreePT_t1.py b/Cassiopee/Converter/test/convertFile2PyTreePT_t1.py index e1911895e..6135ea0a2 100644 --- a/Cassiopee/Converter/test/convertFile2PyTreePT_t1.py +++ b/Cassiopee/Converter/test/convertFile2PyTreePT_t1.py @@ -19,7 +19,7 @@ test.testT(a, 2) # ME - output HEXA -a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) +a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) b = G.cartTetra((9,0,0), (1,1,1), (10,10,10)) z = C.mergeConnectivity(a, b, boundary=0) C.convertPyTree2File(z, LOCAL+'/out3.tp') diff --git a/Cassiopee/Converter/test/convertFile2PyTreePT_t4.py b/Cassiopee/Converter/test/convertFile2PyTreePT_t4.py index 73cabd432..ffae6d371 100644 --- a/Cassiopee/Converter/test/convertFile2PyTreePT_t4.py +++ b/Cassiopee/Converter/test/convertFile2PyTreePT_t4.py @@ -19,7 +19,7 @@ test.testT(a, 2) # ME - output HEXA -a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) +a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) b = G.cartTetra((9,0,0), (1,1,1), (10,10,10)) z = C.mergeConnectivity(a, b, boundary=0) C.convertPyTree2File(z, LOCAL+'/out3.plt') diff --git a/Cassiopee/Converter/test/convertHO2LOPT_t1.py b/Cassiopee/Converter/test/convertHO2LOPT_t1.py index 9a03ce849..84ffb0ba2 100644 --- a/Cassiopee/Converter/test/convertHO2LOPT_t1.py +++ b/Cassiopee/Converter/test/convertHO2LOPT_t1.py @@ -37,6 +37,3 @@ a = C.convertLO2HO(a, 0) a = C.convertHO2LO(a, 0) test.testT(a, 5) - - - diff --git a/Cassiopee/Converter/test/convertHO2LO_t1.py b/Cassiopee/Converter/test/convertHO2LO_t1.py index 94b30df58..afa1a6e44 100644 --- a/Cassiopee/Converter/test/convertHO2LO_t1.py +++ b/Cassiopee/Converter/test/convertHO2LO_t1.py @@ -37,6 +37,3 @@ a = C.convertLO2HO(a, 0) a = C.convertHO2LO(a, 0) test.testA(a, 5) - - - diff --git a/Cassiopee/Converter/test/convertHexa2Struct.py b/Cassiopee/Converter/test/convertHexa2Struct.py index 9eaa6bba4..fbb29bc3b 100755 --- a/Cassiopee/Converter/test/convertHexa2Struct.py +++ b/Cassiopee/Converter/test/convertHexa2Struct.py @@ -2,7 +2,7 @@ import Converter as C import Generator as G -# 2D: +# 2D: a = G.cart((0.,0.,0.), (1,1,2), (5,5,1)) a = C.convertArray2Hexa(a) b = C.convertHexa2Struct(a) diff --git a/Cassiopee/Converter/test/convertHexa2Tetra.py b/Cassiopee/Converter/test/convertHexa2Tetra.py index 99ee9c3f7..3ff01f8a9 100644 --- a/Cassiopee/Converter/test/convertHexa2Tetra.py +++ b/Cassiopee/Converter/test/convertHexa2Tetra.py @@ -2,7 +2,7 @@ import Converter as C import Generator as G -# 2D: quads -> triangles +# 2D: quads -> triangles a = G.cartHexa((0.,0.,0.), (0.1,0.1,0.2), (10,10,1)) b = C.convertArray2Tetra(a) C.convertArrays2File(b, 'out1.plt') diff --git a/Cassiopee/Converter/test/convertHexa2Tetra_t1.py b/Cassiopee/Converter/test/convertHexa2Tetra_t1.py index 8030a24de..b87edcb50 100644 --- a/Cassiopee/Converter/test/convertHexa2Tetra_t1.py +++ b/Cassiopee/Converter/test/convertHexa2Tetra_t1.py @@ -3,7 +3,7 @@ import Generator as G import KCore.test as test -# 2D : QUAD -> TRI +# 2D : QUAD -> TRI a = G.cartHexa((0.,0.,0.), (0.1,0.1,0.2), (10,10,1)) b = C.convertArray2Tetra(a) test.testA([b], 1) diff --git a/Cassiopee/Converter/test/convertLO2HOPT_t1.py b/Cassiopee/Converter/test/convertLO2HOPT_t1.py index d481d9ed7..7ef7e4fb0 100644 --- a/Cassiopee/Converter/test/convertLO2HOPT_t1.py +++ b/Cassiopee/Converter/test/convertLO2HOPT_t1.py @@ -32,6 +32,3 @@ a = T.subzone(a, [0], type='elements') a = C.convertLO2HO(a, 0) test.testT(a, 5) - - - diff --git a/Cassiopee/Converter/test/convertPrism2Tetra_t1.py b/Cassiopee/Converter/test/convertPrism2Tetra_t1.py index 356a53234..8cd2cc339 100644 --- a/Cassiopee/Converter/test/convertPrism2Tetra_t1.py +++ b/Cassiopee/Converter/test/convertPrism2Tetra_t1.py @@ -6,5 +6,3 @@ a = G.cartPenta((0.,0.,0.), (1,1,1), (10,10,3)) a = C.convertArray2Tetra(a) test.testA([a], 1) - - diff --git a/Cassiopee/Converter/test/convertPyTree2Array.py b/Cassiopee/Converter/test/convertPyTree2Array.py index f0a6e24ac..935afd08d 100644 --- a/Cassiopee/Converter/test/convertPyTree2Array.py +++ b/Cassiopee/Converter/test/convertPyTree2Array.py @@ -1,7 +1,7 @@ # - convertPyTree2Array (pyTree) - import Converter.PyTree as C import Generator.PyTree as G -import Converter +import Converter a = G.cart((0.,0.,0.),(0.1,0.1,0.1),(11,11,11)) a = C.initVars(a,'F',1.); a = C.initVars(a,'centers:G',2.) diff --git a/Cassiopee/Converter/test/convertPyTree2FileMPI.py b/Cassiopee/Converter/test/convertPyTree2FileMPI.py index d8b12ab3f..8eadc5bd4 100644 --- a/Cassiopee/Converter/test/convertPyTree2FileMPI.py +++ b/Cassiopee/Converter/test/convertPyTree2FileMPI.py @@ -3,10 +3,10 @@ import Converter.Mpi as Cmpi import Generator.PyTree as G -if Cmpi.rank == 0: +if Cmpi.rank == 0: a = G.cart((0.,0.,0.),(0.1,0.1,0.1),(11,11,11)) a[0] = 'cart0' -else: +else: a = G.cart((10,0,0),(0.1,0.1,0.1),(11,11,11)) a[0] = 'cart1' diff --git a/Cassiopee/Converter/test/convertPyTree2FilePT_t1.py b/Cassiopee/Converter/test/convertPyTree2FilePT_t1.py index 5c2443018..c5b75aeca 100644 --- a/Cassiopee/Converter/test/convertPyTree2FilePT_t1.py +++ b/Cassiopee/Converter/test/convertPyTree2FilePT_t1.py @@ -17,7 +17,7 @@ test.testF(LOCAL+'/out2.tp', 2) # ME - output HEXA -a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) +a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) b = G.cartTetra((9,0,0), (1,1,1), (10,10,10)) z = C.mergeConnectivity(a, b, boundary=0) C.convertPyTree2File(z, LOCAL+'/out3.tp') diff --git a/Cassiopee/Converter/test/convertPyTree2FilePT_t4.py b/Cassiopee/Converter/test/convertPyTree2FilePT_t4.py index 1df2ad6b8..6f3021d1f 100644 --- a/Cassiopee/Converter/test/convertPyTree2FilePT_t4.py +++ b/Cassiopee/Converter/test/convertPyTree2FilePT_t4.py @@ -17,7 +17,7 @@ test.testF(LOCAL+'/out2.plt', 2) # ME - output HEXA -a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) +a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) b = G.cartTetra((9,0,0), (1,1,1), (10,10,10)) z = C.mergeConnectivity(a, b, boundary=0) C.convertPyTree2File(z, LOCAL+'/out3.plt') diff --git a/Cassiopee/Converter/test/convertStruct2Tetra.py b/Cassiopee/Converter/test/convertStruct2Tetra.py index 2741a0f18..b066a6df3 100644 --- a/Cassiopee/Converter/test/convertStruct2Tetra.py +++ b/Cassiopee/Converter/test/convertStruct2Tetra.py @@ -2,7 +2,7 @@ import Converter as C import Generator as G -# 2D: triangles +# 2D: triangles a = G.cart((0.,0.,0.), (0.1,0.1,0.2), (10,10,1)) b = C.convertArray2Tetra(a) C.convertArrays2File(b, 'out1.plt') diff --git a/Cassiopee/Converter/test/convertSurfaceNGonPT_t1.py b/Cassiopee/Converter/test/convertSurfaceNGonPT_t1.py index f27337576..e6230be7b 100644 --- a/Cassiopee/Converter/test/convertSurfaceNGonPT_t1.py +++ b/Cassiopee/Converter/test/convertSurfaceNGonPT_t1.py @@ -29,4 +29,3 @@ # type A : NGON=bars, NFACE=polygon c = C.convertSurfaceNGon(b) test.testT(c, 4) - diff --git a/Cassiopee/Converter/test/copyNodePT.py b/Cassiopee/Converter/test/copyNodePT.py index 993cdd9ae..c7d2a9fb9 100644 --- a/Cassiopee/Converter/test/copyNodePT.py +++ b/Cassiopee/Converter/test/copyNodePT.py @@ -1,4 +1,4 @@ -# - copyNode (pyTree) - +# - copyNode (pyTree) - import Converter.Internal as Internal a = Internal.newDataArray(value=[1,2,3]) diff --git a/Cassiopee/Converter/test/copyNodePT_t1.py b/Cassiopee/Converter/test/copyNodePT_t1.py index 9497be52d..f0920ce01 100644 --- a/Cassiopee/Converter/test/copyNodePT_t1.py +++ b/Cassiopee/Converter/test/copyNodePT_t1.py @@ -1,4 +1,4 @@ -# - copyNode (pyTree) - +# - copyNode (pyTree) - import Converter.Internal as Internal import KCore.test as test diff --git a/Cassiopee/Converter/test/copyRefPT.py b/Cassiopee/Converter/test/copyRefPT.py index a02b4e251..ddd8c8441 100644 --- a/Cassiopee/Converter/test/copyRefPT.py +++ b/Cassiopee/Converter/test/copyRefPT.py @@ -1,4 +1,4 @@ -# - copyRef (pyTree) - +# - copyRef (pyTree) - import Converter.PyTree as C import Converter.Internal as Internal import Generator.PyTree as G diff --git a/Cassiopee/Converter/test/copyTreePT.py b/Cassiopee/Converter/test/copyTreePT.py index b9969b49c..41bc82c1c 100644 --- a/Cassiopee/Converter/test/copyTreePT.py +++ b/Cassiopee/Converter/test/copyTreePT.py @@ -1,4 +1,4 @@ -# - copyTree (pyTree) - +# - copyTree (pyTree) - import Converter.PyTree as C import Generator.PyTree as G import Converter.Internal as Internal @@ -6,5 +6,5 @@ a = G.cart((0,0,0), (1,1,1), (10,10,10)) t = C.newPyTree(['Base',a]) -# t2 is a full copy of t (values/numpys are also copied) +# t2 is a full copy of t (values/numpys are also copied) t2 = Internal.copyTree(t) diff --git a/Cassiopee/Converter/test/copyValuePT_t1.py b/Cassiopee/Converter/test/copyValuePT_t1.py index a6a879214..fdd0d1cfb 100644 --- a/Cassiopee/Converter/test/copyValuePT_t1.py +++ b/Cassiopee/Converter/test/copyValuePT_t1.py @@ -1,4 +1,4 @@ -# - copyValue (pyTree) - +# - copyValue (pyTree) - import Converter.PyTree as C import Converter.Internal as Internal import Generator.PyTree as G diff --git a/Cassiopee/Converter/test/correctPyTreePT_t1.py b/Cassiopee/Converter/test/correctPyTreePT_t1.py index 67f0d3ac6..074a07c25 100644 --- a/Cassiopee/Converter/test/correctPyTreePT_t1.py +++ b/Cassiopee/Converter/test/correctPyTreePT_t1.py @@ -16,12 +16,12 @@ test.testT(t, 1) # Wrong range for BCWall and wrong range for donor -a = G.cart( (0,0,0), (1,1,1), (10,10,10) ) +a = G.cart( (0,0,0), (1,1,1), (10,10,10) ) b = G.cart( (0,0,0), (1,1,1), (10,10,10) ); b[0] = 'toto' a = C.initVars(a, '{centers:Density}={centers:CoordinateX}') a = C.addBC2Zone(a, 'wall', 'BCWall', wrange=[1,1,1,11,1,10]) -a = C.addBC2Zone(a, 'match', 'BCMatch', wrange=[1,1,1,10,1,10], - zoneDonor=b, rangeDonor=[1,1,1,10,1,11], trirac=[1,2,3]) +a = C.addBC2Zone(a, 'match', 'BCMatch', wrange=[1,1,1,10,1,10], + zoneDonor=b, rangeDonor=[1,1,1,10,1,11], trirac=[1,2,3]) t = C.newPyTree(['Base', a]) t = Internal.correctPyTree(t) diff --git a/Cassiopee/Converter/test/createChildPT.py b/Cassiopee/Converter/test/createChildPT.py index 795d4d9c6..807811da7 100644 --- a/Cassiopee/Converter/test/createChildPT.py +++ b/Cassiopee/Converter/test/createChildPT.py @@ -3,5 +3,5 @@ node = Internal.createNode('myNode', 'DataArray_t', value=1., children=[]) Internal.createChild(node, 'childName', 'DataArray_t', value=2., children=[]) -print(node) +print(node) #>> ['myNode', array([ 1.]), [['childName', array([ 2.]), [], 'DataArray_t']], 'DataArray_t'] diff --git a/Cassiopee/Converter/test/createUniqueChildPT.py b/Cassiopee/Converter/test/createUniqueChildPT.py index 0cca9944a..c1d50bd7e 100644 --- a/Cassiopee/Converter/test/createUniqueChildPT.py +++ b/Cassiopee/Converter/test/createUniqueChildPT.py @@ -4,5 +4,5 @@ node = Internal.createNode('myNode', 'DataArray_t', value=1.) Internal.createUniqueChild(node, 'childName', 'DataArray_t', value=2.) # Since childName node already exists. Only the value will be set. -Internal.createUniqueChild(node, 'childName', 'DataArray_t', value=3.); print(node) +Internal.createUniqueChild(node, 'childName', 'DataArray_t', value=3.); print(node) #>> ['myNode', array([ 1.]), [['childName', array([ 3.]), [], 'DataArray_t']], 'DataArray_t'] diff --git a/Cassiopee/Converter/test/diffArrays.py b/Cassiopee/Converter/test/diffArrays.py index 26cf72990..6d2be2cde 100644 --- a/Cassiopee/Converter/test/diffArrays.py +++ b/Cassiopee/Converter/test/diffArrays.py @@ -1,5 +1,5 @@ # - diffArrays (array) - -import Converter as C +import Converter as C import Generator as G a = G.cart((0,0,0), (1,1,1), (11,11,11)) diff --git a/Cassiopee/Converter/test/diffArraysPT.py b/Cassiopee/Converter/test/diffArraysPT.py index f5cdfcf7c..b96a41c6a 100644 --- a/Cassiopee/Converter/test/diffArraysPT.py +++ b/Cassiopee/Converter/test/diffArraysPT.py @@ -1,5 +1,5 @@ # - diffArrays (pyTree) - -import Converter.PyTree as C +import Converter.PyTree as C import Generator.PyTree as G a = G.cart((0,0,0), (1,1,1), (11,11,11)) diff --git a/Cassiopee/Converter/test/diffArrays_t1.py b/Cassiopee/Converter/test/diffArrays_t1.py index 91bd1dee9..736af7619 100644 --- a/Cassiopee/Converter/test/diffArrays_t1.py +++ b/Cassiopee/Converter/test/diffArrays_t1.py @@ -1,5 +1,5 @@ # - diffArrays - -import Converter as C +import Converter as C import Generator as G import KCore.test as T diff --git a/Cassiopee/Converter/test/diffArrays_t2.py b/Cassiopee/Converter/test/diffArrays_t2.py index 1b3f981d1..f8eeb8250 100644 --- a/Cassiopee/Converter/test/diffArrays_t2.py +++ b/Cassiopee/Converter/test/diffArrays_t2.py @@ -1,5 +1,5 @@ # - diffArrays en non structure tetra - -import Converter as C +import Converter as C import Generator as G import KCore.test as T @@ -46,5 +46,3 @@ b = C.initVars(b, "F", 1.2) ret = C.diffArrays([a], [b]) T.testA(ret, 3) - - diff --git a/Cassiopee/Converter/test/ediff.py b/Cassiopee/Converter/test/ediff.py index e0bc4fee8..de88d129b 100644 --- a/Cassiopee/Converter/test/ediff.py +++ b/Cassiopee/Converter/test/ediff.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ediff file1 file2 -import Converter as C +import Converter as C def ediff__(file1, file2): a1 = C.convertFile2Arrays(file1) diff --git a/Cassiopee/Converter/test/elsAProfilePT.py b/Cassiopee/Converter/test/elsAProfilePT.py index b4fc5e27e..2e48d11d5 100644 --- a/Cassiopee/Converter/test/elsAProfilePT.py +++ b/Cassiopee/Converter/test/elsAProfilePT.py @@ -15,7 +15,7 @@ DEPTH = 0 # Grilles recouvrantes ou non ? vmin = 11 # nb de pts minimum par grille cartesienne dhov = 1.e-1 # taille de maille pres des raccords chimere grilles de corps -#----------------------------------------------------------------------------- +#----------------------------------------------------------------------------- a = G.cylinder((0,0,0),R0,R1,360,0,1,(ni,10,1)); a[0] = 'cylindre1' a = C.addBC2Zone(a, 'wall1', 'BCWall', 'jmin') a = C.addBC2Zone(a, 'ov1', 'BCOverlap', 'jmax') @@ -26,18 +26,18 @@ #--------------------------- # Octree mesh generation #--------------------------- -# frontieres exterieures des grilles de corps : surfaces de reference pour l ocrtree +# frontieres exterieures des grilles de corps : surfaces de reference pour l ocrtree extFaces = C.extractBCOfType(t,'BCOverlap') # Taille de maille de l octree pres des surfaces de reference dho = dhov*(vmin-1) snears = [dho]*len(extFaces) # generation de l octree -o = G.octree(extFaces, snears, dfar=10., balancing=1) +o = G.octree(extFaces, snears, dfar=10., balancing=1) o = G.expandLayer(o) # conversion en grilles cartesiennes patch grids if DEPTH == 0: ext = 0 else: ext = DEPTH+1 # si Chimere -res = G.octree2Struct(o, vmin=11, ext=ext, optimized=1, merged=1) +res = G.octree2Struct(o, vmin=11, ext=ext, optimized=1, merged=1) res = C.fillEmptyBCWith(res,'nref','BCFarfield',dim=2) # # Ajout de la base cartesienne @@ -52,7 +52,7 @@ # bodies description bodies = [] bases = Internal.getNodesFromType(t,'CGNSBase_t') -for b in bases: +for b in bases: walls = C.extractBCOfType(b, 'BCWall') if walls != []: bodies.append(walls) @@ -70,6 +70,6 @@ # Arbre a la Cassiopee C.convertPyTree2File(t, 'out_cassiopee.cgns') -# Arbre a la elsA +# Arbre a la elsA t = CE.convert2elsAxdt(t) C.convertPyTree2File(t, 'out_elsa.cgns') \ No newline at end of file diff --git a/Cassiopee/Converter/test/expressionTest.py b/Cassiopee/Converter/test/expressionTest.py index 0d20a70f1..b0b8b513c 100644 --- a/Cassiopee/Converter/test/expressionTest.py +++ b/Cassiopee/Converter/test/expressionTest.py @@ -53,7 +53,7 @@ def test_function(formule, func) : a = expr.ast("{norm} = {x}**2+{y}**2+{z}**2") coords = C.array("x,y,z,norm", 3, 1, 1) coords[1][:, :] = np.array([[1., 2., 3.], [2., 3., 4.], [-1., -3., -5.], - [0., 0., 0.]]) + [0., 0., 0.]]) a.run(coords) print(coords) diff --git a/Cassiopee/Converter/test/extractAllBCMatch_t1.py b/Cassiopee/Converter/test/extractAllBCMatch_t1.py index 6b337f341..2f7f58d91 100644 --- a/Cassiopee/Converter/test/extractAllBCMatch_t1.py +++ b/Cassiopee/Converter/test/extractAllBCMatch_t1.py @@ -23,4 +23,3 @@ dico = C.extractAllBCMatch(t) test.testO(dico, 2) - diff --git a/Cassiopee/Converter/test/extractAllBCMatch_t2.py b/Cassiopee/Converter/test/extractAllBCMatch_t2.py index 3c275b7b2..c7f311c29 100644 --- a/Cassiopee/Converter/test/extractAllBCMatch_t2.py +++ b/Cassiopee/Converter/test/extractAllBCMatch_t2.py @@ -4,7 +4,7 @@ import Connector.PyTree as X import KCore.test as test -# NGON +# NGON a = G.cartNGon((1,1,1), (1.,1.,1.), (4,10,3)); a[0]='cart1' b = G.cartNGon((4,2,0), (1.,1.,1.), (5, 8,5)); b[0]='cart2' @@ -17,9 +17,8 @@ t = X.connectMatch(t,dim=3) t = C.fillEmptyBCWith(t, 'wall', 'BCWall') -dico = C.extractAllBCMatch(t,['centers:H','centers:M']) +dico = C.extractAllBCMatch(t,['centers:H','centers:M']) test.testO(dico, 1) -dico = C.extractAllBCMatch(t) +dico = C.extractAllBCMatch(t) test.testO(dico, 2) - diff --git a/Cassiopee/Converter/test/extractBCFieldsPT.py b/Cassiopee/Converter/test/extractBCFieldsPT.py index 9056521a9..2f3dc4cc5 100644 --- a/Cassiopee/Converter/test/extractBCFieldsPT.py +++ b/Cassiopee/Converter/test/extractBCFieldsPT.py @@ -25,4 +25,3 @@ print('variables = ', res[0]) print('fields = ', res[1]) print('indices = ', res[2]) - diff --git a/Cassiopee/Converter/test/extractBCMatch_t1.py b/Cassiopee/Converter/test/extractBCMatch_t1.py index 2d30bb2cd..e6b366356 100644 --- a/Cassiopee/Converter/test/extractBCMatch_t1.py +++ b/Cassiopee/Converter/test/extractBCMatch_t1.py @@ -6,7 +6,7 @@ import Connector.PyTree as X import KCore.test as test -# Cas 2D +# Cas 2D # ====== a = G.cart((1,1,1), (1.,1.,1.), (4,10,1)); a[0]='cart1' b = G.cart((4,2,1), (1.,1.,1.), (5, 8,1)); b[0]='cart2' @@ -32,10 +32,10 @@ zname = Internal.getValue(gc) zdonor = Internal.getNodeFromName(t,zname) - [indFaceR,fldFace] = CP.extractBCMatch(zdonor,gc,dim,['centers:G','centers:H','centers:M']) + [indFaceR,fldFace] = CP.extractBCMatch(zdonor,gc,dim,['centers:G','centers:H','centers:M']) test.testO([indFaceR,fldFace], it) - [indFaceR,fldFace] = CP.extractBCMatch(zdonor,gc,dim) + [indFaceR,fldFace] = CP.extractBCMatch(zdonor,gc,dim) test.testO([indFaceR,fldFace], it+2) diff --git a/Cassiopee/Converter/test/extractBCMatch_t2.py b/Cassiopee/Converter/test/extractBCMatch_t2.py index 0f4674f8d..1837e3fc1 100644 --- a/Cassiopee/Converter/test/extractBCMatch_t2.py +++ b/Cassiopee/Converter/test/extractBCMatch_t2.py @@ -34,13 +34,12 @@ zname = Internal.getValue(gc) zdonor = Internal.getNodeFromName(t,zname) - [indFaceR,fldFace] = CP.extractBCMatch(zdonor,gc,dim,['centers:G','centers:H','centers:M']) + [indFaceR,fldFace] = CP.extractBCMatch(zdonor,gc,dim,['centers:G','centers:H','centers:M']) test.testO([indFaceR,fldFace], it) it = it + 1 - [indFaceR,fldFace] = CP.extractBCMatch(zdonor,gc,dim) + [indFaceR,fldFace] = CP.extractBCMatch(zdonor,gc,dim) test.testO([indFaceR,fldFace], it) it = it + 1 - diff --git a/Cassiopee/Converter/test/extractBCMatch_t3.py b/Cassiopee/Converter/test/extractBCMatch_t3.py index abc64b1f0..713cdf9de 100644 --- a/Cassiopee/Converter/test/extractBCMatch_t3.py +++ b/Cassiopee/Converter/test/extractBCMatch_t3.py @@ -32,11 +32,9 @@ zname = Internal.getValue(gc) zdonor = Internal.getNodeFromName(t,zname) - [indFaceR,fldFace] = C.extractBCMatch(zdonor,gc,dim,varL) + [indFaceR,fldFace] = C.extractBCMatch(zdonor,gc,dim,varL) test.testO([indFaceR,fldFace], it) - [indFaceR,fldFace] = C.extractBCMatch(zdonor,gc,dim) + [indFaceR,fldFace] = C.extractBCMatch(zdonor,gc,dim) test.testO([indFaceR,fldFace], it+6) - - diff --git a/Cassiopee/Converter/test/extractBCMatch_t4.py b/Cassiopee/Converter/test/extractBCMatch_t4.py index 858f9415a..3f9578adb 100644 --- a/Cassiopee/Converter/test/extractBCMatch_t4.py +++ b/Cassiopee/Converter/test/extractBCMatch_t4.py @@ -32,6 +32,5 @@ zname = Internal.getValue(gc) zdonor = Internal.getNodeFromName(t,zname) - [indFaceR,fldFace] = CP.extractBCMatch(zdonor,gc,dim,varL) + [indFaceR,fldFace] = CP.extractBCMatch(zdonor,gc,dim,varL) test.testO([indFaceR,fldFace], it) - diff --git a/Cassiopee/Converter/test/extractBCOfTypePT_t1.py b/Cassiopee/Converter/test/extractBCOfTypePT_t1.py index 1556d0566..f738eea3d 100644 --- a/Cassiopee/Converter/test/extractBCOfTypePT_t1.py +++ b/Cassiopee/Converter/test/extractBCOfTypePT_t1.py @@ -65,7 +65,7 @@ test.testT(ext, 6) # BC sur un BE + connectivite QUAD de boundary -a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) +a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) b = G.cartHexa((0,0,0), (1,1,1), (10,10,1)) C._addBC2Zone(a, 'wall', 'BCWall', subzone=b) bc = Internal.getNodeFromType(a,'BC_t') diff --git a/Cassiopee/Converter/test/extractVars.py b/Cassiopee/Converter/test/extractVars.py index 7b577b400..762980d5d 100644 --- a/Cassiopee/Converter/test/extractVars.py +++ b/Cassiopee/Converter/test/extractVars.py @@ -7,5 +7,5 @@ # Var defined by a string r = C.extractVars(a, 'F') # Vars defined by a list -r = C.extractVars(a, ['x','y']) +r = C.extractVars(a, ['x','y']) C.convertArrays2File(r, 'out.plt') diff --git a/Cassiopee/Converter/test/fillEmptyBCWith_t2.py b/Cassiopee/Converter/test/fillEmptyBCWith_t2.py index 2ecb05ed0..84f96d3ce 100644 --- a/Cassiopee/Converter/test/fillEmptyBCWith_t2.py +++ b/Cassiopee/Converter/test/fillEmptyBCWith_t2.py @@ -1,4 +1,4 @@ -# - fillEmptyBC (pyTree) - +# - fillEmptyBC (pyTree) - # avec des raccords partiels import Converter.PyTree as C import Generator.PyTree as G diff --git a/Cassiopee/Converter/test/fillEmptyBCWith_t3.py b/Cassiopee/Converter/test/fillEmptyBCWith_t3.py index c3366d8bb..ae60bd19e 100644 --- a/Cassiopee/Converter/test/fillEmptyBCWith_t3.py +++ b/Cassiopee/Converter/test/fillEmptyBCWith_t3.py @@ -1,4 +1,4 @@ -# - fillEmptyBC (pyTree) - +# - fillEmptyBC (pyTree) - # Non structure Element import Converter.PyTree as C import Generator.PyTree as G diff --git a/Cassiopee/Converter/test/fillEmptyBCWith_t4.py b/Cassiopee/Converter/test/fillEmptyBCWith_t4.py index 26093bd9a..633cb58c2 100644 --- a/Cassiopee/Converter/test/fillEmptyBCWith_t4.py +++ b/Cassiopee/Converter/test/fillEmptyBCWith_t4.py @@ -1,4 +1,4 @@ -# - fillEmptyBC (pyTree) - +# - fillEmptyBC (pyTree) - # Non structure NGON import Converter.PyTree as C import Generator.PyTree as G diff --git a/Cassiopee/Converter/test/fillMissingVariablesPT_t1.py b/Cassiopee/Converter/test/fillMissingVariablesPT_t1.py index 25bee2980..40fc39bff 100644 --- a/Cassiopee/Converter/test/fillMissingVariablesPT_t1.py +++ b/Cassiopee/Converter/test/fillMissingVariablesPT_t1.py @@ -11,4 +11,3 @@ t[2][1] = C.addState(t[2][1], 'Mach', 0.6) t = C.fillMissingVariables(t) test.testT(t,1) - diff --git a/Cassiopee/Converter/test/getArgMaxPT_t1.py b/Cassiopee/Converter/test/getArgMaxPT_t1.py index fb56072a9..c6c147f7b 100644 --- a/Cassiopee/Converter/test/getArgMaxPT_t1.py +++ b/Cassiopee/Converter/test/getArgMaxPT_t1.py @@ -4,7 +4,7 @@ import Transform.PyTree as T import KCore.test as test -# test sur une zone +# test sur une zone a = G.cart( (0,0,0), (1.,1.,1.), (10,10,10) ) a = C.initVars(a,'F',1.); a = C.initVars(a,'centers:G', 2.) a = C.addBC2Zone(a, 'wall1', 'BCWall', 'imin') diff --git a/Cassiopee/Converter/test/getArgMinPT_t1.py b/Cassiopee/Converter/test/getArgMinPT_t1.py index a38be865d..f55945127 100644 --- a/Cassiopee/Converter/test/getArgMinPT_t1.py +++ b/Cassiopee/Converter/test/getArgMinPT_t1.py @@ -4,7 +4,7 @@ import Transform.PyTree as T import KCore.test as test -# test sur une zone +# test sur une zone a = G.cart( (0,0,0), (1.,1.,1.), (10,10,10) ) a = C.initVars(a,'F',1.); a = C.initVars(a,'centers:G',2.) a = C.addBC2Zone(a, 'wall1', 'BCWall', 'imin') diff --git a/Cassiopee/Converter/test/getBCDataSetPT.py b/Cassiopee/Converter/test/getBCDataSetPT.py index 9e3f337f1..08daf2774 100644 --- a/Cassiopee/Converter/test/getBCDataSetPT.py +++ b/Cassiopee/Converter/test/getBCDataSetPT.py @@ -7,7 +7,7 @@ a = C.addBC2Zone(a, 'wall', 'BCWall', 'imin') b = Internal.getNodeFromName2(a, 'wall') d = Internal.newBCDataSet(name='BCDataSet', value='UserDefined', - gridLocation='FaceCenter', parent=b) + gridLocation='FaceCenter', parent=b) d = Internal.newBCData('BCNeumann', parent=d) d = Internal.newDataArray('Density', value=10*[1.], parent=d) diff --git a/Cassiopee/Converter/test/getBCDataSetPT_t1.py b/Cassiopee/Converter/test/getBCDataSetPT_t1.py index 108afe7c0..426080d62 100644 --- a/Cassiopee/Converter/test/getBCDataSetPT_t1.py +++ b/Cassiopee/Converter/test/getBCDataSetPT_t1.py @@ -9,10 +9,9 @@ a = C.addBC2Zone(a, 'wall', 'BCWall', 'imin') b = Internal.getNodeFromName2(a, 'wall') d = Internal.newBCDataSet(name='BCDataSet', value='UserDefined', - gridLocation='FaceCenter', parent=b) + gridLocation='FaceCenter', parent=b) d = Internal.newBCData('BCNeumann', parent=d) d = Internal.newDataArray('Density', value=10*[1.], parent=d) datas = Internal.getBCDataSet(a, b) test.testO(datas, 1) - diff --git a/Cassiopee/Converter/test/getBCFaceNodePT_t1.py b/Cassiopee/Converter/test/getBCFaceNodePT_t1.py index 0affe3fb9..af6db0dc4 100644 --- a/Cassiopee/Converter/test/getBCFaceNodePT_t1.py +++ b/Cassiopee/Converter/test/getBCFaceNodePT_t1.py @@ -10,4 +10,3 @@ b = Internal.getNodeFromName(a, 'wall') ind = Internal.getBCFaceNode(a, b) test.testO(ind, 1) - diff --git a/Cassiopee/Converter/test/getBCsPT_t1.py b/Cassiopee/Converter/test/getBCsPT_t1.py index 129cb49ba..20f456eb5 100644 --- a/Cassiopee/Converter/test/getBCsPT_t1.py +++ b/Cassiopee/Converter/test/getBCsPT_t1.py @@ -19,6 +19,3 @@ a = C.addBC2Zone(a, 'wall', 'BCWall', faceList=[1,2]) (BCs,BCNames,BCTypes) = C.getBCs(a) test.testO(BCNames, 3) - - - diff --git a/Cassiopee/Converter/test/getFamilyZoneNamesPT.py b/Cassiopee/Converter/test/getFamilyZoneNamesPT.py index 72c25aae6..e79a4f844 100644 --- a/Cassiopee/Converter/test/getFamilyZoneNamesPT.py +++ b/Cassiopee/Converter/test/getFamilyZoneNamesPT.py @@ -4,7 +4,7 @@ a = G.cart((0.,0.,0), (0.01,0.01,1.), (20,20,2)) b = G.cart((1.,0.,0), (0.01,0.01,1.), (20,20,2)) -C._tagWithFamily(a, 'CARTER') +C._tagWithFamily(a, 'CARTER') C._tagWithFamily(b, 'CARTER') t = C.newPyTree(['Base',a,b]) diff --git a/Cassiopee/Converter/test/getFamilyZoneNamesPT_t1.py b/Cassiopee/Converter/test/getFamilyZoneNamesPT_t1.py index 7fe9a17f9..e25991bdf 100644 --- a/Cassiopee/Converter/test/getFamilyZoneNamesPT_t1.py +++ b/Cassiopee/Converter/test/getFamilyZoneNamesPT_t1.py @@ -5,7 +5,7 @@ a = G.cart((0.,0.,0), (0.01,0.01,1.), (20,20,2)) b = G.cart((1.,0.,0), (0.01,0.01,1.), (20,20,2)) -C._tagWithFamily(a, 'CARTER') +C._tagWithFamily(a, 'CARTER') C._tagWithFamily(b, 'CARTER') t = C.newPyTree(['Base',a,b]) diff --git a/Cassiopee/Converter/test/getIndexField.py b/Cassiopee/Converter/test/getIndexField.py index af858d152..f023d5e0e 100644 --- a/Cassiopee/Converter/test/getIndexField.py +++ b/Cassiopee/Converter/test/getIndexField.py @@ -6,4 +6,3 @@ n = C.getIndexField(a) a = C.addVars([a, n]) C.convertArrays2File(a, 'out.plt') - diff --git a/Cassiopee/Converter/test/getParentFromTypePT_t1.py b/Cassiopee/Converter/test/getParentFromTypePT_t1.py index a8600b6d8..ec49bb46e 100644 --- a/Cassiopee/Converter/test/getParentFromTypePT_t1.py +++ b/Cassiopee/Converter/test/getParentFromTypePT_t1.py @@ -8,4 +8,3 @@ p = Internal.getParentFromType(a, c, 'DataArray_t') test.testO(p[0],1) - diff --git a/Cassiopee/Converter/test/getParentsFromTypePT_t1.py b/Cassiopee/Converter/test/getParentsFromTypePT_t1.py index 8ae6ec95b..367e5e6f3 100644 --- a/Cassiopee/Converter/test/getParentsFromTypePT_t1.py +++ b/Cassiopee/Converter/test/getParentsFromTypePT_t1.py @@ -9,5 +9,3 @@ p = Internal.getParentsFromType(a, c, 'DataArray_t') res = [i[0] for i in p] test.testO(res, 1) - - diff --git a/Cassiopee/Converter/test/getSizeOfPT_t1.py b/Cassiopee/Converter/test/getSizeOfPT_t1.py index e606f9641..d107027e8 100644 --- a/Cassiopee/Converter/test/getSizeOfPT_t1.py +++ b/Cassiopee/Converter/test/getSizeOfPT_t1.py @@ -6,4 +6,3 @@ a = G.cart((0,0,0), (1,1,1), (10,10,10)) mem = Internal.getSizeOf(a) test.testO(mem) - diff --git a/Cassiopee/Converter/test/getStatePT.py b/Cassiopee/Converter/test/getStatePT.py index 1419dab3d..f4fc602ea 100644 --- a/Cassiopee/Converter/test/getStatePT.py +++ b/Cassiopee/Converter/test/getStatePT.py @@ -7,8 +7,8 @@ # Specifie un etat de reference adimensionne par: # Mach, alpha, Re, MutSMu, TurbLevel (adim1) -C._addState(t, adim='adim1', MInf=0.5, alphaZ=0., alphaY=0., - ReInf=1.e8, MutSMuInf=0.2, TurbLevelInf=1.e-4) +C._addState(t, adim='adim1', MInf=0.5, alphaZ=0., alphaY=0., + ReInf=1.e8, MutSMuInf=0.2, TurbLevelInf=1.e-4) # Get the ref state state = C.getState(t); print(state) diff --git a/Cassiopee/Converter/test/getStatePT_t1.py b/Cassiopee/Converter/test/getStatePT_t1.py index e2a4c4023..4bba9683c 100644 --- a/Cassiopee/Converter/test/getStatePT_t1.py +++ b/Cassiopee/Converter/test/getStatePT_t1.py @@ -8,8 +8,8 @@ # Specifie un etat de reference adimensionne par: # Mach, alpha, Re, MutSMu, TurbRate (adim1) -C._addState(t, adim='adim1', MInf=0.5, alphaZ=0., alphaY=0., - ReInf=1.e8, MutSMuInf=0.2, TurbLevelInf=1.e-4) +C._addState(t, adim='adim1', MInf=0.5, alphaZ=0., alphaY=0., + ReInf=1.e8, MutSMuInf=0.2, TurbLevelInf=1.e-4) # Get the ref state state = C.getState(t) diff --git a/Cassiopee/Converter/test/getStdNodesFromName.py b/Cassiopee/Converter/test/getStdNodesFromName.py index 2de48acb1..ac2125b64 100644 --- a/Cassiopee/Converter/test/getStdNodesFromName.py +++ b/Cassiopee/Converter/test/getStdNodesFromName.py @@ -1,4 +1,4 @@ -# - getStandardNodeFromName (pyTree) - +# - getStandardNodeFromName (pyTree) - import Converter.PyTree as C import Generator.PyTree as G diff --git a/Cassiopee/Converter/test/getStdNodesFromName_t1.py b/Cassiopee/Converter/test/getStdNodesFromName_t1.py index aeb9423b2..1933fffbe 100644 --- a/Cassiopee/Converter/test/getStdNodesFromName_t1.py +++ b/Cassiopee/Converter/test/getStdNodesFromName_t1.py @@ -1,4 +1,4 @@ -# - getStandardNodeFromName (pyTree) - +# - getStandardNodeFromName (pyTree) - import Converter.PyTree as C import Generator.PyTree as G import KCore.test as test diff --git a/Cassiopee/Converter/test/getValPT.py b/Cassiopee/Converter/test/getValPT.py index 190faca47..200b24cbf 100644 --- a/Cassiopee/Converter/test/getValPT.py +++ b/Cassiopee/Converter/test/getValPT.py @@ -1,7 +1,7 @@ # - getVal (pyTree) - import Converter.Internal as Internal -# getVal returns always numpys +# getVal returns always numpys z = Internal.newZone('Zone', zsize=[[10, 2, 0]], ztype='Structured') print(Internal.getVal(z)) # >> [[10 2 0]] diff --git a/Cassiopee/Converter/test/getValue.py b/Cassiopee/Converter/test/getValue.py index e01354e7a..476a48f2a 100644 --- a/Cassiopee/Converter/test/getValue.py +++ b/Cassiopee/Converter/test/getValue.py @@ -2,7 +2,7 @@ import Converter as C import Generator as G -# Structured array +# Structured array Ni = 40; Nj = 50; Nk = 20 a = G.cart((0,0,0), (1./(Ni-1), 0.5/(Nj-1),1./(Nk-1)), (Ni,Nj,Nk)) # Get variable values contained in a (x,y,z) in point (10,1,1) diff --git a/Cassiopee/Converter/test/getValue_t1.py b/Cassiopee/Converter/test/getValue_t1.py index 04dfac5bb..c713ecd46 100644 --- a/Cassiopee/Converter/test/getValue_t1.py +++ b/Cassiopee/Converter/test/getValue_t1.py @@ -3,6 +3,3 @@ import KCore.test as test test.stdTestA(C.getValue, 8) - - - diff --git a/Cassiopee/Converter/test/identifyElements_t2.py b/Cassiopee/Converter/test/identifyElements_t2.py index 58a15fc9b..93e3cd096 100644 --- a/Cassiopee/Converter/test/identifyElements_t2.py +++ b/Cassiopee/Converter/test/identifyElements_t2.py @@ -17,7 +17,7 @@ a = G.cart((100000,0,0), (1,1.e-8,1), (N,N,N)) b = T.subzone(a, (1,1,1), (N,N//2,1)) hook = C.createHook(a, function='faceCenters') -faces = C.identifyElements(hook,b,tol=eps) +faces = C.identifyElements(hook,b,tol=eps) ret = faces[faces<0.].shape[0] #if ret != 0.: print 'identifyElements/faces (structured) FAILED: FPU is not correct [STRUCT/FACES]. Check compilation options.' diff --git a/Cassiopee/Converter/test/identifySolutionsPT_t1.py b/Cassiopee/Converter/test/identifySolutionsPT_t1.py index 8e7415edd..dc2087d59 100644 --- a/Cassiopee/Converter/test/identifySolutionsPT_t1.py +++ b/Cassiopee/Converter/test/identifySolutionsPT_t1.py @@ -11,7 +11,7 @@ # Create receptor mesh a = D.sphere((0,0,0),0.1) -# Structure +# Structure hookN = C.createGlobalHook([m],'nodes') hookC = None a2 = C.identifySolutions(a,m,hookN,hookC,tol=1000.) diff --git a/Cassiopee/Converter/test/identifySolutionsPT_t2.py b/Cassiopee/Converter/test/identifySolutionsPT_t2.py index 2625735b4..b60a09cd0 100644 --- a/Cassiopee/Converter/test/identifySolutionsPT_t2.py +++ b/Cassiopee/Converter/test/identifySolutionsPT_t2.py @@ -11,7 +11,7 @@ # Create receptor mesh a = D.sphere((0,0,0),0.1) -# Structure +# Structure mc = C.node2Center(m) hookC = C.createGlobalHook([mc], 'nodes') hookN = None diff --git a/Cassiopee/Converter/test/identifySolutionsPT_t3.py b/Cassiopee/Converter/test/identifySolutionsPT_t3.py index 33b948af8..62e65f15c 100644 --- a/Cassiopee/Converter/test/identifySolutionsPT_t3.py +++ b/Cassiopee/Converter/test/identifySolutionsPT_t3.py @@ -11,7 +11,7 @@ # Create receptor mesh a = D.sphere((0,0,0),0.1) -# Structure +# Structure mc = C.node2Center(m) hookC = C.createGlobalHook([mc], 'nodes') hookN = C.createGlobalHook([m], 'nodes') diff --git a/Cassiopee/Converter/test/identifySolutions_t1.py b/Cassiopee/Converter/test/identifySolutions_t1.py index 576370dea..98b5dc530 100644 --- a/Cassiopee/Converter/test/identifySolutions_t1.py +++ b/Cassiopee/Converter/test/identifySolutions_t1.py @@ -5,7 +5,7 @@ import Transform as T import KCore.test as test -# Donor mesh structure +# Donor mesh structure ni = 21; nj = 21; nk = 21 m = G.cart((0,0,0), (1./(ni-1),1./(nj-1),1./(nk-1)), (ni,nj,nk)) hook = C.createGlobalHook([m],function='nodes') @@ -39,7 +39,7 @@ sol = C.initVars(m, '{ro}={x}') sol = C.extractVars(sol,['ro']) a = D.sphere((0,0,0),0.1) -# RCV Structure +# RCV Structure a2 = C.identifySolutions(a,sol,hook,tol=1000.) test.testA([a2],4) # RCV TRI diff --git a/Cassiopee/Converter/test/identifySolutions_t2.py b/Cassiopee/Converter/test/identifySolutions_t2.py index 9bd9010f0..abc42cbb8 100644 --- a/Cassiopee/Converter/test/identifySolutions_t2.py +++ b/Cassiopee/Converter/test/identifySolutions_t2.py @@ -5,7 +5,7 @@ import KCore.test as test # test: several variables -# Donor mesh structure +# Donor mesh structure ni = 21; nj = 21; nk = 21 m = G.cart((0,0,0), (1./(ni-1),1./(nj-1),1./(nk-1)), (ni,nj,nk)) hook = C.createGlobalHook([m],function='nodes') diff --git a/Cassiopee/Converter/test/initBCDataSetPT.py b/Cassiopee/Converter/test/initBCDataSetPT.py index 1fa992557..11620fc34 100644 --- a/Cassiopee/Converter/test/initBCDataSetPT.py +++ b/Cassiopee/Converter/test/initBCDataSetPT.py @@ -7,7 +7,7 @@ a = C.addBC2Zone(a, 'wall', 'BCWall', 'imin') b = Internal.getNodeFromName2(a, 'wall') d = Internal.newBCDataSet(name='BCDataSet', value='UserDefined', - gridLocation='FaceCenter', parent=b) + gridLocation='FaceCenter', parent=b) d = Internal.newBCData('BCNeumann', parent=d) d = Internal.newDataArray('Density', value=NFACES*[1.], parent=d) diff --git a/Cassiopee/Converter/test/initBCDataSetPT_t1.py b/Cassiopee/Converter/test/initBCDataSetPT_t1.py index 93ce4db12..468a9884f 100644 --- a/Cassiopee/Converter/test/initBCDataSetPT_t1.py +++ b/Cassiopee/Converter/test/initBCDataSetPT_t1.py @@ -8,7 +8,7 @@ a = C.addBC2Zone(a, 'wall', 'BCWall', 'imin') b = Internal.getNodeFromName2(a, 'wall') d = Internal.newBCDataSet(name='BCDataSet', value='UserDefined', - gridLocation='FaceCenter', parent=b) + gridLocation='FaceCenter', parent=b) d = Internal.newBCData('BCNeumann', parent=d) d = Internal.newDataArray('Density', value=NFACES*[1.], parent=d) diff --git a/Cassiopee/Converter/test/loadAndDistributePT_m1.py b/Cassiopee/Converter/test/loadAndDistributePT_m1.py index aa0b5d9f0..763723fc7 100644 --- a/Cassiopee/Converter/test/loadAndDistributePT_m1.py +++ b/Cassiopee/Converter/test/loadAndDistributePT_m1.py @@ -18,4 +18,3 @@ h = Filter.Handle(LOCAL+'/case1.cgns') a = h.loadAndDistribute() if Cmpi.rank == 0: test.testT(a, 1) - diff --git a/Cassiopee/Converter/test/makeParentElementsPT.py b/Cassiopee/Converter/test/makeParentElementsPT.py index fd10de527..4fe0218d1 100644 --- a/Cassiopee/Converter/test/makeParentElementsPT.py +++ b/Cassiopee/Converter/test/makeParentElementsPT.py @@ -1,4 +1,4 @@ -# - signNGonFaces (pyTree) - +# - signNGonFaces (pyTree) - import Converter.PyTree as C import Generator.PyTree as G diff --git a/Cassiopee/Converter/test/mergeBCDataSetPT.py b/Cassiopee/Converter/test/mergeBCDataSetPT.py index 0f995a920..bd11fa6e3 100644 --- a/Cassiopee/Converter/test/mergeBCDataSetPT.py +++ b/Cassiopee/Converter/test/mergeBCDataSetPT.py @@ -8,7 +8,7 @@ a = C.addBC2Zone(a, 'wall', 'BCWall', 'imin') b = Internal.getNodeFromName2(a, 'wall') d = Internal.newBCDataSet(name='BCDataSet', value='UserDefined', - gridLocation='FaceCenter', parent=b) + gridLocation='FaceCenter', parent=b) d = Internal.newBCData('BCNeumann', parent=d) d = Internal.newDataArray('Density', value=NFACES*[1.], parent=d) d2 = Internal.newBCDataSet(name='BCDataSet2', value='UserDefined', diff --git a/Cassiopee/Converter/test/mergeBCDataSetPT_t1.py b/Cassiopee/Converter/test/mergeBCDataSetPT_t1.py index 5cb41c067..c865ea6f1 100644 --- a/Cassiopee/Converter/test/mergeBCDataSetPT_t1.py +++ b/Cassiopee/Converter/test/mergeBCDataSetPT_t1.py @@ -8,7 +8,7 @@ a = C.addBC2Zone(a, 'wall', 'BCWall', 'imin') b = Internal.getNodeFromName2(a, 'wall') d = Internal.newBCDataSet(name='BCDataSet', value='UserDefined', - gridLocation='FaceCenter', parent=b) + gridLocation='FaceCenter', parent=b) d = Internal.newBCData('BCNeumann', parent=d) d = Internal.newDataArray('Density', value=NFACES*[1.], parent=d) d2 = Internal.newBCDataSet(name='BCDataSet2', value='UserDefined', diff --git a/Cassiopee/Converter/test/mergeConnectivityPT.py b/Cassiopee/Converter/test/mergeConnectivityPT.py index cd5cb9c53..6d7047f50 100644 --- a/Cassiopee/Converter/test/mergeConnectivityPT.py +++ b/Cassiopee/Converter/test/mergeConnectivityPT.py @@ -2,16 +2,16 @@ import Converter.PyTree as C import Generator.PyTree as G -a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) +a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) b = G.cartHexa((0,0,0), (1,1,1), (10,10,1)) c = C.mergeConnectivity(a, b, boundary=1) # c contains now a volume HEXA connectivity and a QUAD boundary connectivity. C.convertPyTree2File(c, 'out0.cgns') -a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) +a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) b = G.cartTetra((0,0,0), (1,1,1), (10,10,10)) c = C.mergeConnectivity(a, b, boundary=0) -# c is now a multiple-element zone containing a volume HEXA connectivity and +# c is now a multiple-element zone containing a volume HEXA connectivity and # a volume TETRA connectivity. C.convertPyTree2File(c, 'out.cgns') diff --git a/Cassiopee/Converter/test/mergeConnectivityPT_t1.py b/Cassiopee/Converter/test/mergeConnectivityPT_t1.py index 50b8d4ed8..cfbe963ea 100644 --- a/Cassiopee/Converter/test/mergeConnectivityPT_t1.py +++ b/Cassiopee/Converter/test/mergeConnectivityPT_t1.py @@ -3,7 +3,7 @@ import Generator.PyTree as G import KCore.test as test -a = G.cartHexa( (0,0,0), (1,1,1), (10,10,10) ) +a = G.cartHexa( (0,0,0), (1,1,1), (10,10,10) ) b = G.cartHexa( (0,0,0), (1,1,1), (10,10,1) ) # merge boundary connectivity diff --git a/Cassiopee/Converter/test/mergeTrees_t1.py b/Cassiopee/Converter/test/mergeTrees_t1.py index f06870337..e7317f1e5 100644 --- a/Cassiopee/Converter/test/mergeTrees_t1.py +++ b/Cassiopee/Converter/test/mergeTrees_t1.py @@ -6,12 +6,12 @@ a1 = G.cart((0.,0.,0.),(0.1,0.1,0.1),(11,11,11)) a1 = C.addBC2Zone(a1,'wall','BCWall','imin') a1 = C.addBC2Zone(a1,'overlap','BCOverlap','imax') -a1 = C.initVars(a1,'F',1.); a1 = C.initVars(a1,'centers:G',2.) +a1 = C.initVars(a1,'F',1.); a1 = C.initVars(a1,'centers:G',2.) a2 = G.cart((0.,0.,0.),(0.1,0.1,1.),(11,11,1)); a2[0] = 'cart2' a2 = C.addBC2Zone(a2,'wall','BCWall','imin') a2 = C.addBC2Zone(a2,'overlap','BCOverlap','imax') -a2 = C.initVars(a2,'F',1.); a2 = C.initVars(a2,'centers:G',2.) +a2 = C.initVars(a2,'F',1.); a2 = C.initVars(a2,'centers:G',2.) t1 = C.newPyTree(['Base1', 2, 'Base2', 3]) t1[2][1][2].append(a2); t1[2][2][2].append(a1) diff --git a/Cassiopee/Converter/test/nearestNodes_t2.py b/Cassiopee/Converter/test/nearestNodes_t2.py index ae66f1dd5..6336697d2 100755 --- a/Cassiopee/Converter/test/nearestNodes_t2.py +++ b/Cassiopee/Converter/test/nearestNodes_t2.py @@ -1,4 +1,4 @@ -# - nearestNodes (array) - +# - nearestNodes (array) - # Permet de tester que Converter a ete bien installe import Converter as C import Generator as G diff --git a/Cassiopee/Converter/test/newBCPT_t1.py b/Cassiopee/Converter/test/newBCPT_t1.py index 36774dc0a..b6bdfaf59 100644 --- a/Cassiopee/Converter/test/newBCPT_t1.py +++ b/Cassiopee/Converter/test/newBCPT_t1.py @@ -8,5 +8,5 @@ # Attach it to a parent node d = Internal.newZoneBC() -Internal.newBC('BC', [1,45,1,21,1,1], 'BCWall', parent=d) +Internal.newBC('BC', [1,45,1,21,1,1], 'BCWall', parent=d) test.testT(d, 2) diff --git a/Cassiopee/Converter/test/newDataConversionPT.py b/Cassiopee/Converter/test/newDataConversionPT.py index 590f098e7..059733647 100644 --- a/Cassiopee/Converter/test/newDataConversionPT.py +++ b/Cassiopee/Converter/test/newDataConversionPT.py @@ -10,4 +10,4 @@ # Attach it to a parent node d = Internal.newDiscreteData('DiscreteData') Internal.newDataClass('NondimensionalParameter', parent=d) -Internal.newDataConversion(conversionScale=1., conversionOffset=0., parent=d) +Internal.newDataConversion(conversionScale=1., conversionOffset=0., parent=d) diff --git a/Cassiopee/Converter/test/newDimensionalExponentsPT.py b/Cassiopee/Converter/test/newDimensionalExponentsPT.py index cd7a043fc..8290b5192 100644 --- a/Cassiopee/Converter/test/newDimensionalExponentsPT.py +++ b/Cassiopee/Converter/test/newDimensionalExponentsPT.py @@ -9,4 +9,4 @@ # Attach it to a parent node d = Internal.newGridCoordinates() Internal.newDataClass('Dimensional', parent=d) -Internal.newDimensionalExponents(massExponent=0., lengthExponent=1., timeExponent=0., temperatureExponent=0., angleExponent=0., parent=d) +Internal.newDimensionalExponents(massExponent=0., lengthExponent=1., timeExponent=0., temperatureExponent=0., angleExponent=0., parent=d) diff --git a/Cassiopee/Converter/test/newFlowSolutionPT.py b/Cassiopee/Converter/test/newFlowSolutionPT.py index 730212a51..566606b10 100644 --- a/Cassiopee/Converter/test/newFlowSolutionPT.py +++ b/Cassiopee/Converter/test/newFlowSolutionPT.py @@ -8,4 +8,4 @@ # Attach it to a parent node z = Internal.newZone('Zone', zsize=[[10],[2],[0]], ztype='Structured') -Internal.newFlowSolution(name='FlowSolution', gridLocation='Vertex', parent=z) +Internal.newFlowSolution(name='FlowSolution', gridLocation='Vertex', parent=z) diff --git a/Cassiopee/Converter/test/newGridConnectivity1to1PT.py b/Cassiopee/Converter/test/newGridConnectivity1to1PT.py index dae4e0d01..d523ec516 100644 --- a/Cassiopee/Converter/test/newGridConnectivity1to1PT.py +++ b/Cassiopee/Converter/test/newGridConnectivity1to1PT.py @@ -10,4 +10,4 @@ # Attach it to a parent node d = Internal.newZoneGridConnectivity(name='ZoneGridConnectivity') -Internal.newGridConnectivity1to1(name='Match', donorName='blk1', pointRange=[1,1,1,33,1,69], pointRangeDonor=[51,51,1,33,1,69], transform=None, parent=d) +Internal.newGridConnectivity1to1(name='Match', donorName='blk1', pointRange=[1,1,1,33,1,69], pointRangeDonor=[51,51,1,33,1,69], transform=None, parent=d) diff --git a/Cassiopee/Converter/test/newGridConnectivityPT.py b/Cassiopee/Converter/test/newGridConnectivityPT.py index 68b04c29e..40197019b 100644 --- a/Cassiopee/Converter/test/newGridConnectivityPT.py +++ b/Cassiopee/Converter/test/newGridConnectivityPT.py @@ -8,4 +8,4 @@ # Attach it to a parent node d = Internal.newZoneGridConnectivity(name='ZoneGridConnectivity') -Internal.newGridConnectivity(name='Match', donorName='blk1', ctype='Abutting1to1', parent=d) +Internal.newGridConnectivity(name='Match', donorName='blk1', ctype='Abutting1to1', parent=d) diff --git a/Cassiopee/Converter/test/newGridConnectivityTypePT.py b/Cassiopee/Converter/test/newGridConnectivityTypePT.py index 4f30c2b75..8baf6efd8 100644 --- a/Cassiopee/Converter/test/newGridConnectivityTypePT.py +++ b/Cassiopee/Converter/test/newGridConnectivityTypePT.py @@ -7,4 +7,4 @@ # Attach it to a parent node d = Internal.newGridConnectivity(name='Match', donorName='blk1', ctype=None) -Internal.newGridConnectivityType(ctype='Abutting1to1', parent=d) +Internal.newGridConnectivityType(ctype='Abutting1to1', parent=d) diff --git a/Cassiopee/Converter/test/newGridLocationPT.py b/Cassiopee/Converter/test/newGridLocationPT.py index d8befbb4f..38687d367 100644 --- a/Cassiopee/Converter/test/newGridLocationPT.py +++ b/Cassiopee/Converter/test/newGridLocationPT.py @@ -6,5 +6,5 @@ #>> ['GridLocation',array('CellCenter',dtype='|S1'),[0 son],'GridLocation_t'] # Attach it to a parent node -d = Internal.newBC('wall', [1,80,30,30,1,2], 'BCWall') -Internal.newGridLocation('Vertex', parent=d) +d = Internal.newBC('wall', [1,80,30,30,1,2], 'BCWall') +Internal.newGridLocation('Vertex', parent=d) diff --git a/Cassiopee/Converter/test/newOversetHolesPT.py b/Cassiopee/Converter/test/newOversetHolesPT.py index c8b95babd..f6ffed6da 100644 --- a/Cassiopee/Converter/test/newOversetHolesPT.py +++ b/Cassiopee/Converter/test/newOversetHolesPT.py @@ -7,4 +7,4 @@ # Attach it to a parent node d = Internal.newZoneGridConnectivity(name='ZoneGridConnectivity') -Internal.newOversetHoles(name='OversetHoles', pointList=[22,1036,101,43], parent=d) +Internal.newOversetHoles(name='OversetHoles', pointList=[22,1036,101,43], parent=d) diff --git a/Cassiopee/Converter/test/newPeriodicPT.py b/Cassiopee/Converter/test/newPeriodicPT.py index 155028e0b..f54decb12 100644 --- a/Cassiopee/Converter/test/newPeriodicPT.py +++ b/Cassiopee/Converter/test/newPeriodicPT.py @@ -10,4 +10,4 @@ # Attach it to a parent node d = Internal.newGridConnectivityProperty() -Internal.newPeriodic(rotationCenter=[0.,0.,0.], rotationAngle=[0.,0.,0.], translation=[0.,0.,0.], parent=d) +Internal.newPeriodic(rotationCenter=[0.,0.,0.], rotationAngle=[0.,0.,0.], translation=[0.,0.,0.], parent=d) diff --git a/Cassiopee/Converter/test/newPointListPT.py b/Cassiopee/Converter/test/newPointListPT.py index 21c515e3f..75041f947 100644 --- a/Cassiopee/Converter/test/newPointListPT.py +++ b/Cassiopee/Converter/test/newPointListPT.py @@ -6,5 +6,5 @@ #>> ['PointList',array(shape=(5,),dtype='int32',order='F'),[0 son],'IndexArray_t'] # Attach it to a parent node -d = Internal.newBC('wall', [1,80,30,30,1,2], 'BCWall') +d = Internal.newBC('wall', [1,80,30,30,1,2], 'BCWall') Internal.newPointList('PointList', [101,51,22,1036,2], parent=d) diff --git a/Cassiopee/Converter/test/newPointRangePT.py b/Cassiopee/Converter/test/newPointRangePT.py index 828456d33..4669ad780 100644 --- a/Cassiopee/Converter/test/newPointRangePT.py +++ b/Cassiopee/Converter/test/newPointRangePT.py @@ -6,5 +6,5 @@ #>> ['PointRange',array(shape=(3, 2),dtype='int32',order='F'),[0 son],'IndexRange_t'] # Attach it to a parent node -d = Internal.newBC('wall', [1,80,30,30,1,2], 'BCWall') -Internal.newPointRange('PointRange', [1,71,29,29,1,5], parent=d) +d = Internal.newBC('wall', [1,80,30,30,1,2], 'BCWall') +Internal.newPointRange('PointRange', [1,71,29,29,1,5], parent=d) diff --git a/Cassiopee/Converter/test/newPyTree_t1.py b/Cassiopee/Converter/test/newPyTree_t1.py index dd4eb251a..18afeb800 100644 --- a/Cassiopee/Converter/test/newPyTree_t1.py +++ b/Cassiopee/Converter/test/newPyTree_t1.py @@ -31,5 +31,3 @@ t = C.newPyTree(['Base', [z1,z2]]) test.testT(t,8) - - diff --git a/Cassiopee/Converter/test/newZoneGridConnectivityPT.py b/Cassiopee/Converter/test/newZoneGridConnectivityPT.py index 06b9d4a27..0b3ab68bf 100644 --- a/Cassiopee/Converter/test/newZoneGridConnectivityPT.py +++ b/Cassiopee/Converter/test/newZoneGridConnectivityPT.py @@ -7,4 +7,4 @@ # Attach it to a parent node z = Internal.newZone('Zone', zsize=[[10],[2],[0]], ztype='Structured') -Internal.newZoneGridConnectivity('ZoneGridConnectivity', parent=z) +Internal.newZoneGridConnectivity('ZoneGridConnectivity', parent=z) diff --git a/Cassiopee/Converter/test/newZoneSubRegionPT.py b/Cassiopee/Converter/test/newZoneSubRegionPT.py index 1011d362c..ecd9db5d0 100644 --- a/Cassiopee/Converter/test/newZoneSubRegionPT.py +++ b/Cassiopee/Converter/test/newZoneSubRegionPT.py @@ -21,4 +21,4 @@ # Attach it to a parent node z = Internal.newZone('Zone', zsize=[[10, 2, 2]], ztype='Structured') -Internal.newZoneSubRegion(name='SubRegion', pointRange=[1,10,2,2,1,1], gridLocation='FaceCenter', parent=z) +Internal.newZoneSubRegion(name='SubRegion', pointRange=[1,10,2,2,1,1], gridLocation='FaceCenter', parent=z) diff --git a/Cassiopee/Converter/test/newZoneSubRegionPT_t1.py b/Cassiopee/Converter/test/newZoneSubRegionPT_t1.py index fee662d87..b69f7285a 100644 --- a/Cassiopee/Converter/test/newZoneSubRegionPT_t1.py +++ b/Cassiopee/Converter/test/newZoneSubRegionPT_t1.py @@ -16,5 +16,5 @@ # Attach it to a parent node z = Internal.newZone('Zone', zsize=[[10, 2, 2]], ztype='Structured') -Internal.newZoneSubRegion(name='SubRegion', pointRange=[1,10,2,2,1,1], gridLocation='FaceCenter', parent=z) +Internal.newZoneSubRegion(name='SubRegion', pointRange=[1,10,2,2,1,1], gridLocation='FaceCenter', parent=z) test.testO(n, 4) diff --git a/Cassiopee/Converter/test/node2CenterPT_t2.py b/Cassiopee/Converter/test/node2CenterPT_t2.py index 2e2e2e072..bc79a5cb9 100644 --- a/Cassiopee/Converter/test/node2CenterPT_t2.py +++ b/Cassiopee/Converter/test/node2CenterPT_t2.py @@ -3,7 +3,7 @@ import Generator.PyTree as G import KCore.test as test -# CAS 1D +# CAS 1D def F(x,y): return 2*x+y a = G.cart((0,0,0), (1,1,1), (10,1,1)) diff --git a/Cassiopee/Converter/test/normL2.py b/Cassiopee/Converter/test/normL2.py index b1956eceb..16e283ce5 100644 --- a/Cassiopee/Converter/test/normL2.py +++ b/Cassiopee/Converter/test/normL2.py @@ -1,5 +1,5 @@ # - normL2 (array) - -import Converter as C +import Converter as C import Generator as G a = G.cart((0,0,0), (1,1,1), (11,11,11)) diff --git a/Cassiopee/Converter/test/normL2PT.py b/Cassiopee/Converter/test/normL2PT.py index a66a01ff8..d18416dce 100644 --- a/Cassiopee/Converter/test/normL2PT.py +++ b/Cassiopee/Converter/test/normL2PT.py @@ -1,5 +1,5 @@ # - normL2 (pyTree) - -import Converter.PyTree as C +import Converter.PyTree as C import Generator.PyTree as G a = G.cart((0,0,0), (1,1,1), (11,11,11)) diff --git a/Cassiopee/Converter/test/normL2_t1.py b/Cassiopee/Converter/test/normL2_t1.py index 531b4a9b5..c4a35e223 100644 --- a/Cassiopee/Converter/test/normL2_t1.py +++ b/Cassiopee/Converter/test/normL2_t1.py @@ -1,5 +1,5 @@ # - normL2 (array) - -import Converter as C +import Converter as C import KCore.test as test test.stdTestA(C.normL2,'F') diff --git a/Cassiopee/Converter/test/pushBCPT_t1.py b/Cassiopee/Converter/test/pushBCPT_t1.py index 61cb8427b..997f16fa8 100644 --- a/Cassiopee/Converter/test/pushBCPT_t1.py +++ b/Cassiopee/Converter/test/pushBCPT_t1.py @@ -41,4 +41,3 @@ b = G.cartNGon( (0,0,0), (1,1,1), (10,10,10) ) b = C.pushBC(a, b) test.testT(b, 6) - diff --git a/Cassiopee/Converter/test/randomizeVar_t1.py b/Cassiopee/Converter/test/randomizeVar_t1.py index c6716ac82..d27d647a3 100644 --- a/Cassiopee/Converter/test/randomizeVar_t1.py +++ b/Cassiopee/Converter/test/randomizeVar_t1.py @@ -2,4 +2,3 @@ import Converter as C import KCore.test as test test.stdTestA(C.randomizeVar, 'F', 0.1,0.2) - diff --git a/Cassiopee/Converter/test/recoverBCsPT_t2.py b/Cassiopee/Converter/test/recoverBCsPT_t2.py index cf06b2926..a800d94d3 100644 --- a/Cassiopee/Converter/test/recoverBCsPT_t2.py +++ b/Cassiopee/Converter/test/recoverBCsPT_t2.py @@ -1,10 +1,10 @@ # - recoverBCs (pyTree) - import Converter.PyTree as C import Generator.PyTree as G -import Post.PyTree as P +import Post.PyTree as P import KCore.test as test -# STRUCT +# STRUCT a = G.cart((0,0,0),(1,1,1),(10,10,2)) C._addBC2Zone(a, 'overlap', 'BCOverlap', 'imin') C._addBC2Zone(a, 'match1', 'BCMatch', 'jmin', a, 'jmax', [1,2,3]) @@ -16,7 +16,7 @@ b = C.convertArray2NGon(a, recoverBC=False) b = P.selectCells(a,'{centers:varX}>10.') -c = b +c = b C._recoverBCs(b,(BCs,BCNames,BCTypes),removeBC=False) test.testT(b, 1) @@ -24,7 +24,7 @@ C._recoverBCs(c,(BCs,BCNames,BCTypes),removeBC=True) test.testT(c, 2) -# HEXA +# HEXA a = G.cartHexa((0,0,0),(1,1,1),(10,10,2)) C._addBC2Zone(a, 'wall', 'BCWall', faceList=[1,2]) C._fillEmptyBCWith(a, 'sym', 'BCSymmetryPlane', dim=2) @@ -42,7 +42,7 @@ C._recoverBCs(c,(BCs,BCNames,BCTypes),removeBC=True) test.testT(c, 4) -# NGON +# NGON a = G.cartNGon((0,0,0),(1,1,1),(10,10,2)) C._addBC2Zone(a, 'wall', 'BCWall', faceList=[1,2]) C._fillEmptyBCWith(a, 'sym', 'BCSymmetryPlane', dim=2) diff --git a/Cassiopee/Converter/test/recoverGlobalIndex.py b/Cassiopee/Converter/test/recoverGlobalIndex.py index b2a814dcd..7c7405278 100644 --- a/Cassiopee/Converter/test/recoverGlobalIndex.py +++ b/Cassiopee/Converter/test/recoverGlobalIndex.py @@ -15,4 +15,3 @@ a = C.rmVars(a, 'globalIndex') C.convertArrays2File(a, 'out.plt') - diff --git a/Cassiopee/Converter/test/recoverGlobalIndexPT.py b/Cassiopee/Converter/test/recoverGlobalIndexPT.py index 03c3edaf2..7bf7bbcb9 100644 --- a/Cassiopee/Converter/test/recoverGlobalIndexPT.py +++ b/Cassiopee/Converter/test/recoverGlobalIndexPT.py @@ -15,4 +15,3 @@ C._rmVars(a, 'globalIndex') C.convertPyTree2File(a, 'out.cgns') - diff --git a/Cassiopee/Converter/test/resignNGonFacesPT.py b/Cassiopee/Converter/test/resignNGonFacesPT.py index 6b0ed2e5f..e43347a52 100644 --- a/Cassiopee/Converter/test/resignNGonFacesPT.py +++ b/Cassiopee/Converter/test/resignNGonFacesPT.py @@ -1,4 +1,4 @@ -# - resignNGonFaces (pyTree) - +# - resignNGonFaces (pyTree) - import Converter.PyTree as C import Generator.PyTree as G @@ -8,7 +8,7 @@ C._resignNGonFaces(a) C.convertPyTree2File(a, 'out.cgns') -# Unstructured - unsigned NGon v4 +# Unstructured - unsigned NGon v4 a = G.cartNGon((0., 0., 0.), (1., 1., 1.), (5, 5, 5), api=3) C._unsignNGonFaces(a) C._resignNGonFaces(a) diff --git a/Cassiopee/Converter/test/resignNGonFacesPT_t1.py b/Cassiopee/Converter/test/resignNGonFacesPT_t1.py index e089c6edf..5b6f3c80f 100644 --- a/Cassiopee/Converter/test/resignNGonFacesPT_t1.py +++ b/Cassiopee/Converter/test/resignNGonFacesPT_t1.py @@ -9,7 +9,7 @@ C._resignNGonFaces(a) test.testT(a, 1) -# Unstructured - unsigned NGon v4 +# Unstructured - unsigned NGon v4 a = G.cartNGon((0., 0., 0.), (1., 1., 1.), (5, 5, 5), api=3) C._unsignNGonFaces(a) C._resignNGonFaces(a) diff --git a/Cassiopee/Converter/test/rmBCDataVarsPT.py b/Cassiopee/Converter/test/rmBCDataVarsPT.py index 431bd5e45..53a26cecf 100644 --- a/Cassiopee/Converter/test/rmBCDataVarsPT.py +++ b/Cassiopee/Converter/test/rmBCDataVarsPT.py @@ -10,4 +10,3 @@ C._initBCDataSet(a,'{var3}=3.') a = C.rmBCDataVars(a,'var1') a = C.rmBCDataVars(a,['var2','var3']) - diff --git a/Cassiopee/Converter/test/rmBCOfNamePT.py b/Cassiopee/Converter/test/rmBCOfNamePT.py index 7ff6dda6c..4e9dbce34 100644 --- a/Cassiopee/Converter/test/rmBCOfNamePT.py +++ b/Cassiopee/Converter/test/rmBCOfNamePT.py @@ -6,8 +6,8 @@ b = G.cart((-0.1,0.9,0), (0.01,0.01,1.), (20,20,2)) a = C.addBC2Zone(a, 'wall1', 'BCWall', 'jmin') -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imin', a, 'imax', [1,2,3]) -a = C.addBC2Zone(a, 'match2', 'BCMatch', 'imax', a, 'imin', [1,2,3]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imin', a, 'imax', [1,2,3]) +a = C.addBC2Zone(a, 'match2', 'BCMatch', 'imax', a, 'imin', [1,2,3]) a = C.addBC2Zone(a, 'overlap1', 'BCOverlap', 'jmax') b = C.addBC2Zone(b, 'wall2', 'BCWall', 'imin') b = C.addBC2Zone(b, 'loin', 'FamilySpecified:LOIN', 'imax') diff --git a/Cassiopee/Converter/test/rmBCOfNamePT_t1.py b/Cassiopee/Converter/test/rmBCOfNamePT_t1.py index 08f478ff4..97756da35 100644 --- a/Cassiopee/Converter/test/rmBCOfNamePT_t1.py +++ b/Cassiopee/Converter/test/rmBCOfNamePT_t1.py @@ -7,8 +7,8 @@ b = G.cart((-0.1,0.9,0), (0.01,0.01,1.), (20,20,2)) a = C.addBC2Zone(a, 'wall1', 'BCWall', 'jmin') -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imin', a, 'imax', [1,2,3]) -a = C.addBC2Zone(a, 'match2', 'BCMatch', 'imax', a, 'imin', [1,2,3]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imin', a, 'imax', [1,2,3]) +a = C.addBC2Zone(a, 'match2', 'BCMatch', 'imax', a, 'imin', [1,2,3]) a = C.addBC2Zone(a, 'overlap1', 'BCOverlap', 'jmax') b = C.addBC2Zone(b, 'wall2', 'BCWall', 'imin') b = C.addBC2Zone(b, 'loin', 'FamilySpecified:LOIN', 'imax') diff --git a/Cassiopee/Converter/test/rmBCOfType.py b/Cassiopee/Converter/test/rmBCOfType.py index 3a3ddf2af..14985a41f 100644 --- a/Cassiopee/Converter/test/rmBCOfType.py +++ b/Cassiopee/Converter/test/rmBCOfType.py @@ -6,8 +6,8 @@ b = G.cart((-0.1,0.9,0), (0.01,0.01,1.), (20,20,2)) a = C.addBC2Zone(a, 'wall1', 'BCWallInviscid', 'jmin') -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imin', a, 'imax', [1,2,3]) -a = C.addBC2Zone(a, 'match2', 'BCMatch', 'imax', a, 'imin', [1,2,3]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imin', a, 'imax', [1,2,3]) +a = C.addBC2Zone(a, 'match2', 'BCMatch', 'imax', a, 'imin', [1,2,3]) a = C.addBC2Zone(a, 'overlap1', 'BCOverlap', 'jmax') b = C.addBC2Zone(b, 'wall2', 'BCWall', 'imin') b = C.addBC2Zone(b, 'loin', 'FamilySpecified:LOIN', 'imax') diff --git a/Cassiopee/Converter/test/rmBCOfType_t2.py b/Cassiopee/Converter/test/rmBCOfType_t2.py index 6047ea4b5..61c0b7c1d 100644 --- a/Cassiopee/Converter/test/rmBCOfType_t2.py +++ b/Cassiopee/Converter/test/rmBCOfType_t2.py @@ -6,20 +6,20 @@ # Connectivite sur une zone a1 = G.cart((0.,0.,0.),(0.1,0.1,0.1),(11,11,11)) a1 = C.initVars(a1,'F',1.); a1 = C.initVars(a1,'centers:G',2.) -a1 = C.addBC2Zone(a1,'nearmatch1','BCNearMatch','imax',a1,'imin',[1,2,3]) +a1 = C.addBC2Zone(a1,'nearmatch1','BCNearMatch','imax',a1,'imin',[1,2,3]) a1 = C.rmBCOfType(a1,'BCNearMatch') test.testT(a1,1) -a1 = C.addBC2Zone(a1,'match1','BCMatch','imax',a1,'imin',[1,2,3]) +a1 = C.addBC2Zone(a1,'match1','BCMatch','imax',a1,'imin',[1,2,3]) a1 = C.rmBCOfType(a1,'BCMatch') test.testT(a1,2) -a1 = C.addBC2Zone(a1,'overlap1','BCOverlap','imax') +a1 = C.addBC2Zone(a1,'overlap1','BCOverlap','imax') a1 = C.rmBCOfType(a1,'BCOverlap') test.testT(a1,3) # sur un arbre a1 = G.cart((0.,0.,0.),(0.1,0.1,0.1),(11,11,11)); a1[0] = 'cart1' a2 = G.cart((1.,0.,0.),(0.2,0.2,0.2),(6,6,6)); a2[0] = 'cart2' -a1 = C.addBC2Zone(a1,'nearmatch1','BCNearMatch','imax',a2,'imin',[1,2,3]) +a1 = C.addBC2Zone(a1,'nearmatch1','BCNearMatch','imax',a2,'imin',[1,2,3]) a2 = C.addBC2Zone(a2,'nearmatch2','BCNearMatch','imin',a1,'imax',[1,2,3]) a3 = G.cart((-1.,0.,0.),(0.1,0.1,0.1),(11,11,11)); a3[0] = 'cart3' a1 = C.addBC2Zone(a1,'match1','BCMatch','imin',a3,'imax',[1,2,3]) @@ -33,4 +33,3 @@ test.testT(t,5) t = C.rmBCOfType(t,'BCOverlap') test.testT(t,6) - diff --git a/Cassiopee/Converter/test/rmGhostCellsNGon.py b/Cassiopee/Converter/test/rmGhostCellsNGon.py index 547e6ca8b..83f54fd08 100644 --- a/Cassiopee/Converter/test/rmGhostCellsNGon.py +++ b/Cassiopee/Converter/test/rmGhostCellsNGon.py @@ -1,4 +1,4 @@ -# - rmGhostCellsNGon (array) - +# - rmGhostCellsNGon (array) - import Converter as C import Generator as G diff --git a/Cassiopee/Converter/test/sendMPI.py b/Cassiopee/Converter/test/sendMPI.py index 5f50c2f0e..98c5863c9 100644 --- a/Cassiopee/Converter/test/sendMPI.py +++ b/Cassiopee/Converter/test/sendMPI.py @@ -6,7 +6,7 @@ if Cmpi.rank == 0: a = G.cart((0,0,0), (1,1,1), (50,50,30)) -elif Cmpi.rank == 1: +elif Cmpi.rank == 1: a = G.cart((0,100,0), (1,1,1), (50,50,30)) else: a = G.cart((100,0,0), (1,1,1), (50,50,30)) diff --git a/Cassiopee/Converter/test/setNANValuesAt.py b/Cassiopee/Converter/test/setNANValuesAt.py index 6b0086b19..1a61983bd 100644 --- a/Cassiopee/Converter/test/setNANValuesAt.py +++ b/Cassiopee/Converter/test/setNANValuesAt.py @@ -5,4 +5,3 @@ a = G.cart((0,0,0), (1,1,1), (10,10,10)) a = C.initVars(a, 'F', 1.) a = C.setNANValuesAt(a, 'F', 0.) - diff --git a/Cassiopee/Converter/test/setValueIPT.py b/Cassiopee/Converter/test/setValueIPT.py index 4a388f45a..855d886eb 100644 --- a/Cassiopee/Converter/test/setValueIPT.py +++ b/Cassiopee/Converter/test/setValueIPT.py @@ -8,7 +8,7 @@ Internal.setValue(node, 1.); print(node) #>> ['node1', array([ 1.]), [], 'DataArray_t'] -# Set a numpy array in node +# Set a numpy array in node Internal.setValue(node, numpy.zeros(10)); print(node) #>> ['node1', array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]), [], 'DataArray_t'] diff --git a/Cassiopee/Converter/test/setValueIPT_t1.py b/Cassiopee/Converter/test/setValueIPT_t1.py index 2f4c33d14..90d0b1b8d 100644 --- a/Cassiopee/Converter/test/setValueIPT_t1.py +++ b/Cassiopee/Converter/test/setValueIPT_t1.py @@ -9,7 +9,7 @@ Internal.setValue(node, 1.) test.testO(node, 1) -# Set a numpy array in node +# Set a numpy array in node Internal.setValue(node, numpy.zeros(10)) test.testO(node, 2) diff --git a/Cassiopee/Converter/test/signNGonFacesPT.py b/Cassiopee/Converter/test/signNGonFacesPT.py index 1924395df..73afbbc95 100644 --- a/Cassiopee/Converter/test/signNGonFacesPT.py +++ b/Cassiopee/Converter/test/signNGonFacesPT.py @@ -1,4 +1,4 @@ -# - signNGonFaces (pyTree) - +# - signNGonFaces (pyTree) - import Converter.PyTree as C import Generator.PyTree as G diff --git a/Cassiopee/Converter/test/t1.py b/Cassiopee/Converter/test/t1.py index dc3855005..399bb8b88 100644 --- a/Cassiopee/Converter/test/t1.py +++ b/Cassiopee/Converter/test/t1.py @@ -1,3 +1,3 @@ # Converter installation test import KCore.Dist as Dist -Dist.checkModuleImport('Converter') +Dist.checkModuleImport('Converter') diff --git a/Cassiopee/Converter/test/unsignNGonFacesPT.py b/Cassiopee/Converter/test/unsignNGonFacesPT.py index aafed0da8..ab2b9396e 100644 --- a/Cassiopee/Converter/test/unsignNGonFacesPT.py +++ b/Cassiopee/Converter/test/unsignNGonFacesPT.py @@ -1,4 +1,4 @@ -# - unsignNGonFaces (pyTree) - +# - unsignNGonFaces (pyTree) - import Converter.PyTree as C import Generator.PyTree as G @@ -17,7 +17,7 @@ C._unsignNGonFaces(a) C.convertPyTree2File(a, 'out.cgns') -# Unstructured - unsigned NGon v4 +# Unstructured - unsigned NGon v4 a = G.cartNGon((0., 0., 0.), (1., 1., 1.), (5, 5, 5), api=3) C._unsignNGonFaces(a) C.convertPyTree2File(a, 'out.cgns') diff --git a/Cassiopee/Converter/test/unsignNGonFacesPT_t1.py b/Cassiopee/Converter/test/unsignNGonFacesPT_t1.py index 482b78241..453cad442 100644 --- a/Cassiopee/Converter/test/unsignNGonFacesPT_t1.py +++ b/Cassiopee/Converter/test/unsignNGonFacesPT_t1.py @@ -18,7 +18,7 @@ C._unsignNGonFaces(a) test.testT(a, 3) -# Unstructured - unsigned NGon v4 +# Unstructured - unsigned NGon v4 a = G.cartNGon((0., 0., 0.), (1., 1., 1.), (5, 5, 5), api=3) C._unsignNGonFaces(a) test.testT(a, 4) diff --git a/Cassiopee/Converter/test/writeZonesPT.py b/Cassiopee/Converter/test/writeZonesPT.py index daad6a82c..dd3f488e3 100644 --- a/Cassiopee/Converter/test/writeZonesPT.py +++ b/Cassiopee/Converter/test/writeZonesPT.py @@ -11,5 +11,3 @@ t[2][1][2] += [a,b] (t, dic) = Distributor2.distribute(t, NProc=2, algorithm='fast') Distributed.writeZones(t, 'out.adf', proc=0) - - diff --git a/Cassiopee/Dist2Walls/Dist2Walls/PyTree.py b/Cassiopee/Dist2Walls/Dist2Walls/PyTree.py index c8da38fed..821155ebb 100644 --- a/Cassiopee/Dist2Walls/Dist2Walls/PyTree.py +++ b/Cassiopee/Dist2Walls/Dist2Walls/PyTree.py @@ -49,7 +49,7 @@ def _distance2Walls(t, bodies, type='ortho', loc='centers', signed=0, dim=3, isI for i,z in enumerate(zones): if Internal.getZoneType(z)==1: orderedZones.append(i) for i, z in enumerate(zones): - if Internal.getZoneType(z)==2: orderedZones.append(i) + if Internal.getZoneType(z)==2: orderedZones.append(i) coords = C.getFields(Internal.__GridCoordinates__,zones) if loc == 'centers': flag = C.getField('centers:flag',zones) @@ -66,8 +66,8 @@ def _distance2Walls(t, bodies, type='ortho', loc='centers', signed=0, dim=3, isI return None #============================================================================== -# Eikonal equation starting from spring points -# Multidomain not taken into account, no transfer is done ! +# Eikonal equation starting from spring points +# Multidomain not taken into account, no transfer is done ! #============================================================================== def eikonal(t,tc=None,loc='nodes',nitmax=10, err=0.01,algo=fim_old): """Solve the eikonal equation. @@ -101,8 +101,8 @@ def _eikonal(t,tc=None,loc='nodes', nitmax=10, err=0.01,algo=fmm): # Eikonal sur les zones non convergees et sources if loc == 'nodes': C._initVars(t,'{PhiM}={Phi}') else: C._initVars(t,'{centers:PhiM}={centers:Phi}') - no = 0 - for z in Internal.getNodesFromType2(t,"Zone_t"): + no = 0 + for z in Internal.getNodesFromType2(t,"Zone_t"): if isConverged[no] < 1 and C.getMaxValue(z,loc+':flag')>0.: if loc == 'nodes': C._initVars(z,'{Phi}=({flag}<0.1)*%f+({flag}>0.)*{Phi}'%PHIMAX) else: C._initVars(z,'{centers:Phi}=({centers:flag}<0.1)*%f+({centers:flag}>0.)*{Phi}'%PHIMAX) @@ -122,7 +122,7 @@ def _eikonal(t,tc=None,loc='nodes', nitmax=10, err=0.01,algo=fmm): X._setInterpTransfers(t,z2, variables=['Phi','flag'],variablesIBC=None) no += 1 - # Convergence + # Convergence if it > 0: no = 0 ; nocv = 0 for z in Internal.getNodesFromType2(t,"Zone_t"): @@ -137,14 +137,14 @@ def _eikonal(t,tc=None,loc='nodes', nitmax=10, err=0.01,algo=fmm): elif isConverged[no] == 1: nocv+=1 no += 1 - # Iteration + # Iteration it += 1 #----------------------------------------------------------------------------- if it < nitmax+1: print('Distance by Eikonal converged after %d subiterations.'%it) - else: + else: print('Warning: distance by Eikonal did not converged after %d subiterations.'%nitmax) noi = 0 - for i in isConverged: + for i in isConverged: if i != 1: print('%d, %d'%(i, noi)) noi += 1 return None @@ -161,14 +161,14 @@ def _eikonalForZone(z,loc='nodes',algo=fim_old): if loc == 'nodes': locNode = True nodes = C.getFields(Internal.__GridCoordinates__, z)[0] - if locNode: + if locNode: phi = C.getField('Phi',z)[0] speed = C.getField('speed',z)[0] else: phi = C.getField('centers:Phi',z)[0] speed = C.getField("centers:speed",z)[0] nodes = Converter.node2Center(nodes) - if phi == []: + if phi == []: raise ValueError("Dist2Walls:_eikonalForZone: Phi variable not defined in zone.") if speed == []: raise ValueError("Dist2Walls:_eikonalForZone: speed variable not defined in zone.") @@ -254,12 +254,12 @@ def distance2WallsEikonal(t, body, tc=None, DEPTH=2, loc='nodes', err=0.01, nitm if loc == 'nodes': C._initVars(t,'{sign}=({cellN}>0.)-1.*({cellN}<1.)') - # Marquage des points + # Marquage des points C._initVars(t,'{Phi}=%g*{flag}'%PHIMAX)#'Phi=%g*({flag}<1.)+({flag}>0.)'%PHIMAX) else: C._initVars(t,'{centers:sign}=({centers:cellN}>0.)-1.*({centers:cellN}<1.)') - # Marquage des points + # Marquage des points C._initVars(t,'{centers:Phi}=%g*({centers:flag}<1.)+({centers:flag}>0.)'%PHIMAX) #---------------------------------------------- @@ -287,14 +287,14 @@ def distance2WallsEikonal(t, body, tc=None, DEPTH=2, loc='nodes', err=0.01, nitm #print("Calcul distance initiale : {} secondes".format(end3-beg3)) #beg5 = time.time() - if loc == 'nodes': + if loc == 'nodes': C._initVars(z,'{Phi}={TurbulentDistance}*({flag}>0.)+%g*({flag}<1.)'%PHIMAX) else: C._initVars(z,'{centers:Phi}={centers:TurbulentDistance}*({centers:flag}>0.)+%g*({centers:flag}<1.)'%PHIMAX) #end5 = time.time() #print("Temps passe init var turbulentDistance : {} secondes".format(end5-beg5)) - if type == 0: + if type == 0: ni = dims[1]; nj = dims[2]; nk = dims[3] i = max(1,ni//2); j = max(1,nj//2); k = max(1,nk//2) ind1 = i+j*ni+k*ni*nj @@ -319,6 +319,3 @@ def distance2WallsEikonal(t, body, tc=None, DEPTH=2, loc='nodes', err=0.01, nitm C._initVars(t,'{centers:TurbulentDistance}={centers:sign}*{centers:Phi}') C._rmVars(t,['centers:flag','centers:PhiM','centers:DPhi','centers:speed','centers:Phi']) # pour l instant on detruit tout return t - - - diff --git a/Cassiopee/Dist2Walls/doc/source/conf.py b/Cassiopee/Dist2Walls/doc/source/conf.py index ea7096afd..8ce708eff 100644 --- a/Cassiopee/Dist2Walls/doc/source/conf.py +++ b/Cassiopee/Dist2Walls/doc/source/conf.py @@ -192,22 +192,22 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', + # Additional stuff for the LaTeX preamble. + #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('Dist2Walls', 'Dist2Walls.tex', u'Dist2Walls Documentation', - u'/ELSA/MU-10019/V'+__version__, 'manual'), + ('Dist2Walls', 'Dist2Walls.tex', u'Dist2Walls Documentation', + u'/ELSA/MU-10019/V'+__version__, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -250,9 +250,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Dist2Walls', u'Dist2Walls Documentation', - u'ONERA', 'Dist2Walls', 'One line description of project.', - 'Miscellaneous'), + ('index', 'Dist2Walls', u'Dist2Walls Documentation', + u'ONERA', 'Dist2Walls', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/Dist2Walls/setup.py b/Cassiopee/Dist2Walls/setup.py index f8aecbbcc..e42cd46b4 100644 --- a/Cassiopee/Dist2Walls/setup.py +++ b/Cassiopee/Dist2Walls/setup.py @@ -40,8 +40,8 @@ libraries=libraries+additionalLibs, extra_compile_args=Dist.getCppArgs(), extra_link_args=Dist.getLinkArgs() - ) - ] + ) +] # Setup ====================================================================== setup( @@ -53,7 +53,7 @@ packages=['Dist2Walls'], package_dir={"":"."}, ext_modules=extensions - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Dist2Walls/setupLegacy.py b/Cassiopee/Dist2Walls/setupLegacy.py index c1ce72261..e02bf0bf0 100644 --- a/Cassiopee/Dist2Walls/setupLegacy.py +++ b/Cassiopee/Dist2Walls/setupLegacy.py @@ -35,8 +35,8 @@ libraries=libraries+additionalLibs, extra_compile_args=Dist.getCppArgs(), extra_link_args=Dist.getLinkArgs() - ) - ] + ) +] # Setup ====================================================================== setup( @@ -47,7 +47,7 @@ package_dir={"":"."}, packages=['Dist2Walls'], ext_modules=extensions - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Dist2Walls/test/dist2WallsEikonalAlgosPT.py b/Cassiopee/Dist2Walls/test/dist2WallsEikonalAlgosPT.py index 7c498e134..a4bea0ea3 100644 --- a/Cassiopee/Dist2Walls/test/dist2WallsEikonalAlgosPT.py +++ b/Cassiopee/Dist2Walls/test/dist2WallsEikonalAlgosPT.py @@ -20,7 +20,7 @@ sphere = D.sphere((N*h/2.,N*h/2.,0), 1., 100) sphere = C.convertArray2Tetra(sphere) sphere = G.close(sphere) -t = C.newPyTree(['Base',a]) +t = C.newPyTree(['Base',a]) C._initVars(t,'cellN', 1) t = X.blankCellsTri(t, [[sphere]], numpy.array([[1]]), blankingType='node_in') # Condition aux limites @@ -51,4 +51,3 @@ C._initVars(t,'{flag}=({cellN}>1.)') t = DTW.distance2WallsEikonal(t,sphere,DEPTH=DEPTH,nitmax=10,algo=alg) C.convertPyTree2File(t, 'out2.cgns') - diff --git a/Cassiopee/Dist2Walls/test/dist2WallsEikonalPT.py b/Cassiopee/Dist2Walls/test/dist2WallsEikonalPT.py index 72aaaa7d0..844616705 100644 --- a/Cassiopee/Dist2Walls/test/dist2WallsEikonalPT.py +++ b/Cassiopee/Dist2Walls/test/dist2WallsEikonalPT.py @@ -15,7 +15,7 @@ sphere = D.sphere((6.4,6.4,0), 1., 100) sphere = C.convertArray2Tetra(sphere) sphere = G.close(sphere) -t = C.newPyTree(['Base']); t[2][1][2] = [a]; +t = C.newPyTree(['Base']); t[2][1][2] = [a]; C._initVars(t,'cellN', 1) t = X.blankCellsTri(t, [[sphere]], numpy.array([[1]]), blankingType='node_in') # Condition aux limites @@ -39,4 +39,3 @@ C._initVars(t,'{flag}=({cellN}>1.)') t = DTW.distance2WallsEikonal(t,sphere,DEPTH=DEPTH,nitmax=10) C.convertPyTree2File(t, 'out2.cgns') - diff --git a/Cassiopee/Dist2Walls/test/distance2Walls.py b/Cassiopee/Dist2Walls/test/distance2Walls.py index 8abb6ac53..a7ad01d97 100644 --- a/Cassiopee/Dist2Walls/test/distance2Walls.py +++ b/Cassiopee/Dist2Walls/test/distance2Walls.py @@ -7,7 +7,7 @@ # Bloc dont on cherche la distance a la paroi a = G.cart((0.,0.,0.),(0.1,0.1,0.1),(10,10,10)) -# Paroi +# Paroi sphere = D.sphere((1.2,0.,0.), 0.2, 30) cellN = C.initVars(sphere,'cellN',1.) # Calcul de la distance a la paroi diff --git a/Cassiopee/Dist2Walls/test/distance2WallsPT_t1.py b/Cassiopee/Dist2Walls/test/distance2WallsPT_t1.py index d182430b1..a88b9b200 100644 --- a/Cassiopee/Dist2Walls/test/distance2WallsPT_t1.py +++ b/Cassiopee/Dist2Walls/test/distance2WallsPT_t1.py @@ -36,4 +36,3 @@ t[2][1] = C.addState(t[2][1], 'EquationDimension', 3) t2 = DW.distance2Walls(t, bodies, type='mininterf', loc='centers') test.testT(t2,2) - diff --git a/Cassiopee/Dist2Walls/test/distance2Walls_t1.py b/Cassiopee/Dist2Walls/test/distance2Walls_t1.py index bd04f7125..80d08ca4c 100644 --- a/Cassiopee/Dist2Walls/test/distance2Walls_t1.py +++ b/Cassiopee/Dist2Walls/test/distance2Walls_t1.py @@ -14,7 +14,7 @@ for signed in [0,1]: for loc in ['nodes','centers']: for type in ['mininterf','ortho']: - dist = Dist2Walls.distance2Walls(a, [sphere], cellnbodies =[cellns], loc=loc,type=type,signed=signed, dim=3) + dist = Dist2Walls.distance2Walls(a, [sphere], cellnbodies=[cellns], loc=loc,type=type,signed=signed, dim=3) test.testA([dist],c) c += 1 # la moitie de la sphere est masquee @@ -26,7 +26,7 @@ def cellN0__(x): for signed in [0,1]: for loc in ['nodes','centers']: for type in ['mininterf','ortho']: - dist = Dist2Walls.distance2Walls(a, [sphere], cellnbodies =[cellns], loc=loc,type=type,signed=signed, dim=3) + dist = Dist2Walls.distance2Walls(a, [sphere], cellnbodies=[cellns], loc=loc,type=type,signed=signed, dim=3) test.testA([dist],c) c+=1 @@ -42,4 +42,3 @@ def cellN2__(x): dist = Dist2Walls.distance2Walls(a, [sphere], cellnbodies=[cellns], loc=loc, type=type, signed=signed, dim=3) test.testA([dist],c) c+=1 - diff --git a/Cassiopee/Distributor2/Distributor2/Distributor2.py b/Cassiopee/Distributor2/Distributor2/Distributor2.py index 8c035e730..8a744349b 100644 --- a/Cassiopee/Distributor2/Distributor2/Distributor2.py +++ b/Cassiopee/Distributor2/Distributor2/Distributor2.py @@ -80,7 +80,7 @@ def distribute(arrays, NProc, prescribed=None, perfo=None, weight=None, com=None volComd = numpy.empty((2*size), dtype=E_NpyInt) for i, k in enumerate(allkeys): volComd[2*i] = k - volComd[2*i+1] = comd[k] + volComd[2*i+1] = comd[k] else: volComd = comd # Si algo=graph et pas de com, force algo=fast diff --git a/Cassiopee/Distributor2/Distributor2/PyTree.py b/Cassiopee/Distributor2/Distributor2/PyTree.py index 9176af6d1..73dd53d2a 100644 --- a/Cassiopee/Distributor2/Distributor2/PyTree.py +++ b/Cassiopee/Distributor2/Distributor2/PyTree.py @@ -18,12 +18,12 @@ def computeBBoxes__(arrays, zoneNames): bboxes = []; c = 0 for a in arrays: - try: bb = G.bbox(a); bb = bb+[zoneNames[c],True] + try: bb = G.bbox(a); bb = bb+[zoneNames[c],True] except: bb = [0,0,0,1,1,1,zoneNames[c],False] bboxes.append(bb) c += 1 # Parallel eventuel - try: + try: import Converter.Mpi as Cmpi allboxes = Cmpi.allgather(bboxes) c = 0 @@ -33,7 +33,7 @@ def computeBBoxes__(arrays, zoneNames): for k in j: if k[6] == bb[6] and k[7] == True: bboxes[c] = k - c += 1 + c += 1 except: pass return bboxes @@ -46,7 +46,7 @@ def addCom__(comd, c, d, NBlocs, vol): #============================================================================== # Distribute t (pyTree) over NProc processors # IN: NProc: number of processors -# IN: prescribed: dict containing the zones names as key, and the +# IN: prescribed: dict containing the zones names as key, and the # prescribed proc as value # IN: perfo: describes performance of processors # IN: weight: weight assigned to zones of t as a list of integers. Must be ordered as the zones in the pyTree @@ -59,7 +59,7 @@ def addCom__(comd, c, d, NBlocs, vol): # IN: algorithm: gradient0, gradient1, genetic, fast # IN: nghost: nbre de couches de ghost cells ajoutees #============================================================================== -def distribute(t, NProc, prescribed=None, perfo=None, weight=None, useCom='match', +def distribute(t, NProc, prescribed=None, perfo=None, weight=None, useCom='match', algorithm='graph', mode='nodes', nghost=0, tbb=None): """Distribute a pyTree over processors. Usage: distribute(t, NProc, prescribed=None, perfo=None, weight=None, useCom='all', algorithm='graph', mode='nodes', nghost=0)""" @@ -70,7 +70,7 @@ def distribute(t, NProc, prescribed=None, perfo=None, weight=None, useCom='match return tp, out # in place version -def _distribute(t, NProc, prescribed=None, perfo=None, weight=None, useCom='match', +def _distribute(t, NProc, prescribed=None, perfo=None, weight=None, useCom='match', algorithm='graph', mode='nodes', nghost=0, tbb=None): """Distribute a pyTree over processors. Usage: _distribute(t, NProc, prescribed=None, perfo=None, weight=None, useCom='all', algorithm='graph', mode='nodes', nghost=0)""" @@ -78,9 +78,9 @@ def _distribute(t, NProc, prescribed=None, perfo=None, weight=None, useCom='matc (nbPts, aset, com, comd, weightlist) = getData__(t, NProc, prescribed, weight, useCom, mode, tbb) # Equilibrage - out = Distributor2.distribute(nbPts, NProc, prescribed=aset, + out = Distributor2.distribute(nbPts, NProc, prescribed=aset, com=com, comd=comd, - perfo=perfo, weight=weightlist, + perfo=perfo, weight=weightlist, algorithm=algorithm, mode=mode, nghost=nghost) # Sortie @@ -144,7 +144,7 @@ def getData__(t, NProc, prescribed=None, weight=None, useCom='match', mode='node bases = Internal.getBases(tpp) zc = 0; c = 0 for b in bases: - zones = Internal.getNodesFromType1(b, 'Zone_t') + zones = Internal.getNodesFromType1(b, 'Zone_t') mdict = {} pc = 0 for z in zones: mdict[z[0]] = pc; pc += 1 @@ -202,7 +202,7 @@ def getData__(t, NProc, prescribed=None, weight=None, useCom='match', mode='node zmin2 = bboxd[2]; zmax2 = bboxd[5] if (xmax1 > xmin2-tol and xmin1 < xmax2+tol and ymax1 > ymin2-tol and ymin1 < ymax2+tol and - zmax1 > zmin2-tol and zmin1 < zmax2+tol): + zmax1 > zmin2-tol and zmin1 < zmax2+tol): addCom__(comd, c, d, Nb, vol) d += 1 c += 1 @@ -243,7 +243,7 @@ def getData__(t, NProc, prescribed=None, weight=None, useCom='match', mode='node zmin2 = bboxd[2]; zmax2 = bboxd[5] if (xmax1 > xmin2-tol and xmin1 < xmax2+tol and ymax1 > ymin2-tol and ymin1 < ymax2+tol and - zmax1 > zmin2-tol and zmin1 < zmax2+tol): + zmax1 > zmin2-tol and zmin1 < zmax2+tol): addCom__(comd, c, d, Nb, np) d += 1 c += 1 @@ -300,16 +300,16 @@ def getProcList(t, NProc=None, sort=False): for s in range(NProc): procList.append([]) if not sort: # pas de tri - for z in zones: - proc = Internal.getNodeFromName2(z, 'proc') + for z in zones: + proc = Internal.getNodeFromName2(z, 'proc') if proc is not None: procList[Internal.getValue(proc)].append(z[0]) else: - # On trie les zones par taille decroissant pour chaque base pour etre conforme avec + # On trie les zones par taille decroissant pour chaque base pour etre conforme avec # mode openmp (see reorder dans Fast.Internal) bases = Internal.getNodesFromType1(t,'CGNSBase_t') - for base in bases: + for base in bases: zones = Internal.getNodesFromType1(base,'Zone_t') # calcul taille de la zone size_zone =[] @@ -318,7 +318,7 @@ def getProcList(t, NProc=None, sort=False): if dim[0] == 'Structured': if dim[3] == 1: kfic = 0 else : kfic = 2 - ndimdx = (dim[1]-4)*(dim[2]-4)*(dim[3]-kfic) + ndimdx = (dim[1]-4)*(dim[2]-4)*(dim[3]-kfic) else: ndimdx = dim[2] size_zone.append(ndimdx) @@ -333,7 +333,7 @@ def getProcList(t, NProc=None, sort=False): for z in new_zones: proc = Internal.getNodeFromName2(z, 'proc') - if proc is not None: + if proc is not None: procList[Internal.getValue(proc)].append(z[0]) return procList @@ -380,7 +380,7 @@ def addProcNode(t, proc): def _addProcNode(t, proc): zones = Internal.getZones(t) for z in zones: - Internal.createUniqueChild(z, '.Solver#Param', 'UserDefinedData_t', + Internal.createUniqueChild(z, '.Solver#Param', 'UserDefinedData_t', value=None) n = Internal.getNodeFromName1(z, '.Solver#Param') Internal.createUniqueChild(n, 'proc', 'DataArray_t', value=proc) @@ -424,7 +424,7 @@ def printProcStats(t, stats=None, NProc=None): lzone.append(Internal.getName(z)) dim = Internal.getZoneDim(z) if dim[0] == 'Structured': npts += dim[1]*dim[2]*dim[3] - else: npts += dim[1] + else: npts += dim[1] print ('Info: proc '+str(proc)+': '+str(npts)+' points for zones ',lzone) else: # no dist @@ -486,7 +486,7 @@ def stats(t, useCom='match', mode='nodes'): (nbPts, aset, com, comd, weightlist) = getData__(t, NProc, None, None, useCom, mode) - if comd is not None: + if comd is not None: allkeys = comd.keys() size = len(allkeys) volComd = numpy.empty((2*size), dtype=Internal.E_NpyInt) diff --git a/Cassiopee/Distributor2/doc/source/conf.py b/Cassiopee/Distributor2/doc/source/conf.py index 33cf54c9f..7e165ea76 100644 --- a/Cassiopee/Distributor2/doc/source/conf.py +++ b/Cassiopee/Distributor2/doc/source/conf.py @@ -192,15 +192,15 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', -'preamble': r''' + # Additional stuff for the LaTeX preamble. + #'preamble': '', + 'preamble': r''' \usepackage{charter} \usepackage[defaultsans]{lato} \usepackage{inconsolata} @@ -211,8 +211,8 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('Distributor2', 'Distributor2.tex', u'Distributor2 Documentation', - u'/ELSA/MU-12016/V'+__version__, 'manual'), + ('Distributor2', 'Distributor2.tex', u'Distributor2 Documentation', + u'/ELSA/MU-12016/V'+__version__, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -255,9 +255,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Distributor2', u'Distributor2 Documentation', - u'ONERA', 'Distributor2', 'One line description of project.', - 'Miscellaneous'), + ('index', 'Distributor2', u'Distributor2 Documentation', + u'ONERA', 'Distributor2', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/Distributor2/setup.py b/Cassiopee/Distributor2/setup.py index 0dfc12574..40eedb3dc 100644 --- a/Cassiopee/Distributor2/setup.py +++ b/Cassiopee/Distributor2/setup.py @@ -49,7 +49,7 @@ extra_link_args=Dist.getLinkArgs() ) ] - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Distributor2/setupLegacy.py b/Cassiopee/Distributor2/setupLegacy.py index bda178b2f..29689b951 100644 --- a/Cassiopee/Distributor2/setupLegacy.py +++ b/Cassiopee/Distributor2/setupLegacy.py @@ -43,7 +43,7 @@ extra_link_args=Dist.getLinkArgs() ) ] - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Distributor2/test/addProcNodePT.py b/Cassiopee/Distributor2/test/addProcNodePT.py index 78fcb8ee4..78a88a473 100644 --- a/Cassiopee/Distributor2/test/addProcNodePT.py +++ b/Cassiopee/Distributor2/test/addProcNodePT.py @@ -9,7 +9,7 @@ Internal.printTree(a) #>> ['cart',array(shape=(3, 3),dtype='int32',order='F'),[3 sons],'Zone_t'] #>> |_['ZoneType',array('b'Structured'',dtype='|S1'),[0 son],'ZoneType_t'] -#>> | ... +#>> | ... #>> |_['.Solver#Param',None,[1 son],'UserDefinedData_t'] #>> |_['proc',array([12],dtype='int32'),[0 son],'DataArray_t'] C.convertPyTree2File(a, 'out.cgns') diff --git a/Cassiopee/Distributor2/test/distributePT_m2.py b/Cassiopee/Distributor2/test/distributePT_m2.py index 444f0af6a..d34b50dd0 100644 --- a/Cassiopee/Distributor2/test/distributePT_m2.py +++ b/Cassiopee/Distributor2/test/distributePT_m2.py @@ -22,7 +22,7 @@ if Cmpi.rank == 0: C.convertPyTree2File(t, LOCAL+'/in.cgns') Cmpi.barrier() -# arbre complet +# arbre complet t, stats = D2.distribute(t, NProc=Cmpi.size, algorithm='gradient', useCom='bbox') if Cmpi.rank == 0: print('full:', stats) diff --git a/Cassiopee/Distributor2/test/distributePT_m3.py b/Cassiopee/Distributor2/test/distributePT_m3.py index 27aac47e4..947feb397 100644 --- a/Cassiopee/Distributor2/test/distributePT_m3.py +++ b/Cassiopee/Distributor2/test/distributePT_m3.py @@ -22,7 +22,7 @@ if Cmpi.rank == 0: C.convertPyTree2File(t, LOCAL+'/in.cgns') Cmpi.barrier() -# arbre complet +# arbre complet t, stats = D2.distribute(t, NProc=Cmpi.size, algorithm='gradient', useCom='overlap') if Cmpi.rank == 0: diff --git a/Cassiopee/Distributor2/test/distributePT_t1.py b/Cassiopee/Distributor2/test/distributePT_t1.py index cd3cc7928..4da8e0de0 100644 --- a/Cassiopee/Distributor2/test/distributePT_t1.py +++ b/Cassiopee/Distributor2/test/distributePT_t1.py @@ -63,7 +63,7 @@ a = G.cart( (off,0,0), (1,1,1), (10+i, 10, 10) ) off += 9+i t[2][1][2].append(a) - weightDict[a[0]]=i+1 + weightDict[a[0]]=i+1 t, stats = D2.distribute(t, NProc=5, weight=weightDict,algorithm='gradient', useCom='bbox') test.testT(t,8) diff --git a/Cassiopee/Distributor2/test/redispatchPT_m1.py b/Cassiopee/Distributor2/test/redispatchPT_m1.py index fa1fea043..50ec2a632 100755 --- a/Cassiopee/Distributor2/test/redispatchPT_m1.py +++ b/Cassiopee/Distributor2/test/redispatchPT_m1.py @@ -32,7 +32,7 @@ a = Cmpi.readZones(a, LOCAL+'/in.cgns', rank=Cmpi.rank) # equilibrage 2 (a partir d'un squelette charge) -(a, dic) = D2.distribute(a, NProc=Cmpi.size, algorithm='gradient1', +(a, dic) = D2.distribute(a, NProc=Cmpi.size, algorithm='gradient1', useCom='match') Cmpi._convert2PartialTree(a) D2mpi._redispatch(a) diff --git a/Cassiopee/Distributor2/test/t1.py b/Cassiopee/Distributor2/test/t1.py index c8db4068a..1d7b064c1 100644 --- a/Cassiopee/Distributor2/test/t1.py +++ b/Cassiopee/Distributor2/test/t1.py @@ -1,3 +1,3 @@ # Distributor2 installation test import KCore.Dist as Dist -Dist.checkModuleImport('Distributor2') +Dist.checkModuleImport('Distributor2') diff --git a/Cassiopee/Generator/Generator/Buildings.py b/Cassiopee/Generator/Generator/Buildings.py index 8ae6c5271..18ad26268 100644 --- a/Cassiopee/Generator/Generator/Buildings.py +++ b/Cassiopee/Generator/Generator/Buildings.py @@ -153,7 +153,7 @@ def domain(base, height, h, hp): C._addBC2Zone(vol, 'far', 'BCFarfield', 'jmin') C._addBC2Zone(vol, 'far', 'BCFarfield', 'jmax') C._addBC2Zone(vol, 'far', 'BCFarfield', 'imax') - C._addBC2Zone(vol, 'in', 'BCInflow', 'imin') + C._addBC2Zone(vol, 'in', 'BCInflow', 'imin') return [vol] diff --git a/Cassiopee/Generator/Generator/CartGen.py b/Cassiopee/Generator/Generator/CartGen.py index 22830eb99..926ae807e 100644 --- a/Cassiopee/Generator/Generator/CartGen.py +++ b/Cassiopee/Generator/Generator/CartGen.py @@ -226,7 +226,7 @@ def cartRx2(XC0, XC1, HC, XF0, XF1, R, dim=3, rank=None, size=None): # SplitNParts on core if size is None: size = 1 - if rank is None: rank = 0 + if rank is None: rank = 0 b = Internal.getNodeFromName(t, 'CARTESIAN') T._splitNParts(b, N=size, topTree=t) D2._distribute(b, NProc=size, algorithm='fast') @@ -258,15 +258,15 @@ def cartRx2(XC0, XC1, HC, XF0, XF1, R, dim=3, rank=None, size=None): i1 = dest[0]-1; j1 = dest[2]-1; k1 = dest[4]-1 i2 = dest[1]-1; j2 = dest[3]-1; k2 = dest[5]-1 - if R[0] == 1.: + if R[0] == 1.: ratiox = i1; Hx = H[0] else: ratiox = (R[0]**i1-1.)/(R[0]-1.); Hx = H[0]*R[0]**i1 - if R[1] == 1.: + if R[1] == 1.: ratioy = j1; Hy = H[1] else: ratioy = (R[1]**j1-1.)/(R[1]-1.); Hy = H[1]*R[1]**j1 - if R[2] == 1.: + if R[2] == 1.: ratioz = k1; Hz = H[2] else: ratioz = (R[2]**k1-1.)/(R[2]-1.); Hz = H[2]*R[2]**k1 @@ -406,7 +406,7 @@ def cartRx3(XC0, XC1, HC, XF0, XF1, R, dim=3, rank=None, size=None): # SplitNParts on core if size is None: size = 1 - if rank is None: rank = 0 + if rank is None: rank = 0 b = Internal.getNodeFromName(t, 'CARTESIAN') T._splitNParts(b, N=size, topTree=t) D2._distribute(b, NProc=size, algorithm='fast') @@ -439,11 +439,11 @@ def cartRx3(XC0, XC1, HC, XF0, XF1, R, dim=3, rank=None, size=None): i2 = dest[1]-1; j2 = dest[3]-1; k2 = dest[5]-1 doubleLeft=[0,0,0]; doubleRight=[0,0,0] if dL[0] == 1 and i1 == 0: doubleLeft[0] = 1 - if dR[0] == 1 and i2 == N[0]-1: doubleRight[0] = 1 + if dR[0] == 1 and i2 == N[0]-1: doubleRight[0] = 1 if dL[1] == 1 and j1 == 0: doubleLeft[1] = 1 - if dR[1] == 1 and j2 == N[1]-1: doubleRight[1] = 1 + if dR[1] == 1 and j2 == N[1]-1: doubleRight[1] = 1 if dL[2] == 1 and k1 == 0: doubleLeft[2] = 1 - if dR[2] == 1 and k2 == N[2]-1: doubleRight[2] = 1 + if dR[2] == 1 and k2 == N[2]-1: doubleRight[2] = 1 if doubleLeft[0] == 1 and doubleRight[0] == 0: if R[0] == 1.: ratiox = i1; Hx = H[0] @@ -455,31 +455,31 @@ def cartRx3(XC0, XC1, HC, XF0, XF1, R, dim=3, rank=None, size=None): else: ratiox = 1. + (R[0]**(i1-1)-1.)/(R[0]-1.); Hx = H[0]*R[0]**(i1-1) elif doubleLeft[0] == 0 and doubleRight[0] == 1: if R[0] == 1: ratiox=i1; Hx = H[0] - else: + else: if i1 == 0: ratiox = (R[0]**i1 - 1.)/(R[0] - 1.); Hx = H[0]*R[0]**i1 - else: ratiox = (R[0]**(i1) - 1.)/(R[0] - 1.); Hx = H[0]*R[0]**(i1) + else: ratiox = (R[0]**(i1) - 1.)/(R[0] - 1.); Hx = H[0]*R[0]**(i1) elif doubleLeft[0] == 1 and doubleRight[0] == 1: if R[0] == 1: ratiox=i1; Hx = H[0] - else: + else: if i1 == 0: ratiox = (R[0]**i1 - 1.)/(R[0] - 1.); Hx = H[0] else: ratiox = 1.+(R[0]**(i1-1) - 1.)/(R[0] - 1.); Hx = H[0]*R[0]**(i1-1) if doubleLeft[1] == 1 and doubleRight[1] == 0: if R[1] == 1.: ratioy = j1; Hy = H[1] - else: ratioy = (R[1]**(j1) - 1.)/(R[1]-1.); Hy= H[1] + else: ratioy = (R[1]**(j1) - 1.)/(R[1]-1.); Hy= H[1] elif doubleLeft[1] == 0 and doubleRight[1] == 0: if R[1] == 1.: ratioy = j1; Hy = H[1] else: - if j1 == 0: ratioy = (R[1]**j1-1.)/(R[1]-1.); Hy = H[1]*R[1]**j1 + if j1 == 0: ratioy = (R[1]**j1-1.)/(R[1]-1.); Hy = H[1]*R[1]**j1 else: ratioy = 1. + (R[1]**(j1-1.)-1.)/(R[1]-1.); Hy = H[1]*R[1]**(j1 -1) elif doubleLeft[1] == 0 and doubleRight[1] == 1: if R[1] == 1: ratioy=j1; Hy = H[1] - else: + else: if j1 == 0: ratioy = (R[1]**j1 - 1.)/(R[1] - 1.); Hy = H[1]*R[1]**j1 - else: ratioy = (R[1]**(j1) - 1.)/(R[1] - 1.); Hy = H[1]*R[1]**(j1) + else: ratioy = (R[1]**(j1) - 1.)/(R[1] - 1.); Hy = H[1]*R[1]**(j1) elif doubleLeft[1] == 1 and doubleRight[1] ==1: if R[1] == 1: ratioy=j1 ; Hy = H[1] - else: + else: if j1 == 0: ratioy = (R[1]**j1 - 1.)/(R[1] - 1.); Hy = H[1] else: ratioy = 1.+(R[1]**(j1-1) - 1.)/(R[1] - 1.); Hy = H[1]*R[1]**(j1-1) @@ -491,17 +491,17 @@ def cartRx3(XC0, XC1, HC, XF0, XF1, R, dim=3, rank=None, size=None): elif doubleLeft[2] == 0 and doubleRight[2] == 0: if R[2] == 1.: ratioz = k1; Hz = H[2] else: - if k1 == 0: ratioz = (R[2]**k1-1.)/(R[2]-1.); Hz = H[2]*R[2]**k1 - else: ratioz = 1. + (R[2]**(k1-1) -1.)/(R[2]-1.); Hz = H[2]*R[2]**(k1 - 1) + if k1 == 0: ratioz = (R[2]**k1-1.)/(R[2]-1.); Hz = H[2]*R[2]**k1 + else: ratioz = 1. + (R[2]**(k1-1) -1.)/(R[2]-1.); Hz = H[2]*R[2]**(k1 - 1) elif doubleLeft[2] == 0 and doubleRight[2] ==1: if R[2] == 1: ratioz=k1; Hz = H[2] - else: + else: if k1 == 0: ratioz = (R[2]**k1 - 1.)/(R[2] - 1.); Hz = H[2]*R[2]**k1 - else: ratioz = (R[2]**(k1) - 1.)/(R[2] - 1.); Hz = H[2]*R[2]**(k1) + else: ratioz = (R[2]**(k1) - 1.)/(R[2] - 1.); Hz = H[2]*R[2]**(k1) elif doubleLeft[2] == 1 and doubleRight[2] == 1: if R[2] == 1: ratioz=k1; Hz = H[2] - else: + else: if k1 == 0: ratioz = (R[2]**k1 - 1.)/(R[2] - 1.); Hz = H[2] else: ratioz = 1.+(R[2]**(k1-1) - 1.)/(R[2] - 1.); Hz = H[2]*R[2]**(k1-1) @@ -616,7 +616,7 @@ def cartRxHollow(XC0, XC1, HC, XH0, XH1, XF0, XF1, R, dim=3, rank=None, size=Non bcs = Internal.getNodesFromType2(z, 'GridConnectivity1to1_t') Internal._setValue(bcs[-1], 'cart%d-%d-%d'%(i,j,k+1)) - if i == 0: hio=hio*rio**(ni-3); rio=1./rio; Px=Qx; doubleLeft[0] = 0; doubleRight[0] = 1 + if i == 0: hio=hio*rio**(ni-3); rio=1./rio; Px=Qx; doubleLeft[0] = 0; doubleRight[0] = 1 if j == 0: hjo=hjo*rjo**(nj-3); rjo=1./rjo; Py=Qy; doubleLeft[1] = 0; doubleRight[1] = 1 if k == 0: hko=hko*rko**(nk-3); rko=1./rko; Pz=Qz; doubleLeft[2] = 0; doubleRight[2] = 1 data[z[0]] = [(Px,Py,Pz), (hio,hjo,hko), (rio,rjo,rko), (ni,nj,nk), doubleLeft, doubleRight] @@ -632,9 +632,9 @@ def cartRxHollow(XC0, XC1, HC, XH0, XH1, XF0, XF1, R, dim=3, rank=None, size=Non t = C.newPyTree(['CARTESIAN','FLEX']) core = [] for z in a: - if z[0] in coreL: + if z[0] in coreL: core.append(z) - for zone in core : + for zone in core : t[2][1][2].append(zone) a.remove(zone) t[2][2][2] += a @@ -659,7 +659,7 @@ def cartRxHollow(XC0, XC1, HC, XH0, XH1, XF0, XF1, R, dim=3, rank=None, size=Non # SplitNParts on core if size is None: size = 1 - if rank is None: rank = 0 + if rank is None: rank = 0 b = Internal.getNodeFromName(t, 'CARTESIAN') T._splitNParts(b, N=size, topTree=t) D2._distribute(b, NProc=size, algorithm='fast') @@ -692,11 +692,11 @@ def cartRxHollow(XC0, XC1, HC, XH0, XH1, XF0, XF1, R, dim=3, rank=None, size=Non i2 = dest[1]-1; j2 = dest[3]-1; k2 = dest[5]-1 doubleLeft=[0,0,0]; doubleRight=[0,0,0] if dL[0] == 1 and i1 == 0: doubleLeft[0] = 1 - if dR[0] == 1 and i2 == N[0]-1: doubleRight[0] = 1 + if dR[0] == 1 and i2 == N[0]-1: doubleRight[0] = 1 if dL[1] == 1 and j1 == 0: doubleLeft[1] = 1 - if dR[1] == 1 and j2 == N[1]-1: doubleRight[1] = 1 + if dR[1] == 1 and j2 == N[1]-1: doubleRight[1] = 1 if dL[2] == 1 and k1 == 0: doubleLeft[2] = 1 - if dR[2] == 1 and k2 == N[2]-1: doubleRight[2] = 1 + if dR[2] == 1 and k2 == N[2]-1: doubleRight[2] = 1 if doubleLeft[0] == 1 and doubleRight[0] == 0: if R[0] == 1.: ratiox = i1; Hx = H[0] @@ -708,31 +708,31 @@ def cartRxHollow(XC0, XC1, HC, XH0, XH1, XF0, XF1, R, dim=3, rank=None, size=Non else: ratiox = 1. + (R[0]**(i1-1)-1.)/(R[0]-1.); Hx = H[0]*R[0]**(i1-1) elif doubleLeft[0] == 0 and doubleRight[0] == 1: if R[0] == 1: ratiox=i1; Hx = H[0] - else: + else: if i1 == 0: ratiox = (R[0]**i1 - 1.)/(R[0] - 1.); Hx = H[0]*R[0]**i1 - else: ratiox = (R[0]**(i1) - 1.)/(R[0] - 1.); Hx = H[0]*R[0]**(i1) + else: ratiox = (R[0]**(i1) - 1.)/(R[0] - 1.); Hx = H[0]*R[0]**(i1) elif doubleLeft[0] == 1 and doubleRight[0] == 1: if R[0] == 1: ratiox=i1; Hx = H[0] - else: + else: if i1 == 0: ratiox = (R[0]**i1 - 1.)/(R[0] - 1.); Hx = H[0] else: ratiox = 1.+(R[0]**(i1-1) - 1.)/(R[0] - 1.); Hx = H[0]*R[0]**(i1-1) if doubleLeft[1] == 1 and doubleRight[1] == 0: if R[1] == 1.: ratioy = j1; Hy = H[1] - else: ratioy = (R[1]**(j1) - 1.)/(R[1]-1.); Hy= H[1] + else: ratioy = (R[1]**(j1) - 1.)/(R[1]-1.); Hy= H[1] elif doubleLeft[1] == 0 and doubleRight[1] == 0: if R[1] == 1.: ratioy = j1; Hy = H[1] else: - if j1 == 0: ratioy = (R[1]**j1-1.)/(R[1]-1.); Hy = H[1]*R[1]**j1 + if j1 == 0: ratioy = (R[1]**j1-1.)/(R[1]-1.); Hy = H[1]*R[1]**j1 else: ratioy = 1. + (R[1]**(j1-1.)-1.)/(R[1]-1.); Hy = H[1]*R[1]**(j1 -1) elif doubleLeft[1] == 0 and doubleRight[1] == 1: if R[1] == 1: ratioy=j1; Hy = H[1] - else: + else: if j1 == 0: ratioy = (R[1]**j1 - 1.)/(R[1] - 1.); Hy = H[1]*R[1]**j1 - else: ratioy = (R[1]**(j1) - 1.)/(R[1] - 1.); Hy = H[1]*R[1]**(j1) + else: ratioy = (R[1]**(j1) - 1.)/(R[1] - 1.); Hy = H[1]*R[1]**(j1) elif doubleLeft[1] == 1 and doubleRight[1] ==1: if R[1] == 1: ratioy=j1 ; Hy = H[1] - else: + else: if j1 == 0: ratioy = (R[1]**j1 - 1.)/(R[1] - 1.); Hy = H[1] else: ratioy = 1.+(R[1]**(j1-1) - 1.)/(R[1] - 1.); Hy = H[1]*R[1]**(j1-1) @@ -744,17 +744,17 @@ def cartRxHollow(XC0, XC1, HC, XH0, XH1, XF0, XF1, R, dim=3, rank=None, size=Non elif doubleLeft[2] == 0 and doubleRight[2] == 0: if R[2] == 1.: ratioz = k1; Hz = H[2] else: - if k1 == 0: ratioz = (R[2]**k1-1.)/(R[2]-1.); Hz = H[2]*R[2]**k1 - else: ratioz = 1. + (R[2]**(k1-1) -1.)/(R[2]-1.); Hz = H[2]*R[2]**(k1 - 1) + if k1 == 0: ratioz = (R[2]**k1-1.)/(R[2]-1.); Hz = H[2]*R[2]**k1 + else: ratioz = 1. + (R[2]**(k1-1) -1.)/(R[2]-1.); Hz = H[2]*R[2]**(k1 - 1) elif doubleLeft[2] == 0 and doubleRight[2] ==1: if R[2] == 1: ratioz=k1; Hz = H[2] - else: + else: if k1 == 0: ratioz = (R[2]**k1 - 1.)/(R[2] - 1.); Hz = H[2]*R[2]**k1 - else: ratioz = (R[2]**(k1) - 1.)/(R[2] - 1.); Hz = H[2]*R[2]**(k1) + else: ratioz = (R[2]**(k1) - 1.)/(R[2] - 1.); Hz = H[2]*R[2]**(k1) elif doubleLeft[2] == 1 and doubleRight[2] == 1: if R[2] == 1: ratioz=k1; Hz = H[2] - else: + else: if k1 == 0: ratioz = (R[2]**k1 - 1.)/(R[2] - 1.); Hz = H[2] else: ratioz = 1.+(R[2]**(k1-1) - 1.)/(R[2] - 1.); Hz = H[2]*R[2]**(k1-1) diff --git a/Cassiopee/Generator/Generator/Collar.py b/Cassiopee/Generator/Generator/Collar.py index f35b85b89..736064051 100644 --- a/Cassiopee/Generator/Generator/Collar.py +++ b/Cassiopee/Generator/Generator/Collar.py @@ -27,10 +27,10 @@ # Return the list of created collar grids and the list of BCWall ranges as # [[z1,range11,range12,...],[z2,range21,...],...] # ============================================================================= -def createCollarMesh__(s1, s2, distribj, distribk, niterj, niterk, ext, - alphaRef, btype, contour, constraints1, constraints2, +def createCollarMesh__(s1, s2, distribj, distribk, niterj, niterk, ext, + alphaRef, btype, contour, constraints1, constraints2, toldist): - hjmin = distribj[1][0,1] + hjmin = distribj[1][0,1] remap = 1 # 1: remap l'edge ... vars0 = 'x,y,z' if contour != []: contour[0] = vars0; remap = 0 @@ -55,7 +55,7 @@ def createCollarMesh__(s1, s2, distribj, distribk, niterj, niterk, ext, compCons1 = 0; compCons2 = 0 for noe in range(len(edges)): - edge = edges[noe] + edge = edges[noe] # Remap l'edge si construit automatiquement par booleanSurfaceEdges if remap == 1: edge = remapIntersectionEdge__(edge,s1,s2,hjmin,constraints1+constraints2,alphaRef,toldist) # Creation de la collar mesh @@ -94,9 +94,9 @@ def getSplitZones__(a, constraints,toldist): pool.append(T.subzone(a,(indices[i],1,1),(indices[i+1],nj,nk))) i += 1 # fin - if indices[i] != ni: + if indices[i] != ni: if firstsplit == 1: pool = [z0]+pool; pool += [T.subzone(a,(indices[i],1,1),(ni,nj,nk))] - else: + else: pool += [T.join([z0,T.subzone(a,(indices[i],1,1),(ni,nj,nk))])] else: pool = [z0]+pool @@ -106,7 +106,7 @@ def getSplitZones__(a, constraints,toldist): # cas ou le contour initial est obtenu par intersection geometrique entre les # deux surfaces s1 et s2 # IN : constraints : liste des lignes contraintes a respecter -# IN : hjmin : hauteur de la 1ere maille en j a comparer avec la longueur des mailles des edges +# IN : hjmin : hauteur de la 1ere maille en j a comparer avec la longueur des mailles des edges #----------------------------------------------------------------------------- def remapIntersectionEdge__(edge, s1, s2, hjmin, constraints, alphaRef, toldist): if constraints == []: @@ -128,7 +128,7 @@ def remapIntersectionEdge__(edge, s1, s2, hjmin, constraints, alphaRef, toldist) db = G.cart((0,0,0), (1./(net-1.),1,1), (net,1,1) ) e = G.map(e, db) edges[noe] = e - edge = T.join(edges) + edge = T.join(edges) return edge #----------------------------------------------------------------------------- @@ -136,10 +136,10 @@ def remapIntersectionEdge__(edge, s1, s2, hjmin, constraints, alphaRef, toldist) #----------------------------------------------------------------------------- def getExtremaAnglesAtJunction__(edge, s1,s2): ni = s1[2]; nj = s1[3] - s = T.join([s1,s2]); s = C.convertArray2Tetra(s) + s = T.join([s1,s2]); s = C.convertArray2Tetra(s) alp = D.getSharpestAngle(s); #alp = C.addVars([s, alp]) - alp0 = alp[1][0] + alp0 = alp[1][0] alpha = C.initVars(edge,'alpha',0.); alpha = C.extractVars(alpha,['alpha']); alpt = alpha[1][0] xt = C.extractVars(edge,['x'])[1][0] yt = C.extractVars(edge,['y'])[1][0] @@ -159,7 +159,7 @@ def getExtremaAnglesAtJunction__(edge, s1,s2): # as [[z1,win1,win2,...],[z2,win1,win2]] # nremapPts: nb de pts de remap de l edge initial #----------------------------------------------------------------------------- -def buildDifferenceCollarMesh__(edge, s0, s1, s2, distribj, distribk, constraints1, constraints2, +def buildDifferenceCollarMesh__(edge, s0, s1, s2, distribj, distribk, constraints1, constraints2, niterj, niterk, ext, alphaRef, toldist): check = 1 s2 = T.reorder(s2,(-1,)) @@ -192,15 +192,15 @@ def buildDifferenceCollarMesh__(edge, s0, s1, s2, distribj, distribk, constraint #=================================================== walkin1 = SW.surfaceWalk__([s1], edge1, distribj, constraints1, niterj, alphaRef, check, toldist) walkin2 = SW.surfaceWalk__([s2], edge1opp, distribj, constraints2, niterj, alphaRef, check, toldist) - ni1 = walkin1[2]; nj1 = walkin1[3]; nj2 = walkin2[3] - if nj1 == 1: raise ValueError("collarMesh: surfaceWalk failed on 1st surface.") + ni1 = walkin1[2]; nj1 = walkin1[3]; nj2 = walkin2[3] + if nj1 == 1: raise ValueError("collarMesh: surfaceWalk failed on 1st surface.") if nj2 == 1: raise ValueError("collarMesh: surfaceWalk failed on 2nd surface.") if ext > 1: walkout1 = SW.surfaceWalk__([s1], edge1opp, distribj, constraints1, niterj, alphaRef, check, toldist) walkout2 = SW.surfaceWalk__([s2], edge1, distribj, constraints2, niterj, alphaRef, check, toldist) njo1 = walkout1[3]; njo2 = walkout2[3] - if njo1 == 1: raise ValueError("collarMesh: surfaceWalk for extension failed on 1st surface.") - if njo2 == 1: raise ValueError("collarMesh: surfaceWalk for extension failed on 2nd surface.") + if njo1 == 1: raise ValueError("collarMesh: surfaceWalk for extension failed on 1st surface.") + if njo2 == 1: raise ValueError("collarMesh: surfaceWalk for extension failed on 2nd surface.") # # Extrusion en k [walkin1,walkout1] = G.addNormalLayers([walkin1,walkout1],distribk,niter=niterk,check=1) @@ -209,17 +209,17 @@ def buildDifferenceCollarMesh__(edge, s0, s1, s2, distribj, distribk, constraint # Remap walkin1 et walkin2 nk1 = walkout1[4]; nk2 = walkout2[4] walkin1 = G.map(walkin1,sourcej,dir=2); walkin2 = G.map(walkin2,sourcej,dir=2) - walkout1 = G.map(walkout1,sourcej,dir=2); walkout1 = T.subzone(walkout1,(1,1,1),(ni1,ext+1,nk1)) + walkout1 = G.map(walkout1,sourcej,dir=2); walkout1 = T.subzone(walkout1,(1,1,1),(ni1,ext+1,nk1)) walkout2 = G.map(walkout2,sourcej,dir=2); walkout2 = T.subzone(walkout2,(1,1,1),(ni1,ext+1,nk2)) # # Join z1 = T.join(walkin1,walkout1); z2 = T.join(walkin2,walkout2) z1 = T.reorder(z1,(2,-1,3)); z2 = T.reorder(z2,(2,-1,3)) - # - # determination des parois + # + # determination des parois imin1 = walkin1[2]; jmin1 = walkin1[3]; imin2 = walkin2[2]; jmin2 = walkin2[3] - krange1 = [1,imin1,1,jmin1,1,1]; krange2 = [1,imin2,1,jmin2,1,1] - return [[z1,krange1],[z2,krange2]] + krange1 = [1,imin1,1,jmin1,1,1]; krange2 = [1,imin2,1,jmin2,1,1] + return [[z1,krange1],[z2,krange2]] else: [walkin1,walkin2] = G.addNormalLayers([walkin1,walkin2],distribk,niter=niterk,check=1) # Remap walkin1 et walkin2 @@ -228,14 +228,14 @@ def buildDifferenceCollarMesh__(edge, s0, s1, s2, distribj, distribk, constraint # Map en k z = G.map(z,sourcek,3) imin1 = z[2]; jmin1 = z[3]; krange = [1,imin1,1,jmin1,1,1] - return [[z,krange]] + return [[z,krange]] #------------------------------------------------------------------------------ # builds the collar mesh in case of union # return the list of zones as [[z1,win1,win2,...],[z2,win1,win2]] #------------------------------------------------------------------------------ def buildUnionCollarMesh__(edge, s0, s1, s2, distribj, distribk, - constraints1, constraints2, + constraints1, constraints2, niterj, niterk, alphaRef, toldist): check = 1 #=================================================== @@ -266,17 +266,17 @@ def buildUnionCollarMesh__(edge, s0, s1, s2, distribj, distribk, else: edge1opp = edge0; edge1 = T.reorder(edge0,(-1,2,3)) walkin2 = SW.surfaceWalk__([s2], edge1opp, distribj, constraints2, niterj, alphaRef, check, toldist) nj2 = walkin2[3] - if nj2 == 1: raise ValueError("collarMesh: surfaceWalk failed on 2nd surface.") + if nj2 == 1: raise ValueError("collarMesh: surfaceWalk failed on 2nd surface.") # - walkin1 = SW.surfaceWalk__([s1], edge1, distribj, constraints1, niterj, alphaRef, check, toldist) + walkin1 = SW.surfaceWalk__([s1], edge1, distribj, constraints1, niterj, alphaRef, check, toldist) nj1 = walkin1[3] - if nj1 == 1: raise ValueError("collarMesh: surfaceWalk failed on 1st surface.") + if nj1 == 1: raise ValueError("collarMesh: surfaceWalk failed on 1st surface.") # - # determine the angle at the junction located at edge between s1 and s2 + # determine the angle at the junction located at edge between s1 and s2 alpha,alphamin,alphamax = getExtremaAnglesAtJunction__(edge1,walkin1,T.reorder(walkin2,(-1,2,3))) ldk = D.getLength(distribk) # Remap walkin1 et walkin2 - if alphamin < 120. : # TFI si 180-60 deg + if alphamin < 120. : # TFI si 180-60 deg if alphamax < 120.: z1 = generateCollarVolumeMesh0__(walkin1,walkin2,sourcej,toldist) else: z1 = generateCollarVolumeMesh1__(walkin2,walkin1,sourcej,alpha,toldist) return [[z1,[1,1,1,z1[3],1,z1[4]],[1,z1[2],1,z1[3],1,1]]] @@ -289,7 +289,7 @@ def buildUnionCollarMesh__(edge, s0, s1, s2, distribj, distribk, for z0 in z: z0 = G.map(z0,sourcek,dir=3) info.append([z0,[1,z0[2],1,z0[3],1,1]]) - else: + else: z = G.map(z,sourcek,dir=3) info.append([z,[1,z[2],1,z[3],1,1]]) return info @@ -322,11 +322,11 @@ def booleanSurface__(s1,s2,btype,toldist): extEdges2 = [] try: extEdges2 = P.exteriorFaces(s2) - extEdges2 = T.splitConnexity(extEdges2) + extEdges2 = T.splitConnexity(extEdges2) for noe in range(len(extEdges2)): p = G.fittingPlaster(extEdges2[noe], bumpFactor=0.) b = G.gapfixer(extEdges2[noe], p) - surfs2.append(b) + surfs2.append(b) except: pass surf1 = T.join([s1]+surfs1); surf2 = T.join([s2]+surfs2) surf1 = T.reorder(surf1,(1,)); surf2 = T.reorder(surf2,(1,)) @@ -377,7 +377,7 @@ def joinTBranches__(edges,toldist): def booleanSurfaceEdges__(s1,s2, toldist): err = 0 edge = XOR.intersection(s1,s2) - edge = G.close(edge,toldist) + edge = G.close(edge,toldist) edges = T.splitConnexity(edge) for noe in range(len(edges)): edges0 = T.splitTBranches(edges[noe]) @@ -414,7 +414,7 @@ def getSurfaceConstraints__(iniSurf, boolSurf, edge, toldist, alphaRef=30.): if alphaMax-180. < alphaRef and 180-alphaMin < alphaRef: return []# pas de singularite dans le contour booleen # determination des contraintes : tri des edges candidats e0 = C.convertBAR2Struct(edgens) - edges10 = P.sharpEdges(boolSurf,alphaRef=alphaRef) + edges10 = P.sharpEdges(boolSurf,alphaRef=alphaRef) edges10 = T.splitSharpEdges(edges10,alphaRef=alphaRef) edges10 = T.splitTBranches(edges10) # ne prendre que les contraintes issues de la surface courante iniSurf @@ -458,7 +458,7 @@ def getSurfaceConstraints__(iniSurf, boolSurf, edge, toldist, alphaRef=30.): xt0 = C.extractVars(e0,['x'])[1][0,:] yt0 = C.extractVars(e0,['y'])[1][0,:] - zt0 = C.extractVars(e0,['z'])[1][0,:] + zt0 = C.extractVars(e0,['z'])[1][0,:] for noe1 in range(len(edges1)): e1 = edges1[noe1] dist1 = DTW.distance2Walls([e1],[e0], type='ortho',loc='nodes')[0] @@ -478,7 +478,7 @@ def getSurfaceConstraints__(iniSurf, boolSurf, edge, toldist, alphaRef=30.): else: ind1p = ind1-1 if ind2 < len(xt1)-1: ind2p = ind2+1 else: ind2p = ind2-1 - xB = xt0[ind1p]; yB = yt0[ind1p]; zB = zt0[ind1p] + xB = xt0[ind1p]; yB = yt0[ind1p]; zB = zt0[ind1p] xC = xt1[ind2p]; yC = yt1[ind2p]; zC = zt1[ind2p] # calcul de l angle entre les deux contours au pt d intersection xAB = xB-xA; yAB = yB-yA; zAB = zB-zA @@ -507,7 +507,7 @@ def createBFExtension(c, surfaces, projSurf, dhj, toldist, niter=0): vars = c0[0] d0 = DTW.distance2Walls([c0],projSurf, type='ortho',loc='centers')[0]; d0 = C.center2Node(d0) ind0 = SW.getMinDistIndex__(d0) - if ind0 != 0 : c0 = T.reorder(c0,(-1,2,3)) + if ind0 != 0 : c0 = T.reorder(c0,(-1,2,3)) c2 = T.projectOrtho(c0,surfaces); c2 = G.close(c2,tol=toldist) imax = c2[1].shape[1]; jmax = dhj[1].shape[1] @@ -615,7 +615,7 @@ def generateCollarVolumeMesh0__(surf1, surf2, sourcej, toldist): # boucle : couper en 2 les 2 surfaces xmin1 = surf1[1][0,0]; ymin1 = surf1[1][1,0]; zmin1 = surf1[1][2,0] xmax1 = surf1[1][0,ni1-1]; ymax1 = surf1[1][1,ni1-1]; zmax1 = surf1[1][2,ni1-1] - cas1 = 0 + cas1 = 0 mesh = [] if abs(xmin1-xmax1) < toldist and abs(ymin1-ymax1)< toldist and abs(zmin1-zmax1)< toldist: surf1o = []; surf2o = [] @@ -660,7 +660,7 @@ def generateCollarVolumeMesh1__(surf1, surf2, distribj, calpha, toldist): xmin1 = surf1[1][0,0]; ymin1 = surf1[1][1,0]; zmin1 = surf1[1][2,0] xmax1 = surf1[1][0,ni1-1]; ymax1 = surf1[1][1,ni1-1]; zmax1 = surf1[1][2,ni1-1] isloop = 0 - if abs(xmin1-xmax1) < toldist and abs(ymin1-ymax1)< toldist and abs(zmin1-zmax1)< toldist: + if abs(xmin1-xmax1) < toldist and abs(ymin1-ymax1)< toldist and abs(zmin1-zmax1)< toldist: isloop = 1 # verifier que ds le meme ordre x1 = surf1[1][0,1]; y1 = surf1[1][1,1]; z1 = surf1[1][2,1] @@ -671,10 +671,10 @@ def generateCollarVolumeMesh1__(surf1, surf2, distribj, calpha, toldist): #================================================ # 1er vecteur : tangente a surf1 #================================================ - n1 = C.array('sx,sy,sz',ni1,1,1); vect1 = n1[1] + n1 = C.array('sx,sy,sz',ni1,1,1); vect1 = n1[1] coords1 = surf1[1] for i1 in range(ni1): - istart = i1; iend = i1+ni1#(nj1-1)*ni1 + istart = i1; iend = i1+ni1#(nj1-1)*ni1 dx = coords1[0,iend]-coords1[0,istart] dy = coords1[1,iend]-coords1[1,istart] dz = coords1[2,iend]-coords1[2,istart] @@ -690,7 +690,7 @@ def generateCollarVolumeMesh1__(surf1, surf2, distribj, calpha, toldist): surfu = C.convertArray2Hexa(surfLoc); surfu = G.close(surfu) surfu = T.reorder(surfu, (1,)) indicesU = KCore.indiceStruct2Unstr2([surf2], surfu, 1.e-14)[0] - nu = G.getSmoothNormalMap(surfu) + nu = G.getSmoothNormalMap(surfu) c2 = T.subzone(surfLoc,(1,1,1),(ni2,1,1)) n2 = C.array('sx,sy,sz',ni2,1,1) for ind in range(ni2): @@ -703,14 +703,14 @@ def generateCollarVolumeMesh1__(surf1, surf2, distribj, calpha, toldist): alp1 = C.extractVars(calpha,['alpha'])[1] n = C.array('sx,sy,sz',ni1,1,1); vn = n[1]; vn1 = n1[1]; vn2 = n2[1] - dh1 = T.subzone(surf1,(1,1,1),(1,surf1[3],1)) + dh1 = T.subzone(surf1,(1,1,1),(1,surf1[3],1)) dh1 = T.reorder(dh1,(-2,1,3)) l1 = D.getLength(dh1) alphamax = 90. for i in range(ni1): alp0 = alp1[0,i] - if alp0 < alphamax: - for j in range(3): vn[j,i]=l1*vn1[j,i] + if alp0 < alphamax: + for j in range(3): vn[j,i]=l1*vn1[j,i] else: for j in range(3): vn[j,i]=l1*vn2[j,i] # Petit lissage ... @@ -728,7 +728,7 @@ def generateCollarVolumeMesh1__(surf1, surf2, distribj, calpha, toldist): c2p = T.deform(c2,n) c2p = C.extractVars(c2p,['x','y','z']) - #============================================= + #============================================= # Construction de surf1opp #============================================= surf1opp = C.array('x,y,z',ni1,2,1) @@ -739,8 +739,8 @@ def generateCollarVolumeMesh1__(surf1, surf2, distribj, calpha, toldist): indo = ind-ni1 surf1opp[1][:,ind]= c2p[1][:,indo] - dh1 = T.subzone(surf1,(1,1,1),(1,nj1,1)) - dh1 = T.reorder(dh1,(-2,1,3)) + dh1 = T.subzone(surf1,(1,1,1),(1,nj1,1)) + dh1 = T.reorder(dh1,(-2,1,3)) sourcej = D.getCurvilinearAbscissa(dh1) sourcej = C.initVars(sourcej, '{CoordinateX}={s}') sourcej = C.initVars(sourcej, '{CoordinateY}=0') @@ -756,8 +756,8 @@ def generateCollarVolumeMesh1__(surf1, surf2, distribj, calpha, toldist): ind1 = i + (nj1-1)*ni1 surf2opp[1][:,i] = surf1[1][:,ind1] surf2opp[1][:,i+ni1] = surf1opp[1][:,ind1] - dh2 = T.subzone(surf2,(1,1,1),(1,surf2[3],1)) - dh2 = T.reorder(dh2,(-2,1,3)) + dh2 = T.subzone(surf2,(1,1,1),(1,surf2[3],1)) + dh2 = T.reorder(dh2,(-2,1,3)) sourcej2 = D.getCurvilinearAbscissa(dh2) sourcej2 = C.initVars(sourcej2,'{CoordinateX}={s}') sourcej2 = C.initVars(sourcej2,'{CoordinateY}=0') @@ -787,7 +787,7 @@ def generateCollarVolumeMesh1__(surf1, surf2, distribj, calpha, toldist): surf2o = [surf2_1,surf2_2]; surf2oppo=[surf2opp_1,surf2opp_2] else: surf1o = [surf1]; surf1oppo = [surf1opp] - surf2o = [surf2]; surf2oppo = [surf2opp] + surf2o = [surf2]; surf2oppo = [surf2opp] # #============================================= # creation des fenetres i = 1 et i = imax @@ -796,7 +796,7 @@ def generateCollarVolumeMesh1__(surf1, surf2, distribj, calpha, toldist): r1 = surf1o[nos1]; r1opp = surf1oppo[nos1] r2 = surf2o[nos1]; r2opp = surf2oppo[nos1] - # Calcul de r5 + # Calcul de r5 a11 = T.subzone(r1,(1,1,1),(1,r1[3],r1[4])) a21 = T.subzone(r1opp,(1,1,1),(1,r1opp[3],r1opp[4])) a31 = T.subzone(r2,(1,1,1),(1,r2[3],r2[4])) @@ -811,7 +811,7 @@ def generateCollarVolumeMesh1__(surf1, surf2, distribj, calpha, toldist): a41 = T.subzone(r2opp,(r2opp[2],1,1),(r2opp[2],r2opp[3],r2opp[4])) A = [a11,a21,a31,a41]; A = T.reorder(A,(3,1,2)) r6 = G.TFI(A) - out = [r1,r1opp,r2,r2opp,r5,r6] + out = [r1,r1opp,r2,r2opp,r5,r6] m = G.TFI(out) mesh.append(m) mesh = T.join(mesh) @@ -829,7 +829,7 @@ def buildTFIMeshType0__(r1,r2): # translation de r1 par rapport a r2 -> r1opp1 # idem pour r2 #============================================= - vect = C.array('sx,sy,sz',ni1,nj1,1); vect1 = vect[1] + vect = C.array('sx,sy,sz',ni1,nj1,1); vect1 = vect[1] coords2 = r2[1]; r1opp = C.copy(r1) for j2 in range(nj2-1): @@ -841,10 +841,10 @@ def buildTFIMeshType0__(r1,r2): for j1 in range(nj1): vect1[0,i2+j1*ni1] = dx vect1[1,i2+j1*ni1] = dy - vect1[2,i2+j1*ni1] = dz + vect1[2,i2+j1*ni1] = dz r1opp = T.deform(r1opp,vect) - vect = C.array('sx,sy,sz',ni2,nj2,1); vect2 = vect[1] + vect = C.array('sx,sy,sz',ni2,nj2,1); vect2 = vect[1] coords1 = r1[1]; r2opp = C.copy(r2) for j1 in range(nj1-1): for i1 in range(ni1): @@ -860,7 +860,7 @@ def buildTFIMeshType0__(r1,r2): #============================================= # creation des fenetres i = 1 et i = imax - # calcul de r4 : + # calcul de r4 : #============================================= r1opp = C.extractVars(r1opp,['x','y','z']) r2opp = C.extractVars(r2opp,['x','y','z']) @@ -922,7 +922,7 @@ def orderContourForUnionSurface__(edge, s1, s2): etax1 = n1y*ksiz-n1z*ksiy; etay1 = n1z*ksix-n1x*ksiz; etaz1 = n1x*ksiy-n1y*ksix normeta1 = max(1.e-12,math.sqrt(etax1*etax1+etay1*etay1+etaz1*etaz1)); normeta1 = 1./(normeta1) etax1 = etax1*normeta1; etay1 = etay1*normeta1; etaz1 = etaz1*normeta1 - # + # n2 = G.getSmoothNormalMap(s2,niter=0); n2 = C.normalize(n2, ['sx','sy','sz']) pt2 = T.projectOrtho(ptA,[s2]) x2 = pt2[1][0,0]; y2 = pt2[1][1,0]; z2 = pt2[1][2,0] diff --git a/Cassiopee/Generator/Generator/Generator.py b/Cassiopee/Generator/Generator/Generator.py index 7763b2cc9..78c4bdd9d 100755 --- a/Cassiopee/Generator/Generator/Generator.py +++ b/Cassiopee/Generator/Generator/Generator.py @@ -10,29 +10,29 @@ from .TFIs import allTFI, TFI, TFITri, TFITri2, TFIO, TFIHalfO, TFIMono, TFIStar, TFIStar2 __all__ = ['cart', 'cartr1', 'cartr2', 'cartHexa', 'cartTetra', 'cartPenta', - 'cartPyra', 'cartNGon', 'cylinder', 'cylinder2', 'cylinder3', 'delaunay', - 'checkDelaunay', 'constrainedDelaunay', 'check', 'bbox', 'BB', - 'barycenter', 'CEBBIntersection', 'bboxIntersection', 'checkPointInCEBB', - 'enforceX', 'enforceY', 'enforceZ', 'enforcePlusX', 'enforcePlusY', - 'enforcePlusZ', 'enforceMoinsX', 'enforceMoinsY', 'enforceMoinsZ', - 'enforceLine', 'enforcePoint', 'enforceCurvature', 'enforceCurvature2', - 'addPointInDistribution', 'map', 'map1d', 'map1dpl', 'map2d', - 'mapCurvature', 'refine', 'defineSizeMapForMMGs', 'mmgs', 'densify', - 'hyper2D', 'hyper2D2', 'hyper2D3', 'hyper2D4', 'close', 'closeLegacy', 'zip', - 'pointedHat', 'stitchedHat', 'plaster', 'selectInsideElts', 'grow', 'stack', - 'allTFI', 'TFI', 'TFITri', 'TFITri2', 'TFIO', 'TFIHalfO', 'TFIMono', - 'TFIStar', 'TFIStar2', - 'TTM', 'bboxOfCells', 'getCellPlanarity', 'getVolumeMap', - 'getCellCenters', 'getFaceCentersAndAreas', 'getNormalMap', - 'getSmoothNormalMap', 'getEdgeRatio', 'getMaxLength', 'collarMesh', - 'surfaceWalk', 'buildExtension', 'getCircumCircleMap', 'getInCircleMap', - 'addNormalLayers', 'gencartmb', 'mapSplit', 'T3mesher2D', 'tetraMesher', - 'fittingPlaster', 'gapfixer', 'gapsmanager', 'front2Hexa', 'front2Struct', - 'snapFront', 'snapSharpEdges', 'fillWithStruct', 'octree2Struct', - 'cutOctant', 'octree', 'conformOctree3', 'adaptOctree', 'expandLayer', - 'forceMatch', '_forceMatch', 'getOrthogonalityMap', 'getRegularityMap', - 'getAngleRegularityMap', 'getTriQualityMap', 'getTriQualityStat', - 'quad2Pyra', 'extendCartGrids', 'checkMesh'] + 'cartPyra', 'cartNGon', 'cylinder', 'cylinder2', 'cylinder3', 'delaunay', + 'checkDelaunay', 'constrainedDelaunay', 'check', 'bbox', 'BB', + 'barycenter', 'CEBBIntersection', 'bboxIntersection', 'checkPointInCEBB', + 'enforceX', 'enforceY', 'enforceZ', 'enforcePlusX', 'enforcePlusY', + 'enforcePlusZ', 'enforceMoinsX', 'enforceMoinsY', 'enforceMoinsZ', + 'enforceLine', 'enforcePoint', 'enforceCurvature', 'enforceCurvature2', + 'addPointInDistribution', 'map', 'map1d', 'map1dpl', 'map2d', + 'mapCurvature', 'refine', 'defineSizeMapForMMGs', 'mmgs', 'densify', + 'hyper2D', 'hyper2D2', 'hyper2D3', 'hyper2D4', 'close', 'closeLegacy', 'zip', + 'pointedHat', 'stitchedHat', 'plaster', 'selectInsideElts', 'grow', 'stack', + 'allTFI', 'TFI', 'TFITri', 'TFITri2', 'TFIO', 'TFIHalfO', 'TFIMono', + 'TFIStar', 'TFIStar2', + 'TTM', 'bboxOfCells', 'getCellPlanarity', 'getVolumeMap', + 'getCellCenters', 'getFaceCentersAndAreas', 'getNormalMap', + 'getSmoothNormalMap', 'getEdgeRatio', 'getMaxLength', 'collarMesh', + 'surfaceWalk', 'buildExtension', 'getCircumCircleMap', 'getInCircleMap', + 'addNormalLayers', 'gencartmb', 'mapSplit', 'T3mesher2D', 'tetraMesher', + 'fittingPlaster', 'gapfixer', 'gapsmanager', 'front2Hexa', 'front2Struct', + 'snapFront', 'snapSharpEdges', 'fillWithStruct', 'octree2Struct', + 'cutOctant', 'octree', 'conformOctree3', 'adaptOctree', 'expandLayer', + 'forceMatch', '_forceMatch', 'getOrthogonalityMap', 'getRegularityMap', + 'getAngleRegularityMap', 'getTriQualityMap', 'getTriQualityStat', + 'quad2Pyra', 'extendCartGrids', 'checkMesh'] def cart(Xo, H, N, api=1): """Create a cartesian mesh defined by a structured array. @@ -153,9 +153,9 @@ def bbox(arrays): if varz == -1 : raise ValueError("bbox: z-coordinate not found.") else: varz = 'z' - else: varz = 'CoordinateZ' + else: varz = 'CoordinateZ' - xmin0 = C.getMinValue(a, varx) + xmin0 = C.getMinValue(a, varx) ymin0 = C.getMinValue(a, vary) zmin0 = C.getMinValue(a, varz) xmax0 = C.getMaxValue(a, varx) @@ -212,7 +212,7 @@ def BB(array, method='AABB', weighting=0, tol=0.): else: print('BB: Warning, method=%s not implemented, making an OBB.'%method) ar = generator.obbox(array, weighting) - return ar + return ar def barycenter(array, weight=None): """Get the barycenter of an array. @@ -249,7 +249,7 @@ def bboxIntersection(array1, array2, tol=1.e-6, isBB=False, method='AABB'): elif method == 'OBB': # Computes the intersection between 2 OBB return generator.obboxIntersection(array1, array2) elif method == 'AABBOBB': # Computes the intersection between an AABB and an OBB - return generator.crossIntersection(array1, array2) + return generator.crossIntersection(array1, array2) else: print('Warning: bboxIntersection: method %s not implemented, switching to AABB.'%method) return generator.bboxIntersection(array1, array2) @@ -498,17 +498,17 @@ def map1dpl(array, d, dir, h1, h2, isAvg, pnts): if islocationdependent: for k in range(nk): - for j in range(nj): + for j in range(nj): l = T.subzone(m, (1,j+1,k+1), (ni,j+1,k+1)) h1_local = h1 - h2_local = h2 + h2_local = h2 if h1_local<0:h1_local=numpy.sqrt((l[1][0][0] -l[1][0][1] )**2+ (l[1][1][0] -l[1][1][1] )**2+ (l[1][2][0] -l[1][2][1] )**2) if h2_local<0:h2_local=numpy.sqrt((l[1][0][ni-1]-l[1][0][ni-2])**2+ (l[1][1][ni-1]-l[1][1][ni-2])**2+ (l[1][2][ni-1]-l[1][2][ni-2])**2) - length_local = D.getLength(l) + length_local = D.getLength(l) d = MapE.buildDistrib(h1_local/length_local,h2_local/length_local,N+1) if isAvg: @@ -543,14 +543,14 @@ def d_local(m,j,k,ni,h1,h2,N): import Geom.MapEdge as MapE l = T.subzone(m, (1,j+1,k+1), (ni,j+1,k+1)) h1_local = h1 - h2_local = h2 + h2_local = h2 if h1_local<0:h1_local=numpy.sqrt((l[1][0][0] -l[1][0][1] )**2+ (l[1][1][0] -l[1][1][1] )**2+ (l[1][2][0] -l[1][2][1] )**2) if h2_local<0:h2_local=numpy.sqrt((l[1][0][ni-1]-l[1][0][ni-2])**2+ (l[1][1][ni-1]-l[1][1][ni-2])**2+ (l[1][2][ni-1]-l[1][2][ni-2])**2) - length_local = D.getLength(l) + length_local = D.getLength(l) d = MapE.buildDistrib(h1_local/length_local,h2_local/length_local,N+1) return d @@ -596,7 +596,7 @@ def mapCurvature(array, N, power, dir): def mapCurvature___(array, N, power, dir): try: import Transform as T - except: + except: raise ImportError("mapCurvature: requires Transform, Converter modules.") if dir == 2: m = T.reorder(array, (2,1,3)) elif dir == 3: m = T.reorder(array, (3,2,1)) @@ -629,7 +629,7 @@ def refine(array, power, dir=0): b.append(i) else: b.append(refinePerDir__(i, power, dir)) return b - else: + else: if dir == 0: a2 = refinePerDir__(array, power, 1) a2 = refinePerDir__(a2, power, 2) @@ -658,7 +658,7 @@ def refinePerDir__(a, power, dir): NJ = nj; NK = nk - distribI = C.array('x,y,z', NI, NJ, NK) + distribI = C.array('x,y,z', NI, NJ, NK) vvI = 1./max(NI-1, 1.e-12) vvJ = 1./max(NJ-1, 1.e-12) vvK = 1./max(NK-1, 1.e-12) @@ -666,11 +666,11 @@ def refinePerDir__(a, power, dir): # Distribution fine a interpoler: cartesienne a pas constant par direction for k in range(NK): for j in range(NJ): - for i in range(NI): + for i in range(NI): ind = i + j*NI + k*NINJ distribI[1][0,ind] = i*vvI distribI[1][1,ind] = j*vvJ - distribI[1][2,ind] = k*vvK + distribI[1][2,ind] = k*vvK # Calcul de la distribution en i dhi = 1./max(ni-1, 1.e-12) @@ -707,7 +707,7 @@ def refinePerDir__(a, power, dir): def defineSizeMapForMMGs(array, hmax, sizeConstraints): import KCore; import Generator; import Transform if hmax > 0: array = C.initVars(array, 'sizemap=%f'%hmax) - else: + else: vol = Generator.getVolumeMap(array) vol = C.initVars(vol, '{vol}=(1.15*{vol})**0.5') vol = C.center2Node(vol) @@ -722,7 +722,7 @@ def defineSizeMapForMMGs(array, hmax, sizeConstraints): c = C.addVars([c,v]) hook = C.createHook(c, function='nodes') ret = C.nearestNodes(hook, array) - n = ret[0]; d = ret[1] + n = ret[0]; d = ret[1] pt = array[1] alpha = numpy.empty(d.size, dtype=numpy.float64) if isinstance(pt, list): alpha[:] = 0.3*d[:] / pt[pos,:] @@ -734,7 +734,7 @@ def defineSizeMapForMMGs(array, hmax, sizeConstraints): return array # Remaille une surface avec mmgs -def mmgs(array, ridgeAngle=45., hmin=0., hmax=0., hausd=0.01, grow=1.1, +def mmgs(array, ridgeAngle=45., hmin=0., hmax=0., hausd=0.01, grow=1.1, anisotropy=0, optim=0, fixedConstraints=[], sizeConstraints=[]): """Surface remeshing using MMGS.""" if isinstance(array[0], list): @@ -774,7 +774,7 @@ def mmgs(array, ridgeAngle=45., hmin=0., hmax=0., hausd=0.01, grow=1.1, array = defineSizeMapForMMGs(array, hmax, sizeConstraints) hmaxl = 1000. else: hmaxl = hmax - return generator.mmgs(array, ridgeAngle, hmin, hmaxl, hausd, + return generator.mmgs(array, ridgeAngle, hmin, hmaxl, hausd, grow, anisotropy, optim, fixedNodes, fixedEdges) #============================================================================== @@ -793,7 +793,7 @@ def densify(array, h): else: return generator.densify(array, h) -def hyper2D(array, arrayd, type, +def hyper2D(array, arrayd, type, eta_start=10, eta_end=-1, beta=0.0): """Generate an hyperbolic mesh. Usage: hyper2D(array, arrayd, type)""" @@ -868,9 +868,9 @@ def zip(array, tol=1e-12): Usage: zip(array, tol)""" if isinstance(array[0], list): extFaces = [] - try: + try: import Post as P - for a in array: + for a in array: if len(a) == 4: extFaces.append(P.exteriorFaces(a)) except: pass return generator.closeBorders(array, extFaces, tol) @@ -954,7 +954,7 @@ def TTM(array, niter=100): def bboxOfCells(array): """Return the bounding box of all cells of an array. Usage: getBBoxOfCells(array)""" - if isinstance(array[0], list): + if isinstance(array[0], list): b = [] for i in array: b.append(generator.bboxOfCells(i)) @@ -965,7 +965,7 @@ def bboxOfCells(array): def getCellPlanarity(array): """Return the cell planarity of a surface mesh in an array. Usage: getCellPlanarity(array)""" - if isinstance(array[0], list): + if isinstance(array[0], list): b = [] for i in array: b.append(generator.getCellPlanarity(i)) @@ -976,7 +976,7 @@ def getCellPlanarity(array): def getVolumeMap(array, method=0): """Return the volume map in an array. Usage: getVolumeMap(array, method)""" - if isinstance(array[0], list): + if isinstance(array[0], list): b = [] for i in array: b.append(generator.getVolumeMap(i, method)) @@ -997,7 +997,7 @@ def getCellCenters(array, fc, fa, own, nei): def getNormalMap(array): """Return the map of surface normals in an array. Usage: getNormalMap(array)""" - if isinstance(array[0], list): + if isinstance(array[0], list): b = [] for i in array: b.append(generator.getNormalMap(i)) @@ -1029,7 +1029,7 @@ def getSmoothNormalMap(array, niter=2, eps=0.4, cellN=None, algo=0): np = C.node2Center(n) np = C.normalize(np, ['sx','sy','sz']) - if cellN is not None: + if cellN is not None: fake = ['cellN',cellN[1],n[2],n[3]] np = C.addVars([np, fake]) generator.extrapWithCellN(array, np) @@ -1064,7 +1064,7 @@ def getEdgeRatio(array, dim=3): """Computes the ratio between the max and min lengths of all the edges of cells in an array. Usage: getEdgeRatio(a)""" - if isinstance(array[0], list): + if isinstance(array[0], list): b = [] for i in array: b.append(generator.getEdgeRatio(i, dim)) return b @@ -1076,7 +1076,7 @@ def getEdgeRatio(array, dim=3): def getMaxLength(array, dim=3): """Computes the max length of all the edges of cells in an array. Usage: getMaxLength(a)""" - if isinstance(array[0], list): + if isinstance(array[0], list): b = [] for i in array: b.append(generator.getMaxLength(i, dim)) return b @@ -1135,9 +1135,9 @@ def buildExtension(c, surfaces, dh, niter=0): #============================================================================== # Determines the factor h0 to multiply the hloc in the vicinity of sharp -# angles. +# angles. # IN : sn: normales a la surface s non structuree -# OUT: ht the amplification factor of h, the step in the marching direction +# OUT: ht the amplification factor of h, the step in the marching direction #============================================================================== def getLocalStepFactor__(s, sn, smoothType, nitLocal, kappaType, kappaS, algo): #import Transform @@ -1195,7 +1195,7 @@ def modifyNormalWithMetric(array, narray, algo=0, smoothType=0, eps=0.4, nitLoca def getCircumCircleMap(array): """Return the map of circum circle radius of any cell in a TRI array. Usage: getCircumCircleMap(array)""" - if isinstance(array[0], list): + if isinstance(array[0], list): b = [] for i in array: b.append(generator.getCircumCircleMap(i)) @@ -1206,16 +1206,16 @@ def getCircumCircleMap(array): def getInCircleMap(array): """Return the map of inscribed circle radius of any cell in a TRI array. Usage: getInCircleMap(array)""" - if isinstance(array[0], list): + if isinstance(array[0], list): b = [] for i in array: b.append(generator.getInCircleMap(i)) return b else: return generator.getInCircleMap(array) # -- Add normal layers to a surface -- -def addNormalLayers(surface, distrib, check=0, - niterType=0, niter=0, niterK=[], - smoothType=0, eps=0.4, nitLocal=3, +def addNormalLayers(surface, distrib, check=0, + niterType=0, niter=0, niterK=[], + smoothType=0, eps=0.4, nitLocal=3, kappaType=0, kappaS=[0.2,1.6], blanking=False, cellNs=[], algo=0): """Generate N layers to a surface following normals. distrib is the @@ -1286,7 +1286,7 @@ def createLevel(nb, level, ref): pmax = (ref[2], ref[3], nb) if ref[4]-2*nb < 3 or ref[3]-2*nb < 3 or ref[2]-2*nb < 3: print('Warning: number of points for level %d is too big: %d'%(level, nb)) - print('composite grid: %d %d %d.'%(ref[2],ref[3],ref[4])) + print('composite grid: %d %d %d.'%(ref[2],ref[3],ref[4])) return out out.append(createBlock(pmin, pmax, level, ref)) @@ -1353,7 +1353,7 @@ def createLevel(nb, level, ref): ty = ymax-ymin-Href*(Nj-1) tz = zmax-zmin-Href*(Nk-1) out = T.translate(out, (0.5*tx,0.5*ty,0.5*tz)) - return out + return out #------------------------------------------------------------------------------ # Split a i-array and map a distribution on the splitted i-array @@ -1368,14 +1368,14 @@ def mapSplit(array, dist, splitCrit=100., densMax=1000): else: return mapSplitStruct__(array, dist, splitCrit, densMax) elif len(array) == 4: # non structure - raise TypeError("mapSplit: requires a i-array.") + raise TypeError("mapSplit: requires a i-array.") else: - raise TypeError("mapSplit: requires a i-array.") + raise TypeError("mapSplit: requires a i-array.") # mapSplit pour un i-array structure def mapSplitStruct__(array, dist, splitCrit, densMax): import KCore - try: + try: import math import Transform as T import Geom as D @@ -1420,7 +1420,7 @@ def mapSplitStruct__(array, dist, splitCrit, densMax): for i in range(1,len(xa)): dxa = xa[i]-xa[i-1]; dya = ya[i]-ya[i-1]; dza = za[i]-za[i-1] - la = math.sqrt(dxa*dxa+dya*dya+dza*dza) *lti + la = math.sqrt(dxa*dxa+dya*dya+dza*dza) *lti if la < stepmin and la > 0.: stepmin = la if lt/stepmin > densMax: stepmin = lt/densMax # Densify array @@ -1466,7 +1466,7 @@ def T3mesher2D(a, grading=1.2, triangulateOnly=0, metricInterpType=0): except: return generator.T3mesher2D(a, grading, triangulateOnly, metricInterpType) -def tetraMesher(a, maxh=-1., grading=0.4, triangulateOnly=0, +def tetraMesher(a, maxh=-1., grading=0.4, triangulateOnly=0, remeshBoundaries=0, algo=1, optionString=""): """Create a TRI/TETRA mesh given a set of BAR or surfaces in a. Usage: tetraMesher(a, maxh, grading)""" @@ -1497,7 +1497,7 @@ def tetraMesher(a, maxh=-1., grading=0.4, triangulateOnly=0, else: # tetgen # find holes coords holes = [] - try: + try: import Transform as T sp = T.splitConnexity(a) for s in sp: @@ -1573,7 +1573,7 @@ def front2Hexa(a, surf, h, hf, hext, density=50): def front2Struct(front, surf, distrib, Vmin, dist): """Generate struct grids starting from a front, a surface surf, - and a point distribution.""" + and a point distribution.""" return generator.front2Struct(front, surf, distrib, Vmin, dist) def snapFront(meshes, surfaces, optimized=1): @@ -1634,7 +1634,7 @@ def refinedSharpEdges__(surfaces, step, angle): """Get refined sharp edges from a given surface. Usage: snapSharpEdges(meshes, surfaces)""" try: - import Post as P; import Geom as D + import Post as P; import Geom as D import Transform as T; from . import Generator as G except: raise ImportError("snapSharpEdges: requires Post, Geom, Converter, Transform module.") @@ -1663,7 +1663,7 @@ def refinedSharpEdges__(surfaces, step, angle): else: # 1D # get contours and corners from 1D-surfaces try: contours = T.splitConnexity(b) - except: contours = b + except: contours = b # split les contours par rapport aux angles try: contours = T.splitSharpEdges(contours, angle) except: pass @@ -1699,7 +1699,7 @@ def refinedSharpEdges__(surfaces, step, angle): return [b, contours, corners] def fillWithStruct(a, Vmin): - """Generates struct grids in quad mesh.""" + """Generates struct grids in quad mesh.""" return generator.fillWithStruct(a, Vmin) def octree2Struct(a, vmin=15, ext=0, optimized=1, merged=1, AMR=0, @@ -1739,7 +1739,7 @@ def octree2Struct(a, vmin=15, ext=0, optimized=1, merged=1, AMR=0, return cartzones # Decoupe un octant (octant) -# N multiple de 4 (2D) ou de 8 (3D) +# N multiple de 4 (2D) ou de 8 (3D) def cutOctant(octant, N, ind, dim=3): if dim == 2: M = N**0.5 @@ -1881,7 +1881,7 @@ def _forceMatch1(a1, a2, tol): indices1 = C.identifyNodes(hook, ext1) # identifie ext2 sur a2 - hook = C.createHook(a2, function='nodes') + hook = C.createHook(a2, function='nodes') indices2 = C.identifyNodes(hook, ext2) # match ext1 sur ext2 @@ -1897,7 +1897,7 @@ def _forceMatch1(a1, a2, tol): ext1[1][posz1,i] = ext2[1][posz2,ind2] a1[1][posx1,ind1] = ext2[1][posx2,ind2] a1[1][posy1,ind1] = ext2[1][posy2,ind2] - a1[1][posz1,ind1] = ext2[1][posz2,ind2] + a1[1][posz1,ind1] = ext2[1][posz2,ind2] # match ext2 sur ext1 hook = C.createHook(ext1, function='nodes') @@ -1909,7 +1909,7 @@ def _forceMatch1(a1, a2, tol): ind2 = indices2[i]-1 a2[1][posx2,ind2] = ext1[1][posx1,ind1] a2[1][posy2,ind2] = ext1[1][posy1,ind1] - a2[1][posz2,ind2] = ext1[1][posz1,ind1] + a2[1][posz2,ind2] = ext1[1][posz1,ind1] return None # Force match sur la bande delimitee par P1-P2 @@ -1926,12 +1926,12 @@ def _forceMatch2(a1, a2, P1, P2): hook = C.createHook(ext1, function='nodes') nodes,dist = C.nearestNodes(hook, Geom.point(P1)) ind1s1 = nodes[0]-1 - nodes,dist = C.nearestNodes(hook, Geom.point(P2)) + nodes,dist = C.nearestNodes(hook, Geom.point(P2)) ind2s1 = nodes[0]-1 hook = C.createHook(ext2, function='nodes') - nodes,dist = C.nearestNodes(hook, Geom.point(P1)) + nodes,dist = C.nearestNodes(hook, Geom.point(P1)) ind1s2 = nodes[0]-1 - nodes,dist = C.nearestNodes(hook, Geom.point(P2)) + nodes,dist = C.nearestNodes(hook, Geom.point(P2)) ind2s2 = nodes[0]-1 ext1 = Transform.splitBAR(ext1, ind1s1, ind2s1) ext2 = Transform.splitBAR(ext2, ind1s2, ind2s2) @@ -1948,13 +1948,13 @@ def _forceMatch2(a1, a2, P1, P2): dj = Geom.getLength(e2) bj = Generator.barycenter(e2) diff[i+n1*j] = abs(di-dj) - bary[i+n1*j] = (bi[0]-bj[0])**2+(bi[1]-bj[1])**2+(bi[2]-bj[2])**2 + bary[i+n1*j] = (bi[0]-bj[0])**2+(bi[1]-bj[1])**2+(bi[2]-bj[2])**2 ind = findBest(diff, bary) j = ind//n1; i = ind-j*n1 ext1 = ext1[i]; ext2 = ext2[j] C.convertArrays2File([ext1,ext2], 'exts.plt') - _forceMatch3(a1, a2, ext1, ext2) + _forceMatch3(a1, a2, ext1, ext2) return None # force match avec deux courbes en entree @@ -1974,7 +1974,7 @@ def _forceMatch3(a1, a2, ext1, ext2): indices1 = C.identifyNodes(hook, ext1) # identifie ext2 sur a2 - hook = C.createHook(a2, function='nodes') + hook = C.createHook(a2, function='nodes') indices2 = C.identifyNodes(hook, ext2) # match ext1 sur ext2 @@ -2009,24 +2009,24 @@ def _forceMatch(a1, a2=None, P1=None, P2=None, C1=None, C2=None, tol=-1): _forceMatch3(a1, a2, C1, C2) elif a2 is None and C1 is not None and C2 is not None: _forceMatch4(a1, C1, C2) - elif a2 is not None: + elif a2 is not None: _forceMatch1(a1, a2, tol) return None # addnormalLayers pour une liste d'arrays structures -def addNormalLayersStruct__(surfaces, distrib, check=0, niterType=0, niter=0, niterK=[], - smoothType=0, eps=0.4, nitLocal=3, +def addNormalLayersStruct__(surfaces, distrib, check=0, niterType=0, niter=0, niterK=[], + smoothType=0, eps=0.4, nitLocal=3, kappaType=0, kappaS=[0.2,1.6], blanking=False, cellNs=[], algo=0): import KCore try: import Transform as T; import Generator as G - except: raise ImportError("addNormalLayers: requires Converter, Transform modules.") + except: raise ImportError("addNormalLayers: requires Converter, Transform modules.") kmax = distrib[1].shape[1] # nb of layers in the normal direction if kmax < 2: raise ValueError("addNormalLayers: distribution must contain at least 2 points.") vect = ['sx','sy','sz'] - # verifications + # verifications for nos, surfs in enumerate(surfaces): if surfs[4] != 1: raise ValueError("addNormalLayers: structured surface must be k=1.") if surfs[3] == 1: surfaces[nos] = T.addkplane(surfs) @@ -2109,7 +2109,7 @@ def addNormalLayersStruct__(surfaces, distrib, check=0, niterType=0, niter=0, ni vol0 = getVolumeMap(surfu) vol0 = C.center2Node(vol0) h0 = distrib[1][0,1]-distrib[1][0,0] - if kappaType == 2: + if kappaType == 2: vol = getVolumeMap(surfu) vol = C.center2Node(vol) if niter == 0: @@ -2131,11 +2131,11 @@ def addNormalLayersStruct__(surfaces, distrib, check=0, niterType=0, niter=0, ni n = C.normalize(n, vect) n, epsl = modifyNormalWithMetric(surfu, n, algo=1, smoothType=smoothType, eps=eps, nitLocal=nitLocal, kappaType=kappaType, kappaS=kappaS) if niterType == 0: niterl = niter - elif niterType == 1: niterl = niter*(1.+C.getMaxValue(epsl, 'hl')/eps) + elif niterType == 1: niterl = niter*(1.+C.getMaxValue(epsl, 'hl')/eps) else: if k1 < niterK[0]: niterl = k1*1./niterK[0]*niter elif k1 < niterK[1]: niterl = niter - else: niterl = max(niter + niter*(niterK[1]-k1)/(niterK[2]-niterK[1]),0) + else: niterl = max(niter + niter*(niterK[1]-k1)/(niterK[2]-niterK[1]),0) print('%d: niter=%d'%(k1,niterl)) n = getSmoothNormalMap(surfu, niter=niterl, eps=epsl[1], algo=1) else: @@ -2144,7 +2144,7 @@ def addNormalLayersStruct__(surfaces, distrib, check=0, niterType=0, niter=0, ni else: if k1 < niterK[0]: niterl = k1*1./niterK[0]*niter elif k1 < niterK[1]: niterl = niter - else: niterl = max(niter + niter*(niterK[1]-k1)/(niterK[2]-niterK[1]),0) + else: niterl = max(niter + niter*(niterK[1]-k1)/(niterK[2]-niterK[1]),0) print('%d: niter=%d'%(k1,niterl)) n = getSmoothNormalMap(surfu, niter=niterl, eps=epsl[1], algo=1) n, epsl = modifyNormalWithMetric(surfu, n, algo=1, smoothType=smoothType, eps=eps, nitLocal=nitLocal, kappaType=kappaType, kappaS=kappaS) @@ -2233,11 +2233,11 @@ def addNormalLayersStruct__(surfaces, distrib, check=0, niterType=0, niter=0, ni return listOfCoords # addNormalLayers pour un array non structure -def addNormalLayersUnstr__(surface, distrib, check=0, niterType=0, niter=0, niterK=[], - smoothType=0, eps=0.4, nitLocal=3, +def addNormalLayersUnstr__(surface, distrib, check=0, niterType=0, niter=0, niterK=[], + smoothType=0, eps=0.4, nitLocal=3, kappaType=0, kappaS=[0.2,1.6], blanking=False, cellNs=[], algo=0): try: import Transform as T; import KCore - except: raise ImportError("addNormalLayers: requires Converter, Transform modules.") + except: raise ImportError("addNormalLayers: requires Converter, Transform modules.") if isinstance(surface[0], list): surf = T.join(surface) else: surf = surface surf = close(surf); surf = T.reorder(surf, (1,)) @@ -2293,7 +2293,7 @@ def addNormalLayersUnstr__(surface, distrib, check=0, niterType=0, niter=0, nite np, epsl = modifyNormalWithMetric(surf, n, algo=0, eps=eps) if kmax == 2: beta0 = 0.1 else: beta0 = float((kmax-2-k1))/float(kmax-2); beta0 = beta0*beta0 - n[1] = (1-beta0)*n[1] + beta0 *np[1] + n[1] = (1-beta0)*n[1] + beta0 *np[1] else: # algo=1 (nouvelle version) if k1 == 0 and kappaType == 2: vol = getVolumeMap(surf) if niter == 0: @@ -2324,7 +2324,7 @@ def addNormalLayersUnstr__(surface, distrib, check=0, niterType=0, niter=0, nite else: if k1 < niterK[0]: niterl = k1*1./niterK[0]*niter elif k1 < niterK[1]: niterl = niter - else: niterl = max(niter + niter*(niterK[1]-k1)/(niterK[2]-niterK[1]),0) + else: niterl = max(niter + niter*(niterK[1]-k1)/(niterK[2]-niterK[1]),0) print('%d: niter=%d'%(k1,niterl)) n = getSmoothNormalMap(surf, niter=niterl, eps=epsl[1], cellN=cellN, algo=1) else: @@ -2333,7 +2333,7 @@ def addNormalLayersUnstr__(surface, distrib, check=0, niterType=0, niter=0, nite else: if k1 < niterK[0]: niterl = k1*1./niterK[0]*niter elif k1 < niterK[1]: niterl = niter - else: niterl = max(niter + niter*(niterK[1]-k1)/(niterK[2]-niterK[1]),0) + else: niterl = max(niter + niter*(niterK[1]-k1)/(niterK[2]-niterK[1]),0) print('%d: niter=%d'%(k1,niterl)) n = getSmoothNormalMap(surf, niter=niterl, eps=epsl[1], cellN=cellN, algo=1) n, epsl = modifyNormalWithMetric(surf, n, algo=1, smoothType=smoothType, eps=eps, nitLocal=nitLocal, kappaType=kappaType, kappaS=kappaS) @@ -2376,10 +2376,10 @@ def addNormalLayersUnstr__(surface, distrib, check=0, niterType=0, niter=0, nite else: m = T.join(m, a) if blanking: - if k1 == 0: cellNs.append(cellN) + if k1 == 0: cellNs.append(cellN) else: op = ['cellN', None, m[2], cellN[3]] - op[1] = numpy.concatenate((cellNs[0][1], cellN[1]), axis=1) + op[1] = numpy.concatenate((cellNs[0][1], cellN[1]), axis=1) cellNs[0] = op #C.convertArrays2File([a,m], 'check.plt') #generator.blankPrev(a, cellN, m, op) @@ -2390,7 +2390,7 @@ def addNormalLayersUnstr__(surface, distrib, check=0, niterType=0, niter=0, nite def getOrthogonalityMap(array): """Return the orthogonality map in an array. Usage: getOrthogonalityMap(array)""" - if isinstance(array[0], list): + if isinstance(array[0], list): b = [] for i in array: b.append(generator.getOrthogonalityMap(i)) @@ -2421,12 +2421,12 @@ def getAngleRegularityMap(array): else: return generator.getAngleRegularityMap(array) -# Fonction retournant la carte de qualite d'une maillage TRI +# Fonction retournant la carte de qualite d'une maillage TRI # (0. pour un triangle degenere. pour un triangle equilateral) def getTriQualityMap(array): """Return a TRI quality measure map in an array. Usage: getTriQualityMap(array)""" - if isinstance(array[0], list): + if isinstance(array[0], list): b = [] for i in array: b.append(generator.getTriQualityMap(i)) @@ -2434,7 +2434,7 @@ def getTriQualityMap(array): else: return generator.getTriQualityMap(array) -# Fonction retournant les qualites min, max et mean d'un maillage TRI +# Fonction retournant les qualites min, max et mean d'un maillage TRI # (0. pour un triangle degenere, 1. pour un triangle equilateral) def getTriQualityStat(array): """Return the orthogonality stats (min, max and mean) in aTRI mesh. @@ -2448,7 +2448,7 @@ def getTriQualityStat(array): #------------------------------------------------------------------------------ # Genere des pyramides ayant pour base les QUAD d'une surface donnee #------------------------------------------------------------------------------ -def quad2Pyra(array, hratio = 1.): +def quad2Pyra(array, hratio=1.): """Create a set of pyramids from a set of quads. Usage: quad2Pyra(array, hratio)""" return generator.quad2Pyra(array, hratio) @@ -2467,7 +2467,7 @@ def getMeshFieldInfo(array, field, critValue, verbose): f = DictFunction[field](m)[1] size_loc = numpy.size(f) - fcrit_loc = numpy.count_nonzero(fcritValue) + fcrit_loc = numpy.count_nonzero(fcritValue) fmin_loc = numpy.min(f) fmax_loc = numpy.max(f) fsum_loc = numpy.sum(f) @@ -2491,7 +2491,7 @@ def getMeshFieldInfo(array, field, critValue, verbose): def checkMesh(array, critVol=0., critOrtho=15., critReg=0.1, critAngReg=15., addGC=False, verbose=0): """Return information on mesh quality.""" - if not isinstance(array[0], list): array = [array] + if not isinstance(array[0], list): array = [array] #addGC: dummy argument to match the pyTree function diff --git a/Cassiopee/Generator/Generator/IBM.py b/Cassiopee/Generator/Generator/IBM.py index b0b5c8f21..26cdc931f 100644 --- a/Cassiopee/Generator/Generator/IBM.py +++ b/Cassiopee/Generator/Generator/IBM.py @@ -119,9 +119,9 @@ def adaptIBMMesh(t, tb, vmin, sensor, factor=1.2, DEPTH=2, sizeMax=4000000, return t2 def generateIBMMesh_legacy(tb, vmin=15, snears=0.01, dfar=10., dfarList=[], DEPTH=2, tbox=None, - snearsf=None, check=False, sizeMax=4000000, - externalBCType='BCFarfield', to=None, - fileo=None, expand=2, dfarDir=0, octreeMode=0): + snearsf=None, check=False, sizeMax=4000000, + externalBCType='BCFarfield', to=None, + fileo=None, expand=2, dfarDir=0, octreeMode=0): dimPb = Internal.getNodeFromName(tb, 'EquationDimension') if dimPb is None: raise ValueError('generateIBMMesh: EquationDimension is missing in input body tree.') dimPb = Internal.getValue(dimPb) @@ -129,7 +129,7 @@ def generateIBMMesh_legacy(tb, vmin=15, snears=0.01, dfar=10., dfarList=[], DEPT # type de traitement paroi: pts interieurs ou externes model = Internal.getNodeFromName(tb, 'GoverningEquations') if model is None: raise ValueError('generateIBMMesh: GoverningEquations is missing in input body tree.') - # check Euler non consistant avec Musker + # check Euler non consistant avec Musker if Internal.getValue(model) == 'Euler': for z in Internal.getZones(tb): @@ -260,8 +260,8 @@ def _addBCsForSymmetry(t, bbox=None, dimPb=3, dir_sym=0, X_SYM=0., depth=2): y2 = C.getValue(zp,'CoordinateY',indM) z2 = C.getValue(zp,'CoordinateZ',indM) # blocs interieurs - tt en overlap - if (x1 > xmin-EPSCART and y1 > ymin-EPSCART and z1 > zmin-EPSCART and - x2 < xmax+EPSCART and y2 < ymax+EPSCART and z2 < zmax+EPSCART): + if (x1 > xmin-EPSCART and y1 > ymin-EPSCART and z1 > zmin-EPSCART and + x2 < xmax+EPSCART and y2 < ymax+EPSCART and z2 < zmax+EPSCART): C._fillEmptyBCWith(zp, 'overlap','BCOverlap',dim=dimPb) else: # blocs frontieres irange = None @@ -269,14 +269,14 @@ def _addBCsForSymmetry(t, bbox=None, dimPb=3, dir_sym=0, X_SYM=0., depth=2): # ajout des CL physiques sur ghost cells t_imin = False; t_imax = False; t_jmin = False; t_jmax = False; t_kmin = False; t_kmax = False if dir_sym==1: - if x1xmax-EPSCART: iew = niz-depth t_imax = True - C._addBC2Zone(zp,'nref','BCFarfield','imax') + C._addBC2Zone(zp,'nref','BCFarfield','imax') if y1 zmax+EPSCART: kew = nkz-depth t_kmax = True C._addBC2Zone(zp,'nref','BCFarfield','kmax') elif dir_sym==2: - if y1ymax-EPSCART: jew = njz-depth t_jmax = True - C._addBC2Zone(zp,'nref','BCFarfield','jmax') + C._addBC2Zone(zp,'nref','BCFarfield','jmax') if x1 zmax+EPSCART: kew = nkz-depth t_kmax = True C._addBC2Zone(zp,'nref','BCFarfield','kmax') elif dir_sym==3: - if z1zmax-EPSCART: kew = nkz-depth t_kmax = True - C._addBC2Zone(zp,'nref','BCFarfield','kmax') + C._addBC2Zone(zp,'nref','BCFarfield','kmax') if x1ymax+EPSCART: jew = njz-depth t_jmax = True - C._addBC2Zone(zp,'nref','BCFarfield','jmax') + C._addBC2Zone(zp,'nref','BCFarfield','jmax') if not t_jmin: C._addBC2Zone(zp,'overlap','BCOverlap',[isw, iew, jsw, jsw, ksw, kew]) @@ -359,7 +359,7 @@ def _addBCsForSymmetry(t, bbox=None, dimPb=3, dir_sym=0, X_SYM=0., depth=2): if not t_kmin and dimPb==3: C._addBC2Zone(zp,'overlap','BCOverlap',[isw, iew, jsw, jew, ksw, ksw]) if not t_kmax and dimPb==3: - C._addBC2Zone(zp,'overlap','BCOverlap',[isw, iew, jsw, jew, kew, kew]) + C._addBC2Zone(zp,'overlap','BCOverlap',[isw, iew, jsw, jew, kew, kew]) return None @@ -371,7 +371,7 @@ def _addBCsForSymmetry(t, bbox=None, dimPb=3, dir_sym=0, X_SYM=0., depth=2): # vmin (int): number of points for each octree level # snears (float or list of floats): minimum cell spacing(s) near the bodies # dfars (float or list of floats): extent of the domain from the bodies -# dfarDir (int): +# dfarDir (int): # tbox (tree): refinement bodies # snearsf (float or list of floats) cell spacing(s) to impose inside the refinement bodies # check (boolean): if True: write octree.cgns locally @@ -447,7 +447,7 @@ def octree2StructLoc__(o, parento=None, vmin=15, ext=0, optimized=0, sizeMax=4e6 c += 1 ## Rectilinear mesh modifications - listSavetbOneOver = [] + listSavetbOneOver = [] if tbOneOver: tzones = G.BB(zones) if dimPb==2: @@ -495,7 +495,7 @@ def octree2StructLoc__(o, parento=None, vmin=15, ext=0, optimized=0, sizeMax=4e6 for zTmp in sublist: zAdd=Internal.getNodeFromNameAndType(zones,zTmp,'Zone_t') if zAdd is not None: - listSavetbOneOverZonesTmp.append(Internal.copyTree(zAdd)) + listSavetbOneOverZonesTmp.append(Internal.copyTree(zAdd)) Internal._rmNode(zones, zAdd) listSavetbOneOverZones.append(listSavetbOneOverZonesTmp) @@ -650,12 +650,12 @@ def octree2StructLoc__(o, parento=None, vmin=15, ext=0, optimized=0, sizeMax=4e6 return zones # only in generateIBMMesh and generateIBMMesh -def buildParentOctrees__(o, tb, dimPb=3, vmin=15, snears=0.01, snearFactor=1., dfars=10., dfarDir=0, +def buildParentOctrees__(o, tb, dimPb=3, vmin=15, snears=0.01, snearFactor=1., dfars=10., dfarDir=0, tbox=None, snearsf=None, to=None, octreeMode=0): nzones0 = Internal.getZoneDim(o)[2] if nzones0 < 1000: return None - parento = buildOctree(tb, dimPb=dimPb, vmin=vmin, snears=snears, snearFactor=snearFactor, dfars=dfars, dfarDir=dfarDir, + parento = buildOctree(tb, dimPb=dimPb, vmin=vmin, snears=snears, snearFactor=snearFactor, dfars=dfars, dfarDir=dfarDir, tbox=tbox, snearsf=snearsf, to=to, expand=-1, balancing=0, octreeMode=octreeMode) bbo = G.bbox(parento) @@ -690,12 +690,12 @@ def buildParentOctrees__(o, tb, dimPb=3, vmin=15, snears=0.01, snearFactor=1., d return OCTREEPARENTS # main function -def generateIBMMesh(tb, dimPb=3, vmin=15, snears=0.01, dfars=10., dfarDir=0, +def generateIBMMesh(tb, dimPb=3, vmin=15, snears=0.01, dfars=10., dfarDir=0, tbox=None, snearsf=None, check=False, to=None, ext=2, expand=3, octreeMode=0): """Generates the full Cartesian mesh for IBMs.""" import KCore.test as test - # refinementSurfFile: surface meshes describing refinement zones + # refinementSurfFile: surface meshes describing refinement zones if tbox is not None: if isinstance(tbox, str): tbox = C.convertFile2PyTree(tbox) else: tbox = tbox @@ -722,13 +722,13 @@ def generateIBMMesh(tb, dimPb=3, vmin=15, snears=0.01, dfars=10., dfarDir=0, else: o = Internal.getZones(to)[0] parento = None - else: - o = buildOctree(tb, dimPb=dimPb, vmin=vmin, snears=snears, snearFactor=1., dfars=dfars, dfarDir=dfarDir, + else: + o = buildOctree(tb, dimPb=dimPb, vmin=vmin, snears=snears, snearFactor=1., dfars=dfars, dfarDir=dfarDir, tbox=tbox, snearsf=snearsf, to=to, expand=expand, octreeMode=octreeMode) # build parent octree 3 levels higher # returns a list of 4 octants of the parent octree in 2D and 8 in 3D - parento = buildParentOctrees__(o, tb, dimPb=dimPb, vmin=vmin, snears=snears, snearFactor=4., dfars=dfars, dfarDir=dfarDir, + parento = buildParentOctrees__(o, tb, dimPb=dimPb, vmin=vmin, snears=snears, snearFactor=4., dfars=dfars, dfarDir=dfarDir, tbox=tbox, snearsf=snearsf, to=to, octreeMode=octreeMode) # adjust the extent of the box defining the symmetry plane if in tb @@ -744,7 +744,7 @@ def generateIBMMesh(tb, dimPb=3, vmin=15, snears=0.01, dfars=10., dfarDir=0, coordsym = 'CoordinateX'; dir_sym=1; X_SYM = xmin elif abs(ymax-ymin) < 1e-6: coordsym = 'CoordinateY'; dir_sym=2; X_SYM = ymin - elif abs(zmax-zmin)<1e-6: + elif abs(zmax-zmin)<1e-6: coordsym = 'CoordinateZ'; dir_sym=3; X_SYM = zmin if octreeMode==1: @@ -752,21 +752,21 @@ def generateIBMMesh(tb, dimPb=3, vmin=15, snears=0.01, dfars=10., dfarDir=0, [xmin,ymin,zmin,xmax,ymax,zmax] = G.bbox(o) L = 0.5*(xmax+xmin); eps = 0.2*L xmin = xmin-eps; ymin = ymin-eps; zmin = zmin-eps - xmax = xmax+eps; ymax = ymax+eps; zmax = zmax+eps + xmax = xmax+eps; ymax = ymax+eps; zmax = zmax+eps if dir_sym==1: xmax=X_SYM elif dir_sym==2: ymax=X_SYM elif dir_sym==3: zmax = X_SYM a = D.box((xmin,ymin,zmin),(xmax,ymax,zmax)) C._initVars(a,'{centers:cellN}=({centers:%s}>-1e-8)'%coordsym) baseSYM[2]+=a - else: pass + else: pass if coordsym is not None: to = C.newPyTree(["OCTREE",o]) bodies = [Internal.getZones(baseSYM)] - BM2 = numpy.ones((2,1),dtype=Internal.E_NpyInt) + BM2 = numpy.ones((2,1),dtype=Internal.E_NpyInt) to = X.blankCellsTri(to, bodies, BM2, blankingType='center_in', cellNName='cellN') to = P.selectCells(to,'{centers:cellN}>0.') - o = Internal.getZones(to)[0] + o = Internal.getZones(to)[0] if Cmpi.rank==0 and check: C.convertPyTree2File(o, 'octree.cgns') @@ -809,10 +809,10 @@ def generateIBMMesh(tb, dimPb=3, vmin=15, snears=0.01, dfars=10., dfarDir=0, Cmpi._addXZones(t, graph, variables=[], cartesian=True) # Turn Cartesian grid into a rectilinear grid - test.printMem(">>> cart grids --> rectilinear grids [start]") + test.printMem(">>> cart grids --> rectilinear grids [start]") listDone = [] if tbOneOver: - test.printMem(">>> cart grids --> rectilinear grids [inside]") + test.printMem(">>> cart grids --> rectilinear grids [inside]") tbb = G.BB(t) if dimPb==2: @@ -852,16 +852,16 @@ def generateIBMMesh(tb, dimPb=3, vmin=15, snears=0.01, dfars=10., dfarDir=0, if z not in listDone: zLocal = Internal.getNodeFromName(t,z) T._oneovern(zLocal, (oneoverX,oneoverY,oneoverZ)); - listDone.append(z) + listDone.append(z) del tzones2 - test.printMem(">>> cart grids --> rectilinear grids [end]") + test.printMem(">>> cart grids --> rectilinear grids [end]") zones = Internal.getZones(t) coords = C.getFields(Internal.__GridCoordinates__, zones, api=2) if symmetry==0: extBnd = 0 - else: extBnd = ext-1 # nb de ghost cells = ext-1 + else: extBnd = ext-1 # nb de ghost cells = ext-1 coords, rinds = Generator.extendCartGrids(coords, ext=ext, optimized=1, extBnd=extBnd) C.setFields(coords, zones, 'nodes') for noz in range(len(zones)): @@ -893,7 +893,7 @@ def generateIBMMesh(tb, dimPb=3, vmin=15, snears=0.01, dfars=10., dfarDir=0, # snears (float or list of floats): minimum cell spacing(s) near the bodies # snearFactor (float): snear multiplicator # dfars (float or list of floats): extent of the domain from the bodies -# dfarDir (int): +# dfarDir (int): # tbox (tree): refinement bodies # snearsf (float or list of floats) cell spacing(s) to impose inside the refinement bodies # to (tree): input octree if already created @@ -928,7 +928,7 @@ def addRefinementZones__(o, tb, tbox, snearsf, vmin, dim): sdd = Internal.getNodeFromName1(s, ".Solver#define") if sdd is not None: snearl = Internal.getNodeFromName1(sdd, "snear") - if snearl is not None: + if snearl is not None: snearl = Internal.getValue(snearl) snearsf.append(snearl*(vmin-1)) @@ -959,7 +959,7 @@ def addRefinementZones__(o, tb, tbox, snearsf, vmin, dim): fact = 1.1 while C.getMinValue(to, 'centers:cellN') == 1 and fact < 10.: print("Info: addRefinementZones: tbox too small - increase tbox by fact = %2.1f"%(fact)) - box2 = T.scale(box, fact) + box2 = T.scale(box, fact) tboxl[2][1][2] = box2 to = X_IBM.blankByIBCBodies(to, tboxl, 'centers', 3) fact += 0.1 @@ -980,7 +980,7 @@ def addRefinementZones__(o, tb, tbox, snearsf, vmin, dim): return Internal.getNodeFromType2(to, 'Zone_t') -def buildOctree(tb, dimPb=3, vmin=15, snears=0.01, snearFactor=1., dfars=10., dfarDir=0, +def buildOctree(tb, dimPb=3, vmin=15, snears=0.01, snearFactor=1., dfars=10., dfarDir=0, tbox=None, snearsf=None, to=None, balancing=2, expand=2, octreeMode=0): """Builds an octree from the surface definitions.""" @@ -1008,7 +1008,7 @@ def buildOctree(tb, dimPb=3, vmin=15, snears=0.01, snearFactor=1., dfars=10., df else: if len(bodies) != len(snears): raise ValueError('buildOctree: Number of bodies is not equal to the size of snears.') - dxmin0 = 1.e10 + dxmin0 = 1.e10 for c, z in enumerate(bodies): if dfarList[c] > -1: #body snear is only considered if dfar_loc > -1 dhloc = snears[c]*(vmin-1)*snearFactor @@ -1125,14 +1125,14 @@ def buildOctree(tb, dimPb=3, vmin=15, snears=0.01, snearFactor=1., dfars=10., df return o #============================================================================== -# +# #============================================================================== def createRefinementBodies(tb, dimPb=3, hmod=0.01, pointsPerUnitLength=None): """Creates refinement bodies from the immersed boundaries to extend the finest resolution in the fluid domain.""" import Geom.IBM as D_IBM import Geom.Offset as O - if pointsPerUnitLength is None: + if pointsPerUnitLength is None: print("Info: createRefinementBodies: pointsPerUnitLength is None, using default values (25 for 3D or 1000 for 2D).") pointsPerUnitLength = 25 if dimPb == 3 else 1000 @@ -1187,7 +1187,7 @@ def _projectMeshSize(t, NPas=10, span=1, dictNz=None, isCartesianExtrude=False): NPTS = numpy.zeros(NP, dtype=Internal.E_NpyInt) NCELLS = numpy.zeros(NP, dtype=Internal.E_NpyInt) NPTS_noghost = numpy.zeros(NP, dtype=Internal.E_NpyInt) - NCELLS_noghost = numpy.zeros(NP, dtype=Internal.E_NpyInt) + NCELLS_noghost = numpy.zeros(NP, dtype=Internal.E_NpyInt) if isinstance(t, str): h = Filter.Handle(t) t = h.loadFromProc(loadVariables=False) @@ -1214,14 +1214,14 @@ def _projectMeshSize(t, NPas=10, span=1, dictNz=None, isCartesianExtrude=False): NPTS = Cmpi.allreduce(NPTS ,op=Cmpi.SUM) NCELLS = Cmpi.allreduce(NCELLS,op=Cmpi.SUM) NPTS_noghost = Cmpi.allreduce(NPTS_noghost ,op=Cmpi.SUM) - NCELLS_noghost = Cmpi.allreduce(NCELLS_noghost,op=Cmpi.SUM) + NCELLS_noghost = Cmpi.allreduce(NCELLS_noghost,op=Cmpi.SUM) if rank ==0: print('Projected mesh size with ghost: {} million points & {} million cells'.format(numpy.sum(NPTS)/1.e6,numpy.sum(NCELLS)/1.e6)) print('Projected mesh size without ghost: {} million points & {} million cells'.format(numpy.sum(NPTS_noghost)/1.e6,numpy.sum(NCELLS_noghost)/1.e6)) return None def extrudeCartesianZDir(t, tb, check=False, extrusion="cart", dz=0.01, NPas=10, span=1 , Ntranche=1, - dictNz=None, ific=2, isCartesianExtrude=False, isAutoPeriodic=False, nghost=0): + dictNz=None, ific=2, isCartesianExtrude=False, isAutoPeriodic=False, nghost=0): """Extrudes a 2D IBM grid and geoemtry. The extraction is done in the z-direction. Usage: extrudeCartesianZDir(t, tb, check, extrusion, dz, NPas, span, Ntranche, dictNz, ific, isCartesianExtrude, isAutoPeriodic, nghost)""" @@ -1236,7 +1236,7 @@ def extrudeCartesianZDir(t, tb, check=False, extrusion="cart", dz=0.01, NPas=10, ## Found in original function. Commented here as it is related to interpolations ## and not geometric extrusion. This functionality is now in Connector/IBM.py - it is has been ## deemed to be a more appropriate location. - #for z in Internal.getZones(t): + #for z in Internal.getZones(t): # cellN = Internal.getNodeFromName(z, "cellN")[1] # sh = numpy.shape(cellN) # # modif CellN pour filtrer les cellule solide de l'interp chimere @@ -1249,7 +1249,7 @@ def extrudeCartesianZDir(t, tb, check=False, extrusion="cart", dz=0.01, NPas=10, #Dim = 3D c = 0 for tree in [t,tb]: - for dim in Internal.getNodesFromName(tree,'EquationDimension'): dim[1]=3 + for dim in Internal.getNodesFromName(tree,'EquationDimension'): dim[1]=3 dz_loc={}; Nk={} if c ==0: @@ -1268,9 +1268,9 @@ def extrudeCartesianZDir(t, tb, check=False, extrusion="cart", dz=0.01, NPas=10, NPas_local = int(round(span/h)) if NPas_local<4: print("WARNING:: Zone %s has Nz=%d and is being clipped to Nz=4"%(z[0],NPas_local)) - NPas_local=4 + NPas_local=4 Nk[z[0]] = NPas_local - dz_loc[z[0]] = span/float(Ntranche*Nk[z[0]]) + dz_loc[z[0]] = span/float(Ntranche*Nk[z[0]]) if Nk[z[0]] < Nk_min: Nk_min =Nk[z[0]] else: for z in Internal.getZones(tree): @@ -1281,7 +1281,7 @@ def extrudeCartesianZDir(t, tb, check=False, extrusion="cart", dz=0.01, NPas=10, for z in Internal.getZones(tree): Nk[z[0]] += 2*ific-1+c # -1, for the mesh (already added in the mesh generation) || need to remove this as it is not the case for the geometry (tb) - for z in Internal.getZones(tree): + for z in Internal.getZones(tree): yy_2d = Internal.getNodeFromName(z, "CoordinateY")[1] zz_2d = Internal.getNodeFromName(z, "CoordinateZ")[1] sh_2d = numpy.shape(yy_2d) @@ -1319,7 +1319,7 @@ def extrudeCartesianZDir(t, tb, check=False, extrusion="cart", dz=0.01, NPas=10, if c==1: break c += 1 - for z in Internal.getZones(tree): + for z in Internal.getZones(tree): zdim = Internal.getValue(z) # Modif rind cellule GH en kmin et kmax @@ -1329,10 +1329,10 @@ def extrudeCartesianZDir(t, tb, check=False, extrusion="cart", dz=0.01, NPas=10, BCs = Internal.getNodesFromType(z, "BC_t") for bc in BCs: ptrg = Internal.getNodeFromName(bc, "PointRange")[1] - ptrg[2,0] = 3 + ptrg[2,0] = 3 ptrg[2,1] = Nk[z[0]] - ##Periodic boundary conditions in k direction + ##Periodic boundary conditions in k direction if not isAutoPeriodic: # Creatioon connectivite perio dans t for idir in ['_kmax','_kmin']: @@ -1353,7 +1353,7 @@ def extrudeCartesianZDir(t, tb, check=False, extrusion="cart", dz=0.01, NPas=10, trans = perio else: angle = perio - trans = 0. + trans = 0. Conn = Internal.getNodeFromName(z, "ZoneGridConnectivity") name = 'match_'+z[0]+idir @@ -1389,7 +1389,7 @@ def extrudeCartesianZDir(t, tb, check=False, extrusion="cart", dz=0.01, NPas=10, Units=['Kilogram','Meter','Second','Kelvin','Radian'] Internal.createUniqueChild(rot ,'DimensionalUnits' ,'DimensionalUnits_t',Units) - if isAutoPeriodic: + if isAutoPeriodic: for node in Internal.getNodesFromName(t,'EquationDimension'): Internal.setValue(node,3) for z in Internal.getZones(t): C._addBC2Zone(z, z[0]+'periodKmin', 'BCautoperiod', 'kmin') @@ -1398,16 +1398,16 @@ def extrudeCartesianZDir(t, tb, check=False, extrusion="cart", dz=0.01, NPas=10, for bc in BCs: if Internal.getValue(bc)=='BCautoperiod': ptrg = Internal.getNodeFromName(bc, "PointRange")[1] - ptrg[0,0] = 3 + ptrg[0,0] = 3 ptrg[0,1] = ptrg[0,1]-2 - ptrg[1,0] = 3 + ptrg[1,0] = 3 ptrg[1,1] = ptrg[1,1]-2 if extrusion == 'cyl': T._cart2Cyl(t, (0,0,0),(1,0,0)) - T._cart2Cyl(tb, (0,0,0),(1,0,0)) - X_IBM._redispatch__(t=t) + T._cart2Cyl(tb, (0,0,0),(1,0,0)) + X_IBM._redispatch__(t=t) return t, tb def checkCartesian(t, nghost=0): @@ -1474,7 +1474,7 @@ def _dist2wallNearBody__(t, tb, type='ortho', signed=0, dim=3, loc='centers', mo tbBB=G.BB(tb) ##PRT1 - Zones flagged by the intersection of the bounding boxes of t and tb - interDict = X.getIntersectingDomains(tBB, tbBB) + interDict = X.getIntersectingDomains(tBB, tbBB) zt = [] zt_names = [] for i in interDict: @@ -1490,14 +1490,14 @@ def _dist2wallNearBody__(t, tb, type='ortho', signed=0, dim=3, loc='centers', mo list_additional_zones = getZonesScaleUpDown__(tbBB,tBB,zt_names,dim=dim) ##PRT2 - if list_additional_zones: + if list_additional_zones: zt=[] for i in list_additional_zones: zt.append(Internal.getNodeByName(t,i)) DTW._distance2Walls(zt, tb, type=type, signed=signed, dim=dim, loc=loc) else: - DTW._distance2Walls(t, tb, type=type, signed=signed, dim=dim, loc=loc) + DTW._distance2Walls(t, tb, type=type, signed=signed, dim=dim, loc=loc) return None @@ -1512,7 +1512,7 @@ def getZonesScaleUpDown__(tbBB, tBB, zt_names, diff_percent=0.15, sweep_num=4, s list_additional_zones=[] list_additional_zonesCGNSFile=[] for i in range(1, sweep_num+1): - if scaleDirection >= 0: + if scaleDirection >= 0: tbBB_scale = T.scale(tbBB, factor=(1.0+i*diff_percent,1.0+i*diff_percent,1.0+i*diff_percentz)) _add2listAdditionalZones__(list_additional_zones,tbBB_scale,tBB,mean_tb,zt_names) if scaleDirection<=0: @@ -1538,5 +1538,5 @@ def _add2listAdditionalZones__(list_additional_zones, tbBB_scale, tBB, mean_tb, for i in interDict_scale: if interDict_scale[i] and i not in list_additional_zones and i not in zt_names: list_additional_zones.append(i) - count += 1 + count += 1 return None diff --git a/Cassiopee/Generator/Generator/IBMmodelHeight.py b/Cassiopee/Generator/Generator/IBMmodelHeight.py index 926628c91..a6b3e0dbe 100644 --- a/Cassiopee/Generator/Generator/IBMmodelHeight.py +++ b/Cassiopee/Generator/Generator/IBMmodelHeight.py @@ -25,7 +25,7 @@ def compute_Cf(Re, Cf_law='ANSYS'): #============================================================================= # Compute the corresponding yplus of a given modeling height -#============================================================================= +#============================================================================= def computeYplus(Re, Cf_law='ANSYS', height=0.1, L=1.): h0 = (L*numpy.sqrt(2))/(Re*numpy.sqrt(compute_Cf(Re,Cf_law))) return height/h0 @@ -56,7 +56,7 @@ def computeYplusOpt(Re=None,tb=None,Lref=1.,q=1.2,snear=None,Cf_law='ANSYS'): else: Re = Internal.getValue(Re) else: fail = 1 - if fail: + if fail: raise ValueError("computeYplusOpt: requires Reynolds number as a float or in tb.") fail = 0 if snear is None: @@ -87,7 +87,7 @@ def computeSnearOpt(Re=None,tb=None,Lref=1.,q=1.2,yplus=300.,Cf_law='ANSYS'): if Re is None: fail=1 else: Re = Internal.getValue(Re) else: fail = 1 - if fail: + if fail: raise ValueError("computeSnearOpt: requires Reynolds number as a float or in tb.") diff --git a/Cassiopee/Generator/Generator/Mpi.py b/Cassiopee/Generator/Generator/Mpi.py index ff9f42870..f2a0ecbdd 100644 --- a/Cassiopee/Generator/Generator/Mpi.py +++ b/Cassiopee/Generator/Generator/Mpi.py @@ -69,7 +69,7 @@ def getMeshFieldInfo(m, field, critValue, verbose): zname = z[0] size_loc = numpy.size(f) - fcrit_loc = numpy.count_nonzero(fcritValue) + fcrit_loc = numpy.count_nonzero(fcritValue) fmin_loc = numpy.min(f) fmax_loc = numpy.max(f) fsum_loc = numpy.sum(f) diff --git a/Cassiopee/Generator/Generator/PolyC1.py b/Cassiopee/Generator/Generator/PolyC1.py index 54fdc8e6a..122ac151e 100644 --- a/Cassiopee/Generator/Generator/PolyC1.py +++ b/Cassiopee/Generator/Generator/PolyC1.py @@ -30,7 +30,7 @@ def polyC1Mesher(curve, h, yplus, density, splitCrit=10., dalpha=5.,depth=1): alphaMax = 360.-alpha0 # Split curve - curve = G.close(curve) + curve = G.close(curve) curves = T.splitCurvatureRadius(curve, splitCrit) #C.convertArrays2File(curves, 'split.plt') @@ -247,7 +247,7 @@ def polyC1Mesher(curve, h, yplus, density, splitCrit=10., dalpha=5.,depth=1): elif (ext[c,0] == 2 and ext[c,1] == 2): if ne == 1: # une seule courbe nghb[c,0] = 0; nghb[c,1] = 0 - nghbind[c,0] = curves[c][2]; nghbind[c,1] = 1 + nghbind[c,0] = curves[c][2]; nghbind[c,1] = 1 m = generateExtExtMatch(c, curves, density, extension, delta, nghb[c,0], nghb[c,1], nghbind[c,0], nghbind[c,1]) @@ -494,7 +494,7 @@ def generateOtherCases(curve, curves, pz3 = z1 + n[1][2,0] * h d3 = D.line((x1,y1,z1), (px3,py3,pz3),ext) - if (ext2 == 0):# TFI paroi + if (ext2 == 0):# TFI paroi if (nghbind2 == 1): h0 = h / math.sin( angle2 * math.pi / 180. ) h0 = min(h0, 2*h) @@ -532,7 +532,7 @@ def generateOtherCases(curve, curves, pz3 = pz1 + n[1][2,p-1] * h d4 = D.line((px1,py1,pz1), (px3,py3,pz3),ext) - d2 = buildd2(d1, d3, d4, h, ext1, ext2, angle1, angle2) + d2 = buildd2(d1, d3, d4, h, ext1, ext2, angle1, angle2) r02 = G.cart((0,0,0), (1./(d1[2]-1),1,1), (d1[2],1,1)) d2 = G.map(d2,r02) @@ -548,7 +548,7 @@ def generateOtherCases(curve, curves, px2 = x1 - ext*(x3-x1)*hmv1/norm py2 = y1 - ext*(y3-y1)*hmv1/norm pz2 = z1 - ext*(z3-z1)*hmv1/norm - line1 = D.line((x1,y1,z1), (0.5*(px1+px2),0.5*(py1+py2),0.5*(pz1+pz2)),ext) + line1 = D.line((x1,y1,z1), (0.5*(px1+px2),0.5*(py1+py2),0.5*(pz1+pz2)),ext) line1 = T.reorder(line1,(-1,2,3)) # ajout du nouveau d3 pres de l'extension coincidente line4 = d3 @@ -733,7 +733,7 @@ def generateOtherCases(curve, curves, m = G.TFI([r3, r4, r1, r2]) m = T.reorder(m, (-1,2,3)) - #m = G.TTM(m, 20) + #m = G.TTM(m, 20) curve[0] = vars return m @@ -830,7 +830,7 @@ def buildd2(d1, d3, d4, h, ext1, ext2, angle1, angle2): ind13 = D.getDistantIndex(d1, 1, s1*l) ind23 = D.getDistantIndex(d1, 1, s2*l) #print ext1,ext2,s1,s2, ind13, ind23, d1[2] - #print d1[1][0,0], d1[1][1,0] + #print d1[1][0,0], d1[1][1,0] #print ind13, ind23, l, 1./3.*l d1p = d1[1]; d3p = d3[1]; d4p = d4[1] @@ -863,7 +863,7 @@ def buildd2(d1, d3, d4, h, ext1, ext2, angle1, angle2): sl = (sp[0,i]-s2)/(1. -s2) vect[1][0,i] = sl*h2x + (1.-sl)*h*np[0,ind23] vect[1][1,i] = sl*h2y + (1.-sl)*h*np[1,ind23] - vect[1][2,i] = sl*h2z + (1.-sl)*h*np[2,ind23] + vect[1][2,i] = sl*h2z + (1.-sl)*h*np[2,ind23] d2 = T.deform(d1, vect) return d2 @@ -884,7 +884,7 @@ def buildBC(m, walls, ext1, ext2, extension): elif ext1 <= 0 and ext2 > 0: i2 = m[2]; i1 = extension else: - i2 = m[2]-extension+1; i1 = 1 + i2 = m[2]-extension+1; i1 = 1 wrange = [i1,i2,1,1,1,m[4]] wl.append(wrange) diff --git a/Cassiopee/Generator/Generator/PolyLine.py b/Cassiopee/Generator/Generator/PolyLine.py index e69a4eb55..34820d2a2 100644 --- a/Cassiopee/Generator/Generator/PolyLine.py +++ b/Cassiopee/Generator/Generator/PolyLine.py @@ -111,7 +111,7 @@ def polyLineMesher(polyLine, h, yplus, density): if (indv == -1): ext1 = 1 if (ext2 != 1): indv = findNeighbourIndex(polyLine, ind2+1, i+1) - if (indv == -1): ext2 = 1 + if (indv == -1): ext2 = 1 #print 'mesh no=',i,' ext1=',ext1,' ext2=',ext2 lext1 = max(0,ext1) ; lext2 = max(0,ext2) @@ -168,7 +168,7 @@ def polyLineMesher(polyLine, h, yplus, density): elif (ext2 == -1): px3 = px2 + np[1][0,i+1] * h py3 = py2 + np[1][1,i+1] * h - pz3 = pz2 + np[1][2,i+1] * h + pz3 = pz2 + np[1][2,i+1] * h d1 = D.line( (px1,py1,pz1), (px2,py2,pz2) ) d2 = D.line( (px4,py4,pz4), (px3,py3,pz3) ) diff --git a/Cassiopee/Generator/Generator/PolyTri.py b/Cassiopee/Generator/Generator/PolyTri.py index d67e3d45f..c7ccd1f61 100644 --- a/Cassiopee/Generator/Generator/PolyTri.py +++ b/Cassiopee/Generator/Generator/PolyTri.py @@ -40,7 +40,7 @@ def polyTri2PolyQuad(polyTri): f = polyTri[1]; c = polyTri[2]; ne = c.shape[1]; n = f.shape[1] fq = numpy.zeros((3,n+4*ne),dtype=numpy.float64) for i in range(n): - fq[0,i] = f[0,i]; fq[1,i] = f[1,i]; fq[2,i] = f[2,i] + fq[0,i] = f[0,i]; fq[1,i] = f[1,i]; fq[2,i] = f[2,i] cq = numpy.zeros((4,3*ne), dtype=E_NpyInt) for i in range(ne): diff --git a/Cassiopee/Generator/Generator/PyTree.py b/Cassiopee/Generator/Generator/PyTree.py index 59b72aa70..93ee8fbc8 100644 --- a/Cassiopee/Generator/Generator/PyTree.py +++ b/Cassiopee/Generator/Generator/PyTree.py @@ -155,7 +155,7 @@ def octree2Struct(o, vmin=15, ext=0, optimized=1, merged=1, AMR=0, # Creation des zones du pyTree c = 1; zones = [] for mc in cartzones: - zone = C.convertArrays2ZoneNode('cart'+str(c), [mc]) + zone = C.convertArrays2ZoneNode('cart'+str(c), [mc]) zones.append(zone); c += 1 cartzones = None @@ -168,7 +168,7 @@ def octree2Struct(o, vmin=15, ext=0, optimized=1, merged=1, AMR=0, if AMR == 1: return zones if ext == 0: try: import Connector.PyTree as X - except ImportError: + except ImportError: print('Warning: octree2Struct requires Connector module. No grid connectivity built.') return zones @@ -177,8 +177,8 @@ def octree2Struct(o, vmin=15, ext=0, optimized=1, merged=1, AMR=0, zones = X.connectMatch(zones, dim=dimPb) for ratio0 in ratios: zones = X.connectNearMatch(zones,ratio=ratio0,dim=dimPb) - return zones - else: + return zones + else: #----------------------- # Creation des BCOverlap #----------------------- @@ -194,7 +194,7 @@ def octree2Struct(o, vmin=15, ext=0, optimized=1, merged=1, AMR=0, ind = ni-1 + (nj-1)*ni+(nk-1)*ni*nj x2 = C.getValue(z,'CoordinateX',ind) y2 = C.getValue(z,'CoordinateY',ind) - z2 = C.getValue(z,'CoordinateZ',ind) + z2 = C.getValue(z,'CoordinateZ',ind) xmin = min(xmin,x1); xmax = max(xmax,x2) ymin = min(ymin,y1); ymax = max(ymax,y2) zmin = min(zmin,z1); zmax = max(zmax,z2) @@ -228,7 +228,7 @@ def _adaptOctree(a, indicator="indicator", balancing=1, ratio=2): indic = C.getFields(Internal.__FlowSolutionCenters__,zones) indic = Converter.extractVars(indic, [indicator]) C._deleteFlowSolutions__(a) - for noz, z in enumerate(zones): + for noz, z in enumerate(zones): res = Generator.adaptOctree(hexa[noz], indic[noz], balancing, ratio) C.setFields([res], zones[noz], 'nodes', writeDim=True) return None @@ -310,7 +310,7 @@ def constrainedDelaunay(contour, tol=1.e-10, keepBB=0): Usage: constrainedDelaunay( contour, tol, keepBB )""" contour = C.deleteFlowSolutions__(contour, 'centers') return C.TZGC1(contour, 'nodes', True, - Generator.constrainedDelaunay, tol, keepBB) + Generator.constrainedDelaunay, tol, keepBB) def plaster(contours, surfaces, side=0): """Create a sticky plaster around contours surrounded by surfaces. @@ -337,7 +337,7 @@ def T3mesher2D(a, grading=1.2, triangulateOnly=0, metricInterpType=0): c = Generator.T3mesher2D(c, grading, triangulateOnly, metricInterpType) return C.convertArrays2ZoneNode('tri', [c]) -def tetraMesher(a, maxh=-1., grading=0.4, triangulateOnly=0, +def tetraMesher(a, maxh=-1., grading=0.4, triangulateOnly=0, remeshBoundaries=0, algo=1, optionString=""): """Create a TRI/TETRA mesh given a set of BAR or surfaces in a. Usage: tetraMesher(a, fineness, grading)""" @@ -421,13 +421,13 @@ def snapSharpEdges(t, surfs, step=None, angle=30.): """Adapt t to a given surface. Usage: snapSharpEdges(t, surfs, step)""" arrays = C.getFields(Internal.__GridCoordinates__, surfs) - return C.TZA1(t, 'nodes', 'nodes', True, Generator.snapSharpEdges, + return C.TZA1(t, 'nodes', 'nodes', True, Generator.snapSharpEdges, arrays, step, angle) def _snapSharpEdges(t, surfs, step=None, angle=30.): """Adapt t to a given surface.""" arrays = C.getFields(Internal.__GridCoordinates__, surfs) - return C._TZA1(t, 'nodes', 'nodes', True, Generator.snapSharpEdges, + return C._TZA1(t, 'nodes', 'nodes', True, Generator.snapSharpEdges, arrays, step, angle) def check(t): @@ -483,7 +483,7 @@ def CEBBIntersection(a1, a2, tol=1.e-10): return Generator.CEBBIntersection(m1, m2, tol) def bboxIntersection(z1, z2, tol=1.e-6, isBB=False, method='AABB'): - """Return 1 if bounding boxes of z1 and z2 intersect.""" + """Return 1 if bounding boxes of z1 and z2 intersect.""" if Internal.typeOfNode(z1) != 1: raise ValueError("First arg must be a zone.") if Internal.typeOfNode(z2) != 1: @@ -492,29 +492,29 @@ def bboxIntersection(z1, z2, tol=1.e-6, isBB=False, method='AABB'): z1 = BB(z1, method) z2 = BB(z2, method) if method == 'AABB': # Computes the intersection between 2 AABB - return generator._bboxIntersectionZ(z1, z2, tol, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, + return generator._bboxIntersectionZ(z1, z2, tol, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, Internal.__FlowSolutionCenters__) elif method == 'OBB': # Computes the intersection between 2 OBB - return generator._obboxIntersectionZ(z1, z2, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + return generator._obboxIntersectionZ(z1, z2, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) elif method == 'AABBOBB': # Intersection between AABB and OBB - return generator._crossIntersectionZ(z1, z2, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + return generator._crossIntersectionZ(z1, z2, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) else: print('Warning: bboxIntersection: method',method,'not implemented, switching to AABB.') return generator._bboxIntersectionZ(z1, z2, tol, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) def _bboxIntersection(z1, z2, tol=1.e-6, isBB=False, method='AABB'): - """Return 1 if bounding boxes of z1 and z2 intersect.""" + """Return 1 if bounding boxes of z1 and z2 intersect.""" if Internal.typeOfNode(z1) != 1: raise ValueError("First arg must be a zone.") if Internal.typeOfNode(z2) != 1: @@ -523,26 +523,26 @@ def _bboxIntersection(z1, z2, tol=1.e-6, isBB=False, method='AABB'): _BB(z1,method) _BB(z2,method) if method == 'AABB': # Computes the intersection between 2 AABB - return generator._bboxIntersectionZ(z1, z2, tol, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, + return generator._bboxIntersectionZ(z1, z2, tol, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, Internal.__FlowSolutionCenters__) elif method == 'OBB': # Computes the intersection between 2 OBB - return generator._obboxIntersectionZ(z1, z2, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + return generator._obboxIntersectionZ(z1, z2, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) elif method == 'AABBOBB': # Intersection between AABB and OBB - return generator._crossIntersectionZ(z1, z2, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + return generator._crossIntersectionZ(z1, z2, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) else: print('Warning: bboxIntersection: method %s not implemented, switching to AABB.'%method) - return generator._bboxIntersectionZ(z1, z2, tol, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + return generator._bboxIntersectionZ(z1, z2, tol, + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) def checkPointInCEBB(t, P): """Check if point P is in the Cartesian Elements Bounding Box of a mesh.""" @@ -618,7 +618,7 @@ def getCellCenters(t, fc, fa, own=None, nei=None): def getNormalMap(t): """Return the map of surface normals in an array. - Usage: getNormalMap(t)""" + Usage: getNormalMap(t)""" return C.TZGC1(t, 'centers', True, Generator.getNormalMap) def _getNormalMap(t): @@ -643,7 +643,7 @@ def _getCellPlanarity(t): def getCircumCircleMap(t): """Return the map of circum circle radius of a 'TRI' array. - Usage: getCircumCircleMap(t)""" + Usage: getCircumCircleMap(t)""" return C.TZGC1(t, 'centers', True, Generator.getCircumCircleMap) def _getCircumCircleMap(t): @@ -651,7 +651,7 @@ def _getCircumCircleMap(t): def getInCircleMap(t): """Return the map of inscribed circle radius of a 'TRI' array. - Usage: getInCircleMap(t)""" + Usage: getInCircleMap(t)""" return C.TZGC1(t, 'centers', True, Generator.getInCircleMap) def _getInCircleMap(t): @@ -879,7 +879,7 @@ def _zip(t, tol=1e-12): fields = C.getAllFields(t, 'nodes') fields = Generator.zip(fields, tol) C.setFields(fields, t, 'nodes') - return None + return None def pointedHat(a, coord): """Create a structured surface defined by a contour and a point (x,y,z). @@ -948,7 +948,7 @@ def modifyBC__(dir, ni0, nj0, nk0, z): (parent, d) = Internal.getParentOfNode(z, w) w0 = w[2][0][1] i1 = w0[0,0]; j1 = w0[1,0]; k1 = w0[2,0] - i2 = w0[0,1]; j2 = w0[1,1]; k2 = w0[2,1] + i2 = w0[0,1]; j2 = w0[1,1]; k2 = w0[2,1] if dir == 1: if i1 == 1 and i2 == ni0: range0 = [1,ni,j1,j2,k1,k2] @@ -987,7 +987,7 @@ def modifyBC__(dir, ni0, nj0, nk0, z): (parent, d) = Internal.getParentOfNode(cn, w) w0 = w[1] i1 = w0[0,0]; j1 = w0[1,0]; k1 = w0[2,0] - i2 = w0[0,1]; j2 = w0[1,1]; k2 = w0[2,1] + i2 = w0[0,1]; j2 = w0[1,1]; k2 = w0[2,1] if dir == 1: if i1 == 1 and i2 == ni0: range0 = [1,ni,j1,j2,k1,k2] @@ -1070,7 +1070,7 @@ def refineBCRanges__(r0, ni0, nj0, nk0, ni, nj, nk, dir, factor): shift = factor-1 # nouveaux indices - if dir == 1: + if dir == 1: if i1 == 1: i1N = 1 elif i1 == ni0: i1N = ni else: i1N = alp1*i1-shift @@ -1165,19 +1165,19 @@ def _refine(t, power, dir): else: C._deleteZoneBC__(z); C._deleteGridConnectivity__(z) return None -def mmgs(t, ridgeAngle=45., hmin=0., hmax=0., hausd=0.01, grow=1.1, +def mmgs(t, ridgeAngle=45., hmin=0., hmax=0., hausd=0.01, grow=1.1, anisotropy=0, optim=0, fixedConstraints=[], sizeConstraints=[]): """Remesh a surface using MMGs.""" tp = Internal.copyRef(t) _mmgs(tp, ridgeAngle, hmin, hmax, hausd, grow, anisotropy, optim, fixedConstraints, sizeConstraints) return tp -def _mmgs(t, ridgeAngle=45., hmin=0., hmax=0., hausd=0.01, grow=1.1, +def _mmgs(t, ridgeAngle=45., hmin=0., hmax=0., hausd=0.01, grow=1.1, anisotropy=0, optim=0, fixedConstraints=[], sizeConstraints=[]): arrays = C.getFields('nodes', t, api=1) fixedConstraints = C.getFields('nodes', fixedConstraints, api=1) sizeConstraints = C.getFields('nodes', sizeConstraints, api=1) - b = Generator.mmgs(arrays, ridgeAngle, hmin, hmax, hausd, grow, anisotropy, optim, + b = Generator.mmgs(arrays, ridgeAngle, hmin, hmax, hausd, grow, anisotropy, optim, fixedConstraints, sizeConstraints) C.setFields(b, t, 'nodes', True) C._deleteFlowSolutions__(t) @@ -1207,7 +1207,7 @@ def TFITri(a1, a2, a3): Usage: TFITri(a)""" a1 = C.getFields(Internal.__GridCoordinates__, a1)[0] a2 = C.getFields(Internal.__GridCoordinates__, a2)[0] - a3 = C.getFields(Internal.__GridCoordinates__, a3)[0] + a3 = C.getFields(Internal.__GridCoordinates__, a3)[0] r1,r2,r3 = Generator.TFITri(a1, a2, a3) return [C.convertArrays2ZoneNode('tfi1', [r1]), C.convertArrays2ZoneNode('tfi2', [r2]), @@ -1274,12 +1274,12 @@ def TTM(a, niter=100): m = Generator.TTM(m, niter) return C.convertArrays2ZoneNode('ttm', [m]) -def hyper2D(t, distrib, type, +def hyper2D(t, distrib, type, eta_start=10, eta_end=-1, beta=0.): """Generate an hyperbolic mesh. Usage: hyper2D(t, distrib, type)""" d = C.getFields(Internal.__GridCoordinates__, distrib)[0] - return C.TZGC1(t, 'nodes', True, Generator.hyper2D, d, type, + return C.TZGC1(t, 'nodes', True, Generator.hyper2D, d, type, eta_start, eta_end, beta) def hyper2D2(t, distrib, type, alpha): @@ -1300,8 +1300,8 @@ def hyper2D4(t, distrib, type): d = C.getFields(Internal.__GridCoordinates__, distrib)[0] return C.TZGC1(t, 'nodes', True, Generator.hyper2D4, d, type) -def addNormalLayers(t, distrib, check=0, niterType=0, niter=0, niterK=[], - smoothType=0, eps=0.4, nitLocal=3, kappaType=0, kappaS=[0.2,1.6], +def addNormalLayers(t, distrib, check=0, niterType=0, niter=0, niterK=[], + smoothType=0, eps=0.4, nitLocal=3, kappaType=0, kappaS=[0.2,1.6], blanking=False, algo=0): """Generate N layers to a surface following normals. Distrib is the height of each layer. @@ -1336,7 +1336,7 @@ def buildExtension(c, surfaces, dh, niter=0): return C.setFields([coords], cp, 'nodes') #============================================================================== -# Walk on surface defined by t starting from a contour +# Walk on surface defined by t starting from a contour #============================================================================== def surfaceWalk(t, contour, distrib, constraints=[], niter=0, alphaRef=180., check=0, toldist=1.e-6): @@ -1362,7 +1362,7 @@ def surfaceWalk(t, contour, distrib, constraints=[], niter=0, #============================================================================= def collarMesh(s1, s2, distribj, distribk, niterj=100, niterk=100, ext=10, alphaRef=180., type='union', - contour=[], constraints1=[], constraints2=[], toldist = 1.e-10): + contour=[], constraints1=[], constraints2=[], toldist=1.e-10): """Generates a collar mesh starting from s1 and s2 surfaces, distributions along the surfaces and along the normal direction, with respect to the assembly type between grids. Usage: collarMesh(s1, s2, distribj, distribk, niterj, niterk, ext, alphaRef, type, contour,constraints1,constraints2,toldist)""" @@ -1377,7 +1377,7 @@ def collarMesh(s1, s2, distribj, distribk, else: constraints22 = [] if contour != []: contoura = C.getFields(Internal.__GridCoordinates__,contour)[0] else: contoura = contour - infos = Collar.createCollarMesh__(surf1, surf2, dj, dk, niterj, niterk, + infos = Collar.createCollarMesh__(surf1, surf2, dj, dk, niterj, niterk, ext, alphaRef, type, contoura, constraints11, constraints22, toldist) zones = [] @@ -1385,14 +1385,14 @@ def collarMesh(s1, s2, distribj, distribk, ranges = info[1:] z = C.convertArrays2ZoneNode('Collar', [info[0]]) for r in ranges: C._addBC2Zone(z,'wall','BCWall',r) - # ajout des BCOverlaps + # ajout des BCOverlaps if type == 'union': - C._addBC2Zone(z, 'match', 'BCMatch', 'jmin', z, 'jmax', trirac=[1,2,3]) - C._addBC2Zone(z, 'match', 'BCMatch', 'jmax', z, 'jmin', trirac=[1,2,3]) + C._addBC2Zone(z, 'match', 'BCMatch', 'jmin', z, 'jmax', trirac=[1,2,3]) + C._addBC2Zone(z, 'match', 'BCMatch', 'jmax', z, 'jmin', trirac=[1,2,3]) elif type =='difference': - C._addBC2Zone(z, 'match', 'BCMatch', 'imin', z, 'imax', trirac=[1,2,3]) - C._addBC2Zone(z, 'match', 'BCMatch', 'imax', z, 'imin', trirac=[1,2,3]) - C._fillEmptyBCWith(z, 'overlap', 'BCOverlap') + C._addBC2Zone(z, 'match', 'BCMatch', 'imin', z, 'imax', trirac=[1,2,3]) + C._addBC2Zone(z, 'match', 'BCMatch', 'imax', z, 'imin', trirac=[1,2,3]) + C._fillEmptyBCWith(z, 'overlap', 'BCOverlap') zones += [z] return zones @@ -1409,7 +1409,7 @@ def gencartmb(t, h, Dfar, nlvl): c = 1 zones = [] for mc in cartzones: - zone = C.convertArrays2ZoneNode('cart'+str(c), [mc]) + zone = C.convertArrays2ZoneNode('cart'+str(c), [mc]) zones.append(zone) c += 1 return zones @@ -1446,7 +1446,7 @@ def polyLineMesher(z, h, yplus, density): zones.append(zone) tb = C.newPyTree(['Base']); tb[2][1][2] += zones tb = X.connectMatch(tb,dim=2) - tb = C.fillEmptyBCWith(tb, 'overlap', 'BCOverlap', dim = 2) + tb = C.fillEmptyBCWith(tb, 'overlap', 'BCOverlap', dim=2) zones = tb[2][1][2] return [zones, hout, dout] @@ -1458,7 +1458,7 @@ def polyC1Mesher(z, h, yplus, density, splitCrit=10., dalpha=5., depth=1): """Generate a multiple mesh for a polyC1-curve defined by z. Usage: polyC1Mesher(z, h, yplus, density, splitCrit, dalpha, depth)""" try: import Connector.PyTree as X; from . import PolyC1 as GP - except ImportError: + except ImportError: raise ImportError("polyC1Mesher: requires PolyC1 and Connector.PyTree modules.") name = z[0] coord = C.getFields(Internal.__GridCoordinates__,z)[0] @@ -1517,7 +1517,7 @@ def polyQuadMesher(z, h, hf, density, next): zones.append(zone) tb = C.newPyTree(['Base']); tb[2][1][2] += zones tb = X.connectMatch(tb) - tb = C.fillEmptyBCWith(tb, 'overlap', 'BCOverlap') + tb = C.fillEmptyBCWith(tb, 'overlap', 'BCOverlap') zones = tb[2][1][2] return [zones, hout, dout] @@ -1553,7 +1553,7 @@ def polyTriMesher(z, h, hf, density, next): zones.append(zone) tb = C.newPyTree(['Base']); tb[2][1][2] += zones tb = X.connectMatch(tb) - tb = C.fillEmptyBCWith(tb, 'overlap', 'BCOverlap', dim=3) + tb = C.fillEmptyBCWith(tb, 'overlap', 'BCOverlap', dim=3) zones = tb[2][1][2] return [zones, hout, dout] @@ -1570,7 +1570,7 @@ def mapSplit(z, d, split_crit, dens_max=1000): A = Generator.mapSplit(a, dist, split_crit, dens_max) c = 1; zones = [] for i in A: - zone = C.convertArrays2ZoneNode(name+str(c),[i]) + zone = C.convertArrays2ZoneNode(name+str(c),[i]) zones.append(zone); c += 1 return zones @@ -1697,7 +1697,7 @@ def refine__(t, torig, refine, dim): gcarray_prangeD=gc[2][1][1] #PointRangeDonor for j in range(0, dim): for i in range(0,2): - ##Point Range + ##Point Range if gcarray_prange[j][i] !=1: gcarray_prange[j][i]=(gcarray_prange[j][i]-1)*refine[j]+1 ##Point Range Donor @@ -1736,7 +1736,7 @@ def getMeshFieldInfo(m, field, critValue, verbose): f = Internal.getNodeFromName(z, field)[1] size_loc = numpy.size(f) - fcrit_loc = numpy.count_nonzero(fcritValue) + fcrit_loc = numpy.count_nonzero(fcritValue) fmin_loc = numpy.min(f) fmax_loc = numpy.max(f) fsum_loc = numpy.sum(f) diff --git a/Cassiopee/Generator/Generator/Shapes.py b/Cassiopee/Generator/Generator/Shapes.py index 924f1df50..46c918f15 100644 --- a/Cassiopee/Generator/Generator/Shapes.py +++ b/Cassiopee/Generator/Generator/Shapes.py @@ -1,4 +1,4 @@ -# +# # Maillages autour de formes simples # from . import Generator as G @@ -7,38 +7,38 @@ def square(coord0, coord1, H, dim): """Return the 8 arrays for a cube""" out = [] - (x0,y0) = coord0 + (x0,y0) = coord0 (x1,y1) = coord1 (ni,nj,nk) = dim - a = G.cart((x0-H,y0,0.), (H*1./(nk-1), + a = G.cart((x0-H,y0,0.), (H*1./(nk-1), (y1-y0)*1./(nj-1), 1.), (nk,nj,1)) out.append(a) - a = G.cart( (x0,y1,0.), ((x1-x0)*1./(ni-1), + a = G.cart( (x0,y1,0.), ((x1-x0)*1./(ni-1), H*1./(nk-1), 1.), (ni,nk,1)) out.append(a) - a = G.cart( (x1,y0,0.), (H*1./(nk-1), + a = G.cart( (x1,y0,0.), (H*1./(nk-1), (y1-y0)*1./(nj-1), 1.), (nk,nj,1)) out.append(a) - a = G.cart( (x0,y0-H,0.), ((x1-x0)*1./(ni-1), + a = G.cart( (x0,y0-H,0.), ((x1-x0)*1./(ni-1), H*1./(nk-1), 1.), (ni,nk,1)) out.append(a) - a = G.cart( (x0-H,y0-H,0.), (H*1./(nk-1), + a = G.cart( (x0-H,y0-H,0.), (H*1./(nk-1), H*1./(nk-1), 1.), (nk,nk,1)) out.append(a) - a = G.cart( (x0-H,y1,0.), (H*1./(nk-1), + a = G.cart( (x0-H,y1,0.), (H*1./(nk-1), H*1./(nk-1), 1.), (nk,nk,1)) out.append(a) - a = G.cart( (x1,y1,0.), (H*1./(nk-1), + a = G.cart( (x1,y1,0.), (H*1./(nk-1), H*1./(nk-1), 1.), (nk,nk,1)) out.append(a) - a = G.cart( (x1,y0-H,0.), (H*1./(nk-1), + a = G.cart( (x1,y0-H,0.), (H*1./(nk-1), H*1./(nk-1), 1.), (nk,nk,1)) out.append(a) diff --git a/Cassiopee/Generator/Generator/SurfaceWalk.py b/Cassiopee/Generator/Generator/SurfaceWalk.py index 9f4d3f20d..d7dcf2514 100644 --- a/Cassiopee/Generator/Generator/SurfaceWalk.py +++ b/Cassiopee/Generator/Generator/SurfaceWalk.py @@ -10,7 +10,7 @@ #============================================================================= # Python Interface to create surface grids by marching on surfaces #============================================================================= -try: +try: import Transform as T import Converter as C import Post as P @@ -67,7 +67,7 @@ def surfaceWalk__(surfaces, c, distrib, constraints, niter,alphaRef, check, told if len(distrib) != 5: distrib = C.convertBAR2Struct(distrib) c0 = G.close(c, tol=toldist) - if len(c) == 4: c0 = C.convertBAR2Struct(c0) + if len(c) == 4: c0 = C.convertBAR2Struct(c0) surfaces = C.convertArray2Tetra(surfaces, split='withBarycenters') surfaces = T.join(surfaces) @@ -127,7 +127,7 @@ def surfaceWalk__(surfaces, c, distrib, constraints, niter,alphaRef, check, told stop = 0; j1 = 1; jmaxout = -1 while j1 < jmax and stop == 0: # Interpolation des normales sur le contour - indices, dists = C.nearestNodes(hook, c2) + indices, dists = C.nearestNodes(hook, c2) c2 = C.addVars(c2, vn) alpn2 = C.extractVars(c2,vn) n1 = C.extractVars(normales,vn) @@ -145,7 +145,7 @@ def surfaceWalk__(surfaces, c, distrib, constraints, niter,alphaRef, check, told alpxp = alpp[1][0,:]; alpyp = alpp[1][1,:]; alpzp = alpp[1][2,:] for ieta in range(eta[1].shape[1]): - ps = alpxn[ieta]*alpxp[ieta]+alpyn[ieta]*alpyp[ieta]+alpzn[ieta]*alpzp[ieta] + ps = alpxn[ieta]*alpxp[ieta]+alpyn[ieta]*alpyp[ieta]+alpzn[ieta]*alpzp[ieta] if abs(ps) < cosalphaRef: stop = 1; jmaxout = j1; break #---------------------------------- # add layer a partir de c et de eta @@ -153,7 +153,7 @@ def surfaceWalk__(surfaces, c, distrib, constraints, niter,alphaRef, check, told if stop == 0: alpp = alpn etap = C.normalize(eta, veta) - if constraints2 != []: + if constraints2 != []: eta = generator.straightenVector(c2, etap, constrainedPts, constraints2, loop, niter, toldist) else: eta = etap if loop == 1: # meme eta en imin et imax @@ -189,16 +189,16 @@ def surfaceWalk__(surfaces, c, distrib, constraints, niter,alphaRef, check, told volmin = -1.e6 if check == 1: jminout = jmaxout - for j1 in range(1,jmaxout-1): - subc = T.subzone(coords,(1,j1,1),(imax,j1+1,1)) + for j1 in range(1,jmaxout-1): + subc = T.subzone(coords,(1,j1,1),(imax,j1+1,1)) vol = G.getVolumeMap(subc) - if C.getMinValue(vol,'vol') < 0.1*volmin: + if C.getMinValue(vol,'vol') < 0.1*volmin: jminout = min(jminout,j1prev) break if j1 == 1: volmin = C.getMinValue(vol,'vol') j1prev += 1 return T.subzone(coords,(1,1,1),(imax,jminout,1)) - else: #check == 0: + else: #check == 0: if jmaxout == jmax: return coords else: return T.subzone(coords,(1,1,1),(imax,jmaxout,1)) return None diff --git a/Cassiopee/Generator/Generator/TFIs.py b/Cassiopee/Generator/Generator/TFIs.py index 6803bb3df..c965ee476 100644 --- a/Cassiopee/Generator/Generator/TFIs.py +++ b/Cassiopee/Generator/Generator/TFIs.py @@ -1,7 +1,7 @@ # Various specific TFIs from . import Generator as G from . import generator -try: +try: import Converter as C import Transform as T except ImportError: @@ -83,7 +83,7 @@ def mergeEdgesAngle(edges, thresold=0.3): for c, e in enumerate(edges): tangle = abs(angles[c] - numpy.pi) if tangle < thresold and len(medges) > 0: - e2 = T.join(medges[-1], e); medges[-1] = e2 + e2 = T.join(medges[-1], e); medges[-1] = e2 else: medges.append(e) tangle0 = abs(angles[0] - numpy.pi) if tangle0 < thresold and len(medges) > 0: @@ -94,7 +94,7 @@ def mergeEdgesAngle(edges, thresold=0.3): def findSplitInEdges(edges, N2): isp = 0; N = 0 for e in edges: - N += C.getNPts(e)-1 + N += C.getNPts(e)-1 if N == N2-1: break if N > N2: isp = -1; break isp += 1 @@ -131,7 +131,7 @@ def mergeEdges4(iedges): #c90 = 0 #for c, a in angles: # if abs(a-numpy/2.) < abs(angles[c90]-numpy.pi/2): c90 = c - #if c90 > 0: + #if c90 > 0: # e1 = edges[0:c90]; e2 = edges[c90:]; edges = e2+e1 # try to find first split @@ -191,7 +191,7 @@ def allTFI__(edges): nedges = len(edges) if nedges == 4: # TFI directe ou TFIQuad - try: + try: ret = [TFI(edges)] q = quality(ret) if q >= 1000: return None @@ -200,14 +200,14 @@ def allTFI__(edges): except: pass elif nedges == 1: # TFIO ou TFISingle - try: + try: ret = TFISingle(edges[0]) q = quality(ret) if q >= 1000: return None print("%d: TFI Single"%nedges) return ret except: - try: + try: ret = TFIO(edges[0]) q = quality(ret) if q >= 1000: return None @@ -216,7 +216,7 @@ def allTFI__(edges): except: pass elif nedges == 2: # TFIHalfO - try: + try: ret = TFIHalfO(edges[0], edges[1]) q = quality(ret) if q >= 1000: return None @@ -225,7 +225,7 @@ def allTFI__(edges): except: pass elif nedges == 3: # TFITri - try: + try: ret = TFITri2(edges[0], edges[1], edges[2]) q = quality(ret) if q >= 1000: return None @@ -592,7 +592,7 @@ def TFIHalfO__(a1, a2, weight, offset=0, tol=1.e-6): #elif (indexPP3 == (Nt2-1)//2): indexPP3 += -1 PP3 = (a2[1][0,indexPP3], a2[1][1,indexPP3], a2[1][2,indexPP3]) N1 = indexPP3+1 - indexPP4 = Nt2-N1 + indexPP4 = Nt2-N1 PP4 = (a2[1][0,indexPP4], a2[1][1,indexPP4], a2[1][2,indexPP4]) N2 = Nt2-2*N1+2 @@ -719,7 +719,7 @@ def TFISingle(a1): return ret #============================================================================== -# Cree un ensemble de maillages TFI en etoilant les edges et en +# Cree un ensemble de maillages TFI en etoilant les edges et en # faisant des TFIs par triangle #============================================================================== def TFIStar(edges): diff --git a/Cassiopee/Generator/doc/source/conf.py b/Cassiopee/Generator/doc/source/conf.py index 7e7ca5eca..865d945a8 100644 --- a/Cassiopee/Generator/doc/source/conf.py +++ b/Cassiopee/Generator/doc/source/conf.py @@ -192,15 +192,15 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', -'preamble': r''' + # Additional stuff for the LaTeX preamble. + #'preamble': '', + 'preamble': r''' \usepackage{charter} \usepackage[defaultsans]{lato} \usepackage{inconsolata} @@ -211,10 +211,10 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('Generator', 'Generator.tex', u'Generator Documentation', - u'/ELSA/MU-09022/V'+__version__, 'manual'), - ('Generator_IBM', 'Generator_IBM.tex', u'Generator IBM Documentation', - u'/ELSA/MU-09022/V'+__version__, 'manual'), + ('Generator', 'Generator.tex', u'Generator Documentation', + u'/ELSA/MU-09022/V'+__version__, 'manual'), + ('Generator_IBM', 'Generator_IBM.tex', u'Generator IBM Documentation', + u'/ELSA/MU-09022/V'+__version__, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -257,9 +257,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Generator', u'Generator Documentation', - u'ONERA', 'Generator', 'One line description of project.', - 'Miscellaneous'), + ('index', 'Generator', u'Generator Documentation', + u'ONERA', 'Generator', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/Generator/installLib.py b/Cassiopee/Generator/installLib.py index e8f6bb24d..594334211 100644 --- a/Cassiopee/Generator/installLib.py +++ b/Cassiopee/Generator/installLib.py @@ -1,6 +1,6 @@ # Installation de libgenerator pour etre accessible par les autres modules # Si libgenerator.a existe, on la recopie -# Sinon, on cherche generator.so ou generator.pyd, on le recopie en +# Sinon, on cherche generator.so ou generator.pyd, on le recopie en # libgenerator.so ou dll import os, shutil import KCore.Dist as Dist @@ -27,6 +27,6 @@ a = os.access(installPathLocal+"/generator"+__EXTMODULE__, os.F_OK) if a: shutil.copyfile(installPathLocal+"/generator"+__EXTMODULE__, - libPath+"/libgenerator"+__EXTSHARED__) + libPath+"/libgenerator"+__EXTSHARED__) else: print("Error: generator"+__EXTMODULE__+" can not be found.") diff --git a/Cassiopee/Generator/setup.py b/Cassiopee/Generator/setup.py index 98d0ac301..a24bea46d 100644 --- a/Cassiopee/Generator/setup.py +++ b/Cassiopee/Generator/setup.py @@ -54,7 +54,7 @@ packages=['Generator'], package_dir={"":"."}, ext_modules=listExtensions - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Generator/setupLegacy.py b/Cassiopee/Generator/setupLegacy.py index 75b8f334a..7a6a55ed0 100644 --- a/Cassiopee/Generator/setupLegacy.py +++ b/Cassiopee/Generator/setupLegacy.py @@ -64,7 +64,7 @@ package_dir={"":"."}, packages=['Generator'], ext_modules=listExtensions - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Generator/srcs.py b/Cassiopee/Generator/srcs.py index f32b65fcd..c86c5e2d7 100644 --- a/Cassiopee/Generator/srcs.py +++ b/Cassiopee/Generator/srcs.py @@ -86,35 +86,35 @@ cpp_srcs2 = [] # netgen if NETGEN: - srcs1 = ["adfront2.cpp", "adfront3.cpp", "bisect.cpp", "boundarylayer.cpp", - "clusters.cpp", "curvedelems.cpp", "delaunay.cpp", - "delaunay2d.cpp", "geomsearch.cpp", "global.cpp", + srcs1 = ["adfront2.cpp", "adfront3.cpp", "bisect.cpp", "boundarylayer.cpp", + "clusters.cpp", "curvedelems.cpp", "delaunay.cpp", + "delaunay2d.cpp", "geomsearch.cpp", "global.cpp", "hprefinement.cpp", "improve2.cpp", - "improve2gen.cpp", "improve3.cpp", "localh.cpp", "meshclass.cpp", - "meshfunc.cpp", "meshfunc2d.cpp", "meshing2.cpp", "meshing3.cpp", - "meshtool.cpp", "meshtype.cpp", "msghandler.cpp", "netrule2.cpp", - "netrule3.cpp", "parser2.cpp", "parser3.cpp", "prism2rls.cpp", - "pyramid2rls.cpp", "pyramidrls.cpp", "quadrls.cpp", "refine.cpp", - "ruler2.cpp", "ruler3.cpp", "secondorder.cpp", - "smoothing2.5.cpp", - "smoothing2.cpp", "smoothing3.cpp", "specials.cpp", - "tetrarls.cpp", - "topology.cpp", "triarls.cpp", "validate.cpp", "zrefine.cpp", + "improve2gen.cpp", "improve3.cpp", "localh.cpp", "meshclass.cpp", + "meshfunc.cpp", "meshfunc2d.cpp", "meshing2.cpp", "meshing3.cpp", + "meshtool.cpp", "meshtype.cpp", "msghandler.cpp", "netrule2.cpp", + "netrule3.cpp", "parser2.cpp", "parser3.cpp", "prism2rls.cpp", + "pyramid2rls.cpp", "pyramidrls.cpp", "quadrls.cpp", "refine.cpp", + "ruler2.cpp", "ruler3.cpp", "secondorder.cpp", + "smoothing2.5.cpp", + "smoothing2.cpp", "smoothing3.cpp", "specials.cpp", + "tetrarls.cpp", + "topology.cpp", "triarls.cpp", "validate.cpp", "zrefine.cpp", "bcfunctions.cpp", "parallelmesh.cpp", "paralleltop.cpp", "basegeom.cpp"] for i in srcs1: cpp_srcs2 += ["Generator/Netgen/meshing/"+i] srcs1 = ["array.cpp", "bitarray.cpp", "dynamicmem.cpp", "flags.cpp", "hashtabl.cpp", "mystring.cpp", "ngexception.cpp", "optmem.cpp", - "parthreads.cpp", "profiler.cpp", "seti.cpp", "sort.cpp", + "parthreads.cpp", "profiler.cpp", "seti.cpp", "sort.cpp", "spbita2d.cpp", "symbolta.cpp", "table.cpp", "mpi_interface.cpp"] for i in srcs1: cpp_srcs2 += ["Generator/Netgen/general/"+i] - srcs1 = ["densemat.cpp", "polynomial.cpp", "bfgs.cpp", + srcs1 = ["densemat.cpp", "polynomial.cpp", "bfgs.cpp", "linopt.cpp", "linsearch.cpp"] for i in srcs1: cpp_srcs2 += ["Generator/Netgen/linalg/"+i] srcs1 = ["adtree.cpp", "geom2d.cpp", "geom3d.cpp", "geomfuncs.cpp", - "geomtest3d.cpp", "transform3d.cpp", "spline.cpp", + "geomtest3d.cpp", "transform3d.cpp", "spline.cpp", "splinegeometry.cpp"] for i in srcs1: cpp_srcs2 += ["Generator/Netgen/gprim/"+i] srcs1 = ["genmesh2d.cpp", "geom2dmesh.cpp", "geometry2d.cpp"] @@ -147,7 +147,7 @@ # mmg if MMGS: cpp_srcs2 += ["Generator/mmgs.cpp", - "Generator/MMGS/mmg.c", + "Generator/MMGS/mmg.c", "Generator/MMGS/mmgs1.c", "Generator/MMGS/mmgs2.c", "Generator/MMGS/analys_s.c", diff --git a/Cassiopee/Generator/test/CEBBIntersectionPT_t1.py b/Cassiopee/Generator/test/CEBBIntersectionPT_t1.py index 53a0da921..0c6ea6aeb 100644 --- a/Cassiopee/Generator/test/CEBBIntersectionPT_t1.py +++ b/Cassiopee/Generator/test/CEBBIntersectionPT_t1.py @@ -20,5 +20,3 @@ a2 = C.fillEmptyBCWith(a2,'overlap','BCOverlap') res = G.CEBBIntersection(a1, a2) test.testO(res, 1) - - diff --git a/Cassiopee/Generator/test/CEBBIntersection_t1.py b/Cassiopee/Generator/test/CEBBIntersection_t1.py index 219b1fe7a..ac496b18e 100644 --- a/Cassiopee/Generator/test/CEBBIntersection_t1.py +++ b/Cassiopee/Generator/test/CEBBIntersection_t1.py @@ -14,4 +14,3 @@ a2 = T.translate(a2, (-0.1,-0.1,0)) res = G.CEBBIntersection(a1, a2) test.testO(res, 2) - diff --git a/Cassiopee/Generator/test/IBMExtrude2Dto3D_t1.py b/Cassiopee/Generator/test/IBMExtrude2Dto3D_t1.py index 74da18d6f..eeb20a3ce 100644 --- a/Cassiopee/Generator/test/IBMExtrude2Dto3D_t1.py +++ b/Cassiopee/Generator/test/IBMExtrude2Dto3D_t1.py @@ -16,7 +16,7 @@ dfars = 5 snears = 1 t, tc = X_IBM.prepareIBMData(bodySurfaceFile, None , None , - snears=snears , dfars=dfars , vmin=vmin, + snears=snears , dfars=dfars , vmin=vmin, check=False , frontType=1 , cartesian=False) test.testT(t ,1) @@ -45,7 +45,7 @@ test.testT(tb3D ,4) #C.convertPyTree2File(t3D ,LOCAL+'/t3D_checking.cgns') -#C.convertPyTree2File(tb3D,LOCAL+'/tb3D_checking.cgns') +#C.convertPyTree2File(tb3D,LOCAL+'/tb3D_checking.cgns') # t3Dorig, tb3Dorig = App.extrudeCartesian(t2, bodySurface2, extrusion=extrusion, NPas=NPas, span=span, dz=span/(NPas-1), isAutoPeriodic=True) @@ -61,7 +61,7 @@ nameSplit=bc[0].split(".") lenLocal=len(nameSplit) bc[0]='.'.join(nameSplit[0:lenLocal-1]) -C._rmVars(t3Dorig, ['centers:cellN']) +C._rmVars(t3Dorig, ['centers:cellN']) test.testT(t3Dorig,3) #C.convertPyTree2File(t3Dorig ,LOCAL+'/t3Dorig_checking.cgns') diff --git a/Cassiopee/Generator/test/IBMExtrude2Dto3D_t2.py b/Cassiopee/Generator/test/IBMExtrude2Dto3D_t2.py index 86717e86f..5b9d8f36e 100644 --- a/Cassiopee/Generator/test/IBMExtrude2Dto3D_t2.py +++ b/Cassiopee/Generator/test/IBMExtrude2Dto3D_t2.py @@ -16,7 +16,7 @@ dfars = 5 snears = 1 t, tc = X_IBM.prepareIBMData(bodySurfaceFile, None , None , - snears=snears , dfars=dfars , vmin=vmin, + snears=snears , dfars=dfars , vmin=vmin, check=False , frontType=1 , cartesian=False) test.testT(t ,1) @@ -45,7 +45,7 @@ test.testT(tb3D ,4) #C.convertPyTree2File(t3D ,LOCAL+'/t3D_checking.cgns') -#C.convertPyTree2File(tb3D,LOCAL+'/tb3D_checking.cgns') +#C.convertPyTree2File(tb3D,LOCAL+'/tb3D_checking.cgns') # t3Dorig, tb3Dorig = App.extrudeCartesian(t2, bodySurface2, extrusion=extrusion, NPas=NPas, span=span, dz=span/(NPas-1)) @@ -61,7 +61,7 @@ nameSplit=bc[0].split(".") lenLocal=len(nameSplit) bc[0]='.'.join(nameSplit[0:lenLocal-1]) -C._rmVars(t3Dorig, ['centers:cellN']) +C._rmVars(t3Dorig, ['centers:cellN']) test.testT(t3Dorig,3) #C.convertPyTree2File(t3Dorig ,LOCAL+'/t3Dorig_checking.cgns') diff --git a/Cassiopee/Generator/test/TFI-TRI.py b/Cassiopee/Generator/test/TFI-TRI.py index 4f2204ee7..437b153a3 100644 --- a/Cassiopee/Generator/test/TFI-TRI.py +++ b/Cassiopee/Generator/test/TFI-TRI.py @@ -11,10 +11,10 @@ x = pts[1][0]; y = pts[1][1]; z = pts[1][2] x[0] = 0.; y[0] = 0.; -x[1] = 0.2; y[1] =-0.2; +x[1] = 0.2; y[1] =-0.2; x[2] = 0.4; y[2] =-0.5; x[3] = 0.8; y[3] =-0.1; -x[4] = 1.; y[4] = 0.; +x[4] = 1.; y[4] = 0.; b2 = D.bezier(pts, 15) N = 5 diff --git a/Cassiopee/Generator/test/TFI.py b/Cassiopee/Generator/test/TFI.py index d0b78e0a0..a58cc184e 100644 --- a/Cassiopee/Generator/test/TFI.py +++ b/Cassiopee/Generator/test/TFI.py @@ -30,7 +30,7 @@ x[2] = 2.; y[2] = 3.; z[2] = 0. x[3] = 6.; y[3] = 5.; z[3] = 0. x[4] = 5.; y[4] = 7.; z[4] = 0. -b2 = D.bezier( pts ) +b2 = D.bezier( pts ) C.convertArrays2File([d1, d2, b1, b2], "geom.plt") @@ -52,10 +52,10 @@ # TFI 3D structured #------------------ xo = 0.; yo = 0.; zo = 0. -nx = 21; ny = 21; nz = 21 +nx = 21; ny = 21; nz = 21 hx = 1./(nx-1); hy = 1./(ny-1); hz = 1./(nz-1) -# z = cste +# z = cste fzmin = G.cart((xo,yo,zo), (hx,hy,1.), (nx,ny,1)) fzmax = T.translate(fzmin, (0.,0.,1.)) diff --git a/Cassiopee/Generator/test/TFI2D.py b/Cassiopee/Generator/test/TFI2D.py index b89606fbe..36db4a9a1 100644 --- a/Cassiopee/Generator/test/TFI2D.py +++ b/Cassiopee/Generator/test/TFI2D.py @@ -9,26 +9,26 @@ P3 = (5,7,0) # Geometrie -d1 = D.line(P0, P1) +d1 = D.line(P0, P1) d2 = D.line(P2, P3) pts = C.array('x,y,z', 5, 1, 1) x = pts[1][0]; y = pts[1][1]; z = pts[1][2] -x[0] = 0. ; y[0] = 0.; -x[1] =-2. ; y[1] = 2.; +x[0] = 0. ; y[0] = 0.; +x[1] =-2. ; y[1] = 2.; x[2] =-3. ; y[2] = 3.; -x[3] = 2. ; y[3] = 5.; +x[3] = 2. ; y[3] = 5.; x[4] = 0. ; y[4] = 7.; b1 = D.bezier(pts) pts = C.array('x,y,z', 5, 1, 1) x = pts[1][0]; y = pts[1][1]; z = pts[1][2] x[0 ] = 5.; y[ 0 ] = 0.; -x[1 ] = 3.; y[ 1 ] = 2.; -x[2 ] = 2.; y[ 2 ] = 3.; -x[3 ] = 6.; y[ 3 ] = 5.; -x[4 ] = 5.; y[ 4 ] = 7.; -b2 = D.bezier( pts ) +x[1 ] = 3.; y[ 1 ] = 2.; +x[2 ] = 2.; y[ 2 ] = 3.; +x[3 ] = 6.; y[ 3 ] = 5.; +x[4 ] = 5.; y[ 4 ] = 7.; +b2 = D.bezier( pts ) C.convertArrays2File([d1, d2, b1, b2], "geom.plt", "bin_tp") diff --git a/Cassiopee/Generator/test/TFI3D.py b/Cassiopee/Generator/test/TFI3D.py index f41da9618..ec5accc35 100644 --- a/Cassiopee/Generator/test/TFI3D.py +++ b/Cassiopee/Generator/test/TFI3D.py @@ -4,10 +4,10 @@ import Transform as T xo = 0.; yo = 0.; zo = 0. -ni = 21; nj = 35; nk = 40 +ni = 21; nj = 35; nk = 40 hi = 1./(ni-1); hj = 1./(nj-1); hk = 1./(nk-1) -# grilles z = cste +# grilles z = cste fkmin = G.cart((xo,yo,zo), (hi,hj,1.), (ni,nj,1)) fkmax = T.translate(fkmin, (0.,0.,1.)) diff --git a/Cassiopee/Generator/test/TFIMono_t1.py b/Cassiopee/Generator/test/TFIMono_t1.py index 1e9c6cb2d..0512d71cc 100644 --- a/Cassiopee/Generator/test/TFIMono_t1.py +++ b/Cassiopee/Generator/test/TFIMono_t1.py @@ -1,7 +1,7 @@ # - TFIMono (array) - import Generator as G import Geom as D -import KCore.test as test +import KCore.test as test a1 = D.circle((0,0,0), 1., tetas=0, tetae=180., N=41) a2 = D.line((-1,0,0),(1,0,0), N=21) diff --git a/Cassiopee/Generator/test/TFIO_t1.py b/Cassiopee/Generator/test/TFIO_t1.py index c44e7734c..7c1825089 100644 --- a/Cassiopee/Generator/test/TFIO_t1.py +++ b/Cassiopee/Generator/test/TFIO_t1.py @@ -1,7 +1,7 @@ # - TFIO (array) - import Generator as G import Geom as D -import KCore.test as test +import KCore.test as test a = D.circle((0,0,0), 1., N=41) r = G.TFIO(a) diff --git a/Cassiopee/Generator/test/TFIPT.py b/Cassiopee/Generator/test/TFIPT.py index 5f7dc51ae..33fcfe34f 100644 --- a/Cassiopee/Generator/test/TFIPT.py +++ b/Cassiopee/Generator/test/TFIPT.py @@ -4,9 +4,9 @@ import Geom.PyTree as D # Geometry -P0 = (0,0,0); P1 = (5,0,0); P2 = (0,7,0); P3 = (5,7,0) +P0 = (0,0,0); P1 = (5,0,0); P2 = (0,7,0); P3 = (5,7,0) Ni = 20; Nj = 10 d1 = D.line(P0, P1,Ni); d2 = D.line(P2, P3,Ni) -d3 = D.line(P0, P2,Nj); d4 = D.line(P1, P3,Nj) +d3 = D.line(P0, P2,Nj); d4 = D.line(P1, P3,Nj) m = G.TFI([d1, d2, d3, d4]) C.convertPyTree2File(m, 'out.cgns') diff --git a/Cassiopee/Generator/test/TFIPT_t1.py b/Cassiopee/Generator/test/TFIPT_t1.py index 12fa31f3a..f7310c3b4 100644 --- a/Cassiopee/Generator/test/TFIPT_t1.py +++ b/Cassiopee/Generator/test/TFIPT_t1.py @@ -10,7 +10,7 @@ pts = D.polyline([(0.,0.,0.),(-2,2,0),(-3,3,0.),(2,5,0.),(0.,7,0.)]) b1 = D.bezier(pts) pts = D.polyline([(5.,0.,0.),( 3,2,0),( 2,3,0.),(6,5,0.),(5.,7.,0.)]) -b2 = D.bezier( pts ) +b2 = D.bezier( pts ) # Discretisation reguliere de chaque ligne Ni = 20; Nj = 10 diff --git a/Cassiopee/Generator/test/TFIPT_t2.py b/Cassiopee/Generator/test/TFIPT_t2.py index 26896f669..3f56919e1 100644 --- a/Cassiopee/Generator/test/TFIPT_t2.py +++ b/Cassiopee/Generator/test/TFIPT_t2.py @@ -4,10 +4,10 @@ import KCore.test as test xo = 0.; yo = 0.; zo = 0. -nx = 21; ny = 21; nz = 21 +nx = 21; ny = 21; nz = 21 hx = 1./(nx-1); hy = 1./(ny-1); hz = 1./(nz-1) -# grilles z = cste +# grilles z = cste fzmin = G.cart((xo,yo,zo), (hx,hy,1.), (nx,ny,1)) fzmax = T.translate(fzmin, (0.,0.,1.)) diff --git a/Cassiopee/Generator/test/TFI_t1.py b/Cassiopee/Generator/test/TFI_t1.py index 153642c35..1a3e3680a 100644 --- a/Cassiopee/Generator/test/TFI_t1.py +++ b/Cassiopee/Generator/test/TFI_t1.py @@ -10,27 +10,27 @@ P3 = (5,7,0) # Geometrie -d1 = D.line(P0, P1) +d1 = D.line(P0, P1) d2 = D.line(P2, P3) pts = C.array('x,y,z', 5, 1, 1) x = pts[1][0]; y = pts[1][1]; z = pts[1][2] -x[0 ] = 0. ; y[0] = 0.; -x[1 ] =-2. ; y[1] = 2.; +x[0 ] = 0. ; y[0] = 0.; +x[1 ] =-2. ; y[1] = 2.; x[2 ] =-3. ; y[2] = 3.; -x[3 ] = 2. ; y[3] = 5.; +x[3 ] = 2. ; y[3] = 5.; x[4 ] = 0. ; y[4] = 7.; b1 = D.bezier(pts) # pts = C.array('x,y,z', 5, 1, 1) x = pts[1][0]; y = pts[1][1]; z = pts[1][2] x[0 ] = 5.; y[ 0 ] = 0.; -x[1 ] = 3.; y[ 1 ] = 2.; -x[2 ] = 2.; y[ 2 ] = 3.; -x[3 ] = 6.; y[ 3 ] = 5.; -x[4 ] = 5.; y[ 4 ] = 7.; +x[1 ] = 3.; y[ 1 ] = 2.; +x[2 ] = 2.; y[ 2 ] = 3.; +x[3 ] = 6.; y[ 3 ] = 5.; +x[4 ] = 5.; y[ 4 ] = 7.; -b2 = D.bezier( pts ) +b2 = D.bezier( pts ) # Discretisation reguliere de chaque ligne Ni = 20; Nj = 10 diff --git a/Cassiopee/Generator/test/TFI_t2.py b/Cassiopee/Generator/test/TFI_t2.py index 6afa94835..6f11696f8 100644 --- a/Cassiopee/Generator/test/TFI_t2.py +++ b/Cassiopee/Generator/test/TFI_t2.py @@ -4,10 +4,10 @@ import KCore.test as test xo = 0.; yo = 0.; zo = 0. -nx = 21; ny = 21; nz = 21 +nx = 21; ny = 21; nz = 21 hx = 1./(nx-1); hy = 1./(ny-1); hz = 1./(nz-1) -# grilles z = cste +# grilles z = cste fzmin = G.cart((xo,yo,zo), (hx,hy,1.), (nx,ny,1)) fzmax = T.translate(fzmin, (0.,0.,1.)) diff --git a/Cassiopee/Generator/test/TTM.py b/Cassiopee/Generator/test/TTM.py index 1297143a9..5b0fc35f1 100644 --- a/Cassiopee/Generator/test/TTM.py +++ b/Cassiopee/Generator/test/TTM.py @@ -22,7 +22,7 @@ x[2] = 2.; y[ 2 ] = 3.; z[ 2 ] = 0. x[3] = 6.; y[ 3 ] = 5.; z[ 3 ] = 0. x[4] = 5.; y[ 4 ] = 7.; z[ 4 ] = 0. -b2 = D.bezier( pts ) +b2 = D.bezier( pts ) C.convertArrays2File([d1, d2, b1, b2], 'geom.plt') # Regular discretision of each line diff --git a/Cassiopee/Generator/test/TTMPT_t1.py b/Cassiopee/Generator/test/TTMPT_t1.py index 6761771a3..03a2860de 100644 --- a/Cassiopee/Generator/test/TTMPT_t1.py +++ b/Cassiopee/Generator/test/TTMPT_t1.py @@ -9,7 +9,7 @@ P3 = (5,7,1) # Geometrie -d1 = D.line(P0, P1) +d1 = D.line(P0, P1) d2 = D.line(P2, P3) P0 = ( 0,0,1); P1 = (-2,2,1); P2 = (-3,3,1); P3 = (2,5,1); P4 = ( 0,7,1) @@ -18,7 +18,7 @@ P0 = (5,0,1); P1 = (3,2,1); P2 = (2,3,1); P3 = (6,5,1); P4 = (5,7,1) pts = D.polyline([P0,P1,P2,P3,P4]) -b2 = D.bezier(pts) +b2 = D.bezier(pts) # Discretisation reguliere de chaque ligne Ni = 20; Nj = 10 diff --git a/Cassiopee/Generator/test/TTM_t1.py b/Cassiopee/Generator/test/TTM_t1.py index 2d13499c3..6e75c9975 100644 --- a/Cassiopee/Generator/test/TTM_t1.py +++ b/Cassiopee/Generator/test/TTM_t1.py @@ -10,7 +10,7 @@ P3 = (5,7,0) # Geometrie -d1 = D.line(P0, P1) +d1 = D.line(P0, P1) d2 = D.line(P2, P3) pts = C.array('x,y,z', 5, 1, 1) x = pts[1][0]; y = pts[1][1]; z = pts[1][2] @@ -29,7 +29,7 @@ x[3] = 6.; y[3] = 5.; z[3] = 0. x[4] = 5.; y[4] = 7.; z[4] = 0. -b2 = D.bezier( pts ) +b2 = D.bezier( pts ) # Discretisation reguliere de chaque ligne Ni = 20; Nj = 10 diff --git a/Cassiopee/Generator/test/adaptOctree.py b/Cassiopee/Generator/test/adaptOctree.py index 7db20dd7b..ab1668a04 100644 --- a/Cassiopee/Generator/test/adaptOctree.py +++ b/Cassiopee/Generator/test/adaptOctree.py @@ -1,4 +1,4 @@ -# - adaptOctree (array) - +# - adaptOctree (array) - import Generator as G import Converter as C import Geom as D diff --git a/Cassiopee/Generator/test/adaptOctreePT.py b/Cassiopee/Generator/test/adaptOctreePT.py index d721c1ef5..614be7719 100644 --- a/Cassiopee/Generator/test/adaptOctreePT.py +++ b/Cassiopee/Generator/test/adaptOctreePT.py @@ -1,4 +1,4 @@ -# - adaptOctree (pyTree) - +# - adaptOctree (pyTree) - import Generator.PyTree as G import Converter.PyTree as C import Geom.PyTree as D diff --git a/Cassiopee/Generator/test/adaptOctreePT_t1.py b/Cassiopee/Generator/test/adaptOctreePT_t1.py index a87549bca..ee373781e 100644 --- a/Cassiopee/Generator/test/adaptOctreePT_t1.py +++ b/Cassiopee/Generator/test/adaptOctreePT_t1.py @@ -1,4 +1,4 @@ -# - adaptOctree (pyTree) - +# - adaptOctree (pyTree) - import Generator.PyTree as G import Converter.PyTree as C import Geom.PyTree as D diff --git a/Cassiopee/Generator/test/adaptOctreePT_t2.py b/Cassiopee/Generator/test/adaptOctreePT_t2.py index e87e60095..4c6b724ed 100644 --- a/Cassiopee/Generator/test/adaptOctreePT_t2.py +++ b/Cassiopee/Generator/test/adaptOctreePT_t2.py @@ -1,4 +1,4 @@ -# - adaptOctree (pyTree) - +# - adaptOctree (pyTree) - import Generator.PyTree as G import Converter.PyTree as C import Geom.PyTree as D diff --git a/Cassiopee/Generator/test/adaptOctree_t1.py b/Cassiopee/Generator/test/adaptOctree_t1.py index ee2c27e7e..eecb1c1f4 100644 --- a/Cassiopee/Generator/test/adaptOctree_t1.py +++ b/Cassiopee/Generator/test/adaptOctree_t1.py @@ -1,4 +1,4 @@ -# - adaptOctree (array) - +# - adaptOctree (array) - import Generator as G import Converter as C import Geom as D diff --git a/Cassiopee/Generator/test/adaptOctree_t2.py b/Cassiopee/Generator/test/adaptOctree_t2.py index 38509d8e4..92167e461 100644 --- a/Cassiopee/Generator/test/adaptOctree_t2.py +++ b/Cassiopee/Generator/test/adaptOctree_t2.py @@ -1,4 +1,4 @@ -# - adaptOctree (array) - +# - adaptOctree (array) - import Generator as G import Converter as C import Geom as D diff --git a/Cassiopee/Generator/test/addNormalLayersPT.py b/Cassiopee/Generator/test/addNormalLayersPT.py index 3017a807c..a121d5fab 100644 --- a/Cassiopee/Generator/test/addNormalLayersPT.py +++ b/Cassiopee/Generator/test/addNormalLayersPT.py @@ -3,7 +3,7 @@ import Converter.PyTree as C import Geom.PyTree as D -d = G.cart((0.,0.,0.), (0.1,1,1),(3,1,1)) +d = G.cart((0.,0.,0.), (0.1,1,1),(3,1,1)) a = D.sphere((0,0,0), 1, 50) b = G.addNormalLayers(a, d) C.convertPyTree2File(b, 'out.cgns') diff --git a/Cassiopee/Generator/test/addNormalLayersPT_t1.py b/Cassiopee/Generator/test/addNormalLayersPT_t1.py index 1f8d2eb57..b95db9980 100644 --- a/Cassiopee/Generator/test/addNormalLayersPT_t1.py +++ b/Cassiopee/Generator/test/addNormalLayersPT_t1.py @@ -4,8 +4,8 @@ import Geom.PyTree as D import KCore.test as test -# sur une zone structuree -d = G.cart((0.1,0.,0.), (0.1,1,1),(2,1,1)) +# sur une zone structuree +d = G.cart((0.1,0.,0.), (0.1,1,1),(2,1,1)) a = D.sphere((0,0,0), 1, 50 ) a = G.addNormalLayers(a, d) test.testT(a,1) @@ -23,7 +23,7 @@ test.testT(a,3) # sur une liste de zones structurees -d = G.cart((0.,0.,0.), (0.1,1,1),(3,1,1)) +d = G.cart((0.,0.,0.), (0.1,1,1),(3,1,1)) a = D.sphere6((0,0,0), 1, 20 ) a = C.initVars(a, 'Density',2.); a = C.initVars(a, 'centers:cellN',1.) a = G.addNormalLayers(a, d) diff --git a/Cassiopee/Generator/test/addNormalLayersPT_t2.py b/Cassiopee/Generator/test/addNormalLayersPT_t2.py index 109b2ae2a..da91ecadc 100644 --- a/Cassiopee/Generator/test/addNormalLayersPT_t2.py +++ b/Cassiopee/Generator/test/addNormalLayersPT_t2.py @@ -4,8 +4,8 @@ import Geom.PyTree as D import KCore.test as test -# sur une zone structuree -d = G.cart((0.1,0.,0.), (0.1,1,1),(2,1,1)) +# sur une zone structuree +d = G.cart((0.1,0.,0.), (0.1,1,1),(2,1,1)) a = D.sphere((0,0,0), 1, 50 ) a = G.addNormalLayers(a, d, niter=2) test.testT(a,1) @@ -23,7 +23,7 @@ test.testT(a,3) # sur une liste de zones structurees -d = G.cart((0.,0.,0.), (0.1,1,1),(3,1,1)) +d = G.cart((0.,0.,0.), (0.1,1,1),(3,1,1)) a = D.sphere6((0,0,0), 1, 20 ) a = C.initVars(a, 'Density',2.); a = C.initVars(a, 'centers:cellN',1.) a = G.addNormalLayers(a, d, niter=2) diff --git a/Cassiopee/Generator/test/addNormalLayers_t2.py b/Cassiopee/Generator/test/addNormalLayers_t2.py index 6a433e709..afa02d723 100644 --- a/Cassiopee/Generator/test/addNormalLayers_t2.py +++ b/Cassiopee/Generator/test/addNormalLayers_t2.py @@ -31,7 +31,7 @@ # Structure (i-array) a = D.line((0,0,0),(10,1,0)) a = G.addNormalLayers(a, d, niter=4) -test.testA([a], 4) +test.testA([a], 4) # # list of arrays # diff --git a/Cassiopee/Generator/test/addPointInDistribution_t1.py b/Cassiopee/Generator/test/addPointInDistribution_t1.py index 765b2f385..1a8e5c162 100644 --- a/Cassiopee/Generator/test/addPointInDistribution_t1.py +++ b/Cassiopee/Generator/test/addPointInDistribution_t1.py @@ -7,4 +7,3 @@ a = G.cart((0,0,0), (1./(Ni-1), 0.5/(Nj-1),1), (Ni,Nj,1)) b = G.addPointInDistribution( a, Ni ) test.testA([b], 1) - diff --git a/Cassiopee/Generator/test/auto.py b/Cassiopee/Generator/test/auto.py index a4302b01c..23d4a0936 100644 --- a/Cassiopee/Generator/test/auto.py +++ b/Cassiopee/Generator/test/auto.py @@ -1,5 +1,5 @@ #============================================================================== -# - The *Cassiopee* Project - +# - The *Cassiopee* Project - # Template file for automatic mesh generation # (c) 2005-2009 by ONERA # Input : a geometry 1D curve @@ -52,7 +52,7 @@ # if (hj > hi*l): # print("Warning, mesh generator may be unstable because") # print("cell height is greater than cell length") - temp1 = x + temp1 = x angleLeft = 180. angleRight = 180. @@ -92,4 +92,3 @@ temp1 = G.hyper2D3(temp1, distrib, "C", angleLeft, angleRight) C.convertArrays2File([temp1], "mesh"+repr(c)+".plt", "bin_tp") c += 1 - diff --git a/Cassiopee/Generator/test/bbox.py b/Cassiopee/Generator/test/bbox.py index f0756d5e1..a013cc52a 100644 --- a/Cassiopee/Generator/test/bbox.py +++ b/Cassiopee/Generator/test/bbox.py @@ -4,4 +4,3 @@ b = G.cart((12.,0.,0.),(0.1,0.1,1.),(20,20,20)) print(G.bbox(a)) print(G.bbox([a, b])) - diff --git a/Cassiopee/Generator/test/bboxIntersectionPT_t2.py b/Cassiopee/Generator/test/bboxIntersectionPT_t2.py index 2e56ffb39..7a1bd4713 100644 --- a/Cassiopee/Generator/test/bboxIntersectionPT_t2.py +++ b/Cassiopee/Generator/test/bboxIntersectionPT_t2.py @@ -3,9 +3,9 @@ import Transform.PyTree as T import KCore.test as test -boxA = G.cartTetra((2,-1,0.5), (1,2,0.5), (2,2,2)) +boxA = G.cartTetra((2,-1,0.5), (1,2,0.5), (2,2,2)) -boxB = G.cartTetra((2,-1,0.5), (2,2,1), (2,2,2)) +boxB = G.cartTetra((2,-1,0.5), (2,2,1), (2,2,2)) boxB = T.rotate(boxB,(0,0,0),(10,5,-20)) AABB = G.BB(boxA) OBB = G.BB(boxB, method='OBB') @@ -18,4 +18,3 @@ intersect = G.bboxIntersection(AABB, OBB, tol=1e-10, isBB=True, method='OBB') test.testO(intersect,3) - diff --git a/Cassiopee/Generator/test/bboxIntersection_t2.py b/Cassiopee/Generator/test/bboxIntersection_t2.py index 378a13a9e..bae30498a 100644 --- a/Cassiopee/Generator/test/bboxIntersection_t2.py +++ b/Cassiopee/Generator/test/bboxIntersection_t2.py @@ -3,9 +3,9 @@ import Transform as T import KCore.test as test -boxA = G.cartTetra((2,-1,0.5), (1,2,0.5), (2,2,2)) +boxA = G.cartTetra((2,-1,0.5), (1,2,0.5), (2,2,2)) -boxB = G.cartTetra((2,-1,0.5), (2,2,1), (2,2,2)) +boxB = G.cartTetra((2,-1,0.5), (2,2,1), (2,2,2)) boxB = T.rotate(boxB,(0,0,0),(10,5,-20)) AABB = G.BB(boxA) OBB = G.BB(boxB, method='OBB') @@ -18,4 +18,3 @@ intersect = G.bboxIntersection(AABB, OBB, tol=1e-10, isBB=True, method='OBB') test.testO(intersect,3) - diff --git a/Cassiopee/Generator/test/bboxOfCellsPT_t2.py b/Cassiopee/Generator/test/bboxOfCellsPT_t2.py index e8f48e2f5..2953038c1 100644 --- a/Cassiopee/Generator/test/bboxOfCellsPT_t2.py +++ b/Cassiopee/Generator/test/bboxOfCellsPT_t2.py @@ -67,4 +67,3 @@ t[2][1] = C.addState(t[2][1], 'Mach', 0.6) t = G.bboxOfCells(t) test.testT(t,7) - diff --git a/Cassiopee/Generator/test/bboxPT.py b/Cassiopee/Generator/test/bboxPT.py index 3f2e94f89..7c3f54f56 100644 --- a/Cassiopee/Generator/test/bboxPT.py +++ b/Cassiopee/Generator/test/bboxPT.py @@ -2,4 +2,3 @@ import Generator.PyTree as G a = G.cart((0.,0.,0.),(0.1,0.1,1.),(20,20,20)) print(G.bbox(a)) - diff --git a/Cassiopee/Generator/test/cartHexa.py b/Cassiopee/Generator/test/cartHexa.py index 354d8f580..bc2d0c64b 100644 --- a/Cassiopee/Generator/test/cartHexa.py +++ b/Cassiopee/Generator/test/cartHexa.py @@ -4,4 +4,3 @@ a = G.cartHexa((0.,0.,0.), (0.1,0.1,0.2), (10,10,10)) C.convertArrays2File([a], 'out.plt') - diff --git a/Cassiopee/Generator/test/cartPyra.py b/Cassiopee/Generator/test/cartPyra.py index cf103f78a..135179db4 100755 --- a/Cassiopee/Generator/test/cartPyra.py +++ b/Cassiopee/Generator/test/cartPyra.py @@ -4,4 +4,3 @@ a = G.cartPyra((0.,0.,0.), (1,1,1), (20,20,20)) C.convertArrays2File(a, 'out.tp') - diff --git a/Cassiopee/Generator/test/close.py b/Cassiopee/Generator/test/close.py index cba296fa7..a3d72152d 100644 --- a/Cassiopee/Generator/test/close.py +++ b/Cassiopee/Generator/test/close.py @@ -2,7 +2,7 @@ import Converter as C import Generator as G -a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0.01, 10., (20,20,10)) +a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0.01, 10., (20,20,10)) a = C.convertArray2Tetra(a) a = G.close(a, 1.e-3) C.convertArrays2File(a, 'out.plt') diff --git a/Cassiopee/Generator/test/closePT_t1.py b/Cassiopee/Generator/test/closePT_t1.py index 41abc0daf..b17d4c51c 100644 --- a/Cassiopee/Generator/test/closePT_t1.py +++ b/Cassiopee/Generator/test/closePT_t1.py @@ -4,7 +4,7 @@ import KCore.test as test # test structure -a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0.01, 10., (20,20,10)) +a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0.01, 10., (20,20,10)) C._addBC2Zone(a, 'match1','BCMatch','imin',a,'imax',[1,2,3]) C._addBC2Zone(a, 'match2','BCMatch','imax',a,'imin',[1,2,3]) C._fillEmptyBCWith(a, 'wall','BCWall') diff --git a/Cassiopee/Generator/test/closePT_t2.py b/Cassiopee/Generator/test/closePT_t2.py index 30063aa48..2863f8a8a 100644 --- a/Cassiopee/Generator/test/closePT_t2.py +++ b/Cassiopee/Generator/test/closePT_t2.py @@ -30,7 +30,7 @@ # test 3D cylindre HEXA ni = 20; nj = 20; nk = 5 -a0 = G.cylinder((0.,0.,0.), 0., 1., 0., 359, 1., (ni,nj,nk)) +a0 = G.cylinder((0.,0.,0.), 0., 1., 0., 359, 1., (ni,nj,nk)) a0 = T.subzone(a0,(1,10,1),(20,13,5)) a = C.convertArray2Hexa(a0) C._addVars(a,'Density'); C._initVars(a,'centers:cellN',1.) diff --git a/Cassiopee/Generator/test/close_t1.py b/Cassiopee/Generator/test/close_t1.py index 2659e4cd2..00b49367d 100644 --- a/Cassiopee/Generator/test/close_t1.py +++ b/Cassiopee/Generator/test/close_t1.py @@ -3,7 +3,7 @@ import Generator as G import KCore.test as test -a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0.01, 10., (20,20,10)) +a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0.01, 10., (20,20,10)) a = C.addVars(a, 'F') # test structure diff --git a/Cassiopee/Generator/test/collarMesh.py b/Cassiopee/Generator/test/collarMesh.py index 773272465..a67383844 100644 --- a/Cassiopee/Generator/test/collarMesh.py +++ b/Cassiopee/Generator/test/collarMesh.py @@ -1,4 +1,4 @@ -# - collarMesh (array) - +# - collarMesh (array) - import Converter as C import Geom as D import Transform as T diff --git a/Cassiopee/Generator/test/collarMeshPT.py b/Cassiopee/Generator/test/collarMeshPT.py index d7730cec0..467be9987 100644 --- a/Cassiopee/Generator/test/collarMeshPT.py +++ b/Cassiopee/Generator/test/collarMeshPT.py @@ -1,4 +1,4 @@ -# - collarMesh (pyTree) +# - collarMesh (pyTree) import Converter.PyTree as C import Geom.PyTree as D import Transform.PyTree as T diff --git a/Cassiopee/Generator/test/constrainedDelaunay.py b/Cassiopee/Generator/test/constrainedDelaunay.py index 28327a1a3..01ed03d7a 100644 --- a/Cassiopee/Generator/test/constrainedDelaunay.py +++ b/Cassiopee/Generator/test/constrainedDelaunay.py @@ -7,5 +7,5 @@ A = D.text1D('CASSIOPEE') A = C.convertArray2Tetra(A); a = T.join(A) # Triangulation respecting given contour -tri = G.constrainedDelaunay(a) +tri = G.constrainedDelaunay(a) C.convertArrays2File([a,tri], "out.plt") diff --git a/Cassiopee/Generator/test/cylinder.py b/Cassiopee/Generator/test/cylinder.py index 5bb9467e9..b824f021c 100644 --- a/Cassiopee/Generator/test/cylinder.py +++ b/Cassiopee/Generator/test/cylinder.py @@ -1,5 +1,5 @@ # - cylinder (array) - import Generator as G import Converter as C -a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,50,30)) +a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,50,30)) C.convertArrays2File([a], "out.plt") diff --git a/Cassiopee/Generator/test/cylinder2.py b/Cassiopee/Generator/test/cylinder2.py index 345877ff0..a5a34087d 100644 --- a/Cassiopee/Generator/test/cylinder2.py +++ b/Cassiopee/Generator/test/cylinder2.py @@ -6,4 +6,3 @@ z = G.cart((0.,0.,0.), (0.1, 1., 1.), (11, 1, 1)) cyl = G.cylinder2( (0.,0.,0.), 0.5, 1., 360., 0., 10., r, teta, z) C.convertArrays2File([cyl], "out.plt") - diff --git a/Cassiopee/Generator/test/cylinder3PT_t1.py b/Cassiopee/Generator/test/cylinder3PT_t1.py index bc8389d08..22717eed1 100644 --- a/Cassiopee/Generator/test/cylinder3PT_t1.py +++ b/Cassiopee/Generator/test/cylinder3PT_t1.py @@ -5,4 +5,3 @@ xz = G.cart((0.1,0.,0.), (0.1,1.,0.2), (20, 1, 30)) cyl = G.cylinder3(xz, 0., 90., teta) test.testT(cyl,1) - diff --git a/Cassiopee/Generator/test/cylinder3_t1.py b/Cassiopee/Generator/test/cylinder3_t1.py index 1d5a5b6e6..95e7f2aac 100644 --- a/Cassiopee/Generator/test/cylinder3_t1.py +++ b/Cassiopee/Generator/test/cylinder3_t1.py @@ -5,4 +5,3 @@ xz = G.cart((0.1,0.,0.), (0.1,1.,0.2), (20, 1, 30)) cyl = G.cylinder3( xz, 0., 90., teta) test.testA([cyl],1) - diff --git a/Cassiopee/Generator/test/cylinderPT.py b/Cassiopee/Generator/test/cylinderPT.py index 3c8a9bcd0..66a1dd524 100644 --- a/Cassiopee/Generator/test/cylinderPT.py +++ b/Cassiopee/Generator/test/cylinderPT.py @@ -1,5 +1,5 @@ # - cylinder (pyTree) - import Converter.PyTree as C import Generator.PyTree as G -a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,50,30)) +a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,50,30)) C.convertPyTree2File(a, 'out.cgns') diff --git a/Cassiopee/Generator/test/cylinderPT_t1.py b/Cassiopee/Generator/test/cylinderPT_t1.py index 85f7c9c56..239be6f0c 100644 --- a/Cassiopee/Generator/test/cylinderPT_t1.py +++ b/Cassiopee/Generator/test/cylinderPT_t1.py @@ -2,6 +2,6 @@ import Generator.PyTree as G import KCore.test as test -a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,50,30)) +a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,50,30)) test.testT(a, 1) test.writeCoverage(100) diff --git a/Cassiopee/Generator/test/cylinder_t1.py b/Cassiopee/Generator/test/cylinder_t1.py index e345dea61..708c3c66e 100644 --- a/Cassiopee/Generator/test/cylinder_t1.py +++ b/Cassiopee/Generator/test/cylinder_t1.py @@ -3,13 +3,13 @@ import KCore.test as test # 3D -a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,50,30)) +a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,50,30)) test.testA([a], 1) # 2D -a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,50,1)) +a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,50,1)) test.testA([a], 2) # 1D -a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,1,1)) +a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,1,1)) test.testA([a], 3) diff --git a/Cassiopee/Generator/test/densify_t1.py b/Cassiopee/Generator/test/densify_t1.py index f1a0a0b2b..21ca6e793 100644 --- a/Cassiopee/Generator/test/densify_t1.py +++ b/Cassiopee/Generator/test/densify_t1.py @@ -14,4 +14,3 @@ c = C.initVars(a,'F',1.) c = G.densify(a, 1.05) test.testA([c], 2) - diff --git a/Cassiopee/Generator/test/enforceCurvature2PT_t1.py b/Cassiopee/Generator/test/enforceCurvature2PT_t1.py index 5abad2d9e..5682fc8ec 100644 --- a/Cassiopee/Generator/test/enforceCurvature2PT_t1.py +++ b/Cassiopee/Generator/test/enforceCurvature2PT_t1.py @@ -4,7 +4,7 @@ import Generator.PyTree as G import KCore.test as test -# Cas 1 : courbure constante +# Cas 1 : courbure constante a = D.circle((0,0,0),0.1,N=51) ni = 101; db = G.cart((0,0,0),(1./(ni-1),1,1),(ni,1,1)) db = C.addBC2Zone(db, 'wall1', 'BCWall', 'jmin') diff --git a/Cassiopee/Generator/test/enforceCurvature2_t1.py b/Cassiopee/Generator/test/enforceCurvature2_t1.py index cb1ea4c3c..025ca6bc8 100644 --- a/Cassiopee/Generator/test/enforceCurvature2_t1.py +++ b/Cassiopee/Generator/test/enforceCurvature2_t1.py @@ -4,7 +4,7 @@ import Generator as G import KCore.test as test -# Cas 1 : courbure constante +# Cas 1 : courbure constante a = D.circle((0,0,0),0.1,N=51) ni = 101; distrib = G.cart((0,0,0),(1./(ni-1),1,1),(ni,1,1)) distrib2 = G.enforceCurvature2(distrib,a) diff --git a/Cassiopee/Generator/test/enforceMoinsY_t1.py b/Cassiopee/Generator/test/enforceMoinsY_t1.py index c3156da89..cc353500a 100644 --- a/Cassiopee/Generator/test/enforceMoinsY_t1.py +++ b/Cassiopee/Generator/test/enforceMoinsY_t1.py @@ -10,4 +10,3 @@ # Exact nb of added pts b = G.enforceMoinsY(a, 1.e-3, 10,15) test.testA([b],2) - diff --git a/Cassiopee/Generator/test/enforceXPT_t1.py b/Cassiopee/Generator/test/enforceXPT_t1.py index a5e86ea36..08736ff16 100644 --- a/Cassiopee/Generator/test/enforceXPT_t1.py +++ b/Cassiopee/Generator/test/enforceXPT_t1.py @@ -18,7 +18,7 @@ a2 = G.enforceX(a, 0.3, 0.001, 13,25) test.testT(a2,2) -# 3D +# 3D Ni = 50; Nj = 50; Nk = 2 a = G.cart((0,0,0), (1./(Ni-1), 0.5/(Nj-1),1), (Ni,Nj,Nk)) a = C.addBC2Zone(a, 'overlap1','BCOverlap','imin') diff --git a/Cassiopee/Generator/test/enforceZ.py b/Cassiopee/Generator/test/enforceZ.py index cb4bab84c..490f61c3f 100644 --- a/Cassiopee/Generator/test/enforceZ.py +++ b/Cassiopee/Generator/test/enforceZ.py @@ -7,4 +7,3 @@ a = G.cart((0,0,0), (1./(Ni-1), 1., 0.5/(Nk-1)), (Ni,Nj,Nk)) b = G.enforceZ(a, 0.3, 0.001, 10,15) C.convertArrays2File([b], "out.plt") - diff --git a/Cassiopee/Generator/test/enforceZ_t1.py b/Cassiopee/Generator/test/enforceZ_t1.py index 6a3a22843..19d1ffdc5 100644 --- a/Cassiopee/Generator/test/enforceZ_t1.py +++ b/Cassiopee/Generator/test/enforceZ_t1.py @@ -2,7 +2,7 @@ import Generator as G import KCore.test as test -# Distribution : exact nb of added points +# Distribution : exact nb of added points Ni = 50; Nj = 1; Nk = 50 a = G.cart((0,0,0), (1./(Ni-1), 1., 0.5/(Nk-1)), (Ni,Nj,Nk)) b = G.enforceZ(a, 0.3, 0.001, 10,15) diff --git a/Cassiopee/Generator/test/expandLayer.py b/Cassiopee/Generator/test/expandLayer.py index 671cc391b..73235f22f 100644 --- a/Cassiopee/Generator/test/expandLayer.py +++ b/Cassiopee/Generator/test/expandLayer.py @@ -3,7 +3,7 @@ import Converter as C import Geom as D -s = D.circle((0.,0.,0.), 1., N=100) +s = D.circle((0.,0.,0.), 1., N=100) o = G.octree([s], [0.1], dfar=1., balancing=1) o2 = G.expandLayer(o, level=0) C.convertArrays2File([o, o2], "out.plt") diff --git a/Cassiopee/Generator/test/expandLayerPT.py b/Cassiopee/Generator/test/expandLayerPT.py index b01430626..98e073dce 100644 --- a/Cassiopee/Generator/test/expandLayerPT.py +++ b/Cassiopee/Generator/test/expandLayerPT.py @@ -3,7 +3,7 @@ import Converter.PyTree as C import Geom.PyTree as D -s = D.circle((0.,0.,0.),1.,N=100) +s = D.circle((0.,0.,0.),1.,N=100) o = G.octree([s], [0.1], dfar=1., balancing=1) o2 = G.expandLayer(o, level=0) C.convertPyTree2File(o2, 'out.cgns') diff --git a/Cassiopee/Generator/test/expandLayerPT_t1.py b/Cassiopee/Generator/test/expandLayerPT_t1.py index a84e492f7..e19a12a65 100644 --- a/Cassiopee/Generator/test/expandLayerPT_t1.py +++ b/Cassiopee/Generator/test/expandLayerPT_t1.py @@ -4,13 +4,13 @@ import KCore.test as test # 2D -s = D.circle((0.,0.,0.),1.,N=100) -o = G.octree([s], [0.1], dfar = 1.,balancing=1) +s = D.circle((0.,0.,0.),1.,N=100) +o = G.octree([s], [0.1], dfar=1.,balancing=1) o2 = G.expandLayer(o, level=0) test.testT(o2,1) # 3D -s = D.sphere((0.,0.,0.),1.,N=100) -o = G.octree([s], [0.1], dfar = 1.,balancing=1) +s = D.sphere((0.,0.,0.),1.,N=100) +o = G.octree([s], [0.1], dfar=1.,balancing=1) o2 = G.expandLayer(o,level=0) test.testT(o2,2) diff --git a/Cassiopee/Generator/test/expandLayer_t1.py b/Cassiopee/Generator/test/expandLayer_t1.py index 56d22c27b..a6ab6c2e5 100644 --- a/Cassiopee/Generator/test/expandLayer_t1.py +++ b/Cassiopee/Generator/test/expandLayer_t1.py @@ -4,24 +4,24 @@ import KCore.test as test # 2D -s = D.circle((0.,0.,0.),1.,N=100) -o = G.octree([s], [0.1], dfar = 1.,balancing=1) +s = D.circle((0.,0.,0.),1.,N=100) +o = G.octree([s], [0.1], dfar=1.,balancing=1) o2 = G.expandLayer(o,level=0,balancing=0) test.testA([o2],1) # 3D -s = D.sphere((0.,0.,0.),1.,N=100) -o = G.octree([s], [0.1], dfar = 1.,balancing=1) +s = D.sphere((0.,0.,0.),1.,N=100) +o = G.octree([s], [0.1], dfar=1.,balancing=1) o2 = G.expandLayer(o,level=0,balancing=0) test.testA([o2],2) # 2D -s = D.circle((0.,0.,0.),1.,N=100) -o = G.octree([s], [0.1], dfar = 1.,balancing=1) +s = D.circle((0.,0.,0.),1.,N=100) +o = G.octree([s], [0.1], dfar=1.,balancing=1) o2 = G.expandLayer(o,level=0,balancing=1) test.testA([o2],3) # # 3D -s = D.sphere((0.,0.,0.),1.,N=100) -o = G.octree([s], [0.1], dfar = 1.,balancing=1) +s = D.sphere((0.,0.,0.),1.,N=100) +o = G.octree([s], [0.1], dfar=1.,balancing=1) o2 = G.expandLayer(o,level=0,balancing=1) test.testA([o2],4) diff --git a/Cassiopee/Generator/test/fittingPlasterPT.py b/Cassiopee/Generator/test/fittingPlasterPT.py index adfcf7a1c..7da991d8d 100755 --- a/Cassiopee/Generator/test/fittingPlasterPT.py +++ b/Cassiopee/Generator/test/fittingPlasterPT.py @@ -8,4 +8,3 @@ a = G.close(a) b = G.fittingPlaster(a, bumpFactor=0.5) C.convertPyTree2File(b, 'out.cgns') - diff --git a/Cassiopee/Generator/test/fittingPlasterPT_t1.py b/Cassiopee/Generator/test/fittingPlasterPT_t1.py index 7f1fb26c5..856cb7349 100755 --- a/Cassiopee/Generator/test/fittingPlasterPT_t1.py +++ b/Cassiopee/Generator/test/fittingPlasterPT_t1.py @@ -10,4 +10,3 @@ b = G.fittingPlaster(a, bumpFactor=0.5) t = C.newPyTree(['Base',2]); t[2][1][2].append(b) test.testT(t) - diff --git a/Cassiopee/Generator/test/fittingPlaster_t1.py b/Cassiopee/Generator/test/fittingPlaster_t1.py index 2aef45fd3..f4e888e9a 100755 --- a/Cassiopee/Generator/test/fittingPlaster_t1.py +++ b/Cassiopee/Generator/test/fittingPlaster_t1.py @@ -9,4 +9,3 @@ a = G.close(a) b = G.fittingPlaster(a, bumpFactor=0.5) test.testA([b]) - diff --git a/Cassiopee/Generator/test/front2Hexa.py b/Cassiopee/Generator/test/front2Hexa.py index ce4c0ce91..2fc918ac4 100644 --- a/Cassiopee/Generator/test/front2Hexa.py +++ b/Cassiopee/Generator/test/front2Hexa.py @@ -17,7 +17,7 @@ celln = C.initVars(celln, 'cellN', 1.) # Masquage -cellno = X.blankCells([b], [celln], [a], blankingType=0, delta=1.e-10, dim=3) +cellno = X.blankCells([b], [celln], [a], blankingType=0, delta=1.e-10, dim=3) a = C.initVars(a, 'cellN', 1) b = C.addVars([b, cellno[0]]) diff --git a/Cassiopee/Generator/test/front2Struct.py b/Cassiopee/Generator/test/front2Struct.py index 08e4e0a7a..9a63d91ef 100644 --- a/Cassiopee/Generator/test/front2Struct.py +++ b/Cassiopee/Generator/test/front2Struct.py @@ -17,7 +17,7 @@ celln = C.initVars(celln, 'cellN', 1.) # Masquage -cellno = X.blankCells([b], [celln], [a], blankingType=0, delta=1.e-10, dim=3) +cellno = X.blankCells([b], [celln], [a], blankingType=0, delta=1.e-10, dim=3) a = C.initVars(a, 'cellN', 1) b = C.addVars([b, cellno[0]]) diff --git a/Cassiopee/Generator/test/gapsmanager_t1.py b/Cassiopee/Generator/test/gapsmanager_t1.py index 846950831..bb1558fe5 100644 --- a/Cassiopee/Generator/test/gapsmanager_t1.py +++ b/Cassiopee/Generator/test/gapsmanager_t1.py @@ -20,6 +20,6 @@ b = D.sphere6((0,0,0), 1, N=15) b = b[0] b = C.convertArray2Tetra(b) -b = T.rotate(b, (0,0,0), (0,0,1), 35.) +b = T.rotate(b, (0,0,0), (0,0,1), 35.) b = G.gapsmanager([a,b], mode=1) test.testA(b, 2) diff --git a/Cassiopee/Generator/test/gencartmb.py b/Cassiopee/Generator/test/gencartmb.py index 52e3a50a6..c8e19f24c 100644 --- a/Cassiopee/Generator/test/gencartmb.py +++ b/Cassiopee/Generator/test/gencartmb.py @@ -6,6 +6,6 @@ a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,50,30)) h = 1.e-1# Step of finest Cartesian grid Dfar = 10.# Extension of far boundaries -nlvl = [5,5,5] # Nb of points per level, except the 4th level (automatic) +nlvl = [5,5,5] # Nb of points per level, except the 4th level (automatic) cartGrids = G.gencartmb([a], h, Dfar, nlvl) C.convertArrays2File(cartGrids, 'out.plt') diff --git a/Cassiopee/Generator/test/gencartmb_t1.py b/Cassiopee/Generator/test/gencartmb_t1.py index aa2f78a93..cc02d5d6b 100644 --- a/Cassiopee/Generator/test/gencartmb_t1.py +++ b/Cassiopee/Generator/test/gencartmb_t1.py @@ -4,6 +4,6 @@ # 4 niveaux a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 1., (20,20,2)) -h = 1.e-1; Dfar = 10.; nlvl = [5,5,5] +h = 1.e-1; Dfar = 10.; nlvl = [5,5,5] A = G.gencartmb([a], h, Dfar, nlvl) test.testA(A, 1) diff --git a/Cassiopee/Generator/test/getAngleRegularityMap.py b/Cassiopee/Generator/test/getAngleRegularityMap.py index b8fdf2e04..efcbf4f8b 100644 --- a/Cassiopee/Generator/test/getAngleRegularityMap.py +++ b/Cassiopee/Generator/test/getAngleRegularityMap.py @@ -1,4 +1,4 @@ -# - getAngleRegularityMap (array) - +# - getAngleRegularityMap (array) - import Generator as G import Converter as C import Transform as T diff --git a/Cassiopee/Generator/test/getAngleRegularityMapPT.py b/Cassiopee/Generator/test/getAngleRegularityMapPT.py index 659a94fe9..dc3587c4a 100644 --- a/Cassiopee/Generator/test/getAngleRegularityMapPT.py +++ b/Cassiopee/Generator/test/getAngleRegularityMapPT.py @@ -1,4 +1,4 @@ -# - getAngleRegularityMap (pyTree) - +# - getAngleRegularityMap (pyTree) - import Generator.PyTree as G import Converter.PyTree as C import Transform.PyTree as T diff --git a/Cassiopee/Generator/test/getAngleRegularityMapPT_t1.py b/Cassiopee/Generator/test/getAngleRegularityMapPT_t1.py index d5370b2d0..358174311 100644 --- a/Cassiopee/Generator/test/getAngleRegularityMapPT_t1.py +++ b/Cassiopee/Generator/test/getAngleRegularityMapPT_t1.py @@ -1,4 +1,4 @@ -# - getAngleRegularityMap (pyTree) - +# - getAngleRegularityMap (pyTree) - import Generator.PyTree as G import Transform.PyTree as T import KCore.test as test diff --git a/Cassiopee/Generator/test/getAngleRegularityMapPT_t2.py b/Cassiopee/Generator/test/getAngleRegularityMapPT_t2.py index 682b072ca..344b960b1 100644 --- a/Cassiopee/Generator/test/getAngleRegularityMapPT_t2.py +++ b/Cassiopee/Generator/test/getAngleRegularityMapPT_t2.py @@ -1,4 +1,4 @@ -# - getAngleRegularityMap (pyTree) - +# - getAngleRegularityMap (pyTree) - import Generator.PyTree as G import Connector.PyTree as X import Geom.PyTree as D diff --git a/Cassiopee/Generator/test/getAngleRegularityMap_t1.py b/Cassiopee/Generator/test/getAngleRegularityMap_t1.py index df0c9a6dd..8726504c0 100644 --- a/Cassiopee/Generator/test/getAngleRegularityMap_t1.py +++ b/Cassiopee/Generator/test/getAngleRegularityMap_t1.py @@ -1,4 +1,4 @@ -# - getAngleRegularityMap (array) - +# - getAngleRegularityMap (array) - import Converter as C import Generator as G import Transform as T diff --git a/Cassiopee/Generator/test/getCircumCircleMap_t1.py b/Cassiopee/Generator/test/getCircumCircleMap_t1.py index f1f1fabe0..3bc5225ea 100644 --- a/Cassiopee/Generator/test/getCircumCircleMap_t1.py +++ b/Cassiopee/Generator/test/getCircumCircleMap_t1.py @@ -8,4 +8,3 @@ a = C.convertArray2Tetra(a) n = G.getCircumCircleMap(a) test.testA([n],1) - diff --git a/Cassiopee/Generator/test/getEdgeRatio_t1.py b/Cassiopee/Generator/test/getEdgeRatio_t1.py index 295fbdbab..b3b64f9fe 100644 --- a/Cassiopee/Generator/test/getEdgeRatio_t1.py +++ b/Cassiopee/Generator/test/getEdgeRatio_t1.py @@ -1,4 +1,4 @@ -# - getEdgeRatio (array) - +# - getEdgeRatio (array) - import Generator as G import KCore.test as test @@ -46,7 +46,7 @@ r = G.getEdgeRatio(a) test.testA([r],9) -# NGON +# NGON a = G.cartNGon((0,0,0),(0.1,1,1),(11,11,11)) r = G.getEdgeRatio(a) test.testA([r],10) diff --git a/Cassiopee/Generator/test/getInCircleMap_t1.py b/Cassiopee/Generator/test/getInCircleMap_t1.py index d70477820..8f6a2bd27 100644 --- a/Cassiopee/Generator/test/getInCircleMap_t1.py +++ b/Cassiopee/Generator/test/getInCircleMap_t1.py @@ -8,4 +8,3 @@ a = C.convertArray2Tetra(a) n = G.getInCircleMap(a) test.testA([n],1) - diff --git a/Cassiopee/Generator/test/getMaxLength_t1.py b/Cassiopee/Generator/test/getMaxLength_t1.py index d634d7f9b..9c242a9f8 100644 --- a/Cassiopee/Generator/test/getMaxLength_t1.py +++ b/Cassiopee/Generator/test/getMaxLength_t1.py @@ -1,4 +1,4 @@ -# - getMaxLength(array) - +# - getMaxLength(array) - import Generator as G import KCore.test as test @@ -46,7 +46,7 @@ r = G.getMaxLength(a) test.testA([r],9) -# NGON +# NGON a = G.cartNGon((0,0,0),(0.1,1,1),(11,11,11)) r = G.getMaxLength(a) test.testA([r],10) diff --git a/Cassiopee/Generator/test/getOrthogonalityMap.py b/Cassiopee/Generator/test/getOrthogonalityMap.py index 7bfcf62b9..081b40c2c 100644 --- a/Cassiopee/Generator/test/getOrthogonalityMap.py +++ b/Cassiopee/Generator/test/getOrthogonalityMap.py @@ -1,4 +1,4 @@ -# - getOrthogonalityMap (array) - +# - getOrthogonalityMap (array) - import Generator as G import Converter as C diff --git a/Cassiopee/Generator/test/getOrthogonalityMapPT.py b/Cassiopee/Generator/test/getOrthogonalityMapPT.py index f1846e449..1e454b421 100644 --- a/Cassiopee/Generator/test/getOrthogonalityMapPT.py +++ b/Cassiopee/Generator/test/getOrthogonalityMapPT.py @@ -1,4 +1,4 @@ -# - getOrthogonalityMap (pyTree) - +# - getOrthogonalityMap (pyTree) - import Generator.PyTree as G import Converter.PyTree as C diff --git a/Cassiopee/Generator/test/getOrthogonalityMapPT_t1.py b/Cassiopee/Generator/test/getOrthogonalityMapPT_t1.py index 94e87d440..fd68b45c9 100644 --- a/Cassiopee/Generator/test/getOrthogonalityMapPT_t1.py +++ b/Cassiopee/Generator/test/getOrthogonalityMapPT_t1.py @@ -1,4 +1,4 @@ -# - getOrthogonalityMap (pyTree) - +# - getOrthogonalityMap (pyTree) - import Generator.PyTree as G import Converter.PyTree as C import KCore.test as T diff --git a/Cassiopee/Generator/test/getOrthogonalityMap_t1.py b/Cassiopee/Generator/test/getOrthogonalityMap_t1.py index ee0130fd6..8fbf9d128 100644 --- a/Cassiopee/Generator/test/getOrthogonalityMap_t1.py +++ b/Cassiopee/Generator/test/getOrthogonalityMap_t1.py @@ -1,4 +1,4 @@ -# - getOrthogonalityMap (array) - +# - getOrthogonalityMap (array) - import Generator as G import Converter as C import KCore.test as test @@ -23,4 +23,3 @@ ortho = G.getOrthogonalityMap(a) ortho = C.addVars([ac, ortho]) test.testA([ortho], 3) - diff --git a/Cassiopee/Generator/test/getRegularityMap.py b/Cassiopee/Generator/test/getRegularityMap.py index 7bd734199..1b3223988 100644 --- a/Cassiopee/Generator/test/getRegularityMap.py +++ b/Cassiopee/Generator/test/getRegularityMap.py @@ -1,4 +1,4 @@ -# - getRegularityMap (array) - +# - getRegularityMap (array) - import Generator as G import Converter as C diff --git a/Cassiopee/Generator/test/getRegularityMapPT.py b/Cassiopee/Generator/test/getRegularityMapPT.py index fa13aaa24..8fd817f3a 100644 --- a/Cassiopee/Generator/test/getRegularityMapPT.py +++ b/Cassiopee/Generator/test/getRegularityMapPT.py @@ -1,4 +1,4 @@ -# - getRegularityMapPT (pyTree) - +# - getRegularityMapPT (pyTree) - import Generator.PyTree as G import Converter.PyTree as C diff --git a/Cassiopee/Generator/test/getRegularityMapPT_t1.py b/Cassiopee/Generator/test/getRegularityMapPT_t1.py index d724dfa6f..3468e21c0 100644 --- a/Cassiopee/Generator/test/getRegularityMapPT_t1.py +++ b/Cassiopee/Generator/test/getRegularityMapPT_t1.py @@ -1,4 +1,4 @@ -# - getRegularityMap (pyTree) - +# - getRegularityMap (pyTree) - import Generator.PyTree as G import Converter.PyTree as C import Geom.PyTree as D diff --git a/Cassiopee/Generator/test/getRegularityMap_t1.py b/Cassiopee/Generator/test/getRegularityMap_t1.py index 3cb54a4ba..57c9c58cf 100644 --- a/Cassiopee/Generator/test/getRegularityMap_t1.py +++ b/Cassiopee/Generator/test/getRegularityMap_t1.py @@ -1,4 +1,4 @@ -# - getRegularityMap (array) - +# - getRegularityMap (array) - import Generator as G import Converter as C import Geom as D diff --git a/Cassiopee/Generator/test/getTriQualityMap.py b/Cassiopee/Generator/test/getTriQualityMap.py index 4c7747b6e..63670fb0e 100644 --- a/Cassiopee/Generator/test/getTriQualityMap.py +++ b/Cassiopee/Generator/test/getTriQualityMap.py @@ -1,4 +1,4 @@ -# - getTriQualitylityMap (array) - +# - getTriQualitylityMap (array) - import Generator as G import Converter as C import Geom as D diff --git a/Cassiopee/Generator/test/getTriQualityMapPT.py b/Cassiopee/Generator/test/getTriQualityMapPT.py index ebd2c4458..be9b8d028 100644 --- a/Cassiopee/Generator/test/getTriQualityMapPT.py +++ b/Cassiopee/Generator/test/getTriQualityMapPT.py @@ -9,4 +9,3 @@ t = C.newPyTree(['Base',2,a]) t = G.getTriQualityMap(t) C.convertPyTree2File(t, 'out.cgns') - diff --git a/Cassiopee/Generator/test/getTriQualityMap_t1.py b/Cassiopee/Generator/test/getTriQualityMap_t1.py index 65811c9a4..8525df8ce 100644 --- a/Cassiopee/Generator/test/getTriQualityMap_t1.py +++ b/Cassiopee/Generator/test/getTriQualityMap_t1.py @@ -9,4 +9,3 @@ a = G.close(a) n = G.getTriQualityMap(a) test.testA([n],1) - diff --git a/Cassiopee/Generator/test/hyper2d4.py b/Cassiopee/Generator/test/hyper2d4.py index 57463b6ad..66a4ffbb2 100644 --- a/Cassiopee/Generator/test/hyper2d4.py +++ b/Cassiopee/Generator/test/hyper2d4.py @@ -11,7 +11,3 @@ distrib = G.cart((0,0,0), (1./(Ni-1), 20./(Nj-1),1), (Ni,Nj,1)) msh = G.hyper2D4(a, distrib, "C") C.convertArrays2File([msh], 'out.plt') - - - - diff --git a/Cassiopee/Generator/test/hyper2d4PT.py b/Cassiopee/Generator/test/hyper2d4PT.py index c0078e962..2434efa9a 100644 --- a/Cassiopee/Generator/test/hyper2d4PT.py +++ b/Cassiopee/Generator/test/hyper2d4PT.py @@ -12,6 +12,3 @@ msh = G.hyper2D4(a, distrib, "C") C.convertPyTree2File(msh, 'out.cgns') - - - diff --git a/Cassiopee/Generator/test/mapSplitPT_t1.py b/Cassiopee/Generator/test/mapSplitPT_t1.py index 841098012..650bef216 100644 --- a/Cassiopee/Generator/test/mapSplitPT_t1.py +++ b/Cassiopee/Generator/test/mapSplitPT_t1.py @@ -13,7 +13,7 @@ dist = G.enforceX(dist, 15.5/(Ni-1), 0.005, 2,5) dist = G.enforceX(dist, 27.5/(Ni-1), 0.005, 2,5) -C._initVars(a,'F',1.); C._initVars(a,'centers:F',2.) +C._initVars(a,'F',1.); C._initVars(a,'centers:F',2.) zones = G.mapSplit(a, dist, 0.25) t = C.newPyTree(['Base',1]); t[2][1][2] += zones test.testT(t) diff --git a/Cassiopee/Generator/test/naca0012.py b/Cassiopee/Generator/test/naca0012.py index afb842221..81b41bfbc 100755 --- a/Cassiopee/Generator/test/naca0012.py +++ b/Cassiopee/Generator/test/naca0012.py @@ -53,5 +53,3 @@ msh = T.addkplane(msh) C.convertArrays2File([msh], "new.plt", "bin_tp") - - diff --git a/Cassiopee/Generator/test/octree2StructPT_t3.py b/Cassiopee/Generator/test/octree2StructPT_t3.py index 924f2a20f..16393da52 100644 --- a/Cassiopee/Generator/test/octree2StructPT_t3.py +++ b/Cassiopee/Generator/test/octree2StructPT_t3.py @@ -26,4 +26,3 @@ res = G.octree([s], [snear], dfar=5., balancing=1) res1 = G.octree2Struct(res, vmin=5, ext=1, AMR=1) test.testT(res1,4) - diff --git a/Cassiopee/Generator/test/octree2Struct_t3.py b/Cassiopee/Generator/test/octree2Struct_t3.py index 549647e5c..3a979623b 100644 --- a/Cassiopee/Generator/test/octree2Struct_t3.py +++ b/Cassiopee/Generator/test/octree2Struct_t3.py @@ -37,4 +37,3 @@ test.testA(res1, 11) res1 = G.octree2Struct(res, vmin=5, ext=2, merged=0, optimized=0) test.testA(res1, 12) - diff --git a/Cassiopee/Generator/test/octree_t1.py b/Cassiopee/Generator/test/octree_t1.py index 44cc367f0..c9f2da020 100644 --- a/Cassiopee/Generator/test/octree_t1.py +++ b/Cassiopee/Generator/test/octree_t1.py @@ -22,10 +22,8 @@ # cas liste de dfar s = D.sphere((0,0,0), 1., 100); snear = 0.1 -s2 = D.sphere((8,8,8),1, 100); +s2 = D.sphere((8,8,8),1, 100); res = G.octree([s,s2], [snear,snear], dfarList=[12.,0.], dfar=-1., balancing=1) test.testA([res],5) res = G.octree([s,s2], [snear,snear], dfarList=[12.,5.], dfar=-1., balancing=1) test.testA([res],6) - - diff --git a/Cassiopee/Generator/test/pointedHatPT_t1.py b/Cassiopee/Generator/test/pointedHatPT_t1.py index 346069b74..c45e85a17 100644 --- a/Cassiopee/Generator/test/pointedHatPT_t1.py +++ b/Cassiopee/Generator/test/pointedHatPT_t1.py @@ -15,4 +15,3 @@ a = C.addVars(a,'centers:cellN'); a = C.addVars(a,'Density') surf = G.pointedHat(a,(0.,0.,1.)) test.testT(surf,2) - diff --git a/Cassiopee/Generator/test/refinePT_t1.py b/Cassiopee/Generator/test/refinePT_t1.py index 9cde9a5b4..186ddcc89 100644 --- a/Cassiopee/Generator/test/refinePT_t1.py +++ b/Cassiopee/Generator/test/refinePT_t1.py @@ -3,7 +3,7 @@ import Converter.PyTree as C import KCore.test as test -# cas 2D multibloc avec CL et raccords +# cas 2D multibloc avec CL et raccords a = G.cart( (0,0,0), (0.1,0.1,0.1), (11,11,1)) b = G.cart( (0,1,0), (0.1,0.1,0.1), (11,11,1)) a = C.addBC2Zone(a,'match1','BCMatch','jmax',b,'jmin') diff --git a/Cassiopee/Generator/test/snapFront.py b/Cassiopee/Generator/test/snapFront.py index a41d8549d..465b386e3 100644 --- a/Cassiopee/Generator/test/snapFront.py +++ b/Cassiopee/Generator/test/snapFront.py @@ -21,7 +21,7 @@ celln = C.initVars(celln, 'cellN', 1.) # Masquage -cellno = X.blankCells([b], [celln], [s], blankingType=0, delta=0., dim=2) +cellno = X.blankCells([b], [celln], [s], blankingType=0, delta=0., dim=2) a = C.initVars(s, 'cellN', 1) b = C.addVars([b, cellno[0]]) diff --git a/Cassiopee/Generator/test/snapFront_t1.py b/Cassiopee/Generator/test/snapFront_t1.py index da5aec96a..757d3abb1 100644 --- a/Cassiopee/Generator/test/snapFront_t1.py +++ b/Cassiopee/Generator/test/snapFront_t1.py @@ -23,7 +23,7 @@ celln = C.initVars(celln, 'cellN', 1.) # Masquage -cellno = X.blankCells([b], [celln], [s], blankingType=0, delta=0., dim=2) +cellno = X.blankCells([b], [celln], [s], blankingType=0, delta=0., dim=2) a = C.initVars(s, 'cellN', 1) b = C.addVars([b, cellno[0]]) @@ -34,7 +34,7 @@ test.testA([f], 1) # Adapte le front de la grille a la surface avec optimisation du front -f = G.snapFront(b, [s], optimized = 1) +f = G.snapFront(b, [s], optimized=1) test.testA([f], 11) @@ -43,7 +43,7 @@ f = G.snapFront(b, [s]) test.testA([f], 2) # Adapte le front de la grille a la surface avec optimisation du front -f = G.snapFront(b, [s], optimized = 1) +f = G.snapFront(b, [s], optimized=1) test.testA([f], 21) s = D.polyline([(0.02,0,0),(1,1,0),(2,1,0),(0.02,0,0)]) @@ -54,7 +54,7 @@ for c in contours: if c[1].shape[1] == 3: p = G.fittingPlaster(c) - b = G.gapfixer(c, p) + b = G.gapfixer(c, p) lc.append(b) lc = C.convertArray2Tetra(lc) @@ -66,11 +66,11 @@ b = G.cart( (-0.5, -0.5, 0.), (h, h, 1.), (ni,nj,nk) ) celln = C.array('cellN', ni-1, nj-1, nk-1) celln = C.initVars(celln, 'cellN', 1.) -cellno = X.blankCells([b], [celln], [s2], blankingType=1, delta=0., dim=2) +cellno = X.blankCells([b], [celln], [s2], blankingType=1, delta=0., dim=2) cellno = C.center2Node(cellno, cellNType=0) cellno[0] = T.addkplane(cellno[0]) b = C.addVars([b, cellno[0]]) # Adapte le front de la grille a la surface b = T.subzone(b, (1,1,1), (b[2],b[3],1)) -f = G.snapFront(b, [s], optimized = 2) +f = G.snapFront(b, [s], optimized=2) test.testA([f], 3) diff --git a/Cassiopee/Generator/test/snapSharpEdges.py b/Cassiopee/Generator/test/snapSharpEdges.py index 5b959612b..d27435d33 100644 --- a/Cassiopee/Generator/test/snapSharpEdges.py +++ b/Cassiopee/Generator/test/snapSharpEdges.py @@ -16,7 +16,7 @@ C.convertArrays2File([b,c, s], 'out.plt') # Same with smooth -#c = T.smooth(c, eps=0.5, niter=5, +#c = T.smooth(c, eps=0.5, niter=5, # fixedConstraints=s) # #projConstraints=s)C diff --git a/Cassiopee/Generator/test/surfaceWalk.py b/Cassiopee/Generator/test/surfaceWalk.py index f5ce8a382..bc49a0f66 100644 --- a/Cassiopee/Generator/test/surfaceWalk.py +++ b/Cassiopee/Generator/test/surfaceWalk.py @@ -1,4 +1,4 @@ -# - surfaceWalk (array) +# - surfaceWalk (array) import Converter as C import Geom as D import Transform as T diff --git a/Cassiopee/Generator/test/surfaceWalkPT.py b/Cassiopee/Generator/test/surfaceWalkPT.py index 837e6cf7a..e062d394f 100644 --- a/Cassiopee/Generator/test/surfaceWalkPT.py +++ b/Cassiopee/Generator/test/surfaceWalkPT.py @@ -1,4 +1,4 @@ -# - surfaceWalk (pyTree) +# - surfaceWalk (pyTree) import Converter.PyTree as C import Geom.PyTree as D import Transform.PyTree as T diff --git a/Cassiopee/Generator/test/surfaceWalkPT_t1.py b/Cassiopee/Generator/test/surfaceWalkPT_t1.py index 48227239e..eb73c3463 100644 --- a/Cassiopee/Generator/test/surfaceWalkPT_t1.py +++ b/Cassiopee/Generator/test/surfaceWalkPT_t1.py @@ -1,9 +1,9 @@ -# - surfaceWalk (pyTree) +# - surfaceWalk (pyTree) import Converter.PyTree as C import Geom.PyTree as D import Transform.PyTree as T import Generator.PyTree as G -import KCore.test as test +import KCore.test as test # User definition of parametric curve def f(t,u): x = t+u diff --git a/Cassiopee/Generator/test/zipPT.py b/Cassiopee/Generator/test/zipPT.py index 9aa11ed3f..cff8d0f1a 100755 --- a/Cassiopee/Generator/test/zipPT.py +++ b/Cassiopee/Generator/test/zipPT.py @@ -3,14 +3,14 @@ import Generator.PyTree as G import KCore.test as test -a1 = G.cart((0,0,0), (1,1,1), (10,10,1)); a1[0] = 'cart1' +a1 = G.cart((0,0,0), (1,1,1), (10,10,1)); a1[0] = 'cart1' a2 = G.cart((9+1.e-2,0,0), (1,1,1), (10,10,1)); a2[0] = 'cart2' a3 = G.cart((0,-5.01,0),(1,1,1),(19,6,1)); a3[0] = 'cart3' a4 = G.cart((0,9.0001,0),(1,1,1),(10,6,1)); a4[0] = 'cart4' a5 = G.cart((9.01,9.0002,0),(1,1,1),(10,6,1)); a5[0] = 'cart5' zones = [a1,a2,a3,a4,a5] -# Close une liste de maillages sur leurs frontieres +# Close une liste de maillages sur leurs frontieres zones2 = G.zip(zones, 1e-1) C.convertPyTree2File(zones2, 'out.cgns') diff --git a/Cassiopee/Generator/test/zipPT_t1.py b/Cassiopee/Generator/test/zipPT_t1.py index 1e7522e13..a28821e20 100755 --- a/Cassiopee/Generator/test/zipPT_t1.py +++ b/Cassiopee/Generator/test/zipPT_t1.py @@ -3,7 +3,7 @@ import Generator.PyTree as G import KCore.test as test -a1 = G.cart((0,0,0), (1,1,1), (10,10,1)); a1[0] = 'cart1' +a1 = G.cart((0,0,0), (1,1,1), (10,10,1)); a1[0] = 'cart1' a2 = G.cart((9+1.e-2,0,0), (1,1,1), (10,10,1)); a2[0] = 'cart2' a3 = G.cart((0,-5.01,0),(1,1,1),(19,6,1)); a3[0] = 'cart3' a4 = G.cart((0,9.0001,0),(1,1,1),(10,6,1)); a4[0] = 'cart4' @@ -18,7 +18,7 @@ zones = C.addVars(zones, 'Density'); zones = C.addVars(zones, 'centers:cellN') -# Close une liste de maillages sur leurs frontieres +# Close une liste de maillages sur leurs frontieres zones2 = G.zip(zones, 1e-1) test.testT(zones2, 1) diff --git a/Cassiopee/Geom/Geom/Geom.py b/Cassiopee/Geom/Geom/Geom.py index dc722e712..724dbaed7 100644 --- a/Cassiopee/Geom/Geom/Geom.py +++ b/Cassiopee/Geom/Geom/Geom.py @@ -52,7 +52,7 @@ def naca(e, N=101, sharpte=True): e = 0. if not sharpte: sharpte = 0 else: sharpte = 1 - return geom.naca(e, N, im, ip, it, ith, iq, sharpte) + return geom.naca(e, N, im, ip, it, ith, iq, sharpte) def line(P1, P2, N=100): """Create a line of N points. @@ -72,7 +72,7 @@ def nurbs(Pts, weight='weight', order=3, N=100, M=100, density=-1): try: import Converter Weights = Converter.extractVars(Pts,[weight]) - except: + except: ni = Pts[2]; nj = Pts[3]; nk = Pts[4] Weights = [weight, numpy.ones((1,ni*nj*nk), numpy.float64), ni, nj, nk] return geom.nurbs(Pts, Weights, order, N, order, M, density) @@ -136,7 +136,7 @@ def sphereYinYang(C, R, N=100, ntype='STRUCT'): # IN: liste de maillages struct def export__(a, ntype='STRUCT'): try: import Converter as C; import Transform as T; import Generator as G - except ImportError: + except ImportError: raise ImportError("export: requires Converter, Generator and Transform modules.") if ntype == 'STRUCT': return a elif ntype == 'QUAD': @@ -238,7 +238,7 @@ def triangle(P0, P1, P2, N=0, ntype='TRI'): l3 = line(P2, C02, N) l4 = line(C02, C, N) m3 = G.TFI([l1, l2, l3, l4]) - m3 = T.reorder(m3, (-1,2,3)) + m3 = T.reorder(m3, (-1,2,3)) m = [m1, m2, m3] return export__(m, ntype) @@ -363,7 +363,7 @@ def surface__(f, N): def getLength(a): """Return the length of 1D-mesh. Usage: l = getLength(a""" - if isinstance(a[0], list): + if isinstance(a[0], list): l = 0. for i in a: l += geom.getLength(i) return l @@ -434,7 +434,7 @@ def getSharpestAngle(a): """Return the sharpest angle for each point of a surface based on the sharpest angle between adjacent element to which the point belongs to. Usage: getSharpestAngle(a)""" - if isinstance(a[0], list): + if isinstance(a[0], list): out = [] for i in a: out.append(geom.getSharpestAngle(i)) return out @@ -464,8 +464,8 @@ def getDistribution(a): else: if a[-1] == 'BAR': raise TypeError("getDistribution: only for structured arrays.") c = line((0,0,0),(1,0,0),a[2]) - c[1][0] = geom.getCurvilinearAbscissa(a)[1] - return c + c[1][0] = geom.getCurvilinearAbscissa(a)[1] + return c def getTangent(a): """Return the unit tangent vector of a 1D curve as coordinates. @@ -567,7 +567,7 @@ def orthoDrive(a, d, mode=0): Pi = [coord[0,i-1],coord[1,i-1],coord[2,i-1]] Pip = [coord[0,i],coord[1,i],coord[2,i]] v = Vector.sub(Pip, P0) - else: + else: Pi = [coord[0,i],coord[1,i],coord[2,i]] Pip = [coord[0,i+1],coord[1,i+1],coord[2,i+1]] v = Vector.sub(Pi, P0) @@ -605,10 +605,10 @@ def addSeparationLine(array, array2): def axisym(a, C, axis, angle=360., Ntheta=180, rmod=None): """Create an axisymetrical mesh given an azimuthal 1D or 2D mesh. Usage: axisym(array, (xo,yo,zo), (nx,ny,nz), teta, Nteta, rmod)""" - try: + try: import Converter if rmod is not None: rmod = Converter.convertBAR2Struct(rmod) - except: pass + except: pass if isinstance(a[0], list): b = [] for i in a: @@ -787,7 +787,7 @@ def text1D(string, font='vera', smooth=0, offset=0.5): d = Generator.cart((0,0,0), (1./nmap,1,1), (nmap+1,1,1)) c = 0 for i in retour: - b = Generator.densify(i, hdensify) + b = Generator.densify(i, hdensify) retour[c] = Generator.map(b, d); c += 1 return retour @@ -840,7 +840,7 @@ def connect1D(curves, sharpness=0, N=10, lengthFactor=1.): try: import Transform as T import Converter as C - import Generator as G + import Generator as G except ImportError: raise ImportError("connect1D requires Transform, Converter, Generator modules.") #curves = T.splitTBranch(curves) @@ -860,7 +860,7 @@ def connect1D(curves, sharpness=0, N=10, lengthFactor=1.): added = [] for c in range(ncurves): lcurve = getLength(curves[c]) * lengthFactor - P1 = Pts[c][0] + P1 = Pts[c][0] minDist, P2, d, ext = findNearest__(P1, Pts, c) n1 = Vector.sub(P1, PtsM[c][0]) n1 = Vector.normalize(n1) @@ -897,7 +897,7 @@ def connect1D(curves, sharpness=0, N=10, lengthFactor=1.): if added != []: added = C.convertArray2Hexa(added) out = T.join(out+added) - out = G.close(out) + out = G.close(out) return out # Pt d'intersection par minimal distance @@ -921,10 +921,10 @@ def findNearest__(Pt, Pts, c): minDist = 1.e6; nearest = None; dmin = -1; ext=0 for d in range(len(Pts)): if d <= c: # possible sur lui meme !! - e2a = Pts[d][0]; e2b = Pts[d][1] + e2a = Pts[d][0]; e2b = Pts[d][1] d1 = Vector.squareDist(Pt, e2a) d2 = Vector.squareDist(Pt, e2b) - if d1 < minDist and d1 > 1.e-12: + if d1 < minDist and d1 > 1.e-12: minDist = d1; nearest = e2a; ext=0; dmin = d if d2 < minDist and d2 > 1.e-12: minDist = d2; nearest = e2b; ext=1; dmin = d @@ -944,7 +944,7 @@ def getUVFromIJ(a): a = Converter.initVars(a, '_v_', 0.) if isinstance(a[1], list): # array2/3 pu = a[1][3].ravel('k'); pv = a[1][4].ravel('k') - else: # array1 + else: # array1 pu = a[1][3].ravel('k'); pv = a[1][4].ravel('k') ni = a[2]; nj = a[3] for j in range(nj): diff --git a/Cassiopee/Geom/Geom/IBM.py b/Cassiopee/Geom/Geom/IBM.py index bffb6777b..530003581 100644 --- a/Cassiopee/Geom/Geom/IBM.py +++ b/Cassiopee/Geom/Geom/IBM.py @@ -7,12 +7,12 @@ import Generator.IBMmodelHeight as G_IBM_Height from . import PyTree as D varsDeleteIBM = ['utau','StagnationEnthalpy','StagnationPressure', - 'dirx' ,'diry' ,'dirz', - 'gradxPressure' ,'gradyPressure' ,'gradzPressure' , - 'gradxVelocityX','gradyVelocityX','gradzVelocityX', - 'gradxVelocityY','gradyVelocityY','gradzVelocityY', - 'gradxVelocityZ','gradyVelocityZ','gradzVelocityZ', - 'KCurv' ,'yplus'] + 'dirx' ,'diry' ,'dirz', + 'gradxPressure' ,'gradyPressure' ,'gradzPressure' , + 'gradxVelocityX','gradyVelocityX','gradzVelocityX', + 'gradxVelocityY','gradyVelocityY','gradzVelocityY', + 'gradxVelocityZ','gradyVelocityZ','gradzVelocityZ', + 'KCurv' ,'yplus'] #============================================================================== # Creation of a case with a symmetry plane #============================================================================== @@ -181,7 +181,7 @@ def _setIBCType(t, value): """Set the IBC type in a geometry tree. Usage: _setIBCType(t, value=X)""" zones = Internal.getZones(t) - for z in zones: + for z in zones: Internal._createUniqueChild(z, '.Solver#define', 'UserDefinedData_t') n = Internal.getNodeFromName1(z, '.Solver#define') Internal._createUniqueChild(n, 'ibctype', 'DataArray_t', value) @@ -233,19 +233,19 @@ def _setFluidOutside(t): #============================================================================== def setOutPressControlParam(t, probeName='pointOutPress', AtestSection=1, AOutPress=1, machTarget=0.1, pStatTarget=1e05, tStatTarget=298.15,lmbd=0.1, - cxSupport = 0.6, sSupport=0.1, itExtrctPrb=10): + cxSupport=0.6, sSupport=0.1, itExtrctPrb=10): """Set the user input parameters for the outpress control algorithm. Usage: setOutPressControlParam(t, probeName='X', AtestSection=Y, AOutPress=Z, machTarget=XX,pStatTarget=YY,tStatTarget=ZZ,lmbd=XXX,cxSupport=YYY,sSupport=ZZZ,itExtrctPrb=XXXX)""" tp = Internal.copyRef(t) _setOutPressControlParam(tp, probeName=probeName, AtestSection=AtestSection, AOutPress=AOutPress, machTarget=machTarget, pStatTarget=pStatTarget, tStatTarget=tStatTarget,lmbd=lmbd, - cxSupport = cxSupport, sSupport=sSupport, itExtrctPrb=itExtrctPrb) + cxSupport=cxSupport, sSupport=sSupport, itExtrctPrb=itExtrctPrb) return tp def _setOutPressControlParam(t, probeName='pointOutPress', AtestSection=1, AOutPress=1, machTarget=0.1, pStatTarget=1e05, tStatTarget=298.15,lmbd=0.1, - cxSupport = 0.6, sSupport=0.1, itExtrctPrb=10): + cxSupport=0.6, sSupport=0.1, itExtrctPrb=10): """Set the user input parameters for the outpress control algorithm. Usage: _setOutPressControlParam(t, probeName='X', AtestSection=Y, AOutPress=Z, machTarget=XX,pStatTarget=YY,tStatTarget=ZZ,lmbd=XXX,cxSupport=YYY,sSupport=ZZZ,itExtrctPrb=XXXX)""" zones = Internal.getZones(t) @@ -300,12 +300,12 @@ def _initOutflow(tc, familyName, PStatic, InterpolPlane=None, PressureVar=0, isD else: stagPNode[1][:] = PStatic if not isDensityConstant: - dens = Internal.getNodeFromName(zsr, 'Density') + dens = Internal.getNodeFromName(zsr, 'Density') dens[1][:] = -dens[1][:] return None #============================================================================== -# +# #============================================================================== def initIsoThermal(tc, familyName, TStatic): """Set the value of static temperature TStatic for the wall no slip IBC with family name familyName. @@ -323,17 +323,17 @@ def _initIsoThermal(tc, familyName, TStatic): if FamNode is not None: FamName = Internal.getValue(FamNode) if FamName == familyName: - stagPNode = Internal.getNodeFromName(zsr, 'TemperatureWall') + stagPNode = Internal.getNodeFromName(zsr, 'TemperatureWall') sizeIBC = numpy.shape(stagPNode[1]) stagPNode[1][:] = TStatic #Internal.setValue(stagPNode,TStatic*numpy.ones(sizeIBC)) - stagPNode = Internal.getNodeFromName(zsr, 'Temperature') + stagPNode = Internal.getNodeFromName(zsr, 'Temperature') Internal.setValue(stagPNode, TStatic*numpy.ones(sizeIBC)) return None #============================================================================== -# +# #============================================================================== def initHeatFlux(tc, familyName, QWall): """Set the value of heat flux QWall for the wall no slip IBC with family name familyName. @@ -352,12 +352,12 @@ def _initHeatFlux(tc, familyName, QWall): if FamNode is not None: FamName = Internal.getValue(FamNode) if FamName == familyName: - stagPNode = Internal.getNodeFromName(zsr,'WallHeatFlux') + stagPNode = Internal.getNodeFromName(zsr,'WallHeatFlux') sizeIBC = numpy.shape(stagPNode[1]) stagPNode[1][:] = QWall #Internal.setValue(stagPNode,QWall*numpy.ones(sizeIBC)) - stagPNode = Internal.getNodeFromName(zsr,'Temperature') + stagPNode = Internal.getNodeFromName(zsr,'Temperature') Internal.setValue(stagPNode,QWall*numpy.ones(sizeIBC)) return None @@ -460,7 +460,7 @@ def _addVariablesTcIbc(zsr, ibctype, nIBC): return None #============================================================================== -# +# #============================================================================== def changeIBCType(tc, oldIBCType, newIBCType): """Change the IBC type in a connectivity tree from oldIBCType to newIBCType. @@ -492,7 +492,7 @@ def _changeIBCType(tc, oldIBCType, newIBCType): return None #============================================================================== -# +# #============================================================================== def transformTc2(tc2): """Change the name of the IBM nodes for the second image point. @@ -528,7 +528,7 @@ def _transformTc2(tc2): return None #============================================================================== -# +# #============================================================================== def closeContour(contour, N=2): """Closes a 1D contour with a line or a set of lines.""" @@ -542,7 +542,7 @@ def closeContour(contour, N=2): connectivity = Internal.getNodeFromName(z, 'ElementConnectivity')[1] values, counts = numpy.unique(connectivity, return_counts=True) ends = values[numpy.argwhere(counts==1).flatten()] - if len(ends) == 2: + if len(ends) == 2: i_first = ends[0] - 1 i_last = ends[1] - 1 x = Internal.getNodeFromName(z, "CoordinateX")[1] @@ -572,7 +572,7 @@ def closeContour(contour, N=2): return contour2 #============================================================================== -# +# #============================================================================== def closeSurface(surface): """Closes a 2D surface with a patch or a set of patches.""" @@ -638,7 +638,7 @@ def determineClosedSolidFilament__(tb): for b in filamentBases: node_local = Internal.getNodeFromNameAndType(tb, b, 'CGNSBase_t') tbFilament.append(node_local) - Internal._rmNode(tb,node_local) + Internal._rmNode(tb,node_local) isOrthoProjectFirst = True tbFilament = C.newPyTree(tbFilament); @@ -672,7 +672,7 @@ def _addOneOverLocally(FileName,oneOver): t_local = C.convertFile2PyTree(FileName) nodes = Internal.getNodesFromNameAndType(t_local, '*OneOver*', 'CGNSBase_t') for b in nodes: - Internal._createUniqueChild(b, '.Solver#define', 'UserDefinedData_t') + Internal._createUniqueChild(b, '.Solver#define', 'UserDefinedData_t') n = Internal.getNodeFromName1(b, '.Solver#define') Internal._createUniqueChild(n, 'dirx' , 'DataArray_t', value=oneOver[count][0]) Internal._createUniqueChild(n, 'diry' , 'DataArray_t', value=oneOver[count][1]) diff --git a/Cassiopee/Geom/Geom/MapEdge.py b/Cassiopee/Geom/Geom/MapEdge.py index aaa1b4a8a..0732e291a 100644 --- a/Cassiopee/Geom/Geom/MapEdge.py +++ b/Cassiopee/Geom/Geom/MapEdge.py @@ -7,14 +7,14 @@ import KCore.kcore as KCore import numpy importOK = True -except ImportError: +except ImportError: importOK = False try: range = xrange except: pass def checkImport(): - if not importOK: + if not importOK: raise ImportError("mapEdge requires Converter, Generator, Transform.") # uniformize a 1D mesh (regular step) - OK @@ -56,7 +56,7 @@ def uniformize__(a, N, h, factor, density, sharpAngle): out = []; Nt = 0; rest = 0 for ct, i in enumerate(b): - if C.getNPts(i) >= 2: # avoid degenerated cases + if C.getNPts(i) >= 2: # avoid degenerated cases Li = D.getLength(i) Ni = int(T.kround(N*1.*(Li/L)))+1 rest += Ni-1-N*1.*(Li/L) @@ -79,7 +79,7 @@ def uniformize__(a, N, h, factor, density, sharpAngle): def refine(a, N=10, factor=-1, sharpAngle=30.): """Refine the point distribution on a 1D-mesh.""" if checkImport is None: return None - if isinstance(a[0], list): + if isinstance(a[0], list): b = [] for i in a: b.append(refine__(i, N, factor, sharpAngle)) @@ -216,7 +216,7 @@ def moyenne(a, hl): i1 = 0; i2 = i; h1 = hi; h2 = hi if h1 > 0: i2 = i; h2 = hi - sub = T.subzone(a, (i1+1,1,1), (i2+1,1,1)) + sub = T.subzone(a, (i1+1,1,1), (i2+1,1,1)) Li = D.getLength(sub) href += (h1+h2)*0.5*Li # loop @@ -297,7 +297,7 @@ def enforceh__(a, N, h): if pos == -1: #raise ValueError("enforceh: h or f is not present.") return a - else: + else: hl = numpy.copy(a[1][pos]) factorMoy = moyenne(a, hl) if h > 0: @@ -354,7 +354,7 @@ def enforceh__(a, N, h): #if i1 == -1: i1 = 0; i2 = i; h1 = hi; h2 = hi # propagate hi from inside if not set on borders # keep border h if not set i2 = i; h2 = hi - sub = T.subzone(a, (i1+1,1,1), (i2+1,1,1)) + sub = T.subzone(a, (i1+1,1,1), (i2+1,1,1)) Li = D.getLength(sub) Pi = Li*1./(0.5*(h1+h2)+1.e-12) i1s.append(i1); i2s.append(i2) @@ -452,7 +452,7 @@ def distrib2(a, h1, h2, add=20, forceAdd=False, normalized=True, algo=0, verbose def smooth(a, eps=0.1, niter=5, sharpAngle=30.): """Smooth point distribution in a 1D-mesh.""" if checkImport is None: return None - if isinstance(a[0], list): + if isinstance(a[0], list): b = [] for i in a: b.append(smooth__(i, eps, niter, sharpAngle)) @@ -506,6 +506,6 @@ def mapCurvature(a, N, factor=1., sharpAngle=30.): # set in split setH(a, split[x], h*alp) # set middle - if x < nsplit-1: setH(a, 0.5*(split[x]+split[x+1]), h) + if x < nsplit-1: setH(a, 0.5*(split[x]+split[x+1]), h) out = enforceh(a, N) return out diff --git a/Cassiopee/Geom/Geom/Offset.py b/Cassiopee/Geom/Geom/Offset.py index 00b97e118..b285ce9cb 100755 --- a/Cassiopee/Geom/Geom/Offset.py +++ b/Cassiopee/Geom/Geom/Offset.py @@ -12,7 +12,7 @@ # IN: loc='centers', 'nodes': localisation du champ de distance #============================================================================== def _compDistance__(b, a, loc): - try: + try: DTW._distance2Walls(b, a, type='ortho', loc=loc, signed=1) fail = False except: fail = True @@ -42,8 +42,8 @@ def withCart__(a, offset, pointsPerUnitLength, dim=3): if nj < 2: nj = 2 if nk < 2: nk = 2 hi = (xmax-xmin)/(ni-1); hj = (ymax-ymin)/(nj-1); hk = (zmax-zmin)/(nk-1) - h = min(hi, hj); - if dim == 3: h = min(h, hk); + h = min(hi, hj); + if dim == 3: h = min(h, hk); h = max(h, 1.e-6) ni = int((xmax-xmin)/h)+7; nj = int((ymax-ymin)/h)+7 nk = int((zmax-zmin)/h)+7 @@ -75,7 +75,7 @@ def withOctree__(a, offset, pointsPerUnitLength, dim=3): for z in Internal.getZones(a): bb = G.bbox(z) rx = bb[3]-bb[0]; ry = bb[4]-bb[1]; rz = bb[5]-bb[2] - snear = min(rx, ry); + snear = min(rx, ry); if dim==3: snear = min(snear, rz) snear = 0.1*snear sec = max(sec, snear) diff --git a/Cassiopee/Geom/Geom/Parametrics.py b/Cassiopee/Geom/Geom/Parametrics.py index b368b9d55..1c155e0cf 100644 --- a/Cassiopee/Geom/Geom/Parametrics.py +++ b/Cassiopee/Geom/Geom/Parametrics.py @@ -29,5 +29,4 @@ 'enneper2': '{x} = 1.2*{t}*cos(-pi+2.*pi*{u})-1.2*{t}**3/3.*cos(3*(-pi+2.*pi*{u})) ; {y} = (1.2*{t})**2*cos(2.*(-pi+2*pi*{u})) ; {z} = -1.2*{t}*sin(-pi+2*pi*{u})-(1.2*{t})**(3)/3.*sin(3*(-pi+2.*pi*{u}))', 'dini': '{x} = cos(12.4*{t})*sin(0.1+1.9*{u}) ; {y} = (cos(0.1+1.9*{u})+log(tan((0.1+1.9*{u})/2))) + 0.2*12.4*{t} ; {z} = sin(12.4*{t})*sin(0.1+1.9*{u})', 'drop': '{x} = 2.*{t}*cos(2.*pi*{u}) ; {y} = exp(-4.*{t}*{t})*(sin(4.*pi*{t}) - 2.*{t}*cos(6.*pi*{u})) ; {z} = 2.*{t}*sin(2.*pi*{u})' - } - +} diff --git a/Cassiopee/Geom/Geom/PyTree.py b/Cassiopee/Geom/Geom/PyTree.py index 4c5c6522c..48cc12a51 100644 --- a/Cassiopee/Geom/Geom/PyTree.py +++ b/Cassiopee/Geom/Geom/PyTree.py @@ -29,7 +29,7 @@ def naca(e, N=101, sharpte=True): a = Geom.naca(e, N, sharpte) zname = 'naca' if isinstance(e, str): zname ='NACA'+e - return C.convertArrays2ZoneNode(zname, [a]) + return C.convertArrays2ZoneNode(zname, [a]) def line(P1, P2, N=100): """Create a line of N points. Usage: line( (x1,y1,z1), (x2,y2,z2), N )""" @@ -93,11 +93,11 @@ def sphere6(center, R, N=100, ntype='STRUCT'): A = Geom.sphere6(center, R, N, ntype) if ntype == 'STRUCT': return [C.convertArrays2ZoneNode('sphere-part1', [A[0]]), - C.convertArrays2ZoneNode('sphere-part2', [A[1]]), - C.convertArrays2ZoneNode('sphere-part3', [A[2]]), - C.convertArrays2ZoneNode('sphere-part4', [A[3]]), - C.convertArrays2ZoneNode('sphere-part5', [A[4]]), - C.convertArrays2ZoneNode('sphere-part6', [A[5]])] + C.convertArrays2ZoneNode('sphere-part2', [A[1]]), + C.convertArrays2ZoneNode('sphere-part3', [A[2]]), + C.convertArrays2ZoneNode('sphere-part4', [A[3]]), + C.convertArrays2ZoneNode('sphere-part5', [A[4]]), + C.convertArrays2ZoneNode('sphere-part6', [A[5]])] else: return C.convertArrays2ZoneNode('sphere', [A]) @@ -107,7 +107,7 @@ def sphereYinYang(center, R, N=100, ntype='STRUCT'): A = Geom.sphereYinYang(center, R, N) if ntype == 'STRUCT': return [C.convertArrays2ZoneNode('sphere-part1', [A[0]]), - C.convertArrays2ZoneNode('sphere-part2', [A[1]])] + C.convertArrays2ZoneNode('sphere-part2', [A[1]])] else: return C.convertArrays2ZoneNode('sphere', [A]) @@ -117,10 +117,10 @@ def disc(center, R, N=100, ntype='STRUCT'): A = Geom.disc(center, R, N, ntype) if ntype == 'STRUCT': return [C.convertArrays2ZoneNode('disc-part1', [A[0]]), - C.convertArrays2ZoneNode('disc-part2', [A[1]]), - C.convertArrays2ZoneNode('disc-part3', [A[2]]), - C.convertArrays2ZoneNode('disc-part4', [A[3]]), - C.convertArrays2ZoneNode('disc-part5', [A[4]])] + C.convertArrays2ZoneNode('disc-part2', [A[1]]), + C.convertArrays2ZoneNode('disc-part3', [A[2]]), + C.convertArrays2ZoneNode('disc-part4', [A[3]]), + C.convertArrays2ZoneNode('disc-part5', [A[4]])] else: return C.convertArrays2ZoneNode('disc', [A]) @@ -130,11 +130,11 @@ def box(Pmin, Pmax, N=100, ntype='STRUCT'): A = Geom.box(Pmin, Pmax, N, ntype) if ntype == 'STRUCT': return [C.convertArrays2ZoneNode('box-part1', [A[0]]), - C.convertArrays2ZoneNode('box-part2', [A[1]]), - C.convertArrays2ZoneNode('box-part3', [A[2]]), - C.convertArrays2ZoneNode('box-part4', [A[3]]), - C.convertArrays2ZoneNode('box-part5', [A[4]]), - C.convertArrays2ZoneNode('box-part6', [A[5]])] + C.convertArrays2ZoneNode('box-part2', [A[1]]), + C.convertArrays2ZoneNode('box-part3', [A[2]]), + C.convertArrays2ZoneNode('box-part4', [A[3]]), + C.convertArrays2ZoneNode('box-part5', [A[4]]), + C.convertArrays2ZoneNode('box-part6', [A[5]])] else: return C.convertArrays2ZoneNode('box', [A]) @@ -144,16 +144,16 @@ def cylinder(center, R, H, N=100, ntype='STRUCT'): A = Geom.cylinder(center, R, H, N, ntype) if ntype == 'STRUCT': return [C.convertArrays2ZoneNode('cyl-part1', [A[0]]), - C.convertArrays2ZoneNode('cyl-part2', [A[1]]), - C.convertArrays2ZoneNode('cyl-part3', [A[2]]), - C.convertArrays2ZoneNode('cyl-part4', [A[3]]), - C.convertArrays2ZoneNode('cyl-part5', [A[4]]), - C.convertArrays2ZoneNode('cyl-part6', [A[5]]), - C.convertArrays2ZoneNode('cyl-part7', [A[6]]), - C.convertArrays2ZoneNode('cyl-part8', [A[7]]), - C.convertArrays2ZoneNode('cyl-part9', [A[8]]), - C.convertArrays2ZoneNode('cyl-part10', [A[9]]), - C.convertArrays2ZoneNode('cyl-part11', [A[10]])] + C.convertArrays2ZoneNode('cyl-part2', [A[1]]), + C.convertArrays2ZoneNode('cyl-part3', [A[2]]), + C.convertArrays2ZoneNode('cyl-part4', [A[3]]), + C.convertArrays2ZoneNode('cyl-part5', [A[4]]), + C.convertArrays2ZoneNode('cyl-part6', [A[5]]), + C.convertArrays2ZoneNode('cyl-part7', [A[6]]), + C.convertArrays2ZoneNode('cyl-part8', [A[7]]), + C.convertArrays2ZoneNode('cyl-part9', [A[8]]), + C.convertArrays2ZoneNode('cyl-part10', [A[9]]), + C.convertArrays2ZoneNode('cyl-part11', [A[10]])] else: return C.convertArrays2ZoneNode('cyl', [A]) @@ -172,8 +172,8 @@ def triangle(P1, P2, P3, N=0, ntype='TRI'): a = Geom.triangle(P1, P2, P3, N, ntype) if ntype == 'STRUCT': return [C.convertArrays2ZoneNode('tri-part1', [a[0]]), - C.convertArrays2ZoneNode('tri-part2', [a[1]]), - C.convertArrays2ZoneNode('tri-part3', [a[2]])] + C.convertArrays2ZoneNode('tri-part2', [a[1]]), + C.convertArrays2ZoneNode('tri-part3', [a[2]])] else: return C.convertArrays2ZoneNode('triangle', [a]) @@ -183,9 +183,9 @@ def quadrangle(P1, P2, P3, P4, N=0, ntype='QUAD'): a = Geom.quadrangle(P1, P2, P3, P4, N, ntype) if ntype == 'STRUCT': return [C.convertArrays2ZoneNode('quad-part1', [a[0]]), - C.convertArrays2ZoneNode('quad-part2', [a[1]]), - C.convertArrays2ZoneNode('quad-part3', [a[2]]), - C.convertArrays2ZoneNode('quad-part2', [a[3]])] + C.convertArrays2ZoneNode('quad-part2', [a[1]]), + C.convertArrays2ZoneNode('quad-part3', [a[2]]), + C.convertArrays2ZoneNode('quad-part2', [a[3]])] else: return C.convertArrays2ZoneNode('quadrangle', [a]) @@ -229,7 +229,7 @@ def getCurvatureRadius(t): return C.TZGC1(t, 'nodes', True, Geom.getCurvatureRadius) def _getCurvatureRadius(t): - """Return the curvature radius for each point.""" + """Return the curvature radius for each point.""" return C._TZGC1(t, 'nodes', False, Geom.getCurvatureRadius) def getCurvatureAngle(t): @@ -285,7 +285,7 @@ def addSeparationLine(t, line0): arrays = Geom.addSeparationLine(at, al) zones = [] for i in arrays: - zone = C.convertArrays2ZoneNode(t[0], [i]) + zone = C.convertArrays2ZoneNode(t[0], [i]) zones.append(zone) return zones diff --git a/Cassiopee/Geom/Geom/text1.py b/Cassiopee/Geom/Geom/text1.py index dc95802ad..aa5da3a92 100644 --- a/Cassiopee/Geom/Geom/text1.py +++ b/Cassiopee/Geom/Geom/text1.py @@ -122,7 +122,7 @@ def G(): (1.5,4.,0.), (1.5,2.,0.), (2.,1.,0.), - (4.,1.,0.), + (4.,1.,0.), (4,2,0), (3.,2.,0.), (3.,3.,0.), @@ -912,4 +912,3 @@ def z(): a, s = Z() a = Transform.contract(a, (0,0,0), (1,0,0), (0,0,1), 0.6) return a, s - diff --git a/Cassiopee/Geom/doc/source/conf.py b/Cassiopee/Geom/doc/source/conf.py index aa4e985be..2b2f03ca7 100644 --- a/Cassiopee/Geom/doc/source/conf.py +++ b/Cassiopee/Geom/doc/source/conf.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Geom +# Geom import sys import os @@ -192,15 +192,15 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', -'preamble': r''' + # Additional stuff for the LaTeX preamble. + #'preamble': '', + 'preamble': r''' \usepackage{charter} \usepackage[defaultsans]{lato} \usepackage{inconsolata} @@ -211,10 +211,10 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('Geom', 'Geom.tex', u'Geom Documentation', - u'/ELSA/MU-09021/V'+__version__, 'manual'), - ('Geom_IBM', 'Geom_IBM.tex', u'Geom.IBM Documentation', - u'/ELSA/MU-09021/V'+__version__, 'manual'), + ('Geom', 'Geom.tex', u'Geom Documentation', + u'/ELSA/MU-09021/V'+__version__, 'manual'), + ('Geom_IBM', 'Geom_IBM.tex', u'Geom.IBM Documentation', + u'/ELSA/MU-09021/V'+__version__, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -257,9 +257,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Geom', u'Geom Documentation', - u'ONERA', 'Geom', 'One line description of project.', - 'Miscellaneous'), + ('index', 'Geom', u'Geom Documentation', + u'ONERA', 'Geom', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/Geom/setup.py b/Cassiopee/Geom/setup.py index 2725ef4cf..9167c4ee6 100644 --- a/Cassiopee/Geom/setup.py +++ b/Cassiopee/Geom/setup.py @@ -51,7 +51,7 @@ extra_compile_args=Dist.getCppArgs(), extra_link_args=Dist.getLinkArgs() )] - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Geom/setupLegacy.py b/Cassiopee/Geom/setupLegacy.py index 69bcc7f2b..a9fb3e72f 100644 --- a/Cassiopee/Geom/setupLegacy.py +++ b/Cassiopee/Geom/setupLegacy.py @@ -56,7 +56,7 @@ extra_compile_args=Dist.getCppArgs(), extra_link_args=Dist.getLinkArgs() )] - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Geom/test/bezier_t1.py b/Cassiopee/Geom/test/bezier_t1.py index 8e0b9b719..a7458d388 100644 --- a/Cassiopee/Geom/test/bezier_t1.py +++ b/Cassiopee/Geom/test/bezier_t1.py @@ -1,4 +1,4 @@ - # - bezier - +# - bezier - import Geom as D import Converter as C import Generator as G diff --git a/Cassiopee/Geom/test/changeIBCTypePT.py b/Cassiopee/Geom/test/changeIBCTypePT.py index 95b78ec90..fef27980b 100644 --- a/Cassiopee/Geom/test/changeIBCTypePT.py +++ b/Cassiopee/Geom/test/changeIBCTypePT.py @@ -3,7 +3,7 @@ import Converter.PyTree as C import Generator.PyTree as G import Geom.IBM as D_IBM -import numpy +import numpy a = G.cart((0.,0.,0.), (0.1,0.1,0.2), (10,11,12)) a = C.node2Center(a) diff --git a/Cassiopee/Geom/test/changeIBCTypePT_t1.py b/Cassiopee/Geom/test/changeIBCTypePT_t1.py index ac6546917..763407009 100644 --- a/Cassiopee/Geom/test/changeIBCTypePT_t1.py +++ b/Cassiopee/Geom/test/changeIBCTypePT_t1.py @@ -4,7 +4,7 @@ import Generator.PyTree as G import Geom.IBM as D_IBM import KCore.test as test -import numpy +import numpy a = G.cart((0.,0.,0.), (0.1,0.1,0.2), (10,11,12)) a = C.node2Center(a) diff --git a/Cassiopee/Geom/test/connect1D_t1.py b/Cassiopee/Geom/test/connect1D_t1.py index 67c3a9a14..ff1da8f37 100644 --- a/Cassiopee/Geom/test/connect1D_t1.py +++ b/Cassiopee/Geom/test/connect1D_t1.py @@ -21,4 +21,3 @@ s2 = D.spline(p2, N=10) out = D.connect1D([s1,s2], sharpness=0, lengthFactor=0.5) test.testA([out], 3) - diff --git a/Cassiopee/Geom/test/enforceh.py b/Cassiopee/Geom/test/enforceh.py index ab0b93ac2..1a04ea7cf 100644 --- a/Cassiopee/Geom/test/enforceh.py +++ b/Cassiopee/Geom/test/enforceh.py @@ -3,7 +3,7 @@ import Converter as C a = D.line((0,0,0), (1,0,0), N=30) -D.setH(a, 0, 0.01); D.setH(a, -1, 0.1) +D.setH(a, 0, 0.01); D.setH(a, -1, 0.1) b = D.enforceh(a, N=40) C.convertArrays2File(b, 'out.plt') diff --git a/Cassiopee/Geom/test/getCurvatureRadiusPT_t1.py b/Cassiopee/Geom/test/getCurvatureRadiusPT_t1.py index f4359df2d..17f62d8b8 100644 --- a/Cassiopee/Geom/test/getCurvatureRadiusPT_t1.py +++ b/Cassiopee/Geom/test/getCurvatureRadiusPT_t1.py @@ -15,7 +15,7 @@ a = D.line((0,0,0), (1,0,0), 3) rad = D.getCurvatureRadius(a) t = C.newPyTree(['Base',1]); t[2][1][2].append(rad) -test.testT(t,2) +test.testT(t,2) # bezier pts = D.polyline([(6,0.01,1), (5.4,0.036,1), (4.8,0.064,1), (2.5,0.21,1), diff --git a/Cassiopee/Geom/test/getCurvatureRadius_t1.py b/Cassiopee/Geom/test/getCurvatureRadius_t1.py index 972dedcf0..996b62b57 100644 --- a/Cassiopee/Geom/test/getCurvatureRadius_t1.py +++ b/Cassiopee/Geom/test/getCurvatureRadius_t1.py @@ -8,22 +8,22 @@ # ligne : courbure infinie a = D.line((0,0,0), (1,0,0), 3) rad = D.getCurvatureRadius(a) -test.testA([rad],1) +test.testA([rad],1) # cercle a = D.circle((0,0,0), 1, 10, 0, 10) rad = D.getCurvatureRadius(a) -test.testA([rad],2) +test.testA([rad],2) # bezier pts = D.polyline([(6,0.01,1), (5.4,0.036,1), (4.8,0.064,1), (2.5,0.21,1), (0.3,0.26,1),(0,0.047,1),(0,0,0)]) a = D.bezier( pts, 100 ) rad = D.getCurvatureRadius(a) -test.testA([rad],3) +test.testA([rad],3) # cercle pas dans le plan a = D.circle((0,0,0), 1, 10, 0, 10) a = T.rotate(a, (0,0,0), (1,0,0), 32.) rad = D.getCurvatureRadius(a) -test.testA([rad],4) +test.testA([rad],4) diff --git a/Cassiopee/Geom/test/getCurvilinearAbscissa_t1.py b/Cassiopee/Geom/test/getCurvilinearAbscissa_t1.py index 82ce419ae..94fa01e01 100644 --- a/Cassiopee/Geom/test/getCurvilinearAbscissa_t1.py +++ b/Cassiopee/Geom/test/getCurvilinearAbscissa_t1.py @@ -36,4 +36,3 @@ def g(t): c2 = D.getCurvilinearAbscissa([b,c]) c2 = C.addVars([[b,c], c2]) test.testA(c2,3) - diff --git a/Cassiopee/Geom/test/getDistributionPT_t1.py b/Cassiopee/Geom/test/getDistributionPT_t1.py index 9842d2910..96817b0da 100644 --- a/Cassiopee/Geom/test/getDistributionPT_t1.py +++ b/Cassiopee/Geom/test/getDistributionPT_t1.py @@ -19,4 +19,3 @@ def g(t): a1 = D.curve(f) b1 = D.getDistribution(a1) test.testT(b1, 2) - diff --git a/Cassiopee/Geom/test/getDistribution_t1.py b/Cassiopee/Geom/test/getDistribution_t1.py index e2f0299eb..aafba5956 100644 --- a/Cassiopee/Geom/test/getDistribution_t1.py +++ b/Cassiopee/Geom/test/getDistribution_t1.py @@ -27,4 +27,3 @@ def g(t): c = T.subzone(a, (50,1,1), (100,1,1) ) c2 = D.getDistribution([b,c]) test.testA(c2,3) - diff --git a/Cassiopee/Geom/test/getLengthPT_t1.py b/Cassiopee/Geom/test/getLengthPT_t1.py index 2c4b6decc..bd236bd60 100644 --- a/Cassiopee/Geom/test/getLengthPT_t1.py +++ b/Cassiopee/Geom/test/getLengthPT_t1.py @@ -3,7 +3,7 @@ import Converter.PyTree as C import KCore.test as test -# test getLength structure +# test getLength structure a = D.line((0,0,0), (1,0,0)) l = D.getLength(a) test.testO(l, l) diff --git a/Cassiopee/Geom/test/getLength_t1.py b/Cassiopee/Geom/test/getLength_t1.py index 04d07a515..1ff6c34c4 100644 --- a/Cassiopee/Geom/test/getLength_t1.py +++ b/Cassiopee/Geom/test/getLength_t1.py @@ -5,7 +5,7 @@ res = C.array('r', 1,1,1) -# test getLength structure +# test getLength structure a = D.line((0,0,0), (1,0,0)) l = D.getLength(a) - 1.0 res[1][0,0] = l diff --git a/Cassiopee/Geom/test/getSharpestAngle.py b/Cassiopee/Geom/test/getSharpestAngle.py index 11b76101b..b73ee2ba5 100644 --- a/Cassiopee/Geom/test/getSharpestAngle.py +++ b/Cassiopee/Geom/test/getSharpestAngle.py @@ -5,7 +5,7 @@ import Geom as D N = 10 -d1 = G.cart((0.,0.,0.), (0.05,1,1),(N,1,4)) +d1 = G.cart((0.,0.,0.), (0.05,1,1),(N,1,4)) d2 = G.cart((0.,0.,0.), (1.,0.001,1),(1,10*N,4)) d2 = T.rotate(d2,(0.,0.,0.),(0.,0.,1.),30.) s = T.join(d1,d2) diff --git a/Cassiopee/Geom/test/getSharpestAnglePT.py b/Cassiopee/Geom/test/getSharpestAnglePT.py index d946a485f..d5bb351a6 100644 --- a/Cassiopee/Geom/test/getSharpestAnglePT.py +++ b/Cassiopee/Geom/test/getSharpestAnglePT.py @@ -5,7 +5,7 @@ import Geom.PyTree as D N = 10 -d1 = G.cart((0.,0.,0.), (0.05,1,1),(N,1,4)) +d1 = G.cart((0.,0.,0.), (0.05,1,1),(N,1,4)) d2 = G.cart((0.,0.,0.), (1.,0.001,1),(1,10*N,4)) d2 = T.rotate(d2,(0.,0.,0.),(0.,0.,1.),30.) s = T.join(d1,d2) diff --git a/Cassiopee/Geom/test/getSharpestAnglePT_t1.py b/Cassiopee/Geom/test/getSharpestAnglePT_t1.py index e43ebdbfa..9b1949cce 100644 --- a/Cassiopee/Geom/test/getSharpestAnglePT_t1.py +++ b/Cassiopee/Geom/test/getSharpestAnglePT_t1.py @@ -6,7 +6,7 @@ import KCore.test as test N = 10 -d1 = G.cart((0.,0.,0.), (0.05,1,1),(N,1,4)) +d1 = G.cart((0.,0.,0.), (0.05,1,1),(N,1,4)) d2 = G.cart((0.,0.,0.), (1.,0.001,1),(1,10*N,4)) d2 = T.rotate(d2,(0.,0.,0.),(0.,0.,1.),30.) s0 = T.join(d1,d2) diff --git a/Cassiopee/Geom/test/getSharpestAngle_t1.py b/Cassiopee/Geom/test/getSharpestAngle_t1.py index 68556ae72..f84c482f2 100644 --- a/Cassiopee/Geom/test/getSharpestAngle_t1.py +++ b/Cassiopee/Geom/test/getSharpestAngle_t1.py @@ -6,7 +6,7 @@ import KCore.test as test N = 10 -d1 = G.cart((0.,0.,0.), (0.05,1,1),(N,1,4)) +d1 = G.cart((0.,0.,0.), (0.05,1,1),(N,1,4)) d2 = G.cart((0.,0.,0.), (1.,0.001,1),(1,10*N,4)) d2 = T.rotate(d2,(0.,0.,0.),(0.,0.,1.),30.) s0 = T.join(d1,d2) @@ -26,7 +26,7 @@ test.testA([s],2) # BAR -d1 = G.cart((0.,0.,0.), (0.05,1,1),(N,1,1)) +d1 = G.cart((0.,0.,0.), (0.05,1,1),(N,1,1)) d2 = G.cart((0.,0.,0.), (0.05,0.001,1),(2*N,1,1)) d2 = T.rotate(d2,(0.,0.,0.),(0.,0.,1.),30.) s0 = T.join(d1,d2) diff --git a/Cassiopee/Geom/test/getTangentPT.py b/Cassiopee/Geom/test/getTangentPT.py index d63a124f8..b2e38e329 100644 --- a/Cassiopee/Geom/test/getTangentPT.py +++ b/Cassiopee/Geom/test/getTangentPT.py @@ -3,6 +3,6 @@ import Converter.PyTree as C c = D.polyline([(0,0,0),(1,1,0),(2,-1,0)]) -a = D.spline(c, order=3, density=10.) +a = D.spline(c, order=3, density=10.) b = D.getTangent(a) C.convertPyTree2File(b, "out.cgns") diff --git a/Cassiopee/Geom/test/getTangentPT_t1.py b/Cassiopee/Geom/test/getTangentPT_t1.py index 8853c4536..38c00b0c4 100644 --- a/Cassiopee/Geom/test/getTangentPT_t1.py +++ b/Cassiopee/Geom/test/getTangentPT_t1.py @@ -5,7 +5,7 @@ # Along spline c = D.polyline([(0,0,0),(1,1,0),(2,-1,0)]) -a = D.spline(c, order=3, density=10.) +a = D.spline(c, order=3, density=10.) res = D.getTangent(a) test.testT(res, 1) diff --git a/Cassiopee/Geom/test/initInjPT_t1.py b/Cassiopee/Geom/test/initInjPT_t1.py index 40b813c2b..5702cb06b 100644 --- a/Cassiopee/Geom/test/initInjPT_t1.py +++ b/Cassiopee/Geom/test/initInjPT_t1.py @@ -5,7 +5,7 @@ import Geom.IBM as D_IBM import Geom.PyTree as D import KCore.test as test -import numpy +import numpy a = G.cart((0.,0.,0.), (0.1,0.1,0.2), (10,11,12)) a = C.node2Center(a) diff --git a/Cassiopee/Geom/test/initOutflowPT_t1.py b/Cassiopee/Geom/test/initOutflowPT_t1.py index 980afbc96..1f3e5ff03 100644 --- a/Cassiopee/Geom/test/initOutflowPT_t1.py +++ b/Cassiopee/Geom/test/initOutflowPT_t1.py @@ -5,7 +5,7 @@ import Geom.IBM as D_IBM import Geom.PyTree as D import KCore.test as test -import numpy +import numpy a = G.cart((0.,0.,0.), (0.1,0.1,0.2), (10,11,12)) a = C.node2Center(a) diff --git a/Cassiopee/Geom/test/lineDrivePT_t1.py b/Cassiopee/Geom/test/lineDrivePT_t1.py index 1e660a65f..1f498329f 100644 --- a/Cassiopee/Geom/test/lineDrivePT_t1.py +++ b/Cassiopee/Geom/test/lineDrivePT_t1.py @@ -20,7 +20,7 @@ test.testT(t, 2) # 2D structure + champ en noeuds + champ en centres -a = G.cylinder((0,0,0), 1, 2, 360, 0, 1, (50,21,1)) +a = G.cylinder((0,0,0), 1, 2, 360, 0, 1, (50,21,1)) a = C.addVars(a, 'var') a = C.addVars(a, 'centers:var2') b = D.line((0,0,0), (0,0.,1.)) diff --git a/Cassiopee/Geom/test/lineDrive_t1.py b/Cassiopee/Geom/test/lineDrive_t1.py index 57a926f6d..3ebceab2b 100644 --- a/Cassiopee/Geom/test/lineDrive_t1.py +++ b/Cassiopee/Geom/test/lineDrive_t1.py @@ -18,7 +18,7 @@ test.testA([c], 2) # 2D structure -a = G.cylinder((0,0,0), 1, 2, 360, 0, 1, (50,21,1)) +a = G.cylinder((0,0,0), 1, 2, 360, 0, 1, (50,21,1)) a = C.addVars(a, 'var') b = D.line((0,0,0), (0,0.,1.)) c = D.lineDrive(a, b) diff --git a/Cassiopee/Geom/test/nurbsPT.py b/Cassiopee/Geom/test/nurbsPT.py index ada0bba1e..839fe8eaf 100644 --- a/Cassiopee/Geom/test/nurbsPT.py +++ b/Cassiopee/Geom/test/nurbsPT.py @@ -4,7 +4,7 @@ import Generator.PyTree as G ni = 10; nj = 10 -a = G.cart((0,0,0), (1,1,1), (ni,nj,1)); +a = G.cart((0,0,0), (1,1,1), (ni,nj,1)); C._initVars(a,'weight',1.) C.setValue(a,'weight',(7,1,1), 7.) C.setValue(a,'weight',(9,5,1), 9.) diff --git a/Cassiopee/Geom/test/nurbsPT_t1.py b/Cassiopee/Geom/test/nurbsPT_t1.py index 37d682f0a..4f21a85f9 100644 --- a/Cassiopee/Geom/test/nurbsPT_t1.py +++ b/Cassiopee/Geom/test/nurbsPT_t1.py @@ -6,7 +6,7 @@ # 2D ni = 10; nj = 10 -a = G.cart((0,0,0), (1,1,1), (ni,nj,1)); +a = G.cart((0,0,0), (1,1,1), (ni,nj,1)); a = C.initVars(a, 'weight', 1.) C.setValue(a, 'weight', (7,1,1), 7.) C.setValue(a, 'weight', (9,5,1), 9.) diff --git a/Cassiopee/Geom/test/orthoDrive.py b/Cassiopee/Geom/test/orthoDrive.py index e757a8b6b..d703cb2bd 100644 --- a/Cassiopee/Geom/test/orthoDrive.py +++ b/Cassiopee/Geom/test/orthoDrive.py @@ -7,4 +7,3 @@ d = D.spline(c, 3, N=100) o = D.orthoDrive(a, d, mode=0) C.convertArrays2File(o, 'out.plt') - diff --git a/Cassiopee/Geom/test/orthoDrivePT.py b/Cassiopee/Geom/test/orthoDrivePT.py index f7d88108e..98e806c25 100644 --- a/Cassiopee/Geom/test/orthoDrivePT.py +++ b/Cassiopee/Geom/test/orthoDrivePT.py @@ -7,4 +7,3 @@ d = D.spline(c, 3, N=100) o = D.orthoDrive(a, d, mode=0) C.convertPyTree2File(o, 'out.cgns') - diff --git a/Cassiopee/Geom/test/refine.py b/Cassiopee/Geom/test/refine.py index 16cd7cbcd..ed25c01a9 100644 --- a/Cassiopee/Geom/test/refine.py +++ b/Cassiopee/Geom/test/refine.py @@ -8,4 +8,3 @@ a = T.join([a,b]) a = D.refine(a, N=30) C.convertArrays2File(a, 'out.plt') - diff --git a/Cassiopee/Geom/test/refinePT.py b/Cassiopee/Geom/test/refinePT.py index 63cee1eb8..8d67cce20 100644 --- a/Cassiopee/Geom/test/refinePT.py +++ b/Cassiopee/Geom/test/refinePT.py @@ -8,4 +8,3 @@ a = T.join([a,b]) a = D.refine(a, N=30) C.convertPyTree2File(a, 'out.cgns') - diff --git a/Cassiopee/Geom/test/spline.py b/Cassiopee/Geom/test/spline.py index 5bf169721..cb688865e 100644 --- a/Cassiopee/Geom/test/spline.py +++ b/Cassiopee/Geom/test/spline.py @@ -38,4 +38,3 @@ b = D.spline(a, 4, N=30, M=30) c = D.spline(a, 4, density=10.) C.convertArrays2File([a, b, c], 'out2.plt') - diff --git a/Cassiopee/Geom/test/text2DPT_t1.py b/Cassiopee/Geom/test/text2DPT_t1.py index 16db0b65c..7e325e68a 100644 --- a/Cassiopee/Geom/test/text2DPT_t1.py +++ b/Cassiopee/Geom/test/text2DPT_t1.py @@ -4,6 +4,6 @@ import KCore.test as test a = D.text2D("CASSIOPEE", font='text1') -t = C.newPyTree(['Base', 2, a]) +t = C.newPyTree(['Base', 2, a]) test.testT(t, 1) test.writeCoverage(100) diff --git a/Cassiopee/Geom/test/transformTc2PT.py b/Cassiopee/Geom/test/transformTc2PT.py index 52f3de719..96e050dd3 100644 --- a/Cassiopee/Geom/test/transformTc2PT.py +++ b/Cassiopee/Geom/test/transformTc2PT.py @@ -4,7 +4,7 @@ import Generator.PyTree as G import Geom.IBM as D_IBM import Geom.PyTree as D -import numpy +import numpy a = G.cart((0.,0.,0.), (0.1,0.1,0.2), (10,11,12)) a = C.node2Center(a) diff --git a/Cassiopee/Geom/test/transformTc2PT_t1.py b/Cassiopee/Geom/test/transformTc2PT_t1.py index 9938a417c..99b168c4e 100644 --- a/Cassiopee/Geom/test/transformTc2PT_t1.py +++ b/Cassiopee/Geom/test/transformTc2PT_t1.py @@ -5,7 +5,7 @@ import Geom.IBM as D_IBM import Geom.PyTree as D import KCore.test as test -import numpy +import numpy a = G.cart((0.,0.,0.), (0.1,0.1,0.2), (10,11,12)) a = C.node2Center(a) diff --git a/Cassiopee/Initiator/Initiator/Initiator.py b/Cassiopee/Initiator/Initiator/Initiator.py index d1d83cdea..b97ab3f78 100644 --- a/Cassiopee/Initiator/Initiator/Initiator.py +++ b/Cassiopee/Initiator/Initiator/Initiator.py @@ -9,12 +9,12 @@ from .Adim import adim1, adim2, adim3, dim1, dim2, dim3, dim4 def _applyGaussianAL(a, listOfLoads, listOfALPositions, listOfRotMat, - localEpsX, localEpsY, localEpsZ, NbBlades, NbPointsAL, - TruncVarLoads, TruncVarVelos): + localEpsX, localEpsY, localEpsZ, NbBlades, NbPointsAL, + TruncVarLoads, TruncVarVelos): if isinstance(a[0], list): initiator.applyGaussianAL(a, - listOfLoads,listOfALPositions,listOfRotMat, - localEpsX, localEpsY, localEpsZ, NbBlades, NbPointsAL, TruncVarLoads, TruncVarVelos) + listOfLoads,listOfALPositions,listOfRotMat, + localEpsX, localEpsY, localEpsZ, NbBlades, NbPointsAL, TruncVarLoads, TruncVarVelos) else: initiator.applyGaussianAL( [a],listOfLoads,listOfALPositions,listOfRotMat, diff --git a/Cassiopee/Initiator/Initiator/MeshSize.py b/Cassiopee/Initiator/Initiator/MeshSize.py index de29a5285..413b7ea7a 100644 --- a/Cassiopee/Initiator/Initiator/MeshSize.py +++ b/Cassiopee/Initiator/Initiator/MeshSize.py @@ -53,7 +53,7 @@ def meshSize(UInf, RoInf, ReInf, LInf, esurc=0.012, yplus=1., algo='Turbulent'): def boundaryLayerHeight(ReInf, algo='Turbulent'): if algo == 'Laminar': - delta = 0.75*5*ReInf**(-0.5) + delta = 0.75*5*ReInf**(-0.5) elif algo == 'Turbulent': delta = 0.75*0.37*ReInf**(-1./5.) return delta diff --git a/Cassiopee/Initiator/Initiator/PyTree.py b/Cassiopee/Initiator/Initiator/PyTree.py index 88e90613e..10661cc7f 100755 --- a/Cassiopee/Initiator/Initiator/PyTree.py +++ b/Cassiopee/Initiator/Initiator/PyTree.py @@ -14,16 +14,16 @@ raise ImportError("Initiator.PyTree: requires Converter.PyTree module.") def _applyGaussianAL(t, listOfLoads, listOfALPositions, listOfRotMat, - localEpsX, localEpsY, localEpsZ, NbBlades, NbPointsAL, - TruncVarLoads, TruncVarVelos): + localEpsX, localEpsY, localEpsZ, NbBlades, NbPointsAL, + TruncVarLoads, TruncVarVelos): writeDim = False fa = C.getFields(Internal.__FlowSolutionCenters__, t, api=3) if fa != []: Initiator._applyGaussianAL(fa, listOfLoads, listOfALPositions, listOfRotMat, - localEpsX, localEpsY, localEpsZ, NbBlades, NbPointsAL, TruncVarLoads, TruncVarVelos) + localEpsX, localEpsY, localEpsZ, NbBlades, NbPointsAL, TruncVarLoads, TruncVarVelos) return None -def initConst(t, adim='adim1', MInf=None, alphaZ=0., alphaY=0., ReInf=1.e8, +def initConst(t, adim='adim1', MInf=None, alphaZ=0., alphaY=0., ReInf=1.e8, loc='nodes'): """Init the pyTree by the reference state if it is defined in t, else by input parameters. Usage: initConst(t, adim, MInf, alphaZ, alphaY, ReInf, loc)""" @@ -31,14 +31,14 @@ def initConst(t, adim='adim1', MInf=None, alphaZ=0., alphaY=0., ReInf=1.e8, _initConst(tp, adim, MInf, alphaZ, alphaY, ReInf, loc) return tp -def _initConst(t, adim='adim1', MInf=None, alphaZ=0., alphaY=0., ReInf=1.e8, +def _initConst(t, adim='adim1', MInf=None, alphaZ=0., alphaY=0., ReInf=1.e8, loc='nodes'): """Init the pyTree by the reference state if it is defined in t, else by input parameters.""" if MInf is None: # recuperation de reference state eq = Internal.getNodeFromName(t, 'GoverningEquations') state = Internal.getNodeFromName(t, 'ReferenceState') if state is None: raise ValueError("initConst: no reference state and no argument.") - vars0 = ['Density', 'MomentumX', 'MomentumY', 'MomentumZ', + vars0 = ['Density', 'MomentumX', 'MomentumY', 'MomentumZ', 'EnergyStagnationDensity'] if eq is not None and Internal.getValue(eq) == 'NSTurbulent': vars0 += ['TurbulentSANuTildeDensity', 'TurbulentEnergyKineticDensity', 'TurbulentDissipationDensity'] @@ -70,7 +70,7 @@ def _initDist(t, adim='adim1', loc='nodes'): eq = Internal.getNodeFromName(t, 'GoverningEquations') state = Internal.getNodeFromName(t, 'ReferenceState') if state is None: raise ValueError("initConst: no reference state and no argument.") - vars0 = ['Density', 'MomentumX', 'MomentumY', 'MomentumZ', + vars0 = ['Density', 'MomentumX', 'MomentumY', 'MomentumZ', 'EnergyStagnationDensity'] if eq is not None and Internal.getValue(eq) == 'NSTurbulent': vars0 += ['TurbulentSANuTildeDensity', 'TurbulentEnergyKineticDensity', 'TurbulentDissipationDensity'] @@ -160,7 +160,7 @@ def initVisbal(t, position=(0.,0.), Gamma=2., MInf=0.5, loc='nodes'): _initVisbal(tp, position, Gamma, MInf, loc) return tp -def _initVisbal(t, position=(0.,0.), Gamma=2., MInf=0.5, loc='nodes'): +def _initVisbal(t, position=(0.,0.), Gamma=2., MInf=0.5, loc='nodes'): """Init the array defining a grid with a Visbal vortex of intensity Gamma and position (x0,y0).""" nodes = Internal.getZones(t) for z in nodes: @@ -219,7 +219,7 @@ def _initYee(t, position=(0.,0.), Gamma=2., MInf=0.5, loc='nodes'): return None def initScully(t, position=(0.,0.), Gamma=2., - coreRadius=1., MInf=0.5, model=0, loc='nodes'): + coreRadius=1., MInf=0.5, model=0, loc='nodes'): """Init the array defining a block field with a Scully vortex of intensity Gamma, core radius coreRadius and position (x0,y0). Usage: initScully(array, (x0,y0), Gamma, coreRadius, MInf, model)""" @@ -292,7 +292,7 @@ def _overlayField(t1, t2, MInf=0.5, loc='nodes'): def cons2Prim(t, Gamma=1.4, Rgas=287.053, loc='centers'): """Compute primitive variables from conservative variables""" tp = Internal.copyRef(t) - _cons2Prim(t, Gamma=Gamma, Rgas = Rgas, loc=loc) + _cons2Prim(t, Gamma=Gamma, Rgas=Rgas, loc=loc) return tp def _cons2Prim(t, Gamma=1.4, Rgas=287.053, loc='centers'): diff --git a/Cassiopee/Initiator/doc/source/conf.py b/Cassiopee/Initiator/doc/source/conf.py index 023eec3d5..db5353f4d 100644 --- a/Cassiopee/Initiator/doc/source/conf.py +++ b/Cassiopee/Initiator/doc/source/conf.py @@ -192,15 +192,15 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', -'preamble': r''' + # Additional stuff for the LaTeX preamble. + #'preamble': '', + 'preamble': r''' \usepackage{charter} \usepackage[defaultsans]{lato} \usepackage{inconsolata} @@ -211,8 +211,8 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('Initiator', 'Initiator.tex', u'Initiator Documentation', - u'/ELSA/MU-10019/V'+__version__, 'manual'), + ('Initiator', 'Initiator.tex', u'Initiator Documentation', + u'/ELSA/MU-10019/V'+__version__, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -255,9 +255,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Initiator', u'Initiator Documentation', - u'ONERA', 'Initiator', 'One line description of project.', - 'Miscellaneous'), + ('index', 'Initiator', u'Initiator Documentation', + u'ONERA', 'Initiator', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/Initiator/setup.py b/Cassiopee/Initiator/setup.py index 5aea677dd..f44c449de 100644 --- a/Cassiopee/Initiator/setup.py +++ b/Cassiopee/Initiator/setup.py @@ -52,7 +52,7 @@ extra_link_args=Dist.getLinkArgs() ) ] - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Initiator/setupLegacy.py b/Cassiopee/Initiator/setupLegacy.py index 0a3ef10ac..897289e28 100644 --- a/Cassiopee/Initiator/setupLegacy.py +++ b/Cassiopee/Initiator/setupLegacy.py @@ -58,7 +58,7 @@ extra_link_args=Dist.getLinkArgs() ) ] - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Initiator/test/adim1.py b/Cassiopee/Initiator/test/adim1.py index 4e6e75ad4..811c732df 100644 --- a/Cassiopee/Initiator/test/adim1.py +++ b/Cassiopee/Initiator/test/adim1.py @@ -1,7 +1,7 @@ # - adim1 - import Initiator.Adim as Adim state = Adim.adim1(MInf=0.8, alphaZ=1., ReInf=1.e6); print(state) -#>> [1.0, 0.799878156125113, 0.01396192514982681, 0.0, 2.1057142857142863, -#>> 0.7142857142857143, 1.0, 1.7857142857142863, 0.8, 1000000.0, -#>> 0.3831337844872463, 1.4, 8e-09, 0.049999999999999996, +#>> [1.0, 0.799878156125113, 0.01396192514982681, 0.0, 2.1057142857142863, +#>> 0.7142857142857143, 1.0, 1.7857142857142863, 0.8, 1000000.0, +#>> 0.3831337844872463, 1.4, 8e-09, 0.049999999999999996, #>> 1.6000000000000003e-07, 8.000000000000001e-07, 0.3831337844872463, 1.0, 0.70951] diff --git a/Cassiopee/Initiator/test/adim2.py b/Cassiopee/Initiator/test/adim2.py index ec3a1c5a8..718e8559b 100644 --- a/Cassiopee/Initiator/test/adim2.py +++ b/Cassiopee/Initiator/test/adim2.py @@ -1,7 +1,7 @@ # - adim2 - import Initiator.Adim as Adim state = Adim.adim2(MInf=0.8, alphaZ=1., ReInf=1.e6); print(state) -#>> [1.0, 0.9998476951563913, 0.01745240643728351, 0.0, 3.290178571428572, -#>> 1.1160714285714286, 1.0, 2.790178571428572, 0.8, 1000000.0, -#>> 0.3831337844872463, 1.4, 1e-08, 0.05, 2e-07, 1e-06, 0.3831337844872463, +#>> [1.0, 0.9998476951563913, 0.01745240643728351, 0.0, 3.290178571428572, +#>> 1.1160714285714286, 1.0, 2.790178571428572, 0.8, 1000000.0, +#>> 0.3831337844872463, 1.4, 1e-08, 0.05, 2e-07, 1e-06, 0.3831337844872463, #>> 1.0, 0.70951] diff --git a/Cassiopee/Initiator/test/adim3.py b/Cassiopee/Initiator/test/adim3.py index 36c96b55b..152d2536a 100644 --- a/Cassiopee/Initiator/test/adim3.py +++ b/Cassiopee/Initiator/test/adim3.py @@ -1,7 +1,7 @@ # - adim3 - import Initiator.Adim as Adim state = Adim.adim3(MInf=0.8, alphaZ=1., LInf=2.5, ReInf=1.e6); print(state) -#>> [1.0, 0.799878156125113, 0.01396192514982681, 0.0, 2.1057142857142863, -#>> 0.7142857142857143, 1.0, 1.7857142857142863, 0.8, 1000000.0, -#>> 0.3831337844872463, 1.4, 8e-09, 0.02, 4e-07, 2e-06, 0.3831337844872463, +#>> [1.0, 0.799878156125113, 0.01396192514982681, 0.0, 2.1057142857142863, +#>> 0.7142857142857143, 1.0, 1.7857142857142863, 0.8, 1000000.0, +#>> 0.3831337844872463, 1.4, 8e-09, 0.02, 4e-07, 2e-06, 0.3831337844872463, #>> 1.0, 0.70951] diff --git a/Cassiopee/Initiator/test/dim1.py b/Cassiopee/Initiator/test/dim1.py index 0bcdc4415..48841ac69 100644 --- a/Cassiopee/Initiator/test/dim1.py +++ b/Cassiopee/Initiator/test/dim1.py @@ -1,7 +1,7 @@ # - dim1 - import Initiator.Adim as Adim state = Adim.dim1(UInf=2.8, TInf=298., PInf=101325, LInf=12., alphaZ=1.); print(state) -#>> [1.1845087092749074, 3.3161192480113266, 0.05788307678374978, 0.0, -#>> 253317.14327414043, 101325, 298.0, 717.6325, 0.00809104909572454, -#>> 2167112.2969719185, 110.4, 1.4, 3.316624385969741e-08, 0.009029634570716328, +#>> [1.1845087092749074, 3.3161192480113266, 0.05788307678374978, 0.0, +#>> 253317.14327414043, 101325, 298.0, 717.6325, 0.00809104909572454, +#>> 2167112.2969719185, 110.4, 1.4, 3.316624385969741e-08, 0.009029634570716328, #>> 3.673043864616362e-06, 1.78938e-05, 110.4, 288.15, 0.7084595175093612] diff --git a/Cassiopee/Initiator/test/dim2.py b/Cassiopee/Initiator/test/dim2.py index 4196fab03..311719213 100644 --- a/Cassiopee/Initiator/test/dim2.py +++ b/Cassiopee/Initiator/test/dim2.py @@ -1,7 +1,7 @@ # - dim2 - import Initiator.Adim as Adim state = Adim.dim2(UInf=2.8, TInf=298., RoInf=1.2, LInf=12., alphaZ=1.); print(state) -#>> [1.2, 3.3594882557254744, 0.058640085629272594, 0.0, 256630.08600000004, -#>> 102650.1528, 298.0, 717.6325000000002, 0.00809104909572454, -#>> 2195454.314521849, 110.4, 1.4, 3.3599999999999996e-08, 0.009147726310507706, +#>> [1.2, 3.3594882557254744, 0.058640085629272594, 0.0, 256630.08600000004, +#>> 102650.1528, 298.0, 717.6325000000002, 0.00809104909572454, +#>> 2195454.314521849, 110.4, 1.4, 3.3599999999999996e-08, 0.009147726310507706, #>> 3.673043864616362e-06, 1.78938e-05, 110.4, 288.15, 0.7084595175093613] diff --git a/Cassiopee/Initiator/test/dim3.py b/Cassiopee/Initiator/test/dim3.py index 152469a99..22cc58cc6 100644 --- a/Cassiopee/Initiator/test/dim3.py +++ b/Cassiopee/Initiator/test/dim3.py @@ -1,8 +1,8 @@ # - dim3 - import Initiator.Adim as Adim state = Adim.dim3(UInf=2.8, PInf=101325., RoInf=1.2, LInf=12., alphaZ=1.); print(state) -#>> [1.1999999999999997, 3.3594882557254735, 0.05864008562927258, 0.0, -#>> 253317.20400000006, 101325.0, 294.152996136602, 717.6325000000002, -#>> 0.0081437855769486, 2217576.314799729, 110.4, 1.4, 3.359999999999999e-08, -#>> 0.009239901311665535, 3.6364024751627385e-06, 1.78938e-05, 110.4, +#>> [1.1999999999999997, 3.3594882557254735, 0.05864008562927258, 0.0, +#>> 253317.20400000006, 101325.0, 294.152996136602, 717.6325000000002, +#>> 0.0081437855769486, 2217576.314799729, 110.4, 1.4, 3.359999999999999e-08, +#>> 0.009239901311665535, 3.6364024751627385e-06, 1.78938e-05, 110.4, #>> 288.15, 0.7094696135544664] diff --git a/Cassiopee/Initiator/test/initConstPT_t2.py b/Cassiopee/Initiator/test/initConstPT_t2.py index 0e5112c97..363aa7084 100644 --- a/Cassiopee/Initiator/test/initConstPT_t2.py +++ b/Cassiopee/Initiator/test/initConstPT_t2.py @@ -25,7 +25,7 @@ test.testT(z, 4) # ME -a = G.cartHexa((0,0,0), (0.05,0.05,1), (50,100,2)) +a = G.cartHexa((0,0,0), (0.05,0.05,1), (50,100,2)) b = G.cartTetra((2.45,0,0), (0.05,0.05,1), (50,100,2)) z = C.mergeConnectivity(a, b, boundary=0) I._initConst(z, MInf=0.8, loc='centers') diff --git a/Cassiopee/Initiator/test/lambPT_t1.py b/Cassiopee/Initiator/test/lambPT_t1.py index 67c0f299a..d6fe65c6b 100755 --- a/Cassiopee/Initiator/test/lambPT_t1.py +++ b/Cassiopee/Initiator/test/lambPT_t1.py @@ -12,6 +12,6 @@ a = C.addBC2Zone(a, "overlap", 'BCOverlap', 'jmin') t = C.newPyTree(['Base',a]) t[2][1] = C.addState(t[2][1], 'Mach', 0.8) -t = C.initVars(t,'F',1.); t = C.initVars(t,'centers:G', 2.) +t = C.initVars(t,'F',1.); t = C.initVars(t,'centers:G', 2.) t = I.initLamb(t, position=(7.,7.), Gamma=2., MInf=0.8, loc='centers') test.testT(t,1) diff --git a/Cassiopee/Initiator/test/lambPT_t2.py b/Cassiopee/Initiator/test/lambPT_t2.py index e34104296..be8ca0d52 100644 --- a/Cassiopee/Initiator/test/lambPT_t2.py +++ b/Cassiopee/Initiator/test/lambPT_t2.py @@ -25,7 +25,7 @@ test.testT(z, 4) # ME -a = G.cartHexa((0,0,0), (0.05,0.05,1), (50,100,2)) +a = G.cartHexa((0,0,0), (0.05,0.05,1), (50,100,2)) b = G.cartTetra((2.45,0,0), (0.05,0.05,1), (50,100,2)) z = C.mergeConnectivity(a, b, boundary=0) I._initLamb(z, position=(2.5,2.5), Gamma=2., MInf=0.8, loc='centers') diff --git a/Cassiopee/Initiator/test/overlay2.py b/Cassiopee/Initiator/test/overlay2.py index f9d80b353..2179aa355 100644 --- a/Cassiopee/Initiator/test/overlay2.py +++ b/Cassiopee/Initiator/test/overlay2.py @@ -24,6 +24,3 @@ an = I.overlayField(ac, a2, Mach) file = 'newL'+countName+'.plt' C.convertArrays2File([an],file,"bin_tp") - - - diff --git a/Cassiopee/Initiator/test/scullyPT_t2.py b/Cassiopee/Initiator/test/scullyPT_t2.py index 7fe930c2e..38171ee33 100644 --- a/Cassiopee/Initiator/test/scullyPT_t2.py +++ b/Cassiopee/Initiator/test/scullyPT_t2.py @@ -25,7 +25,7 @@ test.testT(z, 4) # ME -a = G.cartHexa((0,0,0), (0.05,0.05,1), (50,100,2)) +a = G.cartHexa((0,0,0), (0.05,0.05,1), (50,100,2)) b = G.cartTetra((2.45,0,0), (0.05,0.05,1), (50,100,2)) z = C.mergeConnectivity(a, b, boundary=0) I._initScully(z, position=(2.5,2.5), Gamma=2., MInf=0.8, loc='centers') diff --git a/Cassiopee/Initiator/test/visbalPT_t1.py b/Cassiopee/Initiator/test/visbalPT_t1.py index 20de0026d..a4b298887 100755 --- a/Cassiopee/Initiator/test/visbalPT_t1.py +++ b/Cassiopee/Initiator/test/visbalPT_t1.py @@ -12,6 +12,6 @@ a = C.addBC2Zone(a, 'overlap', 'BCOverlap', 'jmin') t = C.newPyTree(['Base']); t[2][1][2].append(a) t[2][1] = C.addState(t[2][1], 'Mach', 0.8) -t = C.initVars(t,'F', 1.); t = C.initVars(t,'centers:G', 2.) +t = C.initVars(t,'F', 1.); t = C.initVars(t,'centers:G', 2.) t = I.initVisbal(t, position=(7.,7.), Gamma=2., MInf=0.8, loc='centers') test.testT(t,1) diff --git a/Cassiopee/Initiator/test/visbalPT_t2.py b/Cassiopee/Initiator/test/visbalPT_t2.py index ee6f8f8fb..adb55651a 100644 --- a/Cassiopee/Initiator/test/visbalPT_t2.py +++ b/Cassiopee/Initiator/test/visbalPT_t2.py @@ -25,7 +25,7 @@ test.testT(z, 4) # ME -a = G.cartHexa((0,0,0), (0.05,0.05,1), (50,100,2)) +a = G.cartHexa((0,0,0), (0.05,0.05,1), (50,100,2)) b = G.cartTetra((2.45,0,0), (0.05,0.05,1), (50,100,2)) z = C.mergeConnectivity(a, b, boundary=0) I._initVisbal(z, position=(2.5,2.5), Gamma=2., MInf=0.8, loc='centers') diff --git a/Cassiopee/Initiator/test/wissocqPT_t2.py b/Cassiopee/Initiator/test/wissocqPT_t2.py index 73a1815ff..aaca77cc0 100644 --- a/Cassiopee/Initiator/test/wissocqPT_t2.py +++ b/Cassiopee/Initiator/test/wissocqPT_t2.py @@ -25,7 +25,7 @@ test.testT(z, 4) # ME -a = G.cartHexa((0,0,0), (0.05,0.05,1), (50,100,2)) +a = G.cartHexa((0,0,0), (0.05,0.05,1), (50,100,2)) b = G.cartTetra((2.45,0,0), (0.05,0.05,1), (50,100,2)) z = C.mergeConnectivity(a, b, boundary=0) I._initWissocq(z, position=(2.5,2.5), Gamma=2., MInf=0.8, loc='centers') diff --git a/Cassiopee/Initiator/test/yeePT_t2.py b/Cassiopee/Initiator/test/yeePT_t2.py index 613c5b695..b2bb03886 100644 --- a/Cassiopee/Initiator/test/yeePT_t2.py +++ b/Cassiopee/Initiator/test/yeePT_t2.py @@ -25,7 +25,7 @@ test.testT(z, 4) # ME -a = G.cartHexa((0,0,0), (0.05,0.05,1), (50,100,2)) +a = G.cartHexa((0,0,0), (0.05,0.05,1), (50,100,2)) b = G.cartTetra((2.45,0,0), (0.05,0.05,1), (50,100,2)) z = C.mergeConnectivity(a, b, boundary=0) I._initYee(z, position=(2.5,2.5), Gamma=2., MInf=0.8, loc='centers') diff --git a/Cassiopee/Intersector/Intersector/Intersector.py b/Cassiopee/Intersector/Intersector/Intersector.py index 783014ee0..569671e06 100755 --- a/Cassiopee/Intersector/Intersector/Intersector.py +++ b/Cassiopee/Intersector/Intersector/Intersector.py @@ -2,7 +2,7 @@ """ __version__ = '4.0' __author__ = "Sam Landier" -# +# # Python Interface to create arrays defining meshes # from . import intersector @@ -60,7 +60,7 @@ def booleanIntersection(a1, a2, tol=0., preserve_right=1, solid_right=1, agg_mod c = intersector.booleanIntersection(a1, a2, tol, preserve_right, solid_right, agg_mode, improve_qual, True, itermax)# last is dummy (outward) return G.close(c) -def booleanUnion(a1, a2, tol=0., preserve_right=1, solid_right=1, agg_mode=1, improve_qual=False, extrude_pgs=[], simplify_pgs = True, hard_mode=0, itermax=10): #agg_mode : 0(NONE), 1(CONVEX), 2(FULL) +def booleanUnion(a1, a2, tol=0., preserve_right=1, solid_right=1, agg_mode=1, improve_qual=False, extrude_pgs=[], simplify_pgs=True, hard_mode=0, itermax=10): #agg_mode : 0(NONE), 1(CONVEX), 2(FULL) """Computes the union between two closed-surface or two volume meshes. Usage for surfaces or bars: booleanUnion(a1, a2, tol) Usage for volumes: booleanUnion(a1, a2, tol, preserve_right, solid_right)""" @@ -73,11 +73,11 @@ def booleanUnion(a1, a2, tol=0., preserve_right=1, solid_right=1, agg_mode=1, im except: pass c = intersector.booleanUnion(a1, a2, tol, preserve_right, solid_right, agg_mode, improve_qual, extrude_pgs, 0, 0, itermax) return G.close(c[0]) - else: + else: c = intersector.booleanUnion(a1, a2, tol, preserve_right, solid_right, agg_mode, improve_qual, extrude_pgs, simplify_pgs, hard_mode, itermax) return c[0] #close is done inside -def booleanUnionWithHisto(a1, a2, tol=0., preserve_right=1, solid_right=1, agg_mode=1, improve_qual=False, extrude_pgs=[], simplify_pgs = True, hard_mode=0, itermax=10): #agg_mode : 0(NONE), 1(CONVEX), 2(FULL) +def booleanUnionWithHisto(a1, a2, tol=0., preserve_right=1, solid_right=1, agg_mode=1, improve_qual=False, extrude_pgs=[], simplify_pgs=True, hard_mode=0, itermax=10): #agg_mode : 0(NONE), 1(CONVEX), 2(FULL) """Computes the union between two closed-surface or two volume meshes. Usage for surfaces or bars: booleanUnion(a1, a2, tol) Usage for volumes: booleanUnion(a1, a2, tol, preserve_right, solid_right)""" @@ -90,7 +90,7 @@ def booleanUnionWithHisto(a1, a2, tol=0., preserve_right=1, solid_right=1, agg_m except: pass c = intersector.booleanUnion(a1, a2, tol, preserve_right, solid_right, agg_mode, improve_qual, extrude_pgs, 0, 0, itermax) return G.close(c) - else: + else: c = intersector.booleanUnion(a1, a2, tol, preserve_right, solid_right, agg_mode, improve_qual, extrude_pgs, simplify_pgs, hard_mode, itermax) return c #close is done inside @@ -99,7 +99,7 @@ def booleanUnionWithHisto(a1, a2, tol=0., preserve_right=1, solid_right=1, agg_m -def booleanUnionMZ(a1, a2, xtol=0., jtol = 0., agg_mode=1, improve_qual=False, simplify_pgs = True, hard_mode=0): #agg_mode : 0(NONE), 1(CONVEX), 2(FULL) +def booleanUnionMZ(a1, a2, xtol=0., jtol=0., agg_mode=1, improve_qual=False, simplify_pgs=True, hard_mode=0): #agg_mode : 0(NONE), 1(CONVEX), 2(FULL) """Computes the union between two volume meshes. Usage for volumes: booleanUnionMZ(a1, a2, tol, agg_mode)""" c = intersector.booleanUnionMZ(a1, a2, xtol, jtol, agg_mode, improve_qual, simplify_pgs, hard_mode) @@ -149,7 +149,7 @@ def XcellN(coord, zwall_ids, basenum, masks, wall_ids, priorities, output_type=0 # IN: aR : receiver mesh # IN : aD : donnor mesh # IN : fldD : donnor center fields -# OUT: returns aR with transferred center fields from aD in a conservative manner +# OUT: returns aR with transferred center fields from aD in a conservative manner #============================================================================== def P1ConservativeInterpolation(aR, aD, fldD): """Does conservative interpolations from aD center fields (fldD) to aR @@ -225,18 +225,18 @@ def externalFaces(a, discarded_ids=None, geo_dim=-1): #============================================================================== # reorient -# IN: -# OUT: +# IN: +# OUT: #============================================================================== -def reorient(a, dir = 1): +def reorient(a, dir=1): """Reorients outward the external polygons of a mesh. Usage: reorient(a)""" return intersector.reorient(a, dir) #============================================================================== # reorientSpecifiedFaces -# IN: -# OUT: +# IN: +# OUT: #============================================================================== def reorientSpecifiedFaces(a, pgs, dir): """Reorients outward (dir = 1) or inward (dir=-1) the specified polygons of a mesh. @@ -245,15 +245,15 @@ def reorientSpecifiedFaces(a, pgs, dir): #============================================================================== # reorientSpecifiedFaces -# IN: -# OUT: +# IN: +# OUT: #============================================================================== def reorientSurf(a, dir): return intersector.reorientSurf(a, dir) #============================================================================== # reorientBC -# IN: -# OUT: +# IN: +# OUT: #============================================================================== def reorientBC(a, pgs, dir): """Reorients outward (dir = 1) or inward (dir=-1) the specified polygons of a mesh. @@ -265,7 +265,7 @@ def reorientBC(a, pgs, dir): # IN: coords: 3D NGON mesh # OUT: returns a 3D NGON Mesh with all the faces made convex #============================================================================== -def convexifyFaces(a, convexity_TOL = 1.e-8): +def convexifyFaces(a, convexity_TOL=1.e-8): """Convexifies any non-convex polygon in a mesh. Usage: convexifyFaces(a)""" return intersector.convexifyFaces(a, convexity_TOL) @@ -275,12 +275,12 @@ def convexifyFaces(a, convexity_TOL = 1.e-8): # IN : mesh : 3D NGON mesh # IN : PH_set : PH to process. 0 for concave cells or 1 for non-centroid-star_shaped cells # IN : split_policy : 0 : convexify concave pgs. 1 : starify concave pgs. 2 : starify any pgs at concave-chains ends. -# OUT: returns a 3D NGON Mesh with some face polygon splits : -# split (convexify, starify) some targeted polygons on targeted cells +# OUT: returns a 3D NGON Mesh with some face polygon splits : +# split (convexify, starify) some targeted polygons on targeted cells # (typically bad polyhedra -concaves, non-centroid-star-shaped-) # to prepare the split of those bad cells. #============================================================================== -def prepareCellsSplit(a, PH_set = 1, split_policy = 0, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = 1.e-8): +def prepareCellsSplit(a, PH_set=1, split_policy=0, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-8): """Splits some prescribed polygons following a prescribed splitting policy. Usage: prepareCellsSplit(a, PH_set, split_policy, PH_conc_threshold, PH_cvx_threshold, PG_cvx_threshold)""" return intersector.prepareCellsSplit(a, PH_set, split_policy, PH_conc_threshold, PH_cvx_threshold, PG_cvx_threshold) @@ -293,7 +293,7 @@ def prepareCellsSplit(a, PH_set = 1, split_policy = 0, PH_conc_threshold = 1./3. # IN : PG_cvx_threshold : convexity angle threshold for polygons # OUT: returns a 3D NGON Mesh with none (or at least less) non-centroid-star_shaped cells. #============================================================================== -def splitNonStarCells(a, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = 1.e-8): +def splitNonStarCells(a, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-8): """Splits some non-centroid-star_shaped cells. Usage: splitNonStarCells(a, PH_conc_threshold, PH_cvx_threshold, PG_cvx_threshold)""" return intersector.splitNonStarCells(a, PH_conc_threshold, PH_cvx_threshold, PG_cvx_threshold) @@ -305,7 +305,7 @@ def splitNonStarCells(a, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_ # IN : discarded_ids : list of ids (0-based) to skip # OUT: returns a 3D NGON Mesh with less polygons (but same shape) #============================================================================== -def simplifyCells(a, treat_externals, angular_threshold = 1.e-12, discarded_ids=None): +def simplifyCells(a, treat_externals, angular_threshold=1.e-12, discarded_ids=None): """Simplifies over-defined polyhedral cells (agglomerate some elligible polygons). Usage: simplifyCells(a, treat_externals, angular_threshold)""" return intersector.simplifyCells(a, treat_externals, angular_threshold, discarded_ids) @@ -326,7 +326,7 @@ def simplifyFaces(a): # IN: angular_threshold : should be as small as possible to avoid introducing degeneracies # OUT: returns a 3D NGON Mesh with less polygons (but same shape) #============================================================================== -def simplifySurf(a, angular_threshold = 1.e-12): +def simplifySurf(a, angular_threshold=1.e-12): """Simplifies over-defined surfaces (agglomerate some elligible polygons). Usage: simplifySurf(a, angular_threshold)""" return intersector.simplifySurf(a, angular_threshold) @@ -340,7 +340,7 @@ def simplifySurf(a, angular_threshold = 1.e-12): # IN: method = 0 (XXX) # OUT: returns a 3D NGON Mesh with less cells and with a smoother growth ratio #============================================================================== -def agglomerateSmallCells(a, vmin=0., vratio=0.01, angular_threshold = 1.e-12, method=0): +def agglomerateSmallCells(a, vmin=0., vratio=0.01, angular_threshold=1.e-12, method=0): """Agglomerates prescribed cells. Usage: agglomerateSmallCells(a, vmin, vratio)""" return intersector.agglomerateSmallCells(a, vmin, vratio,angular_threshold, method) @@ -375,7 +375,7 @@ def agglomerateCellsWithSpecifiedFaces(a, pgs): # IN: vratio : growth ratio threshold # OUT: returns a 3D NGON Mesh with less cells and with a smoother growth ratio #============================================================================== -def agglomerateNonStarCells(a, angular_threshold = 1.e-12): +def agglomerateNonStarCells(a, angular_threshold=1.e-12): """Agglomerates non-centroid-star-shaped cells. Usage: agglomerateNonStarCells(a)""" return intersector.agglomerateNonStarCells(a, angular_threshold) @@ -432,7 +432,7 @@ def closeCells(a): # IN: sensor : sensor hook # OUT: returns a 3D NGON conformal polyhedral mesh with adapted cells #============================================================================== -def adaptCells(a, sensdata=None, sensor_type = 0, smoothing_type = 0, itermax=-1, subdiv_type=0, hmesh=None, sensor=None): +def adaptCells(a, sensdata=None, sensor_type=0, smoothing_type=0, itermax=-1, subdiv_type=0, hmesh=None, sensor=None): """Adapts an unstructured mesh a with repsect to a sensor. Usage: adaptCells(a1, [sensdata, sensor_type, smoothing_type, itermax, subdiv_type, hmesh, sensor])""" owesHMesh=0 @@ -460,21 +460,21 @@ def adaptBox(a, box_ratio=10., smoothing_type=0, itermax=-1): return intersector.adaptBox(a, box_ratio, smoothing_type, itermax) #============================================================================== -# createHMesh : Returns a hierarchical zone hook +# createHMesh : Returns a hierarchical zone hook # IN: a : 3D NGON array # IN: subdiv_type : isotropic currently -# OUT: Returns a hierarchical zone hook +# OUT: Returns a hierarchical zone hook #============================================================================== -def createHMesh(a, subdiv_type = 0): # 0 : ISO, 1: ISO_HEX +def createHMesh(a, subdiv_type=0): # 0 : ISO, 1: ISO_HEX """Returns a hierarchical zone hook. Usage: createHMesh(a, subdiv_type= 0)""" a = intersector.initForAdaptCells(a, {}) return intersector.createHMesh(a, subdiv_type, 0) #============================================================================== -# deleteHMesh : Releases a hierachical zone hook +# deleteHMesh : Releases a hierachical zone hook # IN: hmesh : hierarchcial mesh hook -# OUT: Nothing +# OUT: Nothing #============================================================================== def deleteHMesh(hmesh): """Releases a hierachical zone hook. @@ -483,9 +483,9 @@ def deleteHMesh(hmesh): #============================================================================== # conformizeHMesh : Converts the basic element leaves of a hierarchical mesh to a conformal polyhedral mesh. -# +# # IN: hmesh : hierarchcial mesh hook -# OUT: Nothing +# OUT: Nothing #============================================================================== def conformizeHMesh(hmesh): """Converts the basic element leaves of a hierarchical mesh to a conformal polyhedral mesh. @@ -495,7 +495,7 @@ def conformizeHMesh(hmesh): def interpolateHMeshNodalField(hooks, fieldN): return intersector.interpolateHMeshNodalField(hooks, fieldN) -def createSensor(hmesh, sensor_type = 0, smoothing_type=0 , itermax = -1, sensor_metric_policy=0): +def createSensor(hmesh, sensor_type=0, smoothing_type=0 , itermax=-1, sensor_metric_policy=0): return intersector.createSensor(hmesh, sensor_type, smoothing_type, itermax, sensor_metric_policy) def assignData2Sensor(hmesh, sensdata): @@ -641,12 +641,12 @@ def collapseSmallEdges(a, eratio, lmax=-1): # IN : a1: : NGON mesh (surface or volume). # IN : a2: : NGON mesh (surface or volume). # IN : RTOL: : Relative tolerance (in ]0., 1.[). -# IN: amax : maximal angular value (in rad) between the normals of each pair of colliding polygons. +# IN: amax : maximal angular value (in rad) between the normals of each pair of colliding polygons. # In ragnge [0,PI]. A value of 0. means pure parallelism. A value of PI means any collision. # IN: dir2 : if specified, direction vector used for all a2's polygons instead of their own normals. # OUT: 2 lists of overlapping polygons, the first one for a1, the seoncd one for a2. #============================================================================== -def getOverlappingFaces(a1, a2, RTOL = 0.1, amax = 0.1, dir2=(0.,0.,0.)): +def getOverlappingFaces(a1, a2, RTOL=0.1, amax=0.1, dir2=(0.,0.,0.)): """ Returns the list of polygons in a1 and a2 that are overlapping. Usage: getOverlappingFaces(a1, a2, RTOL, amax, dir2)""" return intersector.getOverlappingFaces(a1,a2, RTOL, amax, dir2) @@ -659,7 +659,7 @@ def getOverlappingFaces(a1, a2, RTOL = 0.1, amax = 0.1, dir2=(0.,0.,0.)): # IN : RTOL: : Relative tolerance (in ]0., 1.[). # OUT: list of t1 involved faces #============================================================================== -def getCollidingTopFaces(a1, a2, RTOL = 0.1): +def getCollidingTopFaces(a1, a2, RTOL=0.1): """ Returns the list of TRI/QUAD in a1 (HEXA and PRISM only) that collide a2. Usage: getCollidingTopFaces(a1, a2, RTOL)""" try : @@ -676,7 +676,7 @@ def getCollidingTopFaces(a1, a2, RTOL = 0.1): # IN : only_externals: : Boolean # OUT: 2 lists of colliding cells, the first one for a1, the seoncd one for a2. #============================================================================== -def getCollidingCells(a1, a2, RTOL = 1.e-12, only_externals = False): +def getCollidingCells(a1, a2, RTOL=1.e-12, only_externals=False): """ Returns the list of cells in a1 and a2 that are colliding. Usage: getCollidingCells(a1, a2, RTOL = 1.e-12, only_externals = False)""" return intersector.getCollidingCells(a1, a2, RTOL, only_externals) @@ -720,13 +720,13 @@ def getFaces(t1, pgids): # IN : ids: : polygon ids. # OUT: selected cells. #============================================================================== -def getCells(t1, ids, are_face_ids = True): +def getCells(t1, ids, are_face_ids=True): """ Returns the cells in t1 having specified faces or cell ids. Usage: getCells(t1, ids, are_face_ids)""" return intersector.getCells(t1, ids, are_face_ids) #============================================================================== -# getNthNeighborhood : returns the list of cells in the N-thneighborhood of t cells given in ids +# getNthNeighborhood : returns the list of cells in the N-thneighborhood of t cells given in ids # IN : a : : NGON mesh. # IN : N : : number of neighborhood required # IN : ids : : input cells ids @@ -738,7 +738,7 @@ def getNthNeighborhood(a, N, ids): return intersector.getNthNeighborhood(a, N, ids) #============================================================================== -# estimateAdapReq : estimates an cell-specified adaptation requirement from +# estimateAdapReq : estimates an cell-specified adaptation requirement from # on a istotropic metric field based on donnor connectivity # IN : t : : NGON mesh. # IN : donnor : : donnor mesh (Volume; Surface or BAR) @@ -749,7 +749,7 @@ def getNthNeighborhood(a, N, ids): # OUT: Returns a list of integers sized as the nb of cells in t giving the nb of subdivisions # per cell in the range [minv, maxv]. #============================================================================== -def estimateAdapReq(t, donnor, metric_policy=2, rtol= 1.e-12, minv=0, maxv=5): +def estimateAdapReq(t, donnor, metric_policy=2, rtol=1.e-12, minv=0, maxv=5): """ estimates an cell-specified adaptation requirement based on a istotropic metric field based on donnor connectivity. Usage : estimateAdapReq(t, donnor [, metric_policy, rtol, minv, maxv])""" return intersector.estimateAdapReq(t, donnor, metric_policy, rtol, minv, maxv) @@ -798,10 +798,10 @@ def checkCellsClosure(a): return intersector.checkCellsClosure(a) #============================================================================== -# checkCellsFlux : Computes the Gauss fluxes using the input orientation (ParentElement). +# checkCellsFlux : Computes the Gauss fluxes using the input orientation (ParentElement). # Should be clsoe to zero machine for a closed and well oriented mesh. # IN: a: : 3D NGON mesh -# OUT: A message telling the cell id for which the Gauss flux is the greatest. +# OUT: A message telling the cell id for which the Gauss flux is the greatest. #============================================================================== def checkCellsFlux(a, PE): """ Returns the cell id for which the Gauss flux is the greatest. @@ -809,19 +809,19 @@ def checkCellsFlux(a, PE): return intersector.checkCellsFlux(a, PE) #============================================================================== -# checkAngularExtrema : Returns the min/max dihedral angles vals and associted cell ids.. +# checkAngularExtrema : Returns the min/max dihedral angles vals and associted cell ids.. # IN: a: : 3D NGON mesh -# OUT: A message telling the cell id for which the Gauss flux is the greatest. +# OUT: A message telling the cell id for which the Gauss flux is the greatest. #============================================================================== def checkAngularExtrema(a, PE): """ Returns the min/max dihedral angles vals and associted cell ids. Usage: checkAngularExtrema(a, PE)""" return intersector.checkAngularExtrema(a, PE) #============================================================================== -# checkCellsVolume : Computes the minimum volume using the input orientation (ParentElement). -# +# checkCellsVolume : Computes the minimum volume using the input orientation (ParentElement). +# # IN: a: : 3D NGON mesh -# OUT: A message telling the cell id for which the volume is the smallest. +# OUT: A message telling the cell id for which the volume is the smallest. #============================================================================== def checkCellsVolume(a, PE): """ Computes the minimum volume using the input orientation (ParentElement). @@ -829,10 +829,10 @@ def checkCellsVolume(a, PE): return intersector.checkCellsVolume(a, PE) #============================================================================== -# checkCellsVolumeAndGrowthRatio : Computes the minimum volume and growth ratio using the input orientation (ParentElement). -# +# checkCellsVolumeAndGrowthRatio : Computes the minimum volume and growth ratio using the input orientation (ParentElement). +# # IN: a: : 3D NGON mesh -# OUT: A message telling the cell id for which the volume is the smallest. +# OUT: A message telling the cell id for which the volume is the smallest. #============================================================================== def checkCellsVolumeAndGrowthRatio(a, PE): """ Computes the minimum volume and growth ratio using the input orientation (ParentElement). @@ -883,19 +883,19 @@ def computeGrowthRatio(a, vmin=0.): #============================================================================== # extrudeBC : XXX #============================================================================== -def extrudeBC(a, extrude_pgs=[], height = 0.25, mean_or_min = 1, create_ghost=1): +def extrudeBC(a, extrude_pgs=[], height=0.25, mean_or_min=1, create_ghost=1): return intersector.extrudeBC(a, extrude_pgs, height, mean_or_min, create_ghost) #============================================================================== # extrudeSurf : XXX #============================================================================== -def extrudeSurf(a, layer_height, nlayers = 1, strategy = 1): +def extrudeSurf(a, layer_height, nlayers=1, strategy=1): return intersector.extrudeSurf(a, layer_height, nlayers, strategy) #============================================================================== # extrudeRevolSurf : XXX #============================================================================== -def extrudeRevolSurf(a, ax_pt, ax_dir, nlayers = 1): +def extrudeRevolSurf(a, ax_pt, ax_dir, nlayers=1): return intersector.extrudeRevolSurf(a, ax_pt, ax_dir, nlayers) #============================================================================== @@ -907,7 +907,7 @@ def statsUncomputableFaces(a): #============================================================================== # statsSize : XXX #============================================================================== -def statsSize(a, compute_metrics = 1): +def statsSize(a, compute_metrics=1): return intersector.statsSize(a, compute_metrics) #============================================================================== @@ -974,10 +974,10 @@ def volumes(a, algo=1, all_pgs_convex=False): Usage: volumes(a, algo=1, all_pgs_convex=False)""" return intersector.volumes(a, algo, all_pgs_convex) -def merge(a, s, tol = 1.e-15): #target arr, source arr +def merge(a, s, tol=1.e-15): #target arr, source arr return intersector.merge(a, s, tol) -def concatenate(la, tol = 1.e-15): +def concatenate(la, tol=1.e-15): return intersector.concatenate(la, tol) #============================================================================== @@ -986,7 +986,7 @@ def concatenate(la, tol = 1.e-15): # IN: xcelln : name of the weighting field (at centers)/ # OUT: volume computed #============================================================================== -def volume(a, xcelln = None): +def volume(a, xcelln=None): """ Computes the volume of a with an optional weighting. Usage: volume(a, xcelln)""" return intersector.volume(a, xcelln) @@ -1009,17 +1009,17 @@ def drawOrientation(a): # OUT: returns a 3D NGON Mesh with synchronised faces #============================================================================== def syncMacthPeriodicFaces(a, rotationCenter=[0.,0.,0.], - rotationAngle=[0.,0.,0.], - translation=[0.,0.,0.], tol=-0.01): + rotationAngle=[0.,0.,0.], + translation=[0.,0.,0.], tol=-0.01): """ Force periodicity for faces that are supposed to be periodic. Usage: syncMacthPeriodicFaces(a, rotationCenter, rotationAngle, translation, TOL)""" return intersector.syncMacthPeriodicFaces(a, rotationCenter, rotationAngle, - translation, tol) + translation, tol) #~ def conservativeTransfer(a1, flowsol, a2, tol=0., reconstruction_type=0): #~ c = intersector.conservative_transfer(a1, flowsol, a2, tol, reconstruction_type) #~ return c - #~ + #~ #~ def totalMass(a1, flowsol): #~ intersector.total_mass(a1, flowsol) #~ return a1 diff --git a/Cassiopee/Intersector/Intersector/Mpi.py b/Cassiopee/Intersector/Intersector/Mpi.py index ae8dd422e..fb6eed38b 100644 --- a/Cassiopee/Intersector/Intersector/Mpi.py +++ b/Cassiopee/Intersector/Intersector/Mpi.py @@ -42,7 +42,7 @@ def getZonesRanks(zidDict, procDict): # IN: sensor : sensor hook # OUT: returns a 3D NGON Mesh with adapted cells #============================================================================== -def adaptCells(t, sensdata=None, sensor_type = 0, smoothing_type = 0, itermax=-1, sensor_metric_policy = 0, subdiv_type=0, hmesh=None, sensor=None, com = MPI.COMM_WORLD, procDict=None, zidDict=None): +def adaptCells(t, sensdata=None, sensor_type=0, smoothing_type=0, itermax=-1, sensor_metric_policy=0, subdiv_type=0, hmesh=None, sensor=None, com=MPI.COMM_WORLD, procDict=None, zidDict=None): """Adapts an unstructured mesh a with respect to a sensor. Usage: adaptCells(t, sensdata=None, sensor_type = 0, smoothing_type = 0, itermax=-1, subdiv_type=0, hmesh=None, sensor=None)""" tp = Internal.copyRef(t) @@ -90,7 +90,7 @@ def _adaptCells(t, sensdata=None, sensor_type=0, smoothing_type=0, itermax=-1, s owesHmesh=1 owesSensor=0 - if sensor is None: + if sensor is None: #print("create sensor") sensor = XOR.createSensor(hmesh, sensor_type, smoothing_type, itermax, sensor_metric_policy) owesSensor=1 @@ -124,9 +124,9 @@ def _adaptCells(t, sensdata=None, sensor_type=0, smoothing_type=0, itermax=-1, s _conformizeHMesh(t, hmesh, zidDict, procDict, rid_to_zones, zonerank, zone_to_rid_to_list_owned, com) if owesHmesh == 1: - # #print('delete owned hmesh') + # #print('delete owned hmesh') XOR.deleteHMesh(hmesh) - if owesSensor == 1: + if owesSensor == 1: #print('delete owned sensor') XOR.deleteSensor(sensor) @@ -135,7 +135,7 @@ def _adaptCells(t, sensdata=None, sensor_type=0, smoothing_type=0, itermax=-1, s # Each hiearchcial zone is referring to a zone in the original mesh t. So the mesh is replaced in the tree and the BCs/Joins/Fields are transferred. # IN: t : PyTree before adaptation # IN: hook : list of hooks to hiearchical zones (same size as nb of zones in t). -# OUT: Nothing +# OUT: Nothing #============================================================================== def _conformizeHMesh(t, hooks, zidDict, procDict, rid_to_zones=None, zonerank=None, zone_to_rid_to_list_owned=None, com=MPI.COMM_WORLD): """Converts the basic element leaves of a hierarchical mesh to a conformal polyhedral mesh. @@ -246,7 +246,7 @@ def _conformizeHMesh(t, hooks, zidDict, procDict, rid_to_zones=None, zonerank=No for f in fieldz: C.setFields([f], z, 'nodes', False) - ## face fields + ## face fields fieldz = [res[5]] #print(fieldz) if fieldz != [None]: @@ -257,9 +257,9 @@ def _conformizeHMesh(t, hooks, zidDict, procDict, rid_to_zones=None, zonerank=No #------------------------------------------------------------------------------ -# +# #------------------------------------------------------------------------------ -def _exchangePointLists(t, hooks, zidDict, procDict, rid_to_zones = None, zonerank=None, zone_to_bcptlists=None, zone_to_rid_to_list_owned=None, com = MPI.COMM_WORLD): +def _exchangePointLists(t, hooks, zidDict, procDict, rid_to_zones=None, zonerank=None, zone_to_bcptlists=None, zone_to_rid_to_list_owned=None, com=MPI.COMM_WORLD): nb_hooks = len(hooks) zones = Internal.getZones(t) @@ -298,14 +298,14 @@ def _exchangePointLists(t, hooks, zidDict, procDict, rid_to_zones = None, zonera #------------------------------------------------------------------------------ # closeCells MPI #------------------------------------------------------------------------------ -def closeCells(t, procDict, zidDict, com = MPI.COMM_WORLD): +def closeCells(t, procDict, zidDict, com=MPI.COMM_WORLD): """Closes any polyhedral cell in a mesh (processes hanging nodes on edges). Usage: closeCells(t, com, procDict, zidDict)""" tp = Internal.copyRef(t) _closeCells(tp, procDict, zidDict, com) return tp -def _closeCells(t, procDict, zidDict, com = MPI.COMM_WORLD): +def _closeCells(t, procDict, zidDict, com=MPI.COMM_WORLD): """Closes any polyhedral cell in a mesh (processes hanging nodes on edges). Usage: closeCells(t, com, procDict, zidDict)""" if procDict is {}: @@ -342,7 +342,7 @@ def _closeCells(t, procDict, zidDict, com = MPI.COMM_WORLD): m = meshes[i] zid_to_m[zid] = m - for z in zs : + for z in zs : zid = CD.getProperty(z, 'zid') m = zid_to_m[zid] # MAJ du maillage de la zone diff --git a/Cassiopee/Intersector/Intersector/PyTree.py b/Cassiopee/Intersector/Intersector/PyTree.py index e3327f433..64f252c52 100644 --- a/Cassiopee/Intersector/Intersector/PyTree.py +++ b/Cassiopee/Intersector/Intersector/PyTree.py @@ -1,6 +1,6 @@ """Grid generation module. """ -# +# # Python Interface to create PyTrees defining meshes # from . import Intersector as XOR @@ -140,7 +140,7 @@ def InputType(t): # fixme : based on first block only if isnod == -1 or isnod == 0: #print('is std node') if XOR.isSingleZone(t): - #print('is isSingleZone node') + #print('is isSingleZone node') return 2 if Internal.isTopTree(t): #print('is isSingleZone node') @@ -162,7 +162,7 @@ def InputType(t): # fixme : based on first block only # IN: nb_comps : nb of connex parts # OUT: returns the adapted feature #============================================================================== -def NGONBlock(t, nb_comps, mixed_type=False, keep_BC=False, tol = 0.): +def NGONBlock(t, nb_comps, mixed_type=False, keep_BC=False, tol=0.): if keep_BC == False: C._deleteGridConnectivity__(t) @@ -190,7 +190,7 @@ def NGONBlock(t, nb_comps, mixed_type=False, keep_BC=False, tol = 0.): #C.convertPyTree2File(t, 'bad_oper.cgns') raise ValueError('NGONBlock: concatenation failed to produce a single connex and conformal block.') - #Internal._correctPyTree(t) # to add families if required and missing + #Internal._correctPyTree(t) # to add families if required and missing zs = Internal.getZones(t) z = zs[0] return z @@ -222,7 +222,7 @@ def isConformalNConnex(t, nb_comps): #============================================================================== # computeMeshAssemblyParameters -# GOAL: Computes the tolerance (based on min edge length) and thr configuration span to nomalize it +# GOAL: Computes the tolerance (based on min edge length) and thr configuration span to nomalize it # IN: t: 3D NGON mesh # OUT: returns the tolerance and the max bounding box size #============================================================================== @@ -303,7 +303,7 @@ def checkAssemblyForlSolver(t, fullcheck=False, nb_comps=1): if err == 1: print('Boolean ERROR : open cells') import sys; sys.exit() - # else : + # else : # print ('OK : all cells are closed') # VERIFICATION 3 : ORIENTATION/QUALITE @@ -333,7 +333,7 @@ def checkAssemblyForlSolver(t, fullcheck=False, nb_comps=1): # print ('vmin') # print (vmin) # print ('vmax') - # print (vmax) + # print (vmax) #VERIFICATION 5 : BIG CELLS print("Check big cells (over 40) ...") @@ -349,7 +349,7 @@ def checkAssemblyForlSolver(t, fullcheck=False, nb_comps=1): print("Check for degen cells...") checkForDegenCells(t) - #VERIF 7 + #VERIF 7 print("Check for over connected cells..") detectOverConnectedFaces(t) @@ -423,7 +423,7 @@ def updateBCPointLists1(z, oids): i=0 bc_to_remove=[] - #print('update the BC pointlists') + #print('update the BC pointlists') for bb in bnds: torem = False if isinstance(ptLists[i], numpy.ndarray): @@ -466,7 +466,7 @@ def updateJoinsPointLists1(z, zones, oids): # Match has disappeared > remove from tree if not isinstance(ptLists[i], numpy.ndarray): Internal._rmNode(z, j) - i=i+1 + i=i+1 continue ptl = Internal.getNodeFromName1(j, 'PointList') @@ -482,7 +482,7 @@ def updateJoinsPointLists1(z, zones, oids): if (dname != zname) : continue ptlD = Internal.getNodeFromName1(jd, 'PointListDonor') - PG0 = ptl[1][0][0] # first polygon in the point list + PG0 = ptl[1][0][0] # first polygon in the point list PG0D = ptlD[1][0][0] # first polygon in the point list if (PG0 != PG0D) : continue # not the right join (in case of multiple joins for 2 zones) : the first PG must be the same (assume one PG only in one join) @@ -533,7 +533,7 @@ def getProperty(z, pname): # getBCsPtLists : XXX # IN: t : 3D NGON PyTree # IN: subdiv_type : isotropic currently -# OUT: Returns a hierarchical zone hook +# OUT: Returns a hierarchical zone hook #============================================================================== def getBCsPtLists(t): @@ -566,8 +566,8 @@ def getBCPtList(z): return ptList -def getBCPtListOfType(z, typesList, families = []): - # +def getBCPtListOfType(z, typesList, families=[]): + # nodes = [] for btyp in typesList: nodes += Internal.getNodesFromValue(z, btyp) @@ -590,7 +590,7 @@ def getBCPtListOfType(z, typesList, families = []): return ptList #------------------------------------------------------------------------------ -# +# #------------------------------------------------------------------------------ def updateJoinsPointLists2(z, zones, jzids, ptLists): # zone name to id @@ -619,7 +619,7 @@ def updateJoinsPointLists2(z, zones, jzids, ptLists): if (dname != zname) : continue ptlD = Internal.getNodeFromName1(jd, 'PointListDonor') - PG0 = ptl[1][0][0] # first polygon in the poitn list + PG0 = ptl[1][0][0] # first polygon in the poitn list PG0D = ptlD[1][0][0] # first polygon in the poitn list if (PG0 != PG0D) : continue # not the right join (in case of multiple joins for 2 zones) : the first PG must be the same (assume one PG only in one join) @@ -650,7 +650,7 @@ def updateBCPointLists2(z, ptLists): bnds = Internal.getNodesFromType(z, 'BC_t') i=0 - # update the BC pointlists + # update the BC pointlists for bb in bnds : ptl = Internal.getNodesFromType(bb, 'IndexArray_t') ptl[0][1] = ptLists[i] @@ -658,7 +658,7 @@ def updateBCPointLists2(z, ptLists): i=i+1 #------------------------------------------------------------------------------ -# +# #------------------------------------------------------------------------------ def updateJoinsPointLists3(z, zidDict, rid_to_ptlist, ptlname): # 'PointList', 'PointListDonor' @@ -701,11 +701,11 @@ def updateJoinsPointLists3(z, zidDict, rid_to_ptlist, ptlname): # 'PointList', ' ptl[1] = L1 #------------------------------------------------------------------------------ -# +# #------------------------------------------------------------------------------ def get_transfo_to_ptlist_dico(z): - # ----- + # ----- dico_rotation_to_ptList = {} @@ -791,7 +791,7 @@ def booleanUnion(a1, a2, tol=0., jtol=0., preserve_right=1, solid_right=1, agg_m typzone1 = s1[3] typzone2 = s2[3] if typzone1 == 'NGON' and typzone2 == 'NGON': # only for Volume/Volume - # compute the join tolerance + # compute the join tolerance if jtol == 0.: L1 = edgeLengthExtrema(a1) L2 = edgeLengthExtrema(a2) @@ -813,9 +813,9 @@ def booleanUnion(a1, a2, tol=0., jtol=0., preserve_right=1, solid_right=1, agg_m res = XOR.booleanUnionWithHisto(s1, s2, tol, preserve_right, solid_right, agg_mode, improve_qual, extrudepgs, simplify_pgs, hard_mode, itermax) is_zone_list = 0 - if (len(res) != 5) : is_zone_list = 1 + if (len(res) != 5) : is_zone_list = 1 elif (res[0][3] != 'NGON' and res[0][3] != 'TRI' and res[0][3] != 'BAR') : is_zone_list = 1 - if (len(res) == 1) : is_zone_list = 2 # Not NGON and not DEBUG + if (len(res) == 1) : is_zone_list = 2 # Not NGON and not DEBUG if is_zone_list == 0: @@ -836,7 +836,7 @@ def booleanUnion(a1, a2, tol=0., jtol=0., preserve_right=1, solid_right=1, agg_m zs = Internal.getZones(newz) zs = zs[0] - # Check name to prevent collision + # Check name to prevent collision name1s = [] for bc1 in BC1s: name1s.append(bc1[0]) @@ -852,10 +852,10 @@ def booleanUnion(a1, a2, tol=0., jtol=0., preserve_right=1, solid_right=1, agg_m # Update pointList for bc1 in BC1s: # copy to avoid modif input tree - bc = Internal.copyTree(bc1) + bc = Internal.copyTree(bc1) Internal._addChild(zoneBC, bc) - updatePointLists(zs, newz, pgoids1) + updatePointLists(zs, newz, pgoids1) newBC1s = Internal.getNodesFromType(newz, "BC_t") @@ -884,7 +884,7 @@ def booleanUnion(a1, a2, tol=0., jtol=0., preserve_right=1, solid_right=1, agg_m # Restore fields # ============== - # a. Build varnames list + # a. Build varnames list varnames = [] cont1 = Internal.getNodeFromName(a1, Internal.__FlowSolutionCenters__) @@ -905,10 +905,10 @@ def booleanUnion(a1, a2, tol=0., jtol=0., preserve_right=1, solid_right=1, agg_m if fld[0] not in varnames: varnames.append(fld[0]) - # b. Build new var arrays + # b. Build new var arrays ncells = C.getNCells(newz) - nsize1 = len(phnids1) - nsize2 = len(phnids2) + nsize1 = len(phnids1) + nsize2 = len(phnids2) for varname in varnames: varnew = numpy.zeros(ncells, numpy.float64) @@ -951,13 +951,13 @@ def booleanUnion(a1, a2, tol=0., jtol=0., preserve_right=1, solid_right=1, agg_m return ozones -def booleanUnionMZ(t1, t2, xtol=0., jtol=0., agg_mode=1, improve_qual = False, simplify_pgs = True, hard_mode = 0): #agg_mode : 0(NONE), 1(CONVEX), 2(FULL) +def booleanUnionMZ(t1, t2, xtol=0., jtol=0., agg_mode=1, improve_qual=False, simplify_pgs=True, hard_mode=0): #agg_mode : 0(NONE), 1(CONVEX), 2(FULL) tp1 = Internal.copyRef(t1) tp2 = Internal.copyRef(t2) return _booleanUnionMZ(tp1, tp2, xtol, jtol, agg_mode, improve_qual, simplify_pgs, hard_mode) -def _booleanUnionMZ(t1, t2, xtol=0., jtol=0., agg_mode=1, improve_qual = False, simplify_pgs = True, hard_mode = 0): #agg_mode : 0(NONE), 1(CONVEX), 2(FULL) +def _booleanUnionMZ(t1, t2, xtol=0., jtol=0., agg_mode=1, improve_qual=False, simplify_pgs=True, hard_mode=0): #agg_mode : 0(NONE), 1(CONVEX), 2(FULL) """Computes the union between two closed volume meshes. Usage for volumes: booleanUnion2(a1, a2, tol, agg_mode)""" t1_is_tree = Internal.isTopTree(t1) @@ -1014,9 +1014,9 @@ def _booleanUnionMZ(t1, t2, xtol=0., jtol=0., agg_mode=1, improve_qual = False, # print(" ") # print("OP1 - pgoids: ", pg_oids) - if mesh != []: + if mesh != []: - # MAJ du maillage de la zone + # MAJ du maillage de la zone C.setFields([mesh], z, 'nodes') # MAJ BCs @@ -1074,9 +1074,9 @@ def _booleanUnionMZ(t1, t2, xtol=0., jtol=0., agg_mode=1, improve_qual = False, # print(" ") # print("OP2 - pgoids: ", pg_oids) - if mesh != []: + if mesh != []: - # MAJ du maillage de la zone + # MAJ du maillage de la zone C.setFields([mesh], z, 'nodes') # MAJ BCs @@ -1131,10 +1131,10 @@ def _booleanUnionMZ(t1, t2, xtol=0., jtol=0., agg_mode=1, improve_qual = False, name2 = 'match%d_%d'%(zoneD+1,glob); glob += 1 C._addBC2Zone(zones[zoneR],name1,'BCMatch',faceList=faceListR+1,\ - zoneDonor=z1OppName, faceListDonor=faceListD+1) + zoneDonor=z1OppName, faceListDonor=faceListD+1) C._addBC2Zone(zones[zoneD],name2,'BCMatch',faceList=faceListD+1,\ - zoneDonor=z2OppName, faceListDonor=faceListR+1) + zoneDonor=z2OppName, faceListDonor=faceListR+1) else: matchName = [] for j in joins: @@ -1155,7 +1155,7 @@ def _booleanUnionMZ(t1, t2, xtol=0., jtol=0., agg_mode=1, improve_qual = False, name1 = 'match%d_%d'%(zoneR+1,glob); glob += 1 name2 = 'match%d_%d'%(zoneD+1,glob); glob += 1 - # Assure unique match name + # Assure unique match name while (name1 in matchName): name1 = 'match%d_%d'%(zoneR+1,glob); glob += 1 @@ -1163,10 +1163,10 @@ def _booleanUnionMZ(t1, t2, xtol=0., jtol=0., agg_mode=1, improve_qual = False, name2 = 'match%d_%d'%(zoneD+1,glob); glob += 1 C._addBC2Zone(zones[zoneR],name1,'BCMatch',faceList=faceListR+1,\ - zoneDonor=z1OppName, faceListDonor=faceListD+1) + zoneDonor=z1OppName, faceListDonor=faceListD+1) C._addBC2Zone(zones[zoneD],name2,'BCMatch',faceList=faceListD+1,\ - zoneDonor=z2OppName, faceListDonor=faceListR+1) + zoneDonor=z2OppName, faceListDonor=faceListR+1) if t1_is_tree == True and t2_is_tree == True: @@ -1205,7 +1205,7 @@ def booleanModifiedSolid(solid, a2, tol=0., preserve_solid=1, agg_mode=1, improv # IN: priorities: one-to-one priorities between components # IN: output_type: 0: binary mask; 1: continuous mask (xcelln); 2: clipped surface. # IN: rtol: relative tolerance -# OUT: returns a 3D NGON surface mesh with the xcelln field (if output_type=0/1, the clipped surface with solution if output_type=2) +# OUT: returns a 3D NGON surface mesh with the xcelln field (if output_type=0/1, the clipped surface with solution if output_type=2) #============================================================================== def XcellN(t, priorities, output_type=0, rtol=0.05): """Computes the weight coefficients of visibility for overset grid configurations as a field called xcelln, for both surface and volume mesh of any kind. @@ -1218,7 +1218,7 @@ def XcellN(t, priorities, output_type=0, rtol=0.05): # _XcellN (in-place version) # IN: t: 3D NGON SURFACE mesh # IN: priorities: one-to-one priorities between components -# IN: output_type: 0: binary mask; 1: continuous mask (xcelln); 2: clipped surface. +# IN: output_type: 0: binary mask; 1: continuous mask (xcelln); 2: clipped surface. # OUT: returns a 3D NGON surface mesh with the xcelln field (if output_type=0/1, the clipped surface with solution if output_type=2) #============================================================================== def _XcellN(t, priorities, output_type=0, rtol=0.05): @@ -1236,7 +1236,7 @@ def _XcellN(t, priorities, output_type=0, rtol=0.05): # _XcellN_ (in-place version) # IN: t: 3D NGON SURFACE mesh # IN: priorities: one-to-one priorities between components -# IN: output_type: 0 : binary mask; 1 : continuous mask (xcelln) ; 2 : clipped surface. +# IN: output_type: 0 : binary mask; 1 : continuous mask (xcelln) ; 2 : clipped surface. # OUT: returns a 3D NGON surface mesh with the xcelln field (if output_type=0/1, the clipped surface with solution if output_type=2) #============================================================================== def _XcellN_(t, priorities, output_type=0, rtol=0.05): @@ -1258,7 +1258,7 @@ def _XcellN_(t, priorities, output_type=0, rtol=0.05): DIM = getTreeDim(t) bases = Internal.getBases(t) - #(BCs,BCNames,BCTypes) = C.getBCs(t) + #(BCs,BCNames,BCTypes) = C.getBCs(t) if len(bases) == 1: raise ValueError('XcellN: Only one base in the file. Each component must be separated in a given Base. No check between zones of the same component.') @@ -1303,7 +1303,7 @@ def _XcellN_(t, priorities, output_type=0, rtol=0.05): bid=-1 for bNG in basesNG: bid += 1 - zj = concatenate(bNG, tol = 1.e-10) # discard inner joins + zj = concatenate(bNG, tol=1.e-10) # discard inner joins #if DBG: C.convertPyTree2File(zj, 'zj_'+str(bid)+'.cgns') b_bounds = externalFaces(zj) # keeping orientation if DBG: C.convertPyTree2File(b_bounds, 'bound_b_'+str(bid)+'.cgns') @@ -1385,7 +1385,7 @@ def _XcellN_(t, priorities, output_type=0, rtol=0.05): for b in bases: zones = Internal.getZones(b) for z in zones: - # grab solution ptrs + # grab solution ptrs cont = Internal.getNodesFromName2(z, Internal.__FlowSolutionCenters__) fields = Internal.getNodesFromType1(cont, 'DataArray_t') @@ -1517,12 +1517,12 @@ def superMesh(surfz, sclip, tol=-1.e-4, proj_on_first=True): #============================================================================== -# superMesh2: +# superMesh2: # IN: surfz: 3D NGON surface mesh to clip # IN: sclip: 3D NGON surface mesh (clipper) # IN: tol: tolerance (abolute if positive, relative otherwise) # IN: proj_on_first: if True(False), each sclip(surfz) face is projected on surfz(sclip). -# OUT: returns face indices and face surface values +# OUT: returns face indices and face surface values #============================================================================== def superMesh2(surfz, sclip, tol=-1.e-4, proj_on_first=True): """Polyclips surfz surface with sclip surface. @@ -1553,13 +1553,13 @@ def superMesh2(surfz, sclip, tol=-1.e-4, proj_on_first=True): # C.convertPyTree2File(xmatch,'xmatch.cgns') - return (anc, anc2, surf, isMatch) + return (anc, anc2, surf, isMatch) #============================================================================== def extractBCMatchTNC(ancA,ancB,weight,fields, iminA, jminA, kminA, imaxA, jmaxA, kmaxA): fld = intersector.computeTNCFields(ancA,ancB,weight,fields, - (iminA, jminA, kminA, imaxA, jmaxA, kmaxA)) + (iminA, jminA, kminA, imaxA, jmaxA, kmaxA)) return fld @@ -1639,7 +1639,7 @@ def _triangulateExteriorFaces(t, in_or_out=2, improve_qual=0): #============================================================================== -# triangulateSpecifiedFaces +# triangulateSpecifiedFaces # IN : t : 3D NGON mesh # IN : pgs : list of polygons # IN : improve_qual : to improve mesh quality @@ -1653,7 +1653,7 @@ def triangulateSpecifiedFaces(t, pgs, improve_qual=1): return tp #============================================================================== -# _triangulateSpecifiedFaces +# _triangulateSpecifiedFaces # IN: a: 3D NGON mesh # IN: pgs : list of polygons # OUT: returns a 3D NGON Mesh @@ -1676,7 +1676,7 @@ def _triangulateSpecifiedFaces(t, pgs, improve_qual=1): pg_oids= m[1] # MAJ du maillage de la zone - C.setFields([mesh], z, 'nodes') + C.setFields([mesh], z, 'nodes') # MAJ POINT LISTS # updatePointLists(z, zones, pg_oids) @@ -1688,7 +1688,7 @@ def _triangulateSpecifiedFaces(t, pgs, improve_qual=1): # IN : quality improvement flag # OUT: returns a 3D NGON mesh with all the external faces triangulated #============================================================================== -def triangulateNFaces(t, improve_qual=1, min_nvertices=5, discard_joins= True): +def triangulateNFaces(t, improve_qual=1, min_nvertices=5, discard_joins=True): """Triangulates nob basic polygons of a volume mesh. Usage: triangulateNonBasicFaces(t)""" tp = Internal.copyRef(t) @@ -1727,7 +1727,7 @@ def _triangulateNFaces(t, improve_qual=1, min_nvertices=5, discard_joins=True): pg_oids=res[1] # MAJ du maillage de la zone - C.setFields([mesh], z, 'nodes') + C.setFields([mesh], z, 'nodes') # MAJ POINT LISTS # updatePointLists(z, zones, pg_oids) @@ -1768,7 +1768,7 @@ def _triangulateBC(t, bctype): if (Internal.isValue(bb, bctype) == False) : continue bcpgs.append(bb[2][1][1][0]) # POINTLIST NUMPY - if bcpgs == []: continue + if bcpgs == []: continue bcpgs = numpy.concatenate(bcpgs) # create a single list bcpgs = bcpgs -1 @@ -1778,7 +1778,7 @@ def _triangulateBC(t, bctype): pg_oids=res[1] # MAJ du maillage de la zone - C.setFields([mesh], z, 'nodes') + C.setFields([mesh], z, 'nodes') # MAJ POINT LISTS # updatePointLists(z, zones, pg_oids) @@ -1844,7 +1844,7 @@ def externalFaces(t, discard_joins=False, geo_dim=-1): zonnod = C.convertArrays2ZoneNode('ef_z'+str(zid), [ef]) if zid_defined == True : # add it to the zone - l = Internal.newIntegralData(name='zid', parent=zonnod) #ceate a zid for each block + l = Internal.newIntegralData(name='zid', parent=zonnod) #ceate a zid for each block l[1] = zid # node : NUGA -> vfoid @@ -1901,7 +1901,7 @@ def _reorientBC(t, bctype, dir): if (Internal.isValue(bb, bctype) == False) : continue bcpgs.append(bb[2][1][1][0]) # POINTLIST NUMPY - if bcpgs == []: continue + if bcpgs == []: continue bcpgs = numpy.concatenate(bcpgs) # create a single list bcpgs = bcpgs -1 @@ -1911,12 +1911,12 @@ def _reorientBC(t, bctype, dir): pg_oids=res[1] # MAJ du maillage de la zone - C.setFields([mesh], z, 'nodes') + C.setFields([mesh], z, 'nodes') return t #============================================================================== -# reorientSpecifiedFaces +# reorientSpecifiedFaces # IN: a: 3D NGON mesh # IN: pgs : list of polygons # OUT: returns a 3D NGON Mesh with consistent orientation for specified polygons @@ -1967,12 +1967,12 @@ def _reorientSurf(t, dir): # IN : t : 3D NGON mesh # IN : PH_set : PH to process. 0 for concave cells or 1 for non-centroid-star_shaped cells # IN : split_policy : 0 : convexify concave pgs. 1 : starify concave pgs. 2 : starify any pgs at concave-chains ends. -# OUT: returns a 3D NGON Mesh with some face polygon splits : -# split (convexify, starify) some targeted polygons on targeted cells +# OUT: returns a 3D NGON Mesh with some face polygon splits : +# split (convexify, starify) some targeted polygons on targeted cells # (typically bad polyhedra -concaves, non-centroid-star-shaped-) # to prepare the split of those bad cells. #============================================================================== -def prepareCellsSplit(t, PH_set=1, split_policy=0, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold = 1.e-8): +def prepareCellsSplit(t, PH_set=1, split_policy=0, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-8): """Splits some prescribed polygons following a prescribed splitting policy. Usage: prepareCellsSplit(t, PH_set, split_policy, PH_conc_threshold, PH_cvx_threshold, PG_cvx_threshold)""" m = C.getFields(Internal.__GridCoordinates__, t)[0] @@ -1987,7 +1987,7 @@ def prepareCellsSplit(t, PH_set=1, split_policy=0, PH_conc_threshold=1./3., PH_c # IN : PG_cvx_threshold : convexity angle threshold for polygons # OUT: returns a 3D NGON Mesh with none (or at least less) non-centroid-star_shaped cells. #============================================================================== -def splitNonStarCells(t, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = 1.e-8): +def splitNonStarCells(t, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-8): """Splits some non-centroid-star_shaped cells. Usage: splitNonStarCells(t, PH_conc_threshold, PH_cvx_threshold, PG_cvx_threshold)""" m = C.getFields(Internal.__GridCoordinates__, t)[0] @@ -2001,7 +2001,7 @@ def splitNonStarCells(t, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_ # IN: discard_joins : when set to True, faces at joins are not modified # OUT: returns a 3D NGON Mesh with less polygons (but same shape) #============================================================================== -def _simplifyCells(t, treat_externals, angular_threshold = 1.e-12, discard_joins=True): +def _simplifyCells(t, treat_externals, angular_threshold=1.e-12, discard_joins=True): """Simplifies over-defined polyhedral cells (agglomerate some elligible polygons). Usage: simplifyCells(t, treat_externals, angular_threshold, discard_joins)""" @@ -2034,7 +2034,7 @@ def _simplifyCells(t, treat_externals, angular_threshold = 1.e-12, discard_joins C.setFields([m], z, 'nodes') # replace the mesh in the zone -def simplifyCells(t, treat_externals, angular_threshold = 1.e-12, discard_joins=True): +def simplifyCells(t, treat_externals, angular_threshold=1.e-12, discard_joins=True): """Simplifies over-defined polyhedral cells (agglomerate some elligible polygons). Usage: simplifyCells(t, treat_externals, angular_threshold, discard_joins)""" tp = Internal.copyRef(t) @@ -2068,7 +2068,7 @@ def simplifyFaces(t): # IN: angular_threshold : should be as small as possible to avoid introducing degeneracies # OUT: returns a 3D NGON Mesh with less polygons (but same shape) #============================================================================== -def simplifySurf(t, angular_threshold = 1.e-12): +def simplifySurf(t, angular_threshold=1.e-12): """Simplifies over-defined surfaces (agglomerate some elligible polygons). Usage: simplifySurf(t, angular_threshold)""" m = C.getFields(Internal.__GridCoordinates__, t)[0] @@ -2189,13 +2189,13 @@ def agglomerateNonStarCells(t, angular_threshold=1.e-12): # IN: pgs : list of polygons # OUT: returns a 3D NGON Mesh #============================================================================== -def agglomerateCellsWithSpecifiedFaces(t, pgs, simplify=1, amax = 1.e-12, treat_externals=1): # 0 : dno not simplify, 1 : simplify only internals, 2 : simlplify evrywhere +def agglomerateCellsWithSpecifiedFaces(t, pgs, simplify=1, amax=1.e-12, treat_externals=1): # 0 : dno not simplify, 1 : simplify only internals, 2 : simlplify evrywhere tp = Internal.copyRef(t) _agglomerateCellsWithSpecifiedFaces(tp,pgs, simplify, amax, treat_externals) return tp -def _agglomerateCellsWithSpecifiedFaces(t, pgs, simplify=1, amax = 1.e-12, treat_externals=1): +def _agglomerateCellsWithSpecifiedFaces(t, pgs, simplify=1, amax=1.e-12, treat_externals=1): zones = Internal.getZones(t) if len(pgs) != len(zones): @@ -2245,7 +2245,7 @@ def _agglomerateCellsWithSpecifiedFaces(t, pgs, simplify=1, amax = 1.e-12, treat jids = None if simplify == 1: - m = XOR.simplifyCells(m, treat_externals, angular_threshold=amax, discarded_ids = jids) + m = XOR.simplifyCells(m, treat_externals, angular_threshold=amax, discarded_ids=jids) C.setFields([m], z, 'nodes') # replace the mesh in the zone @@ -2398,7 +2398,7 @@ def _closeCells(t): m = meshes[i] zid_to_m[zid]=m - for z in zs : + for z in zs : zid = getProperty(z, 'zid') m = zid_to_m[zid] # MAJ du maillage de la zone @@ -2484,20 +2484,20 @@ def getRidToZones(t, zidDict): # IN smoothing_type: First-neighborhood (0) Shell-neighborhood(1) # IN itermax: max number of level in the hierarchy # IN: subdiv_type: isotropic currently -# IN: sensor_metric_policy (specific for xsensor): which reference cell size (edge length) to use ? min (0), mean (1), max(2) or min_or_max(3) +# IN: sensor_metric_policy (specific for xsensor): which reference cell size (edge length) to use ? min (0), mean (1), max(2) or min_or_max(3) # IN: hmesh: hierarchical mesh hook # IN: sensor: sensor hook # IN: conformize: dump a conformal polyhedral mesh # OUT: returns a 3D NGON Mesh with adapted cells #============================================================================== -def adaptCells(t, sensdata=None, sensor_type = 0, smoothing_type = 0, itermax=-1, subdiv_type=0, sensor_metric_policy=0, hmesh=None, sensor=None, conformize=1): +def adaptCells(t, sensdata=None, sensor_type=0, smoothing_type=0, itermax=-1, subdiv_type=0, sensor_metric_policy=0, hmesh=None, sensor=None, conformize=1): """Adapts an unstructured mesh a with respect to a sensor. Usage: adaptCells(t, sensdata=None, sensor_type = 0, smoothing_type = 0, itermax=-1, subdiv_type=0, sensor_metric_policy=0, hmesh=None, sensor=None)""" tp = Internal.copyRef(t) _adaptCells(tp, sensdata, sensor_type, smoothing_type, itermax, subdiv_type, sensor_metric_policy, hmesh, sensor, conformize) return tp -def _adaptCells(t, sensdata=None, sensor_type = 0, smoothing_type = 0, itermax=-1, subdiv_type=0, sensor_metric_policy=0, hmesh=None, sensor=None, conformize=1): +def _adaptCells(t, sensdata=None, sensor_type=0, smoothing_type=0, itermax=-1, subdiv_type=0, sensor_metric_policy=0, hmesh=None, sensor=None, conformize=1): """Adapts an unstructured mesh a with respect to a sensor. Usage: adaptCells(t, sensdata=None, sensor_type = 0, smoothing_type = 0, itermax=-1, subdiv_type=0, sensor_metric_policy=0, hmesh=None, sensor=None)""" @@ -2524,7 +2524,7 @@ def _adaptCells(t, sensdata=None, sensor_type = 0, smoothing_type = 0, itermax=- owesHmesh=1 owesSensor=0 - if sensor is None : + if sensor is None : #print("create sensor") sensor = createSensor(hmesh, sensor_type, smoothing_type, itermax, sensor_metric_policy) owesSensor=1 @@ -2533,7 +2533,7 @@ def _adaptCells(t, sensdata=None, sensor_type = 0, smoothing_type = 0, itermax=- if sensdata is None and sensor_type == 5 : #extract metric fields sensdata = [] # going to fill it - for z in zs : + for z in zs : mxx = C.getField("mxx", z) if mxx == [] : err = 1; break mxy = C.getField("mxy", z) @@ -2548,7 +2548,7 @@ def _adaptCells(t, sensdata=None, sensor_type = 0, smoothing_type = 0, itermax=- if mzz == [] : err = 1; break sensdata.append([mxx[0][1], mxy[0][1], mxz[0][1], myy[0][1], myz[0][1], mzz[0][1]]) - if err == 1 : + if err == 1 : print('INPUT ERROR : metric fields are missing or incomplete in the inout tree') return @@ -2581,9 +2581,9 @@ def _adaptCells(t, sensdata=None, sensor_type = 0, smoothing_type = 0, itermax=- _conformizeHMesh(t, hmesh, conformize) if owesHmesh == 1: - # #print('delete owned hmesh') + # #print('delete owned hmesh') deleteHMesh(hmesh) - if owesSensor == 1: + if owesSensor == 1: #print('delete owned sensor') deleteSensor(sensor) @@ -2593,7 +2593,7 @@ def _adaptCells(t, sensdata=None, sensor_type = 0, smoothing_type = 0, itermax=- # IN: nodal_vals: nb of subdivision required expressed at mesh nodes # OUT: returns a 3D NGON Mesh with adapted cells #============================================================================== -def adaptCellsNodal(t, sensdata=None, smoothing_type = 0, subdiv_type=0, hmesh=None, sensor=None): +def adaptCellsNodal(t, sensdata=None, smoothing_type=0, subdiv_type=0, hmesh=None, sensor=None): """Adapts an unstructured mesh a with respect to a sensor (DEPRECATED : use adaptCells with a sensor of type 2 instead.) Usage: adaptCellsNodal(t, sensdata=None, smoothing_type = 0, subdiv_type=0, hmesh=None, sensor=None)""" tp = Internal.copyRef(t) @@ -2634,7 +2634,7 @@ def _setZonesAndJoinsUId(t): zidDict[z[0]] = iz #build zidDict - l = Internal.newIntegralData(name='zid', parent=z) #ceate a zid for each block + l = Internal.newIntegralData(name='zid', parent=z) #ceate a zid for each block l[1] = iz for z in zs: # loop on blocks @@ -2644,7 +2644,7 @@ def _setZonesAndJoinsUId(t): for rac in raccords: # loop on racs - # GET ZONES INDICES + # GET ZONES INDICES z1 = getProperty(z, 'zid') donnorName = "".join(Internal.getValue(rac)) @@ -2654,7 +2654,7 @@ def _setZonesAndJoinsUId(t): if z1 > z2: c = z2 z2 = z1 - z1 = c + z1 = c ptList = Internal.getNodeFromName1(rac, 'PointList')[1][0] ptList_donor = Internal.getNodeFromName1(rac, 'PointListDonor')[1][0] @@ -2681,14 +2681,14 @@ def _setZonesAndJoinsUId(t): ir += 1 dict_VD[z1][z2][idx_perio][idx_min]=ir - r = Internal.newIntegralData(name='rid', parent=rac) + r = Internal.newIntegralData(name='rid', parent=rac) r[1] = ir else: ir += 1 dict_VD[z1][z2][idx_perio] = {} dict_VD[z1][z2][idx_perio][idx_min]=ir - r = Internal.newIntegralData(name='rid', parent=rac) + r = Internal.newIntegralData(name='rid', parent=rac) r[1] = ir else: ir += 1 @@ -2696,7 +2696,7 @@ def _setZonesAndJoinsUId(t): dict_VD[z1][z2][idx_perio] = {} dict_VD[z1][z2][idx_perio][idx_min]=ir - r = Internal.newIntegralData(name='rid', parent=rac) + r = Internal.newIntegralData(name='rid', parent=rac) r[1] = ir else: ir += 1 @@ -2705,16 +2705,16 @@ def _setZonesAndJoinsUId(t): dict_VD[z1][z2][idx_perio] = {} dict_VD[z1][z2][idx_perio][idx_min]=ir - r = Internal.newIntegralData(name='rid', parent=rac) + r = Internal.newIntegralData(name='rid', parent=rac) r[1] = ir #============================================================================== # createHMesh : Returns a hierarchical mesh hook per zone # IN: t : 3D NGON PyTree # IN: subdiv_type : isotropic currently -# OUT: Returns a hierarchical zone hook +# OUT: Returns a hierarchical zone hook #============================================================================== -def createHMesh(t, subdiv_type= 0): +def createHMesh(t, subdiv_type=0): """Returns a hierarchical mesh hook per zone. Usage: createHMesh(t, subdiv_type= 0)""" @@ -2736,9 +2736,9 @@ def createHMesh(t, subdiv_type= 0): return hmeshs #============================================================================== -# deleteHMesh : Releases a hierachical zone hook +# deleteHMesh : Releases a hierachical zone hook # IN: hook : Python hook -# OUT: Nothing +# OUT: Nothing #============================================================================== def deleteHMesh(hooks): """Releases a hierachical zone hook. @@ -2748,17 +2748,17 @@ def deleteHMesh(hooks): intersector.deleteHMesh(h) #============================================================================== -# createSensor : Returns a sensor hook +# createSensor : Returns a sensor hook # IN: t : 3D NGON PyTree # IN: subdiv_type : isotropic currently -# OUT: Returns a hierarchical PyTree hook +# OUT: Returns a hierarchical PyTree hook #============================================================================== -def createSensor(hmeshs, sensor_type = 0, smoothing_type=0 , itermax = -1, sensor_metric_policy = 0): +def createSensor(hmeshs, sensor_type=0, smoothing_type=0 , itermax=-1, sensor_metric_policy=0): """Returns a sensor hook. Usage: createSensor(hmeshs, sensor_type = 0, smoothing_type=0 , itermax = -1)""" sensors = [] for hmesh in hmeshs: - if hmesh == None : + if hmesh == None : sensors.append(None) else : sensors.append(intersector.createSensor(hmesh,sensor_type,smoothing_type,itermax,sensor_metric_policy)) @@ -2767,7 +2767,7 @@ def createSensor(hmeshs, sensor_type = 0, smoothing_type=0 , itermax = -1, senso #============================================================================== # deleteSensor : Releases a sensor hook # IN: hook : Python hook -# OUT: Nothing +# OUT: Nothing #============================================================================== def deleteSensor(hooks): """Releases a sensor hook. @@ -2779,7 +2779,7 @@ def deleteSensor(hooks): #============================================================================== # assignData2Sensor : Assigns data to a sensor # IN: hook : Python hook -# OUT: Nothing +# OUT: Nothing #============================================================================== def assignData2Sensor(hooks, sensdata): """Assigns data to a sensor. @@ -2830,7 +2830,7 @@ def assignData2Sensor(hooks, sensdata): intersector.assignData2Sensor(h, sensdata[i]) return 0 -def createCom(t, subdiv_type = 0, nbz = 1): +def createCom(t, subdiv_type=0, nbz=1): return intersector.createCom(t, subdiv_type, nbz) def deleteCom(hook): @@ -2841,7 +2841,7 @@ def deleteCom(hook): # Each hiearchcial zone is referring to a zone in the original mesh t. So the mesh is replaced in the returned tree and the BCs/Joins/Fields are transferred. # IN: t : PyTree before adaptation # IN: hook : list of hooks to hiearchical zones (same size as nb of zones in t). -# OUT: Nothing +# OUT: Nothing #============================================================================== def conformizeHMesh(t, hooks, conformize=1): """Converts the basic element leaves of a hierarchical mesh to a conformal polyhedral mesh. @@ -2855,7 +2855,7 @@ def conformizeHMesh(t, hooks, conformize=1): # Each hiearchcial zone is referring to a zone in the original mesh t. So the mesh is replaced in the tree and the BCs/Joins/Fields are transferred. # IN: t: PyTree before adaptation # IN: hook: list of hooks to hiearchical zones (same size as nb of zones in t). -# OUT: Nothing +# OUT: Nothing #============================================================================== def _conformizeHMesh(t, hooks, conformize=1): """Converts the basic element leaves of a hierarchical mesh to a conformal polyhedral mesh. @@ -2955,7 +2955,7 @@ def _conformizeHMesh(t, hooks, conformize=1): for f in fieldz: C.setFields([f], z, 'nodes', False) - ## face fields + ## face fields fieldz = [res[5]] #print(fieldz) if fieldz is not [None]: @@ -2967,7 +2967,7 @@ def _conformizeHMesh(t, hooks, conformize=1): #============================================================================== # _transposePointLists : XXX #============================================================================== -def _transposePointLists(t, hooks, zidDict, rid_to_zones = None, zone_to_bcptlists=None, zone_to_rid_to_list_owned=None): +def _transposePointLists(t, hooks, zidDict, rid_to_zones=None, zone_to_bcptlists=None, zone_to_rid_to_list_owned=None): nb_hooks = len(hooks) zones = Internal.getZones(t) @@ -3034,7 +3034,7 @@ def _interpolateHMeshNodalField(t, hooks, fname): #recuperation du field ayant pour nom fname : u ou v for j in range(len(fname)): - #print(fname[j]) + #print(fname[j]) fieldsN[j] = C.getFields(Internal.__FlowSolutionNodes__, C.extractVars(z, fname[j])) fieldN = fieldsN[j] @@ -3048,7 +3048,7 @@ def _interpolateHMeshNodalField(t, hooks, fname): #============================================================================== # adaptBox : Adapts a bounding box to a cloud of interior points #============================================================================== -def adaptBox(t, box_ratio = 10., smoothing_type=0, itermax=-1): +def adaptBox(t, box_ratio=10., smoothing_type=0, itermax=-1): """Adapts a bounding box to a cloud of interior points. Usage: adaptBox(t, box_ratio)""" @@ -3153,7 +3153,7 @@ def extractNthCell(t, nth): if (nb_zones == 0) : return zones - # here it has neighbors + # here it has neighbors for i in range(nb_zones): zones.append(C.convertArrays2ZoneNode('neigh', [m[i+1]])) @@ -3173,7 +3173,7 @@ def extractNthFace(t, nth): if (nb_zones == 0) : return zones - # here it has parent elements + # here it has parent elements for i in range(nb_zones): zones.append(C.convertArrays2ZoneNode('ph', [m[i+1]])) @@ -3209,7 +3209,7 @@ def extractBiggestCell(t): if (nb_zones == 0) : return zones - # here it has neighbors + # here it has neighbors for i in range(nb_zones): zones.append(C.convertArrays2ZoneNode('neigh', [m[i+1]])) @@ -3277,7 +3277,7 @@ def extractOverConnectedCells(t, nneighs=0): return om #============================================================================== -# detectIdentitcalCells : detects (and optionally removes) geometrically identical cells +# detectIdentitcalCells : detects (and optionally removes) geometrically identical cells #====================================================================== def detectIdenticalCells(t, TOL=1.e-15, clean=0): """Detects (and optionannly removes) geometrically identical cells. @@ -3313,12 +3313,12 @@ def _collapseSmallEdges(t, eratio, lmax=-1.): # IN : t1: : NGON mesh (surface or volume). # IN : t2: : NGON mesh (surface or volume). # IN : RTOL: : Relative tolerance (in ]0., 1.[). -# IN: amax : maximal angular value (in rad) between the normals of each pair of colliding polygons. +# IN: amax : maximal angular value (in rad) between the normals of each pair of colliding polygons. # In ragnge [0,PI]. A value of 0. means pure parallelism. A value of PI means any collision. # IN: dir2 : if specified, direction vector used for all a2's polygons instead of their own normals. # OUT: 2 lists of overlapping polygons, the first one for a1, the seoncd one for a2. #============================================================================== -def getOverlappingFaces(t1, t2, RTOL = 0.1, amax = 0.1, dir2=(0.,0.,0.)): +def getOverlappingFaces(t1, t2, RTOL=0.1, amax=0.1, dir2=(0.,0.,0.)): """ Returns the list of polygons in a1 and a2 that are overlapping. Usage: getOverlappingFaces(t1, t2, RTOL, amax, dir2)""" @@ -3349,7 +3349,7 @@ def getOverlappingFaces(t1, t2, RTOL = 0.1, amax = 0.1, dir2=(0.,0.,0.)): # IN : RTOL: : Relative tolerance (in ]0., 1.[). # OUT: list of t1 involved faces #============================================================================== -def getCollidingTopFaces(t1, t2, RTOL = 0.1): +def getCollidingTopFaces(t1, t2, RTOL=0.1): """ Returns the list of top faces (HEXA and PRISM only) in t1 colliding t2. Usage: getCollidingTopFaces(t1, t2, RTOL)""" @@ -3380,7 +3380,7 @@ def getCollidingTopFaces(t1, t2, RTOL = 0.1): # IN : RTOL: : Relative tolerance (in ]0., 1.[). # OUT: 2 lists of colliding cells, the first one for t1, the seoncd one for t2. #============================================================================== -def getCollidingCells(t1, t2, RTOL = 1.e-12, only_externals = False): +def getCollidingCells(t1, t2, RTOL=1.e-12, only_externals=False): """ Returns the list of cells in a1 and a2 that are colliding. Usage: getOverlappingFaces(t1, t2, RTOL)""" @@ -3463,7 +3463,7 @@ def getFaceIdsCollidingVertex(t1, vtx): # IN : are_face_ids: : boolean to tell if ids are referring to faces or cells. # OUT: attached cells. #============================================================================== -def getCells(t1, ids, are_face_ids = True): +def getCells(t1, ids, are_face_ids=True): """ Returns the cells in t1 having faces or cell ids. Usage: getCells(t1, pgids, are_face_ids = True)""" @@ -3516,7 +3516,7 @@ def getFaces(t1, pgids): #============================================================================== -# getNthNeighborhood : returns the list of cells in the N-thneighborhood of t cells given in ids +# getNthNeighborhood : returns the list of cells in the N-thneighborhood of t cells given in ids # IN : t : : NGON mesh. # IN : N : : number of neighborhood required # IN : ids : : input cells ids @@ -3527,7 +3527,7 @@ def getNthNeighborhood(t, N, ids): Usage: getNthNeighborhood(t, N, ids)""" zones = Internal.getZones(t) - if len(ids) != len(zones) : + if len(ids) != len(zones) : print ('getNthNeighborhood : input ERROR : ids list and nb of zones are different') return @@ -3544,7 +3544,7 @@ def getNthNeighborhood(t, N, ids): return idsNeigh #============================================================================== -# estimateAdapReq : estimates an cell-specified adaptation requirement from +# estimateAdapReq : estimates an cell-specified adaptation requirement from # on a istotropic metric field based on donnor connectivity # IN : t : : NGON mesh. # IN : donnor : : donnor mesh (Volume; Surface or BAR) @@ -3555,7 +3555,7 @@ def getNthNeighborhood(t, N, ids): # OUT: Returns a list of integers sized as the nb of cells in t giving the nb of subdivisions # per cell in the range [minv, maxv]. #============================================================================== -def estimateAdapReq(t, donnor, metric_policy=2, rtol= 1.e-12, minv=0, maxv=5): +def estimateAdapReq(t, donnor, metric_policy=2, rtol=1.e-12, minv=0, maxv=5): """ estimates an cell-specified adaptation requirement from on a istotropic metric field based on donnor connectivity. Usage : estimateAdapReq(t, donnor [, metric_policy, rtol, minv, maxv])""" zones2 = Internal.getZones(donnor) @@ -3581,7 +3581,7 @@ def estimateAdapReq(t, donnor, metric_policy=2, rtol= 1.e-12, minv=0, maxv=5): # IN: dir2 : if specified, direction vector used for all a2's polygons instead of their own normals. # OUT: 2 lists of overlapping polygons, the first one for a1, the seoncd one for a2. #============================================================================== -def getAnisoInnerFaces(t1, aniso_ratio = 0.05): +def getAnisoInnerFaces(t1, aniso_ratio=0.05): """ Returns the list of polygons in a1 that are connecting 2 aniso elements. Usage: getAnisoInnerFaces(t1, aniso_ratio)""" @@ -3632,7 +3632,7 @@ def diffMesh(t1, t2): if (nb_zones == 0) : # fixme : never happen continue - if res[0][1].size == 0 and res[0][1].size == 0 : + if res[0][1].size == 0 and res[0][1].size == 0 : continue zones.append(C.convertArrays2ZoneNode('z1', [res[0]])) @@ -3906,7 +3906,7 @@ def _computeGrowthRatio(t, vmin=0.): #============================================================================== # extrudeUserDefinedBC : XXX #============================================================================== -def extrudeBC(t, height = 0.25, mean_or_min = 1, create_ghost = 1, bndType = 'UserDefined'): +def extrudeBC(t, height=0.25, mean_or_min=1, create_ghost=1, bndType='UserDefined'): m = C.getFields(Internal.__GridCoordinates__, t)[0] cur_shift=0 extrudepgs=[] @@ -3989,7 +3989,7 @@ def oneZonePerCell(t): if nb_zones == 0: return zones - # here it has parent elements + # here it has parent elements for i in range(nb_zones): zones.append(C.convertArrays2ZoneNode('cell%s'%i, [m[i]])) @@ -4008,7 +4008,7 @@ def oneZonePerFace(t): if nb_zones == 0: return zones - # here it has parent elements + # here it has parent elements for i in range(nb_zones): zones.append(C.convertArrays2ZoneNode('face%s'%i, [m[i]])) @@ -4067,7 +4067,7 @@ def _convertTree2NUGANGON(t, keep_BC=False): #print(firstzonetype) # Go Unstructured if firstzonetype == 'Structured' : - #print('Structured -> Basic') + #print('Structured -> Basic') C._convertArray2Hexa(z) (typ, d) = getZoneNSTypeAndDim(z) @@ -4103,14 +4103,14 @@ def _volumes(t, algo=1, all_pgs_convex=False): vols = XOR.volumes(m, algo, all_pgs_convex) C.setFields([vols], z, 'centers', False) -def merge(tz, sz, tol = 1.e-15): #target zone, list source zones +def merge(tz, sz, tol=1.e-15): #target zone, list source zones m = C.getFields(Internal.__GridCoordinates__, tz)[0] #print m s = C.getFields(Internal.__GridCoordinates__, sz)[0] #print s return XOR.merge(m, s, tol) -def concatenate(t, tol = 1.e-15): +def concatenate(t, tol=1.e-15): zones = Internal.getZones(t) @@ -4119,7 +4119,7 @@ def concatenate(t, tol = 1.e-15): m = C.getFields(Internal.__GridCoordinates__, z)[0] ms.append(m) - res = XOR.concatenate(ms, tol) + res = XOR.concatenate(ms, tol) m = res[0] nzone = len(zones) @@ -4136,14 +4136,14 @@ def concatenate(t, tol = 1.e-15): # Restore BCs zoneBC = Internal.createUniqueChild(newz, "ZoneBC", 'ZoneBC_t') - i = 0 + i = 0 for z in zones: BCs = Internal.getNodesFromType(z, "BC_t") for bc in BCs: pointList = Internal.getNodeFromName(bc, Internal.__FACELIST__) pointList = pointList[1][0] for k in range(len(pointList)): - iface = pointList[k]-1 + iface = pointList[k]-1 nids = z_pgnids[i][iface] pointList[k] = nids+1 @@ -4157,7 +4157,7 @@ def concatenate(t, tol = 1.e-15): if ( len(data[1]) != len(pointList)): raise ValueError('Concatenate. BC size differs for BCDataSet.') - Internal._addChild(bc,BCDataSet) + Internal._addChild(bc,BCDataSet) Internal._addChild(zoneBC, bc) @@ -4190,19 +4190,19 @@ def concatenate(t, tol = 1.e-15): for varname in varnames: # a. concatenate all old data for varname variable - varglob = None + varglob = None for z in zones: ncells = C.getNCells(z) cont = Internal.getNodeFromName(z, Internal.__FlowSolutionCenters__) - if cont is not None: + if cont is not None: varnode = Internal.getNodeFromName(cont, varname) - # Put zero if variable does not exist + # Put zero if variable does not exist if varnode is None: varnode = numpy.zeros(ncells, numpy.float64) else: - varnode = varnode[1] + varnode = varnode[1] else: # no FlowSolution in z varnode = numpy.zeros(ncells, numpy.float64) @@ -4210,7 +4210,7 @@ def concatenate(t, tol = 1.e-15): if varglob is None: varglob = varnode.ravel('k') else: - varglob = numpy.concatenate((varglob,varnode)) + varglob = numpy.concatenate((varglob,varnode)) @@ -4227,7 +4227,7 @@ def concatenate(t, tol = 1.e-15): if (z_phnids[i][k] != -1): varnew[ik] = varglob[z_phnids[i][k]] ik = ik + 1 - i = i+1 + i = i+1 contnew = Internal.getNodeFromName(newz, Internal.__FlowSolutionCenters__) varnode = Internal.getNodeFromName(contnew, varname) @@ -4278,19 +4278,19 @@ def volume(t, fieldname=None): # OUT: returns a 3D NGON Mesh with synchronised faces #============================================================================== def syncMacthPeriodicFaces(t, rotationCenter=[0.,0.,0.], - rotationAngle=[0.,0.,0.], - translation=[0.,0.,0.], tol=-0.01, - unitAngle=None, reorient=True): + rotationAngle=[0.,0.,0.], + translation=[0.,0.,0.], tol=-0.01, + unitAngle=None, reorient=True): tp = Internal.copyRef(t) _syncMacthPeriodicFaces(tp, rotationCenter, rotationAngle, translation, tol, unitAngle, reorient) return tp def _syncMacthPeriodicFaces(t, rotationCenter=[0.,0.,0.], - rotationAngle=[0.,0.,0.], - translation=[0.,0.,0.], tol=-0.01, - unitAngle=None, reorient=True): + rotationAngle=[0.,0.,0.], + translation=[0.,0.,0.], tol=-0.01, + unitAngle=None, reorient=True): -# WARNING : currently implemented by applying it individually by zone + # WARNING : currently implemented by applying it individually by zone if unitAngle in ['Radian', None]: rotationAngleR=rotationAngle elif unitAngle == 'Degree': rotationAngleR=[v*Internal.__DEG2RAD__ for v in rotationAngle] @@ -4301,7 +4301,7 @@ def _syncMacthPeriodicFaces(t, rotationCenter=[0.,0.,0.], if reorient == True : _reorient(z) m = C.getFields(Internal.__GridCoordinates__, z)[0] res = XOR.syncMacthPeriodicFaces(m, rotationCenter, rotationAngleR, - translation, tol) + translation, tol) msh = res[0] #print(msh) C.setFields([msh], z, 'nodes') @@ -4309,34 +4309,34 @@ def _syncMacthPeriodicFaces(t, rotationCenter=[0.,0.,0.], #~ def conservativeTransfer(a1, a2, tol=0., reconstruction_type=0): - #~ + #~ #~ s1 = C.getFields(Internal.__GridCoordinates__, a1)[0] #~ flowsol1 = C.getFields(Internal.__FlowSolutionCenters__, a1)[0] #~ s2 = C.getFields(Internal.__GridCoordinates__, a2)[0] -#~ +#~ #~ flowsol2 = XOR.conservativeTransfer(s1, flowsol1, s2, tol, reconstruction_type) - #~ + #~ #~ C._deleteFlowSolutions__(a2) #~ return C.setFields([flowsol2], a2, 'centers') - #~ + #~ #~ def totalMass(a1): -#~ +#~ #~ s1 = C.getFields(Internal.__GridCoordinates__, a1)[0] #~ flowsol1 = C.getFields(Internal.__FlowSolutionCenters__, a1)[0] - #~ + #~ #~ return XOR.totalMass(s1, flowsol1) - #~ -#~ + #~ +#~ #~ def normL1(a1,a2): - #~ + #~ #~ s1 = C.getFields(Internal.__GridCoordinates__, a1)[0] #~ flowsol1 = C.getFields(Internal.__FlowSolutionCenters__, a1)[0] - #~ + #~ #~ s2 = C.getFields(Internal.__GridCoordinates__, a2)[0] #~ flowsol2= C.getFields(Internal.__FlowSolutionCenters__, a2)[0] -#~ +#~ #~ return generator.normL1(s1, flowsol1, s2, flowsol2) -#~ +#~ def testmain(t): m = C.getFields(Internal.__GridCoordinates__, t)[0] c = XOR.testmain(m) diff --git a/Cassiopee/Intersector/Intersector/TurboMachine.py b/Cassiopee/Intersector/Intersector/TurboMachine.py index 5013d704c..3b0491f64 100644 --- a/Cassiopee/Intersector/Intersector/TurboMachine.py +++ b/Cassiopee/Intersector/Intersector/TurboMachine.py @@ -12,13 +12,13 @@ #============================================================================== # buildPeriodicCanalOperand -# GOAL : Append the configuration with both neighbor sectors to ensure periodicity of the result +# GOAL : Append the configuration with both neighbor sectors to ensure periodicity of the result # IN: t : 3D NGON mesh # OUT: returns the tolerance and the max bounding box size #============================================================================== -def buildPeriodicCanalOperand(zv, angle, JTOL, rotationCenter=[0.,0.,0.], rotationAxis = [1., 0., 0.]): +def buildPeriodicCanalOperand(zv, angle, JTOL, rotationCenter=[0.,0.,0.], rotationAxis=[1., 0., 0.]): #zv = X.connectMatchPeriodic(zv, rotationCenter, angle*rotationAxis, tol=JTOL, dim=3, unitAngle='Degree') @@ -36,7 +36,7 @@ def buildPeriodicCanalOperand(zv, angle, JTOL, rotationCenter=[0.,0.,0.], rotati #C.convertPyTree2File(t2, 'op2.cgns') return t2 -def transform(z, translation = [0.,0.,0.], rotationCenter=[0.,0.,0.], rotationAxis = [0., 0., 0.]): +def transform(z, translation=[0.,0.,0.], rotationCenter=[0.,0.,0.], rotationAxis=[0., 0., 0.]): is_trans=False if translation[0] != 0. or translation[1] != 0. or translation[2] != 0.: is_trans = True; @@ -49,14 +49,14 @@ def transform(z, translation = [0.,0.,0.], rotationCenter=[0.,0.,0.], rotationAx if is_trans == False and is_rot == False: print('Input tranform error : no translation nor rotation is defined') - if is_trans == True: + if is_trans == True: zt = T.translate(z, translation) if is_rot == True: zt = T.rotate(z, rotationCenter, rotationAxis) return zt # creates a tree with 3 zones : the main and one on each side of it -def build_periodic_operand_2(zi, zone_name, translation=[0.,0.,0.], rotationCenter=[0.,0.,0.], rotationAxis = [0., 0., 0.]): +def build_periodic_operand_2(zi, zone_name, translation=[0.,0.,0.], rotationCenter=[0.,0.,0.], rotationAxis=[0., 0., 0.]): z = I.copyRef(zi) # to avoid to modify input zone with connectMatch call @@ -77,7 +77,7 @@ def build_periodic_operand_2(zi, zone_name, translation=[0.,0.,0.], rotationCent return t # creates a tree with 3 zones : the main and one on each side of it -def build_periodic_operand_3(zi, zone_name, translation=[0.,0.,0.], rotationCenter=[0.,0.,0.], rotationAxis = [0., 0., 0.]): +def build_periodic_operand_3(zi, zone_name, translation=[0.,0.,0.], rotationCenter=[0.,0.,0.], rotationAxis=[0., 0., 0.]): z = I.copyRef(zi) # to avoid to modify input zone with connectMatch call # 'left zone' @@ -107,13 +107,13 @@ def build_periodic_operand_3(zi, zone_name, translation=[0.,0.,0.], rotationCent #============================================================================== # buildPeriodicFeatureOperand -# GOAL : Append the configuration with one neighbor sector to ensure periodicity of the result +# GOAL : Append the configuration with one neighbor sector to ensure periodicity of the result # IN: t : 3D NGON mesh # OUT: returns the tolerance and the max bounding box size #============================================================================== -def buildPeriodicFeatureOperand(zf, angle, JTOL, rotationCenter=[0.,0.,0.], rotationAxis = [1., 0., 0.]): +def buildPeriodicFeatureOperand(zf, angle, JTOL, rotationCenter=[0.,0.,0.], rotationAxis=[1., 0., 0.]): rotationAxis[0] *= angle ; rotationAxis[1] *= angle ; rotationAxis[2] *= angle zf = X.connectMatchPeriodic(zf, rotationCenter, rotationAxis, tol=JTOL, dim=3, unitAngle='Degree') # to freeze periodic boundaries when agglomerating @@ -128,7 +128,7 @@ def buildPeriodicFeatureOperand(zf, angle, JTOL, rotationCenter=[0.,0.,0.], rota #============================================================================== # prepareFeature (aperiodic version) -# GOAL : remove singularities on features (overlapping polygons) by agglomeration on the vicinity of the canal's skin to ease the assembly. +# GOAL : remove singularities on features (overlapping polygons) by agglomeration on the vicinity of the canal's skin to ease the assembly. # IN: feature : 3D NGON mesh of the features to assemble (axisym features) # IN: canal : 3D NGON mesh of the canal @@ -137,31 +137,31 @@ def buildPeriodicFeatureOperand(zf, angle, JTOL, rotationCenter=[0.,0.,0.], rota # OUT: returns the adapted feature #============================================================================== -def prepareFeature(feature, canal, max_overlap_angle, max_simplify_angle, treat_externals = 1): +def prepareFeature(feature, canal, max_overlap_angle, max_simplify_angle, treat_externals=1): vf = P.exteriorFaces(canal) vf = XOR.convertNGON2DToNGON3D(vf) #C.convertPyTree2File(vf, 'vf.cgns') #import time #t0 = time.time() #print('get overlapping faces...') - res = XOR.getOverlappingFaces(feature, vf, RTOL = 0.15, amax = max_overlap_angle)# rad == 6 deg + res = XOR.getOverlappingFaces(feature, vf, RTOL=0.15, amax=max_overlap_angle)# rad == 6 deg # get pgids for t1 zones only : first par of each pairs nb_zones = len(res) t1zones_pgids = [] for i in range(nb_zones): t1zones_pgids.append(res[i][0]) #print('agglomerateCellsWithSpecifiedFaces') - ag_feature = XOR.agglomerateCellsWithSpecifiedFaces(feature, t1zones_pgids, treat_externals=treat_externals, amax = max_simplify_angle) + ag_feature = XOR.agglomerateCellsWithSpecifiedFaces(feature, t1zones_pgids, treat_externals=treat_externals, amax=max_simplify_angle) #C.convertPyTree2File(ag_feature, 'ag_feature.cgns') return ag_feature #============================================================================== # preparePeriodicFeature -# GOAL : remove singularities on features (overlapping polygons) by agglomeration on the vicinity of the canal's skin to ease the assembly. +# GOAL : remove singularities on features (overlapping polygons) by agglomeration on the vicinity of the canal's skin to ease the assembly. # ASSUMPTION : feature and canal have one main zone each. The remaining zones are duplicated and rotated (by rotation_angle) of the main one (for periodicity) -# so we force the agglomeration to be the same for all zones by merging what we get on each zone with getOverlappingFaces +# so we force the agglomeration to be the same for all zones by merging what we get on each zone with getOverlappingFaces # and apply the result to all zones when calling agglomerateCellsWithSpecifiedFaces # this constraint ensure the boolean operation to give a periodic result. @@ -175,14 +175,14 @@ def prepareFeature(feature, canal, max_overlap_angle, max_simplify_angle, treat_ # OUT: returns the adapted feature #============================================================================== -def preparePeriodicFeature(feature, canal, JTOL, rotation_angle, max_overlap_angle, max_simplify_angle, treat_externals = 1): +def preparePeriodicFeature(feature, canal, JTOL, rotation_angle, max_overlap_angle, max_simplify_angle, treat_externals=1): tmp = T.join(canal, tol=JTOL) s2 = P.exteriorFaces(tmp) s2 = XOR.convertNGON2DToNGON3D(s2) #C.convertPyTree2File(s2, 's2.cgns') #print('get overlapping faces...') - res = XOR.getOverlappingFaces(feature, s2, RTOL = 0.15, amax = max_overlap_angle) + res = XOR.getOverlappingFaces(feature, s2, RTOL=0.15, amax=max_overlap_angle) nb_zones = len(res) @@ -194,7 +194,7 @@ def preparePeriodicFeature(feature, canal, JTOL, rotation_angle, max_overlap_ang idlist = list(set(idlist)) #format ids = numpy.empty(len(idlist), I.E_NpyInt) - ids[:] = idlist[:] + ids[:] = idlist[:] # give this list to all zones featurezones_pgids = [] @@ -202,7 +202,7 @@ def preparePeriodicFeature(feature, canal, JTOL, rotation_angle, max_overlap_ang featurezones_pgids.append(ids) #print('agglomerateCellsWithSpecifiedFaces') - feature = XOR.agglomerateCellsWithSpecifiedFaces(feature, featurezones_pgids, treat_externals=treat_externals, amax = max_simplify_angle) + feature = XOR.agglomerateCellsWithSpecifiedFaces(feature, featurezones_pgids, treat_externals=treat_externals, amax=max_simplify_angle) # force periodicity by cloning the most agglomerated zone and replace the less one z1s = I.getZones(feature) @@ -224,10 +224,10 @@ def preparePeriodicFeature(feature, canal, JTOL, rotation_angle, max_overlap_ang #============================================================================== # regularizeFeature -# GOAL : remove singularities on features (overlapping polygons) by agglomeration on the vicinity of the canal's skin to ease the assembly. +# GOAL : remove singularities on features (overlapping polygons) by agglomeration on the vicinity of the canal's skin to ease the assembly. # ASSUMPTION : feature and canal have one main zone each. The remaining zones are duplicated and rotated (by rotation_angle) of the main one (for periodicity) -# so we force the agglomeration to be the same for all zones by merging what we get on each zone with getOverlappingFaces +# so we force the agglomeration to be the same for all zones by merging what we get on each zone with getOverlappingFaces # and apply the result to all zones when calling agglomerateCellsWithSpecifiedFaces # this constraint ensure the boolean operation to give a periodic result. @@ -240,8 +240,8 @@ def preparePeriodicFeature(feature, canal, JTOL, rotation_angle, max_overlap_ang # OUT: returns the adapted feature #============================================================================== def regularizeFeature(feature, skin, max_overlap_angle, max_simplify_angle): - res1 = XOR.getOverlappingFaces(feature, skin, RTOL = 0.15, amax = max_overlap_angle) - res2 = XOR.getCollidingTopFaces(feature, skin, RTOL = 0.15) + res1 = XOR.getOverlappingFaces(feature, skin, RTOL=0.15, amax=max_overlap_angle) + res2 = XOR.getCollidingTopFaces(feature, skin, RTOL=0.15) #f = XOR.getFaces(feature, [res2[0]]) #C.convertPyTree2File(f, 'tops.cgns') @@ -254,9 +254,9 @@ def regularizeFeature(feature, skin, max_overlap_angle, max_simplify_angle): ids_per_z = [] for i in range(nbz): idlist = [] - if len(res1) > i and len(res1[i]) > 0 : + if len(res1) > i and len(res1[i]) > 0 : idlist = numpy.concatenate((idlist, res1[i][0])) - if len(res2) > i : + if len(res2) > i : idlist = numpy.concatenate((idlist, res2[i])) idlist = list(set(idlist))# get rid of duplicate ids ids = numpy.empty(len(idlist), I.E_NpyInt) #format @@ -266,7 +266,7 @@ def regularizeFeature(feature, skin, max_overlap_angle, max_simplify_angle): #f = XOR.getFaces(feature, ids_per_z) #C.convertPyTree2File(f, 'allf.cgns') - azt = XOR.agglomerateCellsWithSpecifiedFaces(feature, ids_per_z, treat_externals=1, amax = max_simplify_angle) + azt = XOR.agglomerateCellsWithSpecifiedFaces(feature, ids_per_z, treat_externals=1, amax=max_simplify_angle) return azt #============================================================================== @@ -332,7 +332,7 @@ def periodicMeshAssembly(t1, t2, TOL, real_zone_list): for i in range(sz): zs.append(zones[real_zone_list[i]]) - assembly = XOR.concatenate(zs, tol = TOL) # now one single block + assembly = XOR.concatenate(zs, tol=TOL) # now one single block print("Check conformity ...") ##### VERIFICATION 1 : CONFORMITE (PAS DE FACES INTERNES) diff --git a/Cassiopee/Intersector/PolyMeshTools/hook_hmesh.py b/Cassiopee/Intersector/PolyMeshTools/hook_hmesh.py index 0fd392c85..25dbb9f74 100644 --- a/Cassiopee/Intersector/PolyMeshTools/hook_hmesh.py +++ b/Cassiopee/Intersector/PolyMeshTools/hook_hmesh.py @@ -19,8 +19,8 @@ ########################## create the hook -hmsh = XOR.createHMesh(z, 0) # 0 : ISOTROPIC subdivision -######################################## +hmsh = XOR.createHMesh(z, 0) # 0 : ISOTROPIC subdivision +######################################## for i in range(5): # simple loop to demonstrate the feature @@ -29,9 +29,9 @@ nodal_vals = numpy.empty((n,), dtype=Internal.E_NpyInt) nodal_vals[:] = 1 #one nodal_vals and one hmesh per zone - z = XOR.adaptCellsNodal(z, [nodal_vals], hmesh = hmsh) + z = XOR.adaptCellsNodal(z, [nodal_vals], hmesh=hmsh) # refine now with source mesh - z = XOR.adaptCells(z, s, itermax=-1, hmesh = hmsh) + z = XOR.adaptCells(z, s, itermax=-1, hmesh=hmsh) #C.convertPyTree2File(z, "hmesh.cgns") # all the hierarchy is in ! @@ -44,5 +44,3 @@ ########################## free the hook XOR.deleteHMesh(hmsh); ##################################### - - diff --git a/Cassiopee/Intersector/PolyMeshTools/prepare.py b/Cassiopee/Intersector/PolyMeshTools/prepare.py index 9c4b42405..4b43ba7e8 100644 --- a/Cassiopee/Intersector/PolyMeshTools/prepare.py +++ b/Cassiopee/Intersector/PolyMeshTools/prepare.py @@ -19,7 +19,7 @@ t2 = C.convertFile2PyTree(ifile2) #print('getOverlappingFaces') -res = XOR.getOverlappingFaces(t1, t2, RTOL = 0.3, ps_min = 0.95) +res = XOR.getOverlappingFaces(t1, t2, RTOL=0.3, ps_min=0.95) # get pgids for t1 zones only : first par of each pairs nb_zones = len(res) diff --git a/Cassiopee/Intersector/PolyMeshTools/regularize.py b/Cassiopee/Intersector/PolyMeshTools/regularize.py index 207a7484d..dbd6e768d 100644 --- a/Cassiopee/Intersector/PolyMeshTools/regularize.py +++ b/Cassiopee/Intersector/PolyMeshTools/regularize.py @@ -34,7 +34,7 @@ def aglomerate(t, vr, vm): nb_cells0 = nb_cells(t) carry_on=1 i=0 - while (carry_on == 1): + while (carry_on == 1): print("iter %s"%i) t=XOR.agglomerateSmallCells(t, vmin=vm, vratio=vr) nb_cells1 = nb_cells(t) @@ -50,7 +50,7 @@ def aglomerateNonStar(t): nb_cells0 = nb_cells(t) carry_on=1 i=0 - while (carry_on == 1): + while (carry_on == 1): print(" ") print("iter %s"%i) t=XOR.agglomerateNonStarCells(t) @@ -59,7 +59,7 @@ def aglomerateNonStar(t): nb_cells1 = nb_cells(t) if (nb_cells1 == nb_cells0): carry_on=0 if (carry_on == 0): print("no cell found.") - if (nb_cells1 != nb_cells0) : + if (nb_cells1 != nb_cells0) : print("%d cells have been aglomerated"%(nb_cells0-nb_cells1)) #C.convertPyTree2File(t, "nonstar_iter_%s.cgns"%i) nb_cells0 = nb_cells1 @@ -99,7 +99,7 @@ def aglomerateNonStar(t): print(" 2.1. prepareCellsSplit by convexifying any concave PH...") set = 1 # 0 for concave cells or 1 for non-centroid-star_shaped cells policy = 0 #0 : convexify concave pgs on PH set. 1 : starify concave pgs on PH set. 2 : starify any pgs at concave-chains ends - t = XOR.prepareCellsSplit(t, PH_set = set, split_policy = policy, PH_conc_threshold = 0.01, PH_cvx_threshold = 0.05, PG_cvx_threshold = 1.e-8) + t = XOR.prepareCellsSplit(t, PH_set=set, split_policy=policy, PH_conc_threshold=0.01, PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-8) print(" 2.2 splitNonStarCells...") t = XOR.splitNonStarCells(t) print(" 2.3 : simplify cells") diff --git a/Cassiopee/Intersector/doc/source/conf.py b/Cassiopee/Intersector/doc/source/conf.py index d83322674..4a3927ff6 100644 --- a/Cassiopee/Intersector/doc/source/conf.py +++ b/Cassiopee/Intersector/doc/source/conf.py @@ -192,15 +192,15 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', -'preamble': r''' + # Additional stuff for the LaTeX preamble. + #'preamble': '', + 'preamble': r''' \usepackage{charter} \usepackage[defaultsans]{lato} \usepackage{inconsolata} @@ -211,8 +211,8 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('Intersector', 'Intersector.tex', u'Intersector Documentation', - u'/ELSA/MU-10019/V'+__version__, 'manual'), + ('Intersector', 'Intersector.tex', u'Intersector Documentation', + u'/ELSA/MU-10019/V'+__version__, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -255,9 +255,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Intersector', u'Intersector Documentation', - u'ONERA', 'Intersector', 'One line description of project.', - 'Miscellaneous'), + ('index', 'Intersector', u'Intersector Documentation', + u'ONERA', 'Intersector', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/Intersector/setup.py b/Cassiopee/Intersector/setup.py index e0723c4c8..88c378812 100644 --- a/Cassiopee/Intersector/setup.py +++ b/Cassiopee/Intersector/setup.py @@ -73,7 +73,7 @@ extra_compile_args=Dist.getCppArgs()+ADDITIONALCPPFLAGS, extra_link_args=Dist.getLinkArgs() )] - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Intersector/setupLegacy.py b/Cassiopee/Intersector/setupLegacy.py index 86c948665..e99cd6c73 100644 --- a/Cassiopee/Intersector/setupLegacy.py +++ b/Cassiopee/Intersector/setupLegacy.py @@ -70,7 +70,7 @@ extra_compile_args=Dist.getCppArgs()+ADDITIONALCPPFLAGS, extra_link_args=Dist.getLinkArgs() )] - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Intersector/srcs.py b/Cassiopee/Intersector/srcs.py index 2fe26c6f2..1c2beb2c0 100644 --- a/Cassiopee/Intersector/srcs.py +++ b/Cassiopee/Intersector/srcs.py @@ -14,7 +14,7 @@ "Intersector/booleanOperations.cpp", "Intersector/xcelln.cpp", "Intersector/selfX.cpp", - "Intersector/P1ConservativeChimeraCoeffs.cpp", + "Intersector/P1ConservativeChimeraCoeffs.cpp", "PolyMeshTools/splitFaces.cpp", "PolyMeshTools/aggloFaces.cpp", @@ -31,4 +31,3 @@ else: cpp_srcs += ["PolyMeshTools/adaptCells_mpi_stub.cpp", "PolyMeshTools/utils_mpi_stub.cpp"] - diff --git a/Cassiopee/Intersector/test/P1ConsChimeraCoeffs_t1.py b/Cassiopee/Intersector/test/P1ConsChimeraCoeffs_t1.py index a44a99cef..4406a1eb6 100644 --- a/Cassiopee/Intersector/test/P1ConsChimeraCoeffs_t1.py +++ b/Cassiopee/Intersector/test/P1ConsChimeraCoeffs_t1.py @@ -27,6 +27,3 @@ # Blanking coef_and_indices = XOR.P1ConservativeChimeraCoeffs(R, cR, D) test.testO(coef_and_indices,1) - - - diff --git a/Cassiopee/Intersector/test/Quarantine/adaptCellsPT_m1.py b/Cassiopee/Intersector/test/Quarantine/adaptCellsPT_m1.py index 057b9c3be..d7d204b2b 100644 --- a/Cassiopee/Intersector/test/Quarantine/adaptCellsPT_m1.py +++ b/Cassiopee/Intersector/test/Quarantine/adaptCellsPT_m1.py @@ -59,7 +59,7 @@ cell_vals.append(cv) # add dummy BC and fields -for z in zs: +for z in zs: C._fillEmptyBCWith(z, 'wall', 'BCWall') C._initVars(z, '{centers:Density} = {centers:CoordinateX} + {centers:CoordinateY}') C._initVars(z, '{centers:Temperature} = {centers:CoordinateX} + {centers:CoordinateY}') diff --git a/Cassiopee/Intersector/test/Quarantine/adaptCellsPT_m2.py b/Cassiopee/Intersector/test/Quarantine/adaptCellsPT_m2.py index f025a2b8b..9e17de38c 100644 --- a/Cassiopee/Intersector/test/Quarantine/adaptCellsPT_m2.py +++ b/Cassiopee/Intersector/test/Quarantine/adaptCellsPT_m2.py @@ -60,7 +60,7 @@ cell_vals.append(cv) # add dummy BC and fields -for z in zs: +for z in zs: C._fillEmptyBCWith(z, 'wall', 'BCWall') C._initVars(z, '{centers:Density} = {centers:CoordinateX} + {centers:CoordinateY}') C._initVars(z, '{centers:Temperature} = {centers:CoordinateX} + {centers:CoordinateY}') diff --git a/Cassiopee/Intersector/test/Quarantine/getCollidingCellsPT_t1.py b/Cassiopee/Intersector/test/Quarantine/getCollidingCellsPT_t1.py index 9b9db557c..adacbc7f6 100644 --- a/Cassiopee/Intersector/test/Quarantine/getCollidingCellsPT_t1.py +++ b/Cassiopee/Intersector/test/Quarantine/getCollidingCellsPT_t1.py @@ -11,7 +11,7 @@ t2 = G.cart((1.,1.5,3.), (1,1,1), (10,10,10)) t2 = C.convertArray2NGon(t2); t2 = G.close(t2) -res = XOR.getCollidingCells(t1, t2, RTOL = 0.05) +res = XOR.getCollidingCells(t1, t2, RTOL=0.05) [ids_in1,ids_in2] = res[0] diff --git a/Cassiopee/Intersector/test/Quarantine/getCollidingCells_t1.py b/Cassiopee/Intersector/test/Quarantine/getCollidingCells_t1.py index 5db90ae67..f8e253e7c 100644 --- a/Cassiopee/Intersector/test/Quarantine/getCollidingCells_t1.py +++ b/Cassiopee/Intersector/test/Quarantine/getCollidingCells_t1.py @@ -11,9 +11,8 @@ t2 = G.cart((1.,1.5,3.), (1,1,1), (10,10,10)) t2 = C.convertArray2NGon(t2); t2 = G.close(t2) -res = XOR.getCollidingCells(t1, t2, RTOL = 0.05) +res = XOR.getCollidingCells(t1, t2, RTOL=0.05) m = XOR.getCells(t1, res[0], are_face_ids=False) test.testA(m,1) - diff --git a/Cassiopee/Intersector/test/adaptBox.py b/Cassiopee/Intersector/test/adaptBox.py index 362f9b354..d4e14b0a1 100644 --- a/Cassiopee/Intersector/test/adaptBox.py +++ b/Cassiopee/Intersector/test/adaptBox.py @@ -11,4 +11,3 @@ m = XOR.closeCells(m) # optional : to close the polyhedral cells C.convertArrays2File([m], 'out.plt') - diff --git a/Cassiopee/Intersector/test/adaptBoxPT_t1.py b/Cassiopee/Intersector/test/adaptBoxPT_t1.py index 39075e79d..17053f1ce 100644 --- a/Cassiopee/Intersector/test/adaptBoxPT_t1.py +++ b/Cassiopee/Intersector/test/adaptBoxPT_t1.py @@ -11,4 +11,3 @@ m = XOR.closeCells(m) test.testT(m,1) - diff --git a/Cassiopee/Intersector/test/adaptBox_t1.py b/Cassiopee/Intersector/test/adaptBox_t1.py index 65265fc35..d1c47ef27 100644 --- a/Cassiopee/Intersector/test/adaptBox_t1.py +++ b/Cassiopee/Intersector/test/adaptBox_t1.py @@ -10,4 +10,3 @@ m = XOR.adaptBox(a, box_ratio=10.) m = XOR.closeCells(m) test.testA(m,1) - diff --git a/Cassiopee/Intersector/test/adaptCells.py b/Cassiopee/Intersector/test/adaptCells.py index 69d997cae..bc21fc2c6 100644 --- a/Cassiopee/Intersector/test/adaptCells.py +++ b/Cassiopee/Intersector/test/adaptCells.py @@ -18,4 +18,3 @@ m = XOR.closeCells(m[0]) C.convertArrays2File([m], 'xout.plt') - diff --git a/Cassiopee/Intersector/test/adaptCellsCenter.py b/Cassiopee/Intersector/test/adaptCellsCenter.py index 20aba16e5..c63fd7609 100644 --- a/Cassiopee/Intersector/test/adaptCellsCenter.py +++ b/Cassiopee/Intersector/test/adaptCellsCenter.py @@ -15,7 +15,7 @@ nodal_vals[:] = 2 ## HEXA static adaptation -m = XOR.adaptCells(a, nodal_vals, sensor_type = 3, smoothing_type = 1) +m = XOR.adaptCells(a, nodal_vals, sensor_type=3, smoothing_type=1) m = XOR.closeCells(m[0]) C.convertArrays2File([m], 'out.plt') @@ -25,8 +25,7 @@ nodal_vals = numpy.empty((n,), dtype=Internal.E_NpyInt) nodal_vals[:] = 2 -m = XOR.adaptCells(aTH4, nodal_vals, sensor_type = 3, smoothing_type = 1) +m = XOR.adaptCells(aTH4, nodal_vals, sensor_type=3, smoothing_type=1) m = XOR.closeCells(m[0]) C.convertArrays2File([m], 'out2.plt') - diff --git a/Cassiopee/Intersector/test/adaptCellsCenterPT.py b/Cassiopee/Intersector/test/adaptCellsCenterPT.py index 75c66dcf4..e2336353f 100644 --- a/Cassiopee/Intersector/test/adaptCellsCenterPT.py +++ b/Cassiopee/Intersector/test/adaptCellsCenterPT.py @@ -21,15 +21,15 @@ XOR._setZonesAndJoinsUId(z) -m = XOR.adaptCells(z, [nodal_vals], sensor_type=3, smoothing_type = 1) +m = XOR.adaptCells(z, [nodal_vals], sensor_type=3, smoothing_type=1) m = XOR.closeCells(m) C.convertPyTree2File(m, 'out.cgns') ## HEXA dynamic adaptation -hmsh = XOR.createHMesh(z, 0) # 0 : ISOTROPIC subdivision +hmsh = XOR.createHMesh(z, 0) # 0 : ISOTROPIC subdivision -m = XOR.adaptCells(z, [nodal_vals], sensor_type=3, hmesh = hmsh, smoothing_type = 1) +m = XOR.adaptCells(z, [nodal_vals], sensor_type=3, hmesh=hmsh, smoothing_type=1) m = XOR.closeCells(m) # close cells (adding point on lateral faces) C.convertPyTree2File(m, "out1.cgns") @@ -44,9 +44,7 @@ nodal_vals = numpy.empty((n,), dtype=Internal.E_NpyInt) nodal_vals[:] = 2 -m = XOR.adaptCells(zTH4, [nodal_vals], sensor_type=3, smoothing_type = 1) +m = XOR.adaptCells(zTH4, [nodal_vals], sensor_type=3, smoothing_type=1) m = XOR.closeCells(m) C.convertPyTree2File(m, 'out2.cgns') - - diff --git a/Cassiopee/Intersector/test/adaptCellsCenterPT_t1.py b/Cassiopee/Intersector/test/adaptCellsCenterPT_t1.py index c0165db83..b12c7a3dd 100644 --- a/Cassiopee/Intersector/test/adaptCellsCenterPT_t1.py +++ b/Cassiopee/Intersector/test/adaptCellsCenterPT_t1.py @@ -1,7 +1,7 @@ # - adapts a cells with respect to b points (PyTree) - import Intersector.PyTree as XOR import Converter.PyTree as C -import Converter.Internal as I +import Converter.Internal as I import Generator.PyTree as G import numpy import KCore.test as test @@ -22,7 +22,7 @@ XOR._setZonesAndJoinsUId(z) -m = XOR.adaptCells(z, [nodal_vals], sensor_type=3, smoothing_type = 1, subdiv_type=0, hmesh=None) +m = XOR.adaptCells(z, [nodal_vals], sensor_type=3, smoothing_type=1, subdiv_type=0, hmesh=None) m = XOR.closeCells(m) @@ -33,9 +33,9 @@ test.testT(m,1) ## HEXA dynamic adaptation -hmsh = XOR.createHMesh(z, 0) # 0 : ISOTROPIC subdivision +hmsh = XOR.createHMesh(z, 0) # 0 : ISOTROPIC subdivision -m = XOR.adaptCells(z, [nodal_vals], sensor_type=3, smoothing_type = 1, subdiv_type=0, hmesh=hmsh) +m = XOR.adaptCells(z, [nodal_vals], sensor_type=3, smoothing_type=1, subdiv_type=0, hmesh=hmsh) m = XOR.conformizeHMesh(m, hmsh) m = XOR.closeCells(m) # close cells (adding point on lateral faces) @@ -58,7 +58,7 @@ XOR._setZonesAndJoinsUId(zTH4) -m = XOR.adaptCells(zTH4, [nodal_vals], sensor_type=3, smoothing_type = 1, subdiv_type=0) +m = XOR.adaptCells(zTH4, [nodal_vals], sensor_type=3, smoothing_type=1, subdiv_type=0) m = XOR.closeCells(m) @@ -67,5 +67,3 @@ #C.convertPyTree2File(m, 'nodalPT_t1_3.cgns') test.testT(m,3) - - diff --git a/Cassiopee/Intersector/test/adaptCellsCenter_t1.py b/Cassiopee/Intersector/test/adaptCellsCenter_t1.py index 442adb6a3..ef3039082 100644 --- a/Cassiopee/Intersector/test/adaptCellsCenter_t1.py +++ b/Cassiopee/Intersector/test/adaptCellsCenter_t1.py @@ -2,7 +2,7 @@ # adapts a cells with respect to b points import Intersector as XOR import Converter as C -import Converter.Internal as I +import Converter.Internal as I import Generator as G import numpy import KCore.test as test diff --git a/Cassiopee/Intersector/test/adaptCellsDynPT.py b/Cassiopee/Intersector/test/adaptCellsDynPT.py index da3db0f45..6c9eba557 100644 --- a/Cassiopee/Intersector/test/adaptCellsDynPT.py +++ b/Cassiopee/Intersector/test/adaptCellsDynPT.py @@ -1,5 +1,5 @@ # - dynamic adaptation -# +# import Generator.PyTree as G import Converter.PyTree as C import Intersector.PyTree as XOR @@ -17,7 +17,7 @@ senso = XOR.createSensor(hmsh) XOR.assignData2Sensor(senso, source) -m = XOR.adaptCells(mesh, hmesh = hmsh, sensor=senso) +m = XOR.adaptCells(mesh, hmesh=hmsh, sensor=senso) m = XOR.conformizeHMesh(m, hmsh) m = XOR.closeCells(m) diff --git a/Cassiopee/Intersector/test/adaptCellsNodal.py b/Cassiopee/Intersector/test/adaptCellsNodal.py index f5fe0bf6d..020deebef 100644 --- a/Cassiopee/Intersector/test/adaptCellsNodal.py +++ b/Cassiopee/Intersector/test/adaptCellsNodal.py @@ -30,4 +30,3 @@ m = XOR.closeCells(m[0]) C.convertArrays2File([m], 'out2.plt') - diff --git a/Cassiopee/Intersector/test/adaptCellsNodalPT.py b/Cassiopee/Intersector/test/adaptCellsNodalPT.py index 843942373..bc5b1e670 100644 --- a/Cassiopee/Intersector/test/adaptCellsNodalPT.py +++ b/Cassiopee/Intersector/test/adaptCellsNodalPT.py @@ -20,15 +20,15 @@ XOR._setZonesAndJoinsUId(z) -m = XOR.adaptCellsNodal(z, [nodal_vals], smoothing_type = 1) +m = XOR.adaptCellsNodal(z, [nodal_vals], smoothing_type=1) m = XOR.closeCells(m) C.convertPyTree2File(m, 'out.cgns') ## HEXA dynamic adaptation -hmsh = XOR.createHMesh(z, 0) # 0 : ISOTROPIC subdivision +hmsh = XOR.createHMesh(z, 0) # 0 : ISOTROPIC subdivision -m = XOR.adaptCellsNodal(z, [nodal_vals], hmesh = hmsh, smoothing_type = 1) +m = XOR.adaptCellsNodal(z, [nodal_vals], hmesh=hmsh, smoothing_type=1) m = XOR.closeCells(m) # close cells (adding point on lateral faces) C.convertPyTree2File(m, "out1.cgns") @@ -43,9 +43,7 @@ nodal_vals = numpy.empty((n,), dtype=Internal.E_NpyInt) nodal_vals[:] = 2 -m = XOR.adaptCellsNodal(zTH4, [nodal_vals], smoothing_type = 1) +m = XOR.adaptCellsNodal(zTH4, [nodal_vals], smoothing_type=1) m = XOR.closeCells(m) C.convertPyTree2File(m, 'out2.cgns') - - diff --git a/Cassiopee/Intersector/test/adaptCellsNodalPT_t1.py b/Cassiopee/Intersector/test/adaptCellsNodalPT_t1.py index a1d5358f4..54499f2eb 100644 --- a/Cassiopee/Intersector/test/adaptCellsNodalPT_t1.py +++ b/Cassiopee/Intersector/test/adaptCellsNodalPT_t1.py @@ -22,7 +22,7 @@ XOR._setZonesAndJoinsUId(z) -m = XOR.adaptCellsNodal(z, [nodal_vals], smoothing_type = 1, subdiv_type=0, hmesh=None) +m = XOR.adaptCellsNodal(z, [nodal_vals], smoothing_type=1, subdiv_type=0, hmesh=None) m = XOR.closeCells(m) @@ -33,9 +33,9 @@ test.testT(m,1) ## HEXA dynamic adaptation -hmsh = XOR.createHMesh(z, 0) # 0 : ISOTROPIC subdivision +hmsh = XOR.createHMesh(z, 0) # 0 : ISOTROPIC subdivision -m = XOR.adaptCellsNodal(z, [nodal_vals], smoothing_type = 1, subdiv_type=0, hmesh=hmsh) +m = XOR.adaptCellsNodal(z, [nodal_vals], smoothing_type=1, subdiv_type=0, hmesh=hmsh) m = XOR.conformizeHMesh(m, hmsh) m = XOR.closeCells(m) # close cells (adding point on lateral faces) @@ -59,7 +59,7 @@ XOR._setZonesAndJoinsUId(zTH4) -m = XOR.adaptCellsNodal(zTH4, [nodal_vals], smoothing_type = 1, subdiv_type=0) +m = XOR.adaptCellsNodal(zTH4, [nodal_vals], smoothing_type=1, subdiv_type=0) m = XOR.closeCells(m) @@ -68,5 +68,3 @@ #C.convertPyTree2File(m, 'nodalPT_t1_3.cgns') test.testT(m,3) - - diff --git a/Cassiopee/Intersector/test/adaptCellsNodal_t1.py b/Cassiopee/Intersector/test/adaptCellsNodal_t1.py index 75cbd9a8a..5bff8b26c 100644 --- a/Cassiopee/Intersector/test/adaptCellsNodal_t1.py +++ b/Cassiopee/Intersector/test/adaptCellsNodal_t1.py @@ -2,7 +2,7 @@ import Intersector as XOR import Converter as C import Generator as G -import Converter.Internal as I +import Converter.Internal as I import numpy import KCore.test as test @@ -28,7 +28,7 @@ nodal_vals = numpy.empty((n,), dtype=I.E_NpyInt) nodal_vals[:] = 2 -m = XOR.adaptCells(aTH4, nodal_vals, sensor_type = 2, smoothing_type = 1) +m = XOR.adaptCells(aTH4, nodal_vals, sensor_type=2, smoothing_type=1) m = XOR.closeCells(m[0]) #C.convertArrays2File([m], 'out1.plt') diff --git a/Cassiopee/Intersector/test/adaptCellsPT.py b/Cassiopee/Intersector/test/adaptCellsPT.py index 6189c13eb..aa3b58339 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT.py +++ b/Cassiopee/Intersector/test/adaptCellsPT.py @@ -29,24 +29,23 @@ ## dynamic adaptation hmsh = XOR.createHMesh(a) -m = XOR.adaptCells(a, b, hmesh = hmsh, sensor_type=0) +m = XOR.adaptCells(a, b, hmesh=hmsh, sensor_type=0) cm = XOR.conformizeHMesh(m, hmsh) cm = XOR.closeCells(m) XOR.deleteHMesh(hmsh); C.convertPyTree2File(cm, 'out3.cgns') hmsh = XOR.createHMesh(a) -m = XOR.adaptCells(a, b, hmesh = hmsh, sensor_type=0, smoothing_type=1) +m = XOR.adaptCells(a, b, hmesh=hmsh, sensor_type=0, smoothing_type=1) cm = XOR.conformizeHMesh(m, hmsh) cm = XOR.closeCells(cm) C.convertPyTree2File(cm, 'out4.cgns') -m = XOR.adaptCells(m, b, hmesh = hmsh, sensor_type=0) # applied to existing hmesh with the geometrical sensor +m = XOR.adaptCells(m, b, hmesh=hmsh, sensor_type=0) # applied to existing hmesh with the geometrical sensor cm = XOR.conformizeHMesh(cm, hmsh) cm = XOR.closeCells(cm) XOR.deleteHMesh(hmsh); C.convertPyTree2File(cm, 'out5.cgns') - diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t1.py b/Cassiopee/Intersector/test/adaptCellsPT_t1.py index 96460711b..d86fc3f57 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT_t1.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t1.py @@ -47,7 +47,7 @@ # dynamic adaptation hmsh = XOR.createHMesh(a) -m = XOR.adaptCells(a, b, hmesh = hmsh, sensor_type=0) +m = XOR.adaptCells(a, b, hmesh=hmsh, sensor_type=0) m = XOR.conformizeHMesh(m, hmsh) m = XOR.closeCells(m) @@ -59,7 +59,7 @@ #C.convertPyTree2File(m, 'PT_t1_4.cgns') hmsh = XOR.createHMesh(a) -m = XOR.adaptCells(a, b, hmesh = hmsh, sensor_type=0, smoothing_type=1) +m = XOR.adaptCells(a, b, hmesh=hmsh, sensor_type=0, smoothing_type=1) cm = XOR.conformizeHMesh(m, hmsh) cm = XOR.closeCells(cm) @@ -70,7 +70,7 @@ test.testT(cm,5) #C.convertPyTree2File(cm, 'PT_t1_5.cgns') -m = XOR.adaptCells(m, b, hmesh = hmsh, sensor_type=0) # applied to existing hmesh with the basic sensor +m = XOR.adaptCells(m, b, hmesh=hmsh, sensor_type=0) # applied to existing hmesh with the basic sensor cm = XOR.conformizeHMesh(cm, hmsh) cm = XOR.closeCells(cm) @@ -81,4 +81,3 @@ XOR.deleteHMesh(hmsh); test.testT(cm,6) #C.convertPyTree2File(cm, 'PT_t1_6.cgns') - diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t10.py b/Cassiopee/Intersector/test/adaptCellsPT_t10.py index 323a5cf14..c24910d3c 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT_t10.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t10.py @@ -1,7 +1,7 @@ # - adapts a cells with respect to b points (array) - import Intersector.PyTree as XOR import Converter.PyTree as C -import Converter.Internal as I +import Converter.Internal as I import Generator.PyTree as G import Converter.Internal as I import Transform.PyTree as T @@ -44,11 +44,3 @@ test.testT(ta,1) #C.convertPyTree2File(ta, 'PT_t10_1.cgns') - - - - - - - - diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t11.py b/Cassiopee/Intersector/test/adaptCellsPT_t11.py index 8c212414d..616f2d491 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT_t11.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t11.py @@ -39,11 +39,3 @@ test.testT(ta,1) #C.convertPyTree2File(ta, 'PT_t11.cgns') - - - - - - - - diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t12.py b/Cassiopee/Intersector/test/adaptCellsPT_t12.py index aadf69feb..b73fc1210 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT_t12.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t12.py @@ -19,15 +19,15 @@ STYPE=3 # DIR ########################## create the hook XOR._setZonesAndJoinsUId(z) -hmsh = XOR.createHMesh(z, subdiv_type=STYPE) # 0 : ISOTROPIC subdivision -######################################## +hmsh = XOR.createHMesh(z, subdiv_type=STYPE) # 0 : ISOTROPIC subdivision +######################################## #nodal specification n = C.getNCells(z) cell_vals = numpy.empty((n,), dtype=I.E_NpyInt) cell_vals[:] = 1 # refine now with source mesh -z = XOR.adaptCells(z, cell_vals, subdiv_type=STYPE, sensor_type=3, itermax=-1, hmesh = hmsh) +z = XOR.adaptCells(z, cell_vals, subdiv_type=STYPE, sensor_type=3, itermax=-1, hmesh=hmsh) z = XOR.conformizeHMesh(z, hmsh) # each children faces replace its mother in any polyhedron @@ -42,13 +42,3 @@ ########################## free the hook XOR.deleteHMesh(hmsh) ##################################### - - - - - - - - - - diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t13.py b/Cassiopee/Intersector/test/adaptCellsPT_t13.py index c3d715e10..603443833 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT_t13.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t13.py @@ -46,11 +46,3 @@ test.testT(ta,1) #C.convertPyTree2File(ta, 'PT_t11.cgns') - - - - - - - - diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t14.py b/Cassiopee/Intersector/test/adaptCellsPT_t14.py index 944d5dc69..a3d636a5c 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT_t14.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t14.py @@ -38,7 +38,7 @@ # dynamic adaptation hmsh = XOR.createHMesh(a) -m = XOR.adaptCells(a, b, hmesh = hmsh, sensor_type=4) +m = XOR.adaptCells(a, b, hmesh=hmsh, sensor_type=4) m = XOR.conformizeHMesh(m, hmsh) m = XOR.closeCells(m) @@ -50,7 +50,7 @@ #C.convertPyTree2File(m, 'PT_t14_3.cgns') hmsh = XOR.createHMesh(a) -m = XOR.adaptCells(a, b, hmesh = hmsh, sensor_type=4, smoothing_type=1) +m = XOR.adaptCells(a, b, hmesh=hmsh, sensor_type=4, smoothing_type=1) cm = XOR.conformizeHMesh(m, hmsh) cm = XOR.closeCells(cm) @@ -61,7 +61,7 @@ test.testT(cm,5) #C.convertPyTree2File(cm, 'PT_t14_4.cgns') -m = XOR.adaptCells(m, b, hmesh = hmsh, sensor_type=4) # applied to existing hmesh with the basic sensor +m = XOR.adaptCells(m, b, hmesh=hmsh, sensor_type=4) # applied to existing hmesh with the basic sensor cm = XOR.conformizeHMesh(cm, hmsh) cm = XOR.closeCells(cm) @@ -72,4 +72,3 @@ XOR.deleteHMesh(hmsh); test.testT(cm,6) #C.convertPyTree2File(cm, 'PT_t14_5.cgns') - diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t15.py b/Cassiopee/Intersector/test/adaptCellsPT_t15.py index 3bd21d8bc..b82ba4cc4 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT_t15.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t15.py @@ -11,7 +11,7 @@ import numpy a = D.triangle((0,0,0), (0,1,0), (1, 0, 0)) -d = G.cart((1,0.,0.), (1,1,1),(2,1,1)) +d = G.cart((1,0.,0.), (1,1,1),(2,1,1)) a = G.addNormalLayers(a, d) a = C.convertArray2NGon(a) a = G.close(a) @@ -47,4 +47,3 @@ #C.convertPyTree2File(m2, 'PT_t15_2.cgns') test.testT(m2,2) - diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t16.py b/Cassiopee/Intersector/test/adaptCellsPT_t16.py index 281aec3bf..352876203 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT_t16.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t16.py @@ -37,4 +37,3 @@ test.testT(m,2) #C.convertPyTree2File(m, 'PT_t16_2.cgns') - diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t2.py b/Cassiopee/Intersector/test/adaptCellsPT_t2.py index a792c0758..25d561861 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT_t2.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t2.py @@ -47,7 +47,7 @@ ## dynamic adaptation hmsh = XOR.createHMesh(a) -m = XOR.adaptCells(a, b, hmesh = hmsh, sensor_type=0) +m = XOR.adaptCells(a, b, hmesh=hmsh, sensor_type=0) m = XOR.conformizeHMesh(m, hmsh) m = XOR.closeCells(m) XOR.deleteHMesh(hmsh); @@ -59,7 +59,7 @@ #C.convertPyTree2File(m, 'PT_t2_4.cgns') hmsh = XOR.createHMesh(a) -m = XOR.adaptCells(a, b, hmesh = hmsh, sensor_type=0, smoothing_type=1) +m = XOR.adaptCells(a, b, hmesh=hmsh, sensor_type=0, smoothing_type=1) cm = XOR.conformizeHMesh(m, hmsh) cm = XOR.closeCells(cm) @@ -70,7 +70,7 @@ test.testT(cm,5) #C.convertPyTree2File(cm, 'PT_t2_5.cgns') -m = XOR.adaptCells(m, b, hmesh = hmsh, sensor_type=0) # applied to existing hmesh with the basic sensor +m = XOR.adaptCells(m, b, hmesh=hmsh, sensor_type=0) # applied to existing hmesh with the basic sensor cm = XOR.conformizeHMesh(cm, hmsh) cm = XOR.closeCells(cm) @@ -82,4 +82,3 @@ test.testT(cm,6) #C.convertPyTree2File(cm, 'PT_t2_6.cgns') - diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t3.py b/Cassiopee/Intersector/test/adaptCellsPT_t3.py index 6156554e8..84e50b9fa 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT_t3.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t3.py @@ -1,5 +1,5 @@ # - adapts a cells with respect to b points (PyTree) - -# +# import Generator.PyTree as G import Transform.PyTree as T import Converter.PyTree as C @@ -58,7 +58,7 @@ ## dynamic adaptation hmsh = XOR.createHMesh(mesh) -m3 = XOR.adaptCells(mesh, source, hmesh = hmsh, sensor_type=0) +m3 = XOR.adaptCells(mesh, source, hmesh=hmsh, sensor_type=0) m3 = XOR.conformizeHMesh(m3, hmsh) m3 = XOR.closeCells(m3) @@ -70,7 +70,7 @@ #C.convertPyTree2File(m3, 'PT_t3_4.cgns') hmsh = XOR.createHMesh(mesh) -m4 = XOR.adaptCells(mesh, source, hmesh = hmsh, sensor_type=0, smoothing_type=1) +m4 = XOR.adaptCells(mesh, source, hmesh=hmsh, sensor_type=0, smoothing_type=1) m4 = XOR.conformizeHMesh(m4, hmsh) m4 = XOR.closeCells(m4) @@ -81,7 +81,7 @@ test.testT(m4,5) #C.convertPyTree2File(m4, 'PT_t3_5.cgns') -m5 = XOR.adaptCells(m4, source, hmesh = hmsh, sensor_type=0) # applied to existing hmesh with the basic sensor +m5 = XOR.adaptCells(m4, source, hmesh=hmsh, sensor_type=0) # applied to existing hmesh with the basic sensor m5 = XOR.conformizeHMesh(m4, hmsh) m5 = XOR.closeCells(m5) diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t4.py b/Cassiopee/Intersector/test/adaptCellsPT_t4.py index 6883ba024..056097752 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT_t4.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t4.py @@ -9,12 +9,12 @@ import KCore.test as test a = D.triangle((0,0,0), (0,1,0), (1, 0, 0)) -d = G.cart((1,0.,0.), (1,1,1),(2,1,1)) +d = G.cart((1,0.,0.), (1,1,1),(2,1,1)) a = G.addNormalLayers(a, d) a = C.convertArray2NGon(a) a = G.close(a) -b = G.cart((0.2,0.2,-0.5), (0.01,0.01,0.01),(5,5,5)) +b = G.cart((0.2,0.2,-0.5), (0.01,0.01,0.01),(5,5,5)) b = C.convertArray2NGon(b) b = G.close(b) @@ -44,4 +44,3 @@ #C.convertPyTree2File(m2, 'PT_t4_2.cgns') test.testT(m2,2) - diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t5.py b/Cassiopee/Intersector/test/adaptCellsPT_t5.py index 395532b85..18fccf648 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT_t5.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t5.py @@ -13,7 +13,7 @@ a = C.convertArray2NGon(a) a = G.close(a) -b = G.cart((0.2,0.2,0.2), (0.01,0.01,0.01),(5,5,5)) +b = G.cart((0.2,0.2,0.2), (0.01,0.01,0.01),(5,5,5)) b = C.convertArray2NGon(b) b = G.close(b) diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t6.py b/Cassiopee/Intersector/test/adaptCellsPT_t6.py index bd921f3be..ac4c14c7e 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT_t6.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t6.py @@ -9,12 +9,12 @@ import KCore.test as test a = D.triangle((0,0,0), (0,1,0), (1, 0, 0)) -d = G.cart((1,0.,0.), (1,1,1),(2,1,1)) +d = G.cart((1,0.,0.), (1,1,1),(2,1,1)) a = G.addNormalLayers(a, d) a = C.convertArray2NGon(a) a = G.close(a) -b = G.cart((0.2,0.2,-0.2), (0.01,0.01,-0.01),(25,25,25)) +b = G.cart((0.2,0.2,-0.2), (0.01,0.01,-0.01),(25,25,25)) b = C.convertArray2NGon(b) b = G.close(b) #C.convertPyTree2File(b,'z_nonreg6_source.cgns') diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t7.py b/Cassiopee/Intersector/test/adaptCellsPT_t7.py index 10fb71ae0..cf0ab27a1 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT_t7.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t7.py @@ -16,7 +16,7 @@ #C.convertPyTree2File(a,'z_nonreg7.plt') -b = G.cart((0.4,0.4,-0.2), (0.01,0.01,-0.01),(5,5,5)) +b = G.cart((0.4,0.4,-0.2), (0.01,0.01,-0.01),(5,5,5)) b = C.convertArray2NGon(b) b = G.close(b) diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t8.py b/Cassiopee/Intersector/test/adaptCellsPT_t8.py index 42c95720c..a95e1d5eb 100644 --- a/Cassiopee/Intersector/test/adaptCellsPT_t8.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t8.py @@ -1,5 +1,5 @@ import Converter.PyTree as C -import Converter.Internal as I +import Converter.Internal as I import Generator.PyTree as G #import Post.PyTree as P import os, sys @@ -18,8 +18,8 @@ ########################## create the hook XOR._setZonesAndJoinsUId(z) -hmsh = XOR.createHMesh(z, 0) # 0 : ISOTROPIC subdivision -######################################## +hmsh = XOR.createHMesh(z, 0) # 0 : ISOTROPIC subdivision +######################################## for i in range(3): # simple loop to demonstrate the feature sequencing adaptCells and adaptCellsNodal @@ -28,9 +28,9 @@ nodal_vals = numpy.empty((n,), dtype=I.E_NpyInt) nodal_vals[:] = 1 #one nodal_vals and one hmesh per zone - z = XOR.adaptCellsNodal(z, [nodal_vals], hmesh = hmsh) + z = XOR.adaptCellsNodal(z, [nodal_vals], hmesh=hmsh) # refine now with source mesh - z = XOR.adaptCells(z, s, itermax=-1, hmesh = hmsh) + z = XOR.adaptCells(z, s, itermax=-1, hmesh=hmsh) z = XOR.conformizeHMesh(z, hmsh) # each children faces replace its mother in any polyhedron @@ -45,5 +45,3 @@ ########################## free the hook XOR.deleteHMesh(hmsh); ##################################### - - diff --git a/Cassiopee/Intersector/test/adaptCellsPT_t9.py b/Cassiopee/Intersector/test/adaptCellsPT_t9.py index 3e9662789..b654d0b0d 100755 --- a/Cassiopee/Intersector/test/adaptCellsPT_t9.py +++ b/Cassiopee/Intersector/test/adaptCellsPT_t9.py @@ -45,11 +45,3 @@ test.testT(ta,1) #C.convertPyTree2File(ta, 'PT_t9.cgns') - - - - - - - - diff --git a/Cassiopee/Intersector/test/adaptCells_t1.py b/Cassiopee/Intersector/test/adaptCells_t1.py index 20df8bdbd..033f083ec 100644 --- a/Cassiopee/Intersector/test/adaptCells_t1.py +++ b/Cassiopee/Intersector/test/adaptCells_t1.py @@ -19,4 +19,3 @@ m = XOR.closeCells(m[0]) test.testA(m,2) #C.convertArrays2File([m], 't1_2.plt') - diff --git a/Cassiopee/Intersector/test/adaptCells_t2.py b/Cassiopee/Intersector/test/adaptCells_t2.py index 52b67918f..c5e0311a9 100644 --- a/Cassiopee/Intersector/test/adaptCells_t2.py +++ b/Cassiopee/Intersector/test/adaptCells_t2.py @@ -20,4 +20,3 @@ m = XOR.closeCells(m[0]) test.testA(m,2) #C.convertArrays2File([m], 't2_2.plt') - diff --git a/Cassiopee/Intersector/test/agglomerateNonStarCells.py b/Cassiopee/Intersector/test/agglomerateNonStarCells.py index 28c83da47..1337c9f8f 100644 --- a/Cassiopee/Intersector/test/agglomerateNonStarCells.py +++ b/Cassiopee/Intersector/test/agglomerateNonStarCells.py @@ -16,4 +16,3 @@ m = XOR.agglomerateNonStarCells(m) C.convertArrays2File(m, 'out.plt') - diff --git a/Cassiopee/Intersector/test/agglomerateNonStarCellsPT.py b/Cassiopee/Intersector/test/agglomerateNonStarCellsPT.py index a31d9e730..7576198c7 100644 --- a/Cassiopee/Intersector/test/agglomerateNonStarCellsPT.py +++ b/Cassiopee/Intersector/test/agglomerateNonStarCellsPT.py @@ -15,4 +15,3 @@ m = XOR.agglomerateNonStarCells(m) C.convertPyTree2File(m, 'out.cgns') - diff --git a/Cassiopee/Intersector/test/agglomerateNonStarCells_t1.py b/Cassiopee/Intersector/test/agglomerateNonStarCells_t1.py index df4743cbd..9eaf1da2c 100644 --- a/Cassiopee/Intersector/test/agglomerateNonStarCells_t1.py +++ b/Cassiopee/Intersector/test/agglomerateNonStarCells_t1.py @@ -17,4 +17,3 @@ m = XOR.agglomerateNonStarCells(m) test.testA(m,1) - diff --git a/Cassiopee/Intersector/test/agglomerateSmallCells.py b/Cassiopee/Intersector/test/agglomerateSmallCells.py index abc59c9fd..48332f2a8 100644 --- a/Cassiopee/Intersector/test/agglomerateSmallCells.py +++ b/Cassiopee/Intersector/test/agglomerateSmallCells.py @@ -23,8 +23,7 @@ #s = XOR.reorientExternalFaces(s) # Boolean operation -x = XOR.diffSurf(t, s, tol = 0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation +x = XOR.diffSurf(t, s, tol=0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation C.convertArrays2File(x, 'diffsurf.plt') x = XOR.agglomerateSmallCells(x, vmin=0., vratio=0.1) C.convertArrays2File(x, 'agg.plt') - diff --git a/Cassiopee/Intersector/test/agglomerateSmallCellsPT.py b/Cassiopee/Intersector/test/agglomerateSmallCellsPT.py index a166fa685..b3008bf54 100644 --- a/Cassiopee/Intersector/test/agglomerateSmallCellsPT.py +++ b/Cassiopee/Intersector/test/agglomerateSmallCellsPT.py @@ -23,12 +23,9 @@ #s = XOR.reorientExternalFaces(s) # Boolean operation -x = XOR.diffSurf(t, s, tol = 0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation +x = XOR.diffSurf(t, s, tol=0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation x = XOR.agglomerateSmallCells(x, vmin=0., vratio=0.1) t = C.newPyTree(['Base',2]); t[2][1][2].append(x) C.convertPyTree2File(t, 'diffs.cgns') - - - diff --git a/Cassiopee/Intersector/test/agglomerateSmallCellsPT_t1.py b/Cassiopee/Intersector/test/agglomerateSmallCellsPT_t1.py index 9972f8ca1..63889639f 100644 --- a/Cassiopee/Intersector/test/agglomerateSmallCellsPT_t1.py +++ b/Cassiopee/Intersector/test/agglomerateSmallCellsPT_t1.py @@ -21,7 +21,7 @@ s = XOR.convertNGON2DToNGON3D(s) #s = XOR.reorientExternalFaces(s) -x = XOR.diffSurf(t, s, tol = 0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation +x = XOR.diffSurf(t, s, tol=0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation x = XOR.agglomerateSmallCells(x, vmin=0., vratio=0.1) diff --git a/Cassiopee/Intersector/test/agglomerateSmallCells_t1.py b/Cassiopee/Intersector/test/agglomerateSmallCells_t1.py index 9b128925f..147e39fc3 100644 --- a/Cassiopee/Intersector/test/agglomerateSmallCells_t1.py +++ b/Cassiopee/Intersector/test/agglomerateSmallCells_t1.py @@ -21,7 +21,7 @@ s = XOR.convertNGON2DToNGON3D(s) #s = XOR.reorientExternalFaces(s) -x = XOR.diffSurf(t, s, tol = 0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation +x = XOR.diffSurf(t, s, tol=0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation x = XOR.agglomerateSmallCells(x, vmin=0., vratio=0.1) diff --git a/Cassiopee/Intersector/test/booleanIntersectionNGPT_t1.py b/Cassiopee/Intersector/test/booleanIntersectionNGPT_t1.py index 44b045c95..7c856ccbf 100644 --- a/Cassiopee/Intersector/test/booleanIntersectionNGPT_t1.py +++ b/Cassiopee/Intersector/test/booleanIntersectionNGPT_t1.py @@ -19,6 +19,6 @@ #~ x = XOR.booleanIntersection(M1, M2, tol, preserve_right=1, solid_right=0) #~ test.testT(x,3) -#~ +#~ #~ x = XOR.booleanIntersection(M1, M2, tol, preserve_right=0, solid_right=0) #~ test.testT(x,4) diff --git a/Cassiopee/Intersector/test/booleanIntersectionPT_t2.py b/Cassiopee/Intersector/test/booleanIntersectionPT_t2.py index 6931ff838..cb9d0fbdc 100755 --- a/Cassiopee/Intersector/test/booleanIntersectionPT_t2.py +++ b/Cassiopee/Intersector/test/booleanIntersectionPT_t2.py @@ -14,4 +14,3 @@ x = XOR.booleanIntersection(c1, c2, tol=0.) test.testT(x) - diff --git a/Cassiopee/Intersector/test/booleanIntersection_t1.py b/Cassiopee/Intersector/test/booleanIntersection_t1.py index 68467fa73..ec38e3952 100755 --- a/Cassiopee/Intersector/test/booleanIntersection_t1.py +++ b/Cassiopee/Intersector/test/booleanIntersection_t1.py @@ -26,4 +26,3 @@ x = XOR.booleanIntersection(s1, s2, tol=0.) test.testA([x], 2) - diff --git a/Cassiopee/Intersector/test/booleanIntersection_t2.py b/Cassiopee/Intersector/test/booleanIntersection_t2.py index 7af5668a4..732cd7b79 100755 --- a/Cassiopee/Intersector/test/booleanIntersection_t2.py +++ b/Cassiopee/Intersector/test/booleanIntersection_t2.py @@ -14,4 +14,3 @@ x = XOR.booleanIntersection(c1, c2, tol=0.) test.testA([x],1) - diff --git a/Cassiopee/Intersector/test/booleanMinus.py b/Cassiopee/Intersector/test/booleanMinus.py index 45e49909e..0cb302224 100755 --- a/Cassiopee/Intersector/test/booleanMinus.py +++ b/Cassiopee/Intersector/test/booleanMinus.py @@ -12,4 +12,3 @@ x = XOR.booleanMinus(s1, s2, tol=0.) C.convertArrays2File([x], 'out.plt') - diff --git a/Cassiopee/Intersector/test/booleanMinusNG.py b/Cassiopee/Intersector/test/booleanMinusNG.py index 2b2bc3e88..c360d3492 100644 --- a/Cassiopee/Intersector/test/booleanMinusNG.py +++ b/Cassiopee/Intersector/test/booleanMinusNG.py @@ -18,6 +18,6 @@ #~ x = XOR.booleanMinus(M1, M2, tol, preserve_right=1, solid_right=0) #~ C.convertArrays2File([x], 'boolNGminus10.plt') -#~ +#~ #~ x = XOR.booleanMinus(M1, M2, tol, preserve_right=0, solid_right=0) #~ C.convertArrays2File([x], 'boolNGminus00.plt') diff --git a/Cassiopee/Intersector/test/booleanMinusNGPT_t1.py b/Cassiopee/Intersector/test/booleanMinusNGPT_t1.py index 20c93aeda..ee47b782c 100644 --- a/Cassiopee/Intersector/test/booleanMinusNGPT_t1.py +++ b/Cassiopee/Intersector/test/booleanMinusNGPT_t1.py @@ -19,6 +19,6 @@ #~ x = XOR.booleanMinus(M1, M2, tol, preserve_right=1, solid_right=0) #~ test.testT(x,3) -#~ +#~ #~ x = XOR.booleanMinus(M1, M2, tol, preserve_right=0, solid_right=0) #~ test.testT(x,4) diff --git a/Cassiopee/Intersector/test/booleanMinusNG_t1.py b/Cassiopee/Intersector/test/booleanMinusNG_t1.py index 741bb17de..c5448ef86 100644 --- a/Cassiopee/Intersector/test/booleanMinusNG_t1.py +++ b/Cassiopee/Intersector/test/booleanMinusNG_t1.py @@ -19,6 +19,6 @@ #~ x = XOR.booleanMinus(M1, M2, tol, preserve_right=1, solid_right=0) #~ test.testA([x],3) -#~ +#~ #~ x = XOR.booleanMinus(M1, M2, tol, preserve_right=0, solid_right=0) #~ test.testA([x],4) diff --git a/Cassiopee/Intersector/test/booleanMinusPT_t2.py b/Cassiopee/Intersector/test/booleanMinusPT_t2.py index be9376900..507127718 100755 --- a/Cassiopee/Intersector/test/booleanMinusPT_t2.py +++ b/Cassiopee/Intersector/test/booleanMinusPT_t2.py @@ -14,4 +14,3 @@ x = XOR.booleanMinus(c1, c2, tol=0.) test.testT(x) - diff --git a/Cassiopee/Intersector/test/booleanMinus_t1.py b/Cassiopee/Intersector/test/booleanMinus_t1.py index 86cfe8ad2..b15e4bab9 100755 --- a/Cassiopee/Intersector/test/booleanMinus_t1.py +++ b/Cassiopee/Intersector/test/booleanMinus_t1.py @@ -26,4 +26,3 @@ s2 = C.convertArray2Tetra(s2); s2 = G.close(s2) x = XOR.booleanMinus(s1, s2, tol=0.) test.testA([x], 2) - diff --git a/Cassiopee/Intersector/test/booleanMinus_t2.py b/Cassiopee/Intersector/test/booleanMinus_t2.py index 994d8ffc5..60541a646 100755 --- a/Cassiopee/Intersector/test/booleanMinus_t2.py +++ b/Cassiopee/Intersector/test/booleanMinus_t2.py @@ -14,4 +14,3 @@ x = XOR.booleanMinus(c1, c2, tol=0.) test.testA([x],1) - diff --git a/Cassiopee/Intersector/test/booleanUnion.py b/Cassiopee/Intersector/test/booleanUnion.py index 832ea74a5..031814d1a 100755 --- a/Cassiopee/Intersector/test/booleanUnion.py +++ b/Cassiopee/Intersector/test/booleanUnion.py @@ -12,4 +12,3 @@ x = XOR.booleanUnion(s1, s2, tol=0.) C.convertArrays2File([x], 'out.plt') - diff --git a/Cassiopee/Intersector/test/booleanUnionNG.py b/Cassiopee/Intersector/test/booleanUnionNG.py index ef65c54a4..ee56319e2 100644 --- a/Cassiopee/Intersector/test/booleanUnionNG.py +++ b/Cassiopee/Intersector/test/booleanUnionNG.py @@ -18,6 +18,6 @@ #~ x = XOR.booleanUnion(M1, M2, tol, preserve_right=1, solid_right=0) #~ C.convertArrays2File([x], 'boolNGunion10.plt') -#~ +#~ #~ x = XOR.booleanUnion(M1, M2, tol, preserve_right=0, solid_right=0) #~ C.convertArrays2File([x], 'boolNGunion00.plt') diff --git a/Cassiopee/Intersector/test/booleanUnionNGPT_t1.py b/Cassiopee/Intersector/test/booleanUnionNGPT_t1.py index ac4deca26..f80d459a5 100644 --- a/Cassiopee/Intersector/test/booleanUnionNGPT_t1.py +++ b/Cassiopee/Intersector/test/booleanUnionNGPT_t1.py @@ -19,6 +19,6 @@ #~ x = XOR.booleanUnion(M1, M2, tol, preserve_right=1, solid_right=0) #~ test.testT(x,3) -#~ +#~ #~ x = XOR.booleanUnion(M1, M2, tol, preserve_right=0, solid_right=0) #~ test.testT(x,4) diff --git a/Cassiopee/Intersector/test/booleanUnionNGPT_t2.py b/Cassiopee/Intersector/test/booleanUnionNGPT_t2.py index dee5c0911..33bab7917 100755 --- a/Cassiopee/Intersector/test/booleanUnionNGPT_t2.py +++ b/Cassiopee/Intersector/test/booleanUnionNGPT_t2.py @@ -1,5 +1,5 @@ # - adapts a cells with respect to b points (PyTree) - -# +# import Generator.PyTree as G import Transform.PyTree as T import Converter.PyTree as C diff --git a/Cassiopee/Intersector/test/booleanUnionNGPT_t4.py b/Cassiopee/Intersector/test/booleanUnionNGPT_t4.py index 908ae8c89..0699f96a9 100644 --- a/Cassiopee/Intersector/test/booleanUnionNGPT_t4.py +++ b/Cassiopee/Intersector/test/booleanUnionNGPT_t4.py @@ -13,7 +13,7 @@ h1 = C.convertArray2NGon(h1); h1 = G.close(h1) h2 = C.convertArray2NGon(h2); h2 = G.close(h2) -# BCs +# BCs subz = G.cartNGon( (0,0,0), (1,1,1), (13,12,1) ) hook = C.createHook(h1, function='faceCenters') ids = C.identifyElements(hook, subz) @@ -40,7 +40,7 @@ h1 = C.fillEmptyBCWith(h1, 'wall','BCWall') h2 = C.fillEmptyBCWith(h2, 'nref','BCFarfield') -# Split +# Split h1 = T.splitNParts(h1, 5, multigrid=0, dirs=[1,2,3]) h2 = T.splitNParts(h2, 4, multigrid=0, dirs=[1,2,3]) diff --git a/Cassiopee/Intersector/test/booleanUnionNG_t1.py b/Cassiopee/Intersector/test/booleanUnionNG_t1.py index b188fdd82..b51d15d64 100644 --- a/Cassiopee/Intersector/test/booleanUnionNG_t1.py +++ b/Cassiopee/Intersector/test/booleanUnionNG_t1.py @@ -19,6 +19,6 @@ #~ x = XOR.booleanUnion(M1, M2, tol, preserve_right=1, solid_right=0) #~ test.testA([x],3) -#~ +#~ #~ x = XOR.booleanUnion(M1, M2, tol, preserve_right=0, solid_right=0) #~ test.testA([x],4) diff --git a/Cassiopee/Intersector/test/booleanUnionPT_t2.py b/Cassiopee/Intersector/test/booleanUnionPT_t2.py index d1a25c87d..d0a992b09 100755 --- a/Cassiopee/Intersector/test/booleanUnionPT_t2.py +++ b/Cassiopee/Intersector/test/booleanUnionPT_t2.py @@ -14,4 +14,3 @@ x = XOR.booleanUnion(c1, c2, tol=0.) test.testT(x) - diff --git a/Cassiopee/Intersector/test/booleanUnion_t1.py b/Cassiopee/Intersector/test/booleanUnion_t1.py index 0be8016e9..a31c3e678 100755 --- a/Cassiopee/Intersector/test/booleanUnion_t1.py +++ b/Cassiopee/Intersector/test/booleanUnion_t1.py @@ -24,4 +24,3 @@ s2 = C.convertArray2Tetra(s2); s2 = G.close(s2) x = XOR.booleanUnion(s1, s2, tol=0.) test.testA([x],2) - diff --git a/Cassiopee/Intersector/test/booleanUnion_t2.py b/Cassiopee/Intersector/test/booleanUnion_t2.py index d8753e687..e5e2067a4 100755 --- a/Cassiopee/Intersector/test/booleanUnion_t2.py +++ b/Cassiopee/Intersector/test/booleanUnion_t2.py @@ -14,4 +14,3 @@ x = XOR.booleanUnion(c1, c2, tol=0.) test.testA([x],1) - diff --git a/Cassiopee/Intersector/test/checkCellsClosure.py b/Cassiopee/Intersector/test/checkCellsClosure.py index 15f82903d..2413a7f0c 100644 --- a/Cassiopee/Intersector/test/checkCellsClosure.py +++ b/Cassiopee/Intersector/test/checkCellsClosure.py @@ -8,6 +8,3 @@ a = C.convertArray2NGon(a) err = XOR.checkCellsClosure(a) - - - diff --git a/Cassiopee/Intersector/test/closeCellsPT.py b/Cassiopee/Intersector/test/closeCellsPT.py index 4e4a92e71..3466b2697 100644 --- a/Cassiopee/Intersector/test/closeCellsPT.py +++ b/Cassiopee/Intersector/test/closeCellsPT.py @@ -8,4 +8,3 @@ m = XOR.closeCells(m) C.convertPyTree2File(m, 'out.cgns') - diff --git a/Cassiopee/Intersector/test/closeCellsPT_t1.py b/Cassiopee/Intersector/test/closeCellsPT_t1.py index ff57b0397..b40f93802 100644 --- a/Cassiopee/Intersector/test/closeCellsPT_t1.py +++ b/Cassiopee/Intersector/test/closeCellsPT_t1.py @@ -8,4 +8,3 @@ m = XOR.closeCells(m) test.testT(m, 1) - diff --git a/Cassiopee/Intersector/test/concatenatePT_t1.py b/Cassiopee/Intersector/test/concatenatePT_t1.py index 164f8ba0b..2c81f37ad 100644 --- a/Cassiopee/Intersector/test/concatenatePT_t1.py +++ b/Cassiopee/Intersector/test/concatenatePT_t1.py @@ -1,6 +1,6 @@ # - concatenate (PyTree) - -import Converter.PyTree as C +import Converter.PyTree as C import Generator.PyTree as G import Connector.PyTree as X import Transform.PyTree as T @@ -10,7 +10,7 @@ # ---------------------------------------------------------------- # TEST 1 # ---------------------------------------------------------------- -# Maillages +# Maillages a = G.cartHexa((0.,0.,0.), (1.,1.,1.), (3,2,2)) a = C.convertArray2NGon(a) a = C.initVars(a,'{centers:varA} = 5.') @@ -18,7 +18,7 @@ b = C.convertArray2NGon(b) b = C.initVars(b,'{centers:varB} = 9.') -# BCs +# BCs subz = G.cartNGon( (0,0,0), (1,1,1), (3,2,1) ) hook = C.createHook(a, function='faceCenters') ids = C.identifyElements(hook, subz) @@ -32,7 +32,7 @@ t = C.newPyTree(['Base',a,b]) t = X.connectMatch(t) -# BCs +# BCs t = C.fillEmptyBCWith(t, 'nref','BCFarfield') # Champs @@ -45,11 +45,11 @@ # ---------------------------------------------------------------- # TEST 2 # ---------------------------------------------------------------- -# Maillages +# Maillages a = G.cartHexa((0.,0.,0.), (1.,1.,1.), (11,7,3)) a = C.convertArray2NGon(a) -# BCs +# BCs subz = G.cartNGon( (0,0,0), (1,1,1), (11,7,1) ) hook = C.createHook(a, function='faceCenters') ids = C.identifyElements(hook, subz) @@ -62,7 +62,7 @@ # Raccord t = X.connectMatch(t) -# BCs +# BCs t = C.fillEmptyBCWith(t, 'nref','BCFarfield') # Concatenation diff --git a/Cassiopee/Intersector/test/conformUnstrPT_t1.py b/Cassiopee/Intersector/test/conformUnstrPT_t1.py index 1f96ddfa9..e224c8c45 100644 --- a/Cassiopee/Intersector/test/conformUnstrPT_t1.py +++ b/Cassiopee/Intersector/test/conformUnstrPT_t1.py @@ -27,4 +27,3 @@ x = XOR.conformUnstr(c1, c2, tol=0.) test.testT(x, 2) - diff --git a/Cassiopee/Intersector/test/conformUnstr_t1.py b/Cassiopee/Intersector/test/conformUnstr_t1.py index ad10ba547..f7868a2ca 100644 --- a/Cassiopee/Intersector/test/conformUnstr_t1.py +++ b/Cassiopee/Intersector/test/conformUnstr_t1.py @@ -27,4 +27,3 @@ x = XOR.conformUnstr(c1, c2, tol=0.) test.testA([x],2) - diff --git a/Cassiopee/Intersector/test/convexifyFaces.py b/Cassiopee/Intersector/test/convexifyFaces.py index 6937d2177..7dbab4d52 100644 --- a/Cassiopee/Intersector/test/convexifyFaces.py +++ b/Cassiopee/Intersector/test/convexifyFaces.py @@ -16,4 +16,3 @@ m = XOR.convexifyFaces(m) C.convertArrays2File([m], 'out.plt') - diff --git a/Cassiopee/Intersector/test/convexifyFacesPT.py b/Cassiopee/Intersector/test/convexifyFacesPT.py index 99b95ce53..61833fc0e 100644 --- a/Cassiopee/Intersector/test/convexifyFacesPT.py +++ b/Cassiopee/Intersector/test/convexifyFacesPT.py @@ -15,4 +15,3 @@ m = XOR.convexifyFaces(m) C.convertPyTree2File(m, 'out.cgns') - diff --git a/Cassiopee/Intersector/test/diffMesh.py b/Cassiopee/Intersector/test/diffMesh.py index edde25835..aee09dea6 100644 --- a/Cassiopee/Intersector/test/diffMesh.py +++ b/Cassiopee/Intersector/test/diffMesh.py @@ -23,10 +23,9 @@ #s = XOR.reorientExternalFaces(s) # Boolean operation -x = XOR.diffSurf(t, s, tol = 0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation +x = XOR.diffSurf(t, s, tol=0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation xa = XOR.agglomerateSmallCells(x, 0., 10.) x = XOR.diffMesh(x,xa[0]) C.convertArrays2File(x, 'diffM.plt') - diff --git a/Cassiopee/Intersector/test/diffMeshPT.py b/Cassiopee/Intersector/test/diffMeshPT.py index fe7ee0070..f93301563 100644 --- a/Cassiopee/Intersector/test/diffMeshPT.py +++ b/Cassiopee/Intersector/test/diffMeshPT.py @@ -23,10 +23,9 @@ #s = XOR.reorientExternalFaces(s) # Boolean operation -x = XOR.diffSurf(t, s, tol = 0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation +x = XOR.diffSurf(t, s, tol=0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation xa = XOR.agglomerateSmallCells(x, 0., 10.) x = XOR.diffMesh(x,xa) C.convertPyTree2File(x, 'diffM.cgns') - diff --git a/Cassiopee/Intersector/test/diffMeshPT_t1.py b/Cassiopee/Intersector/test/diffMeshPT_t1.py index 76c356b34..5eebc6c3f 100644 --- a/Cassiopee/Intersector/test/diffMeshPT_t1.py +++ b/Cassiopee/Intersector/test/diffMeshPT_t1.py @@ -24,10 +24,9 @@ #s = XOR.reorientExternalFaces(s) # Boolean operation -x = XOR.diffSurf(t, s, tol = 0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation +x = XOR.diffSurf(t, s, tol=0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation xa = XOR.agglomerateSmallCells(x, 0., 10.) x = XOR.diffMesh(x,xa) test.testT(x, 1) - diff --git a/Cassiopee/Intersector/test/diffMesh_t1.py b/Cassiopee/Intersector/test/diffMesh_t1.py index e672e3ee3..fcd229725 100644 --- a/Cassiopee/Intersector/test/diffMesh_t1.py +++ b/Cassiopee/Intersector/test/diffMesh_t1.py @@ -24,10 +24,9 @@ #s = XOR.reorientExternalFaces(s) # Boolean operation -x = XOR.diffSurf(t, s, tol = 0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation +x = XOR.diffSurf(t, s, tol=0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation xa = XOR.agglomerateSmallCells(x, 0., 10.) x = XOR.diffMesh(x,xa[0]) test.testA(x,1) - diff --git a/Cassiopee/Intersector/test/diffSurf.py b/Cassiopee/Intersector/test/diffSurf.py index 4000a648a..204dd4bad 100644 --- a/Cassiopee/Intersector/test/diffSurf.py +++ b/Cassiopee/Intersector/test/diffSurf.py @@ -23,7 +23,6 @@ #s = XOR.reorientExternalFaces(s) # Boolean operation -x = XOR.diffSurf(t, s, tol = 0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation +x = XOR.diffSurf(t, s, tol=0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation C.convertArrays2File([x], 'out.plt') - diff --git a/Cassiopee/Intersector/test/diffSurfPT.py b/Cassiopee/Intersector/test/diffSurfPT.py index cb55010d1..7388a878f 100644 --- a/Cassiopee/Intersector/test/diffSurfPT.py +++ b/Cassiopee/Intersector/test/diffSurfPT.py @@ -23,10 +23,7 @@ #s = XOR.reorientExternalFaces(s) # Boolean operation -x = XOR.diffSurf(t, s, tol = 0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation +x = XOR.diffSurf(t, s, tol=0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation t = C.newPyTree(['Base',2]); t[2][1][2].append(x) C.convertPyTree2File(t, 'diffs.cgns') - - - diff --git a/Cassiopee/Intersector/test/diffSurfPT_t1.py b/Cassiopee/Intersector/test/diffSurfPT_t1.py index 4909cfe9a..11e447333 100644 --- a/Cassiopee/Intersector/test/diffSurfPT_t1.py +++ b/Cassiopee/Intersector/test/diffSurfPT_t1.py @@ -21,7 +21,7 @@ s = XOR.convertNGON2DToNGON3D(s) #s = XOR.reorientExternalFaces(s) -x = XOR.diffSurf(t, s, tol = 0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation +x = XOR.diffSurf(t, s, tol=0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation #C.convertPyTree2File(s, 's.cgns') #C.convertPyTree2File(t, 'o.cgns') diff --git a/Cassiopee/Intersector/test/diffSurf_t1.py b/Cassiopee/Intersector/test/diffSurf_t1.py index 8861469bf..46088452f 100644 --- a/Cassiopee/Intersector/test/diffSurf_t1.py +++ b/Cassiopee/Intersector/test/diffSurf_t1.py @@ -21,7 +21,7 @@ s = XOR.convertNGON2DToNGON3D(s) #s = XOR.reorientExternalFaces(s) -x = XOR.diffSurf(t, s, tol = 0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation +x = XOR.diffSurf(t, s, tol=0., preserve_right=1, agg_mode=2) # agg_mode=2 : full mode aggregation #C.convertPyTree2File(s, 's.cgns') #C.convertPyTree2File(t, 'o.cgns') diff --git a/Cassiopee/Intersector/test/extractPathologicals.py b/Cassiopee/Intersector/test/extractPathologicals.py index 2932db362..0f53fb950 100644 --- a/Cassiopee/Intersector/test/extractPathologicals.py +++ b/Cassiopee/Intersector/test/extractPathologicals.py @@ -17,4 +17,3 @@ m=XOR.extractPathologicalCells(m, 2) # ask for 2 level of neighgbors C.convertArrays2File(m, 'out.plt') - diff --git a/Cassiopee/Intersector/test/extractPathologicals_t1.py b/Cassiopee/Intersector/test/extractPathologicals_t1.py index 5a4f45fc5..1256a2318 100644 --- a/Cassiopee/Intersector/test/extractPathologicals_t1.py +++ b/Cassiopee/Intersector/test/extractPathologicals_t1.py @@ -18,4 +18,3 @@ m=XOR.extractPathologicalCells(m, 2) # ask for 2 level of neighgbors test.testA(m,1) - diff --git a/Cassiopee/Intersector/test/getCollidingCells.py b/Cassiopee/Intersector/test/getCollidingCells.py index 27d1e6fb3..5dc48027c 100644 --- a/Cassiopee/Intersector/test/getCollidingCells.py +++ b/Cassiopee/Intersector/test/getCollidingCells.py @@ -11,9 +11,8 @@ t2 = G.cart((1.,1.5,3.), (1,1,1), (10,10,10)) t2 = C.convertArray2NGon(t2); t2 = G.close(t2) -res = XOR.getCollidingCells(t1, t2, RTOL = 0.05) +res = XOR.getCollidingCells(t1, t2, RTOL=0.05) m = XOR.getCells(t1, res[0], are_face_ids=False) C.convertArrays2File([m], "out.plt") - diff --git a/Cassiopee/Intersector/test/getCollidingCellsPT.py b/Cassiopee/Intersector/test/getCollidingCellsPT.py index b4b04cdbd..b2993ac78 100644 --- a/Cassiopee/Intersector/test/getCollidingCellsPT.py +++ b/Cassiopee/Intersector/test/getCollidingCellsPT.py @@ -11,7 +11,7 @@ t2 = G.cart((1.,1.5,3.), (1,1,1), (10,10,10)) t2 = C.convertArray2NGon(t2); t2 = G.close(t2) -res = XOR.getCollidingCells(t1, t2, RTOL = 0.05) +res = XOR.getCollidingCells(t1, t2, RTOL=0.05) [ids_in1,ids_in2] = res[0] diff --git a/Cassiopee/Intersector/test/getOverlappingFaces.py b/Cassiopee/Intersector/test/getOverlappingFaces.py index d74d0d850..18f0b1b4b 100644 --- a/Cassiopee/Intersector/test/getOverlappingFaces.py +++ b/Cassiopee/Intersector/test/getOverlappingFaces.py @@ -12,7 +12,7 @@ t2 = C.convertArray2NGon(t2); t2 = G.close(t2) # test 1 : volume/volume -res = XOR.getOverlappingFaces(t1, t2, RTOL = 0.05, amax = 0.1) +res = XOR.getOverlappingFaces(t1, t2, RTOL=0.05, amax=0.1) # create a list of polygon list (t1), one list per zone @@ -25,7 +25,7 @@ t2 = P.exteriorFaces(t2) t2 = XOR.convertNGON2DToNGON3D(t2) -res = XOR.getOverlappingFaces(t1, t2, RTOL = 0.05, amax = 0.1) +res = XOR.getOverlappingFaces(t1, t2, RTOL=0.05, amax=0.1) t = XOR.agglomerateCellsWithSpecifiedFaces(t1, res[0]) diff --git a/Cassiopee/Intersector/test/getOverlappingFacesPT.py b/Cassiopee/Intersector/test/getOverlappingFacesPT.py index fd4634291..4a8f51d17 100644 --- a/Cassiopee/Intersector/test/getOverlappingFacesPT.py +++ b/Cassiopee/Intersector/test/getOverlappingFacesPT.py @@ -12,7 +12,7 @@ t2 = C.convertArray2NGon(t2); t2 = G.close(t2) # test 1 : volume/volume -res = XOR.getOverlappingFaces(t1, t2, RTOL = 0.05, amax = 0.1) +res = XOR.getOverlappingFaces(t1, t2, RTOL=0.05, amax=0.1) # create a list of polygon list (t1), one list per zone nb_zones = len(res) @@ -29,7 +29,7 @@ t2 = P.exteriorFaces(t2) t2 = XOR.convertNGON2DToNGON3D(t2) -res = XOR.getOverlappingFaces(t1, t2, RTOL = 0.05, amax = 0.1) +res = XOR.getOverlappingFaces(t1, t2, RTOL=0.05, amax=0.1) t1zones_pgids = [] for i in range(nb_zones): diff --git a/Cassiopee/Intersector/test/getOverlappingFacesPT_t1.py b/Cassiopee/Intersector/test/getOverlappingFacesPT_t1.py index 14390e11c..9c9478b14 100644 --- a/Cassiopee/Intersector/test/getOverlappingFacesPT_t1.py +++ b/Cassiopee/Intersector/test/getOverlappingFacesPT_t1.py @@ -14,7 +14,7 @@ #C.convertPyTree2File(t2, 's.plt') # test 1 : volume/volume -res = XOR.getOverlappingFaces(t1, t2, RTOL = 0.05, amax = 0.1) +res = XOR.getOverlappingFaces(t1, t2, RTOL=0.05, amax=0.1) # create a list of polygon list (t1), one list per zone nb_zones = len(res) @@ -31,7 +31,7 @@ t2 = P.exteriorFaces(t2) t2 = XOR.convertNGON2DToNGON3D(t2) -res = XOR.getOverlappingFaces(t1, t2, RTOL = 0.05, amax = 0.1) +res = XOR.getOverlappingFaces(t1, t2, RTOL=0.05, amax=0.1) t1zones_pgids = [] for i in range(nb_zones): diff --git a/Cassiopee/Intersector/test/getOverlappingFaces_t1.py b/Cassiopee/Intersector/test/getOverlappingFaces_t1.py index 4f1f366fd..e910c1a5d 100644 --- a/Cassiopee/Intersector/test/getOverlappingFaces_t1.py +++ b/Cassiopee/Intersector/test/getOverlappingFaces_t1.py @@ -14,7 +14,7 @@ #C.convertArrays2File([t2], 's.plt') # test 1 : volume/volume -res = XOR.getOverlappingFaces(t1, t2, RTOL = 0.05, amax = 0.1) +res = XOR.getOverlappingFaces(t1, t2, RTOL=0.05, amax=0.1) # create a list of polygon list (t1), one list per zone @@ -27,7 +27,7 @@ t2 = P.exteriorFaces(t2) t2 = XOR.convertNGON2DToNGON3D(t2) -res = XOR.getOverlappingFaces(t1, t2, RTOL = 0.05, amax = 0.1) +res = XOR.getOverlappingFaces(t1, t2, RTOL=0.05, amax=0.1) t = XOR.agglomerateCellsWithSpecifiedFaces(t1, res[0]) diff --git a/Cassiopee/Intersector/test/intersection_t1.py b/Cassiopee/Intersector/test/intersection_t1.py index e1c71e8b0..d5ca937bf 100755 --- a/Cassiopee/Intersector/test/intersection_t1.py +++ b/Cassiopee/Intersector/test/intersection_t1.py @@ -11,4 +11,3 @@ s2 = C.convertArray2Tetra(s2); s2 = G.close(s2) x = XOR.intersection(s1, s2, tol=0.) test.testA([x],1) - diff --git a/Cassiopee/Intersector/test/prepareCellsSplit.py b/Cassiopee/Intersector/test/prepareCellsSplit.py index 1f86a23bc..ad466256c 100644 --- a/Cassiopee/Intersector/test/prepareCellsSplit.py +++ b/Cassiopee/Intersector/test/prepareCellsSplit.py @@ -12,7 +12,6 @@ m = XOR.booleanMinus(M1, M2, tol, preserve_right=1, solid_right=1, agg_mode=2) #full agg to convexify afterward #C.convertArrays2File([m], 'i.plt') -m = XOR.prepareCellsSplit(m, PH_set = 0, split_policy = 2, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = 1.e-2) +m = XOR.prepareCellsSplit(m, PH_set=0, split_policy=2, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-2) C.convertArrays2File([m], 'out.plt') - diff --git a/Cassiopee/Intersector/test/prepareCellsSplitPT.py b/Cassiopee/Intersector/test/prepareCellsSplitPT.py index 4e4474ab8..6e92bd871 100644 --- a/Cassiopee/Intersector/test/prepareCellsSplitPT.py +++ b/Cassiopee/Intersector/test/prepareCellsSplitPT.py @@ -12,7 +12,6 @@ m = XOR.booleanMinus(M1, M2, tol, preserve_right=1, solid_right=1, agg_mode=2) #full agg to convexify afterward #C.convertArrays2File([m], 'i.plt') -m = XOR.prepareCellsSplit(m, PH_set = 0, split_policy = 2, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = 1.e-2) +m = XOR.prepareCellsSplit(m, PH_set=0, split_policy=2, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-2) C.convertPyTree2File(m, 'out.cgns') - diff --git a/Cassiopee/Intersector/test/prepareCellsSplitPT_t1.py b/Cassiopee/Intersector/test/prepareCellsSplitPT_t1.py index 8bb0d0721..e4745ed73 100644 --- a/Cassiopee/Intersector/test/prepareCellsSplitPT_t1.py +++ b/Cassiopee/Intersector/test/prepareCellsSplitPT_t1.py @@ -17,20 +17,20 @@ PG_threshold = 1.e-2 -m = XOR.prepareCellsSplit(m, PH_set = 0, split_policy = 0, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = PG_threshold) +m = XOR.prepareCellsSplit(m, PH_set=0, split_policy=0, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=PG_threshold) test.testT(m, 1) -m = XOR.prepareCellsSplit(m, PH_set = 0, split_policy = 1, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = PG_threshold) +m = XOR.prepareCellsSplit(m, PH_set=0, split_policy=1, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=PG_threshold) test.testT(m, 2) -m = XOR.prepareCellsSplit(m, PH_set = 0, split_policy = 2, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = PG_threshold) +m = XOR.prepareCellsSplit(m, PH_set=0, split_policy=2, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=PG_threshold) test.testT(m, 3) -m = XOR.prepareCellsSplit(m, PH_set = 1, split_policy = 0, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = PG_threshold) +m = XOR.prepareCellsSplit(m, PH_set=1, split_policy=0, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=PG_threshold) test.testT(m, 4) -m = XOR.prepareCellsSplit(m, PH_set = 1, split_policy = 1, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = PG_threshold) +m = XOR.prepareCellsSplit(m, PH_set=1, split_policy=1, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=PG_threshold) test.testT(m, 5) -m = XOR.prepareCellsSplit(m, PH_set = 1, split_policy = 2, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = PG_threshold) +m = XOR.prepareCellsSplit(m, PH_set=1, split_policy=2, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=PG_threshold) test.testT(m, 6) diff --git a/Cassiopee/Intersector/test/prepareCellsSplit_t1.py b/Cassiopee/Intersector/test/prepareCellsSplit_t1.py index 9e0eec95d..c903503dd 100644 --- a/Cassiopee/Intersector/test/prepareCellsSplit_t1.py +++ b/Cassiopee/Intersector/test/prepareCellsSplit_t1.py @@ -16,20 +16,20 @@ PG_threshold = 1.e-2 -m = XOR.prepareCellsSplit(m, PH_set = 0, split_policy = 0, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = PG_threshold) +m = XOR.prepareCellsSplit(m, PH_set=0, split_policy=0, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=PG_threshold) test.testA([m],1) -m = XOR.prepareCellsSplit(m, PH_set = 0, split_policy = 1, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = PG_threshold) +m = XOR.prepareCellsSplit(m, PH_set=0, split_policy=1, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=PG_threshold) test.testA([m],2) -m = XOR.prepareCellsSplit(m, PH_set = 0, split_policy = 2, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = PG_threshold) +m = XOR.prepareCellsSplit(m, PH_set=0, split_policy=2, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=PG_threshold) test.testA([m],3) -m = XOR.prepareCellsSplit(m, PH_set = 1, split_policy = 0, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = PG_threshold) +m = XOR.prepareCellsSplit(m, PH_set=1, split_policy=0, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=PG_threshold) test.testA([m],4) -m = XOR.prepareCellsSplit(m, PH_set = 1, split_policy = 1, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = PG_threshold) +m = XOR.prepareCellsSplit(m, PH_set=1, split_policy=1, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=PG_threshold) test.testA([m],5) -m = XOR.prepareCellsSplit(m, PH_set = 1, split_policy = 2, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = PG_threshold) +m = XOR.prepareCellsSplit(m, PH_set=1, split_policy=2, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=PG_threshold) test.testA([m],6) diff --git a/Cassiopee/Intersector/test/simplifyCells.py b/Cassiopee/Intersector/test/simplifyCells.py index 8f37772f4..f2558a70b 100644 --- a/Cassiopee/Intersector/test/simplifyCells.py +++ b/Cassiopee/Intersector/test/simplifyCells.py @@ -16,4 +16,3 @@ m = XOR.simplifyCells(m, 1) C.convertArrays2File([m], 'out.plt') - diff --git a/Cassiopee/Intersector/test/simplifyCellsPT.py b/Cassiopee/Intersector/test/simplifyCellsPT.py index 5908988a6..0c41b85fe 100644 --- a/Cassiopee/Intersector/test/simplifyCellsPT.py +++ b/Cassiopee/Intersector/test/simplifyCellsPT.py @@ -15,4 +15,3 @@ m = XOR.simplifyCells(m, 1) C.convertPyTree2File(m, 'out.cgns') - diff --git a/Cassiopee/Intersector/test/simplifyCells_t1.py b/Cassiopee/Intersector/test/simplifyCells_t1.py index 3b6a04533..49bcd9950 100644 --- a/Cassiopee/Intersector/test/simplifyCells_t1.py +++ b/Cassiopee/Intersector/test/simplifyCells_t1.py @@ -17,4 +17,3 @@ m = XOR.simplifyCells(m, 1) test.testA([m],1) - diff --git a/Cassiopee/Intersector/test/splitCells.py b/Cassiopee/Intersector/test/splitCells.py index d841173a5..087b543dc 100644 --- a/Cassiopee/Intersector/test/splitCells.py +++ b/Cassiopee/Intersector/test/splitCells.py @@ -13,8 +13,7 @@ m = XOR.booleanMinus(M1, M2, tol, preserve_right=1, solid_right=1, agg_mode=1) m = XOR.simplifyCells(m, 1) -m = XOR.prepareCellsSplit(m, PH_set = 0, split_policy = 0, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = 1.e-8) -m= XOR.splitNonStarCells(m, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = 1.e-8) +m = XOR.prepareCellsSplit(m, PH_set=0, split_policy=0, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-8) +m= XOR.splitNonStarCells(m, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-8) C.convertArrays2File([m], 'out.plt') - diff --git a/Cassiopee/Intersector/test/splitCellsPT.py b/Cassiopee/Intersector/test/splitCellsPT.py index 0d3955d76..110e0df67 100644 --- a/Cassiopee/Intersector/test/splitCellsPT.py +++ b/Cassiopee/Intersector/test/splitCellsPT.py @@ -13,8 +13,7 @@ m = XOR.booleanMinus(M1, M2, tol, preserve_right=1, solid_right=1, agg_mode=1) m = XOR.simplifyCells(m, 1) -m = XOR.prepareCellsSplit(m, PH_set = 0, split_policy = 0, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = 1.e-8) -m= XOR.splitNonStarCells(m, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = 1.e-8) +m = XOR.prepareCellsSplit(m, PH_set=0, split_policy=0, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-8) +m= XOR.splitNonStarCells(m, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-8) C.convertPyTree2File(m, 'out.cgns') - diff --git a/Cassiopee/Intersector/test/splitCellsPT_t1.py b/Cassiopee/Intersector/test/splitCellsPT_t1.py index dd3c004c0..aed1d5d59 100644 --- a/Cassiopee/Intersector/test/splitCellsPT_t1.py +++ b/Cassiopee/Intersector/test/splitCellsPT_t1.py @@ -14,7 +14,7 @@ m = XOR.booleanMinus(M1, M2, tol, preserve_right=1, solid_right=1, agg_mode=1) m = XOR.simplifyCells(m, 1) -m = XOR.prepareCellsSplit(m, PH_set = 0, split_policy = 0, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = 1.e-8) -m= XOR.splitNonStarCells(m, PH_conc_threshold = 1./3., PH_cvx_threshold = 0.05, PG_cvx_threshold = 1.e-8) +m = XOR.prepareCellsSplit(m, PH_set=0, split_policy=0, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-8) +m= XOR.splitNonStarCells(m, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-8) test.testT(m, 1) diff --git a/Cassiopee/Intersector/test/splitCells_t1.py b/Cassiopee/Intersector/test/splitCells_t1.py index c43b92aa3..a797f6196 100644 --- a/Cassiopee/Intersector/test/splitCells_t1.py +++ b/Cassiopee/Intersector/test/splitCells_t1.py @@ -18,4 +18,3 @@ m = XOR.splitNonStarCells(m, PH_conc_threshold=1./3., PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-8) test.testA([m],1) - diff --git a/Cassiopee/Intersector/test/syncPerioFacesPT.py b/Cassiopee/Intersector/test/syncPerioFacesPT.py index 6f4aed68a..2f16d1b39 100644 --- a/Cassiopee/Intersector/test/syncPerioFacesPT.py +++ b/Cassiopee/Intersector/test/syncPerioFacesPT.py @@ -1,6 +1,6 @@ # - concatenate (PyTree) - -import Converter.PyTree as C +import Converter.PyTree as C import Generator.PyTree as G import Connector.PyTree as X import Transform.PyTree as T @@ -33,5 +33,3 @@ a = X.connectMatchPeriodic(a, translation=[0.,0.,9.]) C.convertPyTree2File(a, 'out.cgns') - - diff --git a/Cassiopee/Intersector/test/syncPerioFacesPT_t1.py b/Cassiopee/Intersector/test/syncPerioFacesPT_t1.py index c13c9113b..41f19174e 100644 --- a/Cassiopee/Intersector/test/syncPerioFacesPT_t1.py +++ b/Cassiopee/Intersector/test/syncPerioFacesPT_t1.py @@ -1,6 +1,6 @@ # - concatenate (PyTree) - -import Converter.PyTree as C +import Converter.PyTree as C import Generator.PyTree as G import Connector.PyTree as X import Transform.PyTree as T @@ -12,7 +12,7 @@ # ---------------------------------------------------------------- # TEST 1 # ---------------------------------------------------------------- -# Maillages +# Maillages a = G.cartHexa((0.,0.,0.), (1.,1.,1.), (10,10,10)) a = C.convertArray2NGon(a) @@ -40,5 +40,3 @@ #C.convertPyTree2File(a, 'out.cgns') test.testT(a, 1) - - diff --git a/Cassiopee/Intersector/test/t1.py b/Cassiopee/Intersector/test/t1.py index 23622e91b..d4534bf5f 100644 --- a/Cassiopee/Intersector/test/t1.py +++ b/Cassiopee/Intersector/test/t1.py @@ -1,3 +1,3 @@ # Intersector installation test import KCore.Dist as Dist -Dist.checkModuleImport('Intersector') +Dist.checkModuleImport('Intersector') diff --git a/Cassiopee/Intersector/test/triangulateExteriorFaces.py b/Cassiopee/Intersector/test/triangulateExteriorFaces.py index 160c395b5..0d4067556 100644 --- a/Cassiopee/Intersector/test/triangulateExteriorFaces.py +++ b/Cassiopee/Intersector/test/triangulateExteriorFaces.py @@ -7,4 +7,3 @@ m = XOR.triangulateExteriorFaces(m) C.convertArrays2File([m], 'out.plt') - diff --git a/Cassiopee/Intersector/test/xcellnSph6PT_t1.py b/Cassiopee/Intersector/test/xcellnSph6PT_t1.py index 538a44d80..59d8caa41 100644 --- a/Cassiopee/Intersector/test/xcellnSph6PT_t1.py +++ b/Cassiopee/Intersector/test/xcellnSph6PT_t1.py @@ -27,4 +27,3 @@ t3 = XOR.XcellN(t, [(1,0)], output_type=2) test.testT(t3,6) #C.convertPyTree2File(t3, "Sph612_0.cgns") - diff --git a/Cassiopee/Intersector/test/xcellnSphYinYangPT.py b/Cassiopee/Intersector/test/xcellnSphYinYangPT.py index 9611859f3..c24485030 100755 --- a/Cassiopee/Intersector/test/xcellnSphYinYangPT.py +++ b/Cassiopee/Intersector/test/xcellnSphYinYangPT.py @@ -14,4 +14,3 @@ XOR._XcellN(t, priorities, output_type=2) C.convertPyTree2File(t, "out.cgns") - diff --git a/Cassiopee/KCore/Dist.py b/Cassiopee/KCore/Dist.py index 811f76d91..a5d7f6a99 100644 --- a/Cassiopee/KCore/Dist.py +++ b/Cassiopee/KCore/Dist.py @@ -136,7 +136,7 @@ def checkAll(summary=True): else: out += ['mpi4py: missing (%s).'%(mpi4pyIncDir)] if useCuda: - (ok, cudaIncDir, cudaLib, cudaBin) = checkCuda(additionalLibPaths, additionalIncludePaths) + (ok, cudaIncDir, cudaLib, cudaBin) = checkCuda(additionalLibPaths, additionalIncludePaths) if ok: out += ['cuda: used (%s)'%(cudaIncDir)] else: out += ['cuda: missing. Not used (%s).'%(cudaIncDir)] if summary: @@ -200,7 +200,7 @@ def getInstallPath(prefix): #pythonLib = paths.split('/') #pythonVersion = pythonLib[-2] #Site = pythonLib[-1] - #Lib = pythonLib[-3] + #Lib = pythonLib[-3] #installPath = '%s/%s/%s/%s'%(prefix, Lib, pythonVersion, Site) # Based on distutils (to be su) @@ -225,7 +225,7 @@ def getInstallPath(prefix): pythonLib = distutils.sysconfig.get_python_lib() pythonLib = pythonLib.split('/') pythonVersion = pythonLib[-2] - installPath = prefix + '/lib/python'+pythonVersion+'/site-packages' + installPath = prefix + '/lib/python'+pythonVersion+'/site-packages' else: # standard unix pythonLib = distutils.sysconfig.get_python_lib() pythonLib = pythonLib.split('/') @@ -241,14 +241,14 @@ def getInstallPath(prefix): #============================================================================== # Functions returning the names of the remote repo & branch and the commit hash -#============================================================================== -def getGitOrigin(cassiopeeIncDir): +#============================================================================== +def getGitOrigin(cassiopeeIncDir): mySystem = getSystem()[0] if mySystem == 'mingw' or mySystem == 'Windows': lpath = cassiopeeIncDir.replace('/', '\\') cmd = "cd {} && git config --get remote.origin.url".format(lpath) - else: # unix - lpath = cassiopeeIncDir + else: # unix + lpath = cassiopeeIncDir cmd = "cd {}; git config --get remote.origin.url 2>/dev/null".format(lpath) try: origin = subprocess.check_output(cmd, shell=True) @@ -261,7 +261,7 @@ def getGitBranch(cassiopeeIncDir): lpath = cassiopeeIncDir.replace('/', '\\') cmd = "cd {} && git rev-parse --abbrev-ref HEAD".format(lpath) else: # unix - lpath = cassiopeeIncDir + lpath = cassiopeeIncDir cmd = "cd {}; git rev-parse --abbrev-ref HEAD 2>/dev/null".format(lpath) try: branchName = subprocess.check_output(cmd, shell=True) @@ -273,8 +273,8 @@ def getGitHash(cassiopeeIncDir): if mySystem == 'mingw' or mySystem == 'Windows': lpath = cassiopeeIncDir.replace('/', '\\') cmd = "cd {} && git rev-parse --short HEAD".format(lpath) - else: # unix - lpath = cassiopeeIncDir + else: # unix + lpath = cassiopeeIncDir cmd = "cd {}; git rev-parse --short HEAD 2>/dev/null".format(lpath) try: sha = subprocess.check_output(cmd, shell=True) @@ -483,7 +483,7 @@ def writeSetupCfg(): elif Cppcompiler == 'cc' or Cppcompiler == 'cc': p = open("./setup.cfg", 'w') p.write('[build_ext]\ncompiler=unix\n') - p.close() + p.close() else: p = open("./setup.cfg", 'w') p.write('[build_ext]\ncompiler=%s\n'%Cppcompiler) @@ -498,7 +498,7 @@ def getDistUtilsCompilers(): 'BASECFLAGS', 'CCSHARED', 'LDSHARED', 'SO') for i, v in enumerate(vars): - if v is None: vars[i] = "" + if v is None: vars[i] = "" try: from KCore.config import Cppcompiler except: from config import Cppcompiler @@ -893,7 +893,7 @@ def getCArgs(): options += getSimdOptions() return options elif Cppcompiler.find("gcc") == 0 or Cppcompiler.find("g++") == 0: - if DEBUG: + if DEBUG: options += ['-g', '-O0', '-Wall', '-pedantic', '-D_GLIBCXX_DEBUG_PEDANTIC'] options += ['-ggdb', '-fsanitize=address'] if mySystem[0] == 'mingw': options.remove('-fsanitize=address') # no asan on mingw @@ -1534,12 +1534,12 @@ def checkOCE(additionalLibPaths=[], additionalIncludePaths=[]): l = checkLibFile__('libTKernel.dll.a', additionalLibPaths) i = checkIncFile__('oce/TopTools.hxx', additionalIncludePaths) if i is not None: i = i+'/oce' - if i is None: + if i is None: i = checkIncFile__('opencascade/TopTools.hxx', additionalIncludePaths) if i is not None: i = i+'/opencascade' if i is not None and l is not None: print('Info: libOCE detected at %s.'%l) - return (True, i, l) + return (True, i, l) else: # On n'affiche pas ici le message, car il peut y avoir un installation locale de OCE #print('Info: libOCE or oce/*.hxx was not found on your system. No IGES/STEP support.') @@ -1621,7 +1621,7 @@ def checkAdf(additionalLibPaths=[], additionalIncludePaths=[]): #============================================================================= # Check for Hdf # additionalPaths: chemins d'installation non standards : ['/home/toto',...] -# Retourne: (True/False, chemin des includes, chemin de la librairie, +# Retourne: (True/False, chemin des includes, chemin de la librairie, # liste des noms des libs) #============================================================================= def checkHdf(additionalLibPaths=[], additionalIncludePaths=[]): @@ -1664,7 +1664,7 @@ def checkMpi(additionalLibPaths=[], additionalIncludePaths=[]): libnames = [] l = checkLibFile__('libmpi.so', additionalLibPaths) if l is not None: libnames.append('mpi') - if l is None: + if l is None: l = checkLibFile__('libmpi.a', additionalLibPaths) if l is not None: libnames.append('mpi') if l is None: @@ -1747,9 +1747,9 @@ def checkCuda(additionalLibPaths=[], additionalIncludePaths=[]): has_nvcc = os.access(cuda_root+"/bin/nvcc", os.F_OK) nvcc_exec = None if not has_nvcc and not has_nvcc_exe : - print('Info: nvcc not found at %s/bin. No cuda support.'%cuda_root) + print('Info: nvcc not found at %s/bin. No cuda support.'%cuda_root) return (False, None, None, None, None) - elif has_nvcc: nvcc_exec = cuda_root+"/bin/nvcc" + elif has_nvcc: nvcc_exec = cuda_root+"/bin/nvcc" else: nvcc_exec = cuda_root+"/bin/nvcc.exe" # Check for library : @@ -1819,7 +1819,7 @@ def checkParadigma(additionalLibPaths=[], additionalIncludePaths=[]): #============================================================================= # Check for BLAS # additionalPaths: chemins d'installation non standards: ['/home/toto',...] -# Retourne: (True/False, chemin des includes, chemin de la librairie, +# Retourne: (True/False, chemin des includes, chemin de la librairie, # option de compile, nom de la librarie) #============================================================================= def checkBlas(additionalLibPaths=[], additionalIncludePaths=[]): @@ -1874,7 +1874,7 @@ def checkBlas(additionalLibPaths=[], additionalIncludePaths=[]): #============================================================================= # Check for LAPACK # additionalPaths: chemins d'installation non standards : ['/home/toto',...] -# Retourne: (True/False, chemin des includes, chemin de la librairie, +# Retourne: (True/False, chemin des includes, chemin de la librairie, # option de compile, nom de la librarie) #============================================================================= def checkLapack(additionalLibPaths=[], additionalIncludePaths=[]): @@ -2362,9 +2362,9 @@ def checkIncFile__(file, additionalIncludePaths): if p1 is not None: pp += p1.split(';') elif mySystem[0] == 'mingw': p1 = env.get('PATH', None) - if p1 is not None: + if p1 is not None: pp += p1.split(';') - else: # unix + else: # unix p1 = env.get('LD_LIBRARY_PATH', None) if p1 is not None: pp += p1.split(':') p1 = env.get('PATH', None) @@ -2422,7 +2422,7 @@ def writeBuildInfo(): # Check ffmpeg (mpeg, mpegIncDir, mpegLib) = checkMpeg(config.additionalLibPaths, - config.additionalIncludePaths) + config.additionalIncludePaths) if mpeg: dict['mpeg'] = mpegLib else: dict['mpeg'] = "None" @@ -2434,15 +2434,15 @@ def writeBuildInfo(): # Check mpi (mpi, mpiIncDir, mpiLib, mpiLibs) = checkMpi(config.additionalLibPaths, - config.additionalIncludePaths) + config.additionalIncludePaths) if mpi: dict['mpi'] = mpiLib else: dict['mpi'] = "None" # Check cuda (cuda, cudaIndDir, cudaLib, cudalibNames, cudaexec) = checkCuda(config.additionalLibPaths, - config.additionalIncludePaths) + config.additionalIncludePaths) if cuda: dict['cuda'] = cudaLib - else: dict['cuda'] = "None" + else: dict['cuda'] = "None" # Write dictionnary p.write("# This file is generated by Cassiopee installer.\n") @@ -2538,12 +2538,12 @@ def createExtensions(module, srcs, includeDirs, libraryDirs, libraries, minor = module.lower() # C/Api module Extension(module+'.'+minor, - sources=[module+'/'+minor+'.cpp'], - include_dirs=[module]+includeDirs, - library_dirs=libraryDirs, - libraries=libraries, - extra_compile_args=extraCompileArgs, - extra_link_args=extraLinkArgs) + sources=[module+'/'+minor+'.cpp'], + include_dirs=[module]+includeDirs, + library_dirs=libraryDirs, + libraries=libraries, + extra_compile_args=extraCompileArgs, + extra_link_args=extraLinkArgs) # Cython extensions try: pyx_srcs = srcs.pyx_srcs except: pyx_srcs = [] @@ -2590,7 +2590,7 @@ def createFortranBuilder(env, dirs=[], additionalPPArgs='', additionalFortranArg env.Append(BUILDERS={'FPROC': bld}) # Fortran compiler fortran_builder = Builder(action='$FORTRANCOM', - suffix='.o', src_suffix='.f') + suffix='.o', src_suffix='.f') env.Append(BUILDERS={'Fortran': fortran_builder}) env.Replace(FORTRANCOM='$FORTRAN $FORTRANFLAGS -c -o $TARGET $SOURCE') env.Replace(FORTRANSUFFIXES=['.f', '.F', '.f90', '.F90']) @@ -2732,7 +2732,7 @@ def addCommonNvccVariables(env): env['_NVCCCOMCOM'] = '$_NVCCWRAPCPPPATH' return env -def createCudaBuilders(env, dirs = []): +def createCudaBuilders(env, dirs=[]): import SCons # create a builder that makes PTX files from .cu files (ok, incCuda, libCude, libNameCuda, binCuda) = checkCuda() @@ -2744,10 +2744,10 @@ def createCudaBuilders(env, dirs = []): #for o in opts : # action_cuda += o + " " action_cuda += path + '$NVCCFLAGS $_NVCCCOMCOM $SOURCES -o $TARGET' - ptx_builder = SCons.Builder.Builder(action = action_cuda, - emitter = {}, - suffix = '.ptx', - src_suffix = ['.cu']) + ptx_builder = SCons.Builder.Builder(action=action_cuda, + emitter={}, + suffix='.ptx', + src_suffix=['.cu']) env['BUILDERS']['PTXFile'] = ptx_builder # create builders that make static & shared objects from .cu files @@ -2814,9 +2814,9 @@ def cythonScan(node, env, path, arg=None): # scan file to extract all possible cimports. contents = node.get_text_contents() names = [reo.findall(contents) for reo in [ - re.compile(r'^\s*from\s+(.+?)\s+cimport\s.*$', re.M), - re.compile(r'^\s*cimport\s+(.+?)$', re.M), - ]] + re.compile(r'^\s*from\s+(.+?)\s+cimport\s.*$', re.M), + re.compile(r'^\s*cimport\s+(.+?)$', re.M), + ]] names = itertools.chain(*names) # keep characters before " as ". names = [name.split(' as ')[0] for name in names] @@ -2880,7 +2880,7 @@ def createStaticLibrary(env, ppf, parentFolder, moduleName): staticLib = env.StaticLibrary(ppf) return staticLib -def copyBuiltFiles(env, staticLib, moduleName, installPath): +def copyBuiltFiles(env, staticLib, moduleName, installPath): # Copy built files and python files to the install folder modDir = os.path.join(installPath, moduleName) dp1 = env.Install(modDir, staticLib) diff --git a/Cassiopee/KCore/KCore/Adim.py b/Cassiopee/KCore/KCore/Adim.py index b03db037d..288e17e63 100644 --- a/Cassiopee/KCore/KCore/Adim.py +++ b/Cassiopee/KCore/KCore/Adim.py @@ -25,7 +25,7 @@ def adim1(MInf=0.5, alphaZ=0., alphaY=0., ReInf=1.e8, MutSMuInf=0.2, DCs = 110.4 # Cs air (dimensionne) DTs = 288.15 # Temperature de reference dans Sutherland (dimensionne) DTInf = DTs # On choisit que l'etat de reference de sutherland - # soit la temperature a l'infini + # soit la temperature a l'infini DMus = 1.78938e-5 # Mu dimensionne a la temperature de reference DMuInf = DMus # toujours identification des grandeurs de reference et infini @@ -95,7 +95,7 @@ def adim2(MInf=0.5, alphaZ=0., alphaY=0., ReInf=1.e8, MutSMuInf=0.2, DCs = 110.4 # Cs air (dimensionne) DTs = 288.15 # Temperature de reference dans Sutherland (dimensionne) DTInf = DTs # On choisit que l'etat de reference de sutherland - # soit la temperature a l'infini + # soit la temperature a l'infini DMus = 1.78938e-5 # Mu dimensionne a la temperature de reference DMuInf = DMus # toujours identification des grandeurs de reference et infini @@ -164,7 +164,7 @@ def adim3(MInf=0.5, alphaZ=0., alphaY=0., ReInf=1.e8, LInf=1., MutSMuInf=0.2, DCs = 110.4 # Cs air (dimensionne) DTs = 288.15 # Temperature de reference dans Sutherland (dimensionne) DTInf = DTs # On choisit que l'etat de reference de sutherland - # soit la temperature a l'infini + # soit la temperature a l'infini DMus = 1.78938e-5 # Mu dimensionne a la temperature de reference DMuInf = DMus # toujours identification des grandeurs de reference et infini @@ -392,7 +392,7 @@ def dim4(UInf=2.7777, TInf=298.15, PInf=101325., LInf=1., # si Mtip existe, les grandeurs visqueuses et turbulentes # sont prises par rapport a Mtip - if Mtip is not None: UInf = Mtip*aInf + if Mtip is not None: UInf = Mtip*aInf ReInf = UInf*LInf/NuInf diff --git a/Cassiopee/KCore/KCore/Vector.py b/Cassiopee/KCore/KCore/Vector.py index b6d714e9d..2e7f29c4c 100644 --- a/Cassiopee/KCore/KCore/Vector.py +++ b/Cassiopee/KCore/KCore/Vector.py @@ -62,7 +62,7 @@ def dist(p1, p2): dz = p1[2]-p2[2] return math.sqrt(dx*dx+dy*dy+dz*dz) -# the matrix is given by lines +# the matrix is given by lines def matprod(m, v): """Matrix-vector product.""" [l1,l2,l3] = m # get each line of matrix diff --git a/Cassiopee/KCore/KCore/test.py b/Cassiopee/KCore/KCore/test.py index 1c3161893..4efa4aaad 100644 --- a/Cassiopee/KCore/KCore/test.py +++ b/Cassiopee/KCore/KCore/test.py @@ -66,7 +66,7 @@ def testA(arrays, number=1): 'identifyNodes failed, topological diff performed ' 'instead.') ret = C.diffArrays(arrays, old) - else: + else: print("Warning: missing coordinates for geometrical diff., " "topological diff performed instead.") ret = C.diffArrays(arrays, old) @@ -230,7 +230,7 @@ def checkObject_(objet, refObjet, reference): if isinstance(refObjet, bool): if refObjet != objet: print("DIFF: object value differs from %s (diff=%g,%g)."%(reference, objet, refObjet)) - return False + return False elif isinstance(refObjet, (int, numpy.int32, numpy.int64, numpy.intc)): diff = abs(refObjet-objet) if diff > 0: @@ -465,7 +465,7 @@ def checkTree__(node1, node2): # print('DIFF: valeurs differentes pour le noeud: %s.'%node1[0]) # delta = numpy.max(numpy.abs(val1 -val2)) # print('DIFF: ', delta) - # return 0 + # return 0 return 1 #============================================================================== @@ -509,7 +509,7 @@ def checkType__(a): if isinstance(b[0], str) and (len(b) == 4 or len(b) == 5): return 1 else: return 2 - else: return 2 + else: return 2 #============================================================================== # IN: output=1: ecrit les fichiers resultats @@ -587,7 +587,7 @@ def stdTest1__(output, memory, heavy, F, *keywords): coverage += 1 except TypeError: if output == 1: print('STRUCT3D: uncovered.') - except: print('%s: Structure 3D: fails.'%testName); raise + except: print('%s: Structure 3D: fails.'%testName); raise # 4- BAR try: @@ -866,7 +866,7 @@ def stdTestT__(output, F, *keywords): if res != -2: testT(b, 1) else: testO(b, 1) coverage += 1 - except TypeError: pass # + except TypeError: pass # except: print('%s: One zone: fails.'%testName); raise # 2- Une liste de zones diff --git a/Cassiopee/KCore/doc/source/conf.py b/Cassiopee/KCore/doc/source/conf.py index 949c447b6..f39ad34c9 100644 --- a/Cassiopee/KCore/doc/source/conf.py +++ b/Cassiopee/KCore/doc/source/conf.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Cassiopee documentation +# Cassiopee documentation import sys import os @@ -188,22 +188,22 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', + # Additional stuff for the LaTeX preamble. + #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('index', 'Cassiopee.tex', u'Cassiopee Documentation', - u'/ELSA/MU-10019/V'+__version__, 'manual'), + ('index', 'Cassiopee.tex', u'Cassiopee Documentation', + u'/ELSA/MU-10019/V'+__version__, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -246,9 +246,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Cassiopee', u'Cassiopee Documentation', - u'ONERA', 'Cassiopee', 'One line description of project.', - 'Miscellaneous'), + ('index', 'Cassiopee', u'Cassiopee Documentation', + u'ONERA', 'Cassiopee', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/KCore/installBase.py b/Cassiopee/KCore/installBase.py index f9ce4d66f..37bf2dba2 100644 --- a/Cassiopee/KCore/installBase.py +++ b/Cassiopee/KCore/installBase.py @@ -6,1315 +6,1315 @@ # Paths are list of strings. useOMP, static, useCuda are booleans. # Others are strings. installDict = { -############################################################################### -'DESKTOP...': [ 'Windows ubuntu', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/usr/include/mpi', '/usr/include/hdf5/serial'], # additionalIncludePaths -['gfortran', 'gomp', 'pthread'], # additionalLibs -['/usr/lib/x86_64-linux-gnu','/usr/lib/x86_64-linux-gnu/hdf5/serial/'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'WDSNA81OZ': [ 'Machine de production win32 (Onera)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['c:/MinGW/include'], # additionalIncludePaths -['gfortran', 'gomp', 'pthread'], # additionalLibs -['c:/MinGW/lib', 'c:/Python27/libs', 'c:/MinGW/bin'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'WDAAA728Z': [ 'Windows win64+msys2 (XJ-Onera)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -['-D__SHADERS__', '-isystem /d/juvigny/msys64/mingw64/include/python3.8', '-isystem /d/juvigny/msys64/mingw64/lib/python3.8/site-packages/numpy/core/include/numpy/'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['d:/juvigny/msys64/mingw64/include',"d:/juvigny/msys64/mingw64/include/OpenBLAS"], # additionalIncludePaths -['gfortran', 'gomp', 'pthread', 'openblas', 'psapi'], # additionalLibs -['d:/juvigny/msys64/mingw64/lib', 'd:/juvigny/msys64/mingw64/bin'], # additionalLibPaths -True, # useCuda -['-arch=sm_60'] # NvccAdditionalOptions -], -############################################################################### -'Aryen': [ 'Windows win64+msys2 (CB-Home)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -['-Wno-attributes', '-DSIMD=AVX2'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['c:/msys64/mingw64/include'], # additionalIncludePaths -['gomp', 'gfortran'], # additionalLibs -['c:/msys64/mingw64/lib'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'msys64': [ 'Windows win64+msys2 (CB-Onera/Github)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -['-Wno-attributes', '-DSIMD=AVX2'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['d:/benoit/AppData/Local/msys2/mingw64/include', 'c:/Program Files (x86)/Microsoft SDKs/MPI/Include', 'd:/benoit/AppData/Local/msys2/mingw64/include/OpenBLAS'], # additionalIncludePaths -['gomp', 'gfortran'], # additionalLibs -['d:/benoit/AppData/Local/msys2/mingw64/lib', 'c:/Program Files (x86)/Microsoft SDKs/MPI/Lib/x64'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'WDAAA161Z': [ 'Windows win64+msys2 (CB-Onera)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -['-Wno-attributes', '-fcommon'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -["c:/Users/benoit/msys64/mingw64/include"], # additionalIncludePaths -['gomp', 'gfortran'], # additionalLibs -["c:/Users/benoit/msys64/mingw64/lib"], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'node6.cluster': [ 'MacOSX (generic)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/usr/X11/include' ], # additionalIncludePaths -['python2.7', 'ifcore'], # additionalLibs -['/usr/X11/lib', '/System/Library/Frameworks/OpenGL.framework/Libraries/'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'d1log1':[ 'Cluster HPC4B dev/val (Airbus)', -'ifort', # f77compiler -'ifort', # f90compiler -'icpc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/opt/hpmpi/include', '/opt/soft/cdtng/tools/portage/1.11/usr/include'], # additionalIncludePaths -['svml', 'irc', 'ifcore', 'iomp5'], # additionalLibs -['/opt/soft/cdtng/tools/intelcompiler/16.0/compiler/lib/intel64', '/opt/soft/cdtng/tools/portage/1.11/usr/lib', '/opt/hpmpi/lib/linux_amd64'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'devt1n007.':[ 'Cluster HPC5 dev/val tou_b (Airbus)', -'ifort', # f77compiler -'ifort', # f90compiler -'icpc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/opt/mpi10/include', '/opt/soft/cdtng/tools/portage/1.11/usr/include'], # additionalIncludePaths -['ifcore', 'iomp5', 'svml', 'irc'], # additionalLibs -['/opt/soft/cdtng/tools/intelcompiler/2018/compilers_and_libraries_2018.5.274/linux/compiler/lib/intel64', '/opt/soft/cdtng/tools/portage/1.11/usr/lib', '/opt/mpi10/lib'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'caefr0p...': [ 'Cluster GISEH (Airbus)', -'ifort', # f77compiler -'ifort', # f90compiler -'icpc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/opt/soft/cdtng/tools/portage/1.11/usr/include'], # additionalIncludePaths -['svml', 'irc', 'ifcore', 'iomp5'], # additionalLibs -['/opt/soft/cdtng/tools/portage/1.11/composerxe/lib/intel64', '/opt/soft/cdtng/tools/portage/1.11/usr/lib'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'AA': [ 'Cluster AA', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=16'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/soft/intel-2017.5/compilers_and_libraries_2017.5.239/linux/mpi/include64','/home/mtaplaf/Environnement_Commun/Elsa/LIB_EXT/HDF5/hdf5-1.8.18-par/include'], # additionalIncludePaths -['mpi'], # additionalLibs -['/soft/intel-2017.5/compilers_and_libraries_2017.5.239/linux/mpi/lib64','/home/mtaplaf/Environnement_Commun/Elsa/LIB_EXT/HDF5/hdf5-1.8.18-par/lib'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'AA2': [ 'Machine AA2', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=16'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/soft/intel-2017.5/compilers_and_libraries_2017.5.239/linux/mpi/include64','/home/mtaplaf/Environnement_Commun/Elsa/LIB_EXT/HDF5/hdf5-1.8.18-par/include'], # additionalIncludePaths -['mpi'], # additionalLibs -['/soft/intel-2017.5/compilers_and_libraries_2017.5.239/linux/mpi/lib64','/home/mtaplaf/Environnement_Commun/Elsa/LIB_EXT/HDF5/hdf5-1.8.18-par/lib'], # additionalLibpaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'wfrontend1': [ 'Cluster Kairos (Safran)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -False, # useOMP -False, # static -['/appl/APPLI_SNECMA/HDF5/oper/1.8.11/include'], # additionalIncludePaths -['ifcore', 'svml', 'irc'], # additionalLibs -['/opt/intel/composer_xe_2013_sp1.0.080/lib/intel64', '/appl/APPLI_SNECMA/HDF5/oper/1.8.11/lib'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'santafe': [ 'MacOSX - santafe (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/usr/X11/include' ], # additionalIncludePaths -['python2.7', 'ifcore'], # additionalLibs -['/usr/X11/lib', '/System/Library/Frameworks/OpenGL.framework/Libraries/'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'daapuv': [ 'Machine DAAP (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/usr/local/hdf5-1.8.7/include'], # additionalIncludePaths -[], # additionalLibs -['/usr/local/hdf5-1.8.7/lib'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'celeste': [ 'Grosse machine de post-traitement (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -['Xxf86vm'], # additionalLibs -[], # additionalLibPath -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'oneroa142': [ 'Machine dev (Onera)', -'/opt/intel/fc/9.1.036/bin/ifort', # f77compiler -'/opt/intel/fc/9.1.036/bin/ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'linux64': [ 'Production linux64 (generic)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/stck1/benoit/include'], # additionalIncludePaths -[], # additionalLibs -['/stck1/benoit/lib'], # additionqlLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'eos814_r8': [ 'Poste grand calcul Onera-ld (Onera) avec Centos8', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -['-DCACHELINE=32','-DNB_SOCKET=1'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'eos8': [ 'Poste grand calcul Onera-ld (Onera) avec Centos8', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=32','-DNB_SOCKET=1'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'eos...z': [ 'Poste grand calcul eosXXXz (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/usr/local/hdf5-gnu-1.8.8/include'], # additionalIncludePaths -[], # additionalLibs -['/usr/local/hdf5-gnu-1.8.8/lib'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'eos...': [ 'Onera-eos (legacy-doit etre apres eosZ)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'ld...': [ 'Poste grand calcul Onera-ld (Onera)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -['-DCACHELINE=32','-DNB_SOCKET=1'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'tiamat': [ 'Machine de dev elsA (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=16','-DNB_SOCKET=1','-DCORE_PER_SOCK=6'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/home/benoit/x86_64t/include'], # additionalIncludePaths -[], # additionalLibs -['/home/benoit/x86_64t'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'austri.onera': [ 'Cluster dev austri (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=12','-DSIMD=AVX2'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/home/benoit/aus/include'], # additionalIncludePaths -[], # additionalLibs -['/home/benoit/aus/lib'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'rosetta-ws': [ 'Machine rosetta (Safran)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=16'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/softs/intel/compilers_and_libraries_2016.0.109/linux/mpi/intel64/include'], # additionalIncludePaths -[], # additionalLibs -['/softs/intel/compilers_and_libraries_2016.0.109/linux/mpi/intel64/lib'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'rosetta-compute': [ 'Machine rosetta-calcul (Safran)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=32'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/softs/intel/compilers_and_libraries_2016.0.109/linux/mpi/intel64/include'], # additionalIncludePaths -[], # additionalLibs -['/softs/intel/compilers_and_libraries_2016.0.109/linux/mpi/intel64/lib'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'westri': [ 'Machine westri-KNL (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=64','-DNB_SOCKET=1','-DCORE_PER_SOCK=64','-g','-DSIMD=MIC'], # CppAdditionalOptions -['-g'], # f77AdditionalOptions -True, # useOMP -False, # static -['/usr/local/hdf5-1.8.8-intel-16/include','/home/benoit/aus/include','/stck/nalferez/intel/parallel_studio_xe_2018/compilers_and_libraries_2018/linux/mpi/include64/','/stck/nalferez/intel/parallel_studio_xe_2018/vtune_amplifier_2018/include/','/stck/nalferez/intel/parallel_studio_xe_2018/advisor_2018/include/intel64'], # additionalIncludePaths -[], # additionalLibs -['/home/benoit/aus/lib','/stck/nalferez/intel/parallel_studio_xe_2018/compilers_and_libraries_2018/linux/mpi/lib64/','/stck/nalferez/intel/parallel_studio_xe_2018/compilers_and_libraries_2018/lib64/','/usr/local/hdf5-1.8.8-intel-16/lib/','/stck/nalferez/intel/parallel_studio_xe_2018/advisor_2018/lib64'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'giulia': [ 'Machine dev elsA-ASO (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -["/tmp_opt/lib/hdf5-1.8.8-intel-16-impi/include", -"/usr/local/intel/studio/2016/compilers_and_libraries_2016.0.109/linux/mpi/include64"], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'mangrove': [ 'Machine avec acces GPU (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'moloch': [ 'Machine dev Cedre (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'cc-wdsna': [ 'Portable sous redhat (Onera)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'cephee': [ 'Cluster de dev Cassiopee (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/home/tools/local/x86_64a/include'], # additionalIncludePaths -[], # additionalLibs -['/home/tools/local/x86_64a/lib'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'btmclx2': [ 'Cluster Turbomeca (Safran)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -['/usr/lib/gcc/x86_64-redhat-linux/4.1.2'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'WDSNAXXX': [ '??', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'eos_pgi': [ 'Machine eos avec PGI', -'pgf90', # f77compiler -'pgf90', # f90compiler -'pgcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -["pgf90","pgf902","pgc","pgmath","pgf90_rpm1","rt","pgf90rtl","pgftnrtl"], # additionalLibs -["/d/juvigny/Logiciels/linux86-64/2018/lib"], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################## -'visio': [ 'Machine de post gfx (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -['Xxf86vm'], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################## -'visung': [ 'Machine de post gfx (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################## -'visung_el8': [ 'Machine de post gfx (Onera)', -'ifx', # f77compiler -'ifx', # f90compiler -'icx', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -['Xxf86vm'], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'elmer': [ 'Machine de gros post gfx (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -['Xxf86vm'], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'WDSNA917Z': [ 'Machine de production win64 (Onera)', -'x86_64-w64-mingw32-gfortran', # f77compiler -'x86_64-w64-mingw32-gfortran', # f90compiler -'x86_64-w64-mingw32-gcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -True, # static -['c:/TDM-GCC-64/include'], # additionalIncludePaths -['gfortran', 'gomp', 'quadmath'], # additionalLibs -['c:/TDM-GCC-64/lib', 'c:/Python2.7/libs'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'fulvio': [ 'Machine post gfx legacy (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/usr/local/hdf5-intel-1.8.8/include'], # additionalIncludePaths -[], # additionalLibs -['/usr/local/hdf5-intel-1.8.8/lib'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'cobalt': [ 'CCRT machine Cobalt', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=32'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'irene': [ 'TGCC machine Irene-skylake-partition', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=32'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'topaze': [ 'CCRT machine Topaze-milan-partition', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=64','-axCORE-AVX2','-mavx2'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionAllIbpaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'ouessant': [ 'Machine IDRIS IBM POWER + NVIDIA P100)', -'pgf90', # f77compiler -'pgf90', # f90compiler -'pgcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -["pgf90","pgf902","pgc","pgmath","pgkomp",'omp',"pgf90_rpm1","rt","pgf90rtl"], # additionalLibs -["/opt/pgi/linuxpower/18.4/lib/"], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'jean-zay': [ 'Machine IDRIS intel + NVIDIA V100)', -'nvfortran', # f77compiler -'nvfortran', # f90compiler -'nvc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -True, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'adastra_cpu': [ 'Machine CINES Cray', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'adastra_gpu': [ 'Machine CINES Cray', -'ftn', # f77compiler -'ftn', # f90compiler -'cc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'ubuntu': [ 'Linux ubuntu 24.04', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/usr/include', '/usr/include/hdf5/openmpi', '/usr/lib/x86_64-linux-gnu/openmpi/include'], # additionalIncludePaths -['gfortran', 'gomp'], # additionalLibs -['/usr/lib/x86_64-linux-gnu/hdf5/openmpi', '/usr/lib/x86_64-linux-gnu'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'azure': [ 'Linux Centos7 - Github Actions', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/usr/include', '/usr/include/hdf5/openmpi', '/usr/lib/x86_64-linux-gnu/openmpi/include'], # additionalIncludePaths -['gfortran', 'gomp'], # additionalLibs -['/usr/lib/x86_64-linux-gnu/hdf5/openmpi', '/usr/lib/x86_64-linux-gnu'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'linux': [ 'Linux (generic)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'pdev': [ 'Machine Airbus (Airbus)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/opt/soft/cdtng/tools/portage/1.9/usr/include', '/opt/hpmpi/include'], # additionalIncludePaths -[], # additionalLibs -['/opt/soft/cdtng/tools/portage/1.9/usr/lib', '/opt/hpmpi/lib', '/opt/soft/cdtng/tools/intelcompiler/11.0/lib/intel64'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'laura': [ 'Machine de dev acou (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/usr/local/hdf5/1.8.7/include'], # additionalIncludePaths -[], # additionalLibs -['/usr/local/lib64', '/usr/local/hdf5/1.8.7/lib','/tmp_opt/Python/2.7.3/icc-mpt/lib'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'service': [ 'Cluster de calcul Stelvio (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -["-axAVX,SSE4.2"], # CppAdditionalOptions -["-axAVX,SSE4.2"], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -'r.i.n.': [ 'Cluster Stelvio-batch node (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -["-axAVX,SSE4.2"], # CppAdditionalOptions -["-axAVX,SSE4.2"], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'sator': [ 'Cluster de calcul Sator Broadwell (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=14','-Dvtune','-DSIMD=AVX2'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'sat_brw': [ 'Cluster de calcul Sator Broadwell (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=14','-Dvtune','-DSIMD=AVX2'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'sat_sky': [ 'Cluster de calcul Sator Skylake (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=64','-DNB_SOCKET=2','-DCORE_PER_SOCK=22','-Dvtune','-DSIMD=AVX2P512'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'sat_cas': [ 'Cluster de calcul Sator Cascadelake (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=64','-DNB_SOCKET=2','-DCORE_PER_SOCK=24','-Dvtune','-DSIMD=AVX2P512'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'sat_sph': [ 'Cluster de calcul Sator Saphire (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=64','-DNB_SOCKET=2','-DCORE_PER_SOCK=48','-DSIMD=AVX2P512'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'spiro_sky': [ 'Machine dev Spiro (proc skylake)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=64','-DNB_SOCKET=2','-DCORE_PER_SOCK=22','-DSIMD=AVX512'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'spiro_amd': [ 'Machine dev Spiro (proc amd)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=32','-DSIMD=AVX2'], -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'spiro_arm': [ 'Machine dev Spiro (proc arm)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -['-DCACHELINE=32'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'spiro_acda': [ 'Machine dev Spiro (proc brwl)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=32'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'spiro_coda': [ 'Machine dev Spiro centos8 (Onera) (env. coda)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -['-DCACHELINE=32'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'spiro_el8': [ 'Machine dev Spiro centos8 (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=12','-DSIMD=AVX2'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'spiro_intel': [ 'Machine dev Spiro centos8 (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=12','-DSIMD=AVX2'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'spiro_gcc': [ 'Machine dev Spiro centos8 (Onera)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=12','-DSIMD=AVX2'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'spiro_gpu': [ 'K80 onera', -'nvfortran', # f77compiler -'nvfortran', # f90compiler -'nvc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -True, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'juno_gpu': [ 'GPU A30 onera', -'nvfortran', # f77compiler -'nvfortran', # f90compiler -'nvc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -True, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'juno_gcc': [ 'Machine dev Juno rocky8 (Onera)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=48','-DSIMD=AVX512'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'juno_coda': [ 'Machine dev Juno rocky8 (Onera) (env. coda)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -['-DCACHELINE=32'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'juno': [ 'Machine dev Juno rocky8 (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=48','-DSIMD=AVX512'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'pc_imad': [ 'pc imad local', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -#[], -['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=12','-DSIMD=AVX2'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'spiro_socle6': [ 'Machine dev Spiro centos8 - socle6 (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=12','-DSIMD=AVX2'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'spiro_pgi': [ 'Machine dev Spiro + compilos pgi (Onera)', -'nvfortran', # f77compiler -'nvfortran', # f90compiler -'nvc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -True, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'spiro': [ 'Machine dev Spiro (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=12','-DSIMD=AVX2'], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'chi85bi': [ 'Cluster EDF (Onera)', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'Raspail': [ 'Machine DTIM (Onera)', -'gfortran-7', # f77compiler -'gfortran-7', # f90compiler -'clang++-5.0', # Cppcompiler -#'g++-7', # Cppcompiler -['-pedantic', '-march=native', '-Wno-variadic-macros', '-Wno-long-long', '-g'], # CppAdditionalOptions -['-march=native', '-fdefault-real-8', '-fdefault-double-8'], # f77AdditionalOptions -True, # useOMP -False, # static -['/usr/include/hdf5/serial/'], # additionalIncludePaths -[], # additionalLibs -['/usr/lib/gcc/x86_64-linux-gnu/7', '/usr/lib/x86_64-linux-gnu/'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'curie': [ 'Cluster Curie', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/usr/local/hdf5-1.8.8/include'], # additionalIncludePaths -[], # additionalLibs -['/usr/local/hdf5-1.8.8/lib'], # hdfPath -False, # useCuda -[] # NvccAdditionalOptions -], - ############################################################################## -'madmax64': [ 'Cluster madmax DTIS (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -['/usr/local/intel/cluster_studio/2012_0_032/lib/intel64'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'localhost.localdomain': [ 'Unknown', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'default': [ 'Default', -'gfortran', # f77compiler -'gfortran', # f90compiler -'gcc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'stelvio_impi15': [ 'Cluster Stelvio Full intel (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -['/tmp_opt/lib/hdf5-1.8.8-intel-15-impi/include', - # '/tmp_opt/lib/hdf5/1.8.17/15/impi/include', - '/tmp_opt/intel/studio/2015/impi/5.0.3.048/intel64/include'], # additionalIncludePaths -['mpi'], # additionalLibs -['/tmp_opt/lib/hdf5-1.8.8-intel-15-impi/lib', - '/tmp_opt/lib/hdf5/1.8.17/15/impi/lib', - '/tmp_opt/intel/studio/2015/impi/5.0.3.048/intel64/lib'], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'dumbo': [ 'Grosse machine de post-traitement (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -['Xxf86vm'], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -], -############################################################################### -'xdaap': [ 'Xdaap (Onera)', -'ifort', # f77compiler -'ifort', # f90compiler -'icc', # Cppcompiler -[], # CppAdditionalOptions -[], # f77AdditionalOptions -True, # useOMP -False, # static -[], # additionalIncludePaths -[], # additionalLibs -[], # additionalLibPaths -False, # useCuda -[] # NvccAdditionalOptions -] + ############################################################################### + 'DESKTOP...': [ 'Windows ubuntu', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/usr/include/mpi', '/usr/include/hdf5/serial'], # additionalIncludePaths + ['gfortran', 'gomp', 'pthread'], # additionalLibs + ['/usr/lib/x86_64-linux-gnu','/usr/lib/x86_64-linux-gnu/hdf5/serial/'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'WDSNA81OZ': [ 'Machine de production win32 (Onera)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['c:/MinGW/include'], # additionalIncludePaths + ['gfortran', 'gomp', 'pthread'], # additionalLibs + ['c:/MinGW/lib', 'c:/Python27/libs', 'c:/MinGW/bin'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'WDAAA728Z': [ 'Windows win64+msys2 (XJ-Onera)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + ['-D__SHADERS__', '-isystem /d/juvigny/msys64/mingw64/include/python3.8', '-isystem /d/juvigny/msys64/mingw64/lib/python3.8/site-packages/numpy/core/include/numpy/'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['d:/juvigny/msys64/mingw64/include',"d:/juvigny/msys64/mingw64/include/OpenBLAS"], # additionalIncludePaths + ['gfortran', 'gomp', 'pthread', 'openblas', 'psapi'], # additionalLibs + ['d:/juvigny/msys64/mingw64/lib', 'd:/juvigny/msys64/mingw64/bin'], # additionalLibPaths + True, # useCuda + ['-arch=sm_60'] # NvccAdditionalOptions + ], + ############################################################################### + 'Aryen': [ 'Windows win64+msys2 (CB-Home)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + ['-Wno-attributes', '-DSIMD=AVX2'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['c:/msys64/mingw64/include'], # additionalIncludePaths + ['gomp', 'gfortran'], # additionalLibs + ['c:/msys64/mingw64/lib'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'msys64': [ 'Windows win64+msys2 (CB-Onera/Github)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + ['-Wno-attributes', '-DSIMD=AVX2'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['d:/benoit/AppData/Local/msys2/mingw64/include', 'c:/Program Files (x86)/Microsoft SDKs/MPI/Include', 'd:/benoit/AppData/Local/msys2/mingw64/include/OpenBLAS'], # additionalIncludePaths + ['gomp', 'gfortran'], # additionalLibs + ['d:/benoit/AppData/Local/msys2/mingw64/lib', 'c:/Program Files (x86)/Microsoft SDKs/MPI/Lib/x64'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'WDAAA161Z': [ 'Windows win64+msys2 (CB-Onera)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + ['-Wno-attributes', '-fcommon'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ["c:/Users/benoit/msys64/mingw64/include"], # additionalIncludePaths + ['gomp', 'gfortran'], # additionalLibs + ["c:/Users/benoit/msys64/mingw64/lib"], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'node6.cluster': [ 'MacOSX (generic)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/usr/X11/include' ], # additionalIncludePaths + ['python2.7', 'ifcore'], # additionalLibs + ['/usr/X11/lib', '/System/Library/Frameworks/OpenGL.framework/Libraries/'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'd1log1':[ 'Cluster HPC4B dev/val (Airbus)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icpc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/opt/hpmpi/include', '/opt/soft/cdtng/tools/portage/1.11/usr/include'], # additionalIncludePaths + ['svml', 'irc', 'ifcore', 'iomp5'], # additionalLibs + ['/opt/soft/cdtng/tools/intelcompiler/16.0/compiler/lib/intel64', '/opt/soft/cdtng/tools/portage/1.11/usr/lib', '/opt/hpmpi/lib/linux_amd64'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'devt1n007.':[ 'Cluster HPC5 dev/val tou_b (Airbus)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icpc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/opt/mpi10/include', '/opt/soft/cdtng/tools/portage/1.11/usr/include'], # additionalIncludePaths + ['ifcore', 'iomp5', 'svml', 'irc'], # additionalLibs + ['/opt/soft/cdtng/tools/intelcompiler/2018/compilers_and_libraries_2018.5.274/linux/compiler/lib/intel64', '/opt/soft/cdtng/tools/portage/1.11/usr/lib', '/opt/mpi10/lib'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'caefr0p...': [ 'Cluster GISEH (Airbus)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icpc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/opt/soft/cdtng/tools/portage/1.11/usr/include'], # additionalIncludePaths + ['svml', 'irc', 'ifcore', 'iomp5'], # additionalLibs + ['/opt/soft/cdtng/tools/portage/1.11/composerxe/lib/intel64', '/opt/soft/cdtng/tools/portage/1.11/usr/lib'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'AA': [ 'Cluster AA', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=16'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/soft/intel-2017.5/compilers_and_libraries_2017.5.239/linux/mpi/include64','/home/mtaplaf/Environnement_Commun/Elsa/LIB_EXT/HDF5/hdf5-1.8.18-par/include'], # additionalIncludePaths + ['mpi'], # additionalLibs + ['/soft/intel-2017.5/compilers_and_libraries_2017.5.239/linux/mpi/lib64','/home/mtaplaf/Environnement_Commun/Elsa/LIB_EXT/HDF5/hdf5-1.8.18-par/lib'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'AA2': [ 'Machine AA2', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=16'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/soft/intel-2017.5/compilers_and_libraries_2017.5.239/linux/mpi/include64','/home/mtaplaf/Environnement_Commun/Elsa/LIB_EXT/HDF5/hdf5-1.8.18-par/include'], # additionalIncludePaths + ['mpi'], # additionalLibs + ['/soft/intel-2017.5/compilers_and_libraries_2017.5.239/linux/mpi/lib64','/home/mtaplaf/Environnement_Commun/Elsa/LIB_EXT/HDF5/hdf5-1.8.18-par/lib'], # additionalLibpaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'wfrontend1': [ 'Cluster Kairos (Safran)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + False, # useOMP + False, # static + ['/appl/APPLI_SNECMA/HDF5/oper/1.8.11/include'], # additionalIncludePaths + ['ifcore', 'svml', 'irc'], # additionalLibs + ['/opt/intel/composer_xe_2013_sp1.0.080/lib/intel64', '/appl/APPLI_SNECMA/HDF5/oper/1.8.11/lib'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'santafe': [ 'MacOSX - santafe (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/usr/X11/include' ], # additionalIncludePaths + ['python2.7', 'ifcore'], # additionalLibs + ['/usr/X11/lib', '/System/Library/Frameworks/OpenGL.framework/Libraries/'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'daapuv': [ 'Machine DAAP (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/usr/local/hdf5-1.8.7/include'], # additionalIncludePaths + [], # additionalLibs + ['/usr/local/hdf5-1.8.7/lib'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'celeste': [ 'Grosse machine de post-traitement (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + ['Xxf86vm'], # additionalLibs + [], # additionalLibPath + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'oneroa142': [ 'Machine dev (Onera)', + '/opt/intel/fc/9.1.036/bin/ifort', # f77compiler + '/opt/intel/fc/9.1.036/bin/ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'linux64': [ 'Production linux64 (generic)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/stck1/benoit/include'], # additionalIncludePaths + [], # additionalLibs + ['/stck1/benoit/lib'], # additionqlLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'eos814_r8': [ 'Poste grand calcul Onera-ld (Onera) avec Centos8', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + ['-DCACHELINE=32','-DNB_SOCKET=1'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'eos8': [ 'Poste grand calcul Onera-ld (Onera) avec Centos8', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=32','-DNB_SOCKET=1'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'eos...z': [ 'Poste grand calcul eosXXXz (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/usr/local/hdf5-gnu-1.8.8/include'], # additionalIncludePaths + [], # additionalLibs + ['/usr/local/hdf5-gnu-1.8.8/lib'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'eos...': [ 'Onera-eos (legacy-doit etre apres eosZ)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'ld...': [ 'Poste grand calcul Onera-ld (Onera)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + ['-DCACHELINE=32','-DNB_SOCKET=1'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'tiamat': [ 'Machine de dev elsA (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=16','-DNB_SOCKET=1','-DCORE_PER_SOCK=6'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/home/benoit/x86_64t/include'], # additionalIncludePaths + [], # additionalLibs + ['/home/benoit/x86_64t'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'austri.onera': [ 'Cluster dev austri (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=12','-DSIMD=AVX2'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/home/benoit/aus/include'], # additionalIncludePaths + [], # additionalLibs + ['/home/benoit/aus/lib'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'rosetta-ws': [ 'Machine rosetta (Safran)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=16'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/softs/intel/compilers_and_libraries_2016.0.109/linux/mpi/intel64/include'], # additionalIncludePaths + [], # additionalLibs + ['/softs/intel/compilers_and_libraries_2016.0.109/linux/mpi/intel64/lib'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'rosetta-compute': [ 'Machine rosetta-calcul (Safran)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=32'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/softs/intel/compilers_and_libraries_2016.0.109/linux/mpi/intel64/include'], # additionalIncludePaths + [], # additionalLibs + ['/softs/intel/compilers_and_libraries_2016.0.109/linux/mpi/intel64/lib'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'westri': [ 'Machine westri-KNL (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=64','-DNB_SOCKET=1','-DCORE_PER_SOCK=64','-g','-DSIMD=MIC'], # CppAdditionalOptions + ['-g'], # f77AdditionalOptions + True, # useOMP + False, # static + ['/usr/local/hdf5-1.8.8-intel-16/include','/home/benoit/aus/include','/stck/nalferez/intel/parallel_studio_xe_2018/compilers_and_libraries_2018/linux/mpi/include64/','/stck/nalferez/intel/parallel_studio_xe_2018/vtune_amplifier_2018/include/','/stck/nalferez/intel/parallel_studio_xe_2018/advisor_2018/include/intel64'], # additionalIncludePaths + [], # additionalLibs + ['/home/benoit/aus/lib','/stck/nalferez/intel/parallel_studio_xe_2018/compilers_and_libraries_2018/linux/mpi/lib64/','/stck/nalferez/intel/parallel_studio_xe_2018/compilers_and_libraries_2018/lib64/','/usr/local/hdf5-1.8.8-intel-16/lib/','/stck/nalferez/intel/parallel_studio_xe_2018/advisor_2018/lib64'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'giulia': [ 'Machine dev elsA-ASO (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ["/tmp_opt/lib/hdf5-1.8.8-intel-16-impi/include", + "/usr/local/intel/studio/2016/compilers_and_libraries_2016.0.109/linux/mpi/include64"], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'mangrove': [ 'Machine avec acces GPU (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'moloch': [ 'Machine dev Cedre (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'cc-wdsna': [ 'Portable sous redhat (Onera)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'cephee': [ 'Cluster de dev Cassiopee (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/home/tools/local/x86_64a/include'], # additionalIncludePaths + [], # additionalLibs + ['/home/tools/local/x86_64a/lib'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'btmclx2': [ 'Cluster Turbomeca (Safran)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + ['/usr/lib/gcc/x86_64-redhat-linux/4.1.2'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'WDSNAXXX': [ '??', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'eos_pgi': [ 'Machine eos avec PGI', + 'pgf90', # f77compiler + 'pgf90', # f90compiler + 'pgcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + ["pgf90","pgf902","pgc","pgmath","pgf90_rpm1","rt","pgf90rtl","pgftnrtl"], # additionalLibs + ["/d/juvigny/Logiciels/linux86-64/2018/lib"], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################## + 'visio': [ 'Machine de post gfx (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + ['Xxf86vm'], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################## + 'visung': [ 'Machine de post gfx (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################## + 'visung_el8': [ 'Machine de post gfx (Onera)', + 'ifx', # f77compiler + 'ifx', # f90compiler + 'icx', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + ['Xxf86vm'], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'elmer': [ 'Machine de gros post gfx (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + ['Xxf86vm'], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'WDSNA917Z': [ 'Machine de production win64 (Onera)', + 'x86_64-w64-mingw32-gfortran', # f77compiler + 'x86_64-w64-mingw32-gfortran', # f90compiler + 'x86_64-w64-mingw32-gcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + True, # static + ['c:/TDM-GCC-64/include'], # additionalIncludePaths + ['gfortran', 'gomp', 'quadmath'], # additionalLibs + ['c:/TDM-GCC-64/lib', 'c:/Python2.7/libs'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'fulvio': [ 'Machine post gfx legacy (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/usr/local/hdf5-intel-1.8.8/include'], # additionalIncludePaths + [], # additionalLibs + ['/usr/local/hdf5-intel-1.8.8/lib'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'cobalt': [ 'CCRT machine Cobalt', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=32'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'irene': [ 'TGCC machine Irene-skylake-partition', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=32'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'topaze': [ 'CCRT machine Topaze-milan-partition', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=64','-axCORE-AVX2','-mavx2'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionAllIbpaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'ouessant': [ 'Machine IDRIS IBM POWER + NVIDIA P100)', + 'pgf90', # f77compiler + 'pgf90', # f90compiler + 'pgcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + ["pgf90","pgf902","pgc","pgmath","pgkomp",'omp',"pgf90_rpm1","rt","pgf90rtl"], # additionalLibs + ["/opt/pgi/linuxpower/18.4/lib/"], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'jean-zay': [ 'Machine IDRIS intel + NVIDIA V100)', + 'nvfortran', # f77compiler + 'nvfortran', # f90compiler + 'nvc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + True, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'adastra_cpu': [ 'Machine CINES Cray', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'adastra_gpu': [ 'Machine CINES Cray', + 'ftn', # f77compiler + 'ftn', # f90compiler + 'cc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'ubuntu': [ 'Linux ubuntu 24.04', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/usr/include', '/usr/include/hdf5/openmpi', '/usr/lib/x86_64-linux-gnu/openmpi/include'], # additionalIncludePaths + ['gfortran', 'gomp'], # additionalLibs + ['/usr/lib/x86_64-linux-gnu/hdf5/openmpi', '/usr/lib/x86_64-linux-gnu'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'azure': [ 'Linux Centos7 - Github Actions', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/usr/include', '/usr/include/hdf5/openmpi', '/usr/lib/x86_64-linux-gnu/openmpi/include'], # additionalIncludePaths + ['gfortran', 'gomp'], # additionalLibs + ['/usr/lib/x86_64-linux-gnu/hdf5/openmpi', '/usr/lib/x86_64-linux-gnu'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'linux': [ 'Linux (generic)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'pdev': [ 'Machine Airbus (Airbus)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/opt/soft/cdtng/tools/portage/1.9/usr/include', '/opt/hpmpi/include'], # additionalIncludePaths + [], # additionalLibs + ['/opt/soft/cdtng/tools/portage/1.9/usr/lib', '/opt/hpmpi/lib', '/opt/soft/cdtng/tools/intelcompiler/11.0/lib/intel64'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'laura': [ 'Machine de dev acou (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/usr/local/hdf5/1.8.7/include'], # additionalIncludePaths + [], # additionalLibs + ['/usr/local/lib64', '/usr/local/hdf5/1.8.7/lib','/tmp_opt/Python/2.7.3/icc-mpt/lib'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'service': [ 'Cluster de calcul Stelvio (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ["-axAVX,SSE4.2"], # CppAdditionalOptions + ["-axAVX,SSE4.2"], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + 'r.i.n.': [ 'Cluster Stelvio-batch node (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ["-axAVX,SSE4.2"], # CppAdditionalOptions + ["-axAVX,SSE4.2"], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'sator': [ 'Cluster de calcul Sator Broadwell (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=14','-Dvtune','-DSIMD=AVX2'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'sat_brw': [ 'Cluster de calcul Sator Broadwell (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=14','-Dvtune','-DSIMD=AVX2'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'sat_sky': [ 'Cluster de calcul Sator Skylake (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=64','-DNB_SOCKET=2','-DCORE_PER_SOCK=22','-Dvtune','-DSIMD=AVX2P512'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'sat_cas': [ 'Cluster de calcul Sator Cascadelake (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=64','-DNB_SOCKET=2','-DCORE_PER_SOCK=24','-Dvtune','-DSIMD=AVX2P512'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'sat_sph': [ 'Cluster de calcul Sator Saphire (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=64','-DNB_SOCKET=2','-DCORE_PER_SOCK=48','-DSIMD=AVX2P512'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'spiro_sky': [ 'Machine dev Spiro (proc skylake)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=64','-DNB_SOCKET=2','-DCORE_PER_SOCK=22','-DSIMD=AVX512'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'spiro_amd': [ 'Machine dev Spiro (proc amd)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=32','-DSIMD=AVX2'], + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'spiro_arm': [ 'Machine dev Spiro (proc arm)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + ['-DCACHELINE=32'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'spiro_acda': [ 'Machine dev Spiro (proc brwl)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=32'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'spiro_coda': [ 'Machine dev Spiro centos8 (Onera) (env. coda)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + ['-DCACHELINE=32'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'spiro_el8': [ 'Machine dev Spiro centos8 (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=12','-DSIMD=AVX2'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'spiro_intel': [ 'Machine dev Spiro centos8 (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=12','-DSIMD=AVX2'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'spiro_gcc': [ 'Machine dev Spiro centos8 (Onera)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + ['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=12','-DSIMD=AVX2'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'spiro_gpu': [ 'K80 onera', + 'nvfortran', # f77compiler + 'nvfortran', # f90compiler + 'nvc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + True, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'juno_gpu': [ 'GPU A30 onera', + 'nvfortran', # f77compiler + 'nvfortran', # f90compiler + 'nvc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + True, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'juno_gcc': [ 'Machine dev Juno rocky8 (Onera)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + ['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=48','-DSIMD=AVX512'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'juno_coda': [ 'Machine dev Juno rocky8 (Onera) (env. coda)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + ['-DCACHELINE=32'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'juno': [ 'Machine dev Juno rocky8 (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=48','-DSIMD=AVX512'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'pc_imad': [ 'pc imad local', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + #[], + ['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=12','-DSIMD=AVX2'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'spiro_socle6': [ 'Machine dev Spiro centos8 - socle6 (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=12','-DSIMD=AVX2'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'spiro_pgi': [ 'Machine dev Spiro + compilos pgi (Onera)', + 'nvfortran', # f77compiler + 'nvfortran', # f90compiler + 'nvc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + True, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'spiro': [ 'Machine dev Spiro (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + ['-DCACHELINE=32','-DNB_SOCKET=2','-DCORE_PER_SOCK=12','-DSIMD=AVX2'], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'chi85bi': [ 'Cluster EDF (Onera)', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'Raspail': [ 'Machine DTIM (Onera)', + 'gfortran-7', # f77compiler + 'gfortran-7', # f90compiler + 'clang++-5.0', # Cppcompiler + #'g++-7', # Cppcompiler + ['-pedantic', '-march=native', '-Wno-variadic-macros', '-Wno-long-long', '-g'], # CppAdditionalOptions + ['-march=native', '-fdefault-real-8', '-fdefault-double-8'], # f77AdditionalOptions + True, # useOMP + False, # static + ['/usr/include/hdf5/serial/'], # additionalIncludePaths + [], # additionalLibs + ['/usr/lib/gcc/x86_64-linux-gnu/7', '/usr/lib/x86_64-linux-gnu/'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'curie': [ 'Cluster Curie', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/usr/local/hdf5-1.8.8/include'], # additionalIncludePaths + [], # additionalLibs + ['/usr/local/hdf5-1.8.8/lib'], # hdfPath + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################## + 'madmax64': [ 'Cluster madmax DTIS (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + ['/usr/local/intel/cluster_studio/2012_0_032/lib/intel64'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'localhost.localdomain': [ 'Unknown', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'default': [ 'Default', + 'gfortran', # f77compiler + 'gfortran', # f90compiler + 'gcc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'stelvio_impi15': [ 'Cluster Stelvio Full intel (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + ['/tmp_opt/lib/hdf5-1.8.8-intel-15-impi/include', + # '/tmp_opt/lib/hdf5/1.8.17/15/impi/include', + '/tmp_opt/intel/studio/2015/impi/5.0.3.048/intel64/include'], # additionalIncludePaths + ['mpi'], # additionalLibs + ['/tmp_opt/lib/hdf5-1.8.8-intel-15-impi/lib', + '/tmp_opt/lib/hdf5/1.8.17/15/impi/lib', + '/tmp_opt/intel/studio/2015/impi/5.0.3.048/intel64/lib'], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'dumbo': [ 'Grosse machine de post-traitement (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + ['Xxf86vm'], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ], + ############################################################################### + 'xdaap': [ 'Xdaap (Onera)', + 'ifort', # f77compiler + 'ifort', # f90compiler + 'icc', # Cppcompiler + [], # CppAdditionalOptions + [], # f77AdditionalOptions + True, # useOMP + False, # static + [], # additionalIncludePaths + [], # additionalLibs + [], # additionalLibPaths + False, # useCuda + [] # NvccAdditionalOptions + ] } diff --git a/Cassiopee/KCore/installer.py b/Cassiopee/KCore/installer.py index b99e5d4a2..d63722f5b 100644 --- a/Cassiopee/KCore/installer.py +++ b/Cassiopee/KCore/installer.py @@ -74,7 +74,7 @@ def saveConfigFile(event=None): except: additionalLibPaths = [] dict[machine] = [Vdescription.get(), - Vf77compiler.get(), + Vf77compiler.get(), Vf90compiler.get(), VCppcompiler.get(), VuseOMP.get(), VuseStatic.get(), @@ -100,7 +100,7 @@ def changeMachineName(event=None): # Reset color if WIDGETS != {}: for name in ['Cppcompiler', 'f77compiler', - 'f90compiler', + 'f90compiler', 'additionalIncludePaths', 'additionalLibs', 'additionalLibPaths']: entry = WIDGETS[name] @@ -150,7 +150,7 @@ def check__(name): (ok, FLibs, FLibPaths) = Dist.checkFortranLibs( [], additionalLibPaths, Vf90compiler.get(), VuseOMP.get()) if ok: out = ['f90: OK'] - else: out = ['f90: Fail'] + else: out = ['f90: Fail'] elif name == 'png': additionalLibPaths = eval(VadditionalLibPaths.get()) @@ -308,7 +308,7 @@ def checkMpeg(event=None): key = '' for i in dict.keys(): if (re.compile(i).search(host) is not None or - re.compile(i).search(prod) is not None): + re.compile(i).search(prod) is not None): key = i ; break if (re.compile(key).search(host) is not None): setMachineName(host) @@ -327,7 +327,7 @@ def instructions(): # position de la fenetre parent xpos = winl.master.winfo_rootx() ypos = winl.master.winfo_rooty() - winl.geometry("%+d%+d" % (xpos+40, ypos)) + winl.geometry("%+d%+d" % (xpos+40, ypos)) scrollbar = TK.Scrollbar(winl, orient=TK.VERTICAL, width=10) scrollbar.grid(sticky=TK.NSEW, row=0, column=1) @@ -361,7 +361,7 @@ def printCheck(): # position de la fenetre parent xpos = winl.master.winfo_rootx() ypos = winl.master.winfo_rooty() - winl.geometry("%+d%+d" % (xpos+40, ypos)) + winl.geometry("%+d%+d" % (xpos+40, ypos)) scrollbar = TK.Scrollbar(winl, orient=TK.VERTICAL, width=10) scrollbar.grid(sticky=TK.NSEW, row=0, column=1) diff --git a/Cassiopee/KCore/setup.py b/Cassiopee/KCore/setup.py index 1f681b917..6e0ed1960 100644 --- a/Cassiopee/KCore/setup.py +++ b/Cassiopee/KCore/setup.py @@ -39,7 +39,7 @@ libraries=libraries+additionalLibs, extra_compile_args=Dist.getCppArgs(), extra_link_args=Dist.getLinkArgs()) - ] +] # Setup ====================================================================== setup( @@ -51,7 +51,7 @@ packages=['KCore'], package_dir={"":"."}, ext_modules=extensions - ) +) # Check PYTHONPATH Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/KCore/setupLegacy.py b/Cassiopee/KCore/setupLegacy.py index 18dbbe9cc..8622b6942 100644 --- a/Cassiopee/KCore/setupLegacy.py +++ b/Cassiopee/KCore/setupLegacy.py @@ -54,8 +54,8 @@ libraries=libraries+additionalLibs, extra_compile_args=Dist.getCppArgs(), extra_link_args=Dist.getLinkArgs() - ) - ] + ) +] # Setup ====================================================================== setup( @@ -66,7 +66,7 @@ package_dir={"":"."}, packages=['KCore'], ext_modules=extensions - ) +) # Check PYTHONPATH Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/KCore/srcs.py b/Cassiopee/KCore/srcs.py index dc9c9696e..5d9a7c347 100644 --- a/Cassiopee/KCore/srcs.py +++ b/Cassiopee/KCore/srcs.py @@ -143,62 +143,62 @@ 'KCore/Acc/copyfrom.cpp', ] if PNG: - cpp_srcs += [ - 'KCore/Images/libz/adler32.c', - 'KCore/Images/libz/crc32.c', - 'KCore/Images/libz/gzclose.c', - 'KCore/Images/libz/gzread.c', - 'KCore/Images/libz/infback.c', - 'KCore/Images/libz/inflate.c', - 'KCore/Images/libz/trees.c', - 'KCore/Images/libz/zutil.c', - 'KCore/Images/libz/compress.c', - 'KCore/Images/libz/deflate.c', - 'KCore/Images/libz/gzlib.c', - 'KCore/Images/libz/gzwrite.c', - 'KCore/Images/libz/inffast.c', - 'KCore/Images/libz/inftrees.c', - 'KCore/Images/libz/uncompr.c', - 'KCore/Images/png/pngerror.c', - 'KCore/Images/png/pngmem.c', - 'KCore/Images/png/pngread.c', - 'KCore/Images/png/pngrtran.c', - 'KCore/Images/png/pngset.c', - 'KCore/Images/png/pngtrans.c', - 'KCore/Images/png/pngwrite.c', - 'KCore/Images/png/pngwutil.c', - 'KCore/Images/png/png.c', - 'KCore/Images/png/pngget.c', - 'KCore/Images/png/pngpread.c', - 'KCore/Images/png/pngrio.c', - 'KCore/Images/png/pngrutil.c', - 'KCore/Images/png/pngtest.c', - 'KCore/Images/png/pngwio.c', - 'KCore/Images/png/pngwtran.c', - ] + cpp_srcs += [ + 'KCore/Images/libz/adler32.c', + 'KCore/Images/libz/crc32.c', + 'KCore/Images/libz/gzclose.c', + 'KCore/Images/libz/gzread.c', + 'KCore/Images/libz/infback.c', + 'KCore/Images/libz/inflate.c', + 'KCore/Images/libz/trees.c', + 'KCore/Images/libz/zutil.c', + 'KCore/Images/libz/compress.c', + 'KCore/Images/libz/deflate.c', + 'KCore/Images/libz/gzlib.c', + 'KCore/Images/libz/gzwrite.c', + 'KCore/Images/libz/inffast.c', + 'KCore/Images/libz/inftrees.c', + 'KCore/Images/libz/uncompr.c', + 'KCore/Images/png/pngerror.c', + 'KCore/Images/png/pngmem.c', + 'KCore/Images/png/pngread.c', + 'KCore/Images/png/pngrtran.c', + 'KCore/Images/png/pngset.c', + 'KCore/Images/png/pngtrans.c', + 'KCore/Images/png/pngwrite.c', + 'KCore/Images/png/pngwutil.c', + 'KCore/Images/png/png.c', + 'KCore/Images/png/pngget.c', + 'KCore/Images/png/pngpread.c', + 'KCore/Images/png/pngrio.c', + 'KCore/Images/png/pngrutil.c', + 'KCore/Images/png/pngtest.c', + 'KCore/Images/png/pngwio.c', + 'KCore/Images/png/pngwtran.c', + ] if JPEG: cpp_srcs += [#'KCore/Images/libjpeg/ansi2knr.c', - 'KCore/Images/libjpeg/jcdctmgr.c', - 'KCore/Images/libjpeg/jdapistd.c', + 'KCore/Images/libjpeg/jcdctmgr.c', + 'KCore/Images/libjpeg/jdapistd.c', 'KCore/Images/libjpeg/jdmerge.c', - #'KCore/Images/libjpeg/jmemdos.c', + #'KCore/Images/libjpeg/jmemdos.c', 'KCore/Images/libjpeg/rdjpgcom.c', - 'KCore/Images/libjpeg/cdjpeg.c', - 'KCore/Images/libjpeg/jchuff.c', - 'KCore/Images/libjpeg/jdarith.c', - 'KCore/Images/libjpeg/jdpostct.c', - #'KCore/Images/libjpeg/jmemmac.c', + 'KCore/Images/libjpeg/cdjpeg.c', + 'KCore/Images/libjpeg/jchuff.c', + 'KCore/Images/libjpeg/jdarith.c', + 'KCore/Images/libjpeg/jdpostct.c', + #'KCore/Images/libjpeg/jmemmac.c', 'KCore/Images/libjpeg/rdppm.c', - 'KCore/Images/libjpeg/cjpeg.c', - 'KCore/Images/libjpeg/jcinit.c', - 'KCore/Images/libjpeg/jdatadst.c', - 'KCore/Images/libjpeg/jdsample.c', - 'KCore/Images/libjpeg/jmemmgr.c', + 'KCore/Images/libjpeg/cjpeg.c', + 'KCore/Images/libjpeg/jcinit.c', + 'KCore/Images/libjpeg/jdatadst.c', + 'KCore/Images/libjpeg/jdsample.c', + 'KCore/Images/libjpeg/jmemmgr.c', 'KCore/Images/libjpeg/rdrle.c', - 'KCore/Images/libjpeg/ckconfig.c', + 'KCore/Images/libjpeg/ckconfig.c', 'KCore/Images/libjpeg/jcmainct.c', - 'KCore/Images/libjpeg/jdatasrc.c', + 'KCore/Images/libjpeg/jdatasrc.c', 'KCore/Images/libjpeg/jdtrans.c', 'KCore/Images/libjpeg/jmemname.c', 'KCore/Images/libjpeg/rdswitch.c', @@ -249,7 +249,7 @@ 'KCore/Images/libjpeg/jmemansi.c', 'KCore/Images/libjpeg/rdgif.c', 'KCore/Images/libjpeg/wrtarga.c' - ] + ] if METIS: cpp_srcs += ['KCore/Metis/auxapi.c', diff --git a/Cassiopee/KCore/test/compareSessionLogs.py b/Cassiopee/KCore/test/compareSessionLogs.py index 5b6daf220..731087c81 100644 --- a/Cassiopee/KCore/test/compareSessionLogs.py +++ b/Cassiopee/KCore/test/compareSessionLogs.py @@ -38,7 +38,7 @@ def readGitInfo(filename): info = line.strip().split(' ') gitInfo['Git branch'] = info[2][:-1] gitInfo['Commit hash'] = info[-1] - if all(v is not None for v in gitInfo.values()): + if all(v is not None for v in gitInfo.values()): break return gitInfo @@ -65,7 +65,7 @@ def readLog(filename): session = [] with open (filename, 'r') as f: for line in f: - if ' :' in line: + if ' :' in line: test = line.strip().split(':') session.append([e.strip() for e in test]) return session @@ -98,7 +98,7 @@ def diffTest(test, ref, new): else: return '' -# Return test execution time of the Base, the reference log and the new log +# Return test execution time of the Base, the reference log and the new log def getExecTime(test, ref, new): def _testStr2Time(t): t = t[:-1].split('m') @@ -138,7 +138,7 @@ def stringify(test='', ref='', new=''): script_args.logs = findLogs(script_args.prod) if not(isinstance(script_args.logs, list) and len(script_args.logs) == 2): raise Exception("Two session logs were not found for prod. {}".format( - script_args.prod)) + script_args.prod)) else: script_args.logs = script_args.logs.split(' ') if len(script_args.logs) != 2: @@ -252,7 +252,7 @@ def stringify(test='', ref='', new=''): import shutil os.remove(script_args.logs[0]) newRef = os.path.join(os.path.dirname(script_args.logs[1]), - 'REF-' + os.path.basename(script_args.logs[1])) + 'REF-' + os.path.basename(script_args.logs[1])) shutil.copyfile(script_args.logs[1], newRef) else: exitStatus = 2 diff --git a/Cassiopee/KCore/test/notifyCheckout.py b/Cassiopee/KCore/test/notifyCheckout.py index 4a2d216c4..463cf675e 100644 --- a/Cassiopee/KCore/test/notifyCheckout.py +++ b/Cassiopee/KCore/test/notifyCheckout.py @@ -12,7 +12,7 @@ def parseArgs(): # Create argument parser parser = argparse.ArgumentParser() parser.add_argument("-e", "--email", action="store_true", - help="Email results. Default: print in terminal") + help="Email results. Default: print in terminal") parser.add_argument("-r", "--recipients", type=str, default='', help="Single-quoted space-separated list of recipients") # Parse arguments @@ -49,11 +49,11 @@ def parseArgs(): gitBranch = Dist.getGitBranch(cassiopeeIncDir) gitHash = Dist.getGitHash(cassiopeeIncDir)[:7] gitInfo = "Git origin: {}\nGit branch: {}\nCommit hash: {}".format( - gitOrigin, gitBranch, gitHash) + gitOrigin, gitBranch, gitHash) messageSubject = "[Checkout Cassiopee] State: FAILED" messageText = "Pulling updates for Cassiopee, Fast and all "\ - "PModules:\n{}\n\n{}\n\n".format(52*'-', gitInfo) + "PModules:\n{}\n\n{}\n\n".format(52*'-', gitInfo) messageText += '{:^20} | {:^15} | {:^30} | {:^10}\n{}\n'.format( "PROD.", "PCKG.", "DATE", "STATUS", 85*'-') for log_machine in log_entries: @@ -63,11 +63,11 @@ def parseArgs(): date = strftime("%d/%m/%y at %T", date) status = log_machine[3] messageText += '{:^20} | {:^15} | {:^30} | {:^10}\n'.format( - prod, pckg, date, status) + prod, pckg, date, status) messageText += '\n\nIf the prod. you wish to use is marked as FAILED, '\ - 'please contact the maintainers:\nchristophe.benoit@onera.fr, '\ - 'vincent.casseau@onera.fr' + 'please contact the maintainers:\nchristophe.benoit@onera.fr, '\ + 'vincent.casseau@onera.fr' if script_args.email: notify(recipients=recipients, diff --git a/Cassiopee/KCore/test/notifyInstall.py b/Cassiopee/KCore/test/notifyInstall.py index b9c510a58..fee8a8c3c 100644 --- a/Cassiopee/KCore/test/notifyInstall.py +++ b/Cassiopee/KCore/test/notifyInstall.py @@ -12,7 +12,7 @@ def parseArgs(): # Create argument parser parser = argparse.ArgumentParser() parser.add_argument("-e", "--email", action="store_true", - help="Email results. Default: print in terminal") + help="Email results. Default: print in terminal") parser.add_argument("-r", "--recipients", type=str, default='', help="Single-quoted space-separated list of recipients") # Parse arguments @@ -44,11 +44,11 @@ def parseArgs(): gitBranch = Dist.getGitBranch(cassiopeeIncDir) gitHash = Dist.getGitHash(cassiopeeIncDir)[:7] gitInfo = "Git origin: {}\nGit branch: {}\nCommit hash: {}".format( - gitOrigin, gitBranch, gitHash) + gitOrigin, gitBranch, gitHash) baseState = 'OK' messageText = "Installation of Cassiopee, Fast and all "\ - "PModules:\n{}\n\n{}\n\n".format(48*'-', gitInfo) + "PModules:\n{}\n\n{}\n\n".format(48*'-', gitInfo) messageText += '{:^20} | {:^30} | {:^10}\n{}\n'.format( "PROD.", "DATE", "STATUS", 67*'-') for log_machine in log_entries: @@ -62,8 +62,8 @@ def parseArgs(): messageSubject = "[Install Cassiopee] State: {}".format(baseState) if baseState == 'FAILED': messageText += '\n\nIf the prod. you wish to use is marked as FAILED, '\ - 'please contact the maintainers:\nchristophe.benoit@onera.fr, '\ - 'vincent.casseau@onera.fr' + 'please contact the maintainers:\nchristophe.benoit@onera.fr, '\ + 'vincent.casseau@onera.fr' if script_args.email: notify(recipients=recipients, diff --git a/Cassiopee/KCore/test/notifyValid.py b/Cassiopee/KCore/test/notifyValid.py index d53cec6e1..4b8158057 100644 --- a/Cassiopee/KCore/test/notifyValid.py +++ b/Cassiopee/KCore/test/notifyValid.py @@ -12,7 +12,7 @@ def parseArgs(): # Create argument parser parser = argparse.ArgumentParser() parser.add_argument("-e", "--email", action="store_true", - help="Email results. Default: print in terminal") + help="Email results. Default: print in terminal") parser.add_argument("-r", "--recipients", type=str, default='', help="Single-quoted space-separated list of recipients") # Parse arguments @@ -44,11 +44,11 @@ def parseArgs(): gitBranch = Dist.getGitBranch(cassiopeeIncDir) gitHash = Dist.getGitHash(cassiopeeIncDir)[:7] gitInfo = "Git origin: {}\nGit branch: {}\nCommit hash: {}".format( - gitOrigin, gitBranch, gitHash) + gitOrigin, gitBranch, gitHash) vnvState = 'OK' messageText = "Non-regression testing of Cassiopee, Fast and all "\ - "PModules:\n{}\n\n{}\n\n".format(58*'-', gitInfo) + "PModules:\n{}\n\n{}\n\n".format(58*'-', gitInfo) messageText += '{:^20} | {:^30} | {:^10}\n{}\n'.format( "PROD.", "DATE", "STATUS", 67*'-') for log_machine in log_entries: @@ -62,9 +62,9 @@ def parseArgs(): messageSubject = "[V&V Cassiopee] State: {}".format(vnvState) if vnvState == 'FAILED': messageText += '\n\nIf the prod. you wish to use is marked as FAILED, '\ - 'please contact the maintainers:\nchristophe.benoit@onera.fr, '\ - 'vincent.casseau@onera.fr\nor list remaining issues with:\n'\ - 'compareSessionLogs --prod=your_prod_name' + 'please contact the maintainers:\nchristophe.benoit@onera.fr, '\ + 'vincent.casseau@onera.fr\nor list remaining issues with:\n'\ + 'compareSessionLogs --prod=your_prod_name' if script_args.email: notify(recipients=recipients, diff --git a/Cassiopee/KCore/test/tester3.py b/Cassiopee/KCore/test/tester3.py index 3a9e488ed..4db0a7256 100644 --- a/Cassiopee/KCore/test/tester3.py +++ b/Cassiopee/KCore/test/tester3.py @@ -8,4 +8,3 @@ a = KCore.tester() print(a) - diff --git a/Cassiopee/KCore/test/tester4.py b/Cassiopee/KCore/test/tester4.py index 1a825450e..d865f40df 100644 --- a/Cassiopee/KCore/test/tester4.py +++ b/Cassiopee/KCore/test/tester4.py @@ -41,4 +41,4 @@ #print(a[2][0].shape) #============================================================= -# NGON tra la la +# NGON tra la la diff --git a/Cassiopee/Modeler/Modeler/Animator2D.py b/Cassiopee/Modeler/Modeler/Animator2D.py index d1b25dd38..a84b8b676 100644 --- a/Cassiopee/Modeler/Modeler/Animator2D.py +++ b/Cassiopee/Modeler/Modeler/Animator2D.py @@ -40,7 +40,7 @@ def sort(self): # Register an image def registerImage(self, key, fileName, Ni=1, Nj=1, speed=0.1): - # nom du fichier image, Ni, Nj, no de l'image courante, + # nom du fichier image, Ni, Nj, no de l'image courante, # vitesse de l'animation, ptr courant de l'animation self.images[key] = [fileName,Ni,Nj,self.nimages,speed,0.] self.line += [fileName,Ni,Nj] @@ -71,7 +71,7 @@ def updateShaderParam(self): # you must register all images before display def openDisplay(self): self.prepare() - CPlot.display(self.t, mode='Render', bgColor=1, posCam=(0.,0,1), + CPlot.display(self.t, mode='Render', bgColor=1, posCam=(0.,0,1), posEye=(0.,0,0), dirCam=(0,1,0)) CPlot.setState(activateShortCuts=0, displayInfo=0) @@ -116,7 +116,7 @@ def move(self, key, v, render=True): # place a key in x,y def place(self, key, pos, render=True): if len(pos) == 2: v = (pos[0],pos[1],0.) - else: v = pos + else: v = pos zones = Internal.getZones(self.t) noz = self.getNozOfKey(key, zones) z = Internal.getNodeFromName2(self.t, key) @@ -176,7 +176,7 @@ def drawMultipleImage(self, key, imageKey=None, pos=[(0,0,0)], scale=1., render= noz = self.getNozOfZPos(pos[0][2], zones) CPlot.add(self.t, 1, noz, a) if not self.firstFit: self.fitView() - if render: CPlot.render() + if render: CPlot.render() # draw a particle system from a point def drawParticles(self, key, imageKey=None, pos=(0,0,0), Np=10, scale=1., render=True): @@ -204,13 +204,13 @@ def drawParticles(self, key, imageKey=None, pos=(0,0,0), Np=10, scale=1., render noz = self.getNozOfZPos(pos[2], zones) CPlot.add(self.t, 1, noz, a) if not self.firstFit: self.fitView() - if render: CPlot.render() + if render: CPlot.render() # draw a text def drawText(self, key, pos=(0,0,0), scale=1., text="youpi", color='Black', h=0., render=True): if h == 0.: a = D.text2D(text, font='vera') - else: + else: a = D.text3D(text, font='vera') T._contract(a, (0,0,0), (1,0,0), (0,1,0), h) T._homothety(a, (0,0,0), scale) @@ -273,7 +273,7 @@ def animate(self, key, curMin=None, curMax=None, imageKey=None, render=True): if render: CPlot.render() # Positionne l'animation de l'image key sur une case (posi,posj) - # avec 0 < posi < Ni et 0 < posj < Nj + # avec 0 < posi < Ni et 0 < posj < Nj def setAnimation(self, key, posi, posj, imageKey=None, render=True): if imageKey is None: imageKey = key a = self.getZone(key) @@ -298,7 +298,7 @@ def animateParticles(self, key, step, gravity, render=True): a = T.deform(a, ['ux','uy','vz']) zones = Internal.getZones(self.t) noz = self.getNozOfKey(key, zones) - CPlot.replace(self.t, 1, noz, a) + CPlot.replace(self.t, 1, noz, a) if render: CPlot.render() # Clone une key (jamais teste) @@ -309,7 +309,7 @@ def clone(self, key, newKey): self.images[newKey] = [im[0],im[1],im[2],self.nimages,im[4],im[5]] self.line += [im[0],im[1],im[2]] self.nimages += 1 - CPlot.add(self.t, 1, -1, b) + CPlot.add(self.t, 1, -1, b) # forcefitView # A appeler eventuellement si openDisplay est appele sans aucune image @@ -349,4 +349,3 @@ def getKeys(self): elif v == 8: state['right']=0 elif v == 32: state['space']=1 elif v == 27: state['escape']=1 - diff --git a/Cassiopee/Modeler/Modeler/Boxes.py b/Cassiopee/Modeler/Modeler/Boxes.py index 12bc1ef62..83a9fcbd9 100644 --- a/Cassiopee/Modeler/Modeler/Boxes.py +++ b/Cassiopee/Modeler/Modeler/Boxes.py @@ -109,7 +109,7 @@ def box2D(Pmin, Pmax, r=0., fill=True, uv=False): """2D Box with round chamfer.""" xmin = Pmin[0]; ymin = Pmin[1] xmax = Pmax[0]; ymax = Pmax[1] - dx = r*(xmax-xmin); dy = r*(ymax-ymin) + dx = r*(xmax-xmin); dy = r*(ymax-ymin) P0 = (xmin,ymin,0) P1 = (xmin,ymin+dy,0) P2 = (xmin,ymax-dy,0) diff --git a/Cassiopee/Modeler/Modeler/Cylinders.py b/Cassiopee/Modeler/Modeler/Cylinders.py index 696f7dee7..ec2d2438f 100644 --- a/Cassiopee/Modeler/Modeler/Cylinders.py +++ b/Cassiopee/Modeler/Modeler/Cylinders.py @@ -1,4 +1,4 @@ -# - Cylinders/Cones - +# - Cylinders/Cones - import Geom as D import Transform as T import Generator as G diff --git a/Cassiopee/Modeler/Modeler/Hubs.py b/Cassiopee/Modeler/Modeler/Hubs.py index 1f3ccf8aa..31c3fabf0 100644 --- a/Cassiopee/Modeler/Modeler/Hubs.py +++ b/Cassiopee/Modeler/Modeler/Hubs.py @@ -24,11 +24,11 @@ def hub1(R, zlow, zup, zcone, NbPoints): l4 = T.join([l1,l2,l3]) l4 = D.uniformize(l4, NbPoints) Ntheta = int(NbPoints*0.7) - if (Ntheta//2)*2 == Ntheta: Ntheta += 1 + if (Ntheta//2)*2 == Ntheta: Ntheta += 1 l4 = D.axisym(l4, (0.,0.,0.), (0.,0.,1.), Ntheta=Ntheta) div = NbPoints//8 l5 = T.subzone(l4,(1,1,1),(-div,1,-1)) - l5 = T.subzone(l5,(div,1,1),(-1,1,-1)) + l5 = T.subzone(l5,(div,1,1),(-1,1,-1)) l6 = P.exteriorFacesStructured(l5) z1 = l6[0] z2 = l6[1] @@ -36,4 +36,4 @@ def hub1(R, zlow, zup, zcone, NbPoints): z2 = G.TFIO(z2) proj1 = T.projectOrthoSmooth(z1, [l4], niter=3) proj2 = T.projectOrthoSmooth(z2, [l4], niter=3) - return [l5]+proj1+proj2 \ No newline at end of file + return [l5]+proj1+proj2 diff --git a/Cassiopee/Modeler/Modeler/Perso2D.py b/Cassiopee/Modeler/Modeler/Perso2D.py index caa2a4356..12e54fbef 100644 --- a/Cassiopee/Modeler/Modeler/Perso2D.py +++ b/Cassiopee/Modeler/Modeler/Perso2D.py @@ -38,7 +38,7 @@ def __init__(self, name='serge', file='Images/serge2.png'): # register sounds def registerSounds(self): - self.gob = Sound.registerSound("gob2.wav") + self.gob = Sound.registerSound("gob2.wav") self.faster = Sound.registerSound("gettin' faster.wav") # register images @@ -119,7 +119,7 @@ def checkCollision(self, world): i = max(i,0); i = min(i,world.nx-1) j = max(j,0); j = min(j,world.ny-1) #print i,j,m[i,j] - if m[i,j] == 1: # wall + if m[i,j] == 1: # wall self.playSound(self.gob) self.x -= self.vx self.y -= self.vy @@ -190,7 +190,7 @@ def render1(self, world, init=False, centerCam=True): self.animate(1./16.,4./16.) if self.vx < 0: self.animate(9./16.,12./16.) - if self.vy < 0: + if self.vy < 0: self.animate(13./16.,16./16.) b = T.translate(self.piece, (self.x, self.y, 0.001)) zones = Internal.getZones(world.all[2][3]) @@ -240,4 +240,4 @@ def autoMove(self): elif self.count < 17: pass elif self.count < 19: self.moveUp() self.count += 1 - if self.count == 19: self.count = 0 + if self.count == 19: self.count = 0 diff --git a/Cassiopee/Modeler/Modeler/Screws.py b/Cassiopee/Modeler/Modeler/Screws.py index c54d5687e..6be561941 100644 --- a/Cassiopee/Modeler/Modeler/Screws.py +++ b/Cassiopee/Modeler/Modeler/Screws.py @@ -9,9 +9,9 @@ #============================================================================== # Hexa head of screw -# IN: X: center position +# IN: X: center position # IN: r: radius of screw -# IN: h: height of screw +# IN: h: height of screw #============================================================================== def hexaScrew(X, r, h, chamfer=-1): if chamfer < 0: @@ -42,7 +42,7 @@ def hexaScrew(X, r, h, chamfer=-1): # IN: X: position # IN: r: radius # IN: h: height -# IN: drive: type of drive. 0: None, 1: straight +# IN: drive: type of drive. 0: None, 1: straight #============================================================================== def roundScrew(X, r, h, drive=0): p = D.polyline([(X[0],X[1],X[2]+h), (X[0]+0.8*r,X[1],X[2]+h*0.8), (X[0]+r,X[1],X[2])]) diff --git a/Cassiopee/Modeler/Modeler/Sound.py b/Cassiopee/Modeler/Modeler/Sound.py index a10e4696e..f07bbd0d4 100644 --- a/Cassiopee/Modeler/Modeler/Sound.py +++ b/Cassiopee/Modeler/Modeler/Sound.py @@ -3,7 +3,7 @@ # If you add a function, dont forget to add it also to SoundLess.py try: import pyaudio -except ImportError: +except ImportError: def initSound(): return None def closeSound(): return None def playMusic(fileName): return None @@ -46,10 +46,10 @@ def playMusic(fileName): musicFileHandle = wave.open(fileName, 'rb') if audioHandle is None: initSound() stream = audioHandle.open(format=audioHandle.get_format_from_width(musicFileHandle.getsampwidth()), - channels=musicFileHandle.getnchannels(), - rate=musicFileHandle.getframerate(), - output=True, - stream_callback=musicCallback__) + channels=musicFileHandle.getnchannels(), + rate=musicFileHandle.getframerate(), + output=True, + stream_callback=musicCallback__) stream.start_stream() return stream @@ -130,8 +130,8 @@ def playSound(soundHandle, poolNo=[]): elif i == 2: callback = soundCallback2__ elif i == 3: callback = soundCallback3__ else: callback = soundCallback0__ - soundPool[i] = [None, 0, soundHandle[2], soundHandle[3], soundHandle[4], - soundHandle[5], soundHandle[6]] + soundPool[i] = [None, 0, soundHandle[2], soundHandle[3], soundHandle[4], + soundHandle[5], soundHandle[6]] try: stream = audioHandle.open(format=audioHandle.get_format_from_width(soundHandle[3]), channels=soundHandle[2], @@ -154,7 +154,7 @@ def closeAllSounds(): #print('Checking pool=',i) if h is not None: s = h[0] - if not s.is_active(): + if not s.is_active(): s.close() soundPool[i] = None #print("closing pool=%d"%i) diff --git a/Cassiopee/Modeler/Modeler/SoundLess.py b/Cassiopee/Modeler/Modeler/SoundLess.py index fd2f328a7..2207b1a9a 100644 --- a/Cassiopee/Modeler/Modeler/SoundLess.py +++ b/Cassiopee/Modeler/Modeler/SoundLess.py @@ -6,7 +6,7 @@ def playMusic(fileName): return def stopMusic(musicHandle): return def endMusic(musicHandle): return def registerSound(fileName): return -def playSound(soundHandle, poolNo=[]): return +def playSound(soundHandle, poolNo=[]): return def closeAllSounds(): return def getMusicPos(): return 0 def setMusicPos(pos): return diff --git a/Cassiopee/Modeler/Modeler/Spirographs.py b/Cassiopee/Modeler/Modeler/Spirographs.py index 96a5906cf..3f58dea0b 100644 --- a/Cassiopee/Modeler/Modeler/Spirographs.py +++ b/Cassiopee/Modeler/Modeler/Spirographs.py @@ -6,7 +6,7 @@ # IN: 0<=k<=1 ; 0<=l<=1 # IN: Ns: nbre de courbes # IN: N: nbre de pts sur une courbe -#============================================================================= +#============================================================================= def spirograph(k, l, Ns=1, N=100): out = []; s = 0. for i in range(Ns): @@ -15,4 +15,4 @@ def spirograph(k, l, Ns=1, N=100): #if s*(1.-k)/k > 1.: go = False s += 1. out.append(a) - return out + return out diff --git a/Cassiopee/Modeler/Modeler/Walls.py b/Cassiopee/Modeler/Modeler/Walls.py index aa46a73f5..7221663d3 100644 --- a/Cassiopee/Modeler/Modeler/Walls.py +++ b/Cassiopee/Modeler/Modeler/Walls.py @@ -29,7 +29,7 @@ def wall(line,Bx,By,Bz,nlayers=1,chamfer=-1., shrink=1.): [x,y,z] = C.getValue(line, i) [xp,yp,zp] = C.getValue(line, i+1) - if n%2 == 0: + if n%2 == 0: xi = 0.5*(x+xp); yi = 0.5*(y+yp) bx2 = T.translate(bx, (xi,yi,posZ)) if xp-x>1.e-16: alpha = math.atan((yp-y)/(xp-x)) diff --git a/Cassiopee/Modeler/Modeler/Wings.py b/Cassiopee/Modeler/Modeler/Wings.py index 1e7480b09..7a0d48ade 100644 --- a/Cassiopee/Modeler/Modeler/Wings.py +++ b/Cassiopee/Modeler/Modeler/Wings.py @@ -448,7 +448,7 @@ def splinelaw(polyLine, N=100, Distribution=None, SplineDegree=3): def wing(sections=[airfoil(),airfoil()], span=[1.], washout=[0.], sweep=[0.], - dihedral=[0.], distribution=[{'points':10}],sectionShapeLaw='linear'): + dihedral=[0.], distribution=[{'points':10}],sectionShapeLaw='linear'): ''' This function builds an airplane's wing section by section, using typical aerodynamic parameters. The result is a structured surface. @@ -540,7 +540,7 @@ def wing(sections=[airfoil(),airfoil()], span=[1.], washout=[0.], sweep=[0.], k0 = 0 PreviousSpan = 0. # and this is its corresponding spanwise position for w in range(WingElts): -# print 'k0:',k0,'PreviousSpan',PreviousSpan,'k0+Ne[w]:',k0+Ne[w] + # print 'k0:',k0,'PreviousSpan',PreviousSpan,'k0+Ne[w]:',k0+Ne[w] disI = 0 if len(distribution) != WingElts else w Interpolation = 'linear' if not 'kind' in distribution[disI] else distribution[disI]['kind'] if Interpolation == 'linear': @@ -575,15 +575,15 @@ def wing(sections=[airfoil(),airfoil()], span=[1.], washout=[0.], sweep=[0.], # Old version, makes interpX = scipy.interpolate.interp1d( SectionsSpanPositions, InterpXmatrix, axis=0, - kind=sectionShapeLaw, bounds_error=False, fill_value=InterpXmatrix[0,:]) + kind=sectionShapeLaw, bounds_error=False, fill_value=InterpXmatrix[0,:]) interpY = scipy.interpolate.interp1d( SectionsSpanPositions, InterpYmatrix, axis=0, - kind=sectionShapeLaw, bounds_error=False, fill_value=InterpYmatrix[0,:]) + kind=sectionShapeLaw, bounds_error=False, fill_value=InterpYmatrix[0,:]) # Constructs the wing section by section for k in range(Ntot): # X and Y coords are based upon the interpolating functions -# print 'shape interpX(ElementSpanPositions[k]):',interpX(ElementSpanPositions[k]).shape -# print 'shape Wing[1][0][:,:,k]',Wing[1][0][:,:,k].shape + # print 'shape interpX(ElementSpanPositions[k]):',interpX(ElementSpanPositions[k]).shape + # print 'shape Wing[1][0][:,:,k]',Wing[1][0][:,:,k].shape Wing[1][0][:,:,k] = interpX(ElementSpanPositions[k])[numpy.newaxis].T#numpy.reshape(interpX(ElementSpanPositions[k]).flatten(),(W4dims[1],W4dims[2]),order='F') Wing[1][1][:,:,k] = interpY(ElementSpanPositions[k])[numpy.newaxis].T#numpy.reshape(interpY(ElementSpanPositions[k]).flatten(),(W4dims[1],W4dims[2]),order='F') # Z coords: @@ -681,11 +681,11 @@ def sweepSections(sections=[airfoil(),airfoil()], SpanPositions=None, # Makes the interpolation functions interpX = scipy.interpolate.interp1d( SpanPositions, InterpXmatrix, axis=0, - kind=sectionShapeLaw, bounds_error=False, fill_value=InterpXmatrix[0,:]) + kind=sectionShapeLaw, bounds_error=False, fill_value=InterpXmatrix[0,:]) interpY = scipy.interpolate.interp1d( SpanPositions, InterpYmatrix, axis=0, - kind=sectionShapeLaw, bounds_error=False, fill_value=InterpYmatrix[0,:]) + kind=sectionShapeLaw, bounds_error=False, fill_value=InterpYmatrix[0,:]) interpR = scipy.interpolate.interp1d( SpanPositions, rotation, axis=0, - kind=rotationLaw, bounds_error=False, fill_value=rotation[0]) + kind=rotationLaw, bounds_error=False, fill_value=rotation[0]) # Constructs the surface plane by plane InterpolatedProfiles = [sections[0]] @@ -696,18 +696,18 @@ def sweepSections(sections=[airfoil(),airfoil()], SpanPositions=None, # Z coords results of a imposed twist + 3D rotation + translation # imposed twist InterpolatedProfiles[k] = T.rotate(InterpolatedProfiles[k],(0,0,0), - (0.,0.,interpR(UnitCurvAbscissa[k]))) + (0.,0.,interpR(UnitCurvAbscissa[k]))) # 3D rotation: We look for the local reference frame e1 e2 e3 e3 = Tang[1][:,k].flatten() e2 = numpy.cross(e3,NormalDirection) e2 /= numpy.linalg.norm(e2) # normalization e1 = numpy.cross(e2,e3) InterpolatedProfiles[k] = T.rotate(InterpolatedProfiles[k],(0.,0.,0.), - ((1.,0.,0.),(0,1,0),(0,0,1)),(e1, e2, e3) ) + ((1.,0.,0.),(0,1,0),(0,0,1)),(e1, e2, e3) ) # translation InterpolatedProfiles[k] = T.translate(InterpolatedProfiles[k], - (spine[1][0][k],spine[1][1][k],spine[1][2][k])) + (spine[1][0][k],spine[1][1][k],spine[1][2][k])) # The interpolated profile at this point is done, we save it in our mesh # First we translate it into Arrays3D format InterpolatedProfiles[k] = Converter.Array3D.convertArrays2Arrays3D([InterpolatedProfiles[k]])[0] @@ -719,4 +719,3 @@ def sweepSections(sections=[airfoil(),airfoil()], SpanPositions=None, InterpolatedProfiles.append(sections[0]) return Converter.Array3D.convertArrays3D2Arrays([Surf])[0] - diff --git a/Cassiopee/Modeler/Modeler/WingsPT.py b/Cassiopee/Modeler/Modeler/WingsPT.py index faef815fb..273a82876 100644 --- a/Cassiopee/Modeler/Modeler/WingsPT.py +++ b/Cassiopee/Modeler/Modeler/WingsPT.py @@ -55,12 +55,12 @@ def airfoil(designation='NACA0012',Ntop=None, Nbot=None, ChordLength=1., TopDist but based only on the X coordinate. Usage example: airfoil(designation,Ntop,Nbot,ChordLength,TopDistribution, BottomDistribution,Closed,LeadingEdgePos ) - """ + """ a = Aero.airfoil(designation,Ntop,Nbot,ChordLength,TopDistribution, BottomDistribution,Closed,LeadingEdgePos) return C.convertArrays2ZoneNode('airfoil'+designation, [a]) -def linelaw(P1=(0,0,0), P2=(1,0,0), N=100, Distribution = None): +def linelaw(P1=(0,0,0), P2=(1,0,0), N=100, Distribution=None): """Create a line of N points following a given point Distribution. Distribution is a dictionnary with fields: 'kind' of law: 'linear', 'tanhOneSide', 'tanhTwoSides', 'trigonometric' @@ -81,7 +81,7 @@ def splinelaw(polyLine,N=100,Distribution=None,SplineDegree=3): """ polyLineA = C.getFields(Internal.__GridCoordinates__, polyLine)[0] a = Aero.splinelaw(polyLineA,N,Distribution,SplineDegree) - return C.convertArrays2ZoneNode('splinelaw', [a]) + return C.convertArrays2ZoneNode('splinelaw', [a]) def printSmth(string): return Aero.printSmth(string) @@ -94,8 +94,8 @@ def pyTreeExample(z): def pyTreeExample1(t): return aero.pyTreeExample1(t) -def wing(sections=[airfoil(),airfoil()], span=[1.], washout=[0.], sweep=[0.], - dihedral=[0.], distribution=[{'points':10}],sectionShapeLaw='linear'): +def wing(sections=[airfoil(),airfoil()], span=[1.], washout=[0.], sweep=[0.], + dihedral=[0.], distribution=[{'points':10}],sectionShapeLaw='linear'): ''' This function builds an airplane's wing section by section, using typical aerodynamic parameters. The result is a structured surface. @@ -136,19 +136,19 @@ def wing(sections=[airfoil(),airfoil()], span=[1.], washout=[0.], sweep=[0.], angles are applied is the origin (0,0,0), which corresponds by default to the Leading Edge of the airfoil. If you wish to re-position this reference, you may apply a translation to the wing sections beforehand. - ''' + ''' sectionsA = [] for i in range(len(sections)): sectionsA.append(C.getFields(Internal.__GridCoordinates__, sections[i])[0]) - a = Aero.wing(sectionsA, span, washout, sweep, - dihedral, distribution,sectionShapeLaw) - return C.convertArrays2ZoneNode('wing', [a]) + a = Aero.wing(sectionsA, span, washout, sweep, + dihedral, distribution,sectionShapeLaw) + return C.convertArrays2ZoneNode('wing', [a]) def sweepSections(sections=[airfoil(),airfoil()], SpanPositions=None, rotation=[0.], rotationLaw='linear', NormalDirection=np.array([1,0,0]), - spine=linelaw(P2=(0,0,1)), sectionShapeLaw='linear'): + spine=linelaw(P2=(0,0,1)), sectionShapeLaw='linear'): ''' This function builds a sweep surface from a given profile, or a set of profiles, throughout a spine. The result is a structured surface. @@ -189,11 +189,11 @@ def sweepSections(sections=[airfoil(),airfoil()], SpanPositions=None, XY plane. The reference point from which the rotation angles are applied is the origin (0,0,0). If you wish to re-position this reference, you may apply a translation to the sections beforehand. - ''' + ''' sectionsA = [] for i in range(len(sections)): sectionsA.append(C.getFields(Internal.__GridCoordinates__, sections[i])[0]) spineA = C.getFields(Internal.__GridCoordinates__, spine)[0] a = Aero.sweepSections(sectionsA, SpanPositions, rotation, rotationLaw, - NormalDirection, spineA, sectionShapeLaw) - return C.convertArrays2ZoneNode('sweep', [a]) + NormalDirection, spineA, sectionShapeLaw) + return C.convertArrays2ZoneNode('sweep', [a]) diff --git a/Cassiopee/Modeler/Modeler/World2D.py b/Cassiopee/Modeler/Modeler/World2D.py index e699dbc6d..7170a3e5a 100644 --- a/Cassiopee/Modeler/Modeler/World2D.py +++ b/Cassiopee/Modeler/Modeler/World2D.py @@ -36,7 +36,7 @@ def __init__(self, fileName=None): # World map self.map = numpy.zeros( (0,0), dtype=numpy.int32 ) # pyTree world - self.world = None + self.world = None # pyTree all self.all = C.newPyTree(['World', 'Objects', 'Persos']) # object i,j-> no de la zone correspondante @@ -144,8 +144,8 @@ def build(self): # Static first display of static world def render(self): CPlot.display(self.all, bgColor=1, shadow=0, mode='render', - posCam=(self.nx*0.5, self.ny*0.5, 20.), - posEye=(self.nx*0.5,self.ny*0.5,0), + posCam=(self.nx*0.5, self.ny*0.5, 20.), + posEye=(self.nx*0.5,self.ny*0.5,0), dirCam=(0,1,0), meshStyle=3) CPlot.setState(activateShortCuts=0, displayInfo=0) diff --git a/Cassiopee/Modeler/Modeler/WorldZ.py b/Cassiopee/Modeler/Modeler/WorldZ.py index ed9ac3a76..fc094a74f 100644 --- a/Cassiopee/Modeler/Modeler/WorldZ.py +++ b/Cassiopee/Modeler/Modeler/WorldZ.py @@ -24,7 +24,7 @@ def initGround(a, type=0): elif type == 2: Converter._initVars(a, '{z}=3.*(3*cos(0.01*{x})+cos(0.1*{x}))*sin(0.01*{y})') else: - Converter._initVars(a, '{z}=floor(5*cos(0.1*{x})*sin(0.01*{y}))') + Converter._initVars(a, '{z}=floor(5*cos(0.1*{x})*sin(0.01*{y}))') return a # -getZ- @@ -88,7 +88,7 @@ def getKeys(state): elif v == 7: state['left']=0 elif v == 4: state['right']=1 elif v == 8: state['right']=0 - elif v == 106: state['jump']=1 + elif v == 106: state['jump']=1 CPlot.resetKeyboard() # - move viewer forward - @@ -97,7 +97,7 @@ def getKeys(state): # IN: headstop: limite les mouvements de tete def moveForward(zmap, pos, unit=1., headStop=0.1): (x,y,z) = pos[0] # position of viewer - posCam = pos[0] + posCam = pos[0] (xe,ye,ze) = pos[1] # posEye H = pos[2] # hauteur viewer deltaZ = pos[3] # deltaZ permis @@ -294,11 +294,11 @@ def simpleLoop2(zmap, pos, unit=0.3): while 1 != 2: getKeys(kstate) if kstate['forward'] == 1: # forward - pos = moveForward(zmap, pos, unit) + pos = moveForward(zmap, pos, unit) if kstate['backward'] == 1: #backward - pos = moveBackward(zmap, pos, unit) + pos = moveBackward(zmap, pos, unit) if kstate['left'] == 1: # left - pos = turnLeft(zmap, pos, 5.) + pos = turnLeft(zmap, pos, 5.) if kstate['right'] == 1: # right pos = turnRight(zmap, pos, 5.) if kstate['jump'] == 1: # jump @@ -307,4 +307,3 @@ def simpleLoop2(zmap, pos, unit=0.3): pos = completeMotion(zmap, pos) time.sleep(0.05) t += 1 - diff --git a/Cassiopee/Modeler/doc/source/conf.py b/Cassiopee/Modeler/doc/source/conf.py index 8d528e050..f568f68c2 100644 --- a/Cassiopee/Modeler/doc/source/conf.py +++ b/Cassiopee/Modeler/doc/source/conf.py @@ -192,15 +192,15 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', -'preamble': r''' + # Additional stuff for the LaTeX preamble. + #'preamble': '', + 'preamble': r''' \usepackage{charter} \usepackage[defaultsans]{lato} \usepackage{inconsolata} @@ -211,8 +211,8 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('Modeler', 'Modeler.tex', u'Modeler Documentation', - u'/ELSA/MU-10020/V'+__version__, 'manual'), + ('Modeler', 'Modeler.tex', u'Modeler Documentation', + u'/ELSA/MU-10020/V'+__version__, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -255,9 +255,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'CPlot', u'CPlot Documentation', - u'ONERA', 'CPlot', 'One line description of project.', - 'Miscellaneous'), + ('index', 'CPlot', u'CPlot Documentation', + u'ONERA', 'CPlot', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/Modeler/setup.py b/Cassiopee/Modeler/setup.py index 378d43d1c..d5ae7a0ab 100644 --- a/Cassiopee/Modeler/setup.py +++ b/Cassiopee/Modeler/setup.py @@ -44,7 +44,7 @@ url="https://cassiopee.onera.fr", packages=['Modeler'], package_dir={"":"."} - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Modeler/test/animator2D.py b/Cassiopee/Modeler/test/animator2D.py index d31c507eb..b6c8d20bd 100644 --- a/Cassiopee/Modeler/test/animator2D.py +++ b/Cassiopee/Modeler/test/animator2D.py @@ -52,7 +52,7 @@ def triste(): while 1 != 2: r = random.randint(0,20) if r == 0 or r == 1 or r == 2: cligne() - elif r == 5: + elif r == 5: triste() elif r == 8: souris() time.sleep(0.5) diff --git a/Cassiopee/Modeler/test/animator2DParticles.py b/Cassiopee/Modeler/test/animator2DParticles.py index bef440ac7..450f9cf0d 100644 --- a/Cassiopee/Modeler/test/animator2DParticles.py +++ b/Cassiopee/Modeler/test/animator2DParticles.py @@ -13,4 +13,3 @@ for i in range(100): a.animateParticles('particules1', 0.001, 0.1) time.sleep(0.1) - diff --git a/Cassiopee/Modeler/test/animator2DViz.py b/Cassiopee/Modeler/test/animator2DViz.py index e809a9dc1..76a7a0fae 100644 --- a/Cassiopee/Modeler/test/animator2DViz.py +++ b/Cassiopee/Modeler/test/animator2DViz.py @@ -37,7 +37,7 @@ while 1 != 2: l = '' while l == '': - time.sleep(0.01); l = CPlot.getKeyboard(); + time.sleep(0.01); l = CPlot.getKeyboard(); CPlot.resetKeyboard() v = ord(l[0]) if v == 3: # droite @@ -70,4 +70,3 @@ posCam = (posCam[0],posCam[1],posCam[2]+delta*0.1) posEye = (posEye[0],posEye[1],posEye[2]) CPlot.setState(posCam=posCam, posEye=posEye) - diff --git a/Cassiopee/Modeler/test/box2.py b/Cassiopee/Modeler/test/box2.py index d1c63ee73..773d3a0da 100644 --- a/Cassiopee/Modeler/test/box2.py +++ b/Cassiopee/Modeler/test/box2.py @@ -20,7 +20,7 @@ allObjects.append(a) pos = World.placeViewerAtCenter(zmap) -CPlot.display(allObjects, displayInfo=0, bgColor=1, shadow=0, posCam=pos[0], +CPlot.display(allObjects, displayInfo=0, bgColor=1, shadow=0, posCam=pos[0], posEye=pos[1], meshStyle=3) World.simpleLoop2(zmap, pos) #C.convertArrays2File(allObjects, 'out.plt') diff --git a/Cassiopee/Modeler/test/column.py b/Cassiopee/Modeler/test/column.py index 3a4afb9a2..3e4be5f9f 100644 --- a/Cassiopee/Modeler/test/column.py +++ b/Cassiopee/Modeler/test/column.py @@ -10,7 +10,7 @@ a2 = Models.column2(R1=1, R2=0.8, N=20, h=10.) a2 = T.translate(a2, (0,5,0)) -# Column with +# Column with a3 = Models.column3(R1=1, R2=0.8, N=31, h=10.) a3 = T.translate(a3, (0,10,0)) diff --git a/Cassiopee/Modeler/test/column_t1.py b/Cassiopee/Modeler/test/column_t1.py index 515b20526..bafd5d51a 100644 --- a/Cassiopee/Modeler/test/column_t1.py +++ b/Cassiopee/Modeler/test/column_t1.py @@ -10,7 +10,7 @@ a2 = Models.column2(R1=1, R2=0.8, N=20, h=10.) a2 = T.translate(a2, (0,5,0)) -# Column with +# Column with a3 = Models.column3(R1=1, R2=0.8, N=31, h=10.) a3 = T.translate(a3, (0,10,0)) diff --git a/Cassiopee/Modeler/test/table.py b/Cassiopee/Modeler/test/table.py index c21853b21..eba897c80 100644 --- a/Cassiopee/Modeler/test/table.py +++ b/Cassiopee/Modeler/test/table.py @@ -6,4 +6,3 @@ a = Models.table1(L=2., W=1., H=1.) b = Models.table2(L=0.6, H=1., N=20); b = T.translate(b, (0,3,0)) C.convertArrays2File(a+b, 'out.plt') - diff --git a/Cassiopee/Modeler/test/walk.py b/Cassiopee/Modeler/test/walk.py index 3f9483eb5..ef006190f 100644 --- a/Cassiopee/Modeler/test/walk.py +++ b/Cassiopee/Modeler/test/walk.py @@ -46,7 +46,7 @@ # position du viewer (posCam, posEye, Height of viewer, deltaZ, speed) pos = [(zmap[2]/2,zmap[3]/2,0), (zmap[2]/2+1,zmap[2]/2,0), 1., 1., 0.] pos = World.placeViewer(zmap, pos) -CPlot.display(allObjects, displayInfo=0, bgColor=1, shadow=0, posCam=pos[0], +CPlot.display(allObjects, displayInfo=0, bgColor=1, shadow=0, posCam=pos[0], posEye=pos[1], meshStyle=3) #, stereo=2, stereoDist=0.3) #CPlot.setState(message='u: forward, j: backward, h: turn left, k: turn right') @@ -58,9 +58,9 @@ while 1 != 2: World.getKeys(kstate) if kstate['forward'] == 1: # forward - pos = World.moveForward(zmap, pos, 0.5) + pos = World.moveForward(zmap, pos, 0.5) if kstate['backward'] == 1: #backward - pos = World.moveBackward(zmap, pos, 0.5) + pos = World.moveBackward(zmap, pos, 0.5) if kstate['left'] == 1: # left pos = World.turnLeft(zmap, pos, 5.) if kstate['right'] == 1: # right diff --git a/Cassiopee/Modeler/test/worldZ0.py b/Cassiopee/Modeler/test/worldZ0.py index 983829b85..4222293c9 100644 --- a/Cassiopee/Modeler/test/worldZ0.py +++ b/Cassiopee/Modeler/test/worldZ0.py @@ -38,7 +38,7 @@ # position du viewer (posCam, posEye, Height of viewer, deltaZ) pos = World.placeViewerAtCenter(zmap) -CPlot.display(allObjects, displayInfo=0, bgColor=1, shadow=0, posCam=pos[0], +CPlot.display(allObjects, displayInfo=0, bgColor=1, shadow=0, posCam=pos[0], posEye=pos[1], meshStyle=3) #, stereo=2, stereoDist=0.3) World.simpleLoop(zmap, pos) diff --git a/Cassiopee/Modeler/test/worldZ1.py b/Cassiopee/Modeler/test/worldZ1.py index 962154c56..4f0172c76 100644 --- a/Cassiopee/Modeler/test/worldZ1.py +++ b/Cassiopee/Modeler/test/worldZ1.py @@ -57,7 +57,7 @@ # position du viewer (posCam, posEye, Height of viewer, deltaZ, speed) pos = [(zmap[2]/2,zmap[3]/2,0), (zmap[2]/2+1,zmap[2]/2,0), 1., 1.5, 0.] pos = World.placeViewer(zmap, pos) -CPlot.display(allObjects, displayInfo=0, bgColor=1, shadow=0, posCam=pos[0], +CPlot.display(allObjects, displayInfo=0, bgColor=1, shadow=0, posCam=pos[0], posEye=pos[1], meshStyle=3) #, stereo=2, stereoDist=0.3) #CPlot.setState(message='u: forward, j: backward, h: turn left, k: turn right') @@ -68,11 +68,11 @@ while 1 != 2: World.getKeys(kstate) if kstate['forward'] == 1: # forward - pos = World.moveForward(zmap, pos, 0.3) + pos = World.moveForward(zmap, pos, 0.3) if kstate['backward'] == 1: #backward - pos = World.moveBackward(zmap, pos, 0.3) + pos = World.moveBackward(zmap, pos, 0.3) if kstate['left'] == 1: # left - pos = World.turnLeft(zmap, pos, 5.) + pos = World.turnLeft(zmap, pos, 5.) if kstate['right'] == 1: # right pos = World.turnRight(zmap, pos, 5.) if kstate['jump'] == 1: # jump diff --git a/Cassiopee/Modeler/test/worldZ2.py b/Cassiopee/Modeler/test/worldZ2.py index f59c8dc51..49a192557 100644 --- a/Cassiopee/Modeler/test/worldZ2.py +++ b/Cassiopee/Modeler/test/worldZ2.py @@ -108,7 +108,7 @@ #pos = [(zmap[2]/2,zmap[3]/2,0), (zmap[2]/2+1,zmap[2]/2,0), 1., 1., 0] pos = [(0,25,0), (1,25,0),1,0.3,0] pos = World.placeViewer(zmap, pos) -CPlot.display(allObjects, displayInfo=0, bgColor=1, shadow=0, posCam=pos[0], +CPlot.display(allObjects, displayInfo=0, bgColor=1, shadow=0, posCam=pos[0], posEye=pos[1], meshStyle=3) #, stereo=2, stereoDist=0.3) CPlot.setState(activateShortCuts=0) @@ -118,11 +118,11 @@ while 1 != 2: World.getKeys(kstate) if kstate['forward'] == 1: # forward - pos = World.moveForward(zmap, pos, 0.3) + pos = World.moveForward(zmap, pos, 0.3) if kstate['backward'] == 1: #backward - pos = World.moveBackward(zmap, pos, 0.3) + pos = World.moveBackward(zmap, pos, 0.3) if kstate['left'] == 1: # left - pos = World.turnLeft(zmap, pos, 5.) + pos = World.turnLeft(zmap, pos, 5.) if kstate['right'] == 1: # right pos = World.turnRight(zmap, pos, 5.) if kstate['jump'] == 1: # jump diff --git a/Cassiopee/OCC/OCC/OCC.py b/Cassiopee/OCC/OCC/OCC.py index 22bb67ed6..be2606f04 100644 --- a/Cassiopee/OCC/OCC/OCC.py +++ b/Cassiopee/OCC/OCC/OCC.py @@ -12,15 +12,15 @@ import Converter.Mpi as Cmpi __all__ = ['convertCAD2Arrays', 'switch2UV', 'switch2UV2', '_scaleUV', '_unscaleUV', -'meshSTRUCT', 'meshSTRUCT__', 'meshTRI', 'meshTRI__', 'meshTRIU__', -'meshTRIHO', 'meshQUAD', 'meshQUAD__', 'meshQUADHO', 'meshQUADHO__', -'ultimate', 'meshAllEdges', 'meshAllFacesTri', 'meshAllFacesStruct'] + 'meshSTRUCT', 'meshSTRUCT__', 'meshTRI', 'meshTRI__', 'meshTRIU__', + 'meshTRIHO', 'meshQUAD', 'meshQUAD__', 'meshQUADHO', 'meshQUADHO__', + 'ultimate', 'meshAllEdges', 'meshAllFacesTri', 'meshAllFacesStruct'] # algo=0: mailleur open cascade (chordal_error) # algo=1: algorithme T3mesher (h, chordal_error, growth_ratio) # algo=2: algorithme T3mesher (h, chordal_error, growth_ratio, merge_tol) -def convertCAD2Arrays(fileName, format=None, - h=0., chordal_err=0., growth_ratio=0., +def convertCAD2Arrays(fileName, format=None, + h=0., chordal_err=0., growth_ratio=0., merge_tol=-1, algo=1, join=True): """Convert a CAD (IGES or STEP) file to arrays. Usage: a = convertCAD2Arrays(fileName, options)""" @@ -116,7 +116,7 @@ def meshSTRUCT(fileName, format='fmt_iges', N=11): # IN: hook: CAD hook # IN: faceSubSet: a list of faces to mesh # OUT: faceNo: keep the CAD face number for each zone -# OUT: one mesh per CAD face +# OUT: one mesh per CAD face def meshSTRUCT__(hook, N=11, faceSubset=None, faceNo=None): """Return a STRUCT discretisation of CAD.""" nbFaces = occ.getNbFaces(hook) @@ -160,7 +160,7 @@ def meshTRI(fileName, format="fmt_step", N=11, hmax=-1., order=1): # IN: hook: CAD hook # IN: faceSubSet: a list of faces to mesh # OUT: faceNo: keep the CAD face number for each zone -# OUT: one mesh per CAD face +# OUT: one mesh per CAD face def meshTRI__(hook, N=11, hmax=-1., hausd=-1., order=1, faceSubset=None, faceNo=None): """Return a TRI discretisation of CAD.""" if hmax > 0 and hausd > 0: out = meshTRIH2__(hook, hmax, hausd, order, faceSubset, faceNo) @@ -209,17 +209,17 @@ def reorderEdgesByFace__(edges): #order = 1 #if ind0 == inds[0]: # if ind1 == inds[0]-1: order = -1 - # elif ind1 == inds[0]+1: order = 1 + # elif ind1 == inds[0]+1: order = 1 #elif ind0 == inds[1]: # if ind1 == inds[1]-1: order = -1 - # elif ind1 == inds[0]+1: order = 1 + # elif ind1 == inds[0]+1: order = 1 #else: # ind0 = inds[2] # if ind1 == inds[2]-1: order = -1 # elif ind1 == inds[2]+1: order = 1 #print('order', order) nz = 1; order = 1 except: - print("Warning: finding the exterior edge failed.") + print("Warning: finding the exterior edge failed.") surf = 0.; nz = 1.; order = 1 sortedEdges.append((e, surf, nz, order)) sorted(sortedEdges, key=itemgetter(1), reverse=True) @@ -327,7 +327,7 @@ def meshTRIH__(hook, hmax=-1., hausd=-1, order=1, faceSubset=None, faceNo=None): edges = Transform.join(edges) edges = Generator.close(edges, 1.e-6) edges = reorderEdgesByFace__(edges) - try: + try: a = Generator.T3mesher2D(edges, grading=1.) _unscaleUV([a], T) if order > 1: a = Converter.convertLO2HO(a, order=order) @@ -366,8 +366,8 @@ def meshTRIH2__(hook, hmax=-1., hausd=-1, order=1, faceSubset=None, faceNo=None) def meshTRIHO(fileName, format="fmt_step", N=11): """Return a TRI HO discretisation of CAD.""" - a = convertCAD2Arrays(fileName, format, - h=0., chordal_err=0., growth_ratio=0., + a = convertCAD2Arrays(fileName, format, + h=0., chordal_err=0., growth_ratio=0., merge_tol=-1, algo=2) #a = meshTRI(fileName, format, N) hook = occ.readCAD(fileName, format) @@ -386,7 +386,7 @@ def meshQUADHO(fileName, format="fmt_step", N=11): def meshQUADHO__(hook, N=11, faceSubset=None, faceNo=None): """Return a QUAD HO discretisation of CAD.""" - if faceNo is None: faceNo = [] + if faceNo is None: faceNo = [] a = meshSTRUCT__(hook, N, faceSubset, faceNo) a = Converter.convertArray2Hexa(a) out = [] @@ -541,7 +541,7 @@ def meshFaceWithMetric(hook, i, edges, hmin, hmax, hausd, mesh, FAILED): try: a = occ.trimesh(hook, edges, i, hmin, hmax, hausd, 1.1) _enforceEdgesInFace(a, edgesSav) - if occ.getFaceOrientation(hook, i) == 0: + if occ.getFaceOrientation(hook, i) == 0: a = Transform.reorder(a, (-1,)) mesh.append(a) SUCCESS = True @@ -567,7 +567,7 @@ def meshFaceInUV(hook, i, edges, grading, mesh, FAILED): # Maillage de la face try: - a = Generator.T3mesher2D(edges, grading=grading) + a = Generator.T3mesher2D(edges, grading=grading) _unscaleUV([a], T) o = occ.evalFace(hook, a, i) _enforceEdgesInFace(o, edgesSav) diff --git a/Cassiopee/OCC/OCC/PyTree.py b/Cassiopee/OCC/OCC/PyTree.py index 63506a963..3a48a9168 100644 --- a/Cassiopee/OCC/OCC/PyTree.py +++ b/Cassiopee/OCC/OCC/PyTree.py @@ -17,8 +17,8 @@ #============================================================================== # -- convertCAD2PyTree -- #============================================================================== -def convertCAD2PyTree(fileName, format=None, h=0., chordal_err=0., - growth_ratio=0., merge_tol=-1, algo=1, join=True): +def convertCAD2PyTree(fileName, format=None, h=0., chordal_err=0., + growth_ratio=0., merge_tol=-1, algo=1, join=True): """Convert a CAD (IGES or STEP) file to pyTree. Usage: convertCAD2PyTree(fileName, options)""" a = OCC.convertCAD2Arrays(fileName, format, h, chordal_err, growth_ratio, merge_tol, algo, join) @@ -42,7 +42,7 @@ def convertCAD2PyTree(fileName, format=None, h=0., chordal_err=0., z = Internal.createZoneNode(C.getZoneName('Zone'), i, [], Internal.__GridCoordinates__, Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + Internal.__FlowSolutionCenters__) t[2][base2][2].append(z) else: if not base3: @@ -86,7 +86,7 @@ def convertCAD2PyTree(fileName, format=None, h=0., chordal_err=0., def meshSTRUCT(fileName, format="fmt_step", N=11): """Return a STRUCT discretisation of CAD.""" hook = OCC.occ.readCAD(fileName, format) - return meshSTRUCT__(hook, N) + return meshSTRUCT__(hook, N) def meshSTRUCT__(hook, N=11, faceSubset=None, linkFaceNo=None): """Return a STRUCT discretisation of CAD.""" @@ -106,7 +106,7 @@ def meshSTRUCT__(hook, N=11, faceSubset=None, linkFaceNo=None): def meshTRI(fileName, format="fmt_step", N=11, hmax=-1., order=1): """Return a TRI discretisation of CAD.""" hook = OCC.occ.readCAD(fileName, format) - return meshTRI__(hook, N, hmax, order) + return meshTRI__(hook, N, hmax, order) def meshTRI__(hook, N=11, hmax=-1., order=1, faceSubset=None, linkFaceNo=None): """Return a TRI discretisation of CAD.""" @@ -218,7 +218,7 @@ def __init__(self, fileName, format='fmt_iges'): self.fileName = fileName self.format = format self.hook = None # hook on OCC tree - self.faces = [] # list of CAD faces (class) + self.faces = [] # list of CAD faces (class) self.edges = [] # list of CAD edges (class) self.zones = [] # associated discretization (list of zones) @@ -236,11 +236,11 @@ def evalFace(self, face, distribution): """Evaluate face at given parameters.""" if isinstance(face, int): no = face else: no = face.number - if isinstance(distribution, tuple): + if isinstance(distribution, tuple): d = Converter.array('x,y,z', 1,1,1) d[1][0,0] = distribution[0] d[1][1,0] = distribution[1] - d[1][2,0] = 0. + d[1][2,0] = 0. else: d = C.getFields(Internal.__GridCoordinates__, distribution, api=2)[0] m = OCC.occ.evalFace(self.hook, d, no) @@ -742,7 +742,7 @@ def _setCADcontainer(t, fileName, fileFmt, hmin, hmax, hausd): # mesh all edges def _meshAllEdges(hook, t, hmin=-1., hmax=-1, hausd=-1, N=-1, edgeList=None): - if edgeList is None: + if edgeList is None: nbEdges = occ.getNbEdges(hook) edgeList = range(1, nbEdges+1) @@ -788,7 +788,7 @@ def _remeshAllEdgesOdd(hook, t): z[2].append(cad) if render is not None: z[2].append(render) b[2][edgeno-1] = z - return None + return None def getCADcontainer(t): hmin = None; hmax = None; hausd = None @@ -948,8 +948,8 @@ def _setLonelyEdgesColor(t): elif size == 1: # lonely: red L = D.getLength(ze) if L > 1.e-16: CPlot._addRender2Zone(ze, color='Red') - else: CPlot._addRender2Zone(ze, color='Green') - else: # strange!! + else: CPlot._addRender2Zone(ze, color='Green') + else: # strange!! CPlot._addRender2Zone(ze, color='Green') return None @@ -1263,13 +1263,13 @@ def getFileAndFormat(hook): return OCC.occ.getFileAndFormat(hook) # IN: new2old: new2old map -# IN: Nold: size of old entities +# IN: Nold: size of old entities # OUT: odl2new array def getOld2NewMap(Nold, new2old): old2new = numpy.zeros( (Nold), dtype=Internal.E_NpyInt) old2new[:] = -1 Nnew = len(new2old) - for n in range(Nnew): + for n in range(Nnew): v = new2old[n] if v > 0: old2new[v-1] = n+1 return old2new @@ -1303,7 +1303,7 @@ def _updateEdgesNumbering__(t, old2NewEdgeMap, old2NewFaceMap): n = Internal.getNodeFromName1(CAD, 'faceList') if n is not None: pn = n[1]; index = [] - for i in range(pn.size): + for i in range(pn.size): pn[i] = old2NewFaceMap[pn[i]-1] if pn[i] == -1: index.append(i) n[1] = numpy.delete(pn, index) diff --git a/Cassiopee/OCC/OCC/depend.py b/Cassiopee/OCC/OCC/depend.py index df3f1295e..865bceee2 100644 --- a/Cassiopee/OCC/OCC/depend.py +++ b/Cassiopee/OCC/OCC/depend.py @@ -4,7 +4,7 @@ exp = RE.compile("#include") MODS = ['TKBool', 'TKBRep', 'TKernel', - 'TKG2d', 'TKG3d', 'TKGeomAlgo', + 'TKG2d', 'TKG3d', 'TKGeomAlgo', 'GeomBase', 'TKIGES', 'TKMath', 'TKPrim', 'TKShHealing', 'TKTopAlgo', 'TKXSBase'] @@ -25,8 +25,8 @@ def checkDepend(file, dic): f = open(i+'/'+file, "r") print('Found %s.'%(i+'/'+file)) break - except: pass - if f is None: + except: pass + if f is None: print('File %s not found.'%file); return lines = f.readlines() @@ -73,7 +73,7 @@ def rebuild(dic): #============================================================================== # Ecrit les sources (.cxx) par modules -#============================================================================== +#============================================================================== def writeSources(dic): keys = dic.keys() print('== Sources (%d) =='%len(keys)) @@ -112,7 +112,7 @@ def writeSources(dic): end = False while end == False: keys = dic.keys() ; l = len(keys) ; update = 0 - for k in keys: + for k in keys: if (dic[k] == 0): checkDepend(k, dic) ; update = 1 if update == 0: end = True diff --git a/Cassiopee/OCC/doc/source/conf.py b/Cassiopee/OCC/doc/source/conf.py index 9fbc3a88f..be348685a 100644 --- a/Cassiopee/OCC/doc/source/conf.py +++ b/Cassiopee/OCC/doc/source/conf.py @@ -192,15 +192,15 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', -'preamble': r''' + # Additional stuff for the LaTeX preamble. + #'preamble': '', + 'preamble': r''' \usepackage{charter} \usepackage[defaultsans]{lato} \usepackage{inconsolata} @@ -211,8 +211,8 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('OCC', 'OCC.tex', u'OCC Documentation', - u'/ELSA/MU-09023/V'+__version__, 'manual'), + ('OCC', 'OCC.tex', u'OCC Documentation', + u'/ELSA/MU-09023/V'+__version__, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -255,9 +255,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'OCC', u'OCC Documentation', - u'ONERA', 'OCC', 'One line description of project.', - 'Miscellaneous'), + ('index', 'OCC', u'OCC Documentation', + u'ONERA', 'OCC', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/OCC/setup.py b/Cassiopee/OCC/setup.py index b9c4444ac..6e61d91d5 100644 --- a/Cassiopee/OCC/setup.py +++ b/Cassiopee/OCC/setup.py @@ -24,7 +24,7 @@ (generatorVersion, generatorIncDir, generatorLibDir) = Dist.checkGenerator() # Test if open-cascade is already installed ================================== -(OCEPresent, OCEIncDir, OCELibDir) = Dist.checkOCE(additionalLibPaths, +(OCEPresent, OCEIncDir, OCELibDir) = Dist.checkOCE(additionalLibPaths, additionalIncludePaths) if not OCEPresent: os._exit(0) @@ -71,7 +71,7 @@ extra_compile_args=Dist.getCppArgs(), extra_link_args=Dist.getLinkArgs() )] - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/OCC/setupLegacy.py b/Cassiopee/OCC/setupLegacy.py index 1ccb84889..e7608f4e1 100644 --- a/Cassiopee/OCC/setupLegacy.py +++ b/Cassiopee/OCC/setupLegacy.py @@ -49,7 +49,7 @@ extra_compile_args=Dist.getCppArgs(), extra_link_args=Dist.getLinkArgs() )] - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/OCC/srcs.py b/Cassiopee/OCC/srcs.py index 039e1f100..47dbb723e 100644 --- a/Cassiopee/OCC/srcs.py +++ b/Cassiopee/OCC/srcs.py @@ -1,7 +1,7 @@ import glob import os -exceptions = ['../../OCC/occ_src/TKXSBase/stepread.c', +exceptions = ['../../OCC/occ_src/TKXSBase/stepread.c', '../../OCC/occ_src/TKXSBase/step.tab.c', '../../OCC/occ_src/TKXSBase/lex.step.c'] @@ -25,9 +25,9 @@ def getFiles(module): return srcs srcs = ['OCC/import_OCC_CAD_wrapper.cpp', - 'OCC/CADviaOCC.cpp', + 'OCC/CADviaOCC.cpp', 'OCC/OCCSurface.cpp', - 'OCC/CADviaOCC2.cpp', + 'OCC/CADviaOCC2.cpp', 'OCC/OCCSurface2.cpp', 'OCC/convertCAD2Arrays0.cpp', 'OCC/convertCAD2Arrays1.cpp', @@ -68,47 +68,47 @@ def getFiles(module): import KCore.Dist as Dist allMods6 = ["FWOSPlugin", "TKPLCAF", "PTKernel", "TKPrim", - "TKAdvTools", "TKPShape", "TKBinL", "TKService", - "TKBin", "TKShapeSchema", "TKBinTObj", "TKShHealing", - "TKBinXCAF", "TKStdLSchema", "TKBool", "TKStdSchema", - "TKBO", "TKSTEP209", "TKBRep", "TKSTEPAttr", - "TKCAF", "TKSTEPBase", "TKCDF", "TKSTEP", - "TKernel", "TKSTL", "TKFeat", "TKTObj", - "TKFillet", "TKTopAlgo", "TKG2d", "TKV3d", - "TKG3d", "TKVoxel", "TKGeomAlgo", "TKVRML", - "TKGeomBase", "TKXCAFSchema", "TKHLR", "TKXCAF", - "TKIGES", "TKXDEIGES", "TKLCAF", "TKXDESTEP", - "TKMath", "TKXMesh", "TKMesh", "TKXmlL", - "TKMeshVS", "TKXml", "TKNIS", "TKXmlTObj", - "TKOffset", "TKXmlXCAF", "TKOpenGl", "TKXSBase", - "TKPCAF"] + "TKAdvTools", "TKPShape", "TKBinL", "TKService", + "TKBin", "TKShapeSchema", "TKBinTObj", "TKShHealing", + "TKBinXCAF", "TKStdLSchema", "TKBool", "TKStdSchema", + "TKBO", "TKSTEP209", "TKBRep", "TKSTEPAttr", + "TKCAF", "TKSTEPBase", "TKCDF", "TKSTEP", + "TKernel", "TKSTL", "TKFeat", "TKTObj", + "TKFillet", "TKTopAlgo", "TKG2d", "TKV3d", + "TKG3d", "TKVoxel", "TKGeomAlgo", "TKVRML", + "TKGeomBase", "TKXCAFSchema", "TKHLR", "TKXCAF", + "TKIGES", "TKXDEIGES", "TKLCAF", "TKXDESTEP", + "TKMath", "TKXMesh", "TKMesh", "TKXmlL", + "TKMeshVS", "TKXml", "TKNIS", "TKXmlTObj", + "TKOffset", "TKXmlXCAF", "TKOpenGl", "TKXSBase", + "TKPCAF"] allMods75 = ["TKBinL", "TKBin", "TKBinTObj", - "TKBinXCAF", "TKBool", "TKBO", "TKBRep", - "TKCAF", "TKCDF", "TKDCAF", "TKDraw", "TKernel", - "TKFeat", "TKFillet", "TKG2d", "TKG3d", "TKGeomAlgo", - "TKGeomBase", "TKHLR", "TKIGES", "TKLCAF", "TKMath", - "TKMesh", "TKMeshVS", "TKOffset", "TKOpenGl", "TKPrim", - "TKQADraw", "TKRWMesh", "TKService", "TKShHealing", "TKStdL", - "TKStd", "TKSTEP209", "TKSTEPAttr", "TKSTEPBase", "TKSTEP", - "TKSTL", "TKTObjDRAW", "TKTObj", "TKTopAlgo", "TKTopTest", - "TKV3d", "TKVCAF", "TKViewerTest", "TKVRML", "TKXCAF", "TKXDEDRAW", - "TKXDEIGES", "TKXDESTEP", "TKXMesh", "TKXmlL", "TKXml", "TKXmlTObj", - "TKXmlXCAF", "TKXSBase", "TKXSDRAW"] + "TKBinXCAF", "TKBool", "TKBO", "TKBRep", + "TKCAF", "TKCDF", "TKDCAF", "TKDraw", "TKernel", + "TKFeat", "TKFillet", "TKG2d", "TKG3d", "TKGeomAlgo", + "TKGeomBase", "TKHLR", "TKIGES", "TKLCAF", "TKMath", + "TKMesh", "TKMeshVS", "TKOffset", "TKOpenGl", "TKPrim", + "TKQADraw", "TKRWMesh", "TKService", "TKShHealing", "TKStdL", + "TKStd", "TKSTEP209", "TKSTEPAttr", "TKSTEPBase", "TKSTEP", + "TKSTL", "TKTObjDRAW", "TKTObj", "TKTopAlgo", "TKTopTest", + "TKV3d", "TKVCAF", "TKViewerTest", "TKVRML", "TKXCAF", "TKXDEDRAW", + "TKXDEIGES", "TKXDESTEP", "TKXMesh", "TKXmlL", "TKXml", "TKXmlTObj", + "TKXmlXCAF", "TKXSBase", "TKXSDRAW"] allMods75W = ["TKBin", "TKBinL", "TKBinTObj", "TKBinXCAF", "TKBO", - "TKBool", "TKBRep", "TKCAF", "TKCDF", "TKernel", - "TKFeat", "TKFillet", "TKG2d", "TKG3d", "TKGeomAlgo", - "TKGeomBase", "TKHLR", "TKIGES", "TKLCAF", "TKMath", - "TKMesh", "TKMeshVS", "TKOffset", "TKOpenGl", - "TKPrim", "TKService", - "TKShHealing", "TKStdLSchema", - "TKStdSchema", "TKSTEP", "TKSTEP209", "TKSTEPAttr", - "TKSTEPBase", "TKSTL", "TKTObj", "TKTopAlgo", - "TKV3d", "TKVoxel", "TKVRML", "TKXCAF", "TKXCAFSchema", - "TKXDEIGES", "TKXDESTEP", "TKXMesh", "TKXml", - "TKXmlL", "TKXmlTObj", "TKXmlXCAF", "TKXSBase", - "TKPCAF", "TKPLCAF", "TKNIS", "TKPShape", "TKShapeSchema"] + "TKBool", "TKBRep", "TKCAF", "TKCDF", "TKernel", + "TKFeat", "TKFillet", "TKG2d", "TKG3d", "TKGeomAlgo", + "TKGeomBase", "TKHLR", "TKIGES", "TKLCAF", "TKMath", + "TKMesh", "TKMeshVS", "TKOffset", "TKOpenGl", + "TKPrim", "TKService", + "TKShHealing", "TKStdLSchema", + "TKStdSchema", "TKSTEP", "TKSTEP209", "TKSTEPAttr", + "TKSTEPBase", "TKSTL", "TKTObj", "TKTopAlgo", + "TKV3d", "TKVoxel", "TKVRML", "TKXCAF", "TKXCAFSchema", + "TKXDEIGES", "TKXDESTEP", "TKXMesh", "TKXml", + "TKXmlL", "TKXmlTObj", "TKXmlXCAF", "TKXSBase", + "TKPCAF", "TKPLCAF", "TKNIS", "TKPShape", "TKShapeSchema"] if Dist.getSystem()[0] == 'mingw': allMods = allMods75W diff --git a/Cassiopee/OCC/test/Quarantine/getNodalParametersPT_t1.py b/Cassiopee/OCC/test/Quarantine/getNodalParametersPT_t1.py index a71521772..72bf4240a 100644 --- a/Cassiopee/OCC/test/Quarantine/getNodalParametersPT_t1.py +++ b/Cassiopee/OCC/test/Quarantine/getNodalParametersPT_t1.py @@ -27,7 +27,7 @@ # DISCRETIZED t = OCC.PyTree.convertCAD2PyTree(ifile, format=forma, - h=400, chordal_err=0, growth_ratio = 0., algo=1) + h=400, chordal_err=0, growth_ratio=0., algo=1) # EXTRUDED @@ -39,7 +39,7 @@ (BCs, BCNames, BCTypes) = C.getBCs(t) # extrude -t = XOR.extrudeSurf(t, layer_height = height, nlayers = nlays, strategy = 1) +t = XOR.extrudeSurf(t, layer_height=height, nlayers=nlays, strategy=1) # put back BCs C._recoverBCs(t, (BCs, BCNames, BCTypes), tol=1.e-6) @@ -92,7 +92,7 @@ #------------------------------------------- # updateFcadidFromNcadid #------------------------------------------- -p = Internal.getNodeFromName(t, 'CADData'); +p = Internal.getNodeFromName(t, 'CADData'); Internal.newDataArray('fcadid', value=fcadid, parent=p) occ.updateFcadidFromNcadid( c, wall_face_ids, ncadid, fcadid) @@ -104,7 +104,7 @@ nv = np.empty((n,), dtype=np.int32) nv[:] = 1 -t = XOR.adaptCells(t,nv, sensor_type=2,hmesh = hmsh) +t = XOR.adaptCells(t,nv, sensor_type=2,hmesh=hmsh) t = XOR.conformizeHMesh(t, hmsh) t = XOR.closeCells(t) Internal._rmNodesByName(t, 'zid') diff --git a/Cassiopee/OCC/test/Quarantine/linkNodes2CADPT_t1.py b/Cassiopee/OCC/test/Quarantine/linkNodes2CADPT_t1.py index 00fd37c03..52cdba078 100644 --- a/Cassiopee/OCC/test/Quarantine/linkNodes2CADPT_t1.py +++ b/Cassiopee/OCC/test/Quarantine/linkNodes2CADPT_t1.py @@ -85,7 +85,7 @@ #------------------------------------------- # updateFcadidFromNcadid #------------------------------------------- -p = Internal.getNodeFromName(t, 'CADData'); +p = Internal.getNodeFromName(t, 'CADData'); Internal.newDataArray('fcadid', value=fcadid, parent=p) occ.updateFcadidFromNcadid( c, wall_face_ids, ncadid, fcadid) @@ -97,7 +97,7 @@ nv = np.empty((n,), dtype=np.int32) nv[:] = 1 -t = XOR.adaptCells(t,nv, sensor_type=2,hmesh = hmsh) +t = XOR.adaptCells(t,nv, sensor_type=2,hmesh=hmsh) t = XOR.conformizeHMesh(t, hmsh) t = XOR.closeCells(t) Internal._rmNodesByName(t, 'zid') diff --git a/Cassiopee/OCC/test/getNodalParametersPT.py b/Cassiopee/OCC/test/getNodalParametersPT.py index 6871b1f1a..28cfaf5f6 100644 --- a/Cassiopee/OCC/test/getNodalParametersPT.py +++ b/Cassiopee/OCC/test/getNodalParametersPT.py @@ -27,7 +27,7 @@ # DISCRETIZED t = OCC.PyTree.convertCAD2PyTree(ifile, format=forma, - h=400, chordal_err=0, growth_ratio = 0., algo=1) + h=400, chordal_err=0, growth_ratio=0., algo=1) # EXTRUDED @@ -39,7 +39,7 @@ (BCs, BCNames, BCTypes) = C.getBCs(t) # extrude -t = XOR.extrudeSurf(t, layer_height = height, nlayers = nlays, strategy = 1) +t = XOR.extrudeSurf(t, layer_height=height, nlayers=nlays, strategy=1) # put back BCs C._recoverBCs(t, (BCs, BCNames, BCTypes), tol=1.e-6) @@ -92,7 +92,7 @@ #------------------------------------------- # updateFcadidFromNcadid #------------------------------------------- -p = Internal.getNodeFromName(t, 'CADData'); +p = Internal.getNodeFromName(t, 'CADData'); Internal.newDataArray('fcadid', value=fcadid, parent=p) occ.updateFcadidFromNcadid( c, wall_face_ids, ncadid, fcadid) @@ -104,7 +104,7 @@ nv = np.empty((n,), dtype=np.int32) nv[:] = 1 -t = XOR.adaptCells(t,nv, sensor_type=2,hmesh = hmsh) +t = XOR.adaptCells(t,nv, sensor_type=2,hmesh=hmsh) t = XOR.conformizeHMesh(t, hmsh) t = XOR.closeCells(t) Internal._rmNodesByName(t, 'zid') diff --git a/Cassiopee/OCC/test/linkNodes2CADPT.py b/Cassiopee/OCC/test/linkNodes2CADPT.py index 335e09cb9..6b3b20f17 100644 --- a/Cassiopee/OCC/test/linkNodes2CADPT.py +++ b/Cassiopee/OCC/test/linkNodes2CADPT.py @@ -25,7 +25,7 @@ # DISCRETIZED t = OCC.PyTree.convertCAD2PyTree(ifile, format=forma, - h=400, chordal_err=0, growth_ratio = 0., algo=1) + h=400, chordal_err=0, growth_ratio=0., algo=1) # EXTRUDED @@ -37,7 +37,7 @@ (BCs, BCNames, BCTypes) = C.getBCs(t) # extrude -t = XOR.extrudeSurf(t, layer_height = height, nlayers = nlays, strategy = 1) +t = XOR.extrudeSurf(t, layer_height=height, nlayers=nlays, strategy=1) # put back BCs C._recoverBCs(t, (BCs, BCNames, BCTypes), tol=1.e-6) @@ -84,7 +84,7 @@ #------------------------------------------- # updateFcadidFromNcadid #------------------------------------------- -p = Internal.getNodeFromName(t, 'CADData'); +p = Internal.getNodeFromName(t, 'CADData'); Internal.newDataArray('fcadid', value=fcadid, parent=p) occ.updateFcadidFromNcadid( c, wall_face_ids, ncadid, fcadid) @@ -96,7 +96,7 @@ nv = np.empty((n,), dtype=np.int32) nv[:] = 1 -t = XOR.adaptCells(t,nv, sensor_type=2,hmesh = hmsh) +t = XOR.adaptCells(t,nv, sensor_type=2,hmesh=hmsh) t = XOR.conformizeHMesh(t, hmsh) t = XOR.closeCells(t) Internal._rmNodesByName(t, 'zid') diff --git a/Cassiopee/Post/Post/ExtraVariables2.py b/Cassiopee/Post/Post/ExtraVariables2.py index 9641d54cb..72a543953 100644 --- a/Cassiopee/Post/Post/ExtraVariables2.py +++ b/Cassiopee/Post/Post/ExtraVariables2.py @@ -52,7 +52,7 @@ def _computeVorticity2(t, ghostCells=False): C._rmVars(t, ['centers:gradxVelocityZ', 'centers:gradyVelocityZ', 'centers:gradzVelocityZ']) return None -# IN: centers:Velocity +# IN: centers:Velocity # OUT: centers:VorticityMagnitude def computeVorticityMagnitude2(t, ghostCells=False): """Compute vorticity magnitude from velocity in centers.""" @@ -61,7 +61,7 @@ def computeVorticityMagnitude2(t, ghostCells=False): return tp def _computeVorticityMagnitude2(t, ghostCells=False): - """Compute vorticity magnitude from velocity in centers.""" + """Compute vorticity magnitude from velocity in centers.""" _computeVorticity2(t, ghostCells) C._magnitude(t, ['centers:VorticityX', 'centers:VorticityY', 'centers:VorticityZ']) C._rmVars(t, ['centers:VorticityX', 'centers:VorticityY', 'centers:VorticityZ']) @@ -89,7 +89,7 @@ def _computeQCriterion2(t, ghostCells=False): C._rmVars(t, ['centers:gradxVelocityZ', 'centers:gradzVelocityZ', 'centers:gradzVelocityX', 'centers:gradzVelocityY', 'centers:gradzVelocityX', 'centers:gradyVelocityZ']) return None -# IN: centers:Velocity +# IN: centers:Velocity # OUT: centers:lambda2 def computeLambda2(t, ghostCells=False): """Compute lambda2 criterion from velocity in centers.""" @@ -104,7 +104,7 @@ def _computeLambda2(t, ghostCells=False): P._computeGrad2(t, 'centers:VelocityZ', ghostCells) # Rate of strain tensor - C._initVars(t, 'centers:s11 = {centers:gradxVelocityX}') + C._initVars(t, 'centers:s11 = {centers:gradxVelocityX}') C._initVars(t, 'centers:s12 = 0.5*({centers:gradyVelocityX}+{centers:gradxVelocityY})') C._initVars(t, 'centers:s13 = 0.5*({centers:gradzVelocityX}+{centers:gradxVelocityZ})') C._initVars(t, 'centers:s22 = {centers:gradyVelocityY}') @@ -205,7 +205,7 @@ def _extractPressure(t): P._computeVariables2(t, ['centers:Pressure']) return None -# Calcul module de la vitesse +# Calcul module de la vitesse # IN: centers:VelocityX, centers:VelocityY, centers:VelocityZ # OUT: centers:VelocityMagnitude # v = sqrt(vx**2+vy**2+vz**2) @@ -316,7 +316,7 @@ def _extractQCriterion(t): return None #=========================================================== -# Surfacic extractions +# Surfacic extractions # input : effort tree (teff) #=========================================================== @@ -579,7 +579,7 @@ def integLoads(teff): return [retx[0],rety[0],retz[0]] #============================================================= -# Profile extractions +# Profile extractions # input : effort tree (teff) + volume tree t #============================================================= @@ -691,6 +691,6 @@ def extractRtheta(zp, Uinf, Roinf, Muinf): C._initVars(zpp, '{dDelta} = ( 1. - {VelocityTangential} / %20.16g ) * ( {Density} / %20.16g)'%(Uinf,Roinf) ) ret2 = P.integ(zpp, 'dDelta') delta = ret2[0] - ShapeFactor = delta / theta + ShapeFactor = delta / theta return delta,theta,Rtheta,ShapeFactor diff --git a/Cassiopee/Post/Post/IBM.py b/Cassiopee/Post/Post/IBM.py index fb05af86e..53b7cbb00 100644 --- a/Cassiopee/Post/Post/IBM.py +++ b/Cassiopee/Post/Post/IBM.py @@ -87,7 +87,7 @@ def _extractPressureGradients(t, tc, secondOrder=False, ibctypes=[]): #============================================================================= # Extract the flow field at the IBM target points onto the surface. # IN: tc (tree): connectivity tree containing IBM information -# IN: tb (tree): geometry tree (IBM bodies) +# IN: tb (tree): geometry tree (IBM bodies) # If tb is None, return the cloud of IBM points # If tb is not None, the solution is projected onto the bodies, at the vertices # IN: famZones (list): if famZones is not empty, only extract some subregion families (['FAM1','FAM2,...]) @@ -159,7 +159,7 @@ def extractIBMWallFields(tc, tb=None, coordRef='wall', famZones=[], IBCNames="IB xPI = Internal.getNodeFromName1(IBCD, "CoordinateX_PI")[1] yPI = Internal.getNodeFromName1(IBCD, "CoordinateY_PI")[1] zPI = Internal.getNodeFromName1(IBCD, "CoordinateZ_PI")[1] - xNP.append(xPI); yNP.append(yPI); zNP.append(zPI) + xNP.append(xPI); yNP.append(yPI); zNP.append(zPI) else: xPW = Internal.getNodeFromName1(IBCD, "CoordinateX_PW")[1] yPW = Internal.getNodeFromName1(IBCD, "CoordinateY_PW")[1] @@ -379,7 +379,7 @@ def extractIBMWallFields(tc, tb=None, coordRef='wall', famZones=[], IBCNames="IB if kcurvPresent==1: C._initVars(td,XOD.__KCURV__,0.) if temperaturePresent==1: - C._initVars(td,XOD.__TEMPERATURE__,0.) + C._initVars(td,XOD.__TEMPERATURE__,0.) if gradxPressurePresent==1: C._initVars(td,XOD.__GRADXPRESSURE__,0.) C._initVars(td,XOD.__GRADYPRESSURE__,0.) @@ -402,7 +402,7 @@ def extractShearStress(ts): return ts2 def _extractShearStress(ts): - """Computes the shear stress on the surface.""" + """Computes the shear stress on the surface.""" if Internal.getNodeFromName(ts, Internal.__FlowSolutionCenters__) is None: ts = C.node2Center(ts, Internal.__FlowSolutionNodes__) @@ -432,13 +432,13 @@ def _extractShearStress(ts): # needs gradxPressure, gradyPressure and gradzPressure fields #============================================================================= def extractLocalPressureGradients(ts): - """Computes the pressure gradients in the wall normal/tangent direction.""" + """Computes the pressure gradients in the wall normal/tangent direction.""" ts2 = Internal.copyRef(ts) _extractLocalPressureGradients(ts2) return ts2 def _extractLocalPressureGradients(ts): - """Computes the pressure gradients in the wall normal/tangent direction.""" + """Computes the pressure gradients in the wall normal/tangent direction.""" if Internal.getNodeFromName(ts, Internal.__FlowSolutionCenters__) is None: ts = C.node2Center(ts, Internal.__FlowSolutionNodes__) @@ -731,22 +731,22 @@ def _extractConvectiveTerms(tc): # IN: QInf (float): reference dynamic pressure # IN: variables (list): list of extra variables to compute #============================================================================= -def computeExtraVariables(ts, PInf, QInf, +def computeExtraVariables(ts, PInf, QInf, variables=['Cp','Cf','frictionX','frictionY','frictionZ', 'frictionMagnitude','ShearStress']): """Computes additional variables required for the IBM post-processing.""" ts2 = Internal.copyRef(ts) _computeExtraVariables(ts2, PInf, QInf,variables=variables) return ts2 -def _computeExtraVariables(ts, PInf, QInf, +def _computeExtraVariables(ts, PInf, QInf, variables=['Cp','Cf','frictionX','frictionY','frictionZ', 'frictionMagnitude','ShearStress']): """Computes additional variables required for the IBM post-processing.""" import Post.ExtraVariables2 as PE #------------------------- - # pressure forces + # pressure forces #------------------------- - if 'Cp' in variables: + if 'Cp' in variables: PE._extractCp(ts, PInf, QInf) if any(var in ['gradnP', 'gradtP'] for var in variables): @@ -761,10 +761,10 @@ def _computeExtraVariables(ts, PInf, QInf, if any(var in ['frictionX', 'frictionMagnitude', 'Cf'] for var in variables): PE._extractFrictionMagnitude(ts) - if 'Cf' in variables: + if 'Cf' in variables: PE._extractCf(ts, QInf) - if 'ShearStress' not in variables: + if 'ShearStress' not in variables: FSC = Internal.getNodesFromName(ts,Internal.__FlowSolutionCenters__) Internal._rmNodesFromName(FSC, 'ShearStress*') return None @@ -772,7 +772,7 @@ def _computeExtraVariables(ts, PInf, QInf, #========================================================================================== # Extract the wall surface solution from IBM wall points # IN: tb (tree): geometry tree that contains the IBM bodies. -# IN: tc (tree): connectivity tree containing IBM information. +# IN: tc (tree): connectivity tree containing IBM information. # IN: dimPb (int): pb dimension. # IN: ibctypes (list of strings): IBM conditions to extract. If empty, extract all IBCs. # IN: prepareMLS (boolean): If True, store the MLS coefficients in POST_MLS subregions inside ts. @@ -966,7 +966,7 @@ def prepareSkinReconstruction(tb, tc, dimPb=3, ibctypes=[], prepareMLS=True): stats = D2._distribute(ts, Cmpi.size) if dimPb == 2: C._initVars(ts, '{CoordinateZ}=0.005') # to match cloud of IBM points - # CREATE graphIBCDPost + # CREATE graphIBCDPost graph = {i:{} for i in range(Cmpi.size)} listOfDeletedZones = [] for zl in Internal.getZones(tl): @@ -995,14 +995,14 @@ def prepareSkinReconstruction(tb, tc, dimPb=3, ibctypes=[], prepareMLS=True): graph[Cmpi.rank][Cmpi.rank] = listOfDeletedZones graphIBCDPost = allGatherGraph__(graph) - # CREATE ts + # CREATE ts refstate = Internal.getNodeFromType(ts, 'ReferenceState_t') flowEqn = Internal.getNodeFromType(ts, 'FlowEquationSet_t') listOfBases = [] for b in Internal.getBases(ts): zones = Internal.getZones(b) - zones = [z for z in zones if Cmpi.getProc(z) == Cmpi.rank] + zones = [z for z in zones if Cmpi.getProc(z) == Cmpi.rank] if zones != []: zones = C.convertArray2Tetra(zones) zones = G.close(zones) @@ -1118,7 +1118,7 @@ def computeAerodynamicLoads(ts, ts2=None, dimPb=3, famZones=[], Pref=None, cente listOfBases = [] for b in Internal.getBases(tw): zones = Internal.getZones(b) - zones = [z for z in zones if Cmpi.getProc(z) == Cmpi.rank] + zones = [z for z in zones if Cmpi.getProc(z) == Cmpi.rank] if zones != []: for z in zones: z[0] = z[0]+"_%s"%Cmpi.rank zones = G.close(zones) @@ -1139,7 +1139,7 @@ def computeAerodynamicLoads(ts, ts2=None, dimPb=3, famZones=[], Pref=None, cente tw = C.node2Center(tw, 'FlowSolution') C._rmVars(tw, 'FlowSolution') - if Pref is None: + if Pref is None: RefState = Internal.getNodeFromType(tw, 'ReferenceState_t') PInf = Internal.getValue(Internal.getNodeFromName(RefState,"Pressure")) Pref = PInf @@ -1228,7 +1228,7 @@ def computeAerodynamicCoefficients(ts, aeroLoads, dimPb=3, Sref=None, Lref=None, forcePressure, forceFriction, momentPressure, momentFriction = aeroLoads - if Qref is None: + if Qref is None: RefState = Internal.getNodeFromType(tw,'ReferenceState_t') RoInf = Internal.getValue(Internal.getNodeFromName(RefState,"Density")) VxInf = Internal.getValue(Internal.getNodeFromName(RefState,"VelocityX")) @@ -1274,7 +1274,7 @@ def computeAerodynamicCoefficients(ts, aeroLoads, dimPb=3, Sref=None, Lref=None, ################## #============================================================================== -# Return ts, massflow +# Return ts, massflow # A REFAIRE !!! [AJ] KEEP FOR NOW #============================================================================== def extractMassFlowThroughSurface(tb, t, famZones=[]): @@ -1301,9 +1301,9 @@ def extractMassFlowThroughSurface(tb, t, famZones=[]): #============================================================================= # Computes the viscous and pressure forces on the immersed boundaries -# IN: tb (tree): geometry tree (IBM bodies) +# IN: tb (tree): geometry tree (IBM bodies) # IN: tc (tree): connectivity tree containing IBM information -# IN: tc2 (tree, optional): connectivity tree containing IBM information for the second image point +# IN: tc2 (tree, optional): connectivity tree containing IBM information for the second image point # IN: alpha (float): angle of attack (x-y plane) # IN: beta (float): angle of attack (x-z plane) # IN: Sref (float): reference surface for the aerodynamical coefficients (CD/CL) @@ -1329,7 +1329,7 @@ def _addGradxiP__(tc): nIBC = pressure.shape[0] Nlength = numpy.zeros((nIBC),numpy.float64) - if gradxP is None: + if gradxP is None: zsr[2].append(['gradxPressure' , Nlength , [], 'DataArray_t']) zsr[2].append(['gradyPressure' , copy.copy(Nlength) , [], 'DataArray_t']) zsr[2].append(['gradzPressure' , copy.copy(Nlength) , [], 'DataArray_t']) @@ -1361,7 +1361,7 @@ def _loads0(ts, Sref=None, Pref=None, Qref=None, alpha=0., beta=0., dimPb=3, ver alpha = math.radians(alpha) beta = math.radians(beta) calpha = math.cos(alpha); cbeta = math.cos(beta) - salpha = math.sin(alpha); sbeta = math.sin(beta) + salpha = math.sin(alpha); sbeta = math.sin(beta) if Qref is None: Qref = q if Pref is None: Pref = PInf @@ -1428,7 +1428,7 @@ def loads(tb_in, tc_in=None, tc2_in=None, wall_out=None, alpha=0., beta=0., Sref tc2 = C.convertFile2PyTree(tc2_in) else: tc2 = tc2_in else: tc2 = None - else: + else: tc = None; tc2 = None if isinstance(tb_in, str): tb = C.convertFile2PyTree(tb_in) @@ -1458,7 +1458,7 @@ def loads(tb_in, tc_in=None, tc2_in=None, wall_out=None, alpha=0., beta=0., Sref #==================================== # Extraction des grandeurs a la paroi #==================================== - if tc is None: + if tc is None: zw = Internal.copyRef(tb) for b in Internal.getBases(zw): zones = Internal.getZones(b) @@ -1480,7 +1480,7 @@ def loads(tb_in, tc_in=None, tc2_in=None, wall_out=None, alpha=0., beta=0., Sref dimPb = Internal.getValue(Internal.getNodeFromName(tb, 'EquationDimension')) - if dimPb == 2: + if dimPb == 2: C._initVars(zw, '{CoordinateZ}=0.') T._addkplane(zw) @@ -1625,7 +1625,7 @@ def _prepareSkinReconstruction_old(ts, tc,famZones=[]): G._BB(zbb) hmin = -1e10 - for zbb in Internal.getZones(tlBB): + for zbb in Internal.getZones(tlBB): zc = Internal.getNodeFromName2(tl,zbb[0]) hloc = -1e-3 if zc is not None: diff --git a/Cassiopee/Post/Post/IBM_OLDIES.py b/Cassiopee/Post/Post/IBM_OLDIES.py index ddbbcf8bd..30ed0f39b 100644 --- a/Cassiopee/Post/Post/IBM_OLDIES.py +++ b/Cassiopee/Post/Post/IBM_OLDIES.py @@ -121,7 +121,7 @@ def loads0(ts, Sref=None, alpha=0., beta=0., dimPb=3, verbose=False): # Calc coefficient of friction C._initVars(ts, '{centers:Cf}=(sqrt({centers:Fricx}**2+{centers:Fricy}**2+{centers:Fricz}**2))/%g'%q) - # Update of pressure gradients + # Update of pressure gradients if isGradP: C._initVars(ts, '{centers:gradnP}={centers:gradxPressure}*{centers:sx}+{centers:gradyPressure}*{centers:sy}+{centers:gradzPressure}*{centers:sz}') C._initVars(ts, '{centers:gradtP}={centers:gradxPressure}*{centers:tx}+{centers:gradyPressure}*{centers:ty}+{centers:gradzPressure}*{centers:tz}') @@ -159,7 +159,7 @@ def loads0(ts, Sref=None, alpha=0., beta=0., dimPb=3, verbose=False): return ts #============================================================================= -# Post forces +# Post forces # IN: tb: geometry file with solution projected onto it # IN: Sref: Reference surface area # OUT: wall_out ou None: fichier pour sortie des efforts sur la paroi aux centres @@ -179,7 +179,7 @@ def _unsteadyLoads(tb, Sref=None, Pref=None, Qref=None, alpha=0., beta=0.): # reconstruit les champs parietaux a partir des infos stockees dans tw et les champs de tc -def _computeWallReconstruction(tw, tcw, tc, procDictR=None, procDictD=None, graph=None, +def _computeWallReconstruction(tw, tcw, tc, procDictR=None, procDictD=None, graph=None, variables=['Pressure','Density','utau','yplus']): if procDictR is None: procDictR={} @@ -188,7 +188,7 @@ def _computeWallReconstruction(tw, tcw, tc, procDictR=None, procDictD=None, grap procDictD={} for z in Internal.getZones(tcw): procDictD[z[0]]=0 - if graph is None: + if graph is None: graph = Cmpi.computeGraph(tcw, type='POST',procDict=procDictD, procDict2=procDictR, t2=tw) cellNVariable=''; varType=1; compact=0 @@ -206,7 +206,7 @@ def _computeWallReconstruction(tw, tcw, tc, procDictR=None, procDictD=None, grap FSN = Internal.newFlowSolution(name=Internal.__FlowSolutionNodes__, gridLocation='Vertex', parent=zc_w) - # put the fields in corresponding zcw zone + # put the fields in corresponding zcw zone zc_orig = Internal.getNodeFromName2(tc,zc_orig_name) zsr_orig = Internal.getNodeFromName2(zc_orig,zsrname) for varname in variables: @@ -225,7 +225,7 @@ def _computeWallReconstruction(tw, tcw, tc, procDictR=None, procDictD=None, grap if zoneRole == 'Donor': location = Internal.getNodeFromName1(zsr, 'GridLocation') # localisation des donnees des receveurs - if location is not None: + if location is not None: location = Internal.getValue(location) if location == 'CellCenter': loc = 'centers' else: loc = 'nodes' @@ -237,11 +237,11 @@ def _computeWallReconstruction(tw, tcw, tc, procDictR=None, procDictD=None, grap ListDonor = Internal.getNodeFromName1(zsr,'PointList')[1] ListRcv = Internal.getNodeFromName1(zsr,'PointListDonor')[1] - arrayT = connector._setInterpTransfersD(zc_w, variables, ListDonor, DonorType, Coefs, varType, compact, + arrayT = connector._setInterpTransfersD(zc_w, variables, ListDonor, DonorType, Coefs, varType, compact, cellNVariable, - Internal.__GridCoordinates__, - Internal.__FlowSolutionNodes__, - Internal.__FlowSolutionCenters__) + Internal.__GridCoordinates__, + Internal.__FlowSolutionNodes__, + Internal.__FlowSolutionCenters__) infos.append([dname,arrayT,ListRcv,loc]) for n in infos: rcvName = n[0] @@ -250,12 +250,12 @@ def _computeWallReconstruction(tw, tcw, tc, procDictR=None, procDictD=None, grap fields = n[1] if fields != []: listIndices = n[2] - zr = Internal.getNodeFromName2(tw,rcvName) + zr = Internal.getNodeFromName2(tw,rcvName) C._updatePartialFields(zr, [fields], [listIndices], loc=n[3]) else: rcvNode = procDictR[rcvName] if rcvNode not in datas: datas[rcvNode] = [n] - else: datas[rcvNode] += [n] + else: datas[rcvNode] += [n] #send numpys using graph rcvDatas = Cmpi.sendRecv(datas, graph) @@ -293,8 +293,8 @@ def prepareWallReconstruction(tw, tc): dimPb = Internal.getValue(dimPb) if dimPb ==2: C._initVars(tcw,"CoordinateZ",0.0) - # - # Create the bbtree + # + # Create the bbtree tcw_bb = C.newPyTree(["Base"]) zonesl = [] for base in Internal.getBases(tcw): @@ -317,7 +317,7 @@ def prepareWallReconstruction(tw, tc): C.setValue(zbb,'CoordinateZ',0, valxm) C.setValue(zbb,'CoordinateZ',1, valxp) Cmpi._setProc(zbb,rank) - zonesl.append(zbb) + zonesl.append(zbb) zonesBB = Cmpi.allgatherZones(zonesl) tcw_bb[2][1][2] += zonesBB @@ -338,7 +338,7 @@ def prepareWallReconstruction(tw, tc): for j in i[k]: if not j in graph[k]: graph[k][j] = [] graph[k][j] += i[k][j] - graph[k][j] = list(set(graph[k][j])) + graph[k][j] = list(set(graph[k][j])) Cmpi._addXZones(tcw, graph, subr=False) interDict = X.getIntersectingDomains(tw,tcw_bb) @@ -360,8 +360,8 @@ def prepareWallReconstruction(tw, tc): for j in i[k]: if not j in graphX[k]: graphX[k][j] = [] graphX[k][j] += i[k][j] - graphX[k][j] = list(set(graphX[k][j])) - del tcw_bb + graphX[k][j] = list(set(graphX[k][j])) + del tcw_bb EXTRAP = numpy.array([],numpy.int32) VOL = numpy.array([],numpy.float64) @@ -373,12 +373,12 @@ def prepareWallReconstruction(tw, tc): dnrZones=[] dnrZoneNames=[] for zdname in interDict[zwname]: - zd = Internal.getNodeFromName2(tcw,zdname) + zd = Internal.getNodeFromName2(tcw,zdname) dnrZones.append(zd) dnrZoneNames.append(zdname) coordsD = C.getFields(Internal.__GridCoordinates__, dnrZones, api=1) - coordsR = C.getFields(Internal.__GridCoordinates__, zw, api=1)[0] + coordsR = C.getFields(Internal.__GridCoordinates__, zw, api=1)[0] if coordsR[1].shape[1]>0: coordsD = Converter.convertArray2Node(coordsD) ret = connector.setInterpData_IBMWall(coordsD, coordsR, dimPb, LSorder) diff --git a/Cassiopee/Post/Post/Mpi.py b/Cassiopee/Post/Post/Mpi.py index ade8fa3c6..5ba45fa2e 100644 --- a/Cassiopee/Post/Post/Mpi.py +++ b/Cassiopee/Post/Post/Mpi.py @@ -99,7 +99,7 @@ def integNormProduct(t, vector=[]): if t is not None: ret = P.integNormProduct(t, vector) else: - ret = 0. + ret = 0. ret = numpy.array(ret, dtype=numpy.float64) ret1 = numpy.empty(ret.shape, dtype=numpy.float64) Cmpi.Allreduce(ret, ret1, Cmpi.SUM) @@ -110,7 +110,7 @@ def integMoment(t, center=(0.,0.,0.), vector=[]): if t is not None: ret = P.integMoment(t, center, vector) else: - ret = 0. + ret = 0. ret = numpy.array(ret, dtype=numpy.float64) ret1 = numpy.empty(ret.shape, dtype=numpy.float64) Cmpi.Allreduce(ret, ret1, Cmpi.SUM) @@ -121,7 +121,7 @@ def integMomentNorm(t, center=(0.,0.,0.), var=''): if t is not None: ret = P.integMomentNorm(t, center, var) else: - ret = 0. + ret = 0. ret = numpy.array(ret, dtype=numpy.float64) ret1 = numpy.empty(ret.shape, dtype=numpy.float64) Cmpi.Allreduce(ret, ret1, Cmpi.SUM) diff --git a/Cassiopee/Post/Post/Post.py b/Cassiopee/Post/Post/Post.py index a6930226b..9b9839bc7 100644 --- a/Cassiopee/Post/Post/Post.py +++ b/Cassiopee/Post/Post/Post.py @@ -12,21 +12,21 @@ ## [AJ - KEEP FOR NOW - FROM MASTER] __all__ = ['coarsen', 'computeCurl', 'computeDiff', 'computeExtraVariable', - 'computeGrad', 'computeGrad2', 'computeGradLSQ', - 'computeDiv', 'computeDiv2', 'computeIndicatorField', - 'computeIndicatorFieldForBounds', 'computeIndicatorValue', - 'computeNormCurl', 'computeNormGrad', 'computeVariables', - 'computeVariables2', '_computeVariables2', - 'enforceIndicatorForCoarsestLevel', 'enforceIndicatorForFinestLevel', - 'enforceIndicatorNearBodies', 'exteriorElts', 'exteriorEltsStructured', - 'exteriorFaces', 'exteriorFacesStructured', 'extractMesh', 'extractPlane', - 'extractPoint', 'frontFaces', 'integ', 'integMoment', 'integMomentNorm', - 'integNorm', 'integNormProduct', 'interiorFaces', 'isoLine', 'isoSurf', - 'isoSurfMC', 'perlinNoise', 'projectCloudSolution', - 'refine', 'renameVars', 'selectCells', 'selectCells2', 'selectCells3', - 'sharpEdges', 'silhouette', 'slice', 'streamLine', 'streamLine2', - 'streamRibbon', 'streamRibbon2', 'streamSurf', 'usurp', 'zip', 'zipper', - 'growOfEps__','computeIndicatorField_AMR'] + 'computeGrad', 'computeGrad2', 'computeGradLSQ', + 'computeDiv', 'computeDiv2', 'computeIndicatorField', + 'computeIndicatorFieldForBounds', 'computeIndicatorValue', + 'computeNormCurl', 'computeNormGrad', 'computeVariables', + 'computeVariables2', '_computeVariables2', + 'enforceIndicatorForCoarsestLevel', 'enforceIndicatorForFinestLevel', + 'enforceIndicatorNearBodies', 'exteriorElts', 'exteriorEltsStructured', + 'exteriorFaces', 'exteriorFacesStructured', 'extractMesh', 'extractPlane', + 'extractPoint', 'frontFaces', 'integ', 'integMoment', 'integMomentNorm', + 'integNorm', 'integNormProduct', 'interiorFaces', 'isoLine', 'isoSurf', + 'isoSurfMC', 'perlinNoise', 'projectCloudSolution', + 'refine', 'renameVars', 'selectCells', 'selectCells2', 'selectCells3', + 'sharpEdges', 'silhouette', 'slice', 'streamLine', 'streamLine2', + 'streamRibbon', 'streamRibbon2', 'streamSurf', 'usurp', 'zip', 'zipper', + 'growOfEps__','computeIndicatorField_AMR'] #============================================================================== # Add two layers to surface arrays @@ -55,13 +55,13 @@ def extrudeLayer__(i, nlayers, planarity, eps, dplus, dmoins): j = Transform.reorder(j, (-1,)) c = Generator.addNormalLayers(j, dplus) p = Transform.join(b, c); p = Generator.close(p) - p = Converter.convertArray2Tetra(p) + p = Converter.convertArray2Tetra(p) if p[3] == 'TRI': # une BAR au depart p = Transform.reorder(p, (1,)) b = Generator.addNormalLayers(p, dplus) p = Transform.reorder(p, (-1,)) - c = Generator.addNormalLayers(p, dplus) + c = Generator.addNormalLayers(p, dplus) p = Transform.join(b, c); p = Generator.close(p) p = Converter.convertArray2Tetra(p) return p @@ -98,7 +98,7 @@ def growOfEps__(arrays, eps, nlayers=1, planarity=True): return inl, modified def extractPoint(arrays, Pts, order=2, extrapOrder=1, - constraint=40., tol=1.e-6, hook=None): + constraint=40., tol=1.e-6, hook=None): """Extract the solution in one or more points. Usage: extractPoint( arrays, Pts, order,extrapOrder,constraint,hook)""" if arrays[0][1].shape[0] < 4: return [] # nofield @@ -666,7 +666,7 @@ def streamSurf(arrays, b, vector, N=2000, dir=1): if b[3] != 'BAR': raise TypeError("streamSurf: b must be a BAR.") coord = b[1] for no in range(len(arrays)): - if len(arrays[no])!= 5: + if len(arrays[no])!= 5: arrays[no] = Converter.convertArray2Tetra(arrays[no]) return post.compStreamSurf(arrays, b, vector, dir, N) @@ -765,7 +765,7 @@ def selectCells(arrayNodes, F, arrayCenters=[], varStrings=[], strict=0, F2E=Non #------------------------------------------------------------------------------ # selectCells preserving center flow field solutions # an : coordinates and fields in nodes -# ac : fields in centers +# ac : fields in centers def selectCells2(an, tag, ac=[], strict=0, loc=-1, F2E=None, cleanConnectivity=True): """Select cells in a given array following tag. Usage: selectCells2(arrayN, arrayC, tag, strict)""" @@ -954,7 +954,7 @@ def isoSurf(array, var, value, split='simple'): else: try: dim = 3 - if array[3] == 'NGON': + if array[3] == 'NGON': ap = array[2].ravel('K') if ap[2] == 1: dim = 1 if ap[2] == 2: dim = 2 @@ -1257,6 +1257,3 @@ def computeIndicatorField_AMR(octreeHexa, indicVal, nbTargetPts=-1, bodies=[], print('Number of points: Pre %d | Post %d | Increase: %f | Lower Threshold: %f | Upper Threshold: %f | Limits Modif. Loop Cnt: %d'%(npts, nptsfin, count)) return indicator1 - - - diff --git a/Cassiopee/Post/Post/Probe.py b/Cassiopee/Post/Post/Probe.py index eb5cdcbbe..925948275 100644 --- a/Cassiopee/Post/Post/Probe.py +++ b/Cassiopee/Post/Post/Probe.py @@ -16,7 +16,7 @@ class Probe: """Probe for extracting data from fields during computations.""" # defaullt initialization def init0(self): - # probe mode: + # probe mode: # mode=0, probe XYZ, single point # mode=1, probe ind, single point # mode=2, zones donnees @@ -67,12 +67,12 @@ def init0(self): self._probeZones = None # init from position X/ind+blockName/None - def __init__(self, fileName, - t=None, - X=None, + def __init__(self, fileName, + t=None, + X=None, ind=None, blockName=None, - tPermeable=None, - fields=None, append=False, + tPermeable=None, + fields=None, append=False, bufferSize=100, writeCoords=True, modeForce=0): """Create a probe.""" self.init0() @@ -109,7 +109,7 @@ def __init__(self, fileName, self._mode = 4 # Empilement de zones - else: + else: self._mode = 2 if Cmpi.rank == 0: print('Info: probe is in mode ', self._mode) @@ -121,7 +121,7 @@ def __init__(self, fileName, if self._proc is not None and self._probeZones is not None: self.checkFile(append=self._append) - #if t is not None and fields is not None: + #if t is not None and fields is not None: # self.checkVariables(t, fields) # examine la localisation des champs @@ -161,7 +161,7 @@ def locateProbeXYZ(self, t, X, loc): ret = Cmpi.allgather(dist) dist = 1.e16; proc = 0 for p, i in enumerate(ret): - if i is not None and i < dist: + if i is not None and i < dist: dist = i; proc = p if Cmpi.rank == 0: print('Info: probe found on proc: %d on block: %s.'%(proc,blockName)) @@ -184,7 +184,7 @@ def locateProbeInd(self, t, ind, blockName): if p is not None and not Cmpi.isZoneSkeleton__(p): proc = Cmpi.rank if Cmpi.rank == 0: print('Info: probe found on proc: %d on block %s.'%(proc,blockName)) - else: + else: proc = -1 #print('Warning: probe not found on block %s.'%blockName) @@ -194,9 +194,9 @@ def locateProbeInd(self, t, ind, blockName): loc = self.getFieldLoc(self._fields) dim = Internal.getZoneDim(b) if dim[0] == 'Structured': - if loc == 'nodes': + if loc == 'nodes': ind = (ind[0]-1)+(ind[1]-1)*dim[1]+(ind[2]-1)*dim[2] - else: + else: ind = (ind[0]-1)+(ind[1]-1)*(dim[1]-1)+(ind[2]-1)*(dim[2]-1) else: ind = ind[0] else: ind = -1 @@ -223,7 +223,7 @@ def locateProbeInd(self, t, ind, blockName): def printInfo(self): """Print information on probe.""" if Cmpi.rank == 0: - if self._mode == 0 or self._mode == 1: + if self._mode == 0 or self._mode == 1: print('Info: probe: position X: ', self._posX, self._posY, self._posZ) print('Info: probe: on block:', self._blockName) print('Info: probe: on block global index:', self._ind) @@ -319,7 +319,7 @@ def checkFile(self, append=False): tl = Distributed.convertFile2SkeletonTree(self._fileName) elif self._mode == 4: tl = C.convertFile2PyTree(self._fileName) - else: + else: tl = Cmpi.convertFile2SkeletonTree(self._fileName) zones = Internal.getZones(tl) @@ -342,7 +342,7 @@ def checkFile(self, append=False): self._filecur = 0 return None - #if self._mode != 4: + #if self._mode != 4: # Nettoyage + ne conserve que les zones du proc to = C.newPyTree() bases = Internal.getBases(tl) @@ -389,7 +389,7 @@ def checkFile(self, append=False): for z in zones: if Internal.getNodeFromName1(z, 'FlowSolution#Centers') is not None: paths += ['CGNSTree/Base/%s/FlowSolution#Centers'%z[0]] - if paths != []: + if paths != []: nodes = Distributed.readNodesFromPaths(self._fileName, paths) for c, z in enumerate(self._probeZones): cont = Internal.getNodeFromName2(z, 'FlowSolution#Centers') @@ -397,7 +397,7 @@ def checkFile(self, append=False): if len(self._probeZones) > 0: cont = Internal.getNodeFromName2(self._probeZones[0], 'FlowSolution') - if cont is not None: + if cont is not None: pt = Internal.getNodeFromName2(cont, 'time')[1] if pt.ndim == 2: pt = pt[:,0] elif pt.ndim == 3: pt = pt[:,0,0] @@ -433,7 +433,7 @@ def checkVariables(self, t, varList): for v in varList: vs = v.split(':') contName = Internal.__FlowSolutionNodes__ - if len(vs) == 2 and vs[0] == 'centers': + if len(vs) == 2 and vs[0] == 'centers': contName = Internal.__FlowSolutionCenters__ v = vs[1] cont = Internal.getNodeFromName1(block, contName) @@ -576,9 +576,9 @@ def extract3(self, tcs, time, onlyTransfer=False): self._procDicts = Cmpi.getProcDict(tsBB) if Cmpi.size == 1: for i in self._procDicts: - if self._procDicts[i] < 0: self._procDicts[i] = 0 + if self._procDicts[i] < 0: self._procDicts[i] = 0 - Cmpi.barrier() + Cmpi.barrier() if self._graph is None: tcsBB = Cmpi.createBBoxTree(tcs) procDictc = Cmpi.getProcDict(tcsBB) @@ -709,8 +709,8 @@ def flush__(self): if fc is not None: fc = Internal.copyNode(fc) fc[0] = 'FlowSolution#%d'%self._filecur - nodes += [fc] - paths += ['CGNSTree/Base/%s'%pzone[0]] + nodes += [fc] + paths += ['CGNSTree/Base/%s'%pzone[0]] fcc = Internal.getNodeFromName1(pzone, 'FlowSolution#Centers') if fcc is not None: fcc = Internal.copyNode(fcc) @@ -794,11 +794,11 @@ def readCont(self, cont): pz = Internal.getNodeFromName1(nodes2[0], 'CoordinateZ')[1] if nj > 1: px = px[nr,:]; py = py[nr,:]; pz = pz[nr,:] - else: + else: px = px[nr]; py = py[nr]; pz = pz[nr] ox = Internal.newDataArray('CoordinateX', value=px, parent=gc) oy = Internal.newDataArray('CoordinateY', value=py, parent=gc) - oz = Internal.newDataArray('CoordinateZ', value=pz, parent=gc) + oz = Internal.newDataArray('CoordinateZ', value=pz, parent=gc) if isFS: pos = 0 @@ -924,7 +924,7 @@ def slice(self, ptx, ptx2, start, size, ind, ni): ptx[start:start+size] = ptx2[0:size] elif ind is None: # take all if ptx2.ndim == 2: ptx[start:start+size,:] = ptx2[0:size,:] - else: raise ValueError('not implemented') + else: raise ValueError('not implemented') elif len(ind) == 1: i = ind[0] if ptx2.ndim == 2: ptx[start:start+size] = ptx2[0:size,i] @@ -941,12 +941,12 @@ def slice(self, ptx, ptx2, start, size, ind, ni): ptx[start:start+size,c] = ptx2[0:size,ii,jj] return None - # mode 2: lit un container, retourne un numpy du champ pour + # mode 2: lit un container, retourne un numpy du champ pour # chaque probe zone (ncells, ntime), concatene avec le precedent def readCont2(self, cont, field, pin): # field name spl = field.split(':') - if len(spl) == 2: + if len(spl) == 2: fieldName = spl[1] if spl[0] == 'centers': fieldCont = 'FlowSolution#Centers' else: fcont = 'FlowSolution' diff --git a/Cassiopee/Post/Post/PyTree.py b/Cassiopee/Post/Post/PyTree.py index 208fa4455..87abbdffb 100644 --- a/Cassiopee/Post/Post/PyTree.py +++ b/Cassiopee/Post/Post/PyTree.py @@ -82,7 +82,7 @@ def extractPlane(t, T, order=2, tol=1.e-6): Usage: extractPlane(t, (coefa, coefb, coefc, coefd), order)""" #t = C.deleteFlowSolutions__(t, 'centers') t = C.center2Node(t, Internal.__FlowSolutionCenters__) - A = C.getAllFields(t, 'nodes') + A = C.getAllFields(t, 'nodes') a = Post.extractPlane(A, T, order, tol) return C.convertArrays2ZoneNode('extractedPlane', [a]) @@ -179,14 +179,14 @@ def _extractMesh(t, extractionMesh, order=2, extrapOrder=1, for i,z in enumerate(Internal.getZones(extractionMesh)): if Internal.getZoneType(z)==1: orderedZones.append(i) for i,z in enumerate(Internal.getZones(extractionMesh)): - if Internal.getZoneType(z)==2: orderedZones.append(i) + if Internal.getZoneType(z)==2: orderedZones.append(i) - if mode == 'robust': + if mode == 'robust': tc = C.center2Node(t, Internal.__FlowSolutionCenters__) C._orderVariables(tc, varsn=[], varsc=[]) if hook is not None: - if not isinstance(hook,list): raise TypeError("_extractMesh: hook must be a list of hooks on ADTs.") + if not isinstance(hook,list): raise TypeError("_extractMesh: hook must be a list of hooks on ADTs.") fa = C.getAllFields(tc, 'nodes') del tc an = C.getFields(Internal.__GridCoordinates__, extractionMesh) @@ -351,7 +351,7 @@ def checkVariables___(vars): return loc # SelectCells preserving center flow field solutions -# only for tag defined as center variable +# only for tag defined as center variable def selectCells(t, F, varStrings=[], strict=0, cleanConnectivity=True): """Select cells in a given pyTree. Usage: selectCells(t, F, varStrings)""" @@ -372,7 +372,7 @@ def selectCells(t, F, varStrings=[], strict=0, cleanConnectivity=True): NGON = 0; found = False; PE = None for c in GEl: if c[1][0] == 22: found = True; break - NGON += 1 + NGON += 1 if found: node = GEl[NGON] PE = Internal.getNodeFromName1(node, 'ParentElements') @@ -401,21 +401,21 @@ def selectCells(t, F, varStrings=[], strict=0, cleanConnectivity=True): C._deleteFlowSolutions__(z, 'centers') - C.setFields([fp], z, 'nodes') + C.setFields([fp], z, 'nodes') elif fa != []: if fb != []: if PE is not None: (PE2,fp,fq) = Post.selectCells(fa, F, fb, varStrings, strict, PE[1], cleanConnectivity) else: - (fp,fq) = Post.selectCells(fa, F, fb, varStrings, strict, None, cleanConnectivity) + (fp,fq) = Post.selectCells(fa, F, fb, varStrings, strict, None, cleanConnectivity) C.setFields([fq], z, 'centers') else: if PE is not None: - (PE2,fp) = Post.selectCells(fa, F, fb, varStrings, strict, PE[1], cleanConnectivity) + (PE2,fp) = Post.selectCells(fa, F, fb, varStrings, strict, PE[1], cleanConnectivity) else: - fp = Post.selectCells(fa, F, fb, varStrings, strict, None, cleanConnectivity) + fp = Post.selectCells(fa, F, fb, varStrings, strict, None, cleanConnectivity) C.setFields([fp], z, 'nodes') @@ -431,11 +431,11 @@ def selectCells(t, F, varStrings=[], strict=0, cleanConnectivity=True): if PE is not None: (PE2, fp) = Post.selectCells(fc, F, fb, varStrings, strict, PE[1], cleanConnectivity) else: - fp = Post.selectCells(fc, F, fb, varStrings, strict, None, cleanConnectivity) + fp = Post.selectCells(fc, F, fb, varStrings, strict, None, cleanConnectivity) C.setFields([fp], z, 'nodes') - # Set ParentElement + # Set ParentElement if PE is not None: GEl = Internal.getElementNodes(z) NGON = 0; found = False @@ -498,7 +498,7 @@ def selectCells2(t, tagName, strict=0, cleanConnectivity=True): PE = Internal.getNodeFromName1(node, 'ParentElements') if loc == 0: # noeuds - fb = C.getFields(Internal.__FlowSolutionCenters__, z)[0] + fb = C.getFields(Internal.__FlowSolutionCenters__, z)[0] taga = C.getFields(Internal.__FlowSolutionNodes__, z) taga = Converter.extractVars(taga, [tagName])[0] else: @@ -525,7 +525,7 @@ def selectCells2(t, tagName, strict=0, cleanConnectivity=True): C._deleteFlowSolutions__(z, 'centers') C.setFields([fq], z, 'centers') - else: # pas de champ en centres + else: # pas de champ en centres if PE is not None: (PE2, fp) = Post.selectCells2(f, taga, [], strict, loc, PE[1], cleanConnectivity) else: @@ -536,14 +536,14 @@ def selectCells2(t, tagName, strict=0, cleanConnectivity=True): C.setFields([fp], z, 'nodes') elif fa != []: - if fb != [] and fb is not None: # il y a des champs en centres - if PE is not None: + if fb != [] and fb is not None: # il y a des champs en centres + if PE is not None: (PE2, fp,fq) = Post.selectCells2(fa, taga, fb, strict, loc, PE[1], cleanConnectivity) else: (fp,fq) = Post.selectCells2(fa, taga, fb, strict, loc, None, cleanConnectivity) C.setFields([fq], z, 'centers') else: # pas de champ en centres - if PE is not None: + if PE is not None: (PE2, fp) = Post.selectCells2(fa, taga, [], strict, loc, PE[1], cleanConnectivity) else: fp = Post.selectCells2(fa, taga, [], strict, loc, None, cleanConnectivity) @@ -552,7 +552,7 @@ def selectCells2(t, tagName, strict=0, cleanConnectivity=True): elif fc != []: if fb != [] and fb is not None: # il y a des champs en centres - if PE is not None: + if PE is not None: (PE2, fp,fq) = Post.selectCells2(fc, taga, fb, strict, loc, PE[1], cleanConnectivity) else: (fp,fq) = Post.selectCells2(fc, taga, fb, strict, loc, None, cleanConnectivity) @@ -560,14 +560,14 @@ def selectCells2(t, tagName, strict=0, cleanConnectivity=True): C.setFields([fq], z, 'centers') else: # pas de champ en centres - if PE is not None: + if PE is not None: (PE2, fp) = Post.selectCells2(fc, taga, [], strict, loc, PE[1], cleanConnectivity) else: fp = Post.selectCells2(fc, taga, [], strict, loc, None, cleanConnectivity) Internal._rmNodesFromName(z,Internal.__FlowSolutionCenters__) C.setFields([fp], z, 'nodes') - # Set ParentElement + # Set ParentElement if PE is not None: GEl = Internal.getElementNodes(z) NGON = 0; found = False @@ -750,8 +750,8 @@ def computeVariables(t, varList, return tp def _computeVariables(t, varList, - gamma=-1., rgp=-1., s0=0., betas=-1., - Cs=-1., mus=-1., Ts=-1.): + gamma=-1., rgp=-1., s0=0., betas=-1., + Cs=-1., mus=-1., Ts=-1.): """Compute variables defined in varList. Usage: computeVariables(t, varList, gamma=1.4, rgp=287.053, s0=0., betas=1.458e-6, Cs=110.4, mus=0., Ts=0.)""" try: @@ -801,7 +801,7 @@ def _computeVariables(t, varList, return None def computeVariables2(t, varList, gamma=-1., rgp=-1., s0=0., betas=-1., - Cs=-1., mus=-1., Ts=-1.): + Cs=-1., mus=-1., Ts=-1.): """Compute variables (in place version) defined in varList. Usage: computeVariables2(array, varList, gamma=1.4, rgp=287.053, s0=0., betas=1.458e-6, Cs=110.4, mus=0., Ts=0.)""" tp = Internal.copyRef(t) @@ -809,20 +809,20 @@ def computeVariables2(t, varList, gamma=-1., rgp=-1., s0=0., betas=-1., return tp def _computeVariables2(t, varList, gamma=-1., rgp=-1., s0=0., betas=-1., - Cs=-1., mus=-1., Ts=-1.): + Cs=-1., mus=-1., Ts=-1.): if gamma < 0: try: gamma = C.getState(t, 'Gamma') except: pass if gamma < 0: gamma = 1.4 if rgp < 0: - try: + try: cv = C.getState(t, 'Cv') rgp = cv*(gamma-1.) except: pass if rgp < 0: rgp = 287.053 if s0 < 0: try: s0 = C.getState(t, 's0') - except: pass + except: pass if betas < 0: try: betas = C.getState(t, 'betas') except: pass @@ -956,14 +956,14 @@ def computeExtraVariable(t, varname, gamma=-1, rgp=-1., elif varname == 'ShearStress' or varname == 'nodes:ShearStress': t2 = extraVariablesPT.computeShearStress(t, gamma, rgp, Cs, mus, Ts) zvars = ['centers:ShearStressXX', - 'centers:ShearStressXY', - 'centers:ShearStressXZ', - 'centers:ShearStressYX', - 'centers:ShearStressYY', - 'centers:ShearStressYZ', - 'centers:ShearStressZX', - 'centers:ShearStressZY', - 'centers:ShearStressZZ'] + 'centers:ShearStressXY', + 'centers:ShearStressXZ', + 'centers:ShearStressYX', + 'centers:ShearStressYY', + 'centers:ShearStressYZ', + 'centers:ShearStressZX', + 'centers:ShearStressZY', + 'centers:ShearStressZZ'] t2 = C.center2Node(t2, zvars) C._rmVars(t2, zvars) return t2 @@ -1085,7 +1085,7 @@ def importVariables(t1, t2, method=0, eps=1.e-6, addExtra=1): sol11 = Internal.getNodesFromType(s1, 'DataArray_t') for s11 in sol11: ar1 = Internal.convertDataNode2Array(s11, dim1, cn1)[1] - z2 = C.setFields([ar1], z2, 'centers') + z2 = C.setFields([ar1], z2, 'centers') parent2[2][d] = z2 else: raise NotImplementedError("Method {0!r} is not implemented. Please refer to the documentation".format(method)) @@ -1112,7 +1112,7 @@ def importVariables(t1, t2, method=0, eps=1.e-6, addExtra=1): base[0][2].append(z) elif abs(loc) == 2: # ajout coord en noeud et champ direct (qui correspond aux centres du nouveau) - C._rmVars(z,Internal.__FlowSolutionCenters__) + C._rmVars(z,Internal.__FlowSolutionCenters__) zc = C.center2Node(z) coords = Internal.getNodesFromType1(zc, 'GridCoordinates_t') dim = Internal.getZoneDim(zc) @@ -1129,12 +1129,12 @@ def importVariables(t1, t2, method=0, eps=1.e-6, addExtra=1): if gloc is None: vloc = 0 else: if gloc[1][0]=='V': vloc=0# =='Vertex' - if vloc == 0: + if vloc == 0: ax = Internal.getNodesFromType(x, 'DataArray_t') for sx in ax: ar = Internal.convertDataNode2Array(sx, dim, cn)[1] z = C.setFields([ar], z, 'centers') - C._rmVars(z, Internal.__FlowSolutionNodes__) + C._rmVars(z, Internal.__FlowSolutionNodes__) base[0][2].append(z) return a2 @@ -1181,7 +1181,7 @@ def identifyZonesLoc__(z1, z2, method, eps): # Identification des zones a partir des 8 sommets if (dx1 < eps and dx2 < eps and dy1 < eps and - dy2 < eps and dz1 < eps and dz2 < eps): + dy2 < eps and dz1 < eps and dz2 < eps): return 1 # loc = centres ? else: @@ -1205,7 +1205,7 @@ def identifyZonesLoc__(z1, z2, method, eps): # Identification des zones a partir des 8 sommets if (dx1 < eps and dx2 < eps and dy1 < eps and - dy2 < eps and dz1 < eps and dz2 < eps): + dy2 < eps and dz1 < eps and dz2 < eps): return 2 return 0 @@ -1333,7 +1333,7 @@ def integ(t, var=''): removeVol = True G._getVolumeMap(z) if loc == 0: - try: + try: z2 = C.node2Center(z, varName); removeVar = True ret += post.integ2(z2, varName, Internal.__GridCoordinates__, Internal.__FlowSolutionNodes__, Internal.__FlowSolutionCenters__) @@ -1444,13 +1444,13 @@ def computeGrad(t, var): return tp def computeGradLSQ(t, fldNames, parRun=0, fcenters=None, ptlists=None, - rfields=None): + rfields=None): tp = Internal.copyRef(t) _computeGradLSQ(tp, fldNames, parRun, fcenters, ptlists, rfields) return tp def _computeGradLSQ(t, fldNames, parRun=0, fcenters=None, ptlists=None, - rfields=None): + rfields=None): fc = None if parRun == 0: fc, fa = G.getFaceCentersAndAreas(t) @@ -1465,7 +1465,7 @@ def _computeGradLSQ(t, fldNames, parRun=0, fcenters=None, ptlists=None, if arr == None: continue fsolc = Internal.getNodeFromName1(zone, - Internal.__FlowSolutionCenters__) + Internal.__FlowSolutionCenters__) if fsolc == None: raise ValueError("FlowSolutionCenters not found.") flds = [] @@ -1481,23 +1481,23 @@ def _computeGradLSQ(t, fldNames, parRun=0, fcenters=None, ptlists=None, if parRun == 0: cc = centers[i] Grads = post.computeGradLSQ(arr, flds, pe, cc[0], cc[1], cc[2], fc[i], - None, rflds) + None, rflds) else: rflds = rfields[i] cx = Internal.getNodeFromName1(fsolc, 'CCx')[1] cy = Internal.getNodeFromName1(fsolc, 'CCy')[1] cz = Internal.getNodeFromName1(fsolc, 'CCz')[1] Grads = post.computeGradLSQ(arr, flds, pe, cx, cy, cz, fcenters[0], - ptlists, rflds) + ptlists, rflds) for j in range(len(fldNames)-3): Grad = Grads[j] Internal.createNode('grad' + fldNames[j] + 'x', 'DataArray_t', - Grad[0], None, fsolc) + Grad[0], None, fsolc) Internal.createNode('grad' + fldNames[j] + 'y', 'DataArray_t', - Grad[1], None, fsolc) + Grad[1], None, fsolc) Internal.createNode('grad' + fldNames[j] + 'z', 'DataArray_t', - Grad[2], None, fsolc) + Grad[2], None, fsolc) return None @@ -1995,7 +1995,7 @@ def _computeDiv2(t, var, ghostCells=False, withTNC=False, rmVar=False): if BCFieldZ is None: BCFieldZ = fldZ else: BCFieldZ = numpy.concatenate((BCFieldZ, fldZ), axis=1) - # ================================================================================= + # ================================================================================= if BCFieldX is None: BCFieldX = [None]*nvars if BCFieldY is None: BCFieldY = [None]*nvars @@ -2005,15 +2005,15 @@ def _computeDiv2(t, var, ghostCells=False, withTNC=False, rmVar=False): for i in range(nvars): if isArrayEmpty(f[i]): continue centers = Post.computeDiv2(x, f[i], vol, cellN, indices=indices, - BCFieldX=BCFieldX[i], BCFieldY=BCFieldY[i], - BCFieldZ=BCFieldZ[i]) + BCFieldX=BCFieldX[i], BCFieldY=BCFieldY[i], + BCFieldZ=BCFieldZ[i]) C.setFields([centers], z, 'centers') # Conditional clean up of partial derivatives if rmVar: for i in range(0, 3*nvars, 3): C._rmVars(t, ['{}:{}'.format('centers', v) for v in varList[i:i+ndims]]) - C._rmBCDataVars(t, varList[i:i+ndims]) + C._rmBCDataVars(t, varList[i:i+ndims]) return None @@ -2200,9 +2200,9 @@ def isoSurfMC(t, var, value, vars=None, split='simple'): if Internal.getNodeFromName1(z, Internal.__FlowSolutionNodes__) is None: purge=True if vars is None or vc != []: z = C.center2Node(z, target_var ) - if vars is None: + if vars is None: array = C.getAllFields(z, 'nodes')[0] - else: + else: array = C.getFields([Internal.__GridCoordinates__, Internal.__FlowSolutionNodes__], z, vars=vn+vc)[0] try: a = Post.isoSurfMC(array, var, value, split) @@ -2267,7 +2267,7 @@ def _computeIndicatorField(octreeHexa, varName, nbTargetPts=-1, bodies=[], indicator = Post.computeIndicatorField_AMR( hexa, fields, nbTargetPts, bodiesA, refineFinestLevel, coarsenCoarsestLevel,valMin=valMin,valMax=valMax,isOnlySmallest=isOnlySmallest) - else: + else: indicator, epsInf, epsSup = Post.computeIndicatorField( hexa, fields, nbTargetPts, bodiesA, refineFinestLevel, coarsenCoarsestLevel) @@ -2386,7 +2386,7 @@ def checkOccupancyCellN(lowerLimit, t): with open('CellN_occupancy_MPIrank_'+str(Cmpi.rank)+'.txt', 'w') as f: for i in range(len(list_zones)): string2write=list_zones[i] + ' ' + \ - str(list_occupancy[i])+ ' \n' + str(list_occupancy[i])+ ' \n' f.write(string2write) string2write='..........Below Threshold.......... \n' @@ -2395,12 +2395,12 @@ def checkOccupancyCellN(lowerLimit, t): f.write(string2write) string2write='List of zones='+str(list_zones_below) + ' \n' f.write(string2write) - string2write='Min Occupancy='+str(numpy.min(list_occupancy)) + ' \n' + string2write='Min Occupancy='+str(numpy.min(list_occupancy)) + ' \n' + f.write(string2write) + string2write='Max Occupancy='+str(numpy.max(list_occupancy)) + ' \n' f.write(string2write) - string2write='Max Occupancy='+str(numpy.max(list_occupancy)) + ' \n' + string2write='Mean Occupancy='+str(numpy.mean(list_occupancy))+' \n' f.write(string2write) - string2write='Mean Occupancy='+str(numpy.mean(list_occupancy))+' \n' - f.write(string2write) return list_zones,list_occupancy,list_zones_below @@ -2445,7 +2445,7 @@ def printSizeZones(t, withGhost=False, isNCells=False, printFinal=False): with open('Ncells_MPIrank_'+str(Cmpi.rank)+'.txt', 'w') as f: for i in range(len(list_save_zones)): string2write=list_save_zones[i] + ' ' + \ - str(list_save_ncells[i])+ ' \n' + str(list_save_ncells[i])+ ' \n' f.write(string2write) if printFinal: @@ -2480,7 +2480,7 @@ def probeLocations(tprobe, tcase): z=interDict[p[0]] if z: - z2=Internal.getNodeFromName(tcase, z[0]) + z2=Internal.getNodeFromName(tcase, z[0]) C._initVars(z2,'dist=sqrt(({CoordinateX}-%g)**2+({CoordinateY}-%g)**2+({CoordinateZ}-%g)**2)'%(x_loc,y_loc,z_loc)) dist_array = Internal.getNodeByName(z2,'dist')[1] @@ -2498,9 +2498,9 @@ def probeLocations(tprobe, tcase): with open('probes_locations_ijk_MPIrank_'+str(Cmpi.rank)+'.txt', 'w') as f: for i in range(len(list_save_zones)): string2write=list_save_zones[i] + ' '+ \ - str(list_save_i[i])+ ' '+ \ - str(list_save_j[i])+ ' '+ \ - str(list_save_k[i])+ '\n' + str(list_save_i[i])+ ' '+ \ + str(list_save_j[i])+ ' '+ \ + str(list_save_k[i])+ '\n' f.write(string2write) return None diff --git a/Cassiopee/Post/Post/Rotor.py b/Cassiopee/Post/Post/Rotor.py index ed849cb47..fd7c4e106 100644 --- a/Cassiopee/Post/Post/Rotor.py +++ b/Cassiopee/Post/Post/Rotor.py @@ -19,14 +19,14 @@ def switch(node1, node2): node2[1] = temp return node1, node2 -def ProdVect(U,V): +def ProdVect(U,V): Wx = U[1]*V[2]-U[2]*V[1] Wy = U[2]*V[0]-U[0]*V[2] Wz = U[0]*V[1]-U[1]*V[0] return Wx,Wy,Wz #========================================================================= -# Detection des bords de fuite, attaque et quart de corde +# Detection des bords de fuite, attaque et quart de corde # Creation du repere local et calcul de la matrice de passage # IN: a: slice # r: rayon de la slice @@ -44,7 +44,7 @@ def detectBA_BF_QC(a, r): iLE = numpy.argmin(xcp) iTE = numpy.argmax(xcp) - # Replace la pale avec son mouvement + # Replace la pale avec son mouvement gridx = Internal.getNodeFromName2(a, 'CoordinateX') gridy = Internal.getNodeFromName2(a, 'CoordinateY') gridz = Internal.getNodeFromName2(a, 'CoordinateZ') @@ -78,10 +78,10 @@ def detectBA_BF_QC(a, r): norme = numpy.sqrt(sxmean**2+symean**2+szmean**2) Vy = (sxmean/norme, symean/norme, szmean/norme) - # Vz pointe vers le haut + # Vz pointe vers le haut Vz = ProdVect(Vx, Vy) - #===== Matrices de passage + #===== Matrices de passage MatPass = numpy.array([[Vx[i],Vy[i],Vz[i]] for i in range(3)]).real #print(MatPass) Glob2Loc = numpy.linalg.inv(MatPass) @@ -232,7 +232,7 @@ def exportAccumulatorMap(accumulator, vars=['Fx','Fy','Fz']): # IN: relativeShaft: si le repere du maillage n'est pas le repere vent # OUT: rotor traction #======================================================================== -def computeZb(teff, psi, RoInf, ASOUND, Mtip, AR, SIGMA, +def computeZb(teff, psi, RoInf, ASOUND, Mtip, AR, SIGMA, relativeShaft=0., accumulatorZb=None): """Compute Zb.""" PE._extractShearStress(teff) @@ -289,7 +289,7 @@ def frictionLines(teff): for i in range(20): Pt = C.getValue(z, 'GridCoordinates', (i,35,1)) Pt = (Pt[0]+1.e-6,Pt[1],Pt[2]) - points.append(Pt) + points.append(Pt) s1 = P.streamLine2(b, points, vector=['centers:frictionX','centers:frictionY','centers:frictionZ']) return s1 @@ -301,7 +301,7 @@ def frictionLines(teff): #======================================================================== def extractRadius(teff, axis_pnt, axis_vct, loc='node'): """Extract the radius field, using the rotation axis and center.""" - def function(x,y,z): + def function(x,y,z): ux,uy,uz = axis_vct cx,cy,cz = axis_pnt ax = (y-cy)*uz - (z-cz)*uy @@ -400,7 +400,7 @@ def inverse(m): axis_pnt[0]*invP[1][0] + axis_pnt[1]*invP[1][1] + axis_pnt[2]*invP[1][2], axis_pnt[0]*invP[2][0] + axis_pnt[1]*invP[2][1] + axis_pnt[2]*invP[2][2]] - def function(x,y,z): + def function(x,y,z): # X' = invP*X # first direction is the rotation axis dist2 = x*invP[1][0] + y*invP[1][1] + z*invP[1][2] - Cprime[1] @@ -418,7 +418,7 @@ def function(x,y,z): return teff #======================================================================== -# extrait les slices en parallele et calcule les variables de post traitement +# extrait les slices en parallele et calcule les variables de post traitement # IN: teff # IN: bladeName: name of base of blade # IN: psi: current angle of rotation, used as key in all accumulator dict @@ -441,12 +441,12 @@ def function(x,y,z): # OUT: dictionnaire des slices, slices[rad] est une zone # OUT: accumule les valeurs de CnM2 dans un dictionnaire (psi,rad) #======================================================================== -def extractSlices(teff, bladeName, psi, radii, +def extractSlices(teff, bladeName, psi, radii, RoInf, PInf, ASOUND, Mtip, AR, CHORD, MU, accumulatorSlices=None, accumulatorCnM2=None, accumulatorCmM2=None, adimCnM2=0, adimCmM2=0, adimKp=0, - relativeShaft=0., localFrame=True, delta=0.05, rotationCenter=[0.,0.,0.], + relativeShaft=0., localFrame=True, delta=0.05, rotationCenter=[0.,0.,0.], coordDir='CoordinateZ', coordSlice='CoordinateX', sliceNature='straight'): """Extract slices on blade and compute Kp,Cf,CnM2,CmM2.""" if coordDir == coordSlice: @@ -488,7 +488,7 @@ def extractSlices(teff, bladeName, psi, radii, G._getNormalMap(b) C._normalize(b, ['centers:sx','centers:sy','centers:sz']) if relativeShaft != 0.: - b = T.rotate(b, (0,0,0), (0,1,0), relativeShaft, vectors=[['centers:sx','centers:sy','centers:sz'],['centers:frictionX','centers:frictionY','centers:frictionZ'],['centers:Fx','centers:Fy','centers:Fz']]) + b = T.rotate(b, (0,0,0), (0,1,0), relativeShaft, vectors=[['centers:sx','centers:sy','centers:sz'],['centers:frictionX','centers:frictionY','centers:frictionZ'],['centers:Fx','centers:Fy','centers:Fz']]) # switch GridInit and GridCoordinates and save GridCoordinates in field bp = Internal.copyRef(b) @@ -650,7 +650,7 @@ def extractSlices(teff, bladeName, psi, radii, #============================================================ # extract the files for H2T RotorLoads -# IN: teff: stress tree +# IN: teff: stress tree # IN: bladeName: nom de la base blade a extraire # IN: nblade: numero de la pale a extraire (pour les noms de fichiers de sortie) # IN: it: iteration correspondant a l'extraction de teff (pour les noms de fichiers de sortie) @@ -661,7 +661,7 @@ def extractForH2TRotorLoads(teff, bladeName, nblade, it, relativeShaft=0.): b = Internal.getNodeFromName1(teff, bladeName) bp = Internal.copyRef(b) - # extrait le maillage de reference + # extrait le maillage de reference R._switchGridAndGridInit(bp) for c, z in enumerate(Internal.getZones(bp)): Internal._rmNodesFromName(z, 'FlowSolution#Centers') @@ -683,7 +683,7 @@ def extractForH2TRotorLoads(teff, bladeName, nblade, it, relativeShaft=0.): G._getNormalMap(bp) # Pour retrouver le repere absolu - T._rotate(bp, (0,0,0), (0,1,0), relativeShaft, vectors=[['centers:sx','centers:sy','centers:sz'],['centers:frictionX','centers:frictionY','centers:frictionZ']]) + T._rotate(bp, (0,0,0), (0,1,0), relativeShaft, vectors=[['centers:sx','centers:sy','centers:sz'],['centers:frictionX','centers:frictionY','centers:frictionZ']]) for c, z in enumerate(Internal.getZones(bp)): z = C.extractVars(z, ['centers:sx', 'centers:sy', 'centers:sz', 'centers:frictionX','centers:frictionY','centers:frictionZ','centers:frictionMagnitude'], keepOldNodes=False) @@ -714,7 +714,7 @@ def cleanStress(teff, cpt): Internal._rmNodesByName(tclean, '.Solver#ownData') Internal._rmNodesByName(tclean, 'ReferenceState') Internal._rmNodesByName(tclean, 'FlowEquationSet') - Internal._rmNodesByName(tclean, 'TimeMotion') + Internal._rmNodesByName(tclean, 'TimeMotion') Internal._rmNodesByName(tclean, Internal.__GridCoordinates__+"#Init") Internal._renameNode(tclean, Internal.__GridCoordinates__, Internal.__GridCoordinates__+"#%d"%cpt) diff --git a/Cassiopee/Post/Post/extraVariables.py b/Cassiopee/Post/Post/extraVariables.py index c03df67e8..74af47459 100644 --- a/Cassiopee/Post/Post/extraVariables.py +++ b/Cassiopee/Post/Post/extraVariables.py @@ -8,8 +8,8 @@ # Vorticite en centres #============================================================================== def computeVorticity(array): - presvx = KCore.isNamePresent(array, 'VelocityX') - if presvx == -1: + presvx = KCore.isNamePresent(array, 'VelocityX') + if presvx == -1: ret = P.computeVariables(array, ['VelocityX', 'VelocityY', 'VelocityZ']) a = C.addVars([array, ret]) rot = P.computeCurl(a, ['VelocityX', 'VelocityY', 'VelocityZ']) @@ -25,7 +25,7 @@ def computeVorticity(array): # Norme de la vorticite en centres #============================================================================== def computeVorticityMagnitude(array): - presvx = KCore.isNamePresent(array, 'centers:VorticityX') + presvx = KCore.isNamePresent(array, 'centers:VorticityX') if presvx == -1: ret = P.computeVariables(array, ['VelocityX', 'VelocityY', 'VelocityZ']) a = C.addVars([array, ret]) @@ -47,8 +47,8 @@ def computeQCriterion(array): 'gradxVelocityY', 'gradyVelocityY', 'gradzVelocityY', 'gradxVelocityZ', 'gradyVelocityZ', 'gradzVelocityZ'] # Compute velocity - presvx = KCore.isNamePresent(array, 'VelocityX') - if presvx==-1: + presvx = KCore.isNamePresent(array, 'VelocityX') + if presvx==-1: ret = P.computeVariables(array, ['VelocityX', 'VelocityY', 'VelocityZ']) a = C.addVars([array, ret]) else: a = array @@ -75,7 +75,7 @@ def computeShearStress(array, gamma=1.4, rgp=287.053, 'gradxVelocityZ', 'gradyVelocityZ', 'gradzVelocityZ'] vars1 = ['ViscosityMolecular']+vars0 presvx = KCore.isNamePresent(array, 'VelocityX') - if presvx == -1: + if presvx == -1: ret = P.computeVariables(array, ['VelocityX', 'VelocityY', 'VelocityZ']) a = C.addVars([array, ret]) else: a = array @@ -91,7 +91,7 @@ def computeShearStress(array, gamma=1.4, rgp=287.053, gradV = P.computeGrad(a, 'VelocityY') gradW = P.computeGrad(a, 'VelocityZ') tau = C.addVars([gradU, gradV, gradW, mu]) - else: + else: grads = C.extractVars(a,vars0) tau = C.addVars([grads, mu]) @@ -115,7 +115,7 @@ def computeShearStress(array, gamma=1.4, rgp=287.053, #============================================================================== def computeSkinFriction(array, tangent=0): pres1 = KCore.isNamePresent(array, 'sx') - if pres1 == -1: + if pres1 == -1: try: import Generator as G except: raise ImportError("computeExtraVariable: skinFriction requires Generator module.") n = G.getNormalMap(array) diff --git a/Cassiopee/Post/Post/extraVariablesPT.py b/Cassiopee/Post/Post/extraVariablesPT.py index c06b46eb4..ba3319ee0 100644 --- a/Cassiopee/Post/Post/extraVariablesPT.py +++ b/Cassiopee/Post/Post/extraVariablesPT.py @@ -15,8 +15,8 @@ def computeVorticity(t): t2 = Internal.copyRef(t) presvx = C.isNamePresent(t2, 'VelocityX') - if presvx == -1: - presvxc = C.isNamePresent(t2, 'centers:VelocityX') + if presvx == -1: + presvxc = C.isNamePresent(t2, 'centers:VelocityX') if presvxc > -1: t2 = C.center2Node(t2, ['centers:VelocityX','centers:VelocityY','centers:VelocityZ']) else: t2 = P.computeVariables(t2, ['VelocityX', 'VelocityY', 'VelocityZ']) @@ -47,9 +47,9 @@ def computeQCriterion(t): 'centers:gradxVelocityY', 'centers:gradyVelocityY', 'centers:gradzVelocityY', 'centers:gradxVelocityZ', 'centers:gradyVelocityZ', 'centers:gradzVelocityZ'] t2 = Internal.copyRef(t) - presvx = C.isNamePresent(t2, 'VelocityX') - if presvx == -1: - presvxc = C.isNamePresent(t2, 'centers:VelocityX') + presvx = C.isNamePresent(t2, 'VelocityX') + if presvx == -1: + presvxc = C.isNamePresent(t2, 'centers:VelocityX') if presvxc > -1: t2 = C.center2Node(t2,['centers:VelocityX','centers:VelocityY','centers:VelocityZ']) else: t2 = P.computeVariables(t2, ['VelocityX', 'VelocityY', 'VelocityZ']) @@ -81,9 +81,9 @@ def computeShearStress(t, gamma=1.4, rgp=287.053, # Molecular Viscosity presmuc = C.isNamePresent(t2, 'centers:ViscosityMolecular') - if presmuc == -1: + if presmuc == -1: presmu = C.isNamePresent(t2, 'ViscosityMolecular') - if presmu == -1: + if presmu == -1: t2 = P.computeVariables(t2, ['ViscosityMolecular'], gamma=gamma, rgp=rgp, Cs=Cs, mus=mus, Ts=Ts) t2 = C.node2Center(t2, 'ViscosityMolecular') @@ -91,10 +91,10 @@ def computeShearStress(t, gamma=1.4, rgp=287.053, # Gradient of velocity presgx = C.isNamePresent(t2, 'centers:gradxVelocityX') - if presgx == -1: + if presgx == -1: presgxn = C.isNamePresent(t2, 'gradxVelocityX') if presgxn > -1: t2 = C.center2Node(t2,vars1) - else: + else: # No gradient found presvx = C.isNamePresent(t2, 'VelocityX') if presvx > -1: @@ -135,12 +135,12 @@ def _computeWallShearStress(t): if dimPb is None: dimPb = 3 else: dimPb = Internal.getValue(dimPb) - if dimPb == 2: - vars1 = ['gradxVelocityX', 'gradyVelocityX', 'gradxVelocityY', 'gradyVelocityY'] - else: + if dimPb == 2: + vars1 = ['gradxVelocityX', 'gradyVelocityX', 'gradxVelocityY', 'gradyVelocityY'] + else: vars1 = ['gradxVelocityX', 'gradyVelocityX', 'gradzVelocityX',\ - 'gradxVelocityY', 'gradyVelocityY', 'gradzVelocityY',\ - 'gradxVelocityZ', 'gradyVelocityZ', 'gradzVelocityZ'] + 'gradxVelocityY', 'gradyVelocityY', 'gradzVelocityY',\ + 'gradxVelocityZ', 'gradyVelocityZ', 'gradzVelocityZ'] presgx = C.isNamePresent(t,vars1[0]) if presgx == 1: loc = 'nodes' @@ -149,7 +149,7 @@ def _computeWallShearStress(t): if presgx == 1: loc = 'centers' else: raise ValueError('gradxVelocity is required in tree.') - for nov in range(len(vars1)): + for nov in range(len(vars1)): vars1[nov]='centers:'+vars1[nov] [RoInf, RouInf, RovInf, RowInf, RoeInf, PInf, TInf, cvInf, MInf, ReInf, Cs, Gamma, RokInf, RoomegaInf, RonutildeInf, Mus, Cs, Ts, Pr] = C.getState(t) @@ -242,13 +242,13 @@ def computeSkinFriction(t, centers=0, tangent=0): if pres1 == -1: t2 = G.getNormalMap(t2) else: pres1n = C.isNamePresent(t2, 'sx') - if pres1n > -1: t2 = C.node2Center(t2,['sx','sy','sz']) + if pres1n > -1: t2 = C.node2Center(t2,['sx','sy','sz']) t2 = C.normalize(t2, ['centers:sx', 'centers:sy', 'centers:sz']) pres2 = C.isNamePresent(t2, 'centers:SkinFrictionX') if pres2 == -1: pres2n = C.isNamePresent(t2, 'SkinFrictionX') - if pres2n > -1: t2 = C.node2Center(t2,['SkinFrictionX','SkinFrictionY','SkinFrictionZ']) + if pres2n > -1: t2 = C.node2Center(t2,['SkinFrictionX','SkinFrictionY','SkinFrictionZ']) else: t2 = C.initVars(t2, '{centers:SkinFrictionX}={centers:ShearStressXX}*{centers:sx}+{centers:ShearStressXY}*{centers:sy}+{centers:ShearStressXZ}*{centers:sz}') t2 = C.initVars(t2, '{centers:SkinFrictionY}={centers:ShearStressXY}*{centers:sx}+{centers:ShearStressYY}*{centers:sy}+{centers:ShearStressYZ}*{centers:sz}') @@ -259,7 +259,7 @@ def computeSkinFriction(t, centers=0, tangent=0): if pres3 == -1: pres3n = C.isNamePresent(t2,'SkinFrictionTangentialX') if pres3n > -1: - t2 = C.node2Center(t2,['SkinFrictionTangentialX','SkinFrictionTangentialY','SkinFrictionTangentialZ']) + t2 = C.node2Center(t2,['SkinFrictionTangentialX','SkinFrictionTangentialY','SkinFrictionTangentialZ']) else: t2 = C.initVars(t2, '{centers:SkinFrictionTangentialX}={centers:SkinFrictionX} - {centers:sx}*({centers:SkinFrictionX}*{centers:sx}+{centers:SkinFrictionY}*{centers:sy}+{centers:SkinFrictionZ}*{centers:sz})') t2 = C.initVars(t2, '{centers:SkinFrictionTangentialY}={centers:SkinFrictionY} - {centers:sy}*({centers:SkinFrictionX}*{centers:sx}+{centers:SkinFrictionY}*{centers:sy}+{centers:SkinFrictionZ}*{centers:sz})') diff --git a/Cassiopee/Post/doc/source/conf.py b/Cassiopee/Post/doc/source/conf.py index 9611200b8..33b0b53fc 100644 --- a/Cassiopee/Post/doc/source/conf.py +++ b/Cassiopee/Post/doc/source/conf.py @@ -193,28 +193,28 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', + # Additional stuff for the LaTeX preamble. + #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('Post', 'Post.tex', u'Post Documentation', - u'/ELSA/MU-10019/V'+__version__, 'manual'), - ('ExtraVariables2', 'ExtraVariables2.tex', u'Post.ExtraVariables2 Documentation', - u'/ELSA/MU-10019/V'+__version__, 'manual'), - ('Rotor', 'Rotor.tex', u'Post.Rotor Documentation', - u'/ELSA/MU-10019/V'+__version__, 'manual'), - ('Post_IBM', 'Post_IBM.tex', u'Post.IBM Documentation', - u'/ELSA/MU-10019/V'+__version__, 'manual'), + ('Post', 'Post.tex', u'Post Documentation', + u'/ELSA/MU-10019/V'+__version__, 'manual'), + ('ExtraVariables2', 'ExtraVariables2.tex', u'Post.ExtraVariables2 Documentation', + u'/ELSA/MU-10019/V'+__version__, 'manual'), + ('Rotor', 'Rotor.tex', u'Post.Rotor Documentation', + u'/ELSA/MU-10019/V'+__version__, 'manual'), + ('Post_IBM', 'Post_IBM.tex', u'Post.IBM Documentation', + u'/ELSA/MU-10019/V'+__version__, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -257,9 +257,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Post', u'Post Documentation', - u'ONERA', 'Post', 'One line description of project.', - 'Miscellaneous'), + ('index', 'Post', u'Post Documentation', + u'ONERA', 'Post', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/Post/setup.py b/Cassiopee/Post/setup.py index 8f8e7d9aa..5640f8d65 100644 --- a/Cassiopee/Post/setup.py +++ b/Cassiopee/Post/setup.py @@ -39,7 +39,7 @@ listExtensions.append( Extension('Post.post', sources=["Post/post.cpp"], - include_dirs=["Post"]+additionalIncludePaths+[numpyIncDir,kcoreIncDir], + include_dirs=["Post"]+additionalIncludePaths+[numpyIncDir,kcoreIncDir], library_dirs=additionalLibPaths+libraryDirs, libraries=libraries+additionalLibs, extra_compile_args=Dist.getCppArgs(), @@ -56,7 +56,7 @@ packages=['Post'], package_dir={"":"."}, ext_modules=listExtensions - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Post/setupLegacy.py b/Cassiopee/Post/setupLegacy.py index d581c4882..252dbfd81 100644 --- a/Cassiopee/Post/setupLegacy.py +++ b/Cassiopee/Post/setupLegacy.py @@ -51,7 +51,7 @@ listExtensions.append( Extension('Post.post', sources=["Post/post.cpp"]+srcs.cpp_srcs, - include_dirs=["Post"]+additionalIncludePaths+[numpyIncDir,kcoreIncDir], + include_dirs=["Post"]+additionalIncludePaths+[numpyIncDir,kcoreIncDir], library_dirs=additionalLibPaths+libraryDirs, libraries=libraries+additionalLibs, extra_compile_args=Dist.getCppArgs(), @@ -67,7 +67,7 @@ package_dir={"":"."}, packages=['Post'], ext_modules=listExtensions - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Post/srcs.py b/Cassiopee/Post/srcs.py index 790e8fc70..ea9ab4a70 100644 --- a/Cassiopee/Post/srcs.py +++ b/Cassiopee/Post/srcs.py @@ -75,26 +75,26 @@ if STREAMLINE2: cpp_srcs += [ - "Post/Stream2/face.cpp", - "Post/Stream2/connectivity.cpp", - "Post/Stream2/kdtree.cpp", - "Post/Stream2/linear_algebra.cpp", - "Post/Stream2/triangulated_polyhedron.cpp", - "Post/Stream2/zone_data_view.cpp", - "Post/Stream2/structured_data_view.cpp", - "Post/Stream2/unstructured_data_view.cpp", - "Post/Stream2/ngon_data_view.cpp", - "Post/Stream2/stream_line.cpp", - "Post/Stream2/py_stream_line.cpp", - "Post/Stream2/write_svg.cpp", - "Post/Stream2/volume.cpp", - "Post/Stream2/rotational.cpp", - "Post/Stream2/ribbon_stream_line.cpp", - "Post/Stream2/py_streamribbon.cpp"] + "Post/Stream2/face.cpp", + "Post/Stream2/connectivity.cpp", + "Post/Stream2/kdtree.cpp", + "Post/Stream2/linear_algebra.cpp", + "Post/Stream2/triangulated_polyhedron.cpp", + "Post/Stream2/zone_data_view.cpp", + "Post/Stream2/structured_data_view.cpp", + "Post/Stream2/unstructured_data_view.cpp", + "Post/Stream2/ngon_data_view.cpp", + "Post/Stream2/stream_line.cpp", + "Post/Stream2/py_stream_line.cpp", + "Post/Stream2/write_svg.cpp", + "Post/Stream2/volume.cpp", + "Post/Stream2/rotational.cpp", + "Post/Stream2/ribbon_stream_line.cpp", + "Post/Stream2/py_streamribbon.cpp"] else: cpp_srcs += [ - "Post/Stream2/py_stream_line_stub.cpp", - "Post/Stream2/py_stream_ribbon_stub.cpp"] + "Post/Stream2/py_stream_line_stub.cpp", + "Post/Stream2/py_stream_ribbon_stub.cpp"] if USURP and f90compiler != "None" and os.access(dirName+'/usurp', os.F_OK): cpp_srcs.append("Post/usurp.cpp") diff --git a/Cassiopee/Post/test/coarsen_t1.py b/Cassiopee/Post/test/coarsen_t1.py index f4b300219..bcf02dccc 100644 --- a/Cassiopee/Post/test/coarsen_t1.py +++ b/Cassiopee/Post/test/coarsen_t1.py @@ -16,7 +16,7 @@ m2 = G.cart((0.,0.,0.),(hi,hj,hk), (ni,nj,nk)) m2 = T.subzone(m2,(3,3,6),(m[2]-2,m[3]-2,6)) m2 = T.translate(m2, (0.75,0.75,0.25)) -m2 = T.rotate(m2, (0.2,0.2,0.), (0.,0.,1.), 15.) +m2 = T.rotate(m2, (0.2,0.2,0.), (0.,0.,1.), 15.) m2 = T.perturbate(m2, 0.51) tri = G.delaunay(m2) diff --git a/Cassiopee/Post/test/computeCurl2.py b/Cassiopee/Post/test/computeCurl2.py index 928b837c0..d60569103 100644 --- a/Cassiopee/Post/test/computeCurl2.py +++ b/Cassiopee/Post/test/computeCurl2.py @@ -37,4 +37,4 @@ for i in ref : i = T.subzone(i,(1,1,1),(i[2],i[3],1)) sol.append(i) -C.convertArrays2File(sol, "ref.plt", "bin_tp") +C.convertArrays2File(sol, "ref.plt", "bin_tp") diff --git a/Cassiopee/Post/test/computeCurlPT.py b/Cassiopee/Post/test/computeCurlPT.py index 451932f06..d1043bf6f 100644 --- a/Cassiopee/Post/test/computeCurlPT.py +++ b/Cassiopee/Post/test/computeCurlPT.py @@ -6,7 +6,7 @@ ni = 30; nj = 40; nk = 3 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) m = C.initVars(m,'{F1}=12*{CoordinateY}*{CoordinateY}+4') -m = C.addVars(m,'F2'); m = C.addVars(m,'F3') +m = C.addVars(m,'F2'); m = C.addVars(m,'F3') varname = ['F1','F2','F3'] m = P.computeCurl(m, varname) diff --git a/Cassiopee/Post/test/computeCurlPT_t1.py b/Cassiopee/Post/test/computeCurlPT_t1.py index 9863410a2..02e59ca22 100644 --- a/Cassiopee/Post/test/computeCurlPT_t1.py +++ b/Cassiopee/Post/test/computeCurlPT_t1.py @@ -12,11 +12,11 @@ def F(x,y,z): return 12*y*y + 4 ni = 30; nj = 40 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,1)) C._initVars(m,'F1',F,['CoordinateX','CoordinateY','CoordinateZ']) -C._addVars(m,'F2'); C._addVars(m,'F3') +C._addVars(m,'F2'); C._addVars(m,'F3') varname = ['F1','F2','F3'] m = P.computeCurl(m, varname) C._initVars(m,'centers:F4',F,['centers:rotx','centers:roty','centers:rotz']) -C._addVars(m,'centers:F5'); C._addVars(m,'centers:F6') +C._addVars(m,'centers:F5'); C._addVars(m,'centers:F6') varname = ['centers:F4','centers:F5','centers:F6'] m = P.computeCurl(m, varname) test.testT(m,2) @@ -27,11 +27,11 @@ def F(x,y,z): return 12*y*y + 4 ni = 30; nj = 40 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,2)) C._initVars(m,'F1',F,['CoordinateX','CoordinateY','CoordinateZ']) -C._addVars(m,'F2'); C._addVars(m,'F3') +C._addVars(m,'F2'); C._addVars(m,'F3') varname = ['F1','F2','F3'] m = P.computeCurl(m, varname) C._initVars(m,'centers:F4',F,['centers:rotx','centers:roty','centers:rotz']) -C._addVars(m,'centers:F5'); m = C.addVars(m,'centers:F6') +C._addVars(m,'centers:F5'); m = C.addVars(m,'centers:F6') varname = ['centers:F4','centers:F5','centers:F6'] m = P.computeCurl(m, varname) test.testT(m,3) diff --git a/Cassiopee/Post/test/computeCurlPT_t2.py b/Cassiopee/Post/test/computeCurlPT_t2.py index 0a167079c..894dd55fb 100644 --- a/Cassiopee/Post/test/computeCurlPT_t2.py +++ b/Cassiopee/Post/test/computeCurlPT_t2.py @@ -12,11 +12,11 @@ def F(x,y,z): return 12*y*y + 4 ni = 30; nj = 40 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,1)) C._initVars(m,'F1',F,['CoordinateX','CoordinateY','CoordinateZ']) -C._addVars(m,'F2'); C._addVars(m,'F3') +C._addVars(m,'F2'); C._addVars(m,'F3') varname = ['F1','F2','F3'] m = P.computeCurl(m, varname) C._initVars(m,'centers:F4',F,['centers:rotx','centers:roty','centers:rotz']) -C._addVars(m,'centers:F5'); C._addVars(m,'centers:F6') +C._addVars(m,'centers:F5'); C._addVars(m,'centers:F6') m = C.addBC2Zone(m,'ov','BCOverlap','imin') t = C.newPyTree(['Base',2,m]) t[2][1] = C.addState(t[2][1], 'Mach', 0.6) @@ -30,15 +30,15 @@ def F(x,y,z): return 12*y*y + 4 ni = 30; nj = 40 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,2)) C._initVars(m,'F1',F,['CoordinateX','CoordinateY','CoordinateZ']) -C._addVars(m,'F2'); C._addVars(m,'F3') +C._addVars(m,'F2'); C._addVars(m,'F3') varname = ['F1','F2','F3'] m = P.computeCurl(m, varname) C._initVars(m,'centers:F4',F,['centers:rotx','centers:roty','centers:rotz']) -C._addVars(m,'centers:F5'); C._addVars(m,'centers:F6') +C._addVars(m,'centers:F5'); C._addVars(m,'centers:F6') m = C.addBC2Zone(m,'ov','BCOverlap','imin') t = C.newPyTree(['Base',3,m]) t[2][1] = C.addState(t[2][1], 'Mach', 0.6) -t = C.fillEmptyBCWith(t,'wall','BCWall', dim = 2) +t = C.fillEmptyBCWith(t,'wall','BCWall', dim=2) varname = ['centers:F4','centers:F5','centers:F6'] t = P.computeCurl(t, varname) test.testT(t,3) diff --git a/Cassiopee/Post/test/computeDiffPT.py b/Cassiopee/Post/test/computeDiffPT.py index 4f8515cb5..ea986103a 100644 --- a/Cassiopee/Post/test/computeDiffPT.py +++ b/Cassiopee/Post/test/computeDiffPT.py @@ -6,5 +6,5 @@ ni = 30; nj = 40; nk = 1 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) m = C.initVars(m, '{Density}=({CoordinateX}>5)*1.') -m = P.computeDiff(m, 'Density') +m = P.computeDiff(m, 'Density') C.convertPyTree2File(m, 'out.cgns') diff --git a/Cassiopee/Post/test/computeDiffPT_t1.py b/Cassiopee/Post/test/computeDiffPT_t1.py index 42e88ee45..346309b3e 100644 --- a/Cassiopee/Post/test/computeDiffPT_t1.py +++ b/Cassiopee/Post/test/computeDiffPT_t1.py @@ -26,7 +26,7 @@ def celln(y): # Prise en compte du cellN # m = C.initVars(m, 'cellN', celln, ['CoordinateY']) -m = P.computeDiff(m,'Density') +m = P.computeDiff(m,'Density') test.testT(m,2) # @@ -51,13 +51,13 @@ def celln(y): ni = 30; nj = 40; nk = 11 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),10./(nk-1)), (ni,nj,nk)) m = C.initVars(m, 'Density', F, ['CoordinateX']) -m = P.computeDiff(m,'Density') +m = P.computeDiff(m,'Density') test.testT(m,3) # # Prise en compte du cellN # m = C.initVars(m, 'cellN', celln, ['CoordinateY']) -m = P.computeDiff(m,'Density') +m = P.computeDiff(m,'Density') test.testT(m,4) # diff --git a/Cassiopee/Post/test/computeDiffPT_t2.py b/Cassiopee/Post/test/computeDiffPT_t2.py index 173b23b9c..a8b88459e 100644 --- a/Cassiopee/Post/test/computeDiffPT_t2.py +++ b/Cassiopee/Post/test/computeDiffPT_t2.py @@ -18,13 +18,13 @@ def celln(y): m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) m = C.initVars(m, 'Density', F, ['CoordinateX']) m = C.node2Center(m, 'Density') -m = P.computeDiff(m, 'centers:Density') +m = P.computeDiff(m, 'centers:Density') test.testT(m,1) # Prise en compte du cellN m = C.initVars(m, 'cellN', celln, ['CoordinateY']) m = C.node2Center(m, 'cellN') -m = P.computeDiff(m, 'centers:Density') +m = P.computeDiff(m, 'centers:Density') test.testT(m,2) #------------------------------- @@ -34,7 +34,7 @@ def celln(y): m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1./(nk-1)), (ni,nj,nk)) m = C.initVars(m, 'Density', F, ['CoordinateX']) m = C.node2Center(m,'Density') -m = P.computeDiff(m,'centers:Density') +m = P.computeDiff(m,'centers:Density') test.testT(m,3) # # Prise en compte du cellN diff --git a/Cassiopee/Post/test/computeDiffPT_t3.py b/Cassiopee/Post/test/computeDiffPT_t3.py index 43b6fdd66..26a6a4acb 100644 --- a/Cassiopee/Post/test/computeDiffPT_t3.py +++ b/Cassiopee/Post/test/computeDiffPT_t3.py @@ -27,4 +27,3 @@ def celln(y): t = C.newPyTree(['Base']); t[2][1][2] += [a,b] t = P.computeDiff(t, 'Density') test.testT(t,1) - diff --git a/Cassiopee/Post/test/computeDiff_t1.py b/Cassiopee/Post/test/computeDiff_t1.py index 4329cdcca..e8eaea71d 100644 --- a/Cassiopee/Post/test/computeDiff_t1.py +++ b/Cassiopee/Post/test/computeDiff_t1.py @@ -14,7 +14,7 @@ def celln(y): #-------------- # 2D structure -#-------------- +#-------------- ni = 30; nj = 40; nk = 1 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) m = C.initVars(m, 'ro', F, ['x']) @@ -27,13 +27,13 @@ def celln(y): #-------------- # 3D structure -#-------------- +#-------------- ni = 30; nj = 40; nk = 11 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),10./(nk-1)), (ni,nj,nk)) m = C.initVars(m, 'ro', F, ['x']) -p = P.computeDiff(m,'ro') +p = P.computeDiff(m,'ro') test.testA([p],3) # m = C.initVars(m, 'cellN', celln, ['y']) -p = P.computeDiff(m,'ro') +p = P.computeDiff(m,'ro') test.testA([p],4) diff --git a/Cassiopee/Post/test/computeDiff_t2.py b/Cassiopee/Post/test/computeDiff_t2.py index 207afd359..4f94956f2 100644 --- a/Cassiopee/Post/test/computeDiff_t2.py +++ b/Cassiopee/Post/test/computeDiff_t2.py @@ -14,11 +14,11 @@ def celln(y): #-------------- # TRI -#-------------- +#-------------- ni = 30; nj = 40; nk = 1 m = G.cartTetra((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) m = C.initVars(m, 'ro', F, ['x']) -p = P.computeDiff(m,'ro') +p = P.computeDiff(m,'ro') test.testA([p],1) # m = C.initVars(m, 'cellN', celln, ['y']) @@ -27,23 +27,23 @@ def celln(y): #-------------- # TETRA -#-------------- +#-------------- ni = 30; nj = 40; nk = 11 m = G.cartTetra((0,0,0), (10./(ni-1),10./(nj-1),10./(nk-1)), (ni,nj,nk)) m = C.initVars(m, 'ro', F, ['x']) -p = P.computeDiff(m,'ro') +p = P.computeDiff(m,'ro') test.testA([p],3) # m = C.initVars(m, 'cellN', celln, ['y']) -p = P.computeDiff(m,'ro') +p = P.computeDiff(m,'ro') test.testA([p],4) #-------------- # QUAD -#-------------- +#-------------- ni = 30; nj = 40; nk = 1 m = G.cartHexa((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) m = C.initVars(m, 'ro', F, ['x']) -p = P.computeDiff(m,'ro') +p = P.computeDiff(m,'ro') test.testA([p],5) # m = C.initVars(m, 'cellN', celln, ['y']) @@ -51,15 +51,15 @@ def celln(y): test.testA([p],6) #-------------- # HEXA -#-------------- +#-------------- ni = 30; nj = 40; nk = 11 m = G.cartHexa((0,0,0), (10./(ni-1),10./(nj-1),10./(nk-1)), (ni,nj,nk)) m = C.initVars(m, 'ro', F, ['x']) -p = P.computeDiff(m,'ro') +p = P.computeDiff(m,'ro') test.testA([p],7) # m = C.initVars(m, 'cellN', celln, ['y']) -p = P.computeDiff(m,'ro') +p = P.computeDiff(m,'ro') test.testA([p],8) # # PENTA @@ -67,10 +67,10 @@ def celln(y): ni = 30; nj = 40; nk = 11 m = G.cartPenta((0,0,0), (10./(ni-1),10./(nj-1),10./(nk-1)), (ni,nj,nk)) m = C.initVars(m, 'ro', F, ['x']) -p = P.computeDiff(m,'ro') +p = P.computeDiff(m,'ro') test.testA([p],9) # m = C.initVars(m, 'cellN', celln, ['y']) -p = P.computeDiff(m,'ro') +p = P.computeDiff(m,'ro') test.testA([p],10) # diff --git a/Cassiopee/Post/test/computeDiff_t3.py b/Cassiopee/Post/test/computeDiff_t3.py index eed040326..786f7cffa 100644 --- a/Cassiopee/Post/test/computeDiff_t3.py +++ b/Cassiopee/Post/test/computeDiff_t3.py @@ -16,7 +16,7 @@ def celln(y): # computeDiff_t3 does not work for unstructured arrays, located at centers. # #-------------- # # TRI -# #-------------- +# #-------------- # ni = 30; nj = 40; nk = 1 # m = G.cartTetra((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) # m = C.node2Center(m) @@ -30,23 +30,23 @@ def celln(y): # #-------------- # # TETRA -# #-------------- +# #-------------- # ni = 30; nj = 40; nk = 11 # m = G.cartTetra((0,0,0), (10./(ni-1),10./(nj-1),10./(nk-1)), (ni,nj,nk)) # m = C.initVars(m, 'ro', F, ['x']) -# p = P.computeDiff(m,'ro') +# p = P.computeDiff(m,'ro') # test.testA([p],3) # # # m = C.initVars(m, 'cellN', celln, ['y']) -# p = P.computeDiff(m,'ro') +# p = P.computeDiff(m,'ro') # test.testA([p],4) # #-------------- # # QUAD -# #-------------- +# #-------------- # ni = 30; nj = 40; nk = 1 # m = G.cartHexa((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) # m = C.initVars(m, 'ro', F, ['x']) -# p = P.computeDiff(m,'ro') +# p = P.computeDiff(m,'ro') # test.testA([p],5) # # # m = C.initVars(m, 'cellN', celln, ['y']) @@ -54,15 +54,15 @@ def celln(y): # test.testA([p],6) # #-------------- # # HEXA -# #-------------- +# #-------------- # ni = 30; nj = 40; nk = 11 # m = G.cartHexa((0,0,0), (10./(ni-1),10./(nj-1),10./(nk-1)), (ni,nj,nk)) # m = C.initVars(m, 'ro', F, ['x']) -# p = P.computeDiff(m,'ro') +# p = P.computeDiff(m,'ro') # test.testA([p],7) # # # m = C.initVars(m, 'cellN', celln, ['y']) -# p = P.computeDiff(m,'ro') +# p = P.computeDiff(m,'ro') # test.testA([p],8) # # # # PENTA @@ -70,10 +70,10 @@ def celln(y): # ni = 30; nj = 40; nk = 11 # m = G.cartPenta((0,0,0), (10./(ni-1),10./(nj-1),10./(nk-1)), (ni,nj,nk)) # m = C.initVars(m, 'ro', F, ['x']) -# p = P.computeDiff(m,'ro') +# p = P.computeDiff(m,'ro') # test.testA([p],9) # # # m = C.initVars(m, 'cellN', celln, ['y']) -# p = P.computeDiff(m,'ro') +# p = P.computeDiff(m,'ro') # test.testA([p],10) # # diff --git a/Cassiopee/Post/test/computeDiv2PT_t2.py b/Cassiopee/Post/test/computeDiv2PT_t2.py index 9606052ec..e4cb4ff66 100644 --- a/Cassiopee/Post/test/computeDiv2PT_t2.py +++ b/Cassiopee/Post/test/computeDiv2PT_t2.py @@ -31,7 +31,7 @@ # #---------- # # 3D STRUCT # #---------- -ni = 15; nj = 15; nk = 15 +ni = 15; nj = 15; nk = 15 m1 = G.cart(( 0, 0, 0), (10./(ni-1),10./(nj-1),2./(nk-1)), (ni,nj,nk)) m2 = G.cart(( 0,10, 0), (10./(ni-1),10./(nj-1),2./(nk-1)), (ni,nj,nk)) m3 = G.cart(( 0, 0, 2), (10./(ni-1),10./(nj-1),2./(nk-1)), (ni,nj,nk)) @@ -52,7 +52,7 @@ test.testT(t,2) #---------- -# 2D NGON +# 2D NGON #---------- ni = 15; nj = 15 m1 = G.cartNGon(( 0, 0, 0), (10./(ni-1),10./(nj-1),1.), (ni,nj,2)) @@ -78,7 +78,7 @@ # #-------- # # 3D NGON # #-------- -ni = 15; nj = 15; nk = 15 +ni = 15; nj = 15; nk = 15 m1 = G.cartNGon(( 0, 0, 0), (10./(ni-1),10./(nj-1),2./(nk-1)), (ni,nj,nk)) m2 = G.cartNGon(( 0,10, 0), (10./(ni-1),10./(nj-1),2./(nk-1)), (ni,nj,nk)) m3 = G.cartNGon(( 0, 0, 2), (10./(ni-1),10./(nj-1),2./(nk-1)), (ni,nj,nk)) diff --git a/Cassiopee/Post/test/computeDiv2PT_t3.py b/Cassiopee/Post/test/computeDiv2PT_t3.py index e1d6505ee..8df175e64 100644 --- a/Cassiopee/Post/test/computeDiv2PT_t3.py +++ b/Cassiopee/Post/test/computeDiv2PT_t3.py @@ -8,7 +8,7 @@ # -------- # 3D NGON #-------- -ni = 15; nj = 15; nk = 15 +ni = 15; nj = 15; nk = 15 m1 = G.cartNGon(( 0, 0, 0), (10./(ni-1),10./(nj-1),2./(nk-1)), (ni,nj,nk)) m2 = G.cartNGon(( 0,10, 0), (10./(ni-1),10./(nj-1),2./(nk-1)), (ni,nj,nk)) m3 = G.cartNGon(( 0, 0, 2), (10./(ni-1),10./(nj-1),2./(nk-1)), (ni,nj,nk)) diff --git a/Cassiopee/Post/test/computeDiv2PT_t4.py b/Cassiopee/Post/test/computeDiv2PT_t4.py index 97f036922..fcb2a1144 100644 --- a/Cassiopee/Post/test/computeDiv2PT_t4.py +++ b/Cassiopee/Post/test/computeDiv2PT_t4.py @@ -95,7 +95,7 @@ def F(x): return 2*x #---------- # 3D STRUCT #---------- -ni = 15; nj = 15; nk = 15 +ni = 15; nj = 15; nk = 15 m1 = G.cart(( 0, 0, 0), (10./(ni-1),10./(nj-1),2./(nk-1)), (ni,nj,nk)) m2 = G.cart(( 0,10, 0), (10./(ni-1),10./(nj-1),2./(nk-1)), (ni,nj,nk)) m3 = G.cart(( 0, 0, 2), (10./(ni-1),10./(nj-1),2./(nk-1)), (ni,nj,nk)) diff --git a/Cassiopee/Post/test/computeDivPT_t3.py b/Cassiopee/Post/test/computeDivPT_t3.py index 970e04b32..7c4540527 100644 --- a/Cassiopee/Post/test/computeDivPT_t3.py +++ b/Cassiopee/Post/test/computeDivPT_t3.py @@ -29,4 +29,3 @@ def Fz(x,y,z): return (x-10)*(y-2)+z*z t = C.newPyTree(['Base',2]); t[2][1][2] += [a,b] t = P.computeDiv(t, 'fld') test.testT(t,1) - diff --git a/Cassiopee/Post/test/computeGrad2PT_t2.py b/Cassiopee/Post/test/computeGrad2PT_t2.py index dd74818c4..a13fd485c 100644 --- a/Cassiopee/Post/test/computeGrad2PT_t2.py +++ b/Cassiopee/Post/test/computeGrad2PT_t2.py @@ -6,7 +6,7 @@ import Connector.PyTree as X import KCore.test as test -# Cas 2D avec raccord match +# Cas 2D avec raccord match # ========================= ni = 20 nj = 20 @@ -30,4 +30,3 @@ P._computeGrad2(t, 'centers:F') test.testT(t,1) - diff --git a/Cassiopee/Post/test/computeGrad2PT_t3.py b/Cassiopee/Post/test/computeGrad2PT_t3.py index d289f06ff..4af8d0785 100644 --- a/Cassiopee/Post/test/computeGrad2PT_t3.py +++ b/Cassiopee/Post/test/computeGrad2PT_t3.py @@ -7,7 +7,7 @@ import Connector.PyTree as X import KCore.test as test -# Cas 3D avec raccord match +# Cas 3D avec raccord match # ========================= ni = 30 nj = 30 @@ -36,4 +36,3 @@ P._computeGrad2(t, 'centers:F') test.testT(t,1) - diff --git a/Cassiopee/Post/test/computeGrad2PT_t4.py b/Cassiopee/Post/test/computeGrad2PT_t4.py index fdc8e958b..9c1b33dee 100644 --- a/Cassiopee/Post/test/computeGrad2PT_t4.py +++ b/Cassiopee/Post/test/computeGrad2PT_t4.py @@ -7,11 +7,11 @@ import Connector.PyTree as X import KCore.test as test -# Cas 3D NGon avec raccord match +# Cas 3D NGon avec raccord match # =============================== -ni = 30 -nj = 30 -nk = 10 +ni = 30 +nj = 30 +nk = 10 lx = 1. ly = 1. lz = 0.25 @@ -35,4 +35,3 @@ P._computeGrad2(t, 'centers:F') test.testT(t,1) - diff --git a/Cassiopee/Post/test/computeGrad2PT_t5.py b/Cassiopee/Post/test/computeGrad2PT_t5.py index 720816d43..78d44cd4e 100644 --- a/Cassiopee/Post/test/computeGrad2PT_t5.py +++ b/Cassiopee/Post/test/computeGrad2PT_t5.py @@ -4,11 +4,11 @@ import Generator.PyTree as G import KCore.test as test -# Cas 3D NGon avec volume calcule +# Cas 3D NGon avec volume calcule # =============================== -ni = 30 -nj = 30 -nk = 10 +ni = 30 +nj = 30 +nk = 10 lx = 1. ly = 1. lz = 0.25 @@ -26,4 +26,3 @@ P._computeGrad2(t, 'centers:F') test.testT(t,1) - diff --git a/Cassiopee/Post/test/computeGrad2_t1.py b/Cassiopee/Post/test/computeGrad2_t1.py index 576a5a47a..1c97368f1 100755 --- a/Cassiopee/Post/test/computeGrad2_t1.py +++ b/Cassiopee/Post/test/computeGrad2_t1.py @@ -48,7 +48,7 @@ mc = C.initVars(mc,'{Density}=2*{x}+{x}*{y}') mc = C.extractVars(mc,['Density']) mc = P.computeGrad2(m,mc) -test.testA([mc],3) +test.testA([mc],3) ni = 10; nj = 30; nk = 1 m = G.cartNGon((0,0,0), (10./(ni-1),1,1), (ni,nj,nk)) diff --git a/Cassiopee/Post/test/computeGradPT_t3.py b/Cassiopee/Post/test/computeGradPT_t3.py index e607b08f8..927f44dc1 100644 --- a/Cassiopee/Post/test/computeGradPT_t3.py +++ b/Cassiopee/Post/test/computeGradPT_t3.py @@ -27,4 +27,3 @@ def celln(y): t = C.newPyTree(['Base',2]); t[2][1][2] += [a,b] t = P.computeGrad(t, 'Density') test.testT(t,1) - diff --git a/Cassiopee/Post/test/computeGrad_t2.py b/Cassiopee/Post/test/computeGrad_t2.py index 6ffdc892d..28cc2b541 100644 --- a/Cassiopee/Post/test/computeGrad_t2.py +++ b/Cassiopee/Post/test/computeGrad_t2.py @@ -9,14 +9,14 @@ ni = 30; nj = 40; nk = 3 m = G.cartHexa((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) m = C.initVars(m, '{ro}=2*{x}+{x}*{y}') -p = P.computeGrad(m, 'ro') +p = P.computeGrad(m, 'ro') T.testA([p], 1) # cas 3D tetra ni = 30; nj = 40; nk = 3 m = G.cartTetra((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) m = C.initVars(m, '{ro}=2*{x}+{x}*{y}') -p = P.computeGrad(m, 'ro') +p = P.computeGrad(m, 'ro') T.testA([p], 2) # # cas 3D penta @@ -37,12 +37,12 @@ ni = 30; nj = 40; nk = 1 m = G.cartTetra((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) m = C.initVars(m, '{ro}=2*{x}+{x}*{y}') -p = P.computeGrad(m, 'ro') +p = P.computeGrad(m, 'ro') T.testA([p], 5) # cas 3D NGON ni = 30; nj = 40; nk = 3 m = G.cartNGon((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) m = C.initVars(m, '{ro}=2*{x}+{x}*{y}') -p = P.computeGrad(m, 'ro') +p = P.computeGrad(m, 'ro') T.testA([p], 6) diff --git a/Cassiopee/Post/test/computeIndicatorField.py b/Cassiopee/Post/test/computeIndicatorField.py index 3664ca294..2c1bdc815 100644 --- a/Cassiopee/Post/test/computeIndicatorField.py +++ b/Cassiopee/Post/test/computeIndicatorField.py @@ -1,4 +1,4 @@ -# - compIndicatorField (array) - +# - compIndicatorField (array) - import Generator as G import Converter as C import Geom as D diff --git a/Cassiopee/Post/test/computeIndicatorFieldPT.py b/Cassiopee/Post/test/computeIndicatorFieldPT.py index 2701c22c9..4dc7ee277 100644 --- a/Cassiopee/Post/test/computeIndicatorFieldPT.py +++ b/Cassiopee/Post/test/computeIndicatorFieldPT.py @@ -1,4 +1,4 @@ -# - compIndicatorField (pyTree) - +# - compIndicatorField (pyTree) - import Generator.PyTree as G import Converter.PyTree as C import Geom.PyTree as D @@ -11,6 +11,6 @@ o = G.octree([s], [snear], dfar=10., balancing=1) npts = o[1][0][0] o = G.getVolumeMap(o) -o, valInf, valSup = P.computeIndicatorField(o, 'centers:vol', +o, valInf, valSup = P.computeIndicatorField(o, 'centers:vol', nbTargetPts=2*npts, bodies=[s]) C.convertPyTree2File(o, 'out.cgns') diff --git a/Cassiopee/Post/test/computeIndicatorFieldPT_t1.py b/Cassiopee/Post/test/computeIndicatorFieldPT_t1.py index 1cbcd7d35..21695c159 100644 --- a/Cassiopee/Post/test/computeIndicatorFieldPT_t1.py +++ b/Cassiopee/Post/test/computeIndicatorFieldPT_t1.py @@ -1,4 +1,4 @@ -# - compIndicatorField (pyTree) - +# - compIndicatorField (pyTree) - import Generator.PyTree as G import Converter.PyTree as C import Geom.PyTree as D diff --git a/Cassiopee/Post/test/computeIndicatorField_t1.py b/Cassiopee/Post/test/computeIndicatorField_t1.py index 02e10fc4a..648b564c6 100644 --- a/Cassiopee/Post/test/computeIndicatorField_t1.py +++ b/Cassiopee/Post/test/computeIndicatorField_t1.py @@ -1,4 +1,4 @@ -# - compIndicatorField (array) - +# - compIndicatorField (array) - import Generator as G import Converter as C import Geom as D diff --git a/Cassiopee/Post/test/computeIndicatorValue.py b/Cassiopee/Post/test/computeIndicatorValue.py index 59fad593f..75d08c534 100644 --- a/Cassiopee/Post/test/computeIndicatorValue.py +++ b/Cassiopee/Post/test/computeIndicatorValue.py @@ -1,4 +1,4 @@ -# - compIndicatorValue(array) - +# - compIndicatorValue(array) - import Generator as G import Converter as C import Geom as D diff --git a/Cassiopee/Post/test/computeIndicatorValuePT.py b/Cassiopee/Post/test/computeIndicatorValuePT.py index 5f28cb539..f9148b822 100644 --- a/Cassiopee/Post/test/computeIndicatorValuePT.py +++ b/Cassiopee/Post/test/computeIndicatorValuePT.py @@ -1,4 +1,4 @@ -# - compIndicatorValue(pyTree) - +# - compIndicatorValue(pyTree) - import Generator.PyTree as G import Converter.PyTree as C import Geom.PyTree as D diff --git a/Cassiopee/Post/test/computeIndicatorValuePT_t1.py b/Cassiopee/Post/test/computeIndicatorValuePT_t1.py index 00f3a8e92..1168e824a 100644 --- a/Cassiopee/Post/test/computeIndicatorValuePT_t1.py +++ b/Cassiopee/Post/test/computeIndicatorValuePT_t1.py @@ -1,4 +1,4 @@ -# - compIndicatorValue(pyTree) - +# - compIndicatorValue(pyTree) - import Generator.PyTree as G import Converter.PyTree as C import Geom.PyTree as D diff --git a/Cassiopee/Post/test/computeIndicatorValue_t1.py b/Cassiopee/Post/test/computeIndicatorValue_t1.py index d6dc63cc0..78637b71b 100644 --- a/Cassiopee/Post/test/computeIndicatorValue_t1.py +++ b/Cassiopee/Post/test/computeIndicatorValue_t1.py @@ -1,4 +1,4 @@ -# - compIndicatorValue(array) - +# - compIndicatorValue(array) - import Generator as G import Converter as C import Geom as D diff --git a/Cassiopee/Post/test/computeNormCurlPT.py b/Cassiopee/Post/test/computeNormCurlPT.py index 6b03fd307..972e03383 100755 --- a/Cassiopee/Post/test/computeNormCurlPT.py +++ b/Cassiopee/Post/test/computeNormCurlPT.py @@ -8,7 +8,7 @@ def F(x,y,z): return 12*y*y + 4 ni = 30; nj = 40; nk = 3 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,nk)) m = C.initVars(m,'F1',F,['CoordinateX','CoordinateY','CoordinateZ']) -m = C.addVars(m,'F2'); m = C.addVars(m,'F3') +m = C.addVars(m,'F2'); m = C.addVars(m,'F3') varname = ['F1','F2','F3'] m = P.computeNormCurl(m, varname) diff --git a/Cassiopee/Post/test/computeNormCurlPT_t1.py b/Cassiopee/Post/test/computeNormCurlPT_t1.py index 2387fcc03..4856704f3 100755 --- a/Cassiopee/Post/test/computeNormCurlPT_t1.py +++ b/Cassiopee/Post/test/computeNormCurlPT_t1.py @@ -12,11 +12,11 @@ def F(x,y,z): return 12*y*y + 4 ni = 30; nj = 40 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,1)) m = C.initVars(m,'F1',F,['CoordinateX','CoordinateY','CoordinateZ']) -m = C.addVars(m,'F2'); m = C.addVars(m,'F3') +m = C.addVars(m,'F2'); m = C.addVars(m,'F3') varname = ['F1','F2','F3'] m = P.computeCurl(m, varname) m = C.initVars(m,'centers:F4',F,['centers:rotx','centers:roty','centers:rotz']) -m = C.addVars(m,'centers:F5'); m = C.addVars(m,'centers:F6') +m = C.addVars(m,'centers:F5'); m = C.addVars(m,'centers:F6') varname = ['centers:F4','centers:F5','centers:F6'] m = P.computeNormCurl(m, varname) test.testT(m,2) @@ -27,11 +27,11 @@ def F(x,y,z): return 12*y*y + 4 ni = 30; nj = 40 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,2)) m = C.initVars(m,'F1',F,['CoordinateX','CoordinateY','CoordinateZ']) -m = C.addVars(m,'F2'); m = C.addVars(m,'F3') +m = C.addVars(m,'F2'); m = C.addVars(m,'F3') varname = ['F1','F2','F3'] m = P.computeCurl(m, varname) m = C.initVars(m,'centers:F4',F,['centers:rotx','centers:roty','centers:rotz']) -m = C.addVars(m,'centers:F5'); m = C.addVars(m,'centers:F6') +m = C.addVars(m,'centers:F5'); m = C.addVars(m,'centers:F6') varname = ['centers:F4','centers:F5','centers:F6'] m = P.computeNormCurl(m, varname) test.testT(m,3) diff --git a/Cassiopee/Post/test/computeNormCurlPT_t2.py b/Cassiopee/Post/test/computeNormCurlPT_t2.py index b2fd42937..be6e58f67 100644 --- a/Cassiopee/Post/test/computeNormCurlPT_t2.py +++ b/Cassiopee/Post/test/computeNormCurlPT_t2.py @@ -12,11 +12,11 @@ def F(x,y,z): return 12*y*y + 4 ni = 30; nj = 40 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,1)) m = C.initVars(m,'F1',F,['CoordinateX','CoordinateY','CoordinateZ']) -m = C.addVars(m,'F2'); m = C.addVars(m,'F3') +m = C.addVars(m,'F2'); m = C.addVars(m,'F3') varname = ['F1','F2','F3'] m = P.computeCurl(m, varname) m = C.initVars(m,'centers:F4',F,['centers:rotx','centers:roty','centers:rotz']) -m = C.addVars(m,'centers:F5'); m = C.addVars(m,'centers:F6') +m = C.addVars(m,'centers:F5'); m = C.addVars(m,'centers:F6') m = C.addBC2Zone(m,'ov','BCOverlap','imin') t = C.newPyTree(['Base',2]); t[2][1][2].append(m) t[2][1] = C.addState(t[2][1], 'Mach', 0.6) @@ -30,15 +30,15 @@ def F(x,y,z): return 12*y*y + 4 ni = 30; nj = 40 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,2)) m = C.initVars(m,'F1',F,['CoordinateX','CoordinateY','CoordinateZ']) -m = C.addVars(m,'F2'); m = C.addVars(m,'F3') +m = C.addVars(m,'F2'); m = C.addVars(m,'F3') varname = ['F1','F2','F3'] m = P.computeCurl(m, varname) m = C.initVars(m,'centers:F4',F,['centers:rotx','centers:roty','centers:rotz']) -m = C.addVars(m,'centers:F5'); m = C.addVars(m,'centers:F6') +m = C.addVars(m,'centers:F5'); m = C.addVars(m,'centers:F6') m = C.addBC2Zone(m,'ov','BCOverlap','imin') t = C.newPyTree(['Base',3]); t[2][1][2].append(m) t[2][1] = C.addState(t[2][1], 'Mach', 0.6) -t = C.fillEmptyBCWith(t,'wall','BCWall', dim = 2) +t = C.fillEmptyBCWith(t,'wall','BCWall', dim=2) varname = ['centers:F4','centers:F5','centers:F6'] t = P.computeNormCurl(t, varname) test.testT(t,3) diff --git a/Cassiopee/Post/test/computeNormCurl_t1.py b/Cassiopee/Post/test/computeNormCurl_t1.py index 6db61564d..b22444d6d 100755 --- a/Cassiopee/Post/test/computeNormCurl_t1.py +++ b/Cassiopee/Post/test/computeNormCurl_t1.py @@ -32,4 +32,3 @@ def DF(y): # test sur une liste P = P.computeNormCurl([m1,m2],['u','v','w']) # defined on centers T.testA(P, 3) - diff --git a/Cassiopee/Post/test/computeVariables2PT_t1.py b/Cassiopee/Post/test/computeVariables2PT_t1.py index b5d5d5d91..bc918c687 100644 --- a/Cassiopee/Post/test/computeVariables2PT_t1.py +++ b/Cassiopee/Post/test/computeVariables2PT_t1.py @@ -7,9 +7,9 @@ ni = 30; nj = 40 z1 = GP.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,2)) -# Variables a calculer +# Variables a calculer # -------------------- -vars = ['centers:Pressure','VelocityX','VelocityZ','VelocityMagnitude', +vars = ['centers:Pressure','VelocityX','VelocityZ','VelocityMagnitude', 'Temperature','Entropy','centers:Enthalpy','Mach','ViscosityMolecular', 'PressureStagnation','centers:TemperatureStagnation'] @@ -68,5 +68,3 @@ t2 = CP.addState(t2, 'Cv', 10.9/0.4) PT._computeVariables2(t2, vars) test.testT(t2,4) - - diff --git a/Cassiopee/Post/test/computeVariables2PT_t2.py b/Cassiopee/Post/test/computeVariables2PT_t2.py index f1b40654e..6898ce904 100644 --- a/Cassiopee/Post/test/computeVariables2PT_t2.py +++ b/Cassiopee/Post/test/computeVariables2PT_t2.py @@ -7,9 +7,9 @@ ni = 30; nj = 40 z1 = GP.cartHexa((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,2)) -# Variables a calculer +# Variables a calculer # -------------------- -vars = ['centers:Pressure','VelocityX','VelocityZ','VelocityMagnitude', +vars = ['centers:Pressure','VelocityX','VelocityZ','VelocityMagnitude', 'Temperature','Entropy','centers:Enthalpy','Mach','ViscosityMolecular', 'PressureStagnation','centers:TemperatureStagnation'] @@ -70,5 +70,3 @@ t2 = CP.addState(t2, 'Cv', 10.9/0.4) PT._computeVariables2(t2, vars) test.testT(t2,4) - - diff --git a/Cassiopee/Post/test/computeVariables2PT_t3.py b/Cassiopee/Post/test/computeVariables2PT_t3.py index ee09f210c..b8954a6ae 100644 --- a/Cassiopee/Post/test/computeVariables2PT_t3.py +++ b/Cassiopee/Post/test/computeVariables2PT_t3.py @@ -7,9 +7,9 @@ ni = 30; nj = 40 z1 = GP.cartNGon((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,2)) -# Variables a calculer +# Variables a calculer # -------------------- -vars = ['centers:Pressure','VelocityX','VelocityZ','VelocityMagnitude', +vars = ['centers:Pressure','VelocityX','VelocityZ','VelocityMagnitude', 'Temperature','Entropy','centers:Enthalpy','Mach','ViscosityMolecular', 'PressureStagnation','centers:TemperatureStagnation'] @@ -68,5 +68,3 @@ t2 = CP.addState(t2, 'Cv', 10.9/0.4) PT._computeVariables2(t2, vars) test.testT(t2,4) - - diff --git a/Cassiopee/Post/test/computeVariables2_t1.py b/Cassiopee/Post/test/computeVariables2_t1.py index b63b34720..7732ead4f 100644 --- a/Cassiopee/Post/test/computeVariables2_t1.py +++ b/Cassiopee/Post/test/computeVariables2_t1.py @@ -4,9 +4,9 @@ import Generator as G import KCore.test as test -# Variables a calculer +# Variables a calculer # -------------------- -vars = ['Pressure','VelocityX','VelocityZ','VelocityMagnitude', +vars = ['Pressure','VelocityX','VelocityZ','VelocityMagnitude', 'Temperature','Entropy','Enthalpy','Mach','ViscosityMolecular', 'PressureStagnation','TemperatureStagnation'] diff --git a/Cassiopee/Post/test/computeVariablesBCPT.py b/Cassiopee/Post/test/computeVariablesBCPT.py index 3e47affd2..a58c584a5 100644 --- a/Cassiopee/Post/test/computeVariablesBCPT.py +++ b/Cassiopee/Post/test/computeVariablesBCPT.py @@ -8,7 +8,7 @@ a = C.addBC2Zone(a, 'wall', 'BCWall', 'imin') b = Internal.getNodeFromName2(a, 'wall') d = Internal.newBCDataSet(name='BCDataSet', value='UserDefined', - gridLocation='FaceCenter', parent=b) + gridLocation='FaceCenter', parent=b) d = Internal.newBCData('BCNeumann', parent=d) Internal.newDataArray('Density', value=10*[1.], parent=d) Internal.newDataArray('MomentumX', value=10*[1.], parent=d) diff --git a/Cassiopee/Post/test/computeVariablesPT_t1.py b/Cassiopee/Post/test/computeVariablesPT_t1.py index 8d60dbbe5..79fa0afc4 100644 --- a/Cassiopee/Post/test/computeVariablesPT_t1.py +++ b/Cassiopee/Post/test/computeVariablesPT_t1.py @@ -4,7 +4,7 @@ import Generator.PyTree as G import KCore.test as test -def initDensity(x,y,z): return 1. +def initDensity(x,y,z): return 1. def initMomentum(x,y,z): return 0.1+3*x + 5*y +2*z def initEnergy(x,y,z): return 1e5+1.5*x*x + y*y + 3.*z*z diff --git a/Cassiopee/Post/test/computeVariablesPT_t2.py b/Cassiopee/Post/test/computeVariablesPT_t2.py index e646cf012..716db867e 100644 --- a/Cassiopee/Post/test/computeVariablesPT_t2.py +++ b/Cassiopee/Post/test/computeVariablesPT_t2.py @@ -5,7 +5,7 @@ import Generator.PyTree as G import KCore.test as test -def initDensity(x,y,z): return 1. +def initDensity(x,y,z): return 1. def initMomentum(x,y,z): return 0.1+3*x + 5*y +2*z def initEnergy(x,y,z): return 1e5+1.5*x*x + y*y + 3.*z*z #----- diff --git a/Cassiopee/Post/test/computeVariables_t1.py b/Cassiopee/Post/test/computeVariables_t1.py index c2161ecd5..f4ab64fdf 100644 --- a/Cassiopee/Post/test/computeVariables_t1.py +++ b/Cassiopee/Post/test/computeVariables_t1.py @@ -17,13 +17,13 @@ A = [m] vars = ['Pressure', 'Mach', 'Entropy', 'Enthalpy', 'VelocityX', 'VelocityY', 'VelocityZ', - 'Temperature', 'ViscosityMolecular', + 'Temperature', 'ViscosityMolecular', 'PressureStagnation', 'TemperatureStagnation', 'PressureDynamic'] sol = P.computeVariables(m, vars) test.testA([sol], 1) -# test sur une liste +# test sur une liste ni = 20; nj = 10 m = G.cart((0,0,0), (5./(ni-1),10./(nj-1),1), (ni,nj,2)) c = C.array('ro,rou, rov,row,roE', ni, nj, 2) @@ -37,7 +37,7 @@ vars = ['Pressure', 'Mach'] sol = P.computeVariables(A, vars) test.testA(sol, 2) -# +# vars = ['PressureStagnation','TemperatureStagnation','PressureDynamic'] sol = P.computeVariables(A, vars) test.testA(sol, 3) @@ -55,7 +55,7 @@ A = [m] vars = ['Pressure', 'Mach', 'Entropy', 'Enthalpy', 'VelocityX', 'VelocityY', 'VelocityZ', - 'Temperature', 'ViscosityMolecular', + 'Temperature', 'ViscosityMolecular', 'PressureStagnation', 'TemperatureStagnation', 'PressureDynamic'] sol = P.computeVariables(m, vars) diff --git a/Cassiopee/Post/test/computeWallShearStressPT.py b/Cassiopee/Post/test/computeWallShearStressPT.py index adee9ec9c..2f9afbdc2 100644 --- a/Cassiopee/Post/test/computeWallShearStressPT.py +++ b/Cassiopee/Post/test/computeWallShearStressPT.py @@ -11,7 +11,7 @@ C._initVars(t,'{VelocityX}=0.2*{CoordinateX}**2') C._initVars(t,'{VelocityY}=0.3*{CoordinateY}*{CoordinateX}') C._initVars(t,'VelocityZ', 0.) -for var in ['VelocityX','VelocityY','VelocityZ']: +for var in ['VelocityX','VelocityY','VelocityZ']: t = P.computeGrad(t,var) t = C.node2Center(t,var) C._initVars(t,'centers:Density', 1.) diff --git a/Cassiopee/Post/test/computeWallShearStressPT_t1.py b/Cassiopee/Post/test/computeWallShearStressPT_t1.py index 311270128..36cf55d00 100644 --- a/Cassiopee/Post/test/computeWallShearStressPT_t1.py +++ b/Cassiopee/Post/test/computeWallShearStressPT_t1.py @@ -11,7 +11,7 @@ C._initVars(t,'{VelocityX}=0.2*{CoordinateX}**2') C._initVars(t,'{VelocityY}=0.3*{CoordinateY}*{CoordinateX}') C._initVars(t,'VelocityZ', 0.) -for var in ['VelocityX','VelocityY','VelocityZ']: +for var in ['VelocityX','VelocityY','VelocityZ']: t = P.computeGrad(t,var) t = C.node2Center(t,var) C._initVars(t,'centers:Density', 1.) @@ -26,7 +26,7 @@ C._initVars(t,'{VelocityX}=0.2*{CoordinateX}**2') C._initVars(t,'{VelocityY}=0.3*{CoordinateY}*{CoordinateX}') C._initVars(t,'VelocityZ', 0.) -for var in ['VelocityX','VelocityY','VelocityZ']: +for var in ['VelocityX','VelocityY','VelocityZ']: t = P.computeGrad(t,var) t = C.center2Node(t,['centers:gradx'+var,'centers:grady'+var,'centers:gradz'+var]) C._initVars(t,'Density', 1.) diff --git a/Cassiopee/Post/test/enforceIndicatorForCoarsestLevel_t1.py b/Cassiopee/Post/test/enforceIndicatorForCoarsestLevel_t1.py index 864d88445..8208720c9 100644 --- a/Cassiopee/Post/test/enforceIndicatorForCoarsestLevel_t1.py +++ b/Cassiopee/Post/test/enforceIndicatorForCoarsestLevel_t1.py @@ -1,4 +1,4 @@ -# - enforceIndicatorForCoarsestLevel (array) - +# - enforceIndicatorForCoarsestLevel (array) - import Generator as G import Converter as C import Geom as D diff --git a/Cassiopee/Post/test/enforceIndicatorForFinestLevel_t1.py b/Cassiopee/Post/test/enforceIndicatorForFinestLevel_t1.py index 94a846a8f..acac9a6c4 100644 --- a/Cassiopee/Post/test/enforceIndicatorForFinestLevel_t1.py +++ b/Cassiopee/Post/test/enforceIndicatorForFinestLevel_t1.py @@ -1,4 +1,4 @@ -# - enforceIndicatorForFinestLevel (array) - +# - enforceIndicatorForFinestLevel (array) - import Generator as G import Converter as C import Geom as D @@ -10,4 +10,3 @@ indic = C.initVars(indic,'indicator',1.) indic = P.enforceIndicatorForFinestLevel(indic,o) test.testA([indic],1) - diff --git a/Cassiopee/Post/test/exteriorEltsPT_t1.py b/Cassiopee/Post/test/exteriorEltsPT_t1.py index e3923a1ff..c8f1dea02 100644 --- a/Cassiopee/Post/test/exteriorEltsPT_t1.py +++ b/Cassiopee/Post/test/exteriorEltsPT_t1.py @@ -8,4 +8,3 @@ C._addVars(a,'Density'); C._addVars(a,'centers:cellN') b = P.exteriorFaces(a) test.testT(b, 1) - diff --git a/Cassiopee/Post/test/exteriorFacesPT_t1.py b/Cassiopee/Post/test/exteriorFacesPT_t1.py index 17bfd16ac..dc8836541 100644 --- a/Cassiopee/Post/test/exteriorFacesPT_t1.py +++ b/Cassiopee/Post/test/exteriorFacesPT_t1.py @@ -24,7 +24,7 @@ b = P.exteriorFaces(a) test.testT(b,3) -# cas avec indices +# cas avec indices indices = [] a = G.cartTetra((0,0,0), (1,1.,1), (20,2,1)) C._addVars(a,'Density'); C._addVars(a,'centers:cellN') diff --git a/Cassiopee/Post/test/exteriorFacesPT_t3.py b/Cassiopee/Post/test/exteriorFacesPT_t3.py index 82fd5c8b3..4ef152c8d 100644 --- a/Cassiopee/Post/test/exteriorFacesPT_t3.py +++ b/Cassiopee/Post/test/exteriorFacesPT_t3.py @@ -3,7 +3,7 @@ import Post.PyTree as P import Generator.PyTree as G -# 1D +# 1D a = G.cart((0,0,0), (1,1,1), (10,1,1)) b = P.exteriorFaces(a) test.testT(b,1) diff --git a/Cassiopee/Post/test/exteriorFacesStructuredPT_t1.py b/Cassiopee/Post/test/exteriorFacesStructuredPT_t1.py index 61ef1371d..ca9d9b765 100644 --- a/Cassiopee/Post/test/exteriorFacesStructuredPT_t1.py +++ b/Cassiopee/Post/test/exteriorFacesStructuredPT_t1.py @@ -4,19 +4,19 @@ import Generator.PyTree as G import KCore.test as test -# 1D +# 1D a = G.cart((0,0,0), (1,1,1), (10,1,1)) A = P.exteriorFacesStructured(a) t = C.newPyTree(['Base',0]); t[2][1][2] += A test.testT(t,1) -# 2D +# 2D a = G.cart((0,0,0), (1,1,1), (1,6,10)) A = P.exteriorFacesStructured(a) t = C.newPyTree(['Base',1]); t[2][1][2] += A test.testT(t,2) -# 3D +# 3D a = G.cart((0,0,0), (1,1,1), (4,4,6)) A = P.exteriorFacesStructured(a) t = C.newPyTree(['Base',2]); t[2][1][2] += A diff --git a/Cassiopee/Post/test/exteriorFacesStructuredPT_t2.py b/Cassiopee/Post/test/exteriorFacesStructuredPT_t2.py index 64825b95c..819c6856e 100644 --- a/Cassiopee/Post/test/exteriorFacesStructuredPT_t2.py +++ b/Cassiopee/Post/test/exteriorFacesStructuredPT_t2.py @@ -4,7 +4,7 @@ import Generator.PyTree as G import KCore.test as test -# 1D +# 1D a = G.cart((0,0,0), (1,1,1), (10,1,1)) C._addVars(a,'Density'); C._addVars(a,'centers:cellN') t = C.newPyTree(['Base',1,a]) @@ -12,7 +12,7 @@ zones = P.exteriorFacesStructured(t) test.testT(zones,1) -# 2D +# 2D a = G.cart((0,0,0), (1,1,1), (1,6,10)) C._addVars(a,'Density'); C._addVars(a,'centers:cellN') t = C.newPyTree(['Base',2,a]) diff --git a/Cassiopee/Post/test/extractMesh3.py b/Cassiopee/Post/test/extractMesh3.py index a2ed35ca6..0dc870bf3 100644 --- a/Cassiopee/Post/test/extractMesh3.py +++ b/Cassiopee/Post/test/extractMesh3.py @@ -9,7 +9,7 @@ def F(x,y,z): deg = 1 if deg == 0 : return 10. - elif deg == 1 : + elif deg == 1 : return x + 2.*y + 3.*z elif deg == 2 : return x*x + 2.*y*y + 3*z diff --git a/Cassiopee/Post/test/extractMeshPT.py b/Cassiopee/Post/test/extractMeshPT.py index 3aa67bdc0..0e157cc1a 100644 --- a/Cassiopee/Post/test/extractMeshPT.py +++ b/Cassiopee/Post/test/extractMeshPT.py @@ -1,4 +1,4 @@ -# - extractMesh (pyTree) - +# - extractMesh (pyTree) - import Converter.PyTree as C import Post.PyTree as P import Generator.PyTree as G diff --git a/Cassiopee/Post/test/extractMeshPT_m1.py b/Cassiopee/Post/test/extractMeshPT_m1.py index bfe83b50e..797041f28 100644 --- a/Cassiopee/Post/test/extractMeshPT_m1.py +++ b/Cassiopee/Post/test/extractMeshPT_m1.py @@ -1,4 +1,4 @@ -# - extractMesh (pyTree) - +# - extractMesh (pyTree) - import Converter.PyTree as C import Converter.Mpi as Cmpi import Post.Mpi as Pmpi diff --git a/Cassiopee/Post/test/extractMeshPT_t2.py b/Cassiopee/Post/test/extractMeshPT_t2.py index 0bf309c1a..11cd2bc9e 100644 --- a/Cassiopee/Post/test/extractMeshPT_t2.py +++ b/Cassiopee/Post/test/extractMeshPT_t2.py @@ -16,11 +16,11 @@ t = C.newPyTree(['Base']); C._addState(t[2][1], 'Mach', 0.6) t[2][1][2].append(m) a = G.cart((0.,0.,0.), (0.01, 0.01, 0.1), (40, 40, 1)) -P._extractMesh(t, a) +P._extractMesh(t, a) test.testT(a,1) a = G.cart((0.,0.,0.), (0.01, 0.01, 0.1), (40, 40, 2)) C._addBC2Zone(a,'wall','BCWall','kmin') C._fillEmptyBCWith(a,'ov','BCOverlap') -P._extractMesh(t, a) +P._extractMesh(t, a) test.testT(a,2) diff --git a/Cassiopee/Post/test/extractMesh_t3.py b/Cassiopee/Post/test/extractMesh_t3.py index c4ca1d5c4..6569aee21 100644 --- a/Cassiopee/Post/test/extractMesh_t3.py +++ b/Cassiopee/Post/test/extractMesh_t3.py @@ -40,4 +40,3 @@ def F(x,y,z): print('Computing order %d...'%i) a2 = P.extractMesh([m], a, i) test.testA([a2], i) - diff --git a/Cassiopee/Post/test/extractMesh_t4.py b/Cassiopee/Post/test/extractMesh_t4.py index 926b253dc..255c1dd86 100644 --- a/Cassiopee/Post/test/extractMesh_t4.py +++ b/Cassiopee/Post/test/extractMesh_t4.py @@ -31,4 +31,3 @@ print('Computing order %d...'%i) a2 = P.extractMesh([m], a, i) test.testA([a2], i) - diff --git a/Cassiopee/Post/test/extractPlane_t1.py b/Cassiopee/Post/test/extractPlane_t1.py index a95acd9c9..ea4322be7 100644 --- a/Cassiopee/Post/test/extractPlane_t1.py +++ b/Cassiopee/Post/test/extractPlane_t1.py @@ -24,4 +24,3 @@ m2 = C.convertArray2Hexa(m) p = P.extractPlane([m2],(0.,0.,1.,-0.5)) test.testA([p],3) - diff --git a/Cassiopee/Post/test/extractPlane_t2.py b/Cassiopee/Post/test/extractPlane_t2.py index 6c32679bc..192990ab4 100644 --- a/Cassiopee/Post/test/extractPlane_t2.py +++ b/Cassiopee/Post/test/extractPlane_t2.py @@ -18,4 +18,3 @@ m = C.convertArray2Tetra(m) a = P.extractPlane([m], (0.5, 1., 0., 1)) test.testA([a], 1) - diff --git a/Cassiopee/Post/test/extractPoint_t1.py b/Cassiopee/Post/test/extractPoint_t1.py index c8e888d41..2b3f82bd9 100644 --- a/Cassiopee/Post/test/extractPoint_t1.py +++ b/Cassiopee/Post/test/extractPoint_t1.py @@ -60,7 +60,7 @@ def F(x,y,z): ni = 11; nj = 11; nk = 11; a = G.cart((0,0,0), (1./(ni-1),1./(nj-1),1./(nk-1)), (ni,nj,nk)) -val0 = F(0.55,0.38,0.12) +val0 = F(0.55,0.38,0.12) # init by function C._addVars(a, 'F') diff --git a/Cassiopee/Post/test/extractPoint_t3.py b/Cassiopee/Post/test/extractPoint_t3.py index cc347c4b0..7de00bb38 100644 --- a/Cassiopee/Post/test/extractPoint_t3.py +++ b/Cassiopee/Post/test/extractPoint_t3.py @@ -12,7 +12,7 @@ def F(x,y,z): return 2*x*x*x*x*x + 2.*y*y*z + z*z (x,y,z) = (0.55,0.38,0.12) -val0 = F(x,y,z) +val0 = F(x,y,z) # init by function a = C.initVars(a, 'F', F, ['x','y','z']) @@ -22,5 +22,4 @@ def F(x,y,z): err = 0.010897126 if abs(val[0]-val0) > err: print('DIFF: reference: '+str(err)+'.') - print('DIFF: courant: '+str(val[0]-val0)+'.') - + print('DIFF: courant: '+str(val[0]-val0)+'.') diff --git a/Cassiopee/Post/test/extractRadiusPT.py b/Cassiopee/Post/test/extractRadiusPT.py index 3fa8f43b0..ff85fac9b 100644 --- a/Cassiopee/Post/test/extractRadiusPT.py +++ b/Cassiopee/Post/test/extractRadiusPT.py @@ -5,7 +5,7 @@ import Post.Rotor as Rotor import math -a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,50,30)) +a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,50,30)) coordZ = Internal.getNodeFromName(a, 'CoordinateZ')[1] coordX = Internal.getNodeFromName(a, 'CoordinateX')[1] Internal.getNodeFromName(a, 'CoordinateZ')[1] = coordX diff --git a/Cassiopee/Post/test/extractSlicesPT.py b/Cassiopee/Post/test/extractSlicesPT.py index dbe144680..9e55f601f 100644 --- a/Cassiopee/Post/test/extractSlicesPT.py +++ b/Cassiopee/Post/test/extractSlicesPT.py @@ -21,4 +21,4 @@ # export for CnM2 maps exp = PR.exportAccumulatorMap(accu, vars=['CnM2x','CnM2y','CnM2z']) -C.convertPyTree2File(exp, 'map.cgns') +C.convertPyTree2File(exp, 'map.cgns') diff --git a/Cassiopee/Post/test/extractSlicesPT_t1.py b/Cassiopee/Post/test/extractSlicesPT_t1.py index d74d77242..9d63ab136 100644 --- a/Cassiopee/Post/test/extractSlicesPT_t1.py +++ b/Cassiopee/Post/test/extractSlicesPT_t1.py @@ -11,11 +11,11 @@ SIGMA = 4*CHORD / (math.pi*AR) teff = C.convertFile2PyTree('stress_419.cgns') -accu1 = {}; accu2 = {} +accu1 = {}; accu2 = {} psi = 419.; radii = [1.2,1.3,2.] slices, CnM2, CmM2 = PR.extractSlices(teff, 'Blade7A_00', psi, radii, RoInf, PInf, AINF, Mtip, AR, CHORD, MU, - accumulatorCnM2=accu1, accumulatorCmM2=accu2, + accumulatorCnM2=accu1, accumulatorCmM2=accu2, localFrame=True, relativeShaft=-12.12) test.testT(slices, 1) diff --git a/Cassiopee/Post/test/extractThetaPT.py b/Cassiopee/Post/test/extractThetaPT.py index 3be723ba9..8c5c8e7be 100644 --- a/Cassiopee/Post/test/extractThetaPT.py +++ b/Cassiopee/Post/test/extractThetaPT.py @@ -5,7 +5,7 @@ import Post.Rotor as Rotor import math -a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,50,30)) +a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,50,30)) coordZ = Internal.getNodeFromName(a, 'CoordinateZ')[1] coordX = Internal.getNodeFromName(a, 'CoordinateX')[1] Internal.getNodeFromName(a, 'CoordinateZ')[1] = coordX diff --git a/Cassiopee/Post/test/integ.py b/Cassiopee/Post/test/integ.py index 8ca26fb5f..6127c8696 100644 --- a/Cassiopee/Post/test/integ.py +++ b/Cassiopee/Post/test/integ.py @@ -14,4 +14,3 @@ # Field in nodes cn = C.array('vx', ni, nj, 1); cn = C.initVars(cn, 'vx', 1.) resn = P.integ([m], [cn], [])[0]; print(resn) - diff --git a/Cassiopee/Post/test/integ2.py b/Cassiopee/Post/test/integ2.py index eba79295c..29bc3b903 100644 --- a/Cassiopee/Post/test/integ2.py +++ b/Cassiopee/Post/test/integ2.py @@ -21,4 +21,3 @@ cn = C.initVars(c1, 'vx,vy,vz', 1.); del c1 resn = P.integNorm([m], [cn], []) print(resn) - diff --git a/Cassiopee/Post/test/integ2D.py b/Cassiopee/Post/test/integ2D.py index 8aaa4a41e..f92338379 100644 --- a/Cassiopee/Post/test/integ2D.py +++ b/Cassiopee/Post/test/integ2D.py @@ -53,5 +53,5 @@ print('integ norm:', resn1) #res3 = P.integNormProduct([m1],[c1],[]) -#print(res3) +#print(res3) #print(res1, res2, res3) diff --git a/Cassiopee/Post/test/integ3.py b/Cassiopee/Post/test/integ3.py index 852e07bb0..4884a63d4 100644 --- a/Cassiopee/Post/test/integ3.py +++ b/Cassiopee/Post/test/integ3.py @@ -17,4 +17,3 @@ res = P.integNorm([nodes],[densa],[]) print(res) - diff --git a/Cassiopee/Post/test/integ4.py b/Cassiopee/Post/test/integ4.py index 0033a32a7..04ce3ef47 100644 --- a/Cassiopee/Post/test/integ4.py +++ b/Cassiopee/Post/test/integ4.py @@ -31,9 +31,9 @@ nj = arrays[i][3] nk = arrays[i][4] print(ni, nj, nk) -# dens = ones( (1, ni * nj * nk), float64 ) +# dens = ones( (1, ni * nj * nk), float64 ) # densa = ['t', dens, ni, nj, nk] - dens = ones( (1, (ni-1) * (nj-1) * (nk-1)), float64 ) + dens = ones( (1, (ni-1) * (nj-1) * (nk-1)), float64 ) densa = ['t', dens, (ni-1), (nj-1), (nk-1)] data.append(densa) c=P.node2Center(arrays[i]) @@ -45,5 +45,3 @@ #print(res) #res = P.integNorm(data) print(res) - - diff --git a/Cassiopee/Post/test/integ5.py b/Cassiopee/Post/test/integ5.py index 40d234d1e..4fb0a1d32 100644 --- a/Cassiopee/Post/test/integ5.py +++ b/Cassiopee/Post/test/integ5.py @@ -29,8 +29,8 @@ nj = a[3] nk = a[4] print(ni, nj, nk) - dens = ones( (1, (ni-1) * (nj-1) * (nk-1)), float64 ) -# dens = ones( (3, (ni-1) * (nj-1) * (nk-1)), float64 ) + dens = ones( (1, (ni-1) * (nj-1) * (nk-1)), float64 ) +# dens = ones( (3, (ni-1) * (nj-1) * (nk-1)), float64 ) densa = ['t', dens, (ni-1), (nj-1), (nk-1)] # en centres ac = T.subzone(a,(1,1,1),(ni,nj,1)) data.append(densa) diff --git a/Cassiopee/Post/test/integ6.py b/Cassiopee/Post/test/integ6.py index 518b787b8..2c831ad33 100644 --- a/Cassiopee/Post/test/integ6.py +++ b/Cassiopee/Post/test/integ6.py @@ -35,7 +35,7 @@ # Basic test case 3 #============================================================================= m = G.cart((10,0,0), (10.*sqrt(2)/(ni-1),10.*sqrt(2)/(nj-1),1), (ni,nj,1)) -mp = T.rotate(m, (10,0,0), (0,0,1), 45.); del m +mp = T.rotate(m, (10,0,0), (0,0,1), 45.); del m m3 = C.addVar(mp, 'ro'); del mp c = C.array('cellN', ni-1, nj-1, 1) @@ -52,6 +52,5 @@ c1 = P.node2Center(m4) c2 = P.node2Center(m5) res1 = C.addVars([c1, r[0]]) -res2 = C.addVars([c2, r[1]]) +res2 = C.addVars([c2, r[1]]) C.convertArrays2File([res1,res2], "centers.plt", "bin_tp") - diff --git a/Cassiopee/Post/test/integMoment.py b/Cassiopee/Post/test/integMoment.py index 9cded09c1..a455d4eb7 100644 --- a/Cassiopee/Post/test/integMoment.py +++ b/Cassiopee/Post/test/integMoment.py @@ -5,7 +5,7 @@ # Maillage et champs non structure, en noeuds m = G.cartTetra((0.,0.,0.), (0.1,0.1,0.2), (10,10,1)) -c = C.array('vx,vy,vz', 100, 162, 'TRI') +c = C.array('vx,vy,vz', 100, 162, 'TRI') c = C.initVars(c, 'vx,vy,vz', 1.) res = P.integMoment([m], [c], [], (5.,5., 0.)); print(res) diff --git a/Cassiopee/Post/test/integMoment2.py b/Cassiopee/Post/test/integMoment2.py index d57392892..fdc611374 100644 --- a/Cassiopee/Post/test/integMoment2.py +++ b/Cassiopee/Post/test/integMoment2.py @@ -34,7 +34,7 @@ ni = arrays[i][2] nj = arrays[i][3] nk = arrays[i][4] - dens = ones( (3, (ni-1) * (nj-1) * nk), float64 ) + dens = ones( (3, (ni-1) * (nj-1) * nk), float64 ) densa = ['t', dens, (ni-1), (nj-1), nk] density.append(densa) @@ -42,5 +42,3 @@ print(res) res = P.integMoment(arrays, density, [], (0.,0.,0.)) print(res) - - diff --git a/Cassiopee/Post/test/integMomentNorm.py b/Cassiopee/Post/test/integMomentNorm.py index 268e1cf2e..2b0531583 100644 --- a/Cassiopee/Post/test/integMomentNorm.py +++ b/Cassiopee/Post/test/integMomentNorm.py @@ -5,7 +5,7 @@ # Maillage et champs non structure, en noeuds m = G.cartTetra((0.,0.,0.), (0.1,0.1,0.2), (10,10,1)) -c = C.array('ro', 100, 162, 'TRI') +c = C.array('ro', 100, 162, 'TRI') c = C.initVars(c, 'ro', 1.) res = P.integMomentNorm([m], [c], [], (5.,5., 0.)); print(res) diff --git a/Cassiopee/Post/test/integMomentNormPT_t1.py b/Cassiopee/Post/test/integMomentNormPT_t1.py index 98f40811c..76d6d108c 100644 --- a/Cassiopee/Post/test/integMomentNormPT_t1.py +++ b/Cassiopee/Post/test/integMomentNormPT_t1.py @@ -9,14 +9,14 @@ def f1(x,y): return 2*x + y def f2(x,y): return 3*x*y + 4 -# STRUCT 2D +# STRUCT 2D ni = 30; nj = 40 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,1)) m = C.initVars(m,'vx', f1, ['CoordinateX','CoordinateY']) m = C.node2Center(m, Internal.__GridCoordinates__) m = C.initVars(m,'centers:vy', f2, ['CoordinateX','CoordinateY']) res = P.integMomentNorm(m,(5.,5.,1.),'vx')+\ - P.integMomentNorm(m,(5.,5.,1.),'centers:vy') + P.integMomentNorm(m,(5.,5.,1.),'centers:vy') test.testO(res,1) #TRI @@ -25,7 +25,7 @@ def f2(x,y): return 3*x*y + 4 m2 = C.node2Center(m, Internal.__GridCoordinates__) m2 = C.initVars(m2,'centers:vy', f2, ['CoordinateX','CoordinateY']) res = P.integMomentNorm(m2,(5.,5.,1.),'vx')+\ - P.integMomentNorm(m2,(5.,5.,1.),'centers:vy') + P.integMomentNorm(m2,(5.,5.,1.),'centers:vy') test.testO(res,2) # ARBRE @@ -33,5 +33,5 @@ def f2(x,y): return 3*x*y + 4 t[2][1] = C.addState(t[2][1], 'Mach', 0.6); t[2][1][2].append(m) t[2][2] = C.addState(t[2][2], 'Mach', 0.6); t[2][2][2].append(m2) res = P.integMomentNorm(t,(5.,5.,1.),'vx')+\ - P.integMomentNorm(t,(5.,5.,1.),'centers:vy') + P.integMomentNorm(t,(5.,5.,1.),'centers:vy') test.testO(res,3) diff --git a/Cassiopee/Post/test/integMomentPT_t1.py b/Cassiopee/Post/test/integMomentPT_t1.py index 56e56dba7..2fe47da65 100644 --- a/Cassiopee/Post/test/integMomentPT_t1.py +++ b/Cassiopee/Post/test/integMomentPT_t1.py @@ -8,7 +8,7 @@ def f1(x,y): return 2*x + y def f2(x,y): return 3*x*y + 4 -# STRUCT 2D +# STRUCT 2D ni = 30; nj = 40 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,1)) C._initVars(m,'vx', f1, ['CoordinateX','CoordinateY']) diff --git a/Cassiopee/Post/test/integMoment_t1.py b/Cassiopee/Post/test/integMoment_t1.py index ec093f4ac..7edd7aa5c 100644 --- a/Cassiopee/Post/test/integMoment_t1.py +++ b/Cassiopee/Post/test/integMoment_t1.py @@ -39,7 +39,7 @@ def f2(x,y) : # STRUCT 1D NODE / CENTER m = G.cart((0,0,0), (10./(ni-1),1,1), (ni,1,1)) -m2 = G.cart((0.5,0,0), (9./(ni-2),1,1), (ni-1,1,1)) +m2 = G.cart((0.5,0,0), (9./(ni-2),1,1), (ni-1,1,1)) c = C.array('vx,vy,vz', ni-1, 1, 1) c0 = C.addVars([m2,c]) c0 = C.initVars(c0,'vx', f1, ['x','y']) @@ -64,7 +64,7 @@ def f2(x,y) : # TRI NODE / NODE m = G.cartTetra((0.,0.,0.),(10./(ni-1),10./(nj-1),1), (ni,nj,1)) -c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'TRI') +c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'TRI') c = C.initVars(c, 'vx,vy,vz', 1.) res = P.integMoment([m], [c], [], (xm,ym,zm)) out = C.array('res', 3, 1, 1) @@ -73,7 +73,7 @@ def f2(x,y) : # TRI NODE / CENTER m = G.cartTetra((0.,0.,0.), (10./(ni-1),10./(nj-1),1), (ni,nj,1)) -c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'TRI') +c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'TRI') c = C.initVars(c, 'vx,vy,vz', 1.) c = C.node2Center(c) res = P.integMoment([m], [c], [], (xm,ym,zm)) @@ -84,7 +84,7 @@ def f2(x,y) : # BAR NODE / NODE a = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,1,1)) m = C.convertArray2Tetra(a) -c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'BAR') +c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'BAR') c = C.initVars(c, 'vx,vy,vz', 1.) res = P.integMoment([m], [c], [], (xm,ym,zm)) out = C.array('res', 3, 1, 1) @@ -94,7 +94,7 @@ def f2(x,y) : # BAR NODE / CENTER a = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,1,1)) m = C.convertArray2Tetra(a) -c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'BAR') +c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'BAR') c = C.initVars(c, 'vx,vy,vz', 1.) c = C.node2Center(c) res = P.integMoment([m], [c], [], (xm,ym,zm)) diff --git a/Cassiopee/Post/test/integNorm.py b/Cassiopee/Post/test/integNorm.py index c31292b7d..bcebce9a3 100644 --- a/Cassiopee/Post/test/integNorm.py +++ b/Cassiopee/Post/test/integNorm.py @@ -5,7 +5,7 @@ # Node mesh and field m = G.cartTetra((0.,0.,0.), (0.1,0.1,0.2), (10,10,1)) -c1 = C.array('ro', 100, 162, 'TRI') +c1 = C.array('ro', 100, 162, 'TRI') c = C.initVars(c1, 'ro', 1.) res = P.integNorm([m], [c], []); print('res1 = %f'%res) diff --git a/Cassiopee/Post/test/integNormPT_m1.py b/Cassiopee/Post/test/integNormPT_m1.py index 8f5a872ef..2932d7ccd 100644 --- a/Cassiopee/Post/test/integNormPT_m1.py +++ b/Cassiopee/Post/test/integNormPT_m1.py @@ -26,4 +26,3 @@ def f2(x,y): return 3*x*y + 4 res1 = Pmpi.integNorm(t, 'vx') if Cmpi.rank == 0: test.testO(res1[0], 2) - diff --git a/Cassiopee/Post/test/integNormPT_t1.py b/Cassiopee/Post/test/integNormPT_t1.py index 3736394a4..32589d68d 100644 --- a/Cassiopee/Post/test/integNormPT_t1.py +++ b/Cassiopee/Post/test/integNormPT_t1.py @@ -11,7 +11,7 @@ def f1(x,y): return 2*x + y def f2(x,y): return 3*x*y + 4 -# STRUCT 2D +# STRUCT 2D ni = 30; nj = 40 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,1)) m = C.addBC2Zone(m,'overlap','BCOverlap','imin') diff --git a/Cassiopee/Post/test/integNormProduct.py b/Cassiopee/Post/test/integNormProduct.py index 00890df75..596446eb7 100644 --- a/Cassiopee/Post/test/integNormProduct.py +++ b/Cassiopee/Post/test/integNormProduct.py @@ -5,7 +5,7 @@ # Maillage et champs non structure, en noeuds m = G.cartTetra((0.,0.,0.), (0.1,0.1,0.2), (10,10,1)) -c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'TRI') +c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'TRI') c = C.initVars(c, 'vx,vy,vz', 1.) res = P.integNormProduct([m], [c], []); print(res) diff --git a/Cassiopee/Post/test/integNormProductPT_t1.py b/Cassiopee/Post/test/integNormProductPT_t1.py index accb720fb..dd0743097 100644 --- a/Cassiopee/Post/test/integNormProductPT_t1.py +++ b/Cassiopee/Post/test/integNormProductPT_t1.py @@ -8,7 +8,7 @@ def f1(x,y): return 2*x + y def f2(x,y): return 3*x*y + 4 -# STRUCT 2D +# STRUCT 2D ni = 30; nj = 40 m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,nj,1)) m = C.addBC2Zone(m,'overlap','BCOverlap','imin') diff --git a/Cassiopee/Post/test/integNormProduct_t1.py b/Cassiopee/Post/test/integNormProduct_t1.py index 31edefbb0..3bef692f5 100644 --- a/Cassiopee/Post/test/integNormProduct_t1.py +++ b/Cassiopee/Post/test/integNormProduct_t1.py @@ -54,4 +54,3 @@ def f3(z) : out = C.array('res', 1, 1, 1) out[1][0][0] = res test.testA([out], 4) - diff --git a/Cassiopee/Post/test/integPT_t1.py b/Cassiopee/Post/test/integPT_t1.py index 06bb6baa6..6edd24a20 100644 --- a/Cassiopee/Post/test/integPT_t1.py +++ b/Cassiopee/Post/test/integPT_t1.py @@ -14,7 +14,7 @@ test.testO(res,1) # 1D -ni = 30 +ni = 30 m = G.cart((0,0,0), (10./(ni-1),1,1), (ni,1,1)) m = C.initVars(m, 'vx', 1.) m = C.initVars(m, 'centers:vy', 2.) @@ -32,7 +32,7 @@ test.testO(res,3) # BAR -ni = 30 +ni = 30 m = G.cart((0,0,0), (10./(ni-1),1,1), (ni,1,1)) m = C.convertArray2Tetra(m) m = C.initVars(m, 'vx', 1.) diff --git a/Cassiopee/Post/test/integPT_t2.py b/Cassiopee/Post/test/integPT_t2.py index f2ebf41e8..aa1a6df5b 100644 --- a/Cassiopee/Post/test/integPT_t2.py +++ b/Cassiopee/Post/test/integPT_t2.py @@ -16,7 +16,7 @@ test.testO(res,1) # 1D -ni = 30 +ni = 30 m = G.cart((0,0,0), (10./(ni-1),1,1), (ni,1,1)) m = C.initVars(m, 'vx', 1.) m = C.initVars(m, 'centers:vy', 1.) @@ -41,7 +41,7 @@ test.testO(res,3) # BAR -ni = 30 +ni = 30 m = G.cart((0,0,0), (10./(ni-1),1,1), (ni,1,1)) m = C.convertArray2Tetra(m) m = C.initVars(m, 'vx', 1.) diff --git a/Cassiopee/Post/test/integ_t1.py b/Cassiopee/Post/test/integ_t1.py index 811764482..8a7df9277 100644 --- a/Cassiopee/Post/test/integ_t1.py +++ b/Cassiopee/Post/test/integ_t1.py @@ -39,7 +39,7 @@ def f2(x,y) : # STRUCT 1D NODE / CENTER m = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,1,1)) -m2 = G.cart((0.5,0,0), (9./(ni-2),9./(nj-2),1), (ni-1,1,1)) +m2 = G.cart((0.5,0,0), (9./(ni-2),9./(nj-2),1), (ni-1,1,1)) c = C.array('vx,vy,vz', ni-1, 1, 1) c0 = C.addVars([m2,c]) c0 = C.initVars(c0,'vx', f1, ['x','y']) @@ -64,7 +64,7 @@ def f2(x,y) : # TRI NODE / NODE m = G.cartTetra((0.,0.,0.),(10./(ni-1),10./(nj-1),1), (ni,nj,1)) -c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'TRI') +c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'TRI') c = C.initVars(c, 'vx,vy,vz', 1.) res = P.integ([m], [c], []) out = C.array('res', 3, 1, 1) @@ -73,7 +73,7 @@ def f2(x,y) : # TRI NODE / CENTER m = G.cartTetra((0.,0.,0.), (10./(ni-1),10./(nj-1),1), (ni,nj,1)) -c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'TRI') +c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'TRI') c = C.initVars(c, 'vx,vy,vz', 1.) c = C.node2Center(c) res = P.integ([m], [c], []) @@ -84,7 +84,7 @@ def f2(x,y) : # BAR NODE / NODE a = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,1,1)) m = C.convertArray2Tetra(a) -c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'BAR') +c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'BAR') c = C.initVars(c, 'vx,vy,vz', 1.) res = P.integ([m], [c], []) out = C.array('res', 3, 1, 1) @@ -94,7 +94,7 @@ def f2(x,y) : # BAR NODE / CENTER a = G.cart((0,0,0), (10./(ni-1),10./(nj-1),1), (ni,1,1)) m = C.convertArray2Tetra(a) -c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'BAR') +c = C.array('vx,vy,vz', m[1].shape[1], m[2].shape[1], 'BAR') c = C.initVars(c, 'vx,vy,vz', 1.) c = C.addVars([m,c]) c = C.node2Center(c) diff --git a/Cassiopee/Post/test/interiorFaces.py b/Cassiopee/Post/test/interiorFaces.py index f668615ab..149857080 100644 --- a/Cassiopee/Post/test/interiorFaces.py +++ b/Cassiopee/Post/test/interiorFaces.py @@ -10,7 +10,7 @@ C.convertArrays2File([a,b], 'out1.plt') # Get interior faces in strict sense: -# faces having only interior nodes +# faces having only interior nodes a = G.cartTetra((0,0,0), (1,1.,1), (20,3,1)) b = P.interiorFaces(a,1) C.convertArrays2File([a,b], 'out2.plt') diff --git a/Cassiopee/Post/test/interiorFacesPT_t1.py b/Cassiopee/Post/test/interiorFacesPT_t1.py index e058b6de0..c1e384808 100644 --- a/Cassiopee/Post/test/interiorFacesPT_t1.py +++ b/Cassiopee/Post/test/interiorFacesPT_t1.py @@ -12,7 +12,7 @@ test.testT(b, 1) # test faces interieures au sens strict : -# faces n'ayant que des noeuds interieurs +# faces n'ayant que des noeuds interieurs a = G.cartTetra((0,0,0), (1,1.,1), (20,3,1)) C._addVars(a,'Density'); C._addVars(a,'centers:cellN') b = P.interiorFaces(a,1) @@ -20,7 +20,7 @@ # test faces interieures au sens strict : # faces n'ayant que des noeuds interieurs -# ici aucune +# ici aucune a = G.cartTetra((0,0,0), (1,1.,1), (20,2,1)) C._addVars(a,'Density'); C._addVars(a,'centers:cellN') b = P.interiorFaces(a,1) diff --git a/Cassiopee/Post/test/interiorFacesPT_t2.py b/Cassiopee/Post/test/interiorFacesPT_t2.py index 5aaf47e64..cd0ea52bf 100644 --- a/Cassiopee/Post/test/interiorFacesPT_t2.py +++ b/Cassiopee/Post/test/interiorFacesPT_t2.py @@ -14,7 +14,7 @@ test.testT(t,1) # test faces interieures au sens strict : -# faces n'ayant que des noeuds interieurs +# faces n'ayant que des noeuds interieurs a = G.cartTetra((0,0,0), (1,1.,1), (20,3,1)) C._addVars(a,'Density'); C._addVars(a,'centers:cellN') t = C.newPyTree(['Base',2,a]) @@ -24,7 +24,7 @@ # test faces interieures au sens strict : # faces n'ayant que des noeuds interieurs -# ici aucune +# ici aucune a = G.cartTetra((0,0,0), (1,1.,1), (20,2,1)) C._addVars(a,'Density'); C._addVars(a,'centers:cellN') t = C.newPyTree(['Base',2,a]) diff --git a/Cassiopee/Post/test/interiorFaces_t1.py b/Cassiopee/Post/test/interiorFaces_t1.py index 988dbc10a..6d9ecd540 100644 --- a/Cassiopee/Post/test/interiorFaces_t1.py +++ b/Cassiopee/Post/test/interiorFaces_t1.py @@ -10,15 +10,14 @@ test.testA([b], 1) # test faces interieures au sens strict : -# faces n'ayant que des noeuds interieurs +# faces n'ayant que des noeuds interieurs a = G.cartTetra((0,0,0), (1,1.,1), (20,3,1)) b = P.interiorFaces(a,1) test.testA([b], 2) # test faces interieures au sens strict : #faces n'ayant que des noeuds interieurs -# ici aucune +# ici aucune a = G.cartTetra((0,0,0), (1,1.,1), (20,2,1)) b = P.interiorFaces(a,1) if b[1].shape[1] != 0: print('FAILED...') - diff --git a/Cassiopee/Post/test/isoSurf_t1.py b/Cassiopee/Post/test/isoSurf_t1.py index 17a01e727..7578618fc 100644 --- a/Cassiopee/Post/test/isoSurf_t1.py +++ b/Cassiopee/Post/test/isoSurf_t1.py @@ -11,7 +11,7 @@ iso = P.isoSurf(a, 'field', value=5.) test.testA(iso, 1) -# Surface +# Surface b = D.sphere( (0,0,0), 1.) b = C.initVars(b, '{field}={x}*{x}+{y}*{y}+{z}') iso = P.isoSurf(b, 'field', value=0.5) diff --git a/Cassiopee/Post/test/probePT_m2.py b/Cassiopee/Post/test/probePT_m2.py index 3a16d9eaf..9b0f12ca1 100644 --- a/Cassiopee/Post/test/probePT_m2.py +++ b/Cassiopee/Post/test/probePT_m2.py @@ -39,7 +39,7 @@ probe.extract(tcs, time) probe.flush() -if Cmpi.rank == 0: +if Cmpi.rank == 0: test.testT(probe._probeZones, 1) test.testT(probe._ts, 4) Cmpi.barrier() diff --git a/Cassiopee/Post/test/selectCells2PT_t2.py b/Cassiopee/Post/test/selectCells2PT_t2.py index 36cdd14a0..dd618a197 100644 --- a/Cassiopee/Post/test/selectCells2PT_t2.py +++ b/Cassiopee/Post/test/selectCells2PT_t2.py @@ -5,7 +5,7 @@ import Post.PyTree as P import KCore.test as test -def F(x, y, z): return x+2*y+z +def F(x, y, z): return x+2*y+z def F2(x): if (x > 15.): return True diff --git a/Cassiopee/Post/test/selectCells2PT_t3.py b/Cassiopee/Post/test/selectCells2PT_t3.py index e6309c5ec..59f5c9574 100644 --- a/Cassiopee/Post/test/selectCells2PT_t3.py +++ b/Cassiopee/Post/test/selectCells2PT_t3.py @@ -9,7 +9,7 @@ def F(x, y, z): if (x+2*y+z > 20.): return True else: return False -# test sur une zone - tag aux noeuds - sans champ en centre +# test sur une zone - tag aux noeuds - sans champ en centre a = G.cart((0,0,0),(1,1,1),(11,11,11)) a = C.addBC2Zone(a, 'wall1', 'BCWall', 'imin') a = C.addBC2Zone(a, 'overlap1', 'BCOverlap', 'jmin') diff --git a/Cassiopee/Post/test/selectCells2PT_t4.py b/Cassiopee/Post/test/selectCells2PT_t4.py index 712a28910..0a1367f6f 100644 --- a/Cassiopee/Post/test/selectCells2PT_t4.py +++ b/Cassiopee/Post/test/selectCells2PT_t4.py @@ -11,7 +11,7 @@ def F(x, y, z): if (x+2*y+z > 20.): return True else: return False -# Test tag aux noeuds - sans champ en centre +# Test tag aux noeuds - sans champ en centre a = G.cartNGon( (0,0,0), (1,1,1), (21,11,11) ) a = Internal.createElsaHybrid(a,method=1,methodPE=1) @@ -22,7 +22,7 @@ def F(x, y, z): test.testT(a,1) -# Test tag aux noeuds - avec champ en centre +# Test tag aux noeuds - avec champ en centre a = G.cartNGon( (0,0,0), (1,1,1), (21,11,11) ) a = Internal.createElsaHybrid(a,method=1,methodPE=1) @@ -34,7 +34,7 @@ def F(x, y, z): test.testT(a,2) -# Test tag aux centres - sans champ en centre +# Test tag aux centres - sans champ en centre a = G.cartNGon( (0,0,0), (1,1,1), (21,11,11) ) a = Internal.createElsaHybrid(a,method=1,methodPE=1) @@ -45,7 +45,7 @@ def F(x, y, z): test.testT(a,3) -# Test tag aux centres - avec champ en centre +# Test tag aux centres - avec champ en centre a = G.cartNGon( (0,0,0), (1,1,1), (21,11,11) ) a = Internal.createElsaHybrid(a,method=1,methodPE=1) @@ -56,4 +56,3 @@ def F(x, y, z): a = C.initVars(a, 'centers:tag', F, ['centers:CoordinateX','centers:CoordinateY','centers:CoordinateZ']) b = P.selectCells2(a, 'centers:tag') test.testT(a,4) - diff --git a/Cassiopee/Post/test/selectCells2_t3.py b/Cassiopee/Post/test/selectCells2_t3.py index d32a35320..7c8959d31 100644 --- a/Cassiopee/Post/test/selectCells2_t3.py +++ b/Cassiopee/Post/test/selectCells2_t3.py @@ -8,7 +8,7 @@ def F(x, y, z): if (x+2*y+z > 20.): return True else: return False -# List +# List a = G.cart( (0,0,0), (1,1,1), (11,11,11) ) taga = C.initVars(a, 'tag', F, ['x','y','z']) taga = C.extractVars(taga,['tag']) diff --git a/Cassiopee/Post/test/selectCellsPT_t3.py b/Cassiopee/Post/test/selectCellsPT_t3.py index 13ad84e01..2d6311e50 100644 --- a/Cassiopee/Post/test/selectCellsPT_t3.py +++ b/Cassiopee/Post/test/selectCellsPT_t3.py @@ -7,7 +7,7 @@ def F(x, y, z): if (x + 2*y + z > 20.): return True else: return False -# Struct +# Struct a = G.cart((0,0,0), (1,1,1), (11,11,11) ) C._initVars(a,'{Density}={CoordinateX}') C._initVars(a,'{centers:var1}={centers:CoordinateX}+2.*{centers:CoordinateY}+{centers:CoordinateZ}') @@ -32,4 +32,3 @@ def F(x, y, z): C._initVars(a,'{centers:var2}={centers:CoordinateX}') a = P.selectCells(a, '{centers:var1}>15.') test.testT(a,3) - diff --git a/Cassiopee/Post/test/selectCellsPT_t4.py b/Cassiopee/Post/test/selectCellsPT_t4.py index 7ebc8db43..973929dab 100644 --- a/Cassiopee/Post/test/selectCellsPT_t4.py +++ b/Cassiopee/Post/test/selectCellsPT_t4.py @@ -49,4 +49,3 @@ def F(x, y, z): C._initVars(a,'{centers:var2}={centers:CoordinateX}') a = P.selectCells(a, '{var1}>15.') test.testT(a,5) - diff --git a/Cassiopee/Post/test/selectCellsPT_t5.py b/Cassiopee/Post/test/selectCellsPT_t5.py index 981e39dfb..f4fe97a64 100644 --- a/Cassiopee/Post/test/selectCellsPT_t5.py +++ b/Cassiopee/Post/test/selectCellsPT_t5.py @@ -56,7 +56,7 @@ def F(x, y, z): test.testT(a,3) -# CAS 4 : tag au noeud + uniquement des champs aux noeuds +# CAS 4 : tag au noeud + uniquement des champs aux noeuds # ======================================================= a = G.cartNGon( (0,0,0), (1,1,1), (11,11,11) ) C._initVars(a,'{var1}=1.') @@ -67,5 +67,3 @@ def F(x, y, z): a = P.selectCells(a, '({CoordinateX}-5.)**2+({CoordinateY}-5.)**2+({CoordinateZ}-5.)**2>25.',strict=0) test.testT(a,4) - - diff --git a/Cassiopee/Post/test/selectCells_t2.py b/Cassiopee/Post/test/selectCells_t2.py index 9495684dd..35a038165 100644 --- a/Cassiopee/Post/test/selectCells_t2.py +++ b/Cassiopee/Post/test/selectCells_t2.py @@ -7,7 +7,7 @@ def F(x, y, z): if (x+2*y+z > 20.): return True else: return False -# +# a = G.cart( (0,0,0), (1,1,1), (11,11,11) ) a = P.selectCells(a, F, varStrings=['x','y','z'] ) test.testA([a], 1) diff --git a/Cassiopee/Post/test/sharpEdges_t1.py b/Cassiopee/Post/test/sharpEdges_t1.py index 8db2b1241..43f21789b 100644 --- a/Cassiopee/Post/test/sharpEdges_t1.py +++ b/Cassiopee/Post/test/sharpEdges_t1.py @@ -1,4 +1,4 @@ -# - sharpEdges (array) - +# - sharpEdges (array) - import Converter as C import Generator as G import Post as P diff --git a/Cassiopee/Post/test/silhouette.py b/Cassiopee/Post/test/silhouette.py index 2cbf0ded3..2dcabec36 100644 --- a/Cassiopee/Post/test/silhouette.py +++ b/Cassiopee/Post/test/silhouette.py @@ -3,7 +3,7 @@ import Converter as C import Post as P -a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,1,30)) +a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,1,30)) vector=[1.,0.,0.] res = P.silhouette([a], vector) diff --git a/Cassiopee/Post/test/silhouettePT.py b/Cassiopee/Post/test/silhouettePT.py index 1886355f6..d2eed5731 100644 --- a/Cassiopee/Post/test/silhouettePT.py +++ b/Cassiopee/Post/test/silhouettePT.py @@ -3,7 +3,7 @@ import Converter.PyTree as C import Post.PyTree as P -a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,1,30)) +a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,1,30)) t = C.newPyTree(['Base']); t[2][1][2].append(a) vector=[1.,0.,0.] diff --git a/Cassiopee/Post/test/silhouettePT_t1.py b/Cassiopee/Post/test/silhouettePT_t1.py index fbb171892..ab0fa58ab 100644 --- a/Cassiopee/Post/test/silhouettePT_t1.py +++ b/Cassiopee/Post/test/silhouettePT_t1.py @@ -1,4 +1,4 @@ -# - silhouette (array) - +# - silhouette (array) - import Generator.PyTree as G import Converter.PyTree as C import Post.PyTree as P @@ -17,7 +17,7 @@ vector=[1.,0.,0.] # 2D -a1 = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,1,30)) +a1 = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,1,30)) a1 = C.addBC2Zone(a1,'wall','BCWall','jmin') a1 = C.addBC2Zone(a1,'overlap','BCOverlap','jmax') a2 = T.rotate(a1,(0.,0.,0.),(0.,1.,0.),120.); a2[0] = 'cart2' diff --git a/Cassiopee/Post/test/silhouette_t1.py b/Cassiopee/Post/test/silhouette_t1.py index c4b78d9aa..236d87323 100644 --- a/Cassiopee/Post/test/silhouette_t1.py +++ b/Cassiopee/Post/test/silhouette_t1.py @@ -1,4 +1,4 @@ -# - silhouette (array) - +# - silhouette (array) - import Generator as G import Converter as C import Post as P @@ -8,7 +8,7 @@ # structure # 1D -a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,1,1)) +a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,1,1)) vector=[0.,1.,0.] res = P.silhouette([a], vector) test.testA(res,1) @@ -16,7 +16,7 @@ vector=[1.,0.,0.] # 2D -a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,1,30)) +a = G.cylinder((0.,0.,0.), 0.5, 1., 360., 0., 10., (50,1,30)) a = C.initVars(a,'v',0.) res = P.silhouette([a], vector) test.testA(res,2) diff --git a/Cassiopee/Post/test/streamLinePT.py b/Cassiopee/Post/test/streamLinePT.py index 216a1d676..51434f129 100644 --- a/Cassiopee/Post/test/streamLinePT.py +++ b/Cassiopee/Post/test/streamLinePT.py @@ -12,6 +12,6 @@ def F(x): return M.cos(x) t = C.initVars(t, 'vx', 1.) t = C.initVars(t, 'vy', F, ['CoordinateX']) t = C.initVars(t, 'vz', 0.) -x0=0.1; y0=5.; z0=0.5 +x0=0.1; y0=5.; z0=0.5 p = P.streamLine(t, (x0,y0,z0),['vx','vy','vz']) C.convertPyTree2File(p, "out.cgns") diff --git a/Cassiopee/Post/test/streamRibbonPT.py b/Cassiopee/Post/test/streamRibbonPT.py index 84399d2b9..d995d1a25 100644 --- a/Cassiopee/Post/test/streamRibbonPT.py +++ b/Cassiopee/Post/test/streamRibbonPT.py @@ -1,4 +1,4 @@ -# - streamRibbon (pyTree) - +# - streamRibbon (pyTree) - import Converter.PyTree as C import Post.PyTree as P import Generator.PyTree as G @@ -12,6 +12,6 @@ def F(x): return M.cos(x) t = C.initVars(t, 'vx', 1.) t = C.initVars(t, 'vy', F, ['CoordinateX']) t = C.initVars(t, 'vz', 0.) -x0=0.1; y0=5.; z0=0.5 +x0=0.1; y0=5.; z0=0.5 p = P.streamRibbon(t, (x0,y0,z0),(0.,0.2,0.),['vx','vy','vz']) C.convertPyTree2File(p, "out.cgns") diff --git a/Cassiopee/Post/test/streamRibbonPT_t1.py b/Cassiopee/Post/test/streamRibbonPT_t1.py index 001dabf0c..e8dd4710f 100644 --- a/Cassiopee/Post/test/streamRibbonPT_t1.py +++ b/Cassiopee/Post/test/streamRibbonPT_t1.py @@ -1,4 +1,4 @@ -# - streamRibbon (pyTree) - +# - streamRibbon (pyTree) - import Converter.PyTree as C import Post.PyTree as P import Generator.PyTree as G diff --git a/Cassiopee/Post/test/streamRibbon_t1.py b/Cassiopee/Post/test/streamRibbon_t1.py index bc268237d..b39af3ea8 100644 --- a/Cassiopee/Post/test/streamRibbon_t1.py +++ b/Cassiopee/Post/test/streamRibbon_t1.py @@ -11,7 +11,7 @@ def F(x): return M.cos(x) n = (0.,0.2,0.) pt = (0.55,0.5,0.) #pt = (0.1,5,0) # ne marche pas -pt = (5,5,0) # ne marche pas +pt = (5,5,0) # ne marche pas vect = ['rou','rov','row'] # Maillage en noeuds # 3D @@ -36,7 +36,7 @@ def F(x): return M.cos(x) # 3D non struct m2 = C.convertArray2Tetra(m) -p = P.streamRibbon(m2, pt, n, vect) +p = P.streamRibbon(m2, pt, n, vect) test.testA([p], 2) # Mixte diff --git a/Cassiopee/Post/test/streamSurfPT.py b/Cassiopee/Post/test/streamSurfPT.py index ff1baa00c..0e258b87e 100644 --- a/Cassiopee/Post/test/streamSurfPT.py +++ b/Cassiopee/Post/test/streamSurfPT.py @@ -14,6 +14,6 @@ t = C.initVars(t, 'vx', 1.) t = C.initVars(t, '{vy}=cos({CoordinateX})') t = C.initVars(t, 'vz', 0.) -x0=0.1; y0=5.; z0=0.5 +x0=0.1; y0=5.; z0=0.5 p = P.streamSurf(t, b, ['vx','vy','vz']) C.convertPyTree2File(p, "out.cgns") diff --git a/Cassiopee/Post/test/toutInteg.py b/Cassiopee/Post/test/toutInteg.py index eb1b67a96..6e5c5d038 100644 --- a/Cassiopee/Post/test/toutInteg.py +++ b/Cassiopee/Post/test/toutInteg.py @@ -83,6 +83,3 @@ print("pb in integ, ni=1") print('done.') - - - diff --git a/Cassiopee/Post/test/toutIntegMomentNorm.py b/Cassiopee/Post/test/toutIntegMomentNorm.py index 1dfcb96e6..2143c1977 100644 --- a/Cassiopee/Post/test/toutIntegMomentNorm.py +++ b/Cassiopee/Post/test/toutIntegMomentNorm.py @@ -101,7 +101,3 @@ ## if math.fabs(res[0]-res2) > 1.e-1: ## print "pb in integMoment, ni=1" print(res, res2) - - - - diff --git a/Cassiopee/Post/test/toutIntegNorm.py b/Cassiopee/Post/test/toutIntegNorm.py index 3ab78d967..9f4fa4727 100644 --- a/Cassiopee/Post/test/toutIntegNorm.py +++ b/Cassiopee/Post/test/toutIntegNorm.py @@ -90,8 +90,3 @@ res = res[0] if math.fabs(res[0]-res2) > 1.e-1: print("pb in integ, ni=1") - - - - - diff --git a/Cassiopee/Post/test/usurp.py b/Cassiopee/Post/test/usurp.py index 63967b550..49b53f45e 100644 --- a/Cassiopee/Post/test/usurp.py +++ b/Cassiopee/Post/test/usurp.py @@ -6,7 +6,7 @@ cyln = [] a1 = G.cylinder((0,0,0), 0, 2, 360, 0, 1., (100,2,10)) -a1 = T.subzone(a1, (1,2,1), (a1[2],2,a1[4])) +a1 = T.subzone(a1, (1,2,1), (a1[2],2,a1[4])) cyln.append(a1) # a2 = G.cylinder((0,0,0), 0, 2, 90, 0, 0.5, (10,2,10)) diff --git a/Cassiopee/Post/test/usurp2.py b/Cassiopee/Post/test/usurp2.py index 6e94274d7..874799028 100644 --- a/Cassiopee/Post/test/usurp2.py +++ b/Cassiopee/Post/test/usurp2.py @@ -32,7 +32,7 @@ # Basic test cas 3 #============================================================================= m3 = G.cart((10,0,0), (10.*sqrt(2)/(ni-1),10.*sqrt(2)/(nj-1),1), (ni,nj,1)) -m3 = T.rotate(m3, (10,0,0), (0,0,1), 45.) +m3 = T.rotate(m3, (10,0,0), (0,0,1), 45.) m3 = C.addVar(m3, 'ro') c3 = C.array('cellN', ni-1, nj-1, 1) @@ -47,6 +47,5 @@ centers = C.node2Center([m,m3]) res1 = C.addVars([centers[0], r[0]]) -res2 = C.addVars([centers[1], r[1]]) +res2 = C.addVars([centers[1], r[1]]) C.convertArrays2File([res1,res2], "centers.plt", "bin_tp") - diff --git a/Cassiopee/Post/test/usurp_t1.py b/Cassiopee/Post/test/usurp_t1.py index 61bc93437..2d94d9f50 100644 --- a/Cassiopee/Post/test/usurp_t1.py +++ b/Cassiopee/Post/test/usurp_t1.py @@ -8,7 +8,7 @@ cyln = [] # Creation des cylindres a1 = G.cylinder((0,0,0), 0, 2, 360, 0, 1., (100,2,10)) -a1 = T.subzone(a1, (1,2,1), (a1[2],2,a1[4])) +a1 = T.subzone(a1, (1,2,1), (a1[2],2,a1[4])) cyln.append(a1) a2 = G.cylinder((0,0,0), 0, 2, 90, 0, 0.5, (10,2,10)) diff --git a/Cassiopee/Post/test/usurp_t2.py b/Cassiopee/Post/test/usurp_t2.py index f2a02cfe1..b0a509b5f 100644 --- a/Cassiopee/Post/test/usurp_t2.py +++ b/Cassiopee/Post/test/usurp_t2.py @@ -32,7 +32,7 @@ # Basic test cas 3 #============================================================================= m3 = G.cart((10,0,0), (10.*sqrt(2)/(ni-1),10.*sqrt(2)/(nj-1),1), (ni,nj,1)) -m3 = T.rotate(m3, (10,0,0), (0,0,1), 45.) +m3 = T.rotate(m3, (10,0,0), (0,0,1), 45.) m3 = C.addVars(m3, 'ro') c3 = C.array('cellN', ni-1, nj-1, 1) diff --git a/Cassiopee/Post/test/zipper2.py b/Cassiopee/Post/test/zipper2.py index dcfbac39e..41fb9c83f 100644 --- a/Cassiopee/Post/test/zipper2.py +++ b/Cassiopee/Post/test/zipper2.py @@ -6,4 +6,3 @@ arrays = C.convertFile2Arrays("dauphin_skin.plt","bin_tp") array = P.zipper(arrays,['overlapTol',1.e-3]) C.convertArrays2File([array], "new.plt","bin_tp") - diff --git a/Cassiopee/RigidMotion/RigidMotion/PyTree.py b/Cassiopee/RigidMotion/RigidMotion/PyTree.py index 67c4f000b..d79c1f12c 100644 --- a/Cassiopee/RigidMotion/RigidMotion/PyTree.py +++ b/Cassiopee/RigidMotion/RigidMotion/PyTree.py @@ -32,13 +32,13 @@ def setPrescribedMotion1(t, name, tx="0", ty="0", tz="0", ex="0", ey="0", ez="1", angle="0"): """Define a motion of type 1 (time strings).""" tp = Internal.copyRef(t) - _setPrescribedMotion1(tp, name, tx=tx, ty=ty, tz=tz, cx=cx, cy=cy, cz=cz, + _setPrescribedMotion1(tp, name, tx=tx, ty=ty, tz=tz, cx=cx, cy=cy, cz=cz, ex=ex, ey=ey, ez=ez, angle=angle) return tp def _setPrescribedMotion1(t, name, tx="0", ty="0", tz="0", - cx="0", cy="0", cz="0", - ex="0", ey="0", ez="1", angle="0"): + cx="0", cy="0", cz="0", + ex="0", ey="0", ez="1", angle="0"): for z in Internal.getZones(t): # Recupere le conteneur TimeMotion cont = Internal.getNodeFromName1(z, 'TimeMotion') @@ -69,7 +69,7 @@ def _setPrescribedMotion1(t, name, tx="0", ty="0", tz="0", return None #================================================================== -# Permet de definir un mouvement de RotorMotion +# Permet de definir un mouvement de RotorMotion #================================================================== def setPrescribedMotion2(t, name, transl_speed=(0.,0.,0.), psi0=0., psi0_b=0., @@ -195,11 +195,11 @@ def _setPrescribedMotion2(t, name, for noh in range(len(tets)): DELHS.append(tets[noh]) motion[2].append(['tets', numpy.array(DELHS, numpy.float64), [], 'DataArray_t']) - # blade spanwise vector + # blade spanwise vector motion[2].append(['span_vct', numpy.array([span_vct[0], span_vct[1], span_vct[2]], numpy.float64), [], 'DataArray_t']) - # pre-lag + # pre-lag motion[2].append(['pre_lag_pnt', numpy.array([pre_lag_pnt[0], pre_lag_pnt[1], pre_lag_pnt[2]], numpy.float64), [], 'DataArray_t']) motion[2].append(['pre_lag_vct', numpy.array([pre_lag_vct[0], pre_lag_vct[1], pre_lag_vct[2]], numpy.float64), @@ -219,7 +219,7 @@ def _setPrescribedMotion2(t, name, # Permet de definir un mouvement de rotation + translation a vitesse constante #============================================================================= def setPrescribedMotion3(t, name, - transl_speed=(0.,0.,0.), + transl_speed=(0.,0.,0.), axis_pnt=(0.,0.,0.), axis_vct=(0.,0.,1.), omega=0.): """Define a motion of type 3 (constant rotation+translation speed).""" @@ -229,8 +229,8 @@ def setPrescribedMotion3(t, name, return tp def _setPrescribedMotion3(t, name, transl_speed=(0.,0.,0.), - axis_pnt=(0.,0.,0.), axis_vct=(0.,0.,1.), - omega=0.): + axis_pnt=(0.,0.,0.), axis_vct=(0.,0.,1.), + omega=0.): """Define a motion of type 3 (constant rotation+translation speed).""" for z in Internal.getZones(t): # Recupere le conteneur TimeMotion @@ -321,7 +321,7 @@ def _moveZone__(z, time): angle = angle #*__RAD2DEG__ T._rotate(z, (cx,cy,cz), (ex-cx,ey-cy,ez-cz), angle, vectors=[]) - elif dtype == 2: # type 2: rotor_motion for helicopters in FF + elif dtype == 2: # type 2: rotor_motion for helicopters in FF transl_speed = Internal.getValue(Internal.getNodeFromName(m, 'transl_speed')) psi0 = Internal.getValue(Internal.getNodeFromName(m, 'psi0')) psi0_b = Internal.getValue(Internal.getNodeFromName(m, 'psi0_b')) @@ -340,7 +340,7 @@ def _moveZone__(z, time): bet_vct = Internal.getValue(Internal.getNodeFromName(m, 'bet_vct')) bet0 = Internal.getValue(Internal.getNodeFromName(m, 'bet0')) betc = getNodeValue__(m, 'betc') - bets = getNodeValue__(m, 'bets') + bets = getNodeValue__(m, 'bets') betc = getNodeValue__(m, 'betc') bets = getNodeValue__(m, 'bets') tet_pnt = Internal.getValue(Internal.getNodeFromName(m, 'tet_pnt')) @@ -383,7 +383,7 @@ def _moveZone__(z, time): transl_speed = getNodeValue__(m, 'transl_speed') axis_pnt = getNodeValue__(m, 'axis_pnt') axis_vct = getNodeValue__(m, 'axis_vct') - omega = getNodeValue__(m, 'omega') + omega = getNodeValue__(m, 'omega') cx = axis_pnt[0] cy = axis_pnt[1] cz = axis_pnt[2] @@ -397,7 +397,7 @@ def _moveZone__(z, time): print("Warning: Motion type not found. Nothing done.") return None -# Recopie GridCoordinates#Init (s'il existe) dans GridCoordinates +# Recopie GridCoordinates#Init (s'il existe) dans GridCoordinates def copyGridInit2Grid(t): tp = Internal.copyRef(t) _copyGridInit2Grid(tp) @@ -470,7 +470,7 @@ def _switchGridAndGridInit(t): gc2[0] = 'GridCoordinates#Init' return None -# eval position by deformation: +# eval position by deformation: # ajoute Displacement#0 dans Coordinates#Init def _evalDeformationPosition(t): zones = Internal.getZones(t) @@ -539,7 +539,7 @@ def evalPosition__(t, time): np = Internal.copyTree(n) #for c, p in enumerate(n[2]): n[2][c] = np[2][c] n[2][:] = np[2][:] - for z in zones: + for z in zones: _copyGridInit2Grid(z) _moveZone__(z, time) return a @@ -586,7 +586,7 @@ def getDictOfMotionMatrix(a, time, F=None): dictRM[zname] = getMotionMatrixForZone(z, time, F) return dictRM -def getMotionMatrixForZone(z, time, F=None): +def getMotionMatrixForZone(z, time, F=None): if F is None: cont = Internal.getNodeFromName1(z, 'TimeMotion') if cont is not None: @@ -691,7 +691,7 @@ def _evalGridSpeed(a, time, out=0): """Eval grid speed at given time. Position must be already at time.""" zones = Internal.getZones(a) for z in zones: - # Find Coordinates pointers (must already be updated) + # Find Coordinates pointers (must already be updated) grid = Internal.getNodeFromName1(z, 'GridCoordinates') xcoord = Internal.getNodeFromName1(grid, 'CoordinateX') ycoord = Internal.getNodeFromName1(grid, 'CoordinateY') @@ -700,9 +700,9 @@ def _evalGridSpeed(a, time, out=0): # Get translation vector cont = Internal.getNodeFromName1(z, 'TimeMotion') if cont is not None: - # Get speed pointers + # Get speed pointers mmo = Internal.getNodeFromName1(z, 'Motion') - if mmo is None: mmo = Internal.createNode('Motion', 'UserDefined_t', parent=z) + if mmo is None: mmo = Internal.createNode('Motion', 'UserDefined_t', parent=z) sx = Internal.getNodeFromName1(mmo, 'VelocityX') if sx is None: sx = Internal.copyNode(xcoord); sx[0] = 'VelocityX'; mmo[2].append(sx); sx[1] = sx[1].reshape((sx[1].size)) sy = Internal.getNodeFromName1(mmo, 'VelocityY') @@ -758,7 +758,7 @@ def _evalGridSpeed(a, time, out=0): bet_vct = Internal.getValue(Internal.getNodeFromName(m, 'bet_vct')) bet0 = Internal.getValue(Internal.getNodeFromName(m, 'bet0')) betc = getNodeValue__(m, 'betc') - bets = getNodeValue__(m, 'bets') + bets = getNodeValue__(m, 'bets') betc = getNodeValue__(m, 'betc') bets = getNodeValue__(m, 'bets') tet_pnt = Internal.getValue(Internal.getNodeFromName(m, 'tet_pnt')) @@ -803,10 +803,10 @@ def _evalGridSpeed(a, time, out=0): else: omega = Internal.getValue(omega) rigidMotion.evalSpeed3(xcoord[1], ycoord[1], zcoord[1], - sx[1], sy[1], sz[1], omega, omega*time, - transl_speed[0], transl_speed[1], transl_speed[2], - axis_pnt[0], axis_pnt[1], axis_pnt[2], - axis_vct[0], axis_vct[1], axis_vct[2]) + sx[1], sy[1], sz[1], omega, omega*time, + transl_speed[0], transl_speed[1], transl_speed[2], + axis_pnt[0], axis_pnt[1], axis_pnt[2], + axis_vct[0], axis_vct[1], axis_vct[2]) # Recopie le champ dans un FlowSolution pour visu if out == 1: @@ -866,7 +866,7 @@ def evalPositionM1(coords, z, time): bet_vct = Internal.getValue(Internal.getNodeFromName(m, 'bet_vct')) bet0 = Internal.getValue(Internal.getNodeFromName(m, 'bet0')) betc = getNodeValue__(m, 'betc') - bets = getNodeValue__(m, 'bets') + bets = getNodeValue__(m, 'bets') betc = getNodeValue__(m, 'betc') bets = getNodeValue__(m, 'bets') tet_pnt = Internal.getValue(Internal.getNodeFromName(m, 'tet_pnt')) @@ -920,7 +920,7 @@ def _setRotorMotionCoordsAndGridVel(a, time): # Get grid velocity pointers name = 'Motion' mmo = Internal.getNodeFromName1(z,name) - if mmo is None: mmo = Internal.createNode(name, 'UserDefined_t', parent=z) + if mmo is None: mmo = Internal.createNode(name, 'UserDefined_t', parent=z) sx = Internal.getNodeFromName1(mmo, 'VelocityX') if sx is None: sx = Internal.copyNode(xcoord); sx[0] = 'VelocityX'; mmo[2].append(sx); sx[1] = sx[1].reshape((sx[1].size)) sy = Internal.getNodeFromName1(mmo, 'VelocityY') @@ -945,7 +945,7 @@ def _setRotorMotionCoordsAndGridVel(a, time): bet_vct = Internal.getValue(Internal.getNodeFromName(m, 'bet_vct')) bet0 = Internal.getValue(Internal.getNodeFromName(m, 'bet0')) betc = getNodeValue__(m, 'betc') - bets = getNodeValue__(m, 'bets') + bets = getNodeValue__(m, 'bets') betc = getNodeValue__(m, 'betc') bets = getNodeValue__(m, 'bets') tet_pnt = Internal.getValue(Internal.getNodeFromName(m, 'tet_pnt')) @@ -987,11 +987,11 @@ def _evalGridSpeed2(a, time, dtime=1.e-6, out=0): # evalue la position a l'instant time+dtime c = evalPosition(z, time+dtime) # evalue la difference - coord1X = Internal.getNodeFromName(b, 'CoordinateX')[1] + coord1X = Internal.getNodeFromName(b, 'CoordinateX')[1] coord1Y = Internal.getNodeFromName(b, 'CoordinateY')[1] coord1Z = Internal.getNodeFromName(b, 'CoordinateZ')[1] - coord2X = Internal.getNodeFromName(c, 'CoordinateX')[1] - coord2Y = Internal.getNodeFromName(c, 'CoordinateY')[1] + coord2X = Internal.getNodeFromName(c, 'CoordinateX')[1] + coord2Y = Internal.getNodeFromName(c, 'CoordinateY')[1] coord2Z = Internal.getNodeFromName(c, 'CoordinateZ')[1] speedX = coord2X[:]-coord1X[:] speedY = coord2Y[:]-coord1Y[:] @@ -1006,7 +1006,7 @@ def _evalGridSpeed2(a, time, dtime=1.e-6, out=0): xcoord = Internal.getNodeFromName2(z, 'CoordinateX') name = 'Motion' mmo = Internal.getNodeFromName1(z, name) - if mmo is None: mmo = Internal.createNode(name, 'UserDefined_t', parent=z) + if mmo is None: mmo = Internal.createNode(name, 'UserDefined_t', parent=z) sx = Internal.getNodeFromName1(mmo, 'VelocityX') if sx is None: sx = Internal.copyNode(xcoord); sx[0] = 'VelocityX'; mmo[2].append(sx); sx[1] = sx[1].reshape((sx[1].size)) sy = Internal.getNodeFromName1(mmo, 'VelocityY') @@ -1049,7 +1049,7 @@ def _evalPositionIBC(tc,time): transl_speed = Internal.getNodeFromName(motions[0], 'transl_speed')[1] axis_pnt = Internal.getNodeFromName(motions[0], 'axis_pnt')[1] axis_vct = Internal.getNodeFromName(motions[0], 'axis_vct')[1] - omega = Internal.getNodeFromName(motions[0], 'omega')[1] + omega = Internal.getNodeFromName(motions[0], 'omega')[1] cx = axis_pnt[0] cy = axis_pnt[1] cz = axis_pnt[2] @@ -1084,4 +1084,3 @@ def _evalPositionIBC(tc,time): coordY_PC[:] = transl_speed[1]*time + a21*(coordX_PCInit[:]-cx)+a22*(coordY_PCInit[:]-cy)+a23*(coordZ_PCInit[:]-cz)+cy coordZ_PC[:] = transl_speed[2]*time + a31*(coordX_PCInit[:]-cx)+a32*(coordY_PCInit[:]-cy)+a33*(coordZ_PCInit[:]-cz)+cz return None - diff --git a/Cassiopee/RigidMotion/RigidMotion/RigidMotion.py b/Cassiopee/RigidMotion/RigidMotion/RigidMotion.py index 165110258..be3f37f73 100644 --- a/Cassiopee/RigidMotion/RigidMotion/RigidMotion.py +++ b/Cassiopee/RigidMotion/RigidMotion/RigidMotion.py @@ -6,7 +6,7 @@ from . import rigidMotion import numpy try: import Converter as C -except ImportError: +except ImportError: raise ImportError("RigidMotion: requires Converter module.") #============================================================================== @@ -44,7 +44,7 @@ def _evalPosition(array, time, F): if len(r) != 3: raise ValueError("evalPosition: rotation matrix must be 3x3.") else: if len(r[0]) != 3: raise ValueError("evalPosition: rotation matrix must be 3x3.") - if isinstance(array[0], list): + if isinstance(array[0], list): for i in array: rigidMotion.move(i, d[0], d[1], d[2], \ c[0], c[1], c[2], \ @@ -62,7 +62,7 @@ def _evalPosition(array, time, F): # Applique la formule XP=d+r*(XN-c) sur des numpys de coordonnees # in place def _moveN(coordsN, d, c, r): - return rigidMotion.moveN(coordsN, + return rigidMotion.moveN(coordsN, (d[0], d[1], d[2]), \ (c[0], c[1], c[2]), \ r[0,0], r[0,1], r[0,2], \ diff --git a/Cassiopee/RigidMotion/doc/source/conf.py b/Cassiopee/RigidMotion/doc/source/conf.py index c150605a9..a008538cc 100644 --- a/Cassiopee/RigidMotion/doc/source/conf.py +++ b/Cassiopee/RigidMotion/doc/source/conf.py @@ -192,15 +192,15 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', -'preamble': r''' + # Additional stuff for the LaTeX preamble. + #'preamble': '', + 'preamble': r''' \usepackage{charter} \usepackage[defaultsans]{lato} \usepackage{inconsolata} @@ -211,8 +211,8 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('RigidMotion', 'RigidMotion.tex', u'RigidMotion Documentation', - u'/ELSA/MU-12016/V'+__version__, 'manual'), + ('RigidMotion', 'RigidMotion.tex', u'RigidMotion Documentation', + u'/ELSA/MU-12016/V'+__version__, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -255,9 +255,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'RigidMotion', u'RigidMotion Documentation', - u'ONERA', 'RigidMotion', 'One line description of project.', - 'Miscellaneous'), + ('index', 'RigidMotion', u'RigidMotion Documentation', + u'ONERA', 'RigidMotion', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/RigidMotion/setup.py b/Cassiopee/RigidMotion/setup.py index da909cf41..59c64ce93 100644 --- a/Cassiopee/RigidMotion/setup.py +++ b/Cassiopee/RigidMotion/setup.py @@ -56,7 +56,7 @@ packages=['RigidMotion'], package_dir={"":"."}, ext_modules=listExtensions - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/RigidMotion/setupLegacy.py b/Cassiopee/RigidMotion/setupLegacy.py index f15ad5289..ebe1c81cc 100644 --- a/Cassiopee/RigidMotion/setupLegacy.py +++ b/Cassiopee/RigidMotion/setupLegacy.py @@ -58,7 +58,7 @@ extra_compile_args=Dist.getCppArgs(), extra_link_args=Dist.getLinkArgs() )] - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/RigidMotion/srcs.py b/Cassiopee/RigidMotion/srcs.py index 41599abce..0f82b6d4b 100644 --- a/Cassiopee/RigidMotion/srcs.py +++ b/Cassiopee/RigidMotion/srcs.py @@ -2,7 +2,7 @@ # Fichiers C++ #============================================================================== cpp_srcs = ["RigidMotion/move.cpp", - "RigidMotion/evalSpeed.cpp", + "RigidMotion/evalSpeed.cpp", "RigidMotion/rotorMotion.cpp", "RigidMotion/copyCoords.cpp"] diff --git a/Cassiopee/RigidMotion/test/evalGridSpeed3PT.py b/Cassiopee/RigidMotion/test/evalGridSpeed3PT.py index 148b50156..1e807ec85 100644 --- a/Cassiopee/RigidMotion/test/evalGridSpeed3PT.py +++ b/Cassiopee/RigidMotion/test/evalGridSpeed3PT.py @@ -1,11 +1,11 @@ -# - evalGridSpeed pour motion 3 (pyTree) - +# - evalGridSpeed pour motion 3 (pyTree) - # Motion defined by a constant rotation and translation speed import RigidMotion.PyTree as R import Converter.PyTree as C import Geom.PyTree as D a = D.sphere((1.2,0.,0.), 0.2, 30) -a = R.setPrescribedMotion3(a, 'mot', transl_speed=(0.2,0,0), +a = R.setPrescribedMotion3(a, 'mot', transl_speed=(0.2,0,0), axis_pnt=(1.,2.,0.), axis_vct=(0.,0.,1.), omega=0.2) diff --git a/Cassiopee/RigidMotion/test/evalGridSpeedPT.py b/Cassiopee/RigidMotion/test/evalGridSpeedPT.py index 4e1e07052..37f4f2121 100644 --- a/Cassiopee/RigidMotion/test/evalGridSpeedPT.py +++ b/Cassiopee/RigidMotion/test/evalGridSpeedPT.py @@ -1,4 +1,4 @@ -# - evalGridSpeed (pyTree) - +# - evalGridSpeed (pyTree) - import RigidMotion.PyTree as R import Converter.PyTree as C import Geom.PyTree as D diff --git a/Cassiopee/RigidMotion/test/evalGridSpeedPT_t2.py b/Cassiopee/RigidMotion/test/evalGridSpeedPT_t2.py index 056044787..f73fef48b 100644 --- a/Cassiopee/RigidMotion/test/evalGridSpeedPT_t2.py +++ b/Cassiopee/RigidMotion/test/evalGridSpeedPT_t2.py @@ -1,4 +1,4 @@ -# - evalPosition (pyTree) - +# - evalPosition (pyTree) - import RigidMotion.PyTree as R import KCore.test as test import Generator.PyTree as G @@ -38,7 +38,7 @@ bet_vct = dictBlade["bet_vct"] bet0 = dictBlade["bet0"] betc = (dictBlade["bet1c"],) -bets = (dictBlade["bet1s"],) +bets = (dictBlade["bet1s"],) tet_pnt = dictBlade["tet_pnt"] tet_vct = dictBlade["tet_vct"] tet0 = dictBlade["tet0"] @@ -68,5 +68,3 @@ R._evalPosition(a, time=0.01) R._evalGridSpeed(a, time=0.01) test.testT(a) - - diff --git a/Cassiopee/RigidMotion/test/evalGridSpeedPT_t3.py b/Cassiopee/RigidMotion/test/evalGridSpeedPT_t3.py index 629543d22..2151b86a7 100644 --- a/Cassiopee/RigidMotion/test/evalGridSpeedPT_t3.py +++ b/Cassiopee/RigidMotion/test/evalGridSpeedPT_t3.py @@ -1,4 +1,4 @@ -# - evalGridSpeed (pyTree) - +# - evalGridSpeed (pyTree) - import RigidMotion.PyTree as R import KCore.test as test def F(a): diff --git a/Cassiopee/RigidMotion/test/evalPosition1PT.py b/Cassiopee/RigidMotion/test/evalPosition1PT.py index 8d492fcf9..282317510 100644 --- a/Cassiopee/RigidMotion/test/evalPosition1PT.py +++ b/Cassiopee/RigidMotion/test/evalPosition1PT.py @@ -1,4 +1,4 @@ -# - evalPosition (pyTree) - +# - evalPosition (pyTree) - import RigidMotion.PyTree as R import Converter.PyTree as C import Geom.PyTree as D diff --git a/Cassiopee/RigidMotion/test/evalPosition2PT.py b/Cassiopee/RigidMotion/test/evalPosition2PT.py index 19838c840..76380f459 100644 --- a/Cassiopee/RigidMotion/test/evalPosition2PT.py +++ b/Cassiopee/RigidMotion/test/evalPosition2PT.py @@ -1,4 +1,4 @@ -# - evalPosition pour motion 2 (pyTree) - +# - evalPosition pour motion 2 (pyTree) - # Rotor motion import RigidMotion.PyTree as R import Converter.PyTree as C @@ -39,7 +39,7 @@ bet_vct = dictBlade["bet_vct"] bet0 = dictBlade["bet0"] betc = (dictBlade["bet1c"],) -bets = (dictBlade["bet1s"],) +bets = (dictBlade["bet1s"],) tet_pnt = dictBlade["tet_pnt"] tet_vct = dictBlade["tet_vct"] tet0 = dictBlade["tet0"] diff --git a/Cassiopee/RigidMotion/test/evalPosition3PT.py b/Cassiopee/RigidMotion/test/evalPosition3PT.py index e84c6bd76..0fce8cb63 100644 --- a/Cassiopee/RigidMotion/test/evalPosition3PT.py +++ b/Cassiopee/RigidMotion/test/evalPosition3PT.py @@ -1,11 +1,11 @@ -# - evalPosition pour motion 3 (pyTree) - +# - evalPosition pour motion 3 (pyTree) - # Motion defined by a constant rotation and translation speed import RigidMotion.PyTree as R import Converter.PyTree as C import Geom.PyTree as D a = D.sphere((1.2,0.,0.), 0.2, 30) -a = R.setPrescribedMotion3(a, 'mot', transl_speed=(0.1,0,0), +a = R.setPrescribedMotion3(a, 'mot', transl_speed=(0.1,0,0), axis_pnt=(1.,2.,0.), axis_vct=(0.,0.,1.), omega=0.2) diff --git a/Cassiopee/RigidMotion/test/evalPosition3PT_t1.py b/Cassiopee/RigidMotion/test/evalPosition3PT_t1.py index e00c26148..e1ba47cb3 100644 --- a/Cassiopee/RigidMotion/test/evalPosition3PT_t1.py +++ b/Cassiopee/RigidMotion/test/evalPosition3PT_t1.py @@ -1,11 +1,11 @@ -# - evalPosition pour motion 3 (pyTree) - +# - evalPosition pour motion 3 (pyTree) - # Motion defined by a constant rotation and translation speed import RigidMotion.PyTree as R import Geom.PyTree as D import KCore.test as test a = D.sphere((1.2,0.,0.), 0.2, 30) -a = R.setPrescribedMotion3(a, 'mot', transl_speed=(0.1,0,0), +a = R.setPrescribedMotion3(a, 'mot', transl_speed=(0.1,0,0), axis_pnt=(1.,2.,0.), axis_vct=(0.,0.,1.), omega=0.2) diff --git a/Cassiopee/RigidMotion/test/evalPositionM12PT.py b/Cassiopee/RigidMotion/test/evalPositionM12PT.py index 6707bef02..179324637 100644 --- a/Cassiopee/RigidMotion/test/evalPositionM12PT.py +++ b/Cassiopee/RigidMotion/test/evalPositionM12PT.py @@ -1,4 +1,4 @@ -# - evalPositionM1 pour motion 2 (pyTree) - +# - evalPositionM1 pour motion 2 (pyTree) - # Rotor motion import RigidMotion.PyTree as R import Converter.PyTree as C @@ -40,7 +40,7 @@ bet_vct = dictBlade["bet_vct"] bet0 = dictBlade["bet0"] betc = (dictBlade["bet1c"],) -bets = (dictBlade["bet1s"],) +bets = (dictBlade["bet1s"],) tet_pnt = dictBlade["tet_pnt"] tet_vct = dictBlade["tet_vct"] tet0 = dictBlade["tet0"] @@ -68,8 +68,8 @@ pre_con_pnt=pre_con_pnt, pre_con_vct=pre_con_vct, pre_con_ang=pre_con_ang) b = R.evalPosition(a, time=time0); b[0]='moved' -coords = [Internal.getNodeFromName(b, 'CoordinateX')[1], - Internal.getNodeFromName(b, 'CoordinateY')[1], +coords = [Internal.getNodeFromName(b, 'CoordinateX')[1], + Internal.getNodeFromName(b, 'CoordinateY')[1], Internal.getNodeFromName(b, 'CoordinateZ')[1]] coords0 = R.evalPositionM1(coords, b, time=time0) c = Internal.copyRef(b); c[0] = 'back' diff --git a/Cassiopee/RigidMotion/test/evalPositionM12PT_t1.py b/Cassiopee/RigidMotion/test/evalPositionM12PT_t1.py index 24b669148..7f356fc48 100644 --- a/Cassiopee/RigidMotion/test/evalPositionM12PT_t1.py +++ b/Cassiopee/RigidMotion/test/evalPositionM12PT_t1.py @@ -1,4 +1,4 @@ -# - evalPositionM1 pour motion 2 (pyTree) - +# - evalPositionM1 pour motion 2 (pyTree) - # Rotor motion import RigidMotion.PyTree as R import Generator.PyTree as G @@ -40,7 +40,7 @@ bet_vct = dictBlade["bet_vct"] bet0 = dictBlade["bet0"] betc = (dictBlade["bet1c"],) -bets = (dictBlade["bet1s"],) +bets = (dictBlade["bet1s"],) tet_pnt = dictBlade["tet_pnt"] tet_vct = dictBlade["tet_vct"] tet0 = dictBlade["tet0"] @@ -68,8 +68,8 @@ pre_con_pnt=pre_con_pnt, pre_con_vct=pre_con_vct, pre_con_ang=pre_con_ang) b = R.evalPosition(a, time=time0); b[0]='moved' -coords = [Internal.getNodeFromName(b, 'CoordinateX')[1], - Internal.getNodeFromName(b, 'CoordinateY')[1], +coords = [Internal.getNodeFromName(b, 'CoordinateX')[1], + Internal.getNodeFromName(b, 'CoordinateY')[1], Internal.getNodeFromName(b, 'CoordinateZ')[1]] coords0 = R.evalPositionM1(coords, b, time=time0) c = Internal.copyRef(b); c[0] = 'back' diff --git a/Cassiopee/RigidMotion/test/evalPositionM13PT.py b/Cassiopee/RigidMotion/test/evalPositionM13PT.py index 6023a10c4..8b0ceacc4 100644 --- a/Cassiopee/RigidMotion/test/evalPositionM13PT.py +++ b/Cassiopee/RigidMotion/test/evalPositionM13PT.py @@ -1,4 +1,4 @@ -# - evalPositionM1 pour motion 3 (pyTree) - +# - evalPositionM1 pour motion 3 (pyTree) - # Motion defined by a constant rotation and translation speed import RigidMotion.PyTree as R import Converter.PyTree as C @@ -6,13 +6,13 @@ import Converter.Internal as Internal a = D.sphere((1.2,0.,0.), 0.2, 30) -a = R.setPrescribedMotion3(a, 'mot', transl_speed=(0.1,0,0), +a = R.setPrescribedMotion3(a, 'mot', transl_speed=(0.1,0,0), axis_pnt=(1.,2.,0.), axis_vct=(0.,0.,1.), omega=0.2) b = R.evalPosition(a, time=1.); b[0]='moved' -coords = [Internal.getNodeFromName(b, 'CoordinateX')[1], - Internal.getNodeFromName(b, 'CoordinateY')[1], +coords = [Internal.getNodeFromName(b, 'CoordinateX')[1], + Internal.getNodeFromName(b, 'CoordinateY')[1], Internal.getNodeFromName(b, 'CoordinateZ')[1]] coords0 = R.evalPositionM1(coords, b, time=1.) c = Internal.copyRef(b); c[0] = 'back' diff --git a/Cassiopee/RigidMotion/test/evalPositionM13PT_t1.py b/Cassiopee/RigidMotion/test/evalPositionM13PT_t1.py index 4e53b38dd..39de464ed 100644 --- a/Cassiopee/RigidMotion/test/evalPositionM13PT_t1.py +++ b/Cassiopee/RigidMotion/test/evalPositionM13PT_t1.py @@ -1,4 +1,4 @@ -# - evalPositionM1 pour motion 3 (pyTree) - +# - evalPositionM1 pour motion 3 (pyTree) - # Motion defined by a constant rotation and translation speed import RigidMotion.PyTree as R import Geom.PyTree as D @@ -6,13 +6,13 @@ import KCore.test as test a = D.sphere((1.2,0.,0.), 0.2, 30) -a = R.setPrescribedMotion3(a, 'mot', transl_speed=(0.1,0,0), +a = R.setPrescribedMotion3(a, 'mot', transl_speed=(0.1,0,0), axis_pnt=(1.,2.,0.), axis_vct=(0.,0.,1.), omega=0.2) b = R.evalPosition(a, time=1.); b[0]='moved' -coords = [Internal.getNodeFromName(b, 'CoordinateX')[1], - Internal.getNodeFromName(b, 'CoordinateY')[1], +coords = [Internal.getNodeFromName(b, 'CoordinateX')[1], + Internal.getNodeFromName(b, 'CoordinateY')[1], Internal.getNodeFromName(b, 'CoordinateZ')[1]] coords0 = R.evalPositionM1(coords, b, time=1.) c = Internal.copyRef(b); c[0] = 'back' diff --git a/Cassiopee/RigidMotion/test/evalPositionPT_t1.py b/Cassiopee/RigidMotion/test/evalPositionPT_t1.py index eaf11674b..ca07e1ee4 100644 --- a/Cassiopee/RigidMotion/test/evalPositionPT_t1.py +++ b/Cassiopee/RigidMotion/test/evalPositionPT_t1.py @@ -1,4 +1,4 @@ -# - evalPosition (pyTree) - +# - evalPosition (pyTree) - import RigidMotion.PyTree as R import KCore.test as test diff --git a/Cassiopee/RigidMotion/test/evalPositionPT_t2.py b/Cassiopee/RigidMotion/test/evalPositionPT_t2.py index f2fedb8e4..f92c4b8f3 100644 --- a/Cassiopee/RigidMotion/test/evalPositionPT_t2.py +++ b/Cassiopee/RigidMotion/test/evalPositionPT_t2.py @@ -1,4 +1,4 @@ -# - evalPosition (pyTree) - +# - evalPosition (pyTree) - import RigidMotion.PyTree as R import KCore.test as test import Generator.PyTree as G @@ -38,7 +38,7 @@ bet_vct = dictBlade["bet_vct"] bet0 = dictBlade["bet0"] betc = (dictBlade["bet1c"],) -bets = (dictBlade["bet1s"],) +bets = (dictBlade["bet1s"],) tet_pnt = dictBlade["tet_pnt"] tet_vct = dictBlade["tet_vct"] tet0 = dictBlade["tet0"] @@ -67,5 +67,3 @@ pre_con_pnt=pre_con_pnt, pre_con_vct=pre_con_vct, pre_con_ang=pre_con_ang) b = R.evalPosition(a, time=0.01) test.testT(b) - - diff --git a/Cassiopee/RigidMotion/test/evalPositionPT_t3.py b/Cassiopee/RigidMotion/test/evalPositionPT_t3.py index 647f004ed..3f195cb5b 100644 --- a/Cassiopee/RigidMotion/test/evalPositionPT_t3.py +++ b/Cassiopee/RigidMotion/test/evalPositionPT_t3.py @@ -1,4 +1,4 @@ -# - evalPosition (pyTree) - +# - evalPosition (pyTree) - import RigidMotion.PyTree as R import KCore.test as test def F(a): diff --git a/Cassiopee/RigidMotion/test/setPrescribedMotion1PT.py b/Cassiopee/RigidMotion/test/setPrescribedMotion1PT.py index 2c6c98211..4097c724f 100644 --- a/Cassiopee/RigidMotion/test/setPrescribedMotion1PT.py +++ b/Cassiopee/RigidMotion/test/setPrescribedMotion1PT.py @@ -1,4 +1,4 @@ -# - setPrescribedMotion1 (pyTree) - +# - setPrescribedMotion1 (pyTree) - # Motion defined by time string import RigidMotion.PyTree as R import Converter.PyTree as C diff --git a/Cassiopee/RigidMotion/test/setPrescribedMotion2PT.py b/Cassiopee/RigidMotion/test/setPrescribedMotion2PT.py index c0b6f2ebe..0f14804c1 100644 --- a/Cassiopee/RigidMotion/test/setPrescribedMotion2PT.py +++ b/Cassiopee/RigidMotion/test/setPrescribedMotion2PT.py @@ -1,4 +1,4 @@ -# - setPrescribedMotion2 (pyTree) - +# - setPrescribedMotion2 (pyTree) - # Motion defined by a rotor motion import RigidMotion.PyTree as R import Converter.PyTree as C @@ -38,7 +38,7 @@ bet_vct = dictBlade["bet_vct"] bet0 = dictBlade["bet0"] betc = (dictBlade["bet1c"],) -bets = (dictBlade["bet1s"],) +bets = (dictBlade["bet1s"],) tet_pnt = dictBlade["tet_pnt"] tet_vct = dictBlade["tet_vct"] tet0 = dictBlade["tet0"] diff --git a/Cassiopee/RigidMotion/test/setPrescribedMotion2PT_t1.py b/Cassiopee/RigidMotion/test/setPrescribedMotion2PT_t1.py index ee5974ac1..785ac1514 100644 --- a/Cassiopee/RigidMotion/test/setPrescribedMotion2PT_t1.py +++ b/Cassiopee/RigidMotion/test/setPrescribedMotion2PT_t1.py @@ -1,4 +1,4 @@ -# - setPrescribedMotion2 (pyTree) - +# - setPrescribedMotion2 (pyTree) - # Motion defined by a rotor motion import RigidMotion.PyTree as R import Generator.PyTree as G @@ -39,7 +39,7 @@ bet_vct = dictBlade["bet_vct"] bet0 = dictBlade["bet0"] betc = (dictBlade["bet1c"],) -bets = (dictBlade["bet1s"],) +bets = (dictBlade["bet1s"],) tet_pnt = dictBlade["tet_pnt"] tet_vct = dictBlade["tet_vct"] tet0 = dictBlade["tet0"] diff --git a/Cassiopee/RigidMotion/test/setPrescribedMotion3PT.py b/Cassiopee/RigidMotion/test/setPrescribedMotion3PT.py index c59d39e3c..ed81ac1d1 100644 --- a/Cassiopee/RigidMotion/test/setPrescribedMotion3PT.py +++ b/Cassiopee/RigidMotion/test/setPrescribedMotion3PT.py @@ -1,4 +1,4 @@ -# - setPrescribedMotion3 (pyTree) - +# - setPrescribedMotion3 (pyTree) - # Motion defined by a constant rotation and translation speed import RigidMotion.PyTree as R import Converter.PyTree as C diff --git a/Cassiopee/RigidMotion/test/setPrescribedMotion3PT_t1.py b/Cassiopee/RigidMotion/test/setPrescribedMotion3PT_t1.py index 40d4ca602..69a4df499 100644 --- a/Cassiopee/RigidMotion/test/setPrescribedMotion3PT_t1.py +++ b/Cassiopee/RigidMotion/test/setPrescribedMotion3PT_t1.py @@ -1,11 +1,11 @@ -# - setPrescribedMotion3 (pyTree) - +# - setPrescribedMotion3 (pyTree) - # Motion defined by a constant rotation and translation speed import RigidMotion.PyTree as R import Geom.PyTree as D import KCore.test as test a = D.sphere((1.2,0.,0.), 0.2, 30) -a = R.setPrescribedMotion3(a, 'mot', transl_speed=(1,0,0), +a = R.setPrescribedMotion3(a, 'mot', transl_speed=(1,0,0), axis_pnt=(1.,2.,0.), axis_vct=(0.,0.,1.), omega=0.2) test.testT(a, 1) diff --git a/Cassiopee/RigidMotion/test/setRotorMotionCoordsAndGridVelPT.py b/Cassiopee/RigidMotion/test/setRotorMotionCoordsAndGridVelPT.py index 8c1d02cbb..2389219a3 100644 --- a/Cassiopee/RigidMotion/test/setRotorMotionCoordsAndGridVelPT.py +++ b/Cassiopee/RigidMotion/test/setRotorMotionCoordsAndGridVelPT.py @@ -1,4 +1,4 @@ -# - evalPositionM1 pour motion 2 (pyTree) - +# - evalPositionM1 pour motion 2 (pyTree) - # Rotor motion import RigidMotion.PyTree as R import Converter.PyTree as C @@ -39,7 +39,7 @@ bet_vct = dictBlade["bet_vct"] bet0 = dictBlade["bet0"] betc = (dictBlade["bet1c"],) -bets = (dictBlade["bet1s"],) +bets = (dictBlade["bet1s"],) tet_pnt = dictBlade["tet_pnt"] tet_vct = dictBlade["tet_vct"] tet0 = dictBlade["tet0"] @@ -66,5 +66,5 @@ pre_lag_pnt=pre_lag_pnt, pre_lag_vct=pre_lag_vct, pre_lag_ang=pre_lag_ang, pre_con_pnt=pre_con_pnt, pre_con_vct=pre_con_vct, pre_con_ang=pre_con_ang) -R._setRotorMotionCoordsAndGridVel(a, time=time0); +R._setRotorMotionCoordsAndGridVel(a, time=time0); C.convertPyTree2File(a,"out.cgns") diff --git a/Cassiopee/RigidMotion/test/setRotorMotionCoordsAndGridVelPT_t1.py b/Cassiopee/RigidMotion/test/setRotorMotionCoordsAndGridVelPT_t1.py index 81816985a..592824e9d 100644 --- a/Cassiopee/RigidMotion/test/setRotorMotionCoordsAndGridVelPT_t1.py +++ b/Cassiopee/RigidMotion/test/setRotorMotionCoordsAndGridVelPT_t1.py @@ -1,4 +1,4 @@ -# - setRotorMotionAndGridVel (pyTree) - +# - setRotorMotionAndGridVel (pyTree) - # Rotor motion import RigidMotion.PyTree as R import Generator.PyTree as G @@ -39,7 +39,7 @@ bet_vct = dictBlade["bet_vct"] bet0 = dictBlade["bet0"] betc = (dictBlade["bet1c"],) -bets = (dictBlade["bet1s"],) +bets = (dictBlade["bet1s"],) tet_pnt = dictBlade["tet_pnt"] tet_vct = dictBlade["tet_vct"] tet0 = dictBlade["tet0"] diff --git a/Cassiopee/Template/setupLegacy.py b/Cassiopee/Template/setupLegacy.py index bf54b4e39..e94a6fa0f 100644 --- a/Cassiopee/Template/setupLegacy.py +++ b/Cassiopee/Template/setupLegacy.py @@ -64,7 +64,7 @@ package_dir={"":"."}, packages=['Template'], ext_modules=listExtensions - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Transform/Transform/PyTree.py b/Cassiopee/Transform/Transform/PyTree.py index 1800933a4..a942ea9e5 100644 --- a/Cassiopee/Transform/Transform/PyTree.py +++ b/Cassiopee/Transform/Transform/PyTree.py @@ -24,7 +24,7 @@ def collapse(a): return C.TZGC1(a, 'nodes', True, Transform.collapse) def _collapse(a): - """Collapse the smallest edge of each element for TRI arrays. Return a BAR.""" + """Collapse the smallest edge of each element for TRI arrays. Return a BAR.""" return C._TZGC1(a, 'nodes', True, Transform.collapse) def cart2Cyl(t, center, axis, depth=0, thetaShift=0): @@ -36,7 +36,7 @@ def _cart2Cyl(t, center, axis, depth=0, thetaShift=0): """Transform a mesh in Cartesian coordinates to cylindrical coordinates.""" for z in Internal.getZones(t): transform._cart2CylZ(z, center, axis, depth, thetaShift, - Internal.__GridCoordinates__, Internal.__FlowSolutionNodes__, Internal.__FlowSolutionCenters__) + Internal.__GridCoordinates__, Internal.__FlowSolutionNodes__, Internal.__FlowSolutionCenters__) return None def cyl2Cart(t, center, axis): @@ -45,7 +45,7 @@ def cyl2Cart(t, center, axis): return C.TZGC1(t, 'nodes', True, Transform.cyl2Cart, center, axis) def _cyl2Cart(t, center, axis): - """Transform a mesh in Cylindrical coordinates to Cartesian coordinates.""" + """Transform a mesh in Cylindrical coordinates to Cartesian coordinates.""" for z in Internal.getZones(t): transform._cyl2CartZ(z, center, axis, Internal.__GridCoordinates__, Internal.__FlowSolutionNodes__, Internal.__FlowSolutionCenters__) return None @@ -106,7 +106,7 @@ def homothety(a, center, alpha): return C.TZGC3(a, 'nodes', False, Transform.homothety, center, alpha) def _homothety(a, center, alpha): - """Make for a mesh defined by an array an homothety of center Xc and of factor alpha.""" + """Make for a mesh defined by an array an homothety of center Xc and of factor alpha.""" return C.__TZGC3(a, Transform._homothety, center, alpha) def contract(a, center, dir1, dir2, alpha): @@ -121,8 +121,8 @@ def _contract(a, center, dir1, dir2, alpha): def scale(a, factor=1., X=None): """Scale a mesh of given factor.""" - if X is None: - try: + if X is None: + try: import Generator.PyTree as G X = G.barycenter(a) except: pass @@ -131,7 +131,7 @@ def scale(a, factor=1., X=None): def _scale(a, factor=1., X=None): """Scale a mesh of given factor.""" if X is None: - try: + try: import Generator.PyTree as G X = G.barycenter(a) except: pass @@ -264,7 +264,7 @@ def join(t, t2=None, tol=1.e-10): if t2 is not None: nodes += Internal.getZones(t2) allBCInfos += C.extractBCInfo(t2) - Internal._orderFlowSolution(nodes, loc='both') + Internal._orderFlowSolution(nodes, loc='both') fieldn = C.getAllFields(nodes, 'nodes') fieldc = [] @@ -493,7 +493,7 @@ def isWindowInSubzone__(w, dim, imin, imax, jmin, jmax, kmin, kmax, if ((i1 == i2 and i1 == 1 and imin > 1) or \ (i1 == i2 and i1 == ni0 and imax < ni0) or \ (j1 == j2 and j1 == 1 and jmin > 1) or \ - (j1 == j2 and j1 == nj0 and jmax < nj0)): + (j1 == j2 and j1 == nj0 and jmax < nj0)): isout = 1 else: if ((i1 == i2 and i1 == 1 and imin > 1) or \ @@ -501,7 +501,7 @@ def isWindowInSubzone__(w, dim, imin, imax, jmin, jmax, kmin, kmax, (j1 == j2 and j1 == 1 and jmin > 1) or \ (j1 == j2 and j1 == nj0 and jmax < nj0) or \ (k1 == k2 and k1 == 1 and kmin > 1) or \ - (k1 == k2 and k1 == nk0 and kmax < nk0)): + (k1 == k2 and k1 == nk0 and kmax < nk0)): isout = 1 if imax < i1 or imin > i2 or jmax < j1 or jmin > j2 or kmax < k1 or kmin > k2: isout = 1 @@ -862,7 +862,7 @@ def _replaceZoneWithSplit(t, zname, z1, z2): p,c = Internal.getParentOfNode(t, z) p[2][c] = z1 if len(z2) == 4 and z2[3] == 'Zone_t': p[2].append(z2) - else: p[2] += z2 + else: p[2] += z2 return None def getWinSize(w): @@ -878,10 +878,10 @@ def getWinDir(w): dim = 3 if oi1 != oi2 and ok1 == 1 and ok2 == 1: dim = 2 if oj1 != oj2 and ok1 == 1 and ok2 == 1: dim = 2 - if dim == 2: + if dim == 2: if oi1 == oi2: return 1 else: return 2 - if dim == 3: + if dim == 3: if oi1 == oi2: return 1 elif oj1 == oj2: return 2 else: return 3 @@ -900,8 +900,8 @@ def getCutDir(winz1, winz2): # Retourne true si wins1 correspond a une sous fenetre de win def isWinCut(wins1, win): if wins1[0] == win[0] and wins1[1] == win[1] and \ - wins1[2] == win[2] and wins1[3] == win[3] and \ - wins1[4] == win[4] and wins1[5] == win[5]: + wins1[2] == win[2] and wins1[3] == win[3] and \ + wins1[4] == win[4] and wins1[5] == win[5]: return False else: return True @@ -909,7 +909,7 @@ def isWinCut(wins1, win): def _adaptBCMatch(z, z1, z2, winz1, winz2, t=None): bcs = getBCMatchs__(z) for b in bcs: - (oppBlock, winz, winDonor, trirac, periodic) = getBCMatchData__(b) + (oppBlock, winz, winDonor, trirac, periodic) = getBCMatchData__(b) triracopp = triracopp__(trirac) if oppBlock == z[0]: # self attached BCMatch @@ -935,7 +935,7 @@ def _adaptBCMatch(z, z1, z2, winz1, winz2, t=None): ind0 = donorIndex__(winz,winDonor,trirac,(wini1[0],wini1[2],wini1[4])) ind1 = donorIndex__(winz,winDonor,trirac,(wini1[1],wini1[3],wini1[5])) winopp = [min(ind0[0],ind1[0]),max(ind0[0],ind1[0]), - min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] + min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] #print('correspond au donneur ',winopp) # DBX @@ -949,12 +949,12 @@ def _adaptBCMatch(z, z1, z2, winz1, winz2, t=None): if winopp1 is not None and winopp2 is None: if periodic is None: C._addBC2Zone(z1, 'match', 'BCMatch', wini, z1, winopp1, trirac) - else: C._addBC2Zone(z1, 'match', 'BCMatch', wini, z1, winopp1, trirac, + else: C._addBC2Zone(z1, 'match', 'BCMatch', wini, z1, winopp1, trirac, rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) elif winopp2 is not None and winopp1 is None: if periodic is None: C._addBC2Zone(z1, 'match', 'BCMatch', wini, z2, winopp2, trirac) - else: C._addBC2Zone(z1, 'match', 'BCMatch', wini, z2, winopp2, trirac, + else: C._addBC2Zone(z1, 'match', 'BCMatch', wini, z2, winopp2, trirac, rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) else: # c'est le bazar, winopp1z sur z, winstart1 sur z @@ -964,35 +964,35 @@ def _adaptBCMatch(z, z1, z2, winz1, winz2, t=None): ind0 = donorIndex__(winDonor,winz,triracoppn,(winopp1z[0],winopp1z[2],winopp1z[4])) ind1 = donorIndex__(winDonor,winz,triracoppn,(winopp1z[1],winopp1z[3],winopp1z[5])) winstart1 = [min(ind0[0],ind1[0]),max(ind0[0],ind1[0]), - min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] + min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] winstarti1 = intersectWins__(winz1, winstart1, ret=1) winstarti2 = intersectWins__(winz2, winstart1, ret=1) if winstarti1 is not None: if periodic is None: C._addBC2Zone(z1, 'match', 'BCMatch', winstarti1, z1, winopp1, trirac) - else: C._addBC2Zone(z1, 'match', 'BCMatch', winstarti1, z1, winopp1, trirac, - rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) + else: C._addBC2Zone(z1, 'match', 'BCMatch', winstarti1, z1, winopp1, trirac, + rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) if winstarti2 is not None: if periodic is None: C._addBC2Zone(z2, 'match', 'BCMatch', winstarti2, z1, winopp1, trirac) - else: C._addBC2Zone(z2, 'match', 'BCMatch', winstarti2, z1, winopp1, trirac, - rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) + else: C._addBC2Zone(z2, 'match', 'BCMatch', winstarti2, z1, winopp1, trirac, + rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) winopp2z = intersectWins__(winz2, winopp, ret=0) # choper la fenetre inverse de winopp2z ind0 = donorIndex__(winDonor,winz,triracoppn,(winopp2z[0],winopp2z[2],winopp2z[4])) ind1 = donorIndex__(winDonor,winz,triracoppn,(winopp2z[1],winopp2z[3],winopp2z[5])) winstart2 = [min(ind0[0],ind1[0]),max(ind0[0],ind1[0]), - min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] + min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] winstarti1 = intersectWins__(winz1, winstart2, ret=1) winstarti2 = intersectWins__(winz2, winstart2, ret=1) if winstarti1 is not None: if periodic is None: C._addBC2Zone(z1, 'match', 'BCMatch', winstarti1, z2, winopp2, trirac) - else: C._addBC2Zone(z1, 'match', 'BCMatch', winstarti1, z2, winopp2, trirac, - rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) + else: C._addBC2Zone(z1, 'match', 'BCMatch', winstarti1, z2, winopp2, trirac, + rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) if winstarti2 is not None: if periodic is None: C._addBC2Zone(z2, 'match', 'BCMatch', winstarti2, z2, winopp2, trirac) - else: C._addBC2Zone(z2, 'match', 'BCMatch', winstarti2, z2, winopp2, trirac, - rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) + else: C._addBC2Zone(z2, 'match', 'BCMatch', winstarti2, z2, winopp2, trirac, + rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) #if wini is not None: @@ -1000,20 +1000,20 @@ def _adaptBCMatch(z, z1, z2, winz1, winz2, t=None): # oppBlock = z2[0] # winopp = windonor2 # if periodic is None: C._addBC2Zone(z1, 'match', 'BCMatch', wini, oppBlock, winopp, trirac) - # else: C._addBC2Zone(z1, 'match', 'BCMatch', wini, oppBlock, winopp, trirac, + # else: C._addBC2Zone(z1, 'match', 'BCMatch', wini, oppBlock, winopp, trirac, # rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) # elif wins2 is None and wins1 is not None: # oppBlock = z1[0] # winopp = windonor1 # if periodic is None: C._addBC2Zone(z1, 'match', 'BCMatch', wini, oppBlock, winopp, trirac) - # else: C._addBC2Zone(z1, 'match', 'BCMatch', wini, oppBlock, winopp, trirac, + # else: C._addBC2Zone(z1, 'match', 'BCMatch', wini, oppBlock, winopp, trirac, # rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) # else: # il y en a deux a creer # if periodic is None: C._addBC2Zone(z1, 'match', 'BCMatch', wini, z1[0], windonor1, trirac) - # else: C._addBC2Zone(z1, 'match', 'BCMatch', wini, z1[0], windonor1, trirac, + # else: C._addBC2Zone(z1, 'match', 'BCMatch', wini, z1[0], windonor1, trirac, # rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) # if periodic is None: C._addBC2Zone(z1, 'match', 'BCMatch', wini, z2[0], windonor2, trirac) - # else: C._addBC2Zone(z1, 'match', 'BCMatch', wini, z2[0], windonor2, trirac, + # else: C._addBC2Zone(z1, 'match', 'BCMatch', wini, z2[0], windonor2, trirac, # rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) @@ -1036,7 +1036,7 @@ def _adaptBCMatch(z, z1, z2, winz1, winz2, t=None): ind0 = donorIndex__(winz,winDonor,trirac,(wini1[0],wini1[2],wini1[4])) ind1 = donorIndex__(winz,winDonor,trirac,(wini1[1],wini1[3],wini1[5])) winopp = [min(ind0[0],ind1[0]),max(ind0[0],ind1[0]), - min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] + min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] #print('correspond au donneur ',winopp) # DBX @@ -1050,12 +1050,12 @@ def _adaptBCMatch(z, z1, z2, winz1, winz2, t=None): if winopp1 is not None and winopp2 is None: if periodic is None: C._addBC2Zone(z2, 'match', 'BCMatch', wini, z1, winopp1, trirac) - else: C._addBC2Zone(z2, 'match', 'BCMatch', wini, z1, winopp1, trirac, + else: C._addBC2Zone(z2, 'match', 'BCMatch', wini, z1, winopp1, trirac, rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) elif winopp2 is not None and winopp1 is None: if periodic is None: C._addBC2Zone(z2, 'match', 'BCMatch', wini, z2, winopp2, trirac) - else: C._addBC2Zone(z2, 'match', 'BCMatch', wini, z2, winopp2, trirac, + else: C._addBC2Zone(z2, 'match', 'BCMatch', wini, z2, winopp2, trirac, rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) else: # c'est le bazar, winopp1z sur z, winstart1 sur z @@ -1065,7 +1065,7 @@ def _adaptBCMatch(z, z1, z2, winz1, winz2, t=None): ind0 = donorIndex__(winDonor,winz,triracoppn,(winopp1z[0],winopp1z[2],winopp1z[4])) ind1 = donorIndex__(winDonor,winz,triracoppn,(winopp1z[1],winopp1z[3],winopp1z[5])) winstart1 = [min(ind0[0],ind1[0]),max(ind0[0],ind1[0]), - min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] + min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] # DBX #winstarti1 = intersectWins__(winz1, winstart1, ret=0) @@ -1077,19 +1077,19 @@ def _adaptBCMatch(z, z1, z2, winz1, winz2, t=None): winstarti2 = intersectWins__(winz2, winstart1, ret=1) if winstarti1 is not None: if periodic is None: C._addBC2Zone(z1, 'match', 'BCMatch', winstarti1, z1, winopp1, trirac) - else: C._addBC2Zone(z1, 'match', 'BCMatch', winstarti1, z1, winopp1, trirac, - rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) + else: C._addBC2Zone(z1, 'match', 'BCMatch', winstarti1, z1, winopp1, trirac, + rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) if winstarti2 is not None: if periodic is None: C._addBC2Zone(z2, 'match', 'BCMatch', winstarti2, z1, winopp1, trirac) - else: C._addBC2Zone(z2, 'match', 'BCMatch', winstarti2, z1, winopp1, trirac, - rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) + else: C._addBC2Zone(z2, 'match', 'BCMatch', winstarti2, z1, winopp1, trirac, + rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) winopp2z = intersectWins__(winz2, winopp, ret=0) # choper la fenetre inverse de winopp2z ind0 = donorIndex__(winDonor,winz,triracoppn,(winopp2z[0],winopp2z[2],winopp2z[4])) ind1 = donorIndex__(winDonor,winz,triracoppn,(winopp2z[1],winopp2z[3],winopp2z[5])) winstart2 = [min(ind0[0],ind1[0]),max(ind0[0],ind1[0]), - min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] + min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] # DBX #winstarti1 = intersectWins__(winz1, winstart2, ret=0) @@ -1102,11 +1102,11 @@ def _adaptBCMatch(z, z1, z2, winz1, winz2, t=None): if winstarti1 is not None: if periodic is None: C._addBC2Zone(z1, 'match', 'BCMatch', winstarti1, z2, winopp2, trirac) - else: C._addBC2Zone(z1, 'match', 'BCMatch', winstarti1, z2, winopp2, trirac, + else: C._addBC2Zone(z1, 'match', 'BCMatch', winstarti1, z2, winopp2, trirac, rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) if winstarti2 is not None: if periodic is None: C._addBC2Zone(z2, 'match', 'BCMatch', winstarti2, z2, winopp2, trirac) - else: C._addBC2Zone(z2, 'match', 'BCMatch', winstarti2, z2, winopp2, trirac, + else: C._addBC2Zone(z2, 'match', 'BCMatch', winstarti2, z2, winopp2, trirac, rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) @@ -1114,20 +1114,20 @@ def _adaptBCMatch(z, z1, z2, winz1, winz2, t=None): # oppBlock = z2[0] # winopp = windonor2 # if periodic is None: C._addBC2Zone(z2, 'match', 'BCMatch', wini, oppBlock, winopp, trirac) - # else: C._addBC2Zone(z2, 'match', 'BCMatch', wini, oppBlock, winopp, trirac, + # else: C._addBC2Zone(z2, 'match', 'BCMatch', wini, oppBlock, winopp, trirac, # rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) # elif wins2 is None and wins1 is not None: # oppBlock = z1[0] # winopp = windonor1 # if periodic is None: C._addBC2Zone(z2, 'match', 'BCMatch', wini, oppBlock, winopp, trirac) - # else: C._addBC2Zone(z2, 'match', 'BCMatch', wini, oppBlock, winopp, trirac, + # else: C._addBC2Zone(z2, 'match', 'BCMatch', wini, oppBlock, winopp, trirac, # rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) # else: # if periodic is None: C._addBC2Zone(z2, 'match', 'BCMatch', wini, z1[0], windonor1, trirac) - # else: C._addBC2Zone(z2, 'match', 'BCMatch', wini, z1[0], windonor1, trirac, + # else: C._addBC2Zone(z2, 'match', 'BCMatch', wini, z1[0], windonor1, trirac, # rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) # if periodic is None: C._addBC2Zone(z2, 'match', 'BCMatch', wini, z2[0], windonor2, trirac) - # else: C._addBC2Zone(z2, 'match', 'BCMatch', wini, z2[0], windonor2, trirac, + # else: C._addBC2Zone(z2, 'match', 'BCMatch', wini, z2[0], windonor2, trirac, # rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) # DBX @@ -1148,10 +1148,10 @@ def _adaptBCMatch(z, z1, z2, winz1, winz2, t=None): ind0 = donorIndex__(winz,winDonor,trirac,(wini1[0],wini1[2],wini1[4])) ind1 = donorIndex__(winz,winDonor,trirac,(wini1[1],wini1[3],wini1[5])) winopp = [min(ind0[0],ind1[0]),max(ind0[0],ind1[0]), - min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] + min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] if periodic is None: C._addBC2Zone(z1, 'match', 'BCMatch', wini, oppBlock, winopp, trirac) - else: C._addBC2Zone(z1, 'match', 'BCMatch', wini, oppBlock, winopp, trirac, + else: C._addBC2Zone(z1, 'match', 'BCMatch', wini, oppBlock, winopp, trirac, rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) if t is not None: zopp = Internal.getNodeFromName2(t, oppBlock) @@ -1175,13 +1175,13 @@ def _adaptBCMatch(z, z1, z2, winz1, winz2, t=None): ind0 = donorIndex__(winz,winDonor,trirac,(wini1[0],wini1[2],wini1[4])) ind1 = donorIndex__(winz,winDonor,trirac,(wini1[1],wini1[3],wini1[5])) winopp = [min(ind0[0],ind1[0]),max(ind0[0],ind1[0]), - min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] + min(ind0[1],ind1[1]),max(ind0[1],ind1[1]),min(ind0[2],ind1[2]),max(ind0[2],ind1[2])] if periodic is None: C._addBC2Zone(z2, 'match', 'BCMatch', wini, oppBlock, winopp, trirac) else: C._addBC2Zone(z2, 'match', 'BCMatch', wini, oppBlock, winopp, trirac, rotationCenter=periodic[1], rotationAngle=periodic[2], translation=periodic[0]) if t is not None: zopp = Internal.getNodeFromName2(t, oppBlock) - if zopp is not None: + if zopp is not None: if periodic is None: C._addBC2Zone(zopp, 'match', 'BCMatch', winopp, z2[0], wini, triracopp) else: C._addBC2Zone(zopp, 'match', 'BCMatch', winopp, z2[0], wini, triracopp, rotationCenter=periodic[1], rotationAngle=-1.*periodic[2], translation=-1.*periodic[0]) @@ -1984,7 +1984,7 @@ def projectOrtho(t1, t2): return t def _projectOrtho(t1, t2): # t1 is modified - """Project a surface t1 onto surface t2 orthogonally.""" + """Project a surface t1 onto surface t2 orthogonally.""" zones = Internal.getZones(t1) a1 = C.getFields(Internal.__GridCoordinates__, zones) a2 = C.getFields(Internal.__GridCoordinates__, t2) @@ -2208,7 +2208,7 @@ def _splitSizeUpR__(t, N, R, multigrid, dirs, minPtsPerDir, topTree): nc = int(round(Nr*1./nij,0))+1 ns = Transform.findMGSplitUp__(nk, nc, level=multigrid) if ns-1 >= mins and nk-ns >= mins: - a1, a2 = split(a, 3, ns, topTree) + a1, a2 = split(a, 3, ns, topTree) SP[0] = (getNCells(a2), a2, base) Rs[0] += getNCells(a1) procs[0][1].append(a1[0]) @@ -2224,7 +2224,7 @@ def _splitSizeUpR__(t, N, R, multigrid, dirs, minPtsPerDir, topTree): procs[0][0] = Rs[0] # Affectation des procs - try: + try: import Distributor2.PyTree as D2 for np, p in enumerate(procs): for zname in p[1]: @@ -2639,7 +2639,7 @@ def _splitSize(t, N=0, multigrid=0, dirs=[1,2,3], type=0, R=None, while len(stack)>0: z = stack.pop() _splitSizeUp__(z, N, multigrid, dirs, topTree, stack) - elif type == 2: + elif type == 2: _splitSizeUpR__(t, N, R, multigrid, dirs, minPtsPerDir, topTree) return None diff --git a/Cassiopee/Transform/Transform/Stick.py b/Cassiopee/Transform/Transform/Stick.py index 261a19fe2..c978725e1 100644 --- a/Cassiopee/Transform/Transform/Stick.py +++ b/Cassiopee/Transform/Transform/Stick.py @@ -1,7 +1,7 @@ # Stick import Converter.PyTree as C import Ael.Quantum as KDG -import Converter.Internal as Internal +import Converter.Internal as Internal import Transform.PyTree as T import numpy @@ -11,7 +11,7 @@ # IN: tp: surface projection tree # Done to stick blade meshes on hubs # Projection can introduce artifacts -# modifies t +# modifies t #======================================================================================= def _stick(t, tp, stickBCName='FamilySpecified:stick', nitSmooth=0): diff --git a/Cassiopee/Transform/Transform/Transform.py b/Cassiopee/Transform/Transform/Transform.py index ac791bb87..b2f4e5018 100644 --- a/Cassiopee/Transform/Transform/Transform.py +++ b/Cassiopee/Transform/Transform/Transform.py @@ -2,11 +2,11 @@ """ __version__ = '4.0' __author__ = "Stephanie Peron, Christophe Benoit, Gaelle Jeanfaivre, Pascal Raud" -# +# # Python Interface to make basic transformations on arrays # from . import transform -try: import Converter +try: import Converter except: raise ImportError("Transform: requires Converter module.") from Converter.Internal import E_NpyInt import numpy @@ -14,22 +14,22 @@ try: range = xrange except: pass -__all__ = ['_translate', 'translate', 'addkplane', 'breakElements', 'cart2Cyl', '_cart2Cyl', 'collapse', - 'computeDeformationVector', '_contract', 'contract', 'cyl2Cart', '_cyl2Cart', 'deform', 'deformNormals', 'deformPoint', - 'dual', '_homothety', 'homothety', 'join', 'makeCartesianXYZ', 'makeDirect', 'merge', 'mergeCart', - 'mergeCartByRefinementLevel', 'oneovern', 'patch', 'perturbate', 'projectAllDirs', 'projectDir', - 'projectOrtho', 'projectOrthoSmooth', 'projectRay', 'reorder', 'reorderAll', - 'rotate', '_rotate', '_scale', 'scale', - 'smooth', 'splitBAR', 'splitConnexity', 'splitCurvatureAngle', 'splitCurvatureRadius', 'splitManifold', - 'splitMultiplePts', 'splitNParts', 'splitSharpEdges', 'splitSize', 'splitTBranches', - 'splitTRI', 'subzone', '_symetrize', 'symetrize', 'deformMesh', 'kround', 'smoothField', '_smoothField', - 'alignVectorFieldWithRadialCylindricProjection', '_alignVectorFieldWithRadialCylindricProjection'] +__all__ = ['_translate', 'translate', 'addkplane', 'breakElements', 'cart2Cyl', '_cart2Cyl', 'collapse', + 'computeDeformationVector', '_contract', 'contract', 'cyl2Cart', '_cyl2Cart', 'deform', 'deformNormals', 'deformPoint', + 'dual', '_homothety', 'homothety', 'join', 'makeCartesianXYZ', 'makeDirect', 'merge', 'mergeCart', + 'mergeCartByRefinementLevel', 'oneovern', 'patch', 'perturbate', 'projectAllDirs', 'projectDir', + 'projectOrtho', 'projectOrthoSmooth', 'projectRay', 'reorder', 'reorderAll', + 'rotate', '_rotate', '_scale', 'scale', + 'smooth', 'splitBAR', 'splitConnexity', 'splitCurvatureAngle', 'splitCurvatureRadius', 'splitManifold', + 'splitMultiplePts', 'splitNParts', 'splitSharpEdges', 'splitSize', 'splitTBranches', + 'splitTRI', 'subzone', '_symetrize', 'symetrize', 'deformMesh', 'kround', 'smoothField', '_smoothField', + 'alignVectorFieldWithRadialCylindricProjection', '_alignVectorFieldWithRadialCylindricProjection'] #======================================================================================== # Merge a set of cart grids in A for each refinement level #======================================================================================== def mergeCartByRefinementLevel(A, sizeMax): - dhmin = 1.e10 + dhmin = 1.e10 allDh = [] for a in A: xt = a[1][0,:] @@ -45,7 +45,7 @@ def mergeCartByRefinementLevel(A, sizeMax): found = 0 for noc in range(nzones): dh = allDh[noc] - if dh < 1.2*dhmin and dh > 0.8*dhmin: + if dh < 1.2*dhmin and dh > 0.8*dhmin: if level in levels: levels[level].append(noc) else: @@ -55,7 +55,7 @@ def mergeCartByRefinementLevel(A, sizeMax): print('Level %d: merging %d zones over %d (Total: %d).'%(level,found,nzones,count)) if found > 0: res = [] - for i in levels[level]: res.append(A[i]) + for i in levels[level]: res.append(A[i]) res = mergeCart(res, sizeMax) out += res if count == nzones: ok = 1 @@ -112,7 +112,7 @@ def merge(A, Ac=[], sizeMax=1000000000, dir=0, tol=1.e-10, alphaRef=180.): if len(STRUCTc) == 0: ret += r else: ret += r[0]; retc += r[1] if len(BARs) > 0: - if len(BARc) > 0: + if len(BARc) > 0: r = join(BARs, arrayc=BARc, tol=tol) ret += [r[0]]; retc += [r[1]] else: ret += [join(BARs, tol=tol)] @@ -184,7 +184,7 @@ def _cyl2Cart(a, center=(0,0,0), axis=(0,0,1)): def collapse(a): """Collapse the smallest edge of each element for TRI arrays. Return a BAR. Usage: collapse(a)""" - if isinstance(a[0], list): + if isinstance(a[0], list): b = [] for i in a: b.append(transform.collapse(i)) @@ -237,7 +237,7 @@ def homothety(a, center, alpha): return b def _homothety(a, center, alpha): - if isinstance(a[0], list): + if isinstance(a[0], list): for i in a: transform.homothety(i, center, alpha) else: @@ -254,7 +254,7 @@ def contract(a, center, dir1, dir2, alpha): def _contract(a, center, dir1, dir2, alpha): """Contract a mesh around a plane defined by (center, dir1, dir2) and of factor alpha. Usage: contract(a, (xc,yc,zc), dir1, dir2, alpha)""" - if isinstance(a[0], list): + if isinstance(a[0], list): for i in a: transform.contract(i, center, dir1, dir2, alpha) else: @@ -331,7 +331,7 @@ def _smoothField(a, eps=0.1, niter=1, type=0, varNames=[]): else: transform._smoothField(a, epsv, epsf, niter, type, varNames) return None -def smooth(a, eps=0.5, niter=4, type=0, fixedConstraints=[], +def smooth(a, eps=0.5, niter=4, type=0, fixedConstraints=[], projConstraints=[], delta=1., point=(0,0,0), radius=-1.): """Smooth a mesh with a Laplacian. Usage: smooth(a, eps, niter, type, fixedConstraints, projConstraints, delta, (xR,yR,zR), radius)""" @@ -356,7 +356,7 @@ def smooth(a, eps=0.5, niter=4, type=0, fixedConstraints=[], else: if isinstance(projConstraints[0], list): projConstraint = join(projConstraints) - else: projConstraint = projConstraints + else: projConstraint = projConstraints else: projConstraint = [] listeType = -1 @@ -369,10 +369,10 @@ def smooth(a, eps=0.5, niter=4, type=0, fixedConstraints=[], if len(i) == 5 and listeType != 1: raise TypeError("smooth: list of zones must be all structured or all unstructured.") - if listeType == 1: # all struct + if listeType == 1: # all struct b = Converter.convertArray2Hexa(a); b = join(b); b = G.close(b) listOfIndices = KCore.indiceStruct2Unstr2(a, b, 1.e-14) - c = transform.smooth(b, eps, niter, type, + c = transform.smooth(b, eps, niter, type, fixedConstraint, projConstraint, delta, point, radius) listOfCoords = [] @@ -386,26 +386,26 @@ def smooth(a, eps=0.5, niter=4, type=0, fixedConstraints=[], else: # all unstruct coords = [] for i in a: - coords.append(transform.smooth(i, eps, niter, type, + coords.append(transform.smooth(i, eps, niter, type, fixedConstraint, projConstraint, delta, point, radius)) return coords - elif len(a) == 5: # array structure + elif len(a) == 5: # array structure b = Converter.convertArray2Hexa(a); b = G.close(b) - c = transform.smooth(b, eps, niter, type, fixedConstraint, + c = transform.smooth(b, eps, niter, type, fixedConstraint, projConstraint, delta, point, radius) listOfIndices = [] listOfIndices = KCore.indiceStruct2Unstr2([a], b, 1.e-14) coords = Converter.copy(a) - c = transform.smooth(b, eps, niter, type, fixedConstraint, + c = transform.smooth(b, eps, niter, type, fixedConstraint, projConstraint, delta, point, radius) ninjnk = coords[2]*coords[3]*coords[4] indicesU = listOfIndices[0] coords[1][0:3,:] = c[1][0:3,indicesU[:]] return coords else: # array non structure - return transform.smooth(a, eps, niter, type, fixedConstraint, + return transform.smooth(a, eps, niter, type, fixedConstraint, projConstraint, delta, point, radius) def projectAllDirs(arrays, surfaces, vect=['nx','ny','nz'], oriented=0): @@ -413,18 +413,18 @@ def projectAllDirs(arrays, surfaces, vect=['nx','ny','nz'], oriented=0): Usage: projectAllDirs(arrays,surfaces,vect,oriented) """ try: - b = Converter.convertArray2Tetra(surfaces) + b = Converter.convertArray2Tetra(surfaces) except: b = surfaces if not isinstance(arrays[0], list): - return transform.projectAllDirs([arrays], b, vect, oriented)[0] - else: + return transform.projectAllDirs([arrays], b, vect, oriented)[0] + else: return transform.projectAllDirs(arrays, b, vect, oriented) def projectDir(surfaces, arrays, dir, smooth=0, oriented=0): """Project surfaces onto surface arrays following dir. Usage: projectDir(surfaces, arrays, dir)""" try: - b = Converter.convertArray2Tetra(arrays) + b = Converter.convertArray2Tetra(arrays) if isinstance(b[0], list): b = join(b) except: b = arrays[0] if isinstance(surfaces[0], list): @@ -511,14 +511,14 @@ def _alignVectorFieldWithRadialCylindricProjection(a, axisPassingPoint, axisDire def deform(a, vector=['dx','dy','dz']): """Deform surface by moving surface of the vector dx, dy, dz. - Usage: deform(a, vector)""" + Usage: deform(a, vector)""" if len(vector) != 3 or not isinstance(vector[1],str): a = Converter.addVars([a,vector]) if isinstance(vector[0], list): vector = vector[0][0].split(',') else: vector = vector[0].split(',') else : - if len(vector) != 3: + if len(vector) != 3: raise ValueError("deform: 3 variables are required.") if isinstance(a[0], list): @@ -531,8 +531,8 @@ def deformNormals(array, alpha, niter=1): """Deform a a surface of alpha times the surface normals. Usage: deformNormals(array, alpha, niter)""" try: import Generator as G - except: raise ImportError("deformNormals: requires Generator module.") - if isinstance(array[0], list) and isinstance(alpha[0], list): + except: raise ImportError("deformNormals: requires Generator module.") + if isinstance(array[0], list) and isinstance(alpha[0], list): if len(array) != len(alpha): raise ValueError("deformNormals: number of arrays in a and alpha must be equal.") b = []; noi = 0 for i in array: @@ -560,7 +560,7 @@ def deformNormals(array, alpha, niter=1): n[1][:,:] = n[1][:,:]*alp[:] aloc = Converter.addVars([aloc,n]) aloc = deform(aloc,['sx','sy','sz']) - aloc = Converter.rmVars(aloc,['sx','sy','sz']) + aloc = Converter.rmVars(aloc,['sx','sy','sz']) return aloc else: raise ValueError("deformNormals: array and alpha must be both an array or a list of arrays.") @@ -581,7 +581,7 @@ def deformMesh(a, surfDelta, beta=4., type='nearest'): """Deform a mesh wrt surfDelta defining surface grids and deformation vector on it. Usage: deformMesh(a, surfDelta, beta, type)""" if not isinstance(a[0], list): - if len(a) == 5: + if len(a) == 5: if type == 'nearest': return deformMeshStruct1__(a, surfDelta, beta) elif type == 'gridline': return deformMeshStruct2__(a, surfDelta, beta) else: raise TypeError("deformMesh: type is invalid.") @@ -589,7 +589,7 @@ def deformMesh(a, surfDelta, beta=4., type='nearest'): else: out = [] for i in a: - if len(i) == 5: + if len(i) == 5: if type == 'nearest': out.append(deformMeshStruct1__(i, surfDelta, beta)) elif type =='gridline': out.append(deformMeshStruct2__(i, surfDelta, beta)) else: raise TypeError("deformMesh: type is invalid.") @@ -610,15 +610,15 @@ def deformMeshStruct1__(arrayi, surfDelta, beta): dim = 3 if ni == 1 or nj == 1 or nk == 1: dim = 2 if dim == 3: - m1 = subzone(array, (1,1,1),(1,nj,nk)); m1[2] = nj; m1[3] = nk; m1[4] = 1 - m2 = subzone(array,(ni,1,1),(ni,nj,nk)); m2[2] = nj; m2[3] = nk; m2[4] = 1 - m3 = subzone(array, (1,1,1),(ni,1,nk)); m3[3] = nk; m3[4] = 1 - m4 = subzone(array,(1,nj,1),(ni,nj,nk)); m4[3] = nk; m4[4] = 1 + m1 = subzone(array, (1,1,1),(1,nj,nk)); m1[2] = nj; m1[3] = nk; m1[4] = 1 + m2 = subzone(array,(ni,1,1),(ni,nj,nk)); m2[2] = nj; m2[3] = nk; m2[4] = 1 + m3 = subzone(array, (1,1,1),(ni,1,nk)); m3[3] = nk; m3[4] = 1 + m4 = subzone(array,(1,nj,1),(ni,nj,nk)); m4[3] = nk; m4[4] = 1 m5 = subzone(array,(1,1,1),(ni,nj,1)) m6 = subzone(array,(1,1,nk),(ni,nj,nk)) borders = [m1,m2,m3,m4,m5,m6] else: - m1 = subzone(array, (1,1,1),(1,nj,nk)); m1[2] = nj; m1[3] = 1 + m1 = subzone(array, (1,1,1),(1,nj,nk)); m1[2] = nj; m1[3] = 1 m2 = subzone(array,(ni,1,1),(ni,nj,nk)); m2[2] = nj; m2[3] = 1 m3 = subzone(array, (1,1,1),(ni,1,nk)) m4 = subzone(array,(1,nj,1),(ni,nj,nk)) @@ -627,7 +627,7 @@ def deformMeshStruct1__(arrayi, surfDelta, beta): borders = Converter.addVars([borders,res]) delta = G.TFI(borders) delta = Converter.extractVars(delta, ['dx','dy','dz']) - dim = delta[1].shape[0] + dim = delta[1].shape[0] array[1][:dim,:] += delta[1][:dim,:] return array @@ -649,15 +649,15 @@ def deformMeshStruct2__(arrayi, surfDelta, beta): dim = 3 if ni == 1 or nj == 1 or nk == 1: dim = 2 if dim == 3: - m1 = subzone(res,(1,1,1),(1,nj,nk)); m1[2]=nj; m1[3]=nk; m1[4]=1 - m2 = subzone(res,(ni,1,1),(ni,nj,nk)); m2[2]=nj; m2[3]=nk; m2[4]=1 - m3 = subzone(res,(1,1,1),(ni,1,nk)); m3[3]=nk; m3[4]=1 - m4 = subzone(res,(1,nj,1),(ni,nj,nk)); m4[3]=nk; m4[4]=1 + m1 = subzone(res,(1,1,1),(1,nj,nk)); m1[2]=nj; m1[3]=nk; m1[4]=1 + m2 = subzone(res,(ni,1,1),(ni,nj,nk)); m2[2]=nj; m2[3]=nk; m2[4]=1 + m3 = subzone(res,(1,1,1),(ni,1,nk)); m3[3]=nk; m3[4]=1 + m4 = subzone(res,(1,nj,1),(ni,nj,nk)); m4[3]=nk; m4[4]=1 m5 = subzone(res,(1,1,1),(ni,nj,1)) m6 = subzone(res,(1,1,nk),(ni,nj,nk)) borders = [m1,m2,m3,m4,m5,m6] else: - m1 = subzone(res,(1,1,1),(1,nj,nk)); m1[2]=nj; m1[3]=1 + m1 = subzone(res,(1,1,1),(1,nj,nk)); m1[2]=nj; m1[3]=1 m2 = subzone(res,(ni,1,1),(ni,nj,nk)); m2[2]=nj; m2[3]=1 m3 = subzone(res,(1,1,1),(ni,1,nk)) m4 = subzone(res,(1,nj,1),(ni,nj,nk)) @@ -666,7 +666,7 @@ def deformMeshStruct2__(arrayi, surfDelta, beta): del res delta = G.TFI(borders) delta = Converter.extractVars(delta, ['dx','dy','dz']) - dim = delta[1].shape[0] + dim = delta[1].shape[0] array[1][:dim,:] += delta[1][:dim,:] return array @@ -678,7 +678,7 @@ def computeDeformationVector(array, surfDelta, beta=4.): if not isinstance(surfDelta[0], list): surfDelta = [surfDelta] if isinstance(array[0], list): return transform.computeDeformationVector(array, surfDelta, beta) - else: return transform.computeDeformationVector([array], surfDelta, beta) + else: return transform.computeDeformationVector([array], surfDelta, beta) def join(array, array2=[], arrayc=[], arrayc2=[], tol=1.e-10): """Join two arrays in one or join a list of arrays in one. @@ -740,7 +740,7 @@ def joinsb__(array1, array2, arrayc1, arrayc2, tol): if array1[3] == "NGON": a = Converter.convertArray2NGon(array2) ac = Converter.convertArray2NGon(arrayc2) - else: + else: a = Converter.convertArray2Hexa(array2) ac = Converter.convertArray2Hexa(arrayc2) cn = a[2]; ac = [ac[0], ac[1], cn, ac[3]+'*'] @@ -750,7 +750,7 @@ def joinsb__(array1, array2, arrayc1, arrayc2, tol): if array2[3] == "NGON": a = Converter.convertArray2NGon(array1) ac = Converter.convertArray2NGon(arrayc1) - else: + else: a = Converter.convertArray2Hexa(array1) ac = Converter.convertArray2Hexa(arrayc1) cn = a[2]; ac = [ac[0], ac[1], cn, ac[3]+'*']# la conversion d'un array structure en centres en non structure ne donne pas un array de type elt* @@ -784,7 +784,7 @@ def joins__(array1, array2, tol): else: a = Converter.convertArray2Hexa(array1) return transform.join(a, array2, tol) - else: # Unstruct + else: # Unstruct if array1[3] == "NGON" and array2[3] != "NGON": a = Converter.convertArray2NGon(array2) return transform.join(array1, a, tol) @@ -795,7 +795,7 @@ def joins__(array1, array2, tol): def patch(a1, a2, position=None, nodes=None, order=None): """Patch mesh2 defined by a2 in mesh1 defined by a1 at position (i,j,k). - Usage: patch(a1, a2, (i,j,k))""" + Usage: patch(a1, a2, (i,j,k))""" import numpy if (isinstance(a1[0], list) or isinstance(a2[0], list)): raise TypeError("patch: not for a list of arrays.") @@ -814,7 +814,7 @@ def patch(a1, a2, position=None, nodes=None, order=None): def oneovern(a, N, add=1): """Take one over N points from mesh. Usage: oneovern(a, (Ni,Nj,Nk))""" - if isinstance(a[0], list): + if isinstance(a[0], list): b = [] for i in a: b.append(transform.oneovern(i, N, add)) @@ -827,7 +827,7 @@ def subzone(array, minIndex, maxIndex=None, type=None): Usage: subzone(array, (imin,jmin,kmin), (imax,jmax,kmax))""" if maxIndex is None: # non structure if type == 'elements': - if len(array) == 5: + if len(array) == 5: raise TypeError("subzone: subzone with a list of elements not yet implemented for structured arrays.") return transform.subzoneElements(array, minIndex) elif type == 'faces': @@ -836,10 +836,10 @@ def subzone(array, minIndex, maxIndex=None, type=None): else: return transform.subzoneFaces(array, minIndex) elif type == 'nodes': - if len(array) == 5: + if len(array) == 5: raise TypeError("subzone: subzone with a list of nodes not yet implemented for structured arrays.") return transform.subzoneUnstruct(array, minIndex) - else: + else: if len(array) == 5: raise TypeError("subzone: subzone with a list of nodes not yet implemented for structured arrays.") return transform.subzoneUnstruct(array, minIndex) @@ -946,13 +946,13 @@ def makeCartesianXYZ__(z, tol=1.e-10): elif abs(dz_k) > tol: dirk = 3 dirs = [0,0,0] if diri == 1: dirs[0] = 1 - elif diri==2: dirs[1] = 1 + elif diri==2: dirs[1] = 1 else: dirs[2] = 1 if dirj == 1: dirs[0] = 2 - elif dirj==2: dirs[1] = 2 + elif dirj==2: dirs[1] = 2 else: dirs[2] = 2 if dirk == 1: dirs[0] = 3 - elif dirk==2: dirs[1] = 3 + elif dirk==2: dirs[1] = 3 else: dirs[2] = 3 z = reorder(z,(dirs[0], dirs[1], dirs[2])) ni = z[2]; nj = z[3]; nk = z[4] @@ -966,22 +966,22 @@ def makeCartesianXYZ__(z, tol=1.e-10): ok = 0 diri = 1; dirj = 2; dirk = 3 if dx_i < tol: diri =-1; ok = 1 - dy_j = valindj[posy]-valind[posy] + dy_j = valindj[posy]-valind[posy] if dy_j < tol: dirj =-2; ok = 1 - dz_k = valindk[posz]-valind[posz] + dz_k = valindk[posz]-valind[posz] if dz_k < tol: dirk =-3; ok = 1 if ok == 1: z = reorder(z,(diri,dirj,dirk)) return z def makeDirect(a): """Reorder a structured mesh to make it direct.""" - if isinstance(a[0], list): + if isinstance(a[0], list): b = [] for i in a: b.append(makeDirect__(i)) return b else: - return makeDirect__(a) + return makeDirect__(a) def makeDirect__(a): import KCore @@ -1015,7 +1015,7 @@ def makeDirect__(a): def addkplane(a, N=1): """Add N k-plane(s) to a mesh. Usage: addkplane(a, N)""" - if isinstance(a[0], list): + if isinstance(a[0], list): b = [] for i in a: c = addkplane__(i, N) @@ -1042,7 +1042,7 @@ def addkplane__(a, N): return res def addkplaneCenters(arrayC, arrayK, N=1): - if isinstance(arrayC[0], list): + if isinstance(arrayC[0], list): b = [] for noi in range(len(arrayC)): c = transform.addkplaneCenters(arrayC[noi], arrayK[noi],N) @@ -1121,7 +1121,7 @@ def splitSize__(a, N, multigrid, dirs): if dirl == 1: ns = findMGSplit__(ni, level=multigrid) - if ns > 0: + if ns > 0: a1 = subzone(a, (1,1,1), (ns,nj,nk)) a2 = subzone(a, (ns,1,1), (ni,nj,nk)) else: return [a] @@ -1161,7 +1161,7 @@ def splitSizeUp__(a, N, multigrid, dirs): if dirl == 1: nc = N//njk ns = findMGSplitUp__(ni, nc, level=multigrid) - if ns > 0: + if ns > 0: a1 = subzone(a, (1,1,1), (ns,nj,nk)) a2 = subzone(a, (ns,1,1), (ni,nj,nk)) else: return [a] @@ -1295,7 +1295,7 @@ def splitSizeUpR__(A, N, R, multigrid, dirs, minPtsPerDir): #print('Tot', Tot) return out -def splitSize(array, N=0, multigrid=0, dirs=[1,2,3], type=0, R=None, +def splitSize(array, N=0, multigrid=0, dirs=[1,2,3], type=0, R=None, minPtsPerDir=5): """Split a block until it has less than N points. Usage: splitSize(array, N, multigrid=0, dirs=[1,2,3], type=0)""" @@ -1355,7 +1355,7 @@ def findSplits__(ni, nj, nk, N, dirs, multigrid): out.append((b1,b2,1,nj,1,nk)) b1 = b2 - elif dirs[0] == 2: + elif dirs[0] == 2: ns = kround(njg*1./N); ns = int(ns) r = (nj-N*ns*plev)//plev b1 = 1 @@ -1366,7 +1366,7 @@ def findSplits__(ni, nj, nk, N, dirs, multigrid): if j == N-1: b2 = nj out.append((1,ni,b1,b2,1,nk)) b1 = b2 - else: + else: ns = kround(nkg*1./N); ns = int(ns) r = (nk-N*ns*plev)//plev b1 = 1 @@ -1379,12 +1379,12 @@ def findSplits__(ni, nj, nk, N, dirs, multigrid): b1 = b2 elif ldir == 2: - if dirs[0] == 1: ns1 = ni; bs1 = ni; ng1 = (ni-1)//plev+1 - elif dirs[0] == 2: ns1 = nj; bs1 = nj; ng1 = (nj-1)//plev+1 - else: ns1 = nk; bs1 = nk; ng1 = (nk-1)//plev+1 - if dirs[1] == 1: ns2 = ni; bs2 = ni; ng2 = (ni-1)//plev+1 - elif dirs[1] == 2: ns2 = nj; bs2 = nj; ng2 = (nj-1)//plev+1 - else: ns2 = nk; bs2 = nk; ng2 = (nk-1)//plev+1 + if dirs[0] == 1: ns1 = ni; bs1 = ni; ng1 = (ni-1)//plev+1 + elif dirs[0] == 2: ns1 = nj; bs1 = nj; ng1 = (nj-1)//plev+1 + else: ns1 = nk; bs1 = nk; ng1 = (nk-1)//plev+1 + if dirs[1] == 1: ns2 = ni; bs2 = ni; ng2 = (ni-1)//plev+1 + elif dirs[1] == 2: ns2 = nj; bs2 = nj; ng2 = (nj-1)//plev+1 + else: ns2 = nk; bs2 = nk; ng2 = (nk-1)//plev+1 best = [1,1,1] size = -1 for N1 in range(1,N+1): @@ -1407,14 +1407,14 @@ def findSplits__(ni, nj, nk, N, dirs, multigrid): if r1 > 0: b2 = b1+plev*(ns1+1); r1 -= 1 elif r1 < 0: b2 = b1+plev*(ns1-1); r1 += 1 else: b2 = b1+plev*ns1 - if dirs[0] == 1: - i1 = b1; i2 = b2; + if dirs[0] == 1: + i1 = b1; i2 = b2; if i == N1-1: i2 = ni - elif dirs[0] == 2: + elif dirs[0] == 2: j1 = b1; j2 = b2 if i == N1-1: j2 = nj - else: - k1 = b1; k2 = b2 + else: + k1 = b1; k2 = b2 if i == N1-1: k2 = nk r2 = (ni-N2*ns2*plev)//plev @@ -1423,13 +1423,13 @@ def findSplits__(ni, nj, nk, N, dirs, multigrid): if r2 > 0: c2 = c1+plev*(ns2+1); r2 -= 1 elif r2 < 0: c2 = c1+plev*(ns2-1); r2 += 1 else: c2 = c1+plev*ns2 - if dirs[1] == 1: + if dirs[1] == 1: i1 = c1; i2 = c2 if j == N2-1: i2 = ni - elif dirs[1] == 2: + elif dirs[1] == 2: j1 = c1; j2 = c2 if j == N2-1: j2 = nj - else: + else: k1 = c1; k2 = c2 if j == N2-1: k2 = nk out.append( (i1,i2,j1,j2,k1,k2) ) @@ -1489,7 +1489,7 @@ def findSplits__(ni, nj, nk, N, dirs, multigrid): if j == N2-1: j2 = nj r3 = (nk-N3*ns3*plev)//plev d1 = 1 - for k in range(N3): # tous les splits en k + for k in range(N3): # tous les splits en k if r3 > 0: d2 = d1+plev*(ns3+1); r3 -= 1 elif r3 < 0: d2 = d1+plev*(ns3-1); r3 += 1 else: d2 = d1+plev*ns3 @@ -1539,7 +1539,7 @@ def findNsi__(l, N, Np): Ns[no] += 1 #print Ns[no]*Nm-Np[no] pass elif ND > N: # trop de blocs - # On cherche a diminuer les splits des plus petits Er + # On cherche a diminuer les splits des plus petits Er for i in range(ND-N): e = Er[l-i-1] no = e[1] @@ -1564,7 +1564,7 @@ def splitNParts(arrays, N, multigrid=0, dirs=[1,2,3]): arraysS.append(a) NpS.append(a[2]*a[3]*a[4]) NeS.append(max(a[2]-1,1)*max(a[3]-1,1)*max(a[4]-1,1)) - elif a[3] == 'NGON': + elif a[3] == 'NGON': arraysN.append(a) NpN.append(a[1].size) c = a[2]; NeN.append(c[0,c[0,1]+2]) @@ -1589,7 +1589,7 @@ def splitNParts(arrays, N, multigrid=0, dirs=[1,2,3]): for i in range(len(arraysN)): a = arraysN[i] if NPart[i] > 1: - if a[3] == 'NGON': + if a[3] == 'NGON': elts = transform.splitNGon(a, NPart[i]) else: elts = transform.splitElement(a, NPart[i]) @@ -1705,7 +1705,7 @@ def splitSharpEdges(array, alphaRef=30.): def splitCurvatureAngle(array, sensibility): """Split a line following curvature angle. Usage: splitCurvatureAngle(array, sensibility)""" - out = []; array3 = array; ispl = 1 + out = []; array3 = array; ispl = 1 if len(array) != 5: raise TypeError("splitCurvatureAngle: defined for a i-array only.") @@ -1738,7 +1738,7 @@ def splitMultiplePts2D__(A): isplit = -1; jsplit = -1 # detecte si un pt interieur est de tag > 1 # fenetre i = 1 - for j in range(1,nj-1): + for j in range(1,nj-1): if taga[1][0,j*ni] > 1.: isplit = 1; jsplit = j+1 z1 = subzone(z,(1,1,1),(ni,jsplit,nk)) @@ -1748,7 +1748,7 @@ def splitMultiplePts2D__(A): return A, restart # fenetre i = ni - for j in range(1,nj-1): + for j in range(1,nj-1): if taga[1][0,ni-1+j*ni] > 1.: isplit = ni; jsplit = j+1 z1 = subzone(z,(1,1,1),(ni,jsplit,nk)) @@ -1758,7 +1758,7 @@ def splitMultiplePts2D__(A): return A, restart # fenetre j = 1 - for i in range(1,ni-1): + for i in range(1,ni-1): if taga[1][0,i] > 1.: isplit = i+1; jsplit = 1 z1 = subzone(z,(1,1,1),(isplit,nj,nk)) @@ -1768,14 +1768,14 @@ def splitMultiplePts2D__(A): return A, restart # fenetre j = nj - for i in range(1,ni-1): + for i in range(1,ni-1): if taga[1][0,i+(nj-1)*ni] > 1.: isplit = i+1; jsplit = nj z1 = subzone(z,(1,1,1),(isplit,nj,nk)) z2 = subzone(z,(isplit,1,1),(ni,nj,nk)) del A[noz]; A+= [z1,z2] restart = 1 - return A, restart + return A, restart return A, restart def splitMultiplePts3D__(A): @@ -1858,7 +1858,7 @@ def splitMultiplePts3D__(A): z1 = subzone(z,(1,1,1),(ni,jsplit,nk)) z2 = subzone(z,(1,jsplit,1),(ni,nj,nk)) del A[noz]; A+=[z1,z2]; restart = 1 - return A,restart + return A,restart return A, restart def splitMultiplePts__(A,dim=3): @@ -1870,28 +1870,28 @@ def splitMultiplePts__(A,dim=3): tags = Converter.extractVars(tags, ['definedBC']) for noz1 in range(nzones): - z = A[noz1]; ni=z[2]; nj=z[3]; nk=z[4] - winp=subzone(z,(1,1,1),(1,nj,nk));allWins.append(winp) - winp=subzone(z,(ni,1,1),(ni,nj,nk));allWins.append(winp) - winp=subzone(z,(1,1,1),(ni,1,nk));allWins.append(winp) - winp=subzone(z,(1,nj,1),(ni,nj,nk));allWins.append(winp) + z = A[noz1]; ni=z[2]; nj=z[3]; nk=z[4] + winp=subzone(z,(1,1,1),(1,nj,nk));allWins.append(winp) + winp=subzone(z,(ni,1,1),(ni,nj,nk));allWins.append(winp) + winp=subzone(z,(1,1,1),(ni,1,nk));allWins.append(winp) + winp=subzone(z,(1,nj,1),(ni,nj,nk));allWins.append(winp) if dim == 3: - winp=subzone(z,(1,1,1),(ni,nj,1));allWins.append(winp) - winp=subzone(z,(1,1,nk),(ni,nj,nk));allWins.append(winp) + winp=subzone(z,(1,1,1),(ni,nj,1));allWins.append(winp) + winp=subzone(z,(1,1,nk),(ni,nj,nk));allWins.append(winp) globWin = Converter.convertArray2Hexa(allWins); globWin = join(globWin); globWin = G.close(globWin) hook = Converter.createHook(globWin,function='nodes') tagG = [-1]*globWin[1].shape[1] for noz1 in range(nzones): res = Converter.identifyNodes(hook,A[noz1]) for ind in range(A[noz1][1].shape[1]): - if res[ind] != -1: + if res[ind] != -1: indg = res[ind]-1; tagG[indg]+=1 for noz1 in range(nzones): tag1 = tags[noz1] res = Converter.identifyNodes(hook,A[noz1]) for ind in range(A[noz1][1].shape[1]): - if res[ind] != -1: + if res[ind] != -1: indg = res[ind]-1 tag1[1][0,ind] = tagG[indg] A = Converter.addVars([A,tags]) @@ -1924,7 +1924,7 @@ def splitBAR(array, N, N2=-1): def splitTBranches(array, tol=1.e-13): """Split a BAR into a set of BARS at vertices where T branches exist. Usage: splitTBranches(array, tol=1.e-13)""" - if isinstance(array[0], list): + if isinstance(array[0], list): b = [] for i in array: res = transform.splitTBranches(i, tol) @@ -1933,7 +1933,7 @@ def splitTBranches(array, tol=1.e-13): return b else: res = transform.splitTBranches(array, tol) - if not isinstance(res[0], list): res = [res] + if not isinstance(res[0], list): res = [res] return res def splitTRI(array, idxList): diff --git a/Cassiopee/Transform/doc/source/conf.py b/Cassiopee/Transform/doc/source/conf.py index 81a0d4c3f..fd7d89206 100644 --- a/Cassiopee/Transform/doc/source/conf.py +++ b/Cassiopee/Transform/doc/source/conf.py @@ -192,15 +192,15 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -'pointsize': '12pt', + # The font size ('10pt', '11pt' or '12pt'). + 'pointsize': '12pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', -'preamble': r''' + # Additional stuff for the LaTeX preamble. + #'preamble': '', + 'preamble': r''' \usepackage{charter} \usepackage[defaultsans]{lato} \usepackage{inconsolata} @@ -211,8 +211,8 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('Transform', 'Transform.tex', u'Transform Documentation', - u'/ELSA/MU-09023/V'+__version__, 'manual'), + ('Transform', 'Transform.tex', u'Transform Documentation', + u'/ELSA/MU-09023/V'+__version__, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -255,9 +255,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Transform', u'Transform Documentation', - u'ONERA', 'Transform', 'One line description of project.', - 'Miscellaneous'), + ('index', 'Transform', u'Transform Documentation', + u'ONERA', 'Transform', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/Cassiopee/Transform/setup.py b/Cassiopee/Transform/setup.py index bdb4f10ad..acbbdc3e2 100644 --- a/Cassiopee/Transform/setup.py +++ b/Cassiopee/Transform/setup.py @@ -56,7 +56,7 @@ package_dir={"":"."}, packages=['Transform'], ext_modules=listExtensions - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Transform/setupLegacy.py b/Cassiopee/Transform/setupLegacy.py index ef45ada19..785229ea5 100644 --- a/Cassiopee/Transform/setupLegacy.py +++ b/Cassiopee/Transform/setupLegacy.py @@ -56,7 +56,7 @@ extra_compile_args=Dist.getCppArgs(), extra_link_args=Dist.getLinkArgs() )] - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/Transform/test/addkplane_t2.py b/Cassiopee/Transform/test/addkplane_t2.py index 1d7970850..00018cf1b 100644 --- a/Cassiopee/Transform/test/addkplane_t2.py +++ b/Cassiopee/Transform/test/addkplane_t2.py @@ -14,4 +14,3 @@ test.testT(t ,1) #C.convertPyTree2File(t,'t_check.cgns') - diff --git a/Cassiopee/Transform/test/breakElementsPT_t1.py b/Cassiopee/Transform/test/breakElementsPT_t1.py index 11a37fe4d..fee612b56 100644 --- a/Cassiopee/Transform/test/breakElementsPT_t1.py +++ b/Cassiopee/Transform/test/breakElementsPT_t1.py @@ -31,6 +31,3 @@ res = T.breakElements(t) t = C.newPyTree(['Base']); t[2][1][2]+=res test.testT(t,4) - - - diff --git a/Cassiopee/Transform/test/collapse_t1.py b/Cassiopee/Transform/test/collapse_t1.py index e79471bfe..3092e1155 100644 --- a/Cassiopee/Transform/test/collapse_t1.py +++ b/Cassiopee/Transform/test/collapse_t1.py @@ -3,5 +3,3 @@ import KCore.test as test test.stdTestA(T.collapse) - - diff --git a/Cassiopee/Transform/test/contractPT_t1.py b/Cassiopee/Transform/test/contractPT_t1.py index 9d6c9136e..313627b97 100644 --- a/Cassiopee/Transform/test/contractPT_t1.py +++ b/Cassiopee/Transform/test/contractPT_t1.py @@ -4,21 +4,21 @@ import Converter.PyTree as C import KCore.test as test -# Structure 3D +# Structure 3D a = G.cart((0,0,0), (1,1,1), (10,10,3)) C._addVars(a, 'Density'); C._initVars(a, 'centers:cellN', 1) a = C.addBC2Zone(a, 'wall','BCWall','imin') a = C.addBC2Zone(a, 'overlap','BCOverlap','jmin') -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2,3]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2,3]) a = T.contract(a, (0.,0.,0.), (1,0,0), (0,1,0), 0.1) test.testT(a,1) -# Structure 2D +# Structure 2D a = G.cart((0,0,0), (1,1,1), (10,10,1)) C._addVars(a, 'Density'); C._initVars(a, 'centers:cellN', 1) a = C.addBC2Zone(a, 'wall','BCWall','imin') a = C.addBC2Zone(a, 'overlap','BCOverlap','jmin') -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2]) a = T.contract(a, (0.,0.,0.), (1,0,0), (0,1,0), 0.1) test.testT(a,2) diff --git a/Cassiopee/Transform/test/contractPT_t2.py b/Cassiopee/Transform/test/contractPT_t2.py index d746f6529..154e56139 100644 --- a/Cassiopee/Transform/test/contractPT_t2.py +++ b/Cassiopee/Transform/test/contractPT_t2.py @@ -4,7 +4,7 @@ import Converter.PyTree as C import KCore.test as test -# Structure 3D +# Structure 3D a = G.cart((0,0,0), (1,1,1), (10,10,3)) C._addVars(a, 'Density'); C._initVars(a, 'centers:cellN', 1) a = C.addBC2Zone(a, 'wall','BCWall','imin') @@ -15,12 +15,12 @@ t = T.contract(t, (0.,0.,0.), (1,0,0), (0,1,0), 0.1) test.testT(t,1) -# Structure 2D +# Structure 2D a = G.cart((0,0,0), (1,1,1), (10,10,1)) C._addVars(a, 'Density'); C._initVars(a, 'centers:cellN', 1) a = C.addBC2Zone(a, 'wall','BCWall','imin') a = C.addBC2Zone(a, 'overlap','BCOverlap','jmin') -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2]) t = C.newPyTree(['Base',2,a]) t[2][1] = C.addState(t[2][1], 'EquationDimension', 2) t = T.contract(t, (0.,0.,0.), (1,0,0), (0,1,0), 0.1) diff --git a/Cassiopee/Transform/test/deform2.py b/Cassiopee/Transform/test/deform2.py index c843b6413..31be172a8 100644 --- a/Cassiopee/Transform/test/deform2.py +++ b/Cassiopee/Transform/test/deform2.py @@ -20,7 +20,7 @@ # C.convertArrays2File([a,b], 'out.plt') # Morceau de sphere -#A = D.sphereYinYang((0,0,0), 1., N=20) +#A = D.sphereYinYang((0,0,0), 1., N=20) #a = A[0] # Sphere a probleme diff --git a/Cassiopee/Transform/test/deformMeshPT_t1.py b/Cassiopee/Transform/test/deformMeshPT_t1.py index 5fd4c557d..e0e271366 100644 --- a/Cassiopee/Transform/test/deformMeshPT_t1.py +++ b/Cassiopee/Transform/test/deformMeshPT_t1.py @@ -28,7 +28,7 @@ m = T.deformMesh(m, a1) test.testT(m,1) -# 2D +# 2D m = D.sphere6((0,0,0),2,N=18) m2 = T.deformMesh(m, a1) test.testT(m2,2) diff --git a/Cassiopee/Transform/test/dual.py b/Cassiopee/Transform/test/dual.py index db1243829..26b99e78d 100644 --- a/Cassiopee/Transform/test/dual.py +++ b/Cassiopee/Transform/test/dual.py @@ -8,5 +8,3 @@ a = C.convertArray2NGon(a); a = G.close(a) res = T.dual(a) C.convertArrays2File([res],'out.tp') - - diff --git a/Cassiopee/Transform/test/dualPT_t1.py b/Cassiopee/Transform/test/dualPT_t1.py index 375d75c5f..2f00fc4bb 100644 --- a/Cassiopee/Transform/test/dualPT_t1.py +++ b/Cassiopee/Transform/test/dualPT_t1.py @@ -8,7 +8,7 @@ # NGON 2D ne contenant pas de faces externes a = D.sphere((0,0,0), 1., 15) a = C.convertArray2NGon(a); a = G.close(a) -a = C.initVars(a,'F',1.); a = C.initVars(a,'centers:G',1.); +a = C.initVars(a,'F',1.); a = C.initVars(a,'centers:G',1.); res = T.dual(a) t = C.newPyTree(['Base']); t[2][1][2]+=[res] test.testT(t) diff --git a/Cassiopee/Transform/test/homothetyPT_t1.py b/Cassiopee/Transform/test/homothetyPT_t1.py index 65972ef9d..86df600fe 100644 --- a/Cassiopee/Transform/test/homothetyPT_t1.py +++ b/Cassiopee/Transform/test/homothetyPT_t1.py @@ -5,16 +5,16 @@ import Converter.PyTree as C import KCore.test as test -# Structure 3D + champs + CL +# Structure 3D + champs + CL a = G.cart((0,0,0), (1,1,1), (10,10,3)) C._addVars(a, 'Density'); C._initVars(a, 'centers:cellN', 1) a = C.addBC2Zone(a, 'wall','BCWall','imin') a = C.addBC2Zone(a, 'overlap','BCOverlap','jmin') -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2,3]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2,3]) a = T.homothety(a, (0.,0.,0.), 2.) test.testT(a, 1) -# Structure 2D +# Structure 2D a = G.cart((0,0,0), (1,1,1), (10,10,1)) C._addVars(a,'Density'); C._initVars(a, 'centers:cellN', 1) a = C.addBC2Zone(a, 'wall','BCWall','imin') diff --git a/Cassiopee/Transform/test/homothetyPT_t2.py b/Cassiopee/Transform/test/homothetyPT_t2.py index 8dab70902..e5d840926 100644 --- a/Cassiopee/Transform/test/homothetyPT_t2.py +++ b/Cassiopee/Transform/test/homothetyPT_t2.py @@ -5,18 +5,18 @@ import Converter.PyTree as C import KCore.test as test -# Structure 3D + champs + CL +# Structure 3D + champs + CL a = G.cart((0,0,0), (1,1,1), (10,10,3)) C._addVars(a,'Density'); C._initVars(a, 'centers:cellN', 1) a = C.addBC2Zone(a, 'wall','BCWall','imin') a = C.addBC2Zone(a, 'overlap','BCOverlap','jmin') -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2,3]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2,3]) t = C.newPyTree(['Base',a]) t[2][1] = C.addState(t[2][1], 'EquationDimension', 3) t = T.homothety(t, (0.,0.,0.), 2.) test.testT(t,1) -# Structure 2D +# Structure 2D a = G.cart( (0,0,0), (1,1,1), (10,10,1)) C._addVars(a,'Density'); C._initVars(a, 'centers:cellN', 1) a = C.addBC2Zone(a, 'wall','BCWall','imin') diff --git a/Cassiopee/Transform/test/joinPT_t3.py b/Cassiopee/Transform/test/joinPT_t3.py index 3be5ed8df..f2ae92227 100644 --- a/Cassiopee/Transform/test/joinPT_t3.py +++ b/Cassiopee/Transform/test/joinPT_t3.py @@ -1,4 +1,4 @@ -# join avec les coordonnees et champs desordonnes +# join avec les coordonnees et champs desordonnes import Converter.PyTree as C import Transform.PyTree as T import Geom.PyTree as D diff --git a/Cassiopee/Transform/test/join_t4.py b/Cassiopee/Transform/test/join_t4.py index 7d09af697..50b0ef28f 100644 --- a/Cassiopee/Transform/test/join_t4.py +++ b/Cassiopee/Transform/test/join_t4.py @@ -4,7 +4,7 @@ import Converter as C import KCore.test as test -# test1 lignes +# test1 lignes a1 = D.line((0.,0.,0.), (1.,0.,0), 100) a2 = D.line((1.,0.,0.), (1.,1,0), 100) a2 = T.reorder(a2,(-1,2,3)) @@ -42,4 +42,3 @@ ac1 = C.node2Center(a1); ac2 = C.node2Center(a2) res = T.join (a1, a2, ac1, ac2) test.testA(res,23) - diff --git a/Cassiopee/Transform/test/join_t6.py b/Cassiopee/Transform/test/join_t6.py index 811104831..056d12b43 100644 --- a/Cassiopee/Transform/test/join_t6.py +++ b/Cassiopee/Transform/test/join_t6.py @@ -39,4 +39,3 @@ a2 = C.initVars(a2, 'F', 3.) a = T.join(a1, a2) test.testA([a], 3) - diff --git a/Cassiopee/Transform/test/mergePT_t2.py b/Cassiopee/Transform/test/mergePT_t2.py index e4e97ffb3..596fb9748 100644 --- a/Cassiopee/Transform/test/mergePT_t2.py +++ b/Cassiopee/Transform/test/mergePT_t2.py @@ -78,5 +78,3 @@ def f(t,u): t = C.initVars(t,'F',1.); t = C.initVars(t,'centers:G',2.) res = T.merge(t,dir=2) t[2][1][2] = res; test.testT(t,8) - - diff --git a/Cassiopee/Transform/test/patch.py b/Cassiopee/Transform/test/patch.py index 981af8a69..e17dc92a3 100644 --- a/Cassiopee/Transform/test/patch.py +++ b/Cassiopee/Transform/test/patch.py @@ -10,7 +10,7 @@ c3 = G.cart((0.0,1.,0), (0.01,0.01,1), (101,1,1)) c3 = T.rotate(c3, (0,0,0),(0,0,1),0.3) # patch a region at given position -a = T.patch(c1, c2, position=(1,1,1)) +a = T.patch(c1, c2, position=(1,1,1)) # patch some nodes nodes = numpy.arange(20100, 20201, dtype=numpy.int32) b = T.patch(c1, c3, nodes=nodes) diff --git a/Cassiopee/Transform/test/patchPT.py b/Cassiopee/Transform/test/patchPT.py index bc034a68c..3f7203b71 100644 --- a/Cassiopee/Transform/test/patchPT.py +++ b/Cassiopee/Transform/test/patchPT.py @@ -6,5 +6,5 @@ c1 = G.cart((0,0,0), (0.01,0.01,1), (201,101,1)) c2 = G.cart((0,0,0), (0.01,0.01,1), (51,81,1)) c2 = T.rotate(c2, (0,0,0),(0,0,1),0.2) -a = T.patch(c1, c2, (1,1,1)) +a = T.patch(c1, c2, (1,1,1)) C.convertPyTree2File(a, 'out.cgns') diff --git a/Cassiopee/Transform/test/patchPT_t1.py b/Cassiopee/Transform/test/patchPT_t1.py index a7440c02b..2ee2d9a99 100644 --- a/Cassiopee/Transform/test/patchPT_t1.py +++ b/Cassiopee/Transform/test/patchPT_t1.py @@ -45,7 +45,7 @@ def dens(x,y): return 3*x*y # multi-zone 3D a = D.sphere6((0,0,0), 1, N=20,) -d = G.cart((0.1,0.,0.), (0.1,1,1),(5,1,1)) +d = G.cart((0.1,0.,0.), (0.1,1,1),(5,1,1)) a = G.addNormalLayers(a, d) t = C.newPyTree(['Base',3,a]) t2 = T.subzone(t,(1,1,2),(-1,-1,4)) diff --git a/Cassiopee/Transform/test/perturbatePT_t1.py b/Cassiopee/Transform/test/perturbatePT_t1.py index d1610497d..9d1177ef5 100644 --- a/Cassiopee/Transform/test/perturbatePT_t1.py +++ b/Cassiopee/Transform/test/perturbatePT_t1.py @@ -5,16 +5,16 @@ import KCore.test as test # Traitements sur une zone -# Structure 3D +# Structure 3D a = G.cart( (0,0,0), (1,1,1), (10,10,10)) C._addVars(a,'Density'); C._initVars(a,'centers:cellN',1.) a = C.addBC2Zone(a, 'wall','BCWall','imin') a = C.addBC2Zone(a, 'overlap','BCOverlap','jmin') -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2,3]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2,3]) a = T.perturbate(a, 0.1) test.testT(a,1) -# Structure 2D +# Structure 2D a = G.cart( (0,0,0), (1,1,1), (10,10,1)) C._addVars(a,'Density'); C._initVars(a,'centers:cellN',1.) a = C.addBC2Zone(a, 'wall','BCWall','imin') @@ -23,7 +23,7 @@ test.testT(a,2) # Traitements sur un arbre -# Structure 3D +# Structure 3D a = G.cart( (0,0,0), (1,1,1), (10,10,10)) C._addVars(a,'Density'); C._initVars(a,'centers:cellN',1.) a = C.addBC2Zone(a, 'wall','BCWall','imin') @@ -34,12 +34,12 @@ t = T.perturbate(t, 0.1) test.testT(t,3) -# Structure 2D +# Structure 2D a = G.cart( (0,0,0), (1,1,1), (10,10,1)) C._addVars(a,'Density'); C._initVars(a,'centers:cellN',1.) a = C.addBC2Zone(a, 'wall','BCWall','imin') a = C.addBC2Zone(a, 'overlap','BCOverlap','jmin') -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2]) t = C.newPyTree(['Base',2,a]) t[2][1] = C.addState(t[2][1], 'EquationDimension', 2) t = T.perturbate(t, 0.1) diff --git a/Cassiopee/Transform/test/projectAllDirsPT_t1.py b/Cassiopee/Transform/test/projectAllDirsPT_t1.py index 1791b0cc9..84fbea0e3 100644 --- a/Cassiopee/Transform/test/projectAllDirsPT_t1.py +++ b/Cassiopee/Transform/test/projectAllDirsPT_t1.py @@ -50,7 +50,7 @@ # sur un arbre t = C.newPyTree(['Base',2,a]) tp = C.newPyTree(['Proj',2,b]) -t = G.getNormalMap(t) +t = G.getNormalMap(t) t = C.center2Node(t,['centers:sx','centers:sy','centers:sz']) t2 = T.projectAllDirs(t, tp, ['sx','sy','sz']); c[0] = 'projection' test.testT(t2,5) diff --git a/Cassiopee/Transform/test/projectOrtho_t1.py b/Cassiopee/Transform/test/projectOrtho_t1.py index 588b86b74..e313dcb33 100644 --- a/Cassiopee/Transform/test/projectOrtho_t1.py +++ b/Cassiopee/Transform/test/projectOrtho_t1.py @@ -14,4 +14,3 @@ b = C.initVars(b,'F',1) c = T.projectOrtho([b], [a]) test.testA([a,b]+c, 1) - diff --git a/Cassiopee/Transform/test/reorderAll.py b/Cassiopee/Transform/test/reorderAll.py index bcd8fc363..cbd550bd6 100644 --- a/Cassiopee/Transform/test/reorderAll.py +++ b/Cassiopee/Transform/test/reorderAll.py @@ -8,6 +8,5 @@ m2 = T.rotate(m1, (0.2,0.2,0.), (0.,0.,1.), 15.) m2 = T.reorder(m2,(-1,2,3)) a = [m1,m2] -a = T.reorderAll(a,1) +a = T.reorderAll(a,1) C.convertArrays2File(a, "out.plt") - diff --git a/Cassiopee/Transform/test/reorderPT_t3.py b/Cassiopee/Transform/test/reorderPT_t3.py index 2afbde67e..14d6bfd8c 100644 --- a/Cassiopee/Transform/test/reorderPT_t3.py +++ b/Cassiopee/Transform/test/reorderPT_t3.py @@ -4,7 +4,7 @@ import Converter.PyTree as C import KCore.test as test -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) a = C.addBC2Zone(a,'wall','BCWall','jmin') a = C.addBC2Zone(a,'overlap','BCOverlap','jmax') @@ -12,8 +12,8 @@ C._initVars(b,'F',1.); C._initVars(b,'centers:G',2.) b = C.addBC2Zone(b,'wall','BCWall','jmin') b = C.addBC2Zone(b,'overlap','BCOverlap','jmax') -a = C.addBC2Zone(a, 'match', 'BCMatch', [11,11,1,11,1,11], zoneDonor=b, rangeDonor=[1,1,1,11,1,11], trirac=[1,2,3]) -b = C.addBC2Zone(b, 'match', 'BCMatch', [1,1,1,11,1,11], zoneDonor=a, rangeDonor=[11,11,1,11,1,11], trirac=[1,2,3]) +a = C.addBC2Zone(a, 'match', 'BCMatch', [11,11,1,11,1,11], zoneDonor=b, rangeDonor=[1,1,1,11,1,11], trirac=[1,2,3]) +b = C.addBC2Zone(b, 'match', 'BCMatch', [1,1,1,11,1,11], zoneDonor=a, rangeDonor=[11,11,1,11,1,11], trirac=[1,2,3]) t = C.newPyTree(['Base']); t[2][1][2] += [a,b] t[2][1] = C.addState(t[2][1], 'EquationDimension', 3) # @@ -26,7 +26,7 @@ test.testT(t,2) # reorder une zone et rend coherent le reste de l'arbre -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) a = C.addBC2Zone(a,'wall','BCWall','jmin') a = C.addBC2Zone(a,'overlap','BCOverlap','jmax') @@ -34,15 +34,15 @@ C._initVars(b,'F',1.); C._initVars(b,'centers:G',2.) b = C.addBC2Zone(b,'wall','BCWall','jmin') b = C.addBC2Zone(b,'overlap','BCOverlap','jmax') -a = C.addBC2Zone(a, 'match', 'BCMatch', [11,11,1,11,1,11], zoneDonor=b, rangeDonor=[1,1,1,11,1,11], trirac=[1,2,3]) -b = C.addBC2Zone(b, 'match', 'BCMatch', [1,1,1,11,1,11], zoneDonor=a, rangeDonor=[11,11,1,11,1,11], trirac=[1,2,3]) +a = C.addBC2Zone(a, 'match', 'BCMatch', [11,11,1,11,1,11], zoneDonor=b, rangeDonor=[1,1,1,11,1,11], trirac=[1,2,3]) +b = C.addBC2Zone(b, 'match', 'BCMatch', [1,1,1,11,1,11], zoneDonor=a, rangeDonor=[11,11,1,11,1,11], trirac=[1,2,3]) t = C.newPyTree(['Base']); t[2][1][2] += [a,b] t[2][1] = C.addState(t[2][1], 'EquationDimension', 3) t[2][1][2][0] = T.reorder(t[2][1][2][0],(-1,-2,3),t) test.testT(t,3) # reorder sur la base et rend coherent le reste de l'arbre -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) a = C.addBC2Zone(a,'wall','BCWall','jmin') a = C.addBC2Zone(a,'overlap','BCOverlap','jmax') @@ -50,15 +50,15 @@ C._initVars(b,'F',1.); C._initVars(b,'centers:G',2.) b = C.addBC2Zone(b,'wall','BCWall','jmin') b = C.addBC2Zone(b,'overlap','BCOverlap','jmax') -a = C.addBC2Zone(a, 'match', 'BCMatch', [11,11,1,11,1,11], zoneDonor=b, rangeDonor=[1,1,1,11,1,11], trirac=[1,2,3]) -b = C.addBC2Zone(b, 'match', 'BCMatch', [1,1,1,11,1,11], zoneDonor=a, rangeDonor=[11,11,1,11,1,11], trirac=[1,2,3]) +a = C.addBC2Zone(a, 'match', 'BCMatch', [11,11,1,11,1,11], zoneDonor=b, rangeDonor=[1,1,1,11,1,11], trirac=[1,2,3]) +b = C.addBC2Zone(b, 'match', 'BCMatch', [1,1,1,11,1,11], zoneDonor=a, rangeDonor=[11,11,1,11,1,11], trirac=[1,2,3]) t = C.newPyTree(['Base']); t[2][1][2] += [a,b] t[2][1] = C.addState(t[2][1], 'EquationDimension', 3) t[2][1] = T.reorder(t[2][1],(-1,-2,3),t) test.testT(t,4) # reorder sur la base et rend coherent le reste de l arbre -a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) +a = G.cylinder((0.,0.,0.), 0.1, 1., 0., 45., 5., (11,11,11)) C._initVars(a,'F',1.); C._initVars(a,'centers:G',2.) a = C.addBC2Zone(a,'wall','BCWall','jmin') a = C.addBC2Zone(a,'overlap','BCOverlap','jmax') @@ -66,8 +66,8 @@ C._initVars(b,'F',1.); C._initVars(b,'centers:G',2.) b = C.addBC2Zone(b,'wall','BCWall','jmin') b = C.addBC2Zone(b,'overlap','BCOverlap','jmax') -a = C.addBC2Zone(a, 'match', 'BCMatch', [11,11,1,11,1,11], zoneDonor=b, rangeDonor=[1,1,1,11,1,11], trirac=[1,2,3]) -b = C.addBC2Zone(b, 'match', 'BCMatch', [1,1,1,11,1,11], zoneDonor=a, rangeDonor=[11,11,1,11,1,11], trirac=[1,2,3]) +a = C.addBC2Zone(a, 'match', 'BCMatch', [11,11,1,11,1,11], zoneDonor=b, rangeDonor=[1,1,1,11,1,11], trirac=[1,2,3]) +b = C.addBC2Zone(b, 'match', 'BCMatch', [1,1,1,11,1,11], zoneDonor=a, rangeDonor=[11,11,1,11,1,11], trirac=[1,2,3]) t = C.newPyTree(['Base']); t[2][1][2] += [a,b] t[2][1] = C.addState(t[2][1], 'EquationDimension', 3) t[2][1][2][0] = T.reorder(t[2][1][2][0],(-2,1,3),t) diff --git a/Cassiopee/Transform/test/rotate.py b/Cassiopee/Transform/test/rotate.py index 9bf2ed167..ce8e598ef 100644 --- a/Cassiopee/Transform/test/rotate.py +++ b/Cassiopee/Transform/test/rotate.py @@ -8,7 +8,7 @@ b = T.rotate(a, (0.,0.,0.), (0.,0.,1.), 30.) # Rotate with axis transformations c = T.rotate(a, (0.,0.,0.), ((1.,0.,0.),(0,1,0),(0,0,1)), - ((1,1,0), (1,-1,0), (0,0,1)) ) + ((1,1,0), (1,-1,0), (0,0,1)) ) # Rotate with three angles d = T.rotate(a, (0.,0.,0.), (90.,0.,0.)) C.convertArrays2File([a,d], 'out.plt') diff --git a/Cassiopee/Transform/test/rotatePT.py b/Cassiopee/Transform/test/rotatePT.py index e9fac1d06..1888196b8 100644 --- a/Cassiopee/Transform/test/rotatePT.py +++ b/Cassiopee/Transform/test/rotatePT.py @@ -6,7 +6,7 @@ a = G.cart((0,0,0), (1,1,1), (10,10,2)) # Rotate with an axis and an angle b = T.rotate(a, (0.,0.,0.), (0.,0.,1.), 30.) -b2 = T.rotate(a, (0.,0.,0.), (0.,0.,1.), 30., +b2 = T.rotate(a, (0.,0.,0.), (0.,0.,1.), 30., vectors=[['centers:MomentumX'], ['centers:MomentumX'], ['centers:MomentumX']]) # Rotate with two axis diff --git a/Cassiopee/Transform/test/rotatePT_t3.py b/Cassiopee/Transform/test/rotatePT_t3.py index 8109c52c0..33934de14 100644 --- a/Cassiopee/Transform/test/rotatePT_t3.py +++ b/Cassiopee/Transform/test/rotatePT_t3.py @@ -15,7 +15,7 @@ test.testT(z, 2) # ME -a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) +a = G.cartHexa((0,0,0), (1,1,1), (10,10,10)) b = G.cartTetra((9,0,0), (1,1,1), (10,10,10)) z = C.mergeConnectivity(a, b, boundary=0) T._rotate(z, (0,0,0), (0,0,1), 32.) diff --git a/Cassiopee/Transform/test/rotate_t4.py b/Cassiopee/Transform/test/rotate_t4.py index dc154cfa9..ca61ce4f6 100644 --- a/Cassiopee/Transform/test/rotate_t4.py +++ b/Cassiopee/Transform/test/rotate_t4.py @@ -20,7 +20,7 @@ test.testA([b],1) # Rotate with axis transformations c = T.rotate(a, (0.,0.,0.), ((1.,0.,0.),(0,1,0),(0,0,1)), - ((1,1,0), (1,-1,0), (0,0,1)), vectors=[['vx','vy','vz']] ) + ((1,1,0), (1,-1,0), (0,0,1)), vectors=[['vx','vy','vz']] ) test.testA([c],2) # Rotate with three angles diff --git a/Cassiopee/Transform/test/smoothFieldPT_t1.py b/Cassiopee/Transform/test/smoothFieldPT_t1.py index 06e4b5fcf..5c3a505ba 100644 --- a/Cassiopee/Transform/test/smoothFieldPT_t1.py +++ b/Cassiopee/Transform/test/smoothFieldPT_t1.py @@ -22,4 +22,3 @@ eps[:] = 0.1 T._smoothField(a, eps, niter, type, ['Density']) test.testT(a, 3) - diff --git a/Cassiopee/Transform/test/splitManifold.py b/Cassiopee/Transform/test/splitManifold.py index d94ee7178..0700fc295 100755 --- a/Cassiopee/Transform/test/splitManifold.py +++ b/Cassiopee/Transform/test/splitManifold.py @@ -30,5 +30,3 @@ x = T.splitManifold(c) C.convertArrays2File(x, 'outB.plt') - - diff --git a/Cassiopee/Transform/test/splitManifoldPT.py b/Cassiopee/Transform/test/splitManifoldPT.py index e5a919685..7a0ba0fba 100755 --- a/Cassiopee/Transform/test/splitManifoldPT.py +++ b/Cassiopee/Transform/test/splitManifoldPT.py @@ -27,4 +27,3 @@ c = T.join(c) x = T.splitManifold(c) C.convertPyTree2File(x, "outB.cgns") - diff --git a/Cassiopee/Transform/test/splitManifoldPT_t1.py b/Cassiopee/Transform/test/splitManifoldPT_t1.py index 2dd373d35..70347460d 100644 --- a/Cassiopee/Transform/test/splitManifoldPT_t1.py +++ b/Cassiopee/Transform/test/splitManifoldPT_t1.py @@ -30,7 +30,3 @@ res = T.splitManifold(c) t = C.newPyTree(['Base', 1]); t[2][1][2] += res test.testT(t,2) - - - - diff --git a/Cassiopee/Transform/test/splitManifold_t1.py b/Cassiopee/Transform/test/splitManifold_t1.py index 548ed7b19..13b058c2f 100644 --- a/Cassiopee/Transform/test/splitManifold_t1.py +++ b/Cassiopee/Transform/test/splitManifold_t1.py @@ -29,5 +29,3 @@ c = T.join(c) x = T.splitManifold(c) test.testA(x,2) - - diff --git a/Cassiopee/Transform/test/splitMultiplePtsPT2.py b/Cassiopee/Transform/test/splitMultiplePtsPT2.py index f9474f351..4733ce3f7 100644 --- a/Cassiopee/Transform/test/splitMultiplePtsPT2.py +++ b/Cassiopee/Transform/test/splitMultiplePtsPT2.py @@ -5,7 +5,7 @@ z0 = G.cart((0.,0.,0.),(0.1,0.1,1.),(10,10,1)); z1 = T.subzone(z0,(1,1,1),(5,10,1)); z1[0] = 'cart1' -z1 = C.addBC2Zone(z1, 'wall1','BCWall','jmin') +z1 = C.addBC2Zone(z1, 'wall1','BCWall','jmin') z2 = T.subzone(z0,(5,1,1),(10,5,1)); z2[0] = 'cart2' z3 = T.subzone(z0,(5,5,1),(10,10,1)); z3[0] = 'cart3' t = C.newPyTree(['Base',2]) diff --git a/Cassiopee/Transform/test/splitTBranches.py b/Cassiopee/Transform/test/splitTBranches.py index 689dabb16..7a43fcabf 100644 --- a/Cassiopee/Transform/test/splitTBranches.py +++ b/Cassiopee/Transform/test/splitTBranches.py @@ -11,4 +11,3 @@ c = T.join(c) res = T.splitTBranches(c) C.convertArrays2File(res,"out.plt") - diff --git a/Cassiopee/Transform/test/splitTBranchesPT.py b/Cassiopee/Transform/test/splitTBranchesPT.py index b7ee8aa17..f7ea50f8f 100644 --- a/Cassiopee/Transform/test/splitTBranchesPT.py +++ b/Cassiopee/Transform/test/splitTBranchesPT.py @@ -11,4 +11,3 @@ c = T.join(c) res = T.splitTBranches(c) C.convertPyTree2File(res, "out.cgns") - diff --git a/Cassiopee/Transform/test/subzonePT_t1.py b/Cassiopee/Transform/test/subzonePT_t1.py index 2c6707af0..e4dfe6d60 100644 --- a/Cassiopee/Transform/test/subzonePT_t1.py +++ b/Cassiopee/Transform/test/subzonePT_t1.py @@ -21,7 +21,7 @@ def dens(x,y): return 3*x*y t = C.newPyTree(['Base',a]) test.testT(t, 1) -# structure 2D + CL +# structure 2D + CL a = G.cart((0,0,0), (1,1,1), (10,20,1)) C._initVars(a,'Density',dens,['CoordinateX','CoordinateY']) C._initVars(a,'centers:cellN',1) @@ -47,7 +47,7 @@ def dens(x,y): return 3*x*y t = T.subzone(t, (3,3,3), (7,8,5)) test.testT(t, 3) -# structure 2D + CL +# structure 2D + CL a = G.cart((0,0,0), (1,1,1), (10,20,1)) C._initVars(a,'Density',dens,['CoordinateX','CoordinateY']) C._initVars(a,'centers:cellN',1) diff --git a/Cassiopee/Transform/test/subzonePT_t3.py b/Cassiopee/Transform/test/subzonePT_t3.py index 1ca49292c..86d5d4d37 100644 --- a/Cassiopee/Transform/test/subzonePT_t3.py +++ b/Cassiopee/Transform/test/subzonePT_t3.py @@ -86,7 +86,7 @@ C._initVars(d,'{centers:G}={centers:CoordinateY}') facesL=[] for k in range(ni1): - for j in range(ni1): + for j in range(ni1): facesL.append(j*N+k*N*ni1) d2 = T.subzone(d, facesL, type='faces') test.testT(d2,9) diff --git a/Cassiopee/Transform/test/symetrizePT_t1.py b/Cassiopee/Transform/test/symetrizePT_t1.py index 9dd2e88b4..367e9a9ff 100644 --- a/Cassiopee/Transform/test/symetrizePT_t1.py +++ b/Cassiopee/Transform/test/symetrizePT_t1.py @@ -5,21 +5,21 @@ import Converter.PyTree as C import KCore.test as test -# Structure 3D +# Structure 3D a = G.cart( (0,0,0), (1,1,1), (10,10,3)) C._addVars(a, 'Density'); C._addVars(a,'centers:cellN') a = C.addBC2Zone(a, 'wall','BCWall','imin') a = C.addBC2Zone(a, 'overlap','BCOverlap','jmin') -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2,3]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2,3]) a = T.symetrize(a, (0.,0.,0.), (1,0,0), (0,0,1)) test.testT(a,1) -# Structure 2D +# Structure 2D a = G.cart((0,0,0), (1,1,1), (10,10,1)) C._addVars(a, 'Density'); C._addVars(a, 'centers:cellN') a = C.addBC2Zone(a, 'wall','BCWall','imin') a = C.addBC2Zone(a, 'overlap','BCOverlap','jmin') -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2]) a = T.symetrize(a, (0.,0.,0.), (1,0,0), (0,0,1)) test.testT(a,2) diff --git a/Cassiopee/Transform/test/symetrizePT_t2.py b/Cassiopee/Transform/test/symetrizePT_t2.py index 8e47a0bc4..5b5c1cc1f 100644 --- a/Cassiopee/Transform/test/symetrizePT_t2.py +++ b/Cassiopee/Transform/test/symetrizePT_t2.py @@ -5,7 +5,7 @@ import Converter.PyTree as C import KCore.test as test -# Structure 3D +# Structure 3D a = G.cart((0,0,0), (1,1,1), (10,10,3)) C._addVars(a,'Density'); C._addVars(a,'centers:cellN') a = C.addBC2Zone(a, 'wall','BCWall','imin') @@ -16,12 +16,12 @@ t = T.symetrize(t, (0.,0.,0.), (1,0,0), (0,0,1)) test.testT(t,1) -# Structure 2D +# Structure 2D a = G.cart((0,0,0), (1,1,1), (10,10,1)) C._addVars(a,'Density'); C._addVars(a,'centers:cellN') a = C.addBC2Zone(a, 'wall','BCWall','imin') a = C.addBC2Zone(a, 'overlap','BCOverlap','jmin') -a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2]) +a = C.addBC2Zone(a, 'match1', 'BCMatch', 'imax', a, 'imin', [1,2]) t = C.newPyTree(['Base',2,a]) t[2][1] = C.addState(t[2][1], 'EquationDimension', 2) t = T.symetrize(t, (0.,0.,0.), (1,0,0), (0,0,1)) diff --git a/Cassiopee/Transform/test/translatePT_t2.py b/Cassiopee/Transform/test/translatePT_t2.py index f679530b3..7388f9fac 100644 --- a/Cassiopee/Transform/test/translatePT_t2.py +++ b/Cassiopee/Transform/test/translatePT_t2.py @@ -30,4 +30,3 @@ a = G.cartNGon((0,0,0), (1,1,1), (5,5,5), api=3) T._translate(a, (1,0,0)) test.testT(a, 5) - diff --git a/Cassiopee/XCore/XCore/AdaptMesh/test.py b/Cassiopee/XCore/XCore/AdaptMesh/test.py index bd6ba7dcc..55ac9906d 100644 --- a/Cassiopee/XCore/XCore/AdaptMesh/test.py +++ b/Cassiopee/XCore/XCore/AdaptMesh/test.py @@ -10,7 +10,7 @@ import Post.PyTree as P TOL_match = 1e-7 -TOL_recover = 1e-11 +TOL_recover = 1e-11 rot_angle = 2.*np.pi/36. # MASTER diff --git a/Cassiopee/XCore/XCore/PyTree.py b/Cassiopee/XCore/XCore/PyTree.py index 389519fdf..609a15371 100644 --- a/Cassiopee/XCore/XCore/PyTree.py +++ b/Cassiopee/XCore/XCore/PyTree.py @@ -226,14 +226,14 @@ def loadAndSplitNGon(fileName): if fsolc is not None: for f in fsolc[2]: if f[3] == 'DataArray_t': - solc.append(f[1]); solcNames.append(f[0]) + solc.append(f[1]); solcNames.append(f[0]) fsol = I.getNodeFromName2(z, I.__FlowSolutionNodes__) soln = []; solNames = [] if fsol is not None: for f in fsol[2]: - if f[3] == 'DataArray_t': - soln.append(f[1]); solNames.append(f[0]) + if f[3] == 'DataArray_t': + soln.append(f[1]); solNames.append(f[0]) zonebc = I.getNodeFromType(z, 'ZoneBC_t') bcs = [] @@ -509,7 +509,7 @@ def icapsule_adapt(IC): zs = I.createZoneNode("sa"+str(i), sarrs[i]) cont = I.createUniqueChild(zs, 'ZoneBC', 'ZoneBC_t') bc = I.newBC(name="IntersectionFaces", pointList=stags[i], - family="IntersectionFaces", parent=cont) + family="IntersectionFaces", parent=cont) slave_zones.append(zs) tm = C.newPyTree(['Base', zm]) ts = C.newPyTree(['Base', slave_zones]) @@ -539,7 +539,7 @@ def icapsule_intersect(ma, sa): zs = I.createZoneNode("si"+str(i), slist_i[i]) cont = I.createUniqueChild(zs, 'ZoneBC', 'ZoneBC_t') bc = I.newBC(name="IntersectionFaces", pointList=stags_i[i], - family="IntersectionFaces", parent=cont) + family="IntersectionFaces", parent=cont) slave_zones.append(zs) tm = C.newPyTree(['Base', zm]) ts = C.newPyTree(['Base', slave_zones]) diff --git a/Cassiopee/XCore/createLinks.py b/Cassiopee/XCore/createLinks.py index 33451a995..78fcd8e87 100644 --- a/Cassiopee/XCore/createLinks.py +++ b/Cassiopee/XCore/createLinks.py @@ -3,8 +3,8 @@ paths2 = 'XCore/paradigma' # local link if not os.path.exists(paths2) and os.path.exists(paths1): # symlink fails on windows - try: + try: os.symlink('../'+paths1, paths2) except: import shutil - shutil.copytree(paths1, paths2) + shutil.copytree(paths1, paths2) diff --git a/Cassiopee/XCore/installLib.py b/Cassiopee/XCore/installLib.py index 9d8b33078..6bb88b352 100644 --- a/Cassiopee/XCore/installLib.py +++ b/Cassiopee/XCore/installLib.py @@ -1,6 +1,6 @@ # Installation de libxcore pour etre accessible par les autres modules # Si libxcore.a existe, on la recopie -# Sinon, on cherche xcore.so ou xcore.pyd, on le recopie en +# Sinon, on cherche xcore.so ou xcore.pyd, on le recopie en # libxcore.so ou dll import os, shutil import platform @@ -27,6 +27,6 @@ a = os.access(installPathLocal+"/xcore"+__EXTMODULE__, os.F_OK) if a: shutil.copyfile(installPathLocal+"/xcore"+__EXTMODULE__, - libPath+"/libxcore"+__EXTSHARED__) + libPath+"/libxcore"+__EXTSHARED__) else: print("Error: xcore"+__EXTMODULE__+" can not be found.") diff --git a/Cassiopee/XCore/setup.py b/Cassiopee/XCore/setup.py index 2ef6d888b..6f3c103d3 100644 --- a/Cassiopee/XCore/setup.py +++ b/Cassiopee/XCore/setup.py @@ -53,7 +53,7 @@ libraries += fortranLibs mySystem = Dist.getSystem() -if mySystem[0] == 'mingw': +if mySystem[0] == 'mingw': libraries += ["wsock32"] if cc == 'icc': @@ -105,17 +105,17 @@ name = names[0]+'.'+names[-1] listExtensionsPyx.append( Extension(name, - sources=[c], - include_dirs=["XCore","%s"%PPATH,"%s/ppart"%PPATH,"%s/struct"%PPATH,"%s/pario"%PPATH,"%s/mesh"%PPATH,"%s/meshgen"%PPATH,"%s/mpi_wrapper"%PPATH, "%s/util"%PPATH]+additionalIncludePaths+[numpyIncDir, kcoreIncDir, mpiIncDir, mpi4pyIncDir, pythonIncDir], - library_dirs=additionalLibPaths+libraryDirs, - libraries=libraries+additionalLibs, - extra_compile_args=Dist.getCppArgs()+ADDITIONALCPPFLAGS, - extra_link_args=[], - language='c++' - ) ) + sources=[c], + include_dirs=["XCore","%s"%PPATH,"%s/ppart"%PPATH,"%s/struct"%PPATH,"%s/pario"%PPATH,"%s/mesh"%PPATH,"%s/meshgen"%PPATH,"%s/mpi_wrapper"%PPATH, "%s/util"%PPATH]+additionalIncludePaths+[numpyIncDir, kcoreIncDir, mpiIncDir, mpi4pyIncDir, pythonIncDir], + library_dirs=additionalLibPaths+libraryDirs, + libraries=libraries+additionalLibs, + extra_compile_args=Dist.getCppArgs()+ADDITIONALCPPFLAGS, + extra_link_args=[], + language='c++' + ) ) else: def cythonize(srcs, include_path): return [] - paradigmaDir = '' + paradigmaDir = '' else: def cythonize(srcs, include_path): return [] paradigmaDir = '' @@ -130,7 +130,7 @@ def cythonize(srcs, include_path): return [] packages=['XCore'], package_dir={"":"."}, ext_modules=listExtensions+cythonize(listExtensionsPyx,include_path=[paradigmaDir]) - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/XCore/setupLegacy.py b/Cassiopee/XCore/setupLegacy.py index bc8e9fc53..e309261fd 100644 --- a/Cassiopee/XCore/setupLegacy.py +++ b/Cassiopee/XCore/setupLegacy.py @@ -70,7 +70,7 @@ package_dir={"":"."}, packages=['XCore'], ext_modules=listExtensions - ) +) # Check PYTHONPATH =========================================================== Dist.checkPythonPath(); Dist.checkLdLibraryPath() diff --git a/Cassiopee/XCore/srcs.py b/Cassiopee/XCore/srcs.py index 5374ecaf0..7ddbf8b75 100644 --- a/Cassiopee/XCore/srcs.py +++ b/Cassiopee/XCore/srcs.py @@ -10,7 +10,7 @@ #============================================================================== # Fichiers c++ #============================================================================== -cpp_srcs = ['XCore/CMP/src/recv_buffer.cpp', +cpp_srcs = ['XCore/CMP/src/recv_buffer.cpp', 'XCore/CMP/src/send_buffer.cpp', 'XCore/xmpi/context_mpi_impl.cpp', 'XCore/xmpi/context_stub_impl.cpp', @@ -78,13 +78,13 @@ 'XCore/AdaptMesh/AdaptMesh_AdaptGeom.cpp', 'XCore/AdaptMesh/MeshInit.cpp', - 'XCore/AdaptMesh/MeshOrient.cpp', + 'XCore/AdaptMesh/MeshOrient.cpp', 'XCore/AdaptMesh/MeshClean.cpp', 'XCore/AdaptMesh/MeshTopo.cpp', 'XCore/AdaptMesh/MeshIO.cpp', 'XCore/AdaptMesh/MeshSmooth.cpp', - 'XCore/AdaptMesh/MeshConnectivity.cpp', - 'XCore/AdaptMesh/MeshConformize.cpp', + 'XCore/AdaptMesh/MeshConnectivity.cpp', + 'XCore/AdaptMesh/MeshConformize.cpp', 'XCore/AdaptMesh/MeshRefine.cpp', 'XCore/AdaptMesh/MeshIso.cpp', 'XCore/AdaptMesh/MeshDir.cpp', @@ -118,14 +118,14 @@ ] if mpi: # source that requires mpi cpp_srcs += [ - 'XCore/SplitElement/splitter.cpp', - 'XCore/exchangeFields.cpp', - 'XCore/chunk2partNGon.cpp', - 'XCore/chunk2partElt.cpp', - - 'XCore/AdaptMesh/AdaptMesh_LoadBalance.cpp', - 'XCore/AdaptMesh/MeshComm.cpp', - ] + 'XCore/SplitElement/splitter.cpp', + 'XCore/exchangeFields.cpp', + 'XCore/chunk2partNGon.cpp', + 'XCore/chunk2partElt.cpp', + + 'XCore/AdaptMesh/AdaptMesh_LoadBalance.cpp', + 'XCore/AdaptMesh/MeshComm.cpp', + ] else: cpp_srcs += [ 'XCore/SplitElement/splitter_stub.cpp', @@ -133,4 +133,4 @@ 'XCore/chunk2partNGon_stub.cpp', 'XCore/chunk2partElt_stub.cpp', 'XCore/AdaptMesh/stubs/AdaptMesh_LoadBalance_stub.cpp' - ] + ] diff --git a/Cassiopee/XCore/srcs_scotch.py b/Cassiopee/XCore/srcs_scotch.py index 5fc9586e8..d488e00bf 100644 --- a/Cassiopee/XCore/srcs_scotch.py +++ b/Cassiopee/XCore/srcs_scotch.py @@ -1,356 +1,355 @@ # libscotch cpp_srcs1 = [ -"XCore/scotch/arch.c" -,"XCore/scotch/arch_build.c" -,"XCore/scotch/arch_build2.c" -,"XCore/scotch/arch_cmplt.c" -,"XCore/scotch/arch_cmpltw.c" -,"XCore/scotch/arch_deco.c" -,"XCore/scotch/arch_deco2.c" -,"XCore/scotch/arch_dist.c" -,"XCore/scotch/arch_hcub.c" -,"XCore/scotch/arch_mesh.c" -,"XCore/scotch/arch_sub.c" -,"XCore/scotch/arch_tleaf.c" -,"XCore/scotch/arch_torus.c" -,"XCore/scotch/arch_vcmplt.c" -,"XCore/scotch/arch_vhcub.c" -,"XCore/scotch/bgraph.c" -,"XCore/scotch/bgraph_bipart_bd.c" -,"XCore/scotch/bgraph_bipart_df.c" -,"XCore/scotch/bgraph_bipart_ex.c" -,"XCore/scotch/bgraph_bipart_fm.c" -,"XCore/scotch/bgraph_bipart_gg.c" -,"XCore/scotch/bgraph_bipart_gp.c" -,"XCore/scotch/bgraph_bipart_ml.c" -,"XCore/scotch/bgraph_bipart_st.c" -,"XCore/scotch/bgraph_bipart_zr.c" -,"XCore/scotch/bgraph_check.c" -,"XCore/scotch/bgraph_cost.c" -,"XCore/scotch/bgraph_store.c" -,"XCore/scotch/common.c" -,"XCore/scotch/common_context.c" -,"XCore/scotch/common_file.c" -,"XCore/scotch/common_file_compress.c" -,"XCore/scotch/common_file_decompress.c" -,"XCore/scotch/common_integer.c" -,"XCore/scotch/common_memory.c" -,"XCore/scotch/common_string.c" -,"XCore/scotch/common_stub.c" -,"XCore/scotch/common_thread.c" -,"XCore/scotch/common_thread_system.c" -,"XCore/scotch/common_values.c" -,"XCore/scotch/context.c" -,"XCore/scotch/fibo.c" -,"XCore/scotch/gain.c" -,"XCore/scotch/geom.c" -,"XCore/scotch/graph.c" -,"XCore/scotch/graph_base.c" -,"XCore/scotch/graph_band.c" -,"XCore/scotch/graph_check.c" -,"XCore/scotch/graph_clone.c" -,"XCore/scotch/graph_coarsen.c" -,"XCore/scotch/graph_diam.c" -,"XCore/scotch/graph_dump.c" -,"XCore/scotch/graph_ielo.c" -,"XCore/scotch/graph_induce.c" -,"XCore/scotch/graph_io.c" -,"XCore/scotch/graph_io_chac.c" -,"XCore/scotch/graph_io_habo.c" -,"XCore/scotch/graph_io_mmkt.c" -,"XCore/scotch/graph_io_scot.c" -,"XCore/scotch/graph_list.c" -,"XCore/scotch/graph_match.c" -,"XCore/scotch/hall_order_hd.c" -,"XCore/scotch/hall_order_hf.c" -,"XCore/scotch/hall_order_hx.c" -,"XCore/scotch/hgraph.c" -,"XCore/scotch/hgraph_check.c" -,"XCore/scotch/hgraph_dump.c" -,"XCore/scotch/hgraph_induce.c" -,"XCore/scotch/hgraph_order_bl.c" -,"XCore/scotch/hgraph_order_cc.c" -,"XCore/scotch/hgraph_order_cp.c" -,"XCore/scotch/hgraph_order_gp.c" -,"XCore/scotch/hgraph_order_hd.c" -,"XCore/scotch/hgraph_order_hf.c" -,"XCore/scotch/hgraph_order_hx.c" -,"XCore/scotch/hgraph_order_kp.c" -,"XCore/scotch/hgraph_order_nd.c" -,"XCore/scotch/hgraph_order_si.c" -,"XCore/scotch/hgraph_order_st.c" -,"XCore/scotch/hmesh.c" -,"XCore/scotch/hmesh_check.c" -,"XCore/scotch/hmesh_hgraph.c" -,"XCore/scotch/hmesh_induce.c" -,"XCore/scotch/hmesh_mesh.c" -,"XCore/scotch/hmesh_order_bl.c" -,"XCore/scotch/hmesh_order_cp.c" -,"XCore/scotch/hmesh_order_gr.c" -,"XCore/scotch/hmesh_order_gp.c" -,"XCore/scotch/hmesh_order_hd.c" -,"XCore/scotch/hmesh_order_hf.c" -,"XCore/scotch/hmesh_order_hx.c" -,"XCore/scotch/hmesh_order_nd.c" -,"XCore/scotch/hmesh_order_si.c" -,"XCore/scotch/hmesh_order_st.c" -,"XCore/scotch/kgraph.c" -,"XCore/scotch/kgraph_band.c" -,"XCore/scotch/kgraph_check.c" -,"XCore/scotch/kgraph_map_bd.c" -,"XCore/scotch/kgraph_map_cp.c" -,"XCore/scotch/kgraph_map_df.c" -,"XCore/scotch/kgraph_map_ex.c" -,"XCore/scotch/kgraph_map_fm.c" -,"XCore/scotch/kgraph_map_ml.c" -,"XCore/scotch/kgraph_map_rb.c" -,"XCore/scotch/kgraph_map_rb_map.c" -,"XCore/scotch/kgraph_map_rb_part.c" -,"XCore/scotch/kgraph_map_st.c" -,"XCore/scotch/kgraph_store.c" -,"XCore/scotch/library_arch.c" -,"XCore/scotch/library_arch_f.c" -,"XCore/scotch/library_arch_build.c" -,"XCore/scotch/library_arch_build_f.c" -,"XCore/scotch/library_arch_dom.c" -,"XCore/scotch/library_arch_dom_f.c" -,"XCore/scotch/library_common_f.c" -,"XCore/scotch/library_context.c" -,"XCore/scotch/library_context_f.c" -,"XCore/scotch/library_context_graph.c" -,"XCore/scotch/library_context_graph_f.c" -,"XCore/scotch/library_context_mesh.c" -,"XCore/scotch/library_context_mesh_f.c" -,"XCore/scotch/library_geom.c" -,"XCore/scotch/library_geom_f.c" -,"XCore/scotch/library_graph.c" -,"XCore/scotch/library_graph_f.c" -,"XCore/scotch/library_graph_base.c" -,"XCore/scotch/library_graph_base_f.c" -,"XCore/scotch/library_graph_check.c" -,"XCore/scotch/library_graph_check_f.c" -,"XCore/scotch/library_graph_coarsen.c" -,"XCore/scotch/library_graph_coarsen_f.c" -,"XCore/scotch/library_graph_color.c" -,"XCore/scotch/library_graph_color_f.c" -,"XCore/scotch/library_graph_diam.c" -,"XCore/scotch/library_graph_diam_f.c" -,"XCore/scotch/library_graph_dump.c" -,"XCore/scotch/library_graph_induce.c" -,"XCore/scotch/library_graph_induce_f.c" -,"XCore/scotch/library_graph_io_chac.c" -,"XCore/scotch/library_graph_io_chac_f.c" -,"XCore/scotch/library_graph_io_habo.c" -,"XCore/scotch/library_graph_io_habo_f.c" -,"XCore/scotch/library_graph_io_mmkt.c" -,"XCore/scotch/library_graph_io_mmkt_f.c" -,"XCore/scotch/library_graph_io_scot.c" -,"XCore/scotch/library_graph_io_scot_f.c" -,"XCore/scotch/library_graph_map.c" -,"XCore/scotch/library_graph_map_f.c" -,"XCore/scotch/library_graph_map_io.c" -,"XCore/scotch/library_graph_map_io_f.c" -,"XCore/scotch/library_graph_map_view.c" -,"XCore/scotch/library_graph_map_view_f.c" -,"XCore/scotch/library_graph_order.c" -,"XCore/scotch/library_graph_order_f.c" -,"XCore/scotch/library_graph_part_ovl.c" -,"XCore/scotch/library_graph_part_ovl_f.c" -,"XCore/scotch/library_mapping.c" -,"XCore/scotch/library_memory.c" -,"XCore/scotch/library_memory_f.c" -,"XCore/scotch/library_mesh.c" -,"XCore/scotch/library_mesh_f.c" -,"XCore/scotch/library_mesh_graph.c" -,"XCore/scotch/library_mesh_graph_f.c" -,"XCore/scotch/library_mesh_io_habo.c" -,"XCore/scotch/library_mesh_io_habo_f.c" -,"XCore/scotch/library_mesh_io_scot.c" -,"XCore/scotch/library_mesh_io_scot_f.c" -,"XCore/scotch/library_mesh_order.c" -,"XCore/scotch/library_mesh_order_f.c" -,"XCore/scotch/library_order.c" -,"XCore/scotch/library_parser.c" -,"XCore/scotch/library_parser_f.c" -,"XCore/scotch/library_random.c" -,"XCore/scotch/library_random_f.c" -,"XCore/scotch/library_strat.c" -,"XCore/scotch/library_version.c" -,"XCore/scotch/library_version_f.c" -,"XCore/scotch/mapping.c" -,"XCore/scotch/mapping_io.c" -,"XCore/scotch/mesh.c" -,"XCore/scotch/mesh_check.c" -,"XCore/scotch/mesh_coarsen.c" -,"XCore/scotch/mesh_graph.c" -,"XCore/scotch/mesh_induce_sepa.c" -,"XCore/scotch/mesh_io.c" -,"XCore/scotch/mesh_io_habo.c" -,"XCore/scotch/mesh_io_scot.c" -,"XCore/scotch/order.c" -,"XCore/scotch/order_check.c" -,"XCore/scotch/order_io.c" -,"XCore/scotch/parser.c" -,"XCore/scotch/parser_ll.c" -,"XCore/scotch/parser_yy.c" -,"XCore/scotch/vgraph.c" -,"XCore/scotch/vgraph_check.c" -,"XCore/scotch/vgraph_separate_bd.c" -,"XCore/scotch/vgraph_separate_df.c" -,"XCore/scotch/vgraph_separate_es.c" -,"XCore/scotch/vgraph_separate_fm.c" -,"XCore/scotch/vgraph_separate_gg.c" -,"XCore/scotch/vgraph_separate_gp.c" -,"XCore/scotch/vgraph_separate_ml.c" -,"XCore/scotch/vgraph_separate_st.c" -,"XCore/scotch/vgraph_separate_th.c" -,"XCore/scotch/vgraph_separate_vw.c" -,"XCore/scotch/vgraph_separate_zr.c" -,"XCore/scotch/vgraph_store.c" -,"XCore/scotch/vmesh.c" -,"XCore/scotch/vmesh_check.c" -,"XCore/scotch/vmesh_separate_fm.c" -,"XCore/scotch/vmesh_separate_gg.c" -,"XCore/scotch/vmesh_separate_gr.c" -,"XCore/scotch/vmesh_separate_ml.c" -,"XCore/scotch/vmesh_separate_zr.c" -,"XCore/scotch/vmesh_separate_st.c" -,"XCore/scotch/vmesh_store.c" -,"XCore/scotch/wgraph.c" -,"XCore/scotch/wgraph_check.c" -,"XCore/scotch/wgraph_part_es.c" -,"XCore/scotch/wgraph_part_fm.c" -,"XCore/scotch/wgraph_part_ml.c" -,"XCore/scotch/wgraph_part_rb.c" -,"XCore/scotch/wgraph_part_st.c" -,"XCore/scotch/wgraph_part_zr.c" -,"XCore/scotch/wgraph_store.c" -,"XCore/scotch/library_error.c" -,"XCore/scotch/library_error_exit.c" -,"XCore/scotch/dummysizes.c" + "XCore/scotch/arch.c" + ,"XCore/scotch/arch_build.c" + ,"XCore/scotch/arch_build2.c" + ,"XCore/scotch/arch_cmplt.c" + ,"XCore/scotch/arch_cmpltw.c" + ,"XCore/scotch/arch_deco.c" + ,"XCore/scotch/arch_deco2.c" + ,"XCore/scotch/arch_dist.c" + ,"XCore/scotch/arch_hcub.c" + ,"XCore/scotch/arch_mesh.c" + ,"XCore/scotch/arch_sub.c" + ,"XCore/scotch/arch_tleaf.c" + ,"XCore/scotch/arch_torus.c" + ,"XCore/scotch/arch_vcmplt.c" + ,"XCore/scotch/arch_vhcub.c" + ,"XCore/scotch/bgraph.c" + ,"XCore/scotch/bgraph_bipart_bd.c" + ,"XCore/scotch/bgraph_bipart_df.c" + ,"XCore/scotch/bgraph_bipart_ex.c" + ,"XCore/scotch/bgraph_bipart_fm.c" + ,"XCore/scotch/bgraph_bipart_gg.c" + ,"XCore/scotch/bgraph_bipart_gp.c" + ,"XCore/scotch/bgraph_bipart_ml.c" + ,"XCore/scotch/bgraph_bipart_st.c" + ,"XCore/scotch/bgraph_bipart_zr.c" + ,"XCore/scotch/bgraph_check.c" + ,"XCore/scotch/bgraph_cost.c" + ,"XCore/scotch/bgraph_store.c" + ,"XCore/scotch/common.c" + ,"XCore/scotch/common_context.c" + ,"XCore/scotch/common_file.c" + ,"XCore/scotch/common_file_compress.c" + ,"XCore/scotch/common_file_decompress.c" + ,"XCore/scotch/common_integer.c" + ,"XCore/scotch/common_memory.c" + ,"XCore/scotch/common_string.c" + ,"XCore/scotch/common_stub.c" + ,"XCore/scotch/common_thread.c" + ,"XCore/scotch/common_thread_system.c" + ,"XCore/scotch/common_values.c" + ,"XCore/scotch/context.c" + ,"XCore/scotch/fibo.c" + ,"XCore/scotch/gain.c" + ,"XCore/scotch/geom.c" + ,"XCore/scotch/graph.c" + ,"XCore/scotch/graph_base.c" + ,"XCore/scotch/graph_band.c" + ,"XCore/scotch/graph_check.c" + ,"XCore/scotch/graph_clone.c" + ,"XCore/scotch/graph_coarsen.c" + ,"XCore/scotch/graph_diam.c" + ,"XCore/scotch/graph_dump.c" + ,"XCore/scotch/graph_ielo.c" + ,"XCore/scotch/graph_induce.c" + ,"XCore/scotch/graph_io.c" + ,"XCore/scotch/graph_io_chac.c" + ,"XCore/scotch/graph_io_habo.c" + ,"XCore/scotch/graph_io_mmkt.c" + ,"XCore/scotch/graph_io_scot.c" + ,"XCore/scotch/graph_list.c" + ,"XCore/scotch/graph_match.c" + ,"XCore/scotch/hall_order_hd.c" + ,"XCore/scotch/hall_order_hf.c" + ,"XCore/scotch/hall_order_hx.c" + ,"XCore/scotch/hgraph.c" + ,"XCore/scotch/hgraph_check.c" + ,"XCore/scotch/hgraph_dump.c" + ,"XCore/scotch/hgraph_induce.c" + ,"XCore/scotch/hgraph_order_bl.c" + ,"XCore/scotch/hgraph_order_cc.c" + ,"XCore/scotch/hgraph_order_cp.c" + ,"XCore/scotch/hgraph_order_gp.c" + ,"XCore/scotch/hgraph_order_hd.c" + ,"XCore/scotch/hgraph_order_hf.c" + ,"XCore/scotch/hgraph_order_hx.c" + ,"XCore/scotch/hgraph_order_kp.c" + ,"XCore/scotch/hgraph_order_nd.c" + ,"XCore/scotch/hgraph_order_si.c" + ,"XCore/scotch/hgraph_order_st.c" + ,"XCore/scotch/hmesh.c" + ,"XCore/scotch/hmesh_check.c" + ,"XCore/scotch/hmesh_hgraph.c" + ,"XCore/scotch/hmesh_induce.c" + ,"XCore/scotch/hmesh_mesh.c" + ,"XCore/scotch/hmesh_order_bl.c" + ,"XCore/scotch/hmesh_order_cp.c" + ,"XCore/scotch/hmesh_order_gr.c" + ,"XCore/scotch/hmesh_order_gp.c" + ,"XCore/scotch/hmesh_order_hd.c" + ,"XCore/scotch/hmesh_order_hf.c" + ,"XCore/scotch/hmesh_order_hx.c" + ,"XCore/scotch/hmesh_order_nd.c" + ,"XCore/scotch/hmesh_order_si.c" + ,"XCore/scotch/hmesh_order_st.c" + ,"XCore/scotch/kgraph.c" + ,"XCore/scotch/kgraph_band.c" + ,"XCore/scotch/kgraph_check.c" + ,"XCore/scotch/kgraph_map_bd.c" + ,"XCore/scotch/kgraph_map_cp.c" + ,"XCore/scotch/kgraph_map_df.c" + ,"XCore/scotch/kgraph_map_ex.c" + ,"XCore/scotch/kgraph_map_fm.c" + ,"XCore/scotch/kgraph_map_ml.c" + ,"XCore/scotch/kgraph_map_rb.c" + ,"XCore/scotch/kgraph_map_rb_map.c" + ,"XCore/scotch/kgraph_map_rb_part.c" + ,"XCore/scotch/kgraph_map_st.c" + ,"XCore/scotch/kgraph_store.c" + ,"XCore/scotch/library_arch.c" + ,"XCore/scotch/library_arch_f.c" + ,"XCore/scotch/library_arch_build.c" + ,"XCore/scotch/library_arch_build_f.c" + ,"XCore/scotch/library_arch_dom.c" + ,"XCore/scotch/library_arch_dom_f.c" + ,"XCore/scotch/library_common_f.c" + ,"XCore/scotch/library_context.c" + ,"XCore/scotch/library_context_f.c" + ,"XCore/scotch/library_context_graph.c" + ,"XCore/scotch/library_context_graph_f.c" + ,"XCore/scotch/library_context_mesh.c" + ,"XCore/scotch/library_context_mesh_f.c" + ,"XCore/scotch/library_geom.c" + ,"XCore/scotch/library_geom_f.c" + ,"XCore/scotch/library_graph.c" + ,"XCore/scotch/library_graph_f.c" + ,"XCore/scotch/library_graph_base.c" + ,"XCore/scotch/library_graph_base_f.c" + ,"XCore/scotch/library_graph_check.c" + ,"XCore/scotch/library_graph_check_f.c" + ,"XCore/scotch/library_graph_coarsen.c" + ,"XCore/scotch/library_graph_coarsen_f.c" + ,"XCore/scotch/library_graph_color.c" + ,"XCore/scotch/library_graph_color_f.c" + ,"XCore/scotch/library_graph_diam.c" + ,"XCore/scotch/library_graph_diam_f.c" + ,"XCore/scotch/library_graph_dump.c" + ,"XCore/scotch/library_graph_induce.c" + ,"XCore/scotch/library_graph_induce_f.c" + ,"XCore/scotch/library_graph_io_chac.c" + ,"XCore/scotch/library_graph_io_chac_f.c" + ,"XCore/scotch/library_graph_io_habo.c" + ,"XCore/scotch/library_graph_io_habo_f.c" + ,"XCore/scotch/library_graph_io_mmkt.c" + ,"XCore/scotch/library_graph_io_mmkt_f.c" + ,"XCore/scotch/library_graph_io_scot.c" + ,"XCore/scotch/library_graph_io_scot_f.c" + ,"XCore/scotch/library_graph_map.c" + ,"XCore/scotch/library_graph_map_f.c" + ,"XCore/scotch/library_graph_map_io.c" + ,"XCore/scotch/library_graph_map_io_f.c" + ,"XCore/scotch/library_graph_map_view.c" + ,"XCore/scotch/library_graph_map_view_f.c" + ,"XCore/scotch/library_graph_order.c" + ,"XCore/scotch/library_graph_order_f.c" + ,"XCore/scotch/library_graph_part_ovl.c" + ,"XCore/scotch/library_graph_part_ovl_f.c" + ,"XCore/scotch/library_mapping.c" + ,"XCore/scotch/library_memory.c" + ,"XCore/scotch/library_memory_f.c" + ,"XCore/scotch/library_mesh.c" + ,"XCore/scotch/library_mesh_f.c" + ,"XCore/scotch/library_mesh_graph.c" + ,"XCore/scotch/library_mesh_graph_f.c" + ,"XCore/scotch/library_mesh_io_habo.c" + ,"XCore/scotch/library_mesh_io_habo_f.c" + ,"XCore/scotch/library_mesh_io_scot.c" + ,"XCore/scotch/library_mesh_io_scot_f.c" + ,"XCore/scotch/library_mesh_order.c" + ,"XCore/scotch/library_mesh_order_f.c" + ,"XCore/scotch/library_order.c" + ,"XCore/scotch/library_parser.c" + ,"XCore/scotch/library_parser_f.c" + ,"XCore/scotch/library_random.c" + ,"XCore/scotch/library_random_f.c" + ,"XCore/scotch/library_strat.c" + ,"XCore/scotch/library_version.c" + ,"XCore/scotch/library_version_f.c" + ,"XCore/scotch/mapping.c" + ,"XCore/scotch/mapping_io.c" + ,"XCore/scotch/mesh.c" + ,"XCore/scotch/mesh_check.c" + ,"XCore/scotch/mesh_coarsen.c" + ,"XCore/scotch/mesh_graph.c" + ,"XCore/scotch/mesh_induce_sepa.c" + ,"XCore/scotch/mesh_io.c" + ,"XCore/scotch/mesh_io_habo.c" + ,"XCore/scotch/mesh_io_scot.c" + ,"XCore/scotch/order.c" + ,"XCore/scotch/order_check.c" + ,"XCore/scotch/order_io.c" + ,"XCore/scotch/parser.c" + ,"XCore/scotch/parser_ll.c" + ,"XCore/scotch/parser_yy.c" + ,"XCore/scotch/vgraph.c" + ,"XCore/scotch/vgraph_check.c" + ,"XCore/scotch/vgraph_separate_bd.c" + ,"XCore/scotch/vgraph_separate_df.c" + ,"XCore/scotch/vgraph_separate_es.c" + ,"XCore/scotch/vgraph_separate_fm.c" + ,"XCore/scotch/vgraph_separate_gg.c" + ,"XCore/scotch/vgraph_separate_gp.c" + ,"XCore/scotch/vgraph_separate_ml.c" + ,"XCore/scotch/vgraph_separate_st.c" + ,"XCore/scotch/vgraph_separate_th.c" + ,"XCore/scotch/vgraph_separate_vw.c" + ,"XCore/scotch/vgraph_separate_zr.c" + ,"XCore/scotch/vgraph_store.c" + ,"XCore/scotch/vmesh.c" + ,"XCore/scotch/vmesh_check.c" + ,"XCore/scotch/vmesh_separate_fm.c" + ,"XCore/scotch/vmesh_separate_gg.c" + ,"XCore/scotch/vmesh_separate_gr.c" + ,"XCore/scotch/vmesh_separate_ml.c" + ,"XCore/scotch/vmesh_separate_zr.c" + ,"XCore/scotch/vmesh_separate_st.c" + ,"XCore/scotch/vmesh_store.c" + ,"XCore/scotch/wgraph.c" + ,"XCore/scotch/wgraph_check.c" + ,"XCore/scotch/wgraph_part_es.c" + ,"XCore/scotch/wgraph_part_fm.c" + ,"XCore/scotch/wgraph_part_ml.c" + ,"XCore/scotch/wgraph_part_rb.c" + ,"XCore/scotch/wgraph_part_st.c" + ,"XCore/scotch/wgraph_part_zr.c" + ,"XCore/scotch/wgraph_store.c" + ,"XCore/scotch/library_error.c" + ,"XCore/scotch/library_error_exit.c" + ,"XCore/scotch/dummysizes.c" ] # lib ptscotch cpp_srcs2 = [ -"XCore/scotch/bdgraph.c" -,"XCore/scotch/bdgraph_bipart_bd.c" -,"XCore/scotch/bdgraph_bipart_df.c" -,"XCore/scotch/bdgraph_bipart_ex.c" -,"XCore/scotch/bdgraph_bipart_ml.c" -,"XCore/scotch/bdgraph_bipart_sq.c" -,"XCore/scotch/bdgraph_bipart_st.c" -,"XCore/scotch/bdgraph_bipart_zr.c" -,"XCore/scotch/bdgraph_check.c" -,"XCore/scotch/bdgraph_gather_all.c" -,"XCore/scotch/bdgraph_store.c" -,"XCore/scotch/comm.c" -,"XCore/scotch/dgraph.c" -,"XCore/scotch/dgraph_allreduce.c" -,"XCore/scotch/dgraph_band.c" -,"XCore/scotch/dgraph_build.c" -,"XCore/scotch/dgraph_build_grid3d.c" -,"XCore/scotch/dgraph_build_hcub.c" -,"XCore/scotch/dgraph_check.c" -,"XCore/scotch/dgraph_coarsen.c" -,"XCore/scotch/dgraph_compact.c" -,"XCore/scotch/dgraph_fold.c" -,"XCore/scotch/dgraph_fold_comm.c" -,"XCore/scotch/dgraph_fold_dup.c" -,"XCore/scotch/dgraph_gather.c" -,"XCore/scotch/dgraph_gather_all.c" -,"XCore/scotch/dgraph_ghst.c" -,"XCore/scotch/dgraph_halo.c" -,"XCore/scotch/dgraph_induce.c" -,"XCore/scotch/dgraph_io_load.c" -,"XCore/scotch/dgraph_io_save.c" -,"XCore/scotch/dgraph_match.c" -,"XCore/scotch/dgraph_match_sync_coll.c" -,"XCore/scotch/dgraph_match_sync_ptop.c" -,"XCore/scotch/dgraph_match_check.c" -,"XCore/scotch/dgraph_redist.c" -,"XCore/scotch/dgraph_scatter.c" -,"XCore/scotch/dgraph_view.c" -,"XCore/scotch/dmapping.c" -,"XCore/scotch/dmapping_io.c" -,"XCore/scotch/dorder.c" -,"XCore/scotch/dorder_gather.c" -,"XCore/scotch/dorder_io.c" -,"XCore/scotch/dorder_io_block.c" -,"XCore/scotch/dorder_io_tree.c" -,"XCore/scotch/dorder_perm.c" -,"XCore/scotch/dorder_tree_dist.c" -,"XCore/scotch/hdgraph.c" -,"XCore/scotch/hdgraph_check.c" -,"XCore/scotch/hdgraph_fold.c" -,"XCore/scotch/hdgraph_gather.c" -,"XCore/scotch/hdgraph_induce.c" -,"XCore/scotch/hdgraph_order_nd.c" -,"XCore/scotch/hdgraph_order_si.c" -,"XCore/scotch/hdgraph_order_sq.c" -,"XCore/scotch/hdgraph_order_st.c" -,"XCore/scotch/kdgraph.c" -,"XCore/scotch/kdgraph_gather.c" -,"XCore/scotch/kdgraph_map_rb.c" -,"XCore/scotch/kdgraph_map_rb_map.c" -,"XCore/scotch/kdgraph_map_rb_part.c" -,"XCore/scotch/kdgraph_map_st.c" -,"XCore/scotch/library_context_dgraph.c" -,"XCore/scotch/library_context_dgraph_f.c" -,"XCore/scotch/library_dgraph.c" -,"XCore/scotch/library_dgraph_f.c" -,"XCore/scotch/library_dgraph_band.c" -,"XCore/scotch/library_dgraph_band_f.c" -,"XCore/scotch/library_dgraph_build.c" -,"XCore/scotch/library_dgraph_build_f.c" -,"XCore/scotch/library_dgraph_build_grid3d.c" -,"XCore/scotch/library_dgraph_build_grid3d_f.c" -,"XCore/scotch/library_dgraph_check.c" -,"XCore/scotch/library_dgraph_check_f.c" -,"XCore/scotch/library_dgraph_coarsen.c" -,"XCore/scotch/library_dgraph_coarsen_f.c" -,"XCore/scotch/library_dgraph_gather.c" -,"XCore/scotch/library_dgraph_gather_f.c" -,"XCore/scotch/library_dgraph_grow.c" -,"XCore/scotch/library_dgraph_halo.c" -,"XCore/scotch/library_dgraph_halo_f.c" -,"XCore/scotch/library_dgraph_induce.c" -,"XCore/scotch/library_dgraph_induce_f.c" -,"XCore/scotch/library_dgraph_io_load.c" -,"XCore/scotch/library_dgraph_io_load_f.c" -,"XCore/scotch/library_dgraph_io_save.c" -,"XCore/scotch/library_dgraph_io_save_f.c" -,"XCore/scotch/library_dgraph_map.c" -,"XCore/scotch/library_dgraph_map_f.c" -,"XCore/scotch/library_dgraph_map_view.c" -,"XCore/scotch/library_dgraph_map_view_f.c" -,"XCore/scotch/library_dgraph_order.c" -,"XCore/scotch/library_dgraph_order_f.c" -,"XCore/scotch/library_dgraph_order_gather.c" -,"XCore/scotch/library_dgraph_order_gather_f.c" -,"XCore/scotch/library_dgraph_order_io.c" -,"XCore/scotch/library_dgraph_order_io_f.c" -,"XCore/scotch/library_dgraph_order_io_block.c" -,"XCore/scotch/library_dgraph_order_io_block_f.c" -,"XCore/scotch/library_dgraph_order_perm.c" -,"XCore/scotch/library_dgraph_order_perm_f.c" -,"XCore/scotch/library_dgraph_order_tree_dist.c" -,"XCore/scotch/library_dgraph_order_tree_dist_f.c" -,"XCore/scotch/library_dgraph_redist.c" -,"XCore/scotch/library_dgraph_redist_f.c" -,"XCore/scotch/library_dgraph_scatter.c" -,"XCore/scotch/library_dgraph_scatter_f.c" -,"XCore/scotch/library_dgraph_stat.c" -,"XCore/scotch/library_dgraph_stat_f.c" -,"XCore/scotch/library_dmapping.c" -,"XCore/scotch/library_dorder.c" -,"XCore/scotch/vdgraph.c" -,"XCore/scotch/vdgraph_check.c" -,"XCore/scotch/vdgraph_gather_all.c" -,"XCore/scotch/vdgraph_separate_bd.c" -,"XCore/scotch/vdgraph_separate_df.c" -,"XCore/scotch/vdgraph_separate_ml.c" -,"XCore/scotch/vdgraph_separate_sq.c" -,"XCore/scotch/vdgraph_separate_st.c" -,"XCore/scotch/vdgraph_separate_zr.c" -,"XCore/scotch/vdgraph_store.c" + "XCore/scotch/bdgraph.c" + ,"XCore/scotch/bdgraph_bipart_bd.c" + ,"XCore/scotch/bdgraph_bipart_df.c" + ,"XCore/scotch/bdgraph_bipart_ex.c" + ,"XCore/scotch/bdgraph_bipart_ml.c" + ,"XCore/scotch/bdgraph_bipart_sq.c" + ,"XCore/scotch/bdgraph_bipart_st.c" + ,"XCore/scotch/bdgraph_bipart_zr.c" + ,"XCore/scotch/bdgraph_check.c" + ,"XCore/scotch/bdgraph_gather_all.c" + ,"XCore/scotch/bdgraph_store.c" + ,"XCore/scotch/comm.c" + ,"XCore/scotch/dgraph.c" + ,"XCore/scotch/dgraph_allreduce.c" + ,"XCore/scotch/dgraph_band.c" + ,"XCore/scotch/dgraph_build.c" + ,"XCore/scotch/dgraph_build_grid3d.c" + ,"XCore/scotch/dgraph_build_hcub.c" + ,"XCore/scotch/dgraph_check.c" + ,"XCore/scotch/dgraph_coarsen.c" + ,"XCore/scotch/dgraph_compact.c" + ,"XCore/scotch/dgraph_fold.c" + ,"XCore/scotch/dgraph_fold_comm.c" + ,"XCore/scotch/dgraph_fold_dup.c" + ,"XCore/scotch/dgraph_gather.c" + ,"XCore/scotch/dgraph_gather_all.c" + ,"XCore/scotch/dgraph_ghst.c" + ,"XCore/scotch/dgraph_halo.c" + ,"XCore/scotch/dgraph_induce.c" + ,"XCore/scotch/dgraph_io_load.c" + ,"XCore/scotch/dgraph_io_save.c" + ,"XCore/scotch/dgraph_match.c" + ,"XCore/scotch/dgraph_match_sync_coll.c" + ,"XCore/scotch/dgraph_match_sync_ptop.c" + ,"XCore/scotch/dgraph_match_check.c" + ,"XCore/scotch/dgraph_redist.c" + ,"XCore/scotch/dgraph_scatter.c" + ,"XCore/scotch/dgraph_view.c" + ,"XCore/scotch/dmapping.c" + ,"XCore/scotch/dmapping_io.c" + ,"XCore/scotch/dorder.c" + ,"XCore/scotch/dorder_gather.c" + ,"XCore/scotch/dorder_io.c" + ,"XCore/scotch/dorder_io_block.c" + ,"XCore/scotch/dorder_io_tree.c" + ,"XCore/scotch/dorder_perm.c" + ,"XCore/scotch/dorder_tree_dist.c" + ,"XCore/scotch/hdgraph.c" + ,"XCore/scotch/hdgraph_check.c" + ,"XCore/scotch/hdgraph_fold.c" + ,"XCore/scotch/hdgraph_gather.c" + ,"XCore/scotch/hdgraph_induce.c" + ,"XCore/scotch/hdgraph_order_nd.c" + ,"XCore/scotch/hdgraph_order_si.c" + ,"XCore/scotch/hdgraph_order_sq.c" + ,"XCore/scotch/hdgraph_order_st.c" + ,"XCore/scotch/kdgraph.c" + ,"XCore/scotch/kdgraph_gather.c" + ,"XCore/scotch/kdgraph_map_rb.c" + ,"XCore/scotch/kdgraph_map_rb_map.c" + ,"XCore/scotch/kdgraph_map_rb_part.c" + ,"XCore/scotch/kdgraph_map_st.c" + ,"XCore/scotch/library_context_dgraph.c" + ,"XCore/scotch/library_context_dgraph_f.c" + ,"XCore/scotch/library_dgraph.c" + ,"XCore/scotch/library_dgraph_f.c" + ,"XCore/scotch/library_dgraph_band.c" + ,"XCore/scotch/library_dgraph_band_f.c" + ,"XCore/scotch/library_dgraph_build.c" + ,"XCore/scotch/library_dgraph_build_f.c" + ,"XCore/scotch/library_dgraph_build_grid3d.c" + ,"XCore/scotch/library_dgraph_build_grid3d_f.c" + ,"XCore/scotch/library_dgraph_check.c" + ,"XCore/scotch/library_dgraph_check_f.c" + ,"XCore/scotch/library_dgraph_coarsen.c" + ,"XCore/scotch/library_dgraph_coarsen_f.c" + ,"XCore/scotch/library_dgraph_gather.c" + ,"XCore/scotch/library_dgraph_gather_f.c" + ,"XCore/scotch/library_dgraph_grow.c" + ,"XCore/scotch/library_dgraph_halo.c" + ,"XCore/scotch/library_dgraph_halo_f.c" + ,"XCore/scotch/library_dgraph_induce.c" + ,"XCore/scotch/library_dgraph_induce_f.c" + ,"XCore/scotch/library_dgraph_io_load.c" + ,"XCore/scotch/library_dgraph_io_load_f.c" + ,"XCore/scotch/library_dgraph_io_save.c" + ,"XCore/scotch/library_dgraph_io_save_f.c" + ,"XCore/scotch/library_dgraph_map.c" + ,"XCore/scotch/library_dgraph_map_f.c" + ,"XCore/scotch/library_dgraph_map_view.c" + ,"XCore/scotch/library_dgraph_map_view_f.c" + ,"XCore/scotch/library_dgraph_order.c" + ,"XCore/scotch/library_dgraph_order_f.c" + ,"XCore/scotch/library_dgraph_order_gather.c" + ,"XCore/scotch/library_dgraph_order_gather_f.c" + ,"XCore/scotch/library_dgraph_order_io.c" + ,"XCore/scotch/library_dgraph_order_io_f.c" + ,"XCore/scotch/library_dgraph_order_io_block.c" + ,"XCore/scotch/library_dgraph_order_io_block_f.c" + ,"XCore/scotch/library_dgraph_order_perm.c" + ,"XCore/scotch/library_dgraph_order_perm_f.c" + ,"XCore/scotch/library_dgraph_order_tree_dist.c" + ,"XCore/scotch/library_dgraph_order_tree_dist_f.c" + ,"XCore/scotch/library_dgraph_redist.c" + ,"XCore/scotch/library_dgraph_redist_f.c" + ,"XCore/scotch/library_dgraph_scatter.c" + ,"XCore/scotch/library_dgraph_scatter_f.c" + ,"XCore/scotch/library_dgraph_stat.c" + ,"XCore/scotch/library_dgraph_stat_f.c" + ,"XCore/scotch/library_dmapping.c" + ,"XCore/scotch/library_dorder.c" + ,"XCore/scotch/vdgraph.c" + ,"XCore/scotch/vdgraph_check.c" + ,"XCore/scotch/vdgraph_gather_all.c" + ,"XCore/scotch/vdgraph_separate_bd.c" + ,"XCore/scotch/vdgraph_separate_df.c" + ,"XCore/scotch/vdgraph_separate_ml.c" + ,"XCore/scotch/vdgraph_separate_sq.c" + ,"XCore/scotch/vdgraph_separate_st.c" + ,"XCore/scotch/vdgraph_separate_zr.c" + ,"XCore/scotch/vdgraph_store.c" ] - diff --git a/Cassiopee/XCore/srcs_zoltan.py b/Cassiopee/XCore/srcs_zoltan.py index a2c4da1a7..22f3238e8 100644 --- a/Cassiopee/XCore/srcs_zoltan.py +++ b/Cassiopee/XCore/srcs_zoltan.py @@ -2,85 +2,85 @@ # Fichiers c++ #============================================================================== -cpp_srcs = ['all/all_allo.c', 'all/all_allo_const.h', - 'ch/ch_dist_graph.c', 'ch/ch_init_dist.c', - 'ch/ch_input_assign.c', - 'ch/ch_input_geom.c', 'ch/ch_input_graph.c', 'ch/ch_input_read.c', - 'coloring/bucket.c', 'coloring/coloring.c', - 'coloring/color_test.c', - 'coloring/g2l_hash.c', - 'graph/graph.c', - 'ha/divide_machine.c', 'ha/get_processor_name.c', - 'ha/ha_ovis.c', 'hier/hier.c', - 'hier/hier_free_struct.c', 'hsfc/hsfc.c', 'hsfc/hsfc_box_assign.c', - 'hsfc/hsfc_hilbert.c', - 'hsfc/hsfc_point_assign.c', +cpp_srcs = ['all/all_allo.c', 'all/all_allo_const.h', + 'ch/ch_dist_graph.c', 'ch/ch_init_dist.c', + 'ch/ch_input_assign.c', + 'ch/ch_input_geom.c', 'ch/ch_input_graph.c', 'ch/ch_input_read.c', + 'coloring/bucket.c', 'coloring/coloring.c', + 'coloring/color_test.c', + 'coloring/g2l_hash.c', + 'graph/graph.c', + 'ha/divide_machine.c', 'ha/get_processor_name.c', + 'ha/ha_ovis.c', 'hier/hier.c', + 'hier/hier_free_struct.c', 'hsfc/hsfc.c', 'hsfc/hsfc_box_assign.c', + 'hsfc/hsfc_hilbert.c', + 'hsfc/hsfc_point_assign.c', 'lb/lb_balance.c', 'lb/lb_box_assign.c', - 'lb/lb_copy.c', 'lb/lb_eval.c', 'lb/lb_free.c', 'lb/lb_init.c', - 'lb/lb_invert.c', 'lb/lb_migrate.c', 'lb/lb_part2proc.c', 'lb/lb_point_assign.c', - 'lb/lb_remap.c', 'lb/lb_set_fn.c', 'lb/lb_set_method.c', 'lb/lb_set_part_sizes.c', - 'lb/low_mem_lb_migrate.c', 'matrix/matrix_build.c', 'matrix/matrix_distribute.c', - 'matrix/matrix_operations.c', 'matrix/matrix_sym.c', 'matrix/matrix_utils.c', - 'order/hsfcOrder.c', - 'order/order.c', 'order/order_struct.c', - 'order/order_tools.c', 'order/perm.c', 'par/par_average.c', - 'par/par_bisect.c', 'par/par_median.c', - 'par/par_median_randomized.c', 'par/par_stats.c', - 'par/par_sync.c', 'par/par_tflops_special.c', - 'params/assign_param_vals.c', 'params/bind_param.c', 'params/check_param.c', - 'params/free_params.c', 'params/key_params.c', - 'params/print_params.c', 'params/set_param.c', - 'phg/phg.c', 'phg/phg_build.c', 'phg/phg_build_calls.c', + 'lb/lb_copy.c', 'lb/lb_eval.c', 'lb/lb_free.c', 'lb/lb_init.c', + 'lb/lb_invert.c', 'lb/lb_migrate.c', 'lb/lb_part2proc.c', 'lb/lb_point_assign.c', + 'lb/lb_remap.c', 'lb/lb_set_fn.c', 'lb/lb_set_method.c', 'lb/lb_set_part_sizes.c', + 'lb/low_mem_lb_migrate.c', 'matrix/matrix_build.c', 'matrix/matrix_distribute.c', + 'matrix/matrix_operations.c', 'matrix/matrix_sym.c', 'matrix/matrix_utils.c', + 'order/hsfcOrder.c', + 'order/order.c', 'order/order_struct.c', + 'order/order_tools.c', 'order/perm.c', 'par/par_average.c', + 'par/par_bisect.c', 'par/par_median.c', + 'par/par_median_randomized.c', 'par/par_stats.c', + 'par/par_sync.c', 'par/par_tflops_special.c', + 'params/assign_param_vals.c', 'params/bind_param.c', 'params/check_param.c', + 'params/free_params.c', 'params/key_params.c', + 'params/print_params.c', 'params/set_param.c', + 'phg/phg.c', 'phg/phg_build.c', 'phg/phg_build_calls.c', 'phg/phg_coarse.c', 'phg/phg_comm.c', - 'phg/phg_distrib.c', 'phg/phg_gather.c', 'phg/phg_hypergraph.c', - 'phg/phg_lookup.c', 'phg/phg_match.c', - 'phg/phg_order.c', 'phg/phg_parkway.c', 'phg/phg_partition_tree.c', - 'phg/phg_patoh.c', 'phg/phg_plot.c', 'phg/phg_rdivide.c', 'phg/phg_refinement.c', - 'phg/phg_scale.c', 'phg/phg_serialpartition.c', 'phg/phg_tree.c', - 'phg/phg_two_ways.c', 'phg/phg_util.c','phg/phg_Vcycle.c', - 'phg/phg_verbose.c', 'rcb/box_assign.c', 'rcb/create_proc_list.c', - 'rcb/inertial1d.c', 'rcb/inertial2d.c', - 'rcb/inertial3d.c', 'rcb/point_assign.c', 'rcb/rcb.c', 'rcb/rcb_box.c', - 'rcb/rcb_partition_tree.c', 'rcb/rcb_util.c', - 'rcb/rib.c', 'rcb/rib_util.c', - 'rcb/shared.c', 'reftree/reftree_build.c', - 'reftree/reftree_coarse_path.c', 'reftree/reftree_hash.c', - 'reftree/reftree_part.c', 'simple/block.c', 'simple/cyclic.c', 'simple/random.c', - 'tpls/build_graph.c', 'tpls/parmetis_interface.c', - 'tpls/postprocessing.c', - 'tpls/preprocessing.c', 'tpls/scatter_graph.c', - 'tpls/third_library.c', - 'tpls/verify_graph.c', 'Utilities/Timer/timer.c', - 'Utilities/Timer/zoltan_timer.c', 'zz/murmur3.c', - 'zz/zz_back_trace.c', 'zz/zz_coord.c', 'zz/zz_gen_files.c', - 'zz/zz_hash.c','zz/zz_heap.c', - 'zz/zz_init.c', 'zz/zz_map.c', 'zz/zz_obj_list.c', 'zz/zz_rand.c', + 'phg/phg_distrib.c', 'phg/phg_gather.c', 'phg/phg_hypergraph.c', + 'phg/phg_lookup.c', 'phg/phg_match.c', + 'phg/phg_order.c', 'phg/phg_parkway.c', 'phg/phg_partition_tree.c', + 'phg/phg_patoh.c', 'phg/phg_plot.c', 'phg/phg_rdivide.c', 'phg/phg_refinement.c', + 'phg/phg_scale.c', 'phg/phg_serialpartition.c', 'phg/phg_tree.c', + 'phg/phg_two_ways.c', 'phg/phg_util.c','phg/phg_Vcycle.c', + 'phg/phg_verbose.c', 'rcb/box_assign.c', 'rcb/create_proc_list.c', + 'rcb/inertial1d.c', 'rcb/inertial2d.c', + 'rcb/inertial3d.c', 'rcb/point_assign.c', 'rcb/rcb.c', 'rcb/rcb_box.c', + 'rcb/rcb_partition_tree.c', 'rcb/rcb_util.c', + 'rcb/rib.c', 'rcb/rib_util.c', + 'rcb/shared.c', 'reftree/reftree_build.c', + 'reftree/reftree_coarse_path.c', 'reftree/reftree_hash.c', + 'reftree/reftree_part.c', 'simple/block.c', 'simple/cyclic.c', 'simple/random.c', + 'tpls/build_graph.c', 'tpls/parmetis_interface.c', + 'tpls/postprocessing.c', + 'tpls/preprocessing.c', 'tpls/scatter_graph.c', + 'tpls/third_library.c', + 'tpls/verify_graph.c', 'Utilities/Timer/timer.c', + 'Utilities/Timer/zoltan_timer.c', 'zz/murmur3.c', + 'zz/zz_back_trace.c', 'zz/zz_coord.c', 'zz/zz_gen_files.c', + 'zz/zz_hash.c','zz/zz_heap.c', + 'zz/zz_init.c', 'zz/zz_map.c', 'zz/zz_obj_list.c', 'zz/zz_rand.c', 'zz/zz_set_fn.c', 'zz/zz_sort.c', 'zz/zz_struct.c', 'zz/zz_util.c', - 'driver/dr_dd.c', 'driver/dr_ddCPP.cpp', - 'driver/dr_elem.c', 'driver/dr_elem_util.c', - 'driver/dr_err.c', - 'driver/dr_eval.c', + 'driver/dr_dd.c', 'driver/dr_ddCPP.cpp', + 'driver/dr_elem.c', 'driver/dr_elem_util.c', + 'driver/dr_err.c', + 'driver/dr_eval.c', 'driver/dr_gnuplot.c', - 'driver/dr_migrate.c', - 'driver/dr_input.c', 'driver/dr_loadbal.c', - 'driver/dr_setfixed.c', 'driver/dr_util.c', - 'driver/order_test.c', - 'driver/dr_par_util.c', 'driver/dr_random_io.c', - 'driver/dr_output.c', 'driver/dr_param_file.c', - 'driver/dr_maps.c', 'driver/dr_main.c', + 'driver/dr_migrate.c', + 'driver/dr_input.c', 'driver/dr_loadbal.c', + 'driver/dr_setfixed.c', 'driver/dr_util.c', + 'driver/order_test.c', + 'driver/dr_par_util.c', 'driver/dr_random_io.c', + 'driver/dr_output.c', 'driver/dr_param_file.c', + 'driver/dr_maps.c', 'driver/dr_main.c', 'driver/dr_hg_readfile.c', 'driver/dr_hg_io.c', - 'driver/dr_exoII_io.c', 'driver/dr_chaco_io.c', - 'driver/dr_mmio.c', 'driver/dr_mm_readfile.c', + 'driver/dr_exoII_io.c', 'driver/dr_chaco_io.c', + 'driver/dr_mmio.c', 'driver/dr_mm_readfile.c', ] others=[ - 'order/hund.c', 'timer/timer_params.c', - 'tpls/scotch_interface.c', - 'driver/dr_exoII_ioCPP.cpp', - 'driver/dr_migrateCPP.cpp', - 'driver/dr_compress.c', - 'driver/dr_loadbalCPP.cpp', - 'driver/dr_mainCPP.cpp', 'driver/dr_mapsCPP.cpp', - 'driver/dr_param_fileCPP.cpp', - 'fort/cwrap.c' ] + 'order/hund.c', 'timer/timer_params.c', + 'tpls/scotch_interface.c', + 'driver/dr_exoII_ioCPP.cpp', + 'driver/dr_migrateCPP.cpp', + 'driver/dr_compress.c', + 'driver/dr_loadbalCPP.cpp', + 'driver/dr_mainCPP.cpp', 'driver/dr_mapsCPP.cpp', + 'driver/dr_param_fileCPP.cpp', + 'fort/cwrap.c' ] f90_srcs= ['fdriver/fdr_chaco_io.f90', 'fdriver/fdr_const.f90', 'fdriver/fdr_input.f90', 'fdriver/fdr_loadbal.f90', 'fdriver/fdr_main.f90', 'fdriver/fdr_migrate.f90', 'fdriver/fdr_mm_io.f90', 'fdriver/fdr_param_file.f90', 'fdriver/fdr_sort.f90', 'fort/fwrap.f90', 'fort/zoltan_user_data.f90', 'fort/ztypes.f90'] diff --git a/Cassiopee/XCore/test/elementSplitSmallTest.py b/Cassiopee/XCore/test/elementSplitSmallTest.py index df5832445..0679eee3d 100755 --- a/Cassiopee/XCore/test/elementSplitSmallTest.py +++ b/Cassiopee/XCore/test/elementSplitSmallTest.py @@ -23,7 +23,7 @@ elt2vert_glob = np.empty(8*nb_procs, np.int32) for i in range(0,2*nb_procs): elt2vert_glob[4*i:4*(i+1)] = [i+1,i+2,i+3,i+4] - if (i%2 == 1) : + if (i%2 == 1) : elt2vert_glob[4*i+1],elt2vert_glob[4*i+2] = elt2vert_glob[4*i+2],elt2vert_glob[4*i+1] nb_vert_glob = elt2vert_glob[-1] coords_glob = np.empty((3,nb_vert_glob), np.double) diff --git a/Cassiopee/XCore/test/t1.py b/Cassiopee/XCore/test/t1.py index 22b2efe80..249868907 100644 --- a/Cassiopee/XCore/test/t1.py +++ b/Cassiopee/XCore/test/t1.py @@ -1,3 +1,3 @@ # XCore installation test import KCore.Dist as Dist -Dist.checkModuleImport('XCore') +Dist.checkModuleImport('XCore')