Skip to content

Commit 90348cd

Browse files
authored
Merge pull request #468 from LIHPC-Computational-Geometry/cgns_generacity
Cgns generacity
2 parents dc0833a + e82b86f commit 90348cd

File tree

6 files changed

+1034
-711
lines changed

6 files changed

+1034
-711
lines changed

modules/aero/CMakeLists.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ set(GMDS_INC
7575
inc/gmds/aero/Utils.h
7676
)
7777
if(WITH_CGNS)
78-
set(GMDS_INC ${GMDS_INC} inc/gmds/aero/CGNSWriter3D.h
78+
set(GMDS_INC ${GMDS_INC} inc/gmds/aero/CGNSWriterND.h
7979
)
8080
endif()
8181

@@ -148,7 +148,7 @@ set(GMDS_SRC
148148
src/main.cpp
149149
)
150150
if(WITH_CGNS)
151-
set(GMDS_SRC ${GMDS_SRC} src/CGNSWriter3D.cpp
151+
set(GMDS_SRC ${GMDS_SRC} src/CGNSWriterND.cpp
152152
)
153153
endif()
154154
#==============================================================================
@@ -186,6 +186,7 @@ if(WITH_CGNS)
186186
)
187187
endif ()
188188

189+
189190
target_compile_features(${GMDS_LIB} PUBLIC cxx_std_14)
190191

191192
# INCLUDE TO INSTALL
@@ -210,11 +211,13 @@ endif(WITH_TEST)
210211
#==============================================================================
211212
# EXECUTABLE
212213
#==============================================================================
213-
add_executable(Aero src/main.cpp)
214-
target_link_libraries(Aero PRIVATE ${GMDS_LIB})
215-
target_compile_features(Aero PUBLIC cxx_std_14)
216-
install(TARGETS Aero)
214+
if(WITH_CGNS)
215+
add_executable(Aero src/main.cpp)
216+
target_link_libraries(Aero PRIVATE ${GMDS_LIB})
217+
target_compile_features(Aero PUBLIC cxx_std_14)
218+
install(TARGETS Aero)
217219

218-
add_executable(aero_dev src/main_dev.cpp)
219-
target_link_libraries(aero_dev PRIVATE ${GMDS_LIB})
220-
target_compile_features(aero_dev PUBLIC cxx_std_14)
220+
add_executable(aero_dev src/main_dev.cpp)
221+
target_link_libraries(aero_dev PRIVATE ${GMDS_LIB})
222+
target_compile_features(aero_dev PUBLIC cxx_std_14)
223+
endif ()

modules/aero/inc/gmds/aero/CGNSWriter3D.h renamed to modules/aero/inc/gmds/aero/CGNSWriterND.h

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Created by calderans on 29/06/23.
33
//
44

5-
#ifndef GMDS_CGNSWRITER3D_H
6-
#define GMDS_CGNSWRITER3D_H
5+
#ifndef GMDS_CGNSWRITERND_H
6+
#define GMDS_CGNSWRITERND_H
77
/*----------------------------------------------------------------------------*/
88
#include <sstream>
99
/*----------------------------------------------------------------------------*/
@@ -17,29 +17,26 @@ namespace gmds {
1717

1818
namespace aero {
1919

20-
class GMDSAero_API CGNSWriter3D
20+
class GMDSAero_API CGNSWriterND
2121
{
2222
public:
2323
/** @brief Constructor
2424
*
2525
* @param AMeshService an implementation of an io service to write data
2626
* into a mesh
2727
*/
28-
CGNSWriter3D(Blocking3D *ABlocking);
28+
CGNSWriterND(Blocking3D *ABlocking, int ADim);
2929

30-
CGNSWriter3D(Mesh *AMesh);
30+
CGNSWriterND(Mesh *AMesh, int ADim);
3131

32-
CGNSWriter3D();
32+
CGNSWriterND();
3333

3434
/*------------------------------------------------------------------------*/
3535
/** \brief Destructor. */
36-
virtual ~CGNSWriter3D();
36+
virtual ~CGNSWriterND();
3737

3838
void write(const std::string &AInFileName, const std::string &AOutFileName, const std::string &AWorkingDir);
3939

40-
void writeBoundaryCondition(int &id_bc, cgsize_t *pts, int id_zone, char ABCtype[32], int AEdgeID) const;
41-
42-
4340
protected:
4441
void initialize(const std::string &AOutFileName, const std::string &dir);
4542

@@ -51,7 +48,11 @@ class GMDSAero_API CGNSWriter3D
5148

5249
void _getIndicesIdAndVal(const int *ipnts1, const int *ipnts2, bool *filtre, int &ind, int &val);
5350

51+
void writeConnections3D(const Region& Ablock, int iFace, int& index_tf, const std::vector<Variable<int>*>& zone_vars);
52+
void writeConnections2D(const Face& Ablock, int iEdge, int& index_tf, const std::vector<Variable<int>*>& zone_vars);
5453

54+
void writeBoundaryCondition3D(int &num_bc, const Region& Ablock, int iFace, const std::vector<Variable<int>*>& bc_vars) const;
55+
void writeBoundaryCondition2D(int &num_bc, const Face& Ablock, int iEdge, const std::vector<Variable<int>*>& bc_vars) const;
5556

5657
protected:
5758
Mesh *m_blocks;
@@ -62,8 +63,6 @@ class GMDSAero_API CGNSWriter3D
6263
Variable<int>* VarDiscrJ;
6364
Variable<int>* VarDiscrK;
6465

65-
Variable<int>* axis;
66-
6766
int m_cellDim;
6867
int m_physdim;
6968

@@ -78,4 +77,4 @@ class GMDSAero_API CGNSWriter3D
7877
/*----------------------------------------------------------------------------*/
7978
}// namespace gmds
8079
/*----------------------------------------------------------------------------*/
81-
#endif // GMDS_CGNSWRITER3D_H
80+
#endif // GMDS_CGNSWRITERND_H

0 commit comments

Comments
 (0)