Skip to content

Commit 8beff30

Browse files
[arcane,tests] Supprime utilisations de 'ItemInternal' dans les tests.
1 parent 4648006 commit 8beff30

File tree

6 files changed

+33
-37
lines changed

6 files changed

+33
-37
lines changed

arcane/src/arcane/tests/AMR/ErrorEstimate.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ errorToFlagConverter(RealArray& error_per_cell, const Real& refine_frac,
263263
i = 0;
264264
ENUMERATE_CELL (icell, mesh->ownActiveCells()) { // active cells
265265
Cell cell = *icell;
266-
ItemInternal* iitem = cell.internal();
267266
const Integer id = cell.localId();
268267
ARCANE_ASSERT((id < error_per_cell.size()), ("cell_lid < error_per_cell.size()"));
269268

@@ -272,18 +271,14 @@ errorToFlagConverter(RealArray& error_per_cell, const Real& refine_frac,
272271
// Flag pour deraffinement si error <= coarsen_fraction*delta + error_min
273272
if (cell_error <= coarsen_cutoff && cell.level() > 0) {
274273
if (cell.type() == IT_Hexaedron8) {
275-
Integer f = iitem->flags();
276-
f |= ItemInternal::II_Coarsen;
277-
iitem->setFlags(f);
274+
cell.mutableItemBase().addFlags(ItemInternal::II_Coarsen);
278275
}
279276
}
280277

281278
// Flag pour raffinement si error >= refinement_cutoff.
282279
if (cell_error >= refine_cutoff && cell.level() < max_level)
283280
if (cell.type() == IT_Hexaedron8) {
284-
Integer f = iitem->flags();
285-
f |= ItemInternal::II_Refine;
286-
iitem->setFlags(f);
281+
cell.mutableItemBase().addFlags(ItemInternal::II_Refine);
287282
}
288283
}
289284
}

arcane/src/arcane/tests/ItemVectorUnitTest.cc

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ class ItemPrinter2
5656
: m_item(item), m_item_kind(IK_Unknown), m_has_item_kind(false)
5757
{ _init(); }
5858
ItemPrinter2(const Item& item)
59-
: m_item(item.internal()), m_item_kind(IK_Unknown), m_has_item_kind(false)
59+
: m_item(item), m_item_kind(IK_Unknown), m_has_item_kind(false)
6060
{ _init(); }
6161
ItemPrinter2(const Item& item,eItemKind ik)
62-
: m_item(item.internal()), m_item_kind(ik), m_has_item_kind(true)
62+
: m_item(item), m_item_kind(ik), m_has_item_kind(true)
6363
{ _init(); }
6464
ItemPrinter2()
65-
: m_item(0), m_item_kind(IK_Unknown), m_has_item_kind(false)
65+
: m_item_kind(IK_Unknown), m_has_item_kind(false)
6666
{ _init(); }
6767

6868
public:
@@ -71,7 +71,7 @@ class ItemPrinter2
7171

7272
ItemPrinter2& assign(Item item)
7373
{
74-
m_item = item.internal();
74+
m_item = item;
7575
return (*this);
7676
}
7777

@@ -113,7 +113,7 @@ class ItemPrinter2
113113

114114
private:
115115

116-
ItemInternal* m_item;
116+
Item m_item;
117117
eItemKind m_item_kind;
118118
bool m_has_item_kind;
119119
Int32 m_flags;
@@ -214,42 +214,43 @@ operator<<(std::ostream& o,const ItemVectorPrinter& ip)
214214
void ItemPrinter2::
215215
print(std::ostream& o) const
216216
{
217-
if (!m_item || m_item->localId()==NULL_ITEM_LOCAL_ID){
217+
if (m_item.localId()==NULL_ITEM_LOCAL_ID){
218218
o << "(null_item)";
219219
return;
220220
}
221221

222222
if (m_flags & ONLY_UID){
223-
o << m_item->uniqueId();
223+
o << m_item.uniqueId();
224224
return;
225225
}
226226

227-
o << "{id=" << m_item->uniqueId()
228-
<< ':' << m_item->localId()
229-
<< ",o=" << m_item->owner();
227+
o << "{id=" << m_item.uniqueId()
228+
<< ':' << m_item.localId()
229+
<< ",o=" << m_item.owner();
230230
if (m_has_item_kind){
231231
o << ",k=" << itemKindName(m_item_kind);
232232
}
233233

234234
if (m_flags & CONNECTIVITY){
235-
eItemKind ik = m_item->kind();
235+
eItemKind ik = m_item.kind();
236236
ItemVectorPrinter ivp;
237237
ivp.setIndentLevel(-1);
238238
std::cout << "KIND=" << ik << '\n';
239+
auto item_base = m_item.itemBase();
239240
o << '\n';
240241
if (ik!=IK_Node)
241-
if (m_item->nbNode()!=0)
242-
_print(o,ivp,m_item->nodeList(),"Nodes");
243-
if (m_item->nbEdge()!=0)
244-
_print(o,ivp,m_item->edgeList(),"Edges");
245-
if (m_item->nbFace()!=0)
246-
_print(o,ivp,m_item->faceList(),"Faces");
242+
if (item_base.nbNode()!=0)
243+
_print(o,ivp,item_base.nodeList(),"Nodes");
244+
if (item_base.nbEdge()!=0)
245+
_print(o,ivp,item_base.edgeList(),"Edges");
246+
if (item_base.nbFace()!=0)
247+
_print(o,ivp,item_base.faceList(),"Faces");
247248
if (ik!=IK_Cell)
248-
if (m_item->nbCell()!=0)
249-
_print(o,ivp,m_item->cellList(),"Cells");
249+
if (item_base.nbCell()!=0)
250+
_print(o,ivp,item_base.cellList(),"Cells");
250251
if (ik==IK_Face){
251-
o << "BackCell " << ItemPrinter2(m_item->backCell()) << ' ';
252-
o << "FrontCell " << ItemPrinter2(m_item->frontCell()) << ' ';
252+
o << "BackCell " << ItemPrinter2(item_base.backCell()) << ' ';
253+
o << "FrontCell " << ItemPrinter2(item_base.frontCell()) << ' ';
253254
o << '\n';
254255
}
255256
_printIndent(o);

arcane/src/arcane/tests/ParticleUnitTest.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ _doTest2(Integer iteration,bool allow_no_cell_particle)
244244
Integer nb_created_particle = uids.size();
245245
while (particle_index<nb_created_particle){
246246
for( Integer icell=0; icell<nb_boundary_cell; ++icell ){
247-
Particle p = Particle(particles[particle_index].internal());
247+
Particle p = Particle(particles[particle_index]);
248248
// Si on n'autorise les particules sans maille, indique qu'une
249249
// particule sur 4 est sans maille.
250250
if (allow_no_cell_particle && (icell%4)==0)

arcane/src/arcane/tests/StdArrayMeshVariables.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ checkValues (Integer iteration, const GroupType& group)
104104
ITraceMng* tm = this->m_mesh_handle.mesh()->traceMng();
105105
Integer nb_display_error = 10;
106106
ENUMERATE_ITEM(iter,group){
107-
const ItemType& item = (*iter).internal();
107+
const ItemType& item = (*iter).itemBase();
108108
Int64 n = 1 + (item.uniqueId().asInt64() + iteration*7);
109109
Real r = Convert::toReal(n);
110110

@@ -177,7 +177,7 @@ template<class ItemType> void StdArrayMeshVariables<ItemType>::
177177
setValues(Integer iteration, const GroupType& group)
178178
{
179179
ENUMERATE_ITEM(iter,group){
180-
const ItemType& item = (*iter).internal();
180+
ItemType item = (*iter).itemBase();
181181
Int64 n = 1 + (item.uniqueId().asInt64() + iteration*7);
182182
Real r = Convert::toReal(n);
183183
Integer i = (Integer)(n);

arcane/src/arcane/tests/StdScalarMeshVariables.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ template<class ItemType> void StdScalarMeshVariables<ItemType>::
9999
setValues(Integer iteration, const GroupType& group)
100100
{
101101
ENUMERATE_ITEM(iter,group){
102-
ItemType item = (*iter).internal();
102+
ItemType item = (*iter).itemBase();
103103
setItemValues(iteration,item);
104104
}
105105
}
@@ -123,7 +123,7 @@ setValuesWithViews(Integer seed, const GroupType& group)
123123
MultiScalarValue sv;
124124

125125
ENUMERATE_ITEM(iter,group){
126-
ItemType item = (*iter).internal();
126+
ItemType item = (*iter).itemBase();
127127
Int64 n = 1 + (item.uniqueId().asInt64() + seed*7);
128128
_setReferenceValue(n,sv);
129129

@@ -212,7 +212,7 @@ checkValues (Integer iteration, const GroupType& group)
212212
MultiScalarValue current_sv;
213213
m_nb_displayed_error = 0;
214214
ENUMERATE_ITEM(iter,group){
215-
ItemType item = (*iter).internal();
215+
ItemType item = (*iter).itemBase();
216216

217217
current_sv.m_byte = this->m_byte[item];
218218
current_sv.m_real = this->m_real[item];
@@ -252,7 +252,7 @@ checkValuesWithViews(Integer seed, const GroupType& group)
252252

253253
Integer nb_error = 0;
254254
ENUMERATE_ITEM(iter,group){
255-
ItemType item = (*iter).internal();
255+
ItemType item = (*iter).itemBase();
256256

257257
current_sv.m_byte = in_byte[item];
258258
current_sv.m_real = in_real[item];

arcane/src/arcane/tests/dof/DoFTester.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ _addNodes(Int32Array2View new_nodes_lids, Int64Array2View new_nodes_uids)
10761076
added_items[rank] = mesh()->nodeFamily()->view(new_nodes_lids[rank]);
10771077
ENUMERATE_NODE(inode,added_items[rank])
10781078
{
1079-
inode->internal()->setOwner(rank,local_rank);
1079+
inode->mutableItemBase().setOwner(rank,local_rank);
10801080
info() << "== Add item " << inode->localId() << " on rank " << local_rank << " with owner " << rank;
10811081
}
10821082
}
@@ -1212,7 +1212,7 @@ _removeNodes(Int32ConstArray2View new_nodes_lids,
12121212
Int32 i = 0;
12131213
ENUMERATE_NODE(inode,removed_nodes[rank])
12141214
{
1215-
node_family->removeNodeIfNotConnected(inode->internal());
1215+
node_family->removeNodeIfNotConnected(*inode);
12161216
removed_node_uids[rank][i++] = inode->uniqueId().asInt64();
12171217
}
12181218
i = 0;

0 commit comments

Comments
 (0)