ASPECT
Enumerations | Functions
aspect::Utilities::Coordinates Namespace Reference

Enumerations

enum  CoordinateSystem {
  depth, cartesian, spherical, ellipsoidal,
  invalid
}
 

Functions

template<int dim>
std::array< double, dim > WGS84_coordinates (const ::Point< dim > &position)
 
template<int dim>
std::array< double, dim > cartesian_to_spherical_coordinates (const ::Point< dim > &position)
 
template<int dim>
::Point< dim > spherical_to_cartesian_coordinates (const std::array< double, dim > &scoord)
 
template<int dim>
Tensor< 1, dim > spherical_to_cartesian_vector (const Tensor< 1, dim > &spherical_vector, const ::Point< dim > &position)
 
template<int dim>
std::array< double, 3 > cartesian_to_ellipsoidal_coordinates (const ::Point< 3 > &position, const double semi_major_axis_a, const double eccentricity)
 
template<int dim>
::Point< 3 > ellipsoidal_to_cartesian_coordinates (const std::array< double, 3 > &phi_theta_d, const double semi_major_axis_a, const double eccentricity)
 
CoordinateSystem string_to_coordinate_system (const std::string &)
 

Enumeration Type Documentation

§ CoordinateSystem

This enum lists available coordinate systems that can be used for the function variables. Allowed values are 'cartesian', 'spherical', and 'depth'. 'spherical' coordinates follow: r, phi (2D) or r, phi, theta (3D); where r is radius, phi is longitude, and theta is the polar angle (colatitude). The 'depth' is a one-dimensional coordinate system in which only the distance below the 'top' surface (depth) as defined by each geometry model, is used.

Enumerator
depth 
cartesian 
spherical 
ellipsoidal 
invalid 

Definition at line 40 of file coordinate_systems.h.

Function Documentation

§ WGS84_coordinates()

template<int dim>
std::array<double,dim> aspect::Utilities::Coordinates::WGS84_coordinates ( const ::Point< dim > &  position)

Returns distance from the Earth's center, latitude and longitude from a given ECEF Cartesian coordinates that account for ellipsoidal shape of the Earth with WGS84 parameters.

Referenced by aspect::Utilities::MapParsing::Options::Options().

§ cartesian_to_spherical_coordinates()

template<int dim>
std::array<double,dim> aspect::Utilities::Coordinates::cartesian_to_spherical_coordinates ( const ::Point< dim > &  position)

Returns spherical coordinates of a Cartesian point. If dim==3, then the returned array contains the three values radius, phi, and theta (polar angle). In other words, the two angles correspond to longitude and colatitude (instead of latitude). If dim==2, then theta is omitted. The longitude Phi is always considered in the interval \([0,2\pi]\). Note that that implies that input files that use spherical coordinates also have to provide data using this convention, rather than providing their data from \(-\pi\) (=180 degrees west) to \(+\pi\) (=180 degrees east).

Referenced by aspect::Utilities::MapParsing::Options::Options().

§ spherical_to_cartesian_coordinates()

template<int dim>
::Point<dim> aspect::Utilities::Coordinates::spherical_to_cartesian_coordinates ( const std::array< double, dim > &  scoord)

Return the Cartesian point of a spherical position defined by radius, phi and theta (polar angle). If the dimension is set to 2 theta is omitted.

Referenced by aspect::Utilities::MapParsing::Options::Options().

§ spherical_to_cartesian_vector()

template<int dim>
Tensor<1,dim> aspect::Utilities::Coordinates::spherical_to_cartesian_vector ( const Tensor< 1, dim > &  spherical_vector,
const ::Point< dim > &  position 
)

Given a vector defined in the radius, phi and theta directions, return a vector defined in Cartesian coordinates. If the dimension is set to 2 theta is omitted. Position is given as a Point in Cartesian coordinates.

Referenced by aspect::Utilities::MapParsing::Options::Options().

§ cartesian_to_ellipsoidal_coordinates()

template<int dim>
std::array<double,3> aspect::Utilities::Coordinates::cartesian_to_ellipsoidal_coordinates ( const ::Point< 3 > &  position,
const double  semi_major_axis_a,
const double  eccentricity 
)

Returns ellipsoidal coordinates of a Cartesian point. The returned array is filled with phi, theta and radius.

Referenced by aspect::Utilities::MapParsing::Options::Options().

§ ellipsoidal_to_cartesian_coordinates()

template<int dim>
::Point<3> aspect::Utilities::Coordinates::ellipsoidal_to_cartesian_coordinates ( const std::array< double, 3 > &  phi_theta_d,
const double  semi_major_axis_a,
const double  eccentricity 
)

Return the Cartesian point of a ellipsoidal position defined by phi, theta and radius.

Referenced by aspect::Utilities::MapParsing::Options::Options().

§ string_to_coordinate_system()

CoordinateSystem aspect::Utilities::Coordinates::string_to_coordinate_system ( const std::string &  )

A function that takes a string representation of the name of a coordinate system (as represented by the CoordinateSystem enum) and returns the corresponding value.

Referenced by aspect::Utilities::MapParsing::Options::Options().