AbsVect Class Template Reference
[Vector and Matrix]
#include <AbsVect.h>

Detailed Description
template<class T_>
class OFELI::AbsVect< T_ >
This is a template abstract class from which inherit finite element oriented vectors.
Template Argument :
- T_ data type (double, float, ...)
Public Member Functions | |
| AbsVect (Vect< T_ > &v) | |
| Construct vector from instance of class Vect. | |
| AbsVect (const class Mesh &mesh, size_t nb_dof, size_t first_dof, const string &name, double time=0) | |
| Constructor using a Vect instance with selecting of some components. | |
| AbsVect (const class Mesh &mesh, const string &name=" ", double time=0) | |
| Constructor that initializes vector using mesh data and number of DOF. | |
| AbsVect (const class Mesh &mesh, size_t nb_dof, const string &name, double time=0) | |
| Constructor using mesh, number of DOF, field name and time. | |
| AbsVect (const class Mesh &mesh, size_t nb_dof=1) | |
| Constructor that initializes vector using mesh data and number of DOF. | |
| AbsVect () | |
| Default constructor. | |
| void | BGet (const string &file) |
| Read vector from binary FDF file. | |
| void | BPut (const string &file) |
| Store vector in a binary output file. | |
| void | Copy (valarray< T_ > &v) |
| Copy the object to a valarray (or Vect) instance. | |
| void | Fill (const valarray< T_ > &v, size_t dof=0) |
| Copy a vector as a component of the AbsVect. | |
| char * | getBinary () |
| Return stored vector as pointer to a string. | |
| int | getField () const |
| Return field identifier. | |
| size_t | getLength () const |
| Return number of stored terms in vector. | |
| double | getMax (size_t j) const |
| Calculate maximum absolute value for a given DOF. | |
| const Mesh & | getMesh () const |
| Return mesh instance. | |
| double | getMin (size_t j) const |
| Calculate minimum absolute value for a given DOF. | |
| const string & | getName () const |
| Return vector's name. | |
| size_t | getNbDOF () const |
| Return number of degrees of freedom (DOF). | |
| size_t | getNbX () const |
| Return what will stand for number of nodes, elements or sides. | |
| double | getNorm2 (size_t j) const |
| Calculate 2-norm for a given DOF. | |
| double | getNorm2 () const |
| Calculate 2-norm (Euclidean norm). | |
| double | getNormMax (size_t j) const |
| Calculate Infinite norm for a given DOF. | |
| double | getNormMax () const |
| Calculate Infinite norm. | |
| double | getTime () const |
| Return vector's time. | |
| Vect< T_ > & | getVect () |
| Return contents of vector as instance of Vect. | |
| double | getWNorm2 (size_t j) const |
| Calculate weighted 2-norm for a given DOF. | |
| double | getWNorm2 () const |
| Calculate weighted 2-norm. | |
| virtual void | insertBC (const Vect< T_ > &v, const Vect< T_ > &bc) |
| Insert boundary conditions in current vector instance. | |
| T_ | operator() (size_t i, size_t j=1, size_t k=1) const |
| Operator () (Constant version). | |
| T_ & | operator() (size_t i, size_t j=1, size_t k=1) |
| Operator () (Non constant version). | |
| AbsVect< T_ > & | operator*= (T_ a) |
| Operator *=. | |
| AbsVect< T_ > & | operator+= (const AbsVect< T_ > &v) |
| Operator +=. | |
| AbsVect< T_ > & | operator+= (T_ a) |
| Operator +=. | |
| AbsVect< T_ > & | operator-= (const AbsVect< T_ > &v) |
| Operator -=. | |
| AbsVect< T_ > & | operator-= (T_ a) |
| Operator -=. | |
| AbsVect< T_ > & | operator/= (T_ a) |
| Operator /=. | |
| AbsVect< T_ > & | operator= (const valarray< T_ > &v) |
| Operator =. | |
| AbsVect< T_ > & | operator= (const AbsVect< T_ > &v) |
| Operator =. | |
| void | selectDOF (size_t dof) |
| Select DOF to treat. | |
| void | setBinary (char *s) |
| Assign vector entries by values stored in string pointer. | |
| void | setLength (size_t n) |
| Set number of stored terms in vector. | |
| virtual void | setMesh (const class Mesh &ms, size_t nb_dof=0)=0 |
| Define mesh. | |
| void | setName (const string &name) |
| Define vector's name. | |
| void | setNbDOF (int n) |
| Set number of degrees of freedom (DOF). | |
| void | setTime (double time) |
| Define vector's time. | |
| void | unselectDOF () |
| Unselect all DOF. | |
| virtual | ~AbsVect () |
| Destructor. | |
Constructor & Destructor Documentation
| AbsVect | ( | ) |
Default constructor.
Initializes a zero size vector.
Constructor that initializes vector using mesh data and number of DOF.
- Parameters:
-
[in] mesh Mesh instance to use. [in] nb_dof Number of degrees of freedom (DOF) per node (or element, side, ...) to store in vector. Its default value is 1.
Constructor using mesh, number of DOF, field name and time.
- Parameters:
-
[in] mesh Mesh instance to use. [in] nb_dof Number of degrees of freedom (DOF) per node (or element, side, ...) to store in vector. Its default value is 1. [in] name Name to give to vector. [in] time Time value associated to vector (Default value is 0).
Constructor that initializes vector using mesh data and number of DOF.
- Parameters:
-
[in] mesh Mesh instance to use. [in] name Name to give to the vector (Default value is " "). [in] time Time value associated to vector (Default value is 0).
References Mesh::getNbDOF().
| AbsVect | ( | const class Mesh & | mesh, | |
| size_t | nb_dof, | |||
| size_t | first_dof, | |||
| const string & | name, | |||
| double | time = 0 | |||
| ) |
Constructor using a Vect instance with selecting of some components.
- Parameters:
-
[in] mesh Mesh instance to use. [in] nb_dof Number of degrees of freedom (DOF) per node. (or element, side, ...) to store in vector. Its default value is 1. [in] first_dof Label of first DOF to store in vector (To store DOFs 3 to the last one for instance, choose first_dof=3).[in] name Name to give to vector. [in] time Time value associated to vector (Default value is 0).
Member Function Documentation
| void BGet | ( | const string & | file | ) |
| void BPut | ( | const string & | file | ) |
Store vector in a binary output file.
The same file can be read with member function BGet.
- Parameters:
-
[in] file FDF file name
| void Copy | ( | valarray< T_ > & | v | ) |
Copy the object to a valarray (or Vect) instance.
- Parameters:
-
[in] v vector (as instance of valarray) to copy from.
| void Fill | ( | const valarray< T_ > & | v, | |
| size_t | dof = 0 | |||
| ) |
Copy a vector as a component of the AbsVect.
- Parameters:
-
[in] v vector (as instance of valarray) to copy from. [in] dof label of DOF to copy. If dof=0 (default value), the whole vector is copied
| char * getBinary | ( | ) |
Return stored vector as pointer to a string.
This is useful to store in binary format in order to save disk space.
| int getField | ( | ) | const |
Return field identifier.
Valid only if this one was previously defined.
| double getMax | ( | size_t | j | ) | const |
Calculate maximum absolute value for a given DOF.
- Parameters:
-
[in] j DOF label
References OFELI::Max().
| double getMin | ( | size_t | j | ) | const |
Calculate minimum absolute value for a given DOF.
- Parameters:
-
[in] j DOF label
References OFELI::Min().
| size_t getNbX | ( | ) | const |
Return what will stand for number of nodes, elements or sides.
This is valid if an abstract pointer is used.
| double getNorm2 | ( | size_t | j | ) | const |
Calculate 2-norm for a given DOF.
- Parameters:
-
[in] j DOF label
| double getNormMax | ( | size_t | j | ) | const |
| double getWNorm2 | ( | size_t | j | ) | const |
Calculate weighted 2-norm for a given DOF.
Weighted norm is the 2-norm (euclidean) divided by the square root by vector size.
- Parameters:
-
[in] j DOF label
References AbsVect::getNorm2().
| double getWNorm2 | ( | ) | const |
Calculate weighted 2-norm.
Weighted norm is the 2-norm (euclidean) divided by the square root by vector size.
References AbsVect::getNorm2().
Insert boundary conditions in current vector instance.
- Parameters:
-
[in] v Original vector without imposed values [in] bc Vector containing values to impose
Reimplemented in NodeVect.
| T_ operator() | ( | size_t | i, | |
| size_t | j = 1, |
|||
| size_t | k = 1 | |||
| ) | const |
Operator () (Constant version).
v(i,j,k) is the value for node (or element or size) i, component j, DOF k.
| T_ & operator() | ( | size_t | i, | |
| size_t | j = 1, |
|||
| size_t | k = 1 | |||
| ) |
Operator () (Non constant version).
v(i,j,k) is the value for node (or element or size) i, component j, DOF k.
| AbsVect< T_ > & operator*= | ( | T_ | a | ) |
Operator *=.
Multiply all vector entries by constant a.
- Parameters:
-
[in] a Value by which the vector is multiplied
Operator +=.
- Parameters:
-
[in] v Vector to add.
| AbsVect< T_ > & operator+= | ( | T_ | a | ) |
Operator +=.
Add to all vector entries constant value a.
- Parameters:
-
[in] a Value to add to vector entries
Operator -=.
- Parameters:
-
[in] v Vector to subtract.
| AbsVect< T_ > & operator-= | ( | T_ | a | ) |
Operator -=.
Subtract constant a from vector entries.
- Parameters:
-
[in] a Value to subtract from vector entries
| AbsVect< T_ > & operator/= | ( | T_ | a | ) |
Operator /=.
Divide all vector entries by constant a.
- Parameters:
-
[in] a Value by which the vector is divided
| AbsVect< T_ > & operator= | ( | const valarray< T_ > & | v | ) |
Operator =.
- Parameters:
-
[in] v Vector (valarray instance) to copy.
Operator =.
- Parameters:
-
[in] v Vector to copy from.
| void setBinary | ( | char * | s | ) |
Assign vector entries by values stored in string pointer.
To be used in connection with binary storage
| virtual void setMesh | ( | const class Mesh & | ms, | |
| size_t | nb_dof = 0 | |||
| ) | [pure virtual] |
Define mesh.
- Parameters:
-
[in] ms Mesh instance from which information is extracted. [in] nb_dof Number of DOF per node (Default value yields the number of DOF obtained from mesh)
Implemented in ElementVect, NodeVect, SideVect, and ElementVect< double >.
| void setName | ( | const string & | name | ) |
Define vector's name.
- Parameters:
-
[in] name Given name
Referenced by NodeVect::get(), ElementVect::get(), and OFELI::operator>>().
| void setTime | ( | double | time | ) |