Skip to content
Snippets Groups Projects
Commit d6e682b0 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Quit counting nodes unnecessarily

parent 0f1126b9
No related branches found
No related tags found
No related merge requests found
...@@ -57,29 +57,11 @@ void setup_boundary(GridType const &grid, ...@@ -57,29 +57,11 @@ void setup_boundary(GridType const &grid,
size_t dirichlet_nodes = 0; size_t dirichlet_nodes = 0;
size_t neumann_nodes = 0; size_t neumann_nodes = 0;
size_t frictional_nodes = 0; size_t frictional_nodes = 0;
size_t bounding_nodes = 0;
size_t extremal_nodes = 0;
size_t overall_nodes = 0;
for (VertexLeafIterator it = leafView.template begin<dim>(); for (VertexLeafIterator it = leafView.template begin<dim>();
it != leafView.template end<dim>(); ++it) { it != leafView.template end<dim>(); ++it) {
Dune::GeometryType const gt = it->type(); Dune::GeometryType const gt = it->type();
assert(it->geometry().corners() == 1); assert(it->geometry().corners() == 1);
Dune::FieldVector<double, dim> const coordinates = it->geometry().corner(0); Dune::FieldVector<double, dim> const coordinates = it->geometry().corner(0);
bool bounding(false);
bool extremal(true);
++overall_nodes;
for (int i = 0; i < dim; ++i) {
if (coordinates[i] == end_points[i] || coordinates[i] == 0) {
bounding = true;
break;
}
}
for (int i = 0; i < dim; ++i) {
if (coordinates[i] != end_points[i] && coordinates[i] != 0) {
extremal = false;
break;
}
}
if (coordinates[0] == end_points[0]) { if (coordinates[0] == end_points[0]) {
++dirichlet_nodes; ++dirichlet_nodes;
size_t const id = myVertexMapper.map(*it); size_t const id = myVertexMapper.map(*it);
...@@ -93,21 +75,10 @@ void setup_boundary(GridType const &grid, ...@@ -93,21 +75,10 @@ void setup_boundary(GridType const &grid,
size_t const id = myVertexMapper.map(*it); size_t const id = myVertexMapper.map(*it);
frictionalNodes[id] = true; frictionalNodes[id] = true;
} }
if (bounding) {
++bounding_nodes;
size_t const id = myVertexMapper.map(*it);
}
if (extremal) {
++extremal_nodes;
size_t const id = myVertexMapper.map(*it);
}
} }
std::cout << "Number of Neumann nodes: " << neumann_nodes << std::endl; std::cout << "Number of Neumann nodes: " << neumann_nodes << std::endl;
std::cout << "Number of Dirichlet nodes: " << dirichlet_nodes << std::endl; std::cout << "Number of Dirichlet nodes: " << dirichlet_nodes << std::endl;
std::cout << "Number of frictional nodes: " << dirichlet_nodes << std::endl; std::cout << "Number of frictional nodes: " << dirichlet_nodes << std::endl;
std::cout << "Number of bounding nodes: " << bounding_nodes << std::endl;
std::cout << "Number of extremal nodes: " << extremal_nodes << std::endl;
std::cout << "Number of nodes: " << overall_nodes << std::endl;
} }
// Assembles Neumann boundary term in f // Assembles Neumann boundary term in f
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment