Canoe
Comprehensive Atmosphere N' Ocean Engine
cubed_sphere.hpp
Go to the documentation of this file.
1 #ifndef CUBED_SPHERE_HPP
2 #define CUBED_SPHERE_HPP
3 #include "athena.hpp"
4 #include "coordinates/coordinates.hpp"
5 
6 int FindBlockID(LogicalLocation const &loc);
7 
8 void TransformOxForCubedSphere(int *ox2, int *ox3, int *tox2, int *tox3,
9  LogicalLocation const &loc);
10 
11 void PackDataCubedSphere(const AthenaArray<Real> &src, Real *buf, int sn,
12  int en, int si, int ei, int sj, int ej, int sk, int ek,
13  int &offset, int ox1, int ox2, int ox3,
14  LogicalLocation const &loc);
15 
17  AthenaArray<Real> &tgt, Real affine_angle,
18  int sn, int en, int si, int ei, int sj, int ej,
19  int sk, int ek, int Dir);
20 
21 void DeProjectLocalCartesianAffine(AthenaArray<Real> &flux, Real affine_angle,
22  int sn, int en, int si, int ei, int sj,
23  int ej, int sk, int ek, int Dir);
24 
25 Real CubedSphereMeshGeneratorX2(Real x, LogicalLocation const &loc);
26 Real CubedSphereMeshGeneratorX3(Real x, LogicalLocation const &loc);
27 
28 // Helper functions
29 void GetLatLon(Real *lat, Real *lon, Coordinates *pcoord, int k, int j, int i);
30 void GetLatLonFace2(Real *lat, Real *lon, Coordinates *pcoord, int k, int j,
31  int i);
32 void GetLatLonFace3(Real *lat, Real *lon, Coordinates *pcoord, int k, int j,
33  int i);
34 
35 void GetUV(Real *U, Real *V, Coordinates *pcoord, Real V2, Real V3, int k,
36  int j, int i);
37 void GetVyVz(Real *V2, Real *V3, Coordinates *pcoord, Real U, Real V, int k,
38  int j, int i);
39 // Helper functions adapted from Paul
40 void VecTransABPFromRLL(Real X, Real Y, int blockID, Real U, Real V, Real *V2,
41  Real *V3);
42 void VecTransRLLFromABP(Real X, Real Y, int blockID, Real V2, Real V3, Real *U,
43  Real *V);
44 void RLLFromXYP(Real dX, Real dY, int nP, Real &lon, Real &lat);
45 void XYPFromRLL(Real lon, Real lat, Real &dX, Real &dY, int &nP);
46 
48  public:
49  void SetMeshBlock(MeshBlock *pmb_in);
50  void InitializeSizes(int nc3, int nc2, int nc1);
52  int direction, int k, int j, int il, int iu);
54  int direction, int k, int j, int il, int iu);
56  void SendNeighborBlocks(LogicalLocation const &loc, int ox2, int ox3,
57  int tg_rank, int tg_gid);
58  void RecvNeighborBlocks(LogicalLocation const &loc, int ox2, int ox3,
59  int tg_rank, int tg_gid);
60 
62  MeshBlock *pmb;
63 };
64 
65 #endif
void SendNeighborBlocks(LogicalLocation const &loc, int ox2, int ox3, int tg_rank, int tg_gid)
void SetMeshBlock(MeshBlock *pmb_in)
AthenaArray< Real > L3DValues
void InitializeSizes(int nc3, int nc2, int nc1)
void LoadLR3DValues(AthenaArray< Real > &L_in, AthenaArray< Real > &R_in, int direction, int k, int j, int il, int iu)
void RecvNeighborBlocks(LogicalLocation const &loc, int ox2, int ox3, int tg_rank, int tg_gid)
void SaveLR3DValues(AthenaArray< Real > &L_in, AthenaArray< Real > &R_in, int direction, int k, int j, int il, int iu)
void SynchronizeFluxes()
MeshBlock * pmb
AthenaArray< Real > R3DValues
int FindBlockID(LogicalLocation const &loc)
void XYPFromRLL(Real lon, Real lat, Real &dX, Real &dY, int &nP)
void VecTransABPFromRLL(Real X, Real Y, int blockID, Real U, Real V, Real *V2, Real *V3)
void GetUV(Real *U, Real *V, Coordinates *pcoord, Real V2, Real V3, int k, int j, int i)
void VecTransRLLFromABP(Real X, Real Y, int blockID, Real V2, Real V3, Real *U, Real *V)
void DeProjectLocalCartesianAffine(AthenaArray< Real > &flux, Real affine_angle, int sn, int en, int si, int ei, int sj, int ej, int sk, int ek, int Dir)
void GetVyVz(Real *V2, Real *V3, Coordinates *pcoord, Real U, Real V, int k, int j, int i)
void GetLatLon(Real *lat, Real *lon, Coordinates *pcoord, int k, int j, int i)
void GetLatLonFace3(Real *lat, Real *lon, Coordinates *pcoord, int k, int j, int i)
Real CubedSphereMeshGeneratorX2(Real x, LogicalLocation const &loc)
Real CubedSphereMeshGeneratorX3(Real x, LogicalLocation const &loc)
void PackDataCubedSphere(const AthenaArray< Real > &src, Real *buf, int sn, int en, int si, int ei, int sj, int ej, int sk, int ek, int &offset, int ox1, int ox2, int ox3, LogicalLocation const &loc)
void RLLFromXYP(Real dX, Real dY, int nP, Real &lon, Real &lat)
void TransformOxForCubedSphere(int *ox2, int *ox3, int *tox2, int *tox3, LogicalLocation const &loc)
void ProjectLocalCartesianAffine(const AthenaArray< Real > &src, AthenaArray< Real > &tgt, Real affine_angle, int sn, int en, int si, int ei, int sj, int ej, int sk, int ek, int Dir)
void GetLatLonFace2(Real *lat, Real *lon, Coordinates *pcoord, int k, int j, int i)