Concept
The source grid can contain several billions of cells which cannot be loaded in memory for real time rendering. In order to efficiently display such grids our approach is :
split the data in several multiresolution files (build process),
leverage from these multiresolution files in order to display at best resolution the closest part of the grid, and lower resolutions the farther parts.
By convention, full resolution is called level zero.
Build
First step is to load the source file. The current Demo builder will then analyse full grid size and some more informations it will need for it's new format.
Sample code
// mainFile is source File
// outputDir is the directory where the new split format will be written
cgDataLoader dataLoader = new cgDataLoaderImpl(mainFile,outputDir);
cgIJKReservoirGrid loadedReservoirGrid = dataLoader.createReservoirGrid(0);
Second step consist to build the full resolution geometry data. The source grid is read sequentially (goal are files too big to be fully loaded in memory) and rewrote in several files.
Third step will build the lower resolutions levels from full resolution.
Fourth step would be to build one or several properties with the same format, according to calculated geometry data.
Those steps are automatically done in the current GigaGrid Demo
sample code
// GRDECL SOURCE GRID FILE
// Manage build according to the loaded grid instance
// Starting point of the building is the transition pillar grid loaded from the reader
File tempBuildDir = new File(_outputDir.getAbsolutePath() + File.separator + cgNameConstants.TEMPORARY_BUILD_DIR);
// A temporary grid typ is created when building the grid. It is erased when build is complete
cgTransitionFormatReservoirPillarGrid reservoirGrid = new cgTransitionFormatReservoirPillarGrid(tempBuildDir);
// Building task object to launch build
builderTask = new cgStructuredGridBuilderTask(_outputDir, userDims, getSubdivisionCriteria(), _propertySEPHeaderFiles);
builderTask.buildMultiResolution(loadedReservoirGrid);
// Clear temp files
loadedReservoirGrid.clearTransitoryData();
When the Build is complete, the "outputDir" contains the built gigamodel.