v0.10.0
SurfacePressureComplexForLazy.hpp
Go to the documentation of this file.
1 /* \file SurfacePressureComplexForLazy.hpp
2  *
3  * This file is part of MoFEM.
4  * MoFEM is free software: you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License as published by the
6  * Free Software Foundation, either version 3 of the License, or (at your
7  * option) any later version.
8  *
9  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12  * License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>. */
16 
17 #ifndef __COMPLEX_FOR_LAZY_NEUMANN_FORCES_HPP__
18 #define __COMPLEX_FOR_LAZY_NEUMANN_FORCES_HPP__
19 
20 /** \brief NonLinear surface pressure element (obsolete implementation)
21  * \ingroup nonlinear_elastic_elem
22 
23  \todo This is old implementation, need to be reimplemented, using
24  auto-differentiation. It is well tested and works. well.
25 
26  */
28 
29  struct MyTriangleSpatialFE;
32 
34  AuxMethodSpatial(const string &field_name, MyTriangleSpatialFE *my_ptr,
35  const char type);
36  MoFEMErrorCode doWork(int side, EntityType type,
38  };
39 
42 
44  AuxMethodMaterial(const string &field_name, MyTriangleSpatialFE *my_ptr,
45  const char type);
46  MoFEMErrorCode doWork(int side, EntityType type,
48  };
49 
51 
52  double *sCaleLhs;
53  double *sCaleRhs;
54  enum FORCES { CONSERVATIVE = 1, NONCONSERVATIVE = 2 };
55 
57  const double eps;
58  bool uSeF;
60 
61  Mat Aij;
62  Vec F;
63 
64  MyTriangleSpatialFE(MoFEM::Interface &_mField, Mat _Aij, Vec &_F,
65  double *scale_lhs, double *scale_rhs,
66  std::string spatial_field_name = "SPATIAL_POSITION",
67  std::string mat_field_name = "MESH_NODE_POSITIONS");
68 
69  int getRule(int order) { return max(1, order); };
70 
71  double *N;
72  double *N_face;
73  double *N_edge[3];
74  double *diffN;
75  double *diffN_face;
76  double *diffN_edge[3];
77 
79  int order_edge[3];
80  double *dofs_x;
81  double *dofs_x_edge[3];
82  double *dofs_x_face;
83  double *idofs_x;
84  double *idofs_x_edge[3];
85  double *idofs_x_face;
89 
92  double *dofs_X;
93  double *dofs_X_edge[3];
94  double *dofs_X_face;
95  double *idofs_X;
96  double *idofs_X_edge[3];
97  double *idofs_X_face;
98 
100 
103  double *t_loc;
104 
105  ublas::vector<int> dOfs_x_indices, dOfs_x_face_indices;
106  ublas::vector<ublas::vector<int>> dOfs_x_edge_indices;
107  ublas::vector<int> dOfs_X_indices, dOfs_X_face_indices;
108  ublas::vector<ublas::vector<int>> dOfs_X_edge_indices;
109 
111  ublas::vector<VectorDouble> dOfs_x_edge;
113  ublas::vector<VectorDouble> dOfs_X_edge;
114 
116  ublas::vector<VectorDouble> fExtEdge;
117  double *Fext_edge[3];
118 
120  ublas::vector<MatrixDouble> kExtEdgeNode;
121  double *Kext_edge_node[3];
122 
124  ublas::vector<MatrixDouble> kExtEdgeFace;
125  double *Kext_edge_face[3];
126 
127  ublas::vector<MatrixDouble> kExtFaceEdge, kExtNodeEdge;
128  ublas::matrix<MatrixDouble> kExtEdgeEdge;
129  double *Kext_node_edge[3];
130  double *Kext_face_edge[3];
131  double *Kext_edge_edge[3][3];
132 
133  virtual MoFEMErrorCode calcTraction();
134  virtual MoFEMErrorCode rHs();
135  virtual MoFEMErrorCode lHs();
136 
139 
140  MoFEMErrorCode addForce(int ms_id);
141  MoFEMErrorCode addPressure(int ms_id);
142 
144  return addPressure(ms_id);
145  }
146 
147  struct bCForce {
148  ForceCubitBcData data;
149  Range tRis;
150  };
151  map<int, bCForce> mapForce;
152  struct bCPressure {
153  PressureCubitBcData data;
154  Range tRis;
155  };
156  map<int, bCPressure> mapPressure;
158 
159  boost::ptr_vector<MethodForForceScaling> methodsOp;
160  };
161 
164 
165  Tag thScale;
166 
167  double *sCale;
170  *sCale = scale;
172  }
173 
175 
177  MoFEM::Interface &m_field, Mat _Aij, Vec _F, double *scale_lhs,
178  double *scale_rhs, std::string spatial_field_name = "SPATIAL_POSITION",
179  std::string material_field_name = "MESH_NODE_POSITIONS");
181  MoFEM::Interface &m_field, Mat _Aij, Vec _F,
182  std::string spatial_field_name = "SPATIAL_POSITION",
183  std::string material_field_name = "MESH_NODE_POSITIONS");
184 
185 private:
186  const std::string spatialField;
187  const std::string materialField;
188 };
189 
190 /**
191  * \depracted do not use name with spelling mistake.
192  */
195 
196 #endif //__COMPLEX_FOR_LAZY_NEUMANN_FORCES_HPP__
Deprecated interface functions.
AuxMethodMaterial(const string &field_name, MyTriangleSpatialFE *my_ptr, const char type)
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:509
MyTriangleSpatialFE(MoFEM::Interface &_mField, Mat _Aij, Vec &_F, double *scale_lhs, double *scale_rhs, std::string spatial_field_name="SPATIAL_POSITION", std::string mat_field_name="MESH_NODE_POSITIONS")
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:76
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
DEPRECATED typedef NeumannForcesSurfaceComplexForLazy NeummanForcesSurfaceComplexForLazy
DataForcesAndSourcesCore::EntData EntData
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:67
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
constexpr int order
#define DEPRECATED
Definition: definitions.h:29
AuxMethodSpatial(const string &field_name, MyTriangleSpatialFE *my_ptr, const char type)
NonLinear surface pressure element (obsolete implementation)
ublas::vector< double, DoubleAllocator > VectorDouble
Definition: Types.hpp:74
FaceElementForcesAndSourcesCoreSwitch< 0 > FaceElementForcesAndSourcesCore
Face finite element default.
MoFEMErrorCode reBaseToFaceLoocalCoordSystem(MatrixDouble &t_glob_nodal)
#define _F(n)
Definition: quad.c:25
NeumannForcesSurfaceComplexForLazy(MoFEM::Interface &m_field, Mat _Aij, Vec _F, double *scale_lhs, double *scale_rhs, std::string spatial_field_name="SPATIAL_POSITION", std::string material_field_name="MESH_NODE_POSITIONS")