PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
assembler_PCC_2D_functions_utilities.hpp
Go to the documentation of this file.
1// _LICENSE_HEADER_
2//
3// Copyright (C) 2019 - 2025.
4// Terms register on the GPL-3.0 license.
5//
6// This file can be redistributed and/or modified under the license terms.
7//
8// See top level LICENSE file for more details.
9//
10// This file can be used citing references in CITATION.cff file.
11
12#ifndef __PDETOOLS_ASSEMBLER_assembler_PCC_2D_functions_utilities_HPP
13#define __PDETOOLS_ASSEMBLER_assembler_PCC_2D_functions_utilities_HPP
14
15#include "Eigen_Array.hpp"
16#include "Eigen_SparseArray.hpp"
18
19namespace Polydim
20{
21namespace PDETools
22{
23namespace Assembler_Utilities
24{
25namespace PCC_2D
26{
27// ***************************************************************************
28std::list<Eigen::Triplet<double>> to_triplets(const Eigen::SparseMatrix<double> &M);
29// ***************************************************************************
30inline Eigen::VectorXd to_VectorXd(const Gedim::Eigen_Array<> &v)
31{
32 return static_cast<const Eigen::VectorXd &>(v);
33}
34// ***************************************************************************
35inline Gedim::Eigen_Array<> to_Eigen_Array(const Eigen::VectorXd &v)
36{
37 return Gedim::Eigen_Array<>(v);
38}
39// ***************************************************************************
40Gedim::Eigen_SparseArray<> to_Eigen_SparseArray(const Sparse_Matrix_Data &A);
41// ***************************************************************************
42Gedim::Eigen_SparseArray<> to_Eigen_SparseArray(const Sparse_Matrix_Data &A,
43 const std::array<unsigned int, 2> &new_size,
44 const std::array<unsigned int, 2> &shifts = {0, 0},
45 const bool transpose = false);
46// ***************************************************************************
47Sparse_Matrix_Data to_Sparse_Matrix_Data(const Gedim::Eigen_SparseArray<> &A);
48// ***************************************************************************
49inline Eigen::SparseMatrix<double> to_SparseMatrix(const Gedim::Eigen_SparseArray<> &A)
50{
51 return static_cast<const Eigen::SparseMatrix<double> &>(A);
52}
53// ***************************************************************************
54inline Gedim::Eigen_SparseArray<> to_Eigen_SparseArray(const Eigen::SparseMatrix<double> &A)
55{
57}
58// ***************************************************************************
59inline auto anysotropic_diffusion_term_function(const std::function<double(const double &, const double &, const double &)> &diffusion_term_function)
60{
61 return [diffusion_term_function](const double &x, const double &y, const double &z) {
62 return std::array<double, 9>(
63 {diffusion_term_function(x, y, z), 0.0, 0.0, 0.0, diffusion_term_function(x, y, z), 0.0, 0.0, 0.0, diffusion_term_function(x, y, z)});
64 };
65};
66// ***************************************************************************
67} // namespace PCC_2D
68} // namespace Assembler_Utilities
69} // namespace PDETools
70} // namespace Polydim
71
72#endif
Eigen column vector.
Definition Eigen_Array.hpp:23
Eigen::SparseMatrix< double > to_SparseMatrix(const Gedim::Eigen_SparseArray<> &A)
Definition assembler_PCC_2D_functions_utilities.hpp:49
Sparse_Matrix_Data to_Sparse_Matrix_Data(const Gedim::Eigen_SparseArray<> &A)
Definition assembler_PCC_2D_functions_utilities.cpp:51
std::list< Eigen::Triplet< double > > to_triplets(const Eigen::SparseMatrix< double > &M)
Definition assembler_PCC_2D_functions_utilities.cpp:23
Gedim::Eigen_Array to_Eigen_Array(const Eigen::VectorXd &v)
Definition assembler_PCC_2D_functions_utilities.hpp:35
Gedim::Eigen_SparseArray to_Eigen_SparseArray(const Sparse_Matrix_Data &A)
Definition assembler_PCC_2D_functions_utilities.cpp:39
auto anysotropic_diffusion_term_function(const std::function< double(const double &, const double &, const double &)> &diffusion_term_function)
Definition assembler_PCC_2D_functions_utilities.hpp:59
Eigen::VectorXd to_VectorXd(const Gedim::Eigen_Array<> &v)
Definition assembler_PCC_2D_functions_utilities.hpp:30
Definition FEM_MCC_2D_LocalSpace.cpp:17