MFEM v4.8.0
Finite element discretization library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
mfem::BatchInverseElementTransformation Class Reference

Performs batch inverse element transforms. Currently only supports non-mixed meshes with SEGMENT, SQUARE, or CUBE geometries. Mixed element order meshes are projected onto an equivalent uniform order mesh. More...

#include <eltrans.hpp>

Classes

struct  Kernels
 

Public Types

using ClosestPhysPointKernelType
 
using ClosestPhysDofKernelType
 
using ClosestRefDofKernelType
 
using ClosestRefPointKernelType
 
using NewtonKernelType
 
using NewtonEdgeScanKernelType
 

Public Member Functions

 BatchInverseElementTransformation ()
 
 BatchInverseElementTransformation (const GridFunction &nodes, MemoryType d_mt=MemoryType::DEFAULT)
 
 BatchInverseElementTransformation (const Mesh &mesh, MemoryType d_mt=MemoryType::DEFAULT)
 
 ~BatchInverseElementTransformation ()
 
void SetInitialGuessType (InverseElementTransformation::InitGuessType itype)
 Choose how the initial guesses for subsequent calls to Transform() will be selected. ClosestRefNode is currently not supported.
 
void SetInitGuessPointsType (int q_type)
 
void SetInitGuessRelOrder (int order)
 Set the relative order used for the Closest* initial guess types.
 
void SetInitGuessOrder (int order)
 
int GetBasisType () const
 
void SetSolverType (InverseElementTransformation::SolverType stype)
 Specify which algorithm to use for solving the transformation equation, i.e. when calling the Transform() method. NewtonSegmentProject is currently not supported.
 
void SetMaxIter (int max_it)
 Set the maximum number of iterations when solving for a reference point.
 
void SetReferenceTol (real_t ref_sp_tol)
 Set the reference-space convergence tolerance.
 
void SetPhysicalRelTol (real_t phys_rel_tol)
 Set the relative physical-space convergence tolerance.
 
void UpdateNodes (const GridFunction &nodes, MemoryType d_mt=MemoryType::DEFAULT)
 Updates internal datastructures if nodes change. Some version of UpdateNodes must be called at least once before calls to Transform if nodes have changed.
 
void UpdateNodes (const Mesh &mesh, MemoryType d_mt=MemoryType::DEFAULT)
 Updates internal datastructures if mesh nodes change. Some version of UpdateNodes must be called at least once before calls to Transform if mesh nodes have changed. mesh.GetNodes() must not be null.
 
void Transform (const Vector &pts, const Array< int > &elems, Array< int > &types, Vector &refs, bool use_device=true, Array< int > *iters=nullptr) const
 Performs a batch request of a set of points belonging to the given elements. pts list of physical point coordinates ordered by Ordering::Type::byNODES. elems which element index to search for each corresponding point in pts types output search classification (.
 
 MFEM_REGISTER_KERNELS (FindClosestPhysPoint, ClosestPhysPointKernelType,(int, int, bool))
 
 MFEM_REGISTER_KERNELS (FindClosestPhysDof, ClosestPhysDofKernelType,(int, int, bool))
 
 MFEM_REGISTER_KERNELS (FindClosestRefDof, ClosestRefDofKernelType,(int, int, bool))
 
 MFEM_REGISTER_KERNELS (FindClosestRefPoint, ClosestRefPointKernelType,(int, int, bool))
 
 MFEM_REGISTER_KERNELS (NewtonSolve, NewtonKernelType,(int, int, InverseElementTransformation::SolverType, bool))
 
 MFEM_REGISTER_KERNELS (NewtonEdgeScan, NewtonEdgeScanKernelType,(int, int, InverseElementTransformation::SolverType, bool))
 

Static Public Member Functions

template<int Dim, int SDim>
static void AddFindClosestSpecialization ()
 
template<int Dim, int SDim, InverseElementTransformation::SolverType SType>
static void AddNewtonSolveSpecialization ()
 

Detailed Description

Performs batch inverse element transforms. Currently only supports non-mixed meshes with SEGMENT, SQUARE, or CUBE geometries. Mixed element order meshes are projected onto an equivalent uniform order mesh.

Definition at line 405 of file eltrans.hpp.

Member Typedef Documentation

◆ ClosestPhysDofKernelType

Initial value:
void (*)(int, int, int,
const real_t *, const real_t *,
const int *, const real_t *,
real_t *)
float real_t
Definition config.hpp:43

Definition at line 555 of file eltrans.hpp.

◆ ClosestPhysPointKernelType

Initial value:
void (*)(int, int, int, int,
const real_t *, const real_t *,
const int *, const real_t *,
const real_t *, real_t *)

Definition at line 546 of file eltrans.hpp.

◆ ClosestRefDofKernelType

Initial value:
void (*)(int, int, int, const real_t *,
const real_t *, const int *,
const real_t *, real_t *)

Definition at line 564 of file eltrans.hpp.

◆ ClosestRefPointKernelType

Initial value:
void (*)(int, int, int, int, const real_t *,
const real_t *, const int *,
const real_t *, const real_t *,
real_t *)

Definition at line 572 of file eltrans.hpp.

◆ NewtonEdgeScanKernelType

Initial value:
void (*)(real_t, real_t, int, int, int, int,
const real_t *, const real_t *,
const int *, const real_t *,
const real_t *, int, int *, int *,
real_t *)

Definition at line 591 of file eltrans.hpp.

◆ NewtonKernelType

Initial value:
void (*)(real_t, real_t, int, int, int, int,
const real_t *, const real_t *,
const int *, const real_t *, int *, int*,
real_t *)

Definition at line 581 of file eltrans.hpp.

Constructor & Destructor Documentation

◆ BatchInverseElementTransformation() [1/3]

mfem::BatchInverseElementTransformation::BatchInverseElementTransformation ( )

Uninitialized BatchInverseElementTransformation. Users must call UpdateNodes before Transform.

Definition at line 24 of file batchitrans.cpp.

◆ BatchInverseElementTransformation() [2/3]

mfem::BatchInverseElementTransformation::BatchInverseElementTransformation ( const GridFunction & nodes,
MemoryType d_mt = MemoryType::DEFAULT )

Constructs a BatchInverseElementTransformation given nodes representing the mesh nodes.

Definition at line 28 of file batchitrans.cpp.

◆ BatchInverseElementTransformation() [3/3]

mfem::BatchInverseElementTransformation::BatchInverseElementTransformation ( const Mesh & mesh,
MemoryType d_mt = MemoryType::DEFAULT )

Constructs a BatchInverseElementTransformation for a given mesh. mesh.GetNodes() must not be null.

Definition at line 35 of file batchitrans.cpp.

◆ ~BatchInverseElementTransformation()

mfem::BatchInverseElementTransformation::~BatchInverseElementTransformation ( )

Definition at line 39 of file batchitrans.cpp.

Member Function Documentation

◆ AddFindClosestSpecialization()

template<int Dim, int SDim>
static void mfem::BatchInverseElementTransformation::AddFindClosestSpecialization ( )
inlinestatic

Definition at line 605 of file eltrans.hpp.

◆ AddNewtonSolveSpecialization()

template<int Dim, int SDim, InverseElementTransformation::SolverType SType>
static void mfem::BatchInverseElementTransformation::AddNewtonSolveSpecialization ( )
inlinestatic

Definition at line 618 of file eltrans.hpp.

◆ GetBasisType()

int mfem::BatchInverseElementTransformation::GetBasisType ( ) const
inline

Gets the basis type nodes are projected onto, or BasisType::Invalid if uninitialized.

Definition at line 490 of file eltrans.hpp.

◆ MFEM_REGISTER_KERNELS() [1/6]

mfem::BatchInverseElementTransformation::MFEM_REGISTER_KERNELS ( FindClosestPhysDof ,
ClosestPhysDofKernelType ,
(int, int, bool)  )

◆ MFEM_REGISTER_KERNELS() [2/6]

mfem::BatchInverseElementTransformation::MFEM_REGISTER_KERNELS ( FindClosestPhysPoint ,
ClosestPhysPointKernelType ,
(int, int, bool)  )

◆ MFEM_REGISTER_KERNELS() [3/6]

mfem::BatchInverseElementTransformation::MFEM_REGISTER_KERNELS ( FindClosestRefDof ,
ClosestRefDofKernelType ,
(int, int, bool)  )

◆ MFEM_REGISTER_KERNELS() [4/6]

mfem::BatchInverseElementTransformation::MFEM_REGISTER_KERNELS ( FindClosestRefPoint ,
ClosestRefPointKernelType ,
(int, int, bool)  )

◆ MFEM_REGISTER_KERNELS() [5/6]

mfem::BatchInverseElementTransformation::MFEM_REGISTER_KERNELS ( NewtonEdgeScan ,
NewtonEdgeScanKernelType ,
(int, int, InverseElementTransformation::SolverType, bool)  )

◆ MFEM_REGISTER_KERNELS() [6/6]

mfem::BatchInverseElementTransformation::MFEM_REGISTER_KERNELS ( NewtonSolve ,
NewtonKernelType ,
(int, int, InverseElementTransformation::SolverType, bool)  )

◆ SetInitGuessOrder()

void mfem::BatchInverseElementTransformation::SetInitGuessOrder ( int order)
inline

The number of points in each spatial direction is given by the formula order+1.

Definition at line 486 of file eltrans.hpp.

◆ SetInitGuessPointsType()

void mfem::BatchInverseElementTransformation::SetInitGuessPointsType ( int q_type)
inline

Set the Quadrature1D type used for the Closest* and EdgeScan initial guess types.

Definition at line 472 of file eltrans.hpp.

◆ SetInitGuessRelOrder()

void mfem::BatchInverseElementTransformation::SetInitGuessRelOrder ( int order)
inline

Set the relative order used for the Closest* initial guess types.

The number of points in each spatial direction is given by the formula max(trans_order+order,0)+1, where trans_order is the order of the current ElementTransformation.

Definition at line 478 of file eltrans.hpp.

◆ SetInitialGuessType()

void mfem::BatchInverseElementTransformation::SetInitialGuessType ( InverseElementTransformation::InitGuessType itype)
inline

Choose how the initial guesses for subsequent calls to Transform() will be selected. ClosestRefNode is currently not supported.

Definition at line 463 of file eltrans.hpp.

◆ SetMaxIter()

void mfem::BatchInverseElementTransformation::SetMaxIter ( int max_it)
inline

Set the maximum number of iterations when solving for a reference point.

Definition at line 503 of file eltrans.hpp.

◆ SetPhysicalRelTol()

void mfem::BatchInverseElementTransformation::SetPhysicalRelTol ( real_t phys_rel_tol)
inline

Set the relative physical-space convergence tolerance.

Definition at line 509 of file eltrans.hpp.

◆ SetReferenceTol()

void mfem::BatchInverseElementTransformation::SetReferenceTol ( real_t ref_sp_tol)
inline

Set the reference-space convergence tolerance.

Definition at line 506 of file eltrans.hpp.

◆ SetSolverType()

void mfem::BatchInverseElementTransformation::SetSolverType ( InverseElementTransformation::SolverType stype)
inline

Specify which algorithm to use for solving the transformation equation, i.e. when calling the Transform() method. NewtonSegmentProject is currently not supported.

Definition at line 495 of file eltrans.hpp.

◆ Transform()

void mfem::BatchInverseElementTransformation::Transform ( const Vector & pts,
const Array< int > & elems,
Array< int > & types,
Vector & refs,
bool use_device = true,
Array< int > * iters = nullptr ) const

Performs a batch request of a set of points belonging to the given elements. pts list of physical point coordinates ordered by Ordering::Type::byNODES. elems which element index to search for each corresponding point in pts types output search classification (.

See also
InverseElementTransformation::TransformResult). refs result reference point coordinates ordered by Ordering::Type::byNODES. If using InitGuessType::GivenPoint, this should contain the initial guess for each point. use_device hint for if device acceleration should be used. Device acceleration is currently only implemented for meshes containing only a single tensor product basis element type. iters optional array storing how many iterations was spent on each tested point

Definition at line 118 of file batchitrans.cpp.

◆ UpdateNodes() [1/2]

void mfem::BatchInverseElementTransformation::UpdateNodes ( const GridFunction & nodes,
MemoryType d_mt = MemoryType::DEFAULT )

Updates internal datastructures if nodes change. Some version of UpdateNodes must be called at least once before calls to Transform if nodes have changed.

Definition at line 47 of file batchitrans.cpp.

◆ UpdateNodes() [2/2]

void mfem::BatchInverseElementTransformation::UpdateNodes ( const Mesh & mesh,
MemoryType d_mt = MemoryType::DEFAULT )

Updates internal datastructures if mesh nodes change. Some version of UpdateNodes must be called at least once before calls to Transform if mesh nodes have changed. mesh.GetNodes() must not be null.

Definition at line 41 of file batchitrans.cpp.


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