Compadre  1.5.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
Compadre::Evaluator Class Reference

Lightweight Evaluator Helper This class is a lightweight wrapper for extracting and applying all relevant data from a GMLS class in order to transform data into a form that can be acted on by the GMLS operator, apply the action of the GMLS operator, and then transform data again (only if on a manifold) More...

Detailed Description

Lightweight Evaluator Helper This class is a lightweight wrapper for extracting and applying all relevant data from a GMLS class in order to transform data into a form that can be acted on by the GMLS operator, apply the action of the GMLS operator, and then transform data again (only if on a manifold)

Definition at line 123 of file Compadre_Evaluator.hpp.

#include <Compadre_Evaluator.hpp>

Public Member Functions

 Evaluator (GMLS *gmls)
 
 ~Evaluator ()
 
template<typename view_type_data >
double applyAlphasToDataSingleComponentSingleTargetSite (view_type_data sampling_input_data, const int column_of_input, TargetOperation lro, const int target_index, const int evaluation_site_local_index, const int output_component_axis_1, const int output_component_axis_2, const int input_component_axis_1, const int input_component_axis_2, bool scalar_as_vector_if_needed=true) const
 Dot product of alphas with sampling data, FOR A SINGLE target_index, where sampling data is in a 1D/2D Kokkos View. More...
 
template<typename view_type_data_out , typename view_type_data_in >
void applyAlphasToDataSingleComponentAllTargetSitesWithPreAndPostTransform (view_type_data_out output_data_single_column, view_type_data_in sampling_data_single_column, TargetOperation lro, const SamplingFunctional sro, const int evaluation_site_local_index, const int output_component_axis_1, const int output_component_axis_2, const int input_component_axis_1, const int input_component_axis_2, const int pre_transform_local_index=-1, const int pre_transform_global_index=-1, const int post_transform_local_index=-1, const int post_transform_global_index=-1, bool vary_on_target=false, bool vary_on_neighbor=false) const
 Dot product of alphas with sampling data where sampling data is in a 1D/2D Kokkos View and output view is also a 1D/2D Kokkos View, however THE SAMPLING DATA and OUTPUT VIEW MUST BE ON THE DEVICE! More...
 
template<typename view_type_data_out , typename view_type_data_in >
void applyLocalChartToAmbientSpaceTransform (view_type_data_out output_data_single_column, view_type_data_in sampling_data_single_column, const int local_dim_index, const int global_dim_index) const
 Postprocessing for manifolds. More...
 
template<typename output_data_type = double**, typename output_memory_space , typename view_type_input_data , typename output_array_layout = typename view_type_input_data::array_layout>
Kokkos::View< output_data_type,
output_array_layout,
output_memory_space > 
applyAlphasToDataAllComponentsAllTargetSites (view_type_input_data sampling_data, TargetOperation lro, const SamplingFunctional sro_in=PointSample, bool scalar_as_vector_if_needed=true, const int evaluation_site_local_index=0) const
 Transformation of data under GMLS (allocates memory for output) More...
 
template<typename view_type_output_data , typename view_type_input_data , typename output_array_layout = typename view_type_input_data::array_layout>
void applyAlphasToDataAllComponentsAllTargetSites (view_type_output_data target_output, view_type_output_data ambient_target_output, view_type_input_data sampling_data, TargetOperation lro, const SamplingFunctional sro_in=PointSample, bool scalar_as_vector_if_needed=true, const int evaluation_site_local_index=0) const
 Transformation of data under GMLS (does not allocate memory for output) More...
 
template<typename view_type_data_out , typename view_type_data_in >
void applyFullPolynomialCoefficientsBasisToDataSingleComponent (view_type_data_out output_data_block_column, view_type_data_in sampling_data_single_column, const SamplingFunctional sro, const int output_component_axis_1, const int output_component_axis_2, const int input_component_axis_1, const int input_component_axis_2, const int pre_transform_local_index=-1, const int pre_transform_global_index=-1, const int post_transform_local_index=-1, const int post_transform_global_index=-1, bool vary_on_target=false, bool vary_on_neighbor=false) const
 Dot product of data with full polynomial coefficient basis where sampling data is in a 1D/2D Kokkos View and output view is also a 1D/2D Kokkos View, however THE SAMPLING DATA and OUTPUT VIEW MUST BE ON THE DEVICE! More...
 
template<typename output_data_type = double**, typename output_memory_space , typename view_type_input_data , typename output_array_layout = typename view_type_input_data::array_layout>
Kokkos::View< output_data_type,
output_array_layout,
output_memory_space > 
applyFullPolynomialCoefficientsBasisToDataAllComponents (view_type_input_data sampling_data, bool scalar_as_vector_if_needed=true) const
 Generation of polynomial reconstruction coefficients by applying to data in GMLS (allocates memory for output) More...
 
template<typename view_type_coefficient_output , typename view_type_input_data >
void applyFullPolynomialCoefficientsBasisToDataAllComponents (view_type_coefficient_output coefficient_output, view_type_input_data sampling_data, bool scalar_as_vector_if_needed=true) const
 Generation of polynomial reconstruction coefficients by applying to data in GMLS (does not allocate memory for output) More...
 

Private Attributes

GMLS_gmls
 

Constructor & Destructor Documentation

Compadre::Evaluator::Evaluator ( GMLS gmls)
inline

Definition at line 132 of file Compadre_Evaluator.hpp.

Compadre::Evaluator::~Evaluator ( )
inline

Definition at line 136 of file Compadre_Evaluator.hpp.

Member Function Documentation

template<typename output_data_type = double**, typename output_memory_space , typename view_type_input_data , typename output_array_layout = typename view_type_input_data::array_layout>
Kokkos::View<output_data_type, output_array_layout, output_memory_space> Compadre::Evaluator::applyAlphasToDataAllComponentsAllTargetSites ( view_type_input_data  sampling_data,
TargetOperation  lro,
const SamplingFunctional  sro_in = PointSample,
bool  scalar_as_vector_if_needed = true,
const int  evaluation_site_local_index = 0 
) const
inline

Transformation of data under GMLS (allocates memory for output)

This function is the go-to function to be used when the alpha values have already been calculated and stored for use. The sampling functional provided instructs how a data transformation tensor is to be used on source data before it is provided to the GMLS operator. Once the sampling functional (if applicable) and the GMLS operator have been applied, this function also handles mapping the local vector back to the ambient space if working on a manifold problem and a target functional who has rank 1 output.

Produces a Kokkos View as output with a Kokkos memory_space provided as a template tag by the caller. The data type (double* or double**) must also be specified as a template type if one wish to get a 1D Kokkos View back that can be indexed into with only one ordinal.

Assumptions on input data:

Parameters
sampling_data[in] - 1D or 2D Kokkos View that has the layout #targets * columns of data. Memory space for data can be host or device.
lro[in] - Target operation from the TargetOperation enum
sro_in[in] - Sampling functional from the SamplingFunctional enum
scalar_as_vector_if_needed[in] - If a 1D view is given, where a 2D view is expected (scalar values given where a vector was expected), then the scalar will be repeated for as many components as the vector has
evaluation_site_local_index[in] - 0 corresponds to evaluating at the target site itself, while a number larger than 0 indicates evaluation at a site other than the target, and specified by calling setAdditionalEvaluationSitesData on the GMLS class

Definition at line 370 of file Compadre_Evaluator.hpp.

template<typename view_type_output_data , typename view_type_input_data , typename output_array_layout = typename view_type_input_data::array_layout>
void Compadre::Evaluator::applyAlphasToDataAllComponentsAllTargetSites ( view_type_output_data  target_output,
view_type_output_data  ambient_target_output,
view_type_input_data  sampling_data,
TargetOperation  lro,
const SamplingFunctional  sro_in = PointSample,
bool  scalar_as_vector_if_needed = true,
const int  evaluation_site_local_index = 0 
) const
inline

Transformation of data under GMLS (does not allocate memory for output)

If space for the output result is already allocated, this function will populate the output result view (and possibly ambient target output). The sampling functional provided instructs how a data transformation tensor is to be used on source data before it is provided to the GMLS operator. Once the sampling functional (if applicable) and the GMLS operator have been applied, this function also handles mapping the local vector back to the ambient space if working on a manifold problem and a target functional who has rank 1 output.

Fills a Kokkos View of output.

Assumptions on input data:

Parameters
target_output[in] - 1D or 2D Kokkos View that has the resulting #targets * need output columns. Memory space for data can be host or device.
ambient_target_output[in] - Same view type as target_output, but dimensions should be #targets * global_dimension if this is being filled (if not being filled, then this can be an empty view)
sampling_data[in] - 1D or 2D Kokkos View that has the layout #targets * columns of data. Memory space for data can be host or device.
lro[in] - Target operation from the TargetOperation enum
sro_in[in] - Sampling functional from the SamplingFunctional enum
scalar_as_vector_if_needed[in] - If a 1D view is given, where a 2D view is expected (scalar values given where a vector was expected), then the scalar will be repeated for as many components as the vector has
evaluation_site_local_index[in] - 0 corresponds to evaluating at the target site itself, while a number larger than 0 indicates evaluation at a site other than the target, and specified by calling setAdditionalEvaluationSitesData on the GMLS class

Definition at line 417 of file Compadre_Evaluator.hpp.

template<typename view_type_data_out , typename view_type_data_in >
void Compadre::Evaluator::applyAlphasToDataSingleComponentAllTargetSitesWithPreAndPostTransform ( view_type_data_out  output_data_single_column,
view_type_data_in  sampling_data_single_column,
TargetOperation  lro,
const SamplingFunctional  sro,
const int  evaluation_site_local_index,
const int  output_component_axis_1,
const int  output_component_axis_2,
const int  input_component_axis_1,
const int  input_component_axis_2,
const int  pre_transform_local_index = -1,
const int  pre_transform_global_index = -1,
const int  post_transform_local_index = -1,
const int  post_transform_global_index = -1,
bool  vary_on_target = false,
bool  vary_on_neighbor = false 
) const
inline

Dot product of alphas with sampling data where sampling data is in a 1D/2D Kokkos View and output view is also a 1D/2D Kokkos View, however THE SAMPLING DATA and OUTPUT VIEW MUST BE ON THE DEVICE!

This function is to be used when the alpha values have already been calculated and stored for use.

Only supports one output component / input component at a time. The user will need to loop over the output components in order to fill a vector target or matrix target.

Assumptions on input data:

Parameters
output_data_single_column[out] - 1D Kokkos View (memory space must be device_memory_space())
sampling_data_single_column[in] - 1D Kokkos View (memory space must match output_data_single_column)
lro[in] - Target operation from the TargetOperation enum
sro[in] - Sampling functional from the SamplingFunctional enum
evaluation_site_local_index[in] - local column index of site from additional evaluation sites list or 0 for the target site
output_component_axis_1[in] - Row for a rank 2 tensor or rank 1 tensor, 0 for a scalar output
output_component_axis_2[in] - Columns for a rank 2 tensor, 0 for rank less than 2 output tensor
input_component_axis_1[in] - Row for a rank 2 tensor or rank 1 tensor, 0 for a scalar input
input_component_axis_2[in] - Columns for a rank 2 tensor, 0 for rank less than 2 input tensor
pre_transform_local_index[in] - For manifold problems, this is the local coordinate direction that sampling data may need to be transformed to before the application of GMLS
pre_transform_global_index[in] - For manifold problems, this is the global coordinate direction that sampling data can be represented in
post_transform_local_index[in] - For manifold problems, this is the local coordinate direction that vector output target functionals from GMLS will output into
post_transform_global_index[in] - For manifold problems, this is the global coordinate direction that the target functional output from GMLS will be transformed into
transform_output_ambient[in] - Whether or not a 1D output from GMLS is on the manifold and needs to be mapped to ambient space
vary_on_target[in] - Whether the sampling functional has a tensor to act on sampling data that varies with each target site
vary_on_neighbor[in] - Whether the sampling functional has a tensor to act on sampling data that varies with each neighbor site in addition to varying wit each target site

Definition at line 213 of file Compadre_Evaluator.hpp.

template<typename view_type_data >
double Compadre::Evaluator::applyAlphasToDataSingleComponentSingleTargetSite ( view_type_data  sampling_input_data,
const int  column_of_input,
TargetOperation  lro,
const int  target_index,
const int  evaluation_site_local_index,
const int  output_component_axis_1,
const int  output_component_axis_2,
const int  input_component_axis_1,
const int  input_component_axis_2,
bool  scalar_as_vector_if_needed = true 
) const
inline

Dot product of alphas with sampling data, FOR A SINGLE target_index, where sampling data is in a 1D/2D Kokkos View.

This function is to be used when the alpha values have already been calculated and stored for use

Only supports one output component / input component at a time. The user will need to loop over the output components in order to fill a vector target or matrix target.

Assumptions on input data:

Parameters
sampling_input_data[in] - 1D/2D Kokkos View (no restriction on memory space)
column_of_input[in] - Column of sampling_input_data to use for this input component
lro[in] - Target operation from the TargetOperation enum
target_index[in] - Target # user wants to reconstruct target functional at, corresponds to row number of neighbor_lists
output_component_axis_1[in] - Row for a rank 2 tensor or rank 1 tensor, 0 for a scalar output
output_component_axis_2[in] - Columns for a rank 2 tensor, 0 for rank less than 2 output tensor
input_component_axis_1[in] - Row for a rank 2 tensor or rank 1 tensor, 0 for a scalar input
input_component_axis_2[in] - Columns for a rank 2 tensor, 0 for rank less than 2 input tensor
scalar_as_vector_if_needed[in] - If a 1D view is given, where a 2D view is expected (scalar values given where a vector was expected), then the scalar will be repeated for as many components as the vector has

Definition at line 156 of file Compadre_Evaluator.hpp.

template<typename output_data_type = double**, typename output_memory_space , typename view_type_input_data , typename output_array_layout = typename view_type_input_data::array_layout>
Kokkos::View<output_data_type, output_array_layout, output_memory_space> Compadre::Evaluator::applyFullPolynomialCoefficientsBasisToDataAllComponents ( view_type_input_data  sampling_data,
bool  scalar_as_vector_if_needed = true 
) const
inline

Generation of polynomial reconstruction coefficients by applying to data in GMLS (allocates memory for output)

Polynomial reconstruction coefficients exist for each target, but there are coefficients for each neighbor (a basis for all potentional input data). This function uses a particular choice of data to contract over this basis and return the polynomial reconstructions coefficients specific to this data.

Produces a Kokkos View as output with a Kokkos memory_space provided as a template tag by the caller. The data type (double* or double**) must also be specified as a template type if one wish to get a 1D Kokkos View back that can be indexed into with only one ordinal.

Assumptions on input data:

Parameters
sampling_data[in] - 1D or 2D Kokkos View that has the layout #targets * columns of data. Memory space for data can be host or device.
sro[in] - Sampling functional from the SamplingFunctional enum
scalar_as_vector_if_needed[in] - If a 1D view is given, where a 2D view is expected (scalar values given where a vector was expected), then the scalar will be repeated for as many components as the vector has

Definition at line 685 of file Compadre_Evaluator.hpp.

template<typename view_type_coefficient_output , typename view_type_input_data >
void Compadre::Evaluator::applyFullPolynomialCoefficientsBasisToDataAllComponents ( view_type_coefficient_output  coefficient_output,
view_type_input_data  sampling_data,
bool  scalar_as_vector_if_needed = true 
) const
inline

Generation of polynomial reconstruction coefficients by applying to data in GMLS (does not allocate memory for output)

Polynomial reconstruction coefficients exist for each target, but there are coefficients for each neighbor (a basis for all potentional input data). This function uses a particular choice of data to contract over this basis and return the polynomial reconstructions coefficients specific to this data.

Produces a Kokkos View as output with a Kokkos memory_space provided as a template tag by the caller. The data type (double* or double**) must also be specified as a template type if one wish to get a 1D Kokkos View back that can be indexed into with only one ordinal.

Assumptions on input data:

Parameters
coefficient_output[in] - 1D or 2D Kokkos View that has the layout #targets * #coefficients. Memory space for data can be host or device.
sampling_data[in] - 1D or 2D Kokkos View that has the layout #targets * columns of data. Memory space for data can be host or device.
sro[in] - Sampling functional from the SamplingFunctional enum
scalar_as_vector_if_needed[in] - If a 1D view is given, where a 2D view is expected (scalar values given where a vector was expected), then the scalar will be repeated for as many components as the vector has

