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

[Core] Remove push_back from ModelPart #12903

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
dd02fc8
add additional insert and typecheck to PVS
sunethwarna Dec 5, 2024
2bf1e96
remove push_backs from ModelPart
sunethwarna Dec 5, 2024
2c5d23f
include reduction_utils
sunethwarna Dec 5, 2024
d5521ba
minor
sunethwarna Dec 5, 2024
2f72e0c
func name change
sunethwarna Dec 5, 2024
1e98ea3
fix embedded_skin_utility for Id Change
sunethwarna Dec 10, 2024
9c05b31
allow insertion from const vectors
sunethwarna Dec 10, 2024
abbce15
allow insertion from parent entity ranges
sunethwarna Dec 10, 2024
71ae35f
fix for iterator invalidation
sunethwarna Dec 10, 2024
6d34602
add comments
sunethwarna Dec 10, 2024
f1c4a6f
minor signature modification
sunethwarna Dec 10, 2024
35c1874
fix assign_ms_const_to_neigh_utils
sunethwarna Dec 11, 2024
13e87e7
fix error msg tests
sunethwarna Dec 11, 2024
a50fd2b
fix hdf5
sunethwarna Dec 11, 2024
8a42759
generalize addition from ids
sunethwarna Dec 11, 2024
93293e0
simplify
sunethwarna Dec 11, 2024
6adabf4
fix ranged id addition
sunethwarna Dec 11, 2024
9082f96
Merge remote-tracking branch 'origin/master' into pvs/remove_push_bac…
sunethwarna Dec 12, 2024
d7d4734
fix parmmg
sunethwarna Dec 16, 2024
d718a9a
add benchmarks for modelpart
sunethwarna Dec 16, 2024
4430f5e
minor for comparison
sunethwarna Dec 16, 2024
d7e05de
add type_traits
sunethwarna Dec 18, 2024
fedc6b3
allow rvalue containers in pvs insert
sunethwarna Dec 18, 2024
d642295
allow rvalue containers in model part
sunethwarna Dec 18, 2024
ee29e90
tests for rvalue containers in PVS
sunethwarna Dec 18, 2024
71e3074
more performance improvements
sunethwarna Dec 18, 2024
1024156
fix tests
sunethwarna Dec 18, 2024
a9e8219
minor
sunethwarna Dec 18, 2024
abfdcab
bug fix
sunethwarna Dec 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion kratos/containers/pointer_vector_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,20 @@ class PointerVectorSet final
SortedInsert(first, last);
}

/**
* @brief Insert elements from another PointerVectorSet range.
* @details This function inserts element pointers from another PointerVectorSet range specified by first and last into the current set.
* Since, PointerVectorSet is assumed to be sorted and unique, the incoming PointerVectorSet is not
* sorted and made unique again. This will not insert any elements in the incoming set, if there exists an element with a key
* which is equal to an element's key in the input range.
* @param first Other PointerVectorSet starting iterator
* @param last Other PointerVectorSet ending iterator
*/
void insert(PointerVectorSet::iterator first, PointerVectorSet::iterator last)
{
SortedInsert(first, last);
}

void insert(const PointerVectorSet& rOther)
{
insert(rOther.begin(), rOther.end());
Expand Down Expand Up @@ -1199,7 +1213,10 @@ class PointerVectorSet final
// which is harder to guess, and cryptic. Hence, using the decltype.
using iterator_value_type = std::decay_t<decltype(*Iterator)>;

if constexpr(std::is_same_v<iterator_value_type, std::remove_cv_t<TPointerType>>) {
if constexpr(std::is_same_v<TIteratorType, iterator> || std::is_same_v<TIteratorType, reverse_iterator>) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roigcarlo can you take a look into GetPointer and GetReference? these are difficult functions and i am quite afraid of their implications

// if the TIteratorType is of boost::indirect_iterator type, then we can get the pointer by dereferencing.
return *(Iterator.base());
} else if constexpr(std::is_same_v<iterator_value_type, std::remove_cv_t<TPointerType>>) {
// this supports any type of pointers
return *Iterator;
} else if constexpr(std::is_same_v<iterator_value_type, std::remove_cv_t<value_type>> && std::is_same_v<TPointerType, Kratos::intrusive_ptr<std::decay_t<decltype(*Iterator)>>>) {
Expand Down
Loading
Loading