writeCGNS now running; need to check what it writes!
writeCGNS now runs (for a variety of output options), but still need to check what is actually being written.
With regard to the show-stopper in interiorBoundaryVertices(...) in file Geo/MZoneBoundary.cpp, in the lines (from 814) following the comment
//--A new vertex was inserted
the code was attempting to push_back a CCon::FaceVector object into the member "faces",
CCon::FaceVector faces
By using FaceAllocator with face2Pool, the custom memory management appears to side-step the calling of constructors.
My guess is that the std::vector members (_v, _si) in class FaceDataB::face (e.g. MFace) are "incomplete". Behind the scenes, there is the usual auto-alloc/dealloc triggered by adding into a std::map using operator[], and the problem bit when deallocating a std::vector that had not been properly "constructed".
First attempt at a simple fix:
By replacing the FaceT member with FaceT* we fix this issue of auto-deleting "un-constructed" containers. The simple data type(pointer) member is allocated in the ctor, then we create and store its FaceT object once the FaceDataB object is safely in the container. See comments in the code.
Note: we must now make sure to delete these pointers. See adjusted version of MZoneBoundary::clear();
Three files are attached:
- Geo/MZoneBoundary.h
- Geo/MZoneBoundary.cpp
- Geo/GModelIO_CGNS.cpp
Also, here is a fix for the partial update that slipped into svn yesterday: Geo/GModelIO_CGNS.cpp (from line 415)
switch(meshDim) { case 2: MZone<2>::preInit(); MZoneBoundary<2>::preInit(); write_CGNS_zones<2>(*this, zoneDefinition, numZone, options, scalingFactor, vectorDim, groups[face], cgIndexFile, cgIndexBase); MZone<2>::postDestroy(); MZoneBoundary<2>::postDestroy(); break; case 3: MZone<3>::preInit(); MZoneBoundary<3>::preInit(); write_CGNS_zones<3>(*this, zoneDefinition, numZone, options, scalingFactor, vectorDim, groups[region], cgIndexFile, cgIndexBase); MZone<3>::postDestroy(); MZoneBoundary<3>::postDestroy(); break; }
Nigel