mirror of https://github.com/CGAL/cgal
add testsuit for triangular vector field
This commit is contained in:
parent
fe90baad79
commit
81f1c566e2
|
|
@ -28,6 +28,12 @@ typedef Stl_rungk::Point_iterator_2 Point_iterator;
|
|||
typedef Stl_rungk::Point_2 Point_2;
|
||||
typedef Stl_rungk::Vector_2 Vector_2;
|
||||
|
||||
typedef CGAL::Triangular_field_2<K> TRField;
|
||||
typedef CGAL::Runge_kutta_integrator_2<TRField> TRRunge_kutta_integrator;
|
||||
typedef CGAL::Stream_lines_2<TRField, TRRunge_kutta_integrator> TRStl;
|
||||
typedef TRStl::Stream_line_iterator_2 TRStl_iterator;
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
for (int i=1;i<=23;i++)
|
||||
|
|
@ -68,12 +74,33 @@ int main()
|
|||
Stream_lines_rungk.print_stream_lines(fw);
|
||||
fw.close();
|
||||
/* the placement of streamlines using Euler integrator */
|
||||
std::cout << "using Runge-Kutta integrator\n";
|
||||
std::cout << "using Euler integrator\n";
|
||||
Euler_integrator euler_integrator;
|
||||
dSep = 3.5;
|
||||
dRat = 1.6;
|
||||
Stl_euler Stream_lines(regular_grid_2, euler_integrator,dSep,dRat,1);
|
||||
std::cout << "placement generated\n";
|
||||
}
|
||||
|
||||
std::cout << "placement of streamlines on irregular field\n";
|
||||
TRRunge_kutta_integrator trrunge_kutta_integrator(1);
|
||||
std::ifstream inp("data/datap.tri.cin");
|
||||
std::ifstream inv("data/datav.tri.cin");
|
||||
std::istream_iterator<Point_2> beginp(inp);
|
||||
std::istream_iterator<Vector_2> beginv(inv);
|
||||
std::istream_iterator<Point_2> endp;
|
||||
TRField triangular_field(beginp, endp, beginv);
|
||||
/* the placement of streamlines */
|
||||
std::cout << "processing...\n";
|
||||
double dSep = 38.0;
|
||||
double dRat = 1.6;
|
||||
TRStl TRStream_lines(triangular_field, trrunge_kutta_integrator,dSep,dRat);
|
||||
std::cout << "placement generated\n";
|
||||
std::cout << "updating parameters...\n";
|
||||
TRStream_lines.set_separating_distance(45.0);
|
||||
TRStream_lines.set_saturation_ratio(1.7);
|
||||
TRStream_lines.update();
|
||||
std::cout << "placement generated\n";
|
||||
|
||||
std::cout << "success\n";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue