MFEM v4.9.0
Finite element discretization library
Loading...
Searching...
No Matches
gslib.hpp
Go to the documentation of this file.
1// Copyright (c) 2010-2025, Lawrence Livermore National Security, LLC. Produced
2// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3// LICENSE and NOTICE for details. LLNL-CODE-806117.
4//
5// This file is part of the MFEM library. For more information and source code
6// availability visit https://mfem.org.
7//
8// MFEM is free software; you can redistribute it and/or modify it under the
9// terms of the BSD-3 license. We welcome feedback and contributions, see file
10// CONTRIBUTING.md for details.
11
12#ifndef MFEM_GSLIB
13#define MFEM_GSLIB
14
15#include "../config/config.hpp"
16#ifdef MFEM_USE_MPI
17#include "pgridfunc.hpp"
18#else
19#include "gridfunc.hpp"
20#endif
21
22#ifdef MFEM_USE_GSLIB
23
24namespace gslib
25{
26struct comm;
27struct crystal;
28struct hash_data_3;
29struct hash_data_2;
30struct gs_data;
31}
32
33namespace mfem
34{
35
36/** \brief FindPointsGSLIB can robustly evaluate a GridFunction on an arbitrary
37 * collection of points. See Mittal et al., "General Field Evaluation in
38 * High-Order Meshes on GPUs". (2025). Computers & Fluids. for technical
39 * details.
40 *
41 * There are three key functions in FindPointsGSLIB:
42 *
43 * 1. Setup - constructs the internal data structures of gslib. See \ref Setup.
44 *
45 * 2. FindPoints - for any given arbitrary set of points in physical space,
46 * gslib finds the element number, MPI rank, and the reference space
47 * coordinates inside the element that each point is located in. gslib also
48 * returns a code that indicates whether the point was found inside an
49 * element, on element border, or not found in the domain.
50 * For points returned as found on `element border`, the point is either
51 * on an element edge/face or near the domain boundary, and gslib also
52 * returns a distance to the border. Points near (but outside) the domain
53 * boundary must then be marked as not found using the distance returned
54 * by gslib. See \ref FindPoints.
55 *
56 * 3. Interpolate - Interpolates any grid function at the points found using 2.
57 * For functions in L2 finite element space, use \ref SetL2AvgType to
58 * specify how to interpolate values at points located at element boundaries
59 * where the function might be multi-valued. See \ref Interpolate.
60 *
61 * FindPointsGSLIB also provides interface to use these functions through a
62 * single call.
63 *
64 * For custom interpolation (e.g., evaluating strain rate tensor), we provide
65 * functions that use gslib to send element index and corresponding
66 * reference-space coordinates for each point to the mpi rank that the element
67 * is located on. Then, custom interpolation can be defined locally by the user
68 * before sending the values back to mpi ranks where the query originated from.
69 * See \ref DistributePointInfoToOwningMPIRanks and
70 * \ref DistributeInterpolatedValues.
71 */
73{
74public:
75 enum AvgType {NONE, ARITHMETIC, HARMONIC}; // Average type for L2 functions
76
77protected:
79 Array<Mesh *> mesh_split; // Meshes used to split simplices.
80 // IntegrationRules for simplex->Quad/Hex and to project to p_max in-case of
81 // p-refinement.
83 Array<FiniteElementSpace *> fes_rst_map; //FESpaces to map Quad/Hex->Simplex
84 Array<GridFunction *> gf_rst_map; // GridFunctions to map Quad/Hex->Simplex
86 void *fdataD;
87 struct gslib::crystal *cr; // gslib's internal data
88 struct gslib::comm *gsl_comm; // gslib's internal data
89 int dim, points_cnt; // mesh dimension and number of points
92 Array<unsigned int> recv_proc, recv_index; // data for custom interpolation
93 bool setupflag; // flag to indicate if gslib data has been setup
94 double default_interp_value; // used for points that are not found in the mesh
95 AvgType avgtype; // average type used for L2 functions
98 int NE_split_total; // total number of elements after mesh splitting
99 int mesh_points_cnt; // number of mesh nodes
100 // Tolerance to ignore points found beyond the mesh boundary.
101 // i.e. if ||x*-x(r)||_2^2 > bdr_tol, we mark point as not found.
102 double bdr_tol;
103 // Use CPU functions for Mesh/GridFunction on device for gslib1.0.7
105
106 // Device specific data used for FindPoints
107 struct
108 {
109 bool setup_device = false;
110 bool find_device = false;
112 double newt_tol; // Tolerance specified during setup for Newton solve
113 struct gslib::crystal *cr;
114 struct gslib::hash_data_3 *hash3;
115 struct gslib::hash_data_2 *hash2;
120
121 /// Use GSLIB for communication and interpolation
122 virtual void InterpolateH1(const GridFunction &field_in, Vector &field_out);
123 /// Uses GSLIB Crystal Router for communication followed by MFEM's
124 /// interpolation functions
125 virtual void InterpolateGeneral(const GridFunction &field_in,
126 Vector &field_out);
127
128 /// Since GSLIB is designed to work with quads/hexes, we split every
129 /// triangle/tet/prism/pyramid element into quads/hexes.
130 virtual void SetupSplitMeshes();
131
132 /// Setup integration points that will be used to interpolate the nodal
133 /// location at points expected by GSLIB.
135 IntegrationRule *irule,
136 int order);
137
138 /// Helper function that calls \ref SetupSplitMeshes and
139 /// \ref SetupIntegrationRuleForSplitMesh.
140 virtual void SetupSplitMeshesAndIntegrationRules(const int order);
141
142 /// Get GridFunction value at the points expected by GSLIB.
143 virtual void GetNodalValues(const GridFunction *gf_in, Vector &node_vals);
144
145 /// Map {r,s,t} coordinates from [-1,1] to [0,1] for MFEM. For simplices,
146 /// find the original element number (that was split into micro quads/hexes)
147 /// during the setup phase.
148 virtual void MapRefPosAndElemIndices();
149
150 // Device functions
151 // FindPoints locally on device for 3D.
152 void FindPointsLocal3(const Vector &point_pos, int point_pos_ordering,
153 Array<unsigned int> &gsl_code_dev_l,
154 Array<unsigned int> &gsl_elem_dev_l, Vector &gsl_ref_l,
155 Vector &gsl_dist_l, int npt);
156
157 // FindPoints locally on device for 2D.
158 void FindPointsLocal2(const Vector &point_pos, int point_pos_ordering,
159 Array<unsigned int> &gsl_code_dev_l,
160 Array<unsigned int> &gsl_elem_dev_l, Vector &gsl_ref_l,
161 Vector &gsl_dist_l, int npt);
162
163 // Interpolate on device for 3D.
164 void InterpolateLocal3(const Vector &field_in,
165 Array<int> &gsl_elem_dev_l,
166 Vector &gsl_ref_l,
167 Vector &field_out,
168 int npt, int ncomp,
169 int nel, int dof1dsol);
170 // Interpolate on device for 2D.
171 void InterpolateLocal2(const Vector &field_in,
172 Array<int> &gsl_elem_dev_l,
173 Vector &gsl_ref_l,
174 Vector &field_out,
175 int npt, int ncomp,
176 int nel, int dof1dsol);
177
178 // Prepare data for device functions.
179 void SetupDevice();
180
181 /** Searches positions given in physical space by @a point_pos.
182 These positions can be ordered byNodes: (XXX...,YYY...,ZZZ) or
183 byVDim: (XYZ,XYZ,....XYZ) specified by @a point_pos_ordering. */
184 void FindPointsOnDevice(const Vector &point_pos,
185 int point_pos_ordering = Ordering::byNODES);
186
187 /** Interpolation of field values at prescribed reference space positions.
188 @param[in] field_in_evec E-vector of grid function to be interpolated.
189 Assumed ordering is NDOFSxVDIMxNEL
190 @param[in] nel Number of elements in the mesh.
191 @param[in] ncomp Number of components in the field.
192 @param[in] dof1dsol Number of degrees of freedom in each reference
193 space direction.
194 @param[in] ordering Ordering of the out field values: byNodes/byVDIM
195
196 @param[out] field_out Interpolated values. For points that are not found
197 the value is set to #default_interp_value. */
198 void InterpolateOnDevice(const Vector &field_in_evec, Vector &field_out,
199 const int nel, const int ncomp,
200 const int dof1dsol, const int ordering);
201
202public:
204 FindPointsGSLIB(Mesh &mesh_in, const double bb_t = 0.1,
205 const double newt_tol = 1.0e-12,
206 const int npt_max = 256);
207
208#ifdef MFEM_USE_MPI
209 FindPointsGSLIB(MPI_Comm comm_);
210 FindPointsGSLIB(ParMesh &mesh_in, const double bb_t = 0.1,
211 const double newt_tol = 1.0e-12,
212 const int npt_max = 256);
213#endif
214
215 virtual ~FindPointsGSLIB();
218
219 /** Initializes the internal mesh in gslib, by sending the positions of the
220 Gauss-Lobatto nodes of the input Mesh object \p m.
221 Note: not tested with periodic (L2).
222 Note: the input mesh \p m must have Nodes set.
223
224 @param[in] m Input mesh.
225 @param[in] bb_t (Optional) Relative size of bounding box around
226 each element.
227 @param[in] newt_tol (Optional) Newton tolerance for the gslib
228 search methods.
229 @param[in] npt_max (Optional) Number of points for simultaneous
230 iteration. This alters performance and
231 memory footprint.*/
232
233 void Setup(Mesh &m, const double bb_t = 0.1, const double newt_tol = 1.0e-12,
234 const int npt_max = 256);
235 /** Searches positions given in physical space by \p point_pos.
236 These positions can be ordered byNodes: (XXX...,YYY...,ZZZ) or
237 byVDim: (XYZ,XYZ,....XYZ) specified by \p point_pos_ordering.
238 This function populates the following member variables:
239 #gsl_code Return codes for each point: inside element (0),
240 element boundary (1), not found (2).
241 #gsl_proc MPI proc ids where the points were found.
242 #gsl_elem Element ids where the points were found.
243 Defaults to 0 for points that were not found.
244 #gsl_mfem_elem Element ids corresponding to MFEM-mesh where the points
245 were found. #gsl_mfem_elem != #gsl_elem for simplices
246 Defaults to 0 for points that were not found.
247 #gsl_ref Reference coordinates of the found point.
248 Ordered by vdim (XYZ,XYZ,XYZ...). Defaults to -1 for
249 points that were not found. Note: the gslib reference
250 frame is [-1,1].
251 #gsl_mfem_ref Reference coordinates #gsl_ref mapped to [0,1].
252 Defaults to 0 for points that were not found.
253 #gsl_dist Distance between the sought and the found point
254 in physical space. */
255 void FindPoints(const Vector &point_pos,
256 int point_pos_ordering = Ordering::byNODES);
257 /// Setup FindPoints and search positions
258 void FindPoints(Mesh &m, const Vector &point_pos,
259 int point_pos_ordering = Ordering::byNODES,
260 const double bb_t = 0.1, const double newt_tol = 1.0e-12,
261 const int npt_max = 256);
262
263 /** Interpolation of field values at prescribed reference space positions.
264 @param[in] field_in Function values that will be interpolated on the
265 reference positions. Note: it is assumed that
266 \p field_in is in H1 and in the same space as the
267 mesh that was given to Setup().
268 @param[out] field_out Interpolated values. For points that are not found
269 the value is set to #default_interp_value. */
270 virtual void Interpolate(const GridFunction &field_in, Vector &field_out);
271 /** Search positions and interpolate. The ordering (byNODES or byVDIM) of
272 the output values in \p field_out corresponds to the ordering used
273 in the input GridFunction \p field_in. */
274 void Interpolate(const Vector &point_pos, const GridFunction &field_in,
275 Vector &field_out,
276 int point_pos_ordering = Ordering::byNODES);
277 /** Setup FindPoints, search positions and interpolate. The ordering (byNODES
278 or byVDIM) of the output values in \p field_out corresponds to the
279 ordering used in the input GridFunction \p field_in. */
280 void Interpolate(Mesh &m, const Vector &point_pos,
281 const GridFunction &field_in, Vector &field_out,
282 int point_pos_ordering = Ordering::byNODES);
283
284 /// Average type to be used for L2 functions in-case a point is located at
285 /// an element boundary where the function might be multi-valued.
286 virtual void SetL2AvgType(AvgType avgtype_) { avgtype = avgtype_; }
287
288 /// Set the default interpolation value for points that are not found in the
289 /// mesh.
290 virtual void SetDefaultInterpolationValue(double interp_value_)
291 {
292 default_interp_value = interp_value_;
293 }
294
295 /// Set the tolerance for detecting points outside the 'curvilinear' boundary
296 /// that gslib may return as found on the boundary. Points found on boundary
297 /// with distance greater than @ bdr_tol are marked as not found.
299 {
300 bdr_tol = bdr_tol_;
301 }
302
303 /// Enable/Disable use of CPU functions for GPU data if the gslib version
304 /// is older.
305 virtual void SetGPUtoCPUFallback(bool mode) { gpu_to_cpu_fallback = mode; }
306
307 /** Cleans up memory allocated internally by gslib.
308 Note that in parallel, this must be called before MPI_Finalize(), as it
309 calls MPI_Comm_free() for internal gslib communicators. FreeData is
310 also called by the class destructor and there are no memory leaks if the
311 destructor is called before MPI_Finalize(). If the destructor is called
312 after MPI_Finalize(), there will be an error because gslib will try to
313 invoke some MPI functions.
314 */
315 virtual void FreeData();
316
317 /// Return code for each point searched by FindPoints: inside element (0), on
318 /// element boundary (1), or not found (2).
319 virtual const Array<unsigned int> &GetCode() const { return gsl_code; }
320 /// Return element number for each point found by FindPoints.
321 virtual const Array<unsigned int> &GetElem() const { return gsl_mfem_elem; }
322 /// Return MPI rank on which each point was found by FindPoints.
323 virtual const Array<unsigned int> &GetProc() const { return gsl_proc; }
324 /// Return reference coordinates for each point found by FindPoints.
325 virtual const Vector &GetReferencePosition() const { return gsl_mfem_ref; }
326 /// Return distance between the sought and the found point in physical space,
327 /// for each point found by FindPoints.
328 virtual const Vector &GetDist() const { return gsl_dist; }
329
330 /// Return element number for each point found by FindPoints corresponding to
331 /// GSLIB mesh. gsl_mfem_elem != gsl_elem for mesh with simplices.
332 virtual const Array<unsigned int> &GetGSLIBElem() const { return gsl_elem; }
333 /// Return reference coordinates in [-1,1] (internal range in GSLIB) for each
334 /// point found by FindPoints.
335 virtual const Vector &GetGSLIBReferencePosition() const { return gsl_ref; }
336
337 /// Get array of indices of not-found points.
339
340 /** @name Methods to support a custom interpolation procedure.
341 \brief The physical-space point that the user seeks to interpolate at
342 could be located inside an element on another mpi rank.
343 To enable a custom interpolation procedure (e.g., strain tensor computation)
344 we need a mechanism to first send element indices and reference-space
345 coordinates to the mpi-ranks where each point is found. Then the custom
346 interpolation can be done locally by the user before sending the
347 interpolated values back to the mpi-ranks that the query originated from.
348 Example usage looks something like this:
349
350 FindPoints() -> DistributePointInfoToOwningMPIRanks() -> Computation by
351 user -> DistributeInterpolatedValues().
352 */
353 ///@{
354 /// Distribute element indices in #gsl_mfem_elem, the reference coordinates
355 /// #gsl_mfem_ref, and the code #gsl_code to the corresponding mpi-rank
356 /// #gsl_proc for each point. The received information is provided locally
357 /// in \p recv_elem, \p recv_ref (ordered by vdim), and \p recv_code.
358 /// Note: The user can send empty Array/Vectors to the method as they are
359 /// appropriately sized and filled internally.
361 Array<unsigned int> &recv_elem, Vector &recv_ref,
362 Array<unsigned int> &recv_code);
363 /// Return interpolated values back to the mpi-ranks #recv_proc that had
364 /// sent the element indices and corresponding reference-space coordinates.
365 /// Specify \p vdim and \p ordering (by nodes or by vdim) based on how the
366 /// \p int_vals are structured. The received values are filled in
367 /// \p field_out consistent with the original ordering of the points that
368 /// were used in \ref FindPoints.
369 virtual void DistributeInterpolatedValues(const Vector &int_vals,
370 const int vdim,
371 const int ordering,
372 Vector &field_out) const;
373 ///@}
374
375 /// Return the axis-aligned bounding boxes (AABB) computed during \ref Setup.
376 /// The size of the returned vector is (nel x nverts x dim), where nel is the
377 /// number of elements (after splitting for simplcies), nverts is number of
378 /// vertices (4 in 2D, 8 in 3D), and dim is the spatial dimension.
380
381 /// Return the oriented bounding boxes (OBB) computed during \ref Setup.
382 /// Each OBB is represented using the inverse transformation (A^{-1}) and
383 /// its center (x_c), such that a point x is inside the OBB if:
384 /// -1 <= A^{-1}(x-x_c) <= 1.
385 /// The inverse transformation is returned in \p obbA, a DenseTensor of
386 /// size (dim x dim x nel), and the OBB centers are returned in \p obbC,
387 /// a vector of size (nel x dim). The vertices of the OBBs are returned in
388 /// \p obbV, a vector of size (nel x nverts x dim) .
389 void GetOrientedBoundingBoxes(DenseTensor &obbA, Vector &obbC, Vector &obbV);
390};
391
392/** \brief OversetFindPointsGSLIB enables use of findpts for arbitrary number of
393 overlapping grids.
394
395 The parameters in this class are the same as FindPointsGSLIB with the
396 difference of additional inputs required to account for more than 1 mesh. */
398{
399protected:
401 unsigned int u_meshid;
402 Vector distfint; // Used to store nodal vals of grid func. passed to findpts
403
404public:
407
408#ifdef MFEM_USE_MPI
409 OversetFindPointsGSLIB(MPI_Comm comm_) : FindPointsGSLIB(comm_),
410 overset(true) { }
411#endif
412
413 /** Initializes the internal mesh in gslib, by sending the positions of the
414 Gauss-Lobatto nodes of the input Mesh object \p m.
415 Note: not tested with periodic meshes (L2).
416 Note: the input mesh \p m must have Nodes set.
417
418 @param[in] m Input mesh.
419 @param[in] meshid A unique # for each overlapping mesh. This id is
420 used to make sure that points being searched are not
421 looked for in the mesh that they belong to.
422 @param[in] gfmax (Optional) GridFunction in H1 that is used as a
423 discriminator when one point is located in multiple
424 meshes. The mesh that maximizes gfmax is chosen.
425 For example, using the distance field based on the
426 overlapping boundaries is helpful for convergence
427 during Schwarz iterations.
428 @param[in] bb_t (Optional) Relative size of bounding box around
429 each element.
430 @param[in] newt_tol (Optional) Newton tolerance for the gslib
431 search methods.
432 @param[in] npt_max (Optional) Number of points for simultaneous
433 iteration. This alters performance and
434 memory footprint.*/
435 void Setup(Mesh &m, const int meshid, GridFunction *gfmax = NULL,
436 const double bb_t = 0.1, const double newt_tol = 1.0e-12,
437 const int npt_max = 256);
438
439 /** Searches positions given in physical space by \p point_pos. All output
440 Arrays and Vectors are expected to have the correct size.
441
442 @param[in] point_pos Positions to be found.
443 @param[in] point_id Index of the mesh that the point belongs
444 to (corresponding to \p meshid in Setup).
445 @param[in] point_pos_ordering Ordering of the points:
446 byNodes: (XXX...,YYY...,ZZZ) or
447 byVDim: (XYZ,XYZ,....XYZ) */
448 void FindPoints(const Vector &point_pos,
449 Array<unsigned int> &point_id,
450 int point_pos_ordering = Ordering::byNODES);
451
452 /** Search positions and interpolate */
453 void Interpolate(const Vector &point_pos, Array<unsigned int> &point_id,
454 const GridFunction &field_in, Vector &field_out,
455 int point_pos_ordering = Ordering::byNODES);
457};
458
459/** \brief Class for gather-scatter (gs) operations on Vectors based on
460 corresponding global identifiers.
461
462 This functionality is useful for gs-ops on DOF values across processor
463 boundary, where the global identifier would be the corresponding true DOF
464 index. Operations currently supported are min, max, sum, and multiplication.
465 Note: identifier 0 does not participate in the gather-scatter operation and
466 a given identifier can be included multiple times on a given rank.
467 For example, consider a vector, v:
468 - v = [0.3, 0.4, 0.25, 0.7] on rank1,
469 - v = [0.6, 0.1] on rank 2,
470 - v = [-0.2, 0.3, 0.7, 0.] on rank 3.
471
472 Consider a corresponding Array<int>, a:
473 - a = [1, 2, 3, 1] on rank 1,
474 - a = [3, 2] on rank 2,
475 - a = [1, 2, 0, 3] on rank 3.
476
477 A gather-scatter "minimum" operation, done as follows:
478 GSOPGSLIB gs = GSOPGSLIB(MPI_COMM_WORLD, a);
479 gs.GS(v, GSOp::MIN);
480 would return into v:
481 - v = [-0.2, 0.1, 0., -0.2] on rank 1,
482 - v = [0., 0.1] on rank 2,
483 - v = [-0.2, 0.1, 0.7, 0.] on rank 3,
484 where the values have been compared across all processors based on the
485 integer identifier. */
487{
488protected:
489 struct gslib::crystal *cr; // gslib's internal data
490 struct gslib::comm *gsl_comm; // gslib's internal data
491 struct gslib::gs_data *gsl_data = NULL;
493
494public:
496
497#ifdef MFEM_USE_MPI
498 GSOPGSLIB(MPI_Comm comm_, Array<long long> &ids);
499#endif
500
501 virtual ~GSOPGSLIB();
502
503 /// Supported operation types. See class description.
504 enum GSOp {ADD, MUL, MIN, MAX};
505
506 /// Update the identifiers used for the gather-scatter operator.
507 /// Same \p ids get grouped together and id == 0 does not participate.
508 /// See class description.
509 void UpdateIdentifiers(const Array<long long> &ids);
510
511 /// Gather-Scatter operation on senddata. Must match length of unique
512 /// identifiers used in the constructor. See class description.
513 void GS(Vector &senddata, GSOp op);
514};
515
516} // namespace mfem
517
518#endif // MFEM_USE_GSLIB
519
520#endif // MFEM_GSLIB
Rank 3 tensor (array of matrices)
FindPointsGSLIB can robustly evaluate a GridFunction on an arbitrary collection of points....
Definition gslib.hpp:73
virtual void DistributePointInfoToOwningMPIRanks(Array< unsigned int > &recv_elem, Vector &recv_ref, Array< unsigned int > &recv_code)
Definition gslib.cpp:2135
struct mfem::FindPointsGSLIB::@24 DEV
virtual ~FindPointsGSLIB()
Definition gslib.cpp:127
void FindPointsOnDevice(const Vector &point_pos, int point_pos_ordering=Ordering::byNODES)
Definition gslib.cpp:484
Array< unsigned int > gsl_code
Definition gslib.hpp:90
Array< Mesh * > mesh_split
Definition gslib.hpp:79
virtual const Vector & GetDist() const
Definition gslib.hpp:328
void InterpolateLocal2(const Vector &field_in, Array< int > &gsl_elem_dev_l, Vector &gsl_ref_l, Vector &field_out, int npt, int ncomp, int nel, int dof1dsol)
void FindPoints(const Vector &point_pos, int point_pos_ordering=Ordering::byNODES)
Definition gslib.cpp:236
void GetAxisAlignedBoundingBoxes(Vector &aabb)
Definition gslib.cpp:2249
void FindPointsLocal3(const Vector &point_pos, int point_pos_ordering, Array< unsigned int > &gsl_code_dev_l, Array< unsigned int > &gsl_elem_dev_l, Vector &gsl_ref_l, Vector &gsl_dist_l, int npt)
virtual const Vector & GetReferencePosition() const
Return reference coordinates for each point found by FindPoints.
Definition gslib.hpp:325
void Setup(Mesh &m, const double bb_t=0.1, const double newt_tol=1.0e-12, const int npt_max=256)
Definition gslib.cpp:183
virtual void Interpolate(const GridFunction &field_in, Vector &field_out)
Definition gslib.cpp:1759
virtual void InterpolateH1(const GridFunction &field_in, Vector &field_out)
Use GSLIB for communication and interpolation.
Definition gslib.cpp:1885
Array< FiniteElementSpace * > fes_rst_map
Definition gslib.hpp:83
virtual void SetGPUtoCPUFallback(bool mode)
Definition gslib.hpp:305
virtual void GetNodalValues(const GridFunction *gf_in, Vector &node_vals)
Get GridFunction value at the points expected by GSLIB.
Definition gslib.cpp:1472
struct gslib::hash_data_3 * hash3
Definition gslib.hpp:114
virtual const Array< unsigned int > & GetCode() const
Definition gslib.hpp:319
Array< int > split_element_index
Definition gslib.hpp:97
FiniteElementCollection * fec_map_lin
Definition gslib.hpp:85
virtual const Array< unsigned int > & GetElem() const
Return element number for each point found by FindPoints.
Definition gslib.hpp:321
virtual void DistributeInterpolatedValues(const Vector &int_vals, const int vdim, const int ordering, Vector &field_out) const
Definition gslib.cpp:2194
struct gslib::comm * gsl_comm
Definition gslib.hpp:88
void InterpolateLocal3(const Vector &field_in, Array< int > &gsl_elem_dev_l, Vector &gsl_ref_l, Vector &field_out, int npt, int ncomp, int nel, int dof1dsol)
Array< unsigned int > gsl_elem
Definition gslib.hpp:90
Array< unsigned int > recv_proc
Definition gslib.hpp:92
virtual const Array< unsigned int > & GetGSLIBElem() const
Definition gslib.hpp:332
virtual void SetupSplitMeshesAndIntegrationRules(const int order)
Definition gslib.cpp:1399
Array< unsigned int > gsl_proc
Definition gslib.hpp:90
virtual void SetupIntegrationRuleForSplitMesh(Mesh *mesh, IntegrationRule *irule, int order)
Definition gslib.cpp:1351
virtual const Vector & GetGSLIBReferencePosition() const
Definition gslib.hpp:335
Array< unsigned int > gsl_mfem_elem
Definition gslib.hpp:90
Array< IntegrationRule * > ir_split
Definition gslib.hpp:82
Array< unsigned int > loc_hash_offset
Definition gslib.hpp:117
double default_interp_value
Definition gslib.hpp:94
virtual void SetupSplitMeshes()
Definition gslib.cpp:1159
virtual void MapRefPosAndElemIndices()
Definition gslib.cpp:1582
virtual void FreeData()
Definition gslib.cpp:1123
virtual void SetDefaultInterpolationValue(double interp_value_)
Definition gslib.hpp:290
Array< unsigned int > GetPointsNotFoundIndices() const
Get array of indices of not-found points.
Definition gslib.cpp:2122
FindPointsGSLIB & operator=(const FindPointsGSLIB &)=delete
virtual void InterpolateGeneral(const GridFunction &field_in, Vector &field_out)
Definition gslib.cpp:1961
Array< GridFunction * > gf_rst_map
Definition gslib.hpp:84
virtual void SetL2AvgType(AvgType avgtype_)
Definition gslib.hpp:286
virtual const Array< unsigned int > & GetProc() const
Return MPI rank on which each point was found by FindPoints.
Definition gslib.hpp:323
Array< int > split_element_map
Definition gslib.hpp:96
void GetOrientedBoundingBoxes(DenseTensor &obbA, Vector &obbC, Vector &obbV)
Definition gslib.cpp:2319
FindPointsGSLIB(const FindPointsGSLIB &)=delete
void InterpolateOnDevice(const Vector &field_in_evec, Vector &field_out, const int nel, const int ncomp, const int dof1dsol, const int ordering)
Definition gslib.cpp:851
struct gslib::hash_data_2 * hash2
Definition gslib.hpp:115
Array< unsigned int > recv_index
Definition gslib.hpp:92
void FindPointsLocal2(const Vector &point_pos, int point_pos_ordering, Array< unsigned int > &gsl_code_dev_l, Array< unsigned int > &gsl_elem_dev_l, Vector &gsl_ref_l, Vector &gsl_dist_l, int npt)
virtual void SetDistanceToleranceForPointsFoundOnBoundary(double bdr_tol_)
Definition gslib.hpp:298
struct gslib::crystal * cr
Definition gslib.hpp:87
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
Definition fe_coll.hpp:27
Class for gather-scatter (gs) operations on Vectors based on corresponding global identifiers.
Definition gslib.hpp:487
struct gslib::comm * gsl_comm
Definition gslib.hpp:490
void GS(Vector &senddata, GSOp op)
Definition gslib.cpp:2648
GSOPGSLIB(Array< long long > &ids)
Definition gslib.cpp:2594
virtual ~GSOPGSLIB()
Definition gslib.cpp:2623
GSOp
Supported operation types. See class description.
Definition gslib.hpp:504
struct gslib::crystal * cr
Definition gslib.hpp:489
struct gslib::gs_data * gsl_data
Definition gslib.hpp:491
void UpdateIdentifiers(const Array< long long > &ids)
Definition gslib.cpp:2632
Class for grid function - Vector with associated FE space.
Definition gridfunc.hpp:32
Class for an integration rule - an Array of IntegrationPoint.
Definition intrules.hpp:100
Mesh data type.
Definition mesh.hpp:65
OversetFindPointsGSLIB enables use of findpts for arbitrary number of overlapping grids.
Definition gslib.hpp:398
void Setup(Mesh &m, const int meshid, GridFunction *gfmax=NULL, const double bb_t=0.1, const double newt_tol=1.0e-12, const int npt_max=256)
Definition gslib.cpp:2433
void Interpolate(const Vector &point_pos, Array< unsigned int > &point_id, const GridFunction &field_in, Vector &field_out, int point_pos_ordering=Ordering::byNODES)
Definition gslib.cpp:2584
void FindPoints(const Vector &point_pos, Array< unsigned int > &point_id, int point_pos_ordering=Ordering::byNODES)
Definition gslib.cpp:2504
OversetFindPointsGSLIB(MPI_Comm comm_)
Definition gslib.hpp:409
Class for parallel meshes.
Definition pmesh.hpp:34
Vector data type.
Definition vector.hpp:82