|
4 | 4 | // |
5 | 5 | /*----------------------------------------------------------------------------*/ |
6 | 6 | #include "gmds/aero/CGNSWriterND.h" |
7 | | -#include "gmds/ig/MeshDoctor.h" |
8 | | -#include "gmds/io/IGMeshIOService.h" |
| 7 | +//#include "gmds/ig/MeshDoctor.h" |
| 8 | +//#include "gmds/io/IGMeshIOService.h" |
9 | 9 | //#include "gmds/io/VTKReader.h" |
10 | 10 | #include <fstream> |
11 | 11 | #include <iomanip> |
@@ -64,9 +64,9 @@ CGNSWriterND::initialize(const std::string &AOutFileName, const std::string &dir |
64 | 64 | std::cout<<"Section error : "<<cg_get_error()<<std::endl; |
65 | 65 | } |
66 | 66 |
|
67 | | - char basename[AOutFileName.length()]; |
68 | | - strcpy(basename, AOutFileName.c_str()); |
| 67 | + char basename[AOutFileName.length()+1]; |
69 | 68 |
|
| 69 | + strcpy(basename, AOutFileName.c_str()); |
70 | 70 |
|
71 | 71 | cg_base_write(m_indexFile,basename,m_cellDim,m_physdim,&m_indexBase); |
72 | 72 |
|
@@ -167,6 +167,9 @@ CGNSWriterND::writeZones() |
167 | 167 | zone_size[7] = 0; |
168 | 168 | zone_size[8] = 0; |
169 | 169 | } |
| 170 | + else { |
| 171 | + throw GMDSException("Dimension "+std::to_string(m_cellDim)+"D not supported in CGNS writer."); |
| 172 | + } |
170 | 173 |
|
171 | 174 | if(cg_zone_write(m_indexFile, m_indexBase, zonename, zone_size, CG_Structured, &m_indexZone) != CG_OK) { |
172 | 175 | std::cout << cg_get_error() << std::endl; |
@@ -234,7 +237,7 @@ CGNSWriterND::writeZones() |
234 | 237 | } |
235 | 238 | } |
236 | 239 | void |
237 | | -CGNSWriterND::writeConnections3D(const Region& Ablock, int iFace, int& index_tf, const std::vector<Variable<int>*>& zone_vars){ |
| 240 | +CGNSWriterND::writeConnections3D(const Region& Ablock, int iFace, int& index_tf, const std::vector<Variable<int>*>& zone_vars) const{ |
238 | 241 | Face face = Ablock.get<Face>()[iFace]; |
239 | 242 |
|
240 | 243 | if(face.get<Region>().size() == 2) { |
@@ -578,7 +581,8 @@ CGNSWriterND::writeConnections3D(const Region& Ablock, int iFace, int& index_tf, |
578 | 581 | } |
579 | 582 | /*----------------------------------------------------------------------------*/ |
580 | 583 | void |
581 | | -CGNSWriterND::writeConnections2D(const Face& Ablock, int iEdge, int& index_tf, const std::vector<Variable<int>*>& zone_vars){ |
| 584 | +CGNSWriterND::writeConnections2D(const Face& Ablock, int iEdge, int& index_tf, const std::vector<Variable<int>*>& zone_vars) const |
| 585 | +{ |
582 | 586 |
|
583 | 587 | Edge edge = Ablock.get<Edge>()[iEdge]; |
584 | 588 |
|
@@ -844,7 +848,7 @@ CGNSWriterND::writeBoundaryCondition2D(int &num_bc, const Face& Ablock, int iEdg |
844 | 848 | type_bc = ivar; |
845 | 849 | } |
846 | 850 |
|
847 | | - if(type_bc == -1) { |
| 851 | + if(type_bc != -1) { |
848 | 852 |
|
849 | 853 | switch (iEdge) { |
850 | 854 | case 0: |
|
0 commit comments