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

Handle extremal nodes

parent 52056891
Branches
No related tags found
No related merge requests found
...@@ -43,7 +43,7 @@ int main() { ...@@ -43,7 +43,7 @@ int main() {
double const nu = 0.3; double const nu = 0.3;
int const refinements = 5; int const refinements = 5;
size_t const solver_maxIterations = 10000; size_t const solver_maxIterations = 10000;
double const solver_tolerance = 1e-5; double const solver_tolerance = 1e-4;
typedef Dune::YaspGrid<dim> GridType; typedef Dune::YaspGrid<dim> GridType;
...@@ -98,26 +98,41 @@ int main() { ...@@ -98,26 +98,41 @@ int main() {
VertexMapper myVertexMapper(leafView); VertexMapper myVertexMapper(leafView);
size_t bounding_nodes = 0; size_t bounding_nodes = 0;
size_t extremal_nodes = 0;
for (VertexLeafIterator it = leafView.begin<dim>(); for (VertexLeafIterator it = leafView.begin<dim>();
it != leafView.end<dim>(); ++it) { it != leafView.end<dim>(); ++it) {
Dune::GeometryType gt = it->type(); Dune::GeometryType gt = it->type();
assert(it->geometry().corners() == 1); assert(it->geometry().corners() == 1);
SmallVector coordinates = it->geometry().corner(0); SmallVector coordinates = it->geometry().corner(0);
bool bounding(false); bool bounding(false);
bool extremal(true);
for (int i = 0; i < dim; ++i) { for (int i = 0; i < dim; ++i) {
if (coordinates[i] == end_points[i] || coordinates[i] == 0) { if (coordinates[i] == end_points[i] || coordinates[i] == 0) {
bounding = true; bounding = true;
break; break;
} }
} }
for (int i = 0; i < dim; ++i) {
if (coordinates[i] != end_points[i] && coordinates[i] != 0) {
extremal = false;
break;
}
}
if (bounding) { if (bounding) {
++bounding_nodes; ++bounding_nodes;
size_t id = myVertexMapper.map(*it); size_t id = myVertexMapper.map(*it);
std::cout << "Ignoring id #" << id << std::endl; std::cout << "Ignoring id #" << id << std::endl;
ignoreNodes[id] = true; ignoreNodes[id] = true;
} }
if (extremal) {
++extremal_nodes;
size_t id = myVertexMapper.map(*it);
// std::cout << "Ignoring id #" << id << std::endl;
// ignoreNodes[id] = true;
}
} }
std::cout << "Number of bounding nodes: " << bounding_nodes << std::endl; std::cout << "Number of bounding nodes: " << bounding_nodes << std::endl;
std::cout << "Number of extremal nodes: " << extremal_nodes << std::endl;
} }
blockGSStep.ignoreNodes_ = &ignoreNodes; blockGSStep.ignoreNodes_ = &ignoreNodes;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment