Class documentation of Concepts

Loading...
Searching...
No Matches
concepts::ElementMatrix< F > Class Template Reference

#include <element.hh>

Inheritance diagram for concepts::ElementMatrix< F >:
concepts::ElementMatrixBase< F > concepts::DenseMatrix< F >

Public Types

typedefvalue_type
 

Public Member Functions

 ElementMatrix (const uint m=0, const uint n=0)
 
 ElementMatrix (const uint m, const uint n, const F *data)
 
ElementMatrix< F > & operator= (const ElementMatrixBase< F > &A)
 Assignement operator.
 
void add (const ElementMatrix< F > &A, uint offm=0, uint offn=0)
 Addition of another element matrix with possible offset.
 
const F & operator() (const uint i, const uint j) const
 Returns element (i, j)
 
F & operator() (const uint i, const uint j)
 
template<class G >
ElementMatrix< F > & operator= (const ElementMatrix< G > &other)
 
virtual ElementMatrix< F > & operator= (const F &v)
 
virtual void resize (uint m, uint n)
 
template<uint dim>
void writeColumn (uint col, const Point< F, dim > &val)
 Writes a vector to a column in case of m() >= dim.
 
void writeColumn (uint col, const Array< F > &val)
 Writes an array to a column.
 
void writeColumn (uint col, const F val)
 Writes a value to a column in case of m() >= 1.
 
bool transpose ()
 
void setTranspose (bool t)
 
int getIndex () const
 
void setIndex (int i)
 
void zeros ()
 Fills the matrix with zeros.
 
 operator F* ()
 Returns a pointer to the data array.
 
ElementMatrix< F > & operator*= (const F n)
 Scaling operator.
 
uint row () const
 Returns current row.
 
uint col () const
 Returns current column.
 
void compress (const Real threshold=EPS)
 
std::ostream & info (std::ostream &os) const
 
uint m () const
 Returns the number of rows.
 
uint n () const
 Returns the number of columns.
 
uint size () const
 Returns the number of entries in the matrix.
 
 operator const F * () const
 Returns a pointer to the data array.
 
const Array< F > & getData () const
 Returns the data array

 
bool isTranspose () const
 
bool storeMatlab (const std::string filename, std::string name="", bool append=false) const
 

Protected Attributes

Array< F > data_
 Data.
 
uint m_
 Number of rows.
 
uint n_
 Number of columns.
 
bool t_
 Transpose.
 

Detailed Description

template<class F>
class concepts::ElementMatrix< F >

Element matrix. This class stores the element matrix computed by a bilinear form. These matrices are assembled in a later step.

Author
Philipp Frauenfelder, 2001
Examples
linearFEM1d-simple.cc, and linearFEM1d.cc.

Definition at line 206 of file element.hh.

Member Typedef Documentation

◆ value_type

template<class F >
typedef F concepts::ElementMatrix< F >::value_type

Definition at line 208 of file element.hh.

Constructor & Destructor Documentation

◆ ~ElementMatrix()

template<class F >
virtual concepts::ElementMatrix< F >::~ElementMatrix ( )
inlinevirtual

Definition at line 214 of file element.hh.

Member Function Documentation

◆ col()

template<class F >
uint concepts::ElementMatrix< F >::col ( ) const
inline

Returns current column.

Definition at line 309 of file element.hh.

◆ compress()

template<class F >
void concepts::ElementMatrix< F >::compress ( const Real  threshold = EPS)

Compresses the matrix by dropping small entries. All matrix entries which are smaller than a certain threshold times the largest entry of the matrix are deleted from the matrix.

◆ getData()

template<class F >
const Array< F > & concepts::ElementMatrixBase< F >::getData ( ) const
inlineinherited

Returns the data array

Definition at line 172 of file element.hh.

◆ getIndex()

template<class F >
int concepts::ElementMatrix< F >::getIndex ( ) const
inline
Deprecated:
: FIXME: what the heck is this even for?

Definition at line 289 of file element.hh.

◆ isTranspose()

template<class F >
bool concepts::ElementMatrixBase< F >::isTranspose ( ) const
inlineinherited

Returns true if the matrix is internally stored as transposed (column-major).

Definition at line 177 of file element.hh.

◆ m()

template<class F >
uint concepts::ElementMatrixBase< F >::m ( ) const
inlineinherited

Returns the number of rows.

Definition at line 151 of file element.hh.

◆ n()

template<class F >
uint concepts::ElementMatrixBase< F >::n ( ) const
inlineinherited

Returns the number of columns.

Definition at line 153 of file element.hh.

◆ operator const F *()

template<class F >
concepts::ElementMatrixBase< F >::operator const F * ( ) const
inlineinherited

Returns a pointer to the data array.

Definition at line 169 of file element.hh.

◆ operator F*()

template<class F >
concepts::ElementMatrix< F >::operator F* ( )
inline

Returns a pointer to the data array.

Definition at line 298 of file element.hh.

◆ operator()() [1/2]

template<class F >
F & concepts::ElementMatrix< F >::operator() ( const uint  i,
const uint  j 
)
inline

Definition at line 225 of file element.hh.

◆ operator()() [2/2]

template<class F >
const F & concepts::ElementMatrix< F >::operator() ( const uint  i,
const uint  j 
) const
inline

Returns element (i, j)

Definition at line 222 of file element.hh.

◆ operator*=()

template<class F >
ElementMatrix< F > & concepts::ElementMatrix< F >::operator*= ( const F  n)
inline

Scaling operator.

Definition at line 301 of file element.hh.

◆ operator=() [1/2]

template<class F >
template<class G >
ElementMatrix< F > & concepts::ElementMatrix< F >::operator= ( const ElementMatrix< G > &  other)
inline

can be used to upcast ElementMatrix<Real> to ElementMatrix<Cmplx>

Definition at line 236 of file element.hh.

◆ operator=() [2/2]

template<class F >
virtual ElementMatrix< F > & concepts::ElementMatrix< F >::operator= ( const F &  v)
inlinevirtual

Definition at line 246 of file element.hh.

◆ resize()

template<class F >
virtual void concepts::ElementMatrix< F >::resize ( uint  m,
uint  n 
)
virtual

Sets a new size.

Previous data might be lost. The internal storage is set to the default row-major order.

Reimplemented in concepts::DenseMatrix< F >.

Examples
linearFEM1d-simple.cc, and linearFEM1d.cc.

◆ row()

template<class F >
uint concepts::ElementMatrix< F >::row ( ) const
inline

Returns current row.

Definition at line 307 of file element.hh.

◆ setIndex()

template<class F >
void concepts::ElementMatrix< F >::setIndex ( int  i)
inline
Deprecated:
: FIXME: what the heck is this even for?

Definition at line 292 of file element.hh.

◆ setTranspose()

template<class F >
void concepts::ElementMatrix< F >::setTranspose ( bool  t)
inline

Sets the transpose status to t.

This does not anything if the matrix had the transpose status already. Otherwise, the dimensions are interchanged and the internal storage changes from row-major two column-major order or vice-versa.

Definition at line 286 of file element.hh.

◆ size()

template<class F >
uint concepts::ElementMatrixBase< F >::size ( ) const
inlineinherited

Returns the number of entries in the matrix.

Definition at line 166 of file element.hh.

◆ storeMatlab()

template<class F >
bool concepts::ElementMatrixBase< F >::storeMatlab ( const std::string  filename,
std::string  name = "",
bool  append = false 
) const
inherited

Stores the matrix in a Matlab matrix

Parameters
filenamename of the matlab file, with ending '.m'
namename of the variable, e.g. "A"
appendif false, create new file, otherwise append to it
Returns
true if the writes was successfull

◆ transpose()

template<class F >
bool concepts::ElementMatrix< F >::transpose ( )
inline

Transposes the matrix.

Only the dimensions are interchanged, the data is not touched, but the internal storage changes from row-major two column-major order or vice-versa.

Deprecated:
use isTranspose() and setTranspose()

Definition at line 277 of file element.hh.

◆ writeColumn()

template<class F >
template<uint dim>
void concepts::ElementMatrix< F >::writeColumn ( uint  col,
const Point< F, dim > &  val 
)

Writes a vector to a column in case of m() >= dim.

Definition at line 326 of file element.hh.

◆ zeros()

template<class F >
void concepts::ElementMatrix< F >::zeros ( )
inline

Fills the matrix with zeros.

Examples
linearFEM1d-simple.cc, and linearFEM1d.cc.

Definition at line 295 of file element.hh.

Member Data Documentation

◆ data_

template<class F >
Array<F> concepts::ElementMatrixBase< F >::data_
protectedinherited

Data.

Definition at line 189 of file element.hh.

◆ m_

template<class F >
uint concepts::ElementMatrixBase< F >::m_
protectedinherited

Number of rows.

Definition at line 191 of file element.hh.

◆ n_

template<class F >
uint concepts::ElementMatrixBase< F >::n_
protectedinherited

Number of columns.

Definition at line 193 of file element.hh.

◆ t_

template<class F >
bool concepts::ElementMatrixBase< F >::t_
protectedinherited

Transpose.

Definition at line 195 of file element.hh.


The documentation for this class was generated from the following files: