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.
amgcl_csr_spmm_utilities.h
Go to the documentation of this file.
1 
2 // | / |
3 // ' / __| _` | __| _ \ __|
4 // . \ | ( | | ( |\__ \.
5 // _|\_\_| \__,_|\__|\___/ ____/
6 // Multi-Physics
7 //
8 // License: BSD License
9 // Kratos default license: kratos/license.txt
10 //
11 // Main authors: Riccardo Rossi
12 //
13 //
14 
15 #if !defined(KRATOS_CSR_SPMM_UTILITIES_H_INCLUDED)
16 #define KRATOS_CSR_SPMM_UTILITIES_H_INCLUDED
17 
18 // System includes
19 
20 // External includes
21 #include <amgcl/backend/builtin.hpp>
22 #include <amgcl/adapter/zero_copy.hpp>
23 
24 // Project includes
25 #include "containers/csr_matrix.h"
27 
28 namespace Kratos
29 {
30 
35 {
36 
37 public:
38 
42  template< class TDataType=double, class TIndexType=std::size_t >
46  )
47  {
48  auto pAamgcl = AmgclCSRConversionUtilities::ConvertToAmgcl<TDataType,TIndexType>(rA);
49  auto pBamgcl = AmgclCSRConversionUtilities::ConvertToAmgcl<TDataType,TIndexType>(rB);
50 
51  auto Camgcl = amgcl::backend::product(*pAamgcl, *pBamgcl);
52  amgcl::backend::sort_rows(*Camgcl);
53 
54  return AmgclCSRConversionUtilities::ConvertToCsrMatrix<TDataType,TIndexType>(*Camgcl);
55  }
56 
57 
58 
59 };
60 
61 }
62 
63 #endif // KRATOS_CSR_SPMM_UTILITIES_H_INCLUDED
Definition: amgcl_csr_spmm_utilities.h:35
static CsrMatrix< TDataType, TIndexType >::Pointer SparseMultiply(const CsrMatrix< TDataType, TIndexType > &rA, const CsrMatrix< TDataType, TIndexType > &rB)
Definition: amgcl_csr_spmm_utilities.h:43
This class implements "serial" CSR matrix, including capabilities for FEM assembly.
Definition: csr_matrix.h:60
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21