DGtal  1.5.beta
testVectorsInHeat.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "ConfigTest.h"
#include "DGtalCatch.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/dec/PolygonalCalculus.h"
#include "DGtal/dec/VectorsInHeat.h"
#include "DGtal/shapes/SurfaceMesh.h"
#include "DGtal/shapes/MeshHelpers.h"
Include dependency graph for testVectorsInHeat.cpp:

Go to the source code of this file.

Functions

 TEST_CASE ("Testing VectorsInHeat")
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
Baptiste GENEST (bapti.nosp@m.steg.nosp@m.enest.nosp@m.@gma.nosp@m.il.co.nosp@m.m ) internship at Laboratoire d'InfoRmatique en Image et Systemes d'information - LIRIS (CNRS, UMR 5205), CNRS, France
Date
2022/06/15

Functions for testing class VectorsInHeat.

This file is part of the DGtal library.

Definition in file testVectorsInHeat.cpp.

Function Documentation

◆ TEST_CASE()

TEST_CASE ( "Testing VectorsInHeat )

Definition at line 47 of file testVectorsInHeat.cpp.

48 {
50  std::vector<RealPoint> positions = { RealPoint( 0, 0, 0 ) ,
51  RealPoint( 1, 0, 0 ) ,
52  RealPoint( 0, 1, 0 ) ,
53  RealPoint( 1, 1, 0 ) ,
54  RealPoint( 0, 0, 1 ) ,
55  RealPoint( 1, 0, 1 ) ,
56  RealPoint( 0, 1, 1 ) ,
57  RealPoint( 1, 1, 1 ) ,
58  RealPoint( 1, 0, 2 ) ,
59  RealPoint( 0, 0, 2 ) };
60  std::vector<Mesh::Vertices> faces = { { 1, 0, 2, 3 },
61  { 0, 1, 5, 4 } ,
62  { 1, 3, 7, 5 } ,
63  { 3, 2, 6, 7 } ,
64  { 2, 0, 4, 6 } ,
65  { 4, 5, 8, 9 } };
66 
67  Mesh box(positions.cbegin(), positions.cend(),
68  faces.cbegin(), faces.cend());
69 
71 
72 
73  SECTION("Construction and basic operators")
74  {
76  REQUIRE( heat.isValid() == false );
77 
78  trace.beginBlock("init solvers");
79  heat.init(0.1);
80  trace.endBlock();
81  REQUIRE( heat.isValid() );
82 
83  heat.addSource(0,Eigen::Vector3d(0.1,0.2,0.3));
84  std::vector<VectorsInHeat<PolygonalCalculus<RealPoint,RealVector>>::Vector> d = heat.compute();
85  REQUIRE( d.size() == positions.size() );
86  REQUIRE( d[5][0] == Approx(-0.111302) );
87 
88  heat.clearSource();
90  REQUIRE( sources.sum() == 0);
91  }
92 }
Aim: This class is defined to represent a surface mesh through a set of vertices and faces....
Definition: Mesh.h:92
Implements differential operators on polygonal surfaces from .
void beginBlock(const std::string &keyword="")
double endBlock()
This class implements on polygonal surfaces (using Discrete differential calculus on polygonal surfa...
Definition: VectorsInHeat.h:63
GeodesicsInHeat< PolyCalculus > * heat
Trace trace
Definition: Common.h:153
Aim: Represents an embedded mesh as faces and a list of vertices. Vertices may be shared among faces ...
Definition: SurfaceMesh.h:92
SECTION("Testing constant forward iterators")
REQUIRE(domain.isInside(aPoint))
PointVector< 3, double > RealPoint

References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), heat, REQUIRE(), SECTION(), and DGtal::trace.