DHI.Mike1D.ResultDataAccess Namespace

The DHI.Mike1D.ResultDataAccess component provides common access to a variety of network file formats. It is the main data access component for the MIKE 1D result files, having the .res1d extension. It does also provide support for reading result files from MIKE 11 and MIKE URBAN/MOUSE.

Classes

Ascii1Bridge The Ascii1 bridge is a result data write bridge that is capable of writing the results of a result data object to a specific ascii file.

The Ascii1 bridge only stores reach data. All other data items are ignored.

Ascii2Bridge The Ascii2 bridge is a result data write bridge that is capable of writing the results of a result data object to an ascii file.

The Ascii2 bridge only stores reach data. All other data items are ignored.

AsciiBridge Common class for ascii bridge data
AsciiBridgeData Ascii file format data, defining how and what is put in the ascii file
AsciiBridgeDataItemInstance Class where one dynamic item corresponds to one element value in one data item
AsciiBridgeFactory Factory for creating Ascii Bridge
Convert2Res1d Class to convert a network or RR result file to res1D
Convert2Txt Class to convert a network or RR result file to res1D
ConvertOut2Res1D Helper class for converting SWMM out result file to a res1d RR file, removing all but the rainfall runoff output.
CrfBridge Bridge for reading MOUSE CRF files.
CrfBridgeCrfCatchmentConnection Catchment connection information as read from .crf file
CrfBridgeFactory Factory for creating CRF Bridge
DataItem See IDataItem
DataItemDataItemComparer IEqualityComparer compares using the Description and ItemId.
DataItemElmtTimeInterpolator Class for interpolating data item values in time, for a data item with just a single value.
DataItemFilterName A class that can filter on names
DataItemFilterQuantity A class that can filter on quantities
DataItems Class implementing a list of IDataItem's Required for generic list COM interop
DataItemTimeInterpolator Class for interpolating data item values in time, for a data item with just a single value.
DataItemTimeSingleProxySource A IDataItem that can update itself based on an IDoubleTimeVectorGetter
DataItemValueTimeInterpolator Class for interpolating data item values in time, for a data item with just a single value.
DataReaderLazy Data reader that utilizes the IResultRandomReadBridge and adds lazy reading capabilities. Times for timestep and timesteps are only read on request. Filtering on quantities are respected if the bridge respects it, though filtering on time steps are disregarded.

At most BufferSize time steps are stored in the result data object, hence if reading more than BufferSize number of time steps, the first read time step are removed again (based on reading, not on access).

DataReaderLazyTimeStepDataLazyListT Lazy list of data item values. Data is stored in a dictionary, key'ed by the time step index
DataReaderLazyTimeStepSingleDataLazyList Lazy list of data item values, where data is stored as a list of doubles Data is stored in a dictionary, key'ed by the time step index
Dfs0Bridge The Dfs0 bridge is a result data write bridge that is capable of writing the results of a result data object to a dfs0 file.

The Dfs0 bridge only stores reach data. All other data items are ignored.

The Dfs0 bridge also supports reading an arbitrary dfs0 file data into the GlobalData set, adding support for dfs0 in the ResultDiff tool and GUI.

Dfs0BridgeFactory Factory for creating dfs0 Bridge
Dfs1Bridge The Dfs1 bridge is a result data read bridge that is capable of reading the results of a dfs1 file into one reach of the ResultDataobject.
Dfs1BridgeFactory Factory for creating dfs1 Bridge
DiffData Class that holds difference data for one quantity, the maximum difference found, and where and when it was found.
Filter Filter allowing user to specify a subset of the data set. It contains a list of IDataItemFilter that must all accept a dataitem before it is accepted by this filter.
ListTimeStepData Class implementing a list of double[]'s Required for generic list COM interop
LTSQuantities Default quantities and result quantities used by LTS module.
LTSResultQuantity Result quantity for LTS simulation
M11FfBlockReader Class for reading the generic blocks of the original MIKE 11 file format, that is currently only used by MOUSE. File extensions that indicate a file in MIKE 11 file format: .PRF, .CRF,

After connecting to the file, use the GetNextBlockType to quiery the block type, and then any of the ReadBlock methods or the SkipBlock to read/skip the next block. At end-of-file, GetNextBlockType returns EndOfFile.

M11FfBridgeBase Base class for a bridge reading files in the old MIKE 11 File Format
M11FfBridgeBaseDataItemIndex For a channel, holds the data item and the index where to store channel values.
MultiBridgeCheckFactory Bridge file factory that examines a file to figure out exactly which bridge to use.
Period Describes a period in time. The period is described through Start- and End- Time.
Periods Class implementing a list of IPeriod's Required for generic list COM interop
PredefinedQuantityDataLTS Static class containing the PredefinedQuantityTableLTS.
PredefinedQuantityLTSProperties Properties for PredefinedQuantityLTS.
PredefinedQuantityTableLTS Dictionary from PredefinedQuantityLTS to PredefinedQuantityLTSProperties used by LTSResultQuantity.Create() to create various Quantities for LTS module.
PrfBridge Bridge for reading MOUSE PRF files.

The bridge can also handle other type of MOUSE result files that has the same structure as PRF file. Some of these PRF-like files are missing the full network definition, and if loaded as a stand-alone file, network is not complete. To get complete network, data must be added to an existing "primary" file, by merging in the data items. Different types of MOUSE results that are supported, are listed below:

  • PRF: HD primary result output.
  • PRF: HD result selection output. Must be added to primary PRF file
  • XRF: HD additional output. Must be added to primary PRF file
  • TRF: AD data. Should be added to primary PRF file, can load standalone with some definitions missing

PrfBridgeFactory Factory for creating PRF Bridge
Res11BridgeFactory Factory for creating Res11 Bridge
Res11BridgeLazyFactory Factory for creating Res11 lazy Bridge
Res1DAbstractDataSet Abstract class holding the basic constituents for a Res1D data set
Res1DBasin Basin node
Res1DBridge 
Res1DBridgeAppendFactory Factory for creating Res1d append Bridge
Res1DBridgeFactory Factory for creating Res1dBridge
Res1DBridgeLazyFactory Factory for creating Res1d lazy Bridge reader
Res1DBridgeOldFactory Factory for creating Res1d old format Bridge
Res1DCatchment Data desription and time step data for a catchment.
Res1DCatchments Class implementing a list of IRes1DCatchment's Required for generic list COM interop
Res1DCircularCrossSection Data model for circular cross section. To be able draw circular sections a postprocessing tool (for instance MIKE VIEW) needs to know ID, Centerlevel and Diameter.
Res1DClosedPolygonCrossSection Interface for a closed cross section defined as a polygon in x-z plane
Res1DCrossSectionPoint X-Z Point in a tabulated cross section.
Res1DCrossSectionPoints Class implementing a list of IRes1DCrossSectionPoint's Required for generic list COM interop
Res1DDataSetTimeProxy Class wrapping an IRes1DDataSet into the IDoubleTimeProxy. It requires a ResultDataTimeInterpolator for doing temporal interplation.

When TimeValueGetter(Int32) is called, a TimeDataValueGetter is returned.

Res1DEggshapedCrossSection Result meta data for describing egg-shaped circular cross section
Res1DExtensions Class containing extension methods for Res1D classes
Res1DFactory A factory class (abstract factory pattern) for creating Res1D objects
Res1DGlobalData Global data. Global data are data that is not specific to the topology or parts of the topology (network, catchments ..). Global data could be time step used in model, wind field valid for entire domain etc.
Res1DGridPoint Abstract base class for gridpoints.
Res1DGridPoints Class implementing a list of IRes1DGridPoint's Required for generic list COM interop
Res1DHGridPoint Specialized H gridpoint class extending Res1DGridPoint
Res1DInterpolatedCrossSection Class for an interpolated cross section. An interpolated cross section only contains processed data, and needs other data from elsewhere
Res1DManhole Access to ManHole data from Res1D data access.
Res1DNetworkDataInterpolatorWrapper A INetworkDataInterpolatorT for a given IQuantity, that extracts data from an IResultData at a given time.
Res1DNetworkDataSetWrapper Network value set for a Res1D file, based on a given time in the file.

The Res1DNetworkDataSetWrapper provides temporal and spatial interpolation of data from a IResultData.

