示例#1
0
  inline void operator()(int i)
  {
    dest_rows[i] = rows[i];
    int offset = i*ncols_per_row;
    int ix = row_coords[i*3];
    int iy = row_coords[i*3+1];
    int iz = row_coords[i*3+2];
    GlobalOrdinalType nnz = 0;
    for(int sz=-1; sz<=1; ++sz)
      for(int sy=-1; sy<=1; ++sy)
        for(int sx=-1; sx<=1; ++sx) {
          GlobalOrdinalType col_id =
              miniFE::get_id<GlobalOrdinalType>(global_nodes_x, global_nodes_y, global_nodes_z,
                                   ix+sx, iy+sy, iz+sz);
          if (col_id >= 0 && col_id < global_nrows) {
            GlobalOrdinalType col = mesh->map_id_to_row(col_id);
            dest_cols[offset+nnz] = col;
            dest_coefs[offset+nnz] = 0;
            ++nnz;
          }
        }

    sort_if_needed(&dest_cols[offset], nnz);

  }
示例#2
0
  inline void operator()(int i)
  {
    dest_rows[i] = rows[i];
    int offset = row_offsets[i];
    dest_rowoffsets[i] = offset;
    int ix = row_coords[i*3];
    int iy = row_coords[i*3+1];
    int iz = row_coords[i*3+2];
    GlobalOrdinalType nnz = 0;
    for(int sz=-1; sz<=1; ++sz) {
      for(int sy=-1; sy<=1; ++sy) {
        for(int sx=-1; sx<=1; ++sx) {
          GlobalOrdinalType col_id =
              miniFE::get_id<GlobalOrdinalType>(global_nodes_x, global_nodes_y, global_nodes_z,
                                   ix+sx, iy+sy, iz+sz);
          if (col_id >= 0 && col_id < global_nrows) {
            GlobalOrdinalType col = mesh->map_id_to_row(col_id);
            if (col >= global_nrows) {
              std::cout << "mesh->map_id_to_row produced col="<<col<<" from col_id="<<col_id<<", but global_nrows="<<global_nrows<<", max_row_in_map="<<mesh->max_row_in_map()<<", proc="<<proc<<std::endl;
            }
            dest_cols[offset+nnz] = col;
            dest_coefs[offset+nnz] = 0;
            ++nnz;
          }
        }
      }
    }

    sort_if_needed(&dest_cols[offset], nnz);
  }