static void _traverse_fg_write (VsgPRTree3dNodeInfo *node_info, FILE *file) { gchar *indent = alloca (node_info->depth * 2 * sizeof (gchar)+1); memset (indent, ' ', node_info->depth * 2 * sizeof (gchar)); indent[node_info->depth * 2 * sizeof (gchar)] = '\0'; fprintf (file, "%snode c=", indent); vsg_prtree_key3d_write (&node_info->id, file); if (!VSG_PRTREE3D_NODE_INFO_IS_REMOTE (node_info)) { FileAndIndent fai = {file, indent}; /* fprintf (file, " dev="); */ /* aran_development3d_write ((AranDevelopment3d *) node_info->user_data, */ /* file); */ /* fprintf (file, "\n"); */ if (node_info->point_count >0) { fprintf (file, "\n"); g_slist_foreach (node_info->point_list, (GFunc) _pt_write, &fai); } } else fprintf (file, "remote"); fprintf (file, "\n"); }
static void _traverse_count_local_nodes (VsgPRTree3dNodeInfo *node_info, gint *count) { if (! VSG_PRTREE3D_NODE_INFO_IS_REMOTE (node_info)) { (*count) ++; } }
static void clear_func (const VsgPRTree3dNodeInfo *node_info, AranSolver3d *solver) { gpointer node_dev = node_info->user_data; #ifdef VSG_HAVE_MPI if (VSG_PRTREE3D_NODE_INFO_IS_REMOTE (node_info)) return; #endif solver->zero (node_dev); solver->zero_counter ++; }
static void _traverse_fg_write (VsgPRTree3dNodeInfo *node_info, FILE *file) { fprintf (file, "node c="); vsg_vector3d_write (&node_info->center, file); fprintf (file, " dev="); if (!VSG_PRTREE3D_NODE_INFO_IS_REMOTE (node_info)) { aran_development3d_write ((AranDevelopment3d *) node_info->user_data, file); fprintf (file, "\n"); g_slist_foreach (node_info->point_list, (GFunc) _pt_write, file); } fprintf (file, "\n"); }
static void _traverse_bg_write (VsgPRTree3dNodeInfo *node_info, FILE *file) { gdouble x = node_info->lbound.x; gdouble y = -node_info->ubound.y; gdouble w = node_info->ubound.x - x; gdouble h = -node_info->lbound.y - y; gchar *fill = "none"; if (!node_info->isleaf) return; if (VSG_PRTREE3D_NODE_INFO_IS_REMOTE (node_info)) fill = "#ff0000"; fprintf (file, "<rect x=\"%g\" y=\"%g\" width=\"%g\" height=\"%g\" " \ "rx=\"0\" style=\"stroke:#000000; " \ "stroke-linejoin:miter; stroke-linecap:butt; fill:%s;\"/>\n", x, y, w, h, fill); }
static void _vtp_traverse_bg_write (VsgPRTree3dNodeInfo *node_info, FILE *file) { if (! VSG_PRTREE3D_NODE_INFO_IS_REMOTE (node_info)) { gdouble x = node_info->center.x; gdouble y = node_info->center.y; gdouble z = node_info->center.z; gdouble dx = node_info->ubound.x - node_info->center.x; gdouble dy = node_info->ubound.y - node_info->center.y; gdouble dz = node_info->ubound.z - node_info->center.z; fprintf (file, "%g %g %g\n", x - dx, y, z); fprintf (file, "%g %g %g\n", x + dx, y, z); fprintf (file, "%g %g %g\n", x, y - dy, z); fprintf (file, "%g %g %g\n", x, y + dy, z); fprintf (file, "%g %g %g\n", x, y, z - dz); fprintf (file, "%g %g %g\n", x, y, z + dz); } }
static void down_func (const VsgPRTree3dNodeInfo *node_info, AranSolver3d *solver) { gpointer node_dev = node_info->user_data; #ifdef VSG_HAVE_MPI if (VSG_PRTREE3D_NODE_INFO_IS_REMOTE (node_info)) return; #endif if (solver->l2l != NULL && node_info->point_count != 0 && node_info->father_info) { /* Local to Local translation */ solver->l2l (node_info->father_info, node_info->father_info->user_data, node_info, node_dev); solver->l2l_counter ++; } if ((node_info->isleaf)) { if (solver->l2p != NULL) { GSList *node_list = node_info->point_list; while (node_list) { VsgPoint3 node_point = (VsgPoint3) node_list->data; /* Local to Particle distribution */ solver->l2p (node_info, node_dev, node_point); solver->l2p_counter ++; node_list = node_list->next; } } } }
static void up_func (const VsgPRTree3dNodeInfo *node_info, AranSolver3d *solver) { gpointer node_dev = node_info->user_data; #ifdef VSG_HAVE_MPI if (VSG_PRTREE3D_NODE_INFO_IS_REMOTE (node_info)) return; #endif if (node_info->isleaf) { if (solver->p2m != NULL) { GSList *node_list = node_info->point_list; while (node_list) { VsgPoint3 node_point = (VsgPoint3) node_list->data; /* Particle to Multipole gathering */ solver->p2m (node_point, node_info, node_dev); solver->p2m_counter ++; node_list = node_list->next; } } } if (solver->m2m != NULL && node_info->point_count != 0 && node_info->father_info) { /* Multipole to Multipole translation */ solver->m2m (node_info, node_dev, node_info->father_info, node_info->father_info->user_data); solver->m2m_counter ++; } }