Click or drag to resize

EngineNet Class

The EngineNet holds the network that is used for the computations. It is the main entrance to module data/state.
Inheritance Hierarchy
SystemObject
  DHI.Mike1D.EngineEngineNet

Namespace:  DHI.Mike1D.Engine
Assembly:  DHI.Mike1D.Engine (in DHI.Mike1D.Engine.dll) Version: 19.0.0.0 (11.1.1.1111)
Syntax
public class EngineNet

The EngineNet type exposes the following members.

Constructors
  NameDescription
Public methodEngineNet
Create empty EngineNet.
Public methodEngineNet(StopwatchCollection)
Create empty EngineNet. StopwatchCollection will have added child watches used by the EngineNet.
Top
Properties
  NameDescription
Public propertyAdditionalData
Internal method. Additional data from the MIKE 1D data object. Set during initialize.
Public propertyADModule
AD module
Public propertyBaseFilePath
Internal method. Base file path of simulation. Set during initialize.
Public propertyCatchmentModifiers
Modifiers for catchment output.

Must be provided before prepare

Public propertyDataModule
DataModule - always present
Public propertyEngineTime
Simulation time. To be elaborated.
Public propertyHDModule
hdModule - must always be present
Public propertyLTSModule
LTS module
Public propertyMaxNumberOfThreadsUser
Maximum number of threads to use.

Using more than one thread may give different results, due change in order of calculations and therefor different rounding errors from simulation to simulation when running multiple threads. If exact same results are required for each simulation, set this to 1.

The number of threads actually used are limited by the smallest of this number, the number of logical processing units (number of CPU cores), the license and the OMP_NUM_THREADS environment variable.

Public propertyModules
All modules (HD, AD, WQ, ST)
Public propertyNodes
List of EngineNodes
Public propertyPauseSimulation
If this is true, then the simulation will pause before the next timestep
Public propertyProjectionString
Returns Projection String.
Public propertyReaches
List of Engine Reaches
Public propertyRRModule
RRModule, used when running RR+HD in parallel.
Public propertyRuntimeDiagnostics
Diagnostics instance for the engine net. Used during runtime.
Top
Methods
  NameDescription
Public methodAnyPostIterationEvent
Is there a PostIterationEvent
Public methodBuildSearchMaps
Build search maps. Whenever the list of reaches and nodes are updated, this method must be called to rebuild search maps.
Public methodCreateRuntimeDiagnostics
Create a runtime Diagnostics instance. This is called from Mike1DController.Prepare()
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFindAllReaches
Finds all the reach that uses the specified name. If none of the reaches contains the location null is returned.
Public methodFindNode
Find EngineNode based on location.
Public methodFindReach(String)
Finds the reach that contains the specified location. If none of the reaches contains the location null is returned. If more than span exist with the same reachId, the first found is returned.
Public methodFindReach(ILocation)
Finds the reach that contains the specified location. If none of the reaches contains the location null is returned. If location is exactly on a node, the location can exist on more than one reaches, the first in the list is returned.
Public methodFindReach(ILocation, Double)
Finds the reach that contains the specified location. If none of the reaches contains the location null is returned. If location is exactly on a node, the location can exist on more than one reaches, the first in the list is returned.
Public methodFinish
Finish the simulation
Public methodGetComponentConcentration
Get an array of all concentrations for all components at the given grid point
Public methodGetComponentSourcePoint(EngineNode)
Get a source point for component sources.

If no components are included in simulation, or if node is not part of component simulation, null is returned.

Public methodGetComponentSourcePoint(EngineReach, Int32)
Get a source point for component sources.

The gridPointIndex must match a grid point with volume, i.e. an HGridPoint.

If no components are included in simulation, or if node is not part of component simulation, null is returned.

Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetNumberOfThreads
Get the number of threads, taking the smallest of: input argument, the "OMP_NUM_THREADS" environment variable and the number of cores on the computer.

If the number of threads is smaller than the number of cores on the computer, and "OMP_NUM_THREADS" is not set, then "OMP_NUM_THREADS" is set to this value.

