Skip to content

Commit 5856e02

Browse files
committed
CleanUp for PR_v2
1 parent 44d1f40 commit 5856e02

File tree

7 files changed

+183
-187
lines changed

7 files changed

+183
-187
lines changed

src/pmpo_MPMesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ void MPMesh::T2LTracking(Vec2dView dx){
320320
auto mpPositions = p_MPs->getData<MPF_Cur_Pos_XYZ>();
321321
auto MPs2Elm = p_MPs->getData<MPF_Tgt_Elm_ID>();
322322
auto mpStatus = p_MPs->getData<MPF_Status>();
323-
323+
324324
auto T2LCalc = PS_LAMBDA(const int& elm, const int& mp, const int&mask){
325325
Vec2d MP(mpPositions(mp,0),mpPositions(mp,1));//XXX:the input is XYZ, but we only support 2d vector
326326
if(mask){

src/pmpo_MPMesh.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ template <> const MaterialPointSlice meshFieldIndexToMPSlice < MeshF_OnSurfVeloI
1818
#define maxMPsPerElm 8
1919

2020
class MPMesh{
21-
21+
2222
public:
2323

2424
Mesh* p_mesh;
@@ -68,7 +68,7 @@ class MPMesh{
6868
template <MeshFieldIndex meshFieldIndex>
6969
void assemblyElm0();
7070
template <MeshFieldIndex meshFieldIndex>
71-
void assemblyVtx1();
71+
void assemblyVtx1();
7272
void reconstruct_coeff_full();
7373
void invertMatrix(const Kokkos::View<double**>& vtxMatrices, const double& radius);
7474
Kokkos::View<double*[vec3d_nEntries][vec4d_nEntries]> precomputedVtxCoeffs_new;

src/pmpo_c.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void polympo_createMPs_f(MPMesh_ptr p_mpmesh,
9696
MPI_Allreduce(&numActiveMPs, &globalNumActiveMPs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
9797
MPI_Allreduce(&minElmID, &globalMinElmID, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD);
9898
PMT_ALWAYS_ASSERT(globalNumActiveMPs>0);
99-
99+
100100
//Loop over all mesh elements 0,1,... and find the first element that has an associated MP
101101
int firstElmWithMPs=INT_MAX;
102102
for (int i=0; i<numElms; i++) {
@@ -107,7 +107,7 @@ void polympo_createMPs_f(MPMesh_ptr p_mpmesh,
107107
}
108108
int globalFirstElmWithMPs;
109109
MPI_Allreduce(&firstElmWithMPs, &globalFirstElmWithMPs, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD);
110-
110+
111111
int offset = -1;
112112
if(globalMinElmID-globalFirstElmWithMPs==1) {
113113
offset = 1;
@@ -210,7 +210,7 @@ void polympo_startRebuildMPs2_f(MPMesh_ptr p_mpmesh,
210210
const int nMPs_add,
211211
int* recvMPs_elm,
212212
int* recvMPs_ids) {
213-
213+
214214
Kokkos::Timer timer;
215215
checkMPMeshValid(p_mpmesh);
216216
auto p_MPs = ((polyMPO::MPMesh*)p_mpmesh)->p_MPs;
@@ -224,7 +224,7 @@ void polympo_startRebuildMPs2_f(MPMesh_ptr p_mpmesh,
224224
auto elem_ids_d = create_mirror_view_and_copy(elem_ids, sizeMP2elm);
225225
auto recvMPs_elm_d = create_mirror_view_and_copy(recvMPs_elm, nMPs_add);
226226
auto recvMPs_ids_d = create_mirror_view_and_copy(recvMPs_ids, nMPs_add);
227-
227+
228228
Kokkos::View<int*> mp2Elm("mp2Elm", p_MPs->getCapacity());
229229
Kokkos::View<int*> numDeletedMPs_d("numDeletedMPs", 1);
230230
auto mpAppID = p_MPs->getData<polyMPO::MPF_MP_APP_ID>();
@@ -1161,7 +1161,7 @@ void polympo_getMeshElmCenter_f(MPMesh_ptr p_mpmesh, const int nCells, double* x
11611161

11621162
//check the size
11631163
PMT_ALWAYS_ASSERT(p_mesh->getNumElements()==nCells);
1164-
1164+
11651165
//copy the device to host
11661166
auto elmCenter = p_mesh->getMeshField<polyMPO::MeshF_ElmCenterXYZ>();
11671167
auto h_elmCenter = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), elmCenter);

src/pmpo_c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void polympo_applyReconstruction_f(MPMesh_ptr p_mpmesh);
113113
void polympo_reconstruct_coeff_with_MPI_f(MPMesh_ptr p_mpmesh);
114114
void polympo_reconstruct_iceArea_with_MPI_f(MPMesh_ptr p_mpmesh);
115115
void polympo_reconstruct_velocity_with_MPI_f(MPMesh_ptr p_mpmesh);
116-
116+
117117
// Timing
118118
void polympo_enableTiming_f();
119119
void polympo_summarizeTime_f();

src/pmpo_fortran.f90

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ module polympo
1313
subroutine polympo_initialize() bind(C, NAME='polympo_initialize_f')
1414
use :: iso_c_binding
1515
end subroutine
16-
16+
1717
!---------------------------------------------------------------------------
1818
!> @brief finalize polympo, no polympo apis may be called after this
1919
!> @remark the user must not finalize MPI until after this call
2020
!---------------------------------------------------------------------------
2121
subroutine polympo_finalize() bind(C, NAME='polympo_finalize_f')
2222
use :: iso_c_binding
2323
end subroutine
24-
24+
2525
!---------------------------------------------------------------------------
2626
!> @brief create MPMesh object
2727
!> @param testMeshOption >0 init a planar test Mesh
@@ -35,7 +35,7 @@ function polympo_createMPMesh(setMeshOption, setMPOption) bind(C, NAME='polympo_
3535
type(c_ptr) polympo_createMPMesh
3636
integer(c_int), value :: setMeshOption, setMPOption
3737
end function
38-
38+
3939
!---------------------------------------------------------------------------
4040
!> @brief delete MPMesh object
4141
!> @param mpmesh(in/out) MPMesh object
@@ -44,7 +44,7 @@ subroutine polympo_deleteMPMesh(mpMesh) bind(C, NAME='polympo_deleteMPMesh_f')
4444
use :: iso_c_binding
4545
type(c_ptr), value :: mpMesh
4646
end subroutine
47-
47+
4848
!---------------------------------------------------------------------------
4949
!> @brief set the MPI communicator used by polympo
5050
!> @param comm(in) MPI communicator
@@ -55,13 +55,13 @@ subroutine polympo_setMPICommunicator(mpMesh, comm) &
5555
type(c_ptr), value :: mpMesh
5656
integer(c_int), value :: comm
5757
end subroutine
58-
58+
5959
subroutine polympo_startCommunication(mpMesh) &
6060
bind(C, NAME='polympo_startCommunication_f')
6161
use :: iso_c_binding
6262
type(c_ptr), value :: mpMesh
6363
end subroutine
64-
64+
6565
!---------------------------------------------------------------------------
6666
!> @brief create the material points
6767
!> @brief the fields associated with the MPs are NOT initialized
@@ -82,7 +82,7 @@ subroutine polympo_createMPs(mpMesh, numElms, numMPs, mpsPerElm, mp2Elm, isMPAct
8282
type(c_ptr), intent(in), value :: mp2Elm
8383
type(c_ptr), intent(in), value :: isMPActive
8484
end subroutine
85-
85+
8686
!---------------------------------------------------------------------------
8787
!> @brief move MPs to a new element, add new MPs, or delete MPs
8888
!> @brief the fields associated with the MPs are NOT initialized
@@ -128,7 +128,7 @@ subroutine polympo_finishRebuildMPs(mpMesh) &
128128
use :: iso_c_binding
129129
type(c_ptr), value :: mpMesh
130130
end subroutine
131-
131+
132132
!---------------------------------------------------------------------------
133133
!> @brief Stores pointer to appID data structure and a function to retrieve them used in migration
134134
!> @param mpmesh(in/out) MPMesh object
@@ -142,7 +142,7 @@ subroutine polympo_setAppIDFunc(mpMesh, getNext, appIDs) &
142142
type(c_funptr), value :: getNext
143143
type(c_ptr), value :: appIDs
144144
end subroutine
145-
145+
146146
!---------------------------------------------------------------------------
147147
!> @brief get the current element ID MP array from a polympo array
148148
!> @param mpmesh(in/out) MPMesh object
@@ -164,7 +164,7 @@ subroutine polympo_getMPTgtElmID(mpMesh, numMPs, array) &
164164
integer(c_int), value :: numMPs
165165
type(c_ptr), value :: array
166166
end subroutine
167-
167+
168168
!---------------------------------------------------------------------------
169169
!> @brief set the mp lat lon is rotational or normal
170170
!> @param mpmesh(in/out) MPMesh object
@@ -176,7 +176,7 @@ subroutine polympo_setMPLatLonRotatedFlag(mpMesh, isRotateFlag) &
176176
type(c_ptr), value :: mpMesh
177177
integer(c_int), value :: isRotateFlag
178178
end subroutine
179-
179+
180180
!---------------------------------------------------------------------------
181181
!> @brief set the MP positions array from a host array
182182
!> @param mpmesh(in/out) MPMesh object
@@ -191,7 +191,7 @@ subroutine polympo_setMPPositions(mpMesh, nComps, numMPs, array) &
191191
integer(c_int), value :: nComps, numMPs
192192
type(c_ptr), value :: array
193193
end subroutine
194-
194+
195195
!---------------------------------------------------------------------------
196196
!> @brief get the MP positions array from a polympo array
197197
!> @param mpmesh(in/out) MPMesh object
@@ -207,7 +207,7 @@ subroutine polympo_getMPPositions(mpMesh, nComps, numMPs, array) &
207207
integer(c_int), value :: nComps, numMPs
208208
type(c_ptr), value :: array
209209
end subroutine
210-
210+
211211
!---------------------------------------------------------------------------
212212
!> @brief set the MP positions array from a host array
213213
!> @param mpmesh(in/out) MPMesh object
@@ -222,7 +222,7 @@ subroutine polympo_setMPTgtPositions(mpMesh, nComps, numMPs, array) &
222222
integer(c_int), value :: nComps, numMPs
223223
type(c_ptr), value :: array
224224
end subroutine
225-
225+
226226
!---------------------------------------------------------------------------
227227
!> @brief get the MP positions array from a polympo array
228228
!> @param mpmesh(in/out) MPMesh object
@@ -302,7 +302,7 @@ subroutine polympo_getMPTgtRotLatLon(mpMesh, nComps, numMPs, array) &
302302
integer(c_int), value :: nComps, numMPs
303303
type(c_ptr), value :: array
304304
end subroutine
305-
305+
306306
!---------------------------------------------------------------------------
307307
!> @brief set the Mass MP array from a host array
308308
!> @param mpmesh(in/out) MPMesh object
@@ -372,7 +372,7 @@ subroutine polympo_setMPStrainRate(mpMesh) &
372372
!getMPStrainRate
373373
!setMPStress
374374
!getMPStress
375-
375+
376376
!---------------------------------------------------------------------------
377377
!> @brief Enable the setting of mesh topology (number of entities and entity adjacencies).
378378
!> By default, modifying the mesh topology without calling this function first will result
@@ -581,7 +581,7 @@ subroutine polympo_setOwningProcVertex(mpMesh, nVertices, array) &
581581
integer(c_int), value :: nVertices
582582
type(c_ptr), intent(in), value :: array
583583
end subroutine
584-
584+
585585
!---------------------------------------------------------------------------
586586
!> @brief set the owning process array
587587
!> @param mpmesh(in/out) MPMesh object
@@ -603,7 +603,7 @@ subroutine polympo_setVtxGlobal(mpMesh, nVertices, array) &
603603
integer(c_int), value :: nVertices
604604
type(c_ptr), intent(in), value :: array
605605
end subroutine
606-
606+
607607
!---------------------------------------------------------------------------
608608
!> @brief get enum for vertex mesh fields
609609
!---------------------------------------------------------------------------
@@ -661,7 +661,7 @@ subroutine polympo_setMeshVtxRotLat(mpMesh, nVertices, latitude) &
661661
integer(c_int), value :: nVertices
662662
type(c_ptr), intent(in), value :: latitude
663663
end subroutine
664-
664+
665665
!---------------------------------------------------------------------------
666666
!> @brief get the polympo mesh vertices latitude and longitude
667667
!> @param mpmesh(in/out) MPMesh object
@@ -735,7 +735,7 @@ subroutine polympo_getMeshVtxMass(mpMesh, nVertices, vtxMass) &
735735
integer(c_int), value :: nVertices
736736
type(c_ptr), value :: vtxMass
737737
end subroutine
738-
738+
739739
!---------------------------------------------------------------------------
740740
!> @brief set the mesh elements mass from a host array
741741
!> @param mpmesh(in/out) MPMesh object
@@ -932,7 +932,7 @@ subroutine polympo_push_swap(mpMesh) &
932932
use :: iso_c_binding
933933
type(c_ptr), value :: mpMesh
934934
end subroutine
935-
935+
936936
subroutine polympo_push_swap_pos(mpMesh) &
937937
bind(C, NAME='polympo_push_swap_pos_f')
938938
use :: iso_c_binding
@@ -1000,19 +1000,19 @@ subroutine polympo_reconstruct_coeff_with_MPI(mpMesh) &
10001000
use :: iso_c_binding
10011001
type(c_ptr), value :: mpMesh
10021002
end subroutine
1003-
1003+
10041004
subroutine polympo_reconstruct_iceArea_with_MPI(mpMesh) &
10051005
bind(C, NAME='polympo_reconstruct_iceArea_with_MPI_f')
10061006
use :: iso_c_binding
10071007
type(c_ptr), value :: mpMesh
10081008
end subroutine
1009-
1009+
10101010
subroutine polympo_reconstruct_velocity_with_MPI(mpMesh) &
10111011
bind(C, NAME='polympo_reconstruct_velocity_with_MPI_f')
10121012
use :: iso_c_binding
10131013
type(c_ptr), value :: mpMesh
10141014
end subroutine
1015-
1015+
10161016
!---------------------------------------------------------------------------
10171017
!> @brief directly call the reconstruct of the MP fields to mesh fields
10181018
!> @param mpmesh(in/out) MPMesh object

0 commit comments

Comments
 (0)