sim

package
v0.0.0-...-5a422e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DIMP_PARAMETER int = 0
	DIMP_CELL      int = 1

	DIMI_CELL     int = 0
	DIMI_INPUT    int = 1
	DIMI_TIMESTEP int = 2

	DIMS_CELL  int = 0
	DIMS_STATE int = 1

	DIMO_CELL     int = 0
	DIMO_OUTPUT   int = 1
	DIMO_TIMESTEP int = 2
)

Variables

View Source
var Catalog = make(map[string](func() TimeSteppingModel))

Functions

func InitialiseOutputs

func InitialiseOutputs(model TimeSteppingModel, nTimeSteps int, nCells int) data.ND3Float64

func RunSingleModelJSON

func RunSingleModelJSON(r io.Reader, w io.Writer, splitOutputs bool)

Types

type Hotstartable

type Hotstartable interface {
	GetStates() []float64
	SetStates(states []float64)
}

type ModelDescription

type ModelDescription struct {
	Parameters []ParameterDescription
	States     []string
	Inputs     []string
	Outputs    []string
	Dimensions []string
}

type ParameterDescription

type ParameterDescription struct {
	Name        string
	Default     float64
	Description string
	Range       [2]float64
	RangeOpen   [2]bool
	Units       string
	Dimensions  []string
}

func DescribeParameter

func DescribeParameter(name string, defaultValue float64, description string,
	paramRange []float64, units string, dims []string) ParameterDescription

func DescribeParameters

func DescribeParameters(names []string) []ParameterDescription

func NewParameter

func NewParameter(name string) ParameterDescription

type RunResults

type RunResults struct {
	Outputs data.ND3Float64
	States  data.ND2Float64
}

type Series

type Series data.ND1Float64

type TimeSteppingModel

type TimeSteppingModel interface {
	Description() ModelDescription

	InitialiseDimensions(dims []int)
	FindDimensions(params data.ND2Float64) []int
	ApplyParameters(params data.ND2Float64)
	InitialiseStates(n int) data.ND2Float64
	Run(inputs data.ND3Float64, states data.ND2Float64, outputs data.ND3Float64)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL