@@ -92,6 +92,12 @@ int CgnsFile::Impl::initZoneId(bool clearResults)
92
92
// zone found!
93
93
m_zoneId = Z;
94
94
95
+ ZoneType_t zt;
96
+ ier = cg_zone_type (m_fileId, m_baseId, Z, &zt);
97
+ RETURN_IF_ERR;
98
+
99
+ m_hasFaceSols = (zt == Structured);
100
+
95
101
if (clearResults) {
96
102
ier = clearResultData ();
97
103
} else {
@@ -739,7 +745,7 @@ void CgnsFile::Impl::getPolydataSolName(int num, char* name)
739
745
sprintf (name, " PolydataSolution%d" , num);
740
746
}
741
747
742
- int CgnsFile::Impl::addSolutionNode (int fid, int bid, int zid, int sid, std::vector<std::string>* sols, std::vector<std::string>* cellsols, std::vector<std::string>* ifacesols, std::vector<std::string>* jfacesols)
748
+ int CgnsFile::Impl::addSolutionNode (int fid, int bid, int zid, int sid, std::vector<std::string>* sols, std::vector<std::string>* cellsols, std::vector<std::string>* ifacesols, std::vector<std::string>* jfacesols, bool hasFaceSols )
743
749
{
744
750
char solname[NAME_MAXLENGTH];
745
751
getSolName (sid, solname);
@@ -763,25 +769,30 @@ int CgnsFile::Impl::addSolutionNode(int fid, int bid, int zid, int sid, std::vec
763
769
RETURN_IF_ERR;
764
770
765
771
ier = cg_sol_write (fid, bid, zid, cellsolname, CellCenter, &S);
766
- RETURN_IF_ERR;
767
772
768
- ier = cg_sol_write (fid, bid, zid, ifacesolname, IFaceCenter, &S);
769
773
RETURN_IF_ERR;
770
774
771
- ier = cg_sol_write (fid, bid, zid, jfacesolname, JFaceCenter, &S);
772
- RETURN_IF_ERR;
775
+ if (hasFaceSols) {
776
+ ier = cg_sol_write (fid, bid, zid, ifacesolname, IFaceCenter, &S);
777
+ RETURN_IF_ERR;
778
+
779
+ ier = cg_sol_write (fid, bid, zid, jfacesolname, JFaceCenter, &S);
780
+ RETURN_IF_ERR;
781
+ }
773
782
774
783
ier = writeFlowSolutionPointers (fid, bid, zid, *sols);
775
784
RETURN_IF_ERR;
776
785
777
786
ier = writeFlowCellSolutionPointers (fid, bid, zid, *cellsols);
778
787
RETURN_IF_ERR;
779
788
780
- ier = writeFlowIFaceSolutionPointers (fid, bid, zid, *ifacesols);
781
- RETURN_IF_ERR;
789
+ if (hasFaceSols) {
790
+ ier = writeFlowIFaceSolutionPointers (fid, bid, zid, *ifacesols);
791
+ RETURN_IF_ERR;
782
792
783
- ier = writeFlowJFaceSolutionPointers (fid, bid, zid, *jfacesols);
784
- RETURN_IF_ERR;
793
+ ier = writeFlowJFaceSolutionPointers (fid, bid, zid, *jfacesols);
794
+ RETURN_IF_ERR;
795
+ }
785
796
786
797
ier = addParticleGroupSolutionNode (fid, bid, zid, sid);
787
798
RETURN_IF_ERR;
0 commit comments