File Spherical.cu
FileList > src > Spherical.cu
Go to the source code of this file
#include "Spherical.h"
Public Functions
| Type | Name |
|---|---|
| __host__ __device__ T | calcCM (T Radius, T delta, T yo, int iy) Calculate the scale factor for the y face length in a spherical model. This function computes the scale factor based on the sphere's radius, grid spacing, origin offset, and index in the y direction. Scale factor for y face length (x face lengh scale is always 1 in spherical model assuming that lat long are entered) |
| template __host__ __device__ double | calcCM (double Radius, double delta, double yo, int iy) |
| template __host__ __device__ float | calcCM (float Radius, float delta, float yo, int iy) |
| __host__ __device__ T | calcFM (T Radius, T delta, T yo, T iy) Calculate the scale factor for the y face length in a spherical model. This function computes the scale factor based on the sphere's radius, grid spacing, origin offset and index in the y direction. Scale factor for y face length (x face lengh scale is always 1 in spherical model assuming that lat long are entered) |
| template __host__ __device__ double | calcFM (double Radius, double delta, double yo, double iy) |
| template __host__ __device__ float | calcFM (float Radius, float delta, float yo, float iy) |
| __host__ __device__ T | haversin (T Radius, T lon1, T lat1, T lon2, T lat2) Classic Haversine formula to calculate great-circle distance between two points on a sphere. The function is too slow to use directly in BG_flood engine but is more usable (i.e. naive) for model setup. |
| __host__ __device__ T | spharea (T Radius, T lon, T lat, T dx) Calculate the surface area of a spherical cap. |
| template __host__ __device__ double | spharea (double Radius, double lon, double lat, double dx) |
| template __host__ __device__ float | spharea (float Radius, float lon, float lat, float dx) |
Public Functions Documentation
function calcCM
Calculate the scale factor for the y face length in a spherical model. This function computes the scale factor based on the sphere's radius, grid spacing, origin offset, and index in the y direction. Scale factor for y face length (x face lengh scale is always 1 in spherical model assuming that lat long are entered)
Parameters:
RadiusRadius of the spheredeltaGrid spacingyoOrigin offset in the y directioniyIndex in the y direction
function calcCM
function calcCM
function calcFM
Calculate the scale factor for the y face length in a spherical model. This function computes the scale factor based on the sphere's radius, grid spacing, origin offset and index in the y direction. Scale factor for y face length (x face lengh scale is always 1 in spherical model assuming that lat long are entered)
Parameters:
RadiusRadius of the spheredeltaGrid spacingyoOrigin offset in the y directioniyIndex in the y direction
function calcFM
function calcFM
function haversin
Classic Haversine formula to calculate great-circle distance between two points on a sphere. The function is too slow to use directly in BG_flood engine but is more usable (i.e. naive) for model setup.
Parameters:
RadiusRadius of the spherelon1Longitude of the first point (in degrees)lat1Latitude of the first point (in degrees)lon2Longitude of the second point (in degrees)lat2Latitude of the second point (in degrees)
Returns:
Great-circle distance between the two points
function spharea
Calculate the surface area of a spherical cap.
Template parameters:
TData type (float or double)
Parameters:
RadiusRadius of the spherelonLongitude of the center of the cap (in degrees)latLatitude of the center of the cap (in degrees)dxGrid spacing (in degrees)
Returns:
Surface area of the spherical cap
function spharea
function spharea
The documentation for this class was generated from the following file src/Spherical.cu