Skip to content

Commit 537b355

Browse files
committed
One more way of trying MPAS AppIDs
1 parent 4274cd6 commit 537b355

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

src/pmpo_c.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ void polympo_setAppIDFunc_f(MPMesh_ptr p_mpmesh, IntVoidFunc getNext, void* appI
213213
}
214214

215215
void polympo_setMPASAppIDFunc_f(MPMesh_ptr p_mpmesh, VoidVoidFunc getMPASAppID, void* arg1, void*arg2, void*arg3,
216-
void* arg4, void* arg5, void*arg6) {
216+
const int arg4) {
217217
checkMPMeshValid(p_mpmesh);
218218
auto p_MPs = ((polyMPO::MPMesh*)p_mpmesh)->p_MPs;
219-
std::function<int()> polyMPO_getMPASAppID = [getMPASAppID, arg1, arg2, arg3, arg4, arg5, arg6]()
220-
{getMPASAppID(arg1, arg2, arg3, arg4, arg5, arg6); return *(static_cast<int*>(arg5));};
219+
std::function<int()> polyMPO_getMPASAppID = [getMPASAppID, arg1, arg2, arg3, arg4]()
220+
{ int iParticleNew; getMPASAppID(arg1, arg2, arg3, arg4, iParticleNew); return iParticleNew;};
221221
p_MPs->setAppIDFunc(polyMPO_getMPASAppID);
222222
}
223223

src/pmpo_c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void polympo_finishRebuildMPs_f(MPMesh_ptr p_mpmesh);
2525

2626
void polympo_setAppIDFunc_f(MPMesh_ptr p_mpmesh, IntVoidFunc getNext, void* appIDs);
2727
void polympo_setMPASAppIDFunc_f(MPMesh_ptr p_mpmesh, VoidVoidFunc getMPASAppID, void* arg1, void* arg2, void*arg3,
28-
void* arg4, void*arg5, void* arg6);
28+
const int arg4);
2929

3030
void polympo_getMPCurElmID_f(MPMesh_ptr p_mpmesh, const int numMPs, int* elmIDs);
3131
void polympo_setMPLatLonRotatedFlag_f(MPMesh_ptr p_mpmesh, const int isRotateFlag);

src/pmpo_defines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
typedef void* MPMesh_ptr;
99
//Function that receives void* and returns an int
1010
typedef int (*IntVoidFunc)(void*);
11-
typedef void (*VoidVoidFunc)(void*, void*, void*, void*, void*, void*);
11+
typedef void (*VoidVoidFunc)(void*, void*, void*, const int, int);
1212

1313
using space_t = Kokkos::DefaultExecutionSpace::memory_space;
1414

src/pmpo_fortran.f90

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,15 @@ subroutine polympo_setAppIDFunc(mpMesh, getNext, appIDs) &
118118
!> @param appIDs(in) Pointer to opaque data application data structure (that may contain all available app IDs)
119119
!---------------------------------------------------------------------------
120120
subroutine polympo_setMPASAppIDFunc(mpMesh, getMPASAppID, &
121-
arg1, arg2, arg3, arg4, arg5, arg6) &
121+
arg1, arg2, arg3, arg4) &
122122
bind(C, NAME='polympo_setMPASAppIDFunc_f')
123123
use :: iso_c_binding
124124
type(c_ptr), value :: mpMesh
125125
type(c_funptr), value :: getMPASAppID
126126
type(c_ptr), value :: arg1
127127
type(c_ptr), value :: arg2
128128
type(c_ptr), value :: arg3
129-
type(c_ptr), value :: arg4
130-
type(c_ptr), value :: arg5
131-
type(c_ptr), value :: arg6
129+
integer(c_int), intent(in), value :: arg4
132130
end subroutine
133131

134132

src/pmpo_materialPoints.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void MaterialPoints::migrate() {
151151
new_process(mp) = MPs2Proc(mp);
152152
if(rank!=new_process(mp)){
153153
mpAppID(mp)=-1;
154-
printf("Particle migrated and so its AppID is -1\n");
154+
printf("Particle migrated and so its AppID is -1\n");
155155
}
156156
}
157157
};

0 commit comments

Comments
 (0)