Portage::Interpolate_2ndOrder< D, on_what, SourceMeshType, TargetMeshType, SourceStateType, TargetStateType, T, InterfaceReconstructorType, Matpoly_Splitter, Matpoly_Clipper, CoordSys > Class Template Reference

Interpolate_2ndOrder does a 2nd order interpolation of scalars. More...

#include <interpolate_2nd_order.h>

Public Member Functions

 Interpolate_2ndOrder (SourceMeshType const &source_mesh, TargetMeshType const &target_mesh, SourceStateType const &source_state, NumericTolerances_t num_tols)
 Constructor without interface reconstructor. More...
 
Interpolate_2ndOrderoperator= (const Interpolate_2ndOrder &other)=delete
 Assignment operator (disabled). More...
 
 ~Interpolate_2ndOrder ()=default
 Destructor. More...
 
void set_material (int m)
 Set the material we are operating on. More...
 
void set_interpolation_variable (std::string const &variable_name, const Portage::vector< Vector< D >> *gradient_field=nullptr)
 Set the name of the interpolation variable and the gradient field. More...
 
double operator() (int const targetCellID, std::vector< Weights_t > const &sources_and_weights) const
 Functor to do the actual interpolate calculation. More...
 

Static Public Attributes

static constexpr int order = 2
 

Detailed Description

template<int D, Entity_kind on_what, typename SourceMeshType, typename TargetMeshType, typename SourceStateType, typename TargetStateType, typename T, template< class, int, class, class > class InterfaceReconstructorType = DummyInterfaceReconstructor, class Matpoly_Splitter = void, class Matpoly_Clipper = void, class CoordSys = Wonton::DefaultCoordSys>
class Portage::Interpolate_2ndOrder< D, on_what, SourceMeshType, TargetMeshType, SourceStateType, TargetStateType, T, InterfaceReconstructorType, Matpoly_Splitter, Matpoly_Clipper, CoordSys >

Interpolate_2ndOrder does a 2nd order interpolation of scalars.

Template Parameters
Dspatial dimension of problem
on_whatThe type of entity-based data we wish to interpolate; e.g. does it live on nodes, cells, edges, etc.
SourceMeshTypeMesh wrapper class used to access source mesh info
TargetMeshTypeMesh wrapper class used to access target mesh info
SourceStateTypeState manager used to access source data.
InterfaceReconstructorTypeClass for reconstructing material interfaces
MatPoly_SplitterClass used for splitting material polygons
MatPoly_ClipperClass used for clipping material polygons
CoordSysWhat coordinate system are we operating in?

[1] Margolin, L.G. and Shashkov, M.J. "Second-order sign-preserving conservative interpolation (remapping) on general grids." Journal of Computational Physics, v 184, n 1, pp. 266-298, 2003.

[2] Dukowicz, J.K. and Kodis, J.W. "Accurate Conservative Remapping (Rezoning) for Arbitrary Lagrangian-Eulerian Computations," SIAM Journal on Scientific and Statistical Computing, Vol. 8, No. 3, pp. 305-321, 1987.

Constructor & Destructor Documentation

◆ Interpolate_2ndOrder()

template<int D, Entity_kind on_what, typename SourceMeshType , typename TargetMeshType , typename SourceStateType , typename TargetStateType , typename T , template< class, int, class, class > class InterfaceReconstructorType = DummyInterfaceReconstructor, class Matpoly_Splitter = void, class Matpoly_Clipper = void, class CoordSys = Wonton::DefaultCoordSys>
Portage::Interpolate_2ndOrder< D, on_what, SourceMeshType, TargetMeshType, SourceStateType, TargetStateType, T, InterfaceReconstructorType, Matpoly_Splitter, Matpoly_Clipper, CoordSys >::Interpolate_2ndOrder ( SourceMeshType const &  source_mesh,
TargetMeshType const &  target_mesh,
SourceStateType const &  source_state,
NumericTolerances_t  num_tols 
)
inline

Constructor without interface reconstructor.

Parameters
[in]source_meshmesh wrapper used to query source mesh info.
[in]target_meshmesh wrapper used to query target mesh info.
[in]source_statestate-manager wrapper used to query field info.

◆ ~Interpolate_2ndOrder()

template<int D, Entity_kind on_what, typename SourceMeshType , typename TargetMeshType , typename SourceStateType , typename TargetStateType , typename T , template< class, int, class, class > class InterfaceReconstructorType = DummyInterfaceReconstructor, class Matpoly_Splitter = void, class Matpoly_Clipper = void, class CoordSys = Wonton::DefaultCoordSys>
Portage::Interpolate_2ndOrder< D, on_what, SourceMeshType, TargetMeshType, SourceStateType, TargetStateType, T, InterfaceReconstructorType, Matpoly_Splitter, Matpoly_Clipper, CoordSys >::~Interpolate_2ndOrder ( )
default

Destructor.

Member Function Documentation

◆ operator()()

template<int D, Entity_kind on_what, typename SourceMeshType , typename TargetMeshType , typename SourceStateType , typename TargetStateType , typename T , template< class, int, class, class > class InterfaceReconstructorType = DummyInterfaceReconstructor, class Matpoly_Splitter = void, class Matpoly_Clipper = void, class CoordSys = Wonton::DefaultCoordSys>
double Portage::Interpolate_2ndOrder< D, on_what, SourceMeshType, TargetMeshType, SourceStateType, TargetStateType, T, InterfaceReconstructorType, Matpoly_Splitter, Matpoly_Clipper, CoordSys >::operator() ( int const  targetCellID,
std::vector< Weights_t > const &  sources_and_weights 
) const
inline

Functor to do the actual interpolate calculation.

Parameters
targetCellIDthe target cell index.
sources_and_weightsa list of source cells and intersection weights. Each element of the weights vector is a moment of the source data over the target entity. For first-order interpolation, only the first element (or zero'th moment) of the weights vector (the volume of intersection) is used. Source entities may be repeated in the list if the intersection of a target cell and a source cell consists of two or more disjoint pieces.
Returns
the interpolated value.
Todo:

cleanup the datatype for sources_and_weights - it is somewhat confusing.

must remove assumption that field is scalar.

◆ operator=()

template<int D, Entity_kind on_what, typename SourceMeshType , typename TargetMeshType , typename SourceStateType , typename TargetStateType , typename T , template< class, int, class, class > class InterfaceReconstructorType = DummyInterfaceReconstructor, class Matpoly_Splitter = void, class Matpoly_Clipper = void, class CoordSys = Wonton::DefaultCoordSys>
Interpolate_2ndOrder& Portage::Interpolate_2ndOrder< D, on_what, SourceMeshType, TargetMeshType, SourceStateType, TargetStateType, T, InterfaceReconstructorType, Matpoly_Splitter, Matpoly_Clipper, CoordSys >::operator= ( const Interpolate_2ndOrder< D, on_what, SourceMeshType, TargetMeshType, SourceStateType, TargetStateType, T, InterfaceReconstructorType, Matpoly_Splitter, Matpoly_Clipper, CoordSys > &  other)
delete

Assignment operator (disabled).

Parameters
[in]otherthe interpolator to copy
Returns
current interpolator reference

◆ set_interpolation_variable()

template<int D, Entity_kind on_what, typename SourceMeshType , typename TargetMeshType , typename SourceStateType , typename TargetStateType , typename T , template< class, int, class, class > class InterfaceReconstructorType = DummyInterfaceReconstructor, class Matpoly_Splitter = void, class Matpoly_Clipper = void, class CoordSys = Wonton::DefaultCoordSys>
void Portage::Interpolate_2ndOrder< D, on_what, SourceMeshType, TargetMeshType, SourceStateType, TargetStateType, T, InterfaceReconstructorType, Matpoly_Splitter, Matpoly_Clipper, CoordSys >::set_interpolation_variable ( std::string const &  variable_name,
const Portage::vector< Vector< D >> *  gradient_field = nullptr 
)
inline

Set the name of the interpolation variable and the gradient field.

Parameters
[in]variable_namethe variable name
[in]gradient_fieldthe gradient field

◆ set_material()

template<int D, Entity_kind on_what, typename SourceMeshType , typename TargetMeshType , typename SourceStateType , typename TargetStateType , typename T , template< class, int, class, class > class InterfaceReconstructorType = DummyInterfaceReconstructor, class Matpoly_Splitter = void, class Matpoly_Clipper = void, class CoordSys = Wonton::DefaultCoordSys>
void Portage::Interpolate_2ndOrder< D, on_what, SourceMeshType, TargetMeshType, SourceStateType, TargetStateType, T, InterfaceReconstructorType, Matpoly_Splitter, Matpoly_Clipper, CoordSys >::set_material ( int  m)
inline

Set the material we are operating on.

Parameters
[in]mthe material ID.

Member Data Documentation

◆ order

template<int D, Entity_kind on_what, typename SourceMeshType , typename TargetMeshType , typename SourceStateType , typename TargetStateType , typename T , template< class, int, class, class > class InterfaceReconstructorType = DummyInterfaceReconstructor, class Matpoly_Splitter = void, class Matpoly_Clipper = void, class CoordSys = Wonton::DefaultCoordSys>
constexpr int Portage::Interpolate_2ndOrder< D, on_what, SourceMeshType, TargetMeshType, SourceStateType, TargetStateType, T, InterfaceReconstructorType, Matpoly_Splitter, Matpoly_Clipper, CoordSys >::order = 2
static

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