Public methodGetNumberOfThreadsEnvironment
Number of threads as defined by the environment variables.
Public methodGetSourcePointSurfaceInflow
Get a source point for surface inflow for the specified node. The NodeMaxInflowReservoir class collects all inflow from surface and applies a max inflow limit to how much is forwarded to the node. The remainder of the inflow is stored in a reservoir "on top of" the node. When no limit is specified (MaxInflowFromSurface is big), all inflow is added directly to the node.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitialize
In the initialization step, the network is layed out and the engine component is prepared for exchange item inspection.
Public methodInitializeModules
Initialize the modules. Called in general initialize step
Public methodInitializeThreadPool
For threaded domain decomposition, setup thread pool.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodPerformTimeStep
Perform a time step. In case of failure, an exception is thrown, usually through the RuntimeDiagnostics.

In case of adaptive time stepping, this method will redo the time step until the requirements are met or the minimum time step length is used.

Public methodPrepare
Prepares the engine for timestepping. - Creates and prepares resultDataAccess components - Initialize the engine by either reading initial conditions, reading hotstart information, by calculating steady solution or by some combination of these three Prepare() does not have to be called before OpenMI configuration phase.
Public methodReAssignBoundarySource
Reassign an open bounadry to a node.
Public methodReleaseLicense
Call this to release all licenses after simulation is done.
Public methodResetStopSimulation
Calling this function will end the simulation after the current timestep has been completed
Public methodRunUntil
Performs time steps until the specified time is reached
Public methodStopSimulation
Calling this function will end the simulation after the current timestep has been completed
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTriggerApplyExternalSourcesEvent
Public methodTriggerPostTimeStepEvent
Internal trigger method. Do not use!
Public methodTriggerSimulationDoneEvent
Internal code, do not use

Trigger simulation-done event.

Public methodTriggerSpecialEvent
Trigger a special event, with the provided id
Public methodTryFindReach
Finds the reach that contains the specified location. If none of the reaches contains the location null is returned.
Public methodValidate
Validate whether the EngineNet is in a valid state.
Top
Events
  NameDescription
Public eventApplyExternalSourcesEvent
An event that is called everytime external sources are to be applied
Public eventEvaluateHDImplicitSourcesEvent
An event that is called everytime external HD implicit sources are to be evaluated.

The event can be used when an AD component must be applied based on a HD implicit source.

Public eventPostIterationEvent
An event that is called everytime an iteration was successfully performed.
Public eventPostTimeStepEvent
An event that is called everytime a timestep was successfully performed.
Public eventPreTimeStepEvent
An event that is called everytime a timestep is initiated.

Arguments:

  • Time N
  • Time N+1
  • redo-counter, incremented when an adaptive time step is redone. Initially zero.

For adaptive time stepping a timestep can be rejected and recalculated, in which case this event is triggered more than once for the same time step, but with a different end time and the redocounter (third argument) is incremented.

Public eventSimulationDoneEvent
An event that is called when the simulation is done
Public eventSimulationPreparedEvent
An event that is called when the simulation has been prepared
Public eventSpecialEvent
Special events
Top
Fields
  NameDescription
Public fieldStopwatchOverall
public because we need to access it to add other timers
Public fieldStopwatchPostTimeStepEvent
public stopwatch for post time step event. When registering to the PostTimeStepEvent, you may also add a child to this stop watch, to detail out the timings.
Public fieldUseThreadedDomainDecomposition
Use Threaded domain decomposition
Top
Extension Methods
  NameDescription
Public Extension MethodDisableDispersion
Disable dispersion for AD on the enode
(Defined by CouplingsUtil.)
Public Extension MethodFindReachWithStructure
For a given structure, find the reach where it is located. Or null if it is not found.
(Defined by EngineExtensions.)
Public Extension MethodGetClosestDownstreamGridpoint
Find the specified type of gridpoint which is closest to the given location downstream.

It is assumed that the EngineReach max and min chainages are containing the given chainage, otherwise null is returned.

(Defined by EngineFindExtensions.)
Public Extension MethodGetClosestUpstreamGridpoint
Find the specified type of gridpoint which is closest to the given location upstream.

It is assumed that the EngineReach max and min chainages are containing the given chainage, otherwise null is returned.

(Defined by EngineFindExtensions.)
Top
See Also