PolyFEM
Loading...
Searching...
No Matches
AssemblyValsCache.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace polyfem
6{
7 namespace assembler
8 {
11 {
12 public:
16 void init(const bool is_volume, const std::vector<basis::ElementBases> &bases, const std::vector<basis::ElementBases> &gbases, const bool is_mass = false);
17
20 void compute(const int el_index, const bool is_volume, const basis::ElementBases &basis, const basis::ElementBases &gbasis, ElementAssemblyValues &vals) const;
21
22 void update(const int el_index, const bool is_volume, const basis::ElementBases &basis, const basis::ElementBases &gbasis);
23
24 void clear()
25 {
26 cache.clear();
27 }
28
29 inline bool is_initialized() const { return !cache.empty(); }
30
31 inline bool is_mass() const { return is_mass_; }
32
33 private:
34 std::vector<ElementAssemblyValues> cache;
36 };
37 } // namespace assembler
38} // namespace polyfem
ElementAssemblyValues vals
Definition Assembler.cpp:22
Caches basis evaluation and geometric mapping at every element.
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 initi...
std::vector< ElementAssemblyValues > cache
vector of basis values and geometric mapping with one entry per element
void update(const int el_index, const bool is_volume, const basis::ElementBases &basis, const basis::ElementBases &gbasis)
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,...
stores per element basis values at given quadrature points and geometric mapping
Stores the basis functions for a given element in a mesh (facet in 2d, cell in 3d).