Res1DNetworkDataTimeSetWrapper Network value set for a Res1D file The Res1DNetworkDataTimeSetWrapper provides temporal and spatial interpolation of data from a IResultData.
Res1DNetworkFilter An implementation of the IRes1DSpatialFilter containing a positive list of ids of different types that the filter includes
Res1DNetworkFilterAllNodes An Res1DNetworkFilter that includes all nodes and only user-specified reaches and grid points.
Res1DNetworkHFilter An Res1DNetworkFilter that one reaches only includes H grid points, otherwise it behaves as the Res1DNetworkFilter.
Res1DNetworkQFilter An Res1DNetworkFilter that one reaches only includes Q grid points, otherwise it behaves as the Res1DNetworkFilter.
Res1DNode Provides access to node data via Res1D data access.
Res1DNodes Class implementing a list of IRes1DNode's Required for generic list COM interop
Res1DOpenCrossSection Class implementing a simple open cross section
Res1DOutlet Outlet node
Res1DQGridPoint Specialized Q gridpoint
Res1DReach Default implementation of IRes1DReach
Res1DReachConnection Structure containing reach and which end that it is connected to (start or end)
Res1DReaches Class implementing a list of IRes1DReach's Required for generic list COM interop
Res1DRectangularCrossSection Simple implemtation of a rectangular cross section
Res1DRoutingGridPoint Specialized routing gridpoint
Res1DSewerJunction Sewer Junction node
Res1DSewerNode Sewernode is the base class for nodes used in the sewers.
Res1DSpatialFilterAll A filter that includes all or none of a certain type.
Res1DSpatialFilterAllQPoints An IRes1DSpatialFilter that includes all Q grid points and excludes anything else
Res1DSpatialFilterSet An implementation of the IRes1DSpatialFilter containing a positive list of ids of different types that the filter includes
Res1DStreamBridge Bridge for reading .res1d files.

This class supports reading files from a .NET stream.

Res1DStreamBridgeDataItemCollectionInfo Helper class for storing information on a node-dynamic item before the builder is created.
Res1DStreamBridgeDataItemInstance Class where one dynamic item corresponds to one data item
Res1DStructure Data description of structure
Res1DStructureGridPoint Specialized Q gridpoint
Res1DStructureOutlet Special kind of outlet: When a structure is discharging directly out of the system, and no outlet has been explicitly specified, the engine will put in a StuctureOutlet downstream of the structure.
Res1DStructureReach Default implementation of IRes1DStructureReach
Res1DStructures Class implementing a list of IRes1DStructure's Required for generic list COM interop
Res1DToTimeSeries Contains static functions to extract time series from result data.
ResultBridgeFactories Contains a number of IResultBridgeFactory's keyed on the bridge name

By default the following bridges are available:

  • res1d
  • dfs0 - only write support
  • res11 - only read support

ResultData The result data access is the class that all producers or users of MIKE 1D results should use. The class is used for recording the results, reading results, hot-starting the Mike1D engine and extracting specific results.
ResultDataBuffer

Class that contains a number of resultdata files. In case of more than one component needing access to the same result data file, it should only be opened once (performance/ressource issues). Hence, each component using a result data file should ask this buffer for the file and if it already exist in the buffer, the existing file will be used.

Each result data file is idenfitied by its full filepath name.

ResultDataDiff Class for producing difference report between two result data objects
ResultDataDiffMsgs Diff message
ResultDataDiffMain Helper class for running a ResultDataDiff command line application.
ResultDataDiffTextReporter Class that produces a text report from a ResultDataDiff
ResultDataExtensions Extension class with various extension methods
ResultDataFactory Class to ease reading and writing of result data files.
ResultDataHelper Helper class that extend the functionality of ResultData

Required for certain functions related to COM interop.

ResultDataParameters Base implementation of IResultDataParameters
ResultDataQuery Class for querying results in a ResultData object
ResultDataSearch Class for fast searching in list of nodes, reaches and catchments.
ResultDataTimeInterpolator Class for interpolating ResultData values in time.

This class has some buffer functionality such that results for the same inputs are returned immediately, without a need for searching.

ResultDataUnitConverter Class for doing unit conversions for all data items in a IResultData object.

