31 #if defined(GeodesicsInHeat_RECURSES)
32 #error Recursive header files inclusion detected in GeodesicsInHeat.h
33 #else // defined(GeodesicsInHeat_RECURSES)
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 )
156 if ( ! boundary_with_mixed_solution )
return;
158 const auto surfmesh =
myCalculus->getSurfaceMeshPtr();
160 for (
auto e : edges )
179 ASSERT_MSG(aV < myCalculus->nbVertices(),
"Vertex is not in the surface mesh vertex range");
189 FATAL_ERROR_MSG(
myIsInit,
"init() method must be called first");
198 FATAL_ERROR_MSG(
myIsInit,
"init() method must be called first");
208 Vector heatDiffusionDirichlet
210 heatDiffusion = 0.5 * ( heatDiffusion + heatDiffusionDirichlet );
215 auto surfmesh =
myCalculus->getSurfaceMeshPtr();
223 for(
auto v: vertices)
225 faceHeat(cpt) = heatDiffusion( v );
236 for(
auto v: vertices)
238 divergence(v) += divergenceFace(cpt);
250 return distVec - sourceval*Vector::Ones(
myCalculus->nbVertices());
305 #endif // !defined GeodesicsInHeat_h
307 #undef GeodesicsInHeat_RECURSES
308 #endif // else defined(GeodesicsInHeat_RECURSES)
DirichletConditions< LinAlgBackend > Conditions
IntegerVector myBoundary
The boundary characteristic vector.
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
const PolygonalCalculus * myCalculus
The underlying PolygonalCalculus instance.
PolygonalCalculus::DenseMatrix DenseMatrix
static DenseVector dirichletVector(const SparseMatrix &A, const DenseVector &b, const IntegerVector &p, const DenseVector &u)
LinAlg::SparseMatrix SparseMatrix
Type of sparse matrix.
TPolygonalCalculus PolygonalCalculus
Edges computeManifoldBoundaryEdges() const
SparseMatrix myHeatOpe
The operator for heat diffusion.
static DenseVector dirichletSolution(const DenseVector &xd, const IntegerVector &p, const DenseVector &u)
static SparseMatrix dirichletOperator(const SparseMatrix &A, const IntegerVector &p)
PolygonalCalculus::LinAlg LinAlgBackend
LinAlg::DenseMatrix DenseMatrix
Type of dense matrix.
Vector mySource
Source vector.
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)
GeodesicsInHeat(ConstAlias< PolygonalCalculus > calculus)
PolygonalCalculus::Vertex Vertex
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Provide linear algebra backend using Eigen dense and sparse matrix as well as dense vector....
const VertexPair & edgeVertices(Edge e) const
LinAlg::SolverSimplicialLDLT Solver
Type of a sparse matrix solver.
PolygonalCalculus::SparseMatrix SparseMatrix
This class implements on polygonal surfaces (using Discrete differential calculus on polygonal surfa...
LinearAlgebraBackend::IntegerVector IntegerVector
void addSource(const Vertex aV)
Conditions::IntegerVector IntegerVector
GeodesicsInHeat & operator=(const GeodesicsInHeat &other)=delete
~GeodesicsInHeat()=default
MySurfaceMesh::Vertex Vertex
Vertex type.
Aim: A helper class to solve a system with Dirichlet boundary conditions.
Solver myHeatDirichletSolver
Heat solver with Dirichlet boundary conditions.
LinAlg::DenseVector Vector
Type of Vector.
Solver myHeatSolver
Heat solver.
void init(double dt, double lambda=1.0, bool boundary_with_mixed_solution=false)
double myLambda
Lambda parameter.
Vertex myLastSourceIndex
Vertex index to the last source point (to shift the distances)
const Vertices & incidentVertices(Face f) const
bool myIsInit
Validitate flag.
Solver myPoissonSolver
Poisson solver.
PolygonalCalculus::Solver Solver
PolygonalCalculus::Vector Vector