7#include <MRPch/MREigenSparseCore.h>
23 enum class RememberShape
30 Laplacian(
const MeshTopology & topology, VertCoords & points ) : topology_( topology ), points_( points ) { }
34 MRMESH_API void init(
const VertBitSet & freeVerts, EdgeWeights weights, VertexMass vmass = VertexMass::Unit,
35 RememberShape rem = Laplacian::RememberShape::Yes );
55 [[nodiscard]]
const VertBitSet & region()
const {
return region_; }
58 [[nodiscard]]
const VertBitSet & freeVerts()
const {
return freeVerts_; }
61 [[nodiscard]]
const VertBitSet & firstLayerFixedVerts()
const { assert( solverValid_ );
return firstLayerFixedVerts_; }
70 template <
typename I,
typename G,
typename S>
71 void prepareRhs_( I && iniRhs, G && g, S && s );
73 const MeshTopology & topology_;
80 VertBitSet freeVerts_;
83 VertBitSet fixedSharpVertices_;
86 VertBitSet firstLayerFixedVerts_;
92 double centerCoeff = 0;
95 std::vector<Equation> equations_;
102 std::vector<Element> nonZeroElements_;
105 Vector< int, VertId > regionVert2id_;
106 Vector< int, VertId > freeVert2id_;
108 using SparseMatrix = Eigen::SparseMatrix<double,Eigen::RowMajor>;
112 bool solverValid_ =
false;
113 using SparseMatrixColMajor = Eigen::SparseMatrix<double,Eigen::ColMajor>;
119 virtual ~Solver() =
default;
120 virtual void compute(
const SparseMatrixColMajor& A ) = 0;
121 virtual Eigen::VectorXd solve(
const Eigen::VectorXd& rhs ) = 0;
123 std::unique_ptr<Solver> solver_;
126 bool rhsValid_ =
false;
127 Eigen::VectorXd rhs_[3];
#define MRMESH_API
Definition MRMeshFwd.h:80
unsafe Laplacian(MR._ByValue_Laplacian _other)
unsafe void fixVertex(MR.VertId v, bool? smooth=null)
unsafe void updateSolver()
unsafe void init(MR.Const_VertBitSet freeVerts, MR.EdgeWeights weights, MR.VertexMass? vmass=null, MR.Laplacian.RememberShape? rem=null)
unsafe void applyToScalar(MR.VertScalars scalarField)
Element
Definition MRImGuiMeasurementIndicators.h:99
Definition MRCameraOrientationPlugin.h:8