68 [[nodiscard]]
const VertBitSet &
region()
const {
return region_; }
71 [[nodiscard]]
const VertBitSet &
freeVerts()
const {
return freeVerts_; }
74 [[nodiscard]]
const VertBitSet &
firstLayerFixedVerts()
const { assert( solver_ );
return firstLayerFixedVerts_; }
80 [[nodiscard]] VertCoords &
points()
const {
return points_; }
101 template <
typename I,
typename G,
typename S,
typename P>
102 void prepareRhs_(
I && iniRhs, G && g, S && s, P && p )
const;
105 VertCoords & points_;
111 VertBitSet freeVerts_;
114 VertBitSet fixedSharpVertices_;
117 VertBitSet firstLayerFixedVerts_;
126 std::vector<Equation> equations_;
128 std::vector<Attractor> attractors_;
135 std::vector<Element> nonZeroElements_;
142 std::unique_ptr<Solver> solver_;
#define MRMESH_API
Definition MRMeshFwd.h:80
Definition MRMeshTopology.h:23
void addAttractor(const Attractor &a)
adds one more attractor to the stored list
void apply()
Definition MRLaplacian.h:61
void applyToScalar(VertScalars &scalarField)
const VertBitSet & freeVerts() const
return currently free vertices
Definition MRLaplacian.h:71
const VertBitSet & firstLayerFixedVerts() const
return fixed vertices from the first layer around free vertices
Definition MRLaplacian.h:74
int firstElem
coefficient on matrix diagonal
Definition MRLaplacian.h:124
double weight
Definition MRLaplacian.h:91
void init(const VertBitSet &freeVerts, EdgeWeights weights, VertexMass vmass=VertexMass::Unit, RememberShape rem=RememberShape::Yes)
Definition MRLaplacian.h:34
MeshTriPoint p
Definition MRLaplacian.h:85
EdgeWeights
determines the weight of each edge in applications like Laplacian
Definition MREnums.h:44
Laplacian(Laplacian &&) noexcept
void applyToVector(VertCoords &points)
Laplacian(const MeshTopology &topology, VertCoords &points)
class MRMESH_CLASS I
Definition MRMeshFwd.h:137
double centerCoeff
equation right hand side
Definition MRLaplacian.h:123
void fixVertex(VertId v, bool smooth=true)
const VertBitSet & region() const
return all initially free vertices and the first layer of vertices around them
Definition MRLaplacian.h:68
Vector3d target
Definition MRLaplacian.h:86
RememberShape
Definition MREnums.h:56
void multVertexWeight(VertId v, double factor)
multiplies vertex equation's weight on the given factor
Vector3d rhs
Definition MRLaplacian.h:122
const MeshTopology & topology() const
return the topology for which Laplacian was constructed
Definition MRLaplacian.h:77
void removeAllAttractors()
forgets all attractors added previously
double coeff
Definition MRLaplacian.h:132
VertId neiVert
Definition MRLaplacian.h:133
VertexMass
determines the weight or mass of each vertex in applications like Laplacian
Definition MREnums.h:34
VertCoords & points() const
return the vector of coordinates for which Laplacian was constructed
Definition MRLaplacian.h:80
void fixVertex(VertId v, const Vector3f &fixedPos, bool smooth=true)
void updateSolver()
if you manually call this method after initialization and fixing vertices then next apply call will b...
void initFromPoints(const VertCoords &points, const VertBitSet &freeVerts, EdgeWeights weights, VertexMass vmass=VertexMass::Unit, RememberShape rem=RememberShape::Yes)
same as init() but uses the given points instead of ones passed to a constructor for weights computat...
@ factor
Definition MRUnitInfo.h:51
@ Yes
true Laplacian mode when initial mesh shape is remembered and copied in apply
Definition MREnums.h:57
@ Unit
all vertices have same mass=1
Definition MREnums.h:36
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
attracts the given point inside some mesh's triangle to the given target with the given weight
Definition MRLaplacian.h:84
Definition MRMeshTriPoint.h:26