21 #ifndef PATCH_FE_VALUES_HH_
22 #define PATCH_FE_VALUES_HH_
47 template<
unsigned int spacedim = 3>
98 for (
uint dim=1; dim<4; ++dim) {
110 for (
uint dim=1; dim<4; ++dim) {
117 uint zero_vec_size = 300;
134 template<
unsigned int DIM>
137 if ( _quadrature.
dim() == DIM ) {
154 for (
unsigned int i=0; i<spacedim; ++i) {
172 template<
unsigned int dim>
174 ASSERT((dim>=0) && (dim<=3))(dim).error(
"Dimension must be 0, 1, 2 or 3.");
180 ASSERT((dim>0) && (dim<=3))(dim).error(
"Dimension must be 1, 2 or 3.");
186 ASSERT((dim>0) && (dim<=3))(dim).error(
"Dimension must be 1, 2 or 3.");
193 template<
unsigned int dim>
197 return fe_sys->
fe()[component_idx];
199 ASSERT_EQ(component_idx, 0).warning(
"Non-zero component_idx can only be used for FESystem.");
206 template<
unsigned int dim>
210 template<
unsigned int dim>
214 template<
unsigned int dim>
221 for (
uint i=0; i<spacedim; ++i) {
260 cell_side.
side_idx(), i_point_on_side);
279 template<
class OpType,
unsigned int dim>
281 std::string op_name =
typeid(OpType).name();
287 DebugOut().fmt(
"Create new operation '{}', dim: {}.\n", op_name, dim);
295 template<
class OpType,
unsigned int dim>
297 std::string op_name =
typeid(OpType).name();
303 DebugOut().fmt(
"Create new operation '{}', dim: {}.\n", op_name, dim);
312 stream << endl <<
"Table of patch FE operations:" << endl;
313 stream << std::setfill(
'-') << setw(160) <<
"" << endl;
315 stream << std::setfill(
' ') <<
" Operation" << std::setw(51) <<
"" <<
"Type" << std::setw(5) <<
"" <<
"Shape" << std::setw(2) <<
""
316 <<
"n DOFs" << std::setw(2) <<
"" <<
"Input operations" << std::endl;
318 stream <<
" " << std::left << std::setw(60) <<
typeid(*
operations_[i]).name() <<
"";
320 stream <<
" " << std::setw(6) <<
operations_[i]->format_shape() <<
"" <<
" "
321 << std::setw(7) <<
operations_[i]->n_dofs() <<
"" <<
" ";
322 for (
auto *i_o :
operations_[i]->input_ops_) stream <<
typeid(*i_o).name() <<
" ";
326 stream << std::setfill(
'=') << setw(160) <<
"" << endl;
340 friend class PatchOp<spacedim>;
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
Cell accessor allow iterate over DOF handler cells.
unsigned int dim() const
Return dimension of element appropriate to cell.
unsigned int elm_idx() const
Return serial idx to element of loc_ele_idx_.
ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
Side accessor allows to iterate over sides of DOF handler cell.
unsigned int elem_idx() const
Side side() const
Return Side of given cell and side_idx.
const DHCellAccessor & cell() const
Return DHCellAccessor appropriate to the side.
unsigned int dim() const
Return dimension of element appropriate to the side.
unsigned int side_idx() const
Compound finite element on dim dimensional simplex.
const std::vector< std::shared_ptr< FiniteElement< dim > > > & fe() const
Abstract class for the description of a general finite element on a reference simplex in dim dimensio...
PatchOp< spacedim > * get(std::shared_ptr< FiniteElement< dim >> fe)
Returns operation of given dim and OpType, creates it if doesn't exist.
uint register_element(DHCellAccessor cell, uint element_patch_idx)
Register element to patch_point_vals_ table by dimension of element.
PatchPointValues< spacedim >::PatchFeData PatchFeData
std::vector< PatchOp< spacedim > * > operations_
uint register_bulk_point(DHCellAccessor cell, uint elem_table_row, uint value_patch_idx, uint i_point_on_elem)
Register bulk point to patch_point_vals_ table by dimension of element.
~PatchFEValues()
Destructor.
Quadrature * get_bulk_quadrature(uint dim) const
Getter for bulk quadrature of given dimension.
SideValues< dim > side_values()
Return SideValue object of dimension given by template parameter.
Quadrature * get_side_quadrature(uint dim) const
Getter for side quadrature of given dimension.
uint register_side(DHCellSide cell_side)
Register side to patch_point_vals_ table by dimension of side.
JoinValues< dim > join_values()
Return JoinValue object of dimension given by template parameter.
void init_finalize()
Finalize initialization, creates child (patch) arena and passes it to PatchPointValue objects.
PatchOp< spacedim > * get()
Returns operation of given dim and OpType, creates it if doesn't exist.
BulkValues< dim > bulk_values()
Return BulkValue object of dimension given by template parameter.
const AssemblyArena & asm_arena() const
same as previous but return constant reference
PatchArena & patch_arena() const
return reference to patch arena
uint register_side_point(DHCellSide cell_side, uint elem_table_row, uint value_patch_idx, uint i_point_on_side)
Register side point to patch_point_vals_ table by dimension of side.
void initialize(Quadrature &_quadrature)
Initialize structures and calculates cell-independent data.
void print_operations(ostream &stream) const
Print table of all used operations - development method.
PatchFeData patch_fe_data_
MixedPtr< FiniteElement > fe_
Mixed of shared pointers of FiniteElement object.
void resize_tables(TableSizes table_sizes)
Resize tables of patch_point_vals_.
PatchFEValues(unsigned int quad_order, MixedPtr< FiniteElement > fe)
void reinit_patch()
Reinit data.
bool used_quads_[2]
Pair of flags signs holds info if bulk and side quadratures are used.
unsigned int n_dofs() const
Returns the number of shape functions.
std::unordered_map< std::string, PatchOp< spacedim > * > op_dependency_
AssemblyArena & asm_arena()
return reference to assembly arena
std::vector< std::vector< PatchPointValues< spacedim > > > patch_point_vals_
Sub objects of bulk and side data of dimensions 1,2,3.
std::shared_ptr< FiniteElement< dim > > fe_comp(std::shared_ptr< FiniteElement< dim > > fe, uint component_idx)
Returnd FiniteElement of component_idx for FESystem or fe for other types.
void reset()
Reset PatchpointValues structures.
std::vector< ElementAccessor< spacedim > > elem_list_
List of elements on patch.
uint i_elem_
Index of registered element in table, helper value used during patch creating.
std::vector< uint > elements_map_
Map of element patch indices to PatchOp::result_ and int_table_ tables.
std::vector< Side > side_list_
List of sides on patch.
Base class for quadrature rules on simplices in arbitrary dimensions.
Class FESystem for compound finite elements.
#define DebugOut()
Macro defining 'debug' record of log.
Declares accessors to FE operations.
Base class of FE operations.
Store finite element data on the actual patch such as shape function values, gradients,...
Definitions of particular quadrature rules on simplices.
Class RefElement defines numbering of vertices, sides, calculation of normal vectors etc.
Struct for pre-computing number of elements, sides, bulk points and side points on each dimension.
std::vector< std::vector< uint > > point_sizes_
void reset()
Set all values to zero.
void copy(const TableSizes &other)
Copy values of other TableSizes instance.
std::vector< std::vector< uint > > elem_sizes_