21 #ifndef PATCH_FE_VALUES_HH_
22 #define PATCH_FE_VALUES_HH_
47 template <
class ValueType>
67 template <
class ValueType>
82 unsigned int op_idx,
unsigned int i_shape_fn_idx)
102 template <
class ValueType>
136 template <
class ValueType>
154 unsigned int n_dofs_side,
unsigned int op_idx_bulk,
unsigned int op_idx_side)
210 template<
unsigned int dim>
219 template<
unsigned int FE_dim>
223 return fe_sys->
fe()[component_idx];
225 ASSERT_EQ(component_idx, 0).warning(
"Non-zero component_idx can only be used for FESystem.");
237 template<
unsigned int FE_dim>
241 arma::mat shape_values(fe->n_dofs(), fe->n_components());
242 for (
unsigned int i=0; i<q->
size(); i++)
244 for (
unsigned int j=0; j<fe->n_dofs(); j++)
246 for (
unsigned int c=0; c<fe->n_components(); c++)
247 shape_values(j,c) = fe->shape_value(j, q->
point<FE_dim>(i), c);
249 ref_shape_vals[i][j] = trans(shape_values.row(j));
253 return ref_shape_vals;
264 template<
unsigned int FE_dim>
268 arma::mat shape_values(fe->n_dofs(), fe->n_components());
270 for (
unsigned int sid=0; sid<FE_dim+1; sid++) {
272 for (
unsigned int i=0; i<quad.size(); i++)
274 for (
unsigned int j=0; j<fe->n_dofs(); j++)
276 for (
unsigned int c=0; c<fe->n_components(); c++) {
277 shape_values(j,c) = fe->shape_value(j, quad.template point<FE_dim>(i), c);
280 ref_shape_vals[sid][i][j] = trans(shape_values.row(j));
285 return ref_shape_vals;
295 template<
unsigned int FE_dim>
299 arma::mat grad(FE_dim, fe->n_components());
300 for (
unsigned int i_pt=0; i_pt<q->
size(); i_pt++)
302 for (
unsigned int i_dof=0; i_dof<fe->n_dofs(); i_dof++)
305 for (
unsigned int c=0; c<fe->n_components(); c++)
306 grad.col(c) += fe->shape_grad(i_dof, q->
point<FE_dim>(i_pt), c);
308 ref_shape_grads[i_pt][i_dof] = grad;
312 return ref_shape_grads;
323 template<
unsigned int FE_dim>
328 for (
unsigned int sid=0; sid<FE_dim+1; sid++) {
330 for (
unsigned int i_pt=0; i_pt<quad.size(); i_pt++)
332 for (
unsigned int i_dof=0; i_dof<fe->n_dofs(); i_dof++)
335 for (
unsigned int c=0; c<fe->n_components(); c++)
336 grad.col(c) += fe->shape_grad(i_dof, quad.template point<FE_dim>(i_pt), c);
338 ref_shape_grads[sid][i_pt][i_dof] = grad;
343 return ref_shape_grads;
348 template<
unsigned int dim>
387 auto fe_component = this->
fe_comp(
fe_, component_idx);
388 ASSERT_EQ(fe_component->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of scalar_shape accessor must be FEScalar!\n");
391 uint n_dofs = fe_component->n_dofs();
397 auto ref_scalar_value = ref_scalar_op->result_matrix();
398 for (
unsigned int i_p = 0; i_p < n_points; i_p++)
399 for (
unsigned int i_dof = 0; i_dof < n_dofs; i_dof++) {
400 ref_scalar_value(i_dof)(i_p) = ref_shape_vals[i_p][i_dof][0];
408 auto fe_component = this->
fe_comp(
fe_, component_idx);
410 .error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
413 uint n_dofs = fe_component->n_dofs();
418 auto vector_ref_result = vector_ref_op->result_matrix();
421 for (
uint i_dof=0; i_dof<n_dofs; ++i_dof)
422 for (
uint i_p=0; i_p<n_points; ++i_p)
423 for (
uint c=0; c<3; ++c)
424 vector_ref_result(c, i_dof)(i_p) = ref_shape_vals[i_p][i_dof](c);
431 auto fe_component = this->
fe_comp(
fe_, component_idx);
432 ASSERT_EQ(fe_component->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of scalar_shape accessor must be FEScalar!\n");
435 uint n_dofs = fe_component->n_dofs();
441 auto ref_scalar_value = ref_scalar_op->result_matrix();
442 for (
uint i=0; i<ref_scalar_value.rows(); ++i) {
443 for (
uint i_dof=0; i_dof<n_dofs; ++i_dof)
444 for (
uint i_p=0; i_p<n_points; ++i_p)
445 ref_scalar_value(i, i_dof)(i_p) = ref_shape_grads[i_p][i_dof](i);
453 auto fe_component = this->
fe_comp(
fe_, component_idx);
455 .error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
458 uint n_dofs = fe_component->n_dofs();
464 auto ref_vector_value = ref_vector_op->result_matrix();
465 for (
uint i_c=0; i_c<3; ++i_c) {
466 for (
uint i_dim=0; i_dim<dim; ++i_dim)
467 for (
uint i_dof=0; i_dof<n_dofs; ++i_dof)
468 for (
uint i_p=0; i_p<n_points; ++i_p)
469 ref_vector_value(i_dim,3*i_dof+i_c)(i_p) = ref_shape_grads[i_p][i_dof](i_dim, i_c);
483 auto fe_component = this->
fe_comp(
fe_, component_idx);
484 ASSERT_EQ(fe_component->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of scalar_shape accessor must be FEScalar!\n");
486 uint n_dofs = fe_component->n_dofs();
494 auto fe_component = this->
fe_comp(
fe_, component_idx);
496 uint n_dofs = fe_component->n_dofs();
499 switch (fe_component->fe_type()) {
507 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorContravariant is not implemented yet!\n");
513 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorPiola is not implemented yet!\n");
518 ASSERT(
false).error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
535 auto fe_component = this->
fe_comp(
fe_, component_idx);
536 ASSERT_EQ(fe_component->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of grad_scalar_shape accessor must be FEScalar!\n");
538 uint n_dofs = fe_component->n_dofs();
552 auto fe_component = this->
fe_comp(
fe_, component_idx);
554 uint n_dofs = fe_component->n_dofs();
557 switch (fe_component->fe_type()) {
562 bulk_reinit::ptop_vector_shape_grads<dim>,
568 ASSERT_PERMANENT(
false).error(
"Grad vector for FEVectorContravariant is not implemented yet!\n");
571 bulk_reinit::ptop_vector_contravariant_shape_grads<dim>,
577 ASSERT_PERMANENT(
false).error(
"Grad vector for FEVectorPiola is not implemented yet!\n");
580 bulk_reinit::ptop_vector_piola_shape_grads<dim>,
585 ASSERT(
false).error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
599 auto fe_component = this->
fe_comp(
fe_, component_idx);
600 uint n_dofs = fe_component->n_dofs();
616 auto fe_component = this->
fe_comp(
fe_, component_idx);
617 uint n_dofs = fe_component->n_dofs();
627 std::shared_ptr< FiniteElement<dim> >
fe_;
631 template<
unsigned int dim>
672 auto fe_component = this->
fe_comp(
fe_, component_idx);
673 ASSERT_EQ(fe_component->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of scalar_shape accessor must be FEScalar!\n");
676 uint n_dofs = fe_component->n_dofs();
682 auto ref_scalar_value = ref_scalar_op->result_matrix();
683 for (
unsigned int s=0; s<dim+1; ++s) {
684 for (
unsigned int i_p = 0; i_p < n_points; i_p++)
685 for (
unsigned int i_dof = 0; i_dof < n_dofs; i_dof++) {
686 ref_scalar_value(s, i_dof)(i_p) = ref_shape_vals[s][i_p][i_dof][0];
695 auto fe_component = this->
fe_comp(
fe_, component_idx);
697 .error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
700 uint n_dofs = fe_component->n_dofs();
704 auto ref_vector_value = ref_vector_op->result_matrix();
706 for (
unsigned int s=0; s<dim+1; ++s)
707 for (
unsigned int i_p = 0; i_p < n_points; i_p++)
708 for (
unsigned int i_dof = 0; i_dof < n_dofs; i_dof++)
709 for (
uint c=0; c<3; ++c)
710 ref_vector_value(s,3*i_dof+c)(i_p) = ref_shape_vals[s][i_p][i_dof][c];
717 auto fe_component = this->
fe_comp(
fe_, component_idx);
718 ASSERT_EQ(fe_component->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of scalar_shape accessor must be FEScalar!\n");
721 uint n_dofs = fe_component->n_dofs();
727 auto ref_scalar_value = ref_scalar_op->result_matrix();
728 for (
unsigned int s=0; s<dim+1; ++s)
729 for (
uint i_dof=0; i_dof<n_dofs; ++i_dof)
730 for (
uint i_p=0; i_p<n_points; ++i_p)
731 for (
uint c=0; c<dim; ++c)
732 ref_scalar_value(s,dim*i_dof+c)(i_p) = ref_shape_grads[s][i_p][i_dof](c);
739 auto fe_component = this->
fe_comp(
fe_, component_idx);
741 .error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
744 uint n_dofs = fe_component->n_dofs();
745 uint n_sides = dim+1;
751 auto ref_vector_value = ref_vector_op->result_matrix();
752 for (
uint i_sd=0; i_sd<n_sides; ++i_sd)
753 for (
uint i_c=0; i_c<3; ++i_c)
754 for (
uint i_dim=0; i_dim<dim; ++i_dim)
755 for (
uint i_dof=0; i_dof<n_dofs; ++i_dof)
756 for (
uint i_p=0; i_p<n_points; ++i_p) {
757 ref_vector_value(i_sd*dim+i_dim, 3*i_dof+i_c)(i_p) = ref_shape_grads[i_sd][i_p][i_dof](i_dim, i_c);
766 auto fe_component = this->
fe_comp(
fe_, component_idx);
767 ASSERT_EQ(fe_component->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of scalar_shape accessor must be FEScalar!\n");
769 uint n_dofs = fe_component->n_dofs();
778 auto fe_component = this->
fe_comp(
fe_, component_idx);
781 uint n_dofs = fe_component->n_dofs();
784 switch (fe_component->fe_type()) {
792 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorContravariant is not implemented yet!\n");
798 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorPiola is not implemented yet!\n");
803 ASSERT(
false).error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
811 auto fe_component = this->
fe_comp(
fe_, component_idx);
812 ASSERT_EQ(fe_component->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of grad_scalar_shape accessor must be FEScalar!\n");
814 uint n_dofs = fe_component->n_dofs();
828 auto fe_component = this->
fe_comp(
fe_, component_idx);
830 uint n_dofs = fe_component->n_dofs();
833 switch (fe_component->fe_type()) {
838 side_reinit::ptop_vector_shape_grads<dim>,
844 ASSERT_PERMANENT(
false).error(
"Grad vector for FEVectorContravariant is not implemented yet!\n");
847 side_reinit::ptop_vector_contravariant_shape_grads<dim>,
853 ASSERT_PERMANENT(
false).error(
"Grad vector for FEVectorPiola is not implemented yet!\n");
856 side_reinit::ptop_vector_piola_shape_grads<dim>,
861 ASSERT(
false).error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
875 auto fe_component = this->
fe_comp(
fe_, component_idx);
876 uint n_dofs = fe_component->n_dofs();
892 auto fe_component = this->
fe_comp(
fe_, component_idx);
893 uint n_dofs = fe_component->n_dofs();
903 std::shared_ptr< FiniteElement<dim> >
fe_;
907 template<
unsigned int dim>
924 ASSERT_EQ(fe_component_low->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of scalar_shape accessor must be FEScalar!\n");
925 uint n_dofs_low = fe_component_low->n_dofs();
931 ASSERT_EQ(fe_component_high->fe_type(),
FEType::FEScalar).error(
"Type of FiniteElement of scalar_shape accessor must be FEScalar!\n");
932 uint n_dofs_high = fe_component_high->n_dofs();
945 uint n_dofs_low = fe_component_low->n_dofs();
950 uint n_dofs_high = fe_component_high->n_dofs();
952 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");
953 switch (fe_component_low->fe_type()) {
964 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorContravariant is not implemented yet!\n");
970 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorPiola is not implemented yet!\n");
975 ASSERT(
false).error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
991 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");
992 switch (fe_component_low->fe_type()) {
996 {3, 3-fe_component_low->n_dofs()},
998 fe_component_low->n_dofs());
1001 {3, 3*fe_component_high->n_dofs()},
1002 side_reinit::ptop_vector_shape_grads<dim>,
1003 fe_component_high->n_dofs());
1011 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorContravariant is not implemented yet!\n");
1025 ASSERT_PERMANENT(
false).error(
"Shape vector for FEVectorPiola is not implemented yet!\n");
1038 ASSERT(
false).error(
"Type of FiniteElement of grad_vector_shape accessor must be FEVector, FEVectorPiola or FEVectorContravariant!\n");
1042 fe_component_high->n_dofs(), op_idx_bulk, op_idx_side);
1078 template<
unsigned int spacedim = 3>
1134 used_quads_[0] =
false; used_quads_[1] =
false;
1138 : patch_fe_data_(1024 * 1024, 256),
1147 used_quads_[0] =
false; used_quads_[1] =
false;
1150 uint zero_vec_size = 300;
1151 patch_fe_data_.zero_vec_ =
ArenaVec<double>(zero_vec_size, patch_fe_data_.asm_arena_);
1152 for (
uint i=0; i<zero_vec_size; ++i) patch_fe_data_.zero_vec_(i) = 0.0;
1162 if (is_bulk)
return patch_point_vals_bulk_[dim-1].get_quadrature();
1163 else return patch_point_vals_side_[dim-1].get_quadrature();
1173 template<
unsigned int DIM>
1176 if ( _quadrature.
dim() == DIM ) {
1177 used_quads_[0] =
true;
1178 patch_point_vals_bulk_[DIM-1].initialize();
1180 used_quads_[1] =
true;
1181 patch_point_vals_side_[DIM-1].initialize();
1187 patch_fe_data_.patch_arena_ = patch_fe_data_.asm_arena_.get_child_arena();
1193 for (
unsigned int i=0; i<3; ++i) {
1194 if (used_quads_[0]) patch_point_vals_bulk_[i].reset();
1195 if (used_quads_[1]) patch_point_vals_side_[i].reset();
1197 patch_fe_data_.patch_arena_->reset();
1203 for (
unsigned int i=0; i<3; ++i) {
1204 if (used_quads_[0]) patch_point_vals_bulk_[i].reinit_patch();
1205 if (used_quads_[1]) patch_point_vals_side_[i].reinit_patch();
1212 template<
unsigned int dim>
1214 ASSERT((dim>=0) && (dim<=3))(dim).error(
"Dimension must be 0, 1, 2 or 3.");
1219 template<
unsigned int dim>
1221 ASSERT((dim>0) && (dim<=3))(dim).error(
"Dimension must be 1, 2 or 3.");
1226 template<
unsigned int dim>
1228 ASSERT((dim>0) && (dim<=3))(dim).error(
"Dimension must be 1, 2 or 3.");
1233 template<
unsigned int dim>
1236 return JoinValues<dim>(&patch_point_vals_bulk_[dim-2], &patch_point_vals_side_[dim-1], fe_);
1243 for (
uint i=0; i<3; ++i) {
1244 if (used_quads_[0]) patch_point_vals_bulk_[i].resize_tables(table_sizes.
elem_sizes_[0][i], table_sizes.
point_sizes_[0][i]);
1245 if (used_quads_[1]) patch_point_vals_side_[i].resize_tables(table_sizes.
elem_sizes_[1][i], table_sizes.
point_sizes_[1][i]);
1252 switch (cell.
dim()) {
1255 return patch_point_vals_bulk_[0].register_element(coords, element_patch_idx);
1259 return patch_point_vals_bulk_[1].register_element(coords, element_patch_idx);
1263 return patch_point_vals_bulk_[2].register_element(coords, element_patch_idx);
1275 for (
unsigned int n=0; n<cell_side.
dim(); n++)
1276 for (
unsigned int c=0; c<spacedim; c++)
1277 side_coords(c,n) = (*cell_side.
side().
node(n))[c];
1281 switch (cell.
dim()) {
1284 return patch_point_vals_side_[0].register_side(elm_coords, side_coords, cell_side.
side_idx());
1288 return patch_point_vals_side_[1].register_side(elm_coords, side_coords, cell_side.
side_idx());
1292 return patch_point_vals_side_[2].register_side(elm_coords, side_coords, cell_side.
side_idx());
1303 return patch_point_vals_bulk_[cell.
dim()-1].register_bulk_point(elem_table_row, value_patch_idx, cell.
elm_idx(), i_point_on_elem);
1308 return patch_point_vals_side_[cell_side.
dim()-1].register_side_point(elem_table_row, value_patch_idx, cell_side.
elem_idx(),
1309 cell_side.
side_idx(), i_point_on_side);
1314 stream << endl <<
"Table of patch FE data:" << endl;
1315 for (
uint i=0; i<3; ++i) {
1316 stream << std::setfill(
'-') << setw(100) <<
"" << endl;
1317 stream <<
"Bulk, dimension " << (i+1) << endl;
1318 patch_point_vals_bulk_[i].print_data_tables(stream, points, ints);
1321 for (
uint i=0; i<3; ++i) {
1322 stream << std::setfill(
'-') << setw(100) <<
"" << endl;
1323 stream <<
"Side, dimension " << (i+1) << endl;
1324 patch_point_vals_side_[i].print_data_tables(stream, points, ints);
1326 stream << std::setfill(
'=') << setw(100) <<
"" << endl;
1331 stream << endl <<
"Table of patch FE operations:" << endl;
1332 for (
uint i=0; i<3; ++i) {
1333 stream << std::setfill(
'-') << setw(100) <<
"" << endl;
1334 stream <<
"Bulk, dimension " << (i+1) << endl;
1335 patch_point_vals_bulk_[i].print_operations(stream, 0);
1337 for (
uint i=0; i<3; ++i) {
1338 stream << std::setfill(
'-') << setw(100) <<
"" << endl;
1339 stream <<
"Side, dimension " << (i+1) << endl;
1340 patch_point_vals_side_[i].print_operations(stream, 1);
1342 stream << std::setfill(
'=') << setw(100) <<
"" << endl;
1351 bool used_quads_[2];
1353 template <
class ValueType>
1355 template <
class ValueType>
1360 template <
class ValueType>
1363 return patch_point_vals_->scalar_elem_value(
op_idx_, value_cache_idx);
1369 return patch_point_vals_->vector_elem_value(
op_idx_, value_cache_idx);
1375 return patch_point_vals_->tensor_elem_value(
op_idx_, value_cache_idx);
1378 template <
class ValueType>
1381 return patch_point_vals_->scalar_elem_value(
op_idx_, value_cache_idx);
1387 return patch_point_vals_->vector_elem_value(
op_idx_, value_cache_idx);
1393 return patch_point_vals_->tensor_elem_value(
op_idx_, value_cache_idx);
1396 template <
class ValueType>
1420 template <
class ValueType>
#define ASSERT_PERMANENT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
#define ASSERT_LT(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
#define ASSERT_GT(a, b)
Definition of comparative assert macro (Greater Than) only for debug mode.
#define ASSERT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR) 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.
FeQArray< Vector > ref_vector(uint component_idx=0)
FeQ< Scalar > JxW()
Register the product of Jacobian determinant and the quadrature weight at bulk quadrature points.
FeQArray< 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.
ElQ< Vector > coords()
Create bulk accessor of coords entity.
FeQArray< Tensor > ref_vector_grad(uint component_idx=0)
ElQ< Scalar > determinant()
Create bulk accessor of jac determinant entity.
FeQArray< Vector > ref_scalar_grad(uint component_idx=0)
PatchPointValues< 3 > * patch_point_vals_
FeQArray< 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.
BulkValues(PatchPointValues< 3 > *patch_point_vals, MixedPtr< FiniteElement > fe)
Constructor.
std::shared_ptr< FiniteElement< dim > > fe_
FeQArray< Scalar > ref_scalar(uint component_idx=0)
FeQArray< Vector > vector_shape(uint component_idx=0)
FeQArray< Scalar > scalar_shape(uint component_idx=0)
Return the value of the function_no-th shape function at the p bulk quadrature point.
FeQArray< Scalar > vector_divergence(uint component_idx=0)
Return the value of the function_no-th vector divergence at the p bulk quadrature point.
FeQArray< 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.
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
ValueType operator()(const SidePoint &point) const
ValueType operator()(const BulkPoint &point) const
ElQ(PatchPointValues< 3 > *patch_point_vals, unsigned int op_idx)
Constructor.
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
FeQArray()=delete
Forbidden default constructor.
unsigned int n_dofs() const
Return number of DOFs.
unsigned int n_dofs_
Number of DOFs.
FeQArray(PatchPointValues< 3 > *patch_point_vals, bool is_bulk, unsigned int op_idx, unsigned int n_dofs)
FeQ< ValueType > shape(unsigned int i_shape_fn_idx) const
unsigned int op_idx_
Index of operation in patch_point_vals_.operations vector.
PatchPointValues< 3 > * patch_point_vals_bulk_
Reference to bulk PatchPointValues.
PatchPointValues< 3 > * patch_point_vals_side_
Reference to side PatchPointValues.
FeQJoin(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)
bool is_high_dim(unsigned int i_join_idx) const
unsigned int n_dofs_both() const
unsigned int n_dofs_low() const
unsigned int n_dofs_low_
Number of DOFs on low-dim element.
PatchPointValues< 3 > * patch_point_vals_side_
Pointer to side 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_
Number of DOFs on high-dim element.
FeQJoin()
Default constructor.
unsigned int n_dofs_high() const
FeQ< ValueType > shape(unsigned int i_join_idx) const
PatchPointValues< 3 > * patch_point_vals_bulk_
Pointer to bulk PatchPointValues.
FeQ(PatchPointValues< 3 > *patch_point_vals_bulk, PatchPointValues< 3 > *patch_point_vals_side, unsigned int op_idx, unsigned int i_shape_fn_idx)
Constructor used only in FeQArray::shape()
FeQ(PatchPointValues< 3 > *patch_point_vals, bool is_bulk, unsigned int op_idx)
ValueType operator()(const BulkPoint &point) const
PatchPointValues< 3 > * patch_point_vals_bulk_
Pointer to bulk PatchPointValues.
ValueType operator()(const SidePoint &point) const
unsigned int i_shape_fn_idx_
Index of shape function.
unsigned int op_idx_
Index of operation in patch_point_vals_.operations vector.
PatchPointValues< 3 > * patch_point_vals_side_
Pointer to side PatchPointValues.
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...
FeQJoin< Tensor > gradient_vector_join_shape(FMT_UNUSED uint component_idx=0)
JoinValues(FMT_UNUSED PatchPointValues< 3 > *patch_point_vals_bulk, FMT_UNUSED PatchPointValues< 3 > *patch_point_vals_side, FMT_UNUSED MixedPtr< FiniteElement > fe)
Constructor.
FeQJoin< Vector > vector_join_shape(FMT_UNUSED uint component_idx=0)
FeQJoin< 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.
FeQJoin< Vector > vector_join_shape(uint component_idx=0)
PatchPointValues< 3 > * patch_point_vals_bulk_
FeQJoin< Tensor > gradient_vector_join_shape(uint component_idx=0)
std::shared_ptr< FiniteElement< dim-1 > > fe_low_dim_
FeQJoin< Scalar > scalar_join_shape(uint component_idx=0)
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.
PatchPointValues< spacedim >::PatchFeData PatchFeData
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.
PatchFeData patch_fe_data_
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.
PatchPointValues * zero_values()
Quadrature * get_quadrature() const
Getter for quadrature.
PatchOp< spacedim > * make_fe_op(uint op_idx, std::initializer_list< uint > shape, ReinitFunction reinit_f, uint n_dofs, OpSizeType size_type=pointOp)
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
void zero_values_needed()
Set flag needs_zero_values_ to true.
PatchOp< spacedim > * make_fixed_fe_op(uint op_idx, std::initializer_list< uint > shape, ReinitFunction reinit_f, uint n_dofs)
AssemblyArena & asm_arena() const
return reference to assembly arena
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.
FeQArray< Scalar > ref_scalar(uint component_idx=0)
PatchPointValues< 3 > * patch_point_vals_
ElQ< Vector > normal_vector()
Register the normal vector to a side at side quadrature points.
std::shared_ptr< FiniteElement< dim > > fe_
FeQArray< Scalar > scalar_shape(uint component_idx=0)
Same as BulkValues::scalar_shape but register at side quadrature points.
FeQArray< 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< Vector > coords()
Create side accessor of coords entity.
FeQArray< Vector > vector_shape(uint component_idx=0)
Same as BulkValues::vector_shape but register at side quadrature points.
FeQArray< Tensor > ref_vector_grad(uint component_idx=0)
FeQArray< Vector > ref_scalar_grad(uint component_idx=0)
FeQArray< Vector > ref_vector(uint component_idx=0)
FeQArray< 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.
FeQArray< Vector > grad_scalar_shape(uint component_idx=0)
Same as BulkValues::grad_scalar_shape but register at side quadrature points.
SideValues(PatchPointValues< 3 > *patch_point_vals, MixedPtr< FiniteElement > fe)
Constructor.
FeQArray< Scalar > vector_divergence(uint component_idx=0)
Return the value of the function_no-th vector divergence at the p side quadrature point.
ElQ< Scalar > determinant()
Create bulk accessor of jac determinant entity.
FeQ< Scalar > JxW()
Same as BulkValues::JxW but register at side quadrature points.
NodeAccessor< 3 > node(unsigned int i) const
Returns node for given local index i on the side.
Class FESystem for compound finite elements.
Class MappingP1 implements the affine transformation of the unit cell onto the actual cell.
ArmaMat< double, N, M > mat
@ opVectorSymGrad
Vector symmetric gradient.
@ opVectorDivergence
Vector divergence.
@ opScalarShape
FE operations.
@ opCoords
operations evaluated on quadrature points
@ opVectorShape
Vector shape operation.
@ opRefScalarGrad
Gradient scalar reference.
@ opGradVectorShape
Vector shape gradient.
@ opGradScalarShape
Scalar shape gradient.
@ opRefVector
Vector reference.
@ opRefScalar
Scalar reference.
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_
static void ptop_vector_shape_grads(PatchOp< 3 > *result_op, FMT_UNUSED IntTableArena &el_table)
static void ptop_vector_piola_shape(FMT_UNUSED PatchOp< 3 > *result_op, FMT_UNUSED IntTableArena &el_table)
static void ptop_scalar_shape(PatchOp< 3 > *result_op, FMT_UNUSED IntTableArena &el_table)
static void ptop_vector_contravariant_shape(FMT_UNUSED PatchOp< 3 > *result_op, FMT_UNUSED IntTableArena &el_table)
static void ptop_vector_shape(PatchOp< 3 > *result_op, FMT_UNUSED IntTableArena &el_table)
static void op_base(FMT_UNUSED PatchOp< 3 > *result_op, FMT_UNUSED IntTableArena &el_table)
static void ptop_vector_sym_grad(PatchOp< 3 > *result_op, FMT_UNUSED IntTableArena &el_table)
Common reinit function of vector symmetric gradient on bulk and side points.
static void ptop_vector_divergence(PatchOp< 3 > *result_op, FMT_UNUSED IntTableArena &el_table)
Common reinit function of vector divergence on bulk and side points.
static void ptop_vector_contravariant_shape(FMT_UNUSED PatchOp< 3 > *result_op, FMT_UNUSED IntTableArena &el_table)
static void ptop_vector_shape(PatchOp< 3 > *result_op, IntTableArena &el_table)
static void ptop_vector_piola_shape(FMT_UNUSED PatchOp< 3 > *result_op, FMT_UNUSED IntTableArena &el_table)
static void ptop_scalar_shape(PatchOp< 3 > *result_op, IntTableArena &el_table)
Enum type UpdateFlags indicates which quantities are to be recomputed on each finite element cell.