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

Fix boundary condition checking in 1D

Now checks that each boundary has only one node in parallel and *not* on each processor...
parent 62f9c7b1
No related branches found
No related tags found
No related merge requests found
......@@ -162,12 +162,21 @@ MeshFlatNodeBoundary<2>::_checkBoundaryIsFlat(const TinyVector<2, double>& norma
template <>
template <typename MeshType>
PUGS_INLINE TinyVector<1, double>
MeshFlatNodeBoundary<1>::_getNormal(const MeshType&)
MeshFlatNodeBoundary<1>::_getNormal(const MeshType& mesh)
{
static_assert(MeshType::Dimension == 1);
using R = TinyVector<1, double>;
if (m_node_list.size() != 1) {
const size_t number_of_bc_nodes = [&]() {
size_t number_of_bc_nodes = 0;
auto node_is_owned = mesh.connectivity().nodeIsOwned();
for (size_t i_node = 0; i_node < m_node_list.size(); ++i_node) {
number_of_bc_nodes += (node_is_owned[m_node_list[i_node]]);
}
return parallel::allReduceMax(number_of_bc_nodes);
}();
if (number_of_bc_nodes != 1) {
perr() << "Node boundaries in 1D require to have exactly 1 node\n";
std::exit(1);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment