drasil-code-0.1.9.0: A framework for code and document generation for scientific software - Code SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.CodeSpec

Description

Defines the CodeSpec structure and related functions.

Synopsis

Types

type Input = CodeVarChunk Source #

Program input.

type Output = CodeVarChunk Source #

Program output.

type Const = CodeDefinition Source #

Constants in the problem.

type Derived = CodeDefinition Source #

Derived inputs.

type ConstantMap = Map UID CodeDefinition Source #

Maps constants to their respective CodeDefinition.

data CodeSpec Source #

Code Specification. Holds system information and options.

Instances

Instances details
HasCodeSpec CodeSpec Source # 
Instance details

Defined in Language.Drasil.CodeSpec

HasSmithEtAlSRS CodeSpec Source # 
Instance details

Defined in Language.Drasil.CodeSpec

HasSystemMeta CodeSpec Source # 
Instance details

Defined in Language.Drasil.CodeSpec

Typeclasses

class HasCodeSpec c where Source #

Minimal complete definition

codeSpec

Methods

codeSpec :: Lens' c CodeSpec Source #

cMap :: Lens' c ConstraintCEMap Source #

configFiles :: Lens' c [RelativeFile] Source #

constDefns :: Lens' c [Const] Source #

constMap :: Lens' c ConstantMap Source #

derivedInputs :: Lens' c [Derived] Source #

execOrder :: Lens' c [Def] Source #

extInputs :: Lens' c [Input] Source #

inputs :: Lens' c [Input] Source #

mods :: Lens' c [Mod] Source #

outputs :: Lens' c [Output] Source #

srs :: Lens' c SmithEtAlSRS Source #

Constructors

mkCodeSpec :: SmithEtAlSRS -> Choices -> CodeSpec Source #

Creates a CodeSpec using the provided System, Choices, and Mods.

ODEs

getODE :: [ExtLib] -> Maybe ODE Source #

Get ODE from ExtLib

mapODE :: Maybe ODE -> [CodeDefinition] Source #

Maps ODE to their respective CodeDefinition.

Hacks

asVC :: Func -> DefinedQuantityDict Source #

Convert a Func to an implementation-stage DefinedQuantityDict representing the function.

funcUID :: Func -> UID Source #

Get a UID of a chunk corresponding to a Func.

getDerivedInputs :: [DataDefinition] -> [Input] -> [Const] -> ChunkDB -> [SimpleQDef] Source #

Determines the derived inputs, which can be immediately calculated from the knowns (inputs and constants). If there are DDs, the derived inputs will come from those. If there are none, then the QDefinitions are used instead.

getConstraints :: HasUID c => ConstraintCEMap -> [c] -> [ConstraintCE] Source #

Get a list of Constraints for a list of CodeChunks.

constraintvars :: ConstraintCE -> ChunkDB -> [CodeVarChunk] Source #

Get a list of CodeVarChunks from a constraint.