31#if defined(GeodesicsInHeat_RECURSES)
32#error Recursive header files inclusion detected in GeodesicsInHeat.h
35#define GeodesicsInHeat_RECURSES
37#if !defined GeodesicsInHeat_h
39#define GeodesicsInHeat_h
44#include "DGtal/base/Common.h"
45#include "DGtal/base/ConstAlias.h"
46#include "DGtal/math/linalg/DirichletConditions.h"
61 template <
typename TPolygonalCalculus>
135 void init(
double dt,
double lambda = 1.0,
136 bool boundary_with_mixed_solution =
false )
162 if ( ! boundary_with_mixed_solution )
return;
165 const auto edges =
surfmesh->computeManifoldBoundaryEdges();
166 for (
auto e : edges )
168 const auto vtcs =
surfmesh->edgeVertices( e );
185 ASSERT_MSG(aV < myCalculus->nbVertices(),
"Vertex is not in the surface mesh vertex range");
202 FATAL_ERROR_MSG(
myIsInit,
"init() method must be called first");
211 FATAL_ERROR_MSG(
myIsInit,
"init() method must be called first");
223 Vector heatDiffusionDirichlet
225 heatDiffusion = 0.5 * ( heatDiffusion + heatDiffusionDirichlet );
236 auto vertices =
surfmesh->incidentVertices(f);
237 for(
auto v: vertices)
239 faceHeat(cpt) = heatDiffusion( v );
250 for(
auto v: vertices)
252 divergence(v) += divergenceFace(cpt);
264 return distVec - sourceval*Vector::Ones(
myCalculus->nbVertices());
321#undef GeodesicsInHeat_RECURSES
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Aim: A helper class to solve a system with Dirichlet boundary conditions.
LinearAlgebraBackend::IntegerVector IntegerVector
static DenseVector dirichletVector(const SparseMatrix &A, const DenseVector &b, const IntegerVector &p, const DenseVector &u)
static SparseMatrix dirichletOperator(const SparseMatrix &A, const IntegerVector &p)
static DenseVector dirichletSolution(const DenseVector &xd, const IntegerVector &p, const DenseVector &u)
This class implements Crane2013 on polygonal surfaces (using Discrete differential calculus on polygo...
GeodesicsInHeat(GeodesicsInHeat &&other)=delete
DirichletConditions< LinAlgBackend > Conditions
PolygonalCalculus::LinAlg LinAlgBackend
double myLambda
Lambda parameter.
PolygonalCalculus::SparseMatrix SparseMatrix
Vertex myLastSourceIndex
Vertex index to the last source point (to shift the distances)
const PolygonalCalculus * myCalculus
The underlying PolygonalCalculus instance.
GeodesicsInHeat(const GeodesicsInHeat &other)=delete
void init(double dt, double lambda=1.0, bool boundary_with_mixed_solution=false)
Solver myHeatSolver
Heat solver.
bool myIsInit
Validitate flag.
~GeodesicsInHeat()=default
SparseMatrix myHeatOpe
The operator for heat diffusion.
PolygonalCalculus::Vertex Vertex
void addSource(const Vertex aV)
IntegerVector myBoundary
The boundary characteristic vector.
Solver myPoissonSolver
Poisson solver.
Solver myHeatDirichletSolver
Heat solver with Dirichlet boundary conditions.
GeodesicsInHeat & operator=(const GeodesicsInHeat &other)=delete
PolygonalCalculus::Vector Vector
TPolygonalCalculus PolygonalCalculus
PolygonalCalculus::Solver Solver
GeodesicsInHeat(ConstAlias< PolygonalCalculus > calculus)
PolygonalCalculus::DenseMatrix DenseMatrix
Vector mySource
Source vector.
Conditions::IntegerVector IntegerVector
LinAlg::SparseMatrix SparseMatrix
Type of sparse matrix.
MySurfaceMesh::Vertex Vertex
Vertex type.
LinAlg::SolverSimplicialLDLT Solver
Type of a sparse matrix solver.
LinAlg::DenseMatrix DenseMatrix
Type of dense matrix.
LinAlg::DenseVector Vector
Type of Vector.
DGtal is the top-level namespace which contains all DGtal functions and types.
void laplacian(Shape &shape, const Options &options, std::function< double(const RealPoint3D &)> input_function, std::function< double(const RealPoint3D &)> target_function, int argc, char **argv)
Aim: Provide linear algebra backend using Eigen dense and sparse matrix as well as dense vector....
std::size_t Index
The type used for numbering vertices and faces.