13#include "arcane/lima/internal/LimaUtils.h"
15#include "arcane/utils/CheckedConvert.h"
16#include "arcane/utils/ITraceMng.h"
18#include "arcane/core/IItemFamily.h"
19#include "arcane/core/IMeshReader.h"
20#include "arcane/core/ItemGroup.h"
39 if (!local_ids.
empty())
40 std::sort(std::begin(local_ids), std::end(local_ids));
44 for (
Integer i = 1; i < nb_item; ++i)
45 if (local_ids[i] == local_ids[i - 1]) {
48 if (nb_duplicated != 0) {
49 tm->
warning() <<
"Duplicated items in group name=" << name
50 <<
" nb_duplicated=" << nb_duplicated;
51 auto xbegin = std::begin(local_ids);
52 auto xend = std::end(local_ids);
53 Integer new_size = CheckedConvert::toInteger(std::unique(xbegin, xend) - xbegin);
54 tm->
info() <<
"NEW_SIZE=" << new_size <<
" old=" << nb_item;
55 local_ids = local_ids.
subView(0, new_size);
constexpr ArrayView< T > subView(Integer abegin, Integer asize) noexcept
Sub-view starting from element abegin and containing asize elements.
constexpr Integer size() const noexcept
Returns the size of the array.
constexpr bool empty() const noexcept
Returns true if the array is empty (zero dimension).
Interface of an entity family.
virtual ItemGroup createGroup(const String &name, Int32ConstArrayView local_ids, bool do_override=false)=0
Creates an entity group named name containing the entities local_ids.
virtual ITraceMng * traceMng() const =0
Associated trace manager.
virtual TraceMessage warning()=0
Stream for a warning message.
virtual TraceMessage info()=0
Stream for an information message.
static void createGroup(IItemFamily *family, const String &name, Int32ArrayView local_ids)
Creates a group of entities.
Unicode character string.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
ArrayView< Int32 > Int32ArrayView
C equivalent of a 1D array of 32-bit integers.