diff --git a/src/mesh/MeshLineNodeBoundary.cpp b/src/mesh/MeshLineNodeBoundary.cpp index cae862f33dd9a60d5b0e895aba4907cf5a5b102a..c7e3bb97ae7d786294dbd3d24bd8209b600404b0 100644 --- a/src/mesh/MeshLineNodeBoundary.cpp +++ b/src/mesh/MeshLineNodeBoundary.cpp @@ -34,14 +34,6 @@ MeshLineNodeBoundary<Dimension>::_checkBoundaryIsLine(const TinyVector<Dimension } } -template <> -template <> -TinyVector<1> -MeshLineNodeBoundary<1>::_getDirection(const Mesh<Connectivity<1>>&) -{ - throw UnexpectedError("MeshLineNodeBoundary makes no sense in dimension 1"); -} - template <> template <> TinyVector<2> @@ -142,6 +134,5 @@ getMeshLineNodeBoundary(const Mesh<Connectivity<Dimension>>& mesh, const IBounda throw NormalError(ost.str()); } -template MeshLineNodeBoundary<1> getMeshLineNodeBoundary(const Mesh<Connectivity<1>>&, const IBoundaryDescriptor&); template MeshLineNodeBoundary<2> getMeshLineNodeBoundary(const Mesh<Connectivity<2>>&, const IBoundaryDescriptor&); template MeshLineNodeBoundary<3> getMeshLineNodeBoundary(const Mesh<Connectivity<3>>&, const IBoundaryDescriptor&); diff --git a/src/mesh/MeshLineNodeBoundary.hpp b/src/mesh/MeshLineNodeBoundary.hpp index 8694dd257247eb5aeaf2224d113a34c9c4c8fa32..3d9d989a0bd13c7253c82f5db850bc641a79396f 100644 --- a/src/mesh/MeshLineNodeBoundary.hpp +++ b/src/mesh/MeshLineNodeBoundary.hpp @@ -9,6 +9,8 @@ class [[nodiscard]] MeshLineNodeBoundary final : public MeshNodeBoundary<Dimension> // clazy:exclude=copyable-polymorphic { public: + static_assert(Dimension > 1, "MeshNodeBoundary makes only sense in dimension greater than 1"); + using Rd = TinyVector<Dimension, double>; private: diff --git a/src/mesh/MeshRandomizer.cpp b/src/mesh/MeshRandomizer.cpp index 34087ff69d78f1c2d2bfc83589350c376d5fea70..06028bab1c002c1898bed0e94d3e3d091d1db15c 100644 --- a/src/mesh/MeshRandomizer.cpp +++ b/src/mesh/MeshRandomizer.cpp @@ -96,17 +96,21 @@ class MeshRandomizerHandler::MeshRandomizer }); } else if constexpr (std::is_same_v<BCType, AxisBoundaryCondition>) { - const Rd& t = bc.direction(); + if constexpr (Dimension > 1) { + const Rd& t = bc.direction(); - const Rdxd txt = tensorProduct(t, t); + const Rdxd txt = tensorProduct(t, t); - const Array<const NodeId>& node_list = bc.nodeList(); - parallel_for( - node_list.size(), PUGS_LAMBDA(const size_t i_node) { - const NodeId node_id = node_list[i_node]; + const Array<const NodeId>& node_list = bc.nodeList(); + parallel_for( + node_list.size(), PUGS_LAMBDA(const size_t i_node) { + const NodeId node_id = node_list[i_node]; - shift[node_id] = txt * shift[node_id]; - }); + shift[node_id] = txt * shift[node_id]; + }); + } else { + throw UnexpectedError("AxisBoundaryCondition make no sense in dimension 1"); + } } else if constexpr (std::is_same_v<BCType, FixedBoundaryCondition>) { const Array<const NodeId>& node_list = bc.nodeList(); @@ -300,6 +304,14 @@ class MeshRandomizerHandler::MeshRandomizer<Dimension>::AxisBoundaryCondition ~AxisBoundaryCondition() = default; }; +template <> +class MeshRandomizerHandler::MeshRandomizer<1>::AxisBoundaryCondition +{ + public: + AxisBoundaryCondition() = default; + ~AxisBoundaryCondition() = default; +}; + template <size_t Dimension> class MeshRandomizerHandler::MeshRandomizer<Dimension>::FixedBoundaryCondition {