exasim-project / NeoFOAM

WIP Prototype of a modern CFD core
20 stars 1 forks source link

WIP: 30 arithmetic assignment operators for fields #34

Closed bevanwsjones closed 2 days ago

bevanwsjones commented 4 months ago

PLEASE MERGE #33 first

Field:

greole commented 3 months ago

What is the state of this PR, should we pick it up again?

bevanwsjones commented 3 months ago

What is the state of this PR, should we pick it up again?

Want to get #45 in first so we can do some assert checking on the executors.

bevanwsjones commented 2 months ago

@greole to complete this merge I think there are two ways to go:

  1. Develop an 'error' handling strategy and add it in through a separate merge request. We can go simple for now, but at least give it some 'formality'.
  2. I just put some 'if statements' in to check executor equality and exit if they are not the same.

I think we should do a quick rough implementation now because the later we leave it, the more it will be that 'custom' approaches will crop up all over the code base. I also don't think we need to be too fine-grained about it. In my experience the message, line number, and file are good - a stack trace would be great but probably too much for now. A switch for certain checks to be done in 'debug' and 'release' mode. Thoughts?

greole commented 2 months ago

Develop an 'error' handling strategy and add it in through a separate merge request. We can go simple for now, but at least give it some 'formality'.

If possible I really would like to have some stack trace feature. Unfortunately std::basic_stacktrace is a c++ 23 feature https://en.cppreference.com/w/cpp/utility/basic_stacktrace.

Maybe we can take a look at https://github.com/bombela/backward-cpp or https://github.com/jeremy-rifkin/cpptrace. I guess that should be a different PR though.

greole commented 6 days ago

@bevanwsjones since you're working on this. field could use a std::pair<size_t,size_t> field::range() {return {0, size()};} function.

bevanwsjones commented 2 days ago

@bevanwsjones since you're working on this. field could use a std::pair<size_t,size_t> field::range() {return {0, size()};} function.

done