MFEM  v4.1.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mfem::FindPointsGSLIB Class Reference

#include <gslib.hpp>

Collaboration diagram for mfem::FindPointsGSLIB:
[legend]

Public Member Functions

 FindPointsGSLIB ()
 
 FindPointsGSLIB (MPI_Comm _comm)
 
 ~FindPointsGSLIB ()
 
void Setup (Mesh &m, double bb_t, double newt_tol, int npt_max)
 
void FindPoints (Vector &point_pos, Array< unsigned int > &codes, Array< unsigned int > &proc_ids, Array< unsigned int > &elem_ids, Vector &ref_pos, Vector &dist)
 
void Interpolate (Array< unsigned int > &codes, Array< unsigned int > &proc_ids, Array< unsigned int > &elem_ids, Vector &ref_pos, const GridFunction &field_in, Vector &field_out)
 
void FreeData ()
 

Protected Member Functions

void GetNodeValues (const GridFunction &gf_in, Vector &node_vals)
 

Protected Attributes

Meshmesh
 
Vector gsl_mesh
 
struct findpts_data_2 * fdata2D
 
struct findpts_data_3 * fdata3D
 
int dim
 
struct comm * gsl_comm
 

Detailed Description

Definition at line 27 of file gslib.hpp.

Constructor & Destructor Documentation

mfem::FindPointsGSLIB::FindPointsGSLIB ( )

Definition at line 31 of file gslib.cpp.

mfem::FindPointsGSLIB::FindPointsGSLIB ( MPI_Comm  _comm)

Definition at line 50 of file gslib.cpp.

mfem::FindPointsGSLIB::~FindPointsGSLIB ( )

Definition at line 44 of file gslib.cpp.

Member Function Documentation

void mfem::FindPointsGSLIB::FindPoints ( Vector point_pos,
Array< unsigned int > &  codes,
Array< unsigned int > &  proc_ids,
Array< unsigned int > &  elem_ids,
Vector ref_pos,
Vector dist 
)

Searches positions given in physical space by point_pos. All output Arrays and Vectors are expected to have the correct size.

Parameters
[in]point_posPositions to be found. Must by ordered by nodes (XXX...,YYY...,ZZZ).
[out]codesReturn codes for each point: inside element (0), element boundary (1), not found (2).
[out]proc_idsMPI proc ids where the points were found.
[out]elem_idsElement ids where the points were found.
[out]ref_posReference coordinates of the found point. Ordered by vdim (XYZ,XYZ,XYZ...). Note: the gslib reference frame is [-1,1].
[out]distDistance between the seeked and the found point in physical space.

Definition at line 115 of file gslib.cpp.

void mfem::FindPointsGSLIB::FreeData ( )

Cleans up memory allocated internally by gslib. Note that in parallel, this must be called before MPI_Finalize(), as it calls MPI_Comm_free() for internal gslib communicators.

Definition at line 185 of file gslib.cpp.

void mfem::FindPointsGSLIB::GetNodeValues ( const GridFunction gf_in,
Vector node_vals 
)
protected

Definition at line 190 of file gslib.cpp.

void mfem::FindPointsGSLIB::Interpolate ( Array< unsigned int > &  codes,
Array< unsigned int > &  proc_ids,
Array< unsigned int > &  elem_ids,
Vector ref_pos,
const GridFunction field_in,
Vector field_out 
)

Interpolation of field values at prescribed reference space positions.

Parameters
[in]codesReturn codes for each point: inside element (0), element boundary (1), not found (2).
[in]proc_idsMPI proc ids where the points were found.
[in]elem_idsElement ids where the points were found.
[in]ref_posReference coordinates of the found point. Ordered by vdim (XYZ,XYZ,XYZ...). Note: the gslib reference frame is [-1,1].
[in]field_inFunction values that will be interpolated on the reference positions. Note: it is assumed that field_in is in H1 and in the same space as the mesh that was given to Setup().
[out]field_outInterpolated values.

Definition at line 155 of file gslib.cpp.

void mfem::FindPointsGSLIB::Setup ( Mesh m,
double  bb_t,
double  newt_tol,
int  npt_max 
)

Initializes the internal mesh in gslib, by sending the positions of the Gauss-Lobatto nodes of the input Mesh object m. Note: not tested with periodic (DG meshes). Note: the input mesh m must have Nodes set.

Parameters
[in]mInput mesh.
[in]bb_tRelative size of bounding box around each element.
[in]newt_tolNewton tolerance for the gslib search methods.
[in]npt_maxNumber of points for simultaneous iteration. This alters performance and memory footprint.

Definition at line 58 of file gslib.cpp.

Member Data Documentation

int mfem::FindPointsGSLIB::dim
protected

Definition at line 34 of file gslib.hpp.

struct findpts_data_2* mfem::FindPointsGSLIB::fdata2D
protected

Definition at line 32 of file gslib.hpp.

struct findpts_data_3* mfem::FindPointsGSLIB::fdata3D
protected

Definition at line 33 of file gslib.hpp.

struct comm* mfem::FindPointsGSLIB::gsl_comm
protected

Definition at line 36 of file gslib.hpp.

Vector mfem::FindPointsGSLIB::gsl_mesh
protected

Definition at line 31 of file gslib.hpp.

Mesh* mfem::FindPointsGSLIB::mesh
protected

Definition at line 30 of file gslib.hpp.


The documentation for this class was generated from the following files: