-
Notifications
You must be signed in to change notification settings - Fork 292
/
Copy pathmesh_function.C
818 lines (657 loc) · 25 KB
/
mesh_function.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
// The libMesh Finite Element Library.
// Copyright (C) 2002-2024 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// Local Includes
#include "libmesh/mesh_function.h"
#include "libmesh/dense_vector.h"
#include "libmesh/equation_systems.h"
#include "libmesh/numeric_vector.h"
#include "libmesh/dof_map.h"
#include "libmesh/point_locator_tree.h"
#include "libmesh/fe_base.h"
#include "libmesh/fe_interface.h"
#include "libmesh/fe_compute_data.h"
#include "libmesh/mesh_base.h"
#include "libmesh/point.h"
#include "libmesh/elem.h"
#include "libmesh/int_range.h"
#include "libmesh/fe_map.h"
namespace libMesh
{
//------------------------------------------------------------------
// MeshFunction methods
MeshFunction::MeshFunction (const EquationSystems & eqn_systems,
const NumericVector<Number> & vec,
const DofMap & dof_map,
std::vector<unsigned int> vars,
const FunctionBase<Number> * master) :
FunctionBase<Number> (master),
ParallelObject (eqn_systems),
_eqn_systems (eqn_systems),
_vector (vec),
_dof_map (dof_map),
_system_vars (std::move(vars)),
_out_of_mesh_mode (false),
_new_resize (0)
{
}
MeshFunction::MeshFunction (const EquationSystems & eqn_systems,
const NumericVector<Number> & vec,
const DofMap & dof_map,
const unsigned int var,
const FunctionBase<Number> * master) :
FunctionBase<Number> (master),
ParallelObject (eqn_systems),
_eqn_systems (eqn_systems),
_vector (vec),
_dof_map (dof_map),
_system_vars (1,var),
_out_of_mesh_mode (false),
_new_resize (0)
{
}
MeshFunction::MeshFunction (const MeshFunction & mf):
FunctionBase<Number> (mf._master),
ParallelObject (mf._eqn_systems),
_eqn_systems (mf._eqn_systems),
_vector (mf._vector),
_dof_map (mf._dof_map),
_system_vars (mf._system_vars),
_out_of_mesh_mode (mf._out_of_mesh_mode),
_new_resize (0)
{
// Initialize the mf and set the point locator if the
// input mf had done so.
if(mf.initialized())
{
this->MeshFunction::init();
if(mf.get_point_locator().initialized())
this->set_point_locator_tolerance(mf.get_point_locator().get_close_to_point_tol());
}
if (mf._subdomain_ids)
_subdomain_ids =
std::make_unique<std::set<subdomain_id_type>>
(*mf._subdomain_ids);
}
MeshFunction::~MeshFunction () = default;
void MeshFunction::init ()
{
// are indices of the desired variable(s) provided?
libmesh_assert_greater (this->_system_vars.size(), 0);
// Don't do twice...
if (this->_initialized)
{
libmesh_assert(_point_locator);
return;
}
// The Mesh owns the "master" PointLocator, while handing us a
// PointLocator "proxy" that forwards all requests to the master.
const MeshBase & mesh = this->_eqn_systems.get_mesh();
_point_locator = mesh.sub_point_locator();
int vec_dim = 0;
int n_vector_vars = 0;
int n_scalar_vars = 0;
int total_variables = _dof_map.n_variables();
const MeshBase & mesh = this->_eqn_systems.get_mesh();
_point_locator = mesh.sub_point_locator();
for (int i = 0; i < total_variables; ++i)
{
FEType fe_type = _dof_map.variable_type(i);
if (fe_type != SCALAR)
{
n_vector_vars++;
int vector_dim = FEInterface::n_vec_dim(mesh, fe_type);
if (vector_dim > vec_dim)
vec_dim = vector_dim;
}
else
n_scalar_vars++;
}
_new_resize = vec_dim * n_vector_vars + n_scalar_vars;
// ready for use
this->_initialized = true;
}
void MeshFunction::init (const Trees::BuildType /*point_locator_build_type*/)
{
libmesh_deprecated();
// Call the init() taking no args instead. Note: this is backwards
// compatible because the argument was not used for anything
// previously anyway.
this->init();
}
void
MeshFunction::clear ()
{
// only delete the point locator when we are the master
if (_point_locator && !_master)
_point_locator.reset();
this->_initialized = false;
}
std::unique_ptr<FunctionBase<Number>> MeshFunction::clone () const
{
return std::make_unique<MeshFunction>(*this);
}
Number MeshFunction::operator() (const Point & p,
const Real time)
{
libmesh_assert (this->initialized());
DenseVector<Number> buf (1);
this->operator() (p, time, buf);
return buf(0);
}
std::map<const Elem *, Number> MeshFunction::discontinuous_value (const Point & p,
const Real time)
{
libmesh_assert (this->initialized());
std::map<const Elem *, DenseVector<Number>> buffer;
this->discontinuous_value (p, time, buffer);
std::map<const Elem *, Number> return_value;
for (const auto & [elem, vec] : buffer)
return_value[elem] = vec(0);
// NOTE: If no suitable element is found, then the map return_value is empty. This
// puts burden on the user of this function but I don't really see a better way.
return return_value;
}
Gradient MeshFunction::gradient (const Point & p,
const Real time)
{
libmesh_assert (this->initialized());
std::vector<Gradient> buf (1);
this->gradient(p, time, buf);
return buf[0];
}
std::map<const Elem *, Gradient> MeshFunction::discontinuous_gradient (const Point & p,
const Real time)
{
libmesh_assert (this->initialized());
std::map<const Elem *, std::vector<Gradient>> buffer;
this->discontinuous_gradient (p, time, buffer);
std::map<const Elem *, Gradient> return_value;
for (const auto & [elem, vec] : buffer)
return_value[elem] = vec[0];
// NOTE: If no suitable element is found, then the map return_value is empty. This
// puts burden on the user of this function but I don't really see a better way.
return return_value;
}
#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
Tensor MeshFunction::hessian (const Point & p,
const Real time)
{
libmesh_assert (this->initialized());
std::vector<Tensor> buf (1);
this->hessian(p, time, buf);
return buf[0];
}
#endif
void MeshFunction::operator() (const Point & p,
const Real time,
DenseVector<Number> & output)
{
this->operator() (p, time, output, this->_subdomain_ids.get());
}
void MeshFunction::operator() (const Point & p,
const Real,
DenseVector<Number> & output,
const std::set<subdomain_id_type> * subdomain_ids)
{
libmesh_assert (this->initialized());
const Elem * element = this->find_element(p,subdomain_ids);
if (!element)
{
// We'd better be in out_of_mesh_mode if we couldn't find an
// element in the mesh
libmesh_assert (_out_of_mesh_mode);
output = _out_of_mesh_value;
}
else
{
// resize the output vector to the _new_resize
output.resize (_new_resize);
{
const unsigned int dim = element->dim();
/*
* Get local coordinates to feed these into compute_data().
* Note that the fe_type can safely be used from the 0-variable,
* since the inverse mapping is the same for all FEFamilies
*/
const Point mapped_point (FEMap::inverse_map (dim, element,
p));
// loop over all vars
for (auto index : index_range(this->_system_vars))
{
/*
* the data for this variable
*/
const unsigned int var = _system_vars[index];
if (var == libMesh::invalid_uint)
{
libmesh_assert (_out_of_mesh_mode &&
index < _out_of_mesh_value.size());
output(index) = _out_of_mesh_value(index);
continue;
}
const FEType & fe_type = this->_dof_map.variable_type(var);
/**
* Build an FEComputeData that contains both input and output data
* for the specific compute_data method.
*/
{
FEComputeData data (this->_eqn_systems, mapped_point);
FEInterface::compute_data (dim, fe_type, element, data);
// where the solution values for the var-th variable are stored
std::vector<dof_id_type> dof_indices;
this->_dof_map.dof_indices (element, dof_indices, var);
// interpolate the solution
{
Number value = 0.;
for (auto i : index_range(dof_indices))
value += this->_vector(dof_indices[i]) * data.shape[i];
output(index) = value;
}
}
// next variable
}
}
}
}
void MeshFunction::discontinuous_value (const Point & p,
const Real time,
std::map<const Elem *, DenseVector<Number>> & output)
{
this->discontinuous_value (p, time, output, this->_subdomain_ids.get());
}
void MeshFunction::discontinuous_value (const Point & p,
const Real,
std::map<const Elem *, DenseVector<Number>> & output,
const std::set<subdomain_id_type> * subdomain_ids)
{
libmesh_assert (this->initialized());
// clear the output map
output.clear();
// get the candidate elements
std::set<const Elem *> candidate_element = this->find_elements(p,subdomain_ids);
// loop through all candidates, if the set is empty this function will return an
// empty map
for (const auto & element : candidate_element)
{
const unsigned int dim = element->dim();
// define a temporary vector to store all values
DenseVector<Number> temp_output (cast_int<unsigned int>(this->_system_vars.size()));
/*
* Get local coordinates to feed these into compute_data().
* Note that the fe_type can safely be used from the 0-variable,
* since the inverse mapping is the same for all FEFamilies
*/
const Point mapped_point (FEMap::inverse_map (dim, element, p));
// loop over all vars
for (auto index : index_range(this->_system_vars))
{
/*
* the data for this variable
*/
const unsigned int var = _system_vars[index];
if (var == libMesh::invalid_uint)
{
libmesh_assert (_out_of_mesh_mode &&
index < _out_of_mesh_value.size());
temp_output(index) = _out_of_mesh_value(index);
continue;
}
const FEType & fe_type = this->_dof_map.variable_type(var);
/**
* Build an FEComputeData that contains both input and output data
* for the specific compute_data method.
*/
{
FEComputeData data (this->_eqn_systems, mapped_point);
FEInterface::compute_data (dim, fe_type, element, data);
// where the solution values for the var-th variable are stored
std::vector<dof_id_type> dof_indices;
this->_dof_map.dof_indices (element, dof_indices, var);
// interpolate the solution
{
Number value = 0.;
for (auto i : index_range(dof_indices))
value += this->_vector(dof_indices[i]) * data.shape[i];
temp_output(index) = value;
}
}
// next variable
}
// Insert temp_output into output
output[element] = temp_output;
}
}
void MeshFunction::gradient (const Point & p,
const Real time,
std::vector<Gradient> & output)
{
this->gradient(p, time, output, this->_subdomain_ids.get());
}
void MeshFunction::gradient (const Point & p,
const Real,
std::vector<Gradient> & output,
const std::set<subdomain_id_type> * subdomain_ids)
{
libmesh_assert (this->initialized());
const Elem * element = this->find_element(p,subdomain_ids);
if (!element)
output.resize(0);
else
this->_gradient_on_elem(p, element, output);
}
void MeshFunction::discontinuous_gradient (const Point & p,
const Real time,
std::map<const Elem *, std::vector<Gradient>> & output)
{
this->discontinuous_gradient (p, time, output, this->_subdomain_ids.get());
}
void MeshFunction::discontinuous_gradient (const Point & p,
const Real,
std::map<const Elem *, std::vector<Gradient>> & output,
const std::set<subdomain_id_type> * subdomain_ids)
{
libmesh_assert (this->initialized());
// clear the output map
output.clear();
// get the candidate elements
std::set<const Elem *> candidate_element = this->find_elements(p,subdomain_ids);
// loop through all candidates, if the set is empty this function will return an
// empty map
for (const auto & element : candidate_element)
{
// define a temporary vector to store all values
std::vector<Gradient> temp_output (cast_int<unsigned int>(this->_system_vars.size()));
this->_gradient_on_elem(p, element, temp_output);
// Insert temp_output into output
output.emplace(element, std::move(temp_output));
}
}
void MeshFunction::_gradient_on_elem (const Point & p,
const Elem * element,
std::vector<Gradient> & output)
{
libmesh_assert(element);
// resize the output vector to the _new_resize
output.resize (_new_resize);
const unsigned int dim = element->dim();
/*
* Get local coordinates to feed these into compute_data().
* Note that the fe_type can safely be used from the 0-variable,
* since the inverse mapping is the same for all FEFamilies
*/
const Point mapped_point (FEMap::inverse_map (dim, element,
p));
std::vector<Point> point_list (1, mapped_point);
// loop over all vars
for (auto index : index_range(this->_system_vars))
{
/*
* the data for this variable
*/
const unsigned int var = _system_vars[index];
if (var == libMesh::invalid_uint)
{
libmesh_assert (_out_of_mesh_mode &&
index < _out_of_mesh_value.size());
output[index] = Gradient(_out_of_mesh_value(index));
continue;
}
const FEType & fe_type = this->_dof_map.variable_type(var);
// where the solution values for the var-th variable are stored
std::vector<dof_id_type> dof_indices;
this->_dof_map.dof_indices (element, dof_indices, var);
// interpolate the solution
Gradient grad(0.);
// for performance-reasons, we use different algorithms now.
// TODO: Check that both give the same result for finite elements.
// Otherwive it is wrong...
if (!element->infinite())
{
std::unique_ptr<FEBase> point_fe (FEBase::build(dim, fe_type));
const std::vector<std::vector<RealGradient>> & dphi = point_fe->get_dphi();
point_fe->reinit(element, &point_list);
for (auto i : index_range(dof_indices))
grad.add_scaled(dphi[i][0], this->_vector(dof_indices[i]));
}
#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
else
{
/**
* Build an FEComputeData that contains both input and output data
* for the specific compute_data method.
*/
//TODO: enable this for a vector of points as well...
FEComputeData data (this->_eqn_systems, mapped_point);
data.enable_derivative();
FEInterface::compute_data (dim, fe_type, element, data);
//grad [x] = data.dshape[i](v) * dv/dx * dof_index [i]
// sum over all indices
for (auto i : index_range(dof_indices))
{
// local coordinates
for (std::size_t v=0; v<dim; v++)
for (std::size_t xyz=0; xyz<LIBMESH_DIM; xyz++)
{
// FIXME: this needs better syntax: It is matrix-vector multiplication.
grad(xyz) += data.local_transform[v][xyz]
* data.dshape[i](v)
* this->_vector(dof_indices[i]);
}
}
}
#endif
output[index] = grad;
}
}
#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
void MeshFunction::hessian (const Point & p,
const Real time,
std::vector<Tensor> & output)
{
this->hessian(p, time, output, this->_subdomain_ids.get());
}
void MeshFunction::hessian (const Point & p,
const Real,
std::vector<Tensor> & output,
const std::set<subdomain_id_type> * subdomain_ids)
{
libmesh_assert (this->initialized());
const Elem * element = this->find_element(p,subdomain_ids);
if (!element)
{
output.resize(0);
}
else
{
if(element->infinite())
libmesh_warning("Warning: Requested the Hessian of an Infinite element."
<< "Second derivatives for Infinite elements"
<< " are not yet implemented!"
<< std::endl);
// resize the output vector to the _new_resize
output.resize (_new_resize);
{
const unsigned int dim = element->dim();
/*
* Get local coordinates to feed these into compute_data().
* Note that the fe_type can safely be used from the 0-variable,
* since the inverse mapping is the same for all FEFamilies
*/
const Point mapped_point (FEMap::inverse_map (dim, element,
p));
std::vector<Point> point_list (1, mapped_point);
// loop over all vars
for (auto index : index_range(this->_system_vars))
{
/*
* the data for this variable
*/
const unsigned int var = _system_vars[index];
if (var == libMesh::invalid_uint)
{
libmesh_assert (_out_of_mesh_mode &&
index < _out_of_mesh_value.size());
output[index] = Tensor(_out_of_mesh_value(index));
continue;
}
const FEType & fe_type = this->_dof_map.variable_type(var);
std::unique_ptr<FEBase> point_fe (FEBase::build(dim, fe_type));
const std::vector<std::vector<RealTensor>> & d2phi =
point_fe->get_d2phi();
point_fe->reinit(element, &point_list);
// where the solution values for the var-th variable are stored
std::vector<dof_id_type> dof_indices;
this->_dof_map.dof_indices (element, dof_indices, var);
// interpolate the solution
Tensor hess;
for (auto i : index_range(dof_indices))
hess.add_scaled(d2phi[i][0], this->_vector(dof_indices[i]));
output[index] = hess;
}
}
}
}
#endif
const Elem * MeshFunction::find_element(const Point & p,
const std::set<subdomain_id_type> * subdomain_ids) const
{
/* Ensure that in the case of a master mesh function, the
out-of-mesh mode is enabled either for both or for none. This is
important because the out-of-mesh mode is also communicated to
the point locator. Since this is time consuming, enable it only
in debug mode. */
#ifdef DEBUG
if (this->_master != nullptr)
{
const MeshFunction * master =
cast_ptr<const MeshFunction *>(this->_master);
libmesh_error_msg_if(_out_of_mesh_mode!=master->_out_of_mesh_mode,
"ERROR: If you use out-of-mesh-mode in connection with master mesh "
"functions, you must enable out-of-mesh mode for both the master and the slave mesh function.");
}
#endif
// locate the point in the other mesh
const Elem * element = (*_point_locator)(p, subdomain_ids);
// If we have an element, but it's not a local element, then we
// either need to have a serialized vector or we need to find a
// local element sharing the same point.
if (element &&
(element->processor_id() != this->processor_id()) &&
_vector.type() != SERIAL)
{
// look for a local element containing the point
std::set<const Elem *> point_neighbors;
element->find_point_neighbors(p, point_neighbors);
element = nullptr;
for (const auto & elem : point_neighbors)
if (elem->processor_id() == this->processor_id())
{
element = elem;
break;
}
}
return element;
}
std::set<const Elem *> MeshFunction::find_elements(const Point & p,
const std::set<subdomain_id_type> * subdomain_ids) const
{
/* Ensure that in the case of a master mesh function, the
out-of-mesh mode is enabled either for both or for none. This is
important because the out-of-mesh mode is also communicated to
the point locator. Since this is time consuming, enable it only
in debug mode. */
#ifdef DEBUG
if (this->_master != nullptr)
{
const MeshFunction * master =
cast_ptr<const MeshFunction *>(this->_master);
libmesh_error_msg_if(_out_of_mesh_mode!=master->_out_of_mesh_mode,
"ERROR: If you use out-of-mesh-mode in connection with master mesh "
"functions, you must enable out-of-mesh mode for both the master and the slave mesh function.");
}
#endif
// locate the point in the other mesh
std::set<const Elem *> candidate_elements;
std::set<const Elem *> final_candidate_elements;
(*_point_locator)(p, candidate_elements, subdomain_ids);
for (const auto & element : candidate_elements)
{
// If we have an element, but it's not a local element, then we
// either need to have a serialized vector or we need to find a
// local element sharing the same point.
if (element &&
(element->processor_id() != this->processor_id()) &&
_vector.type() != SERIAL)
{
// look for a local element containing the point
std::set<const Elem *> point_neighbors;
element->find_point_neighbors(p, point_neighbors);
for (const auto & elem : point_neighbors)
if (elem->processor_id() == this->processor_id())
{
final_candidate_elements.insert(elem);
break;
}
}
else
final_candidate_elements.insert(element);
}
return final_candidate_elements;
}
const PointLocatorBase & MeshFunction::get_point_locator () const
{
libmesh_assert (this->initialized());
return *_point_locator;
}
PointLocatorBase & MeshFunction::get_point_locator ()
{
libmesh_assert (this->initialized());
return *_point_locator;
}
void MeshFunction::enable_out_of_mesh_mode(const DenseVector<Number> & value)
{
libmesh_assert (this->initialized());
_point_locator->enable_out_of_mesh_mode();
_out_of_mesh_mode = true;
_out_of_mesh_value = value;
}
void MeshFunction::enable_out_of_mesh_mode(const Number & value)
{
DenseVector<Number> v(1);
v(0) = value;
this->enable_out_of_mesh_mode(v);
}
void MeshFunction::disable_out_of_mesh_mode()
{
libmesh_assert (this->initialized());
_point_locator->disable_out_of_mesh_mode();
_out_of_mesh_mode = false;
}
void MeshFunction::set_point_locator_tolerance(Real tol)
{
_point_locator->set_close_to_point_tol(tol);
_point_locator->set_contains_point_tol(tol);
}
void MeshFunction::unset_point_locator_tolerance()
{
_point_locator->unset_close_to_point_tol();
}
void MeshFunction::set_subdomain_ids(const std::set<subdomain_id_type> * subdomain_ids)
{
if (subdomain_ids)
_subdomain_ids = std::make_unique<std::set<subdomain_id_type>>(*subdomain_ids);
else
_subdomain_ids.reset();
}
} // namespace libMesh