DSC
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
velocity_function.h
1 //
2 // Deformabel Simplicial Complex (DSC) method
3 // Copyright (C) 2013 Technical University of Denmark
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // See licence.txt for a copy of the GNU General Public License.
16 
17 #pragma once
18 
19 #include <chrono>
20 #include <ctime>
21 #include "DSC.h"
22 
23 namespace DSC {
24 
29  {
30  double compute_time = 0.;
31  double deform_time = 0.;
32 
33  double total_compute_time = 0.;
34  double total_deform_time = 0.;
35 
36  protected:
37  int time_step = 0;
38  int MAX_TIME_STEPS;
39  int deform_time_steps = 10;
40 
41  double VELOCITY; // Determines the distance each interface vertex moves at each iteration.
42  double ACCURACY; // Determines the accuracy of the final result.
43 
44  std::vector<vec3> pos_old;
45 
46  public:
50  VelocityFunc(double velocity, double accuracy, int max_time_steps);
51 
52  virtual ~VelocityFunc();
53 
57  virtual std::string get_name() const;
58 
62  int get_time_step() const;
63 
64  virtual void set_max_time_steps(int max_time_steps);
65 
69  double get_velocity() const;
70 
71  virtual void set_velocity(double vel);
72 
76  double get_accuracy() const;
77 
78  virtual void set_accuracy(double acc);
79 
83  double get_deform_time() const;
84 
88  double get_compute_time() const;
89 
93  double get_total_deform_time() const;
94 
98  double get_total_compute_time() const;
99 
100  protected:
104  void update_compute_time(const std::chrono::time_point<std::chrono::system_clock>& start_time);
105 
109  void update_deform_time(const std::chrono::time_point<std::chrono::system_clock>& start_time);
110 
114  virtual void deform(DeformableSimplicialComplex& dsc);
115 
116  public:
121 
126 
130  virtual void test(DeformableSimplicialComplex& dsc);
131 
132  };
133 
134 }
virtual std::string get_name() const
Definition: velocity_function.cpp:11
void take_time_step(DeformableSimplicialComplex &dsc)
Definition: velocity_function.cpp:105
Definition: velocity_function.h:28
void update_deform_time(const std::chrono::time_point< std::chrono::system_clock > &start_time)
Definition: velocity_function.cpp:61
int get_time_step() const
Definition: velocity_function.cpp:15
virtual void test(DeformableSimplicialComplex &dsc)
Definition: velocity_function.cpp:114
double get_compute_time() const
Definition: velocity_function.cpp:43
VelocityFunc(double velocity, double accuracy, int max_time_steps)
Definition: velocity_function.cpp:3
double get_total_deform_time() const
Definition: velocity_function.cpp:47
double get_velocity() const
Definition: velocity_function.cpp:23
double get_total_compute_time() const
Definition: velocity_function.cpp:51
virtual void deform(DeformableSimplicialComplex &dsc)
Definition: velocity_function.cpp:67
double get_accuracy() const
Definition: velocity_function.cpp:31
double get_deform_time() const
Definition: velocity_function.cpp:39
void update_compute_time(const std::chrono::time_point< std::chrono::system_clock > &start_time)
Definition: velocity_function.cpp:55
virtual bool is_motion_finished(DeformableSimplicialComplex &dsc)
Definition: velocity_function.cpp:75