23 template<
typename Scalar>
25 supported_shapes(NULL),
33 if(central_el == NULL || central_el->
active != 1)
34 throw Exceptions::Exception(
"You must pass an active element to the NeighborSearch constructor.");
36 neighbor_edges.reserve(2);
40 neighborhood_type = H2D_DG_NOT_INITIALIZED;
41 original_central_el_transform = 0;
44 template<
typename Scalar>
46 supported_shapes(NULL),
48 central_transformations(LightArray<Transformations*>(4)),
49 neighbor_transformations(LightArray<Transformations*>(4)),
50 central_el(ns.central_el),
52 neighbor_edge(ns.neighbor_edge),
53 active_segment(ns.active_segment)
56 neighbor_edges.reserve(2);
58 for(
unsigned int j = 0; j < ns.central_transformations.get_size(); j++)
59 if(ns.central_transformations.present(j))
62 Transformations *tmp =
new Transformations(ns.central_transformations.get(j));
63 this->central_transformations.add(tmp, j);
65 for(
unsigned int j = 0; j < ns.neighbor_transformations.get_size(); j++)
66 if(ns.neighbor_transformations.present(j))
69 Transformations *tmp =
new Transformations(ns.neighbor_transformations.get(j));
70 this->neighbor_transformations.add(tmp, j);
73 if(central_el == NULL || central_el->
active != 1)
74 throw Exceptions::Exception(
"You must pass an active element to the NeighborSearch constructor.");
76 for(
unsigned int i = 0; i < ns.neighbors.size(); i++)
77 this->neighbors.push_back(ns.neighbors[i]);
78 for(
unsigned int i = 0; i < ns.neighbor_edges.size(); i++)
79 this->neighbor_edges.push_back(ns.neighbor_edges[i]);
82 n_neighbors = ns.n_neighbors;
83 neighborhood_type = ns.neighborhood_type;
84 original_central_el_transform = ns.original_central_el_transform;
85 quad = (&g_quad_2d_std);
86 active_edge = ns.active_edge;
89 template<
typename Scalar>
92 neighbor_edges.clear();
94 clear_supported_shapes();
96 for(
unsigned int i = 0; i < central_transformations.get_size(); i++)
97 if(this->central_transformations.present(i))
98 delete this->central_transformations.get(i);
99 for(
unsigned int i = 0; i < neighbor_transformations.get_size(); i++)
100 if(this->neighbor_transformations.present(i))
101 delete this->neighbor_transformations.get(i);
104 template<
typename Scalar>
110 template<
typename Scalar>
116 template<
typename Scalar>
119 if(supported_shapes != NULL)
delete supported_shapes; supported_shapes = NULL;
122 template<
typename Scalar>
125 this->ignore_errors = value;
128 template<
typename Scalar>
132 for(
unsigned int i = 0; i < n_neighbors; i++)
134 if(this->central_transformations.present(i))
135 this->central_transformations.get(i)->reset();
136 if(this->neighbor_transformations.present(i))
137 this->neighbor_transformations.get(i)->reset();
144 neighbor_edge.local_num_of_edge = 0;
147 neighbor_edges.clear();
151 neighborhood_type = H2D_DG_NOT_INITIALIZED;
154 template<
typename Scalar>
161 if(central_el->en[active_edge]->bnd == 0)
163 neighb_el = central_el->get_neighbor(active_edge);
166 if(neighb_el != NULL)
171 for (
unsigned int j = 0; j < neighb_el->get_nvert(); j++)
172 if(central_el->en[active_edge] == neighb_el->en[j])
174 neighbor_edge.local_num_of_edge = j;
182 int p1 = central_el->vn[active_edge]->id;
183 int p2 = central_el->vn[(active_edge + 1) % central_el->get_nvert()]->id;
184 local_edge_info.
orientation = neighbor_edge_orientation(p1, p2, 0);
186 neighbor_edges.push_back(local_edge_info);
190 neighbors.push_back(neighb_el);
193 neighborhood_type = H2D_DG_NO_TRANSF;
198 Node* vertex = mesh->peek_vertex_node(central_el->en[active_edge]->p1, central_el->en[active_edge]->p2);
201 int orig_vertex_id[2];
202 orig_vertex_id[0] = central_el->vn[active_edge]->
id;
203 orig_vertex_id[1] = central_el->vn[(active_edge + 1) % central_el->get_nvert()]->id;
207 neighborhood_type = H2D_DG_GO_UP;
212 Node** par_mid_vertices =
new Node*[Transformations::max_level];
216 for (
unsigned int j = 0; j < (unsigned) Transformations::max_level; j++)
217 par_mid_vertices[j] = NULL;
219 find_act_elem_up(parent, orig_vertex_id, par_mid_vertices, n_parents);
221 delete [] par_mid_vertices;
225 neighborhood_type = H2D_DG_GO_DOWN;
227 int sons[Transformations::max_level];
231 find_act_elem_down( vertex, orig_vertex_id, sons, n_sons + 1);
239 throw Hermes::Exceptions::Exception(
"The given edge isn't inner");
242 template<
typename Scalar>
245 Hermes::vector<unsigned int> transformations = get_transforms(original_central_el_transform);
247 if(is_inter_edge(edge, transformations))
249 set_active_edge(edge);
250 update_according_to_sub_idx(transformations);
256 neighb_el = central_el;
260 neighbor_edge.local_num_of_edge = active_edge = edge;
265 neighbor_edges.push_back(local_edge_info);
268 neighbors.push_back(neighb_el);
269 neighborhood_type = H2D_DG_NO_TRANSF;
274 template<
typename Scalar>
277 Hermes::vector<unsigned int> transformations_backwards;
280 transformations_backwards.push_back((sub_idx - 1) & 7);
281 sub_idx = (sub_idx - 1) >> 3;
283 Hermes::vector<unsigned int> transformations;
284 for(
unsigned int i = 0; i < transformations_backwards.size(); i++)
285 transformations.push_back(transformations_backwards[transformations_backwards.size() - 1 - i]);
287 return transformations;
290 template<
typename Scalar>
294 if(transformations.size() == 0)
298 for(
unsigned int i = 0; i < transformations.size(); i++)
299 if(central_el->get_mode() == HERMES_MODE_TRIANGLE)
301 if((edge == 0 && (transformations[i] == 2 || transformations[i] == 3)) ||
302 (edge == 1 && (transformations[i] == 0 || transformations[i] == 3)) ||
303 (edge == 2 && (transformations[i] == 1 || transformations[i] == 3)))
309 if((edge == 0 && (transformations[i] == 2 || transformations[i] == 3 || transformations[i] == 5)) ||
310 (edge == 1 && (transformations[i] == 0 || transformations[i] == 3 || transformations[i] == 6)) ||
311 (edge == 2 && (transformations[i] == 0 || transformations[i] == 1 || transformations[i] == 4)) ||
312 (edge == 3 && (transformations[i] == 1 || transformations[i] == 2 || transformations[i] == 7)))
318 template<
typename Scalar>
321 if(neighborhood_type == H2D_DG_NO_TRANSF || neighborhood_type == H2D_DG_GO_UP)
323 if(!neighbor_transformations.present(0))
327 for(
unsigned int i = 0; i < transformations.size(); i++)
329 if(central_el->get_mode() == HERMES_MODE_TRIANGLE)
330 if((active_edge == 0 && transformations[i] == 0) ||
331 (active_edge == 1 && transformations[i] == 1) ||
332 (active_edge == 2 && transformations[i] == 2))
333 tr->
transf[tr->
num_levels++] = (!neighbor_edge.orientation ? neighbor_edge.local_num_of_edge : (neighbor_edge.local_num_of_edge + 1) % 3);
335 tr->
transf[tr->
num_levels++] = (neighbor_edges[0].orientation ? neighbor_edge.local_num_of_edge : (neighbor_edge.local_num_of_edge + 1) % 3);
338 if((active_edge == 0 && (transformations[i] == 0 || transformations[i] == 6)) ||
339 (active_edge == 1 && (transformations[i] == 1 || transformations[i] == 4)) ||
340 (active_edge == 2 && (transformations[i] == 2 || transformations[i] == 7)) ||
341 (active_edge == 3 && (transformations[i] == 3 || transformations[i] == 5)))
342 tr->
transf[tr->
num_levels++] = (!neighbor_edge.orientation ? neighbor_edge.local_num_of_edge : (neighbor_edge.local_num_of_edge + 1) % 4);
343 else if((active_edge == 0 && (transformations[i] == 1 || transformations[i] == 7)) ||
344 (active_edge == 1 && (transformations[i] == 2 || transformations[i] == 5)) ||
345 (active_edge == 2 && (transformations[i] == 3 || transformations[i] == 6)) ||
346 (active_edge == 3 && (transformations[i] == 0 || transformations[i] == 4)))
347 tr->
transf[tr->
num_levels++] = (neighbor_edge.orientation ? neighbor_edge.local_num_of_edge : (neighbor_edge.local_num_of_edge + 1) % 4);
349 else handle_sub_idx_way_down(transformations);
352 template<
typename Scalar>
355 Hermes::vector<unsigned int> neighbors_to_be_deleted;
356 Hermes::vector<unsigned int> neighbors_not_to_be_deleted;
358 Hermes::vector<unsigned int> updated_transformations;
359 for(
int i = 0; i < transformations.size(); i++)
361 if(! ((active_edge == 0 && transformations[i] == 4) || (active_edge == 1 && transformations[i] == 7) || (active_edge == 2 && transformations[i] == 5) || (active_edge == 3 && transformations[i] == 6)) )
363 if(active_edge == 0 && transformations[i] == 6)
364 updated_transformations.push_back(0);
365 else if(active_edge == 0 && transformations[i] == 7)
366 updated_transformations.push_back(1);
367 else if(active_edge == 1 && transformations[i] == 4)
368 updated_transformations.push_back(1);
369 else if(active_edge == 1 && transformations[i] == 5)
370 updated_transformations.push_back(2);
371 else if(active_edge == 2 && transformations[i] == 6)
372 updated_transformations.push_back(3);
373 else if(active_edge == 2 && transformations[i] == 7)
374 updated_transformations.push_back(2);
375 else if(active_edge == 3 && transformations[i] == 4)
376 updated_transformations.push_back(0);
377 else if(active_edge == 3 && transformations[i] == 5)
378 updated_transformations.push_back(3);
380 updated_transformations.push_back(transformations[i]);
385 for(
unsigned int neighbor_i = 0; neighbor_i < n_neighbors; neighbor_i++)
387 bool deleted =
false;
389 Transformations* current_transforms = central_transformations.get(neighbor_i);
391 for(
unsigned int level = 0; level < std::min((
unsigned int)updated_transformations.size(), current_transforms->
num_levels); level++)
394 if(!compatible_transformations(current_transforms->
transf[level], updated_transformations[level], active_edge))
420 neighbors_to_be_deleted.push_back(neighbor_i);
422 neighbors_not_to_be_deleted.push_back(neighbor_i);
426 if(neighbors_to_be_deleted.size() > 0)
427 for(
unsigned int neighbors_to_be_deleted_i = neighbors_to_be_deleted.size(); neighbors_to_be_deleted_i >= 1; neighbors_to_be_deleted_i--)
428 delete_neighbor(neighbors_to_be_deleted[neighbors_to_be_deleted_i - 1]);
431 template<
typename Scalar>
438 if((a == 0 && (b == 6 || b == 4)) ||
439 (a == 1 && (b == 7 || b == 4)))
446 if((a == 1 && (b == 4 || b == 7)) ||
447 (a == 2 && (b == 5 || b == 7)))
454 if((a == 2 && (b == 7 || b == 5)) ||
455 (a == 3 && (b == 6 || b == 5)))
462 if((a == 3 && (b == 5 || b == 6)) ||
463 (a == 0 && (b == 4 || b == 6)))
471 template<
typename Scalar>
474 if(neighborhood_type != H2D_DG_GO_DOWN)
477 Hermes::vector<unsigned int> transformations = get_transforms(original_central_el_transform);
479 Hermes::vector<unsigned int> updated_transformations;
480 for(
int i = 0; i < transformations.size(); i++)
482 if(! ((active_edge == 0 && transformations[i] == 4) || (active_edge == 1 && transformations[i] == 7) || (active_edge == 2 && transformations[i] == 5) || (active_edge == 3 && transformations[i] == 6)) )
484 if(active_edge == 0 && transformations[i] == 6)
485 updated_transformations.push_back(0);
486 else if(active_edge == 0 && transformations[i] == 7)
487 updated_transformations.push_back(1);
488 else if(active_edge == 1 && transformations[i] == 4)
489 updated_transformations.push_back(1);
490 else if(active_edge == 1 && transformations[i] == 5)
491 updated_transformations.push_back(2);
492 else if(active_edge == 2 && transformations[i] == 6)
493 updated_transformations.push_back(3);
494 else if(active_edge == 2 && transformations[i] == 7)
495 updated_transformations.push_back(2);
496 else if(active_edge == 3 && transformations[i] == 4)
497 updated_transformations.push_back(0);
498 else if(active_edge == 3 && transformations[i] == 5)
499 updated_transformations.push_back(3);
501 updated_transformations.push_back(transformations[i]);
506 if(updated_transformations.size() == 0)
509 for(
unsigned int i = 0; i < n_neighbors; i++)
517 while(central_transformations.get(i)->transf[j] == updated_transformations[j])
518 if(++j > updated_transformations.size() - 1)
520 if(j > central_transformations.get(i)->num_levels)
521 j = central_transformations.get(i)->num_levels;
523 for(
unsigned int level = central_transformations.get(i)->num_levels; level < updated_transformations.size(); level++)
525 if(!neighbor_transformations.present(i))
528 Transformations* neighbor_transforms = neighbor_transformations.get(i);
531 if(central_el->get_mode() == HERMES_MODE_TRIANGLE)
532 if((active_edge == 0 && updated_transformations[level] == 0) ||
533 (active_edge == 1 && updated_transformations[level] == 1) ||
534 (active_edge == 2 && updated_transformations[level] == 2))
535 neighbor_transforms->
transf[neighbor_transforms->
num_levels++] = (!neighbor_edge.orientation ? neighbor_edge.local_num_of_edge : (neighbor_edge.local_num_of_edge + 1) % 3);
537 neighbor_transforms->
transf[neighbor_transforms->
num_levels++] = (neighbor_edge.orientation ? neighbor_edge.local_num_of_edge : (neighbor_edge.local_num_of_edge + 1) % 3);
540 if((active_edge == 0 && (updated_transformations[level] == 0 || updated_transformations[level] == 6)) ||
541 (active_edge == 1 && (updated_transformations[level] == 1 || updated_transformations[level] == 4)) ||
542 (active_edge == 2 && (updated_transformations[level] == 2 || updated_transformations[level] == 7)) ||
543 (active_edge == 3 && (updated_transformations[level] == 3 || updated_transformations[level] == 5)))
544 neighbor_transforms->
transf[neighbor_transforms->
num_levels++] = (!neighbor_edge.orientation ? neighbor_edge.local_num_of_edge : (neighbor_edge.local_num_of_edge + 1) % 4);
545 else if((active_edge == 0 && (updated_transformations[level] == 1 || updated_transformations[level] == 7)) ||
546 (active_edge == 1 && (updated_transformations[level] == 2 || updated_transformations[level] == 5)) ||
547 (active_edge == 2 && (updated_transformations[level] == 3 || updated_transformations[level] == 6)) ||
548 (active_edge == 3 && (updated_transformations[level] == 0 || updated_transformations[level] == 4)))
549 neighbor_transforms->
transf[neighbor_transforms->
num_levels++] = (neighbor_edge.orientation ? neighbor_edge.local_num_of_edge : (neighbor_edge.local_num_of_edge + 1) % 4);
552 central_transformations.get(i)->strip_initial_transformations(j);
556 template<
typename Scalar>
561 memset(shifted_trfs, 0,
max_level *
sizeof(
unsigned int));
563 for(
unsigned int k = number_of_stripped; k <
num_levels; k++)
564 shifted_trfs[k - number_of_stripped] =
transf[k];
568 num_levels -= number_of_stripped;
571 template<
typename Scalar>
574 for(
unsigned int i = position; i < n_neighbors - 1; i++)
575 central_transformations.get(i)->copy_from(central_transformations.get(i + 1));
577 if(central_transformations.present(n_neighbors - 1))
578 central_transformations.get(n_neighbors - 1)->reset();
580 for(
unsigned int i = position; i < n_neighbors - 1; i++)
582 if(neighbor_transformations.present(i + 1))
584 if(!neighbor_transformations.present(i))
587 neighbor_transformations.get(i)->copy_from(neighbor_transformations.get(i + 1));
590 if(neighbor_transformations.present(n_neighbors - 1))
591 neighbor_transformations.get(n_neighbors - 1)->reset();
593 neighbor_edges.erase (neighbor_edges.begin() + position);
594 neighbors.erase (neighbors.begin() + position);
598 template<
typename Scalar>
607 int p1 = elem->
vn[active_edge]->
id;
608 int p2 = elem->
vn[(active_edge + 1) % elem->get_nvert()]->
id;
610 int id_of_par_orient_1 = p1;
611 int id_of_par_orient_2 = p2;
622 par_mid_vertices[n_parents++] = vertex;
625 throw Hermes::Exceptions::Exception(
"Maximum number of intermediate parents exceeded in NeighborSearch<Scalar>::finding_act_elem_up");
627 if(par_mid_vertices[n_parents - 1]->
id != vertex->
id)
628 par_mid_vertices[n_parents++] = vertex;
631 if((edge == NULL) || (central_el->
en[active_edge]->
id == edge->
id))
634 find_act_elem_up(elem->
parent, orig_vertex_id, par_mid_vertices, n_parents);
638 for (
int i = 0; i < 2; i++)
643 neighb_el = edge->
elem[i];
647 for(
unsigned int j = 0; j < neighb_el->get_nvert(); j++)
648 if(neighb_el->
en[j] == edge)
653 if(neighbor_edge.
local_num_of_edge == -1)
throw Hermes::Exceptions::Exception(
"Neighbor edge wasn't found");
659 assert(n_neighbors == 0);
661 neighbor_transformations.add(
new Transformations, n_neighbors);
662 Transformations *neighbor_transforms = neighbor_transformations.get(n_neighbors);
664 neighbor_transforms->num_levels = n_parents;
668 for(
int j = n_parents - 1; j > 0; j-- )
673 neighbor_transforms->transf[n_parents - j - 1] = neighbor_edge.
local_num_of_edge;
674 p1 = par_mid_vertices[j]->
id;
678 if(n->id == par_mid_vertices[j-1]->
id)
680 neighbor_transforms->transf[n_parents - j - 1] = (neighbor_edge.
local_num_of_edge + 1) % neighb_el->get_nvert();
681 p2 = par_mid_vertices[j]->
id;
685 neighbor_transforms->transf[n_parents - j - 1] = neighbor_edge.
local_num_of_edge;
686 p1 = par_mid_vertices[j]->
id;
692 if(orig_vertex_id[0] == par_mid_vertices[0]->
id)
695 neighbor_transforms->transf[n_parents - 1] = (neighbor_edge.
local_num_of_edge + 1) % neighb_el->get_nvert();
697 NeighborEdgeInfo local_edge_info;
701 local_edge_info.orientation = neighbor_edge_orientation(id_of_par_orient_1, id_of_par_orient_2, 0);
703 neighbor_edges.push_back(local_edge_info);
709 neighbors.push_back(neighb_el);
715 template<
typename Scalar>
716 void NeighborSearch<Scalar>::find_act_elem_down( Node* vertex,
int* bounding_verts_id,
int* sons,
unsigned int n_sons)
718 int mid_vert = vertex->id;
720 bnd_verts[0] = bounding_verts_id[0];
721 bnd_verts[1] = bounding_verts_id[1];
725 for (
int i = 0; i < 2; i++)
727 sons[n_sons-1] = (active_edge + i) % central_el->get_nvert();
738 throw Hermes::Exceptions::Exception(
"wasn't able to find middle vertex");
743 bounding_verts_id[1] = mid_vert;
745 bounding_verts_id[0] = mid_vert;
747 find_act_elem_down( n, bounding_verts_id, sons, n_sons + 1);
749 bounding_verts_id[0] = bnd_verts[0];
750 bounding_verts_id[1] = bnd_verts[1];
755 for (
int j = 0; j < 2; j++)
757 if((edge->elem[j] != NULL) && (edge->elem[j]->active == 1))
763 for(
unsigned int k = 0; k < neighb_el->get_nvert(); k++)
764 if(neighb_el->
en[k] == edge)
770 if(neighbor_edge.
local_num_of_edge == -1)
throw Hermes::Exceptions::Exception(
"Neighbor edge wasn't found");
774 central_transformations.add(
new Transformations, n_neighbors);
775 Transformations *tr = central_transformations.get(n_neighbors);
778 for(
unsigned int k = 0; k < n_sons; k++)
779 tr->transf[k] = sons[k];
780 tr->num_levels = n_sons;
782 NeighborEdgeInfo local_edge_info;
785 local_edge_info.orientation = neighbor_edge_orientation(bnd_verts[0], bnd_verts[1], i);
787 neighbor_edges.push_back(local_edge_info);
791 neighbors.push_back(neighb_el);
798 template<
typename Scalar>
799 int NeighborSearch<Scalar>::neighbor_edge_orientation(
int bounding_vert1,
int bounding_vert2,
int segment)
const
816 template<
typename Scalar>
819 this->central_al =
new AsmList<Scalar>(*other.central_al);
820 this->cnt = other.cnt;
821 this->dof = other.dof;
822 this->neighbor_al =
new AsmList<Scalar>(*other.neighbor_al);
823 this->combine_assembly_lists();
826 template<
typename Scalar>
831 return new_supp_shapes;
834 template<
typename Scalar>
845 template<
typename Scalar>
848 neighb_quad_order = quad->get_edge_points(neighbor_edge.
local_num_of_edge, order, neighbors[active_segment]->get_mode());
849 central_quad_order = quad->get_edge_points(active_edge, order, central_el->get_mode());
852 template<
typename Scalar>
856 return neighb_quad_order;
858 return central_quad_order;
861 template<
typename Scalar>
864 return this->active_segment;
867 template<
typename Scalar>
870 if(index >= n_neighbors)
871 throw Hermes::Exceptions::Exception(
"NeighborSearch<Scalar>::set_active_segment() called with an incorrect index.");
873 this->active_segment = index;
874 this->neighb_el = this->neighbors[index];
875 this->neighbor_edge = this->neighbor_edges[index];
878 template<
typename Scalar>
881 return this->neighb_el;
884 template<
typename Scalar>
887 return this->neighbor_edge;
890 template<
typename Scalar>
893 if(this->central_transformations.present(index))
894 return this->central_transformations.get(index)->num_levels;
899 template<
typename Scalar>
902 if(!this->central_transformations.present(index_1))
903 throw Hermes::Exceptions::Exception(
"Out of bounds of central_transformations.");
905 throw Hermes::Exceptions::Exception(
"Trying to access transformation deeper than allowed.");
907 return this->central_transformations.get(index_1)->transf[index_2];
910 template<
typename Scalar>
913 if(this->neighbor_transformations.present(index))
914 return this->neighbor_transformations.get(index)->num_levels;
919 template<
typename Scalar>
922 if(!this->neighbor_transformations.present(index_1))
923 throw Hermes::Exceptions::Exception(
"Out of bounds of neighbor_transformations.");
925 throw Hermes::Exceptions::Exception(
"Trying to access transformation deeper than allowed.");
927 return this->neighbor_transformations.get(index_1)->transf[index_2];
930 template<
typename Scalar>
940 if(neighbor_transformations.present(active_segment))
941 neighbor_transformations.get(active_segment)->apply_on(fu);
962 template<
typename Scalar>
964 central_al(central_al)
971 template<
typename Scalar>
974 assert(central_al != NULL && neighbor_al != NULL);
975 cnt = central_al->cnt + neighbor_al->cnt;
977 memcpy(dof, central_al->dof,
sizeof(
int)*central_al->cnt);
978 memcpy(dof + central_al->cnt, neighbor_al->dof,
sizeof(
int)*neighbor_al->cnt);
981 template<
typename Scalar>
988 template<
typename Scalar>
994 template<
typename Scalar>
999 combine_assembly_lists();
1002 template<
typename Scalar>
1005 return (index >= central_al->cnt);
1008 template<
typename Scalar>
1011 memset(transf, 0, max_level *
sizeof(
int));
1014 template<
typename Scalar>
1015 NeighborSearch<Scalar>::Transformations::Transformations(
const Transformations* t)
1020 template<
typename Scalar>
1021 NeighborSearch<Scalar>::Transformations::Transformations(
const Hermes::vector<unsigned int>& t)
1026 template<
typename Scalar>
1027 void NeighborSearch<Scalar>::Transformations::copy_from(
const Hermes::vector<unsigned int>& t)
1029 num_levels = std::min<unsigned int>(t.size(), max_level);
1030 std::copy( t.begin(), t.begin() + num_levels, transf);
1033 template<
typename Scalar>
1034 void NeighborSearch<Scalar>::Transformations::copy_from(
const Transformations* t)
1036 num_levels = t->num_levels;
1037 memcpy(transf, t->transf, max_level *
sizeof(
unsigned int));
1040 template<
typename Scalar>
1041 void NeighborSearch<Scalar>::Transformations::copy_to(Hermes::vector<unsigned int>* t)
1043 t->assign(transf, transf + num_levels);
1046 template<
typename Scalar>
1047 void NeighborSearch<Scalar>::Transformations::reset()
1049 memset(transf, 0, num_levels *
sizeof(
unsigned int));
1053 template<
typename Scalar>
1054 void NeighborSearch<Scalar>::Transformations::apply_on(Transformable* tr)
const
1056 for(
unsigned int i = 0; i < num_levels; i++)
1057 tr->push_transform(transf[i]);
1060 template<
typename Scalar>
1061 void NeighborSearch<Scalar>::Transformations::apply_on(
const Hermes::vector<Transformable*>& tr)
const
1063 for(Hermes::vector<Transformable*>::const_iterator it = tr.begin(); it != tr.end(); ++it)
1064 for(
unsigned int i = 0; i < num_levels; i++)
1065 (*it)->push_transform(transf[i]);
1068 template class HERMES_API NeighborSearch<double>;
1069 template class HERMES_API NeighborSearch<std::complex<double> >;