ViennaGrid for Python
 All Classes Files Functions Variables
Public Member Functions | List of all members
PointCylindrical3D Class Reference

Cylindrical point. More...

#include <cylindrical.hpp>

Public Member Functions

 PointCylindrical3D ()
 Initialize point in the 3D cartesian space with coordinates (0, 0, 0).
 PointCylindrical3D (double x, double y, double z)
 Initialize point in the 3D cartesian space with coordinates (x, y, z) as specified by the parameters.
 PointCylindrical3D (PointCylindrical_t *initial_point, unsigned int initial_id=0)
 Initialize point in the cylindrical space from a ViennaGrid point.
 PointCylindrical3D (PointCylindrical_t &initial_point, unsigned int initial_id=-1)
 Initialize point in the cylindrical space from a ViennaGrid point by copying it.
size_t get_dimension ()
 Get the dimension of the point.
const char * get_coord_system ()
 Get the name of the coordinate system.
double get_coord (unsigned int index)
 Get the coordinate at given index (0 for x, 1 for y, 2 for z).
void set_coord (unsigned int index, double new_value)
 Set the coordinate at given index (0 for x, 1 for y, 2 for z).
list get_coord_list ()
 Get coordinates as a Python list.
PointCylindrical3Doperator= (const PointCylindrical3D &other)
 Assignment operator that copies the coordinates of the right operand to the left operand.
PointCylindrical3D operator+ (const PointCylindrical3D &other)
 Addition operator which adds two points coordinate by coordinate.
PointCylindrical3D operator- (const PointCylindrical3D &other)
 Subtraction operator which subtracts two points coordinate by coordinate.
PointCylindrical3D operator* (const double factor)
 Multiplication operator which multiplies a point and a scalar (real) number, coordinate by coordinate.
PointCylindrical3D operator/ (const double factor)
 Division operator which divides a point and a scalar (real) number, coordinate by coordinate.
PointCylindrical3D operator- ()
 Unary operator which inverts the coordinates of a point.
PointCylindrical_t & get_point ()
 Get ViennaGrid point.
unsigned int get_id ()
 Get ID of the point within the domain it is assigned to (if applicable).
void set_id (unsigned int new_id)
 Set ID of the point within the domain it is assigned to.
PointCartesian3D to_cartesian ()
 Convert to cartesian 3D point.
PointSpherical3D to_spherical ()
 Convert to spherical point.
double norm_1 ()
 Calculate the 1-norm of the point.
double norm_2 ()
 Calculate the 2-norm of the point.
double norm_inf ()
 Calculate the ∞-norm of the point.

Detailed Description

Cylindrical point.

Since
0.1.0

Constructor & Destructor Documentation

PointCylindrical3D::PointCylindrical3D ( )

Initialize point in the 3D cartesian space with coordinates (0, 0, 0).

This constructor is meant to be used when the programmer creates an instance of the high-level Python point, and allocates memory in the heap for storing the point. As one would normally think, this should be paired with a destructor that frees the allocated memory. However, when we free the memory in the destructor, the program aborts and states that the program tried to perform a double-free.

Since
0.1.0
PointCylindrical3D::PointCylindrical3D ( double  x,
double  y,
double  z 
)

Initialize point in the 3D cartesian space with coordinates (x, y, z) as specified by the parameters.

This constructor is meant to be used when the programmer creates an instance of the high-level Python point, and allocates memory in the heap for storing the point. As one would normally think, this should be paired with a destructor that frees the allocated memory. However, when we free the memory in the destructor, the program aborts and states that the program tried to perform a double-free.

Since
0.1.0
PointCylindrical3D::PointCylindrical3D ( PointCylindrical_t *  initial_point,
unsigned int  initial_id = 0 
)

Initialize point in the cylindrical space from a ViennaGrid point.

What this makes is to set the pointer to point to the ViennaGrid point and thus solves the issue caused by the fact that the ViennaGrid point was being copied, thus not being able to get references to the points stored in the domain and thus not being able to modify them.

