18 #ifndef GENERIC_ASSEMBLY_HH_
19 #define GENERIC_ASSEMBLY_HH_
42 std::array<std::shared_ptr<BulkIntegral>, 3>
bulk_;
43 std::array<std::shared_ptr<EdgeIntegral>, 3>
edge_;
44 std::array<std::shared_ptr<CouplingIntegral>, 2>
coupling_;
45 std::array<std::shared_ptr<BoundaryIntegral>, 3>
boundary_;
146 virtual void assemble(std::shared_ptr<DOFHandlerMultiDim> dh) = 0;
164 template <
template<
IntDim...>
class DimAssembly>
169 GenericAssembly(
typename DimAssembly<1>::EqFields *eq_fields,
typename DimAssembly<1>::EqData *eq_data)
209 void assemble(std::shared_ptr<DOFHandlerMultiDim> dh)
override {
214 bool add_into_patch =
false;
215 for(
auto cell_it = dh->local_range().begin(); cell_it != dh->local_range().end(); )
218 if (!add_into_patch) {
220 add_into_patch =
true;
234 add_into_patch =
false;
243 add_into_patch =
false;
248 if (add_into_patch) {
324 if ( (cell_side.side().edge().n_sides() == 1) && (cell_side.side().is_boundary()) ) {
329 if ( (cell_side.n_edge_sides() >=
min_edge_sides_) && (cell_side.edge_sides().begin()->element().idx() == cell.
elm_idx())) {
337 if (cell.
dim() != neighb_side.dim()-1)
continue;
364 unsigned int reg_idx = edge_side.element().region_idx().idx();
382 auto p_low = p.lower_dim(cell);
ElementAccessor< 3 > element_accessor()
Base point accessor class.
unsigned int eval_point_idx() const
Return index in EvalPoints object.
static unsigned int get()
Return number of stored elements.
Cell accessor allow iterate over DOF handler cells.
const ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
RangeConvert< DHNeighbSide, DHCellSide > neighb_sides() const
Returns range of neighbour cell of lower dimension corresponding to cell of higher dimension.
bool is_own() const
Return true if accessor represents own element (false for ghost element)
unsigned int dim() const
Return dimension of element appropriate to cell.
Range< DHCellSide > side_range() const
Returns range of cell sides.
unsigned int elm_idx() const
Return serial idx to element of loc_ele_idx_.
unsigned int local_idx() const
Return local index to element (index of DOF handler).
Side accessor allows to iterate over sides of DOF handler cell.
unsigned int elem_idx() const
const DHCellAccessor & cell() const
Return DHCellAccessor appropriate to the side.
RangeConvert< DHEdgeSide, DHCellSide > edge_sides() const
Returns range of all sides looped over common Edge.
unsigned int dim() const
Return dimension of element appropriate to the side.
ElementAccessor< 3 > element() const
Class allows to iterate over sides of edge.
RegionIdx region_idx() const
Directing class of FieldValueCache.
unsigned int get_simd_rounded_size()
Returns number of eval. points with addition of max simd duplicates due to regions.
void start_elements_update()
Start update of cache.
void finish_elements_update()
Finish update after reading data to cache.
void clear_element_eval_points_map()
Reset all items of elements_eval_points_map.
void create_patch()
Create patch of cached elements before reading data to cache.
RevertableList< EvalPointData > eval_point_data_
void add_eval_point(unsigned int i_reg, unsigned int i_ele, unsigned int i_eval_point, unsigned int dh_loc_idx)
void init(std::shared_ptr< EvalPoints > eval_points)
Init cache.
ElementCacheMap element_cache_map_
ElementCacheMap according to EvalPoints.
virtual ~GenericAssemblyBase()
std::shared_ptr< EvalPoints > eval_points_
EvalPoints object shared by all integrals.
AssemblyIntegrals integrals_
Holds integral objects.
virtual void assemble(std::shared_ptr< DOFHandlerMultiDim > dh)=0
Generic class of assemblation.
MixedPtr< DimAssembly, 1 > multidim_assembly_
Assembly object.
RevertableList< EdgeIntegralData > edge_integral_data_
Holds data for computing edge integrals.
void assemble_integrals()
Call assemblations when patch is filled.
void assemble(std::shared_ptr< DOFHandlerMultiDim > dh) override
General assemble methods.
unsigned int min_edge_sides_
void add_boundary_integral(const DHCellSide &bdr_side)
Add data of boundary integral to appropriate data structure.
const ElementCacheMap & cache_map() const
Return ElementCacheMap.
void add_volume_integral(const DHCellAccessor &cell)
Add data of volume integral to appropriate data structure.
void add_edge_integral(const DHCellSide &cell_side)
Add data of edge integral to appropriate data structure.
RevertableList< BoundaryIntegralData > boundary_integral_data_
Holds data for computing boundary integrals.
int active_integrals_
Holds mask of active integrals.
RevertableList< CouplingIntegralData > coupling_integral_data_
Holds data for computing couplings integrals.
void set_min_edge_sides(unsigned int val)
std::shared_ptr< EvalPoints > eval_points() const
Geter to EvalPoints object.
void reallocate_cache()
Calls cache_reallocate method on.
GenericAssembly(typename DimAssembly< 1 >::EqFields *eq_fields, typename DimAssembly< 1 >::EqData *eq_data)
Constructor.
void add_coupling_integral(const DHCellAccessor &cell, const DHCellSide &ngh_side, bool add_low)
Add data of coupling integral to appropriate data structure.
void add_integrals_of_computing_step(DHCellAccessor cell)
MixedPtr< DimAssembly, 1 > multidim_assembly() const
Getter to set of assembly objects.
RevertableList< BulkIntegralData > bulk_integral_data_
Holds data for computing bulk integrals.
unsigned int idx() const
Returns a global index of the region.
Iter< Object > make_iter(Object obj)
ActiveIntegrals
Allow set mask of active integrals.
unsigned int IntDim
A dimension index type.
Definitions of particular quadrature rules on simplices.
Set of all used integral necessary in assemblation.
std::array< std::shared_ptr< BulkIntegral >, 3 > bulk_
Bulk integrals of elements of dimensions 1, 2, 3.
std::array< std::shared_ptr< CouplingIntegral >, 2 > coupling_
Coupling integrals between elements of dimensions 1-2, 2-3.
std::array< std::shared_ptr< BoundaryIntegral >, 3 > boundary_
Boundary integrals betwwen elements of dimensions 1, 2, 3 and boundaries.
std::array< std::shared_ptr< EdgeIntegral >, 3 > edge_
Edge integrals between elements of dimensions 1, 2, 3.
unsigned int side_subset_index
Index (order) of subset on side of bulk element in EvalPoints object.
BoundaryIntegralData(unsigned int bdr_idx, DHCellSide dhside, unsigned int side_idx)
Constructor with data mebers initialization.
BoundaryIntegralData()
Default constructor.
BoundaryIntegralData(const BoundaryIntegralData &other)
Copy constructor.
unsigned int bdr_subset_index
Index (order) of subset on boundary element in EvalPoints object.
DHCellSide side
Specified cell side (bulk element)
BulkIntegralData(DHCellAccessor dhcell, unsigned int subset_idx)
Constructor with data mebers initialization.
DHCellAccessor cell
Specified cell (element)
unsigned int subset_index
Index (order) of subset in EvalPoints object.
BulkIntegralData(const BulkIntegralData &other)
Copy constructor.
BulkIntegralData()
Default constructor.
unsigned int bulk_subset_index
Index (order) of lower dim subset in EvalPoints object.
CouplingIntegralData(DHCellAccessor dhcell, unsigned int bulk_idx, DHCellSide dhside, unsigned int side_idx)
Constructor with data mebers initialization.
unsigned int side_subset_index
Index (order) of higher dim subset in EvalPoints object.
CouplingIntegralData(const CouplingIntegralData &other)
Copy constructor.
CouplingIntegralData()
Default constructor.
DHCellSide side
Specified cell side (higher dim element)
EdgeIntegralData(const EdgeIntegralData &other)
Copy constructor.
RangeConvert< DHEdgeSide, DHCellSide > edge_side_range
Specified cell side (element)
unsigned int subset_index
Index (order) of subset in EvalPoints object.
EdgeIntegralData(RangeConvert< DHEdgeSide, DHCellSide > range, unsigned int subset_idx)
Constructor with data mebers initialization.
EdgeIntegralData()
Default constructor.
std::size_t revert_temporary()
Erase temporary part of data.
std::size_t make_permanent()
Finalize temporary part of data.
void reset()
Clear the list.
std::size_t emplace_back(Args &&... args)
#define END_TIMER(tag)
Ends a timer with specified tag.
#define START_TIMER(tag)
Starts a timer with specified tag.