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

Detailed Description
template<class T_>
class OFELI::EdgeVect< T_ >
Defines an edgewise vector.
This template class defines an edgewise vector, /e i.e. a vector where degrees of freedom for each edge are stored. The template argument is the type of vector entries. To define such vectors, the constructors require mainly mesh information. Operators =, and () are overloaded. For instance the expression v(n,i) denotes the i-th degree of freedom for edge number n.
Public Member Functions | |
| 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. | |
| EdgeVect (const EdgeVect< T_ > &v) | |
| Copy Constructor. | |
| EdgeVect (const class Mesh &mesh, size_t nb_dof, const string &name=" ", double time=0) | |
| Constructor using mesh information, number of DOF, name and time. | |
| EdgeVect (const class Mesh &mesh, size_t nb_dof=1) | |
| Constructor using mesh information and number of DOF. | |
| EdgeVect () | |
| Default constructor. Initializes a zero-size vector. | |
| 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 | getNbEdges () const |
| Return number of edges. | |
| 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 *=. | |
| EdgeVect< T_ > & | operator*= (const T_ &a) |
| Operator operator*=. | |
| AbsVect< T_ > & | operator+= (const AbsVect< T_ > &v) |
| Operator +=. | |
| AbsVect< T_ > & | operator+= (T_ a) |
| Operator +=. | |
| EdgeVect< T_ > & | operator+= (const T_ &a) |
| Operator +=. | |
| EdgeVect< T_ > & | operator+= (const EdgeVect< T_ > &x) |
| Operator +=. | |
| AbsVect< T_ > & | operator-= (const AbsVect< T_ > &v) |
| Operator -=. | |
| AbsVect< T_ > & | operator-= (T_ a) |
| Operator -=. | |
| EdgeVect< T_ > & | operator-= (const T_ &a) |
| Operator -=. | |
| EdgeVect< T_ > & | operator-= (const EdgeVect< T_ > &x) |
| Operator -=. | |
| AbsVect< T_ > & | operator/= (T_ a) |
| Operator /=. | |
| EdgeVect< T_ > & | operator/= (const T_ &a) |
| Operator operator/=. | |
| EdgeVect< T_ > & | operator= (T_ a) |
| 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 | setMesh (class Mesh &ms, size_t nb_dof=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. | |
| ~EdgeVect () | |
| Destructor. | |
Constructor & Destructor Documentation
Constructor using mesh information and number of DOF.
- Parameters:
-
[in] mesh Mesh instance from which information is extracted. [in] nb_dof Number of DOF per edge (Default value is 1).
References Mesh::getNbEdges().
Constructor using mesh information, number of DOF, name and time.
- Parameters:
-
[in] mesh Mesh instance from which information is extracted. [in] nb_dof Number of DOF per edge. [in] name Name to assign to vector instance (Default value is " "). [in] time Time value to assigne to vector instance (Default value is 0).
References Mesh::getNbEdges().
Copy Constructor.
- Parameters:
-
[in] v EdgeVect instance to copy
References AbsVect::getLength(), and EdgeVect::getNbEdges().
Member Function Documentation
| void BGet | ( | const string & | file | ) | [inherited] |
| void BPut | ( | const string & | file | ) | [inherited] |
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 | ) | [inherited] |
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 | |||
| ) | [inherited] |
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 | ( | ) | [inherited] |
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 [inherited] |
Return field identifier.
Valid only if this one was previously defined.
| double getMax | ( | size_t | j | ) | const [inherited] |
Calculate maximum absolute value for a given DOF.
- Parameters:
-
[in] j DOF label
References OFELI::Max().
| double getMin | ( | size_t | j | ) | const [inherited] |
Calculate minimum absolute value for a given DOF.
- Parameters:
-
[in] j DOF label
References OFELI::Min().
| size_t getNbX | ( | ) | const [inherited] |
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 [inherited] |
Calculate 2-norm for a given DOF.
- Parameters:
-
[in] j DOF label
| double getNormMax | ( | size_t | j | ) | const [inherited] |
| double getWNorm2 | ( | size_t | j | ) | const [inherited] |
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 [inherited] |
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 [inherited] |
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 | |||
| ) | [inherited] |
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 | ) | [inherited] |
Operator *=.
Multiply all vector entries by constant a.
- Parameters:
-
[in] a Value by which the vector is multiplied
| EdgeVect< T_ > & operator*= | ( | const T_ & | a | ) |
Operator operator*=.
- Parameters:
-
[in] a Value to multiply by
Operator +=.
- Parameters:
-
[in] v Vector to add.
| AbsVect< T_ > & operator+= | ( | T_ | a | ) | [inherited] |
Operator +=.
Add to all vector entries constant value a.
- Parameters:
-
[in] a Value to add to vector entries
| EdgeVect< T_ > & operator+= | ( | const T_ & | a | ) |
Operator +=.
Add a constant to current vector entries.
- Parameters:
-
[in] a Value to add to vector entries
Operator +=.
Add vector x to current vector instance.
- Parameters:
-
[in] x Vector to add to instance
Operator -=.
- Parameters:
-
[in] v Vector to subtract.
| AbsVect< T_ > & operator-= | ( | T_ | a | ) | [inherited] |
Operator -=.
Subtract constant a from vector entries.
- Parameters:
-
[in] a Value to subtract from vector entries
| EdgeVect< T_ > & operator-= | ( | const T_ & | a | ) |
Operator -=.
Subtract constant from vector entries.
- Parameters:
-
[in] a Value to subtract from
Operator -=.
- Parameters:
-
[in] x Vector to subtract from
| AbsVect< T_ > & operator/= | ( | T_ | a | ) | [inherited] |
Operator /=.
Divide all vector entries by constant a.
- Parameters:
-
[in] a Value by which the vector is divided
| EdgeVect< T_ > & operator/= | ( | const T_ & | a | ) |
Operator operator/=.
- Parameters:
-
[in] a Value to divide by
| EdgeVect< T_ > & operator= | ( | T_ | a | ) |
Operator =.
Assign constant value a to all vector entries.
| void setBinary | ( | char * | s | ) | [inherited] |
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, inherited] |
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 setMesh | ( | class Mesh & | ms, | |
| size_t | nb_dof = 0 | |||
| ) |
Define mesh.
- Parameters:
-
[in] ms Mesh instance from which information is extracted. [in] nb_dof Number of DOF per edge (Default value yields the number of DOF obtained from mesh)
References Edge::getNbDOF(), Mesh::getNbEdges(), and Mesh::getPtrEdge().
| void setName | ( | const string & | name | ) | [inherited] |
Define vector's name.
- Parameters:
-
[in] name Given name
Referenced by NodeVect::get(), ElementVect::get(), and OFELI::operator>>().
| void setTime | ( | double | time | ) | [inherited] |