double* NeighborSearch::calculate_jwt(int edge_order) { int np = get_quad_np(); double3* pt = get_quad_pt(); double3* tan = central_rm->get_tangent(active_edge, edge_order); double *jwt = new double[np]; for(int i = 0; i < np; i++) jwt[i] = pt[i][2] * tan[i][2]; return jwt; }
double* NeighborSearch::init_jwt(double** ext_cache_jwt) { ensure_central_pss_rm(this); ensure_active_segment(this); int eo = get_quad_eo(); if (n_neighbors == 1) // go-up or no-transf neighborhood { // Do the same as if assembling standard (non-DG) surface forms. if (ext_cache_jwt[eo] == NULL) { int np = get_quad_np(); double3* pt = get_quad_pt(); double3* tan = central_rm->get_tangent(active_edge, eo); ext_cache_jwt[eo] = new double[np]; for(int i = 0; i < np; i++) ext_cache_jwt[eo][i] = pt[i][2] * tan[i][2]; } return ext_cache_jwt[eo]; } else // go-down neighborhood { // Also take into account the transformations of the central element. Key key(eo, active_segment); if (cache_jwt[key] == NULL) { int np = get_quad_np(); double3* pt = get_quad_pt(); double3* tan = central_rm->get_tangent(active_edge, eo); cache_jwt[key] = new double[np]; for(int i = 0; i < np; i++) cache_jwt[key][i] = pt[i][2] * tan[i][2]; } return cache_jwt[key]; } }