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 | Funct |
| A simple class to parse real valued functions. More... | |
| 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 | OFELIException |
| To handle exceptions in OFELI. 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_IMAG std::complex<double>(0.,1.); |
| #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< double > &a, const Point< double > &b, double toler=OFELI_TOLERANCE) |
Return true if both instances of class Point<double> are distant with less then toler More... | |
| double | SqrDistance (const Point< double > &a, const Point< double > &b) |
Return squared euclidean distance between points a and b More... | |
| double | Distance (const Point< double > &a, const Point< double > &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... | |
| 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 | saveBamg (const string &file, Mesh &mesh) |
| This function outputs a Mesh instance in a file in Bamg 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 | 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 | |
| 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. | |
| 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 | Axpy (T_ a, const Vect< T_ > &x, Vect< 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_ > | |
| T_ | stringTo (const std::string &s) |
| Function to convert a string to a template type parameter. | |
Detailed Description
Utility functions and classes.
Macro Definition Documentation
| #define OFELI_E 2.71828182845904523536028747135 |
Value of e or exp (with 28 digits)
| #define OFELI_PI 3.14159265358979323846264338328 |
Value of Pi (with 28 digits)
| #define OFELI_THIRD 0.33333333333333333333333333333 |
Value of 1/3 (with 28 digits)
| #define OFELI_SIXTH 0.16666666666666666666666666667 |
Value of 1/6 (with 28 digits)
| #define OFELI_TWELVETH 0.08333333333333333333333333333 |
Value of 1/12 (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_ONEOVERPI 0.31830988618379067153776752675 |
Value of 1/Pi (with 28 digits)
| #define OFELI_GAUSS2 0.57735026918962576450914878050196 |
Value of 1/sqrt(3) (with 32 digits)
| #define OFELI_EPSMCH DBL_EPSILON |
Value of Machine Epsilon
| #define OFELI_TOLERANCE OFELI_EPSMCH*10000 |
Default tolerance for an iterative process = OFELI_EPSMCH * 10000
| #define VLG 1.e10 |
Very large number: A real number for penalty
| #define OFELI_IMAG std::complex<double>(0.,1.); |
= Unit imaginary number (i)
| #define CATCH_EXCEPTION |
This macro can be inserted after a try loop to catch a thrown exception.
Function Documentation
| ostream & operator<< | ( | ostream & | s, |
| const complex_t & | x | ||
| ) |
Output a complex number.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| ostream & operator<< | ( | ostream & | s, |
| const std::string & | c | ||
| ) |
Output a string.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| ostream & operator<< | ( | ostream & | s, |
| const vector< T_ > & | v | ||
| ) |
Output a vector instance.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| ostream & operator<< | ( | ostream & | s, |
| const std::list< T_ > & | l | ||
| ) |
Output a vector instance.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| ostream & operator<< | ( | ostream & | s, |
| const std::pair< T_, T_ > & | a | ||
| ) |
Output a pair instance.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Save a vector to an output file in a given file format.
Case where the vector contains mesh information
- Parameters
-
[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
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Save a vector to an output file in a given file format.
Case where the vector does not contain mesh information
- Parameters
-
[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
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Save a vector to an output file in a given file format, for a structured grid data.
- Parameters
-
[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
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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/
- Parameters
-
[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 ftime step [Default:1
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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/
- Parameters
-
[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 ftime step [Default:1]
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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
- Parameters
-
[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 ftime step [Default:1]
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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
- Parameters
-
[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 ftime step [Default:1]
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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/
- Parameters
-
[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 ftime step [Default:1]
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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/
- Parameters
-
[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 ftime step [Default:1]
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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/
- Parameters
-
[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 ftime step [Default:1]
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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/
- Parameters
-
[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 ftime step [Default:1]
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Operator ==
Return true if a=b, false if not.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Operator +
Return sum of two points a and b
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| Point< T_ > operator+ | ( | const Point< T_ > & | a, |
| const T_ & | x | ||
| ) |
Operator +
Translate a by x
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| Point< T_ > operator- | ( | const Point< T_ > & | a | ) |
Unary Operator -
Return minus a
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Operator -
Return point a minus point b
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| Point< T_ > operator- | ( | const Point< T_ > & | a, |
| const T_ & | x | ||
| ) |
Operator -
Translate a by -x
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| Point< T_ > operator* | ( | const T_ & | a, |
| const Point< T_ > & | b | ||
| ) |
Operator *
Return point b premultiplied by constant a
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| Point< T_ > operator* | ( | const int & | a, |
| const Point< T_ > & | b | ||
| ) |
Operator *.
Return point b divided by integer constant a
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| Point< T_ > operator* | ( | const Point< T_ > & | b, |
| const T_ & | a | ||
| ) |
Operator /
Return point b multiplied by constant a
| Point< T_ > operator* | ( | const Point< T_ > & | b, |
| const int & | a | ||
| ) |
Operator *
Return point b postmultiplied by constant a
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Operator *
Return inner (scalar) product of points a and b
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| Point< T_ > operator/ | ( | const Point< T_ > & | b, |
| const T_ & | a | ||
| ) |
Operator /
Return point b divided by constant a
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| bool areClose | ( | const Point< double > & | a, |
| const Point< double > & | b, | ||
| double | toler = OFELI_TOLERANCE |
||
| ) |
Return true if both instances of class Point<double> are distant with less then toler
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Return squared euclidean distance between points a and b
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Return euclidean distance between points a and b
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Comparison operator. Returns true if all components of first vector are lower than those of second one.
Return minus a
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| ostream & operator<< | ( | std::ostream & | s, |
| const Point< T_ > & | a | ||
| ) |
Output point coordinates.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Operator ==.
Return true if a=b, false if not.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Operator +.
Return sum of two points a and b
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| Point2D< T_ > operator+ | ( | const Point2D< T_ > & | a, |
| const T_ & | x | ||
| ) |
Operator +.
Translate a by x
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| Point2D< T_ > operator- | ( | const Point2D< T_ > & | a | ) |
Unary Operator -
Return minus a
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Operator -
Return point a minus point b
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| Point2D< T_ > operator- | ( | const Point2D< T_ > & | a, |
| const T_ & | x | ||
| ) |
Operator -
Translate a by -x
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| Point2D< T_ > operator* | ( | const T_ & | a, |
| const Point2D< T_ > & | b | ||
| ) |
Operator *.
Return point b premultiplied by constant a
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| Point2D< T_ > operator* | ( | const int & | a, |
| const Point2D< T_ > & | b | ||
| ) |
Operator *.
Return point b divided by integer constant a
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| Point2D< T_ > operator* | ( | const Point2D< T_ > & | b, |
| const T_ & | a | ||
| ) |
Operator /
Return point b postmultiplied by constant a
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| Point2D< T_ > operator* | ( | const Point2D< T_ > & | b, |
| const int & | a | ||
| ) |
Operator *
Return point b postmultiplied by constant a
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Operator *.
Return point b postmultiplied by integer constant a.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| Point2D< T_ > operator/ | ( | const Point2D< T_ > & | b, |
| const T_ & | a | ||
| ) |
Operator /
Return point b divided by constant a
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Return squared euclidean distance between points a and b
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Return euclidean distance between points a and b
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| ostream & operator<< | ( | std::ostream & | s, |
| const Point2D< T_ > & | a | ||
| ) |
Output point coordinates.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Return discrepancy between 2 vectors x and y
- Parameters
-
[in,out] x First vector (Instance of class Vect). On output, xis assigned the vectory[in] y Second vector (Instance of class Vect) [in] n Type of norm - 1: Weighted 1-Norm
- 2: Weighted 2-Norm
- 0: Max-Norm
[in] type Discrepancy type (0: Absolute, 1: Relative [Default])
- Returns
- Computed discrepancy value
Return discrepancy between 2 vectors x and y
- Parameters
-
[in,out] x First vector (Instance of class Vect). On output, xis assigned the vectory[in] y Second vector (Instance of class Vect) [in] n Type of norm - 1: Weighted 1-Norm
- 2: Weighted 2-Norm
- 0: Max-Norm
[in] type Discrepancy type (0: Absolute, 1: Relative [Default])
- Returns
- Computed discrepancy value
| 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.
- Parameters
-
[in] file Input mesh file name.
[in] form Format of the mesh file. This one can be chosen among the enumerated values: -
GMSH: Mesh generator Gmsh, see site:
http://www.geuz.org/gmsh/ -
MATLAB: Matlab file, see site:
http://www.mathworks.com/products/matlab/ -
EASYMESH: Easymesh is a 2-D mesh generator, see site:
http://web.mit.edu/easymesh_v1.4/www/easymesh.html -
GAMBIT: Gambit is a mesh generator associated to Fluenthttp://www.stanford.edu/class/me469b/gambit_download.html -
BAMG: Mesh generatorBamg, see site:
http://raweb.inria.fr/rapportsactivite/RA2002/gamma/uid25.html -
NETGEN: Netgen is a 3-D mesh generator, see site:
http://www.hpfem.jku.at/netgen/ -
TETGEN: Tetgen is a 3-D mesh generator, see site:
http://tetgen.berlios.de/ -
TRIANGLE_FF: Triangle is a 2-D mesh generator, see site:
http://www.cs.cmu.edu/~quake/triangle.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. -
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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.
- Parameters
-
[in] file Name of a file written in the Bamg format.
- Note
- Bamg is a 2-D mesh generator. It allows to construct adapted meshes from a given metric. It was developed at INRIA, France. Available information can be found in the site:
http://raweb.inria.fr/rapportsactivite/RA2002/gamma/uid25.html
- Parameters
-
[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.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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.
- Parameters
-
[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.nandfile.sproduced by Easymesh.
- Note
- Easymesh is a free program that generates 2-D, unstructured, Delaunay and constrained Delaunay triangulations in general domains. It can be downloaded from the site:
http://www-dinma.univ.trieste.it/nirftc/research/easymesh/Default.htm
- Parameters
-
[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.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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.
- Note
- Gambit is a commercial mesh generator associated to the CFD code Fluent. Informations about Gambit can be found in the site:
http://www.fluent.com/software/gambit/
- Parameters
-
[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.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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.
- Note
- Gmsh is a free mesh generator that can be downloaded from the site:
http://www.geuz.org/gmsh/
- Parameters
-
[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.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| void getMatlab | ( | string | file, |
| Mesh & | mesh, | ||
| size_t | nb_dof = 1 |
||
| ) |
Construct an instance of class Mesh from a Matlab mesh data.
- Note
- Matlab is a language of scientific computing including visualization. It is developed by MathWorks. Available information can be found in the site:
http://www.mathworks.com/products/matlab/
- Parameters
-
[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.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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.
- Note
- Netgen is a tetrahedral mesh generator that can be downloaded from the site:
http://www.hpfem.jku.at/netgen/
- Parameters
-
[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 ]
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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.
- Note
- Tetgen is a free three-dimensional mesh generator that can be downloaded in the site:
http://tetgen.berlios.de/
- Parameters
-
[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.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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.
- Note
- TRIANGLE is a C program that can generate meshes, Delaunay triangulations and Voronoi diagrams for 2D pointsets that can be downloaded in the site:
http://people.scs.fsu.edu/~burkardt/c_src/triangle/triangle.html/
- Parameters
-
[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.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| void saveMesh | ( | const string & | file, |
| const Mesh & | mesh, | ||
| ExternalFileFormat | form | ||
| ) |
This function saves mesh data a file for a given external format.
- Parameters
-
[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: -
GMSH: Mesh generator and graphical postprocessor Gmsh:http://www.geuz.org/gmsh/ -
GNUPLOT: Well known graphics software:http://www.gnuplot.info/ -
MATLAB: Matlab file:http://www.mathworks.com/products/matlab/ -
TECPLOT: Commercial graphics software:http://www.tecplot.com -
VTK: Graphics format for the free postprocessor ParaView:http://public.kitware.com/VTK/
-
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| void saveGmsh | ( | const string & | file, |
| const Mesh & | mesh | ||
| ) |
This function outputs a Mesh instance in a file in Gmsh format.
- Note
- Gmsh is a free mesh generator that can be downloaded from the site: http://www.geuz.org/gmsh/
- Parameters
-
[out] file Output file in Gmsh format. [in] mesh Mesh instance to save.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| void saveGnuplot | ( | const string & | file, |
| const Mesh & | mesh | ||
| ) |
This function outputs a Mesh instance in a file in Gmsh format.
- Note
- 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/
- Parameters
-
[out] file Output file in Gnuplot format. [in] mesh Mesh instance to save.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| void saveMatlab | ( | const string & | file, |
| const Mesh & | mesh | ||
| ) |
This function outputs a Mesh instance in a file in Matlab format.
- Note
- Matlab is a language of scientific computing including visualization. It is developed by MathWorks. Available information can be found in the site:
http://www.mathworks.com/products/matlab/
- Parameters
-
[out] file Output file in Matlab format. [in] mesh Mesh instance to save.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| void saveTecplot | ( | const string & | file, |
| const Mesh & | mesh | ||
| ) |
This function outputs a Mesh instance in a file in Tecplot format.
- Note
- Tecplot is high quality post graphical commercial processing program developed by Amtec. Available information can be found in the site:
http://www.tecplot.com
- Parameters
-
[out] file Output file in Tecplot format. [in] mesh Mesh instance to save.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| void saveVTK | ( | const string & | file, |
| const Mesh & | mesh | ||
| ) |
This function outputs a Mesh instance in a file in VTK format.
- Note
- 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/
- Parameters
-
[out] file Output file in VTK format. [in] mesh Mesh instance to save.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| void saveBamg | ( | const string & | file, |
| Mesh & | mesh | ||
| ) |
This function outputs a Mesh instance in a file in Bamg format.
- Parameters
-
[in] file Name of a file written in the Bamg format.
- Note
- Bamg is a 2-D mesh generator. It allows to construct adapted meshes from a given metric. It was developed at INRIA, France. Available information can be found in the site:
http://raweb.inria.fr/rapportsactivite/RA2002/gamma/uid25.html
- Parameters
-
[in] mesh Mesh instance.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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.nosp@m.nkd@.nosp@m.cda.m.nosp@m.rs.u.nosp@m.mn.ed.nosp@m.u) in 1994.
- Parameters
-
[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.
- Note
- Condition:
n+2>t(No curve results ifn+2<=t) Control vector contains the number of points specified bynOutput array is the proper size to holdnum_outputpoint structures
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| void banner | ( | const string & | prog = " " | ) |
Outputs a banner as header of any developed program.
- Parameters
-
[in] prog Calling program name. Enables writing a copyright notice accompanying the program.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| void QuickSort | ( | std::vector< T_ > & | a, |
| int | begin, | ||
| int | end | ||
| ) |
Function to sort a vector.
qksort uses the famous quick sorting algorithm.
- Parameters
-
[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_
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| void qksort | ( | std::vector< T_ > & | a, |
| int | begin, | ||
| int | end | ||
| ) |
Function to sort a vector.
qksort uses the famous quick sorting algorithm.
- Parameters
-
[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)
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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.
- Parameters
-
[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.
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
| 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_>
| void Xpy | ( | const vector< T_ > & | x, |
| vector< T_ > & | y | ||
| ) |
Add vector x to y
x and y are instances of class vector<T_>
| 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_>
Multiply vector x by a and add result to y
x and y are instances of class Vect<T_>
| 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>
| void clear | ( | vector< T_ > & | v | ) |
Assign 0 to all entries of a vector.
- Parameters
-
[in] v Vector to clear
| void clear | ( | Vect< T_ > & | v | ) |
Assign 0 to all entries of a vector.
- Parameters
-
[in] v Vector to clear
Return 2-norm of array x
- Parameters
-
[in] n is Array length [in] x Array to treat
| 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