copied some fixes from Christinas branch

This commit is contained in:
Andreas Fabri 2018-07-17 13:38:39 +02:00
parent a94eb72dae
commit 40deb94656
3 changed files with 13 additions and 10 deletions

View File

@ -260,7 +260,7 @@ namespace Heat_method_3 {
{
Eigen::VectorXd u;
Matrix A = (M+ a_time_step*c);
Eigen::SimplicialLLT<Matrix> solver;
Eigen::SimplicialLDLT<Matrix> solver;
solver.compute(A);
if(solver.info()!=Eigen::Success) {
// decomposition failed
@ -400,7 +400,7 @@ namespace Heat_method_3 {
}
Eigen::VectorXd solve_phi(Matrix c, Matrix divergence, int dimension) const
Eigen::VectorXd solve_phi(const Matrix& c, const Matrix& divergence, int dimension) const
{
Eigen::VectorXd phi;

View File

@ -367,6 +367,7 @@ namespace Intrinsic_Delaunay_Triangulation_3 {
edge_id_map = get(Edge_property_tag(), const_cast<TriangleMesh&>(tm));
Index edge_i = 0;
BOOST_FOREACH(edge_descriptor ed, edges(tm)){
std::cout << ed << std::endl;
mark_edges(edge_i,0)=1;
edge_lengths(edge_i,0) = Polygon_mesh_processing::edge_length(halfedge(ed,tm),tm);
put(edge_id_map, ed, edge_i++);
@ -408,7 +409,7 @@ namespace Intrinsic_Delaunay_Triangulation_3 {
double e2_len = edge_lengths(e2,0);
double e3_len = edge_lengths(e3,0);
double angle_a = -(e2_len*e2_len) + e3_len*e3_len + e1_len*e1_len;
angle_a = angle_a/(2*e3_len*e1_len);
angle_a = acos(angle_a/(2*e3_len*e1_len));
Point_2 p31(e3_len*std::cos(angle_a), e3_len*std::sin(angle_a));
put(hcm,hd,p31);

View File

@ -109,26 +109,28 @@ void check_no_update(const Idt& sm, const Vertex_distance_map& original, const V
int main(int argc, char*argv[])
{
Surface_mesh sm;
Vertex_distance_map vdm = get(Vertex_distance_tag(),sm);
Idt idt(sm, vdm);
bool idf = false;
std::ifstream in((argc>1)?argv[1]:"data/pyramid0.off");
std::ifstream in((argc>1)?argv[1]:"data/pyramid1.off");
in >> sm;
if(!in || num_vertices(sm) == 0) {
std::cerr << "Problem loading the input data" << std::endl;
return 1;
}
Vertex_distance_map vdm = get(Vertex_distance_tag(),sm);
Idt idt(sm, vdm);
//source set tests
Heat_method hm(idt, idt.vertex_distance_map());
// hm.add_source(* vertices(idt).first);
hm.add_source(boost::graph_traits<Idt>::vertex_descriptor(boost::graph_traits<Surface_mesh>::vertex_descriptor(0),sm));
hm.update();
BOOST_FOREACH(boost::graph_traits<Surface_mesh>::vertex_descriptor vd, vertices(sm)){
std::cout << get(vdm,vd) << std::endl;
}
#if 0