Entities

Entities include variables, coefficients, indices, and other objects that appear in the equations.

Main.Finch.VariableType
Variable{T<:AbstractFloat}

Represents a value that is not defined by an independent function of coordinates. Note that this does not have to be an unknown that is solved for. It can hold values that are dependent on other variables such as transformed variables, or any other value that the user has control over.

This is also useful for setting up data arrays that match those of unknowns. The values for a variable v can be directly accessed as v.values and has dimensions [C, N] where C is the number of components (SCALAR=1, etc.) and N is the number of nodes or cells.

This should be built with the variable function.

source
Main.Finch.CoefficientType
Coefficient{T<:AbstractFloat}

Represents an independent value that can be defined in terms of coordinates or assigned numerical values. Unlike variables, their values are typically not available to the user since they may be in the form of generated functions rather than numbers.

This should be built with the coefficient function.

source
Main.Finch.IndexerType
Indexer

An entity representing an index to be applied to a variable or coefficient. It has a symbol that can be used in expressions, a range of integer values, and a current value that can be accessed with I.value for an index labeled I.

This should be built with the index function.

source
Main.Finch.variableMethod
variable(name; type=SCALAR, location=NODAL, method=CG, index=nothing)

Create a variable entity with name that will be used in expressions. Type can be SCALAR, VECTOR, TENSOR, SYMTENSOR, or VARARRAY. Location can be NODAL or CELL. Generally nodal will be used for FEM and cell for FVM. The method can be specified for this variable when using a mixed solver, but will otherwise be the current solver type. It the type is VAR_ARRAY, it should be indexed using a previously defined indexer or an array of indexers.

Note that a variable does not have to represent an unknown. It can be used to store any value, and can be used in expressions, but does not need to be solved for explicitly.

source
Main.Finch.coefficientMethod
coefficient(name, val; type=SCALAR, location=NODAL, element_array=false)

Create a coefficient entity with name that will be used in expressions. The value can be a numerical constant, a string representing an expression of coordinates(x, y, z, t), or an array of numbers corresponding to the location. Type can be SCALAR, VECTOR, TENSOR, SYMTENSOR, or VARARRAY. Location can be NODAL or CELL. Generally nodal will be used for FEM and cell for FVM.

source
Main.Finch.parameterMethod
parameter(name, val; type=SCALAR)

Create a parameter entity with name that will be used in expressions. The value is a string expression that can include coordinates(x, y, z, t) and any variable and coefficient symbols. It is essentially a convenient object to simplify more complicated expressions. The type is not important as it will be determined by the symbolic expression it represents.

source
Main.Finch.indexMethod
index(name; range=[1])

Create an indexer entity to index variables and coefficients with a VAR_ARRAY type. The range can be an array of integers or an array with the min and max values. Though not strictly necessary, the range should start at 1 and increase consecutively. Other configurations may cause some issues in the generated code.

range=[1,2,3,4,5] is the same as range=[1,5]

source
Main.Finch.testSymbolMethod
testSymbol(symbol; type=SCALAR)

Define a symbol for a test function when using FEM. Type can be SCALAR, VECTOR, TENSOR, or SYM_TENSOR.

source