Rheolef  7.2
an efficient C++ finite element environment
basis.h
Go to the documentation of this file.
1 #ifndef _RHEO_BASIS_H
2 #define _RHEO_BASIS_H
3 //
4 // This file is part of Rheolef.
5 //
6 // Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
7 //
8 // Rheolef is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // Rheolef is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with Rheolef; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 //
22 // =========================================================================
23 // AUTHOR: Pierre.Saramito@imag.fr
24 // DATE: 7 january 2004, update 11 september 2017
25 
26 namespace rheolef {
191 } // namespace rheolef
192 
193 #include "rheolef/reference_element.h"
194 #include "rheolef/reference_element_face_transformation.h"
195 #include "rheolef/point.h"
196 #include "rheolef/tensor.h"
197 #include "rheolef/persistent_table.h"
198 #include "rheolef/space_constant.h"
199 #include "rheolef/basis_raw.h"
200 #include "rheolef/basis_option.h"
201 #include "rheolef/piola_fem.h"
202 #include <unordered_map>
203 
204 namespace rheolef {
205 
206 template<class T> class basis_basic; // forward declaration
207 
208 template<class T>
209 class basis_rep {
210 public:
211 
212 // typedefs:
213 
215  typedef T value_type;
217 
218 // allocators:
219 
220  basis_rep (const basis_option& sopt);
221  virtual ~basis_rep();
222 
223 // numbering accessors:
224 
225  virtual size_type degree() const = 0;
226  virtual size_type family_index() const { return degree(); }
227  virtual std::string family_name() const = 0;
228  std::string name() const { return _name; }
229 
230  virtual valued_type valued_tag() const { return space_constant::scalar; }
231  virtual bool is_nodal() const = 0;
232  virtual bool have_index_parameter() const { return true; }
233  virtual bool have_continuous_feature() const { return true; }
234  virtual bool is_hierarchical() const { return false; }
235  virtual size_type size() const { return 1; }
236  virtual const class basis_basic<T>& operator[] (size_type i_comp) const;
237  virtual bool have_compact_support_inside_element() const { return ! option().is_continuous(); }
238  const basis_option& option() const { return _sopt; }
239  const std::string& valued() const { return space_constant::valued_name (valued_tag()); }
240  bool is_continuous() const { return option().is_continuous(); }
241  bool is_discontinuous() const { return ! is_continuous(); }
242 
243  // accessors to ndof and nnod
245  return _first_idof_by_dimension [hat_K.variant()][hat_K.dimension()+1];
246  }
248  return _first_inod_by_dimension [hat_K.variant()][hat_K.dimension()+1];
249  }
250  // accessors to subgeo ndof & nnod by dimension (not available for basis_trace)
251  // numbering: dofs & nodes are organized by variant and dimension=0..3 of subgeos, for each hat_K
252  // in the discontinous case, this distinction remains in xxx_internal
254  return _ndof_on_subgeo [map_dim][subgeo_variant];
255  }
257  return _nnod_on_subgeo [map_dim][subgeo_variant];
258  }
260  return _first_idof_by_dimension [hat_K.variant()][dim];
261  }
263  return _first_inod_by_dimension [hat_K.variant()][dim];
264  }
265  // internal accessors to subgeo ndof & nnod by dimension (not available for basis_trace)
266  // differs only for discontinuous elements: internals conserve the subgeo structure
268  return _first_idof_by_dimension_internal [hat_K.variant()][hat_K.dimension()+1];
269  }
271  return _first_inod_by_dimension_internal [hat_K.variant()][hat_K.dimension()+1];
272  }
273  // accessors to subgeo ndof & nnod by dimension (not available for basis_trace)
275  return _ndof_on_subgeo_internal [map_dim][subgeo_variant];
276  }
278  return _nnod_on_subgeo_internal [map_dim][subgeo_variant];
279  }
282  }
285  }
286 
287  // used by DG, HDG:
288  virtual size_type local_ndof_on_side (
289  reference_element hat_K,
290  const side_information_type& sid) const;
291  virtual void local_idof_on_side (
292  reference_element hat_K,
293  const side_information_type& sid,
294  Eigen::Matrix<size_type,Eigen::Dynamic,1>& loc_idof) const;
295 
296  virtual const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& hat_node (reference_element hat_K) const;
297  virtual const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>& vdm (reference_element hat_K) const;
298  virtual const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>& inv_vdm (reference_element hat_K) const;
299 
300 // valued accessors :
301 
302  const piola_fem<T>& get_piola_fem() const { return _piola_fem; }
303 
304  // evaluation and compute_dofs:
305  // the abstract class provide a rich interface, for each valued
306  // case because the valued type is run-time dependent.
307  // For each concrete basis, only one of the valued case is implemented.
308 
309 #define _RHEOLEF_evaluate(MEMBER,VALUED,VALUE) \
310  virtual \
311  void \
312  MEMBER ( \
313  reference_element hat_K, \
314  const point_basic<T>& hat_x, \
315  Eigen::Matrix<VALUE,Eigen::Dynamic,1>& value) const \
316  { \
317  error_macro ("basis \""<<name()<<"\": " \
318  << VALUED << "-valued " << #MEMBER \
319  << "() member not implemented"); \
320  } \
321 
327 _RHEOLEF_evaluate(grad_evaluate,"scalar",T)
332 #undef _RHEOLEF_evaluate
333 
334 #define _RHEOLEF_evaluate_on_side(VALUED,VALUE) \
335  virtual \
336  void \
337  evaluate_on_side ( \
338  reference_element tilde_K, \
339  const side_information_type& sid, \
340  const point_basic<T>& hat_x, \
341  Eigen::Matrix<VALUE,Eigen::Dynamic,1>& value) const \
342  { \
343  error_macro ("basis \""<<name()<<"\": " \
344  << VALUED << "-valued evaluate_on_side() member not implemented"); \
345  }
346 
349 #undef _RHEOLEF_evaluate_on_side
350 
351 #define _RHEOLEF_compute_dofs(VALUED,VALUE) \
352  virtual \
353  void \
354  _compute_dofs ( \
355  reference_element hat_K, \
356  const Eigen::Matrix<VALUE,Eigen::Dynamic,1>& f_xnod, \
357  Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const \
358  { \
359  error_macro ("basis \"" << name() << "\": " \
360  << VALUED << "-valued _compute_dofs() member not implemented"); \
361  }
362 
366 #undef _RHEOLEF_compute_dofs
367 
368 // internals:
369 
370  void put (std::ostream& os, reference_element hat_K) const;
371  virtual void put_scalar_valued (std::ostream& os, reference_element hat_K) const;
372  virtual void put_vector_valued (std::ostream& os, reference_element hat_K) const;
373  void put_hat_node (std::ostream& os, reference_element hat_K) const;
374  void put_hat_node_on_side (std::ostream& os, reference_element hat_K,
375  const side_information_type& sid) const;
376 
377  // helper for building class:
378  static basis_rep* make_ptr (const std::string& name);
379  static std::string standard_naming (std::string family_name, size_t degree, const basis_option& sopt);
380  static bool have_index_parameter (std::string family_name);
381  static bool have_continuous_feature (std::string family_name);
382 
383  virtual void _initialize_cstor_sizes () const = 0;
384  void _initialize_data_guard (reference_element hat_K) const;
385  virtual void _initialize_data (reference_element hat_K) const = 0;
386 
387 // internals:
388 
389  void _clear() const;
390 
391  // internal helper:
392  // 1) automatically deduce _first_ixxx_by_dimension from _nxxx_on_subgeo
393  // where xxx = dof or nod
395  const std::array<
396  std::array<
397  size_type
399  ,4>& _nxxx_on_subgeo,
400  std::array<
401  std::array<
402  size_type
403  ,5>
404  ,reference_element::max_variant>& _first_ixxx_by_dimension);
405  // 2) inplace change nxxx_on_subgeo for discontinuous elements
407  bool is_continuous,
408  const
409  std::array<
410  std::array<
411  size_type
413  ,4>& nxxx_on_subgeo_internal,
414  std::array<
415  std::array<
416  size_type
418  ,4>& nxxx_on_subgeo);
419 
420 protected:
421 // data:
422  std::string _name;
424  piola_fem<T> _piola_fem;
425 
426  mutable std::array<bool,
428 
429  // nodes and dofs are organized by variant and dimension=0..3 of subgeos, for each hat_K:
430  mutable std::array<
431  std::array<
432  size_type
438  mutable std::array<
439  std::array<
440  size_type
441  ,5>
446 };
447 // -----------------------------------------------------------
448 // inlined
449 // -----------------------------------------------------------
450 template<class T>
451 inline
452 const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&
454 {
455  error_macro ("basis \""<<name()<<"\": hat_node() member not implemented");
456  static const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1> _dummy;
457  return _dummy;
458 }
459 template<class T>
460 inline
461 const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
463 {
464  error_macro ("basis \""<<name()<<"\": vdm() member not implemented");
465  static const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> _dummy;
466  return _dummy;
467 }
468 template<class T>
469 inline
470 const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
472 {
473  error_macro ("basis \""<<name()<<"\": inv_vdm() member not implemented");
474  static const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> _dummy;
475  return _dummy;
476 }
477 // extract local dof-indexes on a side
478 template<class T>
479 inline
482  reference_element hat_K,
483  const side_information_type& sid) const
484 {
485  error_macro ("basis \""<<name()<<"\": local_ndof_on_side() member not implemented"); return 0;
486 }
487 template<class T>
488 inline
489 void
491  reference_element hat_K,
492  const side_information_type& sid,
493  Eigen::Matrix<size_type,Eigen::Dynamic,1>& loc_idof) const
494 {
495  error_macro ("basis \""<<name()<<"\": local_idof_on_side() member not implemented");
496 }
497 // ---------------------------------------------------------
498 // compute_dof
499 // ---------------------------------------------------------
500 // implementation note:
501 // b.compute_dof (f,&dof)
502 // is impossible with base_rep
503 // because template functions cannot be virtual
504 // cannot call a "b.compute_dof(f,&dof)" template-virtual member
505 // so we have to write at top level basis_rep a general
506 // compute_dof (b,f,&dof)
507 // and switch on all nodal/modal and valued variants
508 //
509 // for vector-valued RTk, it is problematic, because we
510 // only require f.n on the boundary and not all f components
511 //
512 namespace details {
513 
514 template <class T, class Function>
515 typename
516 std::enable_if<
517  is_scalar<typename function_traits<Function>::result_type>::value
518  ,void
519 >::type
521  const basis_rep<T>& b,
522  reference_element hat_K,
523  const Function& f,
524  Eigen::Matrix<T,Eigen::Dynamic,1>& dof)
525 {
527  check_macro (b.valued_tag() == space_constant::scalar,
528  "interpolate: incompatible scalar-valued function and "<<b.valued()<<"-valued basis");
529  const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& hat_node = b.hat_node (hat_K);
530  // modal basis:
531  Eigen::Matrix<T,Eigen::Dynamic,1> f_xnod (hat_node.size());
532  for (size_type loc_inod = 0, loc_nnod = hat_node.size(); loc_inod < loc_nnod; ++loc_inod) {
533  f_xnod [loc_inod] = f (hat_node [loc_inod]);
534  }
535  b._compute_dofs (hat_K, f_xnod, dof);
536 }
537 template <class T, class Function>
538 typename
539 std::enable_if<
540  is_point<typename function_traits<Function>::result_type>::value
541  ,void
542 >::type
544  const basis_rep<T>& b,
545  reference_element hat_K,
546  const Function& f,
547  Eigen::Matrix<T,Eigen::Dynamic,1>& dof)
548 {
550  check_macro (b.valued_tag() == space_constant::vector,
551  "interpolate: incompatible vector-valued function and "<<b.valued()<<"-valued basis");
552  const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& hat_node = b.hat_node (hat_K);
553  // modal basis:
554  Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1> f_xnod (hat_node.size());
555  for (size_type loc_inod = 0, loc_nnod = hat_node.size(); loc_inod < loc_nnod; ++loc_inod) {
556  f_xnod [loc_inod] = f (hat_node [loc_inod]);
557  }
558  b._compute_dofs (hat_K, f_xnod, dof);
559 }
560 
561 } // namespace details
562 
563 // [verbatim_basis_basic]
564 template<class T>
565 class basis_basic : public smart_pointer_nocopy<basis_rep<T> >,
566  public persistent_table<basis_basic<T> > {
567 public:
568 
569 // typedefs:
570 
571  typedef basis_rep<T> rep;
573  typedef typename rep::size_type size_type;
574  typedef typename rep::value_type value_type;
575  typedef typename rep::valued_type valued_type;
576 
577 // allocators:
578 
579  basis_basic (std::string name = "");
580  void reset (std::string& name);
581  void reset_family_index (size_type k);
582 
583 // accessors:
584 
585  bool is_initialized() const { return base::operator->() != 0; }
586  size_type degree() const;
587  size_type family_index() const;
588  std::string family_name() const;
589  std::string name() const;
590  size_type ndof (reference_element hat_K) const;
591  size_type nnod (reference_element hat_K) const;
592  bool is_continuous() const;
593  bool is_discontinuous() const;
594  bool is_nodal() const;
595  bool have_continuous_feature() const;
597  bool is_hierarchical() const;
598  size_type size() const;
599  const basis_basic<T>& operator[] (size_type i_comp) const;
600  bool have_index_parameter() const;
601  const basis_option& option() const;
602  valued_type valued_tag() const;
603  const std::string& valued() const;
604  const piola_fem<T>& get_piola_fem() const;
605 // [verbatim_basis_basic]
606 
608  reference_element hat_K,
609  const side_information_type& sid) const;
610  void local_idof_on_side (
611  reference_element hat_K,
612  const side_information_type& sid,
613  Eigen::Matrix<size_type,Eigen::Dynamic,1>& loc_idof) const;
614 
615  size_type ndof_on_subgeo (size_type map_dim, size_type subgeo_variant) const;
616  size_type nnod_on_subgeo (size_type map_dim, size_type subgeo_variant) const;
619 
624 
625  // evaluate the basis:
626  template<class Value>
627  void evaluate (
628  reference_element hat_K,
629  const point_basic<T>& hat_x,
630  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const;
631 
632  // evaluation restricted to a side:
633  template<class Value>
634  void evaluate_on_side (
635  reference_element tilde_K,
636  const side_information_type& sid,
637  const point_basic<T>& hat_x,
638  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const;
639 
640  // evaluate the gradient of the basis:
641  template<class Value>
642  void grad_evaluate (
643  reference_element hat_K,
644  const point_basic<T>& hat_x,
645  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const;
646 
647  // interpolation nodes:
648  const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& hat_node (reference_element hat_K) const;
649 
650  // compute_dof:
651  template <class Function>
652  void compute_dof (
653  reference_element hat_K,
654  const Function& f,
655  Eigen::Matrix<T,Eigen::Dynamic,1>& dofs) const;
656 
657  template <class Value>
658  void compute_dofs (
659  reference_element hat_K,
660  const Eigen::Matrix<Value,Eigen::Dynamic,1>& f_xnod, // scalar-valued case:
661  Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const;
662 
663  const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>& vdm (reference_element hat_K) const;
664  const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>& inv_vdm (reference_element hat_K) const;
665 
666  // output:
667  void put (std::ostream& os, reference_element hat_K) const;
668  void put_hat_node (std::ostream& os, reference_element hat_K) const;
669  void put_hat_node_on_side (
670  std::ostream& os,
671  reference_element hat_K,
672  const side_information_type& sid) const;
673 
674 protected:
675 // internals:
676 
677  void _clear() const;
678 // [verbatim_basis_basic_cont]
679 };
680 // [verbatim_basis_basic_cont]
681 
682 // [verbatim_basis]
684 // [verbatim_basis]
685 
686 // -----------------------------------------------------------
687 // inlined
688 // -----------------------------------------------------------
689 template<class T>
690 inline
692  : base(),
694 {
695  reset (name);
696 }
697 template<class T>
698 inline
699 void
701 {
702  return base::data()._clear();
703 }
704 template<class T>
705 inline
706 std::string
708 {
709  return base::data().family_name();
710 }
711 template<class T>
712 inline
715 {
716  return base::data().family_index();
717 }
718 template<class T>
719 inline
720 std::string
722 {
723  return base::data().name();
724 }
725 template<class T>
726 inline
729 {
730  return base::data().degree();
731 }
732 template<class T>
733 inline
736 {
737  return base::data().ndof (hat_K);
738 }
739 template<class T>
740 inline
743 {
744  return base::data().nnod (hat_K);
745 }
746 template<class T>
747 inline
748 const basis_option&
750 {
751  return base::data().option();
752 }
753 template<class T>
754 inline
755 bool
757 {
758  return base::data().is_continuous();
759 }
760 template<class T>
761 inline
762 bool
764 {
765  return base::data().is_discontinuous();
766 }
767 template<class T>
768 inline
769 bool
771 {
772  return base::data().is_nodal();
773 }
774 template<class T>
775 inline
776 bool
778 {
779  return base::data().have_continuous_feature();
780 }
781 template<class T>
782 inline
783 bool
785 {
786  return base::data().have_compact_support_inside_element();
787 }
788 template<class T>
789 inline
792 {
793  return base::data().size();
794 }
795 template<class T>
796 inline
797 bool
799 {
800  return base::data().is_hierarchical();
801 }
802 template<class T>
803 inline
804 const basis_basic<T>&
806 {
807  error_macro ("basis \""<<name()<<"\": invalid basis indexation [i_comp]");
808  static const basis_basic<T> dummy; return dummy;
809 }
810 template<class T>
811 inline
812 const basis_basic<T>&
814 {
815  return base::data().operator[] (i_comp);
816 }
817 template<class T>
818 inline
819 bool
821 {
822  return base::data().have_index_parameter();
823 }
824 template<class T>
825 inline
828 {
829  return base::data().valued_tag();
830 }
831 template<class T>
832 inline
833 const piola_fem<T>&
835 {
836  return base::data().get_piola_fem();
837 }
838 template<class T>
839 inline
840 const std::string&
842 {
843  return base::data().valued();
844 }
845 template<class T>
846 inline
849 {
850  return base::data().ndof_on_subgeo (map_dim, subgeo_variant);
851 }
852 template<class T>
853 inline
856 {
857  return base::data().nnod_on_subgeo (map_dim, subgeo_variant);
858 }
859 template<class T>
860 inline
863 {
864  return base::data().first_idof_by_dimension (hat_K, dim);
865 }
866 template<class T>
867 inline
870 {
871  return base::data().first_inod_by_dimension (hat_K, dim);
872 }
873 template<class T>
874 inline
877 {
878  return base::data().ndof_on_subgeo_internal (map_dim, subgeo_variant);
879 }
880 template<class T>
881 inline
884 {
885  return base::data().nnod_on_subgeo_internal (map_dim, subgeo_variant);
886 }
887 template<class T>
888 inline
891 {
892  return base::data().first_idof_by_dimension_internal (hat_K, dim);
893 }
894 template<class T>
895 inline
898 {
899  return base::data().first_inod_by_dimension_internal (hat_K, dim);
900 }
901 template<class T>
902 inline
903 const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
905 {
906  return base::data().vdm(hat_K);
907 }
908 template<class T>
909 inline
910 const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
912 {
913  return base::data().inv_vdm(hat_K);
914 }
915 template<class T>
916 template<class Value>
917 inline
918 void
920  reference_element hat_K,
921  const point_basic<T>& hat_x,
922  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const
923 {
924  base::data().evaluate (hat_K, hat_x, value);
925 }
926 template<class T>
927 template<class Value>
928 inline
929 void
931  reference_element tilde_K,
932  const side_information_type& sid,
933  const point_basic<T>& hat_x,
934  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const
935 {
936  base::data().evaluate_on_side (tilde_K, sid, hat_x, value);
937 }
938 template<class T>
939 template<class Value>
940 inline
941 void
943  reference_element hat_K,
944  const point_basic<T>& hat_x,
945  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const
946 {
947  base::data().grad_evaluate (hat_K, hat_x, value);
948 }
949 template<class T>
950 template <class Function>
951 inline
952 void
954  reference_element hat_K,
955  const Function& f,
956  Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const
957 {
958  return details::compute_dof (base::data(), hat_K, f, dof);
959 }
960 template<class T>
961 template<class Value>
962 inline
963 void
965  reference_element hat_K,
966  const Eigen::Matrix<Value,Eigen::Dynamic,1>& f_xnod,
967  Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const
968 {
969  base::data()._compute_dofs (hat_K, f_xnod, dof);
970 }
971 template<class T>
972 inline
973 const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&
975 {
976  return base::data().hat_node (hat_K);
977 }
978 template<class T>
979 inline
980 void
981 basis_basic<T>::put (std::ostream& os, reference_element hat_K) const
982 {
983  base::data().put (os, hat_K);
984 }
985 template<class T>
986 inline
987 void
988 basis_basic<T>::put_hat_node (std::ostream& os, reference_element hat_K) const
989 {
990  base::data().put_hat_node (os, hat_K);
991 }
992 template<class T>
993 inline
996  reference_element hat_K,
997  const side_information_type& sid) const
998 {
999  return base::data().local_ndof_on_side (hat_K, sid);
1000 }
1001 template<class T>
1002 inline
1003 void
1005  reference_element hat_K,
1006  const side_information_type& sid,
1007  Eigen::Matrix<size_type,Eigen::Dynamic,1>& loc_idof) const
1008 {
1009  base::data().local_idof_on_side (hat_K, sid, loc_idof);
1010 }
1011 template<class T>
1012 inline
1013 void
1015  std::ostream& os,
1016  reference_element hat_K,
1017  const side_information_type& sid) const
1018 {
1019  base::data().put_hat_node_on_side (os, hat_K, sid);
1020 }
1021 
1022 }// namespace rheolef
1023 #endif // _RHEO_BASIS_H
field::size_type size_type
Definition: branch.cc:430
bool is_continuous() const
Definition: basis.h:756
const piola_fem< T > & get_piola_fem() const
Definition: basis.h:834
size_type ndof(reference_element hat_K) const
Definition: basis.h:735
size_type size() const
Definition: basis.h:791
std::string name() const
Definition: basis.h:721
bool have_compact_support_inside_element() const
Definition: basis.h:784
basis_rep< T > rep
Definition: basis.h:571
void compute_dofs(reference_element hat_K, const Eigen::Matrix< Value, Eigen::Dynamic, 1 > &f_xnod, Eigen::Matrix< T, Eigen::Dynamic, 1 > &dof) const
Definition: basis.h:964
rep::value_type value_type
Definition: basis.h:574
bool have_continuous_feature() const
Definition: basis.h:777
void evaluate_on_side(reference_element tilde_K, const side_information_type &sid, const point_basic< T > &hat_x, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
Definition: basis.h:930
bool is_discontinuous() const
Definition: basis.h:763
size_type nnod(reference_element hat_K) const
Definition: basis.h:742
size_type local_ndof_on_side(reference_element hat_K, const side_information_type &sid) const
Definition: basis.h:995
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & vdm(reference_element hat_K) const
Definition: basis.h:904
size_type nnod_on_subgeo_internal(size_type map_dim, size_type subgeo_variant) const
Definition: basis.h:883
size_type family_index() const
Definition: basis.h:714
void local_idof_on_side(reference_element hat_K, const side_information_type &sid, Eigen::Matrix< size_type, Eigen::Dynamic, 1 > &loc_idof) const
Definition: basis.h:1004
const basis_option & option() const
Definition: basis.h:749
valued_type valued_tag() const
Definition: basis.h:827
bool is_initialized() const
Definition: basis.h:585
void put_hat_node_on_side(std::ostream &os, reference_element hat_K, const side_information_type &sid) const
Definition: basis.h:1014
size_type first_inod_by_dimension(reference_element hat_K, size_type dim) const
Definition: basis.h:869
size_type degree() const
Definition: basis.h:728
basis_basic(std::string name="")
Definition: basis.h:691
size_type first_idof_by_dimension_internal(reference_element hat_K, size_type dim) const
Definition: basis.h:890
size_type first_inod_by_dimension_internal(reference_element hat_K, size_type dim) const
Definition: basis.h:897
rep::valued_type valued_type
Definition: basis.h:575
void compute_dof(reference_element hat_K, const Function &f, Eigen::Matrix< T, Eigen::Dynamic, 1 > &dofs) const
Definition: basis.h:953
void put(std::ostream &os, reference_element hat_K) const
Definition: basis.h:981
size_type first_idof_by_dimension(reference_element hat_K, size_type dim) const
Definition: basis.h:862
void put_hat_node(std::ostream &os, reference_element hat_K) const
Definition: basis.h:988
bool is_hierarchical() const
Definition: basis.h:798
const Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > & hat_node(reference_element hat_K) const
Definition: basis.h:974
rep::size_type size_type
Definition: basis.h:573
const basis_basic< T > & operator[](size_type i_comp) const
Definition: basis.h:813
size_type nnod_on_subgeo(size_type map_dim, size_type subgeo_variant) const
Definition: basis.h:855
bool is_nodal() const
Definition: basis.h:770
const std::string & valued() const
Definition: basis.h:841
smart_pointer_nocopy< rep > base
Definition: basis.h:572
std::string family_name() const
Definition: basis.h:707
void grad_evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
Definition: basis.h:942
size_type ndof_on_subgeo_internal(size_type map_dim, size_type subgeo_variant) const
Definition: basis.h:876
void reset_family_index(size_type k)
Definition: basis_rep.cc:94
bool have_index_parameter() const
Definition: basis.h:820
size_type ndof_on_subgeo(size_type map_dim, size_type subgeo_variant) const
Definition: basis.h:848
void reset(std::string &name)
Definition: basis_rep.cc:79
void evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
Definition: basis.h:919
void _clear() const
Definition: basis.h:700
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & inv_vdm(reference_element hat_K) const
Definition: basis.h:911
see the basis_option page for the full documentation
Definition: basis_option.h:93
bool is_continuous() const
Definition: basis_option.h:227
bool is_continuous() const
Definition: basis.h:240
std::array< std::array< size_type,reference_element::max_variant >,4 > _nnod_on_subgeo
Definition: basis.h:437
const piola_fem< T > & get_piola_fem() const
Definition: basis.h:302
std::array< std::array< size_type,reference_element::max_variant >,4 > _ndof_on_subgeo_internal
Definition: basis.h:434
virtual size_type local_ndof_on_side(reference_element hat_K, const side_information_type &sid) const
Definition: basis.h:481
std::array< std::array< size_type,5 >,reference_element::max_variant > _first_idof_by_dimension
Definition: basis.h:443
size_type ndof(reference_element hat_K) const
Definition: basis.h:244
point_basic< T > tensor3_basic< T > scalar
Definition: basis.h:327
virtual std::string family_name() const =0
std::string name() const
Definition: basis.h:228
virtual ~basis_rep()
Definition: basis_rep.cc:102
virtual bool have_continuous_feature() const
Definition: basis.h:233
_RHEOLEF_evaluate(evaluate,"scalar", T) _RHEOLEF_evaluate(evaluate
std::array< std::array< size_type,5 >,reference_element::max_variant > _first_inod_by_dimension
Definition: basis.h:445
virtual size_type size() const
Definition: basis.h:235
size_type ndof_internal(reference_element hat_K) const
Definition: basis.h:267
basis_rep(const basis_option &sopt)
Definition: basis_rep.cc:107
virtual bool have_index_parameter() const
Definition: basis.h:232
virtual void _initialize_data(reference_element hat_K) const =0
_RHEOLEF_compute_dofs("scalar", T) _RHEOLEF_compute_dofs("vector"
virtual valued_type valued_tag() const
Definition: basis.h:230
bool is_discontinuous() const
Definition: basis.h:241
std::array< std::array< size_type,5 >,reference_element::max_variant > _first_idof_by_dimension_internal
Definition: basis.h:442
size_type first_inod_by_dimension_internal(reference_element hat_K, size_type dim) const
Definition: basis.h:283
size_type nnod_internal(reference_element hat_K) const
Definition: basis.h:270
size_type ndof_on_subgeo_internal(size_type map_dim, size_type subgeo_variant) const
Definition: basis.h:274
size_type first_idof_by_dimension_internal(reference_element hat_K, size_type dim) const
Definition: basis.h:280
virtual const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & vdm(reference_element hat_K) const
Definition: basis.h:462
static void _helper_make_discontinuous_ndof_on_subgeo(bool is_continuous, const std::array< std::array< size_type, reference_element::max_variant >, 4 > &nxxx_on_subgeo_internal, std::array< std::array< size_type, reference_element::max_variant >, 4 > &nxxx_on_subgeo)
Definition: basis_rep.cc:143
reference_element::size_type size_type
Definition: basis.h:214
virtual void local_idof_on_side(reference_element hat_K, const side_information_type &sid, Eigen::Matrix< size_type, Eigen::Dynamic, 1 > &loc_idof) const
Definition: basis.h:490
piola_fem< T > _piola_fem
Definition: basis.h:424
const std::string & valued() const
Definition: basis.h:239
void _initialize_data_guard(reference_element hat_K) const
Definition: basis_rep.cc:131
basis_option _sopt
Definition: basis.h:423
std::array< bool, reference_element::max_variant > _have_initialize_data
Definition: basis.h:427
space_constant::valued_type valued_type
Definition: basis.h:216
void put_hat_node_on_side(std::ostream &os, reference_element hat_K, const side_information_type &sid) const
size_type first_idof_by_dimension(reference_element hat_K, size_type dim) const
Definition: basis.h:259
virtual bool is_nodal() const =0
std::array< std::array< size_type,reference_element::max_variant >,4 > _ndof_on_subgeo
Definition: basis.h:435
size_type nnod_on_subgeo(size_type map_dim, size_type subgeo_variant) const
Definition: basis.h:256
const basis_option & option() const
Definition: basis.h:238
virtual bool have_compact_support_inside_element() const
Definition: basis.h:237
size_type nnod(reference_element hat_K) const
Definition: basis.h:247
size_type ndof_on_subgeo(size_type map_dim, size_type subgeo_variant) const
Definition: basis.h:253
size_type first_inod_by_dimension(reference_element hat_K, size_type dim) const
Definition: basis.h:262
static std::string standard_naming(std::string family_name, size_t degree, const basis_option &sopt)
Definition: basis_rep.cc:44
std::string _name
Definition: basis.h:422
static basis_rep * make_ptr(const std::string &name)
Definition: basis_list.cc:56
void put_hat_node(std::ostream &os, reference_element hat_K) const
size_type nnod_on_subgeo_internal(size_type map_dim, size_type subgeo_variant) const
Definition: basis.h:277
virtual size_type family_index() const
Definition: basis.h:226
virtual const Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > & hat_node(reference_element hat_K) const
Definition: basis.h:453
std::array< std::array< size_type,5 >,reference_element::max_variant > _first_inod_by_dimension_internal
Definition: basis.h:444
virtual const class basis_basic< T > & operator[](size_type i_comp) const
Definition: basis.h:805
virtual void put_vector_valued(std::ostream &os, reference_element hat_K) const
_RHEOLEF_evaluate_on_side("scalar", T) _RHEOLEF_evaluate_on_side("vector"
virtual bool is_hierarchical() const
Definition: basis.h:234
virtual void _initialize_cstor_sizes() const =0
std::array< std::array< size_type,reference_element::max_variant >,4 > _nnod_on_subgeo_internal
Definition: basis.h:436
virtual size_type degree() const =0
void _clear() const
Definition: basis_rep.cc:125
virtual const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & inv_vdm(reference_element hat_K) const
Definition: basis.h:471
static void _helper_initialize_first_ixxx_by_dimension_from_nxxx_on_subgeo(const std::array< std::array< size_type, reference_element::max_variant >, 4 > &_nxxx_on_subgeo, std::array< std::array< size_type, 5 >, reference_element::max_variant > &_first_ixxx_by_dimension)
Definition: basis_rep.cc:184
see the persistent_table page for the full documentation
see the reference_element page for the full documentation
static const variant_type max_variant
variant_type variant() const
std::vector< int >::size_type size_type
basis_basic< Float > basis
Definition: basis.h:683
rheolef::std type
size_t size_type
Definition: basis_get.cc:76
rheolef::std value
rheolef::std Function
static iorheo::force_initialization dummy
Definition: iorheo.cc:147
see the tensor3 page for the full documentation
see the tensor4 page for the full documentation
see the tensor page for the full documentation
#define error_macro(message)
Definition: dis_macros.h:49
Expr1::float_type T
Definition: field_expr.h:230
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
std::enable_if< is_scalar< typename function_traits< Function >::result_type >::value,void >::type compute_dof(const basis_rep< T > &b, reference_element hat_K, const Function &f, Eigen::Matrix< T, Eigen::Dynamic, 1 > &dof)
Definition: basis.h:520
const std::string & valued_name(valued_type valued_tag)
This file is part of Rheolef.
void put(std::ostream &out, std::string name, const tiny_matrix< T > &a)
Definition: tiny_lu.h:155
void evaluate(const geo_basic< float_type, M > &omega_K, const geo_element &K, Eigen::Matrix< Result, Eigen::Dynamic, 1 > &value) const
Definition: cavity_dg.h:29