NiHu  2.0
elastostatics_2d_standalone.cpp
1 #include <boost/math/constants/constants.hpp>
2 
3 #include "core/mesh.hpp"
7 #include "library/lib_mesh.hpp"
8 
10 
11 typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> dMatrix;
12 typedef Eigen::Matrix<double, Eigen::Dynamic, 1> dVector;
13 typedef Eigen::Matrix<unsigned, Eigen::Dynamic, Eigen::Dynamic> uMatrix;
14 
15 int main()
16 {
17  float R = 1.0;
18  size_t N = 500;
19  auto mesh = NiHu::create_circle_mesh(R, N);
20  auto const &space = NiHu::constant_view(mesh, NiHu::field_dimension::_2d());
21  auto const &tst_space = space;
22 
23  size_t n = space.get_num_dofs();
24  std::cout << "number of DOFs: " << n << std::endl;
25  dMatrix II(n, n);
26  dMatrix LL(n, n);
27  dMatrix MM(n, n);
28  II.setZero();
29  LL.setZero();
30  MM.setZero();
31 
33  float nu = .3f, mu = 1.0f;
36 
37  II << tst_space * I[space];
38  LL << tst_space * L[space];
39  MM << tst_space * M[space];
40 
41  std::cout << II.topLeftCorner(10, 10) << std::endl << std::endl;
42  std::cout << LL.topLeftCorner(10, 10) << std::endl << std::endl;
43  std::cout << MM.topLeftCorner(10, 10) << std::endl;
44 
45  return 0;
46 }
NiHu::create_integral_operator
integral_operator< Kernel > create_integral_operator(Kernel &&kernel)
factory function of an integral operator
Definition: integral_operator.hpp:421
elastostatics_kernel.hpp
implementation of fundamental solutions of elastostatics
NiHu::create_circle_mesh
NiHu::mesh< tmp::vector< typename NiHu::tag2type< ElemTag >::type > > create_circle_mesh(double r, size_t nElem, orientation ori=outward, ElemTag tag=ElemTag())
Create a homogeneous circular boundary mesh.
Definition: lib_mesh.hpp:32
NiHu::elastostatics_2d_T_kernel
2d traction kernel for elastostatics
Definition: elastostatics_kernel.hpp:188
elastostatics_singular_integrals.hpp
Analytical expressions for the singular integrals of elastostatic kernels.
lib_mesh.hpp
Utility functions for basic mesh generation.
NiHu::constant_view
const function_space_view< Mesh, field_option::constant, Dimension > & constant_view(mesh_base< Mesh > const &msh, Dimension dim=Dimension())
factory function to transform a mesh into a constant function space
Definition: function_space.hpp:304
weighted_residual.hpp
declaration of class NiHu::weighted_residual
lib_element.hpp
NiHu::mex::real_matrix
Definition: mex_matrix_separate.hpp:133
NiHu::elastostatics_2d_U_kernel
The displacement kernel of 2D elastostatics.
Definition: elastostatics_kernel.hpp:115
NiHu::identity_integral_operator
The identity integral operator .
Definition: integral_operator.hpp:310
mesh.hpp
Declaration of class Mesh.