From 90b7698c1ea1da4af04aba4f951f274b94b3d5c2 Mon Sep 17 00:00:00 2001 From: vincentcasseau Date: Tue, 15 Oct 2024 12:06:11 +0200 Subject: [PATCH] PyPI: fix install on azure with prodmode 2 --- .github/workflows/publish-pypi.yml.disabled | 91 -------------- Cassiopee/CPlot/install | 2 +- Cassiopee/Compressor/install | 2 +- Cassiopee/Connector/install | 2 +- Cassiopee/Converter/install | 2 +- Cassiopee/Dist2Walls/install | 2 +- Cassiopee/Generator/install | 2 +- Cassiopee/Geom/install | 2 +- Cassiopee/Initiator/install | 2 +- Cassiopee/Intersector/install | 2 +- Cassiopee/KCore/installBase.py | 2 +- Cassiopee/OCC/install | 2 +- Cassiopee/Post/install | 2 +- Cassiopee/RigidMotion/install | 2 +- Cassiopee/Template/install | 2 +- Cassiopee/Transform/install | 2 +- .../XCore/XCore/AdaptMesh/AdaptMesh_Init.cpp | 2 +- Cassiopee/XCore/XCore/AdaptMesh/MeshInit.cpp | 8 +- .../XCore/{AdaptMesh => common}/Karray.cpp | 0 .../XCore/{AdaptMesh => common}/Karray.h | 8 +- .../intersectMesh/IntersectMesh_Init.cpp | 4 +- .../XCore/XCore/intersectMesh/extract.cpp | 6 +- .../XCore/intersectMesh/intersectMesh.cpp | 4 +- .../XCore/XCore/intersectMesh/karray.cpp | 116 ------------------ Cassiopee/XCore/XCore/intersectMesh/karray.h | 43 ------- .../prepareMeshesForIntersection.cpp | 4 +- .../removeIntersectingKPlanes.cpp | 10 +- Cassiopee/XCore/srcs.py | 5 +- 28 files changed, 37 insertions(+), 294 deletions(-) delete mode 100644 .github/workflows/publish-pypi.yml.disabled rename Cassiopee/XCore/XCore/{AdaptMesh => common}/Karray.cpp (100%) rename Cassiopee/XCore/XCore/{AdaptMesh => common}/Karray.h (90%) delete mode 100644 Cassiopee/XCore/XCore/intersectMesh/karray.cpp delete mode 100644 Cassiopee/XCore/XCore/intersectMesh/karray.h diff --git a/.github/workflows/publish-pypi.yml.disabled b/.github/workflows/publish-pypi.yml.disabled deleted file mode 100644 index a38b9804b..000000000 --- a/.github/workflows/publish-pypi.yml.disabled +++ /dev/null @@ -1,91 +0,0 @@ -name: publish PyPI - -on: - push: - tags: - - 'v*' - branches: - - 'main' - -jobs: - build: - runs-on: ubuntu-latest -# strategy: -# matrix: -# python-version: ["3.8", "3.12"] - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.8" -# python-version: ${{ matrix.python-version }} - - - name: Install system dependencies - run: | - sudo apt-get update && sudo apt-get install -y \ - gcc \ - g++ \ - gfortran \ - libopenmpi-dev \ - libhdf5-openmpi-dev \ - python3-tk \ - mesa-common-dev \ - libgl1-mesa-dev \ - libglu1-mesa-dev \ - libosmesa6-dev \ - xorg-dev - - - name: Install Python dependencies - run: | - python -m pip install --upgrade pip - pip install wheel twine auditwheel setuptools scons numpy mpi4py - - - name: Verify Python and Installed Packages - run: | - python --version - python -m pip list - - - name: Build Cassiopee package - run: | - export CASSIOPEE=$GITHUB_WORKSPACE - export MACHINE=azure - . $CASSIOPEE/Cassiopee/Envs/sh_Cassiopee_r8 - cd $CASSIOPEE/Cassiopee - echo -e "FREEMODULES='KCore XCore Converter Geom Transform Generator Post Initiator Connector Distributor2 Dist2Walls RigidMotion Compressor Modeler Intersector Apps CPlot'\nexport FREEMODULES\nFULLMODULES='KCore XCore Converter Geom Transform Generator Post Initiator Connector Distributor2 Dist2Walls RigidMotion Compressor Modeler Intersector Apps CPlot'\nexport FULLMODULES\nOTHERS=''" > $CASSIOPEE/Cassiopee/MODULES - ./install - - - name: Publish to PyPI - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: | - export CASSIOPEE=$GITHUB_WORKSPACE - export MACHINE=azure - . $CASSIOPEE/Cassiopee/Envs/sh_Cassiopee_r8 - for wheel in $(find $CASSIOPEE/Dist/bin/$ELSAPROD/pip-ephem-wheel-cache-* -type f -name "*.whl"); do - echo "$wheel" - auditwheel -v repair "$wheel" - done - find $CASSIOPEE/Dist/bin/$ELSAPROD/pip-ephem-wheel-cache-* -type f -name "*manylinux*.whl" -exec twine upload {} + - -# publish: -# runs-on: ubuntu-latest -# needs: build -# steps: -# - name: Checkout repository -# uses: actions/checkout@v3 -# -# - name: Set up Python -# uses: actions/setup-python@v4 -# with: -# python-version: "3.12" -# -# - name: Publish to PyPI -# env: -# TWINE_USERNAME: __token__ -# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} -# run: find -name "*.whl" -exec twine upload {} + diff --git a/Cassiopee/CPlot/install b/Cassiopee/CPlot/install index 39cb57ef3..b8b0503f2 100755 --- a/Cassiopee/CPlot/install +++ b/Cassiopee/CPlot/install @@ -35,7 +35,7 @@ if [ "$PRODMODE" = "" ]; then fi # Compilation et installation -if [ $PRODMODE -le 1 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS" diff --git a/Cassiopee/Compressor/install b/Cassiopee/Compressor/install index af6b0b760..910f3de10 100755 --- a/Cassiopee/Compressor/install +++ b/Cassiopee/Compressor/install @@ -34,7 +34,7 @@ if [ "$PRODMODE" = "" ]; then fi # Compilation et installation -if [ $PRODMODE -le 1 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS" diff --git a/Cassiopee/Connector/install b/Cassiopee/Connector/install index a8db417ab..d905493a8 100755 --- a/Cassiopee/Connector/install +++ b/Cassiopee/Connector/install @@ -37,7 +37,7 @@ if [ "$PRODMODE" = "" ]; then fi # Compilation et installation -if [ $PRODMODE -le 1 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS" diff --git a/Cassiopee/Converter/install b/Cassiopee/Converter/install index 5cb16852c..cf2752626 100755 --- a/Cassiopee/Converter/install +++ b/Cassiopee/Converter/install @@ -37,7 +37,7 @@ if [ "$PRODMODE" = "" ]; then fi # Compilation et installation -if [ $PRODMODE -le 1 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS" diff --git a/Cassiopee/Dist2Walls/install b/Cassiopee/Dist2Walls/install index cc718056e..b37856812 100755 --- a/Cassiopee/Dist2Walls/install +++ b/Cassiopee/Dist2Walls/install @@ -35,7 +35,7 @@ if [ "$PRODMODE" = "" ]; then fi # Compilation et installation -if [ $PRODMODE -le 1 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS" diff --git a/Cassiopee/Generator/install b/Cassiopee/Generator/install index a0c02b05c..32d9a656c 100755 --- a/Cassiopee/Generator/install +++ b/Cassiopee/Generator/install @@ -37,7 +37,7 @@ if [ "$PRODMODE" = "" ]; then fi # Compilation et installation -if [ $PRODMODE -le 1 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS" diff --git a/Cassiopee/Geom/install b/Cassiopee/Geom/install index ff6e2820b..7fc0c39a6 100755 --- a/Cassiopee/Geom/install +++ b/Cassiopee/Geom/install @@ -38,7 +38,7 @@ if [ "$PRODMODE" = "" ]; then fi # Compilation et installation -if [ $PRODMODE -le 1 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS" diff --git a/Cassiopee/Initiator/install b/Cassiopee/Initiator/install index c54a8f254..63649a79d 100755 --- a/Cassiopee/Initiator/install +++ b/Cassiopee/Initiator/install @@ -38,7 +38,7 @@ if [ "$PRODMODE" = "" ]; then fi # Compilation et installation -if [ $PRODMODE -le 1 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS" diff --git a/Cassiopee/Intersector/install b/Cassiopee/Intersector/install index 01dca21f6..07a53845d 100755 --- a/Cassiopee/Intersector/install +++ b/Cassiopee/Intersector/install @@ -38,7 +38,7 @@ if [ "$PRODMODE" = "" ]; then fi # Compilation et installation -if [ $PRODMODE -le 1 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS" diff --git a/Cassiopee/KCore/installBase.py b/Cassiopee/KCore/installBase.py index 61d25d877..f1dce2ac9 100644 --- a/Cassiopee/KCore/installBase.py +++ b/Cassiopee/KCore/installBase.py @@ -728,7 +728,7 @@ [] # NvccAdditionalOptions ], ############################################################################### -'azure': [ 'Linux ubuntu 24.04 - Github Actions', +'azure': [ 'Linux ubuntu 20.04 - Github Actions', 'gfortran', # f77compiler 'gfortran', # f90compiler 'gcc', # Cppcompiler diff --git a/Cassiopee/OCC/install b/Cassiopee/OCC/install index c3020c72b..086cfd691 100755 --- a/Cassiopee/OCC/install +++ b/Cassiopee/OCC/install @@ -41,7 +41,7 @@ fi #cd .. # Compilation et installation -if [ $PRODMODE -le 1 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS" diff --git a/Cassiopee/Post/install b/Cassiopee/Post/install index 6ef6bdafc..370f6c959 100755 --- a/Cassiopee/Post/install +++ b/Cassiopee/Post/install @@ -37,7 +37,7 @@ if [ "$PRODMODE" = "" ]; then fi # Compilation et installation -if [ $PRODMODE -le 1 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS" diff --git a/Cassiopee/RigidMotion/install b/Cassiopee/RigidMotion/install index 7675ce80d..973815d1f 100755 --- a/Cassiopee/RigidMotion/install +++ b/Cassiopee/RigidMotion/install @@ -35,7 +35,7 @@ if [ "$PRODMODE" = "" ]; then fi # Compilation et installation -if [ $PRODMODE -le 1 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS" diff --git a/Cassiopee/Template/install b/Cassiopee/Template/install index c5fce0977..4f486d0d6 100755 --- a/Cassiopee/Template/install +++ b/Cassiopee/Template/install @@ -35,7 +35,7 @@ if [ "$PRODMODE" = "" ]; then fi # Compilation et installation -if [ $PRODMODE -le 0 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS" diff --git a/Cassiopee/Transform/install b/Cassiopee/Transform/install index 2f7714289..067cdfbee 100755 --- a/Cassiopee/Transform/install +++ b/Cassiopee/Transform/install @@ -37,7 +37,7 @@ if [ "$PRODMODE" = "" ]; then fi # Compilation et installation -if [ $PRODMODE -le 1 ]; then +if [ $PRODMODE -le 2 ]; then sconsf=`which scons` if [ "$OMP_NUM_THREADS" != "" ]; then export SCONSOPT="-j $OMP_NUM_THREADS" diff --git a/Cassiopee/XCore/XCore/AdaptMesh/AdaptMesh_Init.cpp b/Cassiopee/XCore/XCore/AdaptMesh/AdaptMesh_Init.cpp index a327ed29f..cfba3d336 100644 --- a/Cassiopee/XCore/XCore/AdaptMesh/AdaptMesh_Init.cpp +++ b/Cassiopee/XCore/XCore/AdaptMesh/AdaptMesh_Init.cpp @@ -17,7 +17,7 @@ along with Cassiopee. If not, see . */ #include "Mesh.h" -#include "Karray.h" +#include "common/Karray.h" #include "common/mem.h" PyObject *K_XCORE::AdaptMesh_Init(PyObject *self, PyObject *args) diff --git a/Cassiopee/XCore/XCore/AdaptMesh/MeshInit.cpp b/Cassiopee/XCore/XCore/AdaptMesh/MeshInit.cpp index e3025d9ff..aa11d9067 100644 --- a/Cassiopee/XCore/XCore/AdaptMesh/MeshInit.cpp +++ b/Cassiopee/XCore/XCore/AdaptMesh/MeshInit.cpp @@ -17,7 +17,7 @@ along with Cassiopee. If not, see . */ #include "Mesh.h" -#include "Karray.h" +#include "common/Karray.h" #include "common/mem.h" Mesh::Mesh() @@ -87,9 +87,9 @@ Mesh::Mesh() Mesh *Mesh_from_Karray(Karray *karray) { E_Int np = karray->npoints(); - E_Float *X = karray->X(); - E_Float *Y = karray->Y(); - E_Float *Z = karray->Z(); + E_Float *X = karray->x; + E_Float *Y = karray->y; + E_Float *Z = karray->z; E_Int nf = karray->nfaces(); diff --git a/Cassiopee/XCore/XCore/AdaptMesh/Karray.cpp b/Cassiopee/XCore/XCore/common/Karray.cpp similarity index 100% rename from Cassiopee/XCore/XCore/AdaptMesh/Karray.cpp rename to Cassiopee/XCore/XCore/common/Karray.cpp diff --git a/Cassiopee/XCore/XCore/AdaptMesh/Karray.h b/Cassiopee/XCore/XCore/common/Karray.h similarity index 90% rename from Cassiopee/XCore/XCore/AdaptMesh/Karray.h rename to Cassiopee/XCore/XCore/common/Karray.h index 5710a9e74..6d960b89e 100644 --- a/Cassiopee/XCore/XCore/AdaptMesh/Karray.h +++ b/Cassiopee/XCore/XCore/common/Karray.h @@ -43,10 +43,6 @@ struct Karray { inline E_Int *ngon() const { return cn->getNGon(); } inline E_Int *nface() const { return cn->getNFace(); } - inline E_Float *X() const { return x; } - inline E_Float *Y() const { return y; } - inline E_Float *Z() const { return z; } - inline E_Int *get_face(E_Int face, E_Int &np) const { return cn->getFace(face, np, ngon(), indpg()); } @@ -54,7 +50,7 @@ struct Karray { { return cn->getElt(cell, nf, nface(), indph()); } inline E_Int orient_boundary() - { return K_CONNECT::orient_boundary_ngon(X(), Y(), Z(), *cn); } + { return K_CONNECT::orient_boundary_ngon(x, y, z, *cn); } inline E_Int build_parent_elements(E_Int *owner, E_Int *neigh) { return K_CONNECT::build_parent_elements_ngon(*cn, owner, neigh); } @@ -66,4 +62,4 @@ E_Int Karray_parse_ngon(PyObject *pyobject, Karray &karray); void Karray_free_structured(Karray &karray); -E_Int Karray_parse_structured(PyObject *pyobject, Karray &karray); \ No newline at end of file +E_Int Karray_parse_structured(PyObject *pyobject, Karray &karray); diff --git a/Cassiopee/XCore/XCore/intersectMesh/IntersectMesh_Init.cpp b/Cassiopee/XCore/XCore/intersectMesh/IntersectMesh_Init.cpp index ca555d7cf..294eee1e1 100644 --- a/Cassiopee/XCore/XCore/intersectMesh/IntersectMesh_Init.cpp +++ b/Cassiopee/XCore/XCore/intersectMesh/IntersectMesh_Init.cpp @@ -17,7 +17,7 @@ along with Cassiopee. If not, see . */ #include "mesh.h" -#include "karray.h" +#include "common/Karray.h" //#include "BVH.h" PyObject *K_XCORE::IntersectMesh_Init(PyObject *self, PyObject *args) @@ -39,7 +39,7 @@ PyObject *K_XCORE::IntersectMesh_Init(PyObject *self, PyObject *args) // Init mesh - IMesh *M = new IMesh(*karray.cn, karray.X, karray.Y, karray.Z, karray.npts); + IMesh *M = new IMesh(*karray.cn, karray.x, karray.y, karray.z, karray.npts); /* M->make_skin(); puts("Making BVH"); diff --git a/Cassiopee/XCore/XCore/intersectMesh/extract.cpp b/Cassiopee/XCore/XCore/intersectMesh/extract.cpp index ea70443d9..406de4999 100644 --- a/Cassiopee/XCore/XCore/intersectMesh/extract.cpp +++ b/Cassiopee/XCore/XCore/intersectMesh/extract.cpp @@ -1,5 +1,5 @@ #include "mesh.h" -#include "karray.h" +#include "common/Karray.h" PyObject *K_XCORE::extractCell(PyObject *self, PyObject *args) { @@ -19,7 +19,7 @@ PyObject *K_XCORE::extractCell(PyObject *self, PyObject *args) if (ret != 0) return NULL; - IMesh M(*marray.cn, marray.X, marray.Y, marray.Z, marray.npts); + IMesh M(*marray.cn, marray.x, marray.y, marray.z, marray.npts); IMesh M_out; @@ -91,4 +91,4 @@ PyObject *K_XCORE::extractCell(PyObject *self, PyObject *args) return M_out.export_karray(); -} \ No newline at end of file +} diff --git a/Cassiopee/XCore/XCore/intersectMesh/intersectMesh.cpp b/Cassiopee/XCore/XCore/intersectMesh/intersectMesh.cpp index 289ddc829..b70089049 100644 --- a/Cassiopee/XCore/XCore/intersectMesh/intersectMesh.cpp +++ b/Cassiopee/XCore/XCore/intersectMesh/intersectMesh.cpp @@ -17,7 +17,7 @@ along with Cassiopee. If not, see . */ #include "xcore.h" -#include "karray.h" +#include "common/Karray.h" #include "common/common.h" #include "mesh.h" #include "smesh.h" @@ -312,7 +312,7 @@ PyObject *K_XCORE::intersectMesh(PyObject *self, PyObject *args) } // Init and orient master/slave meshes - IMesh S(*sarray.cn, sarray.X, sarray.Y, sarray.Z, sarray.npts); + IMesh S(*sarray.cn, sarray.x, sarray.y, sarray.z, sarray.npts); M.make_skin(); S.make_skin(); diff --git a/Cassiopee/XCore/XCore/intersectMesh/karray.cpp b/Cassiopee/XCore/XCore/intersectMesh/karray.cpp deleted file mode 100644 index 19fed4c35..000000000 --- a/Cassiopee/XCore/XCore/intersectMesh/karray.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - Copyright 2013-2024 Onera. - - This file is part of Cassiopee. - - Cassiopee is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Cassiopee is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Cassiopee. If not, see . -*/ -#include "karray.h" -#include "common/common.h" - -void Karray_free_ngon(Karray &karray) -{ - RELEASESHAREDU(karray.pyobject, karray.f, karray.cn); -} - -E_Int Karray_parse_ngon(PyObject *pyobject, Karray &karray) -{ - E_Int ret; - - char *varString; - char *eltType; - - ret = K_ARRAY::getFromArray3(pyobject, varString, karray.f, karray.ni, - karray.nj, karray.nk, karray.cn, eltType); - - if (ret <= 0) { - RAISE("Bad input array."); - return 1; - } - - if (ret == 1) { - RAISE("IMesh should be an NGon."); - Karray_free_structured(karray); - return 1; - } - - E_Int posx = K_ARRAY::isCoordinateXPresent(varString); - E_Int posy = K_ARRAY::isCoordinateYPresent(varString); - E_Int posz = K_ARRAY::isCoordinateZPresent(varString); - - if (posx == -1 || posy == -1 || posz == -1) { - Karray_free_ngon(karray); - RAISE("Coordinates not found."); - return 1; - } - - posx++; posy++; posz++; - - karray.X = karray.f->begin(posx); - karray.Y = karray.f->begin(posy); - karray.Z = karray.f->begin(posz); - karray.npts = karray.f->getSize(); - - karray.pyobject = pyobject; - - return 0; -} - -void Karray_free_structured(Karray &karray) -{ - RELEASESHAREDS(karray.pyobject, karray.f); -} - -E_Int Karray_parse_structured(PyObject *pyobject, Karray &karray) -{ - E_Int ret; - - char *varString; - char *eltType; - - ret = K_ARRAY::getFromArray3(pyobject, varString, karray.f, karray.ni, - karray.nj, karray.nk, karray.cn, eltType); - - if (ret <= 0) { - RAISE("Bad input array"); - return 1; - } - - if (ret != 1) { - RAISE("IMesh should be structured."); - RELEASESHAREDB(ret, pyobject, karray.f, karray.cn); - return 1; - } - - E_Int posx = K_ARRAY::isCoordinateXPresent(varString); - E_Int posy = K_ARRAY::isCoordinateYPresent(varString); - E_Int posz = K_ARRAY::isCoordinateZPresent(varString); - - if (posx == -1 || posy == -1 || posz == -1) { - RAISE("Coordinates not found"); - Karray_free_structured(karray); - return 1; - } - - posx++; posy++; posz++; - - karray.X = karray.f->begin(posx); - karray.Y = karray.f->begin(posy); - karray.Z = karray.f->begin(posz); - karray.npts = karray.f->getSize(); - - karray.pyobject = pyobject; - - return 0; -} \ No newline at end of file diff --git a/Cassiopee/XCore/XCore/intersectMesh/karray.h b/Cassiopee/XCore/XCore/intersectMesh/karray.h deleted file mode 100644 index c504d363f..000000000 --- a/Cassiopee/XCore/XCore/intersectMesh/karray.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2013-2024 Onera. - - This file is part of Cassiopee. - - Cassiopee is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Cassiopee is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Cassiopee. If not, see . -*/ -#pragma once - -#include "xcore.h" -#include "common/common.h" - -struct Karray { - // Reference to the python array - PyObject *pyobject; - - K_FLD::FldArrayF *f; - E_Int ni, nj, nk; - - K_FLD::FldArrayI *cn; - - E_Float *X, *Y, *Z; - E_Int npts; -}; - -void Karray_free_ngon(Karray &karray); - -E_Int Karray_parse_ngon(PyObject *pyobject, Karray &karray); - -void Karray_free_structured(Karray &karray); - -E_Int Karray_parse_structured(PyObject *pyobject, Karray &karray); \ No newline at end of file diff --git a/Cassiopee/XCore/XCore/intersectMesh/prepareMeshesForIntersection.cpp b/Cassiopee/XCore/XCore/intersectMesh/prepareMeshesForIntersection.cpp index 37516a1d6..7f5618355 100644 --- a/Cassiopee/XCore/XCore/intersectMesh/prepareMeshesForIntersection.cpp +++ b/Cassiopee/XCore/XCore/intersectMesh/prepareMeshesForIntersection.cpp @@ -17,7 +17,7 @@ along with Cassiopee. If not, see . */ #include "xcore.h" -#include "karray.h" +#include "common/Karray.h" #include "common/common.h" #include "mesh.h" #include "smesh.h" @@ -79,7 +79,7 @@ PyObject *K_XCORE::prepareMeshesForIntersection(PyObject *self, PyObject *args) // TODO(Imad): quasi-planar surfaces // Init master/slave meshes - IMesh S(*sarray.cn, sarray.X, sarray.Y, sarray.Z, sarray.npts); + IMesh S(*sarray.cn, sarray.x, sarray.y, sarray.z, sarray.npts); S.make_skin(); for (E_Int fid : S.skin) { diff --git a/Cassiopee/XCore/XCore/intersectMesh/removeIntersectingKPlanes.cpp b/Cassiopee/XCore/XCore/intersectMesh/removeIntersectingKPlanes.cpp index c74d7d91f..7a8316cf2 100644 --- a/Cassiopee/XCore/XCore/intersectMesh/removeIntersectingKPlanes.cpp +++ b/Cassiopee/XCore/XCore/intersectMesh/removeIntersectingKPlanes.cpp @@ -18,7 +18,7 @@ */ #include "xcore.h" #include "common/common.h" -#include "karray.h" +#include "common/Karray.h" #include "mesh.h" #include "ray.h" #include "io.h" @@ -63,9 +63,9 @@ PyObject *handle_slave(IMesh *M, Karray& sarray) E_Int nk = sarray.nk; E_Int nij = ni * nj; - E_Float *Xs = sarray.X; - E_Float *Ys = sarray.Y; - E_Float *Zs = sarray.Z; + E_Float *Xs = sarray.x; + E_Float *Ys = sarray.y; + E_Float *Zs = sarray.z; // Last k-plane outside of M std::vector kmax(nij, -1); @@ -422,4 +422,4 @@ PyObject *K_XCORE::removeIntersectingKPlanes(PyObject *self, PyObject *args) } return slaves_out; -} \ No newline at end of file +} diff --git a/Cassiopee/XCore/srcs.py b/Cassiopee/XCore/srcs.py index 63a8a5686..f3737a047 100644 --- a/Cassiopee/XCore/srcs.py +++ b/Cassiopee/XCore/srcs.py @@ -19,6 +19,7 @@ 'XCore/common/mem.cpp', 'XCore/common/common.cpp', + 'XCore/common/Karray.cpp', 'XCore/intersectMesh/BVH.cpp', 'XCore/intersectMesh/AABB.cpp', @@ -40,7 +41,6 @@ 'XCore/intersectMesh/hedge.cpp', 'XCore/intersectMesh/face.cpp', 'XCore/intersectMesh/vertex.cpp', - 'XCore/intersectMesh/event.cpp', 'XCore/intersectMesh/status.cpp', 'XCore/intersectMesh/snode.cpp', 'XCore/intersectMesh/queue.cpp', @@ -56,7 +56,6 @@ 'XCore/intersectMesh/triangle.cpp', 'XCore/intersectMesh/point.cpp', 'XCore/intersectMesh/ray.cpp', - 'XCore/intersectMesh/karray.cpp', 'XCore/intersectMesh/meshExport.cpp', @@ -93,8 +92,6 @@ 'XCore/AdaptMesh/Tri.cpp', 'XCore/AdaptMesh/Edge.cpp', - - 'XCore/AdaptMesh/Karray.cpp' ] if mpi: # source that requires mpi cpp_srcs += [