PolyFEM
Loading...
Searching...
No Matches
polyfem::utils::ExpressionValue Class Reference

#include <ExpressionValue.hpp>

Public Member Functions

 ExpressionValue ()
 
void set_unit_type (const std::string &unit_type)
 
void init (const json &vals)
 
void init (const double val)
 
void init (const Eigen::MatrixXd &val)
 
void init (const std::string &expr)
 
void init (const std::function< double(double x, double y, double z)> &func)
 
void init (const std::function< double(double x, double y, double z, double t)> &func)
 
void init (const std::function< double(double x, double y, double z, double t, int index)> &func)
 
void init (const std::function< Eigen::MatrixXd(double x, double y, double z)> &func, const int coo)
 
void init (const std::function< Eigen::MatrixXd(double x, double y, double z, double t)> &func, const int coo)
 
void set_t (const json &t)
 
double operator() (double x, double y, double z=0, double t=0, int index=-1) const
 
void clear ()
 
bool is_zero () const
 
bool is_mat () const
 
const Eigen::MatrixXd & get_mat () const
 
void set_mat (const Eigen::MatrixXd &mat)
 
double get_val () const
 

Private Attributes

std::function< double(double x, double y, double z, double t, int index)> sfunc_
 
std::function< Eigen::MatrixXd(double x, double y, double z, double t)> tfunc_
 
int tfunc_coo_
 
std::string expr_
 
double value_
 
Eigen::MatrixXd mat_
 
std::vector< ExpressionValuemat_expr_
 
std::map< double, int > t_index_
 
units::precise_unit unit_type_
 
units::precise_unit unit_
 
bool unit_type_set_ = false
 

Detailed Description

Definition at line 12 of file ExpressionValue.hpp.

Constructor & Destructor Documentation

◆ ExpressionValue()

polyfem::utils::ExpressionValue::ExpressionValue ( )

Definition at line 63 of file ExpressionValue.cpp.

References clear().

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void polyfem::utils::ExpressionValue::clear ( )

Definition at line 68 of file ExpressionValue.cpp.

References expr_, mat_, mat_expr_, sfunc_, tfunc_, and value_.

Referenced by polyfem::assembler::GenericScalarProblem::clear(), ExpressionValue(), init(), init(), init(), init(), init(), init(), init(), init(), and init().

Here is the caller graph for this function:

◆ get_mat()

const Eigen::MatrixXd & polyfem::utils::ExpressionValue::get_mat ( ) const
inline

Definition at line 49 of file ExpressionValue.hpp.

References is_mat(), and mat_.

Here is the call graph for this function:

◆ get_val()

double polyfem::utils::ExpressionValue::get_val ( ) const
inline

Definition at line 63 of file ExpressionValue.hpp.

References value_.

◆ init() [1/9]

void polyfem::utils::ExpressionValue::init ( const double  val)

Definition at line 78 of file ExpressionValue.cpp.

References clear(), val, and value_.

Here is the call graph for this function:

◆ init() [2/9]

void polyfem::utils::ExpressionValue::init ( const Eigen::MatrixXd &  val)

Definition at line 85 of file ExpressionValue.cpp.

References clear(), mat_, and val.

Here is the call graph for this function:

◆ init() [3/9]

void polyfem::utils::ExpressionValue::init ( const json vals)

Definition at line 149 of file ExpressionValue.cpp.

References clear(), init(), polyfem::logger(), mat_, mat_expr_, t_index_, unit_, and vals.

Referenced by init(), polyfem::assembler::GenericScalarProblem::set_parameters(), and polyfem::solver::TargetForm::set_reference().

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

◆ init() [4/9]

void polyfem::utils::ExpressionValue::init ( const std::function< double(double x, double y, double z)> &  func)

Definition at line 195 of file ExpressionValue.cpp.

References clear(), sfunc_, x, y, and z.

Here is the call graph for this function:

◆ init() [5/9]

void polyfem::utils::ExpressionValue::init ( const std::function< double(double x, double y, double z, double t)> &  func)

Definition at line 202 of file ExpressionValue.cpp.

References clear(), sfunc_, x, y, and z.

Here is the call graph for this function:

◆ init() [6/9]

void polyfem::utils::ExpressionValue::init ( const std::function< double(double x, double y, double z, double t, int index)> &  func)

Definition at line 208 of file ExpressionValue.cpp.

References clear(), and sfunc_.

Here is the call graph for this function:

◆ init() [7/9]

void polyfem::utils::ExpressionValue::init ( const std::function< Eigen::MatrixXd(double x, double y, double z)> &  func,
const int  coo 
)

Definition at line 214 of file ExpressionValue.cpp.

References clear(), tfunc_, tfunc_coo_, x, y, and z.

Here is the call graph for this function:

◆ init() [8/9]

void polyfem::utils::ExpressionValue::init ( const std::function< Eigen::MatrixXd(double x, double y, double z, double t)> &  func,
const int  coo 
)