Definition at line 722 of file Compadre_Evaluator.hpp.

template<typename view_type_data_out , typename view_type_data_in >
void Compadre::Evaluator::applyFullPolynomialCoefficientsBasisToDataSingleComponent ( view_type_data_out  output_data_block_column,
view_type_data_in  sampling_data_single_column,
const SamplingFunctional  sro,
const int  output_component_axis_1,
const int  output_component_axis_2,
const int  input_component_axis_1,
const int  input_component_axis_2,
const int  pre_transform_local_index = -1,
const int  pre_transform_global_index = -1,
const int  post_transform_local_index = -1,
const int  post_transform_global_index = -1,
bool  vary_on_target = false,
bool  vary_on_neighbor = false 
) const
inline

Dot product of data with full polynomial coefficient basis where sampling data is in a 1D/2D Kokkos View and output view is also a 1D/2D Kokkos View, however THE SAMPLING DATA and OUTPUT VIEW MUST BE ON THE DEVICE!

This function is to be used when the polynomial coefficient basis has already been calculated and stored for use.

Only supports one output component / input component at a time. The user will need to loop over the output components in order to fill a vector target or matrix target.

Assumptions on input data:

Parameters
output_data_block_column[out] - 2D Kokkos View (memory space must be device_memory_space())
sampling_data_single_column[in] - 1D Kokkos View (memory space must match output_data_single_column)
sro[in] - Sampling functional from the SamplingFunctional enum
target_index[in] - Target # user wants to reconstruct target functional at, corresponds to row number of neighbor_lists
output_component_axis_1[in] - Row for a rank 2 tensor or rank 1 tensor, 0 for a scalar output
output_component_axis_2[in] - Columns for a rank 2 tensor, 0 for rank less than 2 output tensor
input_component_axis_1[in] - Row for a rank 2 tensor or rank 1 tensor, 0 for a scalar input
input_component_axis_2[in] - Columns for a rank 2 tensor, 0 for rank less than 2 input tensor
pre_transform_local_index[in] - For manifold problems, this is the local coordinate direction that sampling data may need to be transformed to before the application of GMLS
pre_transform_global_index[in] - For manifold problems, this is the global coordinate direction that sampling data can be represented in
post_transform_local_index[in] - For manifold problems, this is the local coordinate direction that vector output target functionals from GMLS will output into
post_transform_global_index[in] - For manifold problems, this is the global coordinate direction that the target functional output from GMLS will be transformed into
vary_on_target[in] - Whether the sampling functional has a tensor to act on sampling data that varies with each target site
vary_on_neighbor[in] - Whether the sampling functional has a tensor to act on sampling data that varies with each neighbor site in addition to varying wit each target site

Definition at line 565 of file Compadre_Evaluator.hpp.

template<typename view_type_data_out , typename view_type_data_in >
void Compadre::Evaluator::applyLocalChartToAmbientSpaceTransform ( view_type_data_out  output_data_single_column,
view_type_data_in  sampling_data_single_column,
const int  local_dim_index,
const int  global_dim_index 
) const
inline

Postprocessing for manifolds.

Maps local chart vector solutions to ambient space. THE SAMPLING DATA and OUTPUT VIEW MUST BE ON THE DEVICE!

Only supports one output component / input component at a time. The user will need to loop over the output components in order to transform a vector target.

Assumptions on input data:

Parameters
output_data_single_column[out] - 1D Kokkos View (memory space must be device_memory_space())
sampling_data_single_column[in] - 1D Kokkos View (memory space must match output_data_single_column)
local_dim_index[in] - For manifold problems, this is the local coordinate direction that sampling data may need to be transformed to before the application of GMLS
global_dim_index[in] - For manifold problems, this is the global coordinate direction that sampling data can be represented in

Definition at line 317 of file Compadre_Evaluator.hpp.

Member Data Documentation

GMLS* Compadre::Evaluator::_gmls
private

Definition at line 127 of file Compadre_Evaluator.hpp.


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