v0.11.1
VolumeElementForcesAndSourcesCoreOnContactPrismSide.hpp
Go to the documentation of this file.
1 /** \file VolumeElementForcesAndSourcesCoreOnContactPrismSide.hpp
2  \brief Volume element.
3 
4  Those element are inherited by user to implement specific implementation of
5  particular problem.
6 
7 */
8 
9 /* This file is part of MoFEM.
10  * MoFEM is free software: you can redistribute it and/or modify it under
11  * the terms of the GNU Lesser General Public License as published by the
12  * Free Software Foundation, either version 3 of the License, or (at your
13  * option) any later version.
14  *
15  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
16  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18  * License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>. */
22 
23 #ifndef __VOLUMEELEMENTFORCESANDSOURCESCORE_ONVOLUMESIDE_HPP__
24 #define __VOLUMEELEMENTFORCESANDSOURCESCORE_ONVOLUMESIDE_HPP__
25 
26 using namespace boost::numeric;
27 
28 namespace MoFEM {
29 
30 /**
31  * \brief Base volume element used to integrate on contact surface (could be
32  * extended to other volume elements) \ingroup
33  * mofem_forces_and_sources_volume_element
34  */
37 
39 
40  /**
41  * @brief Get the face nodes mapped on volume element
42  *
43  * \todo That this is not general, e.g., for quad number of nodes is 4.
44  *
45  * @return const std::array<int, 3>&
46  */
47  inline const std::array<int, 3> &getFaceConnMap() const;
48 
49  /**
50  * @brief Get face nodes maped on volume
51  *
52  * \todo That this is not general, e.g., for prism or hex, size of fixed array
53  * is wrong.
54  *
55  * @return const sdt::array<int, 4>&
56  */
57  inline const std::array<int, 4> &getTetConnMap() const;
58 
59  /**
60  * @brief Get node on volume opposite to volume element
61  *
62  * \todo That this is not general, e.g., for prism or hex, opposite node is
63  * not unique.
64  *
65  * @return int
66  */
67  inline int getOppositeNode() const;
68 
69  /**
70  * @brief Sense face on volume
71  *
72  * @return int
73  */
74  inline int getFaceSense() const;
75 
76  /**
77  * @brief Face number on the volume
78  *
79  * @return int
80  */
81  inline int getFaceSideNumber() const;
82 
83  /** \brief default operator for TET element
84  * \ingroup mofem_forces_and_sources_volume_element
85  */
88 
90 
92  getVolumeFE() const;
93 
94  inline ContactPrismElementForcesAndSourcesCore *getContactFE() const;
95 
96  /** \brief get face coordinates at Gauss pts.
97 
98  \note Coordinates should be the same what function getMasterCoordsAtGaussPts
99  on tets is returning. If both coordinates are different it is error, or you
100  do something very unusual.
101 
102  */
103  inline MatrixDouble &getMasterCoordsAtGaussPts();
104 
105  /** \brief get face coordinates at Gauss pts.
106 
107  \note Coordinates should be the same what function getSlaveCoordsAtGaussPts
108  on tets is returning. If both coordinates are different it is error, or you
109  do something very unusual.
110 
111  */
112  inline MatrixDouble &getSlaveCoordsAtGaussPts();
113 
114  /**
115  * \brief get face sense in respect to volume
116  * @return error code
117  */
118  inline int getFaceSense() const;
119 
120  /**
121  * \brief get face side number in respect to volume
122  * @return error code
123  */
124  inline int getFaceSideNumber() const;
125  };
126 
127  int getRule(int order);
128  MoFEMErrorCode setGaussPts(int order);
129 
130 private:
131  int faceSense; ///< Sense of face, could be 1 or -1
132  int faceSideNumber; ///< Face side number
133  std::array<int, 3> faceConnMap;
134  std::array<int, 4> tetConnMap;
136 };
137 
138 /**
139  * @brief Volume side finite element with switches
140  *
141  * Using SWITCH to off functions
142  *
143  * @tparam SWITCH
144  */
145 template <int SWITCH>
148 
149  using VolumeElementForcesAndSourcesCoreOnContactPrismSideBase::
150  VolumeElementForcesAndSourcesCoreOnContactPrismSideBase;
151 
154 
155  MoFEMErrorCode operator()();
156 };
157 
158 /** \brief Volume element used to integrate on contact element (could be
159  extended for other volume elements) \ingroup
160  mofem_forces_and_sources_volume_element
161 
162  */
165 
166 const std::array<int, 3> &
167 VolumeElementForcesAndSourcesCoreOnContactPrismSideBase::getFaceConnMap() const {
168  return faceConnMap;
169 }
170 
171 const std::array<int, 4> &
172 VolumeElementForcesAndSourcesCoreOnContactPrismSideBase::getTetConnMap() const {
173  return tetConnMap;
174 }
175 
176 int VolumeElementForcesAndSourcesCoreOnContactPrismSideBase::getOppositeNode() const {
177  return oppositeNode;
178 }
179 
180 int VolumeElementForcesAndSourcesCoreOnContactPrismSideBase::getFaceSense() const {
181  return faceSense;
182 }
183 
184 int VolumeElementForcesAndSourcesCoreOnContactPrismSideBase::getFaceSideNumber()
185  const {
186  return faceSideNumber;
187 }
188 
190 VolumeElementForcesAndSourcesCoreOnContactPrismSideBase::UserDataOperator::
191  getVolumeFE() const {
193  ptrFE);
194 }
195 
197 VolumeElementForcesAndSourcesCoreOnContactPrismSideBase::UserDataOperator::
198  getContactFE() const {
199  return static_cast<ContactPrismElementForcesAndSourcesCore *>(
200  getVolumeFE()->sidePtrFE);
201 }
202 
203 MatrixDouble &VolumeElementForcesAndSourcesCoreOnContactPrismSideBase::
204  UserDataOperator::getMasterCoordsAtGaussPts() {
205  return getContactFE()->getGaussPtsMasterFromEleSide();
206 }
207 
208 MatrixDouble &VolumeElementForcesAndSourcesCoreOnContactPrismSideBase::
209  UserDataOperator::getSlaveCoordsAtGaussPts() {
210  return getContactFE()->getGaussPtsSlaveFromEleSide();
211 }
212 
213 int VolumeElementForcesAndSourcesCoreOnContactPrismSideBase::UserDataOperator::
214  getFaceSense() const {
215  return getVolumeFE()->faceSense;
216 }
217 
218 int VolumeElementForcesAndSourcesCoreOnContactPrismSideBase::UserDataOperator::
219  getFaceSideNumber() const {
220  return getVolumeFE()->faceSideNumber;
221 }
222 
223 template <int SWITCH>
225 operator()() {
226  return OpSwitch<SWITCH>();
227 }
228 
229 } // namespace MoFEM
230 
231 #endif //__VOLUMEELEMENTFORCESANDSOURCESCORE_ONVOLUMESIDE_HPP__
ForcesAndSourcesCore::UserDataOperator UserDataOperator
VolumeElementForcesAndSourcesCoreSwitch< 0 > VolumeElementForcesAndSourcesCore
Volume finite element default.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:67
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:76
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
Base volume element used to integrate on contact surface (could be extended to other volume elements)...