Flow123d
JS_before_hm-1727-ga1133b990
|
Go to the documentation of this file.
18 #ifndef GENERIC_ASSEMBLY_HH_
19 #define GENERIC_ASSEMBLY_HH_
41 std::array<std::shared_ptr<BulkIntegral>, 3>
bulk_;
42 std::array<std::shared_ptr<EdgeIntegral>, 3>
edge_;
43 std::array<std::shared_ptr<CouplingIntegral>, 2>
coupling_;
44 std::array<std::shared_ptr<BoundaryIntegral>, 3>
boundary_;
56 virtual void assemble(std::shared_ptr<DOFHandlerMultiDim> dh) = 0;
69 template <
template<
IntDim...>
class DimAssembly>
165 GenericAssembly(
typename DimAssembly<1>::EqFields *eq_fields,
typename DimAssembly<1>::EqData *eq_data)
200 void assemble(std::shared_ptr<DOFHandlerMultiDim> dh)
override {
205 bool add_into_patch =
false;
206 for(
auto cell_it = dh->local_range().begin(); cell_it != dh->local_range().end(); )
209 if (!add_into_patch) {
211 add_into_patch =
true;
225 add_into_patch =
false;
234 add_into_patch =
false;
239 if (add_into_patch) {
254 template<
unsigned int dim>
269 template<
unsigned int dim>
278 template<
unsigned int dim>
282 if (range.begin()->dim() != dim)
continue;
288 template<
unsigned int dim>
308 this->assemble_cell_integrals<1>();
309 this->assemble_cell_integrals<2>();
310 this->assemble_cell_integrals<3>();
316 this->assemble_boundary_side_integrals<1>();
317 this->assemble_boundary_side_integrals<2>();
318 this->assemble_boundary_side_integrals<3>();
324 this->assemble_edge_integrals<1>();
325 this->assemble_edge_integrals<2>();
326 this->assemble_edge_integrals<3>();
332 this->assemble_neighbour_integrals<2>();
333 this->assemble_neighbour_integrals<3>();
358 if ( (cell_side.side().edge().n_sides() == 1) && (cell_side.side().is_boundary()) ) {
363 if ( (cell_side.n_edge_sides() >= 2) && (cell_side.edge_sides().begin()->element().idx() == cell.
elm_idx())) {
371 if (cell.
dim() != neighb_side.dim()-1)
continue;
398 unsigned int reg_idx = edge_side.element().region_idx().idx();
416 auto p_low = p.lower_dim(cell);
RevertableList< BulkIntegralData > bulk_integral_data_
Holds data for computing bulk integrals.
void add_boundary_integral(const DHCellSide &bdr_side)
Add data of boundary integral to appropriate data structure.
static unsigned int get()
Return number of stored elements.
std::array< std::shared_ptr< CouplingIntegral >, 2 > coupling_
Coupling integrals between elements of dimensions 1-2, 2-3.
void add_integrals_of_computing_step(DHCellAccessor cell)
std::shared_ptr< EvalPoints > eval_points_
EvalPoints object shared by all integrals.
Set of all used integral necessary in assemblation.
void create_patch()
Create patch of cached elements before reading data to cache.
std::size_t make_permanent()
Finalize temporary part of data.
CouplingIntegralData()
Default constructor.
std::size_t emplace_back(Args &&... args)
RangeConvert< DHEdgeSide, DHCellSide > edge_side_range
Specified cell side (element)
RangeConvert< DHEdgeSide, DHCellSide > edge_sides() const
Returns range of all sides looped over common Edge.
EdgeIntegralData()
Default constructor.
unsigned int side_subset_index
Index (order) of higher dim subset in EvalPoints object.
DHCellSide side
Specified cell side (higher dim element)
RevertableList< EdgeIntegralData > edge_integral_data_
Holds data for computing edge integrals.
Directing class of FieldValueCache.
bool is_own() const
Return true if accessor represents own element (false for ghost element)
BoundaryIntegralData()
Default constructor.
std::array< std::shared_ptr< EdgeIntegral >, 3 > edge_
Edge integrals between elements of dimensions 1, 2, 3.
Point accessor allow iterate over bulk quadrature points defined in local element coordinates.
void reallocate_cache()
Calls cache_reallocate method on.
BoundaryIntegralData(const BoundaryIntegralData &other)
Copy constructor.
unsigned int side_subset_index
Index (order) of subset on side of bulk element in EvalPoints object.
unsigned int dim() const
Return dimension of element appropriate to cell.
unsigned int idx() const
Returns a global index of the region.
unsigned int dim() const
Return dimension of element appropriate to the side.
GenericAssembly(typename DimAssembly< 1 >::EqFields *eq_fields, typename DimAssembly< 1 >::EqData *eq_data)
Constructor.
unsigned int position_in_cache(unsigned mesh_elm_idx) const
Return position of element stored in ElementCacheMap.
RevertableList< EvalPointData > eval_point_data_
void assemble_cell_integrals()
Assembles the cell integrals for the given dimension.
virtual void assemble(std::shared_ptr< DOFHandlerMultiDim > dh)=0
void assemble(std::shared_ptr< DOFHandlerMultiDim > dh) override
General assemble methods.
void add_edge_integral(const DHCellSide &cell_side)
Add data of edge integral to appropriate data structure.
void init(std::shared_ptr< EvalPoints > eval_points)
Init cache.
std::size_t temporary_size() const
Return temporary size of list (full size of stored data).
DHCellAccessor cell
Specified cell (element)
RevertableList< BoundaryIntegralData > boundary_integral_data_
Holds data for computing boundary integrals.
unsigned int bulk_subset_index
Index (order) of lower dim subset in EvalPoints object.
CouplingIntegralData(const CouplingIntegralData &other)
Copy constructor.
EdgeIntegralData(RangeConvert< DHEdgeSide, DHCellSide > range, unsigned int subset_idx)
Constructor with data mebers initialization.
Side accessor allows to iterate over sides of DOF handler cell.
BulkIntegralData()
Default constructor.
EdgeIntegralData(const EdgeIntegralData &other)
Copy constructor.
unsigned int bdr_subset_index
Index (order) of subset on boundary element in EvalPoints object.
BulkIntegralData(DHCellAccessor dhcell, unsigned int subset_idx)
Constructor with data mebers initialization.
Range< DHCellSide > side_range() const
Returns range of cell sides.
int active_integrals_
Holds mask of active integrals.
const DHCellAccessor & cell() const
Return DHCellAccessor appropriate to the side.
RangeConvert< DHNeighbSide, DHCellSide > neighb_sides() const
Returns range of neighbour cell of lower dimension corresponding to cell of higher dimension.
std::array< std::shared_ptr< BulkIntegral >, 3 > bulk_
Bulk integrals of elements of dimensions 1, 2, 3.
Definitions of particular quadrature rules on simplices.
void clear_element_eval_points_map()
Reset all items of elements_eval_points_map.
unsigned int local_idx() const
Return local index to element (index of DOF handler).
MixedPtr< DimAssembly, 1 > multidim_assembly() const
Getter to set of assembly objects.
AssemblyIntegrals integrals_
Holds integral objects.
const ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
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_volume_integral(const DHCellAccessor &cell)
Add data of volume integral to appropriate data structure.
void assemble_neighbour_integrals()
Assembles the neighbours integrals for the given dimension.
ActiveIntegrals
Allow set mask of active integrals.
RevertableList< CouplingIntegralData > coupling_integral_data_
Holds data for computing couplings integrals.
void assemble_boundary_side_integrals()
Assembles the boundary side integrals for the given dimension.
unsigned int eval_point_idx() const
Return index in EvalPoints object.
ElementAccessor< 3 > element_accessor()
void assemble_edge_integrals()
Assembles the edge integrals for the given dimension.
Struct is a container that encapsulates variable size arrays.
unsigned int elm_idx() const
Return serial idx to element of loc_ele_idx_.
CouplingIntegralData(DHCellAccessor dhcell, unsigned int bulk_idx, DHCellSide dhside, unsigned int side_idx)
Constructor with data mebers initialization.
void finish_elements_update()
Finish update after reading data to cache.
ElementAccessor< 3 > element() const
unsigned int elem_idx() const
const ElementCacheMap & cache_map() const
Return ElementCacheMap.
void assemble_integrals()
Call assemblations when patch is filled.
Cell accessor allow iterate over DOF handler cells.
unsigned int subset_index
Index (order) of subset in EvalPoints object.
std::size_t revert_temporary()
Erase temporary part of data.
Class allows to iterate over sides of edge.
BoundaryIntegralData(unsigned int bdr_idx, DHCellSide dhside, unsigned int side_idx)
Constructor with data mebers initialization.
Iter< Object > make_iter(Object obj)
std::shared_ptr< EvalPoints > eval_points() const
Geter to EvalPoints object.
ElementCacheMap element_cache_map_
ElementCacheMap according to EvalPoints.
void start_elements_update()
Start update of cache.
virtual ~GenericAssemblyBase()
#define START_TIMER(tag)
Starts a timer with specified tag.
Generic class of assemblation.
unsigned int subset_index
Index (order) of subset in EvalPoints object.
DHCellSide side
Specified cell side (bulk element)
#define END_TIMER(tag)
Ends a timer with specified tag.
BulkIntegralData(const BulkIntegralData &other)
Copy constructor.
RegionIdx region_idx() const
MixedPtr< DimAssembly, 1 > multidim_assembly_
Assembly object.
std::array< std::shared_ptr< BoundaryIntegral >, 3 > boundary_
Boundary integrals betwwen elements of dimensions 1, 2, 3 and boundaries.
unsigned int IntDim
A dimension index type.