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

Make Field more powerful #897

Closed
dschwoerer opened this issue Feb 22, 2018 · 2 comments
Closed

Make Field more powerful #897

dschwoerer opened this issue Feb 22, 2018 · 2 comments

Comments

@dschwoerer
Copy link
Contributor

Currently it is quite hard to use Field for anything.
It cannot be used to checkdata, copy a field, or iterate over it.
Therefore the solver e.g. needs to maintain a separate list for field3d and field2d - fieldperp or other fields are not supported.
This breaks the usefulness of the fields being derived from field.
Therefore fixing #208 is rather useless - as it would require much work or be of limited use.

checkData(Field) could be implemented to use RTTI to do the job - but that is not a nice solution - and would be trivially avoided if checkData() would be a member function of Field - then the vtable would resolve to the appropriate implementation of checkData at runtime.
Field3D shouldn't be (much) slower, if it is marked as final ...

To summarize:

  • Do we want other Fields?
  • Should we use RTTI or make fiend functions member functions?
  • Is there a better way to make use use Field more often, rather then being limited to Field3D?
@bendudson
Copy link
Contributor

Field and FieldData should be merged, in my opinion. It's hard to make much use of Field in any performance-critical parts of the code, due to the vtable indirection needed. Generally I think we can use polymorphism at compile time: checkData overloaded for different field types; polymorphism less commonly needed at runtime. There are some places which are not performance critical where it would be nice though.

@ZedThree
Copy link
Member

I think this mostly done in #2313. as well as more use of templates.

There's still places where this could be improved (e.g. Solver's use of separate vectors for each field type), but we're getting there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants