File MeshTri3.h#
Generate simple meshes of 3-noded triangular elements in 2d (GooseFEM::Mesh::ElementType::Tri3).
- Copyright
Copyright 2017. Tom de Geus. All rights reserved.
- License: This project is released under the GNU Public License (GPLv3).
-
namespace GooseFEM
Toolbox to perform finite element computations.
-
namespace Mesh
Generic mesh operations, and simple mesh definitions.
-
namespace Tri3#
Simple meshes of and mesh operations for triangular elements of type ElementType::Tri3.
Functions
-
inline array_type::tensor<int, 1> getOrientation(const array_type::tensor<double, 2> &coor, const array_type::tensor<size_t, 2> &conn)#
Read the orientation of a mesh of triangular elements of type ElementType::Tri3.
- Parameters
coor – Nodal coordinates [nnode, ndim].
conn – Connectivity [nelem, nne].
- Returns
Orientation (-1 or +1) per element [nelem].
-
inline array_type::tensor<size_t, 2> setOrientation(const array_type::tensor<double, 2> &coor, const array_type::tensor<size_t, 2> &conn, const array_type::tensor<int, 1> &val, int orientation = -1)#
Set the orientation of a mesh of triangular elements of type ElementType::Tri3.
For efficiency this function reuses the output of getOrientation().
- Parameters
coor – Nodal coordinates [nnode, ndim].
conn – Connectivity [nelem, nne].
val – Current orientation per element (output of getOrientation()) [nelem].
orientation – Target orientation (applied to all elements).
- Returns
Connectivity (order of nodes-per-element may have changed) [nelem, nne].
-
inline array_type::tensor<size_t, 2> setOrientation(const array_type::tensor<double, 2> &coor, const array_type::tensor<size_t, 2> &conn, int orientation = -1)#
Set the orientation of a mesh of triangular elements of type ElementType::Tri3.
- Parameters
coor – Nodal coordinates [nnode, ndim].
conn – Connectivity [nelem, nne].
orientation – Target orientation (applied to all elements).
- Returns
Connectivity (order of nodes-per-element may have changed) [nelem, nne].
-
class Regular : public GooseFEM::Mesh::RegularBase2d<Regular>
- #include <GooseFEM/MeshTri3.h>
Regular grid of squares, with each square cut into two triangular elements.
Public Functions
-
inline Regular(size_t nelx, size_t nely, double h = 1.0)
Constructor.
- Parameters
nelx – Number of elements in x-direction.
nely – Number of elements in y-direction.
h – Edge-size (of the squares, and thus of two of three element-edges).
Private Functions
-
inline size_t nelx_impl() const#
-
inline size_t nely_impl() const#
-
inline ElementType elementType_impl() const#
-
inline array_type::tensor<double, 2> coor_impl() const#
-
inline array_type::tensor<size_t, 2> conn_impl() const#
-
inline array_type::tensor<size_t, 1> nodesBottomEdge_impl() const#
-
inline array_type::tensor<size_t, 1> nodesTopEdge_impl() const#
-
inline array_type::tensor<size_t, 1> nodesLeftEdge_impl() const#
-
inline array_type::tensor<size_t, 1> nodesRightEdge_impl() const#
-
inline array_type::tensor<size_t, 1> nodesBottomOpenEdge_impl() const#
-
inline array_type::tensor<size_t, 1> nodesTopOpenEdge_impl() const#
-
inline array_type::tensor<size_t, 1> nodesLeftOpenEdge_impl() const#
-
inline array_type::tensor<size_t, 1> nodesRightOpenEdge_impl() const#
-
inline size_t nodesBottomLeftCorner_impl() const#
-
inline size_t nodesBottomRightCorner_impl() const#
-
inline size_t nodesTopLeftCorner_impl() const#
-
inline size_t nodesTopRightCorner_impl() const#
Private Members
Friends
- friend class RegularBase< Regular >
- friend class RegularBase2d< Regular >
-
inline Regular(size_t nelx, size_t nely, double h = 1.0)
-
inline array_type::tensor<int, 1> getOrientation(const array_type::tensor<double, 2> &coor, const array_type::tensor<size_t, 2> &conn)#
-
namespace Tri3#
-
namespace Mesh