Added new functions to Grid including
- int getBufferSize() const;
- void loadVelocityModelBinary(util::DataBuffer& buffer)
- void saveVelocityModelBinary(util::DataBuffer& buffer)
The first function retrieves the approximate size required of a DataBuffer object to store the contents of the Grid object. The next two functions read a Grid object from an input DataBuffer and save the contents of the Grid into an input DataBuffer object. These functions are required by PGL to be able to store the SLBM model into an FDB.
Since PGL really saves the an SLBMInterface object these same functions were provided in SlbmInterface to pass-through the request to the Grid object. In SlbmInterface they are called by the same name. A new function to retreive the model path variable
- const string& getModelPath() const
was also added to the SlbmInterface object.
I modified the Grid object file base read function to extract the DataBuffer read/write information into separate functions. This avoided duplicating the functionality in the new calls above. The calls separate out the input of geo stacks, layer connectivity and grid connectivity as well as initialization functionality. They are divided into the 4 functions below:
- void readGeoStacks(util::DataBuffer& buffer)
- void readConnectivity(util::DataBuffer& buffer, int& nNodes, vector& elev, vector& waterThick, vector& stackId)
- void readTessellationData(util::DataBuffer& buffer, int nNodes, const vector& elev, const vector& waterThick, const vector& stackId, vector& triset);
- void defineTessAdjacency(int nNodes, const vector& triset);
Finally, the Uncertainty class was modified so that it could be read from and written to by a DataBuffer object. This included adding a constructor to serialize from a DataBuffer, a function to retrieve the necessary buffer size, a function to serialize, and a function to deserialize. These functions are defined by
- Uncertainty(util::DataBuffer& buffer)
- int getBufferSize() const
- void serialize(util::DataBuffer& buffer)
- void deserialize(util::DataBuffer& buffer)
Also, I fixed a bug in the Uncertainty file read class where a pth “/” descriptor was missing. And I replaced the getUncertainty(…) functionality with a new implementation that uses a fast binary search to find the bracket values from then input distance.