If data is read using a lazy reader, this can incur a severe performance hit. In that case, the bridge must implement the unit conversion.

ResultDataXmlBridge Bridge that writes ResultData to XML file using DataContracts
ResultSpecification Specification for writing results: File to output to, time to output, what to output (quantities), and where (spatially) to include output.
SWMM5IntFileBridge Class for reading SWMM5 Interface File data and populate a ResultData object.

The SWMM5 Interface File contains outlet node flows.

The asRR argument to the constructor flags if data is stored as catchment TotalRunOff or node DischargeOutflow.

The "usual" integration in MIKE 1D is to convert the flow to runoff, and attach to MIKE 1D as catchment runoff file. There can be issues with the catchment connections and these must be regenerated.

To integrate node outflow to MIKE 1D, we probably need to introduce a new type of boundary (Runoff Node Inflow), which assigns directly to the node matching the Id.

There is currently not that much error reporting.

SWMM5IntFileBridgeFactory Factory for creating SWMM5 Interface File Bridge on the fly
TimeDataBuffer Class for buffering data values, for performance.
TimeDataCircularValue Implementation of ITimeData for a single valued item
TimeDataCircularVector Implementation of ITimeData for a vector item

It stores an array of element values for each time step.

TimeDataValue Implementation of ITimeData for a single valued item
TimeDataValueGetter Class providing temporal interpolation of values in an ITimeData, using an ResultDataTimeInterpolator for doing the interpolation.

The ResultDataTimeInterpolator can be used by several instances of this class, in case temporal interpolation is required by more than one data item at the same times.

TimeDataVector Implementation of ITimeData for a vector item

It stores an array of element values for each time step.

TimeDataVectorTS Implementation of ITimeData for a vector item.

For each element it stores a list of time steps.

TxtFileBridgeFactory Bridge file factory that examines a txt file to figure out exactly which bridge to use.

Structures

M11FfBlockReaderChannelDescriptor Channel descriptor block

In the CHANNEL descripter part information is stored about each specific data series in the data part of the file. In the ITEM descripter part there could as an example be one record describing "water level in nodes". In the CHANNEL description part there must be one record for each node. The record can hold individual information about the node shuch as top and bottom level.

Additional information about each CHANNEL may be placed in a number of extra records just after the CHANNEL descripter record.

ONE channel descriptor record must exist for each channel.

CHANNEL descripter records MUST appear in the same order as the data they represent appears in the logical data record.

M11FfBlockReaderItemDescriptor Item Descriptor block

The ITEM descripter part contains one ITEM descripter record for each type of data channel. Examples of ITEMs are "water level" and "flow". If data channels with values for water level as a funtion of time is to be devided into groups e.g. "water level in nodes" and "water level in pipes" then there must exist an ITEM descripter record for each of the groups.

Each item descripter record may represent several data channels of the described ITEM.

In this part of the file no extra records are allowed. Note in particular that ITEM descripter records for data channels with time values must be defined too

ONE item descirptor record for each type of data channel.

No extra records allowed in this part

M11FfBlockReaderMiscDescriptor Misc descriptor block
M11FfBlockReaderTimeDescriptor Time descriptor block

The TIME descripter part must start with one and only one TIME descripter record. This record contains information about the type of time data in the file. The type of time data ranges from information about an offset time and a constant time step which applies for all data channels, to individual time data for each data value in each data channel.

The individual information is added in a number of extra records after the TIME descripter record. The number of extra records must be specified in the TIME descripter record in variable NR_XREC. If there are no extra records, NR_XREC is defined as zero.

For rectype 1 and 2, the following values are present DivReal[0] : Number of time steps/values in each data channel DivReal[1] : Time between first and last value, time span of file

For constant time steps, the time step size can be calculated by: double timestepSize = DivReal[1] / (DivReal[0]-1.0);

M11FfBridgeBaseItemTypeData Item type data
M11FfBridgeBaseUnitConversionFactors 
Res1DStructureLocation Location of structure
SerializerCoordsSurrogate Surrogated class for DHI.Generic.MikeZero.DFS.Coords

Interfaces

IDataItem

An IDataItem contains data for one quantity and for a number of time steps and elements. For each set of time data there is an array of data element values.

