Skip to content
Snippets Groups Projects
Commit c425c436 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Forbid MeshLineNodeBoundary in dimension 1

parent f0766980
No related branches found
No related tags found
1 merge request!140Change referenced item list policy
...@@ -34,14 +34,6 @@ MeshLineNodeBoundary<Dimension>::_checkBoundaryIsLine(const TinyVector<Dimension ...@@ -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 <>
template <> template <>
TinyVector<2> TinyVector<2>
...@@ -142,6 +134,5 @@ getMeshLineNodeBoundary(const Mesh<Connectivity<Dimension>>& mesh, const IBounda ...@@ -142,6 +134,5 @@ getMeshLineNodeBoundary(const Mesh<Connectivity<Dimension>>& mesh, const IBounda
throw NormalError(ost.str()); 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<2> getMeshLineNodeBoundary(const Mesh<Connectivity<2>>&, const IBoundaryDescriptor&);
template MeshLineNodeBoundary<3> getMeshLineNodeBoundary(const Mesh<Connectivity<3>>&, const IBoundaryDescriptor&); template MeshLineNodeBoundary<3> getMeshLineNodeBoundary(const Mesh<Connectivity<3>>&, const IBoundaryDescriptor&);
...@@ -9,6 +9,8 @@ class [[nodiscard]] MeshLineNodeBoundary final ...@@ -9,6 +9,8 @@ class [[nodiscard]] MeshLineNodeBoundary final
: public MeshNodeBoundary<Dimension> // clazy:exclude=copyable-polymorphic : public MeshNodeBoundary<Dimension> // clazy:exclude=copyable-polymorphic
{ {
public: public:
static_assert(Dimension > 1, "MeshNodeBoundary makes only sense in dimension greater than 1");
using Rd = TinyVector<Dimension, double>; using Rd = TinyVector<Dimension, double>;
private: private:
......
...@@ -96,6 +96,7 @@ class MeshRandomizerHandler::MeshRandomizer ...@@ -96,6 +96,7 @@ class MeshRandomizerHandler::MeshRandomizer
}); });
} else if constexpr (std::is_same_v<BCType, AxisBoundaryCondition>) { } else if constexpr (std::is_same_v<BCType, AxisBoundaryCondition>) {
if constexpr (Dimension > 1) {
const Rd& t = bc.direction(); const Rd& t = bc.direction();
const Rdxd txt = tensorProduct(t, t); const Rdxd txt = tensorProduct(t, t);
...@@ -107,6 +108,9 @@ class MeshRandomizerHandler::MeshRandomizer ...@@ -107,6 +108,9 @@ class MeshRandomizerHandler::MeshRandomizer
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>) { } else if constexpr (std::is_same_v<BCType, FixedBoundaryCondition>) {
const Array<const NodeId>& node_list = bc.nodeList(); const Array<const NodeId>& node_list = bc.nodeList();
...@@ -300,6 +304,14 @@ class MeshRandomizerHandler::MeshRandomizer<Dimension>::AxisBoundaryCondition ...@@ -300,6 +304,14 @@ class MeshRandomizerHandler::MeshRandomizer<Dimension>::AxisBoundaryCondition
~AxisBoundaryCondition() = default; ~AxisBoundaryCondition() = default;
}; };
template <>
class MeshRandomizerHandler::MeshRandomizer<1>::AxisBoundaryCondition
{
public:
AxisBoundaryCondition() = default;
~AxisBoundaryCondition() = default;
};
template <size_t Dimension> template <size_t Dimension>
class MeshRandomizerHandler::MeshRandomizer<Dimension>::FixedBoundaryCondition class MeshRandomizerHandler::MeshRandomizer<Dimension>::FixedBoundaryCondition
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment