PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
Loading...
Searching...
No Matches
HyperReduction.h
1#ifndef PBAT_SIM_VBD_MULTIGRID_HYPERREDUCTION_H
2#define PBAT_SIM_VBD_MULTIGRID_HYPERREDUCTION_H
3
4#include "pbat/Aliases.h"
5
6#include <vector>
7
8namespace pbat {
9namespace sim {
10namespace vbd {
11namespace multigrid {
12
13struct Hierarchy;
14
15struct HyperReduction
16{
17 static constexpr auto kPolynomialOrder = 1;
18 static constexpr auto kDims = 3;
19
20 HyperReduction() = default;
27 HyperReduction(Hierarchy const& hierarchy, Index clusterSize = 5);
34 void Construct(Hierarchy const& hierarchy, Index clusterSize = 5);
40 void AllocateWorkspace(std::size_t nLevels);
47 void ConstructHierarchicalClustering(Hierarchy const& hierarchy, Index clusterSize);
51 void ComputeClusterQuadratureWeights(Hierarchy const& hierarchy);
64 void
65 ComputeLinearPolynomialErrors(Hierarchy const& hierarchy, Eigen::Ref<MatrixX const> const& u);
66
70 std::vector<IndexVectorX> C;
72 std::vector<IndexVectorX> Cptr;
73 std::vector<IndexVectorX> Cadj;
74
75 std::vector<MatrixX>
79 std::vector<MatrixX> bC;
80 std::vector<VectorX> wC;
81 std::vector<IndexVectorX> eC;
82 std::vector<MatrixX> up;
83 std::vector<VectorX> Ep;
84 Scalar EpMax{1e-6};
85};
86
87} // namespace multigrid
88} // namespace vbd
89} // namespace sim
90} // namespace pbat
91
92#endif // PBAT_SIM_VBD_MULTIGRID_HYPERREDUCTION_H
PBAT's Vertex Block Descent (VBD) anka2024vbd API.
Definition AndersonIntegrator.cpp:10
PBAT simulation algorithms.
The main namespace of the library.
Definition Aliases.h:15
std::ptrdiff_t Index
Index type.
Definition Aliases.h:17
double Scalar
Scalar type.
Definition Aliases.h:18
Definition Hierarchy.h:16
void AllocateWorkspace(std::size_t nLevels)
Definition HyperReduction.cpp:49
std::vector< IndexVectorX > C
Hierarchical clustering of mesh elements.
Definition HyperReduction.h:70
Scalar EpMax
Maximum allowable linear polynomial error in any cluster.
Definition HyperReduction.h:84
std::vector< VectorX > wC
|#levels| cluster quad. weights
Definition HyperReduction.h:80
void Construct(Hierarchy const &hierarchy, Index clusterSize=5)
Definition HyperReduction.cpp:39
std::vector< VectorX > Ep
|#levels| linear polynomial errors at each level
Definition HyperReduction.h:83
std::vector< MatrixX > ApInvC
Definition HyperReduction.h:76
void ComputeClusterQuadratureWeights(Hierarchy const &hierarchy)
Compute the quadrature weights for each cluster.
Definition HyperReduction.cpp:127
std::vector< MatrixX > up
|#levels| list of |#clusters| cluster polynomials
Definition HyperReduction.h:82
void ComputeLinearPolynomialErrors(Hierarchy const &hierarchy, Eigen::Ref< MatrixX const > const &u)
Definition HyperReduction.cpp:204
std::vector< IndexVectorX > eC
|#levels| Representative elements of each cluster
Definition HyperReduction.h:81
std::vector< MatrixX > bC
#dimsx|#elements| array of integrated target fields
Definition HyperReduction.h:79
void PrecomputeInversePolynomialMatrices(Hierarchy const &hierarchy)
Definition HyperReduction.cpp:147
void ConstructHierarchicalClustering(Hierarchy const &hierarchy, Index clusterSize)
Construct the hierarchical clustering of mesh elements.
Definition HyperReduction.cpp:68