@@ -44,6 +44,7 @@ namespace polyMPO{
4444
4545 auto dualTriangleAreaEntry = meshFields2TypeAndString.at (MeshF_DualTriangleArea);
4646 PMT_ALWAYS_ASSERT (dualTriangleAreaEntry.first == MeshFType_VtxBased);
47+ dualTriangleArea_ = MeshFView<MeshF_DualTriangleArea>(dualTriangleAreaEntry.second ,numVtxs_);
4748 }
4849
4950 void Mesh::setMeshElmBasedFieldSize (){
@@ -78,17 +79,6 @@ namespace polyMPO{
7879 pumipic::RecordTime (" PolyMPO_computeRotLatLonIncr" , timer.seconds ());
7980 }
8081
81- KOKKOS_INLINE_FUNCTION
82- void computeGnomonicProjectionAtPoint ( const Vec3d& vtxCoord, const double gnomProjElmCenter[4 ], double & outX, double & outY) {
83- const double iDen = 1.0 / ( gnomProjElmCenter[1 ] * gnomProjElmCenter[3 ] * vtxCoord[0 ] +
84- gnomProjElmCenter[0 ] * gnomProjElmCenter[3 ] * vtxCoord[1 ] +
85- gnomProjElmCenter[2 ] * vtxCoord[2 ]);
86- outX = iDen * (vtxCoord[1 ] * gnomProjElmCenter[1 ] -
87- vtxCoord[1 ] * gnomProjElmCenter[0 ]);
88- outY = iDen * (vtxCoord[2 ] * gnomProjElmCenter[3 ] - vtxCoord[1 ] * gnomProjElmCenter[2 ] * gnomProjElmCenter[0 ] -
89- vtxCoord[0 ] * gnomProjElmCenter[1 ] * gnomProjElmCenter[2 ]);
90- }
91-
9282 void Mesh::setGnomonicProjection (bool isRotated, double radius){
9383 std::cout<<__FUNCTION__<<std::endl;
9484 auto gnomProjVtx = getMeshField<MeshF_VtxGnomProj>();
@@ -114,6 +104,10 @@ namespace polyMPO{
114104 gnomProjElmCenter (iElm, 2 ) = invR*elmCenter[2 ];
115105 gnomProjElmCenter (iElm, 3 ) = invR*cosLatR;
116106
107+ if (iElm < 10 )
108+ printf (" Elm %d, Centres %.15e %.15e %.15e %.15e \n " , iElm, gnomProjElmCenter (iElm, 0 ), gnomProjElmCenter (iElm, 1 ),
109+ gnomProjElmCenter (iElm, 2 ), gnomProjElmCenter (iElm, 3 ) );
110+
117111 int nVtxE = elm2VtxConn (iElm,0 );
118112 for (int i=0 ; i<nVtxE; i++){
119113 int vID = elm2VtxConn (iElm, i+1 ) - 1 ;
@@ -123,10 +117,14 @@ namespace polyMPO{
123117 }
124118
125119 double outX, outY;
126- computeGnomonicProjectionAtPoint (vtxCord, &gnomProjElmCenter (iElm, 0 ), outX, outY);
120+ auto gnomProjElmCenter_sub = Kokkos::subview (gnomProjElmCenter, iElm, Kokkos::ALL);
121+ computeGnomonicProjectionAtPoint (vtxCord, gnomProjElmCenter_sub, outX, outY);
127122
128123 gnomProjVtx (iElm, i, 0 ) = outX;
129124 gnomProjVtx (iElm, i, 1 ) = outY;
125+
126+ if (iElm < 10 )
127+ printf (" Elm %d, Vtx %d -> outX: %.15e, outY: %.15e \n " , iElm, i, outX, outY);
130128 }
131129 });
132130 }
0 commit comments