Skip to content

Commit 9bb7eb2

Browse files
committed
modified as per Cameron's comment
1 parent 2aa19c4 commit 9bb7eb2

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

mds/apfMDS.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,6 @@ class MeshMDS : public Mesh2
649649
{
650650
p = getPMent(pmodel, residence, owner);
651651
PCU_ALWAYS_ASSERT(p);
652-
//printf("(%d) setPtnClas e %d (id %d, owner=%d)\n", PCU_Comm_Self(), getMdsIndex(this,e), p->ID, p->owner);
653652
}
654653
mds_set_part(mesh, id, (void*)p);
655654
PCU_ALWAYS_ASSERT(mds_get_part(mesh, id)==(void*)p);

mds/apfPM.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515

1616
namespace apf {
1717

18-
int pme_id=0;
19-
18+
// the following three functions are for exclusive use by pumi_mesh_loadAll
2019
// the last arg "owner" is used only if a new pmodel entity is created
2120
PME* getPMent(PM& ps, apf::Parts const& pids, int owner)
2221
{
@@ -43,6 +42,7 @@ PME* getPMent(PM& ps, apf::Parts const& pids, int owner)
4342
return &p;
4443
}
4544
}
45+
static int pme_id=ps.size();
4646
PME *pme = new PME(pme_id++, pids, owner);
4747
ps.insert(*pme);
4848
++(pme->refs);
@@ -53,15 +53,11 @@ PME* getPMent(PM& ps, apf::Parts const& pids, int owner)
5353
void deletePM(PM& ps)
5454
{
5555
APF_ITERATE(PM, ps, it)
56-
{
57-
printf("(%d) %s: delete PME %d\n", PCU_Comm_Self(), __func__, it->ID);
5856
ps.erase(*it);
59-
}
6057
}
6158

6259
void deletePMent(PM& ps, PME* p)
6360
{
64-
printf("(%d) %s: delete PME %d\n", PCU_Comm_Self(), __func__, p->ID);
6561
ps.erase(*p);
6662
}
6763

@@ -70,7 +66,7 @@ typedef std::map<int,size_t> CountMap;
7066

7167
PME* getPME(PM& ps, apf::Parts const& ids)
7268
{
73-
PME const& cp = *(ps.insert(PME(pme_id++, ids, -1)).first);
69+
PME const& cp = *(ps.insert(PME(ps.size(), ids, -1)).first);
7470
/* always annoyed by this flaw in std::set */
7571
PME& p = const_cast<PME&>(cp);
7672
++(p.refs);

mds/apfPM.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ struct PME
2424
if (o>-1) owner = o;
2525
ids.assign(i.begin(), i.end());
2626
refs = 0;
27-
#ifdef DEBUG
28-
printf("(%d) create a new PME %d (pids.size=%d, ownder=%d)\n", PCU_Comm_Self(), ID, ids.size(), owner);
29-
#endif
3027
}
3128

3229
bool operator<(PME const& other) const
@@ -36,23 +33,22 @@ struct PME
3633
int owner;
3734
std::vector<int> ids;
3835
int refs;
39-
int ID;
36+
int ID; // debugging purpose
4037
};
4138

4239
typedef std::set<PME> PM;
4340

4441
void deletePM (PM& ps);
4542
void deletePMent(PM& ps, PME* p);
46-
PME* getPMent(PM& ps, apf::Parts const& pids, int);
43+
PME* getPMent(PM& ps, apf::Parts const& pids, int o = -1);
4744

4845
PME* getPME(PM& ps, Parts const& ids);
4946
void putPME(PM& ps, PME* p);
5047
void updateOwners(Mesh* m, PM& ps);
5148

5249
void stitchMesh(Mesh2* m);
5350

54-
void remapPM(PM& pm,
55-
int (*map)(int, void*), void* user);
51+
void remapPM(PM& pm, int (*map)(int, void*), void* user);
5652

5753
}
5854

0 commit comments

Comments
 (0)