Utility functions and classes. More...
Files | |
file | OFELI.h |
Header file that includes all kernel classes of the library. | |
file | OFELI_Config.h |
File that contains some macros. | |
file | constants.h |
File that contains some widely used constants. | |
Classes | |
class | Tabulation |
To read and manipulate tabulated functions. More... | |
class | Point< T_ > |
Defines a point with arbitrary type coordinates. More... | |
class | Point2D< T_ > |
Defines a 2-D point with arbitrary type coordinates. More... | |
class | SpaceTime |
Defines a space-time point. More... | |
class | Gauss |
Calculate data for Gauss integration. More... | |
class | Timer |
To handle elapsed time counting. More... | |
Macros | |
#define | OFELI_E 2.71828182845904523536028747135 |
#define | OFELI_PI 3.14159265358979323846264338328 |
#define | OFELI_THIRD 0.33333333333333333333333333333 |
#define | OFELI_SIXTH 0.16666666666666666666666666667 |
#define | OFELI_TWELVETH 0.08333333333333333333333333333 |
#define | OFELI_SQRT2 1.41421356237309504880168872421 |
#define | OFELI_SQRT3 1.73205080756887729352744634151 |
#define | OFELI_ONEOVERPI 0.31830988618379067153776752675 |
#define | OFELI_GAUSS2 0.57735026918962576450914878050196 |
#define | OFELI_EPSMCH DBL_EPSILON |
#define | OFELI_TOLERANCE OFELI_EPSMCH*10000 |
#define | VLG 1.e10 |
#define | OFELI_INFINITY std::numeric_limits<real_t>::infinity(); |
#define | OFELI_IMAG std::complex<double>(0.,1.); |
#define | LIGHT_SPEED 299792458.2; |
#define | CATCH_EXCEPTION |
Typedefs | |
typedef unsigned long | lsize_t |
This type stands for type unsigned long . | |
typedef double | real_t |
This type stands for double . | |
typedef std::complex< double > | complex_t |
This type stands for type std::complex<double> | |
Functions | |
ostream & | operator<< (ostream &s, const complex_t &x) |
Output a complex number. More... | |
ostream & | operator<< (ostream &s, const std::string &c) |
Output a string. More... | |
template<class T_ > | |
ostream & | operator<< (ostream &s, const vector< T_ > &v) |
Output a vector instance. More... | |
template<class T_ > | |
ostream & | operator<< (ostream &s, const std::list< T_ > &l) |
Output a vector instance. More... | |
template<class T_ > | |
ostream & | operator<< (ostream &s, const std::pair< T_, T_ > &a) |
Output a pair instance. More... | |
void | saveField (Vect< real_t > &v, string output_file, int opt) |
Save a vector to an output file in a given file format. More... | |
void | saveField (const Vect< real_t > &v, const Mesh &mesh, string output_file, int opt) |
Save a vector to an output file in a given file format. More... | |
void | saveField (Vect< real_t > &v, const Grid &g, string output_file, int opt) |
Save a vector to an output file in a given file format, for a structured grid data. More... | |
void | saveGnuplot (string input_file, string output_file, string mesh_file, int f=1) |
Save a vector to an input Gnuplot file. More... | |
void | saveGnuplot (Mesh &mesh, string input_file, string output_file, int f=1) |
Save a vector to an input Gnuplot file. More... | |
void | saveTecplot (string input_file, string output_file, string mesh_file, int f=1) |
Save a vector to an output file to an input Tecplot file. More... | |
void | saveTecplot (Mesh &mesh, string input_file, string output_file, int f=1) |
Save a vector to an output file to an input Tecplot file. More... | |
void | saveVTK (string input_file, string output_file, string mesh_file, int f=1) |
Save a vector to an output VTK file. More... | |
void | saveVTK (Mesh &mesh, string input_file, string output_file, int f=1) |
Save a vector to an output VTK file. More... | |
void | saveGmsh (string input_file, string output_file, string mesh_file, int f=1) |
Save a vector to an output Gmsh file. More... | |
void | saveGmsh (Mesh &mesh, string input_file, string output_file, int f=1) |
Save a vector to an output Gmsh file. More... | |
ostream & | operator<< (ostream &s, const Tabulation &t) |
Output Tabulated function data. | |
template<class T_ > | |
bool | operator== (const Point< T_ > &a, const Point< T_ > &b) |
Operator == More... | |
template<class T_ > | |
Point< T_ > | operator+ (const Point< T_ > &a, const Point< T_ > &b) |
Operator + More... | |
template<class T_ > | |
Point< T_ > | operator+ (const Point< T_ > &a, const T_ &x) |
Operator + More... | |
template<class T_ > | |
Point< T_ > | operator- (const Point< T_ > &a) |
Unary Operator - More... | |
template<class T_ > | |
Point< T_ > | operator- (const Point< T_ > &a, const Point< T_ > &b) |
Operator - More... | |
template<class T_ > | |
Point< T_ > | operator- (const Point< T_ > &a, const T_ &x) |
Operator - More... | |
template<class T_ > | |
Point< T_ > | operator* (const T_ &a, const Point< T_ > &b) |
Operator * More... | |
template<class T_ > | |
Point< T_ > | operator* (const int &a, const Point< T_ > &b) |
Operator *. More... | |
template<class T_ > | |
Point< T_ > | operator* (const Point< T_ > &b, const T_ &a) |
Operator / More... | |
template<class T_ > | |
Point< T_ > | operator* (const Point< T_ > &b, const int &a) |
Operator * More... | |
template<class T_ > | |
T_ | operator* (const Point< T_ > &a, const Point< T_ > &b) |
Operator * More... | |
template<class T_ > | |
Point< T_ > | operator/ (const Point< T_ > &b, const T_ &a) |
Operator / More... | |
bool | areClose (const Point< real_t > &a, const Point< real_t > &b, real_t toler=OFELI_TOLERANCE) |
Return true if both instances of class Point<double> are distant with less then toler More... | |
real_t | SqrDistance (const Point< real_t > &a, const Point< real_t > &b) |
Return squared euclidean distance between points a and b More... | |
real_t | Distance (const Point< real_t > &a, const Point< real_t > &b) |
Return euclidean distance between points a and b More... | |
bool | operator< (const Point< size_t > &a, const Point< size_t > &b) |
Comparison operator. Returns true if all components of first vector are lower than those of second one. More... | |
template<class T_ > | |
std::ostream & | operator<< (std::ostream &s, const Point< T_ > &a) |
Output point coordinates. More... | |
template<class T_ > | |
bool | operator== (const Point2D< T_ > &a, const Point2D< T_ > &b) |
Operator ==. More... | |
template<class T_ > | |
Point2D< T_ > | operator+ (const Point2D< T_ > &a, const Point2D< T_ > &b) |
Operator +. More... | |
template<class T_ > | |
Point2D< T_ > | operator+ (const Point2D< T_ > &a, const T_ &x) |
Operator +. More... | |
template<class T_ > | |
Point2D< T_ > | operator- (const Point2D< T_ > &a) |
Unary Operator - More... | |
template<class T_ > | |
Point2D< T_ > | operator- (const Point2D< T_ > &a, const Point2D< T_ > &b) |
Operator - More... | |
template<class T_ > | |
Point2D< T_ > | operator- (const Point2D< T_ > &a, const T_ &x) |
Operator - More... | |
template<class T_ > | |
Point2D< T_ > | operator* (const T_ &a, const Point2D< T_ > &b) |
Operator *. More... | |
template<class T_ > | |
Point2D< T_ > | operator* (const int &a, const Point2D< T_ > &b) |
template<class T_ > | |
Point2D< T_ > | operator* (const Point2D< T_ > &b, const T_ &a) |
Operator / More... | |
template<class T_ > | |
Point2D< T_ > | operator* (const Point2D< T_ > &b, const int &a) |
Operator * More... | |
template<class T_ > | |
T_ | operator* (const Point2D< T_ > &b, const Point2D< T_ > &a) |
Operator *. More... | |
template<class T_ > | |
Point2D< T_ > | operator/ (const Point2D< T_ > &b, const T_ &a) |
Operator / More... | |
bool | areClose (const Point2D< real_t > &a, const Point2D< real_t > &b, real_t toler=OFELI_TOLERANCE) |
Return true if both instances of class Point2D<real_t> are distant with less then toler [Default: OFELI_EPSMCH ]. | |
real_t | SqrDistance (const Point2D< real_t > &a, const Point2D< real_t > &b) |
Return squared euclidean distance between points a and b More... | |
real_t | Distance (const Point2D< real_t > &a, const Point2D< real_t > &b) |
Return euclidean distance between points a and b More... | |
template<class T_ > | |
std::ostream & | operator<< (std::ostream &s, const Point2D< T_ > &a) |
Output point coordinates. More... | |
bool | operator== (const SpaceTime &a, const SpaceTime &b) |
Operator == More... | |
SpaceTime | operator+ (const SpaceTime &a, const SpaceTime &b) |
Operator + More... | |
SpaceTime | operator+ (const SpaceTime &a, const real_t &x) |
Operator + More... | |
SpaceTime | operator- (const SpaceTime &a) |
Unary Operator - More... | |
SpaceTime | operator- (const SpaceTime &a, const SpaceTime &b) |
Operator - More... | |
SpaceTime | operator- (const SpaceTime &a, const real_t &x) |
Operator - More... | |
SpaceTime | operator* (const real_t &a, const SpaceTime &b) |
Operator * More... | |
SpaceTime | operator* (const int &a, const SpaceTime &b) |
Operator *. More... | |
SpaceTime | operator* (const SpaceTime &b, const real_t &a) |
Operator / More... | |
SpaceTime | operator* (const SpaceTime &b, const int &a) |
Operator * More... | |
real_t | operator* (const SpaceTime &a, const SpaceTime &b) |
Operator * More... | |
SpaceTime | operator/ (const SpaceTime &b, const real_t &a) |
Operator / More... | |
bool | areClose (const SpaceTime &a, const SpaceTime &b, real_t toler=OFELI_TOLERANCE) |
Return true if both instances of class Point<double> are distant with less then toler More... | |
real_t | SqrDistance (const SpaceTime &a, const SpaceTime &b) |
Return squared euclidean distance between points a and b More... | |
real_t | Distance (const SpaceTime &a, const SpaceTime &b) |
Return euclidean distance between points a and b More... | |
bool | operator< (const SpaceTime &a, const SpaceTime &b) |
Comparison operator. Returns true if all components of first vector are lower than those of second one. More... | |
std::ostream & | operator<< (std::ostream &s, const SpaceTime &a) |
Output space-time point coordinates. More... | |
real_t | Discrepancy (Vect< real_t > &x, const Vect< real_t > &y, int n, int type=1) |
Return discrepancy between 2 vectors x and y More... | |
real_t | Discrepancy (Vect< complex_t > &x, const Vect< complex_t > &y, int n, int type=1) |
Return discrepancy between 2 vectors x and y More... | |
void | getMesh (string file, ExternalFileFormat form, Mesh &mesh, size_t nb_dof=1) |
Construct an instance of class Mesh from a mesh file stored in an external file format. More... | |
void | getBamg (string file, Mesh &mesh, size_t nb_dof=1) |
Construct an instance of class Mesh from a mesh file stored in Bamg format. More... | |
void | getEasymesh (string file, Mesh &mesh, size_t nb_dof=1) |
Construct an instance of class Mesh from a mesh file stored in Easymesh format. More... | |
void | getGambit (string file, Mesh &mesh, size_t nb_dof=1) |
Construct an instance of class Mesh from a mesh file stored in Gambit neutral format. More... | |
void | getGmsh (string file, Mesh &mesh, size_t nb_dof=1) |
Construct an instance of class Mesh from a mesh file stored in Gmsh format. More... | |
void | getMatlab (string file, Mesh &mesh, size_t nb_dof=1) |
Construct an instance of class Mesh from a Matlab mesh data. More... | |
void | getNetgen (string file, Mesh &mesh, size_t nb_dof=1) |
Construct an instance of class Mesh from a mesh file stored in Netgen format. More... | |
void | getTetgen (string file, Mesh &mesh, size_t nb_dof=1) |
Construct an instance of class Mesh from a mesh file stored in Tetgen format. More... | |
void | getTriangle (string file, Mesh &mesh, size_t nb_dof=1) |
Construct an instance of class Mesh from a mesh file stored in Triangle format. More... | |
void | saveMesh (const string &file, const Mesh &mesh, ExternalFileFormat form) |
This function saves mesh data a file for a given external format. More... | |
void | saveGmsh (const string &file, const Mesh &mesh) |
This function outputs a Mesh instance in a file in Gmsh format. More... | |
void | saveGnuplot (const string &file, const Mesh &mesh) |
This function outputs a Mesh instance in a file in Gmsh format. More... | |
void | saveMatlab (const string &file, const Mesh &mesh) |
This function outputs a Mesh instance in a file in Matlab format. More... | |
void | saveTecplot (const string &file, const Mesh &mesh) |
This function outputs a Mesh instance in a file in Tecplot format. More... | |
void | saveVTK (const string &file, const Mesh &mesh) |
This function outputs a Mesh instance in a file in VTK format. More... | |
void | BSpline (size_t n, size_t t, Vect< Point< real_t > > &control, Vect< Point< real_t > > &output, size_t num_output) |
Function to perform a B-spline interpolation. More... | |
void | banner (const string &prog=" ") |
Outputs a banner as header of any developed program. More... | |
template<class T_ > | |
void | QuickSort (std::vector< T_ > &a, int begin, int end) |
Function to sort a vector. More... | |
template<class T_ > | |
void | qksort (std::vector< T_ > &a, int begin, int end) |
Function to sort a vector. More... | |
template<class T_ , class C_ > | |
void | qksort (std::vector< T_ > &a, int begin, int end, C_ compare) |
Function to sort a vector according to a key function. More... | |
int | Sgn (real_t a) |
Return sign of a : -1 or 1 . | |
real_t | Sgn (real_t a, real_t b) |
Return |a| if b>0 , -|a| if not. | |
real_t | Abs2 (complex_t a) |
Return square of modulus of complex number a | |
real_t | Abs2 (real_t a) |
Return square of real number a | |
real_t | Abs (real_t a) |
Return absolute value of a | |
real_t | Abs (complex_t a) |
Return modulus of complex number a | |
real_t | Abs (const Point< real_t > &p) |
Return norm of vector a | |
real_t | Conjg (real_t a) |
Return complex conjugate of real number a | |
complex_t | Conjg (complex_t a) |
Return complex conjugate of complex number a | |
string | out_complex (complex_t z) |
Return string to conveniently display a complex number. More... | |
string | out_complex (real_t x, real_t y) |
Return string to conviently display a complex number. More... | |
real_t | Max (real_t a, real_t b, real_t c) |
Return maximum value of real numbers a , b and c | |
int | Kronecker (int i, int j) |
Return Kronecker delta of i and j . | |
template<class T_ > | |
const T_ & | Max (const T_ &a, const T_ &b) |
Return maximum value of elements a and b | |
template<class T_ > | |
const T_ & | Min (const T_ &a, const T_ &b) |
Return minimum value of elements a and b | |
int | Max (int a, int b, int c) |
Return maximum value of integer numbers a , b and c | |
real_t | Min (real_t a, real_t b, real_t c) |
Return minimum value of real numbers a , b and c | |
int | Min (int a, int b, int c) |
Return minimum value of integer numbers a , b and c | |
real_t | Max (real_t a, real_t b, real_t c, real_t d) |
Return maximum value of integer numbers a , b , c and d | |
int | Max (int a, int b, int c, int d) |
Return maximum value of integer numbers a , b , c and d | |
real_t | Min (real_t a, real_t b, real_t c, real_t d) |
Return minimum value of real numbers a , b , c and d | |
int | Min (int a, int b, int c, int d) |
Return minimum value of integer numbers a , b , c and d | |
real_t | Arg (complex_t x) |
Return argument of complex number x | |
complex_t | Log (complex_t x) |
Return principal determination of logarithm of complex number x | |
template<class T_ > | |
T_ | Sqr (T_ x) |
Return square of value x | |
template<class T_ > | |
void | Scale (T_ a, const vector< T_ > &x, vector< T_ > &y) |
Mutiply vector x by a and save result in vector y More... | |
template<class T_ > | |
void | Scale (T_ a, const Vect< T_ > &x, Vect< T_ > &y) |
Mutiply vector x by a and save result in vector y More... | |
template<class T_ > | |
void | Scale (T_ a, vector< T_ > &x) |
Mutiply vector x by a More... | |
template<class T_ > | |
void | Xpy (size_t n, T_ *x, T_ *y) |
Add array x to y | |
template<class T_ > | |
void | Xpy (const vector< T_ > &x, vector< T_ > &y) |
Add vector x to y More... | |
template<class T_ > | |
void | Axpy (size_t n, T_ a, T_ *x, T_ *y) |
Multiply array x by a and add result to y More... | |
template<class T_ > | |
void | Axpy (T_ a, const vector< T_ > &x, vector< T_ > &y) |
Multiply vector x by a and add result to y More... | |
template<class T_ > | |
void | Copy (size_t n, T_ *x, T_ *y) |
Copy array x to y n is the arrays size. | |
real_t | Error2 (const vector< real_t > &x, const vector< real_t > &y) |
Return absolute L2 error between vectors x and y | |
real_t | RError2 (const vector< real_t > &x, const vector< real_t > &y) |
Return absolute L2 error between vectors x and y | |
real_t | ErrorMax (const vector< real_t > &x, const vector< real_t > &y) |
Return absolute Max. error between vectors x and y | |
real_t | RErrorMax (const vector< real_t > &x, const vector< real_t > &y) |
Return relative Max. error between vectors x and y | |
template<class T_ > | |
T_ | Dot (size_t n, T_ *x, T_ *y) |
Return dot product of arrays x and y More... | |
real_t | Dot (const vector< real_t > &x, const vector< real_t > &y) |
Return dot product of vectors x and y . More... | |
template<class T_ > | |
T_ | Dot (const Point< T_ > &x, const Point< T_ > &y) |
Return dot product of x and y | |
real_t | exprep (real_t x) |
Compute the exponential function with avoiding over and underflows. | |
template<class T_ > | |
void | Assign (vector< T_ > &v, const T_ &a) |
Assign the value a to all entries of a vector v | |
template<class T_ > | |
void | clear (vector< T_ > &v) |
Assign 0 to all entries of a vector. More... | |
template<class T_ > | |
void | clear (Vect< T_ > &v) |
Assign 0 to all entries of a vector. More... | |
real_t | Nrm2 (size_t n, real_t *x) |
Return 2-norm of array x More... | |
real_t | Nrm2 (const vector< real_t > &x) |
Return 2-norm of vector x | |
template<class T_ > | |
real_t | Nrm2 (const Point< T_ > &a) |
Return 2-norm of a | |
bool | Equal (real_t x, real_t y, real_t toler=OFELI_EPSMCH) |
Function to return true if numbers x and y are close up to a given tolerance toler More... | |
char | itoc (int i) |
Function to convert an integer to a character. | |
template<class T_ > | |
std::string | toString (const T_ x) |
Function to convert any value to a string. | |
template<class T_ > | |
T_ | stringTo (const std::string &s) |
Function to convert a string to a template type parameter. | |
Utility functions and classes.
#define CATCH_EXCEPTION |
This macro can be inserted after a try
loop to catch a thrown exception.
#define LIGHT_SPEED 299792458.2; |
= Speed of light in SI units
#define OFELI_E 2.71828182845904523536028747135 |
Value of e or exp (with 28 digits)
#define OFELI_EPSMCH DBL_EPSILON |
Value of Machine Epsilon
#define OFELI_GAUSS2 0.57735026918962576450914878050196 |
Value of 1/sqrt(3) (with 32 digits)
#define OFELI_IMAG std::complex<double>(0.,1.); |
= Unit imaginary number (i
)
#define OFELI_INFINITY std::numeric_limits<real_t>::infinity(); |
= Very large number: Infinity
#define OFELI_ONEOVERPI 0.31830988618379067153776752675 |
Value of 1/Pi (with 28 digits)
#define OFELI_PI 3.14159265358979323846264338328 |
Value of Pi (with 28 digits)
#define OFELI_SIXTH 0.16666666666666666666666666667 |
Value of 1/6 (with 28 digits)
#define OFELI_SQRT2 1.41421356237309504880168872421 |
Value of sqrt(2) (with 28 digits)
#define OFELI_SQRT3 1.73205080756887729352744634151 |
Value of sqrt(3) (with 28 digits)
#define OFELI_THIRD 0.33333333333333333333333333333 |
Value of 1/3 (with 28 digits)
#define OFELI_TOLERANCE OFELI_EPSMCH*10000 |
Default tolerance for an iterative process = OFELI_EPSMCH * 10000
#define OFELI_TWELVETH 0.08333333333333333333333333333 |
Value of 1/12 (with 28 digits)
#define VLG 1.e10 |
Very large number: A real number for penalty
bool areClose | ( | const Point< real_t > & | a, |
const Point< real_t > & | b, | ||
real_t | toler = OFELI_TOLERANCE |
||
) |
Return true
if both instances of class Point<double> are distant with less then toler
bool areClose | ( | const SpaceTime & | a, |
const SpaceTime & | b, | ||
real_t | toler = OFELI_TOLERANCE |
||
) |
Return true
if both instances of class Point<double> are distant with less then toler
void Axpy | ( | size_t | n, |
T_ | a, | ||
T_ * | x, | ||
T_ * | y | ||
) |
Multiply array x
by a
and add result to y
n
is the arrays size.
void Axpy | ( | T_ | a, |
const vector< T_ > & | x, | ||
vector< T_ > & | y | ||
) |
Multiply vector x
by a
and add result to y
x
and y
are instances of class vector<T_>
void banner | ( | const string & | prog = " " | ) |
Outputs a banner as header of any developed program.
[in] | prog | Calling program name. Enables writing a copyright notice accompanying the program. |
BSpline | ( | size_t | n, |
size_t | t, | ||
Vect< Point< real_t > > & | control, | ||
Vect< Point< real_t > > & | output, | ||
size_t | num_output | ||
) |
Function to perform a B-spline interpolation.
This program is adapted from a free program ditributed by Keith Vertanen (verta) in 1994. nkd@ cda.m rs.u mn.ed u
[in] | n | Number of control points minus 1. |
[in] | t | Degree of the polynomial plus 1. |
[in] | control | Control point array made up of Point stucture. |
[out] | output | Vector in which the calculated spline points are to be put. |
[in] | num_output | How many points on the spline are to be calculated. |
n+2>t
(No curve results if n+2<=t
) Control vector contains the number of points specified by n
Output array is the proper size to hold num_output
point structuresvoid clear | ( | vector< T_ > & | v | ) |
Assign 0
to all entries of a vector.
[in] | v | Vector to clear |
void clear | ( | Vect< T_ > & | v | ) |
Assign 0
to all entries of a vector.
[in] | v | Vector to clear |
Return discrepancy between 2 vectors x
and y
[in,out] | x | First vector (Instance of class Vect). On output, x is assigned the vector y |
[in] | y | Second vector (Instance of class Vect) |
[in] | n | Type of norm
|
[in] | type | Discrepancy type (0: Absolute, 1: Relative [Default]) |
Return discrepancy between 2 vectors x
and y
[in,out] | x | First vector (Instance of class Vect). On output, x is assigned the vector y |
[in] | y | Second vector (Instance of class Vect) |
[in] | n | Type of norm
|
[in] | type | Discrepancy type (0: Absolute, 1: Relative [Default]) |
Return euclidean distance between points a
and b
Return euclidean distance between points a
and b
Return euclidean distance between points a
and b
T_ Dot | ( | size_t | n, |
T_ * | x, | ||
T_ * | y | ||
) |
Return dot product of arrays x
and y
n
is the arrays size.
Return dot product of vectors x
and y
.
x
and y
are instances of class vector<double>
bool Equal | ( | real_t | x, |
real_t | y, | ||
real_t | toler = OFELI_EPSMCH |
||
) |
Function to return true if numbers x
and y
are close up to a given tolerance toler
Default value of tolerance is the constant OFELI_EPSMCH
void getBamg | ( | string | file, |
Mesh & | mesh, | ||
size_t | nb_dof = 1 |
||
) |
Construct an instance of class Mesh from a mesh file stored in Bamg format.
[in] | file | Name of a file written in the Bamg format. |
http://raweb.inria.fr/rapportsactivite/RA2002/gamma/uid25.html
[out] | mesh | Mesh instance created by the function. |
[in] | nb_dof | Number of degrees of freedom for each node. This information is not provided, in general, by mesh generators. Its default value here is 1. |
void getEasymesh | ( | string | file, |
Mesh & | mesh, | ||
size_t | nb_dof = 1 |
||
) |
Construct an instance of class Mesh from a mesh file stored in Easymesh format.
[in] | file | Name of a file (without extension) written in Easymesh format. Actually, the function Easymesh2MDF attempts to read mesh data from files file.e , file.n and file.s produced by Easymesh. |
[in] | mesh | Mesh instance created by the function. |
[in] | nb_dof | Number of degrees of freedom for each node. This information is not provided, in general, by mesh generators. Its default value here is 1. |
void getGambit | ( | string | file, |
Mesh & | mesh, | ||
size_t | nb_dof = 1 |
||
) |
Construct an instance of class Mesh from a mesh file stored in Gambit neutral format.
[in] | file | Name of a file written in the Gambit neutral format. |
[out] | mesh | Mesh instance created by the function. |
[in] | nb_dof | Number of degrees of freedom for each node. This information is not provided, in general, by mesh generators. Its default value here is 1. |
void getGmsh | ( | string | file, |
Mesh & | mesh, | ||
size_t | nb_dof = 1 |
||
) |
Construct an instance of class Mesh from a mesh file stored in Gmsh format.
[in] | file | Name of a file written in the Gmsh format. |
[out] | mesh | Mesh instance created by the function. |
[in] | nb_dof | Number of degrees of freedom for each node. This information is not provided, in general, by mesh generators. Its default value here is 1. |
void getMatlab | ( | string | file, |
Mesh & | mesh, | ||
size_t | nb_dof = 1 |
||
) |
Construct an instance of class Mesh from a Matlab mesh data.
[in] | file | Name of a file created by Matlab by executing the script file Matlab2OFELI.m |
[out] | mesh | Mesh instance created by the function. |
[in] | nb_dof | Number of degrees of freedom for each node. This information is not provided, in general, by mesh generators. Its default value here is 1. |
void getMesh | ( | string | file, |
ExternalFileFormat | form, | ||
Mesh & | mesh, | ||
size_t | nb_dof = 1 |
||
) |
Construct an instance of class Mesh from a mesh file stored in an external file format.
[in] | file | Input mesh file name. |
[in] | form | Format of the mesh file. This one can be chosen among the enumerated values:
|
[out] | mesh | Mesh instance created by the function. |
[in] | nb_dof | Number of degrees of freedom for each node. This information is not provided, in general, by mesh generators. Its default value here is 1. |
void getNetgen | ( | string | file, |
Mesh & | mesh, | ||
size_t | nb_dof = 1 |
||
) |
Construct an instance of class Mesh from a mesh file stored in Netgen format.
[in] | file | Name of a file written in the Netgen format. |
[out] | mesh | Mesh instance created by the function. |
[in] | nb_dof | Number of degrees of freedom for each node. This information is not provided, in general, by mesh generators. [ default = 1 ] |
void getTetgen | ( | string | file, |
Mesh & | mesh, | ||
size_t | nb_dof = 1 |
||
) |
Construct an instance of class Mesh from a mesh file stored in Tetgen format.
[in] | file | Name of a file written in the Tetgen format. |
[out] | mesh | Mesh instance created by the function. |
[in] | nb_dof | Number of degrees of freedom for each node. This information is not provided, in general, by mesh generators. Its default value here is 1. |
void getTriangle | ( | string | file, |
Mesh & | mesh, | ||
size_t | nb_dof = 1 |
||
) |
Construct an instance of class Mesh from a mesh file stored in Triangle format.
[in] | file | Name of a file written in the Tetgen format. |
[out] | mesh | Mesh instance created by the function. |
[in] | nb_dof | Number of degrees of freedom for each node. This information is not provided, in general, by mesh generators. Its default value here is 1. |
Return 2-norm of array x
[in] | n | is Array length |
[in] | x | Array to treat |
Operator *.
Return point b
premultiplied by constant a
Operator *.
Return point b
divided by integer constant a
Operator *
Return point b
premultiplied by constant a
Operator *
Return point b
premultiplied by constant a
Operator /
Return point b
postmultiplied by constant a
Operator *.
Return point b
divided by integer constant a
Operator *.
Return point b
divided by integer constant a
Operator *
Return point b
postmultiplied by constant a
Operator /
Return point b
multiplied by constant a
Operator /
Return point b
multiplied by constant a
Operator *.
Return point b postmultiplied by integer constant a.
Operator *
Return point b
postmultiplied by constant a
Operator *
Return point b
postmultiplied by constant a
Operator *
Return inner (scalar) product of points a
and b
Operator *
Return inner (scalar) product of points a
and b
Operator +.
Return sum of two points a
and b
Operator +.
Translate a
by x
Operator +
Return sum of two points a
and b
Operator +
Return sum of two points a
and b
Operator +
Translate a
by x
Operator +
Translate a
by x
Unary Operator -
Return minus a
Operator -
Return point a
minus point b
Unary Operator -
Return minus a
Unary Operator -
Return minus a
Operator -
Translate a
by -x
Operator -
Return point a
minus point b
Operator -
Return point a
minus point b
Operator -
Translate a
by -x
Operator -
Translate a
by -x
Operator /
Return point b
divided by constant a
Operator /
Return point b
divided by constant a
Operator /
Return point b
divided by constant a
Comparison operator. Returns true if all components of first vector are lower than those of second one.
Return minus a
Comparison operator. Returns true if all components of first vector are lower than those of second one.
Return minus a
ostream & operator<< | ( | ostream & | s, |
const complex_t & | x | ||
) |
Output a complex number.
ostream & operator<< | ( | ostream & | s, |
const std::string & | c | ||
) |
Output a string.
ostream & operator<< | ( | ostream & | s, |
const vector< T_ > & | v | ||
) |
Output a vector instance.
ostream & operator<< | ( | ostream & | s, |
const std::list< T_ > & | l | ||
) |
Output a vector instance.
ostream & operator<< | ( | ostream & | s, |
const std::pair< T_, T_ > & | a | ||
) |
Output a pair instance.
ostream & operator<< | ( | std::ostream & | s, |
const Point2D< T_ > & | a | ||
) |
Output point coordinates.
ostream & operator<< | ( | std::ostream & | s, |
const Point< T_ > & | a | ||
) |
Output point coordinates.
ostream & operator<< | ( | std::ostream & | s, |
const SpaceTime & | a | ||
) |
Output space-time point coordinates.
Operator ==.
Return true
if a=b
, false if not.
Operator ==
Return true
if a=b
, false
if not.
Operator ==
Return true
if a=b
, false
if not.
string out_complex | ( | complex_t | z | ) |
Return string to conveniently display a complex number.
[in] | z | Complex number |
Return string to conviently display a complex number.
[in] | x | Real part |
[in] | y | Imaginary part |
void qksort | ( | std::vector< T_ > & | a, |
int | begin, | ||
int | end | ||
) |
Function to sort a vector.
qksort uses the famous quick sorting algorithm.
[in,out] | a | Vector to sort. |
[in] | begin | index of starting index (default value is 0) |
[in] | end | index of ending index (default value is the vector size - 1) |
void qksort | ( | std::vector< T_ > & | a, |
int | begin, | ||
int | end, | ||
C_ | compare | ||
) |
Function to sort a vector according to a key function.
qksort uses the famous quick sorting algorithm.
[in,out] | a | Vector to sort. |
[in] | begin | index of starting index (0 for the beginning of the vector) |
[in] | end | index of ending index |
[in] | compare | A function object that implements the ordering. The user must provide this function that returns a boolean function that is true if the first argument is less than the second and false if not. |
void QuickSort | ( | std::vector< T_ > & | a, |
int | begin, | ||
int | end | ||
) |
Function to sort a vector.
qksort uses the famous quick sorting algorithm.
[in,out] | a | Vector to sort. |
[in] | begin | index of starting iterator |
[in] | end | index of ending iterator |
The calling program must provide an overloading of the operator < for the type T_
Save a vector to an output file in a given file format.
Case where the vector contains mesh information
[in] | v | Vect instance to save |
[in] | output_file | Output file where to save the vector |
[in] | opt | Option to choose file format to save. This is to be chosen among enumerated values: GMSH , GNUPLOT , MATLAB , TECPLOT , VTK |
Save a vector to an output file in a given file format.
Case where the vector does not contain mesh information
[in] | v | Vect instance to save |
[in] | mesh | Mesh instance |
[in] | output_file | Output file where to save the vector |
[in] | opt | Option to choose file format to save. This is to be chosen among enumerated values: GMSH , GNUPLOT , MATLAB , TECPLOT , VTK |
Save a vector to an output file in a given file format, for a structured grid data.
[in] | v | Vect instance to save |
[in] | g | Grid instance |
[in] | output_file | Output file where to save the vector |
[in] | opt | Option to choose file format to save. This is to be chosen among enumerated values: GMSH , VTK |
void saveGmsh | ( | const string & | file, |
const Mesh & | mesh | ||
) |
This function outputs a Mesh instance in a file in Gmsh format.
[in] | file | Output file in Gmsh format. |
[in] | mesh | Mesh instance to save. |
void saveGmsh | ( | string | input_file, |
string | output_file, | ||
string | mesh_file, | ||
int | f = 1 |
||
) |
Save a vector to an output Gmsh file.
Gmsh is a free mesh generator and postprocessor that can be downloaded from the site:
http://www.geuz.org/gmsh/
[in] | input_file | Input file (OFELI XML file containing a field). |
[in] | output_file | Output file (Gmsh format file) |
[in] | mesh_file | File containing mesh data |
[in] | f | Field is stored each f time step [Default: 1 ] |
void saveGmsh | ( | Mesh & | mesh, |
string | input_file, | ||
string | output_file, | ||
int | f = 1 |
||
) |
Save a vector to an output Gmsh file.
Gmsh is a free mesh generator and postprocessor that can be downloaded from the site:
http://www.geuz.org/gmsh/
[in] | mesh | Reference to Mesh instance |
[in] | input_file | Input file (OFELI XML file containing a field). |
[in] | output_file | Output file (Gmsh format file) |
[in] | f | Field is stored each f time step [Default: 1 ] |
void saveGnuplot | ( | const string & | file, |
const Mesh & | mesh | ||
) |
This function outputs a Mesh instance in a file in Gmsh format.
http://www.gnuplot.info/
[out] | file | Output file in Gnuplot format. |
[in] | mesh | Mesh instance to save. |
void saveGnuplot | ( | string | input_file, |
string | output_file, | ||
string | mesh_file, | ||
int | f = 1 |
||
) |
Save a vector to an input Gnuplot file.
Gnuplot is a command-line driven program for producing 2D and 3D plots. It is under the GNU General Public License. Available information can be found in the site:
http://www.gnuplot.info/
[in] | input_file | Input file (OFELI XML file containing a field). |
[in] | output_file | Output file (gnuplot format file) |
[in] | mesh_file | File containing mesh data |
[in] | f | Field is stored each f time step [Default: 1 |
void saveGnuplot | ( | Mesh & | mesh, |
string | input_file, | ||
string | output_file, | ||
int | f = 1 |
||
) |
Save a vector to an input Gnuplot file.
Gnuplot is a command-line driven program for producing 2D and 3D plots. It is under the GNU General Public License. Available information can be found in the site:
http://www.gnuplot.info/
[in] | mesh | Reference to Mesh instance |
[in] | input_file | Input file (OFELI XML file containing a field). |
[in] | output_file | Output file (gnuplot format file) |
[in] | f | Field is stored each f time step [Default: 1 ] |
void saveMatlab | ( | const string & | file, |
const Mesh & | mesh | ||
) |
This function outputs a Mesh instance in a file in Matlab format.
http://www.mathworks.com/products/matlab/
[out] | file | Output file in Matlab format. |
[in] | mesh | Mesh instance to save. |
void saveMesh | ( | const string & | file, |
const Mesh & | mesh, | ||
ExternalFileFormat | form | ||
) |
This function saves mesh data a file for a given external format.
[in] | file | File where to store mesh |
[in] | mesh | Mesh instance to save |
[in] | form | Format of the mesh file. This one can be chosen among the enumerated values:
|
void saveTecplot | ( | const string & | file, |
const Mesh & | mesh | ||
) |
This function outputs a Mesh instance in a file in Tecplot format.
http://www.tecplot.com
[out] | file | Output file in Tecplot format. |
[in] | mesh | Mesh instance to save. |
void saveTecplot | ( | string | input_file, |
string | output_file, | ||
string | mesh_file, | ||
int | f = 1 |
||
) |
Save a vector to an output file to an input Tecplot file.
Tecplot is high quality post graphical commercial processing program developed by Amtec. Available information can be found in the site: http://www.tecplot.com
[in] | input_file | Input file (OFELI XML file containing a field). |
[in] | output_file | Output file (gnuplot format file) |
[in] | mesh_file | File containing mesh data |
[in] | f | Field is stored each f time step [Default: 1 ] |
void saveTecplot | ( | Mesh & | mesh, |
string | input_file, | ||
string | output_file, | ||
int | f = 1 |
||
) |
Save a vector to an output file to an input Tecplot file.
Tecplot is high quality post graphical commercial processing program developed by Amtec. Available information can be found in the site: http://www.tecplot.com
[in] | mesh | Reference to Mesh instance |
[in] | input_file | Input file (OFELI XML file containing a field). |
[in] | output_file | Output file (gnuplot format file) |
[in] | f | Field is stored each f time step [Default: 1 ] |
void saveVTK | ( | const string & | file, |
const Mesh & | mesh | ||
) |
This function outputs a Mesh instance in a file in VTK format.
http://public.kitware.com/VTK/
[out] | file | Output file in VTK format. |
[in] | mesh | Mesh instance to save. |
saveVTK | ( | string | input_file, |
string | output_file, | ||
string | mesh_file, | ||
int | f = 1 |
||
) |
Save a vector to an output VTK file.
The Visualization ToolKit (VTK) is an open source, freely available software system for 3D computer graphics. Available information can be found in the site:
http://public.kitware.com/VTK/
[in] | input_file | Input file (OFELI XML file containing a field). |
[in] | output_file | Output file (VTK format file) |
[in] | mesh_file | File containing mesh data |
[in] | f | Field is stored each f time step [Default: 1 ] |
saveVTK | ( | Mesh & | mesh, |
string | input_file, | ||
string | output_file, | ||
int | f = 1 |
||
) |
Save a vector to an output VTK file.
The Visualization ToolKit (VTK) is an open source, freely available software system for 3D computer graphics. Available information can be found in the site:
http://public.kitware.com/VTK/
[in] | mesh | Reference to Mesh instance |
[in] | input_file | Input file (OFELI XML file containing a field). |
[in] | output_file | Output file (VTK format file) |
[in] | f | Field is stored each f time step [Default: 1 ] |
void Scale | ( | T_ | a, |
const vector< T_ > & | x, | ||
vector< T_ > & | y | ||
) |
Mutiply vector x
by a
and save result in vector y
x
and y
are instances of class vector<T_>
Mutiply vector x
by a
and save result in vector y
x
and y
are instances of class Vect<T_>
void Scale | ( | T_ | a, |
vector< T_ > & | x | ||
) |
Mutiply vector x
by a
x
is an instance of class vector<T_>
Return squared euclidean distance between points a
and b
Return squared euclidean distance between points a
and b
Return squared euclidean distance between points a
and b
void Xpy | ( | const vector< T_ > & | x, |
vector< T_ > & | y | ||
) |
Add vector x
to y
x
and y
are instances of class vector<T_>