本文整理汇总了C++中Triangulation::vertices_end方法的典型用法代码示例。如果您正苦于以下问题:C++ Triangulation::vertices_end方法的具体用法?C++ Triangulation::vertices_end怎么用?C++ Triangulation::vertices_end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Triangulation
的用法示例。
在下文中一共展示了Triangulation::vertices_end方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load_fields_from_fft
void load_fields_from_fft(const CH_FFT& fft , Triangulation& T ) {
int Nb = fft.Nx();
c_array vx = fft.field_vel_x();
c_array vy = fft.field_vel_y();
c_array al = fft.field_f();
for(F_v_it vit=T.vertices_begin();
vit != T.vertices_end();
vit++) {
int nx = vit->nx.val();
int ny = vit->ny.val();
// "right" ordering
int i = ( Nb - 1 ) - ny ;
int j = nx;
// "wrong" ordering
// int i = nx;
// int j = ny;
vit->U.set( Vector_2( real(vx(i,j)) , real(vy(i,j)) ) );
vit->alpha.set( real( al(i,j) ) );
// TODO: return more fields (chem pot, pressure, force, etc)
}
return;
}
示例2: load_alpha_on_fft
void load_alpha_on_fft( const Triangulation& T , CH_FFT& fft ) {
int Nb = fft.Nx();
size_t align=fft.alignment();
c_array al( Nb , Nb , align );
for(F_v_it vit=T.vertices_begin();
vit != T.vertices_end();
vit++) {
int nx = vit->nx.val();
int ny = vit->ny.val();
// "right" ordering
int i = ( Nb - 1 ) - ny ;
int j = nx;
// "wrong" ordering
// int i = nx;
// int j = ny;
FT val = vit->alpha0.val();
//FT val = vit->alpha.val();
al(i,j) = val;
}
fft.set_f( al );
return;
}
示例3: load_fields_on_fft
void load_fields_on_fft( const Triangulation& T , CH_FFT& fft ) {
int Nb = fft.Nx();
size_t align=fft.alignment();
c_array u0x( Nb , Nb , align );
c_array u0y( Nb , Nb , align );
// fully implicit
c_array uux( Nb , Nb , align );
c_array uuy( Nb , Nb , align );
for(F_v_it vit=T.vertices_begin();
vit != T.vertices_end();
vit++) {
int nx = vit->nx.val();
int ny = vit->ny.val();
// "right" ordering
int i = ( Nb - 1 ) - ny ;
int j = nx;
// "wrong" ordering
// int i = nx;
// int j = ny;
Vector_2 v0 = vit->Uold.val();
u0x(i,j) = v0.x();
u0y(i,j) = v0.y();
// fully implicit
//Vector_2 vv = vit->U.val();
//uux(i,j) = vv.x();
//uuy(i,j) = vv.y();
//FT val = vit->alpha.val();
}
fft.set_u( u0x , u0y );
// fully implicit
// hack force field to store current velocity
// fft.set_force( uux , uuy );
return;
}
示例4: number
void number(Triangulation& T) {
int i=0;
for(F_v_it vit=T.vertices_begin();
vit != T.vertices_end();
vit++) {
// vit->indx.set(i); //or
vit->idx=i;
++i;
}
return;
}
示例5: number
void number(Triangulation& T) {
int idx=0;
int N=simu.no_of_particles();
int Nb=sqrt(N + 1e-12);
FT spacing=LL/FT(Nb+0);
FT side=LL-1*spacing;
for(F_v_it vit=T.vertices_begin();
vit != T.vertices_end();
vit++) {
// vit->indx.set(i); //or
vit->idx = idx;
FT x = vit->point().x() + side/2.0;
FT y = vit->point().y() + side/2.0;
int i = rint( FT(Nb) * x / LL );//+ 0.5);
int j = rint( FT(Nb) * y / LL );//+ 0.5);
// --i; --j;
vit->nx = i;
vit->ny = j;
// cout << idx
// << " " << i
// << " " << j
// << " " << x
// << " " << y
// << endl;
++idx;
}
return;
}
示例6: 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;
}
示例7: load_fields_on_fft
void load_fields_on_fft( const Triangulation& T , CH_FFT& fft ) {
int Nb = fft.Nx();
size_t align=fft.alignment();
c_array ux( Nb , Nb , align );
c_array uy( Nb , Nb , align );
for(F_v_it vit=T.vertices_begin();
vit != T.vertices_end();
vit++) {
int nx = vit->nx.val();
int ny = vit->ny.val();
// "right" ordering
int i = ( Nb - 1 ) - ny ;
int j = nx;
// "wrong" ordering
// int i = nx;
// int j = ny;
Vector_2 vv = vit->Uold.val();
//FT val = vit->alpha.val();
ux(i,j) = vv.x();
uy(i,j) = vv.y();
}
fft.set_u( ux , uy );
return;
}