PolyFEM
Loading...
Searching...
No Matches
polyfem::basis::Basis Class Reference

Represents one basis function and its gradient. More...

#include <Basis.hpp>

Public Types

typedef std::function< void(const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)> Fun
 

Public Member Functions

 Basis ()
 
void init (const int order, const int global_index, const int local_index, const RowVectorNd &node)
 Initialize a basis function within an element.
 
bool is_complete () const
 Checks if global is empty or not.
 
void eval_basis (const Eigen::MatrixXd &uv, Eigen::MatrixXd &val) const
 Evaluates the basis function over a set of uv parameters.
 
Eigen::MatrixXd operator() (const Eigen::MatrixXd &uv) const
 Evaluate the basis function over a set of uv parameters.
 
void eval_grad (const Eigen::MatrixXd &uv, Eigen::MatrixXd &val) const
 Evaluate the gradient of the basis function.
 
const std::vector< Local2Global > & global () const
 
std::vector< Local2Global > & global ()
 
void set_basis (const Fun &fun)
 
void set_grad (const Fun &fun)
 
bool is_defined () const
 
int order () const
 

Private Attributes

std::vector< Local2Globalglobal_
 list of real nodes influencing the basis
 
int local_index_
 local index inside the element (for debugging purposes)
 
int order_
 
Fun basis_
 basis and gadient
 
Fun grad_
 

Friends

std::ostream & operator<< (std::ostream &os, const Basis &obj)
 

Detailed Description

Represents one basis function and its gradient.

Definition at line 43 of file Basis.hpp.

Member Typedef Documentation

◆ Fun

typedef std::function<void(const Eigen::MatrixXd &uv, Eigen::MatrixXd &val)> polyfem::basis::Basis::Fun

Definition at line 47 of file Basis.hpp.

Constructor & Destructor Documentation

◆ Basis()

polyfem::basis::Basis::Basis ( )

Definition at line 9 of file Basis.cpp.

Member Function Documentation

◆ eval_basis()

void polyfem::basis::Basis::eval_basis ( const Eigen::MatrixXd &  uv,
Eigen::MatrixXd &  val 
) const
inline

Evaluates the basis function over a set of uv parameters.

Parameters
[in]uv#uv x dim matrix of parameters to evaluate
[out]val#uv x 1 vector of computed values

Definition at line 72 of file Basis.hpp.

References basis_, and val.

Referenced by operator()().

Here is the caller graph for this function:

◆ eval_grad()

void polyfem::basis::Basis::eval_grad ( const Eigen::MatrixXd &  uv,
Eigen::MatrixXd &  val 
) const
inline

Evaluate the gradient of the basis function.

Parameters
[in]uv#uv x dim matrix of parameters to evaluate
[out]val#uv x dim matrix of computed gradients

Definition at line 97 of file Basis.hpp.

References grad_, and val.

◆ global() [1/2]

std::vector< Local2Global > & polyfem::basis::Basis::global ( )
inline

Definition at line 105 of file Basis.hpp.

References global_.

◆ global() [2/2]

◆ init()

void polyfem::basis::Basis::init ( const int  order,
const int  global_index,
const int  local_index,
const RowVectorNd node 
)

Initialize a basis function within an element.

Parameters
[in]global_indexGlobal index of the node associated to the basis
[in]local_indexLocal index of the node within the element
[in]node1 x dim position of the node associated to the basis

Definition at line 14 of file Basis.cpp.

References global_, local_index_, order(), and order_.

Here is the call graph for this function:

◆ is_complete()

bool polyfem::basis::Basis::is_complete ( ) const
inline

Checks if global is empty or not.

Definition at line 63 of file Basis.hpp.

References global_.

◆ is_defined()

bool polyfem::basis::Basis::is_defined ( ) const
inline

Definition at line 111 of file Basis.hpp.

References basis_.

◆ operator()()

Eigen::MatrixXd polyfem::basis::Basis::operator() ( const Eigen::MatrixXd &  uv) const
inline

Evaluate the basis function over a set of uv parameters.

Parameters
[in]uv#uv x dim matrix of parameters to evaluate
Returns
#uv x 1 vector of computed values

Definition at line 84 of file Basis.hpp.

References eval_basis(), and val.

Here is the call graph for this function:

◆ order()

int polyfem::basis::Basis::order ( ) const
inline

Definition at line 112 of file Basis.hpp.

References order_.

Referenced by p_bases.Lagrange::compute_basis(), q_bases.Lagrange::compute_basis(), and init().

Here is the caller graph for this function:

◆ set_basis()

void polyfem::basis::Basis::set_basis ( const Fun fun)
inline

Definition at line 108 of file Basis.hpp.

References basis_.

◆ set_grad()

void polyfem::basis::Basis::set_grad ( const Fun fun)
inline

Definition at line 109 of file Basis.hpp.

References grad_.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const Basis obj 
)
friend

Definition at line 115 of file Basis.hpp.

Member Data Documentation

◆ basis_

Fun polyfem::basis::Basis::basis_
private

basis and gadient

Definition at line 129 of file Basis.hpp.

Referenced by eval_basis(), is_defined(), and set_basis().

◆ global_

std::vector<Local2Global> polyfem::basis::Basis::global_
private

list of real nodes influencing the basis

Definition at line 125 of file Basis.hpp.

Referenced by global(), global(), init(), and is_complete().

◆ grad_

Fun polyfem::basis::Basis::grad_
private

Definition at line 130 of file Basis.hpp.

Referenced by eval_grad(), and set_grad().

◆ local_index_

int polyfem::basis::Basis::local_index_
private

local index inside the element (for debugging purposes)

Definition at line 126 of file Basis.hpp.

Referenced by init().

◆ order_

int polyfem::basis::Basis::order_
private

Definition at line 127 of file Basis.hpp.

Referenced by init(), and order().


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