Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
public void Initialise(IIdentifiable method, IElementSet fromElements, IElementSet toElements)

If Initialise is called at the beginning, a mapping matrix will be calculated for mapping the fromElements to the toElements. The mapping method is specified by the string method method, a string of type IIdentifiable.

Code Block
public TimeSpaceValueSet MapValues(ITimeSpaceValueSet inputValues)

During computation MapValues uses the mapping matrix calculated in Initialise. When the GetValues method is invoked, the source component uses this matrix to make the spatial conversion, simply by multiplying the vector of input values associated to the grid of the source components with the matrix.
For the example shown in the figure above, the mapping matrix will look as shown below:

When the groundwater model invokes the GetValues method in the river model, the river model can make the spatial transformation of its internal calculated leakages using the following multiplication:

where I is a vector with four components describing the leakage contribution to each grid cell in the groundwater model and L is a vector with three components, each value being the calculated leakage in a river branch.

A hard-coded example of this the coupling of a river and a groundwater model is the unit test LinkingRiverGWTest.cs in the Oatc.OpenMI.Wrappers.EngineWrapper.UnitTest namespace. ( C#-Code on SourceForge).

Adapted outputs

In OpenMI 2 spatial mapping can be done in a flexible way by plugging a spatial Adapted output between Provider and Consumer. A set of simple interpolations will be provided and application developers can integrate their own Adapted outputs with new interpolation methods. Furthermore, a series connection of Adapted outputs is possible.

...