コード例 #1
0
 void fill_table(common::Table<T>& table)
 {
   typedef typename boost::mpl::if_< typename boost::is_integral<T>::type, boost::random::uniform_int_distribution<T>, boost::random::uniform_real_distribution<T> >::type distribution_type;
   distribution_type dist(0, 1);
   const Uint nb_rows = table.size();
   const Uint nb_cols = table.row_size();
   for(Uint i = 0; i != nb_rows; ++i)
   {
     for(Uint j = 0; j != nb_cols; ++j)
     {
       table[i][j] = dist(gen);
     }
   }
 }
コード例 #2
0
ファイル: RCGStrategy.cpp プロジェクト: BijanZarif/coolfluid3
void RCGStrategy::set_coordinates(common::PE::CommPattern& cp, const common::Table< Real >& coords, const common::List< Uint >& used_nodes, const std::vector< bool >& periodic_links_active)
{
  math::LSS::CoordinatesStrategy::set_coordinates(cp, coords, used_nodes, periodic_links_active);
  m_implementation->m_dim = coords.row_size();
  m_implementation->m_xcoords = m_x_coords.empty() ? 0 : &m_x_coords[0];
  m_implementation->m_ycoords = m_y_coords.empty() ? 0 : &m_y_coords[0];
  m_implementation->m_zcoords = m_z_coords.empty() ? 0 : &m_z_coords[0];
  m_implementation->reset_solver();
}
コード例 #3
0
ファイル: Field.hpp プロジェクト: xyuan/coolfluid3
 View view(common::Table<Uint>::ConstRow& indices)
 {
   return array()[ boost::indices[range(indices[0],indices[0]+indices.size())][range()] ];
 }