21 #ifndef PATCH_FE_VALUES_HH_
22 #define PATCH_FE_VALUES_HH_
50 template <
class ValueType>
70 template <
class ValueType>
95 template <
class ValueType>
114 unsigned int n_dofs_side,
unsigned int op_idx_bulk,
unsigned int op_idx_side,
unsigned int join_idx)
174 template<
unsigned int dim>
183 template<
unsigned int FE_dim>
187 return fe_sys->
fe()[component_idx];
189 ASSERT_EQ(component_idx, 0).warning(
"Non-zero component_idx can only be used for FESystem.");
201 template<
unsigned int FE_dim>
205 arma::mat shape_values(fe->n_dofs(), fe->n_components());
206 for (
unsigned int i=0; i<q->
size(); i++)
208 for (
unsigned int j=0; j<fe->n_dofs(); j++)
210 for (
unsigned int c=0; c<fe->n_components(); c++)
211 shape_values(j,c) = fe->shape_value(j, q->
point<FE_dim>(i), c);
213 ref_shape_vals[i][j] = trans(shape_values.row(j));
217 return ref_shape_vals;
228 template<
unsigned int FE_dim>
232 arma::mat shape_values(fe->n_dofs(), fe->n_components());
234 for (
unsigned int sid=0; sid<FE_dim+1; sid++) {
236 for (
unsigned int i=0; i<quad.size(); i++)
238 for (
unsigned int j=0; j<fe->n_dofs(); j++)
240 for (
unsigned int c=0; c<fe->n_components(); c++) {
241 shape_values(j,c) = fe->shape_value(j, quad.template point<FE_dim>(i), c);
244 ref_shape_vals[sid][i][j] = trans(shape_values.row(j));
249 return ref_shape_vals;
259 template<
unsigned int FE_dim>
263 arma::mat grad(FE_dim, fe->n_components());
264 for (
unsigned int i_pt=0; i_pt<q->
size(); i_pt++)
266 for (
unsigned int i_dof=0; i_dof<fe->n_dofs(); i_dof++)
269 for (
unsigned int c=0; c<fe->n_components(); c++)
270 grad.col(c) += fe->shape_grad(i_dof, q->
point<FE_dim>(i_pt), c);
272 ref_shape_grads[i_pt][i_dof] = grad;
276 return ref_shape_grads;
287 template<
unsigned int FE_dim>
292 for (
unsigned int sid=0; sid<FE_dim+1; sid++) {
294 for (
unsigned int i_pt=0; i_pt<quad.size(); i_pt++)
296 for (
unsigned int i_dof=0; i_dof<fe->n_dofs(); i_dof++)
299 for (
unsigned int c=0; c<fe->n_components(); c++)
300 grad.col(c) += fe->shape_grad(i_dof, quad.template point<FE_dim>(i_pt), c);
302 ref_shape_grads[sid][i_pt][i_dof] = grad;
307 return ref_shape_grads;
312 template<
unsigned int dim>
357 auto fe_component = this->
fe_comp(
fe_, component_idx);
358 ASSERT_EQ(fe_component->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of scalar_shape accessor must be FEScalar!\n");
364 for (
unsigned int j = 0; j < fe_component->n_dofs(); j++) {
365 shape_values[j][i] = ref_shape_vals[i][j][0];
379 auto fe_component = this->
fe_comp(
fe_, component_idx);
385 for (
unsigned int j = 0; j < fe_component->n_dofs(); j++) {
386 shape_values[j][i] = ref_shape_vals[i][j];
390 switch (fe_component->fe_type()) {
401 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorContravariant is not implemented yet!\n");
410 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorPiola is not implemented yet!\n");
418 ASSERT(
false).error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
436 auto fe_component = this->
fe_comp(
fe_, component_idx);
437 ASSERT_EQ(fe_component->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of grad_scalar_shape accessor must be FEScalar!\n");
443 bulk_reinit::ptop_scalar_shape_grads<dim>(operations, ref_shape_grads, scalar_shape_grads_op_idx);
459 auto fe_component = this->
fe_comp(
fe_, component_idx);
465 switch (fe_component->fe_type()) {
469 bulk_reinit::ptop_vector_shape_grads<dim>(operations, ref_shape_grads, vector_shape_grads_op_idx);
472 lambda_vector_shape_grad,
474 fe_component->n_dofs());
479 ASSERT_PERMANENT(
false).error(
"Grad vector for FEVectorContravariant is not implemented yet!\n");
481 bulk_reinit::ptop_vector_contravariant_shape_grads<dim>(operations, ref_shape_grads, vector_shape_grads_op_idx);
484 lambda_contravariant_shape_grad,
486 fe_component->n_dofs());
491 ASSERT_PERMANENT(
false).error(
"Grad vector for FEVectorPiola is not implemented yet!\n");
493 bulk_reinit::ptop_vector_piola_shape_grads<dim>(operations, ref_shape_grads, vector_shape_grads_op_idx);
496 lambda_piola_shape_grad,
498 fe_component->n_dofs());
502 ASSERT(
false).error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
517 auto fe_component = this->
fe_comp(
fe_, component_idx);
540 auto fe_component = this->
fe_comp(
fe_, component_idx);
557 std::shared_ptr< FiniteElement<dim> >
fe_;
561 template<
unsigned int dim>
603 auto fe_component = this->
fe_comp(
fe_, component_idx);
604 ASSERT_EQ(fe_component->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of scalar_shape accessor must be FEScalar!\n");
612 for (
unsigned int s=0; s<dim+1; ++s)
614 for (
unsigned int j = 0; j < fe_component->n_dofs(); j++) {
615 shape_values[s][i][j] = ref_shape_vals[s][i][j][0];
630 auto fe_component = this->
fe_comp(
fe_, component_idx);
639 for (
unsigned int s=0; s<dim+1; ++s)
641 for (
unsigned int j = 0; j < fe_component->n_dofs(); j++) {
642 shape_values[s][i][j] = ref_shape_vals[s][i][j];
646 switch (fe_component->fe_type()) {
658 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorContravariant is not implemented yet!\n");
667 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorPiola is not implemented yet!\n");
675 ASSERT(
false).error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
683 auto fe_component = this->
fe_comp(
fe_, component_idx);
684 ASSERT_EQ(fe_component->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of grad_scalar_shape accessor must be FEScalar!\n");
690 side_reinit::ptop_scalar_shape_grads<dim>(operations, el_table, ref_shape_grads, scalar_shape_grads_op_idx);
706 auto fe_component = this->
fe_comp(
fe_, component_idx);
712 switch (fe_component->fe_type()) {
716 side_reinit::ptop_vector_shape_grads<dim>(operations, el_table, ref_shape_grads, vector_shape_grads_op_idx);
719 lambda_vector_shape_grad,
721 fe_component->n_dofs());
726 ASSERT_PERMANENT(
false).error(
"Grad vector for FEVectorContravariant is not implemented yet!\n");
728 side_reinit::ptop_vector_contravariant_shape_grads<dim>(operations, el_table, ref_shape_grads, vector_shape_grads_op_idx);
731 lambda_contravariant_shape_grad,
733 fe_component->n_dofs());
738 ASSERT_PERMANENT(
false).error(
"Grad vector for FEVectorPiola is not implemented yet!\n");
740 side_reinit::ptop_vector_piola_shape_grads<dim>(operations, el_table, ref_shape_grads, vector_shape_grads_op_idx);
743 lambda_piola_shape_grad,
745 fe_component->n_dofs());
749 ASSERT(
false).error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
764 auto fe_component = this->
fe_comp(
fe_, component_idx);
787 auto fe_component = this->
fe_comp(
fe_, component_idx);
804 std::shared_ptr< FiniteElement<dim> >
fe_;
808 template<
unsigned int dim>
825 ASSERT_EQ(fe_component_low->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of scalar_shape accessor must be FEScalar!\n");
830 for (
unsigned int j = 0; j < fe_component_low->n_dofs(); j++) {
831 shape_values_bulk[j][i] = ref_shape_vals_bulk[i][j][0];
842 ASSERT_EQ(fe_component_high->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of scalar_shape accessor must be FEScalar!\n");
849 for (
unsigned int s=0; s<dim+1; ++s)
851 for (
unsigned int j = 0; j < fe_component_high->n_dofs(); j++) {
852 shape_values_side[s][i][j] = ref_shape_vals_side[s][i][j][0];
862 fe_component_low->n_dofs(), fe_component_high->n_dofs(), op_idx_bulk, op_idx_side, 0) );
863 unsigned int end_idx = fe_component_low->n_dofs() + fe_component_high->n_dofs();
865 fe_component_low->n_dofs(), fe_component_high->n_dofs(), op_idx_bulk, op_idx_side, end_idx) );
876 for (
unsigned int j = 0; j < fe_component_low->n_dofs(); j++) {
877 shape_values_bulk[j][i] = ref_shape_vals_bulk[i][j];
888 for (
unsigned int s=0; s<dim+1; ++s)
890 for (
unsigned int j = 0; j < fe_component_high->n_dofs(); j++) {
891 shape_values_side[s][i][j] = ref_shape_vals_side[s][i][j];
895 ASSERT_EQ(fe_component_high->fe_type(), fe_component_low->fe_type()).error(
"Type of FiniteElement of low and high element must be same!\n");
896 switch (fe_component_low->fe_type()) {
914 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorContravariant is not implemented yet!\n");
923 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorPiola is not implemented yet!\n");
931 ASSERT(
false).error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
935 fe_component_low->n_dofs(), fe_component_high->n_dofs(), op_idx_bulk, op_idx_side, 0) );
936 unsigned int end_idx = fe_component_low->n_dofs() + fe_component_high->n_dofs();
938 fe_component_low->n_dofs(), fe_component_high->n_dofs(), op_idx_bulk, op_idx_side, end_idx) );
954 ASSERT_EQ(fe_component_high->fe_type(), fe_component_low->fe_type()).error(
"Type of FiniteElement of low and high element must be same!\n");
955 switch (fe_component_low->fe_type()) {
963 lambda_vector_grad_bulk,
965 fe_component_low->n_dofs());
969 side_reinit::ptop_vector_shape_grads<dim>(operations, el_table, ref_shape_grads_side, op_idx_side);
972 lambda_vector_grad_side,
974 fe_component_high->n_dofs());
979 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorContravariant is not implemented yet!\n");
1001 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorPiola is not implemented yet!\n");
1022 ASSERT(
false).error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
1026 fe_component_low->n_dofs(), fe_component_high->n_dofs(), op_idx_bulk, op_idx_side, 0) );
1027 unsigned int end_idx = fe_component_low->n_dofs() + fe_component_high->n_dofs();
1029 fe_component_low->n_dofs(), fe_component_high->n_dofs(), op_idx_bulk, op_idx_side, end_idx) );
1072 template<
unsigned int spacedim = 3>
1127 used_quads_[0] =
false; used_quads_[1] =
false;
1131 : asm_arena_(1024 * 1024, 256),
1132 patch_arena_(nullptr),
1141 used_quads_[0] =
false; used_quads_[1] =
false;
1148 if (patch_arena_!=
nullptr)
1149 delete patch_arena_;
1154 if (is_bulk)
return patch_point_vals_bulk_[dim-1].get_quadrature();
1155 else return patch_point_vals_side_[dim-1].get_quadrature();
1165 template<
unsigned int DIM>
1168 if ( _quadrature.
dim() == DIM ) {
1169 used_quads_[0] =
true;
1170 patch_point_vals_bulk_[DIM-1].initialize();
1172 used_quads_[1] =
true;
1173 patch_point_vals_side_[DIM-1].initialize();
1179 patch_arena_ = asm_arena_.get_child_arena();
1180 for (
unsigned int i=0; i<3; ++i) {
1181 if (used_quads_[0]) patch_point_vals_bulk_[i].init_finalize(patch_arena_);
1182 if (used_quads_[1]) patch_point_vals_side_[i].init_finalize(patch_arena_);
1189 for (
unsigned int i=0; i<3; ++i) {
1190 if (used_quads_[0]) patch_point_vals_bulk_[i].reset();
1191 if (used_quads_[1]) patch_point_vals_side_[i].reset();
1193 patch_arena_->reset();
1199 for (
unsigned int i=0; i<3; ++i) {
1200 if (used_quads_[0]) patch_point_vals_bulk_[i].reinit_patch();
1201 if (used_quads_[1]) patch_point_vals_side_[i].reinit_patch();
1208 template<
unsigned int dim>
1210 ASSERT((dim>=0) && (dim<=3))(dim).error(
"Dimension must be 0, 1, 2 or 3.");
1215 template<
unsigned int dim>
1217 ASSERT((dim>0) && (dim<=3))(dim).error(
"Dimension must be 1, 2 or 3.");
1222 template<
unsigned int dim>
1224 ASSERT((dim>0) && (dim<=3))(dim).error(
"Dimension must be 1, 2 or 3.");
1229 template<
unsigned int dim>
1232 return JoinValues<dim>(&patch_point_vals_bulk_[dim-2], &patch_point_vals_side_[dim-1], fe_);
1239 for (
uint i=0; i<3; ++i) {
1240 if (used_quads_[0]) patch_point_vals_bulk_[i].resize_tables(table_sizes.
elem_sizes_[0][i], table_sizes.
point_sizes_[0][i]);
1241 if (used_quads_[1]) patch_point_vals_side_[i].resize_tables(table_sizes.
elem_sizes_[1][i], table_sizes.
point_sizes_[1][i]);
1248 switch (cell.
dim()) {
1251 return patch_point_vals_bulk_[0].register_element(coords, element_patch_idx);
1255 return patch_point_vals_bulk_[1].register_element(coords, element_patch_idx);
1259 return patch_point_vals_bulk_[2].register_element(coords, element_patch_idx);
1271 for (
unsigned int n=0; n<cell_side.
dim(); n++)
1272 for (
unsigned int c=0; c<spacedim; c++)
1273 side_coords(c,n) = (*cell_side.
side().
node(n))[c];
1277 switch (cell.
dim()) {
1280 return patch_point_vals_side_[0].register_side(elm_coords, side_coords, cell_side.
side_idx());
1284 return patch_point_vals_side_[1].register_side(elm_coords, side_coords, cell_side.
side_idx());
1288 return patch_point_vals_side_[2].register_side(elm_coords, side_coords, cell_side.
side_idx());
1299 return patch_point_vals_bulk_[cell.
dim()-1].register_bulk_point(elem_table_row, value_patch_idx, cell.
elm_idx(), i_point_on_elem);
1304 return patch_point_vals_side_[cell_side.
dim()-1].register_side_point(elem_table_row, value_patch_idx, cell_side.
elem_idx(),
1305 cell_side.
side_idx(), i_point_on_side);
1310 stream << endl <<
"Table of patch FE data:" << endl;
1311 for (
uint i=0; i<3; ++i) {
1312 stream << std::setfill(
'-') << setw(100) <<
"" << endl;
1313 stream <<
"Bulk, dimension " << (i+1) << endl;
1314 patch_point_vals_bulk_[i].print_data_tables(stream, points, ints);
1317 for (
uint i=0; i<3; ++i) {
1318 stream << std::setfill(
'-') << setw(100) <<
"" << endl;
1319 stream <<
"Side, dimension " << (i+1) << endl;
1320 patch_point_vals_side_[i].print_data_tables(stream, points, ints);
1322 stream << std::setfill(
'=') << setw(100) <<
"" << endl;
1327 stream << endl <<
"Table of patch FE operations:" << endl;
1328 for (
uint i=0; i<3; ++i) {
1329 stream << std::setfill(
'-') << setw(100) <<
"" << endl;
1330 stream <<
"Bulk, dimension " << (i+1) << endl;
1331 patch_point_vals_bulk_[i].print_operations(stream, 0);
1333 for (
uint i=0; i<3; ++i) {
1334 stream << std::setfill(
'-') << setw(100) <<
"" << endl;
1335 stream <<
"Side, dimension " << (i+1) << endl;
1336 patch_point_vals_side_[i].print_operations(stream, 1);
1338 stream << std::setfill(
'=') << setw(100) <<
"" << endl;
1348 bool used_quads_[2];
1350 template <
class ValueType>
1352 template <
class ValueType>
1354 template <
class ValueType>
1359 template <
class ValueType>
1362 return patch_point_vals_.scalar_value(op_idx_, value_cache_idx);
1368 return patch_point_vals_.vector_value(op_idx_, value_cache_idx);
1374 return patch_point_vals_.tensor_value(op_idx_, value_cache_idx);
1377 template <
class ValueType>
1380 return patch_point_vals_.scalar_value(op_idx_, value_cache_idx);
1386 return patch_point_vals_.vector_value(op_idx_, value_cache_idx);
1392 return patch_point_vals_.tensor_value(op_idx_, value_cache_idx);
1395 template <
class ValueType>
1398 return patch_point_vals_.scalar_value(op_idx_, value_cache_idx, shape_idx);
1404 return patch_point_vals_.vector_value(op_idx_, value_cache_idx, shape_idx);
1410 return patch_point_vals_.tensor_value(op_idx_, value_cache_idx, shape_idx);
1413 template <
class ValueType>
1416 return patch_point_vals_.scalar_value(op_idx_, value_cache_idx, shape_idx);
1422 return patch_point_vals_.vector_value(op_idx_, value_cache_idx, shape_idx);
1428 return patch_point_vals_.tensor_value(op_idx_, value_cache_idx, shape_idx);
1432 template <
class ValueType>
1445 Vector vect; vect.zeros();
1456 Tensor tens; tens.zeros();
1464 template <
class ValueType>
1480 Vector vect; vect.zeros();
1491 Tensor tens; tens.zeros();
#define ASSERT_PERMANENT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
std::vector< std::vector< std::vector< arma::vec > > > ref_shape_values_side(Quadrature *q, std::shared_ptr< FiniteElement< FE_dim >> fe)
Precomputed values of basis functions at the side quadrature points.
std::shared_ptr< FiniteElement< FE_dim > > fe_comp(std::shared_ptr< FiniteElement< FE_dim > > fe, uint component_idx)
Return FiniteElement of component_idx for FESystem or fe for other types.
std::vector< std::vector< arma::mat > > ref_shape_gradients_bulk(Quadrature *q, std::shared_ptr< FiniteElement< FE_dim >> fe)
Precomputed gradients of basis functions at the bulk quadrature points.
std::vector< std::vector< arma::vec > > ref_shape_values_bulk(Quadrature *q, std::shared_ptr< FiniteElement< FE_dim >> fe)
Precomputed values of basis functions at the bulk quadrature points.
std::vector< std::vector< std::vector< arma::mat > > > ref_shape_gradients_side(Quadrature *q, std::shared_ptr< FiniteElement< FE_dim >> fe)
Precomputed gradients of basis functions at the side quadrature points.
Base point accessor class.
const ElementCacheMap * elm_cache_map() const
unsigned int elem_patch_idx() const
unsigned int eval_point_idx() const
Return index in EvalPoints object.
ElQ< Scalar > JxW()
Register the product of Jacobian determinant and the quadrature weight at bulk quadrature points.
FeQ< Tensor > vector_sym_grad(uint component_idx=0)
Return the value of the function_no-th vector symmetric gradient at the p bulk quadrature point.
PatchPointValues< 3 > & patch_point_vals_
ElQ< Vector > coords()
Create bulk accessor of coords entity.
FeQ< Tensor > grad_vector_shape(uint component_idx=0)
Return the value of the function_no-th gradient vector shape function at the p bulk quadrature point.
ElQ< Scalar > determinant()
Create bulk accessor of jac determinant entity.
FeQ< Scalar > vector_divergence(uint component_idx=0)
Return the value of the function_no-th vector divergence at the p bulk quadrature point.
std::shared_ptr< FiniteElement< dim > > fe_
FeQ< Vector > grad_scalar_shape(uint component_idx=0)
Return the value of the function_no-th gradient shape function at the p bulk quadrature point.
FeQ< Scalar > scalar_shape(uint component_idx=0)
Return the value of the function_no-th shape function at the p bulk quadrature point.
FeQ< Vector > vector_shape(uint component_idx=0)
BulkValues(PatchPointValues< 3 > &patch_point_vals, MixedPtr< FiniteElement > fe)
Constructor.
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
ElQ(PatchPointValues< 3 > &patch_point_vals, unsigned int op_idx)
Constructor.
ValueType operator()(const SidePoint &point) const
ValueType operator()(const BulkPoint &point) const
unsigned int op_idx_
Index of operation in patch_point_vals_.operations vector.
ElQ()=delete
Forbidden default constructor.
PatchPointValues< 3 > & patch_point_vals_
Reference to PatchPointValues.
int element_eval_point(unsigned int i_elem_in_cache, unsigned int i_eval_point) const
Compound finite element on dim dimensional simplex.
const std::vector< std::shared_ptr< FiniteElement< dim > > > & fe() const
Bulk data specialization, order of item in operations_ vector corresponds to the BulkOps enum.
ValueType operator()(unsigned int shape_idx, FMT_UNUSED const SidePoint &point) const
ValueType operator()(unsigned int shape_idx, FMT_UNUSED const BulkPoint &point) const
PatchPointValues< 3 > & patch_point_vals_
Reference to PatchPointValues.
FeQ(PatchPointValues< 3 > &patch_point_vals, unsigned int op_idx, unsigned int n_dofs)
unsigned int n_dofs_
Number of DOFs.
unsigned int op_idx_
Index of operation in patch_point_vals_.operations vector.
FeQ()=delete
Forbidden default constructor.
Bulk Side specialization, order of item in operations_ vector corresponds to the SideOps enum.
Abstract class for the description of a general finite element on a reference simplex in dim dimensio...
unsigned int n_dofs_both() const
unsigned int local_idx() const
Return local index of DOF (on low / high-dim) - should be private method.
bool operator==(const JoinShapeAccessor< ValueType > &other) const
Comparison of accessors.
JoinShapeAccessor(PatchPointValues< 3 > *patch_point_vals_bulk, PatchPointValues< 3 > *patch_point_vals_side, unsigned int n_dofs_bulk, unsigned int n_dofs_side, unsigned int op_idx_bulk, unsigned int op_idx_side, unsigned int join_idx)
PatchPointValues< 3 > * patch_point_vals_bulk_
Pointer to bulk PatchPointValues.
unsigned int op_idx_side_
Index of operation in patch_point_vals_side_.operations vector.
unsigned int op_idx_bulk_
Index of operation in patch_point_vals_bulk_.operations vector.
unsigned int n_dofs_high() const
JoinShapeAccessor()
Default constructor.
void inc()
Iterates to next item.
unsigned int join_idx_
Index of processed DOF.
unsigned int n_dofs_high_
Number of DOFs on high-dim element.
unsigned int join_idx() const
Return global index of DOF.
unsigned int n_dofs_low() const
ValueType operator()(const BulkPoint &point) const
unsigned int n_dofs_low_
Number of DOFs on low-dim element.
PatchPointValues< 3 > * patch_point_vals_side_
Pointer to side PatchPointValues.
JoinValues(FMT_UNUSED PatchPointValues< 3 > *patch_point_vals_bulk, FMT_UNUSED PatchPointValues< 3 > *patch_point_vals_side, FMT_UNUSED MixedPtr< FiniteElement > fe)
Constructor.
Range< JoinShapeAccessor< Vector > > vector_join_shape(FMT_UNUSED uint component_idx=0)
Range< JoinShapeAccessor< Tensor > > gradient_vector_join_shape(FMT_UNUSED uint component_idx=0)
Range< JoinShapeAccessor< Scalar > > scalar_join_shape(FMT_UNUSED uint component_idx=0)
std::shared_ptr< FiniteElement< dim > > fe_high_dim_
JoinValues(PatchPointValues< 3 > *patch_point_vals_bulk, PatchPointValues< 3 > *patch_point_vals_side, MixedPtr< FiniteElement > fe)
Constructor.
Range< JoinShapeAccessor< Vector > > vector_join_shape(uint component_idx=0)
PatchPointValues< 3 > * patch_point_vals_bulk_
Range< JoinShapeAccessor< Tensor > > gradient_vector_join_shape(uint component_idx=0)
Range< JoinShapeAccessor< Scalar > > scalar_join_shape(uint component_idx=0)
std::shared_ptr< FiniteElement< dim-1 > > fe_low_dim_
PatchPointValues< 3 > * patch_point_vals_side_
static ElementMap element_map(ElementAccessor< 3 > elm)
uint register_element(DHCellAccessor cell, uint element_patch_idx)
Register element to patch_point_vals_ table by dimension of element.
PatchArena * patch_arena_
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.
std::array< FeBulk::PatchPointValues< spacedim >, 3 > patch_point_vals_bulk_
Sub objects of bulk data of dimensions 1,2,3.
uint register_side(DHCellSide cell_side)
Register side to patch_point_vals_ table by dimension of side.
void init_finalize()
Finalize initialization, creates child (patch) arena and passes it to PatchPointValue objects.
void print_data_tables(ostream &stream, bool points, bool ints, bool only_bulk=true) const
Temporary development method.
JoinValues< dim > join_values()
Return JoinValue object of dimension given by template parameter.
Quadrature * get_quadrature(uint dim, bool is_bulk) const
Return bulk or side quadrature of given dimension.
BulkValues< dim > bulk_values()
Return BulkValue object of dimension given by template parameter.
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
Temporary development method.
std::array< FeSide::PatchPointValues< spacedim >, 3 > patch_point_vals_side_
Sub objects of side data of dimensions 1,2,3.
MixedPtr< FiniteElement > fe_
Mixed of shared pointers of FiniteElement object.
SideValues< dim > side_values()
Return SideValue object of dimension given by template parameter.
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.
unsigned int n_dofs() const
Returns the number of shape functions.
void reset()
Reset PatchpointValues structures.
unsigned int get_fe_op(FEOps fe_op) const
Return index of FE operation in operations_ vector.
ElOp< spacedim > & make_fe_op(std::initializer_list< uint > shape, ReinitFunction reinit_f, std::vector< uint > input_ops_vec, uint n_dofs, OpSizeType size_type=pointOp)
void set_fe_op(FEOps fe_op, unsigned int op_vec_idx)
Set index of FE operation in operations_ vector.
std::vector< ElOp< spacedim > > operations_
Vector of all defined operations.
Quadrature * get_quadrature() const
Getter for quadrature.
uint dim() const
Getter for dim_.
Tensor tensor_value(uint op_idx, uint point_idx, uint i_dof=0) const
Scalar scalar_value(uint op_idx, uint point_idx, uint i_dof=0) const
Vector vector_value(uint op_idx, uint point_idx, uint i_dof=0) const
Base class for quadrature rules on simplices in arbitrary dimensions.
Quadrature make_from_side(unsigned int sid) const
unsigned int size() const
Returns number of quadrature points.
Armor::ArmaVec< double, point_dim > point(unsigned int i) const
Returns the ith quadrature point.
General point a+ side_begin_ + ccessor allow iterate over quadrature points of given side defined in ...
unsigned int eval_point_idx() const
Return index in EvalPoints object.
SideValues(PatchPointValues< 3 > &patch_point_vals, MixedPtr< FiniteElement > fe)
Constructor.
FeQ< Vector > vector_shape(uint component_idx=0)
Same as BulkValues::vector_shape but register at side quadrature points.
FeQ< Scalar > vector_divergence(uint component_idx=0)
Return the value of the function_no-th vector divergence at the p side quadrature point.
ElQ< Vector > normal_vector()
Register the normal vector to a side at side quadrature points.
std::shared_ptr< FiniteElement< dim > > fe_
FeQ< Tensor > vector_sym_grad(uint component_idx=0)
Return the value of the function_no-th vector symmetric gradient at the p side quadrature point.
ElQ< Scalar > JxW()
Same as BulkValues::JxW but register at side quadrature points.
ElQ< Vector > coords()
Create side accessor of coords entity.
FeQ< Scalar > scalar_shape(uint component_idx=0)
Same as BulkValues::scalar_shape but register at side quadrature points.
FeQ< Tensor > grad_vector_shape(uint component_idx=0)
Return the value of the function_no-th gradient vector shape function at the p bulk quadrature point.
FeQ< Vector > grad_scalar_shape(uint component_idx=0)
Same as BulkValues::grad_scalar_shape but register at side quadrature points.
PatchPointValues< 3 > & patch_point_vals_
ElQ< Scalar > determinant()
Create bulk accessor of jac determinant entity.
NodeAccessor< 3 > node(unsigned int i) const
Returns node for given local index i on the side.
Class ElementValues calculates data related to transformation of reference cell to actual cell (Jacob...
Class FESystem for compound finite elements.
Class FEValues calculates finite element data on the actual cells such as shape function values,...
Iter< Object > make_iter(Object obj)
Class MappingP1 implements the affine transformation of the unit cell onto the actual cell.
ArmaMat< double, N, M > mat
@ opCoords
operations evaluated on quadrature points
@ opInvJac
inverse Jacobian
@ opJac
Jacobian of element.
@ opJxW
JxW value of quadrature point.
@ opNormalVec
normal vector of quadrature point
@ opElJac
Jacobian of element.
Store finite element data on the actual patch such as shape function values, gradients,...
@ opVectorShape
Vector shape operation.
@ opVectorDivergence
Vector divergence.
@ opVectorSymGrad
Vector symmetric gradient.
@ opGradScalarShape
Scalar shape gradient.
@ opGradVectorShape
Vector shape gradient.
@ opScalarShape
Scalar shape operation.
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_
static void ptop_vector_shape(std::vector< ElOp< 3 >> &operations, std::vector< std::vector< arma::vec3 > > shape_values, uint vector_shape_op_idx)
static void ptop_vector_contravariant_shape(FMT_UNUSED std::vector< ElOp< 3 >> &operations, FMT_UNUSED std::vector< std::vector< arma::vec3 > > shape_values, FMT_UNUSED uint vector_shape_op_idx)
static void ptop_vector_piola_shape(FMT_UNUSED std::vector< ElOp< 3 >> &operations, FMT_UNUSED std::vector< std::vector< arma::vec3 > > shape_values, FMT_UNUSED uint vector_shape_op_idx)
static void ptop_scalar_shape(std::vector< ElOp< 3 >> &operations, std::vector< std::vector< double > > shape_values, uint scalar_shape_op_idx)
static void ptop_vector_shape_grads(std::vector< ElOp< 3 >> &operations, std::vector< std::vector< arma::mat > > ref_shape_grads, uint vector_shape_grads_op_idx)
static void ptop_vector_divergence(std::vector< ElOp< 3 >> &operations, uint vector_divergence_op_idx)
Common reinit function of vector divergence on bulk and side points.
static void ptop_vector_sym_grad(std::vector< ElOp< 3 >> &operations, uint vector_sym_grad_op_idx)
Common reinit function of vector symmetric gradient on bulk and side points.
static void ptop_vector_shape(std::vector< ElOp< 3 >> &operations, IntTableArena &el_table, std::vector< std::vector< std::vector< arma::vec3 > > > shape_values, uint vector_shape_op_idx)
static void ptop_scalar_shape(std::vector< ElOp< 3 >> &operations, IntTableArena &el_table, std::vector< std::vector< std::vector< double > > > shape_values, uint scalar_shape_op_idx)
static void ptop_vector_contravariant_shape(FMT_UNUSED std::vector< ElOp< 3 >> &operations, FMT_UNUSED IntTableArena &el_table, FMT_UNUSED std::vector< std::vector< std::vector< arma::vec3 > > > shape_values, FMT_UNUSED uint vector_shape_op_idx)
static void ptop_vector_piola_shape(FMT_UNUSED std::vector< ElOp< 3 >> &operations, FMT_UNUSED IntTableArena &el_table, FMT_UNUSED std::vector< std::vector< std::vector< arma::vec3 > > > shape_values, FMT_UNUSED uint vector_shape_op_idx)
Enum type UpdateFlags indicates which quantities are to be recomputed on each finite element cell.