This constructor is meant to be used by the wrapper code when the programmer tries to get a reference to a point stored in a domain (not when they want to define a point on their own!), and does not allocate memory in the heap, thus elliminating the need for the constructor to free that memory when this constructor has been used. At first, one would think that it should be distinguished in some way when the object has been instantiated using this constructor or any other constructor in order for the destructor to only free when another constructor has been called, not this one. However, we have shown that no freeing action is need at all.

Since
0.1.0
PointCylindrical3D::PointCylindrical3D ( PointCylindrical_t &  initial_point,
unsigned int  initial_id = -1 
)

Initialize point in the cylindrical space from a ViennaGrid point by copying it.

This constructor is meant to be used by the wrapper code when the programmer runs an algorithm on points. Hence, it needs to allocate memory in the heap for the new ViennaGrid point.

As one would normally think, this should be paired with a destructor that frees the allocated memory. However, when we free the memory in the destructor, the program aborts and states that the program tried to perform a double-free.

Since
0.1.0

Member Function Documentation

double PointCylindrical3D::get_coord ( unsigned int  index)

Get the coordinate at given index (0 for x, 1 for y, 2 for z).

Since
0.1.0
list PointCylindrical3D::get_coord_list ( )

Get coordinates as a Python list.

Since
0.1.0
const char * PointCylindrical3D::get_coord_system ( )

Get the name of the coordinate system.

For cartesian points, this always returns 'cartesian'.

Since
0.1.0
size_t PointCylindrical3D::get_dimension ( )

Get the dimension of the point.

For 3D points, this always returns 3.

Since
0.1.0
unsigned int PointCylindrical3D::get_id ( )

Get ID of the point within the domain it is assigned to (if applicable).

Since
0.1.0
PointCylindrical_t & PointCylindrical3D::get_point ( )

Get ViennaGrid point.

Since
0.1.0
double PointCylindrical3D::norm_1 ( )

Calculate the 1-norm of the point.

Since
0.1.0
double PointCylindrical3D::norm_2 ( )

Calculate the 2-norm of the point.

Since
0.1.0
double PointCylindrical3D::norm_inf ( )

Calculate the ∞-norm of the point.

Since
0.1.0
PointCylindrical3D PointCylindrical3D::operator* ( const double  factor)

Multiplication operator which multiplies a point and a scalar (real) number, coordinate by coordinate.

Since
0.1.0
PointCylindrical3D PointCylindrical3D::operator+ ( const PointCylindrical3D other)

Addition operator which adds two points coordinate by coordinate.

Since
0.1.0
PointCylindrical3D PointCylindrical3D::operator- ( const PointCylindrical3D other)

Subtraction operator which subtracts two points coordinate by coordinate.

Since
0.1.0
PointCylindrical3D PointCylindrical3D::operator- ( )

Unary operator which inverts the coordinates of a point.

Since
0.1.0
PointCylindrical3D PointCylindrical3D::operator/ ( const double  factor)

Division operator which divides a point and a scalar (real) number, coordinate by coordinate.

Since
0.1.0
PointCylindrical3D & PointCylindrical3D::operator= ( const PointCylindrical3D other)

Assignment operator that copies the coordinates of the right operand to the left operand.

This operator cannot be wrapped to Python explicitly.

Since
0.1.0
void PointCylindrical3D::set_coord ( unsigned int  index,
double  new_value 
)

Set the coordinate at given index (0 for x, 1 for y, 2 for z).

Since
0.1.0
void PointCylindrical3D::set_id ( unsigned int  new_id)

Set ID of the point within the domain it is assigned to.

Since
0.1.0
PointCartesian3D PointCylindrical3D::to_cartesian ( )

Convert to cartesian 3D point.

Since
0.1.0
PointSpherical3D PointCylindrical3D::to_spherical ( )

Convert to spherical point.

Since
0.1.0

The documentation for this class was generated from the following files: