SpECTRE  v2025.08.19
dg::MortarInterpolator< Dim > Class Template Reference

Interpolator to be used for interpolating boundary data from (to) a Neighbor onto a mortar between nonconforming Blocks. More...

#include <MortarInterpolator.hpp>

Public Member Functions

 MortarInterpolator (const ElementId< Dim > &host_id, const DirectionalId< Dim > &neighbor_id, const Domain< Dim > &domain, const Mesh< Dim - 1 > &host_mortar_mesh, const Mesh< Dim - 1 > &neighbor_mortar_mesh)
 The Element with host_id is one of the multiple nonconforming Elements abutting the single Element with neighbor_id. The host_mortar_mesh and neighbor_mortar_mesh are simply the appropriate face Mesh of the host and neighbor.
 
const std::vector< size_t > & interpolated_neighbor_data_offsets () const
 The offsets of the data returned by interpolate_to_neighbor into the full data on the neighbor_mortar_mesh. More...
 
const Mesh< Dim - 1 > & neighbor_mortar_mesh () const
 The neighbor mortar mesh that is used to compute the target points and offsets when interpolating to the neighbor.
 
void reset_if_necessary (const Domain< Dim > &domain, const Mesh< Dim - 1 > &host_mortar_mesh, const Mesh< Dim - 1 > &neighbor_mortar_mesh)
 Updates the interpolator if either of the mortar Mesh change.
 
void pup (PUP::er &p)
 
void interpolate_to_host (gsl::not_null< DataVector * > result, const DataVector &neighbor_data) const
 Interpolates the boundary data of the neighbor to the host mortar. More...
 
DataVector interpolate_to_host (const DataVector &neighbor_data) const
 Interpolates the boundary data of the neighbor to the host mortar. More...
 
void interpolate_to_neighbor (gsl::not_null< DataVector * > result, const DataVector &host_data) const
 Interpolates the boundary data of the host to a subset of the points of the neighbor mortar. More...
 
DataVector interpolate_to_neighbor (const DataVector &host_data) const
 Interpolates the boundary data of the host to a subset of the points of the neighbor mortar. More...
 

Friends

template<size_t LocalDim>
bool operator== (const MortarInterpolator< LocalDim > &lhs, const MortarInterpolator< LocalDim > &rhs)
 

Detailed Description

template<size_t Dim>
class dg::MortarInterpolator< Dim >

Interpolator to be used for interpolating boundary data from (to) a Neighbor onto a mortar between nonconforming Blocks.

Details

This interpolator is designed to be used when multiple nonconforming elements are neighbors with a single element (e.g deformed cubes of a cubed sphere next to a single S2 spherical shell). Each of the multiple elements (the hosts) should create this class to both interpolate neighbor boundary data to the mortar of the host as well as interpolate the host boundary data onto the subset of points of the mortar of the neighbor.

Note
For nonconforming neighbors, the block logical coordinates of neighboring elements are not related by a discrete rotation (i.e. an OrientationMap). Therefore boundary data cannot be copied or projected to a neighbor, but must be interpolated. As nonconforming neighbors cannot exist in one dimension, this class is not instantiated for Dim = 1.

Member Function Documentation

◆ interpolate_to_host() [1/2]

template<size_t Dim>
DataVector dg::MortarInterpolator< Dim >::interpolate_to_host ( const DataVector neighbor_data) const

Interpolates the boundary data of the neighbor to the host mortar.

Details

neighbor_data is a type-erased Variables so will have a size equal to the product of the number of components and the number of grid points of the neighbor_mortar_mesh. The returned DataVector will have a size equal to the number of components and the number of grid points of the host_mortar_mesh.

◆ interpolate_to_host() [2/2]

template<size_t Dim>
void dg::MortarInterpolator< Dim >::interpolate_to_host ( gsl::not_null< DataVector * >  result,
const DataVector neighbor_data 
) const

Interpolates the boundary data of the neighbor to the host mortar.

Details

neighbor_data is a type-erased Variables so will have a size equal to the product of the number of components and the number of grid points of the neighbor_mortar_mesh. The returned DataVector will have a size equal to the number of components and the number of grid points of the host_mortar_mesh.

◆ interpolate_to_neighbor() [1/2]

template<size_t Dim>
DataVector dg::MortarInterpolator< Dim >::interpolate_to_neighbor ( const DataVector host_data) const

Interpolates the boundary data of the host to a subset of the points of the neighbor mortar.

Details

host_data is a type-erased Variables so will have a size equal to the product of the number of components and the number of grid points of the host_mortar_mesh. The returned DataVector will have a size equal to the number of components and the number of grid points of the neighbor_mortar_mesh that the host is able to interpolate to.

◆ interpolate_to_neighbor() [2/2]

template<size_t Dim>
void dg::MortarInterpolator< Dim >::interpolate_to_neighbor ( gsl::not_null< DataVector * >  result,
const DataVector host_data 
) const

Interpolates the boundary data of the host to a subset of the points of the neighbor mortar.

Details

host_data is a type-erased Variables so will have a size equal to the product of the number of components and the number of grid points of the host_mortar_mesh. The returned DataVector will have a size equal to the number of components and the number of grid points of the neighbor_mortar_mesh that the host is able to interpolate to.

◆ interpolated_neighbor_data_offsets()

template<size_t Dim>
const std::vector< size_t > & dg::MortarInterpolator< Dim >::interpolated_neighbor_data_offsets ( ) const
inline

The offsets of the data returned by interpolate_to_neighbor into the full data on the neighbor_mortar_mesh.

Details

The DataVectors of type-erased Variables store data such that the grid point index varies fastest (as opposed to the component index). The size of the returned vector is equal to the number of grid points of the neighbor_mortar_mesh that the host is able to interpolate to, and the values of the returned vector map the grid point index of the partial DataVector returned by interpolate_to_neighbor to the grid point index of the full DataVector on the neighbor_mortar_mesh


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