@@ -26,7 +26,9 @@ enum MeshFieldIndex{
2626 MeshF_ElmMass,
2727 MeshF_OnSurfVeloIncr,
2828 MeshF_OnSurfDispIncr,
29- MeshF_RotLatLonIncr
29+ MeshF_RotLatLonIncr,
30+ MeshF_VtxGnomProj,
31+ MeshF_ElmCenterGnomProj
3032};
3133enum MeshFieldType{
3234 MeshFType_Invalid = -2 ,
@@ -46,24 +48,28 @@ template <> struct meshFieldToType < MeshF_ElmMass > { using type = Ko
4648template <> struct meshFieldToType < MeshF_OnSurfVeloIncr > { using type = Kokkos::View<vec2d_t *>; };
4749template <> struct meshFieldToType < MeshF_OnSurfDispIncr > { using type = Kokkos::View<vec2d_t *>; };
4850template <> struct meshFieldToType < MeshF_RotLatLonIncr > { using type = Kokkos::View<vec2d_t *>; };
51+ template <> struct meshFieldToType < MeshF_VtxGnomProj > { using type = Kokkos::View<double *[maxVtxsPerElm][2 ]>; };
52+ template <> struct meshFieldToType < MeshF_ElmCenterGnomProj > { using type = Kokkos::View<double *[4 ]>; };
4953
5054template <MeshFieldIndex index>
5155using MeshFView = typename meshFieldToType<index>::type;
5256
53- const std::map<MeshFieldIndex, std::pair<MeshFieldType,
54- std::string>> meshFields2TypeAndString =
55- {{MeshF_Invalid, {MeshFType_Invalid," MeshField_InValid!" }},
56- {MeshF_Unsupported, {MeshFType_Unsupported," MeshField_Unsupported" }},
57- {MeshF_VtxCoords, {MeshFType_VtxBased," MeshField_VerticesCoords" }},
58- {MeshF_VtxRotLat, {MeshFType_VtxBased," MeshField_VerticesLatitude" }},
59- {MeshF_ElmCenterXYZ, {MeshFType_ElmBased," MeshField_ElementCenterXYZ" }},
60- {MeshF_DualTriangleArea, {MeshFType_VtxBased," MeshField_DualTriangleArea" }},
61- {MeshF_Vel, {MeshFType_VtxBased," MeshField_Velocity" }},
62- {MeshF_VtxMass, {MeshFType_VtxBased," MeshField_VerticesMass" }},
63- {MeshF_ElmMass, {MeshFType_ElmBased," MeshField_ElementsMass" }},
64- {MeshF_OnSurfVeloIncr, {MeshFType_VtxBased," MeshField_OnSurfaceVelocityIncrement" }},
65- {MeshF_OnSurfDispIncr, {MeshFType_VtxBased," MeshField_OnSurfaceDisplacementIncrement" }},
66- {MeshF_RotLatLonIncr, {MeshFType_VtxBased," MeshField_RotationalLatitudeLongitudeIncreasement" }}};
57+ const std::map<MeshFieldIndex, std::pair<MeshFieldType, std::string>> meshFields2TypeAndString = {
58+ {MeshF_Invalid, {MeshFType_Invalid," MeshField_InValid!" }},
59+ {MeshF_Unsupported, {MeshFType_Unsupported," MeshField_Unsupported" }},
60+ {MeshF_VtxCoords, {MeshFType_VtxBased," MeshField_VerticesCoords" }},
61+ {MeshF_VtxRotLat, {MeshFType_VtxBased," MeshField_VerticesLatitude" }},
62+ {MeshF_ElmCenterXYZ, {MeshFType_ElmBased," MeshField_ElementCenterXYZ" }},
63+ {MeshF_DualTriangleArea, {MeshFType_VtxBased," MeshField_DualTriangleArea" }},
64+ {MeshF_Vel, {MeshFType_VtxBased," MeshField_Velocity" }},
65+ {MeshF_VtxMass, {MeshFType_VtxBased," MeshField_VerticesMass" }},
66+ {MeshF_ElmMass, {MeshFType_ElmBased," MeshField_ElementsMass" }},
67+ {MeshF_OnSurfVeloIncr, {MeshFType_VtxBased," MeshField_OnSurfaceVelocityIncrement" }},
68+ {MeshF_OnSurfDispIncr, {MeshFType_VtxBased," MeshField_OnSurfaceDisplacementIncrement" }},
69+ {MeshF_RotLatLonIncr, {MeshFType_VtxBased," MeshField_RotationalLatitudeLongitudeIncreasement" }},
70+ {MeshF_VtxGnomProj, {MeshFType_ElmBased," MeshField_VertexGnomonicProjection" }},
71+ {MeshF_ElmCenterGnomProj,{MeshFType_ElmBased," MeshField_ElementCenterGnomonicprojection" }}
72+ };
6773
6874enum mesh_type {mesh_unrecognized_lower = -1 ,
6975 mesh_general_polygonal, // other meshes
@@ -102,6 +108,9 @@ class Mesh {
102108 MeshFView<MeshF_OnSurfVeloIncr> vtxOnSurfVeloIncr_;
103109 MeshFView<MeshF_OnSurfDispIncr> vtxOnSurfDispIncr_;
104110 MeshFView<MeshF_RotLatLonIncr> vtxRotLatLonIncr_;
111+ // GnomonicProjection
112+ MeshFView<MeshF_VtxGnomProj> vtxGnomProj_;
113+ MeshFView<MeshF_ElmCenterGnomProj> elmCenterGnomProj_;
105114 // DoubleMat2DView vtxStress_;
106115
107116 public:
@@ -126,7 +135,7 @@ class Mesh {
126135 setMeshElmBasedFieldSize ();
127136 meshEdit_ = false ;
128137 vtxCoords_ = vtxCoords;
129- }
138+ }
130139
131140 bool meshEditable (){ return meshEdit_; }
132141 bool checkMeshType (int meshType);
@@ -177,6 +186,8 @@ class Mesh {
177186 IntView getElmGlobal () {return globalElm_;}
178187 IntView getVtxGlobal () {return globalVtx_;}
179188
189+ void setGnomonicProjection (bool isRotated, double radius);
190+
180191 void computeRotLatLonIncr ();
181192};
182193
@@ -220,6 +231,12 @@ auto Mesh::getMeshField(){
220231 else if constexpr (index==MeshF_RotLatLonIncr){
221232 return vtxRotLatLonIncr_;
222233 }
234+ else if constexpr (index==MeshF_VtxGnomProj){
235+ return vtxGnomProj_;
236+ }
237+ else if constexpr (index==MeshF_ElmCenterGnomProj){
238+ return elmCenterGnomProj_;
239+ }
223240 fprintf (stderr," Mesh Field Index error!\n " );
224241 exit (1 );
225242}
0 commit comments