3 #include <Caribou/config.h>
4 #include <Caribou/constants.h>
5 #include <Caribou/Geometry/Element.h>
9 namespace caribou::geometry {
11 template<
typename Derived>
16 using LocalCoordinates =
typename Base::LocalCoordinates;
17 using WorldCoordinates =
typename Base::WorldCoordinates;
19 using GaussNode =
typename Base::GaussNode;
21 template <UNSIGNED_INTEGER_TYPE Dim>
22 using Vector =
typename Base::template Vector<Dim>;
24 template <UNSIGNED_INTEGER_TYPE Rows, UNSIGNED_INTEGER_TYPE Cols>
25 using Matrix =
typename Base::template Matrix<Rows, Cols>;
28 static constexpr
auto CanonicalDimension = Base::CanonicalDimension;
29 static constexpr
auto Dimension = Base::Dimension;
30 static constexpr
auto NumberOfNodesAtCompileTime = Base::NumberOfNodesAtCompileTime;
31 static constexpr
auto NumberOfGaussNodesAtCompileTime = Base::NumberOfGaussNodesAtCompileTime;
33 static_assert(Dimension == 2 or Dimension == 3,
"Quads can only be of dimension 2 or 3.");
35 using Size = Vector<CanonicalDimension>;
36 using Rotation = Matrix<Dimension,Dimension>;
64 inline auto rotation() const -> const Rotation & {
69 inline auto size() const -> const Size & {
74 inline auto T(
const LocalCoordinates & coordinates)
const -> WorldCoordinates {
75 if constexpr (Dimension == 2) {
79 p.template block<CanonicalDimension, 1>(0,0) = coordinates.cwiseProduct(
p_H / 2.);
89 inline auto get_number_of_nodes()
const {
return NumberOfNodesAtCompileTime;}
91 inline auto get_number_of_gauss_nodes()
const {
return NumberOfGaussNodesAtCompileTime;}
92 inline auto get_center()
const {
return p_center;};
94 inline auto get_number_of_boundary_elements() const -> UNSIGNED_INTEGER_TYPE {
return 4;};
96 auto self() -> Derived& {
return *
static_cast<Derived*
>(
this); }
97 auto self()
const ->
const Derived& {
return *
static_cast<const Derived*
>(
this); }
auto edges() const
Get the list of node indices of the edges.
Definition: BaseRectangularQuad.h:59
auto boundary_elements_node_indices() const -> const auto &
Get the list of node indices of the boundary elements.
Definition: Element.h:100
BaseRectangularQuad()
Default empty constructor.
Definition: BaseRectangularQuad.h:39
Definition: BaseRectangularQuad.h:12
BaseRectangularQuad(WorldCoordinates center, Size H, Rotation R)
Constructor by specifying the center point, the size (hx, hy, hz) and the rotation.
Definition: BaseRectangularQuad.h:51
Rotation p_R
Rotation matrix (a.k.a. the local coordinates frame) at the center of the quad.
Definition: BaseRectangularQuad.h:101
BaseRectangularQuad(WorldCoordinates center)
Constructor by specifying the center point.
Definition: BaseRectangularQuad.h:42
auto T(const LocalCoordinates &coordinates) const -> WorldCoordinates
Compute the transformation of a local position {u,v} to its world position {x,y[ ,...
Definition: BaseRectangularQuad.h:74
Size p_H
Size of the quad {hx, hy}.
Definition: BaseRectangularQuad.h:100
BaseRectangularQuad(WorldCoordinates center, Size H)
Constructor by specifying the center point and the size (hx, hy, hz)
Definition: BaseRectangularQuad.h:45
auto rotation() const -> const Rotation &
Get the rotation frame of the quad.
Definition: BaseRectangularQuad.h:64
WorldCoordinates p_center
Position of the center point of the quad.
Definition: BaseRectangularQuad.h:99
BaseRectangularQuad(WorldCoordinates center, Rotation R)
Constructor by specifying the center point and the rotation.
Definition: BaseRectangularQuad.h:48
auto center() const -> WorldCoordinates
Get the position at the center of the element.
Definition: Element.h:154
auto size() const -> const Size &
Get the size (hx, hy) of the quad.
Definition: BaseRectangularQuad.h:69