PolyFEM
|
Caches basis evaluation and geometric mapping at every element. More...
#include <AssemblyValsCache.hpp>
Public Member Functions | |
void | init (const bool is_volume, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const bool is_mass=false) |
computes the basis evaluation and geometric mapping for each of the given ElementBases in bases initializes cache member | |
void | compute (const int el_index, const bool is_volume, const basis::ElementBases &basis, const basis::ElementBases &gbasis, ElementAssemblyValues &vals) const |
retrieves cached basis evaluation and geometric for the given element if it doesn't exist, computes and caches it (modifies cache member in the latter case) | |
void | clear () |
bool | is_mass () const |
Private Attributes | |
std::vector< ElementAssemblyValues > | cache |
vector of basis values and geometric mapping with one entry per element | |
bool | is_mass_ |
Caches basis evaluation and geometric mapping at every element.
Definition at line 10 of file AssemblyValsCache.hpp.
|
inline |
Definition at line 22 of file AssemblyValsCache.hpp.
References cache.
Referenced by polyfem::State::build_basis().
void polyfem::assembler::AssemblyValsCache::compute | ( | const int | el_index, |
const bool | is_volume, | ||
const basis::ElementBases & | basis, | ||
const basis::ElementBases & | gbasis, | ||
ElementAssemblyValues & | vals | ||
) | const |
retrieves cached basis evaluation and geometric for the given element if it doesn't exist, computes and caches it (modifies cache member in the latter case)
Definition at line 33 of file AssemblyValsCache.cpp.
References cache, polyfem::basis::ElementBases::compute_mass_quadrature(), is_mass_, quadrature, and vals.
Referenced by polyfem::assembler::RhsAssembler::assemble(), polyfem::assembler::RhsAssembler::compute_energy(), polyfem::solver::ComplianceForm::compute_partial_gradient_step(), polyfem::solver::WeightedVolumeForm::compute_partial_gradient_with_param(), polyfem::solver::AdjointTools::compute_shape_derivative_functional_term(), polyfem::solver::AdjointTools::dJ_du_step(), polyfem::solver::ElasticForm::force_material_derivative(), polyfem::solver::InertiaForm::force_shape_derivative(), polyfem::solver::ElasticForm::force_shape_derivative(), polyfem::solver::BodyForm::force_shape_derivative(), polyfem::solver::AdjointTools::integrate_objective(), polyfem::assembler::RhsAssembler::time_bc(), and polyfem::solver::WeightedVolumeForm::value_unweighted_with_param().
void polyfem::assembler::AssemblyValsCache::init | ( | const bool | is_volume, |
const std::vector< basis::ElementBases > & | bases, | ||
const std::vector< basis::ElementBases > & | gbases, | ||
const bool | is_mass = false |
||
) |
computes the basis evaluation and geometric mapping for each of the given ElementBases in bases initializes cache member
Definition at line 11 of file AssemblyValsCache.cpp.
References cache, is_mass(), is_mass_, polyfem::utils::maybe_parallel_for(), and quadrature.
Referenced by polyfem::State::build_basis().
|
inline |
Definition at line 27 of file AssemblyValsCache.hpp.
References is_mass_.
Referenced by init(), and polyfem::assembler::RhsAssembler::RhsAssembler().
|
private |
vector of basis values and geometric mapping with one entry per element
Definition at line 30 of file AssemblyValsCache.hpp.
|
private |
Definition at line 31 of file AssemblyValsCache.hpp.