Example codes
and tutorials
The (Not-so) Quick Guide
List of tutorials/demo codes
Single-Physics Problems
Poisson
Adaptivity illustrated for Poisson
Advection-Diffusion
Unsteady heat equation
Linear wave equation
The Young-Laplace equation
Navier-Stokes
Free-surface Navier-Stokes
Axisymmetric Navier-Stokes
Solid mechanics
Beam structures
Shell structures
Multi-physics Problems
Fluid-structure interaction
Boussinesq convection
Steady thermoelasticity
Methods-based example codes and tutorials
Mesh generation
Linear solvers and preconditioners
Visualisation of the results
Parallel processing
How to write a new element
How to write a new refineable element
Default nonlinear solvers -- the sequence of action functions
...
Documentation
FE theory and top-down discussion of the data structure
The (Not-so) Quick Guide
Comprehensive bottom-up discussion of the data structure
List of available structured and unstructured meshes
Linear solvers and preconditioners
Visualisation of the results
Parallel processing
Coding conventions and C++ style
Creating documentation
Optimisation - robustness vs. "raw speed"
Linear vs. nonlinear problems
Storing shape functions
Changing the default "full" integration scheme
Disabling the ALE formulation of unsteady equations
C vs. C++ output
Different sparse assembly techniques and the STL memory pool
Publications
Publications
Talks
Journal publications
Theses
Picture show
Download
Copyright
Download/installation instructions
Download page
FAQ & Contact
FAQ
Change log
Bugs and other known problems
Completeness of the library & our "To-Do List"
Contact the developers
Get involved

 


Beta release!

Please note that the library has not been "officially" released. While we continue to work on the documentation, these web pages are likely to contain broken links and documents in draft form. Please send an email to

oomph-lib AT maths DOT man DOT ac DOT uk

if you wish to be informed of the library's "official" release.

oomph::DenseMatrix< T > Class Template Reference

#include <matrices.h>

Inheritance diagram for oomph::DenseMatrix< T >:

oomph::Matrix< T, MATRIX_TYPE > List of all members.

Detailed Description

template<class T>
class oomph::DenseMatrix< T >

Class for dense matrices, storing all the values of the matrix as a pointer to a pointer with assorted output functions inherited from Matrix<T>. The curious recursive template pattern is used here to pass the specific class to the base class so that round bracket access can be inlined.

Definition at line 319 of file matrices.h.


Public Member Functions

 DenseMatrix ()
 Empty constructor, simply assign the lengths N and M to 0.
 DenseMatrix (const DenseMatrix &source_matrix)
 Copy constructor: Deep copy!
DenseMatrixoperator= (const DenseMatrix &source_matrix)
 Copy assignement.
T & entry (const unsigned long &i, const unsigned long &j)
 The access function that will be called by the read-write round-bracket operator.
const T & get_entry (const unsigned long &i, const unsigned long &j) const
 The access function the will be called by the read-only (const version) round-bracket operator.
 DenseMatrix (const unsigned long &n)
 Constructor to build a square n by n matrix.
 DenseMatrix (const unsigned long &n, const unsigned long &m)
 Constructor to build a matrix with n rows and m columns.
 DenseMatrix (const unsigned long &n, const unsigned long &m, const T &initial_val)
 Constructor to build a matrix with n rows and m columns, with initial value initial_val.
virtual ~DenseMatrix ()
 Destructor, clean up the matrix data.
unsigned long nrow () const
 Return the number of rows of the matrix.
unsigned long ncol () const
 Return the number of columns of the matrix.
void resize (const unsigned long &n)
void resize (const unsigned long &n, const unsigned long &m)
 Resize to a non-square n_row x m_col matrix, where any values already present will be transfered.
void resize (const unsigned long &n, const unsigned long &m, const T &initial_value)
 Resize to a non-square n_row x m_col matrix and initialize the new entries to specified value.
void initialise (const T &val)
 Initialize all values in the matrix to val.
void output (std::ostream &outfile)
 Output function to print a matrix row-by-row to the stream outfile.
void output (std::string filename)
 Output function to print a matrix row-by-row to a file. Specify filename.
void indexed_output (std::ostream &outfile)
 Indexed output as i,j,a(i,j).
void indexed_output (std::string filename)
 Indexed output function to print a matrix to a file as i,j,a(i,j). Specify filename.
void sparse_indexed_output (std::ostream &outfile)
 Sparse indexed output as i,j,a(i,j) for a(i,j)!=0 only.
void sparse_indexed_output (std::string filename)
 Indexed output function to print a matrix to a file as i,j,a(i,j) for a(i,j)!=0 only. Specify filename.

Protected Attributes

T * Matrixdata
 Internal representation of matrix as a pointer to data.
unsigned long N
 Number of rows.
unsigned long M
 Number of columns.

Constructor & Destructor Documentation

template<class T>
oomph::DenseMatrix< T >::DenseMatrix (  )  [inline]

Empty constructor, simply assign the lengths N and M to 0.

Definition at line 336 of file matrices.h.

template<class T>
oomph::DenseMatrix< T >::DenseMatrix ( const DenseMatrix< T > &  source_matrix  )  [inline]

Copy constructor: Deep copy!

Definition at line 339 of file matrices.h.

template<class T>
oomph::DenseMatrix< T >::DenseMatrix ( const unsigned long &  n  ) 

Constructor to build a square n by n matrix.

Definition at line 2526 of file matrices.h.

References oomph::DenseMatrix< T >::initialise(), oomph::DenseMatrix< T >::M, oomph::DenseMatrix< T >::Matrixdata, and oomph::DenseMatrix< T >::N.

template<class T>
oomph::DenseMatrix< T >::DenseMatrix ( const unsigned long &  n,
const unsigned long &  m 
)

Constructor to build a matrix with n rows and m columns.

Definition at line 2543 of file matrices.h.

References oomph::DenseMatrix< T >::initialise(), oomph::DenseMatrix< T >::M, oomph::DenseMatrix< T >::Matrixdata, and oomph::DenseMatrix< T >::N.

template<class T>
oomph::DenseMatrix< T >::DenseMatrix ( const unsigned long &  n,
const unsigned long &  m,
const T &  initial_val 
)

Constructor to build a matrix with n rows and m columns, with initial value initial_val.

Definition at line 2560 of file matrices.h.

References oomph::DenseMatrix< T >::initialise(), oomph::DenseMatrix< T >::M, oomph::DenseMatrix< T >::Matrixdata, and oomph::DenseMatrix< T >::N.

template<class T>
virtual oomph::DenseMatrix< T >::~DenseMatrix (  )  [inline, virtual]

Destructor, clean up the matrix data.

Definition at line 415 of file matrices.h.


Member Function Documentation

template<class T>
T& oomph::DenseMatrix< T >::entry ( const unsigned long &  i,
const unsigned long &  j 
) [inline]

The access function that will be called by the read-write round-bracket operator.

Definition at line 384 of file matrices.h.

template<class T>
const T& oomph::DenseMatrix< T >::get_entry ( const unsigned long &  i,
const unsigned long &  j 
) const [inline]

The access function the will be called by the read-only (const version) round-bracket operator.

Definition at line 394 of file matrices.h.

template<class T>
void oomph::DenseMatrix< T >::indexed_output ( std::string  filename  ) 

Indexed output function to print a matrix to a file as i,j,a(i,j). Specify filename.

Definition at line 2721 of file matrices.h.

References oomph::DenseMatrix< T >::indexed_output().

template<class T>
void oomph::DenseMatrix< T >::indexed_output ( std::ostream &  outfile  ) 

Indexed output as i,j,a(i,j).

Definition at line 2701 of file matrices.h.

References oomph::DenseMatrix< T >::M, and oomph::DenseMatrix< T >::N.

Referenced by oomph::DenseMatrix< T >::indexed_output().

template<class T>
void oomph::DenseMatrix< T >::initialise ( const T &  val  )  [inline]

Initialize all values in the matrix to val.

Definition at line 437 of file matrices.h.

Referenced by oomph::DenseMatrix< T >::DenseMatrix(), oomph::FSIDiagHermiteShellElement::dposition_dlagrangian_at_local_coordinate(), oomph::FSIHermiteBeamElement::dposition_dlagrangian_at_local_coordinate(), oomph::DGElement::get_inverse_mass_matrix_times_residuals(), oomph::Problem::get_jacobian(), oomph::GeneralisedElement::get_jacobian(), oomph::GeneralisedElement::get_jacobian_and_mass_matrix(), oomph::GeneralisedElement::get_mass_matrix(), oomph::PseudoBucklingRingElement::get_residuals_generic(), oomph::DGElement::pre_compute_mass_matrix(), and oomph::DenseMatrix< T >::resize().

template<class T>
unsigned long oomph::DenseMatrix< T >::ncol (  )  const [inline, virtual]

Return the number of columns of the matrix.

Implements oomph::Matrix< T, MATRIX_TYPE >.

Reimplemented in oomph::DenseComplexMatrix, and oomph::DenseDoubleMatrix.

Definition at line 421 of file matrices.h.

Referenced by oomph::ConstitutiveLaw::are_matrices_of_equal_dimensions(), oomph::BlockPreconditioner< MATRIX >::build_preconditioner_matrix(), oomph::ConstitutiveLaw::calculate_contravariant(), oomph::DenseMatrix< bool >::DenseMatrix(), oomph::DenseDoubleMatrix::eigenvalues_by_jacobi(), oomph::BlockPreconditioner< MATRIX >::get_blocks(), oomph::PVDEquationsBase< DIM >::get_strain(), oomph::LinearElasticityEquationsBase< DIM >::get_strain(), oomph::ConstitutiveLaw::is_matrix_square(), oomph::TimeStepper::ntstorage(), oomph::DenseMatrix< bool >::operator=(), oomph::NavierStokesEquations< DIM >::strain_rate(), and oomph::AxisymmetricNavierStokesEquations::strain_rate().

template<class T>
unsigned long oomph::DenseMatrix< T >::nrow (  )  const [inline, virtual]

Return the number of rows of the matrix.

Implements oomph::Matrix< T, MATRIX_TYPE >.

Reimplemented in oomph::DenseComplexMatrix, and oomph::DenseDoubleMatrix.

Definition at line 418 of file matrices.h.

Referenced by oomph::ConstitutiveLaw::are_matrices_of_equal_dimensions(), oomph::BlockPreconditioner< MATRIX >::build_preconditioner_matrix(), oomph::IsotropicStrainEnergyFunctionConstitutiveLaw::calculate_second_piola_kirchhoff_stress(), oomph::GeneralisedHookean::calculate_second_piola_kirchhoff_stress(), oomph::DenseMatrix< bool >::DenseMatrix(), oomph::DenseDoubleMatrix::eigenvalues_by_jacobi(), oomph::PVDEquations< DIM >::fill_in_generic_contribution_to_residuals_pvd(), oomph::RefineablePVDEquations< DIM >::fill_in_generic_contribution_to_residuals_pvd(), oomph::PVDEquationsWithPressure< DIM >::fill_in_generic_residual_contribution_pvd_with_pressure(), oomph::RefineablePVDEquationsWithPressure< DIM >::fill_in_generic_residual_contribution_pvd_with_pressure(), oomph::BlockPreconditioner< MATRIX >::get_blocks(), oomph::PVDEquationsBase< DIM >::get_strain(), oomph::LinearElasticityEquationsBase< DIM >::get_strain(), oomph::TimeStepper::highest_derivative(), oomph::ConstitutiveLaw::is_matrix_square(), oomph::TimeStepper::make_steady(), oomph::DenseMatrix< bool >::operator=(), oomph::NavierStokesEquations< DIM >::strain_rate(), and oomph::AxisymmetricNavierStokesEquations::strain_rate().

template<class T>
DenseMatrix& oomph::DenseMatrix< T >::operator= ( const DenseMatrix< T > &  source_matrix  )  [inline]

Copy assignement.

Definition at line 357 of file matrices.h.

template<class T>
void oomph::DenseMatrix< T >::output ( std::string  filename  ) 

Output function to print a matrix row-by-row to a file. Specify filename.

Definition at line 2685 of file matrices.h.

References oomph::DenseMatrix< T >::output().

template<class T>
void oomph::DenseMatrix< T >::output ( std::ostream &  outfile  )  [virtual]

Output function to print a matrix row-by-row to the stream outfile.

Reimplemented from oomph::Matrix< T, MATRIX_TYPE >.

Definition at line 2664 of file matrices.h.

References oomph::DenseMatrix< T >::M, and oomph::DenseMatrix< T >::N.

Referenced by oomph::DenseMatrix< T >::output().

template<class T>
void oomph::DenseMatrix< T >::resize ( const unsigned long &  n,
const unsigned long &  m,
const T &  initial_value 
)

Resize to a non-square n_row x m_col matrix and initialize the new entries to specified value.

Definition at line 2622 of file matrices.h.

References oomph::DenseMatrix< T >::initialise(), oomph::DenseMatrix< T >::M, oomph::DenseMatrix< T >::Matrixdata, and oomph::DenseMatrix< T >::N.

template<class T>
void oomph::DenseMatrix< T >::resize ( const unsigned long &  n,
const unsigned long &  m 
)

Resize to a non-square n_row x m_col matrix, where any values already present will be transfered.

Definition at line 2576 of file matrices.h.

References oomph::DenseMatrix< T >::initialise(), oomph::DenseMatrix< T >::M, oomph::DenseMatrix< T >::Matrixdata, and oomph::DenseMatrix< T >::N.

template<class T>
void oomph::DenseMatrix< T >::resize ( const unsigned long &  n  )  [inline]

Resize to a square nxn matrix; any values already present will be transfered

Definition at line 425 of file matrices.h.

Referenced by oomph::SpectralElement::assign_all_generic_local_eqn_numbers(), oomph::BDF< NSTEPS >::BDF(), oomph::DenseDoubleMatrix::eigenvalues_by_jacobi(), oomph::DGElement::get_inverse_mass_matrix_times_residuals(), oomph::Problem::get_jacobian(), oomph::JacobiEigenSolver::jacobi(), oomph::KirchhoffLoveShellEquations::KirchhoffLoveShellEquations(), oomph::DenseDoubleMatrix::matrix_reduction(), oomph::DenseDoubleMatrix::multiply(), oomph::DenseMatrix< bool >::operator=(), oomph::DGElement::pre_compute_mass_matrix(), oomph::DenseMatrix< bool >::resize(), oomph::QuadTree::setup_static_data(), oomph::OcTree::setup_static_data(), oomph::HSL_MA42::solve(), and oomph::TimeStepper::TimeStepper().

template<class T>
void oomph::DenseMatrix< T >::sparse_indexed_output ( std::string  filename  ) 

Indexed output function to print a matrix to a file as i,j,a(i,j) for a(i,j)!=0 only. Specify filename.

Definition at line 2759 of file matrices.h.

References oomph::DenseMatrix< T >::sparse_indexed_output().

template<class T>
void oomph::DenseMatrix< T >::sparse_indexed_output ( std::ostream &  outfile  )  [virtual]

Sparse indexed output as i,j,a(i,j) for a(i,j)!=0 only.

Implements oomph::Matrix< T, MATRIX_TYPE >.

Definition at line 2736 of file matrices.h.

References oomph::DenseMatrix< T >::M, and oomph::DenseMatrix< T >::N.

Referenced by oomph::DenseMatrix< T >::sparse_indexed_output().


Member Data Documentation

template<class T>
unsigned long oomph::DenseMatrix< T >::M [protected]

Number of columns.

Definition at line 331 of file matrices.h.

Referenced by oomph::DenseMatrix< T >::DenseMatrix(), oomph::DenseMatrix< bool >::DenseMatrix(), oomph::DenseMatrix< bool >::entry(), oomph::DenseMatrix< bool >::get_entry(), oomph::DenseMatrix< T >::indexed_output(), oomph::DenseMatrix< bool >::initialise(), oomph::DenseMatrix< bool >::ncol(), oomph::DenseMatrix< bool >::operator=(), oomph::DenseMatrix< T >::output(), oomph::DenseMatrix< T >::resize(), and oomph::DenseMatrix< T >::sparse_indexed_output().

template<class T>
T* oomph::DenseMatrix< T >::Matrixdata [protected]

Internal representation of matrix as a pointer to data.

Definition at line 325 of file matrices.h.

Referenced by oomph::DenseMatrix< T >::DenseMatrix(), oomph::DenseMatrix< bool >::DenseMatrix(), oomph::DenseMatrix< bool >::entry(), oomph::DenseMatrix< bool >::get_entry(), oomph::DenseMatrix< bool >::initialise(), oomph::DenseMatrix< T >::resize(), and oomph::DenseMatrix< bool >::~DenseMatrix().

template<class T>
unsigned long oomph::DenseMatrix< T >::N [protected]

Number of rows.

Definition at line 328 of file matrices.h.

Referenced by oomph::DenseMatrix< T >::DenseMatrix(), oomph::DenseMatrix< bool >::DenseMatrix(), oomph::DenseMatrix< T >::indexed_output(), oomph::DenseMatrix< bool >::initialise(), oomph::DenseMatrix< bool >::nrow(), oomph::DenseMatrix< bool >::operator=(), oomph::DenseMatrix< T >::output(), oomph::DenseMatrix< T >::resize(), and oomph::DenseMatrix< T >::sparse_indexed_output().


The documentation for this class was generated from the following file:
Generated on Mon Aug 10 11:25:17 2009 by  doxygen 1.4.7