Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c1d22b0
New Regualization method with dual cell triangle involved
dhyan1272 Jan 9, 2025
eb482e8
Scaling and regularization
dhyan1272 Feb 10, 2025
bc6d278
Tests read the areaTriangle field, so tests should be successful with…
dhyan1272 Feb 10, 2025
f8d54fc
Dellaocation, removed log file and created paper folder
dhyan1272 Feb 14, 2025
5da1001
Order 1 reconstruction, coefficients calculated once
dhyan1272 Feb 14, 2025
a591f11
Multi process debugging
dhyan1272 Mar 25, 2025
7be04f9
More debugging
dhyan1272 Mar 27, 2025
fefd5e5
Added global ids to polyMPO from MPAS
dhyan1272 Mar 31, 2025
8bc0780
Running on multiple processors
dhyan1272 Apr 1, 2025
e004bc5
Vtp files issue for multi-process
dhyan1272 Apr 7, 2025
4274cd6
Towards multi Process
dhyan1272 Apr 10, 2025
537b355
One more way of trying MPAS AppIDs
dhyan1272 Apr 10, 2025
c52bfa7
MPASAppID now takes cell no as input
dhyan1272 Apr 11, 2025
8e310cf
iParticleNew Issue
dhyan1272 Apr 12, 2025
aeb3e65
New particleID can be found from MPAS in polyMPO
dhyan1272 Apr 16, 2025
a8582e8
Before Phase 1
dhyan1272 Apr 24, 2025
3988a6a
Push operation from MPAS in while loop
dhyan1272 Apr 30, 2025
77cde5b
Woking 2 proc case
dhyan1272 May 6, 2025
a9e74ab
Removed print annd some cleaning
dhyan1272 May 20, 2025
607de99
Some more redudancy removed like trying to get new AppID from MPAS
dhyan1272 May 20, 2025
4b6930f
All tests on remus pass
dhyan1272 May 21, 2025
00643ff
Removed print statement
dhyan1272 May 21, 2025
14b0c74
Parallel-reconstruction using MPAS
dhyan1272 Jun 3, 2025
8ef0501
MaxAppID commentted out for multiple Proc
dhyan1272 Jun 3, 2025
10f27c5
Parallel Reconstruction Templated
dhyan1272 Jun 26, 2025
d4ac97a
Some more clean up
dhyan1272 Jul 1, 2025
b439df6
Velocity Increment Interpolation and updating velocity in advection
dhyan1272 Jul 8, 2025
f89a03f
Standard physics qualitative comparison, Kokkos fence before spherica…
dhyan1272 Jul 11, 2025
d89991e
Timings fixed/added
dhyan1272 Jul 11, 2025
380ac70
Avoid calculating basis twice for 2 fields, this version in USNCCM18 …
dhyan1272 Jul 13, 2025
91d4185
Updated timers get set in reconstruction
dhyan1272 Jul 15, 2025
a786bc1
Couple of more timers
dhyan1272 Jul 16, 2025
01d4525
Some more cleaning
dhyan1272 Aug 11, 2025
9507b84
elm2Process needed for ctest
dhyan1272 Aug 11, 2025
14519cf
RP changes1_v0
dhyan1272 Aug 12, 2025
e5b2a1a
RP changes1_v1
dhyan1272 Aug 12, 2025
7f362c0
RP changes1_v2
dhyan1272 Aug 12, 2025
3545660
RP changes1_v3
dhyan1272 Aug 12, 2025
775ca49
PR changes2_v0
dhyan1272 Aug 13, 2025
4839c60
PR changes2_v1
dhyan1272 Aug 13, 2025
8a92ee9
PR changes2_v2
dhyan1272 Aug 13, 2025
fe85441
PR changes3_v0
dhyan1272 Aug 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 56 additions & 7 deletions src/pmpo_MPMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ void MPMesh::CVTTrackingElmCenterBased(const int printVTPIndex){
auto MPs2Elm = p_MPs->getData<MPF_Tgt_Elm_ID>();
auto MPs2Proc = p_MPs->getData<MPF_Tgt_Proc_ID>();
auto elm2Process = p_mesh->getElm2Process();

auto elm2global = p_mesh->getElmGlobal();

if(printVTPIndex>=0) {
printVTP_mesh(printVTPIndex);
}
Expand Down Expand Up @@ -155,8 +156,8 @@ void MPMesh::CVTTrackingElmCenterBased(const int printVTPIndex){
for(int i=1; i<=numConnElms; i++){
int elmID = elm2ElmConn(iElm,i)-1;

//New delta
Vec3d center(elmCenter(elmID, 0), elmCenter(elmID, 1), elmCenter(elmID, 2));
//New delta
Vec3d center(elmCenter(elmID, 0), elmCenter(elmID, 1), elmCenter(elmID, 2));
delta = MPnew - center;

double neighborDistSq = delta[0]*delta[0] + delta[1]*delta[1] + delta[2]*delta[2];
Expand All @@ -175,7 +176,7 @@ void MPMesh::CVTTrackingElmCenterBased(const int printVTPIndex){
iElm = closestElm;
}
}
if(printVTPIndex>=0){
if(printVTPIndex>=0 && numMPs>0){
double d1 = dx[0];
double d2 = dx[2];
double d3 = dx[3];
Expand Down Expand Up @@ -301,6 +302,7 @@ void MPMesh::reconstructSlices() {
if (reconstructSlice.size() == 0) return;
Kokkos::Timer timer;
calcBasis();
resetPreComputeFlag();
for (auto const& [index, reconstruct] : reconstructSlice) {
if (reconstruct) reconstruct();
}
Expand All @@ -322,22 +324,69 @@ bool getAnyIsMigrating(MaterialPoints* p_MPs, bool isMigrating) {
return anyIsMigrating;
}

void MPMesh::push_ahead(){
Kokkos::Timer timer;
//Latitude Longitude increment at mesh vertices and interpolate to particle position
p_mesh->computeRotLatLonIncr();

//Interpolates latitude longitude increments and mesh velocity increments to
//MP positions
sphericalInterpolationDispVelIncr(*this);

//Push the MPs
p_MPs->updateRotLatLonAndXYZ2Tgt(p_mesh->getSphereRadius());
pumipic::RecordTime("PolyMPO_interpolateAndPush", timer.seconds());
}

bool MPMesh::push1P(){
Kokkos::Timer timer;
//Given target location find the new element or the last element in a partioned mesh
//and the process it belongs to so that migration can be checked
CVTTrackingElmCenterBased();
//From the above two inputs find if any particle needs to be migrated
bool anyIsMigrating = getAnyIsMigrating(p_MPs, p_MPs->check_migrate());
pumipic::RecordTime("PolyMPO_trackAndCheckMigrate", timer.seconds());
return anyIsMigrating;
}

void MPMesh::push_swap(){
//current becomes target, target becomes -1
p_MPs->updateMPElmID();
}

void MPMesh::push_swap_pos(){
//current becomes target, target becomes -1
//Making read for next push_ahead
p_MPs->updateMPSlice<MPF_Cur_Pos_XYZ, MPF_Tgt_Pos_XYZ>();
p_MPs->updateMPSlice<MPF_Cur_Pos_Rot_Lat_Lon, MPF_Tgt_Pos_Rot_Lat_Lon>();
}


void MPMesh::push(){

Kokkos::Timer timer;

p_mesh->computeRotLatLonIncr();

sphericalInterpolation<MeshF_RotLatLonIncr>(*this);

p_MPs->updateRotLatLonAndXYZ2Tgt(p_mesh->getSphereRadius()); // set Tgt_XYZ

auto elm2Process = p_mesh->getElm2Process();

bool anyIsMigrating = false;
do {
CVTTrackingElmCenterBased(); // move to Tgt_XYZ
p_MPs->updateMPSlice<MPF_Cur_Pos_XYZ, MPF_Tgt_Pos_XYZ>(); // Tgt_XYZ becomes Cur_XYZ
p_MPs->updateMPSlice<MPF_Cur_Pos_Rot_Lat_Lon, MPF_Tgt_Pos_Rot_Lat_Lon>(); // Tgt becomes Cur
if (elm2Process.size() > 0)
anyIsMigrating = getAnyIsMigrating(p_MPs, p_MPs->migrate());

bool anyIsMigrating = getAnyIsMigrating(p_MPs, p_MPs->check_migrate());

if(anyIsMigrating)
p_MPs->migrate();
else
p_MPs->rebuild(); //rebuild pumi-pic
p_MPs->rebuild();

p_MPs->updateMPElmID(); //update mpElm IDs slices
reconstructSlices();
}
Expand Down
29 changes: 28 additions & 1 deletion src/pmpo_MPMesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,28 @@

namespace polyMPO{

template <MeshFieldIndex> const MaterialPointSlice meshFieldIndexToMPSlice;
template <MeshFieldIndex>
const MaterialPointSlice meshFieldIndexToMPSlice;
template <> const MaterialPointSlice meshFieldIndexToMPSlice < MeshF_Vel > = MPF_Vel;
template <> const MaterialPointSlice meshFieldIndexToMPSlice < MeshF_VtxMass > = MPF_Mass;
template <> const MaterialPointSlice meshFieldIndexToMPSlice < MeshF_ElmMass > = MPF_Mass;
template <> const MaterialPointSlice meshFieldIndexToMPSlice < MeshF_RotLatLonIncr > = MPF_Rot_Lat_Lon_Incr;
template <> const MaterialPointSlice meshFieldIndexToMPSlice < MeshF_OnSurfVeloIncr > = MPF_Vel_Incr;

#define maxMPsPerElm 8

class MPMesh{
private:

bool isPreComputed;

public:

MPMesh() : isPreComputed(false){};
void computeMatricesAndSolve();
void resetPreComputeFlag();
Kokkos::View<double*[vec4d_nEntries]> precomputedVtxCoeffs;

Mesh* p_mesh;
MaterialPoints* p_MPs;

Expand All @@ -33,6 +45,10 @@ class MPMesh{
void CVTTrackingEdgeCenterBased(Vec2dView dx);
void CVTTrackingElmCenterBased(const int printVTPIndex = -1);
void T2LTracking(Vec2dView dx);
bool push1P();
void push_ahead();
void push_swap();
void push_swap_pos();
void push();
void calcBasis();

Expand All @@ -49,6 +65,17 @@ class MPMesh{
void assemblyElm0();
template <MeshFieldIndex meshFieldIndex>
void assemblyVtx1();
template <MeshFieldIndex meshFieldIndex>
void subAssemblyVtx1(int vtxPerElm, int nCells, int comp, double* array);

void subAssemblyCoeffs(int vtxPerElm, int nCells, double* m11, double* m12, double* m13, double* m14,
double* m22, double* m23, double* m24,
double* m33, double* m34,
double* m44);
void solveMatrixAndRegularize(int nVertices, double* m11, double* m12, double* m13, double* m14,
double* m22, double* m23, double* m24,
double* m33, double* m34,
double* m44);

template<MeshFieldIndex meshFieldIndex>
void setReconstructSlice(int order, MeshFieldType type);
Expand Down
Loading