v0.14.0
BaseFunction.hpp
Go to the documentation of this file.
1 /** \file BaseFunction.hpp
2 \brief General implementation of base function
3 
4 */
5 
6 
7 
8 #ifndef __BASEFUNCTION_HPP__
9 #define __BASEFUNCTION_HPP__
10 
11 namespace MoFEM {
12 
14 
15  using UnknownInterface::UnknownInterface;
16 
17  virtual MoFEMErrorCode
18  query_interface(boost::typeindex::type_index type_index,
19  UnknownInterface **iface) const = 0;
20 
21  virtual ~BaseFunctionUnknownInterface() = default;
22 };
23 
24 /**
25  * \brief Base class used to exchange data between element data structures and
26  * class calculating base functions \ingroup mofem_base_functions
27  */
29 
30  MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
31  UnknownInterface **iface) const;
32 
33  using BaseFunctionUnknownInterface::BaseFunctionUnknownInterface;
34 };
35 
36 /**
37  * \brief Base class if inherited used to calculate base functions
38  * \ingroup mofem_base_functions
39  */
41 
42  struct DofsSideMapData {
43  EntityType type;
44  int side;
45  int dof;
46  };
47 
48  /**
49  * @brief Map entity stype and side to element/entity dof index
50  *
51  * Such map is used to establish connection between dofs in the interior for
52  * broken specs. Is assume that trace of interior on given side is not zero.
53  *
54  */
55  using DofsSideMap = multi_index_container<
56 
58 
59  indexed_by<
60  ordered_non_unique<
61  tag<TypeSide_mi_tag>,
62  composite_key<
63 
65  member<DofsSideMapData, EntityType, &DofsSideMapData::type>,
66  member<DofsSideMapData, int, &DofsSideMapData::side>>>,
67 
68  ordered_unique<tag<EntDofIdx_mi_tag>, // This is number of base
69  // function, i.e.
70  // std::floor(dof/nb_coeffs)
71  member<DofsSideMapData, int, &DofsSideMapData::dof>>
72 
73  >>;
74 
75  MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
76  MoFEM::UnknownInterface **iface) const;
77 
78  using BaseFunctionUnknownInterface::BaseFunctionUnknownInterface;
79 
81  boost::shared_ptr<BaseFunctionCtx> ctx_ptr);
82 
83  virtual MoFEMErrorCode getValue(MatrixDouble &pts_x, MatrixDouble &pts_t,
84  boost::shared_ptr<BaseFunctionCtx> ctx_ptr);
85 
86 };
87 
88 } // namespace MoFEM
89 
90 #endif //__BASEFUNCTION_HPP__
91 
92 /**
93  * \defgroup mofem_base_functions Base functions
94  *
95  * \brief Calculation of base functions at integration points.
96  *
97  * \ingroup mofem
98  **/
UBlasMatrix< double >
MoFEM::BaseFunction::DofsSideMap
multi_index_container< DofsSideMapData, indexed_by< ordered_non_unique< tag< TypeSide_mi_tag >, composite_key< DofsSideMapData, member< DofsSideMapData, EntityType, &DofsSideMapData::type >, member< DofsSideMapData, int, &DofsSideMapData::side > >>, ordered_unique< tag< EntDofIdx_mi_tag >, member< DofsSideMapData, int, &DofsSideMapData::dof > > > > DofsSideMap
Map entity stype and side to element/entity dof index.
Definition: BaseFunction.hpp:73
MoFEM::BaseFunction::query_interface
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, MoFEM::UnknownInterface **iface) const
Definition: BaseFunction.cpp:17
MoFEM::BaseFunction::DofsSideMapData::type
EntityType type
Definition: BaseFunction.hpp:43
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::BaseFunction
Base class if inherited used to calculate base functions.
Definition: BaseFunction.hpp:40
MoFEM::BaseFunctionCtx::query_interface
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Definition: BaseFunction.cpp:10
MoFEM::BaseFunctionCtx
Base class used to exchange data between element data structures and class calculating base functions...
Definition: BaseFunction.hpp:28
MoFEM::BaseFunction::getValue
virtual MoFEMErrorCode getValue(MatrixDouble &pts, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
Definition: BaseFunction.cpp:24
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MoFEM::BaseFunction::DofsSideMapData::dof
int dof
Definition: BaseFunction.hpp:45
MoFEM::BaseFunctionUnknownInterface::~BaseFunctionUnknownInterface
virtual ~BaseFunctionUnknownInterface()=default
MoFEM::BaseFunctionUnknownInterface::query_interface
virtual MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const =0
MoFEM::BaseFunctionUnknownInterface
Definition: BaseFunction.hpp:13
MoFEM::UnknownInterface
base class for all interface classes
Definition: UnknownInterface.hpp:34
MoFEM::BaseFunction::DofsSideMapData
Definition: BaseFunction.hpp:42
MoFEM::BaseFunction::DofsSideMapData::side
int side
Definition: BaseFunction.hpp:44