46 m_nnode = (m_nelx + 1) * (m_nely + 1);
47 m_nelem = m_nelx * m_nely * 2;
54 size_t nelx_impl()
const
59 size_t nely_impl()
const
69 array_type::tensor<double, 2> coor_impl()
const
71 array_type::tensor<double, 2>
ret = xt::empty<double>({m_nnode, m_ndim});
73 array_type::tensor<double, 1>
x =
74 xt::linspace<double>(0.0, m_h *
static_cast<double>(m_nelx), m_nelx + 1);
75 array_type::tensor<double, 1>
y =
76 xt::linspace<double>(0.0, m_h *
static_cast<double>(m_nely), m_nely + 1);
80 for (
size_t iy = 0;
iy < m_nely + 1; ++
iy) {
81 for (
size_t ix = 0;
ix < m_nelx + 1; ++
ix) {
91 array_type::tensor<size_t, 2> conn_impl()
const
93 array_type::tensor<size_t, 2>
ret = xt::empty<size_t>({m_nelem, m_nne});
97 for (
size_t iy = 0;
iy < m_nely; ++
iy) {
98 for (
size_t ix = 0;
ix < m_nelx; ++
ix) {
113 array_type::tensor<size_t, 1> nodesBottomEdge_impl()
const
115 array_type::tensor<size_t, 1>
ret = xt::empty<size_t>({m_nelx + 1});
117 for (
size_t ix = 0;
ix < m_nelx + 1; ++
ix) {
124 array_type::tensor<size_t, 1> nodesTopEdge_impl()
const
126 array_type::tensor<size_t, 1>
ret = xt::empty<size_t>({m_nelx + 1});
128 for (
size_t ix = 0;
ix < m_nelx + 1; ++
ix) {
129 ret(
ix) =
ix + m_nely * (m_nelx + 1);
135 array_type::tensor<size_t, 1> nodesLeftEdge_impl()
const
137 array_type::tensor<size_t, 1>
ret = xt::empty<size_t>({m_nely + 1});
139 for (
size_t iy = 0;
iy < m_nely + 1; ++
iy) {
146 array_type::tensor<size_t, 1> nodesRightEdge_impl()
const
148 array_type::tensor<size_t, 1>
ret = xt::empty<size_t>({m_nely + 1});
150 for (
size_t iy = 0;
iy < m_nely + 1; ++
iy) {
151 ret(
iy) =
iy * (m_nelx + 1) + m_nelx;
157 array_type::tensor<size_t, 1> nodesBottomOpenEdge_impl()
const
159 array_type::tensor<size_t, 1>
ret = xt::empty<size_t>({m_nelx - 1});
161 for (
size_t ix = 1;
ix < m_nelx; ++
ix) {
168 array_type::tensor<size_t, 1> nodesTopOpenEdge_impl()
const
170 array_type::tensor<size_t, 1>
ret = xt::empty<size_t>({m_nelx - 1});
172 for (
size_t ix = 1;
ix < m_nelx; ++
ix) {
173 ret(
ix - 1) =
ix + m_nely * (m_nelx + 1);
179 array_type::tensor<size_t, 1> nodesLeftOpenEdge_impl()
const
181 array_type::tensor<size_t, 1>
ret = xt::empty<size_t>({m_nely - 1});
183 for (
size_t iy = 1;
iy < m_nely; ++
iy) {
184 ret(
iy - 1) =
iy * (m_nelx + 1);
190 array_type::tensor<size_t, 1> nodesRightOpenEdge_impl()
const
192 array_type::tensor<size_t, 1>
ret = xt::empty<size_t>({m_nely - 1});
194 for (
size_t iy = 1;
iy < m_nely; ++
iy) {
195 ret(
iy - 1) =
iy * (m_nelx + 1) + m_nelx;
201 size_t nodesBottomLeftCorner_impl()
const
206 size_t nodesBottomRightCorner_impl()
const
211 size_t nodesTopLeftCorner_impl()
const
213 return m_nely * (m_nelx + 1);
216 size_t nodesTopRightCorner_impl()
const
218 return m_nely * (m_nelx + 1) + m_nelx;