Definition at line 222 of file ExpressionValue.cpp.

References clear(), tfunc_, and tfunc_coo_.

Here is the call graph for this function:

◆ init() [9/9]

void polyfem::utils::ExpressionValue::init ( const std::string &  expr)

Definition at line 92 of file ExpressionValue.cpp.

References clear(), expr_, polyfem::logger(), mat_, polyfem::io::read_matrix(), x, y, and z.

Here is the call graph for this function:

◆ is_mat()

bool polyfem::utils::ExpressionValue::is_mat ( ) const
inline

Definition at line 42 of file ExpressionValue.hpp.

References expr_, and mat_.

Referenced by get_mat(), and set_mat().

Here is the caller graph for this function:

◆ is_zero()

bool polyfem::utils::ExpressionValue::is_zero ( ) const
inline

Definition at line 41 of file ExpressionValue.hpp.

References expr_, and value_.

Referenced by polyfem::assembler::GenericScalarProblem::is_rhs_zero().

Here is the caller graph for this function:

◆ operator()()

double polyfem::utils::ExpressionValue::operator() ( double  x,
double  y,
double  z = 0,
double  t = 0,
int  index = -1 
) const

Definition at line 244 of file ExpressionValue.cpp.

References expr_, polyfem::log_and_throw_error(), polyfem::logger(), mat_, mat_expr_, sfunc_, t_index_, tfunc_, tfunc_coo_, unit_, unit_type_, unit_type_set_, value_, x, y, and z.

Here is the call graph for this function:

◆ set_mat()

void polyfem::utils::ExpressionValue::set_mat ( const Eigen::MatrixXd &  mat)
inline

Definition at line 55 of file ExpressionValue.hpp.

References is_mat(), and mat_.

Here is the call graph for this function:

◆ set_t()

void polyfem::utils::ExpressionValue::set_t ( const json t)

Definition at line 230 of file ExpressionValue.cpp.

References polyfem::logger(), mat_, mat_expr_, and t_index_.

Here is the call graph for this function:

◆ set_unit_type()

void polyfem::utils::ExpressionValue::set_unit_type ( const std::string &  unit_type)
inline

Definition at line 17 of file ExpressionValue.hpp.

References unit_type_, and unit_type_set_.

Referenced by polyfem::assembler::ScalarBCValue::set_unit_type(), and polyfem::assembler::GenericScalarProblem::set_units().

Here is the caller graph for this function:

Member Data Documentation

◆ expr_

std::string polyfem::utils::ExpressionValue::expr_
private

Definition at line 73 of file ExpressionValue.hpp.

Referenced by clear(), init(), is_mat(), is_zero(), and operator()().

◆ mat_

Eigen::MatrixXd polyfem::utils::ExpressionValue::mat_
private

Definition at line 75 of file ExpressionValue.hpp.

Referenced by clear(), get_mat(), init(), init(), init(), is_mat(), operator()(), set_mat(), and set_t().

◆ mat_expr_

std::vector<ExpressionValue> polyfem::utils::ExpressionValue::mat_expr_
private

Definition at line 76 of file ExpressionValue.hpp.

Referenced by clear(), init(), operator()(), and set_t().

◆ sfunc_

std::function<double(double x, double y, double z, double t, int index)> polyfem::utils::ExpressionValue::sfunc_
private

Definition at line 69 of file ExpressionValue.hpp.

Referenced by clear(), init(), init(), init(), and operator()().

◆ t_index_

std::map<double, int> polyfem::utils::ExpressionValue::t_index_
private

Definition at line 77 of file ExpressionValue.hpp.

Referenced by init(), operator()(), and set_t().

◆ tfunc_

std::function<Eigen::MatrixXd(double x, double y, double z, double t)> polyfem::utils::ExpressionValue::tfunc_
private

Definition at line 70 of file ExpressionValue.hpp.

Referenced by clear(), init(), init(), and operator()().

◆ tfunc_coo_

int polyfem::utils::ExpressionValue::tfunc_coo_
private

Definition at line 71 of file ExpressionValue.hpp.

Referenced by init(), init(), and operator()().

◆ unit_

units::precise_unit polyfem::utils::ExpressionValue::unit_
private

Definition at line 80 of file ExpressionValue.hpp.

Referenced by init(), and operator()().

◆ unit_type_

units::precise_unit polyfem::utils::ExpressionValue::unit_type_
private

Definition at line 79 of file ExpressionValue.hpp.

Referenced by operator()(), and set_unit_type().

◆ unit_type_set_

bool polyfem::utils::ExpressionValue::unit_type_set_ = false
private

Definition at line 81 of file ExpressionValue.hpp.

Referenced by operator()(), and set_unit_type().

◆ value_

double polyfem::utils::ExpressionValue::value_
private

Definition at line 74 of file ExpressionValue.hpp.

Referenced by clear(), get_val(), init(), is_zero(), and operator()().


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