Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Functions | Variables
numbers Namespace Reference

Classes

struct  NumberTraits
 
struct  NumberTraits< std::complex< number > >
 

Functions

bool is_finite (const double x)
 
bool is_finite (const std::complex< double > &x)
 
bool is_finite (const std::complex< float > &x)
 
bool is_finite (const std::complex< long double > &x)
 

Variables

static const unsigned int invalid_unsigned_int = static_cast<unsigned int> (-1)
 
const types::global_dof_index invalid_size_type = static_cast<types::global_dof_index> (-1)
 
const types::global_dof_index invalid_dof_index = static_cast<types::global_dof_index>(-1)
 
const types::material_id invalid_material_id = static_cast<types::material_id>(-1)
 
const types::boundary_id invalid_boundary_id = static_cast<types::boundary_id>(-1)
 
const types::boundary_id internal_face_boundary_id = static_cast<types::boundary_id>(-1)
 
const types::subdomain_id invalid_subdomain_id = static_cast<types::subdomain_id>(-1)
 
const types::subdomain_id artificial_subdomain_id = static_cast<types::subdomain_id>(-2)
 
static const double E = 2.7182818284590452354
 
static const double LOG2E = 1.4426950408889634074
 
static const double LOG10E = 0.43429448190325182765
 
static const double LN2 = 0.69314718055994530942
 
static const double LN10 = 2.30258509299404568402
 
static const double PI = 3.14159265358979323846
 
static const double PI_2 = 1.57079632679489661923
 
static const double PI_4 = 0.78539816339744830962
 
static const double SQRT2 = 1.41421356237309504880
 
static const double SQRT1_2 = 0.70710678118654752440
 

Detailed Description

Namespace for the declaration of universal constants. Since the availability in math.h is not always guaranteed, we put them here. Since this file is included by base/config.h, they are available to the whole library.

The constants defined here are a subset of the M_XXX constants sometimes declared in the system include file math.h, but without the prefix M_.

In addition to that, we declare invalid_unsigned_int to be the largest unsigned integer representable; this value is widely used in the library as a marker for an invalid index, an invalid size of an array, and similar purposes.

Function Documentation

bool numbers::is_finite ( const double  x)

Return true if the given value is a finite floating point number, i.e. is neither plus or minus infinity nor NaN (not a number).

Note that the argument type of this function is double. In other words, if you give a very large number of type long double, this function may return false even if the number is finite with respect to type long double.

bool numbers::is_finite ( const std::complex< double > &  x)

Return true if real and imaginary parts of the given complex number are finite.

bool numbers::is_finite ( const std::complex< float > &  x)

Return true if real and imaginary parts of the given complex number are finite.

bool numbers::is_finite ( const std::complex< long double > &  x)

Return true if real and imaginary parts of the given complex number are finite.

Again may not work correctly if real or imaginary parts are very large numbers that are infinite in terms of double, but finite with respect to long double.

Variable Documentation

const unsigned int numbers::invalid_unsigned_int = static_cast<unsigned int> (-1)
static

Representation of the largest number that can be put into an unsigned integer. This value is widely used throughout the library as a marker for an invalid unsigned integer value, such as an invalid array index, an invalid array size, and the like.

Definition at line 191 of file types.h.

const types::global_dof_index numbers::invalid_size_type = static_cast<types::global_dof_index> (-1)

Representation of the largest number that can be put into a size_type. This value is used throughout the library as a marker for an invalid size_type value, such as an invalid array index, an invalid array size, and the like. Invalid_size_type is equivalent to invalid_dof_index.

Definition at line 211 of file types.h.

const types::global_dof_index numbers::invalid_dof_index = static_cast<types::global_dof_index>(-1)

An invalid value for indices of degrees of freedom.

Definition at line 217 of file types.h.

const types::material_id numbers::invalid_material_id = static_cast<types::material_id>(-1)

Invalid material_id which we need in several places as a default value. We assume that all material_ids lie in the range [0, invalid_material_id).

Definition at line 226 of file types.h.

const types::boundary_id numbers::invalid_boundary_id = static_cast<types::boundary_id>(-1)

Invalid boundary_id which we need in several places as a default value. We assume that all valid boundary_ids lie in the range [0, invalid_boundary_id).

See Also
Glossary entry on boundary indicators

Definition at line 237 of file types.h.

const types::boundary_id numbers::internal_face_boundary_id = static_cast<types::boundary_id>(-1)

A boundary indicator number that we reserve for internal faces. We assume that all valid boundary_ids lie in the range [0, internal_face_boundary_id).

This is an indicator that is used internally (by the library) to differentiate between faces that lie at the boundary of the domain and faces that lie in the interior of the domain. You should never try to assign this boundary indicator to anything in user code.

See Also
Glossary entry on boundary indicators

Definition at line 253 of file types.h.

const types::subdomain_id numbers::invalid_subdomain_id = static_cast<types::subdomain_id>(-1)

A special id for an invalid subdomain id. This value may not be used as a valid id but is used, for example, for default arguments to indicate a subdomain id that is not to be used.

See the glossary for more information.

Definition at line 267 of file types.h.

const types::subdomain_id numbers::artificial_subdomain_id = static_cast<types::subdomain_id>(-2)

The subdomain id assigned to a cell whose true subdomain id we don't know, for example because it resides on a different processor on a mesh that is kept distributed on many processors. Such cells are called "artificial".

See the glossary entries on subdomain ids and artificial cells as well as the Parallel computing with multiple processors using distributed memory module for more information.

Definition at line 286 of file types.h.

const double numbers::E = 2.7182818284590452354
static

e

Definition at line 47 of file numbers.h.

const double numbers::LOG2E = 1.4426950408889634074
static

log_2 e

Definition at line 52 of file numbers.h.

const double numbers::LOG10E = 0.43429448190325182765
static

log_10 e

Definition at line 57 of file numbers.h.

const double numbers::LN2 = 0.69314718055994530942
static

log_e 2

Definition at line 62 of file numbers.h.

const double numbers::LN10 = 2.30258509299404568402
static

log_e 10

Definition at line 67 of file numbers.h.

const double numbers::PI = 3.14159265358979323846
static

pi

Definition at line 72 of file numbers.h.

const double numbers::PI_2 = 1.57079632679489661923
static

pi/2

Definition at line 77 of file numbers.h.

const double numbers::PI_4 = 0.78539816339744830962
static

pi/4

Definition at line 82 of file numbers.h.

const double numbers::SQRT2 = 1.41421356237309504880
static

sqrt(2)

Definition at line 87 of file numbers.h.

const double numbers::SQRT1_2 = 0.70710678118654752440
static

1/sqrt(2)

Definition at line 92 of file numbers.h.