Esempio n. 1
0
Eigen::Vector3d HTProcess::getFlux(std::size_t element_id,
                                   MathLib::Point3d const& p,
                                   double const t,
                                   GlobalVector const& x) const
{
    // fetch local_x from primary variable
    std::vector<GlobalIndexType> indices_cache;
    auto const r_c_indices = NumLib::getRowColumnIndices(
        element_id, *_local_to_global_index_map, indices_cache);
    std::vector<double> local_x(x.get(r_c_indices.rows));

    return _local_assemblers[element_id]->getFlux(p, t, local_x);
}
Esempio n. 2
0
  KOKKOS_INLINE_FUNCTION
  void operator() (device_type device) const
  {
    typename local_view_type::Partition part( device.team_rank() , device.team_size() );
    const local_view_type local_x( dev_x , part );
    const local_view_type local_y( dev_y , part );
    const int element = device.league_rank();

    // Apply evaluation function to this thread's fix-sized UQ sample set.
    simple_function< value_type >( local_x(element) , local_y(element) );

    // Print x and y
    if (print) {

      device.team_barrier();

      if ( ! device.league_rank() && ! device.team_rank() ) {
        printf("view_kernel league(%d:%d) team_size(%d) dim(%d) size(%d)\n",
               device.league_rank(), device.league_size(),device.team_size(),
               int(dev_x.dimension_1()), int(local_x(element).size()) );
      }

      if ( ! device.team_rank() ) {
        printf("x(%i) = { ",element);
        for (int sample=0; sample< int(dev_x.dimension_1()); ++sample) {
          printf("%g ", dev_x(element,sample));
        }
        printf("}\n\n");
        printf("y(%i) = { ",element);
        for (int sample=0; sample< int(dev_y.dimension_1()); ++sample) {
          printf("%g ", dev_y(element,sample));
        }
        printf("}\n\n");
      }

      device.team_barrier();
    }
  }