Skip to content

Allow StaticArray or FieldVector with extra fields #592

Open
@mauro3

Description

@mauro3

It would be nice if custom defined StaticArrays or FieldVectors could have extra fields which would not form part of the array. Example:

struct Point3D <: FieldVector{3, Float64}
    x::Float64
    y::Float64
    z::Float64
    proj::String # Proj4 or similar string
end

This feature would allow to use arbitrary fields of a type to be exposed as a vector, and then be used in e.g. diff-eq solver.

I don't think this can work with the current similar_type interface. If similar_type would take an instance instead of a type, then that could be used to make an appropriate constructor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    designspeculative design related issuefeaturefeatures and feature requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions