Skip to content

Commit

Permalink
fixing adaptive list 4
Browse files Browse the repository at this point in the history
  • Loading branch information
euklid committed Aug 31, 2015
1 parent b602d7f commit 1b0c2fc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kernel_laplace_constant_element_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ std::vector<complex_t> KernLapConstEl2D::calc_local_exp_cmp(const std::vector<El
// using recursive multiplication get all exponentiations for a fixed element to compute
// moments using L_k(z_l) = \sum_{i=1}^n q(e_i)*conj(tangent_normed_i)*{-(k-2)!/(end_i-center)^(k-1) + (k-2)!/(start_i-center)^(k-1)}
// for k >=2
// We have L_1(z_l) = \sum_{i=1}^n q(e_i)*conj(tangent_normed_i)*{-log(end_i-center) + log(start_i-center) }
// We have L_1(z_l) = \sum_{i=1}^n q(e_i)*conj(tangent_normed_i)*{log(end_i-center) - log(start_i-center) }
// and L_0(z_l) = \sum_{i=1}^n q(e_i)*conj(tangent_normed_i)*{-((end_i-center)*(log(end_i-center) - 1)) + (start_i-center)*(log(start_i-center)-1) }
std::vector<complex_t> loc_exps(num_loc_exps,0);
unsigned int num_el = elements.size();
Expand Down
30 changes: 25 additions & 5 deletions tree2d_ada.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,28 @@ void Tree2D_Ada::make_other_levels_lists()
}


void make_list4(Cell * const cell, Cell * const neighbor)
{
std::vector<Cell*> stack;
stack.push_back(neighbor);
Cell * cur_cell;
while(!stack.empty())
{
cur_cell = stack.back();
stack.pop_back();
if(cur_cell->is_leaf())
{
// the bigger cell cell is in list 4 of cur_cell
cur_cell->add_to_list(cell,3);
}
else
{
std::vector<Cell*> const & children = cur_cell->get_children();
stack.insert(stack.end(),children.begin(),children.end());
}
}
}

void Tree2D_Ada::generate_lists134(Cell * const cell, Cell * const neighbor)
{
if(neighbor->is_leaf())
Expand Down Expand Up @@ -286,12 +308,10 @@ void Tree2D_Ada::generate_lists134(Cell * const cell, Cell * const neighbor)
{
// the cur_cell's father was a direct neighbor to cell, otherwise
// it wouldn't be in the stack. but cur_cell is not a direct
// neighbor to cell --> cur_cell is in list 3 of cell and we don't
// care for its children
// neighbor to cell --> cur_cell is in list 3 of cell
cell->add_to_list(cur_cell,2);
cur_cell->add_to_list(cell,3);
// and all its descendents are in list 4
make_list4(cell,cur_cell);
}

}

}

0 comments on commit 1b0c2fc

Please sign in to comment.