17 #include <deal.II/base/quadrature_lib.h> 18 #include <deal.II/base/qprojector.h> 19 #include <deal.II/base/thread_management.h> 20 #include <deal.II/base/utilities.h> 21 #include <deal.II/lac/full_matrix.h> 22 #include <deal.II/lac/householder.h> 23 #include <deal.II/lac/constraint_matrix.h> 24 #include <deal.II/grid/tria.h> 25 #include <deal.II/grid/tria_iterator.h> 26 #include <deal.II/grid/grid_generator.h> 27 #include <deal.II/fe/fe_tools.h> 28 #include <deal.II/fe/fe.h> 29 #include <deal.II/fe/fe_face.h> 30 #include <deal.II/fe/fe_q_iso_q1.h> 31 #include <deal.II/fe/fe_q.h> 32 #include <deal.II/fe/fe_q_dg0.h> 33 #include <deal.II/fe/fe_q_bubbles.h> 34 #include <deal.II/fe/fe_bernstein.h> 35 #include <deal.II/fe/fe_q_hierarchical.h> 36 #include <deal.II/fe/fe_dgq.h> 37 #include <deal.II/fe/fe_dgp.h> 38 #include <deal.II/fe/fe_dgp_monomial.h> 39 #include <deal.II/fe/fe_dgp_nonparametric.h> 40 #include <deal.II/fe/fe_dg_vector.h> 41 #include <deal.II/fe/fe_nedelec.h> 42 #include <deal.II/fe/fe_abf.h> 43 #include <deal.II/fe/fe_bdm.h> 44 #include <deal.II/fe/fe_raviart_thomas.h> 45 #include <deal.II/fe/fe_rannacher_turek.h> 46 #include <deal.II/fe/fe_nothing.h> 47 #include <deal.II/fe/fe_system.h> 48 #include <deal.II/fe/fe_values.h> 49 #include <deal.II/fe/mapping_cartesian.h> 50 #include <deal.II/fe/mapping_q1.h> 51 #include <deal.II/dofs/dof_handler.h> 52 #include <deal.II/dofs/dof_accessor.h> 53 #include <deal.II/dofs/dof_tools.h> 54 #include <deal.II/hp/dof_handler.h> 56 #include <deal.II/base/std_cxx11/shared_ptr.h> 58 #include <deal.II/base/index_set.h> 64 DEAL_II_NAMESPACE_OPEN
71 template <
int dim,
int spacedim>
74 const std::vector<unsigned int> &multiplicities,
75 const bool do_tensor_product)
79 unsigned int multiplied_dofs_per_vertex = 0;
80 unsigned int multiplied_dofs_per_line = 0;
81 unsigned int multiplied_dofs_per_quad = 0;
82 unsigned int multiplied_dofs_per_hex = 0;
84 unsigned int multiplied_n_components = 0;
86 unsigned int degree = 0;
88 unsigned int n_components = 0;
90 for (
unsigned int i=0; i<fes.size(); i++)
91 if (multiplicities[i]>0)
93 n_components = fes[i]->n_components();
97 for (
unsigned int i=0; i<fes.size(); i++)
98 if (multiplicities[i]>0)
100 multiplied_dofs_per_vertex += fes[i]->dofs_per_vertex * multiplicities[i];
101 multiplied_dofs_per_line += fes[i]->dofs_per_line * multiplicities[i];
102 multiplied_dofs_per_quad += fes[i]->dofs_per_quad * multiplicities[i];
103 multiplied_dofs_per_hex += fes[i]->dofs_per_hex * multiplicities[i];
105 multiplied_n_components+=fes[i]->n_components() * multiplicities[i];
107 Assert (do_tensor_product || (n_components == fes[i]->n_components()),
110 degree = std::max(degree, fes[i]->tensor_degree() );
119 unsigned int index = 0;
120 for (index=0; index<fes.size(); ++index)
121 if (multiplicities[index]>0)
127 for (; index<fes.size(); ++index)
128 if (multiplicities[index]>0)
132 fes[index]->conforming_space);
135 std::vector<unsigned int> dpo;
136 dpo.push_back(multiplied_dofs_per_vertex);
137 dpo.push_back(multiplied_dofs_per_line);
138 if (dim>1) dpo.push_back(multiplied_dofs_per_quad);
139 if (dim>2) dpo.push_back(multiplied_dofs_per_hex);
143 for (
unsigned int base=0; base < fes.size(); ++base)
144 for (
unsigned int m = 0; m < multiplicities[base]; ++m)
145 block_indices.
push_back(fes[base]->dofs_per_cell);
148 (do_tensor_product ? multiplied_n_components : n_components),
156 template <
int dim,
int spacedim>
159 const unsigned int N1,
161 const unsigned int N2,
163 const unsigned int N3,
165 const unsigned int N4,
167 const unsigned int N5)
169 std::vector<const FiniteElement<dim,spacedim>*> fes;
176 std::vector<unsigned int> mult;
187 template <
int dim,
int spacedim>
190 const std::vector<unsigned int> &multiplicities)
196 unsigned int n_shape_functions = 0;
197 for (
unsigned int i=0; i<fes.size(); ++i)
198 if (multiplicities[i]>0)
199 n_shape_functions += fes[i]->dofs_per_cell * multiplicities[i];
202 std::vector<bool> retval (n_shape_functions,
false);
211 unsigned int total_index = 0;
212 for (
unsigned int vertex_number=0;
213 vertex_number<GeometryInfo<dim>::vertices_per_cell;
216 for (
unsigned int base=0; base<fes.size(); ++base)
217 for (
unsigned int m=0; m<multiplicities[base]; ++m)
218 for (
unsigned int local_index = 0;
219 local_index < fes[base]->dofs_per_vertex;
220 ++local_index, ++total_index)
222 const unsigned int index_in_base
223 = (fes[base]->dofs_per_vertex*vertex_number +
226 Assert (index_in_base < fes[base]->dofs_per_cell,
228 retval[total_index] = fes[base]->restriction_is_additive(index_in_base);
234 for (
unsigned int line_number= 0;
238 for (
unsigned int base=0; base<fes.size(); ++base)
239 for (
unsigned int m=0; m<multiplicities[base]; ++m)
240 for (
unsigned int local_index = 0;
241 local_index < fes[base]->dofs_per_line;
242 ++local_index, ++total_index)
244 const unsigned int index_in_base
245 = (fes[base]->dofs_per_line*line_number +
247 fes[base]->first_line_index);
249 Assert (index_in_base < fes[base]->dofs_per_cell,
251 retval[total_index] = fes[base]->restriction_is_additive(index_in_base);
257 for (
unsigned int quad_number= 0;
261 for (
unsigned int base=0; base<fes.size(); ++base)
262 for (
unsigned int m=0; m<multiplicities[base]; ++m)
263 for (
unsigned int local_index = 0;
264 local_index < fes[base]->dofs_per_quad;
265 ++local_index, ++total_index)
267 const unsigned int index_in_base
268 = (fes[base]->dofs_per_quad*quad_number +
270 fes[base]->first_quad_index);
272 Assert (index_in_base < fes[base]->dofs_per_cell,
274 retval[total_index] = fes[base]->restriction_is_additive(index_in_base);
280 for (
unsigned int hex_number= 0;
284 for (
unsigned int base=0; base<fes.size(); ++base)
285 for (
unsigned int m=0; m<multiplicities[base]; ++m)
286 for (
unsigned int local_index = 0;
287 local_index < fes[base]->dofs_per_hex;
288 ++local_index, ++total_index)
290 const unsigned int index_in_base
291 = (fes[base]->dofs_per_hex*hex_number +
293 fes[base]->first_hex_index);
295 Assert (index_in_base < fes[base]->dofs_per_cell,
297 retval[total_index] = fes[base]->restriction_is_additive(index_in_base);
314 template <
int dim,
int spacedim>
317 const unsigned int N1,
319 const unsigned int N2,
321 const unsigned int N3,
323 const unsigned int N4,
325 const unsigned int N5)
327 std::vector<const FiniteElement<dim,spacedim>*> fe_list;
328 std::vector<unsigned int> multiplicities;
330 fe_list.push_back (fe1);
331 multiplicities.push_back (N1);
333 fe_list.push_back (fe2);
334 multiplicities.push_back (N2);
336 fe_list.push_back (fe3);
337 multiplicities.push_back (N3);
339 fe_list.push_back (fe4);
340 multiplicities.push_back (N4);
342 fe_list.push_back (fe5);
343 multiplicities.push_back (N5);
349 template <
int dim,
int spacedim>
350 std::vector<ComponentMask>
352 const std::vector<unsigned int> &multiplicities,
353 const bool do_tensor_product)
359 unsigned int n_shape_functions = 0;
360 for (
unsigned int i=0; i<fes.size(); ++i)
361 if (multiplicities[i]>0)
362 n_shape_functions += fes[i]->dofs_per_cell * multiplicities[i];
364 unsigned int n_components = 0;
365 if (do_tensor_product)
367 for (
unsigned int i=0; i<fes.size(); ++i)
368 if (multiplicities[i]>0)
369 n_components += fes[i]->n_components() * multiplicities[i];
373 for (
unsigned int i=0; i<fes.size(); ++i)
374 if (multiplicities[i]>0)
376 n_components = fes[i]->n_components();
380 for (
unsigned int i=0; i<fes.size(); ++i)
381 if (multiplicities[i]>0)
382 Assert (n_components == fes[i]->n_components(),
387 std::vector<std::vector<bool> >
388 retval (n_shape_functions, std::vector<bool> (n_components,
false));
398 unsigned int total_index = 0;
399 for (
unsigned int vertex_number=0;
400 vertex_number<GeometryInfo<dim>::vertices_per_cell;
403 unsigned int comp_start = 0;
404 for (
unsigned int base=0; base<fes.size(); ++base)
405 for (
unsigned int m=0; m<multiplicities[base];
406 ++m, comp_start+=fes[base]->n_components() * do_tensor_product)
407 for (
unsigned int local_index = 0;
408 local_index < fes[base]->dofs_per_vertex;
409 ++local_index, ++total_index)
411 const unsigned int index_in_base
412 = (fes[base]->dofs_per_vertex*vertex_number +
415 Assert (comp_start+fes[base]->n_components() <=
416 retval[total_index].size(),
418 for (
unsigned int c=0; c<fes[base]->n_components(); ++c)
420 Assert (c < fes[base]->get_nonzero_components(index_in_base).size(),
422 retval[total_index][comp_start+c]
423 = fes[base]->get_nonzero_components(index_in_base)[c];
430 for (
unsigned int line_number= 0;
434 unsigned int comp_start = 0;
435 for (
unsigned int base=0; base<fes.size(); ++base)
436 for (
unsigned int m=0; m<multiplicities[base];
437 ++m, comp_start+=fes[base]->n_components() * do_tensor_product)
438 for (
unsigned int local_index = 0;
439 local_index < fes[base]->dofs_per_line;
440 ++local_index, ++total_index)
442 const unsigned int index_in_base
443 = (fes[base]->dofs_per_line*line_number +
445 fes[base]->first_line_index);
447 Assert (comp_start+fes[base]->n_components() <=
448 retval[total_index].size(),
450 for (
unsigned int c=0; c<fes[base]->n_components(); ++c)
452 Assert (c < fes[base]->get_nonzero_components(index_in_base).size(),
454 retval[total_index][comp_start+c]
455 = fes[base]->get_nonzero_components(index_in_base)[c];
462 for (
unsigned int quad_number= 0;
466 unsigned int comp_start = 0;
467 for (
unsigned int base=0; base<fes.size(); ++base)
468 for (
unsigned int m=0; m<multiplicities[base];
469 ++m, comp_start+=fes[base]->n_components() * do_tensor_product)
470 for (
unsigned int local_index = 0;
471 local_index < fes[base]->dofs_per_quad;
472 ++local_index, ++total_index)
474 const unsigned int index_in_base
475 = (fes[base]->dofs_per_quad*quad_number +
477 fes[base]->first_quad_index);
479 Assert (comp_start+fes[base]->n_components() <=
480 retval[total_index].size(),
482 for (
unsigned int c=0; c<fes[base]->n_components(); ++c)
484 Assert (c < fes[base]->get_nonzero_components(index_in_base).size(),
486 retval[total_index][comp_start+c]
487 = fes[base]->get_nonzero_components(index_in_base)[c];
494 for (
unsigned int hex_number= 0;
498 unsigned int comp_start = 0;
499 for (
unsigned int base=0; base<fes.size(); ++base)
500 for (
unsigned int m=0; m<multiplicities[base];
501 ++m, comp_start+=fes[base]->n_components() * do_tensor_product)
502 for (
unsigned int local_index = 0;
503 local_index < fes[base]->dofs_per_hex;
504 ++local_index, ++total_index)
506 const unsigned int index_in_base
507 = (fes[base]->dofs_per_hex*hex_number +
509 fes[base]->first_hex_index);
511 Assert (comp_start+fes[base]->n_components() <=
512 retval[total_index].size(),
514 for (
unsigned int c=0; c<fes[base]->n_components(); ++c)
516 Assert (c < fes[base]->get_nonzero_components(index_in_base).size(),
518 retval[total_index][comp_start+c]
519 = fes[base]->get_nonzero_components(index_in_base)[c];
530 std::vector<ComponentMask> xretval (retval.size());
531 for (
unsigned int i=0; i<retval.size(); ++i)
541 template <
int dim,
int spacedim>
542 std::vector<ComponentMask>
544 const unsigned int N1,
546 const unsigned int N2,
548 const unsigned int N3,
550 const unsigned int N4,
552 const unsigned int N5,
553 const bool do_tensor_product)
555 std::vector<const FiniteElement<dim,spacedim>*> fe_list;
556 std::vector<unsigned int> multiplicities;
558 fe_list.push_back (fe1);
559 multiplicities.push_back (N1);
561 fe_list.push_back (fe2);
562 multiplicities.push_back (N2);
564 fe_list.push_back (fe3);
565 multiplicities.push_back (N3);
567 fe_list.push_back (fe4);
568 multiplicities.push_back (N4);
570 fe_list.push_back (fe5);
571 multiplicities.push_back (N5);
579 template <
int dim,
int spacedim>
581 build_cell_tables(std::vector< std::pair< std::pair< unsigned int, unsigned int >,
unsigned int > > &system_to_base_table,
582 std::vector< std::pair< unsigned int, unsigned int > > &system_to_component_table,
583 std::vector< std::pair< std::pair< unsigned int, unsigned int >,
unsigned int > > &component_to_base_table,
585 const bool do_tensor_product)
587 unsigned int total_index = 0;
589 if (do_tensor_product)
594 for (
unsigned int k=0; k<fe.
base_element(base).n_components(); ++k)
595 component_to_base_table[total_index++]
596 = std::make_pair(std::make_pair(base,k), m);
598 Assert (total_index == component_to_base_table.size(),
605 for (
unsigned int i = 0; i < component_to_base_table.size(); i++)
614 const std::pair<unsigned int, unsigned int>
622 for (
unsigned int vertex_number=0;
623 vertex_number<GeometryInfo<dim>::vertices_per_cell;
626 unsigned int comp_start = 0;
629 ++m, comp_start+=fe.
base_element(base).n_components() * do_tensor_product)
630 for (
unsigned int local_index = 0;
632 ++local_index, ++total_index)
634 const unsigned int index_in_base
635 = (fe.
base_element(base).dofs_per_vertex*vertex_number +
638 system_to_base_table[total_index]
639 = std::make_pair (std::make_pair(base, m), index_in_base);
643 const unsigned int comp_in_base
644 = fe.
base_element(base).system_to_component_index(index_in_base).first;
645 const unsigned int comp
646 = comp_start + comp_in_base;
647 const unsigned int index_in_comp
648 = fe.
base_element(base).system_to_component_index(index_in_base).second;
649 system_to_component_table[total_index]
650 = std::make_pair (comp, index_in_comp);
653 system_to_component_table[total_index] = non_primitive_index;
659 for (
unsigned int line_number= 0;
663 unsigned int comp_start = 0;
666 ++m, comp_start+=fe.
base_element(base).n_components() * do_tensor_product)
667 for (
unsigned int local_index = 0;
669 ++local_index, ++total_index)
671 const unsigned int index_in_base
676 system_to_base_table[total_index]
677 = std::make_pair (std::make_pair(base,m), index_in_base);
681 const unsigned int comp_in_base
682 = fe.
base_element(base).system_to_component_index(index_in_base).first;
683 const unsigned int comp
684 = comp_start + comp_in_base;
685 const unsigned int index_in_comp
686 = fe.
base_element(base).system_to_component_index(index_in_base).second;
687 system_to_component_table[total_index]
688 = std::make_pair (comp, index_in_comp);
691 system_to_component_table[total_index] = non_primitive_index;
697 for (
unsigned int quad_number= 0;
701 unsigned int comp_start = 0;
704 ++m, comp_start += fe.
base_element(base).n_components() * do_tensor_product)
705 for (
unsigned int local_index = 0;
707 ++local_index, ++total_index)
709 const unsigned int index_in_base
714 system_to_base_table[total_index]
715 = std::make_pair (std::make_pair(base,m), index_in_base);
719 const unsigned int comp_in_base
720 = fe.
base_element(base).system_to_component_index(index_in_base).first;
721 const unsigned int comp
722 = comp_start + comp_in_base;
723 const unsigned int index_in_comp
724 = fe.
base_element(base).system_to_component_index(index_in_base).second;
725 system_to_component_table[total_index]
726 = std::make_pair (comp, index_in_comp);
729 system_to_component_table[total_index] = non_primitive_index;
735 for (
unsigned int hex_number= 0;
739 unsigned int comp_start = 0;
742 ++m, comp_start+=fe.
base_element(base).n_components() * do_tensor_product)
743 for (
unsigned int local_index = 0;
745 ++local_index, ++total_index)
747 const unsigned int index_in_base
752 system_to_base_table[total_index]
753 = std::make_pair (std::make_pair(base,m), index_in_base);
757 const unsigned int comp_in_base
758 = fe.
base_element(base).system_to_component_index(index_in_base).first;
759 const unsigned int comp
760 = comp_start + comp_in_base;
761 const unsigned int index_in_comp
762 = fe.
base_element(base).system_to_component_index(index_in_base).second;
763 system_to_component_table[total_index]
764 = std::make_pair (comp, index_in_comp);
767 system_to_component_table[total_index] = non_primitive_index;
774 template <
int dim,
int spacedim>
776 build_face_tables(std::vector< std::pair< std::pair< unsigned int, unsigned int >,
unsigned int > > &face_system_to_base_table,
777 std::vector< std::pair< unsigned int, unsigned int > > &face_system_to_component_table,
779 const bool do_tensor_product)
785 const std::pair<unsigned int, unsigned int>
790 unsigned int total_index = 0;
791 for (
unsigned int vertex_number=0;
792 vertex_number<GeometryInfo<dim>::vertices_per_face;
795 unsigned int comp_start = 0;
798 ++m, comp_start += fe.
base_element(base).n_components() * do_tensor_product)
799 for (
unsigned int local_index = 0;
801 ++local_index, ++total_index)
811 const unsigned int index_in_base
812 = (fe.
base_element(base).dofs_per_vertex*vertex_number +
815 const unsigned int face_index_in_base
816 = (fe.
base_element(base).dofs_per_vertex*vertex_number +
819 face_system_to_base_table[total_index]
820 = std::make_pair (std::make_pair(base,m), face_index_in_base);
824 const unsigned int comp_in_base
825 = fe.
base_element(base).face_system_to_component_index(face_index_in_base).first;
826 const unsigned int comp
827 = comp_start + comp_in_base;
828 const unsigned int face_index_in_comp
829 = fe.
base_element(base).face_system_to_component_index(face_index_in_base).second;
830 face_system_to_component_table[total_index]
831 = std::make_pair (comp, face_index_in_comp);
834 face_system_to_component_table[total_index] = non_primitive_index;
840 for (
unsigned int line_number= 0;
844 unsigned int comp_start = 0;
847 ++m, comp_start += fe.
base_element(base).n_components() * do_tensor_product)
848 for (
unsigned int local_index = 0;
850 ++local_index, ++total_index)
853 const unsigned int index_in_base
858 const unsigned int face_index_in_base
863 face_system_to_base_table[total_index]
864 = std::make_pair (std::make_pair(base,m), face_index_in_base);
868 const unsigned int comp_in_base
869 = fe.
base_element(base).face_system_to_component_index(face_index_in_base).first;
870 const unsigned int comp
871 = comp_start + comp_in_base;
872 const unsigned int face_index_in_comp
873 = fe.
base_element(base).face_system_to_component_index(face_index_in_base).second;
874 face_system_to_component_table[total_index]
875 = std::make_pair (comp, face_index_in_comp);
878 face_system_to_component_table[total_index] = non_primitive_index;
884 for (
unsigned int quad_number= 0;
888 unsigned int comp_start = 0;
891 ++m, comp_start += fe.
base_element(base).n_components() * do_tensor_product)
892 for (
unsigned int local_index = 0;
894 ++local_index, ++total_index)
897 const unsigned int index_in_base
902 const unsigned int face_index_in_base
907 face_system_to_base_table[total_index]
908 = std::make_pair (std::make_pair(base,m), face_index_in_base);
912 const unsigned int comp_in_base
913 = fe.
base_element(base).face_system_to_component_index(face_index_in_base).first;
914 const unsigned int comp
915 = comp_start + comp_in_base;
916 const unsigned int face_index_in_comp
917 = fe.
base_element(base).face_system_to_component_index(face_index_in_base).second;
918 face_system_to_component_table[total_index]
919 = std::make_pair (comp, face_index_in_comp);
922 face_system_to_component_table[total_index] = non_primitive_index;
926 Assert (total_index == face_system_to_component_table.size(),
928 Assert (total_index == face_system_to_base_table.size(),
1064 fill_no_codim_fe_names (std::map<std::string,std_cxx11::shared_ptr<const Subscriptor> > &result)
1066 typedef std_cxx11::shared_ptr<const Subscriptor> FEFactoryPointer;
1068 result[
"FE_Q_Hierarchical"]
1072 result[
"FE_Bernstein"]
1078 result[
"FE_DGNedelec"]
1080 result[
"FE_DGRaviartThomas"]
1082 result[
"FE_RaviartThomas"]
1084 result[
"FE_RaviartThomasNodal"]
1086 result[
"FE_Nedelec"]
1088 result[
"FE_DGPNonparametric"]
1092 result[
"FE_DGPMonomial"]
1096 result[
"FE_DGQArbitraryNodes"]
1098 result[
"FE_DGQLegendre"]
1100 result[
"FE_DGQHermite"]
1110 result[
"FE_Q_Bubbles"]
1112 result[
"FE_Q_iso_Q1"]
1114 result[
"FE_Nothing"]
1116 result[
"FE_RannacherTurek"]
1125 template <
int dim,
int spacedim>
1127 fill_codim_fe_names (std::map<std::string,std_cxx11::shared_ptr<const Subscriptor> > &result)
1129 typedef std_cxx11::shared_ptr<const Subscriptor> FEFactoryPointer;
1131 result[
"FE_Bernstein"]
1137 result[
"FE_Nothing"]
1139 result[
"FE_DGQArbitraryNodes"]
1141 result[
"FE_DGQLegendre"]
1143 result[
"FE_DGQHermite"]
1145 result[
"FE_Q_Bubbles"]
1149 result[
"FE_Q_iso_Q1"]
1153 result[
"FE_Bernstein"]
1161 std::vector<std::vector<
1162 std::map<std::string,
1163 std_cxx11::shared_ptr<const Subscriptor> > > >
1166 std::vector<std::vector<
1167 std::map<std::string,
1168 std_cxx11::shared_ptr<const Subscriptor> > > >
1171 for (
unsigned int d=0;
d<4; ++
d)
1172 result[d].resize(4);
1174 fill_no_codim_fe_names<1> (result[1][1]);
1175 fill_no_codim_fe_names<2> (result[2][2]);
1176 fill_no_codim_fe_names<3> (result[3][3]);
1178 fill_codim_fe_names<1,2> (result[1][2]);
1179 fill_codim_fe_names<1,3> (result[1][3]);
1180 fill_codim_fe_names<2,3> (result[2][3]);
1218 std::vector<std::vector<
1219 std::map<std::string,
1220 std_cxx11::shared_ptr<const Subscriptor> > > >
1221 fe_name_map = fill_default_map();
1244 template <
int dim,
int spacedim>
1255 template <
int dim,
typename number,
int spacedim>
1262 interpolation_matrix.
n());
1264 interpolation_matrix = tmp;
1276 template <
int dim,
int spacedim>
1278 unsigned int match_dimension (
const std::string &name,
1279 const unsigned int position)
1281 if (position >= name.size())
1284 if ((position+5 < name.size())
1286 (name[position] ==
'<')
1288 (name[position+1] ==
'd')
1290 (name[position+2] ==
'i')
1292 (name[position+3] ==
'm')
1294 (name[position+4] ==
'>'))
1298 const char dim_char =
'0'+dim;
1300 if ((position+3 < name.size())
1302 (name[position] ==
'<')
1304 (name[position+1] == dim_char)
1306 (name[position+2] ==
'>'))
1318 template <
int dim,
int spacedim>
1324 template<
int dim,
int spacedim>
1327 std::vector<unsigned int> &renumbering,
1328 std::vector<std::vector<unsigned int> > &comp_start)
1337 for (
unsigned int i=0; i<comp_start.size(); ++i)
1340 const unsigned int increment
1343 for (
unsigned int j=0; j<comp_start[i].size(); ++j)
1345 comp_start[i][j] = k;
1357 std::pair<std::pair<unsigned int, unsigned int>,
unsigned int>
1359 renumbering[i] = comp_start[indices.first.first][indices.first.second]
1366 template<
int dim,
int spacedim>
1369 std::vector<types::global_dof_index> &renumbering,
1370 std::vector<types::global_dof_index> &block_data,
1371 bool return_start_indices)
1381 unsigned int count=0;
1385 block_data[count++] = (return_start_indices)
1392 std::vector<types::global_dof_index> start_indices(block_data.size());
1394 for (
unsigned int i=0; i<block_data.size(); ++i)
1395 if (return_start_indices)
1396 start_indices[i] = block_data[i];
1399 start_indices[i] = k;
1405 std::pair<unsigned int, types::global_dof_index>
1407 renumbering[i] = start_indices[indices.first]
1414 template <
int dim,
typename number,
int spacedim>
1424 interpolation_matrix.
n(),
1431 bool fe_implements_interpolation =
true;
1434 gim_forwarder (fe1, fe2, interpolation_matrix);
1439 fe_implements_interpolation =
false;
1441 if (fe_implements_interpolation ==
true)
1455 const std::vector<Point<dim> > &
1460 typename FEL::ExcFEHasNoSupportPoints());
1469 interpolation_matrix(i,j) = fe1.
shape_value (j,fe2_support_points[i]);
1471 interpolation_matrix(i,j)=0.;
1478 template <
int dim,
typename number,
int spacedim>
1488 interpolation_matrix.
n(),
1499 second_matrix.
mmult(interpolation_matrix, first_matrix);
1504 template <
int dim,
typename number,
int spacedim>
1514 difference_matrix.
n(),
1522 difference_matrix(i,i) = 1.;
1525 difference_matrix.
add (-1, interpolation_matrix);
1530 template <
int dim,
typename number,
int spacedim>
1570 for (
unsigned int k=0; k<quadrature.
size(); ++k)
1572 const double w = val2.
JxW(k);
1573 for (
unsigned int i=0; i<n2; ++i)
1576 for (
unsigned int j=0; j<n2; ++j)
1593 for (
unsigned int j=0; j<n1; ++j)
1596 for (
unsigned int i=0; i<n2; ++i)
1597 for (
unsigned int k=0; k<quadrature.
size(); ++k)
1599 const double w = val2.
JxW(k);
1607 for (
unsigned int i=0; i<n2; ++i)
1614 template<
int dim,
int spacedim>
1630 std::vector<Vector<double> >
1635 std::vector<double> nodal_values(n_dofs);
1641 for (
unsigned int i=0; i<n_dofs; ++i)
1645 for (
unsigned int k=0; k<points.size(); ++k)
1646 for (
unsigned int d=0; d<dim; ++d)
1656 for (
unsigned int j=0; j<n_dofs; ++j)
1658 N(j,i) = nodal_values[j];
1668 template<
int dim,
int spacedim>
1713 template<
int dim,
typename number,
int spacedim>
1715 compute_embedding_for_shape_function (
1716 const unsigned int i,
1721 const double threshold)
1742 for (
unsigned int k = 0; k < nq; ++k)
1743 v_coarse (k * nd + d) = phi_i[k];
1747 for (
unsigned int d = 0;
d < nd; ++
d)
1748 for (
unsigned int k = 0; k < nq; ++k)
1765 for (
unsigned int j = 0; j < n; ++j)
1766 this_matrix(j, i) = v_fine(j);
1771 template<
int dim,
typename number,
int spacedim>
1773 compute_embedding_matrices_for_refinement_case (
1776 const unsigned int ref_case,
1777 const double threshold)
1781 for (
unsigned int i = 0; i < nc; ++i)
1794 const unsigned int degree = fe.
degree;
1796 const unsigned int nq = q_fine.size();
1820 for (
unsigned int j = 0; j < n; ++j)
1821 for (
unsigned int d = 0;
d < nd; ++
d)
1822 for (
unsigned int k = 0; k < nq; ++k)
1823 A (k * nd + d, j) = fine.shape_value_component (j, k, d);
1826 unsigned int cell_number = 0;
1832 ++fine_cell, ++cell_number)
1834 fine.reinit (fine_cell);
1840 const std::vector<Point<spacedim> > &q_points_fine = fine.get_quadrature_points();
1841 std::vector<Point<dim> > q_points_coarse(q_points_fine.size());
1842 for (
unsigned int i=0; i<q_points_fine.size(); ++i)
1843 for (
unsigned int j=0; j<dim; ++j)
1844 q_points_coarse[i](j) = q_points_fine[i](j);
1846 fine.get_JxW_values ());
1863 for (
unsigned int i = 0; i < n; ++i)
1866 Threads::new_task (&compute_embedding_for_shape_function<dim, number, spacedim>,
1867 i, fe, coarse, H, this_matrix, threshold);
1873 for (
unsigned int i = 0; i < n; ++i)
1875 compute_embedding_for_shape_function<dim, number, spacedim>
1876 (i, fe, coarse, H, this_matrix, threshold);
1882 for (
unsigned int i = 0; i < this_matrix.
m (); ++i)
1883 for (
unsigned int j = 0; j < this_matrix.
n (); ++j)
1884 if (std::fabs (this_matrix (i, j)) < 1
e-12)
1885 this_matrix (i, j) = 0.;
1895 template <
int dim,
typename number,
int spacedim>
1899 const bool isotropic_only,
1900 const double threshold)
1905 unsigned int ref_case = (isotropic_only)
1909 for (; ref_case <= RefinementCase<dim>::isotropic_refinement; ++ref_case)
1910 task_group +=
Threads::new_task (&compute_embedding_matrices_for_refinement_case<dim, number, spacedim>,
1911 fe, matrices[ref_case-1], ref_case, threshold);
1918 template <
int dim,
typename number,
int spacedim>
1922 const unsigned int face_coarse,
1923 const unsigned int face_fine,
1924 const double threshold)
1932 const unsigned int degree = fe.
degree;
1937 for (
unsigned int i=0; i<nc; ++i)
1948 std::vector<unsigned int> face_c_dofs(n);
1949 std::vector<unsigned int> face_f_dofs(n);
1951 unsigned int face_dof=0;
1952 for (
unsigned int i=0; i<GeometryInfo<dim>::vertices_per_face; ++i)
1960 face_c_dofs[face_dof] = offset_c + j;
1961 face_f_dofs[face_dof] = offset_f + j;
1965 for (
unsigned int i=1; i<=GeometryInfo<dim>::lines_per_face; ++i)
1975 face_c_dofs[face_dof] = offset_c + j;
1976 face_f_dofs[face_dof] = offset_f + j;
1980 for (
unsigned int i=1; i<=GeometryInfo<dim>::quads_per_face; ++i)
1990 face_c_dofs[face_dof] = offset_c + j;
1991 face_f_dofs[face_dof] = offset_f + j;
2013 QGauss<dim-1> q_gauss(degree+1);
2015 const unsigned int nq = q_fine.
size();
2035 for (
unsigned int j=0; j<n; ++j)
2036 for (
unsigned int k=0; k<nq; ++k)
2038 for (
unsigned int d=0; d<nd; ++d)
2045 for (
unsigned int d=1; d<dim; ++d)
2056 for (
unsigned int cell_number = 0; cell_number < GeometryInfo<dim>::max_children_per_face;
2065 tria.
begin(0)->refinement_case(), face_coarse, cell_number));
2073 for (
unsigned int i=0; i<n; ++i)
2081 for (
unsigned int k=0; k<nq; ++k)
2083 for (
unsigned int d=0; d<nd; ++d)
2090 for (
unsigned int d=1; d<dim; ++d)
2107 for (
unsigned int j=0; j<n; ++j)
2108 this_matrix(j,i) = v_fine(j);
2112 for (
unsigned int i=0; i<this_matrix.
m(); ++i)
2113 for (
unsigned int j=0; j<this_matrix.
n(); ++j)
2114 if (std::fabs(this_matrix(i,j)) < 1e-12)
2115 this_matrix(i,j) = 0.;
2121 template <
int dim,
typename number,
int spacedim>
2125 const bool isotropic_only)
2129 const unsigned int degree = fe.
degree;
2134 const unsigned int nq = q_fine.
size();
2148 coarse.
reinit (coarse_cell);
2151 for (
unsigned int i=0; i<n; ++i)
2152 for (
unsigned int j=0; j<n; ++j)
2155 const double *coarse_i = &coarse.
shape_value(i,0);
2156 const double *coarse_j = &coarse.
shape_value(j,0);
2158 for (
unsigned int k=0; k<nq; ++k)
2159 mass_ij += JxW[k] * coarse_i[k] * coarse_j[k];
2160 mass(i,j) = mass_ij;
2165 for (
unsigned int d=0; d<nd; ++d)
2166 for (
unsigned int k=0; k<nq; ++k)
2169 mass(i,j) = mass_ij;
2178 unsigned int ref_case = (isotropic_only)
2181 for (; ref_case <= RefinementCase<dim>::isotropic_refinement; ++ref_case)
2186 for (
unsigned int i=0; i<nc; ++i)
2188 Assert(matrices[ref_case-1][i].n() == n,
2190 Assert(matrices[ref_case-1][i].m() == n,
2211 for (
unsigned int cell_number=0; cell_number<nc; ++cell_number)
2219 fine.
reinit(coarse_cell->child(cell_number));
2221 std::vector<Point<dim> > q_points_coarse(q_points_fine.size());
2222 for (
unsigned int q=0; q<q_points_fine.size(); ++q)
2223 for (
unsigned int j=0; j<dim; ++j)
2224 q_points_coarse[q](j) = q_points_fine[q](j);
2228 coarse.reinit(coarse_cell);
2242 const double *coarse_i = &coarse.shape_value(i,0);
2246 for (
unsigned int k=0; k<nq; ++k)
2247 update += JxW[k] * coarse_i[k] * fine_j[k];
2253 for (
unsigned int d=0; d<nd; ++d)
2254 for (
unsigned int k=0; k<nq; ++k)
2255 update += JxW[k] * coarse.shape_value_component(i,k,d)
2264 mass.
vmult (v_coarse, v_fine);
2266 this_matrix(i,j) = v_coarse(i);
2271 for (
unsigned int i=0; i<this_matrix.
m(); ++i)
2272 for (
unsigned int j=0; j<this_matrix.
n(); ++j)
2273 if (std::fabs(this_matrix(i,j)) < 1e-12)
2274 this_matrix(i,j) = 0.;
2281 template <
int dim,
int spacedim>
2288 std::string name = parameter_name;
2289 unsigned int name_end =
2290 name.find_first_not_of(std::string(
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"));
2291 if (name_end < name.size())
2292 name.erase(name_end);
2300 Assert(fe_name_map[dim][spacedim].find(name) == fe_name_map[dim][spacedim].end(),
2301 ExcMessage(
"Cannot change existing element in finite element name list"));
2305 fe_name_map[dim][spacedim][name] =
2306 std_cxx11::shared_ptr<const Subscriptor> (factory);
2318 template <
int dim,
int spacedim>
2320 get_fe_by_name_ext (std::string &name,
2321 const std::map<std::string,
2322 std_cxx11::shared_ptr<const Subscriptor> >
2329 unsigned int name_end =
2330 name.find_first_not_of(std::string(
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"));
2331 const std::string name_part(name, 0, name_end);
2332 name.erase(0, name_part.size());
2340 if (name_part ==
"FESystem")
2351 std::vector<const FiniteElement<dim,spacedim>*> base_fes;
2352 std::vector<unsigned int> base_multiplicities;
2357 if (name.size() == 0 || name[0] !=
'[')
2358 throw (std::string(
"Invalid first character in ") + name);
2367 base_fes.push_back (get_fe_by_name_ext<dim,spacedim> (name,
2380 const std::pair<int,unsigned int> tmp
2382 name.erase(0, tmp.second);
2385 base_multiplicities.push_back (tmp.first);
2391 base_multiplicities.push_back (1);
2404 while (name[0] ==
'-');
2411 if (name.size() == 0 || name[0] !=
']')
2412 throw (std::string(
"Invalid first character in ") + name);
2415 Assert ((base_fes.size() == base_multiplicities.size())
2417 (base_fes.size() > 0),
2434 for (
unsigned int i=0; i<base_fes.size(); ++i)
2441 return system_element;
2451 for (
unsigned int i=0; i<base_fes.size(); ++i)
2466 else if (name_part ==
"FE_Nothing")
2477 const Subscriptor *ptr = fe_name_map.find(name_part)->second.get();
2478 const FEFactoryBase<dim,spacedim> *fef=
dynamic_cast<const FEFactoryBase<dim,spacedim>*
>(ptr);
2486 AssertThrow (fe_name_map.find(name_part) != fe_name_map.end(),
2492 if (name.size() == 0 || name[0] !=
'(')
2493 throw (std::string(
"Invalid first character in ") + name);
2497 const std::pair<int,unsigned int> tmp
2499 name.erase(0, tmp.second+1);
2500 const Subscriptor *ptr = fe_name_map.find(name_part)->second.get();
2501 const FEFactoryBase<dim,spacedim> *fef=
dynamic_cast<const FEFactoryBase<dim,spacedim>*
>(ptr);
2502 return fef->get(tmp.first);
2506 unsigned int position = name.find(
'(');
2507 const std::string quadrature_name(name, 0, position);
2508 name.erase(0,position+1);
2509 if (quadrature_name.compare(
"QGaussLobatto") == 0)
2511 const std::pair<int,unsigned int> tmp
2514 name.erase(0, tmp.second+2);
2515 const Subscriptor *ptr = fe_name_map.find(name_part)->second.get();
2516 const FEFactoryBase<dim,spacedim> *fef=
dynamic_cast<const FEFactoryBase<dim,spacedim>*
>(ptr);
2519 else if (quadrature_name.compare(
"QGauss") == 0)
2521 const std::pair<int,unsigned int> tmp
2524 name.erase(0, tmp.second+2);
2525 const Subscriptor *ptr = fe_name_map.find(name_part)->second.get();
2526 const FEFactoryBase<dim,spacedim> *fef=
dynamic_cast<const FEFactoryBase<dim,spacedim>*
>(ptr);
2529 else if (quadrature_name.compare(
"QIterated") == 0)
2532 position = name.find(
'(');
2533 const std::string subquadrature_name(name, 0, position);
2534 AssertThrow(subquadrature_name.compare(
"QTrapez") == 0,
2535 ExcNotImplemented(
"Could not detect quadrature of name " + subquadrature_name));
2537 name.erase(0,position+3);
2538 const std::pair<int,unsigned int> tmp
2541 name.erase(0, tmp.second+2);
2542 const Subscriptor *ptr = fe_name_map.find(name_part)->second.get();
2543 const FEFactoryBase<dim,spacedim> *fef=
dynamic_cast<const FEFactoryBase<dim,spacedim>*
>(ptr);
2568 template <
int dim,
int spacedim>
2571 return get_fe_by_name_ext<dim,spacedim> (name, fe_name_map[dim][spacedim]);
2582 return get_fe_by_name<dim,dim> (parameter_name);
2587 template <
int dim,
int spacedim>
2592 std::size_t index = 1;
2595 while (2 < name.size() && index < name.size() - 1)
2597 if (name[index] ==
' ' &&
2598 (!(std::isalnum(name[index - 1]) || name[index - 1] ==
'_') ||
2599 !(std::isalnum(name[index + 1]) || name[index + 1] ==
'_')))
2601 name.erase(index, 1);
2612 for (
unsigned int pos1 = name.find(
'<');
2614 pos1 = name.find(
'<'))
2617 const unsigned int pos2 = name.find(
'>');
2624 const char dimchar =
'0' + dim;
2626 if (name.at(pos1+1) !=
'd')
2627 Assert (name.at(pos1+1) == dimchar,
2637 name.erase(pos1, pos2-pos1+1);
2642 for (
unsigned int pos = name.find(
"^dim");
2644 pos = name.find(
"^dim"))
2645 name.erase(pos+2, 2);
2649 for (
unsigned int pos = name.find(
"^d");
2651 pos = name.find(
"^d"))
2652 name.at(pos+1) =
'0' + dim;
2662 + std::string(
" extra characters after " 2666 catch (
const std::string &errline)
2669 + std::string(
" at ")
2677 template <
int dim,
int spacedim>
2693 for (
unsigned int q=0; q<lhs_quadrature.
size(); ++q)
2696 lhs_quadrature.
weight(q);
2699 for (
unsigned int q=0; q<rhs_quadrature.
size(); ++q)
2701 rhs_quadrature.
weight(q);
2709 M_inverse.
mmult (X, Q);
2717 template <
int dim,
int spacedim>
2728 for (
unsigned int q=0; q<quadrature.
size(); ++q)
2745 Assert(projection_matrix.n_cols() == vector_of_tensors_at_qp.
size(),
2747 vector_of_tensors_at_qp.
size()));
2751 Assert(projection_matrix.n_rows() == vector_of_tensors_at_nodes.
size(),
2753 vector_of_tensors_at_nodes.
size()));
2756 const unsigned int n_support_points = projection_matrix.n_rows();
2758 const unsigned int n_quad_points = projection_matrix.n_cols();
2765 for (
unsigned int ii = 0; ii < dim; ++ii)
2768 component_at_qp = 0;
2776 for (
unsigned int q = 0; q < n_quad_points; ++q)
2778 component_at_qp(q) = vector_of_tensors_at_qp[q][ii];
2783 projection_matrix.
vmult(component_at_node, component_at_qp);
2787 for (
unsigned int nn =0; nn <n_support_points; ++nn)
2789 vector_of_tensors_at_nodes[nn][ii] = component_at_node(nn);
2806 Assert(projection_matrix.n_cols() == vector_of_tensors_at_qp.
size(),
2808 vector_of_tensors_at_qp.
size()));
2812 Assert(projection_matrix.n_rows() == vector_of_tensors_at_nodes.
size(),
2814 vector_of_tensors_at_nodes.
size()));
2817 const unsigned int n_support_points = projection_matrix.n_rows();
2819 const unsigned int n_quad_points = projection_matrix.n_cols();
2822 const unsigned int n_independent_components =
2831 for (
unsigned int ii = 0; ii < n_independent_components; ++ii)
2834 component_at_qp = 0;
2838 const unsigned int row = row_column_index[0];
2839 const unsigned int column = row_column_index[1];
2847 for (
unsigned int q = 0; q < n_quad_points; ++q)
2849 component_at_qp(q) = (vector_of_tensors_at_qp[q])[row][column];
2854 projection_matrix.
vmult(component_at_node, component_at_qp);
2857 for (
unsigned int nn =0; nn <n_support_points; ++nn)
2859 (vector_of_tensors_at_nodes[nn])[row][column] = component_at_node(nn);
2866 template <
int dim,
int spacedim>
2872 const unsigned int face,
2889 fe_face_values.
reinit (cell, face);
2893 for (
unsigned int q=0; q<lhs_quadrature.
size(); ++q)
2896 lhs_quadrature.
weight(q);
2899 M(i,i) = (M(i,i) == 0 ? 1 : M(i,i));
2905 fe_face_values.
reinit (cell, face);
2908 for (
unsigned int q=0; q<rhs_quadrature.
size(); ++q)
2910 rhs_quadrature.
weight(q);
2918 M_inverse.
mmult (X, Q);
2932 const unsigned int n = degree+1;
2934 unsigned int dofs_per_cell = n;
2935 for (
unsigned int i=1; i<dim; ++i)
2942 const unsigned int dofs_per_line = degree - 1;
2955 h2l[1] = dofs_per_cell-1;
2956 for (
unsigned int i=2; i<dofs_per_cell; ++i)
2964 unsigned int next_index = 0;
2966 h2l[next_index++] = 0;
2967 h2l[next_index++] = n-1;
2968 h2l[next_index++] = n*(n-1);
2969 h2l[next_index++] = n*n-1;
2972 for (
unsigned int i=0; i<dofs_per_line; ++i)
2973 h2l[next_index++] = (1+i)*n;
2976 for (
unsigned int i=0; i<dofs_per_line; ++i)
2977 h2l[next_index++] = (2+i)*n-1;
2980 for (
unsigned int i=0; i<dofs_per_line; ++i)
2981 h2l[next_index++] = 1+i;
2984 for (
unsigned int i=0; i<dofs_per_line; ++i)
2985 h2l[next_index++] = n*(n-1)+i+1;
2988 for (
unsigned int i=0; i<dofs_per_line; ++i)
2989 for (
unsigned int j=0; j<dofs_per_line; ++j)
2990 h2l[next_index++] = n*(i+1)+j+1;
2999 unsigned int next_index = 0;
3001 h2l[next_index++] = 0;
3002 h2l[next_index++] = ( 1)*degree;
3003 h2l[next_index++] = ( n )*degree;
3004 h2l[next_index++] = ( n+1)*degree;
3005 h2l[next_index++] = (n*n )*degree;
3006 h2l[next_index++] = (n*n +1)*degree;
3007 h2l[next_index++] = (n*n+n )*degree;
3008 h2l[next_index++] = (n*n+n+1)*degree;
3011 for (
unsigned int i=0; i<dofs_per_line; ++i)
3012 h2l[next_index++] = (i+1)*n;
3014 for (
unsigned int i=0; i<dofs_per_line; ++i)
3015 h2l[next_index++] = n-1+(i+1)*n;
3017 for (
unsigned int i=0; i<dofs_per_line; ++i)
3018 h2l[next_index++] = 1+i;
3020 for (
unsigned int i=0; i<dofs_per_line; ++i)
3021 h2l[next_index++] = 1+i+n*(n-1);
3024 for (
unsigned int i=0; i<dofs_per_line; ++i)
3025 h2l[next_index++] = (n-1)*n*n+(i+1)*n;
3027 for (
unsigned int i=0; i<dofs_per_line; ++i)
3028 h2l[next_index++] = (n-1)*(n*n+1)+(i+1)*n;
3030 for (
unsigned int i=0; i<dofs_per_line; ++i)
3031 h2l[next_index++] = n*n*(n-1)+i+1;
3033 for (
unsigned int i=0; i<dofs_per_line; ++i)
3034 h2l[next_index++] = n*n*(n-1)+i+1+n*(n-1);
3037 for (
unsigned int i=0; i<dofs_per_line; ++i)
3038 h2l[next_index++] = (i+1)*n*n;
3040 for (
unsigned int i=0; i<dofs_per_line; ++i)
3041 h2l[next_index++] = n-1+(i+1)*n*n;
3043 for (
unsigned int i=0; i<dofs_per_line; ++i)
3044 h2l[next_index++] = (i+1)*n*n+n*(n-1);
3046 for (
unsigned int i=0; i<dofs_per_line; ++i)
3047 h2l[next_index++] = n-1+(i+1)*n*n+n*(n-1);
3052 for (
unsigned int i=0; i<dofs_per_line; ++i)
3053 for (
unsigned int j=0; j<dofs_per_line; ++j)
3054 h2l[next_index++] = (i+1)*n*n+n*(j+1);
3056 for (
unsigned int i=0; i<dofs_per_line; ++i)
3057 for (
unsigned int j=0; j<dofs_per_line; ++j)
3058 h2l[next_index++] = (i+1)*n*n+n-1+n*(j+1);
3060 for (
unsigned int i=0; i<dofs_per_line; ++i)
3061 for (
unsigned int j=0; j<dofs_per_line; ++j)
3062 h2l[next_index++] = (j+1)*n*n+i+1;
3064 for (
unsigned int i=0; i<dofs_per_line; ++i)
3065 for (
unsigned int j=0; j<dofs_per_line; ++j)
3066 h2l[next_index++] = (j+1)*n*n+n*(n-1)+i+1;
3068 for (
unsigned int i=0; i<dofs_per_line; ++i)
3069 for (
unsigned int j=0; j<dofs_per_line; ++j)
3070 h2l[next_index++] = n*(i+1)+j+1;
3072 for (
unsigned int i=0; i<dofs_per_line; ++i)
3073 for (
unsigned int j=0; j<dofs_per_line; ++j)
3074 h2l[next_index++] = (n-1)*n*n+n*(i+1)+j+1;
3077 for (
unsigned int i=0; i<dofs_per_line; ++i)
3078 for (
unsigned int j=0; j<dofs_per_line; ++j)
3079 for (
unsigned int k=0; k<dofs_per_line; ++k)
3080 h2l[next_index++] = n*n*(i+1)+n*(j+1)+k+1;
3097 std::vector<unsigned int> &h2l)
3101 hierarchic_to_lexicographic_numbering<dim> (fe.
dofs_per_line+1, h2l);
3107 std::vector<unsigned int>
3112 hierarchic_to_lexicographic_numbering<dim> (fe.
dofs_per_line+1, h2l);
3121 std::vector<unsigned int> &l2h)
3129 std::vector<unsigned int>
3140 #include "fe_tools.inst" 3145 DEAL_II_NAMESPACE_CLOSE
Transformed quadrature weights.
static const unsigned int invalid_unsigned_int
static ::ExceptionBase & ExcLeastSquaresError(double arg1)
#define AssertDimension(dim1, dim2)
void vmult(Vector< number2 > &w, const Vector< number2 > &v, const bool adding=false) const
virtual double shape_value_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
virtual void get_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
const std::vector< Point< dim > > & get_generalized_support_points() const
static unsigned int face_to_cell_vertices(const unsigned int face, const unsigned int vertex, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false)
std::string trim(const std::string &input)
const unsigned int dofs_per_quad
static TableIndices< rank > unrolled_to_component_indices(const unsigned int i)
std::pair< int, unsigned int > get_integer_at_position(const std::string &name, const unsigned int position)
const unsigned int degree
const Point< dim > & point(const unsigned int i) const
bool has_generalized_support_points() const
ActiveSelector::active_cell_iterator active_cell_iterator
active_cell_iterator begin_active(const unsigned int level=0) const
Transformed quadrature points.
static ::ExceptionBase & ExcNotInitialized()
#define AssertThrow(cond, exc)
bool is_primitive() const
const unsigned int dofs_per_line
cell_iterator begin(const unsigned int level=0) const
virtual void convert_generalized_support_point_values_to_nodal_values(const std::vector< Vector< double > > &support_point_values, std::vector< double > &nodal_values) const
double shape_value_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const
static ::ExceptionBase & ExcFENotPrimitive()
bool is_finite(const double x)
unsigned int n_blocks() const
cell_iterator end() const
const std::vector< Point< spacedim > > & get_quadrature_points() const
virtual void execute_coarsening_and_refinement()
static ::ExceptionBase & ExcMatrixDimensionMismatch(int arg1, int arg2, int arg3, int arg4)
static ::ExceptionBase & ExcMessage(std::string arg1)
static unsigned int n_children(const RefinementCase< dim > &refinement_case)
const unsigned int first_quad_index
const double & shape_value(const unsigned int function_no, const unsigned int point_no) const
static ::ExceptionBase & ExcNotGreaterThan(int arg1, int arg2)
void invert(const FullMatrix< number2 > &M)
unsigned int global_dof_index
static unsigned int face_to_cell_lines(const unsigned int face, const unsigned int line, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false)
void reinit(const TableIndices< N > &new_size, const bool omit_default_initialization=false)
#define Assert(cond, exc)
unsigned int element_multiplicity(const unsigned int index) const
static void project_to_subface(const SubQuadrature &quadrature, const unsigned int face_no, const unsigned int subface_no, std::vector< Point< dim > > &q_points, const RefinementCase< dim-1 > &ref_case=RefinementCase< dim-1 >::isotropic_refinement)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
void reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access > > &cell, const unsigned int face_no)
virtual const FiniteElement< dim, spacedim > & base_element(const unsigned int index) const
std::vector< unsigned int > invert_permutation(const std::vector< unsigned int > &permutation)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
unsigned int size() const
const unsigned int dofs_per_cell
static ::ExceptionBase & ExcInvalidFEDimension(char arg1, int arg2)
static ::ExceptionBase & ExcInvalidFE()
const unsigned int n_quadrature_points
void mmult(FullMatrix< number2 > &C, const FullMatrix< number2 > &B, const bool adding=false) const
const std::vector< Point< dim > > & get_unit_support_points() const
std::pair< unsigned int, unsigned int > system_to_component_index(const unsigned int index) const
virtual double shape_value(const unsigned int i, const Point< dim > &p) const
unsigned int n_components() const
std::pair< std::pair< unsigned int, unsigned int >, unsigned int > system_to_base_index(const unsigned int index) const
const std::vector< double > & get_JxW_values() const
std::pair< unsigned int, types::global_dof_index > system_to_block_index(const unsigned int component) const
double JxW(const unsigned int quadrature_point) const
static void project_to_face(const SubQuadrature &quadrature, const unsigned int face_no, std::vector< Point< dim > > &q_points)
bool conforms(const Conformity) const
void add(const number a, const FullMatrix< number2 > &A)
const Conformity conforming_space
static ::ExceptionBase & ExcInvalidFEName(std::string arg1)
void hyper_cube(Triangulation< dim, spacedim > &tria, const double left=0., const double right=1., const bool colorize=false)
void push_back(const size_type size)
const unsigned int dofs_per_face
const unsigned int first_line_index
double least_squares(Vector< number2 > &dst, const Vector< number2 > &src) const
void refine_global(const unsigned int times=1)
static ::ExceptionBase & ExcNotImplemented()
const unsigned int dofs_per_vertex
unsigned int size(const unsigned int i) const
unsigned int n_base_elements() const
void reinit(const TriaIterator< DoFCellAccessor< DoFHandlerType< dim, spacedim >, level_dof_access > > &cell)
double weight(const unsigned int i) const
Task< RT > new_task(const std_cxx11::function< RT()> &function)
unsigned int tensor_degree() const
static ::ExceptionBase & ExcInternalError()