Flow123d  JS_before_hm-1002-gafa1d04
mixed_mesh_intersections.cc
Go to the documentation of this file.
1 /*
2  * MixedMeshIntersections.cpp
3  *
4  * Created on: 13.4.2014
5  * Author: viktor, pe, jb
6  */
7 
10 #include "intersection_aux.hh"
11 #include "intersection_local.hh"
12 
13 #include "system/global_defs.h"
14 #include "system/sys_profiler.hh"
15 
16 #include "mesh/mesh.h"
17 #include "mesh/ref_element.hh"
19 #include "mesh/bih_tree.hh"
20 #include "mesh/accessors.hh"
21 #include "mesh/node_accessor.hh"
22 #include "mesh/range_wrapper.hh"
23 
24 
26 : mesh(mesh), algorithm13_(mesh), algorithm23_(mesh), algorithm22_(mesh), algorithm12_(mesh)
27 {}
28 
30 {}
31 
32 
33 unsigned int MixedMeshIntersections::number_of_components(unsigned int dim)
34 {
35  ASSERT(dim < 3);
36 // if(dim == 1) return algorithm13_.component_counter_;
37  if(dim == 2) return algorithm22_.component_counter_;
38  else xprintf(Err, "Not implemented for dim %d\n.",dim);
39  return 0;
40 }
41 
42 
44 {
45  double subtotal = 0.0;
46 
47  for(unsigned int i = 0; i < intersection_storage13_.size(); i++){
48  ElementAccessor<3> ele = mesh->element_accessor( intersection_storage13_[i].component_ele_idx() );
49  double t1d_length = ele.measure();
50  double local_length = intersection_storage13_[i].compute_measure();
51 
52  if(intersection_storage13_[i].size() == 2)
53  {
54  arma::vec3 from = intersection_storage13_[i][0].coords(ele);
55  arma::vec3 to = intersection_storage13_[i][1].coords(ele);
56 // DebugOut().fmt("sublength from [{} {} {}] to [{} {} {}] = %f\n",
57 // from[0], from[1], from[2],
58 // to[0], to[1], to[2],
59 // local_length*t1d_length);
60  }
61  subtotal += local_length*t1d_length;
62  }
63  return subtotal;
64 }
65 
66 
68 {
69  double subtotal = 0.0;
70 
71  for(unsigned int i = 0; i < intersection_storage23_.size(); i++){
72  double t2dArea = mesh->element_accessor( intersection_storage23_[i].component_ele_idx() ).measure();
73  double localArea = intersection_storage23_[i].compute_measure();
74  subtotal += 2*localArea*t2dArea;
75  }
76  return subtotal;
77 }
78 
79 
81 {
82  double subtotal = 0.0;
83  double val;
84 
85  for(unsigned int i = 0; i < intersection_storage22_.size(); i++){
86  if(intersection_storage22_[i].size() > 1)
87  {
88  ElementAccessor<3> eleA = mesh->element_accessor( intersection_storage22_[i].component_ele_idx() );
89 // ElementAccessor<3> eleB = mesh->element_accessor( intersection_storage22_[i].bulk_ele_idx() );
90 
91  arma::vec3 from = intersection_storage22_[i][0].coords(eleA);
92  arma::vec3 to = intersection_storage22_[i][1].coords(eleA);
93  val = arma::norm(from - to, 2);
94 
95 // DebugOut().fmt("{}--{}:sublength from [{} {} {}] to [{} {} {}] = {}\n",
96 // eleA.idx(), eleB.idx(),
97 // from[0], from[1], from[2],
98 // to[0], to[1], to[2],
99 // val);
100  subtotal += val;
101  }
102  }
103  return subtotal;
104 }
105 
106 
107 template<uint dim_A, uint dim_B>
109  //unsigned int ele_a_idx = isec_aux.component_ele_idx();
110  //unsigned int ele_b_idx = isec_aux.bulk_ele_idx();
111 
112  //WARNING:
113  // - not all algorithms uses this function (e.g. 2d2d pushes directly into storage)
114  // - we cannot throw away isec of zero measure generaly (e.g. 1d2d, 1d3d)
115  // - is it not better to test number of IPs according to dimensions?
116 
117  IntersectionLocal<dim_A, dim_B> isec(isec_aux);
118  //if ( (! (dim_A==1 && dim_B==2)) && isec.compute_measure() < 1e-14) return;
119 
120  storage.push_back(isec);
121  /*
122  element_intersections_[ele_a_idx].push_back(
123  std::make_pair(ele_b_idx, &(storage.back())) );
124 
125  element_intersections_[ele_b_idx].push_back(
126  std::make_pair(ele_a_idx, &(storage.back())) );
127  */
128 
129 }
130 
131 template<uint dim_A, uint dim_B>
133 {
134  for(auto &isec : storage) {
135 
136  unsigned int ele_a_idx = isec.component_ele_idx();
137  unsigned int ele_b_idx = isec.bulk_ele_idx();
138  ASSERT_EQ_DBG(mesh->element_accessor(ele_a_idx)->dim(), dim_A)(ele_a_idx);
139  ASSERT_EQ_DBG(mesh->element_accessor(ele_b_idx)->dim(), dim_B)(ele_b_idx);
140  element_intersections_[ele_a_idx].push_back(
141  std::make_pair(ele_b_idx, &(isec)) );
142 
143 
144  if (dim_B==3) {
145  // necessary for 2d-2d intersections
146  element_intersections_[ele_b_idx].push_back(
147  std::make_pair(ele_a_idx, &(isec)) );
148 
149  }
150 /*
151  element_intersections_[ele_b_idx].push_back(
152  std::make_pair(ele_a_idx, &(isec)) );*/
153  }
154 }
155 
156 
157 template<unsigned int dim>
160 {
161  START_TIMER("Intersection algorithm");
162 
164  switch(is){
167  case Mesh::BBsearch: iea.compute_intersections_BB(); break;
168  default: ASSERT(0).error("Unsupported search algorithm.");
169  }
170 
171  END_TIMER("Intersection algorithm");
172 
173  START_TIMER("Intersection into storage");
174  storage.reserve(iea.n_intersections_);
175 
176  for (auto elm : mesh->elements_range()) {
177  unsigned int idx = elm.idx();
178 
179  if(elm->dim() == dim)
180  {
181 // intersection_map_[idx].resize(iea.intersection_list_[idx].size());
182  element_intersections_[idx].reserve(iea.intersection_list_[idx].size());
183  for(unsigned int j = 0; j < iea.intersection_list_[idx].size(); j++){
184 
185  // skip zero intersections (are made in iea.prolongate())
186  if(iea.intersection_list_[idx][j].size() == 0) continue;
187  store_intersection(storage, iea.intersection_list_[idx][j]); }
188  }
189  }
190  END_TIMER("Intersection into storage");
191 
192 // for(IntersectionLocal<2,3> &is : intersection_storage23_) {
193 // DebugOut().fmt("comp-bulk: {} {}\n", is.component_ele_idx(), is.bulk_ele_idx());
194 // }
195 }
196 
198 {
199  START_TIMER("Intersection algorithm");
201  END_TIMER("Intersection algorithm");
202 
203 // START_TIMER("Intersection into storage");
204 //
205 // storage.reserve(algorithm22_.intersectionaux_storage22_.size());
206 //
207 // for(IntersectionAux<2,2> &is : algorithm22_.intersectionaux_storage22_) {
208 // unsigned int triaA_idx = is.component_ele_idx();
209 // unsigned int triaB_idx = is.bulk_ele_idx();
210 //
211 // //HACK: 'skip flag' move this check into algorithm12_.compute_intersections()
212 // bool skip = false;
213 // for(unsigned int i=0; i<element_intersections_[triaA_idx].size(); i++)
214 // {
215 // if(element_intersections_[triaA_idx][i].first == triaB_idx)
216 // skip = true;
217 // }
218 // if(! skip) {
219 // storage.push_back(IntersectionLocal<2,2>(is));
220 // element_intersections_[triaA_idx].push_back(std::make_pair(
221 // triaB_idx,
222 // &(storage.back())
223 // ));
224 // element_intersections_[triaB_idx].push_back(std::make_pair(
225 // triaA_idx,
226 // &(storage.back())
227 // ));
228 //
229 // // DebugOut().fmt("2D-2D intersection [{} - {}]:\n",
230 // // mesh->element_accessor(is.component_ele_idx()).idx(),
231 // // mesh->element_accessor(is.bulk_ele_idx()).idx());
232 // // for(const IntersectionPointAux<2,2>& ip : is.points()) {
233 // // DebugOut() << ip;
234 // // auto p = ip.coords(mesh->element(is.component_ele_idx()));
235 // // DebugOut() << "[" << p[0] << " " << p[1] << " " << p[2] << "]\n";
236 // // }
237 // }
238 // }
239 // DBGVAR(algorithm22_.intersectionaux_storage22_.size());
240 //
241 // END_TIMER("Intersection into storage");
242 }
243 
245 {
246  storage.reserve(intersection_storage13_.size());
248  storage.shrink_to_fit();
249 
250 // START_TIMER("Intersection into storage");
251 // storage.reserve(algorithm12_.intersectionaux_storage12_.size());
252 
253 // for(IntersectionAux<1,2> &is : algorithm12_.intersectionaux_storage12_) {
254 // unsigned int abscissa_idx = is.component_ele_idx();
255 // unsigned int triangle_idx = is.bulk_ele_idx();
256 //
257 // //HACK: 'skip flag' move this check into algorithm12_.compute_intersections()
258 // bool skip = false;
259 // for(unsigned int i=0; i<intersection_map_[abscissa_idx].size(); i++)
260 // {
261 // if(intersection_map_[abscissa_idx][i].first == triangle_idx)
262 // skip = true;
263 // }
264 // if(! skip) {
265 // storage.push_back(IntersectionLocal<1,2>(is));
266 // intersection_map_[abscissa_idx].push_back(std::make_pair(
267 // triangle_idx,
268 // &(storage.back())
269 // ));
270 // intersection_map_[triangle_idx].push_back(std::make_pair(
271 // abscissa_idx,
272 // &(storage.back())
273 // ));
274 // DebugOut().fmt("1D-2D intersection [{} - {}]:\n",is.component_ele_idx(), is.bulk_ele_idx());
275 // for(const IntersectionPointAux<1,2>& ip : is.points()) {
276 // //DebugOut() << ip;
277 // auto p = ip.coords(mesh->element(is.component_ele_idx()));
278 // DebugOut() << "[" << p[0] << " " << p[1] << " " << p[2] << "]\n";
279 // }
280 // }
281 // }
282 // END_TIMER("Intersection into storage");
283 }
284 
286 {
288 // DBGVAR(algorithm12_.intersectionaux_storage12_.size());
289 
290  START_TIMER("Intersection into storage");
291  storage.reserve(algorithm12_.intersectionaux_storage12_.size());
292 
294  store_intersection(storage, is);
295 // DebugOut().fmt("1D-2D intersection [{} - {}]:\n",is.component_ele_idx(), is.bulk_ele_idx());
296 // for(const IntersectionPointAux<1,2>& ip : is.points()) {
297 // //DebugOut() << ip;
298 // auto p = ip.coords(mesh->element(is.component_ele_idx()));
299 // DebugOut() << "[" << p[0] << " " << p[1] << " " << p[2] << "]\n";
300 // }
301  }
302  END_TIMER("Intersection into storage");
303 }
304 
306 {
308 // DBGVAR(algorithm12_.intersectionaux_storage12_.size());
309 
310  START_TIMER("Intersection into storage");
311  storage.reserve(algorithm12_.intersectionaux_storage12_.size());
312 
314  store_intersection(storage, is);
315 // DebugOut().fmt("1D-2D intersection [{} - {}]:\n",is.component_ele_idx(), is.bulk_ele_idx());
316 // for(const IntersectionPointAux<1,2>& ip : is.points()) {
317 // //DebugOut() << ip;
318 // auto p = ip.coords(mesh->element(is.component_ele_idx()));
319 // DebugOut() << "[" << p[0] << " " << p[1] << " " << p[2] << "]\n";
320 // }
321  }
322  END_TIMER("Intersection into storage");
323 }
324 
326 {
328 
329  // check whether the mesh is in plane only
330  bool mesh_in_2d_only = false;
331  auto bb = mesh->get_bih_tree().tree_box();
332  for(uint axis = 0; axis < bb.dimension; axis++)
333  if(bb.size(axis) < geometry_epsilon) mesh_in_2d_only = true;
334 
336  START_TIMER("Intersections 1D-3D");
337 // DebugOut() << "Intersection Algorithm d13\n";
338  compute_intersections<1>(algorithm13_,intersection_storage13_);
339  END_TIMER("Intersections 1D-3D");
340  }
342 
343 
345  START_TIMER("Intersections 2D-3D");
346 // DebugOut() << "Intersection Algorithm d23\n";
347  compute_intersections<2>(algorithm23_,intersection_storage23_);
348  END_TIMER("Intersections 2D-3D");
349  }
351 
352 
353  if(d & IntersectionType::d22){
354  START_TIMER("Intersections 2D-2D");
355 // DebugOut() << "Intersection Algorithm d22\n";
357  END_TIMER("Intersections 2D-2D");
358  }
359 
360  if( mesh_in_2d_only){
361  START_TIMER("Intersections 1D-2D (1)");
363  END_TIMER("Intersections 1D-2D (1)");
364  }
365  // make sence only if some intersections in 3D are computed
366  // TODO: this does NOT compute 1d-2d outside 3d bulk
367  // NOTE: create input record in mesh to decide, whether compute also outside (means to call alg. 2)
368  else if( ! intersection_storage13_.empty() &&
369  ! intersection_storage23_.empty() &&
371  START_TIMER("Intersections 1D-2D (3)");
372  DebugOut() << "Intersection Algorithm d12_3\n";
374  END_TIMER("Intersections 1D-2D (3)");
375  }
376  // otherwise compute 1d-2d in the most general case
377  else if(d & IntersectionType::d12_2){
378  START_TIMER("Intersections 1D-2D (2)");
379  DebugOut() << "Intersection Algorithm d12_2\n";
381  END_TIMER("Intersections 1D-2D (2)");
382  }
383 
384  //ASSERT_EQ(intersection_storage13_.size(), 0);
385  //ASSERT_EQ(intersection_storage23_.size(), 0);
386  //ASSERT_EQ(intersection_storage22_.size(), 0);
387  // compose master
389 
390  // release temporary links from 3d elements
391  for (auto elm : mesh->elements_range()) {
392  if(elm->dim() == 3) element_intersections_[elm.idx()].clear();
393  }
394 
395 
396 
397 }
398 
399 
400 
401 
403 {
404  string t_name = name;
405 
406  unsigned int number_of_intersection_points = 0;
407  unsigned int number_of_nodes = mesh->n_nodes();
408 
409  for(unsigned int j = 0; j < intersection_storage13_.size();j++){
410  number_of_intersection_points += intersection_storage13_[j].size();
411  }
412 
413  FILE * file;
414  file = fopen((t_name.append(".msh")).c_str(),"w");
415 
416  fprintf(file, "$MeshFormat\n");
417  fprintf(file, "2.2 0 8\n");
418  fprintf(file, "$EndMeshFormat\n");
419  fprintf(file, "$Nodes\n");
420  fprintf(file, "%d\n", (mesh->n_nodes() + number_of_intersection_points));
421 
422  unsigned int idx = 1;
423  for (auto nod : mesh->node_range()) {
424  arma::vec3 _nod = *nod;
425  fprintf(file,"%d %.16f %.16f %.16f\n", idx, _nod[0], _nod[1], _nod[2]);
426  idx++;
427  }
428 
429  for(unsigned int j = 0; j < intersection_storage13_.size();j++){
432 // ElementAccessor<3> el3D = mesh->element_accessor( il.bulk_ele_idx() );
433 
434  for(unsigned int k = 0; k < il.size();k++){
435  number_of_nodes++;
436  IntersectionPoint<1,3> IP13 = il[k];
437  arma::vec3 global = IP13.coords(el1D);
438 
439 // if(i == 0){
440 // _global = (IP13.local_bcoords_A())[0] * el1D.node(0)->point()
441 // +(IP13.local_bcoords_A())[1] * el1D.node(1)->point();
442 // }else{
443 // _global = (IP13.local_bcoords_B())[0] * el3D.node(0)->point()
444 // +(IP13.local_bcoords_B())[1] * el3D.node(1)->point()
445 // +(IP13.local_bcoords_B())[2] * el3D.node(2)->point()
446 // +(IP13.local_bcoords_B())[3] * el3D.node(3)->point();
447 // }
448 
449  fprintf(file,"%d %.16f %.16f %.16f\n", number_of_nodes, global[0], global[1], global[2]);
450  }
451  }
452 
453  fprintf(file,"$EndNodes\n");
454  fprintf(file,"$Elements\n");
455  fprintf(file,"%d\n", ((unsigned int)intersection_storage13_.size() + mesh->n_elements()) );
456 
457  for (auto elee : mesh->elements_range()) {
458  if(elee->dim() == 3){
459  int id1 = elee.node(0).idx() + 1;
460  int id2 = elee.node(1).idx() + 1;
461  int id3 = elee.node(2).idx() + 1;
462  int id4 = elee.node(3).idx() + 1;
463 
464  fprintf(file,"%d 4 2 %d %d %d %d %d %d\n", elee.idx(), elee.region().id(), elee->pid(), id1, id2, id3, id4);
465  }else if(elee->dim() == 2){
466  int id1 = elee.node(0).idx() + 1;
467  int id2 = elee.node(1).idx() + 1;
468  int id3 = elee.node(2).idx() + 1;
469  fprintf(file,"%d 2 2 %d %d %d %d %d\n", elee.idx(), elee.region().id(), elee->pid(), id1, id2, id3);
470 
471  }else if(elee->dim() == 1){
472  int id1 = elee.node(0).idx() + 1;
473  int id2 = elee.node(1).idx() + 1;
474  fprintf(file,"%d 1 2 %d %d %d %d\n",elee.idx(), elee.region().id(), elee->pid(), id1, id2);
475  }
476  }
477 
478  unsigned int number_of_elements = mesh->n_elements();
479  unsigned int nodes = mesh->n_nodes();
480 
481  for(unsigned int j = 0; j < intersection_storage13_.size();j++){
483  number_of_elements++;
484  nodes++;
485  if(il.size() == 1){
486  fprintf(file,"%d 1 2 1001 0 %d %d\n", number_of_elements, nodes, nodes);
487  }else if(il.size() == 2){
488  fprintf(file,"%d 1 2 1001 0 %d %d\n", number_of_elements, nodes, nodes+1);
489  nodes++;
490  }
491  }
492 
493  fprintf(file,"$EndElements\n");
494  fclose(file);
495 }
496 
498 {
499  //for(unsigned int i = 0; i < 2;i++){
500  string t_name = name;
501 
502  unsigned int number_of_intersection_points = 0;
503  unsigned int number_of_nodes = mesh->n_nodes();
504 
505  for(unsigned int j = 0; j < intersection_storage23_.size();j++){
506  number_of_intersection_points += intersection_storage23_[j].size();
507  }
508 
509  FILE * file;
510  file = fopen((t_name.append(".msh")).c_str(),"w");
511 
512  fprintf(file, "$MeshFormat\n");
513  fprintf(file, "2.2 0 8\n");
514  fprintf(file, "$EndMeshFormat\n");
515  fprintf(file, "$Nodes\n");
516  fprintf(file, "%d\n", (mesh->n_nodes() + number_of_intersection_points));
517 
518  unsigned int idx = 1;
519  for (auto nod : mesh->node_range()) {
520  arma::vec3 _nod = *nod;
521  fprintf(file,"%d %.16f %.16f %.16f\n", idx, _nod[0], _nod[1], _nod[2]);
522  idx++;
523  }
524 
525  for(unsigned int j = 0; j < intersection_storage23_.size();j++){
526 
529 // ElementAccessor<3> el3D = mesh->element_accessor( il.bulk_ele_idx() );
530 
531  for(unsigned int k = 0; k < intersection_storage23_[j].size();k++){
532 
533  number_of_nodes++;
534  IntersectionPoint<2,3> IP23 = il[k];
535  arma::vec3 global = IP23.coords(el2D);
536 // if(i == 0){
537 // _global = (IP23.local_bcoords_A())[0] * el2D.node(0)->point()
538 // +(IP23.local_bcoords_A())[1] * el2D.node(1)->point()
539 // +(IP23.local_bcoords_A())[2] * el2D.node(2)->point();
540 // }else{
541 // _global = (IP23.local_bcoords_B())[0] * el3D.node(0)->point()
542 // +(IP23.local_bcoords_B())[1] * el3D.node(1)->point()
543 // +(IP23.local_bcoords_B())[2] * el3D.node(2)->point()
544 // +(IP23.local_bcoords_B())[3] * el3D.node(3)->point();
545 // }
546  fprintf(file,"%d %.16f %.16f %.16f\n", number_of_nodes, global[0], global[1], global[2]);
547  }
548  }
549 
550  fprintf(file,"$EndNodes\n");
551  fprintf(file,"$Elements\n");
552  fprintf(file,"%d\n", (number_of_intersection_points + mesh->n_elements()) );
553 
554  for (auto elee : mesh->elements_range()) {
555  if(elee->dim() == 3){
556  int id1 = elee.node(0).idx() + 1;
557  int id2 = elee.node(1).idx() + 1;
558  int id3 = elee.node(2).idx() + 1;
559  int id4 = elee.node(3).idx() + 1;
560 
561  fprintf(file,"%d 4 2 %d %d %d %d %d %d\n", elee.idx(), elee.region().id(), elee->pid(), id1, id2, id3, id4);
562  }else if(elee->dim() == 2){
563  int id1 = elee.node(0).idx() + 1;
564  int id2 = elee.node(1).idx() + 1;
565  int id3 = elee.node(2).idx() + 1;
566  fprintf(file,"%d 2 2 %d %d %d %d %d\n", elee.idx(), elee.region().id(), elee->pid(), id1, id2, id3);
567 
568  }else{
569  int id1 = elee.node(0).idx() + 1;
570  int id2 = elee.node(1).idx() + 1;
571  fprintf(file,"%d 1 2 %d %d %d %d\n",elee.idx(), elee.region().id(), elee->pid(), id1, id2);
572  }
573  }
574 
575  unsigned int number_of_elements = mesh->n_elements();
576  unsigned int last = 0;
577  unsigned int nodes = mesh->n_nodes();
578 
579  for(unsigned int j = 0; j < intersection_storage23_.size();j++){
581 
582  for(unsigned int k = 0; k < il.size();k++){
583 
584  number_of_elements++;
585  nodes++;
586  if(k == 0){
587  last = nodes;
588  }
589 
590  if((k+1) == il.size() && il.size()){
591  fprintf(file,"%d 1 2 1002 0 %d %d\n", number_of_elements, nodes, last);
592  }else{
593  fprintf(file,"%d 1 2 1002 0 %d %d\n", number_of_elements, nodes, nodes+1);
594  }
595  //if(il.size() < 3) break;
596  }
597  }
598 
599  fprintf(file,"$EndElements\n");
600  fclose(file);
601  //}
602 }
603 
604 
IntersectionType
Selection of intersections of different dimensions.
#define ASSERT_EQ_DBG(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
Definition: asserts.hh:332
void compute_intersections_22(std::vector< IntersectionLocal< 2, 2 >> &storage)
unsigned int uint
Classes with algorithms for computation of intersections of meshes.
void print_mesh_to_file_13(std::string name)
Generates a mesh file of the given name, including the intersection.
Definition: mesh.h:78
Class represents intersection of two elements.
Class represents an intersection point of simplex<N> and simplex<M>. It contains barycentric coordina...
InspectElementsAlgorithm< 1 > algorithm13_
static const double geometry_epsilon
std::vector< std::vector< ILpair > > element_intersections_
unsigned int n_intersections_
Counter for intersection among elements.
unsigned int size() const
Returns number of intersection points.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
Definition: asserts.hh:347
virtual unsigned int n_nodes() const
Definition: mesh.h:126
void compute_intersections_BIHtree(const BIHTree &bih)
Uses only BIHtree to find intersection candidates. (No prolongation).
virtual ElementAccessor< 3 > element_accessor(unsigned int idx) const
Create and return ElementAccessor to element of given idx.
Definition: mesh.cc:839
unsigned int component_ele_idx() const
Returns index of component element.
void print_mesh_to_file_23(std::string name)
unsigned int dim() const
Definition: elements.h:121
void compute_intersections(std::vector< std::vector< ILpair >> &intersection_map, std::vector< IntersectionLocal< 2, 2 >> &storage)
Runs the core algorithm for computing 2D-2D intersection in 3D.
Global macros to enhance readability and debugging, general constants.
std::vector< IntersectionAux< 1, 2 > > intersectionaux_storage12_
Stores temporarily 1D-2D intersections.
void compute_intersections_12_2(std::vector< IntersectionLocal< 1, 2 >> &storage)
void compute_intersections_3(std::vector< std::vector< ILpair >> &intersection_map, std::vector< IntersectionLocal< 1, 2 >> &storage)
Runs the algorithm (3): compute 1D-2D intersection inside 3D mesh. It directly fills the intersection...
std::vector< std::vector< IntersectionAux< dim, 3 > > > intersection_list_
Resulting vector of intersections.
InspectElementsAlgorithm< 2 > algorithm23_
IntersectionSearch get_intersection_search()
Getter for input type selection for intersection search algorithm.
Definition: mesh.cc:154
FMT_FUNC int fprintf(std::ostream &os, CStringRef format, ArgList args)
Definition: ostream.cc:56
void compute_intersections_12_1(std::vector< IntersectionLocal< 1, 2 >> &storage)
const BoundingBox & tree_box() const
Definition: bih_tree.cc:229
#define xprintf(...)
Definition: system.hh:93
#define START_TIMER(tag)
Starts a timer with specified tag.
virtual Range< ElementAccessor< 3 > > elements_range() const
Returns range of bulk elements.
Definition: mesh.cc:1153
std::vector< IntersectionLocal< 1, 3 > > intersection_storage13_
Stores 1D-3D intersections.
double measure() const
Computes the measure of the element.
void append_to_index(std::vector< IntersectionLocal< dim_A, dim_B >> &storage)
double measure_13()
Computes the size of the intersection in dim dimenstions.
const BIHTree & get_bih_tree()
Getter for BIH. Creates and compute BIH at first call.
Definition: mesh.cc:1050
arma::vec3 coords(ElementAccessor< 3 > comp_ele) const
virtual unsigned int n_elements(bool boundary=false) const
Returns count of boundary or bulk elements.
Definition: mesh.h:344
void compute_intersections(IntersectionType d=IntersectionType::all)
void store_intersection(std::vector< IntersectionLocal< dim_A, dim_B >> &storage, IntersectionAux< dim_A, dim_B > &isec_aux)
unsigned int number_of_components(unsigned int dim)
Class implements algorithm for dim-dimensional intersections with 3D elements.
InspectElementsAlgorithm22 algorithm22_
void compute_intersections(const BIHTree &bih)
Uses BIHtree to find the initial candidate of a component and then prolongates the component interset...
InspectElementsAlgorithm12 algorithm12_
#define END_TIMER(tag)
Ends a timer with specified tag.
Class RefElement defines numbering of vertices, sides, calculation of normal vectors etc...
Definition: system.hh:65
Range< NodeAccessor< 3 > > node_range() const
Returns range of nodes.
Definition: mesh.cc:1159
void compute_intersections_2(const BIHTree &bih)
Runs the algorithm (2): compute 1D-2D intersection in 3D ambient space BIH is used to find intersecti...
void compute_intersections_1(const BIHTree &bih)
Runs the algorithm (1): compute 1D-2D intersection in 2D plane. BIH is used to find intersection cand...
IntersectionSearch
Types of search algorithm for finding intersection candidates.
Definition: mesh.h:93
Internal auxiliary class representing intersection object of simplex<dimA> and simplex<dimB>.
std::vector< IntersectionLocal< 2, 2 > > intersection_storage22_
Stores 2D-2D intersections.
void compute_intersections_12_3(std::vector< IntersectionLocal< 1, 2 >> &storage)
#define DebugOut()
Macro defining &#39;debug&#39; record of log.
Definition: logger.hh:264
Internal class representing intersection point.
std::vector< IntersectionLocal< 1, 2 > > intersection_storage12_
Stores 1D-2D intersections.
Implementation of range helper class.
std::vector< IntersectionLocal< 2, 3 > > intersection_storage23_
Stores 2D-3D intersections.
Internal class representing intersection object.