Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ComponentItemListBuilder.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ComponentItemListBuilder.cc (C) 2000-2024 */
9/* */
10/* Helper class for building a list of ComponentItem. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/materials/internal/ComponentItemListBuilder.h"
15#include "arcane/materials/internal/MeshMaterialVariableIndexer.h"
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane::Materials
23{
24namespace
25{
26 MemoryAllocationOptions _allocInfo(const String& name)
27 {
28 MemoryAllocationOptions opts(MemoryUtils::getDefaultDataAllocator());
29 opts.setArrayName(name);
30 return opts;
31 }
32} // namespace
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37ComponentItemListBuilder::
38ComponentItemListBuilder()
39{
40}
41
42/*---------------------------------------------------------------------------*/
43/*---------------------------------------------------------------------------*/
44
45ComponentItemListBuilderOld::
46ComponentItemListBuilderOld(MeshMaterialVariableIndexer* var_indexer,
47 Integer begin_index_in_partial)
48: m_component_index(var_indexer->index() + 1)
49, m_index_in_partial(begin_index_in_partial)
50, m_pure_matvar_indexes(_allocInfo("PureMatVarIndexes"))
51, m_partial_matvar_indexes(_allocInfo("PartialMatVarIndexes"))
52, m_partial_local_ids(_allocInfo("PartialLocalIds"))
53, m_indexer(var_indexer)
54{
55 Integer reserve_size = 4000;
56 m_pure_matvar_indexes.reserve(reserve_size);
57 m_partial_matvar_indexes.reserve(reserve_size);
58 m_partial_local_ids.reserve(reserve_size);
59}
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
63
64} // End namespace Arcane::Materials
65
66/*---------------------------------------------------------------------------*/
67/*---------------------------------------------------------------------------*/
Memory and allocator management functions.
Always enables tracing in Arcane parts concerning materials.
IMemoryAllocator * getDefaultDataAllocator()
Default allocator for data.
Int32 Integer
Type representing an integer.