本文整理汇总了C++中Triangulation::point方法的典型用法代码示例。如果您正苦于以下问题:C++ Triangulation::point方法的具体用法?C++ Triangulation::point怎么用?C++ Triangulation::point使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Triangulation
的用法示例。
在下文中一共展示了Triangulation::point方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: move_info
void move_info(Triangulation& T) {
for(F_v_it fv=T.finite_vertices_begin();
fv!=T.finite_vertices_end();
fv++) {
Periodic_point rr=T.periodic_point(fv);
Point r=T.point(rr); // current point
fv->alpha0.set( fv->alpha() );
fv->rold.set(r);
fv->Uold.set(fv->U());
// fv->Ustar.set(fv->U());
// fv->p.set(fv->p() + fv->pstar() );
}
return;
}
示例2: clone
void clone(const Triangulation& Tfrom,Triangulation& Tto) {
for(F_v_it vit=Tfrom.vertices_begin();
vit != Tfrom.vertices_end();
vit++) {
Periodic_point pp=Tfrom.periodic_point(vit);
Point p=Tfrom.point(pp);
Vertex_handle fv=Tto.insert( p );
fv->rold.set( p );
fv->U.set( vit->U.val() );
fv->Uold.set( vit->U.val() );
fv->idx.set( vit->idx.val() );
}
return;
}
示例3: move
FT move(Triangulation& Tp, const FT dt , FT& dd0 ) {
vector<data_kept> prev;
FT dd2=0;
bool first=false; // debug
for(F_v_it fv=Tp.finite_vertices_begin();
fv!=Tp.finite_vertices_end();
fv++) {
data_kept data(fv);
Vector_2 vel = fv->U();
Vector_2 disp = dt * vel;
Periodic_point rr=Tp.periodic_point(fv);
Point rnow=Tp.point(rr); // current point
Point r0=fv->rold(); // starting point
Point rnew= r0 + disp;
Vector_2 disp2 = per_vect(rnew,rnow);
FT rel_disp = sqrt(disp2.squared_length() ) / simu.h();
FT rel_disp0= sqrt( disp.squared_length() ) / simu.h();
if(first) {
cout
<< "r0 " << r0 << " "
<< "rnow " << rnow << " "
<< "rnew " << rnew << " "
<< "disp2 " << disp2 << " "
<< " idx " << fv->idx() << " "
<< "rel_disp " << rel_disp
<< endl ;
first=false;
}
dd2 += rel_disp;
dd0 += rel_disp0;
// cout << "New position: " << r0 ;
data.pos = per_point( rnew );
// cout << " ---> " << data.pos << endl ;
prev.push_back (data);
}
// cout << "relative displacement " << sqrt(dd2)/simu.no_of_points()/simu.h() << endl ;
dd2 /= simu.no_of_particles();
dd0 /= simu.no_of_particles();
// cout << "relative displacement " << dd2 << endl ;
Tp.clear(); // clears the triangulation !!
for(vector<data_kept>::iterator data=prev.begin();
data!=prev.end();
data++) {
// cout << "Inserting back at " << data->pos << endl ;
Vertex_handle fv=Tp.insert(data->pos);
data->restore(fv);
// return info to vertices
}
// cout << "Insertion done" << endl ;
Tp.convert_to_1_sheeted_covering();
return dd2;
}