IDataItemFilter Interface for implementing filtering of data items.
IDataItemFilterQuantity Interface for DataItemFilterQuantity
IDataItems Interface for a list of IDataItem's Required for generic list COM interop
IFilter Filter allowing user to specify a subset of the data set.
IListTimeStepData Interface for a list of Double's Required for generic list COM interop
IPeriod Describes a period in time. The period id described through Start- and End- Time.
IPeriods Interface for a list of IPeriod's Required for generic list COM interop
IRes1DBasin Data model for a Basin. The basin is a specialisation of a sewer node.
IRes1DCatchment Data desription and time step data for a catchment.
IRes1DCatchments Interface for a list of IRes1DCatchment's Required for generic list COM interop
IRes1DCircularCrossSection Result meta data for describing circular cross section
IRes1DClosedCrossSection Base interface for closed cross sections in the result data access. Basically it simply defines that all closed cross sections must have a height.
IRes1DClosedPolygonCrossSection Interface for a closed cross section defined as a polygon in x-z plane
IRes1DCrossSection Base interface for cross sections in the result data access. Basically it simply defines that all cross sections must have an identification string.
IRes1DCrossSectionPoint X-Z point in tabulated cross section
IRes1DCrossSectionPoints Interface for a list of IRes1DCrossSectionPoint's Required for generic list COM interop
IRes1DDataSet Interface for a general dataset, containing timestep data.
IRes1DEggshapedCrossSection Result meta data for describing egg-shaped circular cross section
IRes1DFactory A factory interface (abstract factory pattern) for creating Res1D objects
IRes1DGlobalData Global data. Global data are data that is not specific to the topology or parts of the topology (network, catchments ..). Global data could be time step used in model, wind filed valid for entire domain etc.
IRes1DGridPoint Data model for the generalized gridpoint. Actual grid points are specilizations of IRes1dGridPoint
IRes1DGridPoints Interface for a list of IRes1DGridPoint's Required for generic list COM interop
IRes1DHGridPoint Data description of the H grid point. A H grid point is a grid point with a cross section.
IRes1DInterpolatedCrossSection Base interface for interpolated cross sections. An interpolated cross section only contains processed data, and needs other data from elsewhere
IRes1DItemData Data for one data item and one timestep.

Depending on the type of data in the file, this can be cast to a similar IRes1DItemDataT and the Data can be cast to its raw array data type.

This interface is never implemented directly.

IRes1DItemDataT Data for one item and timestep. This is the generic extension of IRes1DItemData
IRes1DManhole The circular manhole is a vertical circular cylinder. The cylinder is bounded vertically by invert level and ground level.
IRes1DNode Interface to a Res1D Node
IRes1DNodes Interface for a list of IRes1DNode's Required for generic list COM interop
IRes1DOpenCrossSection Interface to an open cross section
IRes1DOutlet Interface for a Res1D outlet
IRes1DQGridPoint Data description of the Q grid point
IRes1DReach Data desription and time step data for a reach (also sometimes called a branch or a link)
IRes1DReaches Interface for a list of IRes1DReach's Required for generic list COM interop
IRes1DRectangularCrossSection Interface for a rectangular cross section
IRes1DRoutingGridPoint Data description of a routing grid point. A routing grid point is a Q point that can also have a cross section and a water level
IRes1DSewerJunction Interface for a Res1D sewer junction.
IRes1DSewerNode Interface for a Res1D sewer node. This is usually specialized further.
IRes1DSpatialFilter A filter interface that specifies whether a specified Res1D data structure is included or not.
IRes1DStructure Data description of structure
IRes1DStructureGridPoint Data description of the Q grid point
IRes1DStructureOutlet Interface for a Res1D structure outlet which is a pecial kind of outlet: When a structure is discharging directly out of the system, and no outlet has been explicitly specified, the engine will put in a StuctureOutlet downstream of the structure.
IRes1DStructureReach Data desription and time step data for a reach that only contains a structure
IRes1DStructures Interface for a list of IRes1DStructure's Required for generic list COM interop
IResultBridge Interface that is to be implemted by any MIKE 1D result bridge. The interface standardizes the communication between ResultData access and persistant storage.
IResultBridgeFactory Interface for a result bridge factory
IResultBridgeFactoryTypeChecker Interface for a result bridge factory checker
IResultData The result data access is the class that all producers or users of MIKE 1D results should use. The class is used for recording the results, reading results, hotstarting the Mike1D engine and extracting specific results.
IResultDataHelper Helper class that extend the functionality of ResultData

