v0.8.16
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 data
43  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(
57  const Interface &moab,const EntityHandle meshset
58  );
59 
60  /** \brief Get tensor dimension
61 
62  This is general two point tensor \f$\mathbf{T}\f$ of type
63  \f[
64  \left(
65  \begin{array}{cc}
66  q & l \\
67  p & m
68  \end{array}
69  \right)
70  \f]
71  at point \f$\mathbf{X} \in \mathcal{B}\f$ over mapping
72  \f[
73  \phi: \mathcal{B} \to \mathcal{S}
74  \f]
75  is a multilinear mapping
76  \f[
77  \mathbf{T}:
78  (
79  T^*_\mathbf{X}\mathcal{B}\times\dots\times T^*_\mathbf{X}\mathcal{B}
80  ) \times
81  (
82  T_\mathbf{X}\mathcal{B}\times\dots\times T_\mathbf{X}\mathcal{B}
83  ) \times
84  (
85  T^*_\mathbf{x}\mathcal{S}\times\dots\times T^*_\mathbf{x}\mathcal{S}
86  ) \times
87  (
88  T_\mathbf{x}\mathcal{B}\times\dots\times T_\mathbf{x}\mathcal{B}
89  )
90  \to \mathbb{R}
91  \f]
92  where \f$\mathbf{x} = \phi(\mathbf{X})\f$. See details in \cite marsden1994mathematical
93 
94  \param d = 0,1,2,3 is equivalent to q,l,o and m respectively.
95 
96  */
97  inline int getDim(const int d) const {
98  return tagCoordSysDim[d];
99  };
100 
101 
102  virtual MoFEMErrorCode get_E_Base(const double m[]) const {
104  SETERRQ(PETSC_COMM_SELF,MOFEM_NOT_IMPLEMENTED,"not implemented");
106  }
107 
108  virtual MoFEMErrorCode get_E_DualBase(const double m[]) const {
110  SETERRQ(PETSC_COMM_SELF,MOFEM_NOT_IMPLEMENTED,"not implemented");
112  }
113 
114  virtual MoFEMErrorCode get_e_Base(const double m[]) const {
116  SETERRQ(PETSC_COMM_SELF,MOFEM_NOT_IMPLEMENTED,"not implemented");
118  }
119 
120  virtual MoFEMErrorCode get_e_DualBase(const double m[]) const {
122  SETERRQ(PETSC_COMM_SELF,MOFEM_NOT_IMPLEMENTED,"not implemented");
124  }
125 
126  inline EntityHandle getMeshset() const { return meshSet; };
127  inline boost::string_ref getNameRef() const { return boost::string_ref((char *)tagCoordSysName,tagCoordSysNameSize); };
128  inline std::string getName() const { return std::string((char *)tagCoordSysName,tagCoordSysNameSize); };
129  };
130 
131  typedef multi_index_container<
132  boost::shared_ptr<CoordSys>,
133  indexed_by<
134  ordered_unique<
135  tag<Meshset_mi_tag>, member<CoordSys,EntityHandle,&CoordSys::meshSet>
136  >,
137  ordered_unique<
138  tag<CoordSysName_mi_tag>, const_mem_fun<CoordSys,boost::string_ref,&CoordSys::getNameRef>
139  >
141 
142 }
143 
144 #endif //__COORDSYSMULTIINDICES_HPP__
145 
146 /***************************************************************************//**
147  * \defgroup coordsys_multi_indices Coordinate system of tensor field
148  * \ingroup mofem
149  ******************************************************************************/
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Common.hpp:60
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:483
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
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:490
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...
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.