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

Detailed Description
template<class T_>
class OFELI::BCVect< T_ >
To treat vectors that contain imposed boundary conditions.
This template class stores a vector that may contain imposed boundary conditions at components where they are to be imposed.
Template Argument :
- T_ data type (double, float, ...)
Public Member Functions | |
| void | Assembly (const Side *sd, T_ *b) |
| Assembly of side vector (as C-array) into Vect instance. | |
| void | Assembly (const Side *sd, const Vect< T_ > &b) |
| Assembly of side vector into Vect instance. | |
| void | Assembly (const Element *el, const T_ *b) |
| Assembly of element vector (as C-array) into Vect instance. | |
| void | Assembly (const Element *el, const Vect< T_ > &b) |
| Assembly of element vector into current instance. | |
| BCVect (const NodeVect< T_ > &v) | |
| Constructor using a NodeVect instance. | |
| BCVect (const Vect< T_ > &v) | |
| Constructor using a (parent) Vect instance. | |
| BCVect (const BCVect< T_ > &v) | |
| Copy constructor. | |
| BCVect (size_t n, T_ *x) | |
| Constructor using initializing vector by a C-array. | |
| BCVect (size_t dim) | |
| Constructor setting vector size. | |
| BCVect () | |
| Default constructor. | |
| void | From (const SideVect< T_ > &v, size_t nb_dof=0, size_t first_dof=1) |
| Fill vector with a SideVect instance. | |
| void | From (const ElementVect< T_ > &v, size_t nb_dof=0, size_t first_dof=1) |
| Fill vector with a ElementVect instance. | |
| void | From (const NodeVect< T_ > &v, size_t nb_dof=0, size_t first_dof=1) |
| Fill vector with a NodeVect instance. | |
| double | getNorm1 () const |
| Calculate 1-norm of vector. | |
| double | getNorm2 () const |
| Calculate 2-norm (Euclidean norm) of vector. | |
| double | getNormMax () const |
| Calculate Max-norm (Infinite norm) of vector. | |
| size_t | getNx () const |
| Return number of grid points in the x-direction if grid indexing is set. | |
| size_t | getNy () const |
| Return number of grid points in the y-direction if grid indexing is set. | |
| size_t | getNz () const |
| Return number of grid points in the z-direction if grid indexing is set. | |
| void | getPrintView (size_t &imin, size_t &imax) const |
| Return window data for vector printing. | |
| size_t | getSize () const |
| Return vector size. | |
| double | getWNorm1 () const |
| Calculate weighted 1-norm of vector (1-Norm divided by size). | |
| double | getWNorm2 () const |
| Calculate weighted 2-norm of vector (2-Norm divided by sqrt(size)). | |
| void | insertBC (const class Mesh &m, const Vect< T_ > &v) |
| Insert boundary conditions. | |
| void | insertBC (const class Mesh &m, const Vect< T_ > &v, const Vect< T_ > &bc) |
| Insert boundary conditions. | |
| Vect< T_ > & | MultAdd (const Vect< T_ > &x, const T_ &a) |
| Multiply by a constant then add to a vector. | |
| T_ | operator() (size_t i, size_t j, size_t k) const |
| Operator () with triple indexing (Constant version). | |
| T_ & | operator() (size_t i, size_t j, size_t k) |
| Operator () with triple indexing (Non constant version). | |
| T_ | operator() (size_t i, size_t j) const |
| Operator () with double indexing (Constant version). | |
| T_ & | operator() (size_t i, size_t j) |
| Operator () with double indexing (Non constant version, case of a grid vector). | |
| T_ | operator() (size_t i) const |
| Operator () (Constant version). | |
| T_ & | operator() (size_t i) |
| Operator () (Non constant version). | |
| Vect< T_ > & | operator*= (const T_ &a) |
| Operator operator*=. | |
| Vect< T_ > & | operator+= (const T_ &a) |
| Operator +=. | |
| Vect< T_ > & | operator+= (const Vect< T_ > &x) |
| Operator +=. | |
| Vect< T_ > & | operator-= (const T_ &a) |
| Operator -=. | |
| Vect< T_ > & | operator-= (const Vect< T_ > &x) |
| Operator -=. | |
| Vect< T_ > & | operator/= (const T_ &a) |
| Operator operator/=. | |
| void | removeBC (const class Mesh &m, NodeVect< T_ > *v) |
| Remove boundary conditions. | |
| void | removeBC (const class Mesh &m, const Vect< T_ > &v) |
| Remove boundary conditions. | |
| void | setPrintView (size_t imin, size_t imax) |
| set a window for vector printing | |
| void | setSize (size_t nx, size_t ny, size_t nz) |
| Set vector size (structured 3-D case). | |
| void | setSize (size_t nx, size_t ny) |
| Set vector size (structured 2-D case). | |
| void | setSize (size_t size) |
| Set vector size. | |
| void | transferBC (const class Mesh &m, const Vect< T_ > &bc) |
| Transfer boundary conditions to the vector. | |
| ~BCVect () | |
| Destructor. | |
Constructor & Destructor Documentation
| BCVect | ( | size_t | dim | ) |
Constructor setting vector size.
- Parameters:
-
[in] dim vector size to set
| BCVect | ( | size_t | n, | |
| T_ * | x | |||
| ) |
Constructor using initializing vector by a C-array.
- Parameters:
-
[in] n Vector size [in] x C-array containing values to copy
Member Function Documentation
| void Assembly | ( | const Side * | sd, | |
| T_ * | b | |||
| ) | [inherited] |
Assembly of side vector (as C-array) into Vect instance.
- Parameters:
-
[in] sd Pointer to side [in] b Local vector to assemble (C-Array)
References Node::getDOF(), Node::getNbDOF(), Side::getNbNodes(), and Side::getPtrNode().
Assembly of side vector into Vect instance.
- Parameters:
-
[in] sd Pointer to side [in] b Local vector to assemble (Instance of class Vect)
References Node::getDOF(), Node::getNbDOF(), Side::getNbNodes(), and Side::getPtrNode().
| void Assembly | ( | const Element * | el, | |
| const T_ * | b | |||
| ) | [inherited] |
Assembly of element vector (as C-array) into Vect instance.
- Parameters:
-
[in] el Pointer to element [in] b Local vector to assemble (C-Array)
References Node::getDOF(), Node::getNbDOF(), Element::getNbNodes(), and Element::getPtrNode().
Assembly of element vector into current instance.
- Parameters:
-
[in] el Pointer to element [in] b Local vector to assemble (Instance of class Vect)
References Node::getDOF(), Node::getNbDOF(), Element::getNbNodes(), and Element::getPtrNode().
| void From | ( | const SideVect< T_ > & | v, | |
| size_t | nb_dof = 0, |
|||
| size_t | first_dof = 1 | |||
| ) | [inherited] |
Fill vector with a SideVect instance.
- Parameters:
-
[in] v SideVect instance to extract from [in] nb_dof Number of DOF per side [in] first_dof First DOF to extract For instance, a choice first_dof=2 and nb_dof=1 means that the second DOF of each side is copied in the vector
References AbsVect::getNbDOF(), and SideVect::getNbSides().
| void From | ( | const ElementVect< T_ > & | v, | |
| size_t | nb_dof = 0, |
|||
| size_t | first_dof = 1 | |||
| ) | [inherited] |
Fill vector with a ElementVect instance.
- Parameters:
-
[in] v ElementVect instance to extract from [in] nb_dof Number of DOF per element [in] first_dof First DOF to extract For instance, a choice first_dof=2 and nb_dof=1 means that the second DOF of each element is copied in the vector
References AbsVect::getNbDOF(), and ElementVect::getNbElements().
| void From | ( | const NodeVect< T_ > & | v, | |
| size_t | nb_dof = 0, |
|||
| size_t | first_dof = 1 | |||
| ) | [inherited] |
Fill vector with a NodeVect instance.
- Parameters:
-
[in] v NodeVect instance to extract from [in] nb_dof Number of DOF per node [in] first_dof First DOF to extract For instance, a choice first_dof=2 and nb_dof=1 means that the second DOF of each node is copied in the vector
References AbsVect::getNbDOF(), and NodeVect::getNbNodes().
Referenced by Vect::Vect().
| void getPrintView | ( | size_t & | imin, | |
| size_t & | imax | |||
| ) | const [inherited] |
Return window data for vector printing.
- Parameters:
-
[out] imin first vector index to view [out] imax last vector index to view
Referenced by OFELI::operator<<().
Insert boundary conditions.
DOF with imposed boundary conditions are set to zero.
- Parameters:
-
[in] m Mesh instance. [in] v Vect instance from which free degrees of freedom are copied to current instance.
References Side::getCode(), Node::getCode(), Side::getDOF(), Node::getDOF(), Side::getNbDOF(), Node::getNbDOF(), Mesh::getNode(), Mesh::getSide(), Mesh::NodesAreDOF(), Mesh::SidesAreDOF(), Mesh::topNode(), and Mesh::topSide().
Insert boundary conditions.
- Parameters:
-
[in] m Mesh instance. [in] v Vect instance from which free degrees of freedom are copied to current instance. [in] bc Vect instance from which imposed degrees of freedom are copied to current instance.
References Side::getCode(), Node::getCode(), Side::getDOF(), Node::getDOF(), Side::getNbDOF(), Node::getNbDOF(), Mesh::getNode(), Mesh::getSide(), Mesh::NodesAreDOF(), Mesh::SidesAreDOF(), Mesh::topNode(), and Mesh::topSide().
Multiply by a constant then add to a vector.
- Parameters:
-
[in] x Vector to add [in] a Constant to multiply before adding
| T_ operator() | ( | size_t | i, | |
| size_t | j, | |||
| size_t | k | |||
| ) | const [inherited] |
Operator () with triple indexing (Constant version).
| T_ & operator() | ( | size_t | i, | |
| size_t | j, | |||
| size_t | k | |||
| ) | [inherited] |
Operator () with triple indexing (Non constant version).
| T_ operator() | ( | size_t | i, | |
| size_t | j | |||
| ) | const [inherited] |
| T_ & operator() | ( | size_t | i, | |
| size_t | j | |||
| ) | [inherited] |
| T_ operator() | ( | size_t | i | ) | const [inherited] |
Operator () (Constant version).
- Parameters:
-
[in] i Rank index in vector (starts at 1) - v(i) starts at v(1) to v(size()).
- v(i) is the same element as v[i-1]
| T_ & operator() | ( | size_t | i | ) | [inherited] |
Operator () (Non constant version).
- Parameters:
-
[in] i Rank index in vector (starts at 1) - v(i) starts at v(1) to v(size())
- v(i) is the same element as v[i-1]
| Vect< T_ > & operator*= | ( | const T_ & | a | ) | [inherited] |
Operator operator*=.
- Parameters:
-
[in] a Value to multiply by
| Vect< T_ > & operator+= | ( | const T_ & | a | ) | [inherited] |
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
| Vect< T_ > & operator-= | ( | const T_ & | a | ) | [inherited] |
Operator -=.
Subtract constant from vector entries.
- Parameters:
-
[in] a Value to subtract from
Operator -=.
- Parameters:
-
[in] x Vector to subtract from
| Vect< T_ > & operator/= | ( | const T_ & | a | ) | [inherited] |
Operator operator/=.
- Parameters:
-
[in] a Value to divide by
Remove boundary conditions.
This member function copies to current vector a vector where only non imposed DOF are retained.
References Mesh::getNbDOF(), Mesh::getNode(), and Mesh::topNode().
Remove boundary conditions.
This member function copies to current vector a vector where only non imposed DOF are retained.
References Node::getCode(), Node::getDOF(), Node::getNbDOF(), Mesh::getNode(), and Mesh::topNode().
| void setPrintView | ( | size_t | imin, | |
| size_t | imax | |||
| ) | [inherited] |
set a window for vector printing
- Parameters:
-
[in] imin first vector index to view [in] imax last vector index to view
| void setSize | ( | size_t | nx, | |
| size_t | ny, | |||
| size_t | nz | |||
| ) | [inherited] |
Set vector size (structured 3-D case).
- Parameters:
-
[in] nx Number of grid points in x-direction [in] ny Number of grid points in y-direction [in] nz Number of grid points in z-direction
References OFELI::Clear().
| void setSize | ( | size_t | nx, | |
| size_t | ny | |||
| ) | [inherited] |
Set vector size (structured 2-D case).
- Parameters:
-
[in] nx Number of grid points in x-direction [in] ny Number of grid points in y-direction
References OFELI::Clear().
| void setSize | ( | size_t | size | ) | [inherited] |
Set vector size.
- Parameters:
-
[in] size New size value
Transfer boundary conditions to the vector.
- Parameters:
-
[in] m Mesh instance. [in] bc Vect instance from which imposed degrees of freedom are copied to current instance.
References Side::getCode(), Node::getCode(), Side::getNbDOF(), Node::getNbDOF(), Mesh::getNode(), Mesh::getSide(), Mesh::NodesAreDOF(), Mesh::SidesAreDOF(), Mesh::topNode(), and Mesh::topSide().