Rheolef  7.1
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_sides)
252  return _ndof_on_subgeo [map_dim][subgeo_variant];
253  }
255  return _nnod_on_subgeo [map_dim][subgeo_variant];
256  }
258  return _first_idof_by_dimension [hat_K.variant()][dim];
259  }
261  return _first_inod_by_dimension [hat_K.variant()][dim];
262  }
263  // used by DG, HDG:
264  virtual size_type local_ndof_on_side (
265  reference_element hat_K,
266  const side_information_type& sid) const;
267  virtual void local_idof_on_side (
268  reference_element hat_K,
269  const side_information_type& sid,
270  Eigen::Matrix<size_type,Eigen::Dynamic,1>& loc_idof) const;
271 
272  virtual const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& hat_node (reference_element hat_K) const;
273  virtual const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>& vdm (reference_element hat_K) const;
274  virtual const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>& inv_vdm (reference_element hat_K) const;
275 
276 // valued accessors :
277 
278  const piola_fem<T>& get_piola_fem() const { return _piola_fem; }
279 
280  // evaluation and compute_dofs:
281  // the abstract class provide a rich interface, for each valued
282  // case because the valued type is run-time dependent.
283  // For each concrete basis, only one of the valued case is implemented.
284 
285 #define _RHEOLEF_evaluate(MEMBER,VALUED,VALUE) \
286  virtual \
287  void \
288  MEMBER ( \
289  reference_element hat_K, \
290  const point_basic<T>& hat_x, \
291  Eigen::Matrix<VALUE,Eigen::Dynamic,1>& value) const \
292  { \
293  error_macro ("basis \""<<name()<<"\": " \
294  << VALUED << "-valued " << #MEMBER \
295  << "() member not implemented"); \
296  } \
297 
303 _RHEOLEF_evaluate(grad_evaluate,"scalar",T)
308 #undef _RHEOLEF_evaluate
309 
310 #define _RHEOLEF_evaluate_on_side(VALUED,VALUE) \
311  virtual \
312  void \
313  evaluate_on_side ( \
314  reference_element tilde_K, \
315  const side_information_type& sid, \
316  const point_basic<T>& hat_x, \
317  Eigen::Matrix<VALUE,Eigen::Dynamic,1>& value) const \
318  { \
319  error_macro ("basis \""<<name()<<"\": " \
320  << VALUED << "-valued evaluate_on_side() member not implemented"); \
321  }
322 
325 #undef _RHEOLEF_evaluate_on_side
326 
327 #define _RHEOLEF_compute_dofs(VALUED,VALUE) \
328  virtual \
329  void \
330  _compute_dofs ( \
331  reference_element hat_K, \
332  const Eigen::Matrix<VALUE,Eigen::Dynamic,1>& f_xnod, \
333  Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const \
334  { \
335  error_macro ("basis \"" << name() << "\": " \
336  << VALUED << "-valued _compute_dofs() member not implemented"); \
337  }
338 
342 #undef _RHEOLEF_compute_dofs
343 
344 // internals:
345 
346  void put (std::ostream& os, reference_element hat_K) const;
347  virtual void put_scalar_valued (std::ostream& os, reference_element hat_K) const;
348  virtual void put_vector_valued (std::ostream& os, reference_element hat_K) const;
349  void put_hat_node (std::ostream& os, reference_element hat_K) const;
350  void put_hat_node_on_side (std::ostream& os, reference_element hat_K,
351  const side_information_type& sid) const;
352 
353  // helper for building class:
354  static basis_rep* make_ptr (const std::string& name);
355  static std::string standard_naming (std::string family_name, size_t degree, const basis_option& sopt);
356  static bool have_index_parameter (std::string family_name);
357  static bool have_continuous_feature (std::string family_name);
358 
359  virtual void _initialize_cstor_sizes () const = 0;
360  void _initialize_data_guard (reference_element hat_K) const;
361  virtual void _initialize_data (reference_element hat_K) const = 0;
362 
363 // internals:
364 
365  void _clear() const;
366 
367  // internal helper:
368  // 1) automatically deduce _first_ixxx_by_dimension from _nxxx_on_subgeo
369  // where xxx = dof or nod
371  const std::array<
372  std::array<
373  size_type
375  ,4>& _nxxx_on_subgeo,
376  std::array<
377  std::array<
378  size_type
379  ,5>
380  ,reference_element::max_variant>& _first_ixxx_by_dimension);
381  // 2) inplace change nxxx_on_subgeo for discontinuous elements
383  bool is_continuous,
384  std::array<
385  std::array<
386  size_type
388  ,4>& nxxx_on_subgeo);
389 
390 protected:
391 // data:
392  std::string _name;
394  piola_fem<T> _piola_fem;
395 
396  mutable std::array<bool,
398 
399  // nodes and dofs are organized by variant and dimension=0..3 of subgeos, for each hat_K:
400  mutable std::array<
401  std::array<
402  size_type
406  mutable std::array<
407  std::array<
408  size_type
409  ,5>
412 };
413 // -----------------------------------------------------------
414 // inlined
415 // -----------------------------------------------------------
416 template<class T>
417 inline
418 const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&
420 {
421  error_macro ("basis \""<<name()<<"\": hat_node() member not implemented");
422  static const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1> _dummy;
423  return _dummy;
424 }
425 template<class T>
426 inline
427 const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
429 {
430  error_macro ("basis \""<<name()<<"\": vdm() member not implemented");
431  static const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> _dummy;
432  return _dummy;
433 }
434 template<class T>
435 inline
436 const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
438 {
439  error_macro ("basis \""<<name()<<"\": inv_vdm() member not implemented");
440  static const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> _dummy;
441  return _dummy;
442 }
443 // extract local dof-indexes on a side
444 template<class T>
445 inline
448  reference_element hat_K,
449  const side_information_type& sid) const
450 {
451  error_macro ("basis \""<<name()<<"\": local_ndof_on_side() member not implemented"); return 0;
452 }
453 template<class T>
454 inline
455 void
457  reference_element hat_K,
458  const side_information_type& sid,
459  Eigen::Matrix<size_type,Eigen::Dynamic,1>& loc_idof) const
460 {
461  error_macro ("basis \""<<name()<<"\": local_idof_on_side() member not implemented");
462 }
463 // ---------------------------------------------------------
464 // compute_dof
465 // ---------------------------------------------------------
466 // implementation note:
467 // b.compute_dof (f,&dof)
468 // is impossible with base_rep
469 // because template functions cannot be virtual
470 // cannot call a "b.compute_dof(f,&dof)" template-virtual member
471 // so we have to write at top level basis_rep a general
472 // compute_dof (b,f,&dof)
473 // and switch on all nodal/modal and valued variants
474 //
475 // for vector-valued RTk, it is problematic, because we
476 // only require f.n on the boundary and not all f components
477 //
478 namespace details {
479 
480 template <class T, class Function>
481 typename
482 std::enable_if<
483  is_scalar<typename function_traits<Function>::result_type>::value
484  ,void
485 >::type
487  const basis_rep<T>& b,
488  reference_element hat_K,
489  const Function& f,
490  Eigen::Matrix<T,Eigen::Dynamic,1>& dof)
491 {
493  check_macro (b.valued_tag() == space_constant::scalar,
494  "interpolate: incompatible scalar-valued function and "<<b.valued()<<"-valued basis");
495  const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& hat_node = b.hat_node (hat_K);
496  // modal basis:
497  Eigen::Matrix<T,Eigen::Dynamic,1> f_xnod (hat_node.size());
498  for (size_type loc_inod = 0, loc_nnod = hat_node.size(); loc_inod < loc_nnod; ++loc_inod) {
499  f_xnod [loc_inod] = f (hat_node [loc_inod]);
500  }
501  b._compute_dofs (hat_K, f_xnod, dof);
502 }
503 template <class T, class Function>
504 typename
505 std::enable_if<
506  is_point<typename function_traits<Function>::result_type>::value
507  ,void
508 >::type
510  const basis_rep<T>& b,
511  reference_element hat_K,
512  const Function& f,
513  Eigen::Matrix<T,Eigen::Dynamic,1>& dof)
514 {
516  check_macro (b.valued_tag() == space_constant::vector,
517  "interpolate: incompatible vector-valued function and "<<b.valued()<<"-valued basis");
518  const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& hat_node = b.hat_node (hat_K);
519  // modal basis:
520  Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1> f_xnod (hat_node.size());
521  for (size_type loc_inod = 0, loc_nnod = hat_node.size(); loc_inod < loc_nnod; ++loc_inod) {
522  f_xnod [loc_inod] = f (hat_node [loc_inod]);
523  }
524  b._compute_dofs (hat_K, f_xnod, dof);
525 }
526 
527 } // namespace details
528 
529 // [verbatim_basis_basic]
530 template<class T>
531 class basis_basic : public smart_pointer_nocopy<basis_rep<T> >,
532  public persistent_table<basis_basic<T> > {
533 public:
534 
535 // typedefs:
536 
537  typedef basis_rep<T> rep;
539  typedef typename rep::size_type size_type;
540  typedef typename rep::value_type value_type;
541  typedef typename rep::valued_type valued_type;
542 
543 // allocators:
544 
545  basis_basic (std::string name = "");
546  void reset (std::string& name);
547  void reset_family_index (size_type k);
548 
549 // accessors:
550 
551  bool is_initialized() const { return base::operator->() != 0; }
552  size_type degree() const;
553  size_type family_index() const;
554  std::string family_name() const;
555  std::string name() const;
556  size_type ndof (reference_element hat_K) const;
557  size_type nnod (reference_element hat_K) const;
558  bool is_continuous() const;
559  bool is_discontinuous() const;
560  bool is_nodal() const;
561  bool have_continuous_feature() const;
563  bool is_hierarchical() const;
564  size_type size() const;
565  const basis_basic<T>& operator[] (size_type i_comp) const;
566  bool have_index_parameter() const;
567  const basis_option& option() const;
568  valued_type valued_tag() const;
569  const std::string& valued() const;
570  const piola_fem<T>& get_piola_fem() const;
571 // [verbatim_basis_basic]
572 
574  reference_element hat_K,
575  const side_information_type& sid) const;
576  void local_idof_on_side (
577  reference_element hat_K,
578  const side_information_type& sid,
579  Eigen::Matrix<size_type,Eigen::Dynamic,1>& loc_idof) const;
580 
581  size_type ndof_on_subgeo (size_type map_dim, size_type subgeo_variant) const;
582  size_type nnod_on_subgeo (size_type map_dim, size_type subgeo_variant) const;
585 
586  // evaluate the basis:
587  template<class Value>
588  void evaluate (
589  reference_element hat_K,
590  const point_basic<T>& hat_x,
591  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const;
592 
593  // evaluation restricted to a side:
594  template<class Value>
595  void evaluate_on_side (
596  reference_element tilde_K,
597  const side_information_type& sid,
598  const point_basic<T>& hat_x,
599  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const;
600 
601  // evaluate the gradient of the basis:
602  template<class Value>
603  void grad_evaluate (
604  reference_element hat_K,
605  const point_basic<T>& hat_x,
606  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const;
607 
608  // interpolation nodes:
609  const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& hat_node (reference_element hat_K) const;
610 
611  // compute_dof:
612  template <class Function>
613  void compute_dof (
614  reference_element hat_K,
615  const Function& f,
616  Eigen::Matrix<T,Eigen::Dynamic,1>& dofs) const;
617 
618  template <class Value>
619  void compute_dofs (
620  reference_element hat_K,
621  const Eigen::Matrix<Value,Eigen::Dynamic,1>& f_xnod, // scalar-valued case:
622  Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const;
623 
624  const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>& vdm (reference_element hat_K) const;
625  const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>& inv_vdm (reference_element hat_K) const;
626 
627  // output:
628  void put (std::ostream& os, reference_element hat_K) const;
629  void put_hat_node (std::ostream& os, reference_element hat_K) const;
630  void put_hat_node_on_side (
631  std::ostream& os,
632  reference_element hat_K,
633  const side_information_type& sid) const;
634 
635 protected:
636 // internals:
637 
638  void _clear() const;
639 // [verbatim_basis_basic_cont]
640 };
641 // [verbatim_basis_basic_cont]
642 
643 // [verbatim_basis]
645 // [verbatim_basis]
646 
647 // -----------------------------------------------------------
648 // inlined
649 // -----------------------------------------------------------
650 template<class T>
651 inline
653  : base(),
655 {
656  reset (name);
657 }
658 template<class T>
659 inline
660 void
662 {
663  return base::data()._clear();
664 }
665 template<class T>
666 inline
667 std::string
669 {
670  return base::data().family_name();
671 }
672 template<class T>
673 inline
676 {
677  return base::data().family_index();
678 }
679 template<class T>
680 inline
681 std::string
683 {
684  return base::data().name();
685 }
686 template<class T>
687 inline
690 {
691  return base::data().degree();
692 }
693 template<class T>
694 inline
697 {
698  return base::data().ndof (hat_K);
699 }
700 template<class T>
701 inline
704 {
705  return base::data().nnod (hat_K);
706 }
707 template<class T>
708 inline
709 const basis_option&
711 {
712  return base::data().option();
713 }
714 template<class T>
715 inline
716 bool
718 {
719  return base::data().is_continuous();
720 }
721 template<class T>
722 inline
723 bool
725 {
726  return base::data().is_discontinuous();
727 }
728 template<class T>
729 inline
730 bool
732 {
733  return base::data().is_nodal();
734 }
735 template<class T>
736 inline
737 bool
739 {
740  return base::data().have_continuous_feature();
741 }
742 template<class T>
743 inline
744 bool
746 {
747  return base::data().have_compact_support_inside_element();
748 }
749 template<class T>
750 inline
753 {
754  return base::data().size();
755 }
756 template<class T>
757 inline
758 bool
760 {
761  return base::data().is_hierarchical();
762 }
763 template<class T>
764 inline
765 const basis_basic<T>&
767 {
768  error_macro ("basis \""<<name()<<"\": invalid basis indexation [i_comp]");
769  static const basis_basic<T> dummy; return dummy;
770 }
771 template<class T>
772 inline
773 const basis_basic<T>&
775 {
776  return base::data().operator[] (i_comp);
777 }
778 template<class T>
779 inline
780 bool
782 {
783  return base::data().have_index_parameter();
784 }
785 template<class T>
786 inline
789 {
790  return base::data().valued_tag();
791 }
792 template<class T>
793 inline
794 const piola_fem<T>&
796 {
797  return base::data().get_piola_fem();
798 }
799 template<class T>
800 inline
801 const std::string&
803 {
804  return base::data().valued();
805 }
806 template<class T>
807 inline
810 {
811  return base::data().ndof_on_subgeo (map_dim, subgeo_variant);
812 }
813 template<class T>
814 inline
817 {
818  return base::data().nnod_on_subgeo (map_dim, subgeo_variant);
819 }
820 template<class T>
821 inline
824 {
825  return base::data().first_idof_by_dimension (hat_K, dim);
826 }
827 template<class T>
828 inline
831 {
832  return base::data().first_inod_by_dimension (hat_K, dim);
833 }
834 template<class T>
835 inline
836 const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
838 {
839  return base::data().vdm(hat_K);
840 }
841 template<class T>
842 inline
843 const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
845 {
846  return base::data().inv_vdm(hat_K);
847 }
848 template<class T>
849 template<class Value>
850 inline
851 void
853  reference_element hat_K,
854  const point_basic<T>& hat_x,
855  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const
856 {
857  base::data().evaluate (hat_K, hat_x, value);
858 }
859 template<class T>
860 template<class Value>
861 inline
862 void
864  reference_element tilde_K,
865  const side_information_type& sid,
866  const point_basic<T>& hat_x,
867  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const
868 {
869  base::data().evaluate_on_side (tilde_K, sid, hat_x, value);
870 }
871 template<class T>
872 template<class Value>
873 inline
874 void
876  reference_element hat_K,
877  const point_basic<T>& hat_x,
878  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const
879 {
880  base::data().grad_evaluate (hat_K, hat_x, value);
881 }
882 template<class T>
883 template <class Function>
884 inline
885 void
887  reference_element hat_K,
888  const Function& f,
889  Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const
890 {
891  return details::compute_dof (base::data(), hat_K, f, dof);
892 }
893 template<class T>
894 template<class Value>
895 inline
896 void
898  reference_element hat_K,
899  const Eigen::Matrix<Value,Eigen::Dynamic,1>& f_xnod,
900  Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const
901 {
902  base::data()._compute_dofs (hat_K, f_xnod, dof);
903 }
904 template<class T>
905 inline
906 const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&
908 {
909  return base::data().hat_node (hat_K);
910 }
911 template<class T>
912 inline
913 void
914 basis_basic<T>::put (std::ostream& os, reference_element hat_K) const
915 {
916  base::data().put (os, hat_K);
917 }
918 template<class T>
919 inline
920 void
921 basis_basic<T>::put_hat_node (std::ostream& os, reference_element hat_K) const
922 {
923  base::data().put_hat_node (os, hat_K);
924 }
925 template<class T>
926 inline
929  reference_element hat_K,
930  const side_information_type& sid) const
931 {
932  return base::data().local_ndof_on_side (hat_K, sid);
933 }
934 template<class T>
935 inline
936 void
938  reference_element hat_K,
939  const side_information_type& sid,
940  Eigen::Matrix<size_type,Eigen::Dynamic,1>& loc_idof) const
941 {
942  base::data().local_idof_on_side (hat_K, sid, loc_idof);
943 }
944 template<class T>
945 inline
946 void
948  std::ostream& os,
949  reference_element hat_K,
950  const side_information_type& sid) const
951 {
952  base::data().put_hat_node_on_side (os, hat_K, sid);
953 }
954 
955 }// namespace rheolef
956 #endif // _RHEO_BASIS_H
field::size_type size_type
Definition: branch.cc:425
bool is_continuous() const
Definition: basis.h:717
const piola_fem< T > & get_piola_fem() const
Definition: basis.h:795
size_type ndof(reference_element hat_K) const
Definition: basis.h:696
size_type size() const
Definition: basis.h:752
std::string name() const
Definition: basis.h:682
bool have_compact_support_inside_element() const
Definition: basis.h:745
basis_rep< T > rep
Definition: basis.h:537
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:897
rep::value_type value_type
Definition: basis.h:540
bool have_continuous_feature() const
Definition: basis.h:738
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:863
bool is_discontinuous() const
Definition: basis.h:724
size_type nnod(reference_element hat_K) const
Definition: basis.h:703
size_type local_ndof_on_side(reference_element hat_K, const side_information_type &sid) const
Definition: basis.h:928
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & vdm(reference_element hat_K) const
Definition: basis.h:837
size_type family_index() const
Definition: basis.h:675
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:937
const basis_option & option() const
Definition: basis.h:710
valued_type valued_tag() const
Definition: basis.h:788
bool is_initialized() const
Definition: basis.h:551
void put_hat_node_on_side(std::ostream &os, reference_element hat_K, const side_information_type &sid) const
Definition: basis.h:947
size_type first_inod_by_dimension(reference_element hat_K, size_type dim) const
Definition: basis.h:830
size_type degree() const
Definition: basis.h:689
basis_basic(std::string name="")
Definition: basis.h:652
rep::valued_type valued_type
Definition: basis.h:541
void compute_dof(reference_element hat_K, const Function &f, Eigen::Matrix< T, Eigen::Dynamic, 1 > &dofs) const
Definition: basis.h:886
void put(std::ostream &os, reference_element hat_K) const
Definition: basis.h:914
size_type first_idof_by_dimension(reference_element hat_K, size_type dim) const
Definition: basis.h:823
void put_hat_node(std::ostream &os, reference_element hat_K) const
Definition: basis.h:921
bool is_hierarchical() const
Definition: basis.h:759
const Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > & hat_node(reference_element hat_K) const
Definition: basis.h:907
rep::size_type size_type
Definition: basis.h:539
const basis_basic< T > & operator[](size_type i_comp) const
Definition: basis.h:774
size_type nnod_on_subgeo(size_type map_dim, size_type subgeo_variant) const
Definition: basis.h:816
bool is_nodal() const
Definition: basis.h:731
const std::string & valued() const
Definition: basis.h:802
smart_pointer_nocopy< rep > base
Definition: basis.h:538
std::string family_name() const
Definition: basis.h:668
void grad_evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
Definition: basis.h:875
void reset_family_index(size_type k)
Definition: basis_rep.cc:93
bool have_index_parameter() const
Definition: basis.h:781
size_type ndof_on_subgeo(size_type map_dim, size_type subgeo_variant) const
Definition: basis.h:809
void reset(std::string &name)
Definition: basis_rep.cc:78
void evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
Definition: basis.h:852
void _clear() const
Definition: basis.h:661
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & inv_vdm(reference_element hat_K) const
Definition: basis.h:844
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:405
const piola_fem< T > & get_piola_fem() const
Definition: basis.h:278
virtual size_type local_ndof_on_side(reference_element hat_K, const side_information_type &sid) const
Definition: basis.h:447
std::array< std::array< size_type,5 >,reference_element::max_variant > _first_idof_by_dimension
Definition: basis.h:410
size_type ndof(reference_element hat_K) const
Definition: basis.h:244
static void _helper_discontinuous_ndof_on_subgeo_inplace_change(bool is_continuous, std::array< std::array< size_type, reference_element::max_variant >, 4 > &nxxx_on_subgeo)
Definition: basis_rep.cc:135
point_basic< T > tensor3_basic< T > scalar
Definition: basis.h:303
virtual std::string family_name() const =0
std::string name() const
Definition: basis.h:228
virtual ~basis_rep()
Definition: basis_rep.cc:101
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:411
virtual size_type size() const
Definition: basis.h:235
basis_rep(const basis_option &sopt)
Definition: basis_rep.cc:106
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
virtual const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & vdm(reference_element hat_K) const
Definition: basis.h:428
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:456
piola_fem< T > _piola_fem
Definition: basis.h:394
const std::string & valued() const
Definition: basis.h:239
void _initialize_data_guard(reference_element hat_K) const
Definition: basis_rep.cc:126
basis_option _sopt
Definition: basis.h:393
std::array< bool, reference_element::max_variant > _have_initialize_data
Definition: basis.h:397
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:257
virtual bool is_nodal() const =0
std::array< std::array< size_type,reference_element::max_variant >,4 > _ndof_on_subgeo
Definition: basis.h:404
size_type nnod_on_subgeo(size_type map_dim, size_type subgeo_variant) const
Definition: basis.h:254
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:251
size_type first_inod_by_dimension(reference_element hat_K, size_type dim) const
Definition: basis.h:260
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:392
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
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:419
virtual const class basis_basic< T > & operator[](size_type i_comp) const
Definition: basis.h:766
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
virtual size_type degree() const =0
void _clear() const
Definition: basis_rep.cc:120
virtual const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & inv_vdm(reference_element hat_K) const
Definition: basis.h:437
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:173
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:644
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:261
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:486
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