Skip to content

Commit aa26314

Browse files
committed
- call CGNSWriter3D in MGX
1 parent 33e6e2b commit aa26314

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

src/Core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ endif()
106106
if (SEPA3D)
107107
target_include_directories (Core PUBLIC ${SEPARATRICE3D_INCLUDE_DIR})
108108
endif (SEPA3D)
109-
target_link_libraries (Core PUBLIC ${CORE_OPTIONAL_LIBRARIES_LIST} Mesquite::Mesquite cgns::cgns PkgConfig::GTS GMDSIg GMDSIo)
109+
target_link_libraries (Core PUBLIC ${CORE_OPTIONAL_LIBRARIES_LIST} Mesquite::Mesquite cgns::cgns PkgConfig::GTS GMDSIg GMDSIo GMDSAero)
110110
# Etre capable une fois installée de retrouver vtk*, ... :
111111
# (Rem : en son absence on a Set runtime path of "/tmp/pignerol/install/lib/libCore.so.5.0.0" to "") ...
112112
set_target_properties (Core PROPERTIES INSTALL_RPATH_USE_LINK_PATH 1)

src/Core/Mesh/ExportBlocksCGNSImplementation.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,13 @@
77
*/
88
/*----------------------------------------------------------------------------*/
99
#include "Mesh/ExportBlocksCGNSImplementation.h"
10-
#include "Geom/Volume.h"
11-
#include "Geom/Surface.h"
12-
#include "Geom/Curve.h"
13-
#include "Geom/Vertex.h"
1410
#include "Mesh/MeshItf.h"
1511
#include "Mesh/Surface.h"
1612
/*----------------------------------------------------------------------------*/
1713
#include <gmds/ig/Mesh.h>
1814
#include <gmds/io/IGMeshIOService.h>
1915
#include <gmds/io/VTKWriter.h>
16+
#include <gmds/aero/CGNSWriter3D.h>
2017
/*----------------------------------------------------------------------------*/
2118
#include <TkUtil/MemoryError.h>
2219
#include <iostream>
@@ -26,8 +23,8 @@ namespace Mgx3D {
2623
namespace Mesh {
2724
/*----------------------------------------------------------------------------*/
2825
ExportBlocksCGNSImplementation::
29-
ExportBlocksCGNSImplementation(Internal::Context& c, const std::string& n)
30-
: m_context(c), m_filename(n)
26+
ExportBlocksCGNSImplementation(Internal::Context& c, const std::string& filename)
27+
: m_context(c), m_filename(filename)
3128
{}
3229

3330
/*----------------------------------------------------------------------------*/
@@ -43,7 +40,7 @@ namespace Mgx3D {
4340

4441
std::map<gmds::TCellID,unsigned long> n2v;
4542

46-
gmds::Mesh mesh(gmds::MeshModel(gmds::DIM3 | gmds::N | gmds::R | gmds::R2N | gmds::N2R));
43+
gmds::Mesh mesh(gmds::MeshModel(gmds::DIM3 | gmds::N | gmds::F | gmds::R | gmds::R2N | gmds::N2R | gmds::R2F | gmds::F2R | gmds::F2N | gmds::N2F));
4744

4845
gmds::Mesh localMesh = m_context.getMeshManager().getMesh()->getGMDSMesh();
4946

@@ -150,11 +147,15 @@ namespace Mgx3D {
150147
}
151148
}
152149

153-
gmds::IGMeshIOService ioService(&mesh);
154-
gmds::VTKWriter writer(&ioService);
155-
writer.setCellOptions(gmds::N|gmds::R);
156-
writer.setDataOptions(gmds::N|gmds::R);
157-
writer.write(m_filename);
150+
int position = m_filename.find_last_of('/');
151+
152+
m_basename = m_filename.substr(position+1, m_filename.length()-position+1);
153+
154+
m_path = m_filename.substr(0, position+1);
155+
156+
gmds::aero::CGNSWriter3D writer3D(&mesh);
157+
writer3D.write("",m_basename,m_path);
158+
158159
}
159160
/*----------------------------------------------------------------------------*/
160161
} // end namespace Topo

src/Core/protected/Mesh/ExportBlocksCGNSImplementation.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace Mgx3D {
2727
* \param c le contexte
2828
* \param n le nom du fichier dans lequel se fait l'exportation
2929
*/
30-
ExportBlocksCGNSImplementation(Internal::Context& c, const std::string& n);
30+
ExportBlocksCGNSImplementation(Internal::Context& c, const std::string& filename);
3131

3232
/*------------------------------------------------------------------------*/
3333
/** \brief Destructeur
@@ -45,8 +45,12 @@ namespace Mgx3D {
4545
/// contexte d'exécution
4646
Internal::Context& m_context;
4747

48+
std::string m_path;
49+
4850
/// fichier dans lequel on exporte
4951
std::string m_filename;
52+
53+
std::string m_basename;
5054
};
5155

5256
/*----------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)