Click or drag to resize

Mike1DController Class

The Mike1DController is the entry point for an HD simulation, including any enabled modules (Rainfall runoff, AD, Control etc.)

It links the simulation setup with the actual engine setup. It controls initialization, start, stop and finalization of the engine.

Inheritance Hierarchy

Namespace:  DHI.Mike1D.Mike1DDataAccess
Assembly:  DHI.Mike1D.Mike1DDataAccess (in DHI.Mike1D.Mike1DDataAccess.dll) Version: 19.0.0.0 (11.1.1.1111)
Syntax
public class Mike1DController : AbstractMike1DController, 
	IMike1DController, IModelStateReadWrite

The Mike1DController type exposes the following members.

Constructors
  NameDescription
Public methodMike1DController
Default constructor

The logfilewriter will be created based on the input file name, or connection properties, when calling the Open(IConnection, IDiagnostics) method.

Public methodMike1DController(DiagnosticsHandler)
Make a controller that uses the provided diagnosticsHandler for handling diagnostics messages. This is convenient if the diagnosticsHandler is to be resued by more than one controller.
Top
Properties
  NameDescription
Public propertyCurrentTime
Current time of simulation
(Overrides AbstractMike1DControllerCurrentTime.)
Public propertyDiagnosticsHandler
Handler, taking care of diagnostics messages.
(Inherited from AbstractMike1DController.)
Public propertyEngineNet
The enginenet used for the simulation
(Inherited from AbstractMike1DController.)
Public propertyIsFailed
Bool indicating that the controller is in a failed state
(Inherited from AbstractMike1DController.)
Public propertyMike1DData
The Mike1DData that defines the simulation setup
(Inherited from AbstractMike1DController.)
Public propertyMinSecondsBetweenProgressEvent
Minimum number of seconds between the ControllerProgressEvent is triggered.
(Inherited from AbstractMike1DController.)
Public propertyProgressState
Progress state of the controller, specifying how far the controller has progressed. One of Initialized,Prepared,Running.
(Inherited from AbstractMike1DController.)
Public propertyResultDataList
List of all result data components associated with
(Inherited from AbstractMike1DController.)
Public propertyRuntimeDiagnostics
Diagnostics that are used during the simulation (prepare, run)
(Inherited from AbstractMike1DController.)
Public propertySimulationType
String to indicate the type of simulation being run. Used for user output only.
(Overrides AbstractMike1DControllerSimulationType.)
Public propertyState
Current state of the controller
(Inherited from AbstractMike1DController.)
Public propertyStateWriter
Public propertyTimings
Detailed timings of the different parts of the simulation.
(Inherited from AbstractMike1DController.)
Top
Methods
  NameDescription
Protected methodChangeControllerState
Change the state of the controller. Also triggers the ControllerEvent
(Inherited from AbstractMike1DController.)
Protected methodDoFinish
Finish and clean up
(Overrides AbstractMike1DControllerDoFinish.)
Protected methodDoInitialize
Initialize the engine. Initialize sets up the engine net. When done, the EngineNet will be ready to inform on what data is available
(Overrides AbstractMike1DControllerDoInitialize(IDiagnostics).)
Protected methodDoPrepare
Prepare the engine. This is called just before run is called.
(Overrides AbstractMike1DControllerDoPrepare.)
Protected methodDoPrepareBoundaryData
Prepares boundary data.
Protected methodDoPrepareCatchmentResultFiles
Prepares catchment result files.
Protected methodDoPrepareDiagnostics
Prepares runtime diagnostics.
Protected methodDoPrepareLTSModule
Prepares LTS module.
Protected methodDoPrepareResultFileFolder
Prepares result file folder.
Protected methodDoRun
Run the engine to end of simulation.
(Overrides AbstractMike1DControllerDoRun.)
Protected methodDoRunUntil
Run the engine to specified end time.
(Overrides AbstractMike1DControllerDoRunUntil(DateTime).)
Protected methodDoStopSimulation
Calling this function will end the simulation after the current timestep has been completed
(Overrides AbstractMike1DControllerDoStopSimulation.)
Protected methodDoValidate
Validate that the Controller does not have any errors/warnings
(Overrides AbstractMike1DControllerDoValidate.)
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 methodFinish
Finish and clean up.
(Inherited from AbstractMike1DController.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Protected methodGetLTSResultSpecifications
Produces LTS result specification.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitialize
Initialize the engine. Initialize sets up the engine net. When done, the EngineNet will be ready to inform on what data is available
(Inherited from AbstractMike1DController.)
Protected methodInitTimings
Initiate timings
(Overrides AbstractMike1DControllerInitTimings.)
Protected methodInvokeControllerProgressEvent
Call to invoke a progress event
(Inherited from AbstractMike1DController.)
Public methodIsInActiveState
Returns true if the controller is in an active state and currently executing.
(Inherited from AbstractMike1DController.)
Public methodStatic memberLoad(IConnection)
Creates a Mike1DController and loads the setup. The setup is loaded with all default parameters.

In case of errors when loading the setup, a Mike1DException is thrown. Errors can be examined by extracting the IDiagnostics object stored in Data using string key "Diagnostics".

Public methodStatic memberLoad(IConnection, IDiagnostics)
Creates a Mike1DController and loads the setup. The setup is loaded with all default parameters
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOpen
Open the file specified by the connection.
Public methodPrepare
Prepare the engine. This is called just before run is called. I will set the initial state (initial conditions), open output files etc.
(Inherited from AbstractMike1DController.)
Protected methodRaiseControllerFailedEvent
Put controller in a failed state, and issue a failed event on ControllerEvent
(Inherited from AbstractMike1DController.)
Public methodRaiseSpecialEvent
Trigger a custom special event
(Inherited from AbstractMike1DController.)
Protected methodReadStartStates
Read the controller start state. It is in a method to let the Mike1DControllerEM objects skip this part
Public methodReadState
Reading starting state of a MIKE 1D controller from a state file. Used when a reader is already defined - could ex. be used to read the starting state of DA ensemble member
Public methodRun
Run the engine
(Inherited from AbstractMike1DController.)
Public methodRunManual
Must be called when running the engine manually, timestep by timestep, i.e. when not using the Run or RunUntil(DateTime) methods.

This is required for correctly transferring the engine to the run state before taking the time step.

(Inherited from AbstractMike1DController.)
Public methodRunUntil
Run the engine until endTime.

endTime should not exceed the simulation end time.

(Inherited from AbstractMike1DController.)
Protected methodSetupStateWriting
Setup writing of the controller state. It is in a method to let the Mike1DControllerEM objects skip this part
Public methodStopSimulation
Calling this function will end the simulation after the current timestep has been completed
(Inherited from AbstractMike1DController.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodValidate
Validate that the Controller/data access modules does not have any errors/warnings. Can be called before Initialize(IDiagnostics).
(Inherited from AbstractMike1DController.)
Public methodWriteState
Writing current state of a MIKE 1D controller to a state file. Used when a writer is already defined - could ex. be used to write the DA ensemble member
Top
Events
  NameDescription
Public eventControllerEvent
Event that is raised while the controller is running. It is raised whenever the State of the controller changes.
(Inherited from AbstractMike1DController.)
Public eventControllerProgressEvent
Controller progress event, triggered whenever the controller has progressed, though no more often than MinSecondsBetweenProgressEvent
(Inherited from AbstractMike1DController.)
Public eventSpecialEvent
Event that is raised for special events
(Inherited from AbstractMike1DController.)
Top
Fields
  NameDescription
Protected field_engineNet
EngineNet
(Inherited from AbstractMike1DController.)
Protected field_engineNetGlobal
Global (entire) EngineNet. Used when decomposing setup into several domains, where this contains the full EngineNet
(Inherited from AbstractMike1DController.)
Protected field_mike1DData
MIKE 1D data object
(Inherited from AbstractMike1DController.)
Protected field_resultDataList
Active result data objects
(Inherited from AbstractMike1DController.)
Protected field_runtimeDiagnostics
Diagnostics object used during runtime
(Inherited from AbstractMike1DController.)
Protected field_state
Current state of controller
(Inherited from AbstractMike1DController.)
Protected field_suppressUnknownExceptions
Flag indicating whether to suppress unknown exception.
(Inherited from AbstractMike1DController.)
Protected field_timings
Timings used in controller
(Inherited from AbstractMike1DController.)
Protected field_timingsPrep
Timings used during prepare
Protected field_timingsRun
Timings used during runtime
Public fieldMaxNumberOfThreadsUser
Maximum number of threads, set by the user.
Public fieldUseThreadedDomainDecomposition
Use Threaded domain decomposition
Top
Extension Methods
  NameDescription
Public Extension MethodCanWriteHtmlSummary
Check if controller is in a state to write HTML summary
(Defined by ControllerExtensions.)
Top
See Also