Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a mix of small things.
The most important part is the usage of sorted containers to improve the performance of the output modules:
whenever the boundary conditions are numerous, the retrieval of strain and stresses on an element becomes the most time consuming part, not because the computations are hard per se, but because most of the time is spent looping through all the BCs looking for which of them are applied to such element. This suggests the best practice would be to merge together equivalent boundary conditions by merging the sets. At that point, in the case of element BCs, the bottleneck would be the O(N) lookup on the elements IntArray. This fix uses the sorted IntArray inside the Set, reducing the complexity to a one shot O(NlogN) and a O(logN) for each time the lookup is performed.
Note: since these structures are meant for lookup, in terms of performance an std::unordered_set (O(1)) would be better, but the memory footprint may be too much when the sets are a lot? 馃
The initialization of the staggered solver has
prob3
as an optional parameter. To retrieve that, the reference to the third element in the array is still passed around. This harmless in the Release build, the Debug build however performs out of bound checks and complains.The rest is unused variables and macros