PolyFEM
Loading...
Searching...
No Matches
polyfem::LazyCubicInterpolator Class Reference

#include <LazyCubicInterpolator.hpp>

Public Member Functions

 LazyCubicInterpolator (const int dim, const double delta)
 
void bicubic_interpolation (const Eigen::MatrixXd &corner_point, const std::vector< std::string > &keys, const Eigen::MatrixXd &point, double &val, Eigen::MatrixXd &grad) const
 
void tricubic_interpolation (const Eigen::MatrixXd &corner_point, const std::vector< std::string > &keys, const Eigen::MatrixXd &point, double &val, Eigen::MatrixXd &grad) const
 
void lazy_evaluate (std::function< void(const Eigen::MatrixXd &, double &)> compute_distance, const Eigen::MatrixXd &point, double &val, Eigen::MatrixXd &grad)
 
void cache_grid (std::function< void(const Eigen::MatrixXd &, double &)> compute_distance, const Eigen::MatrixXd &point)
 
void evaluate (const Eigen::MatrixXd &point, double &val, Eigen::MatrixXd &grad) const
 

Private Member Functions

void build_corner_keys (const Eigen::MatrixXd &point, Eigen::MatrixXi &keys) const
 
void setup_key (const Eigen::VectorXi &key, std::string &key_string, Eigen::MatrixXd &clamped_point) const
 

Private Attributes

int dim_
 
double delta_
 
std::unordered_map< std::string, double > implicit_function_distance
 
std::unordered_map< std::string, Eigen::VectorXd > implicit_function_grads
 
Eigen::MatrixXd cubic_mat
 
std::shared_mutex distance_mutex_
 
std::shared_mutex grad_mutex_
 

Detailed Description

Definition at line 13 of file LazyCubicInterpolator.hpp.

Constructor & Destructor Documentation

◆ LazyCubicInterpolator()

polyfem::LazyCubicInterpolator::LazyCubicInterpolator ( const int  dim,
const double  delta 
)
inline

Definition at line 16 of file LazyCubicInterpolator.hpp.

References cubic_mat, and dim_.

Member Function Documentation

◆ bicubic_interpolation()

void polyfem::LazyCubicInterpolator::bicubic_interpolation ( const Eigen::MatrixXd &  corner_point,
const std::vector< std::string > &  keys,
const Eigen::MatrixXd &  point,
double &  val,
Eigen::MatrixXd &  grad 
) const

Definition at line 6 of file LazyCubicInterpolator.cpp.

References cubic_mat, delta_, distance_mutex_, grad_mutex_, implicit_function_distance, implicit_function_grads, val, and x.

Referenced by evaluate().

Here is the caller graph for this function:

◆ build_corner_keys()

void polyfem::LazyCubicInterpolator::build_corner_keys ( const Eigen::MatrixXd &  point,
Eigen::MatrixXi &  keys 
) const
inlineprivate

Definition at line 115 of file LazyCubicInterpolator.hpp.

References delta_, and dim_.

Referenced by cache_grid(), and evaluate().

Here is the caller graph for this function:

◆ cache_grid()

void polyfem::LazyCubicInterpolator::cache_grid ( std::function< void(const Eigen::MatrixXd &, double &)>  compute_distance,
const Eigen::MatrixXd &  point 
)

Definition at line 112 of file LazyCubicInterpolator.cpp.

References build_corner_keys(), delta_, dim_, distance_mutex_, grad_mutex_, implicit_function_distance, implicit_function_grads, and setup_key().

Referenced by lazy_evaluate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ evaluate()

void polyfem::LazyCubicInterpolator::evaluate ( const Eigen::MatrixXd &  point,
double &  val,
Eigen::MatrixXd &  grad 
) const

Definition at line 208 of file LazyCubicInterpolator.cpp.

References bicubic_interpolation(), build_corner_keys(), dim_, setup_key(), tricubic_interpolation(), and val.

Referenced by lazy_evaluate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lazy_evaluate()

void polyfem::LazyCubicInterpolator::lazy_evaluate ( std::function< void(const Eigen::MatrixXd &, double &)>  compute_distance,
const Eigen::MatrixXd &  point,
double &  val,
Eigen::MatrixXd &  grad 
)

Definition at line 235 of file LazyCubicInterpolator.cpp.

References cache_grid(), evaluate(), and val.

Here is the call graph for this function:

◆ setup_key()

void polyfem::LazyCubicInterpolator::setup_key ( const Eigen::VectorXi &  key,
std::string &  key_string,
Eigen::MatrixXd &  clamped_point 
) const
inlineprivate

Definition at line 142 of file LazyCubicInterpolator.hpp.

References delta_, and dim_.

Referenced by cache_grid(), and evaluate().

Here is the caller graph for this function:

◆ tricubic_interpolation()

void polyfem::LazyCubicInterpolator::tricubic_interpolation ( const Eigen::MatrixXd &  corner_point,
const std::vector< std::string > &  keys,
const Eigen::MatrixXd &  point,
double &  val,
Eigen::MatrixXd &  grad 
) const

Definition at line 53 of file LazyCubicInterpolator.cpp.

References cubic_mat, delta_, distance_mutex_, grad_mutex_, implicit_function_distance, implicit_function_grads, val, and x.

Referenced by evaluate().

Here is the caller graph for this function:

Member Data Documentation

◆ cubic_mat

Eigen::MatrixXd polyfem::LazyCubicInterpolator::cubic_mat
private

◆ delta_

double polyfem::LazyCubicInterpolator::delta_
private

◆ dim_

int polyfem::LazyCubicInterpolator::dim_
private

◆ distance_mutex_

std::shared_mutex polyfem::LazyCubicInterpolator::distance_mutex_
mutableprivate

◆ grad_mutex_

std::shared_mutex polyfem::LazyCubicInterpolator::grad_mutex_
mutableprivate

◆ implicit_function_distance

std::unordered_map<std::string, double> polyfem::LazyCubicInterpolator::implicit_function_distance
private

◆ implicit_function_grads

std::unordered_map<std::string, Eigen::VectorXd> polyfem::LazyCubicInterpolator::implicit_function_grads
private

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