v0.8.23
CoordSysMultiIndices.hpp
Go to the documentation of this file.
1 /** \file CoordSysMultiIndices.hpp
2  * \ingroup coordsys_multi_indices
3  * \brief Coordinate systems attached to DOFs
4  */
5 
6 /* MoFEM is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10 
11  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15 
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
18 */
19 
20 #ifndef __COORDSYSMULTIINDICES_HPP__
21 #define __COORDSYSMULTIINDICES_HPP__
22 
23 namespace MoFEM {
24 
25 /** \brief Structure for Coordinate system of two-point tensor
26 * \ingroup coordsys_multi_indices
27 
28 Scientific computing applications deal in physical quantities expressed as
29 tensors: scalars such as temperature, vectors such as velocity, and
30 second-order tensors such as stress. In practice, these are formally tensor
31 fields: a tensor field assigns a tensor to each point in a mathematical space
32 (typically a Euclidean space or manifold).
33 
34 Because tensors have a geometric interpretation, their underlying physical
35 meaning is independent of the coordinate system, very often on two coordinate
36 systems in reference and current configuration, in which they are defined; the
37 numerical value of a tensor depends on the coordinate systems, and so any
38 numerical instantiation of a tensor field is incomplete without a specification
39 of its coordinate system.
40 
41 In this data structure a generic two-point tensors are considered,
42 see \cite marsden1994mathematical. To each field \ref MoFEM::Field a CoordSys
43 data structure can be attached, carrying information about tensor structure
44 approximated by the field.
45 
46 Note: Some concepts and ideas are taken from iFiedl Interface specification
47 <https://redmine.scorec.rpi.edu/anonsvn/itaps/software/trunk/tools/doxygen/html/ifield.html>
48 
49 */
50 struct CoordSys {
51 
52  EntityHandle meshSet; ///< keeps entities for this meshset
53  const int *tagCoordSysDim;
54  const char *tagCoordSysName; ///< tag keeps name of the field
56  CoordSys(const Interface &moab, const EntityHandle meshset);
57 
58  /** \brief Get tensor dimension
59 
60  This is general two point tensor \f$\mathbf{T}\f$ of type
61  \f[
62  \left(
63  \begin{array}{cc}
64  q & l \\
65  p & m
66  \end{array}
67  \right)
68  \f]
69  at point \f$\mathbf{X} \in \mathcal{B}\f$ over mapping
70  \f[
71  \phi: \mathcal{B} \to \mathcal{S}
72  \f]
73  is a multilinear mapping
74  \f[
75  \mathbf{T}:
76  (
77  T^*_\mathbf{X}\mathcal{B}\times\dots\times T^*_\mathbf{X}\mathcal{B}
78  ) \times
79  (
80  T_\mathbf{X}\mathcal{B}\times\dots\times T_\mathbf{X}\mathcal{B}
81  ) \times
82  (
83  T^*_\mathbf{x}\mathcal{S}\times\dots\times T^*_\mathbf{x}\mathcal{S}
84  ) \times
85  (
86  T_\mathbf{x}\mathcal{B}\times\dots\times T_\mathbf{x}\mathcal{B}
87  )
88  \to \mathbb{R}
89  \f]
90  where \f$\mathbf{x} = \phi(\mathbf{X})\f$. See details in \cite
91  marsden1994mathematical
92 
93  \param d = 0,1,2,3 is equivalent to q,l,o and m respectively.
94 
95  */
96  inline int getDim(const int d) const { return tagCoordSysDim[d]; };
97 
98  virtual MoFEMErrorCode get_E_Base(const double m[]) const {
100  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
102  }
103 
104  virtual MoFEMErrorCode get_E_DualBase(const double m[]) const {
106  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
108  }
109 
110  virtual MoFEMErrorCode get_e_Base(const double m[]) const {
112  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
114  }
115 
116  virtual MoFEMErrorCode get_e_DualBase(const double m[]) const {
118  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
120  }
121 
122  inline EntityHandle getMeshset() const { return meshSet; };
123  inline boost::string_ref getNameRef() const {
124  return boost::string_ref((char *)tagCoordSysName, tagCoordSysNameSize);
125  };
126  inline std::string getName() const {
127  return std::string((char *)tagCoordSysName, tagCoordSysNameSize);
128  };
129 };
130 
131 typedef multi_index_container<
132  boost::shared_ptr<CoordSys>,
133  indexed_by<
134  ordered_unique<tag<Meshset_mi_tag>,
135  member<CoordSys, EntityHandle, &CoordSys::meshSet>>,
136  ordered_unique<
137  tag<CoordSysName_mi_tag>,
138  const_mem_fun<CoordSys, boost::string_ref, &CoordSys::getNameRef>>>>
140 
141 } // namespace MoFEM
142 
143 #endif //__COORDSYSMULTIINDICES_HPP__
144 
145 /**
146  * \defgroup coordsys_multi_indices Coordinate system of tensor field
147  * \ingroup mofem
148  **/
boost::string_ref getNameRef() const
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
const char * tagCoordSysName
tag keeps name of the field
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
multi_index_container< boost::shared_ptr< CoordSys >, indexed_by< ordered_unique< tag< Meshset_mi_tag >, member< CoordSys, EntityHandle, &CoordSys::meshSet > >, ordered_unique< tag< CoordSysName_mi_tag >, const_mem_fun< CoordSys, boost::string_ref, &CoordSys::getNameRef > > > > CoordSys_multiIndex
EntityHandle getMeshset() const
EntityHandle meshSet
keeps entities for this meshset
virtual MoFEMErrorCode get_E_Base(const double m[]) const
Structure for Coordinate system of two-point tensorScientific computing applications deal in physical...
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T * > &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: dTensor0.hpp:27
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:66
std::string getName() const
virtual MoFEMErrorCode get_E_DualBase(const double m[]) const
CoordSys(const Interface &moab, const EntityHandle meshset)
virtual MoFEMErrorCode get_e_DualBase(const double m[]) const
virtual MoFEMErrorCode get_e_Base(const double m[]) const
int getDim(const int d) const
Get tensor dimension.