PolyFEM
Loading...
Searching...
No Matches
polyfem::assembler::AssemblyValsCache Class Reference

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 update (const int el_index, const bool is_volume, const basis::ElementBases &basis, const basis::ElementBases &gbasis)
 
void clear ()
 
bool is_initialized () const
 
bool is_mass () const
 

Private Attributes

std::vector< ElementAssemblyValuescache
 vector of basis values and geometric mapping with one entry per element
 
bool is_mass_
 

Detailed Description

Caches basis evaluation and geometric mapping at every element.

Definition at line 10 of file AssemblyValsCache.hpp.

Member Function Documentation

◆ clear()

void polyfem::assembler::AssemblyValsCache::clear ( )
inline

Definition at line 24 of file AssemblyValsCache.hpp.

References cache.

Referenced by polyfem::State::build_basis().

Here is the caller graph for this function:

◆ compute()

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 45 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::InertiaForm::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().

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

◆ init()

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().

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

◆ is_initialized()

bool polyfem::assembler::AssemblyValsCache::is_initialized ( ) const
inline

Definition at line 29 of file AssemblyValsCache.hpp.

References cache.

Referenced by polyfem::assembler::RhsAssembler::RhsAssembler().

Here is the caller graph for this function:

◆ is_mass()

bool polyfem::assembler::AssemblyValsCache::is_mass ( ) const
inline

Definition at line 31 of file AssemblyValsCache.hpp.

References is_mass_.

Referenced by init(), and polyfem::assembler::RhsAssembler::RhsAssembler().

Here is the caller graph for this function:

◆ update()

void polyfem::assembler::AssemblyValsCache::update ( const int  el_index,
const bool  is_volume,
const basis::ElementBases basis,
const basis::ElementBases gbasis 
)

Definition at line 33 of file AssemblyValsCache.cpp.

References cache, polyfem::basis::ElementBases::compute_mass_quadrature(), is_mass_, and quadrature.

Here is the call graph for this function:

Member Data Documentation

◆ cache

std::vector<ElementAssemblyValues> polyfem::assembler::AssemblyValsCache::cache
private

vector of basis values and geometric mapping with one entry per element

Definition at line 34 of file AssemblyValsCache.hpp.

Referenced by clear(), compute(), init(), is_initialized(), and update().

◆ is_mass_

bool polyfem::assembler::AssemblyValsCache::is_mass_
private

Definition at line 35 of file AssemblyValsCache.hpp.

Referenced by compute(), init(), is_mass(), and update().


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