Required for certain functions related to COM interop.

IResultDataIO TODO: Interface for working the the data in the underlying file format, on a file based manner.
IResultDataParameters Parameters to use when loading data into an IResultData
IResultDataReader Interface to connect the IResultData with an IResultReadBridge.

Special kind of read functionality can be required in different scenaries. Examples of read functionality include lazy reading (read only when required), time-filtered reading etc. The data reader implements this special read functionality for the IResultRandomReadBridge bridges.

IResultDataSearch Utility interface for searching in reaches, nodes, grid points and catchments in the result data object.

Provided for COM interop.


Obsolete
IResultRandomReadBridge A read bridge that is able to access time step data in random order from a result storage.
IResultReadBridge Interface that is to be implemted for a bridge that can read data from persistant storage into the ResultData access.
IResultReadWriteBridge Interface that is to be implemted for a bridge that can read and write between the ResultData access and persistant storage. For detail, see the IResultReadBridge and IResultWriteBridge.
IResultWriteBridge Interface that is to be implemted for a bridge that can write data from the ResultData access to persistant storage.

The Save method is used for storing the entire content of the result data object to persistant storage. When Save is called, the bridge should initialize and open the persistant storage, write data to the storage and finalise and close the storage.

The methods Prepare(IDiagnostics), Flush(Boolean) and Finish are used for storing data from the result data into persistent storage during a simulation.

The Prepare(IDiagnostics) is called during the prepare phase of the simulation, where all static data is available. The method must initialise the storage, open it for writing and write any required static data (not time dependent data) to the storage.

The Flush(Boolean) method is called regurlarly during the simulation, depending on the SecondsBetweenFileFlush parameter. There can be data for more than one time step in the result data object. The method must store all data present in the result data object. After the flush method, the current data in the result data object is removed. A final call to flush is issued when the simulation is done.

The Finish method will be called when the simulation is done and after the last flush call. It must finalize and close down the persistant storage.

ITimeData Data container, storing a number of time steps and element values.

It has methods for handling as well single valued items (one element) and vector items with several elements.

Res1DStreamBridgeIDynamicItem Interface for getting and adding data between a dynamic item and a (set of) data item(s)

Delegates

ResultDataDoStoreDelegate Delegate type used to override the build in functionality of when to store results in the result data object.
ResultProgressEvent Delegate type for hooking up on progress for reading/writing result files
ResultTimeStepEvent Delegate type for hooking up time step notifications

Enumerations

AsciiBridgeStaticItemTypes Types of static outputs.
DirectionTypes Direction of data on an axis.

Example

For velocity data, Positive means that positive velocity value is in positive axis direction, while Negative means that positive velocity value is in the negative axis direction.
EventSortType LTS sort type, when writing results to PFS file, whether to sort on time or on value.
GridPointTypes Types of gridpoints
ItemTypeGroup Enumeration that is used to describe whether a certain item is associated with global data, a node or a reach
LoadStatus 
LTSCalculatorTypes LTS calculator types
LTSResultTypes LTS simulation result types
M11FfBlockReaderBlockType Type of blocks in MIKE 11 file format
M11FfBridgeBaseGeometryType Type of geometry
PredefinedQuantityLTS Enumeration of predefined quantities for LTS module.
Res1DReachEnd Enumeration specifying an end of the reach.
Res1DSpatialFilterTypeEnum Type enum used in Res1DNetworkFilter to specify which grid points on a reach to include in the filter.
ResultDataDiffMsgLevels Message levels
ResultDataDiffMainCmdArgParseStatus Status when parsing command line arguments
ResultDataDiffMainDEBUGLEVELS Debug levels when running diff
ResultProgressType Type of progress being reported
ResultSpecificationFileMode How to handle creation of files
ResultTypes Enum specifying unit type of storing frequency
StoringFrequencyUnitTypes Enum specifying unit type of storing frequency