Skip to content

Discuss new L2GTransformer constructor #104

@pjaap

Description

@pjaap

See @j-fu comment in #100:

I would agree. But if there is time: I thought a bit more on this. Adding a type stable method

function L2GTransformer(
        EG::Union{Type{<:Tetrahedron3D}, Type{<:Parallelepiped3D}},
        grid::ExtendableGrid{Tv, Ti},
        AT::Type{<:AssemblyType},
        CT::Type{<:AbstractCoordinateSystem}
    ) where {Tv, Ti}
    A = zeros(Tv, size(grid[Coordinates], 1), dim_element(EG))
    b = zeros(Tv, size(grid[Coordinates], 1))
    return L2GTransformer{Tv, Ti, EG, CT}(
        0,
        false,
        grid[Coordinates],
        grid[GridComponentNodes4AssemblyType(AT)],
        grid[GridComponentVolumes4AssemblyType(AT)],
        A,
        b,
        zeros(Tv, 3, 3),
        0
    )
end

could help to solve this. However one would have to do more at the call site as well.

Originally posted by @j-fu in #100 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions