Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have two set of fields #55

Merged
merged 8 commits into from
Nov 21, 2019
Merged

Conversation

ahojukka5
Copy link
Member

This PR introduces a new type of set of fields, which must be defined and initialized when creating a new element. Closes issue #47. It is now well-known that the use of Dict{String,AbstractField}, where fields are dynamically defined during the simulation, leads to type instability problems. Problem is solved by having two kinds of fields in the element, let's call them sfields and dfields, where the dfields is the old implementation and sfields is the new one.

@ahojukka5 ahojukka5 force-pushed the ahojukka5/fix_interpolation_performance branch 2 times, most recently from 0147d38 to 9b15470 Compare April 12, 2019 11:50
@ahojukka5 ahojukka5 force-pushed the ahojukka5/fix_interpolation_performance branch from 9983eca to 71af1ed Compare November 21, 2019 17:02
@ahojukka5 ahojukka5 marked this pull request as ready for review November 21, 2019 17:15
We get some bad ideas, like writing own `size` and `length`. We should
get rid of them in some time, thus moved to `depreacted.jl`.
Declar new abstract type AbstractElement and modify functions so that
they take AbstractElement as input argument. This change allows to
define new elements with different properties, in principle. However
most of the functions are heavily related to existing structure of the
Element.
About 25 ns to 20 ns by changing comparison. I also noted that
interpolation when time is `Inf` or `-Inf` is significantly faster, only
7 ns, so for fast access for first or last time frame, maybe consider
that.
Avoid type confusion by having a type for a field. After all, it's a
field and ::AbstractField is thus justified.
This is the first step to implement statically typed fields. Let's make
room for the implementation by renaming old fields to dfields and also
make the code in elements.jl to be more clear. Lot of stuff moved to
deprecated.jl.
This is going to be a part of documentation using Literate.jl
@ahojukka5 ahojukka5 force-pushed the ahojukka5/fix_interpolation_performance branch from 71af1ed to be5f52d Compare November 21, 2019 17:18
Declaring elements without connectivity vector/tuple at all is probably
a bad idea. Better idea is to define right size vector describing
connectivity, but give zeros to those nodes which are not connected to
anywhere.
@ahojukka5 ahojukka5 merged commit 2a0fd11 into master Nov 21, 2019
@ahojukka5 ahojukka5 deleted the ahojukka5/fix_interpolation_performance branch November 21, 2019 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant