KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
ublas_interface.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Pooyan Dadvand
11 //
12 
13 
14 #if !defined(KRATOS_UBLAS_INTERFACE_H_INCLUDED )
15 #define KRATOS_UBLAS_INTERFACE_H_INCLUDED
16 
17 
18 // System includes
19 #include <string>
20 #include <iostream>
21 
22 
23 // External includes
24 #include <boost/numeric/ublas/matrix.hpp>
25 #include <boost/numeric/ublas/vector.hpp>
26 #include <boost/numeric/ublas/vector_proxy.hpp>
27 #include <boost/numeric/ublas/vector_sparse.hpp>
28 #include <boost/numeric/ublas/vector_expression.hpp>
29 #include <boost/numeric/ublas/matrix_proxy.hpp>
30 #include <boost/numeric/ublas/symmetric.hpp>
31 #include <boost/numeric/ublas/hermitian.hpp>
32 #include <boost/numeric/ublas/banded.hpp>
33 #include <boost/numeric/ublas/triangular.hpp>
34 #include <boost/numeric/ublas/lu.hpp>
35 
36 #include <boost/numeric/ublas/io.hpp>
37 #include <boost/numeric/ublas/matrix_sparse.hpp>
38 #include <boost/numeric/ublas/operation.hpp>
39 #include <boost/numeric/ublas/operation_sparse.hpp>
40 
41 // Project includes
42 #include "includes/define.h"
43 
44 
45 namespace Kratos
46 {
47 
50 
54  using namespace boost::numeric::ublas;
55 
56  template <typename TDataType> using DenseMatrix = boost::numeric::ublas::matrix<TDataType>;
57  template <typename TDataType> using DenseVector = boost::numeric::ublas::vector<TDataType>;
58 
59  template <typename TDataType, std::size_t TSize1, std::size_t TSize2> using BoundedMatrix = boost::numeric::ublas::bounded_matrix<TDataType, TSize1, TSize2>;
60  template <typename TDataType, std::size_t TSize> using BoundedVector = boost::numeric::ublas::bounded_vector<TDataType, TSize>;
61 
62 
63  typedef boost::numeric::ublas::vector<double> Vector;
64  typedef unit_vector<double> UnitVector;
65  typedef zero_vector<double> ZeroVector;
66  typedef scalar_vector<double> ScalarVector;
67  //typedef sparse_vector<double> SparseVector;
68  typedef mapped_vector<double> SparseVector;
69 
70  typedef compressed_vector<double> CompressedVector;
71  typedef coordinate_vector<double> CoordinateVector;
72  typedef vector_range<Vector> VectorRange;
73  typedef vector_slice<Vector> VectorSlice;
74 
75  typedef matrix<double> Matrix;
76  typedef identity_matrix<double> IdentityMatrix;
77  typedef zero_matrix<double> ZeroMatrix;
79  typedef triangular_matrix<double> TriangularMatrix;
80  typedef symmetric_matrix<double> SymmetricMatrix;
81  typedef hermitian_matrix<double> HermitianMatrix;
82  typedef banded_matrix<double> BandedMatrix;
83  //typedef sparse_matrix<double> SparseMatrix;
84  typedef mapped_matrix<double> SparseMatrix;
85  typedef coordinate_matrix<double> CoordinateMatrix;
86  typedef matrix_column<Matrix> MatrixColumn;
87  typedef matrix_vector_range<Matrix> MatrixVectorRange;
88  typedef matrix_vector_slice<Matrix> MatrixVectorSlice;
89  typedef matrix_range<Matrix> MatrixRange;
90  typedef matrix_slice<Matrix> MatrixSlice;
91 
92  template <typename TExpressionType> using MatrixRow = matrix_row<TExpressionType>;
93 
94  typedef boost::numeric::ublas::compressed_matrix<double> CompressedMatrix;
95 
99 
103 
107 
108 
112 
113 
117 
118 } // namespace Kratos.
119 
120 #endif // KRATOS_UBLAS_INTERFACE_H_INCLUDED defined
121 
122 
123 
Definition: amatrix_interface.h:701
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
matrix_slice< Matrix > MatrixSlice
Definition: ublas_interface.h:90
mapped_matrix< double > SparseMatrix
Definition: ublas_interface.h:84
AMatrix::IdentityMatrix< double > IdentityMatrix
Definition: amatrix_interface.h:564
unit_vector< double > UnitVector
Definition: ublas_interface.h:64
Internals::Matrix< double, AMatrix::dynamic, 1 > Vector
Definition: amatrix_interface.h:472
vector_range< Vector > VectorRange
Definition: ublas_interface.h:72
vector_slice< Vector > VectorSlice
Definition: ublas_interface.h:73
boost::numeric::ublas::compressed_matrix< double > CompressedMatrix
Definition: ublas_interface.h:94
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
AMatrix::MatrixRow< TExpressionType > MatrixRow
Definition: amatrix_interface.h:492
scalar_vector< double > ScalarVector
Definition: ublas_interface.h:66
matrix_vector_slice< Matrix > MatrixVectorSlice
Definition: ublas_interface.h:88
hermitian_matrix< double > HermitianMatrix
Definition: ublas_interface.h:81
banded_matrix< double > BandedMatrix
Definition: ublas_interface.h:82
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
matrix_vector_range< Matrix > MatrixVectorRange
Definition: ublas_interface.h:87
mapped_vector< double > SparseVector
Definition: ublas_interface.h:68
Internals::Matrix< TDataType, AMatrix::dynamic, AMatrix::dynamic > DenseMatrix
Definition: amatrix_interface.h:474
coordinate_vector< double > CoordinateVector
Definition: ublas_interface.h:71
symmetric_matrix< double > SymmetricMatrix
Definition: ublas_interface.h:80
compressed_vector< double > CompressedVector
Definition: ublas_interface.h:70
matrix_range< Matrix > MatrixRange
Definition: ublas_interface.h:89
scalar_matrix< double > ScalarMatrix
Definition: amatrix_interface.h:728
Internals::Matrix< TDataType, AMatrix::dynamic, 1 > DenseVector
Definition: amatrix_interface.h:476
Internals::Matrix< TDataType, TSize, 1 > BoundedVector
Definition: amatrix_interface.h:478
coordinate_matrix< double > CoordinateMatrix
Definition: ublas_interface.h:85
matrix_column< Matrix > MatrixColumn
Definition: ublas_interface.h:86
Internals::Matrix< TDataType, TSize1, TSize2 > BoundedMatrix
Definition: amatrix_interface.h:480
triangular_matrix< double > TriangularMatrix
Definition: ublas_interface.h:79