Skip to content

Commit 56e49e7

Browse files
authored
Merge pull request #455 from LIHPC-Computational-Geometry/blocking_deactivation
Blocking deactivation
2 parents 1b94d51 + 0dfa958 commit 56e49e7

10 files changed

Lines changed: 66 additions & 29 deletions

File tree

.github/workflows/continuous-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
-DWITH_CODE_COVERAGE:BOOL=OFF
6363
-DWITH_PYTHON_API:BOOL=ON
6464
-DENABLE_BLOCK_MESHER:BOOL=ON
65-
-DENABLE_BLOCKING:BOOL=ON
65+
-DENABLE_BLOCKING:BOOL=OFF
6666
-DENABLE_AERO:BOOL=ON
6767
-DENABLE_DUAL_BLOCKING:BOOL=OFF
6868
-DENABLE_ELG3D:BOOL=OFF

.github/workflows/continuous-ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
-DWITH_PYTHON_API:BOOL=OFF
6161
-DWITH_TEST:BOOL=ON
6262
-DENABLE_BLOCK_MESHER:BOOL=ON
63-
-DENABLE_BLOCKING:BOOL=ON
63+
-DENABLE_BLOCKING:BOOL=OFF
6464
-DENABLE_AERO:BOOL=ON
6565
-DENABLE_DUAL_BLOCKING:BOOL=OFF
6666
-DENABLE_ELG3D:BOOL=OFF

core/blocking/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ set(GMDS_INC
1616
inc/gmds/blocking/SheetCollapse.h)
1717

1818
if(WITH_CGNS)
19-
message(TEST)
2019
set(GMDS_INC ${GMDS_INC} inc/gmds/blocking/CGNSWriter.h
2120
)
2221
endif()

core/blocking/inc/gmds/blocking/CGNSWriter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
/*----------------------------------------------------------------------------*/
1010
#include <cgnslib.h>
1111
/*----------------------------------------------------------------------------*/
12-
#include "LIB_GMDS_BLOCKING_export.h"
12+
#include "GMDSBlocking_export.h"
1313
#include "gmds/ig/Blocking2D.h"
1414
/*----------------------------------------------------------------------------*/
1515
namespace gmds {
1616

1717
namespace blocking {
1818

19-
class LIB_GMDS_BLOCKING_API CGNSWriter
19+
class GMDSBlocking_API CGNSWriter
2020
{
2121
public:
2222
/** @brief Constructor

modules/aero/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ generate_export_header(${GMDS_LIB}
163163
#==============================================================================
164164
include(GNUInstallDirs)
165165

166+
if(WITH_CGNS)
167+
include (${CMAKE_SOURCE_DIR}/cmake/FindCgns.cmake)
168+
endif()
169+
166170
#LIBRARY TO INSTALL
167171
target_link_libraries(${GMDS_LIB} PUBLIC
168172
${LIB_GMDS_IG}
@@ -176,6 +180,11 @@ target_link_libraries(${GMDS_LIB} PUBLIC
176180
GMDSSmoothy
177181
ANN
178182
)
183+
if(WITH_CGNS)
184+
target_link_libraries(${GMDS_LIB} PUBLIC
185+
cgns::cgns
186+
)
187+
endif ()
179188

180189
target_compile_features(${GMDS_LIB} PUBLIC cxx_std_14)
181190

modules/aero/src/CGNSWriter3D.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ CGNSWriter3D::CGNSWriter3D(Blocking3D *ABlocking)
2626
{}
2727
/*----------------------------------------------------------------------------*/
2828
CGNSWriter3D::CGNSWriter3D(Mesh *AMesh)
29-
:m_mesh(AMesh),m_blocks(nullptr)
29+
:m_mesh(nullptr),m_blocks(AMesh)
3030
{}
3131
/*----------------------------------------------------------------------------*/
3232
CGNSWriter3D::CGNSWriter3D()
@@ -182,7 +182,7 @@ void CGNSWriter3D::writeZones()
182182
idinter1 = 1;
183183
idmax1 = 2;
184184
break;
185-
case 2:
185+
case 1:
186186
pts1[0] = 1;
187187
pts1[1] = 1;
188188
pts1[2] = 1;
@@ -199,7 +199,7 @@ void CGNSWriter3D::writeZones()
199199
idinter1 = 1;
200200
idmax1 = 5;
201201
break;
202-
case 5:
202+
case 2:
203203
pts1[0] = discrI;
204204
pts1[1] = 1;
205205
pts1[2] = 1;
@@ -250,7 +250,7 @@ void CGNSWriter3D::writeZones()
250250
idinter1 = 3;
251251
idmax1 = 7;
252252
break;
253-
case 1:
253+
case 5:
254254
pts1[0] = 1; // X1
255255
pts1[1] = 1; // Y1
256256
pts1[2] = discrK; // Z1
@@ -509,7 +509,7 @@ void CGNSWriter3D::writeZones()
509509
pts_bc[4] = discrJ; // Y2
510510
pts_bc[5] = 1; // Z2
511511
break;
512-
case 2:
512+
case 1:
513513
pts_bc[0] = 1;
514514
pts_bc[1] = 1;
515515
pts_bc[2] = 1;
@@ -518,7 +518,7 @@ void CGNSWriter3D::writeZones()
518518
pts_bc[4] = 1;
519519
pts_bc[5] = discrK;
520520
break;
521-
case 5:
521+
case 2:
522522
pts_bc[0] = discrI;
523523
pts_bc[1] = 1;
524524
pts_bc[2] = 1;
@@ -545,7 +545,7 @@ void CGNSWriter3D::writeZones()
545545
pts_bc[4] = discrJ;
546546
pts_bc[5] = discrK;
547547
break;
548-
case 1:
548+
case 5:
549549
pts_bc[0] = 1; // X1
550550
pts_bc[1] = 1; // Y1
551551
pts_bc[2] = discrK; // Z1
@@ -622,11 +622,11 @@ void CGNSWriter3D::write(const std::string &AInFileName, const std::string &AOut
622622
vtkReader.read(AInFileName);
623623
624624
std::cout<<"End reading"<<std::endl;
625-
625+
*/
626626
MeshDoctor doc(m_blocks);
627627
doc.buildFacesAndR2F();
628628
doc.buildF2R(m_blocks->getModel());
629-
*/
629+
630630
m_block_grid = m_blocks->newVariable<std::vector<TCellID>,GMDS_REGION>("block_grid");
631631

632632
VarDiscrI = m_blocks->getVariable<int,GMDS_REGION>("discrI");

modules/aero/src/main.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Created by Claire Roche on 21/10/2021.
33
/*------------------------------------------------------------------------*/
44
#ifdef USE_CGNS
5-
#include <gmds/blocking/CGNSWriter.h>
5+
//#include <gmds/blocking/CGNSWriter.h>
66
#include <gmds/aero/CGNSWriter3D.h>
77
#endif
88
#include <gmds/aero/AbstractAeroPipeline.h>
@@ -41,8 +41,9 @@ int main(int argc, char* argv[])
4141

4242
if (aero2D_result == AbstractAeroPipeline::SUCCESS) {
4343
#ifdef USE_CGNS
44-
blocking::CGNSWriter writer(algo_aero2D.getBlocking());
45-
writer.write(output_file, dir);
44+
45+
//blocking::CGNSWriter writer(algo_aero2D.getBlocking());
46+
//writer.write(output_file, dir);
4647
#else
4748
std::cout << "CGNS export is desactivated" << std::endl;
4849
#endif

modules/aero/tst/AeroPipelineTestSuite.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <iostream>
1313
#include <unit_test_config.h>
1414
#ifdef USE_CGNS
15-
#include <gmds/blocking/CGNSWriter.h>
15+
//#include <gmds/blocking/CGNSWriter.h>
1616
#endif
1717
/*----------------------------------------------------------------------------*/
1818
using namespace gmds;
@@ -40,8 +40,8 @@ TEST(AeroPipelineTestClass, DISABLED_AeroPipeline2D_Test1)
4040
AbstractAeroPipeline::STATUS aero2D_result = algo_aero2D.execute();
4141

4242
#ifdef USE_CGNS
43-
blocking::CGNSWriter writer(algo_aero2D.getBlocking());
44-
writer.write("AeroPipeline_2D.cgns", "");
43+
//blocking::CGNSWriter writer(algo_aero2D.getBlocking());
44+
//writer.write("AeroPipeline_2D.cgns", "");
4545
#endif
4646

4747
ASSERT_EQ(AbstractAeroPipeline::SUCCESS, aero2D_result);

pygmds/CMakeLists.txt

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,33 @@ cmake_minimum_required(VERSION 3.10)
33

44
find_package(pybind11 REQUIRED)
55

6-
pybind11_add_module(gmds
7-
src/binding_math.cpp
6+
SET(PYBIND11_SRC
7+
src/binding_math.cpp
88
src/binding_mesh.cpp
99
src/binding_geometry.cpp
10-
src/binding_blocking.cpp
1110
src/gmds_facade.cpp
12-
)
11+
)
12+
if(ENABLE_BLOCKING)
13+
list(APPEND PYBIND11_SRC
14+
src/binding_blocking.cpp
15+
)
16+
endif ()
17+
18+
pybind11_add_module(gmds
19+
${PYBIND11_SRC}
20+
)
1321

1422
target_link_libraries(gmds PRIVATE
1523
${LIB_GMDS_IG}
1624
${LIB_GMDS_CADFAC}
17-
LIB_GMDS_BLOCKING
1825
${LIB_GMDS_IO}
1926
)
27+
if(ENABLE_BLOCKING)
28+
target_link_libraries(gmds PRIVATE
29+
${LIB_GMDS_BLOCKING}
30+
)
31+
endif ()
32+
2033
target_compile_definitions(gmds PUBLIC cxx_std_14)
2134

2235
install(TARGETS gmds
@@ -26,4 +39,4 @@ install(TARGETS gmds
2639
#==============================================================================
2740
if(WITH_TEST)
2841
add_subdirectory(tst)
29-
endif(WITH_TEST)
42+
endif(WITH_TEST)

pygmds/tst/CMakeLists.txt

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
#==============================================================================
22
message("ENVIRONMENT ENVPYTHONPATH $ENV{PYTHONPATH}")
33

4-
add_test(NAME test_pygmds
5-
COMMAND pytest ${CMAKE_CURRENT_SOURCE_DIR} ${TEST_SAMPLES_DIR} -v
4+
add_test(NAME test_pygmds_mesh
5+
COMMAND pytest ${CMAKE_CURRENT_SOURCE_DIR}/test_mesh.py ${TEST_SAMPLES_DIR} -v
66
)
7-
set_tests_properties(test_pygmds
7+
add_test(NAME test_pygmds_geometry
8+
COMMAND pytest ${CMAKE_CURRENT_SOURCE_DIR}/test_geometry.py ${TEST_SAMPLES_DIR} -v
9+
)
10+
if(ENABLE_BLOCKING)
11+
add_test(NAME test_pygmds_blocking
12+
COMMAND pytest ${CMAKE_CURRENT_SOURCE_DIR}/test_blocking.py ${TEST_SAMPLES_DIR} -v
13+
)
14+
endif ()
15+
16+
set_tests_properties(test_pygmds_mesh
17+
PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/pygmds:$ENV{PYTHONPATH}")
18+
set_tests_properties(test_pygmds_geometry
819
PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/pygmds:$ENV{PYTHONPATH}")
20+
if(ENABLE_BLOCKING)
21+
set_tests_properties(test_pygmds_blocking
22+
PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/pygmds:$ENV{PYTHONPATH}")
23+
endif ()
924
#==============================================================================

0 commit comments

Comments
 (0)