19 #ifndef INTEGRAL_DATA_HH_
20 #define INTEGRAL_DATA_HH_
25 #include <unordered_set>
26 #include <unordered_map>
27 #include <boost/functional/hash.hpp>
129 return boost::hash_value( tpl );
134 return std::make_tuple(dim, quad_size);
140 template<
typename Integral>
145 template<
unsigned int dim>
157 for (
auto &
it :
bulk_)
it.second->patch_data().make_permanent();
158 for (
auto &
it :
edge_)
it.second->patch_data().make_permanent();
159 for (
auto &
it :
coupling_)
it.second->patch_data().make_permanent();
160 for (
auto &
it :
boundary_)
it.second->patch_data().make_permanent();
166 for (
auto &
it :
bulk_)
it.second->patch_data().revert_temporary();
167 for (
auto &
it :
edge_)
it.second->patch_data().revert_temporary();
168 for (
auto &
it :
coupling_)
it.second->patch_data().revert_temporary();
169 for (
auto &
it :
boundary_)
it.second->patch_data().revert_temporary();
175 for (
auto &
it :
bulk_)
it.second->patch_data().reset();
176 for (
auto &
it :
edge_)
it.second->patch_data().reset();
183 if (
bulk_.size() > 0)
return bulk_.begin()->second->patch_data().permanent_size();
189 if (
edge_.size() > 0)
return edge_.begin()->second->patch_data().permanent_size();
195 if (
coupling_.size() > 0)
return coupling_.begin()->second->patch_data().permanent_size();
201 if (
boundary_.size() > 0)
return boundary_.begin()->second->patch_data().permanent_size();
212 std::size_t
operator()(std::tuple<std::string, uint> tpl)
const {
213 return boost::hash_value( tpl );
217 static std::tuple<std::string, uint>
op_tuple(std::string op_type,
uint quad_size) {
218 return std::make_tuple(op_type, quad_size);
224 template<
typename Operation>
Cell accessor allow iterate over DOF handler cells.
Side accessor allows to iterate over sides of DOF handler cell.
Class allows to iterate over sides of edge.
Iter< Object > make_iter(Object obj)
std::unordered_map< std::tuple< std::string, uint >, Operation *, OperationTplHash > OperationMap
Alias for unordered_map of Operation pointer with custom hash.
std::unordered_map< std::tuple< uint, uint >, std::shared_ptr< Integral >, IntegralTplHash > IntegralPtrMap
Alias for unordered_map of shared_ptr<Integral> with custom hash.
Implementation of range helper class.
BoundaryIntegralData()
Default constructor.
BoundaryIntegralData(DHCellSide dhside)
Constructor with data mebers initialization.
BoundaryIntegralData(const BoundaryIntegralData &other)
Copy constructor.
DHCellSide side
Specified cell side (bulk element)
BulkIntegralData()
Default constructor.
BulkIntegralData(const BulkIntegralData &other)
Copy constructor.
BulkIntegralData(DHCellAccessor dhcell)
Constructor with data mebers initialization.
DHCellAccessor cell
Specified cell (element)
DHCellSide side
Specified cell side (higher dim element)
CouplingIntegralData(const CouplingIntegralData &other)
Copy constructor.
CouplingIntegralData()
Default constructor.
CouplingIntegralData(DHCellAccessor dhcell, DHCellSide dhside)
Constructor with data mebers initialization.
Set of integral of given dimension necessary in assemblation.
unsigned int n_patch_neighbours() const
Return number of neighbours on patch.
void revert_temporary()
Erase temporary part of integral data.
void reset()
Clear list of integral data.
IntegralPtrMap< BoundaryIntegralAcc< dim > > boundary_
Boundary integrals betwwen side and boundary element of dim-1.
unsigned int n_patch_boundaries() const
Return number of boundaries on patch.
IntegralPtrMap< EdgeIntegralAcc< dim > > edge_
Edge integrals between elements of same dimensions.
IntegralPtrMap< BulkIntegralAcc< dim > > bulk_
Bulk integrals of elements.
void make_permanent()
Finalize temporary part of integral data.
unsigned int n_patch_cells() const
Return number of cells on patch.
IntegralPtrMap< CouplingIntegralAcc< dim > > coupling_
Coupling integrals between elements of dimensions dim and dim-1.
unsigned int n_patch_edges() const
Return number of edges on patch.
EdgeIntegralData(const EdgeIntegralData &other)
Copy constructor.
EdgeIntegralData(RangeConvert< DHEdgeSide, DHCellSide > range)
Constructor with data mebers initialization.
EdgeIntegralData()
Default constructor.
RangeConvert< DHEdgeSide, DHCellSide > edge_side_range
Specified cell side (element)
Define Integral Tuple hash function - helper struct of IntegralPtrMap.
std::size_t operator()(std::tuple< uint, uint > tpl) const
static std::tuple< uint, uint > integral_tuple(uint dim, uint quad_size)
Create tuple from dimennsion and size of Quadrature.
Define Integral Tuple hash function - helper struct of OperationMap.
static std::tuple< std::string, uint > op_tuple(std::string op_type, uint quad_size)
Create tuple from typeid(Operation).name and size of Quadrature.
std::size_t operator()(std::tuple< std::string, uint > tpl) const