HArD::Core2D
Hybrid Arbitrary Degree::Core 2D - Library to implement 2D schemes with edge and cell polynomials as unknowns
Loading...
Searching...
No Matches
xdivdiv.hpp
Go to the documentation of this file.
1#ifndef XDIVDIV_HPP
2#define XDIVDIV_HPP
3
4#include <globaldofspace.hpp>
5#include <platescore.hpp>
6#include <integralweight.hpp>
7
8namespace HArDCore2D
9{
16
19 class XDivDiv : public GlobalDOFSpace
20 {
21 public:
22 typedef std::function<Eigen::Matrix2d(const Eigen::Vector2d &)> FunctionType;
23 typedef std::function<double(const Eigen::Vector2d &, const Edge &)> EdgeFunctionType;
24 typedef std::function<Eigen::Matrix2d(const Eigen::Matrix2d &)> ConstitutiveLawType;
25
28 {
30 const Eigen::MatrixXd & _divdiv,
31 const Eigen::MatrixXd & _divdiv_rhs,
32 const Eigen::MatrixXd & _potential
33 )
34 : divdiv(_divdiv),
35 divdiv_rhs(_divdiv_rhs),
36 potential(_potential)
37 {
38 // Do nothing
39 }
40
41 Eigen::MatrixXd divdiv;
42 Eigen::MatrixXd divdiv_rhs;
43 Eigen::MatrixXd potential;
44 };
45
49
51
52 inline FunctionValue function(size_t i) const
53 {
54 assert(i >= 0 && i <= 2);
55 return m_basis[i];
56 }
57
58 inline size_t size() const {
59 return 3;
60 }
61
62 private:
63 std::array<MatrixRd, 3> m_basis;
64 };
65
67 XDivDiv(const PlatesCore & plates_core, bool use_threads = true, std::ostream & output = std::cout);
68
70 const Mesh & mesh() const
71 {
72 return m_plates_core.mesh();
73 }
74
77 const size_t & degree() const
78 {
79 return m_plates_core.degree();
80 }
81
83 Eigen::VectorXd interpolate(
84 const FunctionType & tau,
85 const EdgeFunctionType & Dtau,
86 const int deg_quad = -1
87 ) const;
88
90 Eigen::MatrixXd computeL2Product(
91 const size_t iT,
92 const ConstitutiveLawType & A = [](const Eigen::Matrix2d tau)->Eigen::Matrix2d { return tau; },
93 const double & penalty_factor = 1.
94 ) const;
95
96
98 inline const LocalOperators & cellOperators(size_t iT) const
99 {
100 return *m_cell_operators[iT];
101 }
102
104 inline const Eigen::MatrixXd & edgePotential(size_t iE) const
105 {
106 return m_edge_potentials[iE];
107 }
108
110 inline const Eigen::MatrixXd & edgePotential(const Edge & E) const
111 {
112 return m_edge_potentials[E.global_index()];
113 }
114
116 inline const PlatesCore::CellBases & cellBases(size_t iT) const
117 {
118 return m_plates_core.cellBases(iT);
119 }
120
122 inline const PlatesCore::CellBases & cellBases(const Cell & T) const
123 {
124 return m_plates_core.cellBases(T.global_index());
125 }
126
128 inline const PlatesCore::EdgeBases & edgeBases(size_t iE) const
129 {
130 return m_plates_core.edgeBases(iE);
131 }
132
134 inline const PlatesCore::EdgeBases & edgeBases(const Edge & E) const
135 {
136 return m_plates_core.edgeBases(E.global_index());
137 }
138
140 inline const SymmetricMatrixBasisVertex & SymBasisVertex() const
141 {
142 return m_symm_vertex;
143 }
144
145 private:
146 LocalOperators _compute_cell_divdiv_potential(size_t iT);
147 Eigen::MatrixXd _compute_edge_potential(size_t iE);
148
149 const PlatesCore & m_plates_core;
150 bool m_use_threads;
151 std::ostream & m_output;
152
153 // Basis for the space of symmetric tensor-valued fields on a vertex
154 SymmetricMatrixBasisVertex m_symm_vertex;
155
156 // Containers for local operators
157 std::vector<std::unique_ptr<LocalOperators> > m_cell_operators;
158 std::vector<Eigen::MatrixXd> m_edge_potentials;
159 };
160
161} // end of namespace HArDCore2D
162
163#endif
static auto tau
Definition basis-test.cpp:71
Base class for global DOF spaces. Provides functions to manipulate global DOFs (the local version bei...
Definition globaldofspace.hpp:16
Construct all polynomial spaces for the plates sequence.
Definition platescore.hpp:25
Discrete Hdivdiv space.
Definition xdivdiv.hpp:20
Definition Mesh2D.hpp:26
Compute max and min eigenvalues of all matrices for i
Definition compute_eigs.m:5
Eigen::Matrix2d MatrixRd
Definition basis.hpp:54
bool use_threads
Definition HHO_DiffAdvecReac.hpp:47
MatrixRd FunctionValue
Definition xdivdiv.hpp:48
const Mesh & mesh() const
Return the mesh.
Definition xdivdiv.hpp:70
FunctionValue function(size_t i) const
Definition xdivdiv.hpp:52
std::function< Eigen::Matrix2d(const Eigen::Vector2d &)> FunctionType
Definition xdivdiv.hpp:22
size_t size() const
Definition xdivdiv.hpp:58
SymmetricMatrixBasisVertex()
Definition xdivdiv.cpp:16
Eigen::MatrixXd divdiv_rhs
Definition xdivdiv.hpp:42
std::function< Eigen::Matrix2d(const Eigen::Matrix2d &)> ConstitutiveLawType
Definition xdivdiv.hpp:24
Eigen::MatrixXd divdiv
Definition xdivdiv.hpp:41
LocalOperators(const Eigen::MatrixXd &_divdiv, const Eigen::MatrixXd &_divdiv_rhs, const Eigen::MatrixXd &_potential)
Definition xdivdiv.hpp:29
const size_t & degree() const
Definition xdivdiv.hpp:77
std::function< double(const Eigen::Vector2d &, const Edge &)> EdgeFunctionType
Definition xdivdiv.hpp:23
Eigen::MatrixXd potential
Definition xdivdiv.hpp:43
A
Definition mmread.m:102
if(strcmp(field, 'real')) % real valued entries T
Definition mmread.m:93
Definition ddr-klplate.hpp:27
A structure to store the local operators (divdiv and potential)
Definition xdivdiv.hpp:28
Basis for the space of symmetric matrices.
Definition xdivdiv.hpp:47